diff --git a/components/checkbox/demo/layout.vue b/components/checkbox/demo/layout.vue index c4e4708d0..9da57ce8e 100644 --- a/components/checkbox/demo/layout.vue +++ b/components/checkbox/demo/layout.vue @@ -1,12 +1,12 @@ + diff --git a/components/grid/demo/basic.vue b/components/grid/demo/basic.vue new file mode 100644 index 000000000..dd6b80617 --- /dev/null +++ b/components/grid/demo/basic.vue @@ -0,0 +1,48 @@ + + + diff --git a/components/grid/demo/complex.vue b/components/grid/demo/complex.vue new file mode 100644 index 000000000..490bbb4c7 --- /dev/null +++ b/components/grid/demo/complex.vue @@ -0,0 +1,34 @@ + + + diff --git a/components/grid/demo/flex-order.vue b/components/grid/demo/flex-order.vue new file mode 100644 index 000000000..2f680b396 --- /dev/null +++ b/components/grid/demo/flex-order.vue @@ -0,0 +1,35 @@ + + + diff --git a/components/grid/demo/flex.vue b/components/grid/demo/flex.vue new file mode 100644 index 000000000..d7deb1566 --- /dev/null +++ b/components/grid/demo/flex.vue @@ -0,0 +1,68 @@ + + + diff --git a/components/grid/demo/flexible.vue b/components/grid/demo/flexible.vue new file mode 100644 index 000000000..96a5c6a01 --- /dev/null +++ b/components/grid/demo/flexible.vue @@ -0,0 +1,34 @@ + + + diff --git a/components/grid/demo/gutter.vue b/components/grid/demo/gutter.vue new file mode 100644 index 000000000..b9ce3d289 --- /dev/null +++ b/components/grid/demo/gutter.vue @@ -0,0 +1,35 @@ + + + diff --git a/components/grid/demo/index.vue b/components/grid/demo/index.vue new file mode 100644 index 000000000..9d25299d3 --- /dev/null +++ b/components/grid/demo/index.vue @@ -0,0 +1,75 @@ + + + diff --git a/components/grid/demo/layout.vue b/components/grid/demo/layout.vue new file mode 100644 index 000000000..58ca44de9 --- /dev/null +++ b/components/grid/demo/layout.vue @@ -0,0 +1,44 @@ + + + diff --git a/components/grid/demo/offset.vue b/components/grid/demo/offset.vue new file mode 100644 index 000000000..293141411 --- /dev/null +++ b/components/grid/demo/offset.vue @@ -0,0 +1,40 @@ + + + diff --git a/components/grid/demo/pull.vue b/components/grid/demo/pull.vue new file mode 100644 index 000000000..1b249d074 --- /dev/null +++ b/components/grid/demo/pull.vue @@ -0,0 +1,33 @@ + + + diff --git a/components/grid/index.js b/components/grid/index.js index 352a384d8..cd65231b0 100644 --- a/components/grid/index.js +++ b/components/grid/index.js @@ -1,7 +1,6 @@ -import Row from './row.vue' -import Col from './col.vue' +import Row from './Row.vue' +import Col from './Col.vue' export default { Col, Row, } - diff --git a/components/index.js b/components/index.js index ca29ac8f5..be9cf66de 100644 --- a/components/index.js +++ b/components/index.js @@ -12,6 +12,6 @@ export { default as Rate } from './rate' export { default as ToolTip } from './tooltip' -export { default as Row } from './grid/row' +export { default as Row } from './grid/Row' -export { default as Col } from './grid/col' +export { default as Col } from './grid/Col' diff --git a/components/switch/Switch.vue b/components/switch/Switch.vue new file mode 100644 index 000000000..3f3a22ab5 --- /dev/null +++ b/components/switch/Switch.vue @@ -0,0 +1,87 @@ + + diff --git a/components/switch/index.js b/components/switch/index.js new file mode 100644 index 000000000..54acb541f --- /dev/null +++ b/components/switch/index.js @@ -0,0 +1,2 @@ +import Switch from './Switch.vue' +export default Switch diff --git a/components/switch/style/index.js b/components/switch/style/index.js new file mode 100644 index 000000000..cf31ed80f --- /dev/null +++ b/components/switch/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less' +import './index.less' diff --git a/components/switch/style/index.less b/components/switch/style/index.less new file mode 100644 index 000000000..8d3bcc552 --- /dev/null +++ b/components/switch/style/index.less @@ -0,0 +1,126 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@switch-prefix-cls: ~"@{ant-prefix}-switch"; +@switch-duration: .36s; + +.@{switch-prefix-cls} { + position: relative; + display: inline-block; + box-sizing: border-box; + height: 22px; + min-width: 44px; + line-height: 20px; + vertical-align: middle; + border-radius: 20px; + border: 1px solid transparent; + background-color: @disabled-color; + cursor: pointer; + transition: all @switch-duration; + user-select: none; + + &-inner { + color: #fff; + font-size: @font-size-base; + margin-left: 24px; + margin-right: 6px; + display: block; + } + + &:after { + position: absolute; + width: 18px; + height: 18px; + left: 1px; + top: 1px; + + border-radius: 18px; + background-color: @component-background; + content: " "; + cursor: pointer; + transition: all @switch-duration @ease-in-out-circ; + } + + &:active:after { + width: 24px; + } + + &:focus { + box-shadow: 0 0 0 2px fade(@primary-color, 20%); + outline: 0; + } + + &:focus:hover { + box-shadow: none; + } + + &-small { + height: 14px; + min-width: 28px; + line-height: 12px; + + .@{switch-prefix-cls}-inner { + margin-left: 18px; + margin-right: 3px; + } + + &:after { + width: 12px; + height: 12px; + top: 0; + left: 0.5px; + } + + &:active:after { + width: 16px; + } + } + + &-small&-checked { + &:after { + left: 100%; + margin-left: -12.5px; + } + + .@{switch-prefix-cls}-inner { + margin-left: 3px; + margin-right: 18px; + } + } + + &-small:active&-checked:after { + margin-left: -16.5px; + } + + &-checked { + background-color: @primary-color; + + .@{switch-prefix-cls}-inner { + margin-left: 6px; + margin-right: 24px; + } + + &:after { + left: 100%; + margin-left: -19px; + } + + &:active:after { + margin-left: -25px; + } + } + + &-disabled { + cursor: not-allowed; + background: #f4f4f4; + + &:after { + background: #ccc; + cursor: not-allowed; + } + + .@{switch-prefix-cls}-inner { + color: @disabled-color; + } + } +} diff --git a/examples/grid.vue b/examples/grid.vue deleted file mode 100644 index a721853b9..000000000 --- a/examples/grid.vue +++ /dev/null @@ -1,98 +0,0 @@ - - -