From cbdc66f989ba644259c596a12b45037154ff828a Mon Sep 17 00:00:00 2001 From: magicianShiro Date: Thu, 26 Jul 2018 23:00:52 +0800 Subject: [PATCH] fix: canlendar year select and select event --- .gitignore | 4 +- components/calendar/Header.jsx | 2 +- components/calendar/index.en-US.md | 2 +- components/calendar/index.jsx | 4 +- components/calendar/index.zh-CN.md | 2 +- es/_util/BaseMixin.js | 27 + es/_util/ContainerRender.js | 98 + es/_util/Dom/addEventListener.js | 5 + es/_util/Dom/class-util.js | 65 + es/_util/Dom/contains.js | 11 + es/_util/KeyCode.js | 517 +++ es/_util/StateMixin.js | 11 + es/_util/antRefDirective.js | 15 + es/_util/callMoment.js | 8 + es/_util/createChainedFunction.js | 22 + es/_util/css-animation/Event.js | 82 + es/_util/css-animation/index.js | 176 + es/_util/getLocale.js | 25 + es/_util/getRequestAnimationFrame.js | 44 + es/_util/getScroll.js | 17 + es/_util/getScrollBarSize.js | 38 + es/_util/getTransitionProps.js | 35 + es/_util/interopDefault.js | 4 + es/_util/isCssAnimationSupported.js | 24 + es/_util/isFlexSupported.js | 8 + es/_util/openAnimation.js | 49 + es/_util/props-util.js | 321 ++ es/_util/requestAnimationTimeout.js | 24 + es/_util/store/PropTypes.js | 7 + es/_util/store/Provider.js | 16 + es/_util/store/connect.js | 91 + es/_util/store/create.js | 31 + es/_util/store/index.js | 5 + es/_util/throttleByAnimationFrame.js | 56 + es/_util/triggerEvent.js | 8 + es/_util/vnode.js | 136 + es/_util/vue-types/index.js | 269 ++ es/_util/vue-types/utils.js | 200 + es/_util/warning.js | 9 + es/affix/index.js | 266 ++ es/affix/style/css.js | 2 + es/affix/style/index.css | 8 + es/affix/style/index.js | 2 + es/affix/style/index.less | 6 + es/alert/index.js | 160 + es/alert/style/css.js | 2 + es/alert/style/index.css | 198 + es/alert/style/index.js | 2 + es/alert/style/index.less | 169 + es/align/Align.js | 129 + es/align/index.js | 3 + es/align/isWindow.js | 5 + es/anchor/Anchor.js | 279 ++ es/anchor/AnchorLink.js | 68 + es/anchor/index.js | 8 + es/anchor/style/css.js | 2 + es/anchor/style/index.css | 84 + es/anchor/style/index.js | 2 + es/anchor/style/index.less | 81 + es/auto-complete/InputElement.js | 100 + es/auto-complete/index.js | 132 + es/auto-complete/style/css.js | 4 + es/auto-complete/style/index.css | 66 + es/auto-complete/style/index.js | 4 + es/auto-complete/style/index.less | 79 + es/avatar/Avatar.js | 126 + es/avatar/index.js | 3 + es/avatar/style/css.js | 2 + es/avatar/style/index.css | 64 + es/avatar/style/index.js | 2 + es/avatar/style/index.less | 50 + es/back-top/index.js | 139 + es/back-top/style/css.js | 2 + es/back-top/style/index.css | 54 + es/back-top/style/index.js | 2 + es/back-top/style/index.less | 40 + es/back-top/style/responsive.less | 11 + es/badge/Badge.js | 116 + es/badge/ScrollNumber.js | 147 + es/badge/index.js | 3 + es/badge/style/css.js | 2 + es/badge/style/index.css | 216 + es/badge/style/index.js | 2 + es/badge/style/index.less | 164 + es/breadcrumb/Breadcrumb.js | 102 + es/breadcrumb/BreadcrumbItem.js | 42 + es/breadcrumb/index.js | 5 + es/breadcrumb/style/css.js | 2 + es/breadcrumb/style/index.css | 40 + es/breadcrumb/style/index.js | 2 + es/breadcrumb/style/index.less | 41 + es/button/button-group.js | 51 + es/button/button.js | 153 + es/button/buttonTypes.js | 14 + es/button/index.js | 5 + es/button/style/css.js | 2 + es/button/style/index.css | 1056 +++++ es/button/style/index.js | 2 + es/button/style/index.less | 195 + es/button/style/mixin.less | 333 ++ es/calendar/Constants.js | 1 + es/calendar/Header.js | 217 + es/calendar/index.js | 267 ++ es/calendar/locale/ar_EG.js | 2 + es/calendar/locale/bg_BG.js | 2 + es/calendar/locale/ca_ES.js | 2 + es/calendar/locale/cs_CZ.js | 2 + es/calendar/locale/de_DE.js | 2 + es/calendar/locale/el_GR.js | 2 + es/calendar/locale/en_GB.js | 2 + es/calendar/locale/en_US.js | 2 + es/calendar/locale/es_ES.js | 2 + es/calendar/locale/et_EE.js | 2 + es/calendar/locale/fa_IR.js | 2 + es/calendar/locale/fi_FI.js | 2 + es/calendar/locale/fr_BE.js | 2 + es/calendar/locale/fr_FR.js | 2 + es/calendar/locale/is_IS.js | 2 + es/calendar/locale/it_IT.js | 2 + es/calendar/locale/ja_JP.js | 2 + es/calendar/locale/ko_KR.js | 2 + es/calendar/locale/ku_IQ.js | 2 + es/calendar/locale/nb_NO.js | 2 + es/calendar/locale/nl_BE.js | 2 + es/calendar/locale/nl_NL.js | 2 + es/calendar/locale/pl_PL.js | 2 + es/calendar/locale/pt_BR.js | 2 + es/calendar/locale/pt_PT.js | 2 + es/calendar/locale/ru_RU.js | 2 + es/calendar/locale/sk_SK.js | 2 + es/calendar/locale/sl_SI.js | 2 + es/calendar/locale/sr_RS.js | 2 + es/calendar/locale/sv_SE.js | 2 + es/calendar/locale/th_TH.js | 2 + es/calendar/locale/tr_TR.js | 2 + es/calendar/locale/uk_UA.js | 2 + es/calendar/locale/vi_VN.js | 2 + es/calendar/locale/zh_CN.js | 2 + es/calendar/locale/zh_TW.js | 2 + es/calendar/style/css.js | 6 + es/calendar/style/index.css | 229 + es/calendar/style/index.js | 6 + es/calendar/style/index.less | 266 ++ es/card/Card.js | 183 + es/card/Grid.js | 27 + es/card/Meta.js | 54 + es/card/index.js | 6 + es/card/style/css.js | 5 + es/card/style/index.css | 295 ++ es/card/style/index.js | 5 + es/card/style/index.less | 257 ++ es/carousel/index.js | 161 + es/carousel/style/css.js | 2 + es/carousel/style/index.css | 209 + es/carousel/style/index.js | 2 + es/carousel/style/index.less | 210 + es/cascader/index.js | 438 ++ es/cascader/style/css.js | 5 + es/cascader/style/index.css | 236 + es/cascader/style/index.js | 5 + es/cascader/style/index.less | 214 + es/checkbox/Checkbox.js | 176 + es/checkbox/Group.js | 142 + es/checkbox/index.js | 5 + es/checkbox/style/css.js | 2 + es/checkbox/style/index.css | 213 + es/checkbox/style/index.js | 2 + es/checkbox/style/index.less | 4 + es/checkbox/style/mixin.less | 193 + es/col/index.js | 3 + es/col/style/css.js | 2 + es/col/style/index.js | 2 + es/collapse/Collapse.js | 40 + es/collapse/CollapsePanel.js | 41 + es/collapse/index.js | 5 + es/collapse/src/Collapse.js | 145 + es/collapse/src/Panel.js | 79 + es/collapse/src/PanelContent.js | 48 + es/collapse/src/commonProps.js | 22 + es/collapse/src/index.js | 6 + es/collapse/src/openAnimationFactory.js | 35 + es/collapse/style/css.js | 2 + es/collapse/style/index.css | 118 + es/collapse/style/index.js | 2 + es/collapse/style/index.less | 128 + es/date-picker/RangePicker.js | 409 ++ es/date-picker/WeekPicker.js | 184 + es/date-picker/createPicker.js | 222 + es/date-picker/index.js | 20 + es/date-picker/interface.js | 106 + es/date-picker/locale/ar_EG.js | 16 + es/date-picker/locale/bg_BG.js | 17 + es/date-picker/locale/ca_ES.js | 17 + es/date-picker/locale/cs_CZ.js | 17 + es/date-picker/locale/de_DE.js | 15 + es/date-picker/locale/el_GR.js | 15 + es/date-picker/locale/en_GB.js | 17 + es/date-picker/locale/en_US.js | 17 + es/date-picker/locale/es_ES.js | 17 + es/date-picker/locale/et_EE.js | 17 + es/date-picker/locale/fa_IR.js | 17 + es/date-picker/locale/fi_FI.js | 17 + es/date-picker/locale/fr_BE.js | 15 + es/date-picker/locale/fr_FR.js | 15 + es/date-picker/locale/is_IS.js | 17 + es/date-picker/locale/it_IT.js | 15 + es/date-picker/locale/ja_JP.js | 16 + es/date-picker/locale/ko_KR.js | 17 + es/date-picker/locale/ku_IQ.js | 16 + es/date-picker/locale/nb_NO.js | 17 + es/date-picker/locale/nl_BE.js | 15 + es/date-picker/locale/nl_NL.js | 15 + es/date-picker/locale/pl_PL.js | 17 + es/date-picker/locale/pt_BR.js | 17 + es/date-picker/locale/pt_PT.js | 45 + es/date-picker/locale/ru_RU.js | 20 + es/date-picker/locale/sk_SK.js | 17 + es/date-picker/locale/sl_SI.js | 41 + es/date-picker/locale/sr_RS.js | 17 + es/date-picker/locale/sv_SE.js | 16 + es/date-picker/locale/th_TH.js | 17 + es/date-picker/locale/tr_TR.js | 17 + es/date-picker/locale/uk_UA.js | 16 + es/date-picker/locale/vi_VN.js | 17 + es/date-picker/locale/zh_CN.js | 19 + es/date-picker/locale/zh_TW.js | 19 + es/date-picker/style/Calendar.less | 336 ++ es/date-picker/style/DecadePanel.less | 71 + es/date-picker/style/MonthPanel.less | 75 + es/date-picker/style/MonthPicker.less | 11 + es/date-picker/style/Picker.less | 100 + es/date-picker/style/RangePicker.less | 222 + es/date-picker/style/TimePicker.less | 148 + es/date-picker/style/WeekPicker.less | 21 + es/date-picker/style/YearPanel.less | 74 + es/date-picker/style/css.js | 6 + es/date-picker/style/index.css | 1452 +++++++ es/date-picker/style/index.js | 6 + es/date-picker/style/index.less | 17 + es/date-picker/wrapPicker.js | 154 + es/divider/index.js | 44 + es/divider/style/css.js | 2 + es/divider/style/index.css | 141 + es/divider/style/index.js | 2 + es/divider/style/index.less | 129 + es/dropdown/dropdown-button.js | 102 + es/dropdown/dropdown.js | 87 + es/dropdown/getDropdownProps.js | 15 + es/dropdown/index.js | 8 + es/dropdown/src/Dropdown.js | 159 + es/dropdown/src/index.js | 2 + es/dropdown/src/placements.js | 47 + es/dropdown/style/css.js | 5 + es/dropdown/style/index.css | 285 ++ es/dropdown/style/index.js | 5 + es/dropdown/style/index.less | 251 ++ es/form/Form.js | 248 ++ es/form/FormItem.js | 367 ++ es/form/constants.js | 2 + es/form/index.js | 10 + es/form/style/css.js | 5 + es/form/style/index.css | 758 ++++ es/form/style/index.js | 5 + es/form/style/index.less | 624 +++ es/form/style/mixin.less | 106 + es/grid/Col.js | 78 + es/grid/Row.js | 155 + es/grid/index.js | 4 + es/grid/style/css.js | 2 + es/grid/style/index.css | 3855 +++++++++++++++++ es/grid/style/index.js | 2 + es/grid/style/index.less | 116 + es/grid/style/mixin.less | 101 + es/icon/icon.js | 69 + es/icon/index.js | 2 + es/icon/style/css.js | 1 + es/icon/style/index.js | 1 + es/index.js | 131 + es/input-number/index.js | 65 + es/input-number/style/css.js | 2 + es/input-number/style/index.css | 261 ++ es/input-number/style/index.js | 2 + es/input-number/style/index.less | 171 + es/input/Group.js | 39 + es/input/Input.js | 210 + es/input/Search.js | 120 + es/input/TextArea.js | 150 + es/input/calculateNodeHeight.js | 122 + es/input/index.js | 9 + es/input/inputProps.js | 37 + es/input/style/css.js | 2 + es/input/style/index.css | 348 ++ es/input/style/index.js | 2 + es/input/style/index.less | 33 + es/input/style/mixin.less | 350 ++ es/input/style/search-input.less | 33 + es/layout/Sider.js | 258 ++ es/layout/index.js | 5 + es/layout/layout.js | 121 + es/layout/style/css.js | 2 + es/layout/style/index.css | 118 + es/layout/style/index.js | 2 + es/layout/style/index.less | 112 + es/list/Item.js | 163 + es/list/index.js | 267 ++ es/list/style/bordered.less | 41 + es/list/style/css.js | 7 + es/list/style/index.css | 308 ++ es/list/style/index.js | 7 + es/list/style/index.less | 207 + es/list/style/responsive.less | 42 + es/locale-provider/LocaleReceiver.js | 41 + es/locale-provider/ar_EG.js | 44 + es/locale-provider/bg_BG.js | 44 + es/locale-provider/ca_ES.js | 36 + es/locale-provider/cs_CZ.js | 42 + es/locale-provider/de_DE.js | 44 + es/locale-provider/default.js | 45 + es/locale-provider/el_GR.js | 44 + es/locale-provider/en_GB.js | 44 + es/locale-provider/en_US.js | 3 + es/locale-provider/es_ES.js | 44 + es/locale-provider/et_EE.js | 44 + es/locale-provider/fa_IR.js | 44 + es/locale-provider/fi_FI.js | 44 + es/locale-provider/fr_BE.js | 36 + es/locale-provider/fr_FR.js | 36 + es/locale-provider/index.js | 73 + es/locale-provider/is_IS.js | 44 + es/locale-provider/it_IT.js | 44 + es/locale-provider/ja_JP.js | 44 + es/locale-provider/ko_KR.js | 42 + es/locale-provider/ku_IQ.js | 44 + es/locale-provider/nb_NO.js | 44 + es/locale-provider/nl_BE.js | 44 + es/locale-provider/nl_NL.js | 44 + es/locale-provider/pl_PL.js | 44 + es/locale-provider/pt_BR.js | 44 + es/locale-provider/pt_PT.js | 44 + es/locale-provider/ru_RU.js | 44 + es/locale-provider/sk_SK.js | 44 + es/locale-provider/sl_SI.js | 44 + es/locale-provider/sr_RS.js | 44 + es/locale-provider/style/css.js | 1 + es/locale-provider/style/index.css | 4 + es/locale-provider/style/index.js | 1 + es/locale-provider/style/index.less | 2 + es/locale-provider/sv_SE.js | 36 + es/locale-provider/th_TH.js | 44 + es/locale-provider/tr_TR.js | 44 + es/locale-provider/uk_UA.js | 44 + es/locale-provider/vi_VN.js | 44 + es/locale-provider/zh_CN.js | 44 + es/locale-provider/zh_TW.js | 44 + es/menu/MenuItem.js | 62 + es/menu/index.js | 269 ++ es/menu/style/css.js | 5 + es/menu/style/dark.less | 118 + es/menu/style/index.css | 678 +++ es/menu/style/index.js | 5 + es/menu/style/index.less | 462 ++ es/message/index.js | 133 + es/message/style/css.js | 2 + es/message/style/index.css | 87 + es/message/style/index.js | 2 + es/message/style/index.less | 74 + es/modal/ActionButton.js | 86 + es/modal/ConfirmDialog.js | 97 + es/modal/Modal.js | 170 + es/modal/confirm.js | 54 + es/modal/index.js | 59 + es/modal/locale.js | 22 + es/modal/style/confirm.less | 74 + es/modal/style/css.js | 5 + es/modal/style/index.css | 211 + es/modal/style/index.js | 5 + es/modal/style/index.less | 4 + es/modal/style/modal.less | 147 + es/notification/index.js | 222 + es/notification/style/css.js | 2 + es/notification/style/index.css | 235 + es/notification/style/index.js | 2 + es/notification/style/index.less | 199 + es/pagination/MiniSelect.js | 25 + es/pagination/Pagination.js | 81 + es/pagination/index.js | 4 + es/pagination/style/css.js | 2 + es/pagination/style/index.css | 396 ++ es/pagination/style/index.js | 2 + es/pagination/style/index.less | 353 ++ es/popconfirm/index.js | 139 + es/popconfirm/style/css.js | 5 + es/popconfirm/style/index.js | 5 + es/popover/index.js | 58 + es/popover/style/css.js | 2 + es/popover/style/index.css | 183 + es/popover/style/index.js | 2 + es/popover/style/index.less | 178 + es/progress/index.js | 5 + es/progress/progress.js | 154 + es/progress/style/css.js | 2 + es/progress/style/index.css | 166 + es/progress/style/index.js | 2 + es/progress/style/index.less | 167 + es/radio/Group.js | 120 + es/radio/Radio.js | 160 + es/radio/index.js | 18 + es/radio/style/css.js | 2 + es/radio/style/index.css | 290 ++ es/radio/style/index.js | 2 + es/radio/style/index.less | 281 ++ es/rate/index.js | 65 + es/rate/style/css.js | 2 + es/rate/style/index.css | 77 + es/rate/style/index.js | 2 + es/rate/style/index.less | 71 + es/row/index.js | 2 + es/row/style/css.js | 2 + es/row/style/index.js | 2 + es/select/index.js | 178 + es/select/style/css.js | 5 + es/select/style/index.css | 579 +++ es/select/style/index.js | 5 + es/select/style/index.less | 571 +++ es/slider/index.js | 151 + es/slider/style/css.js | 5 + es/slider/style/index.css | 172 + es/slider/style/index.js | 5 + es/slider/style/index.less | 188 + es/spin/Spin.js | 173 + es/spin/index.js | 4 + es/spin/style/css.js | 2 + es/spin/style/index.css | 219 + es/spin/style/index.js | 2 + es/spin/style/index.less | 207 + es/steps/index.js | 45 + es/steps/style/css.js | 2 + es/steps/style/custom-icon.less | 21 + es/steps/style/index.css | 477 ++ es/steps/style/index.js | 2 + es/steps/style/index.less | 187 + es/steps/style/label-placement.less | 28 + es/steps/style/progress-dot.less | 75 + es/steps/style/small.less | 45 + es/steps/style/vertical.less | 67 + es/style.js | 51 + es/style/color/bezierEasing.less | 111 + es/style/color/colorPalette.less | 75 + es/style/color/colors.less | 146 + es/style/color/tinyColor.less | 1184 +++++ es/style/core/base.less | 502 +++ es/style/core/iconfont.less | 340 ++ es/style/core/index.less | 4 + es/style/core/motion.less | 15 + es/style/core/motion/fade.less | 31 + es/style/core/motion/move.less | 120 + es/style/core/motion/other.less | 10 + es/style/core/motion/slide.less | 120 + es/style/core/motion/swing.less | 33 + es/style/core/motion/zoom.less | 160 + es/style/css.js | 1 + es/style/index.css | 2958 +++++++++++++ es/style/index.js | 1 + es/style/index.less | 2 + es/style/mixins/clearfix.less | 16 + es/style/mixins/compatibility.less | 18 + es/style/mixins/iconfont.less | 37 + es/style/mixins/index.less | 8 + es/style/mixins/motion.less | 33 + es/style/mixins/reset.less | 12 + es/style/mixins/size.less | 10 + es/style/themes/default.less | 463 ++ es/style/v2-compatible-reset.css | 45 + es/style/v2-compatible-reset.js | 1 + es/style/v2-compatible-reset.less | 14 + es/switch/index.js | 71 + es/switch/style/css.js | 2 + es/switch/style/index.css | 173 + es/switch/style/index.js | 2 + es/switch/style/index.less | 165 + es/table/Column.js | 6 + es/table/ColumnGroup.js | 10 + es/table/FilterDropdownMenuWrapper.js | 23 + es/table/SelectionBox.js | 80 + es/table/SelectionCheckboxAll.js | 205 + es/table/Table.js | 1034 +++++ es/table/createBodyRow.js | 69 + es/table/createStore.js | 11 + es/table/filterDropdown.js | 268 ++ es/table/index.js | 123 + es/table/interface.js | 196 + es/table/style/css.js | 9 + es/table/style/index.css | 654 +++ es/table/style/index.js | 9 + es/table/style/index.less | 593 +++ es/table/style/size.less | 109 + es/table/util.js | 70 + es/tabs/index.js | 8 + es/tabs/style/card-style.less | 148 + es/tabs/style/css.js | 2 + es/tabs/style/index.css | 555 +++ es/tabs/style/index.js | 2 + es/tabs/style/index.less | 414 ++ es/tabs/tabs.js | 183 + es/tag/CheckableTag.js | 48 + es/tag/Tag.js | 102 + es/tag/index.js | 5 + es/tag/style/css.js | 2 + es/tag/style/index.css | 237 + es/tag/style/index.js | 2 + es/tag/style/index.less | 119 + es/time-picker/index.js | 183 + es/time-picker/locale/ar_EG.js | 5 + es/time-picker/locale/bg_BG.js | 5 + es/time-picker/locale/ca_ES.js | 5 + es/time-picker/locale/cs_CZ.js | 5 + es/time-picker/locale/de_DE.js | 5 + es/time-picker/locale/el_GR.js | 5 + es/time-picker/locale/en_GB.js | 5 + es/time-picker/locale/en_US.js | 5 + es/time-picker/locale/es_ES.js | 5 + es/time-picker/locale/et_EE.js | 5 + es/time-picker/locale/fa_IR.js | 5 + es/time-picker/locale/fi_FI.js | 5 + es/time-picker/locale/fr_BE.js | 5 + es/time-picker/locale/fr_FR.js | 5 + es/time-picker/locale/is_IS.js | 5 + es/time-picker/locale/it_IT.js | 5 + es/time-picker/locale/ja_JP.js | 5 + es/time-picker/locale/ko_KR.js | 5 + es/time-picker/locale/ku_IQ.js | 5 + es/time-picker/locale/nb_NO.js | 5 + es/time-picker/locale/nl_BE.js | 5 + es/time-picker/locale/nl_NL.js | 5 + es/time-picker/locale/pl_PL.js | 5 + es/time-picker/locale/pt_BR.js | 5 + es/time-picker/locale/pt_PT.js | 5 + es/time-picker/locale/ru_RU.js | 8 + es/time-picker/locale/sk_SK.js | 5 + es/time-picker/locale/sl_SI.js | 5 + es/time-picker/locale/sr_RS.js | 5 + es/time-picker/locale/sv_SE.js | 5 + es/time-picker/locale/th_TH.js | 5 + es/time-picker/locale/tr_TR.js | 5 + es/time-picker/locale/uk_UA.js | 5 + es/time-picker/locale/vi_VN.js | 5 + es/time-picker/locale/zh_CN.js | 5 + es/time-picker/locale/zh_TW.js | 5 + es/time-picker/style/css.js | 5 + es/time-picker/style/index.css | 325 ++ es/time-picker/style/index.js | 5 + es/time-picker/style/index.less | 234 + es/timeline/Timeline.js | 69 + es/timeline/TimelineItem.js | 59 + es/timeline/index.js | 9 + es/timeline/style/css.js | 2 + es/timeline/style/index.css | 86 + es/timeline/style/index.js | 2 + es/timeline/style/index.less | 93 + es/tooltip/Tooltip.js | 196 + es/tooltip/abstractTooltipProps.js | 20 + es/tooltip/index.js | 2 + es/tooltip/placements.js | 92 + es/tooltip/style/css.js | 2 + es/tooltip/style/index.css | 129 + es/tooltip/style/index.js | 2 + es/tooltip/style/index.less | 144 + es/transfer/index.js | 429 ++ es/transfer/item.js | 76 + es/transfer/list.js | 309 ++ es/transfer/operation.js | 68 + es/transfer/search.js | 68 + es/transfer/style/css.js | 7 + es/transfer/style/index.css | 194 + es/transfer/style/index.js | 7 + es/transfer/style/index.less | 174 + es/tree-select/index.js | 125 + es/tree-select/interface.js | 39 + es/tree-select/style/css.js | 6 + es/tree-select/style/index.css | 397 ++ es/tree-select/style/index.js | 6 + es/tree-select/style/index.less | 145 + es/tree/index.js | 195 + es/tree/style/css.js | 5 + es/tree/style/index.css | 493 +++ es/tree/style/index.js | 5 + es/tree/style/index.less | 203 + es/tree/style/mixin.less | 27 + es/trigger/LazyRenderBox.js | 30 + es/trigger/Popup.js | 259 ++ es/trigger/PopupInner.js | 35 + es/trigger/Trigger.js | 560 +++ es/trigger/assets/index.less | 70 + es/trigger/assets/mask.less | 63 + es/trigger/index.js | 3 + es/trigger/utils.js | 22 + es/upload/Dragger.js | 26 + es/upload/Upload.js | 297 ++ es/upload/UploadList.js | 275 ++ es/upload/index.js | 8 + es/upload/interface.js | 103 + es/upload/style/css.js | 6 + es/upload/style/index.css | 492 +++ es/upload/style/index.js | 6 + es/upload/style/index.less | 459 ++ es/upload/utils.js | 61 + es/vc-calendar/assets/common/Calendar.less | 106 + .../assets/common/FullCalendar.less | 91 + es/vc-calendar/assets/common/Picker.less | 10 + .../assets/common/RangeCalendar.less | 132 + es/vc-calendar/assets/common/index.less | 16 + es/vc-calendar/assets/index.less | 10 + es/vc-calendar/assets/index/Calendar.less | 291 ++ es/vc-calendar/assets/index/DecadePanel.less | 115 + es/vc-calendar/assets/index/Input.less | 22 + es/vc-calendar/assets/index/MonthPanel.less | 135 + es/vc-calendar/assets/index/Picker.less | 110 + es/vc-calendar/assets/index/Time.less | 6 + es/vc-calendar/assets/index/TimePanel.less | 74 + es/vc-calendar/assets/index/YearPanel.less | 125 + es/vc-calendar/index.js | 2 + es/vc-calendar/src/Calendar.js | 370 ++ es/vc-calendar/src/FullCalendar.js | 160 + es/vc-calendar/src/MonthCalendar.js | 137 + es/vc-calendar/src/Picker.js | 228 + es/vc-calendar/src/RangeCalendar.js | 663 +++ es/vc-calendar/src/calendar/CalendarFooter.js | 95 + es/vc-calendar/src/calendar/CalendarHeader.js | 257 ++ es/vc-calendar/src/calendar/OkButton.js | 30 + .../src/calendar/TimePickerButton.js | 36 + es/vc-calendar/src/calendar/TodayButton.js | 40 + es/vc-calendar/src/date/DateConstants.js | 4 + es/vc-calendar/src/date/DateInput.js | 163 + es/vc-calendar/src/date/DateTBody.js | 266 ++ es/vc-calendar/src/date/DateTHead.js | 67 + es/vc-calendar/src/date/DateTable.js | 25 + es/vc-calendar/src/decade/DecadePanel.js | 159 + .../src/full-calendar/CalendarHeader.js | 167 + es/vc-calendar/src/index.js | 3 + es/vc-calendar/src/locale/ar_EG.js | 27 + es/vc-calendar/src/locale/bg_BG.js | 27 + es/vc-calendar/src/locale/ca_ES.js | 27 + es/vc-calendar/src/locale/cs_CZ.js | 27 + es/vc-calendar/src/locale/da_DK.js | 27 + es/vc-calendar/src/locale/de_DE.js | 27 + es/vc-calendar/src/locale/el_GR.js | 27 + es/vc-calendar/src/locale/en_GB.js | 27 + es/vc-calendar/src/locale/en_US.js | 27 + es/vc-calendar/src/locale/es_ES.js | 27 + es/vc-calendar/src/locale/et_EE.js | 27 + es/vc-calendar/src/locale/fa_IR.js | 27 + es/vc-calendar/src/locale/fi_FI.js | 27 + es/vc-calendar/src/locale/fr_BE.js | 27 + es/vc-calendar/src/locale/fr_FR.js | 27 + es/vc-calendar/src/locale/hu_HU.js | 27 + es/vc-calendar/src/locale/is_IS.js | 27 + es/vc-calendar/src/locale/it_IT.js | 27 + es/vc-calendar/src/locale/ja_JP.js | 26 + es/vc-calendar/src/locale/ko_KR.js | 27 + es/vc-calendar/src/locale/ku_IQ.js | 27 + es/vc-calendar/src/locale/nb_NO.js | 27 + es/vc-calendar/src/locale/nl_BE.js | 27 + es/vc-calendar/src/locale/nl_NL.js | 27 + es/vc-calendar/src/locale/pl_PL.js | 27 + es/vc-calendar/src/locale/pt_BR.js | 27 + es/vc-calendar/src/locale/pt_PT.js | 27 + es/vc-calendar/src/locale/ru_RU.js | 27 + es/vc-calendar/src/locale/sk_SK.js | 27 + es/vc-calendar/src/locale/sl_SI.js | 27 + es/vc-calendar/src/locale/sr_RS.js | 27 + es/vc-calendar/src/locale/sv_SE.js | 27 + es/vc-calendar/src/locale/th_TH.js | 27 + es/vc-calendar/src/locale/tr_TR.js | 27 + es/vc-calendar/src/locale/ug_CN.js | 26 + es/vc-calendar/src/locale/uk_UA.js | 27 + es/vc-calendar/src/locale/zh_CN.js | 26 + es/vc-calendar/src/locale/zh_TW.js | 26 + es/vc-calendar/src/mixin/CalendarMixin.js | 120 + es/vc-calendar/src/mixin/CommonMixin.js | 42 + es/vc-calendar/src/month/MonthPanel.js | 147 + es/vc-calendar/src/month/MonthTable.js | 155 + es/vc-calendar/src/picker/placements.js | 35 + .../src/range-calendar/CalendarPart.js | 167 + es/vc-calendar/src/util/index.js | 89 + es/vc-calendar/src/year/YearPanel.js | 186 + es/vc-cascader/Cascader.js | 343 ++ es/vc-cascader/Menus.js | 170 + es/vc-cascader/assets/index.less | 167 + es/vc-cascader/index.js | 3 + es/vc-checkbox/index.js | 1 + es/vc-checkbox/src/Checkbox.js | 138 + es/vc-checkbox/src/index.js | 3 + es/vc-dialog/Dialog.js | 455 ++ es/vc-dialog/DialogWrap.js | 97 + es/vc-dialog/IDialogPropTypes.js | 40 + es/vc-dialog/LazyRenderBox.js | 16 + es/vc-dialog/assets/bootstrap.less | 3 + es/vc-dialog/assets/bootstrap/Dialog.less | 133 + es/vc-dialog/assets/bootstrap/effect.less | 42 + es/vc-dialog/assets/bootstrap/variables.less | 869 ++++ es/vc-dialog/assets/index.less | 4 + es/vc-dialog/assets/index/Dialog.less | 134 + es/vc-dialog/assets/index/Mask.less | 63 + es/vc-dialog/index.js | 3 + es/vc-form/demo/async-init.js | 157 + es/vc-form/demo/dynamic-fields.js | 215 + es/vc-form/demo/dynamic.js | 151 + es/vc-form/demo/file-input.js | 97 + es/vc-form/demo/getFieldDecorator.js | 61 + es/vc-form/demo/input-array.js | 95 + es/vc-form/demo/modal.js | 115 + es/vc-form/demo/nested-field.js | 195 + es/vc-form/demo/normalize.js | 231 + es/vc-form/demo/overview.js | 325 ++ es/vc-form/demo/parallel-form.js | 96 + es/vc-form/demo/start-end-date.js | 102 + es/vc-form/demo/styles.js | 11 + es/vc-form/demo/suggest.js | 142 + es/vc-form/demo/validateFirst.js | 152 + es/vc-form/demo/validateTrigger.js | 128 + es/vc-form/index.js | 3 + es/vc-form/src/createBaseForm.js | 575 +++ es/vc-form/src/createDOMForm.js | 125 + es/vc-form/src/createFieldsStore.js | 300 ++ es/vc-form/src/createForm.js | 34 + es/vc-form/src/createFormField.js | 19 + es/vc-form/src/index.js | 9 + es/vc-form/src/propTypes.js | 24 + es/vc-form/src/utils.js | 154 + es/vc-input-number/assets/index.less | 115 + .../demo/combination-key-format.js | 80 + es/vc-input-number/demo/custom.js | 59 + es/vc-input-number/demo/precision.js | 52 + es/vc-input-number/demo/simple-use-touch.js | 68 + es/vc-input-number/demo/simple.js | 67 + es/vc-input-number/demo/small-step.js | 43 + es/vc-input-number/src/InputHandler.js | 37 + es/vc-input-number/src/index.js | 654 +++ es/vc-lazy-load/demo/index.js | 49 + es/vc-lazy-load/demo/style.less | 18 + es/vc-lazy-load/index.js | 3 + es/vc-lazy-load/src/LazyLoad.js | 171 + .../src/utils/getElementPosition.js | 12 + es/vc-lazy-load/src/utils/inViewport.js | 34 + es/vc-lazy-load/src/utils/parentScroll.js | 40 + es/vc-m-feedback/demo/simple.js | 32 + es/vc-m-feedback/demo/simple.less | 7 + es/vc-m-feedback/index.js | 3 + es/vc-m-feedback/src/PropTypes.js | 13 + es/vc-m-feedback/src/TouchFeedback.js | 109 + es/vc-menu/DOMWrap.js | 46 + es/vc-menu/Divider.js | 17 + es/vc-menu/Menu.js | 185 + es/vc-menu/MenuItem.js | 158 + es/vc-menu/MenuItemGroup.js | 54 + es/vc-menu/MenuMixin.js | 268 ++ es/vc-menu/SubMenu.js | 527 +++ es/vc-menu/SubPopupMenu.js | 55 + es/vc-menu/assets/index.less | 298 ++ es/vc-menu/commonPropsType.js | 26 + es/vc-menu/index.js | 9 + es/vc-menu/placements.js | 29 + es/vc-menu/util.js | 46 + es/vc-notification/Notice.js | 83 + es/vc-notification/Notification.js | 169 + es/vc-notification/index.js | 2 + es/vc-pagination/KeyCode.js | 14 + es/vc-pagination/Options.js | 166 + es/vc-pagination/Pager.js | 65 + es/vc-pagination/Pagination.js | 628 +++ es/vc-pagination/assets/index.less | 288 ++ es/vc-pagination/index.js | 1 + es/vc-pagination/locale/ar_EG.js | 15 + es/vc-pagination/locale/bg_BG.js | 15 + es/vc-pagination/locale/ca_ES.js | 15 + es/vc-pagination/locale/cs_CZ.js | 15 + es/vc-pagination/locale/da_DK.js | 15 + es/vc-pagination/locale/de_DE.js | 15 + es/vc-pagination/locale/el_GR.js | 15 + es/vc-pagination/locale/en_GB.js | 15 + es/vc-pagination/locale/en_US.js | 15 + es/vc-pagination/locale/es_ES.js | 15 + es/vc-pagination/locale/et_EE.js | 15 + es/vc-pagination/locale/fa_IR.js | 15 + es/vc-pagination/locale/fi_FI.js | 15 + es/vc-pagination/locale/fr_BE.js | 15 + es/vc-pagination/locale/fr_FR.js | 15 + es/vc-pagination/locale/hu_HU.js | 15 + es/vc-pagination/locale/id_ID.js | 15 + es/vc-pagination/locale/is_IS.js | 15 + es/vc-pagination/locale/it_IT.js | 15 + es/vc-pagination/locale/ja_JP.js | 15 + es/vc-pagination/locale/ko_KR.js | 15 + es/vc-pagination/locale/ku_IQ.js | 15 + es/vc-pagination/locale/nb_NO.js | 14 + es/vc-pagination/locale/nl_BE.js | 15 + es/vc-pagination/locale/nl_NL.js | 15 + es/vc-pagination/locale/pl_PL.js | 15 + es/vc-pagination/locale/pt_BR.js | 15 + es/vc-pagination/locale/pt_PT.js | 15 + es/vc-pagination/locale/ru_RU.js | 15 + es/vc-pagination/locale/sk_SK.js | 15 + es/vc-pagination/locale/sl_SI.js | 15 + es/vc-pagination/locale/sr_RS.js | 14 + es/vc-pagination/locale/sv_SE.js | 15 + es/vc-pagination/locale/th_TH.js | 15 + es/vc-pagination/locale/tr_TR.js | 15 + es/vc-pagination/locale/ug_CN.js | 14 + es/vc-pagination/locale/uk_UA.js | 15 + es/vc-pagination/locale/vi_VN.js | 15 + es/vc-pagination/locale/zh_CN.js | 15 + es/vc-pagination/locale/zh_TW.js | 15 + es/vc-progress/assets/index.less | 0 es/vc-progress/demo/fast-progress.js | 59 + es/vc-progress/demo/gap.js | 89 + es/vc-progress/demo/simple.js | 58 + es/vc-progress/index.js | 5 + es/vc-progress/src/Circle.js | 123 + es/vc-progress/src/Line.js | 69 + es/vc-progress/src/enhancer.js | 23 + es/vc-progress/src/index.js | 9 + es/vc-progress/src/types.js | 25 + es/vc-rate/assets/index.less | 96 + es/vc-rate/demo/simple.js | 84 + es/vc-rate/index.js | 3 + es/vc-rate/src/Rate.js | 237 + es/vc-rate/src/Star.js | 83 + es/vc-rate/src/index.js | 2 + es/vc-rate/src/util.js | 39 + es/vc-select/DropdownMenu.js | 185 + es/vc-select/OptGroup.js | 8 + es/vc-select/Option.js | 11 + es/vc-select/PropTypes.js | 44 + es/vc-select/Select.js | 1646 +++++++ es/vc-select/SelectTrigger.js | 216 + es/vc-select/assets/index.less | 503 +++ es/vc-select/demo/tbFetchSuggest.js | 36 + es/vc-select/index.js | 9 + es/vc-select/util.js | 177 + es/vc-slick/assets/docs.less | 116 + es/vc-slick/assets/fonts/slick.svg | 14 + es/vc-slick/assets/index.less | 3 + es/vc-slick/assets/slick-theme.less | 204 + es/vc-slick/assets/slick.less | 119 + es/vc-slick/demo/AdaptiveHeight.js | 24 + es/vc-slick/demo/AppendDots.js | 57 + es/vc-slick/demo/AsNavFor.js | 41 + es/vc-slick/demo/AutoPlay.js | 26 + es/vc-slick/demo/AutoPlayMethods.js | 51 + es/vc-slick/demo/CenterMode.js | 24 + es/vc-slick/demo/CustomArrows.js | 49 + es/vc-slick/demo/CustomPaging.js | 48 + es/vc-slick/demo/CustomSlides.js | 44 + es/vc-slick/demo/DynamicSlides.js | 47 + es/vc-slick/demo/Fade.js | 39 + es/vc-slick/demo/FocusOnSelect.js | 23 + es/vc-slick/demo/LazyLoad.js | 40 + es/vc-slick/demo/MultipleItems.js | 23 + es/vc-slick/demo/MultipleRows.js | 30 + es/vc-slick/demo/PauseOnHover.js | 25 + es/vc-slick/demo/PreviousNextMethods.js | 74 + es/vc-slick/demo/Resizable.js | 73 + es/vc-slick/demo/Responsive.js | 46 + es/vc-slick/demo/Rtl.js | 25 + es/vc-slick/demo/SimpleSlider.js | 37 + es/vc-slick/demo/SlickGoTo.js | 67 + es/vc-slick/demo/SlideChangeHooks.js | 37 + es/vc-slick/demo/SwipeToSlide.js | 26 + es/vc-slick/demo/UnevenSetsFinite.js | 23 + es/vc-slick/demo/UnevenSetsInfinite.js | 23 + es/vc-slick/demo/VariableWidth.js | 49 + es/vc-slick/demo/VerticalMode.js | 30 + es/vc-slick/demo/VerticalSwipeToSlide.js | 31 + es/vc-slick/demo/config.js | 1 + es/vc-slick/demo/imglist.js | 11 + es/vc-slick/demo/index.js | 41 + es/vc-slick/src/arrows.js | 147 + es/vc-slick/src/default-props.js | 56 + es/vc-slick/src/dots.js | 83 + es/vc-slick/src/index.js | 3 + es/vc-slick/src/initial-state.js | 26 + es/vc-slick/src/inner-slider.js | 771 ++++ es/vc-slick/src/slider.js | 219 + es/vc-slick/src/track.js | 201 + es/vc-slick/src/utils/innerSliderUtils.js | 734 ++++ es/vc-slider/assets/index.less | 302 ++ es/vc-slider/demo/handle.js | 139 + es/vc-slider/demo/marks.js | 101 + es/vc-slider/demo/range.js | 333 ++ es/vc-slider/demo/slider.js | 333 ++ es/vc-slider/demo/vertical.js | 106 + es/vc-slider/index.js | 3 + es/vc-slider/src/Handle.js | 112 + es/vc-slider/src/Range.js | 443 ++ es/vc-slider/src/Slider.js | 212 + es/vc-slider/src/common/Marks.js | 78 + es/vc-slider/src/common/Steps.js | 61 + es/vc-slider/src/common/Track.js | 30 + es/vc-slider/src/common/createSlider.js | 374 ++ es/vc-slider/src/createSliderWithTooltip.js | 108 + es/vc-slider/src/index.js | 10 + es/vc-slider/src/utils.js | 136 + es/vc-steps/Step.js | 139 + es/vc-steps/Steps.js | 150 + es/vc-steps/assets/custom-icon.less | 21 + es/vc-steps/assets/iconfont.less | 203 + es/vc-steps/assets/index.less | 168 + es/vc-steps/assets/label-placement.less | 30 + es/vc-steps/assets/progress-dot.less | 39 + es/vc-steps/assets/small.less | 55 + es/vc-steps/assets/variables.less | 19 + es/vc-steps/assets/vertical.less | 53 + es/vc-steps/index.js | 8 + es/vc-switch/PropTypes.js | 15 + es/vc-switch/Switch.js | 129 + es/vc-switch/assets/index.less | 115 + es/vc-switch/index.js | 3 + es/vc-table/assets/animation.less | 59 + es/vc-table/assets/bordered.less | 11 + es/vc-table/assets/index.less | 227 + es/vc-table/demo/childrenIndent.js | 97 + es/vc-table/demo/className.js | 48 + es/vc-table/demo/colspan-rowspan.js | 112 + es/vc-table/demo/column-resize.js | 104 + es/vc-table/demo/dropdown.js | 132 + es/vc-table/demo/expandedRowRender.js | 137 + es/vc-table/demo/fixedColumns-auto-height.js | 51 + es/vc-table/demo/fixedColumns.js | 32 + es/vc-table/demo/fixedColumnsAndHeader.js | 16 + .../fixedColumnsAndHeaderSyncRowHeight.js | 16 + es/vc-table/demo/grouping-columns.js | 82 + es/vc-table/demo/jsx.js | 65 + es/vc-table/demo/key.js | 58 + es/vc-table/demo/nested.js | 40 + es/vc-table/demo/no-data.js | 28 + es/vc-table/demo/rowAndCellClick.js | 115 + es/vc-table/demo/scrollX.js | 16 + es/vc-table/demo/scrollXY.js | 22 + es/vc-table/demo/scrollY.js | 70 + es/vc-table/demo/styled-components.js | 46 + es/vc-table/demo/subTable.js | 63 + es/vc-table/demo/title-and-footer.js | 37 + es/vc-table/index.js | 72 + es/vc-table/src/BaseTable.js | 197 + es/vc-table/src/BodyTable.js | 137 + es/vc-table/src/ColGroup.js | 48 + es/vc-table/src/Column.js | 17 + es/vc-table/src/ColumnGroup.js | 9 + es/vc-table/src/ColumnManager.js | 180 + es/vc-table/src/ExpandIcon.js | 40 + es/vc-table/src/ExpandableRow.js | 136 + es/vc-table/src/ExpandableTable.js | 232 + es/vc-table/src/HeadTable.js | 84 + es/vc-table/src/Table.js | 514 +++ es/vc-table/src/TableCell.js | 107 + es/vc-table/src/TableHeader.js | 93 + es/vc-table/src/TableHeaderRow.js | 96 + es/vc-table/src/TableRow.js | 302 ++ es/vc-table/src/utils.js | 86 + es/vc-tabs/src/InkTabBar.js | 13 + es/vc-tabs/src/InkTabBarMixin.js | 147 + es/vc-tabs/src/KeyCode.js | 18 + es/vc-tabs/src/ScrollableInkTabBar.js | 16 + es/vc-tabs/src/ScrollableTabBar.js | 15 + es/vc-tabs/src/ScrollableTabBarMixin.js | 315 ++ es/vc-tabs/src/TabBar.js | 24 + es/vc-tabs/src/TabBarMixin.js | 150 + es/vc-tabs/src/TabContent.js | 60 + es/vc-tabs/src/TabPane.js | 60 + es/vc-tabs/src/Tabs.js | 246 ++ es/vc-tabs/src/utils.js | 80 + es/vc-time-picker/Combobox.js | 232 + es/vc-time-picker/Header.js | 215 + es/vc-time-picker/Panel.js | 220 + es/vc-time-picker/Select.js | 153 + es/vc-time-picker/TimePicker.js | 360 ++ es/vc-time-picker/assets/index.less | 14 + es/vc-time-picker/assets/index/Header.less | 49 + es/vc-time-picker/assets/index/Panel.less | 29 + es/vc-time-picker/assets/index/Picker.less | 23 + es/vc-time-picker/assets/index/Select.less | 63 + es/vc-time-picker/index.js | 2 + es/vc-time-picker/placements.js | 35 + es/vc-tooltip/Tooltip.js | 108 + es/vc-tooltip/assets/boostrap/anim.less | 58 + es/vc-tooltip/assets/bootstrap.less | 164 + es/vc-tooltip/assets/bootstrap_white.less | 190 + es/vc-tooltip/index.js | 3 + es/vc-tooltip/placements.js | 83 + es/vc-tree-select/assets/icons.png | Bin 0 -> 11173 bytes es/vc-tree-select/assets/index.less | 2 + es/vc-tree-select/assets/select.less | 500 +++ es/vc-tree-select/assets/tree.less | 164 + es/vc-tree-select/demo/basic.js | 396 ++ es/vc-tree-select/demo/big-data-generator.js | 86 + es/vc-tree-select/demo/big-data.js | 88 + es/vc-tree-select/demo/demo.less | 15 + es/vc-tree-select/demo/disable.js | 86 + es/vc-tree-select/demo/dynamic.js | 58 + es/vc-tree-select/demo/filter.js | 100 + es/vc-tree-select/demo/form.js | 174 + es/vc-tree-select/demo/styles.js | 11 + es/vc-tree-select/demo/util.js | 154 + es/vc-tree-select/index.js | 7 + es/vc-tree-select/src/PropTypes.js | 83 + es/vc-tree-select/src/Select.js | 1114 +++++ es/vc-tree-select/src/SelectTrigger.js | 374 ++ es/vc-tree-select/src/TreeNode.js | 12 + es/vc-tree-select/src/index.js | 31 + es/vc-tree-select/src/strategies.js | 3 + es/vc-tree-select/src/util.js | 612 +++ es/vc-tree/assets/icons.png | Bin 0 -> 11173 bytes es/vc-tree/assets/index.less | 192 + es/vc-tree/demo/basic.js | 178 + es/vc-tree/demo/basic.less | 6 + es/vc-tree/demo/contextmenu.less | 18 + es/vc-tree/demo/draggable.less | 11 + es/vc-tree/demo/util.js | 198 + es/vc-tree/index.js | 3 + es/vc-tree/src/Tree.js | 633 +++ es/vc-tree/src/TreeNode.js | 633 +++ es/vc-tree/src/index.js | 30 + es/vc-tree/src/util.js | 445 ++ es/vc-upload/demo/beforeUpload.js | 48 + es/vc-upload/demo/drag.js | 34 + es/vc-upload/demo/simple.js | 105 + es/vc-upload/index.js | 3 + es/vc-upload/src/AjaxUploader.js | 230 + es/vc-upload/src/IframeUploader.js | 255 ++ es/vc-upload/src/Upload.js | 105 + es/vc-upload/src/attr-accept.js | 24 + es/vc-upload/src/index.js | 4 + es/vc-upload/src/request.js | 97 + es/vc-upload/src/uid.js | 6 + es/version/index.js | 3 + es/version/style/css.js | 2 + es/version/style/index.js | 2 + lib/_util/BaseMixin.js | 42 + lib/_util/ContainerRender.js | 111 + lib/_util/Dom/addEventListener.js | 17 + lib/_util/Dom/class-util.js | 72 + lib/_util/Dom/contains.js | 18 + lib/_util/KeyCode.js | 523 +++ lib/_util/StateMixin.js | 23 + lib/_util/antRefDirective.js | 21 + lib/_util/callMoment.js | 15 + lib/_util/createChainedFunction.js | 29 + lib/_util/css-animation/Event.js | 88 + lib/_util/css-animation/index.js | 193 + lib/_util/getLocale.js | 39 + lib/_util/getRequestAnimationFrame.js | 51 + lib/_util/getScroll.js | 24 + lib/_util/getScrollBarSize.js | 45 + lib/_util/getTransitionProps.js | 47 + lib/_util/interopDefault.js | 11 + lib/_util/isCssAnimationSupported.js | 30 + lib/_util/isFlexSupported.js | 15 + lib/_util/openAnimation.js | 63 + lib/_util/props-util.js | 361 ++ lib/_util/requestAnimationTimeout.js | 35 + lib/_util/store/PropTypes.js | 18 + lib/_util/store/Provider.js | 23 + lib/_util/store/connect.js | 114 + lib/_util/store/create.js | 45 + lib/_util/store/index.js | 34 + lib/_util/throttleByAnimationFrame.js | 72 + lib/_util/triggerEvent.js | 15 + lib/_util/vnode.js | 155 + lib/_util/vue-types/index.js | 284 ++ lib/_util/vue-types/utils.js | 211 + lib/_util/warning.js | 22 + lib/affix/index.js | 306 ++ lib/affix/style/css.js | 5 + lib/affix/style/index.css | 8 + lib/affix/style/index.js | 5 + lib/affix/style/index.less | 6 + lib/alert/index.js | 187 + lib/alert/style/css.js | 5 + lib/alert/style/index.css | 198 + lib/alert/style/index.js | 5 + lib/alert/style/index.less | 169 + lib/align/Align.js | 159 + lib/align/index.js | 15 + lib/align/isWindow.js | 12 + lib/anchor/Anchor.js | 309 ++ lib/anchor/AnchorLink.js | 86 + lib/anchor/index.js | 33 + lib/anchor/style/css.js | 5 + lib/anchor/style/index.css | 84 + lib/anchor/style/index.js | 5 + lib/anchor/style/index.less | 81 + lib/auto-complete/InputElement.js | 118 + lib/auto-complete/index.js | 162 + lib/auto-complete/style/css.js | 7 + lib/auto-complete/style/index.css | 66 + lib/auto-complete/style/index.js | 7 + lib/auto-complete/style/index.less | 79 + lib/avatar/Avatar.js | 139 + lib/avatar/index.js | 14 + lib/avatar/style/css.js | 5 + lib/avatar/style/index.css | 64 + lib/avatar/style/index.js | 5 + lib/avatar/style/index.less | 50 + lib/back-top/index.js | 167 + lib/back-top/style/css.js | 5 + lib/back-top/style/index.css | 54 + lib/back-top/style/index.js | 5 + lib/back-top/style/index.less | 40 + lib/back-top/style/responsive.less | 11 + lib/badge/Badge.js | 142 + lib/badge/ScrollNumber.js | 167 + lib/badge/index.js | 14 + lib/badge/style/css.js | 5 + lib/badge/style/index.css | 216 + lib/badge/style/index.js | 5 + lib/badge/style/index.less | 164 + lib/breadcrumb/Breadcrumb.js | 120 + lib/breadcrumb/BreadcrumbItem.js | 53 + lib/breadcrumb/index.js | 19 + lib/breadcrumb/style/css.js | 5 + lib/breadcrumb/style/index.css | 40 + lib/breadcrumb/style/index.js | 5 + lib/breadcrumb/style/index.less | 41 + lib/button/button-group.js | 63 + lib/button/button.js | 174 + lib/button/buttonTypes.js | 27 + lib/button/index.js | 19 + lib/button/style/css.js | 5 + lib/button/style/index.css | 1056 +++++ lib/button/style/index.js | 5 + lib/button/style/index.less | 195 + lib/button/style/mixin.less | 333 ++ lib/calendar/Constants.js | 6 + lib/calendar/Header.js | 237 + lib/calendar/index.js | 313 ++ lib/calendar/locale/ar_EG.js | 14 + lib/calendar/locale/bg_BG.js | 14 + lib/calendar/locale/ca_ES.js | 14 + lib/calendar/locale/cs_CZ.js | 14 + lib/calendar/locale/de_DE.js | 14 + lib/calendar/locale/el_GR.js | 14 + lib/calendar/locale/en_GB.js | 14 + lib/calendar/locale/en_US.js | 14 + lib/calendar/locale/es_ES.js | 14 + lib/calendar/locale/et_EE.js | 14 + lib/calendar/locale/fa_IR.js | 14 + lib/calendar/locale/fi_FI.js | 14 + lib/calendar/locale/fr_BE.js | 14 + lib/calendar/locale/fr_FR.js | 14 + lib/calendar/locale/is_IS.js | 14 + lib/calendar/locale/it_IT.js | 14 + lib/calendar/locale/ja_JP.js | 14 + lib/calendar/locale/ko_KR.js | 14 + lib/calendar/locale/ku_IQ.js | 14 + lib/calendar/locale/nb_NO.js | 14 + lib/calendar/locale/nl_BE.js | 14 + lib/calendar/locale/nl_NL.js | 14 + lib/calendar/locale/pl_PL.js | 14 + lib/calendar/locale/pt_BR.js | 14 + lib/calendar/locale/pt_PT.js | 14 + lib/calendar/locale/ru_RU.js | 14 + lib/calendar/locale/sk_SK.js | 14 + lib/calendar/locale/sl_SI.js | 14 + lib/calendar/locale/sr_RS.js | 14 + lib/calendar/locale/sv_SE.js | 14 + lib/calendar/locale/th_TH.js | 14 + lib/calendar/locale/tr_TR.js | 14 + lib/calendar/locale/uk_UA.js | 14 + lib/calendar/locale/vi_VN.js | 14 + lib/calendar/locale/zh_CN.js | 14 + lib/calendar/locale/zh_TW.js | 14 + lib/calendar/style/css.js | 9 + lib/calendar/style/index.css | 229 + lib/calendar/style/index.js | 9 + lib/calendar/style/index.less | 266 ++ lib/card/Card.js | 208 + lib/card/Grid.js | 45 + lib/card/Meta.js | 73 + lib/card/index.js | 24 + lib/card/style/css.js | 7 + lib/card/style/index.css | 295 ++ lib/card/style/index.js | 7 + lib/card/style/index.less | 257 ++ lib/carousel/index.js | 182 + lib/carousel/style/css.js | 5 + lib/carousel/style/index.css | 209 + lib/carousel/style/index.js | 5 + lib/carousel/style/index.less | 210 + lib/cascader/index.js | 482 +++ lib/cascader/style/css.js | 7 + lib/cascader/style/index.css | 236 + lib/cascader/style/index.js | 7 + lib/cascader/style/index.less | 214 + lib/checkbox/Checkbox.js | 200 + lib/checkbox/Group.js | 159 + lib/checkbox/index.js | 19 + lib/checkbox/style/css.js | 5 + lib/checkbox/style/index.css | 213 + lib/checkbox/style/index.js | 5 + lib/checkbox/style/index.less | 4 + lib/checkbox/style/mixin.less | 193 + lib/col/index.js | 10 + lib/col/style/css.js | 5 + lib/col/style/index.js | 5 + lib/collapse/Collapse.js | 64 + lib/collapse/CollapsePanel.js | 62 + lib/collapse/index.js | 19 + lib/collapse/src/Collapse.js | 173 + lib/collapse/src/Panel.js | 96 + lib/collapse/src/PanelContent.js | 61 + lib/collapse/src/commonProps.js | 34 + lib/collapse/src/index.js | 20 + lib/collapse/src/openAnimationFactory.js | 46 + lib/collapse/style/css.js | 5 + lib/collapse/style/index.css | 118 + lib/collapse/style/index.js | 5 + lib/collapse/style/index.less | 128 + lib/date-picker/RangePicker.js | 448 ++ lib/date-picker/WeekPicker.js | 216 + lib/date-picker/createPicker.js | 264 ++ lib/date-picker/index.js | 50 + lib/date-picker/interface.js | 124 + lib/date-picker/locale/ar_EG.js | 33 + lib/date-picker/locale/bg_BG.js | 34 + lib/date-picker/locale/ca_ES.js | 34 + lib/date-picker/locale/cs_CZ.js | 34 + lib/date-picker/locale/de_DE.js | 32 + lib/date-picker/locale/el_GR.js | 32 + lib/date-picker/locale/en_GB.js | 34 + lib/date-picker/locale/en_US.js | 34 + lib/date-picker/locale/es_ES.js | 34 + lib/date-picker/locale/et_EE.js | 34 + lib/date-picker/locale/fa_IR.js | 34 + lib/date-picker/locale/fi_FI.js | 34 + lib/date-picker/locale/fr_BE.js | 32 + lib/date-picker/locale/fr_FR.js | 32 + lib/date-picker/locale/is_IS.js | 34 + lib/date-picker/locale/it_IT.js | 32 + lib/date-picker/locale/ja_JP.js | 33 + lib/date-picker/locale/ko_KR.js | 34 + lib/date-picker/locale/ku_IQ.js | 33 + lib/date-picker/locale/nb_NO.js | 34 + lib/date-picker/locale/nl_BE.js | 32 + lib/date-picker/locale/nl_NL.js | 32 + lib/date-picker/locale/pl_PL.js | 34 + lib/date-picker/locale/pt_BR.js | 34 + lib/date-picker/locale/pt_PT.js | 62 + lib/date-picker/locale/ru_RU.js | 37 + lib/date-picker/locale/sk_SK.js | 34 + lib/date-picker/locale/sl_SI.js | 55 + lib/date-picker/locale/sr_RS.js | 34 + lib/date-picker/locale/sv_SE.js | 33 + lib/date-picker/locale/th_TH.js | 34 + lib/date-picker/locale/tr_TR.js | 34 + lib/date-picker/locale/uk_UA.js | 33 + lib/date-picker/locale/vi_VN.js | 34 + lib/date-picker/locale/zh_CN.js | 36 + lib/date-picker/locale/zh_TW.js | 36 + lib/date-picker/style/Calendar.less | 336 ++ lib/date-picker/style/DecadePanel.less | 71 + lib/date-picker/style/MonthPanel.less | 75 + lib/date-picker/style/MonthPicker.less | 11 + lib/date-picker/style/Picker.less | 100 + lib/date-picker/style/RangePicker.less | 222 + lib/date-picker/style/TimePicker.less | 148 + lib/date-picker/style/WeekPicker.less | 21 + lib/date-picker/style/YearPanel.less | 74 + lib/date-picker/style/css.js | 9 + lib/date-picker/style/index.css | 1452 +++++++ lib/date-picker/style/index.js | 9 + lib/date-picker/style/index.less | 17 + lib/date-picker/wrapPicker.js | 183 + lib/divider/index.js | 58 + lib/divider/style/css.js | 5 + lib/divider/style/index.css | 141 + lib/divider/style/index.js | 5 + lib/divider/style/index.less | 129 + lib/dropdown/dropdown-button.js | 136 + lib/dropdown/dropdown.js | 112 + lib/dropdown/getDropdownProps.js | 28 + lib/dropdown/index.js | 33 + lib/dropdown/src/Dropdown.js | 186 + lib/dropdown/src/index.js | 14 + lib/dropdown/src/placements.js | 52 + lib/dropdown/style/css.js | 7 + lib/dropdown/style/index.css | 285 ++ lib/dropdown/style/index.js | 7 + lib/dropdown/style/index.less | 251 ++ lib/form/Form.js | 282 ++ lib/form/FormItem.js | 405 ++ lib/form/constants.js | 7 + lib/form/index.js | 52 + lib/form/style/css.js | 7 + lib/form/style/index.css | 758 ++++ lib/form/style/index.js | 7 + lib/form/style/index.less | 624 +++ lib/form/style/mixin.less | 106 + lib/grid/Col.js | 97 + lib/grid/Row.js | 180 + lib/grid/index.js | 19 + lib/grid/style/css.js | 5 + lib/grid/style/index.css | 3855 +++++++++++++++++ lib/grid/style/index.js | 5 + lib/grid/style/index.less | 116 + lib/grid/style/mixin.less | 101 + lib/icon/icon.js | 83 + lib/icon/index.js | 14 + lib/icon/style/css.js | 3 + lib/icon/style/index.js | 3 + lib/index.js | 305 ++ lib/input-number/index.js | 92 + lib/input-number/style/css.js | 5 + lib/input-number/style/index.css | 261 ++ lib/input-number/style/index.js | 5 + lib/input-number/style/index.less | 171 + lib/input/Group.js | 52 + lib/input/Input.js | 240 + lib/input/Search.js | 159 + lib/input/TextArea.js | 178 + lib/input/calculateNodeHeight.js | 129 + lib/input/index.js | 29 + lib/input/inputProps.js | 49 + lib/input/style/css.js | 5 + lib/input/style/index.css | 348 ++ lib/input/style/index.js | 5 + lib/input/style/index.less | 33 + lib/input/style/mixin.less | 350 ++ lib/input/style/search-input.less | 33 + lib/layout/Sider.js | 282 ++ lib/layout/index.js | 19 + lib/layout/layout.js | 145 + lib/layout/style/css.js | 5 + lib/layout/style/index.css | 118 + lib/layout/style/index.js | 5 + lib/layout/style/index.less | 112 + lib/list/Item.js | 186 + lib/list/index.js | 324 ++ lib/list/style/bordered.less | 41 + lib/list/style/css.js | 11 + lib/list/style/index.css | 308 ++ lib/list/style/index.js | 11 + lib/list/style/index.less | 207 + lib/list/style/responsive.less | 42 + lib/locale-provider/LocaleReceiver.js | 54 + lib/locale-provider/ar_EG.js | 64 + lib/locale-provider/bg_BG.js | 64 + lib/locale-provider/ca_ES.js | 56 + lib/locale-provider/cs_CZ.js | 62 + lib/locale-provider/de_DE.js | 64 + lib/locale-provider/default.js | 65 + lib/locale-provider/el_GR.js | 64 + lib/locale-provider/en_GB.js | 64 + lib/locale-provider/en_US.js | 14 + lib/locale-provider/es_ES.js | 64 + lib/locale-provider/et_EE.js | 64 + lib/locale-provider/fa_IR.js | 64 + lib/locale-provider/fi_FI.js | 64 + lib/locale-provider/fr_BE.js | 56 + lib/locale-provider/fr_FR.js | 56 + lib/locale-provider/index.js | 95 + lib/locale-provider/is_IS.js | 64 + lib/locale-provider/it_IT.js | 64 + lib/locale-provider/ja_JP.js | 64 + lib/locale-provider/ko_KR.js | 62 + lib/locale-provider/ku_IQ.js | 64 + lib/locale-provider/nb_NO.js | 64 + lib/locale-provider/nl_BE.js | 64 + lib/locale-provider/nl_NL.js | 64 + lib/locale-provider/pl_PL.js | 64 + lib/locale-provider/pt_BR.js | 64 + lib/locale-provider/pt_PT.js | 64 + lib/locale-provider/ru_RU.js | 64 + lib/locale-provider/sk_SK.js | 64 + lib/locale-provider/sl_SI.js | 64 + lib/locale-provider/sr_RS.js | 64 + lib/locale-provider/style/css.js | 3 + lib/locale-provider/style/index.css | 4 + lib/locale-provider/style/index.js | 3 + lib/locale-provider/style/index.less | 2 + lib/locale-provider/sv_SE.js | 56 + lib/locale-provider/th_TH.js | 64 + lib/locale-provider/tr_TR.js | 64 + lib/locale-provider/uk_UA.js | 64 + lib/locale-provider/vi_VN.js | 64 + lib/locale-provider/zh_CN.js | 64 + lib/locale-provider/zh_TW.js | 64 + lib/menu/MenuItem.js | 79 + lib/menu/index.js | 310 ++ lib/menu/style/css.js | 7 + lib/menu/style/dark.less | 118 + lib/menu/style/index.css | 678 +++ lib/menu/style/index.js | 7 + lib/menu/style/index.less | 462 ++ lib/message/index.js | 147 + lib/message/style/css.js | 5 + lib/message/style/index.css | 87 + lib/message/style/index.js | 5 + lib/message/style/index.less | 74 + lib/modal/ActionButton.js | 106 + lib/modal/ConfirmDialog.js | 117 + lib/modal/Modal.js | 202 + lib/modal/confirm.js | 73 + lib/modal/index.js | 76 + lib/modal/locale.js | 38 + lib/modal/style/confirm.less | 74 + lib/modal/style/css.js | 7 + lib/modal/style/index.css | 211 + lib/modal/style/index.js | 7 + lib/modal/style/index.less | 4 + lib/modal/style/modal.less | 147 + lib/notification/index.js | 239 + lib/notification/style/css.js | 5 + lib/notification/style/index.css | 235 + lib/notification/style/index.js | 5 + lib/notification/style/index.less | 199 + lib/pagination/MiniSelect.js | 39 + lib/pagination/Pagination.js | 113 + lib/pagination/index.js | 21 + lib/pagination/style/css.js | 5 + lib/pagination/style/index.css | 396 ++ lib/pagination/style/index.js | 5 + lib/pagination/style/index.less | 353 ++ lib/popconfirm/index.js | 180 + lib/popconfirm/style/css.js | 7 + lib/popconfirm/style/index.js | 7 + lib/popover/index.js | 78 + lib/popover/style/css.js | 5 + lib/popover/style/index.css | 183 + lib/popover/style/index.js | 5 + lib/popover/style/index.less | 178 + lib/progress/index.js | 21 + lib/progress/progress.js | 176 + lib/progress/style/css.js | 5 + lib/progress/style/index.css | 166 + lib/progress/style/index.js | 5 + lib/progress/style/index.less | 167 + lib/radio/Group.js | 141 + lib/radio/Radio.js | 178 + lib/radio/index.js | 36 + lib/radio/style/css.js | 5 + lib/radio/style/index.css | 290 ++ lib/radio/style/index.js | 5 + lib/radio/style/index.less | 281 ++ lib/rate/index.js | 88 + lib/rate/style/css.js | 5 + lib/rate/style/index.css | 77 + lib/rate/style/index.js | 5 + lib/rate/style/index.less | 71 + lib/row/index.js | 10 + lib/row/style/css.js | 5 + lib/row/style/index.js | 5 + lib/select/index.js | 211 + lib/select/style/css.js | 7 + lib/select/style/index.css | 579 +++ lib/select/style/index.js | 7 + lib/select/style/index.less | 571 +++ lib/slider/index.js | 186 + lib/slider/style/css.js | 7 + lib/slider/style/index.css | 172 + lib/slider/style/index.js | 7 + lib/slider/style/index.less | 188 + lib/spin/Spin.js | 201 + lib/spin/index.js | 21 + lib/spin/style/css.js | 5 + lib/spin/style/index.css | 219 + lib/spin/style/index.js | 5 + lib/spin/style/index.less | 207 + lib/steps/index.js | 62 + lib/steps/style/css.js | 5 + lib/steps/style/custom-icon.less | 21 + lib/steps/style/index.css | 477 ++ lib/steps/style/index.js | 5 + lib/steps/style/index.less | 187 + lib/steps/style/label-placement.less | 28 + lib/steps/style/progress-dot.less | 75 + lib/steps/style/small.less | 45 + lib/steps/style/vertical.less | 67 + lib/style.js | 101 + lib/style/color/bezierEasing.less | 111 + lib/style/color/colorPalette.less | 75 + lib/style/color/colors.less | 146 + lib/style/color/tinyColor.less | 1184 +++++ lib/style/core/base.less | 502 +++ lib/style/core/iconfont.less | 340 ++ lib/style/core/index.less | 4 + lib/style/core/motion.less | 15 + lib/style/core/motion/fade.less | 31 + lib/style/core/motion/move.less | 120 + lib/style/core/motion/other.less | 10 + lib/style/core/motion/slide.less | 120 + lib/style/core/motion/swing.less | 33 + lib/style/core/motion/zoom.less | 160 + lib/style/css.js | 3 + lib/style/index.css | 2958 +++++++++++++ lib/style/index.js | 3 + lib/style/index.less | 2 + lib/style/mixins/clearfix.less | 16 + lib/style/mixins/compatibility.less | 18 + lib/style/mixins/iconfont.less | 37 + lib/style/mixins/index.less | 8 + lib/style/mixins/motion.less | 33 + lib/style/mixins/reset.less | 12 + lib/style/mixins/size.less | 10 + lib/style/themes/default.less | 463 ++ lib/style/v2-compatible-reset.css | 45 + lib/style/v2-compatible-reset.js | 3 + lib/style/v2-compatible-reset.less | 14 + lib/switch/index.js | 94 + lib/switch/style/css.js | 5 + lib/switch/style/index.css | 173 + lib/switch/style/index.js | 5 + lib/switch/style/index.less | 165 + lib/table/Column.js | 13 + lib/table/ColumnGroup.js | 20 + lib/table/FilterDropdownMenuWrapper.js | 28 + lib/table/SelectionBox.js | 104 + lib/table/SelectionCheckboxAll.js | 235 + lib/table/Table.js | 1105 +++++ lib/table/createBodyRow.js | 88 + lib/table/createStore.js | 26 + lib/table/filterDropdown.js | 308 ++ lib/table/index.js | 140 + lib/table/interface.js | 213 + lib/table/style/css.js | 15 + lib/table/style/index.css | 654 +++ lib/table/style/index.js | 15 + lib/table/style/index.less | 593 +++ lib/table/style/size.less | 109 + lib/table/util.js | 87 + lib/tabs/index.js | 30 + lib/tabs/style/card-style.less | 148 + lib/tabs/style/css.js | 5 + lib/tabs/style/index.css | 555 +++ lib/tabs/style/index.js | 5 + lib/tabs/style/index.less | 414 ++ lib/tabs/tabs.js | 210 + lib/tag/CheckableTag.js | 59 + lib/tag/Tag.js | 124 + lib/tag/index.js | 19 + lib/tag/style/css.js | 5 + lib/tag/style/index.css | 237 + lib/tag/style/index.js | 5 + lib/tag/style/index.less | 119 + lib/time-picker/index.js | 222 + lib/time-picker/locale/ar_EG.js | 11 + lib/time-picker/locale/bg_BG.js | 11 + lib/time-picker/locale/ca_ES.js | 11 + lib/time-picker/locale/cs_CZ.js | 11 + lib/time-picker/locale/de_DE.js | 11 + lib/time-picker/locale/el_GR.js | 11 + lib/time-picker/locale/en_GB.js | 11 + lib/time-picker/locale/en_US.js | 11 + lib/time-picker/locale/es_ES.js | 11 + lib/time-picker/locale/et_EE.js | 11 + lib/time-picker/locale/fa_IR.js | 11 + lib/time-picker/locale/fi_FI.js | 11 + lib/time-picker/locale/fr_BE.js | 11 + lib/time-picker/locale/fr_FR.js | 11 + lib/time-picker/locale/is_IS.js | 11 + lib/time-picker/locale/it_IT.js | 11 + lib/time-picker/locale/ja_JP.js | 11 + lib/time-picker/locale/ko_KR.js | 11 + lib/time-picker/locale/ku_IQ.js | 11 + lib/time-picker/locale/nb_NO.js | 11 + lib/time-picker/locale/nl_BE.js | 11 + lib/time-picker/locale/nl_NL.js | 11 + lib/time-picker/locale/pl_PL.js | 11 + lib/time-picker/locale/pt_BR.js | 11 + lib/time-picker/locale/pt_PT.js | 11 + lib/time-picker/locale/ru_RU.js | 14 + lib/time-picker/locale/sk_SK.js | 11 + lib/time-picker/locale/sl_SI.js | 11 + lib/time-picker/locale/sr_RS.js | 11 + lib/time-picker/locale/sv_SE.js | 11 + lib/time-picker/locale/th_TH.js | 11 + lib/time-picker/locale/tr_TR.js | 11 + lib/time-picker/locale/uk_UA.js | 11 + lib/time-picker/locale/vi_VN.js | 11 + lib/time-picker/locale/zh_CN.js | 11 + lib/time-picker/locale/zh_TW.js | 11 + lib/time-picker/style/css.js | 7 + lib/time-picker/style/index.css | 325 ++ lib/time-picker/style/index.js | 7 + lib/time-picker/style/index.less | 234 + lib/timeline/Timeline.js | 100 + lib/timeline/TimelineItem.js | 77 + lib/timeline/index.js | 34 + lib/timeline/style/css.js | 5 + lib/timeline/style/index.css | 86 + lib/timeline/style/index.js | 5 + lib/timeline/style/index.less | 93 + lib/tooltip/Tooltip.js | 223 + lib/tooltip/abstractTooltipProps.js | 34 + lib/tooltip/index.js | 14 + lib/tooltip/placements.js | 106 + lib/tooltip/style/css.js | 5 + lib/tooltip/style/index.css | 129 + lib/tooltip/style/index.js | 5 + lib/tooltip/style/index.less | 144 + lib/transfer/index.js | 465 ++ lib/transfer/item.js | 102 + lib/transfer/list.js | 351 ++ lib/transfer/operation.js | 86 + lib/transfer/search.js | 86 + lib/transfer/style/css.js | 11 + lib/transfer/style/index.css | 194 + lib/transfer/style/index.js | 11 + lib/transfer/style/index.less | 174 + lib/tree-select/index.js | 165 + lib/tree-select/interface.js | 54 + lib/tree-select/style/css.js | 9 + lib/tree-select/style/index.css | 397 ++ lib/tree-select/style/index.js | 9 + lib/tree-select/style/index.less | 145 + lib/tree/index.js | 216 + lib/tree/style/css.js | 7 + lib/tree/style/index.css | 493 +++ lib/tree/style/index.js | 7 + lib/tree/style/index.less | 203 + lib/tree/style/mixin.less | 27 + lib/trigger/LazyRenderBox.js | 40 + lib/trigger/Popup.js | 288 ++ lib/trigger/PopupInner.js | 51 + lib/trigger/Trigger.js | 602 +++ lib/trigger/assets/index.less | 70 + lib/trigger/assets/mask.less | 63 + lib/trigger/index.js | 15 + lib/trigger/utils.js | 37 + lib/upload/Dragger.js | 42 + lib/upload/Upload.js | 336 ++ lib/upload/UploadList.js | 312 ++ lib/upload/index.js | 47 + lib/upload/interface.js | 117 + lib/upload/style/css.js | 9 + lib/upload/style/index.css | 492 +++ lib/upload/style/index.js | 9 + lib/upload/style/index.less | 459 ++ lib/upload/utils.js | 71 + lib/vc-calendar/assets/common/Calendar.less | 106 + .../assets/common/FullCalendar.less | 91 + lib/vc-calendar/assets/common/Picker.less | 10 + .../assets/common/RangeCalendar.less | 132 + lib/vc-calendar/assets/common/index.less | 16 + lib/vc-calendar/assets/index.less | 10 + lib/vc-calendar/assets/index/Calendar.less | 291 ++ lib/vc-calendar/assets/index/DecadePanel.less | 115 + lib/vc-calendar/assets/index/Input.less | 22 + lib/vc-calendar/assets/index/MonthPanel.less | 135 + lib/vc-calendar/assets/index/Picker.less | 110 + lib/vc-calendar/assets/index/Time.less | 6 + lib/vc-calendar/assets/index/TimePanel.less | 74 + lib/vc-calendar/assets/index/YearPanel.less | 125 + lib/vc-calendar/index.js | 14 + lib/vc-calendar/src/Calendar.js | 419 ++ lib/vc-calendar/src/FullCalendar.js | 196 + lib/vc-calendar/src/MonthCalendar.js | 169 + lib/vc-calendar/src/Picker.js | 260 ++ lib/vc-calendar/src/RangeCalendar.js | 708 +++ .../src/calendar/CalendarFooter.js | 124 + .../src/calendar/CalendarHeader.js | 281 ++ lib/vc-calendar/src/calendar/OkButton.js | 36 + .../src/calendar/TimePickerButton.js | 47 + lib/vc-calendar/src/calendar/TodayButton.js | 47 + lib/vc-calendar/src/date/DateConstants.js | 10 + lib/vc-calendar/src/date/DateInput.js | 179 + lib/vc-calendar/src/date/DateTBody.js | 288 ++ lib/vc-calendar/src/date/DateTHead.js | 80 + lib/vc-calendar/src/date/DateTable.js | 38 + lib/vc-calendar/src/decade/DecadePanel.js | 176 + .../src/full-calendar/CalendarHeader.js | 181 + lib/vc-calendar/src/index.js | 14 + lib/vc-calendar/src/locale/ar_EG.js | 33 + lib/vc-calendar/src/locale/bg_BG.js | 33 + lib/vc-calendar/src/locale/ca_ES.js | 33 + lib/vc-calendar/src/locale/cs_CZ.js | 33 + lib/vc-calendar/src/locale/da_DK.js | 33 + lib/vc-calendar/src/locale/de_DE.js | 33 + lib/vc-calendar/src/locale/el_GR.js | 33 + lib/vc-calendar/src/locale/en_GB.js | 33 + lib/vc-calendar/src/locale/en_US.js | 33 + lib/vc-calendar/src/locale/es_ES.js | 33 + lib/vc-calendar/src/locale/et_EE.js | 33 + lib/vc-calendar/src/locale/fa_IR.js | 33 + lib/vc-calendar/src/locale/fi_FI.js | 33 + lib/vc-calendar/src/locale/fr_BE.js | 33 + lib/vc-calendar/src/locale/fr_FR.js | 33 + lib/vc-calendar/src/locale/hu_HU.js | 33 + lib/vc-calendar/src/locale/is_IS.js | 33 + lib/vc-calendar/src/locale/it_IT.js | 33 + lib/vc-calendar/src/locale/ja_JP.js | 32 + lib/vc-calendar/src/locale/ko_KR.js | 33 + lib/vc-calendar/src/locale/ku_IQ.js | 33 + lib/vc-calendar/src/locale/nb_NO.js | 33 + lib/vc-calendar/src/locale/nl_BE.js | 33 + lib/vc-calendar/src/locale/nl_NL.js | 33 + lib/vc-calendar/src/locale/pl_PL.js | 33 + lib/vc-calendar/src/locale/pt_BR.js | 33 + lib/vc-calendar/src/locale/pt_PT.js | 33 + lib/vc-calendar/src/locale/ru_RU.js | 33 + lib/vc-calendar/src/locale/sk_SK.js | 33 + lib/vc-calendar/src/locale/sl_SI.js | 33 + lib/vc-calendar/src/locale/sr_RS.js | 33 + lib/vc-calendar/src/locale/sv_SE.js | 33 + lib/vc-calendar/src/locale/th_TH.js | 33 + lib/vc-calendar/src/locale/tr_TR.js | 33 + lib/vc-calendar/src/locale/ug_CN.js | 32 + lib/vc-calendar/src/locale/uk_UA.js | 33 + lib/vc-calendar/src/locale/zh_CN.js | 32 + lib/vc-calendar/src/locale/zh_TW.js | 32 + lib/vc-calendar/src/mixin/CalendarMixin.js | 143 + lib/vc-calendar/src/mixin/CommonMixin.js | 48 + lib/vc-calendar/src/month/MonthPanel.js | 164 + lib/vc-calendar/src/month/MonthTable.js | 172 + lib/vc-calendar/src/picker/placements.js | 41 + .../src/range-calendar/CalendarPart.js | 196 + lib/vc-calendar/src/util/index.js | 112 + lib/vc-calendar/src/year/YearPanel.js | 203 + lib/vc-cascader/Cascader.js | 380 ++ lib/vc-cascader/Menus.js | 186 + lib/vc-cascader/assets/index.less | 167 + lib/vc-cascader/index.js | 15 + lib/vc-checkbox/index.js | 18 + lib/vc-checkbox/src/Checkbox.js | 167 + lib/vc-checkbox/src/index.js | 14 + lib/vc-dialog/Dialog.js | 490 +++ lib/vc-dialog/DialogWrap.js | 120 + lib/vc-dialog/IDialogPropTypes.js | 51 + lib/vc-dialog/LazyRenderBox.js | 26 + lib/vc-dialog/assets/bootstrap.less | 3 + lib/vc-dialog/assets/bootstrap/Dialog.less | 133 + lib/vc-dialog/assets/bootstrap/effect.less | 42 + lib/vc-dialog/assets/bootstrap/variables.less | 869 ++++ lib/vc-dialog/assets/index.less | 4 + lib/vc-dialog/assets/index/Dialog.less | 134 + lib/vc-dialog/assets/index/Mask.less | 63 + lib/vc-dialog/index.js | 15 + lib/vc-form/demo/async-init.js | 168 + lib/vc-form/demo/dynamic-fields.js | 227 + lib/vc-form/demo/dynamic.js | 167 + lib/vc-form/demo/file-input.js | 110 + lib/vc-form/demo/getFieldDecorator.js | 66 + lib/vc-form/demo/input-array.js | 103 + lib/vc-form/demo/modal.js | 131 + lib/vc-form/demo/nested-field.js | 204 + lib/vc-form/demo/normalize.js | 239 + lib/vc-form/demo/overview.js | 339 ++ lib/vc-form/demo/parallel-form.js | 108 + lib/vc-form/demo/start-end-date.js | 113 + lib/vc-form/demo/styles.js | 16 + lib/vc-form/demo/suggest.js | 153 + lib/vc-form/demo/validateFirst.js | 160 + lib/vc-form/demo/validateTrigger.js | 136 + lib/vc-form/index.js | 11 + lib/vc-form/src/createBaseForm.js | 624 +++ lib/vc-form/src/createDOMForm.js | 147 + lib/vc-form/src/createFieldsStore.js | 328 ++ lib/vc-form/src/createForm.js | 45 + lib/vc-form/src/createFormField.js | 35 + lib/vc-form/src/index.js | 33 + lib/vc-form/src/propTypes.js | 35 + lib/vc-form/src/utils.js | 182 + lib/vc-input-number/assets/index.less | 115 + .../demo/combination-key-format.js | 92 + lib/vc-input-number/demo/custom.js | 71 + lib/vc-input-number/demo/precision.js | 64 + lib/vc-input-number/demo/simple-use-touch.js | 80 + lib/vc-input-number/demo/simple.js | 79 + lib/vc-input-number/demo/small-step.js | 55 + lib/vc-input-number/src/InputHandler.js | 51 + lib/vc-input-number/src/index.js | 684 +++ lib/vc-lazy-load/demo/index.js | 60 + lib/vc-lazy-load/demo/style.less | 18 + lib/vc-lazy-load/index.js | 14 + lib/vc-lazy-load/src/LazyLoad.js | 204 + .../src/utils/getElementPosition.js | 19 + lib/vc-lazy-load/src/utils/inViewport.js | 46 + lib/vc-lazy-load/src/utils/parentScroll.js | 46 + lib/vc-m-feedback/demo/simple.js | 44 + lib/vc-m-feedback/demo/simple.less | 7 + lib/vc-m-feedback/index.js | 14 + lib/vc-m-feedback/src/PropTypes.js | 24 + lib/vc-m-feedback/src/TouchFeedback.js | 129 + lib/vc-menu/DOMWrap.js | 66 + lib/vc-menu/Divider.js | 22 + lib/vc-menu/Menu.js | 210 + lib/vc-menu/MenuItem.js | 185 + lib/vc-menu/MenuItemGroup.js | 65 + lib/vc-menu/MenuMixin.js | 297 ++ lib/vc-menu/SubMenu.js | 567 +++ lib/vc-menu/SubPopupMenu.js | 75 + lib/vc-menu/assets/index.less | 298 ++ lib/vc-menu/commonPropsType.js | 38 + lib/vc-menu/index.js | 37 + lib/vc-menu/placements.js | 34 + lib/vc-menu/util.js | 55 + lib/vc-notification/Notice.js | 100 + lib/vc-notification/Notification.js | 201 + lib/vc-notification/index.js | 14 + lib/vc-pagination/KeyCode.js | 20 + lib/vc-pagination/Options.js | 182 + lib/vc-pagination/Pager.js | 75 + lib/vc-pagination/Pagination.js | 657 +++ lib/vc-pagination/assets/index.less | 288 ++ lib/vc-pagination/index.js | 18 + lib/vc-pagination/locale/ar_EG.js | 21 + lib/vc-pagination/locale/bg_BG.js | 21 + lib/vc-pagination/locale/ca_ES.js | 21 + lib/vc-pagination/locale/cs_CZ.js | 21 + lib/vc-pagination/locale/da_DK.js | 21 + lib/vc-pagination/locale/de_DE.js | 21 + lib/vc-pagination/locale/el_GR.js | 21 + lib/vc-pagination/locale/en_GB.js | 21 + lib/vc-pagination/locale/en_US.js | 21 + lib/vc-pagination/locale/es_ES.js | 21 + lib/vc-pagination/locale/et_EE.js | 21 + lib/vc-pagination/locale/fa_IR.js | 21 + lib/vc-pagination/locale/fi_FI.js | 21 + lib/vc-pagination/locale/fr_BE.js | 21 + lib/vc-pagination/locale/fr_FR.js | 21 + lib/vc-pagination/locale/hu_HU.js | 21 + lib/vc-pagination/locale/id_ID.js | 21 + lib/vc-pagination/locale/is_IS.js | 21 + lib/vc-pagination/locale/it_IT.js | 21 + lib/vc-pagination/locale/ja_JP.js | 21 + lib/vc-pagination/locale/ko_KR.js | 21 + lib/vc-pagination/locale/ku_IQ.js | 21 + lib/vc-pagination/locale/nb_NO.js | 20 + lib/vc-pagination/locale/nl_BE.js | 21 + lib/vc-pagination/locale/nl_NL.js | 21 + lib/vc-pagination/locale/pl_PL.js | 21 + lib/vc-pagination/locale/pt_BR.js | 21 + lib/vc-pagination/locale/pt_PT.js | 21 + lib/vc-pagination/locale/ru_RU.js | 21 + lib/vc-pagination/locale/sk_SK.js | 21 + lib/vc-pagination/locale/sl_SI.js | 21 + lib/vc-pagination/locale/sr_RS.js | 20 + lib/vc-pagination/locale/sv_SE.js | 21 + lib/vc-pagination/locale/th_TH.js | 21 + lib/vc-pagination/locale/tr_TR.js | 21 + lib/vc-pagination/locale/ug_CN.js | 20 + lib/vc-pagination/locale/uk_UA.js | 21 + lib/vc-pagination/locale/vi_VN.js | 21 + lib/vc-pagination/locale/zh_CN.js | 21 + lib/vc-pagination/locale/zh_TW.js | 21 + lib/vc-progress/assets/index.less | 0 lib/vc-progress/demo/fast-progress.js | 67 + lib/vc-progress/demo/gap.js | 97 + lib/vc-progress/demo/simple.js | 66 + lib/vc-progress/index.js | 16 + lib/vc-progress/src/Circle.js | 147 + lib/vc-progress/src/Line.js | 88 + lib/vc-progress/src/enhancer.js | 29 + lib/vc-progress/src/index.js | 23 + lib/vc-progress/src/types.js | 36 + lib/vc-rate/assets/index.less | 96 + lib/vc-rate/demo/simple.js | 96 + lib/vc-rate/index.js | 15 + lib/vc-rate/src/Rate.js | 262 ++ lib/vc-rate/src/Star.js | 94 + lib/vc-rate/src/index.js | 14 + lib/vc-rate/src/util.js | 45 + lib/vc-select/DropdownMenu.js | 210 + lib/vc-select/OptGroup.js | 19 + lib/vc-select/Option.js | 21 + lib/vc-select/PropTypes.js | 55 + lib/vc-select/Select.js | 1694 ++++++++ lib/vc-select/SelectTrigger.js | 245 ++ lib/vc-select/assets/index.less | 503 +++ lib/vc-select/demo/tbFetchSuggest.js | 50 + lib/vc-select/index.js | 30 + lib/vc-select/util.js | 209 + lib/vc-slick/assets/docs.less | 116 + lib/vc-slick/assets/fonts/slick.svg | 14 + lib/vc-slick/assets/index.less | 3 + lib/vc-slick/assets/slick-theme.less | 204 + lib/vc-slick/assets/slick.less | 119 + lib/vc-slick/demo/AdaptiveHeight.js | 36 + lib/vc-slick/demo/AppendDots.js | 69 + lib/vc-slick/demo/AsNavFor.js | 53 + lib/vc-slick/demo/AutoPlay.js | 38 + lib/vc-slick/demo/AutoPlayMethods.js | 63 + lib/vc-slick/demo/CenterMode.js | 36 + lib/vc-slick/demo/CustomArrows.js | 64 + lib/vc-slick/demo/CustomPaging.js | 61 + lib/vc-slick/demo/CustomSlides.js | 56 + lib/vc-slick/demo/DynamicSlides.js | 59 + lib/vc-slick/demo/Fade.js | 52 + lib/vc-slick/demo/FocusOnSelect.js | 35 + lib/vc-slick/demo/LazyLoad.js | 53 + lib/vc-slick/demo/MultipleItems.js | 35 + lib/vc-slick/demo/MultipleRows.js | 42 + lib/vc-slick/demo/PauseOnHover.js | 37 + lib/vc-slick/demo/PreviousNextMethods.js | 86 + lib/vc-slick/demo/Resizable.js | 85 + lib/vc-slick/demo/Responsive.js | 58 + lib/vc-slick/demo/Rtl.js | 37 + lib/vc-slick/demo/SimpleSlider.js | 49 + lib/vc-slick/demo/SlickGoTo.js | 80 + lib/vc-slick/demo/SlideChangeHooks.js | 49 + lib/vc-slick/demo/SwipeToSlide.js | 38 + lib/vc-slick/demo/UnevenSetsFinite.js | 35 + lib/vc-slick/demo/UnevenSetsInfinite.js | 35 + lib/vc-slick/demo/VariableWidth.js | 61 + lib/vc-slick/demo/VerticalMode.js | 42 + lib/vc-slick/demo/VerticalSwipeToSlide.js | 43 + lib/vc-slick/demo/config.js | 6 + lib/vc-slick/demo/imglist.js | 31 + lib/vc-slick/demo/index.js | 136 + lib/vc-slick/src/arrows.js | 166 + lib/vc-slick/src/default-props.js | 67 + lib/vc-slick/src/dots.js | 98 + lib/vc-slick/src/index.js | 14 + lib/vc-slick/src/initial-state.js | 32 + lib/vc-slick/src/inner-slider.js | 821 ++++ lib/vc-slick/src/slider.js | 252 ++ lib/vc-slick/src/track.js | 218 + lib/vc-slick/src/utils/innerSliderUtils.js | 746 ++++ lib/vc-slider/assets/index.less | 302 ++ lib/vc-slider/demo/handle.js | 160 + lib/vc-slider/demo/marks.js | 113 + lib/vc-slider/demo/range.js | 349 ++ lib/vc-slider/demo/slider.js | 356 ++ lib/vc-slider/demo/vertical.js | 118 + lib/vc-slider/index.js | 15 + lib/vc-slider/src/Handle.js | 136 + lib/vc-slider/src/Range.js | 481 ++ lib/vc-slider/src/Slider.js | 244 ++ lib/vc-slider/src/common/Marks.js | 99 + lib/vc-slider/src/common/Steps.js | 81 + lib/vc-slider/src/common/Track.js | 42 + lib/vc-slider/src/common/createSlider.js | 423 ++ lib/vc-slider/src/createSliderWithTooltip.js | 139 + lib/vc-slider/src/index.js | 32 + lib/vc-slider/src/utils.js | 163 + lib/vc-steps/Step.js | 156 + lib/vc-steps/Steps.js | 177 + lib/vc-steps/assets/custom-icon.less | 21 + lib/vc-steps/assets/iconfont.less | 203 + lib/vc-steps/assets/index.less | 168 + lib/vc-steps/assets/label-placement.less | 30 + lib/vc-steps/assets/progress-dot.less | 39 + lib/vc-steps/assets/small.less | 55 + lib/vc-steps/assets/variables.less | 19 + lib/vc-steps/assets/vertical.less | 53 + lib/vc-steps/index.js | 22 + lib/vc-switch/PropTypes.js | 26 + lib/vc-switch/Switch.js | 150 + lib/vc-switch/assets/index.less | 115 + lib/vc-switch/index.js | 14 + lib/vc-table/assets/animation.less | 59 + lib/vc-table/assets/bordered.less | 11 + lib/vc-table/assets/index.less | 227 + lib/vc-table/demo/childrenIndent.js | 109 + lib/vc-table/demo/className.js | 60 + lib/vc-table/demo/colspan-rowspan.js | 124 + lib/vc-table/demo/column-resize.js | 129 + lib/vc-table/demo/dropdown.js | 152 + lib/vc-table/demo/expandedRowRender.js | 149 + lib/vc-table/demo/fixedColumns-auto-height.js | 63 + lib/vc-table/demo/fixedColumns.js | 44 + lib/vc-table/demo/fixedColumnsAndHeader.js | 28 + .../fixedColumnsAndHeaderSyncRowHeight.js | 28 + lib/vc-table/demo/grouping-columns.js | 95 + lib/vc-table/demo/jsx.js | 77 + lib/vc-table/demo/key.js | 70 + lib/vc-table/demo/nested.js | 52 + lib/vc-table/demo/no-data.js | 40 + lib/vc-table/demo/rowAndCellClick.js | 127 + lib/vc-table/demo/scrollX.js | 28 + lib/vc-table/demo/scrollXY.js | 34 + lib/vc-table/demo/scrollY.js | 82 + lib/vc-table/demo/styled-components.js | 58 + lib/vc-table/demo/subTable.js | 75 + lib/vc-table/demo/title-and-footer.js | 49 + lib/vc-table/index.js | 95 + lib/vc-table/src/BaseTable.js | 225 + lib/vc-table/src/BodyTable.js | 155 + lib/vc-table/src/ColGroup.js | 59 + lib/vc-table/src/Column.js | 28 + lib/vc-table/src/ColumnGroup.js | 20 + lib/vc-table/src/ColumnManager.js | 199 + lib/vc-table/src/ExpandIcon.js | 55 + lib/vc-table/src/ExpandableRow.js | 154 + lib/vc-table/src/ExpandableTable.js | 258 ++ lib/vc-table/src/HeadTable.js | 99 + lib/vc-table/src/Table.js | 561 +++ lib/vc-table/src/TableCell.js | 122 + lib/vc-table/src/TableHeader.js | 107 + lib/vc-table/src/TableHeaderRow.js | 118 + lib/vc-table/src/TableRow.js | 329 ++ lib/vc-table/src/utils.js | 100 + lib/vc-tabs/src/InkTabBar.js | 26 + lib/vc-tabs/src/InkTabBarMixin.js | 160 + lib/vc-tabs/src/KeyCode.js | 24 + lib/vc-tabs/src/ScrollableInkTabBar.js | 35 + lib/vc-tabs/src/ScrollableTabBar.js | 31 + lib/vc-tabs/src/ScrollableTabBarMixin.js | 334 ++ lib/vc-tabs/src/TabBar.js | 38 + lib/vc-tabs/src/TabBarMixin.js | 165 + lib/vc-tabs/src/TabContent.js | 72 + lib/vc-tabs/src/TabPane.js | 71 + lib/vc-tabs/src/Tabs.js | 281 ++ lib/vc-tabs/src/utils.js | 105 + lib/vc-time-picker/Combobox.js | 248 ++ lib/vc-time-picker/Header.js | 231 + lib/vc-time-picker/Panel.js | 242 ++ lib/vc-time-picker/Select.js | 173 + lib/vc-time-picker/TimePicker.js | 386 ++ lib/vc-time-picker/assets/index.less | 14 + lib/vc-time-picker/assets/index/Header.less | 49 + lib/vc-time-picker/assets/index/Panel.less | 29 + lib/vc-time-picker/assets/index/Picker.less | 23 + lib/vc-time-picker/assets/index/Select.less | 63 + lib/vc-time-picker/index.js | 18 + lib/vc-time-picker/placements.js | 41 + lib/vc-tooltip/Tooltip.js | 130 + lib/vc-tooltip/assets/boostrap/anim.less | 58 + lib/vc-tooltip/assets/bootstrap.less | 164 + lib/vc-tooltip/assets/bootstrap_white.less | 190 + lib/vc-tooltip/index.js | 14 + lib/vc-tooltip/placements.js | 88 + lib/vc-tree-select/assets/icons.png | Bin 0 -> 11173 bytes lib/vc-tree-select/assets/index.less | 2 + lib/vc-tree-select/assets/select.less | 500 +++ lib/vc-tree-select/assets/tree.less | 164 + lib/vc-tree-select/demo/basic.js | 416 ++ lib/vc-tree-select/demo/big-data-generator.js | 98 + lib/vc-tree-select/demo/big-data.js | 110 + lib/vc-tree-select/demo/demo.less | 15 + lib/vc-tree-select/demo/disable.js | 98 + lib/vc-tree-select/demo/dynamic.js | 73 + lib/vc-tree-select/demo/filter.js | 115 + lib/vc-tree-select/demo/form.js | 197 + lib/vc-tree-select/demo/styles.js | 16 + lib/vc-tree-select/demo/util.js | 164 + lib/vc-tree-select/index.js | 40 + lib/vc-tree-select/src/PropTypes.js | 95 + lib/vc-tree-select/src/Select.js | 1167 +++++ lib/vc-tree-select/src/SelectTrigger.js | 413 ++ lib/vc-tree-select/src/TreeNode.js | 25 + lib/vc-tree-select/src/index.js | 56 + lib/vc-tree-select/src/strategies.js | 8 + lib/vc-tree-select/src/util.js | 652 +++ lib/vc-tree/assets/icons.png | Bin 0 -> 11173 bytes lib/vc-tree/assets/index.less | 192 + lib/vc-tree/demo/basic.js | 194 + lib/vc-tree/demo/basic.less | 6 + lib/vc-tree/demo/contextmenu.less | 18 + lib/vc-tree/demo/draggable.less | 11 + lib/vc-tree/demo/util.js | 208 + lib/vc-tree/index.js | 3 + lib/vc-tree/src/Tree.js | 668 +++ lib/vc-tree/src/TreeNode.js | 667 +++ lib/vc-tree/src/index.js | 49 + lib/vc-tree/src/util.js | 478 ++ lib/vc-upload/demo/beforeUpload.js | 59 + lib/vc-upload/demo/drag.js | 45 + lib/vc-upload/demo/simple.js | 122 + lib/vc-upload/index.js | 14 + lib/vc-upload/src/AjaxUploader.js | 262 ++ lib/vc-upload/src/IframeUploader.js | 284 ++ lib/vc-upload/src/Upload.js | 129 + lib/vc-upload/src/attr-accept.js | 31 + lib/vc-upload/src/index.js | 15 + lib/vc-upload/src/request.js | 104 + lib/vc-upload/src/uid.js | 13 + lib/version/index.js | 10 + lib/version/style/css.js | 3 + lib/version/style/index.js | 3 + 2069 files changed, 218734 insertions(+), 7 deletions(-) create mode 100644 es/_util/BaseMixin.js create mode 100644 es/_util/ContainerRender.js create mode 100644 es/_util/Dom/addEventListener.js create mode 100644 es/_util/Dom/class-util.js create mode 100644 es/_util/Dom/contains.js create mode 100644 es/_util/KeyCode.js create mode 100644 es/_util/StateMixin.js create mode 100644 es/_util/antRefDirective.js create mode 100644 es/_util/callMoment.js create mode 100644 es/_util/createChainedFunction.js create mode 100644 es/_util/css-animation/Event.js create mode 100644 es/_util/css-animation/index.js create mode 100644 es/_util/getLocale.js create mode 100644 es/_util/getRequestAnimationFrame.js create mode 100644 es/_util/getScroll.js create mode 100644 es/_util/getScrollBarSize.js create mode 100644 es/_util/getTransitionProps.js create mode 100644 es/_util/interopDefault.js create mode 100644 es/_util/isCssAnimationSupported.js create mode 100644 es/_util/isFlexSupported.js create mode 100644 es/_util/openAnimation.js create mode 100644 es/_util/props-util.js create mode 100644 es/_util/requestAnimationTimeout.js create mode 100644 es/_util/store/PropTypes.js create mode 100644 es/_util/store/Provider.js create mode 100644 es/_util/store/connect.js create mode 100644 es/_util/store/create.js create mode 100644 es/_util/store/index.js create mode 100644 es/_util/throttleByAnimationFrame.js create mode 100644 es/_util/triggerEvent.js create mode 100644 es/_util/vnode.js create mode 100644 es/_util/vue-types/index.js create mode 100644 es/_util/vue-types/utils.js create mode 100644 es/_util/warning.js create mode 100644 es/affix/index.js create mode 100644 es/affix/style/css.js create mode 100644 es/affix/style/index.css create mode 100644 es/affix/style/index.js create mode 100644 es/affix/style/index.less create mode 100644 es/alert/index.js create mode 100644 es/alert/style/css.js create mode 100644 es/alert/style/index.css create mode 100644 es/alert/style/index.js create mode 100644 es/alert/style/index.less create mode 100644 es/align/Align.js create mode 100644 es/align/index.js create mode 100644 es/align/isWindow.js create mode 100644 es/anchor/Anchor.js create mode 100644 es/anchor/AnchorLink.js create mode 100644 es/anchor/index.js create mode 100644 es/anchor/style/css.js create mode 100644 es/anchor/style/index.css create mode 100644 es/anchor/style/index.js create mode 100644 es/anchor/style/index.less create mode 100644 es/auto-complete/InputElement.js create mode 100644 es/auto-complete/index.js create mode 100644 es/auto-complete/style/css.js create mode 100644 es/auto-complete/style/index.css create mode 100644 es/auto-complete/style/index.js create mode 100644 es/auto-complete/style/index.less create mode 100644 es/avatar/Avatar.js create mode 100644 es/avatar/index.js create mode 100644 es/avatar/style/css.js create mode 100644 es/avatar/style/index.css create mode 100644 es/avatar/style/index.js create mode 100644 es/avatar/style/index.less create mode 100644 es/back-top/index.js create mode 100644 es/back-top/style/css.js create mode 100644 es/back-top/style/index.css create mode 100644 es/back-top/style/index.js create mode 100644 es/back-top/style/index.less create mode 100644 es/back-top/style/responsive.less create mode 100644 es/badge/Badge.js create mode 100644 es/badge/ScrollNumber.js create mode 100644 es/badge/index.js create mode 100644 es/badge/style/css.js create mode 100644 es/badge/style/index.css create mode 100644 es/badge/style/index.js create mode 100644 es/badge/style/index.less create mode 100644 es/breadcrumb/Breadcrumb.js create mode 100644 es/breadcrumb/BreadcrumbItem.js create mode 100644 es/breadcrumb/index.js create mode 100644 es/breadcrumb/style/css.js create mode 100644 es/breadcrumb/style/index.css create mode 100644 es/breadcrumb/style/index.js create mode 100644 es/breadcrumb/style/index.less create mode 100644 es/button/button-group.js create mode 100644 es/button/button.js create mode 100644 es/button/buttonTypes.js create mode 100644 es/button/index.js create mode 100644 es/button/style/css.js create mode 100644 es/button/style/index.css create mode 100644 es/button/style/index.js create mode 100644 es/button/style/index.less create mode 100644 es/button/style/mixin.less create mode 100644 es/calendar/Constants.js create mode 100644 es/calendar/Header.js create mode 100644 es/calendar/index.js create mode 100644 es/calendar/locale/ar_EG.js create mode 100644 es/calendar/locale/bg_BG.js create mode 100644 es/calendar/locale/ca_ES.js create mode 100644 es/calendar/locale/cs_CZ.js create mode 100644 es/calendar/locale/de_DE.js create mode 100644 es/calendar/locale/el_GR.js create mode 100644 es/calendar/locale/en_GB.js create mode 100644 es/calendar/locale/en_US.js create mode 100644 es/calendar/locale/es_ES.js create mode 100644 es/calendar/locale/et_EE.js create mode 100644 es/calendar/locale/fa_IR.js create mode 100644 es/calendar/locale/fi_FI.js create mode 100644 es/calendar/locale/fr_BE.js create mode 100644 es/calendar/locale/fr_FR.js create mode 100644 es/calendar/locale/is_IS.js create mode 100644 es/calendar/locale/it_IT.js create mode 100644 es/calendar/locale/ja_JP.js create mode 100644 es/calendar/locale/ko_KR.js create mode 100755 es/calendar/locale/ku_IQ.js create mode 100644 es/calendar/locale/nb_NO.js create mode 100644 es/calendar/locale/nl_BE.js create mode 100644 es/calendar/locale/nl_NL.js create mode 100644 es/calendar/locale/pl_PL.js create mode 100644 es/calendar/locale/pt_BR.js create mode 100644 es/calendar/locale/pt_PT.js create mode 100644 es/calendar/locale/ru_RU.js create mode 100644 es/calendar/locale/sk_SK.js create mode 100644 es/calendar/locale/sl_SI.js create mode 100644 es/calendar/locale/sr_RS.js create mode 100644 es/calendar/locale/sv_SE.js create mode 100644 es/calendar/locale/th_TH.js create mode 100644 es/calendar/locale/tr_TR.js create mode 100644 es/calendar/locale/uk_UA.js create mode 100644 es/calendar/locale/vi_VN.js create mode 100644 es/calendar/locale/zh_CN.js create mode 100644 es/calendar/locale/zh_TW.js create mode 100644 es/calendar/style/css.js create mode 100644 es/calendar/style/index.css create mode 100644 es/calendar/style/index.js create mode 100644 es/calendar/style/index.less create mode 100644 es/card/Card.js create mode 100644 es/card/Grid.js create mode 100644 es/card/Meta.js create mode 100644 es/card/index.js create mode 100644 es/card/style/css.js create mode 100644 es/card/style/index.css create mode 100644 es/card/style/index.js create mode 100644 es/card/style/index.less create mode 100644 es/carousel/index.js create mode 100644 es/carousel/style/css.js create mode 100644 es/carousel/style/index.css create mode 100644 es/carousel/style/index.js create mode 100644 es/carousel/style/index.less create mode 100644 es/cascader/index.js create mode 100644 es/cascader/style/css.js create mode 100644 es/cascader/style/index.css create mode 100644 es/cascader/style/index.js create mode 100644 es/cascader/style/index.less create mode 100644 es/checkbox/Checkbox.js create mode 100644 es/checkbox/Group.js create mode 100644 es/checkbox/index.js create mode 100644 es/checkbox/style/css.js create mode 100644 es/checkbox/style/index.css create mode 100644 es/checkbox/style/index.js create mode 100644 es/checkbox/style/index.less create mode 100644 es/checkbox/style/mixin.less create mode 100644 es/col/index.js create mode 100644 es/col/style/css.js create mode 100644 es/col/style/index.js create mode 100644 es/collapse/Collapse.js create mode 100644 es/collapse/CollapsePanel.js create mode 100644 es/collapse/index.js create mode 100644 es/collapse/src/Collapse.js create mode 100644 es/collapse/src/Panel.js create mode 100644 es/collapse/src/PanelContent.js create mode 100644 es/collapse/src/commonProps.js create mode 100644 es/collapse/src/index.js create mode 100644 es/collapse/src/openAnimationFactory.js create mode 100644 es/collapse/style/css.js create mode 100644 es/collapse/style/index.css create mode 100644 es/collapse/style/index.js create mode 100644 es/collapse/style/index.less create mode 100644 es/date-picker/RangePicker.js create mode 100644 es/date-picker/WeekPicker.js create mode 100644 es/date-picker/createPicker.js create mode 100755 es/date-picker/index.js create mode 100644 es/date-picker/interface.js create mode 100644 es/date-picker/locale/ar_EG.js create mode 100644 es/date-picker/locale/bg_BG.js create mode 100644 es/date-picker/locale/ca_ES.js create mode 100644 es/date-picker/locale/cs_CZ.js create mode 100644 es/date-picker/locale/de_DE.js create mode 100644 es/date-picker/locale/el_GR.js create mode 100644 es/date-picker/locale/en_GB.js create mode 100644 es/date-picker/locale/en_US.js create mode 100644 es/date-picker/locale/es_ES.js create mode 100644 es/date-picker/locale/et_EE.js create mode 100644 es/date-picker/locale/fa_IR.js create mode 100644 es/date-picker/locale/fi_FI.js create mode 100644 es/date-picker/locale/fr_BE.js create mode 100644 es/date-picker/locale/fr_FR.js create mode 100644 es/date-picker/locale/is_IS.js create mode 100644 es/date-picker/locale/it_IT.js create mode 100644 es/date-picker/locale/ja_JP.js create mode 100644 es/date-picker/locale/ko_KR.js create mode 100755 es/date-picker/locale/ku_IQ.js create mode 100644 es/date-picker/locale/nb_NO.js create mode 100644 es/date-picker/locale/nl_BE.js create mode 100644 es/date-picker/locale/nl_NL.js create mode 100644 es/date-picker/locale/pl_PL.js create mode 100644 es/date-picker/locale/pt_BR.js create mode 100644 es/date-picker/locale/pt_PT.js create mode 100644 es/date-picker/locale/ru_RU.js create mode 100644 es/date-picker/locale/sk_SK.js create mode 100644 es/date-picker/locale/sl_SI.js create mode 100644 es/date-picker/locale/sr_RS.js create mode 100644 es/date-picker/locale/sv_SE.js create mode 100644 es/date-picker/locale/th_TH.js create mode 100644 es/date-picker/locale/tr_TR.js create mode 100644 es/date-picker/locale/uk_UA.js create mode 100644 es/date-picker/locale/vi_VN.js create mode 100644 es/date-picker/locale/zh_CN.js create mode 100644 es/date-picker/locale/zh_TW.js create mode 100644 es/date-picker/style/Calendar.less create mode 100644 es/date-picker/style/DecadePanel.less create mode 100644 es/date-picker/style/MonthPanel.less create mode 100644 es/date-picker/style/MonthPicker.less create mode 100644 es/date-picker/style/Picker.less create mode 100644 es/date-picker/style/RangePicker.less create mode 100644 es/date-picker/style/TimePicker.less create mode 100644 es/date-picker/style/WeekPicker.less create mode 100644 es/date-picker/style/YearPanel.less create mode 100644 es/date-picker/style/css.js create mode 100644 es/date-picker/style/index.css create mode 100644 es/date-picker/style/index.js create mode 100644 es/date-picker/style/index.less create mode 100644 es/date-picker/wrapPicker.js create mode 100644 es/divider/index.js create mode 100644 es/divider/style/css.js create mode 100644 es/divider/style/index.css create mode 100644 es/divider/style/index.js create mode 100644 es/divider/style/index.less create mode 100644 es/dropdown/dropdown-button.js create mode 100644 es/dropdown/dropdown.js create mode 100644 es/dropdown/getDropdownProps.js create mode 100644 es/dropdown/index.js create mode 100644 es/dropdown/src/Dropdown.js create mode 100644 es/dropdown/src/index.js create mode 100644 es/dropdown/src/placements.js create mode 100644 es/dropdown/style/css.js create mode 100644 es/dropdown/style/index.css create mode 100644 es/dropdown/style/index.js create mode 100644 es/dropdown/style/index.less create mode 100755 es/form/Form.js create mode 100644 es/form/FormItem.js create mode 100644 es/form/constants.js create mode 100644 es/form/index.js create mode 100644 es/form/style/css.js create mode 100644 es/form/style/index.css create mode 100644 es/form/style/index.js create mode 100644 es/form/style/index.less create mode 100644 es/form/style/mixin.less create mode 100644 es/grid/Col.js create mode 100644 es/grid/Row.js create mode 100644 es/grid/index.js create mode 100644 es/grid/style/css.js create mode 100644 es/grid/style/index.css create mode 100644 es/grid/style/index.js create mode 100644 es/grid/style/index.less create mode 100644 es/grid/style/mixin.less create mode 100644 es/icon/icon.js create mode 100644 es/icon/index.js create mode 100644 es/icon/style/css.js create mode 100644 es/icon/style/index.js create mode 100644 es/index.js create mode 100644 es/input-number/index.js create mode 100644 es/input-number/style/css.js create mode 100644 es/input-number/style/index.css create mode 100644 es/input-number/style/index.js create mode 100644 es/input-number/style/index.less create mode 100644 es/input/Group.js create mode 100644 es/input/Input.js create mode 100644 es/input/Search.js create mode 100644 es/input/TextArea.js create mode 100644 es/input/calculateNodeHeight.js create mode 100644 es/input/index.js create mode 100644 es/input/inputProps.js create mode 100644 es/input/style/css.js create mode 100644 es/input/style/index.css create mode 100644 es/input/style/index.js create mode 100644 es/input/style/index.less create mode 100644 es/input/style/mixin.less create mode 100644 es/input/style/search-input.less create mode 100644 es/layout/Sider.js create mode 100644 es/layout/index.js create mode 100644 es/layout/layout.js create mode 100644 es/layout/style/css.js create mode 100644 es/layout/style/index.css create mode 100644 es/layout/style/index.js create mode 100644 es/layout/style/index.less create mode 100644 es/list/Item.js create mode 100644 es/list/index.js create mode 100644 es/list/style/bordered.less create mode 100644 es/list/style/css.js create mode 100644 es/list/style/index.css create mode 100644 es/list/style/index.js create mode 100644 es/list/style/index.less create mode 100644 es/list/style/responsive.less create mode 100644 es/locale-provider/LocaleReceiver.js create mode 100644 es/locale-provider/ar_EG.js create mode 100644 es/locale-provider/bg_BG.js create mode 100644 es/locale-provider/ca_ES.js create mode 100644 es/locale-provider/cs_CZ.js create mode 100644 es/locale-provider/de_DE.js create mode 100644 es/locale-provider/default.js create mode 100644 es/locale-provider/el_GR.js create mode 100644 es/locale-provider/en_GB.js create mode 100644 es/locale-provider/en_US.js create mode 100644 es/locale-provider/es_ES.js create mode 100644 es/locale-provider/et_EE.js create mode 100644 es/locale-provider/fa_IR.js create mode 100644 es/locale-provider/fi_FI.js create mode 100644 es/locale-provider/fr_BE.js create mode 100644 es/locale-provider/fr_FR.js create mode 100644 es/locale-provider/index.js create mode 100644 es/locale-provider/is_IS.js create mode 100644 es/locale-provider/it_IT.js create mode 100644 es/locale-provider/ja_JP.js create mode 100644 es/locale-provider/ko_KR.js create mode 100755 es/locale-provider/ku_IQ.js create mode 100644 es/locale-provider/nb_NO.js create mode 100644 es/locale-provider/nl_BE.js create mode 100644 es/locale-provider/nl_NL.js create mode 100644 es/locale-provider/pl_PL.js create mode 100644 es/locale-provider/pt_BR.js create mode 100644 es/locale-provider/pt_PT.js create mode 100644 es/locale-provider/ru_RU.js create mode 100644 es/locale-provider/sk_SK.js create mode 100644 es/locale-provider/sl_SI.js create mode 100644 es/locale-provider/sr_RS.js create mode 100644 es/locale-provider/style/css.js create mode 100644 es/locale-provider/style/index.css create mode 100644 es/locale-provider/style/index.js create mode 100644 es/locale-provider/style/index.less create mode 100644 es/locale-provider/sv_SE.js create mode 100644 es/locale-provider/th_TH.js create mode 100644 es/locale-provider/tr_TR.js create mode 100644 es/locale-provider/uk_UA.js create mode 100644 es/locale-provider/vi_VN.js create mode 100644 es/locale-provider/zh_CN.js create mode 100644 es/locale-provider/zh_TW.js create mode 100644 es/menu/MenuItem.js create mode 100644 es/menu/index.js create mode 100644 es/menu/style/css.js create mode 100644 es/menu/style/dark.less create mode 100644 es/menu/style/index.css create mode 100644 es/menu/style/index.js create mode 100644 es/menu/style/index.less create mode 100644 es/message/index.js create mode 100644 es/message/style/css.js create mode 100644 es/message/style/index.css create mode 100644 es/message/style/index.js create mode 100644 es/message/style/index.less create mode 100644 es/modal/ActionButton.js create mode 100644 es/modal/ConfirmDialog.js create mode 100644 es/modal/Modal.js create mode 100644 es/modal/confirm.js create mode 100644 es/modal/index.js create mode 100644 es/modal/locale.js create mode 100644 es/modal/style/confirm.less create mode 100644 es/modal/style/css.js create mode 100644 es/modal/style/index.css create mode 100644 es/modal/style/index.js create mode 100644 es/modal/style/index.less create mode 100644 es/modal/style/modal.less create mode 100644 es/notification/index.js create mode 100644 es/notification/style/css.js create mode 100644 es/notification/style/index.css create mode 100644 es/notification/style/index.js create mode 100644 es/notification/style/index.less create mode 100644 es/pagination/MiniSelect.js create mode 100644 es/pagination/Pagination.js create mode 100644 es/pagination/index.js create mode 100644 es/pagination/style/css.js create mode 100644 es/pagination/style/index.css create mode 100644 es/pagination/style/index.js create mode 100644 es/pagination/style/index.less create mode 100644 es/popconfirm/index.js create mode 100644 es/popconfirm/style/css.js create mode 100644 es/popconfirm/style/index.js create mode 100644 es/popover/index.js create mode 100644 es/popover/style/css.js create mode 100644 es/popover/style/index.css create mode 100644 es/popover/style/index.js create mode 100644 es/popover/style/index.less create mode 100644 es/progress/index.js create mode 100644 es/progress/progress.js create mode 100644 es/progress/style/css.js create mode 100644 es/progress/style/index.css create mode 100644 es/progress/style/index.js create mode 100644 es/progress/style/index.less create mode 100644 es/radio/Group.js create mode 100644 es/radio/Radio.js create mode 100644 es/radio/index.js create mode 100644 es/radio/style/css.js create mode 100644 es/radio/style/index.css create mode 100644 es/radio/style/index.js create mode 100644 es/radio/style/index.less create mode 100644 es/rate/index.js create mode 100644 es/rate/style/css.js create mode 100644 es/rate/style/index.css create mode 100644 es/rate/style/index.js create mode 100644 es/rate/style/index.less create mode 100644 es/row/index.js create mode 100644 es/row/style/css.js create mode 100644 es/row/style/index.js create mode 100644 es/select/index.js create mode 100644 es/select/style/css.js create mode 100644 es/select/style/index.css create mode 100644 es/select/style/index.js create mode 100644 es/select/style/index.less create mode 100644 es/slider/index.js create mode 100644 es/slider/style/css.js create mode 100644 es/slider/style/index.css create mode 100644 es/slider/style/index.js create mode 100644 es/slider/style/index.less create mode 100644 es/spin/Spin.js create mode 100644 es/spin/index.js create mode 100644 es/spin/style/css.js create mode 100644 es/spin/style/index.css create mode 100644 es/spin/style/index.js create mode 100644 es/spin/style/index.less create mode 100644 es/steps/index.js create mode 100644 es/steps/style/css.js create mode 100644 es/steps/style/custom-icon.less create mode 100644 es/steps/style/index.css create mode 100644 es/steps/style/index.js create mode 100644 es/steps/style/index.less create mode 100644 es/steps/style/label-placement.less create mode 100644 es/steps/style/progress-dot.less create mode 100644 es/steps/style/small.less create mode 100644 es/steps/style/vertical.less create mode 100644 es/style.js create mode 100644 es/style/color/bezierEasing.less create mode 100644 es/style/color/colorPalette.less create mode 100644 es/style/color/colors.less create mode 100644 es/style/color/tinyColor.less create mode 100644 es/style/core/base.less create mode 100644 es/style/core/iconfont.less create mode 100644 es/style/core/index.less create mode 100644 es/style/core/motion.less create mode 100644 es/style/core/motion/fade.less create mode 100644 es/style/core/motion/move.less create mode 100644 es/style/core/motion/other.less create mode 100644 es/style/core/motion/slide.less create mode 100644 es/style/core/motion/swing.less create mode 100644 es/style/core/motion/zoom.less create mode 100644 es/style/css.js create mode 100644 es/style/index.css create mode 100644 es/style/index.js create mode 100644 es/style/index.less create mode 100644 es/style/mixins/clearfix.less create mode 100644 es/style/mixins/compatibility.less create mode 100644 es/style/mixins/iconfont.less create mode 100644 es/style/mixins/index.less create mode 100644 es/style/mixins/motion.less create mode 100644 es/style/mixins/reset.less create mode 100644 es/style/mixins/size.less create mode 100644 es/style/themes/default.less create mode 100644 es/style/v2-compatible-reset.css create mode 100644 es/style/v2-compatible-reset.js create mode 100644 es/style/v2-compatible-reset.less create mode 100644 es/switch/index.js create mode 100644 es/switch/style/css.js create mode 100644 es/switch/style/index.css create mode 100644 es/switch/style/index.js create mode 100644 es/switch/style/index.less create mode 100644 es/table/Column.js create mode 100644 es/table/ColumnGroup.js create mode 100644 es/table/FilterDropdownMenuWrapper.js create mode 100644 es/table/SelectionBox.js create mode 100644 es/table/SelectionCheckboxAll.js create mode 100755 es/table/Table.js create mode 100644 es/table/createBodyRow.js create mode 100644 es/table/createStore.js create mode 100755 es/table/filterDropdown.js create mode 100644 es/table/index.js create mode 100644 es/table/interface.js create mode 100644 es/table/style/css.js create mode 100644 es/table/style/index.css create mode 100644 es/table/style/index.js create mode 100644 es/table/style/index.less create mode 100644 es/table/style/size.less create mode 100644 es/table/util.js create mode 100644 es/tabs/index.js create mode 100644 es/tabs/style/card-style.less create mode 100644 es/tabs/style/css.js create mode 100644 es/tabs/style/index.css create mode 100644 es/tabs/style/index.js create mode 100644 es/tabs/style/index.less create mode 100644 es/tabs/tabs.js create mode 100644 es/tag/CheckableTag.js create mode 100644 es/tag/Tag.js create mode 100644 es/tag/index.js create mode 100644 es/tag/style/css.js create mode 100644 es/tag/style/index.css create mode 100644 es/tag/style/index.js create mode 100644 es/tag/style/index.less create mode 100644 es/time-picker/index.js create mode 100644 es/time-picker/locale/ar_EG.js create mode 100644 es/time-picker/locale/bg_BG.js create mode 100644 es/time-picker/locale/ca_ES.js create mode 100644 es/time-picker/locale/cs_CZ.js create mode 100644 es/time-picker/locale/de_DE.js create mode 100644 es/time-picker/locale/el_GR.js create mode 100644 es/time-picker/locale/en_GB.js create mode 100644 es/time-picker/locale/en_US.js create mode 100644 es/time-picker/locale/es_ES.js create mode 100644 es/time-picker/locale/et_EE.js create mode 100644 es/time-picker/locale/fa_IR.js create mode 100644 es/time-picker/locale/fi_FI.js create mode 100644 es/time-picker/locale/fr_BE.js create mode 100644 es/time-picker/locale/fr_FR.js create mode 100644 es/time-picker/locale/is_IS.js create mode 100644 es/time-picker/locale/it_IT.js create mode 100644 es/time-picker/locale/ja_JP.js create mode 100644 es/time-picker/locale/ko_KR.js create mode 100755 es/time-picker/locale/ku_IQ.js create mode 100644 es/time-picker/locale/nb_NO.js create mode 100644 es/time-picker/locale/nl_BE.js create mode 100644 es/time-picker/locale/nl_NL.js create mode 100644 es/time-picker/locale/pl_PL.js create mode 100644 es/time-picker/locale/pt_BR.js create mode 100644 es/time-picker/locale/pt_PT.js create mode 100644 es/time-picker/locale/ru_RU.js create mode 100644 es/time-picker/locale/sk_SK.js create mode 100644 es/time-picker/locale/sl_SI.js create mode 100644 es/time-picker/locale/sr_RS.js create mode 100644 es/time-picker/locale/sv_SE.js create mode 100644 es/time-picker/locale/th_TH.js create mode 100644 es/time-picker/locale/tr_TR.js create mode 100644 es/time-picker/locale/uk_UA.js create mode 100644 es/time-picker/locale/vi_VN.js create mode 100644 es/time-picker/locale/zh_CN.js create mode 100644 es/time-picker/locale/zh_TW.js create mode 100644 es/time-picker/style/css.js create mode 100644 es/time-picker/style/index.css create mode 100644 es/time-picker/style/index.js create mode 100644 es/time-picker/style/index.less create mode 100644 es/timeline/Timeline.js create mode 100644 es/timeline/TimelineItem.js create mode 100644 es/timeline/index.js create mode 100644 es/timeline/style/css.js create mode 100644 es/timeline/style/index.css create mode 100644 es/timeline/style/index.js create mode 100644 es/timeline/style/index.less create mode 100644 es/tooltip/Tooltip.js create mode 100644 es/tooltip/abstractTooltipProps.js create mode 100644 es/tooltip/index.js create mode 100644 es/tooltip/placements.js create mode 100644 es/tooltip/style/css.js create mode 100644 es/tooltip/style/index.css create mode 100644 es/tooltip/style/index.js create mode 100644 es/tooltip/style/index.less create mode 100644 es/transfer/index.js create mode 100644 es/transfer/item.js create mode 100644 es/transfer/list.js create mode 100644 es/transfer/operation.js create mode 100644 es/transfer/search.js create mode 100644 es/transfer/style/css.js create mode 100644 es/transfer/style/index.css create mode 100644 es/transfer/style/index.js create mode 100644 es/transfer/style/index.less create mode 100644 es/tree-select/index.js create mode 100644 es/tree-select/interface.js create mode 100644 es/tree-select/style/css.js create mode 100644 es/tree-select/style/index.css create mode 100644 es/tree-select/style/index.js create mode 100644 es/tree-select/style/index.less create mode 100644 es/tree/index.js create mode 100644 es/tree/style/css.js create mode 100644 es/tree/style/index.css create mode 100644 es/tree/style/index.js create mode 100644 es/tree/style/index.less create mode 100644 es/tree/style/mixin.less create mode 100644 es/trigger/LazyRenderBox.js create mode 100644 es/trigger/Popup.js create mode 100644 es/trigger/PopupInner.js create mode 100644 es/trigger/Trigger.js create mode 100644 es/trigger/assets/index.less create mode 100644 es/trigger/assets/mask.less create mode 100644 es/trigger/index.js create mode 100644 es/trigger/utils.js create mode 100644 es/upload/Dragger.js create mode 100644 es/upload/Upload.js create mode 100644 es/upload/UploadList.js create mode 100644 es/upload/index.js create mode 100755 es/upload/interface.js create mode 100644 es/upload/style/css.js create mode 100644 es/upload/style/index.css create mode 100644 es/upload/style/index.js create mode 100644 es/upload/style/index.less create mode 100644 es/upload/utils.js create mode 100644 es/vc-calendar/assets/common/Calendar.less create mode 100644 es/vc-calendar/assets/common/FullCalendar.less create mode 100644 es/vc-calendar/assets/common/Picker.less create mode 100644 es/vc-calendar/assets/common/RangeCalendar.less create mode 100644 es/vc-calendar/assets/common/index.less create mode 100644 es/vc-calendar/assets/index.less create mode 100644 es/vc-calendar/assets/index/Calendar.less create mode 100644 es/vc-calendar/assets/index/DecadePanel.less create mode 100644 es/vc-calendar/assets/index/Input.less create mode 100644 es/vc-calendar/assets/index/MonthPanel.less create mode 100644 es/vc-calendar/assets/index/Picker.less create mode 100644 es/vc-calendar/assets/index/Time.less create mode 100644 es/vc-calendar/assets/index/TimePanel.less create mode 100644 es/vc-calendar/assets/index/YearPanel.less create mode 100644 es/vc-calendar/index.js create mode 100644 es/vc-calendar/src/Calendar.js create mode 100644 es/vc-calendar/src/FullCalendar.js create mode 100644 es/vc-calendar/src/MonthCalendar.js create mode 100644 es/vc-calendar/src/Picker.js create mode 100644 es/vc-calendar/src/RangeCalendar.js create mode 100644 es/vc-calendar/src/calendar/CalendarFooter.js create mode 100644 es/vc-calendar/src/calendar/CalendarHeader.js create mode 100644 es/vc-calendar/src/calendar/OkButton.js create mode 100644 es/vc-calendar/src/calendar/TimePickerButton.js create mode 100644 es/vc-calendar/src/calendar/TodayButton.js create mode 100644 es/vc-calendar/src/date/DateConstants.js create mode 100644 es/vc-calendar/src/date/DateInput.js create mode 100644 es/vc-calendar/src/date/DateTBody.js create mode 100644 es/vc-calendar/src/date/DateTHead.js create mode 100644 es/vc-calendar/src/date/DateTable.js create mode 100644 es/vc-calendar/src/decade/DecadePanel.js create mode 100644 es/vc-calendar/src/full-calendar/CalendarHeader.js create mode 100644 es/vc-calendar/src/index.js create mode 100644 es/vc-calendar/src/locale/ar_EG.js create mode 100644 es/vc-calendar/src/locale/bg_BG.js create mode 100644 es/vc-calendar/src/locale/ca_ES.js create mode 100644 es/vc-calendar/src/locale/cs_CZ.js create mode 100644 es/vc-calendar/src/locale/da_DK.js create mode 100644 es/vc-calendar/src/locale/de_DE.js create mode 100644 es/vc-calendar/src/locale/el_GR.js create mode 100644 es/vc-calendar/src/locale/en_GB.js create mode 100644 es/vc-calendar/src/locale/en_US.js create mode 100644 es/vc-calendar/src/locale/es_ES.js create mode 100644 es/vc-calendar/src/locale/et_EE.js create mode 100644 es/vc-calendar/src/locale/fa_IR.js create mode 100644 es/vc-calendar/src/locale/fi_FI.js create mode 100644 es/vc-calendar/src/locale/fr_BE.js create mode 100644 es/vc-calendar/src/locale/fr_FR.js create mode 100644 es/vc-calendar/src/locale/hu_HU.js create mode 100644 es/vc-calendar/src/locale/is_IS.js create mode 100644 es/vc-calendar/src/locale/it_IT.js create mode 100644 es/vc-calendar/src/locale/ja_JP.js create mode 100644 es/vc-calendar/src/locale/ko_KR.js create mode 100644 es/vc-calendar/src/locale/ku_IQ.js create mode 100644 es/vc-calendar/src/locale/nb_NO.js create mode 100644 es/vc-calendar/src/locale/nl_BE.js create mode 100644 es/vc-calendar/src/locale/nl_NL.js create mode 100644 es/vc-calendar/src/locale/pl_PL.js create mode 100644 es/vc-calendar/src/locale/pt_BR.js create mode 100644 es/vc-calendar/src/locale/pt_PT.js create mode 100644 es/vc-calendar/src/locale/ru_RU.js create mode 100644 es/vc-calendar/src/locale/sk_SK.js create mode 100644 es/vc-calendar/src/locale/sl_SI.js create mode 100644 es/vc-calendar/src/locale/sr_RS.js create mode 100644 es/vc-calendar/src/locale/sv_SE.js create mode 100644 es/vc-calendar/src/locale/th_TH.js create mode 100644 es/vc-calendar/src/locale/tr_TR.js create mode 100644 es/vc-calendar/src/locale/ug_CN.js create mode 100644 es/vc-calendar/src/locale/uk_UA.js create mode 100644 es/vc-calendar/src/locale/zh_CN.js create mode 100644 es/vc-calendar/src/locale/zh_TW.js create mode 100644 es/vc-calendar/src/mixin/CalendarMixin.js create mode 100644 es/vc-calendar/src/mixin/CommonMixin.js create mode 100644 es/vc-calendar/src/month/MonthPanel.js create mode 100644 es/vc-calendar/src/month/MonthTable.js create mode 100644 es/vc-calendar/src/picker/placements.js create mode 100644 es/vc-calendar/src/range-calendar/CalendarPart.js create mode 100644 es/vc-calendar/src/util/index.js create mode 100644 es/vc-calendar/src/year/YearPanel.js create mode 100644 es/vc-cascader/Cascader.js create mode 100644 es/vc-cascader/Menus.js create mode 100644 es/vc-cascader/assets/index.less create mode 100644 es/vc-cascader/index.js create mode 100644 es/vc-checkbox/index.js create mode 100644 es/vc-checkbox/src/Checkbox.js create mode 100644 es/vc-checkbox/src/index.js create mode 100644 es/vc-dialog/Dialog.js create mode 100644 es/vc-dialog/DialogWrap.js create mode 100644 es/vc-dialog/IDialogPropTypes.js create mode 100644 es/vc-dialog/LazyRenderBox.js create mode 100644 es/vc-dialog/assets/bootstrap.less create mode 100644 es/vc-dialog/assets/bootstrap/Dialog.less create mode 100644 es/vc-dialog/assets/bootstrap/effect.less create mode 100644 es/vc-dialog/assets/bootstrap/variables.less create mode 100644 es/vc-dialog/assets/index.less create mode 100644 es/vc-dialog/assets/index/Dialog.less create mode 100644 es/vc-dialog/assets/index/Mask.less create mode 100644 es/vc-dialog/index.js create mode 100644 es/vc-form/demo/async-init.js create mode 100644 es/vc-form/demo/dynamic-fields.js create mode 100644 es/vc-form/demo/dynamic.js create mode 100644 es/vc-form/demo/file-input.js create mode 100644 es/vc-form/demo/getFieldDecorator.js create mode 100644 es/vc-form/demo/input-array.js create mode 100644 es/vc-form/demo/modal.js create mode 100644 es/vc-form/demo/nested-field.js create mode 100644 es/vc-form/demo/normalize.js create mode 100644 es/vc-form/demo/overview.js create mode 100644 es/vc-form/demo/parallel-form.js create mode 100644 es/vc-form/demo/start-end-date.js create mode 100644 es/vc-form/demo/styles.js create mode 100644 es/vc-form/demo/suggest.js create mode 100644 es/vc-form/demo/validateFirst.js create mode 100644 es/vc-form/demo/validateTrigger.js create mode 100644 es/vc-form/index.js create mode 100644 es/vc-form/src/createBaseForm.js create mode 100644 es/vc-form/src/createDOMForm.js create mode 100644 es/vc-form/src/createFieldsStore.js create mode 100644 es/vc-form/src/createForm.js create mode 100644 es/vc-form/src/createFormField.js create mode 100644 es/vc-form/src/index.js create mode 100644 es/vc-form/src/propTypes.js create mode 100644 es/vc-form/src/utils.js create mode 100755 es/vc-input-number/assets/index.less create mode 100644 es/vc-input-number/demo/combination-key-format.js create mode 100644 es/vc-input-number/demo/custom.js create mode 100644 es/vc-input-number/demo/precision.js create mode 100644 es/vc-input-number/demo/simple-use-touch.js create mode 100644 es/vc-input-number/demo/simple.js create mode 100644 es/vc-input-number/demo/small-step.js create mode 100755 es/vc-input-number/src/InputHandler.js create mode 100755 es/vc-input-number/src/index.js create mode 100644 es/vc-lazy-load/demo/index.js create mode 100644 es/vc-lazy-load/demo/style.less create mode 100644 es/vc-lazy-load/index.js create mode 100644 es/vc-lazy-load/src/LazyLoad.js create mode 100644 es/vc-lazy-load/src/utils/getElementPosition.js create mode 100644 es/vc-lazy-load/src/utils/inViewport.js create mode 100644 es/vc-lazy-load/src/utils/parentScroll.js create mode 100644 es/vc-m-feedback/demo/simple.js create mode 100644 es/vc-m-feedback/demo/simple.less create mode 100755 es/vc-m-feedback/index.js create mode 100755 es/vc-m-feedback/src/PropTypes.js create mode 100755 es/vc-m-feedback/src/TouchFeedback.js create mode 100644 es/vc-menu/DOMWrap.js create mode 100644 es/vc-menu/Divider.js create mode 100644 es/vc-menu/Menu.js create mode 100644 es/vc-menu/MenuItem.js create mode 100644 es/vc-menu/MenuItemGroup.js create mode 100644 es/vc-menu/MenuMixin.js create mode 100644 es/vc-menu/SubMenu.js create mode 100644 es/vc-menu/SubPopupMenu.js create mode 100644 es/vc-menu/assets/index.less create mode 100644 es/vc-menu/commonPropsType.js create mode 100644 es/vc-menu/index.js create mode 100644 es/vc-menu/placements.js create mode 100644 es/vc-menu/util.js create mode 100644 es/vc-notification/Notice.js create mode 100644 es/vc-notification/Notification.js create mode 100644 es/vc-notification/index.js create mode 100644 es/vc-pagination/KeyCode.js create mode 100644 es/vc-pagination/Options.js create mode 100644 es/vc-pagination/Pager.js create mode 100644 es/vc-pagination/Pagination.js create mode 100644 es/vc-pagination/assets/index.less create mode 100644 es/vc-pagination/index.js create mode 100644 es/vc-pagination/locale/ar_EG.js create mode 100644 es/vc-pagination/locale/bg_BG.js create mode 100644 es/vc-pagination/locale/ca_ES.js create mode 100644 es/vc-pagination/locale/cs_CZ.js create mode 100644 es/vc-pagination/locale/da_DK.js create mode 100644 es/vc-pagination/locale/de_DE.js create mode 100644 es/vc-pagination/locale/el_GR.js create mode 100644 es/vc-pagination/locale/en_GB.js create mode 100644 es/vc-pagination/locale/en_US.js create mode 100644 es/vc-pagination/locale/es_ES.js create mode 100644 es/vc-pagination/locale/et_EE.js create mode 100644 es/vc-pagination/locale/fa_IR.js create mode 100644 es/vc-pagination/locale/fi_FI.js create mode 100644 es/vc-pagination/locale/fr_BE.js create mode 100644 es/vc-pagination/locale/fr_FR.js create mode 100644 es/vc-pagination/locale/hu_HU.js create mode 100644 es/vc-pagination/locale/id_ID.js create mode 100644 es/vc-pagination/locale/is_IS.js create mode 100644 es/vc-pagination/locale/it_IT.js create mode 100644 es/vc-pagination/locale/ja_JP.js create mode 100644 es/vc-pagination/locale/ko_KR.js create mode 100644 es/vc-pagination/locale/ku_IQ.js create mode 100644 es/vc-pagination/locale/nb_NO.js create mode 100644 es/vc-pagination/locale/nl_BE.js create mode 100644 es/vc-pagination/locale/nl_NL.js create mode 100644 es/vc-pagination/locale/pl_PL.js create mode 100644 es/vc-pagination/locale/pt_BR.js create mode 100644 es/vc-pagination/locale/pt_PT.js create mode 100644 es/vc-pagination/locale/ru_RU.js create mode 100644 es/vc-pagination/locale/sk_SK.js create mode 100644 es/vc-pagination/locale/sl_SI.js create mode 100644 es/vc-pagination/locale/sr_RS.js create mode 100644 es/vc-pagination/locale/sv_SE.js create mode 100644 es/vc-pagination/locale/th_TH.js create mode 100644 es/vc-pagination/locale/tr_TR.js create mode 100644 es/vc-pagination/locale/ug_CN.js create mode 100644 es/vc-pagination/locale/uk_UA.js create mode 100644 es/vc-pagination/locale/vi_VN.js create mode 100644 es/vc-pagination/locale/zh_CN.js create mode 100644 es/vc-pagination/locale/zh_TW.js create mode 100644 es/vc-progress/assets/index.less create mode 100644 es/vc-progress/demo/fast-progress.js create mode 100644 es/vc-progress/demo/gap.js create mode 100644 es/vc-progress/demo/simple.js create mode 100644 es/vc-progress/index.js create mode 100644 es/vc-progress/src/Circle.js create mode 100644 es/vc-progress/src/Line.js create mode 100644 es/vc-progress/src/enhancer.js create mode 100644 es/vc-progress/src/index.js create mode 100644 es/vc-progress/src/types.js create mode 100644 es/vc-rate/assets/index.less create mode 100644 es/vc-rate/demo/simple.js create mode 100644 es/vc-rate/index.js create mode 100644 es/vc-rate/src/Rate.js create mode 100644 es/vc-rate/src/Star.js create mode 100644 es/vc-rate/src/index.js create mode 100644 es/vc-rate/src/util.js create mode 100644 es/vc-select/DropdownMenu.js create mode 100644 es/vc-select/OptGroup.js create mode 100644 es/vc-select/Option.js create mode 100644 es/vc-select/PropTypes.js create mode 100644 es/vc-select/Select.js create mode 100644 es/vc-select/SelectTrigger.js create mode 100644 es/vc-select/assets/index.less create mode 100644 es/vc-select/demo/tbFetchSuggest.js create mode 100644 es/vc-select/index.js create mode 100644 es/vc-select/util.js create mode 100644 es/vc-slick/assets/docs.less create mode 100644 es/vc-slick/assets/fonts/slick.svg create mode 100644 es/vc-slick/assets/index.less create mode 100644 es/vc-slick/assets/slick-theme.less create mode 100644 es/vc-slick/assets/slick.less create mode 100644 es/vc-slick/demo/AdaptiveHeight.js create mode 100644 es/vc-slick/demo/AppendDots.js create mode 100644 es/vc-slick/demo/AsNavFor.js create mode 100644 es/vc-slick/demo/AutoPlay.js create mode 100644 es/vc-slick/demo/AutoPlayMethods.js create mode 100644 es/vc-slick/demo/CenterMode.js create mode 100644 es/vc-slick/demo/CustomArrows.js create mode 100644 es/vc-slick/demo/CustomPaging.js create mode 100644 es/vc-slick/demo/CustomSlides.js create mode 100644 es/vc-slick/demo/DynamicSlides.js create mode 100644 es/vc-slick/demo/Fade.js create mode 100644 es/vc-slick/demo/FocusOnSelect.js create mode 100644 es/vc-slick/demo/LazyLoad.js create mode 100644 es/vc-slick/demo/MultipleItems.js create mode 100644 es/vc-slick/demo/MultipleRows.js create mode 100644 es/vc-slick/demo/PauseOnHover.js create mode 100644 es/vc-slick/demo/PreviousNextMethods.js create mode 100644 es/vc-slick/demo/Resizable.js create mode 100644 es/vc-slick/demo/Responsive.js create mode 100644 es/vc-slick/demo/Rtl.js create mode 100644 es/vc-slick/demo/SimpleSlider.js create mode 100644 es/vc-slick/demo/SlickGoTo.js create mode 100644 es/vc-slick/demo/SlideChangeHooks.js create mode 100644 es/vc-slick/demo/SwipeToSlide.js create mode 100644 es/vc-slick/demo/UnevenSetsFinite.js create mode 100644 es/vc-slick/demo/UnevenSetsInfinite.js create mode 100644 es/vc-slick/demo/VariableWidth.js create mode 100644 es/vc-slick/demo/VerticalMode.js create mode 100644 es/vc-slick/demo/VerticalSwipeToSlide.js create mode 100644 es/vc-slick/demo/config.js create mode 100644 es/vc-slick/demo/imglist.js create mode 100644 es/vc-slick/demo/index.js create mode 100644 es/vc-slick/src/arrows.js create mode 100644 es/vc-slick/src/default-props.js create mode 100644 es/vc-slick/src/dots.js create mode 100644 es/vc-slick/src/index.js create mode 100644 es/vc-slick/src/initial-state.js create mode 100644 es/vc-slick/src/inner-slider.js create mode 100644 es/vc-slick/src/slider.js create mode 100644 es/vc-slick/src/track.js create mode 100644 es/vc-slick/src/utils/innerSliderUtils.js create mode 100644 es/vc-slider/assets/index.less create mode 100644 es/vc-slider/demo/handle.js create mode 100644 es/vc-slider/demo/marks.js create mode 100644 es/vc-slider/demo/range.js create mode 100644 es/vc-slider/demo/slider.js create mode 100644 es/vc-slider/demo/vertical.js create mode 100644 es/vc-slider/index.js create mode 100644 es/vc-slider/src/Handle.js create mode 100644 es/vc-slider/src/Range.js create mode 100644 es/vc-slider/src/Slider.js create mode 100644 es/vc-slider/src/common/Marks.js create mode 100644 es/vc-slider/src/common/Steps.js create mode 100644 es/vc-slider/src/common/Track.js create mode 100644 es/vc-slider/src/common/createSlider.js create mode 100644 es/vc-slider/src/createSliderWithTooltip.js create mode 100644 es/vc-slider/src/index.js create mode 100644 es/vc-slider/src/utils.js create mode 100644 es/vc-steps/Step.js create mode 100644 es/vc-steps/Steps.js create mode 100644 es/vc-steps/assets/custom-icon.less create mode 100644 es/vc-steps/assets/iconfont.less create mode 100644 es/vc-steps/assets/index.less create mode 100644 es/vc-steps/assets/label-placement.less create mode 100644 es/vc-steps/assets/progress-dot.less create mode 100644 es/vc-steps/assets/small.less create mode 100644 es/vc-steps/assets/variables.less create mode 100644 es/vc-steps/assets/vertical.less create mode 100644 es/vc-steps/index.js create mode 100644 es/vc-switch/PropTypes.js create mode 100644 es/vc-switch/Switch.js create mode 100644 es/vc-switch/assets/index.less create mode 100644 es/vc-switch/index.js create mode 100644 es/vc-table/assets/animation.less create mode 100644 es/vc-table/assets/bordered.less create mode 100644 es/vc-table/assets/index.less create mode 100644 es/vc-table/demo/childrenIndent.js create mode 100644 es/vc-table/demo/className.js create mode 100644 es/vc-table/demo/colspan-rowspan.js create mode 100644 es/vc-table/demo/column-resize.js create mode 100644 es/vc-table/demo/dropdown.js create mode 100644 es/vc-table/demo/expandedRowRender.js create mode 100644 es/vc-table/demo/fixedColumns-auto-height.js create mode 100644 es/vc-table/demo/fixedColumns.js create mode 100644 es/vc-table/demo/fixedColumnsAndHeader.js create mode 100644 es/vc-table/demo/fixedColumnsAndHeaderSyncRowHeight.js create mode 100644 es/vc-table/demo/grouping-columns.js create mode 100644 es/vc-table/demo/jsx.js create mode 100644 es/vc-table/demo/key.js create mode 100644 es/vc-table/demo/nested.js create mode 100644 es/vc-table/demo/no-data.js create mode 100644 es/vc-table/demo/rowAndCellClick.js create mode 100644 es/vc-table/demo/scrollX.js create mode 100644 es/vc-table/demo/scrollXY.js create mode 100644 es/vc-table/demo/scrollY.js create mode 100644 es/vc-table/demo/styled-components.js create mode 100644 es/vc-table/demo/subTable.js create mode 100644 es/vc-table/demo/title-and-footer.js create mode 100644 es/vc-table/index.js create mode 100644 es/vc-table/src/BaseTable.js create mode 100644 es/vc-table/src/BodyTable.js create mode 100644 es/vc-table/src/ColGroup.js create mode 100644 es/vc-table/src/Column.js create mode 100644 es/vc-table/src/ColumnGroup.js create mode 100644 es/vc-table/src/ColumnManager.js create mode 100644 es/vc-table/src/ExpandIcon.js create mode 100644 es/vc-table/src/ExpandableRow.js create mode 100644 es/vc-table/src/ExpandableTable.js create mode 100644 es/vc-table/src/HeadTable.js create mode 100644 es/vc-table/src/Table.js create mode 100644 es/vc-table/src/TableCell.js create mode 100644 es/vc-table/src/TableHeader.js create mode 100644 es/vc-table/src/TableHeaderRow.js create mode 100644 es/vc-table/src/TableRow.js create mode 100644 es/vc-table/src/utils.js create mode 100644 es/vc-tabs/src/InkTabBar.js create mode 100644 es/vc-tabs/src/InkTabBarMixin.js create mode 100644 es/vc-tabs/src/KeyCode.js create mode 100644 es/vc-tabs/src/ScrollableInkTabBar.js create mode 100644 es/vc-tabs/src/ScrollableTabBar.js create mode 100644 es/vc-tabs/src/ScrollableTabBarMixin.js create mode 100644 es/vc-tabs/src/TabBar.js create mode 100644 es/vc-tabs/src/TabBarMixin.js create mode 100644 es/vc-tabs/src/TabContent.js create mode 100644 es/vc-tabs/src/TabPane.js create mode 100644 es/vc-tabs/src/Tabs.js create mode 100644 es/vc-tabs/src/utils.js create mode 100644 es/vc-time-picker/Combobox.js create mode 100644 es/vc-time-picker/Header.js create mode 100644 es/vc-time-picker/Panel.js create mode 100644 es/vc-time-picker/Select.js create mode 100644 es/vc-time-picker/TimePicker.js create mode 100644 es/vc-time-picker/assets/index.less create mode 100644 es/vc-time-picker/assets/index/Header.less create mode 100644 es/vc-time-picker/assets/index/Panel.less create mode 100644 es/vc-time-picker/assets/index/Picker.less create mode 100644 es/vc-time-picker/assets/index/Select.less create mode 100644 es/vc-time-picker/index.js create mode 100644 es/vc-time-picker/placements.js create mode 100644 es/vc-tooltip/Tooltip.js create mode 100644 es/vc-tooltip/assets/boostrap/anim.less create mode 100644 es/vc-tooltip/assets/bootstrap.less create mode 100644 es/vc-tooltip/assets/bootstrap_white.less create mode 100644 es/vc-tooltip/index.js create mode 100644 es/vc-tooltip/placements.js create mode 100644 es/vc-tree-select/assets/icons.png create mode 100644 es/vc-tree-select/assets/index.less create mode 100644 es/vc-tree-select/assets/select.less create mode 100644 es/vc-tree-select/assets/tree.less create mode 100644 es/vc-tree-select/demo/basic.js create mode 100644 es/vc-tree-select/demo/big-data-generator.js create mode 100644 es/vc-tree-select/demo/big-data.js create mode 100644 es/vc-tree-select/demo/demo.less create mode 100644 es/vc-tree-select/demo/disable.js create mode 100644 es/vc-tree-select/demo/dynamic.js create mode 100644 es/vc-tree-select/demo/filter.js create mode 100644 es/vc-tree-select/demo/form.js create mode 100644 es/vc-tree-select/demo/styles.js create mode 100644 es/vc-tree-select/demo/util.js create mode 100644 es/vc-tree-select/index.js create mode 100644 es/vc-tree-select/src/PropTypes.js create mode 100644 es/vc-tree-select/src/Select.js create mode 100644 es/vc-tree-select/src/SelectTrigger.js create mode 100644 es/vc-tree-select/src/TreeNode.js create mode 100644 es/vc-tree-select/src/index.js create mode 100644 es/vc-tree-select/src/strategies.js create mode 100644 es/vc-tree-select/src/util.js create mode 100644 es/vc-tree/assets/icons.png create mode 100644 es/vc-tree/assets/index.less create mode 100644 es/vc-tree/demo/basic.js create mode 100644 es/vc-tree/demo/basic.less create mode 100644 es/vc-tree/demo/contextmenu.less create mode 100644 es/vc-tree/demo/draggable.less create mode 100644 es/vc-tree/demo/util.js create mode 100644 es/vc-tree/index.js create mode 100644 es/vc-tree/src/Tree.js create mode 100644 es/vc-tree/src/TreeNode.js create mode 100644 es/vc-tree/src/index.js create mode 100644 es/vc-tree/src/util.js create mode 100644 es/vc-upload/demo/beforeUpload.js create mode 100644 es/vc-upload/demo/drag.js create mode 100644 es/vc-upload/demo/simple.js create mode 100644 es/vc-upload/index.js create mode 100644 es/vc-upload/src/AjaxUploader.js create mode 100644 es/vc-upload/src/IframeUploader.js create mode 100644 es/vc-upload/src/Upload.js create mode 100644 es/vc-upload/src/attr-accept.js create mode 100644 es/vc-upload/src/index.js create mode 100644 es/vc-upload/src/request.js create mode 100644 es/vc-upload/src/uid.js create mode 100644 es/version/index.js create mode 100644 es/version/style/css.js create mode 100644 es/version/style/index.js create mode 100644 lib/_util/BaseMixin.js create mode 100644 lib/_util/ContainerRender.js create mode 100644 lib/_util/Dom/addEventListener.js create mode 100644 lib/_util/Dom/class-util.js create mode 100644 lib/_util/Dom/contains.js create mode 100644 lib/_util/KeyCode.js create mode 100644 lib/_util/StateMixin.js create mode 100644 lib/_util/antRefDirective.js create mode 100644 lib/_util/callMoment.js create mode 100644 lib/_util/createChainedFunction.js create mode 100644 lib/_util/css-animation/Event.js create mode 100644 lib/_util/css-animation/index.js create mode 100644 lib/_util/getLocale.js create mode 100644 lib/_util/getRequestAnimationFrame.js create mode 100644 lib/_util/getScroll.js create mode 100644 lib/_util/getScrollBarSize.js create mode 100644 lib/_util/getTransitionProps.js create mode 100644 lib/_util/interopDefault.js create mode 100644 lib/_util/isCssAnimationSupported.js create mode 100644 lib/_util/isFlexSupported.js create mode 100644 lib/_util/openAnimation.js create mode 100644 lib/_util/props-util.js create mode 100644 lib/_util/requestAnimationTimeout.js create mode 100644 lib/_util/store/PropTypes.js create mode 100644 lib/_util/store/Provider.js create mode 100644 lib/_util/store/connect.js create mode 100644 lib/_util/store/create.js create mode 100644 lib/_util/store/index.js create mode 100644 lib/_util/throttleByAnimationFrame.js create mode 100644 lib/_util/triggerEvent.js create mode 100644 lib/_util/vnode.js create mode 100644 lib/_util/vue-types/index.js create mode 100644 lib/_util/vue-types/utils.js create mode 100644 lib/_util/warning.js create mode 100644 lib/affix/index.js create mode 100644 lib/affix/style/css.js create mode 100644 lib/affix/style/index.css create mode 100644 lib/affix/style/index.js create mode 100644 lib/affix/style/index.less create mode 100644 lib/alert/index.js create mode 100644 lib/alert/style/css.js create mode 100644 lib/alert/style/index.css create mode 100644 lib/alert/style/index.js create mode 100644 lib/alert/style/index.less create mode 100644 lib/align/Align.js create mode 100644 lib/align/index.js create mode 100644 lib/align/isWindow.js create mode 100644 lib/anchor/Anchor.js create mode 100644 lib/anchor/AnchorLink.js create mode 100644 lib/anchor/index.js create mode 100644 lib/anchor/style/css.js create mode 100644 lib/anchor/style/index.css create mode 100644 lib/anchor/style/index.js create mode 100644 lib/anchor/style/index.less create mode 100644 lib/auto-complete/InputElement.js create mode 100644 lib/auto-complete/index.js create mode 100644 lib/auto-complete/style/css.js create mode 100644 lib/auto-complete/style/index.css create mode 100644 lib/auto-complete/style/index.js create mode 100644 lib/auto-complete/style/index.less create mode 100644 lib/avatar/Avatar.js create mode 100644 lib/avatar/index.js create mode 100644 lib/avatar/style/css.js create mode 100644 lib/avatar/style/index.css create mode 100644 lib/avatar/style/index.js create mode 100644 lib/avatar/style/index.less create mode 100644 lib/back-top/index.js create mode 100644 lib/back-top/style/css.js create mode 100644 lib/back-top/style/index.css create mode 100644 lib/back-top/style/index.js create mode 100644 lib/back-top/style/index.less create mode 100644 lib/back-top/style/responsive.less create mode 100644 lib/badge/Badge.js create mode 100644 lib/badge/ScrollNumber.js create mode 100644 lib/badge/index.js create mode 100644 lib/badge/style/css.js create mode 100644 lib/badge/style/index.css create mode 100644 lib/badge/style/index.js create mode 100644 lib/badge/style/index.less create mode 100644 lib/breadcrumb/Breadcrumb.js create mode 100644 lib/breadcrumb/BreadcrumbItem.js create mode 100644 lib/breadcrumb/index.js create mode 100644 lib/breadcrumb/style/css.js create mode 100644 lib/breadcrumb/style/index.css create mode 100644 lib/breadcrumb/style/index.js create mode 100644 lib/breadcrumb/style/index.less create mode 100644 lib/button/button-group.js create mode 100644 lib/button/button.js create mode 100644 lib/button/buttonTypes.js create mode 100644 lib/button/index.js create mode 100644 lib/button/style/css.js create mode 100644 lib/button/style/index.css create mode 100644 lib/button/style/index.js create mode 100644 lib/button/style/index.less create mode 100644 lib/button/style/mixin.less create mode 100644 lib/calendar/Constants.js create mode 100644 lib/calendar/Header.js create mode 100644 lib/calendar/index.js create mode 100644 lib/calendar/locale/ar_EG.js create mode 100644 lib/calendar/locale/bg_BG.js create mode 100644 lib/calendar/locale/ca_ES.js create mode 100644 lib/calendar/locale/cs_CZ.js create mode 100644 lib/calendar/locale/de_DE.js create mode 100644 lib/calendar/locale/el_GR.js create mode 100644 lib/calendar/locale/en_GB.js create mode 100644 lib/calendar/locale/en_US.js create mode 100644 lib/calendar/locale/es_ES.js create mode 100644 lib/calendar/locale/et_EE.js create mode 100644 lib/calendar/locale/fa_IR.js create mode 100644 lib/calendar/locale/fi_FI.js create mode 100644 lib/calendar/locale/fr_BE.js create mode 100644 lib/calendar/locale/fr_FR.js create mode 100644 lib/calendar/locale/is_IS.js create mode 100644 lib/calendar/locale/it_IT.js create mode 100644 lib/calendar/locale/ja_JP.js create mode 100644 lib/calendar/locale/ko_KR.js create mode 100755 lib/calendar/locale/ku_IQ.js create mode 100644 lib/calendar/locale/nb_NO.js create mode 100644 lib/calendar/locale/nl_BE.js create mode 100644 lib/calendar/locale/nl_NL.js create mode 100644 lib/calendar/locale/pl_PL.js create mode 100644 lib/calendar/locale/pt_BR.js create mode 100644 lib/calendar/locale/pt_PT.js create mode 100644 lib/calendar/locale/ru_RU.js create mode 100644 lib/calendar/locale/sk_SK.js create mode 100644 lib/calendar/locale/sl_SI.js create mode 100644 lib/calendar/locale/sr_RS.js create mode 100644 lib/calendar/locale/sv_SE.js create mode 100644 lib/calendar/locale/th_TH.js create mode 100644 lib/calendar/locale/tr_TR.js create mode 100644 lib/calendar/locale/uk_UA.js create mode 100644 lib/calendar/locale/vi_VN.js create mode 100644 lib/calendar/locale/zh_CN.js create mode 100644 lib/calendar/locale/zh_TW.js create mode 100644 lib/calendar/style/css.js create mode 100644 lib/calendar/style/index.css create mode 100644 lib/calendar/style/index.js create mode 100644 lib/calendar/style/index.less create mode 100644 lib/card/Card.js create mode 100644 lib/card/Grid.js create mode 100644 lib/card/Meta.js create mode 100644 lib/card/index.js create mode 100644 lib/card/style/css.js create mode 100644 lib/card/style/index.css create mode 100644 lib/card/style/index.js create mode 100644 lib/card/style/index.less create mode 100644 lib/carousel/index.js create mode 100644 lib/carousel/style/css.js create mode 100644 lib/carousel/style/index.css create mode 100644 lib/carousel/style/index.js create mode 100644 lib/carousel/style/index.less create mode 100644 lib/cascader/index.js create mode 100644 lib/cascader/style/css.js create mode 100644 lib/cascader/style/index.css create mode 100644 lib/cascader/style/index.js create mode 100644 lib/cascader/style/index.less create mode 100644 lib/checkbox/Checkbox.js create mode 100644 lib/checkbox/Group.js create mode 100644 lib/checkbox/index.js create mode 100644 lib/checkbox/style/css.js create mode 100644 lib/checkbox/style/index.css create mode 100644 lib/checkbox/style/index.js create mode 100644 lib/checkbox/style/index.less create mode 100644 lib/checkbox/style/mixin.less create mode 100644 lib/col/index.js create mode 100644 lib/col/style/css.js create mode 100644 lib/col/style/index.js create mode 100644 lib/collapse/Collapse.js create mode 100644 lib/collapse/CollapsePanel.js create mode 100644 lib/collapse/index.js create mode 100644 lib/collapse/src/Collapse.js create mode 100644 lib/collapse/src/Panel.js create mode 100644 lib/collapse/src/PanelContent.js create mode 100644 lib/collapse/src/commonProps.js create mode 100644 lib/collapse/src/index.js create mode 100644 lib/collapse/src/openAnimationFactory.js create mode 100644 lib/collapse/style/css.js create mode 100644 lib/collapse/style/index.css create mode 100644 lib/collapse/style/index.js create mode 100644 lib/collapse/style/index.less create mode 100644 lib/date-picker/RangePicker.js create mode 100644 lib/date-picker/WeekPicker.js create mode 100644 lib/date-picker/createPicker.js create mode 100755 lib/date-picker/index.js create mode 100644 lib/date-picker/interface.js create mode 100644 lib/date-picker/locale/ar_EG.js create mode 100644 lib/date-picker/locale/bg_BG.js create mode 100644 lib/date-picker/locale/ca_ES.js create mode 100644 lib/date-picker/locale/cs_CZ.js create mode 100644 lib/date-picker/locale/de_DE.js create mode 100644 lib/date-picker/locale/el_GR.js create mode 100644 lib/date-picker/locale/en_GB.js create mode 100644 lib/date-picker/locale/en_US.js create mode 100644 lib/date-picker/locale/es_ES.js create mode 100644 lib/date-picker/locale/et_EE.js create mode 100644 lib/date-picker/locale/fa_IR.js create mode 100644 lib/date-picker/locale/fi_FI.js create mode 100644 lib/date-picker/locale/fr_BE.js create mode 100644 lib/date-picker/locale/fr_FR.js create mode 100644 lib/date-picker/locale/is_IS.js create mode 100644 lib/date-picker/locale/it_IT.js create mode 100644 lib/date-picker/locale/ja_JP.js create mode 100644 lib/date-picker/locale/ko_KR.js create mode 100755 lib/date-picker/locale/ku_IQ.js create mode 100644 lib/date-picker/locale/nb_NO.js create mode 100644 lib/date-picker/locale/nl_BE.js create mode 100644 lib/date-picker/locale/nl_NL.js create mode 100644 lib/date-picker/locale/pl_PL.js create mode 100644 lib/date-picker/locale/pt_BR.js create mode 100644 lib/date-picker/locale/pt_PT.js create mode 100644 lib/date-picker/locale/ru_RU.js create mode 100644 lib/date-picker/locale/sk_SK.js create mode 100644 lib/date-picker/locale/sl_SI.js create mode 100644 lib/date-picker/locale/sr_RS.js create mode 100644 lib/date-picker/locale/sv_SE.js create mode 100644 lib/date-picker/locale/th_TH.js create mode 100644 lib/date-picker/locale/tr_TR.js create mode 100644 lib/date-picker/locale/uk_UA.js create mode 100644 lib/date-picker/locale/vi_VN.js create mode 100644 lib/date-picker/locale/zh_CN.js create mode 100644 lib/date-picker/locale/zh_TW.js create mode 100644 lib/date-picker/style/Calendar.less create mode 100644 lib/date-picker/style/DecadePanel.less create mode 100644 lib/date-picker/style/MonthPanel.less create mode 100644 lib/date-picker/style/MonthPicker.less create mode 100644 lib/date-picker/style/Picker.less create mode 100644 lib/date-picker/style/RangePicker.less create mode 100644 lib/date-picker/style/TimePicker.less create mode 100644 lib/date-picker/style/WeekPicker.less create mode 100644 lib/date-picker/style/YearPanel.less create mode 100644 lib/date-picker/style/css.js create mode 100644 lib/date-picker/style/index.css create mode 100644 lib/date-picker/style/index.js create mode 100644 lib/date-picker/style/index.less create mode 100644 lib/date-picker/wrapPicker.js create mode 100644 lib/divider/index.js create mode 100644 lib/divider/style/css.js create mode 100644 lib/divider/style/index.css create mode 100644 lib/divider/style/index.js create mode 100644 lib/divider/style/index.less create mode 100644 lib/dropdown/dropdown-button.js create mode 100644 lib/dropdown/dropdown.js create mode 100644 lib/dropdown/getDropdownProps.js create mode 100644 lib/dropdown/index.js create mode 100644 lib/dropdown/src/Dropdown.js create mode 100644 lib/dropdown/src/index.js create mode 100644 lib/dropdown/src/placements.js create mode 100644 lib/dropdown/style/css.js create mode 100644 lib/dropdown/style/index.css create mode 100644 lib/dropdown/style/index.js create mode 100644 lib/dropdown/style/index.less create mode 100755 lib/form/Form.js create mode 100644 lib/form/FormItem.js create mode 100644 lib/form/constants.js create mode 100644 lib/form/index.js create mode 100644 lib/form/style/css.js create mode 100644 lib/form/style/index.css create mode 100644 lib/form/style/index.js create mode 100644 lib/form/style/index.less create mode 100644 lib/form/style/mixin.less create mode 100644 lib/grid/Col.js create mode 100644 lib/grid/Row.js create mode 100644 lib/grid/index.js create mode 100644 lib/grid/style/css.js create mode 100644 lib/grid/style/index.css create mode 100644 lib/grid/style/index.js create mode 100644 lib/grid/style/index.less create mode 100644 lib/grid/style/mixin.less create mode 100644 lib/icon/icon.js create mode 100644 lib/icon/index.js create mode 100644 lib/icon/style/css.js create mode 100644 lib/icon/style/index.js create mode 100644 lib/index.js create mode 100644 lib/input-number/index.js create mode 100644 lib/input-number/style/css.js create mode 100644 lib/input-number/style/index.css create mode 100644 lib/input-number/style/index.js create mode 100644 lib/input-number/style/index.less create mode 100644 lib/input/Group.js create mode 100644 lib/input/Input.js create mode 100644 lib/input/Search.js create mode 100644 lib/input/TextArea.js create mode 100644 lib/input/calculateNodeHeight.js create mode 100644 lib/input/index.js create mode 100644 lib/input/inputProps.js create mode 100644 lib/input/style/css.js create mode 100644 lib/input/style/index.css create mode 100644 lib/input/style/index.js create mode 100644 lib/input/style/index.less create mode 100644 lib/input/style/mixin.less create mode 100644 lib/input/style/search-input.less create mode 100644 lib/layout/Sider.js create mode 100644 lib/layout/index.js create mode 100644 lib/layout/layout.js create mode 100644 lib/layout/style/css.js create mode 100644 lib/layout/style/index.css create mode 100644 lib/layout/style/index.js create mode 100644 lib/layout/style/index.less create mode 100644 lib/list/Item.js create mode 100644 lib/list/index.js create mode 100644 lib/list/style/bordered.less create mode 100644 lib/list/style/css.js create mode 100644 lib/list/style/index.css create mode 100644 lib/list/style/index.js create mode 100644 lib/list/style/index.less create mode 100644 lib/list/style/responsive.less create mode 100644 lib/locale-provider/LocaleReceiver.js create mode 100644 lib/locale-provider/ar_EG.js create mode 100644 lib/locale-provider/bg_BG.js create mode 100644 lib/locale-provider/ca_ES.js create mode 100644 lib/locale-provider/cs_CZ.js create mode 100644 lib/locale-provider/de_DE.js create mode 100644 lib/locale-provider/default.js create mode 100644 lib/locale-provider/el_GR.js create mode 100644 lib/locale-provider/en_GB.js create mode 100644 lib/locale-provider/en_US.js create mode 100644 lib/locale-provider/es_ES.js create mode 100644 lib/locale-provider/et_EE.js create mode 100644 lib/locale-provider/fa_IR.js create mode 100644 lib/locale-provider/fi_FI.js create mode 100644 lib/locale-provider/fr_BE.js create mode 100644 lib/locale-provider/fr_FR.js create mode 100644 lib/locale-provider/index.js create mode 100644 lib/locale-provider/is_IS.js create mode 100644 lib/locale-provider/it_IT.js create mode 100644 lib/locale-provider/ja_JP.js create mode 100644 lib/locale-provider/ko_KR.js create mode 100755 lib/locale-provider/ku_IQ.js create mode 100644 lib/locale-provider/nb_NO.js create mode 100644 lib/locale-provider/nl_BE.js create mode 100644 lib/locale-provider/nl_NL.js create mode 100644 lib/locale-provider/pl_PL.js create mode 100644 lib/locale-provider/pt_BR.js create mode 100644 lib/locale-provider/pt_PT.js create mode 100644 lib/locale-provider/ru_RU.js create mode 100644 lib/locale-provider/sk_SK.js create mode 100644 lib/locale-provider/sl_SI.js create mode 100644 lib/locale-provider/sr_RS.js create mode 100644 lib/locale-provider/style/css.js create mode 100644 lib/locale-provider/style/index.css create mode 100644 lib/locale-provider/style/index.js create mode 100644 lib/locale-provider/style/index.less create mode 100644 lib/locale-provider/sv_SE.js create mode 100644 lib/locale-provider/th_TH.js create mode 100644 lib/locale-provider/tr_TR.js create mode 100644 lib/locale-provider/uk_UA.js create mode 100644 lib/locale-provider/vi_VN.js create mode 100644 lib/locale-provider/zh_CN.js create mode 100644 lib/locale-provider/zh_TW.js create mode 100644 lib/menu/MenuItem.js create mode 100644 lib/menu/index.js create mode 100644 lib/menu/style/css.js create mode 100644 lib/menu/style/dark.less create mode 100644 lib/menu/style/index.css create mode 100644 lib/menu/style/index.js create mode 100644 lib/menu/style/index.less create mode 100644 lib/message/index.js create mode 100644 lib/message/style/css.js create mode 100644 lib/message/style/index.css create mode 100644 lib/message/style/index.js create mode 100644 lib/message/style/index.less create mode 100644 lib/modal/ActionButton.js create mode 100644 lib/modal/ConfirmDialog.js create mode 100644 lib/modal/Modal.js create mode 100644 lib/modal/confirm.js create mode 100644 lib/modal/index.js create mode 100644 lib/modal/locale.js create mode 100644 lib/modal/style/confirm.less create mode 100644 lib/modal/style/css.js create mode 100644 lib/modal/style/index.css create mode 100644 lib/modal/style/index.js create mode 100644 lib/modal/style/index.less create mode 100644 lib/modal/style/modal.less create mode 100644 lib/notification/index.js create mode 100644 lib/notification/style/css.js create mode 100644 lib/notification/style/index.css create mode 100644 lib/notification/style/index.js create mode 100644 lib/notification/style/index.less create mode 100644 lib/pagination/MiniSelect.js create mode 100644 lib/pagination/Pagination.js create mode 100644 lib/pagination/index.js create mode 100644 lib/pagination/style/css.js create mode 100644 lib/pagination/style/index.css create mode 100644 lib/pagination/style/index.js create mode 100644 lib/pagination/style/index.less create mode 100644 lib/popconfirm/index.js create mode 100644 lib/popconfirm/style/css.js create mode 100644 lib/popconfirm/style/index.js create mode 100644 lib/popover/index.js create mode 100644 lib/popover/style/css.js create mode 100644 lib/popover/style/index.css create mode 100644 lib/popover/style/index.js create mode 100644 lib/popover/style/index.less create mode 100644 lib/progress/index.js create mode 100644 lib/progress/progress.js create mode 100644 lib/progress/style/css.js create mode 100644 lib/progress/style/index.css create mode 100644 lib/progress/style/index.js create mode 100644 lib/progress/style/index.less create mode 100644 lib/radio/Group.js create mode 100644 lib/radio/Radio.js create mode 100644 lib/radio/index.js create mode 100644 lib/radio/style/css.js create mode 100644 lib/radio/style/index.css create mode 100644 lib/radio/style/index.js create mode 100644 lib/radio/style/index.less create mode 100644 lib/rate/index.js create mode 100644 lib/rate/style/css.js create mode 100644 lib/rate/style/index.css create mode 100644 lib/rate/style/index.js create mode 100644 lib/rate/style/index.less create mode 100644 lib/row/index.js create mode 100644 lib/row/style/css.js create mode 100644 lib/row/style/index.js create mode 100644 lib/select/index.js create mode 100644 lib/select/style/css.js create mode 100644 lib/select/style/index.css create mode 100644 lib/select/style/index.js create mode 100644 lib/select/style/index.less create mode 100644 lib/slider/index.js create mode 100644 lib/slider/style/css.js create mode 100644 lib/slider/style/index.css create mode 100644 lib/slider/style/index.js create mode 100644 lib/slider/style/index.less create mode 100644 lib/spin/Spin.js create mode 100644 lib/spin/index.js create mode 100644 lib/spin/style/css.js create mode 100644 lib/spin/style/index.css create mode 100644 lib/spin/style/index.js create mode 100644 lib/spin/style/index.less create mode 100644 lib/steps/index.js create mode 100644 lib/steps/style/css.js create mode 100644 lib/steps/style/custom-icon.less create mode 100644 lib/steps/style/index.css create mode 100644 lib/steps/style/index.js create mode 100644 lib/steps/style/index.less create mode 100644 lib/steps/style/label-placement.less create mode 100644 lib/steps/style/progress-dot.less create mode 100644 lib/steps/style/small.less create mode 100644 lib/steps/style/vertical.less create mode 100644 lib/style.js create mode 100644 lib/style/color/bezierEasing.less create mode 100644 lib/style/color/colorPalette.less create mode 100644 lib/style/color/colors.less create mode 100644 lib/style/color/tinyColor.less create mode 100644 lib/style/core/base.less create mode 100644 lib/style/core/iconfont.less create mode 100644 lib/style/core/index.less create mode 100644 lib/style/core/motion.less create mode 100644 lib/style/core/motion/fade.less create mode 100644 lib/style/core/motion/move.less create mode 100644 lib/style/core/motion/other.less create mode 100644 lib/style/core/motion/slide.less create mode 100644 lib/style/core/motion/swing.less create mode 100644 lib/style/core/motion/zoom.less create mode 100644 lib/style/css.js create mode 100644 lib/style/index.css create mode 100644 lib/style/index.js create mode 100644 lib/style/index.less create mode 100644 lib/style/mixins/clearfix.less create mode 100644 lib/style/mixins/compatibility.less create mode 100644 lib/style/mixins/iconfont.less create mode 100644 lib/style/mixins/index.less create mode 100644 lib/style/mixins/motion.less create mode 100644 lib/style/mixins/reset.less create mode 100644 lib/style/mixins/size.less create mode 100644 lib/style/themes/default.less create mode 100644 lib/style/v2-compatible-reset.css create mode 100644 lib/style/v2-compatible-reset.js create mode 100644 lib/style/v2-compatible-reset.less create mode 100644 lib/switch/index.js create mode 100644 lib/switch/style/css.js create mode 100644 lib/switch/style/index.css create mode 100644 lib/switch/style/index.js create mode 100644 lib/switch/style/index.less create mode 100644 lib/table/Column.js create mode 100644 lib/table/ColumnGroup.js create mode 100644 lib/table/FilterDropdownMenuWrapper.js create mode 100644 lib/table/SelectionBox.js create mode 100644 lib/table/SelectionCheckboxAll.js create mode 100755 lib/table/Table.js create mode 100644 lib/table/createBodyRow.js create mode 100644 lib/table/createStore.js create mode 100755 lib/table/filterDropdown.js create mode 100644 lib/table/index.js create mode 100644 lib/table/interface.js create mode 100644 lib/table/style/css.js create mode 100644 lib/table/style/index.css create mode 100644 lib/table/style/index.js create mode 100644 lib/table/style/index.less create mode 100644 lib/table/style/size.less create mode 100644 lib/table/util.js create mode 100644 lib/tabs/index.js create mode 100644 lib/tabs/style/card-style.less create mode 100644 lib/tabs/style/css.js create mode 100644 lib/tabs/style/index.css create mode 100644 lib/tabs/style/index.js create mode 100644 lib/tabs/style/index.less create mode 100644 lib/tabs/tabs.js create mode 100644 lib/tag/CheckableTag.js create mode 100644 lib/tag/Tag.js create mode 100644 lib/tag/index.js create mode 100644 lib/tag/style/css.js create mode 100644 lib/tag/style/index.css create mode 100644 lib/tag/style/index.js create mode 100644 lib/tag/style/index.less create mode 100644 lib/time-picker/index.js create mode 100644 lib/time-picker/locale/ar_EG.js create mode 100644 lib/time-picker/locale/bg_BG.js create mode 100644 lib/time-picker/locale/ca_ES.js create mode 100644 lib/time-picker/locale/cs_CZ.js create mode 100644 lib/time-picker/locale/de_DE.js create mode 100644 lib/time-picker/locale/el_GR.js create mode 100644 lib/time-picker/locale/en_GB.js create mode 100644 lib/time-picker/locale/en_US.js create mode 100644 lib/time-picker/locale/es_ES.js create mode 100644 lib/time-picker/locale/et_EE.js create mode 100644 lib/time-picker/locale/fa_IR.js create mode 100644 lib/time-picker/locale/fi_FI.js create mode 100644 lib/time-picker/locale/fr_BE.js create mode 100644 lib/time-picker/locale/fr_FR.js create mode 100644 lib/time-picker/locale/is_IS.js create mode 100644 lib/time-picker/locale/it_IT.js create mode 100644 lib/time-picker/locale/ja_JP.js create mode 100644 lib/time-picker/locale/ko_KR.js create mode 100755 lib/time-picker/locale/ku_IQ.js create mode 100644 lib/time-picker/locale/nb_NO.js create mode 100644 lib/time-picker/locale/nl_BE.js create mode 100644 lib/time-picker/locale/nl_NL.js create mode 100644 lib/time-picker/locale/pl_PL.js create mode 100644 lib/time-picker/locale/pt_BR.js create mode 100644 lib/time-picker/locale/pt_PT.js create mode 100644 lib/time-picker/locale/ru_RU.js create mode 100644 lib/time-picker/locale/sk_SK.js create mode 100644 lib/time-picker/locale/sl_SI.js create mode 100644 lib/time-picker/locale/sr_RS.js create mode 100644 lib/time-picker/locale/sv_SE.js create mode 100644 lib/time-picker/locale/th_TH.js create mode 100644 lib/time-picker/locale/tr_TR.js create mode 100644 lib/time-picker/locale/uk_UA.js create mode 100644 lib/time-picker/locale/vi_VN.js create mode 100644 lib/time-picker/locale/zh_CN.js create mode 100644 lib/time-picker/locale/zh_TW.js create mode 100644 lib/time-picker/style/css.js create mode 100644 lib/time-picker/style/index.css create mode 100644 lib/time-picker/style/index.js create mode 100644 lib/time-picker/style/index.less create mode 100644 lib/timeline/Timeline.js create mode 100644 lib/timeline/TimelineItem.js create mode 100644 lib/timeline/index.js create mode 100644 lib/timeline/style/css.js create mode 100644 lib/timeline/style/index.css create mode 100644 lib/timeline/style/index.js create mode 100644 lib/timeline/style/index.less create mode 100644 lib/tooltip/Tooltip.js create mode 100644 lib/tooltip/abstractTooltipProps.js create mode 100644 lib/tooltip/index.js create mode 100644 lib/tooltip/placements.js create mode 100644 lib/tooltip/style/css.js create mode 100644 lib/tooltip/style/index.css create mode 100644 lib/tooltip/style/index.js create mode 100644 lib/tooltip/style/index.less create mode 100644 lib/transfer/index.js create mode 100644 lib/transfer/item.js create mode 100644 lib/transfer/list.js create mode 100644 lib/transfer/operation.js create mode 100644 lib/transfer/search.js create mode 100644 lib/transfer/style/css.js create mode 100644 lib/transfer/style/index.css create mode 100644 lib/transfer/style/index.js create mode 100644 lib/transfer/style/index.less create mode 100644 lib/tree-select/index.js create mode 100644 lib/tree-select/interface.js create mode 100644 lib/tree-select/style/css.js create mode 100644 lib/tree-select/style/index.css create mode 100644 lib/tree-select/style/index.js create mode 100644 lib/tree-select/style/index.less create mode 100644 lib/tree/index.js create mode 100644 lib/tree/style/css.js create mode 100644 lib/tree/style/index.css create mode 100644 lib/tree/style/index.js create mode 100644 lib/tree/style/index.less create mode 100644 lib/tree/style/mixin.less create mode 100644 lib/trigger/LazyRenderBox.js create mode 100644 lib/trigger/Popup.js create mode 100644 lib/trigger/PopupInner.js create mode 100644 lib/trigger/Trigger.js create mode 100644 lib/trigger/assets/index.less create mode 100644 lib/trigger/assets/mask.less create mode 100644 lib/trigger/index.js create mode 100644 lib/trigger/utils.js create mode 100644 lib/upload/Dragger.js create mode 100644 lib/upload/Upload.js create mode 100644 lib/upload/UploadList.js create mode 100644 lib/upload/index.js create mode 100755 lib/upload/interface.js create mode 100644 lib/upload/style/css.js create mode 100644 lib/upload/style/index.css create mode 100644 lib/upload/style/index.js create mode 100644 lib/upload/style/index.less create mode 100644 lib/upload/utils.js create mode 100644 lib/vc-calendar/assets/common/Calendar.less create mode 100644 lib/vc-calendar/assets/common/FullCalendar.less create mode 100644 lib/vc-calendar/assets/common/Picker.less create mode 100644 lib/vc-calendar/assets/common/RangeCalendar.less create mode 100644 lib/vc-calendar/assets/common/index.less create mode 100644 lib/vc-calendar/assets/index.less create mode 100644 lib/vc-calendar/assets/index/Calendar.less create mode 100644 lib/vc-calendar/assets/index/DecadePanel.less create mode 100644 lib/vc-calendar/assets/index/Input.less create mode 100644 lib/vc-calendar/assets/index/MonthPanel.less create mode 100644 lib/vc-calendar/assets/index/Picker.less create mode 100644 lib/vc-calendar/assets/index/Time.less create mode 100644 lib/vc-calendar/assets/index/TimePanel.less create mode 100644 lib/vc-calendar/assets/index/YearPanel.less create mode 100644 lib/vc-calendar/index.js create mode 100644 lib/vc-calendar/src/Calendar.js create mode 100644 lib/vc-calendar/src/FullCalendar.js create mode 100644 lib/vc-calendar/src/MonthCalendar.js create mode 100644 lib/vc-calendar/src/Picker.js create mode 100644 lib/vc-calendar/src/RangeCalendar.js create mode 100644 lib/vc-calendar/src/calendar/CalendarFooter.js create mode 100644 lib/vc-calendar/src/calendar/CalendarHeader.js create mode 100644 lib/vc-calendar/src/calendar/OkButton.js create mode 100644 lib/vc-calendar/src/calendar/TimePickerButton.js create mode 100644 lib/vc-calendar/src/calendar/TodayButton.js create mode 100644 lib/vc-calendar/src/date/DateConstants.js create mode 100644 lib/vc-calendar/src/date/DateInput.js create mode 100644 lib/vc-calendar/src/date/DateTBody.js create mode 100644 lib/vc-calendar/src/date/DateTHead.js create mode 100644 lib/vc-calendar/src/date/DateTable.js create mode 100644 lib/vc-calendar/src/decade/DecadePanel.js create mode 100644 lib/vc-calendar/src/full-calendar/CalendarHeader.js create mode 100644 lib/vc-calendar/src/index.js create mode 100644 lib/vc-calendar/src/locale/ar_EG.js create mode 100644 lib/vc-calendar/src/locale/bg_BG.js create mode 100644 lib/vc-calendar/src/locale/ca_ES.js create mode 100644 lib/vc-calendar/src/locale/cs_CZ.js create mode 100644 lib/vc-calendar/src/locale/da_DK.js create mode 100644 lib/vc-calendar/src/locale/de_DE.js create mode 100644 lib/vc-calendar/src/locale/el_GR.js create mode 100644 lib/vc-calendar/src/locale/en_GB.js create mode 100644 lib/vc-calendar/src/locale/en_US.js create mode 100644 lib/vc-calendar/src/locale/es_ES.js create mode 100644 lib/vc-calendar/src/locale/et_EE.js create mode 100644 lib/vc-calendar/src/locale/fa_IR.js create mode 100644 lib/vc-calendar/src/locale/fi_FI.js create mode 100644 lib/vc-calendar/src/locale/fr_BE.js create mode 100644 lib/vc-calendar/src/locale/fr_FR.js create mode 100644 lib/vc-calendar/src/locale/hu_HU.js create mode 100644 lib/vc-calendar/src/locale/is_IS.js create mode 100644 lib/vc-calendar/src/locale/it_IT.js create mode 100644 lib/vc-calendar/src/locale/ja_JP.js create mode 100644 lib/vc-calendar/src/locale/ko_KR.js create mode 100644 lib/vc-calendar/src/locale/ku_IQ.js create mode 100644 lib/vc-calendar/src/locale/nb_NO.js create mode 100644 lib/vc-calendar/src/locale/nl_BE.js create mode 100644 lib/vc-calendar/src/locale/nl_NL.js create mode 100644 lib/vc-calendar/src/locale/pl_PL.js create mode 100644 lib/vc-calendar/src/locale/pt_BR.js create mode 100644 lib/vc-calendar/src/locale/pt_PT.js create mode 100644 lib/vc-calendar/src/locale/ru_RU.js create mode 100644 lib/vc-calendar/src/locale/sk_SK.js create mode 100644 lib/vc-calendar/src/locale/sl_SI.js create mode 100644 lib/vc-calendar/src/locale/sr_RS.js create mode 100644 lib/vc-calendar/src/locale/sv_SE.js create mode 100644 lib/vc-calendar/src/locale/th_TH.js create mode 100644 lib/vc-calendar/src/locale/tr_TR.js create mode 100644 lib/vc-calendar/src/locale/ug_CN.js create mode 100644 lib/vc-calendar/src/locale/uk_UA.js create mode 100644 lib/vc-calendar/src/locale/zh_CN.js create mode 100644 lib/vc-calendar/src/locale/zh_TW.js create mode 100644 lib/vc-calendar/src/mixin/CalendarMixin.js create mode 100644 lib/vc-calendar/src/mixin/CommonMixin.js create mode 100644 lib/vc-calendar/src/month/MonthPanel.js create mode 100644 lib/vc-calendar/src/month/MonthTable.js create mode 100644 lib/vc-calendar/src/picker/placements.js create mode 100644 lib/vc-calendar/src/range-calendar/CalendarPart.js create mode 100644 lib/vc-calendar/src/util/index.js create mode 100644 lib/vc-calendar/src/year/YearPanel.js create mode 100644 lib/vc-cascader/Cascader.js create mode 100644 lib/vc-cascader/Menus.js create mode 100644 lib/vc-cascader/assets/index.less create mode 100644 lib/vc-cascader/index.js create mode 100644 lib/vc-checkbox/index.js create mode 100644 lib/vc-checkbox/src/Checkbox.js create mode 100644 lib/vc-checkbox/src/index.js create mode 100644 lib/vc-dialog/Dialog.js create mode 100644 lib/vc-dialog/DialogWrap.js create mode 100644 lib/vc-dialog/IDialogPropTypes.js create mode 100644 lib/vc-dialog/LazyRenderBox.js create mode 100644 lib/vc-dialog/assets/bootstrap.less create mode 100644 lib/vc-dialog/assets/bootstrap/Dialog.less create mode 100644 lib/vc-dialog/assets/bootstrap/effect.less create mode 100644 lib/vc-dialog/assets/bootstrap/variables.less create mode 100644 lib/vc-dialog/assets/index.less create mode 100644 lib/vc-dialog/assets/index/Dialog.less create mode 100644 lib/vc-dialog/assets/index/Mask.less create mode 100644 lib/vc-dialog/index.js create mode 100644 lib/vc-form/demo/async-init.js create mode 100644 lib/vc-form/demo/dynamic-fields.js create mode 100644 lib/vc-form/demo/dynamic.js create mode 100644 lib/vc-form/demo/file-input.js create mode 100644 lib/vc-form/demo/getFieldDecorator.js create mode 100644 lib/vc-form/demo/input-array.js create mode 100644 lib/vc-form/demo/modal.js create mode 100644 lib/vc-form/demo/nested-field.js create mode 100644 lib/vc-form/demo/normalize.js create mode 100644 lib/vc-form/demo/overview.js create mode 100644 lib/vc-form/demo/parallel-form.js create mode 100644 lib/vc-form/demo/start-end-date.js create mode 100644 lib/vc-form/demo/styles.js create mode 100644 lib/vc-form/demo/suggest.js create mode 100644 lib/vc-form/demo/validateFirst.js create mode 100644 lib/vc-form/demo/validateTrigger.js create mode 100644 lib/vc-form/index.js create mode 100644 lib/vc-form/src/createBaseForm.js create mode 100644 lib/vc-form/src/createDOMForm.js create mode 100644 lib/vc-form/src/createFieldsStore.js create mode 100644 lib/vc-form/src/createForm.js create mode 100644 lib/vc-form/src/createFormField.js create mode 100644 lib/vc-form/src/index.js create mode 100644 lib/vc-form/src/propTypes.js create mode 100644 lib/vc-form/src/utils.js create mode 100755 lib/vc-input-number/assets/index.less create mode 100644 lib/vc-input-number/demo/combination-key-format.js create mode 100644 lib/vc-input-number/demo/custom.js create mode 100644 lib/vc-input-number/demo/precision.js create mode 100644 lib/vc-input-number/demo/simple-use-touch.js create mode 100644 lib/vc-input-number/demo/simple.js create mode 100644 lib/vc-input-number/demo/small-step.js create mode 100755 lib/vc-input-number/src/InputHandler.js create mode 100755 lib/vc-input-number/src/index.js create mode 100644 lib/vc-lazy-load/demo/index.js create mode 100644 lib/vc-lazy-load/demo/style.less create mode 100644 lib/vc-lazy-load/index.js create mode 100644 lib/vc-lazy-load/src/LazyLoad.js create mode 100644 lib/vc-lazy-load/src/utils/getElementPosition.js create mode 100644 lib/vc-lazy-load/src/utils/inViewport.js create mode 100644 lib/vc-lazy-load/src/utils/parentScroll.js create mode 100644 lib/vc-m-feedback/demo/simple.js create mode 100644 lib/vc-m-feedback/demo/simple.less create mode 100755 lib/vc-m-feedback/index.js create mode 100755 lib/vc-m-feedback/src/PropTypes.js create mode 100755 lib/vc-m-feedback/src/TouchFeedback.js create mode 100644 lib/vc-menu/DOMWrap.js create mode 100644 lib/vc-menu/Divider.js create mode 100644 lib/vc-menu/Menu.js create mode 100644 lib/vc-menu/MenuItem.js create mode 100644 lib/vc-menu/MenuItemGroup.js create mode 100644 lib/vc-menu/MenuMixin.js create mode 100644 lib/vc-menu/SubMenu.js create mode 100644 lib/vc-menu/SubPopupMenu.js create mode 100644 lib/vc-menu/assets/index.less create mode 100644 lib/vc-menu/commonPropsType.js create mode 100644 lib/vc-menu/index.js create mode 100644 lib/vc-menu/placements.js create mode 100644 lib/vc-menu/util.js create mode 100644 lib/vc-notification/Notice.js create mode 100644 lib/vc-notification/Notification.js create mode 100644 lib/vc-notification/index.js create mode 100644 lib/vc-pagination/KeyCode.js create mode 100644 lib/vc-pagination/Options.js create mode 100644 lib/vc-pagination/Pager.js create mode 100644 lib/vc-pagination/Pagination.js create mode 100644 lib/vc-pagination/assets/index.less create mode 100644 lib/vc-pagination/index.js create mode 100644 lib/vc-pagination/locale/ar_EG.js create mode 100644 lib/vc-pagination/locale/bg_BG.js create mode 100644 lib/vc-pagination/locale/ca_ES.js create mode 100644 lib/vc-pagination/locale/cs_CZ.js create mode 100644 lib/vc-pagination/locale/da_DK.js create mode 100644 lib/vc-pagination/locale/de_DE.js create mode 100644 lib/vc-pagination/locale/el_GR.js create mode 100644 lib/vc-pagination/locale/en_GB.js create mode 100644 lib/vc-pagination/locale/en_US.js create mode 100644 lib/vc-pagination/locale/es_ES.js create mode 100644 lib/vc-pagination/locale/et_EE.js create mode 100644 lib/vc-pagination/locale/fa_IR.js create mode 100644 lib/vc-pagination/locale/fi_FI.js create mode 100644 lib/vc-pagination/locale/fr_BE.js create mode 100644 lib/vc-pagination/locale/fr_FR.js create mode 100644 lib/vc-pagination/locale/hu_HU.js create mode 100644 lib/vc-pagination/locale/id_ID.js create mode 100644 lib/vc-pagination/locale/is_IS.js create mode 100644 lib/vc-pagination/locale/it_IT.js create mode 100644 lib/vc-pagination/locale/ja_JP.js create mode 100644 lib/vc-pagination/locale/ko_KR.js create mode 100644 lib/vc-pagination/locale/ku_IQ.js create mode 100644 lib/vc-pagination/locale/nb_NO.js create mode 100644 lib/vc-pagination/locale/nl_BE.js create mode 100644 lib/vc-pagination/locale/nl_NL.js create mode 100644 lib/vc-pagination/locale/pl_PL.js create mode 100644 lib/vc-pagination/locale/pt_BR.js create mode 100644 lib/vc-pagination/locale/pt_PT.js create mode 100644 lib/vc-pagination/locale/ru_RU.js create mode 100644 lib/vc-pagination/locale/sk_SK.js create mode 100644 lib/vc-pagination/locale/sl_SI.js create mode 100644 lib/vc-pagination/locale/sr_RS.js create mode 100644 lib/vc-pagination/locale/sv_SE.js create mode 100644 lib/vc-pagination/locale/th_TH.js create mode 100644 lib/vc-pagination/locale/tr_TR.js create mode 100644 lib/vc-pagination/locale/ug_CN.js create mode 100644 lib/vc-pagination/locale/uk_UA.js create mode 100644 lib/vc-pagination/locale/vi_VN.js create mode 100644 lib/vc-pagination/locale/zh_CN.js create mode 100644 lib/vc-pagination/locale/zh_TW.js create mode 100644 lib/vc-progress/assets/index.less create mode 100644 lib/vc-progress/demo/fast-progress.js create mode 100644 lib/vc-progress/demo/gap.js create mode 100644 lib/vc-progress/demo/simple.js create mode 100644 lib/vc-progress/index.js create mode 100644 lib/vc-progress/src/Circle.js create mode 100644 lib/vc-progress/src/Line.js create mode 100644 lib/vc-progress/src/enhancer.js create mode 100644 lib/vc-progress/src/index.js create mode 100644 lib/vc-progress/src/types.js create mode 100644 lib/vc-rate/assets/index.less create mode 100644 lib/vc-rate/demo/simple.js create mode 100644 lib/vc-rate/index.js create mode 100644 lib/vc-rate/src/Rate.js create mode 100644 lib/vc-rate/src/Star.js create mode 100644 lib/vc-rate/src/index.js create mode 100644 lib/vc-rate/src/util.js create mode 100644 lib/vc-select/DropdownMenu.js create mode 100644 lib/vc-select/OptGroup.js create mode 100644 lib/vc-select/Option.js create mode 100644 lib/vc-select/PropTypes.js create mode 100644 lib/vc-select/Select.js create mode 100644 lib/vc-select/SelectTrigger.js create mode 100644 lib/vc-select/assets/index.less create mode 100644 lib/vc-select/demo/tbFetchSuggest.js create mode 100644 lib/vc-select/index.js create mode 100644 lib/vc-select/util.js create mode 100644 lib/vc-slick/assets/docs.less create mode 100644 lib/vc-slick/assets/fonts/slick.svg create mode 100644 lib/vc-slick/assets/index.less create mode 100644 lib/vc-slick/assets/slick-theme.less create mode 100644 lib/vc-slick/assets/slick.less create mode 100644 lib/vc-slick/demo/AdaptiveHeight.js create mode 100644 lib/vc-slick/demo/AppendDots.js create mode 100644 lib/vc-slick/demo/AsNavFor.js create mode 100644 lib/vc-slick/demo/AutoPlay.js create mode 100644 lib/vc-slick/demo/AutoPlayMethods.js create mode 100644 lib/vc-slick/demo/CenterMode.js create mode 100644 lib/vc-slick/demo/CustomArrows.js create mode 100644 lib/vc-slick/demo/CustomPaging.js create mode 100644 lib/vc-slick/demo/CustomSlides.js create mode 100644 lib/vc-slick/demo/DynamicSlides.js create mode 100644 lib/vc-slick/demo/Fade.js create mode 100644 lib/vc-slick/demo/FocusOnSelect.js create mode 100644 lib/vc-slick/demo/LazyLoad.js create mode 100644 lib/vc-slick/demo/MultipleItems.js create mode 100644 lib/vc-slick/demo/MultipleRows.js create mode 100644 lib/vc-slick/demo/PauseOnHover.js create mode 100644 lib/vc-slick/demo/PreviousNextMethods.js create mode 100644 lib/vc-slick/demo/Resizable.js create mode 100644 lib/vc-slick/demo/Responsive.js create mode 100644 lib/vc-slick/demo/Rtl.js create mode 100644 lib/vc-slick/demo/SimpleSlider.js create mode 100644 lib/vc-slick/demo/SlickGoTo.js create mode 100644 lib/vc-slick/demo/SlideChangeHooks.js create mode 100644 lib/vc-slick/demo/SwipeToSlide.js create mode 100644 lib/vc-slick/demo/UnevenSetsFinite.js create mode 100644 lib/vc-slick/demo/UnevenSetsInfinite.js create mode 100644 lib/vc-slick/demo/VariableWidth.js create mode 100644 lib/vc-slick/demo/VerticalMode.js create mode 100644 lib/vc-slick/demo/VerticalSwipeToSlide.js create mode 100644 lib/vc-slick/demo/config.js create mode 100644 lib/vc-slick/demo/imglist.js create mode 100644 lib/vc-slick/demo/index.js create mode 100644 lib/vc-slick/src/arrows.js create mode 100644 lib/vc-slick/src/default-props.js create mode 100644 lib/vc-slick/src/dots.js create mode 100644 lib/vc-slick/src/index.js create mode 100644 lib/vc-slick/src/initial-state.js create mode 100644 lib/vc-slick/src/inner-slider.js create mode 100644 lib/vc-slick/src/slider.js create mode 100644 lib/vc-slick/src/track.js create mode 100644 lib/vc-slick/src/utils/innerSliderUtils.js create mode 100644 lib/vc-slider/assets/index.less create mode 100644 lib/vc-slider/demo/handle.js create mode 100644 lib/vc-slider/demo/marks.js create mode 100644 lib/vc-slider/demo/range.js create mode 100644 lib/vc-slider/demo/slider.js create mode 100644 lib/vc-slider/demo/vertical.js create mode 100644 lib/vc-slider/index.js create mode 100644 lib/vc-slider/src/Handle.js create mode 100644 lib/vc-slider/src/Range.js create mode 100644 lib/vc-slider/src/Slider.js create mode 100644 lib/vc-slider/src/common/Marks.js create mode 100644 lib/vc-slider/src/common/Steps.js create mode 100644 lib/vc-slider/src/common/Track.js create mode 100644 lib/vc-slider/src/common/createSlider.js create mode 100644 lib/vc-slider/src/createSliderWithTooltip.js create mode 100644 lib/vc-slider/src/index.js create mode 100644 lib/vc-slider/src/utils.js create mode 100644 lib/vc-steps/Step.js create mode 100644 lib/vc-steps/Steps.js create mode 100644 lib/vc-steps/assets/custom-icon.less create mode 100644 lib/vc-steps/assets/iconfont.less create mode 100644 lib/vc-steps/assets/index.less create mode 100644 lib/vc-steps/assets/label-placement.less create mode 100644 lib/vc-steps/assets/progress-dot.less create mode 100644 lib/vc-steps/assets/small.less create mode 100644 lib/vc-steps/assets/variables.less create mode 100644 lib/vc-steps/assets/vertical.less create mode 100644 lib/vc-steps/index.js create mode 100644 lib/vc-switch/PropTypes.js create mode 100644 lib/vc-switch/Switch.js create mode 100644 lib/vc-switch/assets/index.less create mode 100644 lib/vc-switch/index.js create mode 100644 lib/vc-table/assets/animation.less create mode 100644 lib/vc-table/assets/bordered.less create mode 100644 lib/vc-table/assets/index.less create mode 100644 lib/vc-table/demo/childrenIndent.js create mode 100644 lib/vc-table/demo/className.js create mode 100644 lib/vc-table/demo/colspan-rowspan.js create mode 100644 lib/vc-table/demo/column-resize.js create mode 100644 lib/vc-table/demo/dropdown.js create mode 100644 lib/vc-table/demo/expandedRowRender.js create mode 100644 lib/vc-table/demo/fixedColumns-auto-height.js create mode 100644 lib/vc-table/demo/fixedColumns.js create mode 100644 lib/vc-table/demo/fixedColumnsAndHeader.js create mode 100644 lib/vc-table/demo/fixedColumnsAndHeaderSyncRowHeight.js create mode 100644 lib/vc-table/demo/grouping-columns.js create mode 100644 lib/vc-table/demo/jsx.js create mode 100644 lib/vc-table/demo/key.js create mode 100644 lib/vc-table/demo/nested.js create mode 100644 lib/vc-table/demo/no-data.js create mode 100644 lib/vc-table/demo/rowAndCellClick.js create mode 100644 lib/vc-table/demo/scrollX.js create mode 100644 lib/vc-table/demo/scrollXY.js create mode 100644 lib/vc-table/demo/scrollY.js create mode 100644 lib/vc-table/demo/styled-components.js create mode 100644 lib/vc-table/demo/subTable.js create mode 100644 lib/vc-table/demo/title-and-footer.js create mode 100644 lib/vc-table/index.js create mode 100644 lib/vc-table/src/BaseTable.js create mode 100644 lib/vc-table/src/BodyTable.js create mode 100644 lib/vc-table/src/ColGroup.js create mode 100644 lib/vc-table/src/Column.js create mode 100644 lib/vc-table/src/ColumnGroup.js create mode 100644 lib/vc-table/src/ColumnManager.js create mode 100644 lib/vc-table/src/ExpandIcon.js create mode 100644 lib/vc-table/src/ExpandableRow.js create mode 100644 lib/vc-table/src/ExpandableTable.js create mode 100644 lib/vc-table/src/HeadTable.js create mode 100644 lib/vc-table/src/Table.js create mode 100644 lib/vc-table/src/TableCell.js create mode 100644 lib/vc-table/src/TableHeader.js create mode 100644 lib/vc-table/src/TableHeaderRow.js create mode 100644 lib/vc-table/src/TableRow.js create mode 100644 lib/vc-table/src/utils.js create mode 100644 lib/vc-tabs/src/InkTabBar.js create mode 100644 lib/vc-tabs/src/InkTabBarMixin.js create mode 100644 lib/vc-tabs/src/KeyCode.js create mode 100644 lib/vc-tabs/src/ScrollableInkTabBar.js create mode 100644 lib/vc-tabs/src/ScrollableTabBar.js create mode 100644 lib/vc-tabs/src/ScrollableTabBarMixin.js create mode 100644 lib/vc-tabs/src/TabBar.js create mode 100644 lib/vc-tabs/src/TabBarMixin.js create mode 100644 lib/vc-tabs/src/TabContent.js create mode 100644 lib/vc-tabs/src/TabPane.js create mode 100644 lib/vc-tabs/src/Tabs.js create mode 100644 lib/vc-tabs/src/utils.js create mode 100644 lib/vc-time-picker/Combobox.js create mode 100644 lib/vc-time-picker/Header.js create mode 100644 lib/vc-time-picker/Panel.js create mode 100644 lib/vc-time-picker/Select.js create mode 100644 lib/vc-time-picker/TimePicker.js create mode 100644 lib/vc-time-picker/assets/index.less create mode 100644 lib/vc-time-picker/assets/index/Header.less create mode 100644 lib/vc-time-picker/assets/index/Panel.less create mode 100644 lib/vc-time-picker/assets/index/Picker.less create mode 100644 lib/vc-time-picker/assets/index/Select.less create mode 100644 lib/vc-time-picker/index.js create mode 100644 lib/vc-time-picker/placements.js create mode 100644 lib/vc-tooltip/Tooltip.js create mode 100644 lib/vc-tooltip/assets/boostrap/anim.less create mode 100644 lib/vc-tooltip/assets/bootstrap.less create mode 100644 lib/vc-tooltip/assets/bootstrap_white.less create mode 100644 lib/vc-tooltip/index.js create mode 100644 lib/vc-tooltip/placements.js create mode 100644 lib/vc-tree-select/assets/icons.png create mode 100644 lib/vc-tree-select/assets/index.less create mode 100644 lib/vc-tree-select/assets/select.less create mode 100644 lib/vc-tree-select/assets/tree.less create mode 100644 lib/vc-tree-select/demo/basic.js create mode 100644 lib/vc-tree-select/demo/big-data-generator.js create mode 100644 lib/vc-tree-select/demo/big-data.js create mode 100644 lib/vc-tree-select/demo/demo.less create mode 100644 lib/vc-tree-select/demo/disable.js create mode 100644 lib/vc-tree-select/demo/dynamic.js create mode 100644 lib/vc-tree-select/demo/filter.js create mode 100644 lib/vc-tree-select/demo/form.js create mode 100644 lib/vc-tree-select/demo/styles.js create mode 100644 lib/vc-tree-select/demo/util.js create mode 100644 lib/vc-tree-select/index.js create mode 100644 lib/vc-tree-select/src/PropTypes.js create mode 100644 lib/vc-tree-select/src/Select.js create mode 100644 lib/vc-tree-select/src/SelectTrigger.js create mode 100644 lib/vc-tree-select/src/TreeNode.js create mode 100644 lib/vc-tree-select/src/index.js create mode 100644 lib/vc-tree-select/src/strategies.js create mode 100644 lib/vc-tree-select/src/util.js create mode 100644 lib/vc-tree/assets/icons.png create mode 100644 lib/vc-tree/assets/index.less create mode 100644 lib/vc-tree/demo/basic.js create mode 100644 lib/vc-tree/demo/basic.less create mode 100644 lib/vc-tree/demo/contextmenu.less create mode 100644 lib/vc-tree/demo/draggable.less create mode 100644 lib/vc-tree/demo/util.js create mode 100644 lib/vc-tree/index.js create mode 100644 lib/vc-tree/src/Tree.js create mode 100644 lib/vc-tree/src/TreeNode.js create mode 100644 lib/vc-tree/src/index.js create mode 100644 lib/vc-tree/src/util.js create mode 100644 lib/vc-upload/demo/beforeUpload.js create mode 100644 lib/vc-upload/demo/drag.js create mode 100644 lib/vc-upload/demo/simple.js create mode 100644 lib/vc-upload/index.js create mode 100644 lib/vc-upload/src/AjaxUploader.js create mode 100644 lib/vc-upload/src/IframeUploader.js create mode 100644 lib/vc-upload/src/Upload.js create mode 100644 lib/vc-upload/src/attr-accept.js create mode 100644 lib/vc-upload/src/index.js create mode 100644 lib/vc-upload/src/request.js create mode 100644 lib/vc-upload/src/uid.js create mode 100644 lib/version/index.js create mode 100644 lib/version/style/css.js create mode 100644 lib/version/style/index.js diff --git a/.gitignore b/.gitignore index d58ce65448..af2fa330c1 100644 --- a/.gitignore +++ b/.gitignore @@ -60,8 +60,8 @@ typings/ .idea .DS_Store dist -lib -es +# lib +# es site-dist yarn.lock package-lock.json diff --git a/components/calendar/Header.jsx b/components/calendar/Header.jsx index 43da7f308e..a2cc60281a 100644 --- a/components/calendar/Header.jsx +++ b/components/calendar/Header.jsx @@ -46,7 +46,7 @@ export default { const suffix = locale.year === '年' ? '年' : '' const options = [] - for (let index = start; index < end; index++) { + for (let index = start; index <= end; index++) { options.push() } return ( diff --git a/components/calendar/index.en-US.md b/components/calendar/index.en-US.md index 92508d73ef..5ec9dcfb58 100644 --- a/components/calendar/index.en-US.md +++ b/components/calendar/index.en-US.md @@ -39,4 +39,4 @@ customize the progress dot by setting a scoped slot | --- | --- | --- | | panelChange | Callback for when panel changes | function(date: moment, mode: string) | - | | select | Callback for when a date is selected | function(date: moment) | - | -| change | Callback for when value change | function(date: moment) | - | +| onChange | Callback for when value change | function(date: moment) | - | diff --git a/components/calendar/index.jsx b/components/calendar/index.jsx index c4cdfb32b7..abe9b3c66c 100644 --- a/components/calendar/index.jsx +++ b/components/calendar/index.jsx @@ -122,7 +122,7 @@ export default { } if (way === 'select') { this.$emit('select', value) - this.$emit('change', value) + this.$emit('onChange', value) } else if (way === 'changePanel') { this.onPanelChange(value, this.sMode) } @@ -147,7 +147,7 @@ export default { onPanelChange (value, mode) { this.$emit('panelChange', value, mode) if (value !== this.sValue) { - this.$emit('change', value) + this.$emit('onChange', value) } }, diff --git a/components/calendar/index.zh-CN.md b/components/calendar/index.zh-CN.md index 46cdbef7f1..7b5fbcdfd7 100644 --- a/components/calendar/index.zh-CN.md +++ b/components/calendar/index.zh-CN.md @@ -37,4 +37,4 @@ | --- | --- | --- | | panelChange | 日期面板变化回调 | function(date: moment, mode: string) | 无 | | select | 点击选择日期回调 | function(date: moment) | 无 | -| change | 日期变化时的回调, 面板变化有可能导致日期变化| function(date: moment) | 无 | +| onChange | 日期变化时的回调, 面板变化有可能导致日期变化| function(date: moment) | 无 | diff --git a/es/_util/BaseMixin.js b/es/_util/BaseMixin.js new file mode 100644 index 0000000000..dad7a6e3fa --- /dev/null +++ b/es/_util/BaseMixin.js @@ -0,0 +1,27 @@ +import _toConsumableArray from 'babel-runtime/helpers/toConsumableArray'; +import _extends from 'babel-runtime/helpers/extends'; +export default { + methods: { + setState: function setState(state, callback) { + _extends(this.$data, typeof state === 'function' ? state(this.$data) : state); + this.$nextTick(function () { + callback && callback(); + }); + }, + __emit: function __emit() { + // 直接调用listeners,底层组件不需要vueTool记录events + var args = [].slice.call(arguments, 0); + var filterEvent = []; + var eventName = args[0]; + if (args.length && this.$listeners[eventName]) { + if (filterEvent.includes(eventName)) { + this.$emit.apply(this, [eventName].concat(_toConsumableArray(args.slice(1)))); + } else { + var _$listeners; + + (_$listeners = this.$listeners)[eventName].apply(_$listeners, _toConsumableArray(args.slice(1))); + } + } + } + } +}; \ No newline at end of file diff --git a/es/_util/ContainerRender.js b/es/_util/ContainerRender.js new file mode 100644 index 0000000000..b6d9889c6b --- /dev/null +++ b/es/_util/ContainerRender.js @@ -0,0 +1,98 @@ + +import Vue from 'vue'; +import PropTypes from './vue-types'; + +export default { + props: { + autoMount: PropTypes.bool.def(true), + autoDestroy: PropTypes.bool.def(true), + visible: PropTypes.bool, + forceRender: PropTypes.bool.def(false), + parent: PropTypes.any, + getComponent: PropTypes.func.isRequired, + getContainer: PropTypes.func.isRequired, + children: PropTypes.func.isRequired + }, + + mounted: function mounted() { + if (this.autoMount) { + this.renderComponent(); + } + }, + updated: function updated() { + if (this.autoMount) { + this.renderComponent(); + } + }, + beforeDestroy: function beforeDestroy() { + if (this.autoDestroy) { + this.removeContainer(); + } + }, + + methods: { + removeContainer: function removeContainer() { + if (this.container) { + this._component && this._component.$destroy(); + this.container.parentNode.removeChild(this.container); + this.container = null; + } + }, + renderComponent: function renderComponent() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var ready = arguments[1]; + var visible = this.visible, + getComponent = this.getComponent, + forceRender = this.forceRender, + getContainer = this.getContainer, + parent = this.parent; + + var self = this; + if (visible || parent.$refs._component || forceRender) { + var el = this.componentEl; + if (!this.container) { + this.container = getContainer(); + el = document.createElement('div'); + this.componentEl = el; + this.container.appendChild(el); + } + + if (!this._component) { + this._component = new Vue({ + data: { + comProps: props + }, + parent: self.parent, + el: el, + mounted: function mounted() { + this.$nextTick(function () { + if (ready) { + ready.call(self); + } + }); + }, + updated: function updated() { + this.$nextTick(function () { + if (ready) { + ready.call(self); + } + }); + }, + render: function render() { + return getComponent(this.comProps); + } + }); + } else { + this._component.comProps = props; + } + } + } + }, + + render: function render() { + return this.children({ + renderComponent: this.renderComponent, + removeContainer: this.removeContainer + }); + } +}; \ No newline at end of file diff --git a/es/_util/Dom/addEventListener.js b/es/_util/Dom/addEventListener.js new file mode 100644 index 0000000000..47eaa02df7 --- /dev/null +++ b/es/_util/Dom/addEventListener.js @@ -0,0 +1,5 @@ +import addDOMEventListener from 'add-dom-event-listener'; + +export default function addEventListenerWrap(target, eventType, cb) { + return addDOMEventListener(target, eventType, cb); +} \ No newline at end of file diff --git a/es/_util/Dom/class-util.js b/es/_util/Dom/class-util.js new file mode 100644 index 0000000000..c66261d664 --- /dev/null +++ b/es/_util/Dom/class-util.js @@ -0,0 +1,65 @@ +/* @flow */ + +/** + * Add class with compatibility for SVG since classList is not supported on + * SVG elements in IE + */ +export function addClass(el, cls) { + /* istanbul ignore if */ + if (!cls || !(cls = cls.trim())) { + return; + } + + /* istanbul ignore else */ + if (el.classList) { + if (cls.indexOf(' ') > -1) { + cls.split(/\s+/).forEach(function (c) { + return el.classList.add(c); + }); + } else { + el.classList.add(cls); + } + } else { + var cur = ' ' + (el.getAttribute('class') || '') + ' '; + if (cur.indexOf(' ' + cls + ' ') < 0) { + el.setAttribute('class', (cur + cls).trim()); + } + } +} + +/** + * Remove class with compatibility for SVG since classList is not supported on + * SVG elements in IE + */ +export function removeClass(el, cls) { + /* istanbul ignore if */ + if (!cls || !(cls = cls.trim())) { + return; + } + + /* istanbul ignore else */ + if (el.classList) { + if (cls.indexOf(' ') > -1) { + cls.split(/\s+/).forEach(function (c) { + return el.classList.remove(c); + }); + } else { + el.classList.remove(cls); + } + if (!el.classList.length) { + el.removeAttribute('class'); + } + } else { + var cur = ' ' + (el.getAttribute('class') || '') + ' '; + var tar = ' ' + cls + ' '; + while (cur.indexOf(tar) >= 0) { + cur = cur.replace(tar, ' '); + } + cur = cur.trim(); + if (cur) { + el.setAttribute('class', cur); + } else { + el.removeAttribute('class'); + } + } +} \ No newline at end of file diff --git a/es/_util/Dom/contains.js b/es/_util/Dom/contains.js new file mode 100644 index 0000000000..80fc904a10 --- /dev/null +++ b/es/_util/Dom/contains.js @@ -0,0 +1,11 @@ +export default function contains(root, n) { + var node = n; + while (node) { + if (node === root) { + return true; + } + node = node.parentNode; + } + + return false; +} \ No newline at end of file diff --git a/es/_util/KeyCode.js b/es/_util/KeyCode.js new file mode 100644 index 0000000000..9b4e9b911e --- /dev/null +++ b/es/_util/KeyCode.js @@ -0,0 +1,517 @@ +/** + * @ignore + * some key-codes definition and utils from closure-library + * @author yiminghe@gmail.com + */ + +var KeyCode = { + /** + * MAC_ENTER + */ + MAC_ENTER: 3, + /** + * BACKSPACE + */ + BACKSPACE: 8, + /** + * TAB + */ + TAB: 9, + /** + * NUMLOCK on FF/Safari Mac + */ + NUM_CENTER: 12, // NUMLOCK on FF/Safari Mac + /** + * ENTER + */ + ENTER: 13, + /** + * SHIFT + */ + SHIFT: 16, + /** + * CTRL + */ + CTRL: 17, + /** + * ALT + */ + ALT: 18, + /** + * PAUSE + */ + PAUSE: 19, + /** + * CAPS_LOCK + */ + CAPS_LOCK: 20, + /** + * ESC + */ + ESC: 27, + /** + * SPACE + */ + SPACE: 32, + /** + * PAGE_UP + */ + PAGE_UP: 33, // also NUM_NORTH_EAST + /** + * PAGE_DOWN + */ + PAGE_DOWN: 34, // also NUM_SOUTH_EAST + /** + * END + */ + END: 35, // also NUM_SOUTH_WEST + /** + * HOME + */ + HOME: 36, // also NUM_NORTH_WEST + /** + * LEFT + */ + LEFT: 37, // also NUM_WEST + /** + * UP + */ + UP: 38, // also NUM_NORTH + /** + * RIGHT + */ + RIGHT: 39, // also NUM_EAST + /** + * DOWN + */ + DOWN: 40, // also NUM_SOUTH + /** + * PRINT_SCREEN + */ + PRINT_SCREEN: 44, + /** + * INSERT + */ + INSERT: 45, // also NUM_INSERT + /** + * DELETE + */ + DELETE: 46, // also NUM_DELETE + /** + * ZERO + */ + ZERO: 48, + /** + * ONE + */ + ONE: 49, + /** + * TWO + */ + TWO: 50, + /** + * THREE + */ + THREE: 51, + /** + * FOUR + */ + FOUR: 52, + /** + * FIVE + */ + FIVE: 53, + /** + * SIX + */ + SIX: 54, + /** + * SEVEN + */ + SEVEN: 55, + /** + * EIGHT + */ + EIGHT: 56, + /** + * NINE + */ + NINE: 57, + /** + * QUESTION_MARK + */ + QUESTION_MARK: 63, // needs localization + /** + * A + */ + A: 65, + /** + * B + */ + B: 66, + /** + * C + */ + C: 67, + /** + * D + */ + D: 68, + /** + * E + */ + E: 69, + /** + * F + */ + F: 70, + /** + * G + */ + G: 71, + /** + * H + */ + H: 72, + /** + * I + */ + I: 73, + /** + * J + */ + J: 74, + /** + * K + */ + K: 75, + /** + * L + */ + L: 76, + /** + * M + */ + M: 77, + /** + * N + */ + N: 78, + /** + * O + */ + O: 79, + /** + * P + */ + P: 80, + /** + * Q + */ + Q: 81, + /** + * R + */ + R: 82, + /** + * S + */ + S: 83, + /** + * T + */ + T: 84, + /** + * U + */ + U: 85, + /** + * V + */ + V: 86, + /** + * W + */ + W: 87, + /** + * X + */ + X: 88, + /** + * Y + */ + Y: 89, + /** + * Z + */ + Z: 90, + /** + * META + */ + META: 91, // WIN_KEY_LEFT + /** + * WIN_KEY_RIGHT + */ + WIN_KEY_RIGHT: 92, + /** + * CONTEXT_MENU + */ + CONTEXT_MENU: 93, + /** + * NUM_ZERO + */ + NUM_ZERO: 96, + /** + * NUM_ONE + */ + NUM_ONE: 97, + /** + * NUM_TWO + */ + NUM_TWO: 98, + /** + * NUM_THREE + */ + NUM_THREE: 99, + /** + * NUM_FOUR + */ + NUM_FOUR: 100, + /** + * NUM_FIVE + */ + NUM_FIVE: 101, + /** + * NUM_SIX + */ + NUM_SIX: 102, + /** + * NUM_SEVEN + */ + NUM_SEVEN: 103, + /** + * NUM_EIGHT + */ + NUM_EIGHT: 104, + /** + * NUM_NINE + */ + NUM_NINE: 105, + /** + * NUM_MULTIPLY + */ + NUM_MULTIPLY: 106, + /** + * NUM_PLUS + */ + NUM_PLUS: 107, + /** + * NUM_MINUS + */ + NUM_MINUS: 109, + /** + * NUM_PERIOD + */ + NUM_PERIOD: 110, + /** + * NUM_DIVISION + */ + NUM_DIVISION: 111, + /** + * F1 + */ + F1: 112, + /** + * F2 + */ + F2: 113, + /** + * F3 + */ + F3: 114, + /** + * F4 + */ + F4: 115, + /** + * F5 + */ + F5: 116, + /** + * F6 + */ + F6: 117, + /** + * F7 + */ + F7: 118, + /** + * F8 + */ + F8: 119, + /** + * F9 + */ + F9: 120, + /** + * F10 + */ + F10: 121, + /** + * F11 + */ + F11: 122, + /** + * F12 + */ + F12: 123, + /** + * NUMLOCK + */ + NUMLOCK: 144, + /** + * SEMICOLON + */ + SEMICOLON: 186, // needs localization + /** + * DASH + */ + DASH: 189, // needs localization + /** + * EQUALS + */ + EQUALS: 187, // needs localization + /** + * COMMA + */ + COMMA: 188, // needs localization + /** + * PERIOD + */ + PERIOD: 190, // needs localization + /** + * SLASH + */ + SLASH: 191, // needs localization + /** + * APOSTROPHE + */ + APOSTROPHE: 192, // needs localization + /** + * SINGLE_QUOTE + */ + SINGLE_QUOTE: 222, // needs localization + /** + * OPEN_SQUARE_BRACKET + */ + OPEN_SQUARE_BRACKET: 219, // needs localization + /** + * BACKSLASH + */ + BACKSLASH: 220, // needs localization + /** + * CLOSE_SQUARE_BRACKET + */ + CLOSE_SQUARE_BRACKET: 221, // needs localization + /** + * WIN_KEY + */ + WIN_KEY: 224, + /** + * MAC_FF_META + */ + MAC_FF_META: 224, // Firefox (Gecko) fires this for the meta key instead of 91 + /** + * WIN_IME + */ + WIN_IME: 229 + + /* + whether text and modified key is entered at the same time. + */ +};KeyCode.isTextModifyingKeyEvent = function isTextModifyingKeyEvent(e) { + var keyCode = e.keyCode; + if (e.altKey && !e.ctrlKey || e.metaKey || + // Function keys don't generate text + keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) { + return false; + } + + // The following keys are quite harmless, even in combination with + // CTRL, ALT or SHIFT. + switch (keyCode) { + case KeyCode.ALT: + case KeyCode.CAPS_LOCK: + case KeyCode.CONTEXT_MENU: + case KeyCode.CTRL: + case KeyCode.DOWN: + case KeyCode.END: + case KeyCode.ESC: + case KeyCode.HOME: + case KeyCode.INSERT: + case KeyCode.LEFT: + case KeyCode.MAC_FF_META: + case KeyCode.META: + case KeyCode.NUMLOCK: + case KeyCode.NUM_CENTER: + case KeyCode.PAGE_DOWN: + case KeyCode.PAGE_UP: + case KeyCode.PAUSE: + case KeyCode.PRINT_SCREEN: + case KeyCode.RIGHT: + case KeyCode.SHIFT: + case KeyCode.UP: + case KeyCode.WIN_KEY: + case KeyCode.WIN_KEY_RIGHT: + return false; + default: + return true; + } +}; + +/* + whether character is entered. + */ +KeyCode.isCharacterKey = function isCharacterKey(keyCode) { + if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) { + return true; + } + + if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) { + return true; + } + + if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) { + return true; + } + + // Safari sends zero key code for non-latin characters. + if (window.navigation.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) { + return true; + } + + switch (keyCode) { + case KeyCode.SPACE: + case KeyCode.QUESTION_MARK: + case KeyCode.NUM_PLUS: + case KeyCode.NUM_MINUS: + case KeyCode.NUM_PERIOD: + case KeyCode.NUM_DIVISION: + case KeyCode.SEMICOLON: + case KeyCode.DASH: + case KeyCode.EQUALS: + case KeyCode.COMMA: + case KeyCode.PERIOD: + case KeyCode.SLASH: + case KeyCode.APOSTROPHE: + case KeyCode.SINGLE_QUOTE: + case KeyCode.OPEN_SQUARE_BRACKET: + case KeyCode.BACKSLASH: + case KeyCode.CLOSE_SQUARE_BRACKET: + return true; + default: + return false; + } +}; + +export default KeyCode; \ No newline at end of file diff --git a/es/_util/StateMixin.js b/es/_util/StateMixin.js new file mode 100644 index 0000000000..03485c10be --- /dev/null +++ b/es/_util/StateMixin.js @@ -0,0 +1,11 @@ +import _extends from "babel-runtime/helpers/extends"; +export default { + methods: { + setState: function setState(state, callback) { + _extends(this.$data, state); + this.$nextTick(function () { + callback && callback(); + }); + } + } +}; \ No newline at end of file diff --git a/es/_util/antRefDirective.js b/es/_util/antRefDirective.js new file mode 100644 index 0000000000..60a59c91f8 --- /dev/null +++ b/es/_util/antRefDirective.js @@ -0,0 +1,15 @@ +export default { + install: function install(Vue, options) { + Vue.directive('ant-ref', { + bind: function bind(el, binding, vnode) { + binding.value(vnode); + }, + update: function update(el, binding, vnode) { + binding.value(vnode); + }, + unbind: function unbind(el, binding, vnode) { + binding.value(null); + } + }); + } +}; \ No newline at end of file diff --git a/es/_util/callMoment.js b/es/_util/callMoment.js new file mode 100644 index 0000000000..bb58478765 --- /dev/null +++ b/es/_util/callMoment.js @@ -0,0 +1,8 @@ +// https://github.com/moment/moment/issues/3650 +export default function callMoment(moment) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return (moment["default"] || moment).apply(undefined, args); +} \ No newline at end of file diff --git a/es/_util/createChainedFunction.js b/es/_util/createChainedFunction.js new file mode 100644 index 0000000000..24c324665d --- /dev/null +++ b/es/_util/createChainedFunction.js @@ -0,0 +1,22 @@ +/** + * Safe chained function + * + * Will only create a new function if needed, + * otherwise will pass back existing functions or null. + * + * @returns {function|null} + */ +export default function createChainedFunction() { + var args = [].slice.call(arguments, 0); + if (args.length === 1) { + return args[0]; + } + + return function chainedFunction() { + for (var i = 0; i < args.length; i++) { + if (args[i] && args[i].apply) { + args[i].apply(this, arguments); + } + } + }; +} \ No newline at end of file diff --git a/es/_util/css-animation/Event.js b/es/_util/css-animation/Event.js new file mode 100644 index 0000000000..a5fadff7a2 --- /dev/null +++ b/es/_util/css-animation/Event.js @@ -0,0 +1,82 @@ +var EVENT_NAME_MAP = { + transitionend: { + transition: 'transitionend', + WebkitTransition: 'webkitTransitionEnd', + MozTransition: 'mozTransitionEnd', + OTransition: 'oTransitionEnd', + msTransition: 'MSTransitionEnd' + }, + + animationend: { + animation: 'animationend', + WebkitAnimation: 'webkitAnimationEnd', + MozAnimation: 'mozAnimationEnd', + OAnimation: 'oAnimationEnd', + msAnimation: 'MSAnimationEnd' + } +}; + +var endEvents = []; + +function detectEvents() { + var testEl = document.createElement('div'); + var style = testEl.style; + + if (!('AnimationEvent' in window)) { + delete EVENT_NAME_MAP.animationend.animation; + } + + if (!('TransitionEvent' in window)) { + delete EVENT_NAME_MAP.transitionend.transition; + } + + for (var baseEventName in EVENT_NAME_MAP) { + if (EVENT_NAME_MAP.hasOwnProperty(baseEventName)) { + var baseEvents = EVENT_NAME_MAP[baseEventName]; + for (var styleName in baseEvents) { + if (styleName in style) { + endEvents.push(baseEvents[styleName]); + break; + } + } + } + } +} + +if (typeof window !== 'undefined' && typeof document !== 'undefined') { + detectEvents(); +} + +function addEventListener(node, eventName, eventListener) { + node.addEventListener(eventName, eventListener, false); +} + +function removeEventListener(node, eventName, eventListener) { + node.removeEventListener(eventName, eventListener, false); +} + +var TransitionEvents = { + addEndEventListener: function addEndEventListener(node, eventListener) { + if (endEvents.length === 0) { + window.setTimeout(eventListener, 0); + return; + } + endEvents.forEach(function (endEvent) { + addEventListener(node, endEvent, eventListener); + }); + }, + + + endEvents: endEvents, + + removeEndEventListener: function removeEndEventListener(node, eventListener) { + if (endEvents.length === 0) { + return; + } + endEvents.forEach(function (endEvent) { + removeEventListener(node, endEvent, eventListener); + }); + } +}; + +export default TransitionEvents; \ No newline at end of file diff --git a/es/_util/css-animation/index.js b/es/_util/css-animation/index.js new file mode 100644 index 0000000000..b4374162fe --- /dev/null +++ b/es/_util/css-animation/index.js @@ -0,0 +1,176 @@ +import _typeof from 'babel-runtime/helpers/typeof'; +import Event from './Event'; +import classes from 'component-classes'; +import { requestAnimationTimeout, cancelAnimationTimeout } from '../requestAnimationTimeout'; + +var isCssAnimationSupported = Event.endEvents.length !== 0; +var capitalPrefixes = ['Webkit', 'Moz', 'O', +// ms is special .... ! +'ms']; +var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', '']; + +function getStyleProperty(node, name) { + // old ff need null, https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle + var style = window.getComputedStyle(node, null); + var ret = ''; + for (var i = 0; i < prefixes.length; i++) { + ret = style.getPropertyValue(prefixes[i] + name); + if (ret) { + break; + } + } + return ret; +} + +function fixBrowserByTimeout(node) { + if (isCssAnimationSupported) { + var transitionDelay = parseFloat(getStyleProperty(node, 'transition-delay')) || 0; + var transitionDuration = parseFloat(getStyleProperty(node, 'transition-duration')) || 0; + var animationDelay = parseFloat(getStyleProperty(node, 'animation-delay')) || 0; + var animationDuration = parseFloat(getStyleProperty(node, 'animation-duration')) || 0; + var time = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay); + // sometimes, browser bug + node.rcEndAnimTimeout = setTimeout(function () { + node.rcEndAnimTimeout = null; + if (node.rcEndListener) { + node.rcEndListener(); + } + }, time * 1000 + 200); + } +} + +function clearBrowserBugTimeout(node) { + if (node.rcEndAnimTimeout) { + clearTimeout(node.rcEndAnimTimeout); + node.rcEndAnimTimeout = null; + } +} + +var cssAnimation = function cssAnimation(node, transitionName, endCallback) { + var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : _typeof(transitionName)) === 'object'; + var className = nameIsObj ? transitionName.name : transitionName; + var activeClassName = nameIsObj ? transitionName.active : transitionName + '-active'; + var end = endCallback; + var start = void 0; + var active = void 0; + var nodeClasses = classes(node); + + if (endCallback && Object.prototype.toString.call(endCallback) === '[object Object]') { + end = endCallback.end; + start = endCallback.start; + active = endCallback.active; + } + + if (node.rcEndListener) { + node.rcEndListener(); + } + + node.rcEndListener = function (e) { + if (e && e.target !== node) { + return; + } + + if (node.rcAnimTimeout) { + cancelAnimationTimeout(node.rcAnimTimeout); + node.rcAnimTimeout = null; + } + + clearBrowserBugTimeout(node); + + nodeClasses.remove(className); + nodeClasses.remove(activeClassName); + + Event.removeEndEventListener(node, node.rcEndListener); + node.rcEndListener = null; + + // Usually this optional end is used for informing an owner of + // a leave animation and telling it to remove the child. + if (end) { + end(); + } + }; + + Event.addEndEventListener(node, node.rcEndListener); + + if (start) { + start(); + } + nodeClasses.add(className); + + node.rcAnimTimeout = requestAnimationTimeout(function () { + node.rcAnimTimeout = null; + nodeClasses.add(activeClassName); + if (active) { + requestAnimationTimeout(active, 0); + } + fixBrowserByTimeout(node); + // 30ms for firefox + }, 30); + + return { + stop: function stop() { + if (node.rcEndListener) { + node.rcEndListener(); + } + } + }; +}; + +cssAnimation.style = function (node, style, callback) { + if (node.rcEndListener) { + node.rcEndListener(); + } + + node.rcEndListener = function (e) { + if (e && e.target !== node) { + return; + } + + if (node.rcAnimTimeout) { + cancelAnimationTimeout(node.rcAnimTimeout); + node.rcAnimTimeout = null; + } + + clearBrowserBugTimeout(node); + + Event.removeEndEventListener(node, node.rcEndListener); + node.rcEndListener = null; + + // Usually this optional callback is used for informing an owner of + // a leave animation and telling it to remove the child. + if (callback) { + callback(); + } + }; + + Event.addEndEventListener(node, node.rcEndListener); + + node.rcAnimTimeout = requestAnimationTimeout(function () { + for (var s in style) { + if (style.hasOwnProperty(s)) { + node.style[s] = style[s]; + } + } + node.rcAnimTimeout = null; + fixBrowserByTimeout(node); + }, 0); +}; + +cssAnimation.setTransition = function (node, p, value) { + var property = p; + var v = value; + if (value === undefined) { + v = property; + property = ''; + } + property = property || ''; + capitalPrefixes.forEach(function (prefix) { + node.style[prefix + 'Transition' + property] = v; + }); +}; + +cssAnimation.isCssAnimationSupported = isCssAnimationSupported; + +export { isCssAnimationSupported }; + +export default cssAnimation; \ No newline at end of file diff --git a/es/_util/getLocale.js b/es/_util/getLocale.js new file mode 100644 index 0000000000..a958f61415 --- /dev/null +++ b/es/_util/getLocale.js @@ -0,0 +1,25 @@ +import _extends from 'babel-runtime/helpers/extends'; +export function getComponentLocale(props, context, componentName, getDefaultLocale) { + var locale = {}; + if (context && context.antLocale && context.antLocale[componentName]) { + locale = context.antLocale[componentName]; + } else { + var defaultLocale = getDefaultLocale(); + // TODO: make default lang of antd be English + // https://github.com/ant-design/ant-design/issues/6334 + locale = defaultLocale['default'] || defaultLocale; + } + + var result = _extends({}, locale, props.locale); + result.lang = _extends({}, locale.lang, props.locale.lang); + return result; +} + +export function getLocaleCode(context) { + var localeCode = context.antLocale && context.antLocale.locale; + // Had use LocaleProvide but didn't set locale + if (context.antLocale && context.antLocale.exist && !localeCode) { + return 'zh-cn'; + } + return localeCode; +} \ No newline at end of file diff --git a/es/_util/getRequestAnimationFrame.js b/es/_util/getRequestAnimationFrame.js new file mode 100644 index 0000000000..e20ee5d92b --- /dev/null +++ b/es/_util/getRequestAnimationFrame.js @@ -0,0 +1,44 @@ +var availablePrefixs = ['moz', 'ms', 'webkit']; + +function requestAnimationFramePolyfill() { + var lastTime = 0; + return function (callback) { + var currTime = new Date().getTime(); + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); + var id = window.setTimeout(function () { + callback(currTime + timeToCall); + }, timeToCall); + lastTime = currTime + timeToCall; + return id; + }; +} + +export default function getRequestAnimationFrame() { + if (typeof window === 'undefined') { + return function () {}; + } + if (window.requestAnimationFrame) { + // https://github.com/vuejs/vue/issues/4465 + return window.requestAnimationFrame.bind(window); + } + + var prefix = availablePrefixs.filter(function (key) { + return key + 'RequestAnimationFrame' in window; + })[0]; + + return prefix ? window[prefix + 'RequestAnimationFrame'] : requestAnimationFramePolyfill(); +} + +export function cancelRequestAnimationFrame(id) { + if (typeof window === 'undefined') { + return null; + } + if (window.cancelAnimationFrame) { + return window.cancelAnimationFrame(id); + } + var prefix = availablePrefixs.filter(function (key) { + return key + 'CancelAnimationFrame' in window || key + 'CancelRequestAnimationFrame' in window; + })[0]; + + return prefix ? (window[prefix + 'CancelAnimationFrame'] || window[prefix + 'CancelRequestAnimationFrame']).call(this, id) : clearTimeout(id); +} \ No newline at end of file diff --git a/es/_util/getScroll.js b/es/_util/getScroll.js new file mode 100644 index 0000000000..a1c1ca2989 --- /dev/null +++ b/es/_util/getScroll.js @@ -0,0 +1,17 @@ +export default function getScroll(target, top) { + if (typeof window === 'undefined') { + return 0; + } + + var prop = top ? 'pageYOffset' : 'pageXOffset'; + var method = top ? 'scrollTop' : 'scrollLeft'; + var isWindow = target === window; + + var ret = isWindow ? target[prop] : target[method]; + // ie6,7,8 standard mode + if (isWindow && typeof ret !== 'number') { + ret = window.document.documentElement[method]; + } + + return ret; +} \ No newline at end of file diff --git a/es/_util/getScrollBarSize.js b/es/_util/getScrollBarSize.js new file mode 100644 index 0000000000..4d850c1f6b --- /dev/null +++ b/es/_util/getScrollBarSize.js @@ -0,0 +1,38 @@ +var cached = void 0; + +export default function getScrollBarSize(fresh) { + if (fresh || cached === undefined) { + var inner = document.createElement('div'); + inner.style.width = '100%'; + inner.style.height = '200px'; + + var outer = document.createElement('div'); + var outerStyle = outer.style; + + outerStyle.position = 'absolute'; + outerStyle.top = 0; + outerStyle.left = 0; + outerStyle.pointerEvents = 'none'; + outerStyle.visibility = 'hidden'; + outerStyle.width = '200px'; + outerStyle.height = '150px'; + outerStyle.overflow = 'hidden'; + + outer.appendChild(inner); + + document.body.appendChild(outer); + + var widthContained = inner.offsetWidth; + outer.style.overflow = 'scroll'; + var widthScroll = inner.offsetWidth; + + if (widthContained === widthScroll) { + widthScroll = outer.clientWidth; + } + + document.body.removeChild(outer); + + cached = widthContained - widthScroll; + } + return cached; +} \ No newline at end of file diff --git a/es/_util/getTransitionProps.js b/es/_util/getTransitionProps.js new file mode 100644 index 0000000000..e18062a933 --- /dev/null +++ b/es/_util/getTransitionProps.js @@ -0,0 +1,35 @@ +import animate from './css-animation'; +var noop = function noop() {}; +var getTransitionProps = function getTransitionProps(transitionName) { + var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var beforeEnter = opt.beforeEnter, + enter = opt.enter, + leave = opt.leave, + afterLeave = opt.afterLeave, + _opt$appear = opt.appear, + appear = _opt$appear === undefined ? true : _opt$appear, + tag = opt.tag; + + var transitionProps = { + props: { + appear: appear, + css: false + }, + on: { + beforeEnter: beforeEnter || noop, + enter: enter || function (el, done) { + animate(el, transitionName + '-enter', done); + }, + leave: leave || function (el, done) { + animate(el, transitionName + '-leave', done); + }, + afterLeave: afterLeave || noop + } + // transition-group + };if (tag) { + transitionProps.tag = tag; + } + return transitionProps; +}; + +export default getTransitionProps; \ No newline at end of file diff --git a/es/_util/interopDefault.js b/es/_util/interopDefault.js new file mode 100644 index 0000000000..8be87bc5bb --- /dev/null +++ b/es/_util/interopDefault.js @@ -0,0 +1,4 @@ +// https://github.com/moment/moment/issues/3650 +export default function interopDefault(m) { + return m["default"] || m; +} \ No newline at end of file diff --git a/es/_util/isCssAnimationSupported.js b/es/_util/isCssAnimationSupported.js new file mode 100644 index 0000000000..887858916d --- /dev/null +++ b/es/_util/isCssAnimationSupported.js @@ -0,0 +1,24 @@ +var animation = void 0; + +function isCssAnimationSupported() { + if (animation !== undefined) { + return animation; + } + var domPrefixes = 'Webkit Moz O ms Khtml'.split(' '); + var elm = document.createElement('div'); + if (elm.style.animationName !== undefined) { + animation = true; + } + if (animation !== undefined) { + for (var i = 0; i < domPrefixes.length; i++) { + if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) { + animation = true; + break; + } + } + } + animation = animation || false; + return animation; +} + +export default isCssAnimationSupported; \ No newline at end of file diff --git a/es/_util/isFlexSupported.js b/es/_util/isFlexSupported.js new file mode 100644 index 0000000000..06c162ed17 --- /dev/null +++ b/es/_util/isFlexSupported.js @@ -0,0 +1,8 @@ +export default function isFlexSupported() { + if (typeof window !== 'undefined' && window.document && window.document.documentElement) { + var documentElement = window.document.documentElement; + + return 'flex' in documentElement.style || 'webkitFlex' in documentElement.style || 'Flex' in documentElement.style || 'msFlex' in documentElement.style; + } + return false; +} \ No newline at end of file diff --git a/es/_util/openAnimation.js b/es/_util/openAnimation.js new file mode 100644 index 0000000000..acc41e097d --- /dev/null +++ b/es/_util/openAnimation.js @@ -0,0 +1,49 @@ +import cssAnimation from './css-animation'; +import getRequestAnimationFrame, { cancelRequestAnimationFrame } from './getRequestAnimationFrame'; + +var reqAnimFrame = getRequestAnimationFrame(); + +function animate(node, show, done) { + var height = void 0; + var requestAnimationFrameId = void 0; + return cssAnimation(node, 'ant-motion-collapse', { + start: function start() { + if (!show) { + node.style.height = node.offsetHeight + 'px'; + node.style.opacity = 1; + } else { + height = node.offsetHeight; + node.style.height = 0; + node.style.opacity = 0; + } + }, + active: function active() { + if (requestAnimationFrameId) { + cancelRequestAnimationFrame(requestAnimationFrameId); + } + requestAnimationFrameId = reqAnimFrame(function () { + node.style.height = (show ? height : 0) + 'px'; + node.style.opacity = show ? 1 : 0; + }); + }, + end: function end() { + if (requestAnimationFrameId) { + cancelRequestAnimationFrame(requestAnimationFrameId); + } + node.style.height = ''; + node.style.opacity = ''; + done(); + } + }); +} + +var animation = { + enter: function enter(node, done) { + return animate(node, true, done); + }, + leave: function leave(node, done) { + return animate(node, false, done); + } +}; + +export default animation; \ No newline at end of file diff --git a/es/_util/props-util.js b/es/_util/props-util.js new file mode 100644 index 0000000000..7535caf9ac --- /dev/null +++ b/es/_util/props-util.js @@ -0,0 +1,321 @@ +import _extends from 'babel-runtime/helpers/extends'; +import _slicedToArray from 'babel-runtime/helpers/slicedToArray'; +import isPlainObject from 'lodash/isPlainObject'; + +function getType(fn) { + var match = fn && fn.toString().match(/^\s*function (\w+)/); + return match ? match[1] : ''; +} + +var camelizeRE = /-(\w)/g; +var camelize = function camelize(str) { + return str.replace(camelizeRE, function (_, c) { + return c ? c.toUpperCase() : ''; + }); +}; +var parseStyleText = function parseStyleText() { + var cssText = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + var camel = arguments[1]; + + var res = {}; + var listDelimiter = /;(?![^(]*\))/g; + var propertyDelimiter = /:(.+)/; + cssText.split(listDelimiter).forEach(function (item) { + if (item) { + var tmp = item.split(propertyDelimiter); + if (tmp.length > 1) { + var k = camel ? camelize(tmp[0].trim()) : tmp[0].trim(); + res[k] = tmp[1].trim(); + } + } + }); + return res; +}; + +var hasProp = function hasProp(instance, prop) { + var $options = instance.$options || {}; + var propsData = $options.propsData || {}; + return prop in propsData; +}; +var slotHasProp = function slotHasProp(slot, prop) { + var $options = slot.componentOptions || {}; + var propsData = $options.propsData || {}; + return prop in propsData; +}; +var filterProps = function filterProps(props) { + var propsData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var res = {}; + Object.keys(props).forEach(function (k) { + if (k in propsData || props[k] !== undefined) { + res[k] = props[k]; + } + }); + return res; +}; +var getSlots = function getSlots(ele) { + var componentOptions = ele.componentOptions || {}; + if (ele.$vnode) { + componentOptions = ele.$vnode.componentOptions || {}; + } + var children = componentOptions.children || []; + var slots = {}; + children.forEach(function (child) { + var name = child.data && child.data.slot || 'default'; + slots[name] = slots[name] || []; + slots[name].push(child); + }); + return slots; +}; +var getSlotOptions = function getSlotOptions(ele) { + if (ele.fnOptions) { + // 函数式组件 + return ele.fnOptions; + } + var componentOptions = ele.componentOptions; + if (ele.$vnode) { + componentOptions = ele.$vnode.componentOptions; + } + return componentOptions ? componentOptions.Ctor.options || {} : {}; +}; +var getOptionProps = function getOptionProps(instance) { + if (instance.componentOptions) { + var componentOptions = instance.componentOptions; + var _componentOptions$pro = componentOptions.propsData, + propsData = _componentOptions$pro === undefined ? {} : _componentOptions$pro, + _componentOptions$Cto = componentOptions.Ctor, + Ctor = _componentOptions$Cto === undefined ? {} : _componentOptions$Cto; + + var props = (Ctor.options || {}).props || {}; + var res = {}; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = Object.entries(props)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref = _step.value; + + var _ref2 = _slicedToArray(_ref, 2); + + var k = _ref2[0]; + var v = _ref2[1]; + + var def = v['default']; + if (def !== undefined) { + res[k] = typeof def === 'function' && getType(v.type) !== 'Function' ? def.call(instance) : def; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator['return']) { + _iterator['return'](); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return _extends({}, res, propsData); + } + var _instance$$options = instance.$options, + $options = _instance$$options === undefined ? {} : _instance$$options, + _instance$$props = instance.$props, + $props = _instance$$props === undefined ? {} : _instance$$props; + + return filterProps($props, $options.propsData); +}; + +var getComponentFromProp = function getComponentFromProp(instance, prop) { + if (instance.$createElement) { + var h = instance.$createElement; + var temp = instance[prop]; + if (temp !== undefined) { + return typeof temp === 'function' ? temp(h) : temp; + } + return instance.$slots[prop]; + } else { + var _h = instance.context.$createElement; + var _temp = getPropsData(instance)[prop]; + if (_temp !== undefined) { + return typeof _temp === 'function' ? _temp(_h) : _temp; + } + var slotsProp = []; + var componentOptions = instance.componentOptions || {}; + (componentOptions.children || []).forEach(function (child) { + if (child.data && child.data.slot === prop) { + if (child.tag === 'template') { + slotsProp.push(child.children); + } else { + slotsProp.push(child); + } + } + }); + return slotsProp.length ? slotsProp : undefined; + } +}; + +var getAllProps = function getAllProps(ele) { + var data = ele.data || {}; + var componentOptions = ele.componentOptions || {}; + if (ele.$vnode) { + data = ele.$vnode.data || {}; + componentOptions = ele.$vnode.componentOptions || {}; + } + return _extends({}, data.props, data.attrs, componentOptions.propsData); +}; + +var getPropsData = function getPropsData(ele) { + var componentOptions = ele.componentOptions; + if (ele.$vnode) { + componentOptions = ele.$vnode.componentOptions; + } + return componentOptions ? componentOptions.propsData || {} : {}; +}; +var getValueByProp = function getValueByProp(ele, prop) { + return getPropsData(ele)[prop]; +}; + +var getAttrs = function getAttrs(ele) { + var data = ele.data; + if (ele.$vnode) { + data = ele.$vnode.data; + } + return data ? data.attrs || {} : {}; +}; + +var getKey = function getKey(ele) { + var key = ele.key; + if (ele.$vnode) { + key = ele.$vnode.key; + } + return key; +}; + +export function getEvents(child) { + var events = {}; + if (child.componentOptions && child.componentOptions.listeners) { + events = child.componentOptions.listeners; + } else if (child.data && child.data.on) { + events = child.data.on; + } + return _extends({}, events); +} +export function getClass(ele) { + var data = {}; + if (ele.data) { + data = ele.data; + } else if (ele.$vnode && ele.$vnode.data) { + data = ele.$vnode.data; + } + var tempCls = data['class'] || data.staticClass; + var cls = {}; + if (typeof tempCls === 'string') { + tempCls.split(' ').forEach(function (c) { + cls[c.trim()] = true; + }); + } else { + cls = tempCls; + } + return cls; +} +export function getStyle(ele, camel) { + var data = {}; + if (ele.data) { + data = ele.data; + } else if (ele.$vnode && ele.$vnode.data) { + data = ele.$vnode.data; + } + var style = data.style || data.staticStyle; + if (typeof style === 'string') { + style = parseStyleText(style, camel); + } else if (camel && style) { + // 驼峰化 + var res = {}; + Object.keys(style).forEach(function (k) { + return res[camelize(k)] = style[k]; + }); + return res; + } + return style; +} + +export function getComponentName(opts) { + return opts && (opts.Ctor.options.name || opts.tag); +} + +export function isEmptyElement(ele) { + return !(ele.tag || ele.text.trim() !== ''); +} + +export function filterEmpty() { + var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + return children.filter(function (c) { + return c.tag || c.text && c.text.trim() !== ''; + }); +} +var initDefaultProps = function initDefaultProps(propTypes, defaultProps) { + Object.keys(defaultProps).forEach(function (k) { + if (propTypes[k]) { + propTypes[k].def && (propTypes[k] = propTypes[k].def(defaultProps[k])); + } else { + throw new Error('not have ' + k + ' prop'); + } + }); + return propTypes; +}; + +export function mergeProps() { + var args = [].slice.call(arguments, 0); + var props = {}; + args.forEach(function (p, i) { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = Object.entries(p)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var _ref3 = _step2.value; + + var _ref4 = _slicedToArray(_ref3, 2); + + var k = _ref4[0]; + var v = _ref4[1]; + + props[k] = props[k] || {}; + if (isPlainObject(v)) { + _extends(props[k], v); + } else { + props[k] = v; + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2['return']) { + _iterator2['return'](); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + }); + return props; +} + +function isValidElement(element) { + return element && element.context && element.context._isVue; +} + +export { hasProp, filterProps, getOptionProps, getComponentFromProp, getSlotOptions, slotHasProp, getPropsData, getKey, getAttrs, getValueByProp, parseStyleText, initDefaultProps, isValidElement, camelize, getSlots, getAllProps }; +export default hasProp; \ No newline at end of file diff --git a/es/_util/requestAnimationTimeout.js b/es/_util/requestAnimationTimeout.js new file mode 100644 index 0000000000..008c52e0d2 --- /dev/null +++ b/es/_util/requestAnimationTimeout.js @@ -0,0 +1,24 @@ + +import getRequestAnimationFrame, { cancelRequestAnimationFrame as caf } from './getRequestAnimationFrame'; +var raf = getRequestAnimationFrame(); + +export var cancelAnimationTimeout = function cancelAnimationTimeout(frame) { + return caf(frame.id); +}; + +export var requestAnimationTimeout = function requestAnimationTimeout(callback, delay) { + var start = Date.now(); + function timeout() { + if (Date.now() - start >= delay) { + callback.call(); + } else { + frame.id = raf(timeout); + } + } + + var frame = { + id: raf(timeout) + }; + + return frame; +}; \ No newline at end of file diff --git a/es/_util/store/PropTypes.js b/es/_util/store/PropTypes.js new file mode 100644 index 0000000000..284b46bf5c --- /dev/null +++ b/es/_util/store/PropTypes.js @@ -0,0 +1,7 @@ +import PropTypes from '../vue-types'; + +export var storeShape = PropTypes.shape({ + subscribe: PropTypes.func.isRequired, + setState: PropTypes.func.isRequired, + getState: PropTypes.func.isRequired +}); \ No newline at end of file diff --git a/es/_util/store/Provider.js b/es/_util/store/Provider.js new file mode 100644 index 0000000000..9f40e5ee25 --- /dev/null +++ b/es/_util/store/Provider.js @@ -0,0 +1,16 @@ + +import { storeShape } from './PropTypes'; +export default { + name: 'StoreProvider', + props: { + store: storeShape.isRequired + }, + provide: function provide() { + return { + _store: this.$props + }; + }, + render: function render() { + return this.$slots['default'][0]; + } +}; \ No newline at end of file diff --git a/es/_util/store/connect.js b/es/_util/store/connect.js new file mode 100644 index 0000000000..ef9251fa56 --- /dev/null +++ b/es/_util/store/connect.js @@ -0,0 +1,91 @@ +import _extends from 'babel-runtime/helpers/extends'; +import shallowEqual from 'shallowequal'; +import omit from 'omit.js'; +import { getOptionProps } from '../props-util'; +import PropTypes from '../vue-types'; + +function getDisplayName(WrappedComponent) { + return WrappedComponent.name || 'Component'; +} + +var defaultMapStateToProps = function defaultMapStateToProps() { + return {}; +}; +export default function connect(mapStateToProps) { + var shouldSubscribe = !!mapStateToProps; + var finnalMapStateToProps = mapStateToProps || defaultMapStateToProps; + return function wrapWithConnect(WrappedComponent) { + var tempProps = omit(WrappedComponent.props || {}, ['store']); + var props = {}; + Object.keys(tempProps).forEach(function (k) { + props[k] = PropTypes.any; + }); + var Connect = { + name: 'Connect_' + getDisplayName(WrappedComponent), + props: props, + inject: { + _store: { 'default': {} } + }, + data: function data() { + this.store = this._store.store; + return { + subscribed: finnalMapStateToProps(this.store.getState(), this.$props) + }; + }, + mounted: function mounted() { + this.trySubscribe(); + }, + beforeDestroy: function beforeDestroy() { + this.tryUnsubscribe(); + }, + + methods: { + handleChange: function handleChange() { + if (!this.unsubscribe) { + return; + } + + var nextState = finnalMapStateToProps(this.store.getState(), this.$props); + if (!shallowEqual(this.nextState, nextState)) { + this.nextState = nextState; + this.subscribed = nextState; + } + }, + trySubscribe: function trySubscribe() { + if (shouldSubscribe) { + this.unsubscribe = this.store.subscribe(this.handleChange); + this.handleChange(); + } + }, + tryUnsubscribe: function tryUnsubscribe() { + if (this.unsubscribe) { + this.unsubscribe(); + this.unsubscribe = null; + } + } + }, + render: function render() { + var h = arguments[0]; + var $listeners = this.$listeners, + $slots = this.$slots, + $attrs = this.$attrs, + $scopedSlots = this.$scopedSlots, + subscribed = this.subscribed, + store = this.store; + + var props = getOptionProps(this); + var wrapProps = { + props: _extends({}, props, subscribed, { + store: store + }), + on: $listeners, + attrs: $attrs, + slots: $slots, + scopedSlots: $scopedSlots + }; + return h(WrappedComponent, wrapProps); + } + }; + return Connect; + }; +} \ No newline at end of file diff --git a/es/_util/store/create.js b/es/_util/store/create.js new file mode 100644 index 0000000000..233d259dc8 --- /dev/null +++ b/es/_util/store/create.js @@ -0,0 +1,31 @@ +import _extends from "babel-runtime/helpers/extends"; +export default function create(initialState) { + var state = initialState; + var listeners = []; + + function setState(partial) { + state = _extends({}, state, partial); + for (var i = 0; i < listeners.length; i++) { + listeners[i](); + } + } + + function getState() { + return state; + } + + function subscribe(listener) { + listeners.push(listener); + + return function unsubscribe() { + var index = listeners.indexOf(listener); + listeners.splice(index, 1); + }; + } + + return { + setState: setState, + getState: getState, + subscribe: subscribe + }; +} \ No newline at end of file diff --git a/es/_util/store/index.js b/es/_util/store/index.js new file mode 100644 index 0000000000..02252a4af6 --- /dev/null +++ b/es/_util/store/index.js @@ -0,0 +1,5 @@ +export { default as Provider } from './Provider'; + +export { default as connect } from './connect'; + +export { default as create } from './create'; \ No newline at end of file diff --git a/es/_util/throttleByAnimationFrame.js b/es/_util/throttleByAnimationFrame.js new file mode 100644 index 0000000000..a013fc5fa7 --- /dev/null +++ b/es/_util/throttleByAnimationFrame.js @@ -0,0 +1,56 @@ +import _toConsumableArray from 'babel-runtime/helpers/toConsumableArray'; +import getRequestAnimationFrame, { cancelRequestAnimationFrame } from '../_util/getRequestAnimationFrame'; + +var reqAnimFrame = getRequestAnimationFrame(); + +export default function throttleByAnimationFrame(fn) { + var requestId = void 0; + + var later = function later(args) { + return function () { + requestId = null; + fn.apply(undefined, _toConsumableArray(args)); + }; + }; + + var throttled = function throttled() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (requestId == null) { + requestId = reqAnimFrame(later(args)); + } + }; + + throttled.cancel = function () { + return cancelRequestAnimationFrame(requestId); + }; + + return throttled; +} + +export function throttleByAnimationFrameDecorator() { + return function (target, key, descriptor) { + var fn = descriptor.value; + var definingProperty = false; + return { + configurable: true, + get: function get() { + if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) { + return fn; + } + + var boundFn = throttleByAnimationFrame(fn.bind(this)); + definingProperty = true; + Object.defineProperty(this, key, { + value: boundFn, + configurable: true, + writable: true + }); + definingProperty = false; + return boundFn; + } + }; + }; +} \ No newline at end of file diff --git a/es/_util/triggerEvent.js b/es/_util/triggerEvent.js new file mode 100644 index 0000000000..0ef398571b --- /dev/null +++ b/es/_util/triggerEvent.js @@ -0,0 +1,8 @@ +export default function triggerEvent(el, type) { + if ('createEvent' in document) { + // modern browsers, IE9+ + var e = document.createEvent('HTMLEvents'); + e.initEvent(type, false, true); + el.dispatchEvent(e); + } +} \ No newline at end of file diff --git a/es/_util/vnode.js b/es/_util/vnode.js new file mode 100644 index 0000000000..e1fa864dbf --- /dev/null +++ b/es/_util/vnode.js @@ -0,0 +1,136 @@ +import _toConsumableArray from 'babel-runtime/helpers/toConsumableArray'; +import _extends from 'babel-runtime/helpers/extends'; +import { filterEmpty, parseStyleText } from './props-util'; +export function cloneVNode(vnode, deep) { + var componentOptions = vnode.componentOptions; + var data = vnode.data; + + var listeners = {}; + if (componentOptions && componentOptions.listeners) { + listeners = _extends({}, componentOptions.listeners); + } + + var on = {}; + if (data && data.on) { + on = _extends({}, data.on); + } + + var cloned = new vnode.constructor(vnode.tag, data ? _extends({}, data, { on: on }) : data, vnode.children, vnode.text, vnode.elm, vnode.context, componentOptions ? _extends({}, componentOptions, { listeners: listeners }) : componentOptions, vnode.asyncFactory); + cloned.ns = vnode.ns; + cloned.isStatic = vnode.isStatic; + cloned.key = vnode.key; + cloned.isComment = vnode.isComment; + cloned.fnContext = vnode.fnContext; + cloned.fnOptions = vnode.fnOptions; + cloned.fnScopeId = vnode.fnScopeId; + cloned.isCloned = true; + if (deep) { + if (vnode.children) { + cloned.children = cloneVNodes(vnode.children, true); + } + if (componentOptions && componentOptions.children) { + componentOptions.children = cloneVNodes(componentOptions.children, true); + } + } + return cloned; +} + +export function cloneVNodes(vnodes, deep) { + var len = vnodes.length; + var res = new Array(len); + for (var i = 0; i < len; i++) { + res[i] = cloneVNode(vnodes[i], deep); + } + return res; +} + +export function cloneElement(n, nodeProps, deep) { + var ele = n; + if (Array.isArray(n)) { + ele = filterEmpty(n)[0]; + } + if (!ele) { + return null; + } + var node = cloneVNode(ele, deep); + var _nodeProps$props = nodeProps.props, + props = _nodeProps$props === undefined ? {} : _nodeProps$props, + key = nodeProps.key, + _nodeProps$on = nodeProps.on, + on = _nodeProps$on === undefined ? {} : _nodeProps$on, + children = nodeProps.children, + _nodeProps$directives = nodeProps.directives, + directives = _nodeProps$directives === undefined ? [] : _nodeProps$directives; + + var data = node.data || {}; + var cls = {}; + var style = {}; + var _nodeProps$attrs = nodeProps.attrs, + attrs = _nodeProps$attrs === undefined ? {} : _nodeProps$attrs, + ref = nodeProps.ref, + _nodeProps$domProps = nodeProps.domProps, + domProps = _nodeProps$domProps === undefined ? {} : _nodeProps$domProps, + _nodeProps$style = nodeProps.style, + tempStyle = _nodeProps$style === undefined ? {} : _nodeProps$style, + _nodeProps$class = nodeProps['class'], + tempCls = _nodeProps$class === undefined ? {} : _nodeProps$class, + _nodeProps$scopedSlot = nodeProps.scopedSlots, + scopedSlots = _nodeProps$scopedSlot === undefined ? {} : _nodeProps$scopedSlot; + + + if (typeof data.style === 'string') { + style = parseStyleText(data.style); + } else { + style = _extends({}, data.style, style); + } + if (typeof tempStyle === 'string') { + style = _extends({}, style, parseStyleText(style)); + } else { + style = _extends({}, style, tempStyle); + } + + if (typeof data['class'] === 'string') { + cls[data['class']] = true; + data['class'].split(' ').forEach(function (c) { + cls[c.trim()] = true; + }); + } else { + cls = _extends({}, data['class'], cls); + } + if (typeof tempCls === 'string') { + tempCls.split(' ').forEach(function (c) { + cls[c.trim()] = true; + }); + } else { + cls = _extends({}, cls, tempCls); + } + node.data = _extends({}, data, { + style: style, + attrs: _extends({}, data.attrs, attrs), + 'class': cls, + domProps: _extends({}, data.domProps, domProps), + scopedSlots: _extends({}, data.scopedSlots, scopedSlots), + directives: [].concat(_toConsumableArray(data.directives || []), _toConsumableArray(directives)) + }); + + if (node.componentOptions) { + node.componentOptions.propsData = node.componentOptions.propsData || {}; + node.componentOptions.listeners = node.componentOptions.listeners || {}; + node.componentOptions.propsData = _extends({}, node.componentOptions.propsData, props); + node.componentOptions.listeners = _extends({}, node.componentOptions.listeners, on); + if (children) { + node.componentOptions.children = children; + } + } else { + node.data.on = _extends({}, node.data.on || {}, on); + } + + if (key !== undefined) { + node.key = key; + node.data.key = key; + } + if (typeof ref === 'string') { + node.data.ref = ref; + } + return node; +} \ No newline at end of file diff --git a/es/_util/vue-types/index.js b/es/_util/vue-types/index.js new file mode 100644 index 0000000000..14eb751314 --- /dev/null +++ b/es/_util/vue-types/index.js @@ -0,0 +1,269 @@ +import _typeof from 'babel-runtime/helpers/typeof'; +import isPlainObject from 'lodash/isPlainObject'; +import { toType, getType, isFunction, validateType, isInteger, isArray, warn } from './utils'; + +var VuePropTypes = { + + get any() { + return toType('any', { + type: null + }); + }, + + get func() { + return toType('function', { + type: Function + }).def(currentDefaults.func); + }, + + get bool() { + return toType('boolean', { + type: Boolean + }).def(currentDefaults.bool); + }, + + get string() { + return toType('string', { + type: String + }).def(currentDefaults.string); + }, + + get number() { + return toType('number', { + type: Number + }).def(currentDefaults.number); + }, + + get array() { + return toType('array', { + type: Array + }).def(currentDefaults.array); + }, + + get object() { + return toType('object', { + type: Object + }).def(currentDefaults.object); + }, + + get integer() { + return toType('integer', { + type: Number, + validator: function validator(value) { + return isInteger(value); + } + }).def(currentDefaults.integer); + }, + + get symbol() { + return toType('symbol', { + type: null, + validator: function validator(value) { + return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'symbol'; + } + }); + }, + + custom: function custom(validatorFn) { + var warnMsg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'custom validation failed'; + + if (typeof validatorFn !== 'function') { + throw new TypeError('[VueTypes error]: You must provide a function as argument'); + } + + return toType(validatorFn.name || '<>', { + validator: function validator() { + var valid = validatorFn.apply(undefined, arguments); + if (!valid) warn(this._vueTypes_name + ' - ' + warnMsg); + return valid; + } + }); + }, + oneOf: function oneOf(arr) { + if (!isArray(arr)) { + throw new TypeError('[VueTypes error]: You must provide an array as argument'); + } + var msg = 'oneOf - value should be one of "' + arr.join('", "') + '"'; + var allowedTypes = arr.reduce(function (ret, v) { + if (v !== null && v !== undefined) { + ret.indexOf(v.constructor) === -1 && ret.push(v.constructor); + } + return ret; + }, []); + + return toType('oneOf', { + type: allowedTypes.length > 0 ? allowedTypes : null, + validator: function validator(value) { + var valid = arr.indexOf(value) !== -1; + if (!valid) warn(msg); + return valid; + } + }); + }, + instanceOf: function instanceOf(instanceConstructor) { + return toType('instanceOf', { + type: instanceConstructor + }); + }, + oneOfType: function oneOfType(arr) { + if (!isArray(arr)) { + throw new TypeError('[VueTypes error]: You must provide an array as argument'); + } + + var hasCustomValidators = false; + + var nativeChecks = arr.reduce(function (ret, type, i) { + if (isPlainObject(type)) { + if (type._vueTypes_name === 'oneOf') { + return ret.concat(type.type || []); + } + if (type.type && !isFunction(type.validator)) { + if (isArray(type.type)) return ret.concat(type.type); + ret.push(type.type); + } else if (isFunction(type.validator)) { + hasCustomValidators = true; + } + return ret; + } + ret.push(type); + return ret; + }, []); + + if (!hasCustomValidators) { + // we got just native objects (ie: Array, Object) + // delegate to Vue native prop check + return toType('oneOfType', { + type: nativeChecks + }).def(undefined); + } + + var typesStr = arr.map(function (type) { + if (type && isArray(type.type)) { + return type.type.map(getType); + } + return getType(type); + }).reduce(function (ret, type) { + return ret.concat(isArray(type) ? type : [type]); + }, []).join('", "'); + + return this.custom(function oneOfType(value) { + var valid = arr.some(function (type) { + if (type._vueTypes_name === 'oneOf') { + return type.type ? validateType(type.type, value, true) : true; + } + return validateType(type, value, true); + }); + if (!valid) warn('oneOfType - value type should be one of "' + typesStr + '"'); + return valid; + }).def(undefined); + }, + arrayOf: function arrayOf(type) { + return toType('arrayOf', { + type: Array, + validator: function validator(values) { + var valid = values.every(function (value) { + return validateType(type, value); + }); + if (!valid) warn('arrayOf - value must be an array of "' + getType(type) + '"'); + return valid; + } + }); + }, + objectOf: function objectOf(type) { + return toType('objectOf', { + type: Object, + validator: function validator(obj) { + var valid = Object.keys(obj).every(function (key) { + return validateType(type, obj[key]); + }); + if (!valid) warn('objectOf - value must be an object of "' + getType(type) + '"'); + return valid; + } + }); + }, + shape: function shape(obj) { + var keys = Object.keys(obj); + var requiredKeys = keys.filter(function (key) { + return obj[key] && obj[key].required === true; + }); + + var type = toType('shape', { + type: Object, + validator: function validator(value) { + var _this = this; + + if (!isPlainObject(value)) { + return false; + } + var valueKeys = Object.keys(value); + + // check for required keys (if any) + if (requiredKeys.length > 0 && requiredKeys.some(function (req) { + return valueKeys.indexOf(req) === -1; + })) { + warn('shape - at least one of required properties "' + requiredKeys.join('", "') + '" is not present'); + return false; + } + + return valueKeys.every(function (key) { + if (keys.indexOf(key) === -1) { + if (_this._vueTypes_isLoose === true) return true; + warn('shape - object is missing "' + key + '" property'); + return false; + } + var type = obj[key]; + return validateType(type, value[key]); + }); + } + }); + + Object.defineProperty(type, '_vueTypes_isLoose', { + enumerable: false, + writable: true, + value: false + }); + + Object.defineProperty(type, 'loose', { + get: function get() { + this._vueTypes_isLoose = true; + return this; + }, + + enumerable: false + }); + + return type; + } +}; + +var typeDefaults = function typeDefaults() { + return { + func: undefined, + bool: undefined, + string: undefined, + number: undefined, + array: undefined, + object: undefined, + integer: undefined + }; +}; + +var currentDefaults = typeDefaults(); + +Object.defineProperty(VuePropTypes, 'sensibleDefaults', { + enumerable: false, + set: function set(value) { + if (value === false) { + currentDefaults = {}; + } else if (value === true) { + currentDefaults = typeDefaults(); + } else if (isPlainObject(value)) { + currentDefaults = value; + } + }, + get: function get() { + return currentDefaults; + } +}); + +export default VuePropTypes; \ No newline at end of file diff --git a/es/_util/vue-types/utils.js b/es/_util/vue-types/utils.js new file mode 100644 index 0000000000..6395436dbb --- /dev/null +++ b/es/_util/vue-types/utils.js @@ -0,0 +1,200 @@ +import isPlainObject from 'lodash/isPlainObject'; + +var ObjProto = Object.prototype; +var toString = ObjProto.toString; +export var hasOwn = ObjProto.hasOwnProperty; + +var FN_MATCH_REGEXP = /^\s*function (\w+)/; + +// https://github.com/vuejs/vue/blob/dev/src/core/util/props.js#L159 +export var getType = function getType(fn) { + var type = fn !== null && fn !== undefined ? fn.type ? fn.type : fn : null; + var match = type && type.toString().match(FN_MATCH_REGEXP); + return match && match[1]; +}; + +export var getNativeType = function getNativeType(value) { + if (value === null || value === undefined) return null; + var match = value.constructor.toString().match(FN_MATCH_REGEXP); + return match && match[1]; +}; + +/** + * No-op function + */ +export var noop = function noop() {}; + +/** + * Checks for a own property in an object + * + * @param {object} obj - Object + * @param {string} prop - Property to check + */ +export var has = function has(obj, prop) { + return hasOwn.call(obj, prop); +}; + +/** + * Determines whether the passed value is an integer. Uses `Number.isInteger` if available + * + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger + * @param {*} value - The value to be tested for being an integer. + * @returns {boolean} + */ +export var isInteger = Number.isInteger || function (value) { + return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; +}; + +/** + * Determines whether the passed value is an Array. + * + * @param {*} value - The value to be tested for being an array. + * @returns {boolean} + */ +export var isArray = Array.isArray || function (value) { + return toString.call(value) === '[object Array]'; +}; + +/** + * Checks if a value is a function + * + * @param {any} value - Value to check + * @returns {boolean} + */ +export var isFunction = function isFunction(value) { + return toString.call(value) === '[object Function]'; +}; + +/** + * Adds a `def` method to the object returning a new object with passed in argument as `default` property + * + * @param {object} type - Object to enhance + */ +export var withDefault = function withDefault(type) { + Object.defineProperty(type, 'def', { + value: function value(def) { + if (def === undefined && this['default'] === undefined) { + this['default'] = undefined; + return this; + } + if (!isFunction(def) && !validateType(this, def)) { + warn(this._vueTypes_name + ' - invalid default value: "' + def + '"', def); + return this; + } + this['default'] = isArray(def) || isPlainObject(def) ? function () { + return def; + } : def; + + return this; + }, + + enumerable: false, + writable: false + }); +}; + +/** + * Adds a `isRequired` getter returning a new object with `required: true` key-value + * + * @param {object} type - Object to enhance + */ +export var withRequired = function withRequired(type) { + Object.defineProperty(type, 'isRequired', { + get: function get() { + this.required = true; + return this; + }, + + enumerable: false + }); +}; + +/** + * Adds `isRequired` and `def` modifiers to an object + * + * @param {string} name - Type internal name + * @param {object} obj - Object to enhance + * @returns {object} + */ +export var toType = function toType(name, obj) { + Object.defineProperty(obj, '_vueTypes_name', { + enumerable: false, + writable: false, + value: name + }); + withRequired(obj); + withDefault(obj); + + if (isFunction(obj.validator)) { + obj.validator = obj.validator.bind(obj); + } + return obj; +}; + +/** + * Validates a given value against a prop type object + * + * @param {Object|*} type - Type to use for validation. Either a type object or a constructor + * @param {*} value - Value to check + * @param {boolean} silent - Silence warnings + * @returns {boolean} + */ +export var validateType = function validateType(type, value) { + var silent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var typeToCheck = type; + var valid = true; + var expectedType = void 0; + if (!isPlainObject(type)) { + typeToCheck = { type: type }; + } + var namePrefix = typeToCheck._vueTypes_name ? typeToCheck._vueTypes_name + ' - ' : ''; + + if (hasOwn.call(typeToCheck, 'type') && typeToCheck.type !== null) { + if (isArray(typeToCheck.type)) { + valid = typeToCheck.type.some(function (type) { + return validateType(type, value, true); + }); + expectedType = typeToCheck.type.map(function (type) { + return getType(type); + }).join(' or '); + } else { + expectedType = getType(typeToCheck); + + if (expectedType === 'Array') { + valid = isArray(value); + } else if (expectedType === 'Object') { + valid = isPlainObject(value); + } else if (expectedType === 'String' || expectedType === 'Number' || expectedType === 'Boolean' || expectedType === 'Function') { + valid = getNativeType(value) === expectedType; + } else { + valid = value instanceof typeToCheck.type; + } + } + } + + if (!valid) { + silent === false && warn(namePrefix + 'value "' + value + '" should be of type "' + expectedType + '"'); + return false; + } + + if (hasOwn.call(typeToCheck, 'validator') && isFunction(typeToCheck.validator)) { + valid = typeToCheck.validator(value); + if (!valid && silent === false) warn(namePrefix + 'custom validation failed'); + return valid; + } + return valid; +}; + +var warn = noop; + +if (process.env.NODE_ENV !== 'production') { + var hasConsole = typeof console !== 'undefined'; + warn = function warn(msg) { + if (hasConsole) { + console.warn('[VueTypes warn]: ' + msg); + } + }; +} + +export { warn }; \ No newline at end of file diff --git a/es/_util/warning.js b/es/_util/warning.js new file mode 100644 index 0000000000..3634e4cc91 --- /dev/null +++ b/es/_util/warning.js @@ -0,0 +1,9 @@ +import warning from 'warning'; + +var warned = {}; +export default (function (valid, message, throwError) { + if (!valid && !warned[message]) { + warning(false, message); + warned[message] = true; + } +}); \ No newline at end of file diff --git a/es/affix/index.js b/es/affix/index.js new file mode 100644 index 0000000000..1d184cb439 --- /dev/null +++ b/es/affix/index.js @@ -0,0 +1,266 @@ +import _mergeJSXProps from 'babel-helper-vue-jsx-merge-props'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _extends from 'babel-runtime/helpers/extends'; + +import PropTypes from '../_util/vue-types'; +import addEventListener from '../_util/Dom/addEventListener'; +import classNames from 'classnames'; +import shallowequal from 'shallowequal'; +import omit from 'omit.js'; +import getScroll from '../_util/getScroll'; +import BaseMixin from '../_util/BaseMixin'; +import throttleByAnimationFrame from '../_util/throttleByAnimationFrame'; + +function getTargetRect(target) { + return target !== window ? target.getBoundingClientRect() : { top: 0, left: 0, bottom: 0 }; +} + +function getOffset(element, target) { + var elemRect = element.getBoundingClientRect(); + var targetRect = getTargetRect(target); + + var scrollTop = getScroll(target, true); + var scrollLeft = getScroll(target, false); + + var docElem = window.document.body; + var clientTop = docElem.clientTop || 0; + var clientLeft = docElem.clientLeft || 0; + + return { + top: elemRect.top - targetRect.top + scrollTop - clientTop, + left: elemRect.left - targetRect.left + scrollLeft - clientLeft, + width: elemRect.width, + height: elemRect.height + }; +} + +function getDefaultTarget() { + return typeof window !== 'undefined' ? window : null; +} + +// Affix +var AffixProps = { + /** + * 距离窗口顶部达到指定偏移量后触发 + */ + offsetTop: PropTypes.number, + offset: PropTypes.number, + /** 距离窗口底部达到指定偏移量后触发 */ + offsetBottom: PropTypes.number, + /** 固定状态改变时触发的回调函数 */ + // onChange?: (affixed?: boolean) => void; + /** 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */ + target: PropTypes.func, + prefixCls: PropTypes.string +}; + +export default { + name: 'AAffix', + props: AffixProps, + mixins: [BaseMixin], + data: function data() { + this.events = ['resize', 'scroll', 'touchstart', 'touchmove', 'touchend', 'pageshow', 'load']; + this.eventHandlers = {}; + return { + affixStyle: undefined, + placeholderStyle: undefined + }; + }, + beforeMount: function beforeMount() { + this.updatePosition = throttleByAnimationFrame(this.updatePosition); + }, + mounted: function mounted() { + var _this = this; + + var target = this.target || getDefaultTarget; + // Wait for parent component ref has its value + this.timeout = setTimeout(function () { + _this.setTargetEventListeners(target); + }); + }, + + watch: { + target: function target(val) { + var _this2 = this; + + this.$nextTick(function () { + _this2.clearEventListeners(); + _this2.setTargetEventListeners(val); + // Mock Event object. + _this2.updatePosition({}); + }); + } + }, + beforeDestroy: function beforeDestroy() { + this.clearEventListeners(); + clearTimeout(this.timeout); + this.updatePosition.cancel(); + }, + + methods: { + setAffixStyle: function setAffixStyle(e, affixStyle) { + var _this3 = this; + + var _target = this.target, + target = _target === undefined ? getDefaultTarget : _target; + + var originalAffixStyle = this.affixStyle; + var isWindow = target() === window; + if (e.type === 'scroll' && originalAffixStyle && affixStyle && isWindow) { + return; + } + if (shallowequal(affixStyle, originalAffixStyle)) { + return; + } + this.setState({ affixStyle: affixStyle }, function () { + var affixed = !!_this3.affixStyle; + if (affixStyle && !originalAffixStyle || !affixStyle && originalAffixStyle) { + _this3.$emit('change', affixed); + } + }); + }, + setPlaceholderStyle: function setPlaceholderStyle(placeholderStyle) { + var originalPlaceholderStyle = this.placeholderStyle; + if (shallowequal(placeholderStyle, originalPlaceholderStyle)) { + return; + } + this.setState({ placeholderStyle: placeholderStyle }); + }, + syncPlaceholderStyle: function syncPlaceholderStyle(e) { + var affixStyle = this.affixStyle; + + if (!affixStyle) { + return; + } + this.$refs.placeholderNode.style.cssText = ''; + this.setAffixStyle(e, _extends({}, affixStyle, { + width: this.$refs.placeholderNode.offsetWidth + 'px' + })); + this.setPlaceholderStyle({ + width: this.$refs.placeholderNode.offsetWidth + 'px' + }); + }, + updatePosition: function updatePosition(e) { + var offsetTop = this.offsetTop; + var offsetBottom = this.offsetBottom, + offset = this.offset, + _target2 = this.target, + target = _target2 === undefined ? getDefaultTarget : _target2; + + var targetNode = target(); + + // Backwards support + offsetTop = offsetTop || offset; + var scrollTop = getScroll(targetNode, true); + var affixNode = this.$el; + var elemOffset = getOffset(affixNode, targetNode); + var elemSize = { + width: this.$refs.fixedNode.offsetWidth, + height: this.$refs.fixedNode.offsetHeight + }; + + var offsetMode = { + top: false, + bottom: false + // Default to `offsetTop=0`. + };if (typeof offsetTop !== 'number' && typeof offsetBottom !== 'number') { + offsetMode.top = true; + offsetTop = 0; + } else { + offsetMode.top = typeof offsetTop === 'number'; + offsetMode.bottom = typeof offsetBottom === 'number'; + } + + var targetRect = getTargetRect(targetNode); + var targetInnerHeight = targetNode.innerHeight || targetNode.clientHeight; + if (scrollTop > elemOffset.top - offsetTop && offsetMode.top) { + // Fixed Top + var width = elemOffset.width + 'px'; + var top = targetRect.top + offsetTop + 'px'; + this.setAffixStyle(e, { + position: 'fixed', + top: top, + left: targetRect.left + elemOffset.left + 'px', + width: width + }); + this.setPlaceholderStyle({ + width: width, + height: elemSize.height + 'px' + }); + } else if (scrollTop < elemOffset.top + elemSize.height + offsetBottom - targetInnerHeight && offsetMode.bottom) { + // Fixed Bottom + var targetBottomOffet = targetNode === window ? 0 : window.innerHeight - targetRect.bottom; + var _width = elemOffset.width + 'px'; + this.setAffixStyle(e, { + position: 'fixed', + bottom: targetBottomOffet + offsetBottom + 'px', + left: targetRect.left + elemOffset.left + 'px', + width: _width + }); + this.setPlaceholderStyle({ + width: _width, + height: elemOffset.height + 'px' + }); + } else { + var affixStyle = this.affixStyle; + + if (e.type === 'resize' && affixStyle && affixStyle.position === 'fixed' && affixNode.offsetWidth) { + this.setAffixStyle(e, _extends({}, affixStyle, { width: affixNode.offsetWidth + 'px' })); + } else { + this.setAffixStyle(e, null); + } + this.setPlaceholderStyle(null); + } + if (e.type === 'resize') { + this.syncPlaceholderStyle(e); + } + }, + setTargetEventListeners: function setTargetEventListeners(getTarget) { + var _this4 = this; + + var target = getTarget(); + if (!target) { + return; + } + this.clearEventListeners(); + + this.events.forEach(function (eventName) { + _this4.eventHandlers[eventName] = addEventListener(target, eventName, _this4.updatePosition); + }); + }, + clearEventListeners: function clearEventListeners() { + var _this5 = this; + + this.events.forEach(function (eventName) { + var handler = _this5.eventHandlers[eventName]; + if (handler && handler.remove) { + handler.remove(); + } + }); + } + }, + + render: function render() { + var h = arguments[0]; + var prefixCls = this.prefixCls, + affixStyle = this.affixStyle, + placeholderStyle = this.placeholderStyle, + $slots = this.$slots, + $props = this.$props; + + var className = classNames(_defineProperty({}, prefixCls || 'ant-affix', affixStyle)); + + var props = { + attrs: omit($props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target']) + }; + return h( + 'div', + _mergeJSXProps([props, { style: placeholderStyle, ref: 'placeholderNode' }]), + [h( + 'div', + { 'class': className, ref: 'fixedNode', style: affixStyle }, + [$slots['default']] + )] + ); + } +}; \ No newline at end of file diff --git a/es/affix/style/css.js b/es/affix/style/css.js new file mode 100644 index 0000000000..579ee46c2e --- /dev/null +++ b/es/affix/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import './index.css'; \ No newline at end of file diff --git a/es/affix/style/index.css b/es/affix/style/index.css new file mode 100644 index 0000000000..a70d1b00eb --- /dev/null +++ b/es/affix/style/index.css @@ -0,0 +1,8 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-affix { + position: fixed; + z-index: 10; +} diff --git a/es/affix/style/index.js b/es/affix/style/index.js new file mode 100644 index 0000000000..1675ad8fe0 --- /dev/null +++ b/es/affix/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import './index.less'; \ No newline at end of file diff --git a/es/affix/style/index.less b/es/affix/style/index.less new file mode 100644 index 0000000000..cd61d1ed08 --- /dev/null +++ b/es/affix/style/index.less @@ -0,0 +1,6 @@ +@import "../../style/themes/default"; + +.@{ant-prefix}-affix { + position: fixed; + z-index: @zindex-affix; +} diff --git a/es/alert/index.js b/es/alert/index.js new file mode 100644 index 0000000000..eb1aa122b0 --- /dev/null +++ b/es/alert/index.js @@ -0,0 +1,160 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; + +import Icon from '../icon'; +import classNames from 'classnames'; +import BaseMixin from '../_util/BaseMixin'; +import PropTypes from '../_util/vue-types'; +import getTransitionProps from '../_util/getTransitionProps'; +import { getComponentFromProp } from '../_util/props-util'; +function noop() {} +export var AlertProps = { + /** + * Type of Alert styles, options:`success`, `info`, `warning`, `error` + */ + type: PropTypes.oneOf(['success', 'info', 'warning', 'error']), + /** Whether Alert can be closed */ + closable: PropTypes.bool, + /** Close text to show */ + closeText: PropTypes.any, + /** Content of Alert */ + message: PropTypes.any, + /** Additional content of Alert */ + description: PropTypes.any, + /** Callback when close Alert */ + // onClose?: React.MouseEventHandler; + /** Trigger when animation ending of Alert */ + afterClose: PropTypes.func.def(noop), + /** Whether to show icon */ + showIcon: PropTypes.bool, + iconType: PropTypes.string, + prefixCls: PropTypes.string, + banner: PropTypes.bool +}; + +export default { + props: AlertProps, + mixins: [BaseMixin], + name: 'AAlert', + data: function data() { + return { + closing: true, + closed: false + }; + }, + + methods: { + handleClose: function handleClose(e) { + e.preventDefault(); + var dom = this.$el; + dom.style.height = dom.offsetHeight + 'px'; + // Magic code + // 重复一次后才能正确设置 height + dom.style.height = dom.offsetHeight + 'px'; + + this.setState({ + closing: false + }); + this.$emit('close', e); + }, + animationEnd: function animationEnd() { + this.setState({ + closed: true, + closing: true + }); + this.afterClose(); + } + }, + + render: function render() { + var _classNames; + + var h = arguments[0]; + var _prefixCls = this.prefixCls, + prefixCls = _prefixCls === undefined ? 'ant-alert' : _prefixCls, + banner = this.banner, + closing = this.closing, + closed = this.closed; + var closable = this.closable, + type = this.type, + showIcon = this.showIcon, + iconType = this.iconType; + + var closeText = getComponentFromProp(this, 'closeText'); + var description = getComponentFromProp(this, 'description'); + var message = getComponentFromProp(this, 'message'); + // banner模式默认有 Icon + showIcon = banner && showIcon === undefined ? true : showIcon; + // banner模式默认为警告 + type = banner && type === undefined ? 'warning' : type || 'info'; + + if (!iconType) { + switch (type) { + case 'success': + iconType = 'check-circle'; + break; + case 'info': + iconType = 'info-circle'; + break; + case 'error': + iconType = 'cross-circle'; + break; + case 'warning': + iconType = 'exclamation-circle'; + break; + default: + iconType = 'default'; + } + + // use outline icon in alert with description + if (description) { + iconType += '-o'; + } + } + + var alertCls = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, prefixCls + '-' + type, true), _defineProperty(_classNames, prefixCls + '-close', !closing), _defineProperty(_classNames, prefixCls + '-with-description', !!description), _defineProperty(_classNames, prefixCls + '-no-icon', !showIcon), _defineProperty(_classNames, prefixCls + '-banner', !!banner), _classNames)); + + // closeable when closeText is assigned + if (closeText) { + closable = true; + } + + var closeIcon = closable ? h( + 'a', + { + on: { + 'click': this.handleClose + }, + 'class': prefixCls + '-close-icon' }, + [closeText || h(Icon, { + attrs: { type: 'cross' } + })] + ) : null; + var transitionProps = getTransitionProps(prefixCls + '-slide-up', { + appear: false, + afterLeave: this.animationEnd + }); + return closed ? null : h( + 'transition', + transitionProps, + [h( + 'div', + { + directives: [{ + name: 'show', + value: closing + }], + 'class': alertCls }, + [showIcon ? h(Icon, { 'class': prefixCls + '-icon', attrs: { type: iconType } + }) : null, h( + 'span', + { 'class': prefixCls + '-message' }, + [message] + ), h( + 'span', + { 'class': prefixCls + '-description' }, + [description] + ), closeIcon] + )] + ); + } +}; \ No newline at end of file diff --git a/es/alert/style/css.js b/es/alert/style/css.js new file mode 100644 index 0000000000..579ee46c2e --- /dev/null +++ b/es/alert/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import './index.css'; \ No newline at end of file diff --git a/es/alert/style/index.css b/es/alert/style/index.css new file mode 100644 index 0000000000..c5c02eacf4 --- /dev/null +++ b/es/alert/style/index.css @@ -0,0 +1,198 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-alert { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + position: relative; + padding: 8px 15px 8px 37px; + border-radius: 4px; +} +.ant-alert.ant-alert-no-icon { + padding: 8px 15px; +} +.ant-alert-icon { + top: 12.5px; + left: 16px; + position: absolute; +} +.ant-alert-description { + font-size: 14px; + line-height: 22px; + display: none; +} +.ant-alert-success { + border: 1px solid #b7eb8f; + background-color: #f6ffed; +} +.ant-alert-success .ant-alert-icon { + color: #52c41a; +} +.ant-alert-info { + border: 1px solid #91d5ff; + background-color: #e6f7ff; +} +.ant-alert-info .ant-alert-icon { + color: #1890ff; +} +.ant-alert-warning { + border: 1px solid #ffe58f; + background-color: #fffbe6; +} +.ant-alert-warning .ant-alert-icon { + color: #faad14; +} +.ant-alert-error { + border: 1px solid #ffa39e; + background-color: #fff1f0; +} +.ant-alert-error .ant-alert-icon { + color: #f5222d; +} +.ant-alert-close-icon { + font-size: 12px; + position: absolute; + right: 16px; + top: 8px; + line-height: 22px; + overflow: hidden; + cursor: pointer; +} +.ant-alert-close-icon .anticon-cross { + color: rgba(0, 0, 0, 0.45); + -webkit-transition: color .3s; + transition: color .3s; +} +.ant-alert-close-icon .anticon-cross:hover { + color: #404040; +} +.ant-alert-close-text { + position: absolute; + right: 16px; +} +.ant-alert-with-description { + padding: 15px 15px 15px 64px; + position: relative; + border-radius: 4px; + color: rgba(0, 0, 0, 0.65); + line-height: 1.5; +} +.ant-alert-with-description.ant-alert-no-icon { + padding: 15px; +} +.ant-alert-with-description .ant-alert-icon { + position: absolute; + top: 16px; + left: 24px; + font-size: 24px; +} +.ant-alert-with-description .ant-alert-close-icon { + position: absolute; + top: 16px; + right: 16px; + cursor: pointer; + font-size: 14px; +} +.ant-alert-with-description .ant-alert-message { + font-size: 16px; + color: rgba(0, 0, 0, 0.85); + display: block; + margin-bottom: 4px; +} +.ant-alert-with-description .ant-alert-description { + display: block; +} +.ant-alert.ant-alert-close { + height: 0 !important; + margin: 0; + padding-top: 0; + padding-bottom: 0; + -webkit-transition: all 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86); + transition: all 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86); + -webkit-transform-origin: 50% 0; + -ms-transform-origin: 50% 0; + transform-origin: 50% 0; +} +.ant-alert-slide-up-leave { + -webkit-animation: antAlertSlideUpOut 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86); + animation: antAlertSlideUpOut 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86); + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} +.ant-alert-banner { + border-radius: 0; + border: 0; + margin-bottom: 0; +} +@-webkit-keyframes antAlertSlideUpIn { + 0% { + opacity: 0; + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: scaleY(0); + transform: scaleY(0); + } + 100% { + opacity: 1; + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: scaleY(1); + transform: scaleY(1); + } +} +@keyframes antAlertSlideUpIn { + 0% { + opacity: 0; + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: scaleY(0); + transform: scaleY(0); + } + 100% { + opacity: 1; + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: scaleY(1); + transform: scaleY(1); + } +} +@-webkit-keyframes antAlertSlideUpOut { + 0% { + opacity: 1; + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: scaleY(1); + transform: scaleY(1); + } + 100% { + opacity: 0; + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: scaleY(0); + transform: scaleY(0); + } +} +@keyframes antAlertSlideUpOut { + 0% { + opacity: 1; + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: scaleY(1); + transform: scaleY(1); + } + 100% { + opacity: 0; + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: scaleY(0); + transform: scaleY(0); + } +} diff --git a/es/alert/style/index.js b/es/alert/style/index.js new file mode 100644 index 0000000000..1675ad8fe0 --- /dev/null +++ b/es/alert/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import './index.less'; \ No newline at end of file diff --git a/es/alert/style/index.less b/es/alert/style/index.less new file mode 100644 index 0000000000..dfcf65789c --- /dev/null +++ b/es/alert/style/index.less @@ -0,0 +1,169 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@alert-prefix-cls: ~"@{ant-prefix}-alert"; + +@alert-message-color: @heading-color; +@alert-text-color: @text-color; + +.@{alert-prefix-cls} { + .reset-component; + position: relative; + padding: 8px 15px 8px 37px; + border-radius: @border-radius-base; + + &&-no-icon { + padding: 8px 15px; + } + + &-icon { + top: 8px + @font-size-base * @line-height-base / 2 - @font-size-base / 2 + 1px; + left: 16px; + position: absolute; + } + + &-description { + font-size: @font-size-base; + line-height: 22px; + display: none; + } + + &-success { + border: @border-width-base @border-style-base ~`colorPalette("@{success-color}", 3)`; + background-color: ~`colorPalette("@{success-color}", 1)`; + .@{alert-prefix-cls}-icon { + color: @success-color; + } + } + + &-info { + border: @border-width-base @border-style-base ~`colorPalette("@{info-color}", 3)`; + background-color: ~`colorPalette("@{info-color}", 1)`; + .@{alert-prefix-cls}-icon { + color: @info-color; + } + } + + &-warning { + border: @border-width-base @border-style-base ~`colorPalette("@{warning-color}", 3)`; + background-color: ~`colorPalette("@{warning-color}", 1)`; + .@{alert-prefix-cls}-icon { + color: @warning-color; + } + } + + &-error { + border: @border-width-base @border-style-base ~`colorPalette("@{error-color}", 3)`; + background-color: ~`colorPalette("@{error-color}", 1)`; + .@{alert-prefix-cls}-icon { + color: @error-color; + } + } + + &-close-icon { + font-size: @font-size-sm; + position: absolute; + right: 16px; + top: 8px; + line-height: 22px; + overflow: hidden; + cursor: pointer; + + .@{iconfont-css-prefix}-cross { + color: @text-color-secondary; + transition: color .3s; + &:hover { + color: #404040; + } + } + } + + &-close-text { + position: absolute; + right: 16px; + } + + &-with-description { + padding: 15px 15px 15px 64px; + position: relative; + border-radius: @border-radius-base; + color: @text-color; + line-height: @line-height-base; + } + + &-with-description&-no-icon { + padding: 15px; + } + + &-with-description &-icon { + position: absolute; + top: 16px; + left: 24px; + font-size: 24px; + } + + &-with-description &-close-icon { + position: absolute; + top: 16px; + right: 16px; + cursor: pointer; + font-size: @font-size-base; + } + + &-with-description &-message { + font-size: @font-size-lg; + color: @alert-message-color; + display: block; + margin-bottom: 4px; + } + + &-with-description &-description { + display: block; + } + + &&-close { + height: 0 !important; + margin: 0; + padding-top: 0; + padding-bottom: 0; + transition: all .3s @ease-in-out-circ; + transform-origin: 50% 0; + } + + &-slide-up-leave { + animation: antAlertSlideUpOut .3s @ease-in-out-circ; + animation-fill-mode: both; + } + + &-banner { + border-radius: 0; + border: 0; + margin-bottom: 0; + } +} + +@keyframes antAlertSlideUpIn { + 0% { + opacity: 0; + transform-origin: 0% 0%; + transform: scaleY(0); + } + 100% { + opacity: 1; + transform-origin: 0% 0%; + transform: scaleY(1); + } +} + +@keyframes antAlertSlideUpOut { + 0% { + opacity: 1; + transform-origin: 0% 0%; + transform: scaleY(1); + } + 100% { + opacity: 0; + transform-origin: 0% 0%; + transform: scaleY(0); + } +} diff --git a/es/align/Align.js b/es/align/Align.js new file mode 100644 index 0000000000..3eb731904d --- /dev/null +++ b/es/align/Align.js @@ -0,0 +1,129 @@ +import _extends from 'babel-runtime/helpers/extends'; + +import PropTypes from '../_util/vue-types'; +import align from 'dom-align'; +import addEventListener from '../_util/Dom/addEventListener'; +import { cloneElement } from '../_util/vnode.js'; +import isWindow from './isWindow'; +import clonedeep from 'lodash/cloneDeep'; +import shallowequal from 'shallowequal'; +function noop() {} + +function buffer(fn, ms) { + var timer = void 0; + + function clear() { + if (timer) { + clearTimeout(timer); + timer = null; + } + } + + function bufferFn() { + clear(); + timer = setTimeout(fn, ms); + } + + bufferFn.clear = clear; + + return bufferFn; +} + +export default { + props: { + childrenProps: PropTypes.object, + align: PropTypes.object.isRequired, + target: PropTypes.func.def(noop), + monitorBufferTime: PropTypes.number.def(50), + monitorWindowResize: PropTypes.bool.def(false), + disabled: PropTypes.bool.def(false), + visible: PropTypes.bool.def(false) + }, + data: function data() { + this.aligned = false; + return {}; + }, + mounted: function mounted() { + var _this = this; + + this.$nextTick(function () { + _this.prevProps = _extends({}, _this.$props); + var props = _this.$props; + // if parent ref not attached .... use document.getElementById + !_this.aligned && _this.forceAlign(); + if (!props.disabled && props.monitorWindowResize) { + _this.startMonitorWindowResize(); + } + }); + }, + updated: function updated() { + var _this2 = this; + + this.$nextTick(function () { + var prevProps = _this2.prevProps; + var props = _this2.$props; + var reAlign = false; + if (!props.disabled && _this2.visible) { + if (prevProps.disabled || !shallowequal(prevProps.align, props.align)) { + reAlign = true; + } else { + var lastTarget = prevProps.target(); + var currentTarget = props.target(); + if (isWindow(lastTarget) && isWindow(currentTarget)) { + reAlign = false; + } else if (lastTarget !== currentTarget) { + reAlign = true; + } + } + } + + if (reAlign) { + _this2.forceAlign(); + } + + if (props.monitorWindowResize && !props.disabled) { + _this2.startMonitorWindowResize(); + } else { + _this2.stopMonitorWindowResize(); + } + _this2.prevProps = _extends({}, _this2.$props, { align: clonedeep(_this2.$props.align) }); + }); + }, + beforeDestroy: function beforeDestroy() { + this.stopMonitorWindowResize(); + }, + + methods: { + startMonitorWindowResize: function startMonitorWindowResize() { + if (!this.resizeHandler) { + this.bufferMonitor = buffer(this.forceAlign, this.$props.monitorBufferTime); + this.resizeHandler = addEventListener(window, 'resize', this.bufferMonitor); + } + }, + stopMonitorWindowResize: function stopMonitorWindowResize() { + if (this.resizeHandler) { + this.bufferMonitor.clear(); + this.resizeHandler.remove(); + this.resizeHandler = null; + } + }, + forceAlign: function forceAlign() { + var props = this.$props; + if (!props.disabled) { + var source = this.$el; + this.aligned = true; + this.$listeners.align && this.$listeners.align(source, align(source, props.target(), props.align)); + } + } + }, + + render: function render() { + var childrenProps = this.$props.childrenProps; + + var child = this.$slots['default'][0]; + if (childrenProps) { + return cloneElement(child, { props: childrenProps }); + } + return child; + } +}; \ No newline at end of file diff --git a/es/align/index.js b/es/align/index.js new file mode 100644 index 0000000000..3c1385da41 --- /dev/null +++ b/es/align/index.js @@ -0,0 +1,3 @@ +// based on vc-align 2.3.6 +import Align from './Align'; +export default Align; \ No newline at end of file diff --git a/es/align/isWindow.js b/es/align/isWindow.js new file mode 100644 index 0000000000..ca05d3ba19 --- /dev/null +++ b/es/align/isWindow.js @@ -0,0 +1,5 @@ +export default function isWindow(obj) { + /* eslint no-eq-null: 0 */ + /* eslint eqeqeq: 0 */ + return obj != null && obj == obj.window; +} \ No newline at end of file diff --git a/es/anchor/Anchor.js b/es/anchor/Anchor.js new file mode 100644 index 0000000000..2ec24f0404 --- /dev/null +++ b/es/anchor/Anchor.js @@ -0,0 +1,279 @@ +import PropTypes from '../_util/vue-types'; +import classNames from 'classnames'; +import addEventListener from '../_util/Dom/addEventListener'; +import Affix from '../affix'; +import getScroll from '../_util/getScroll'; +import getRequestAnimationFrame from '../_util/getRequestAnimationFrame'; +import { initDefaultProps, getClass, getStyle } from '../_util/props-util'; +import BaseMixin from '../_util/BaseMixin'; + +function getDefaultContainer() { + return window; +} + +function getOffsetTop(element, container) { + if (!element) { + return 0; + } + + if (!element.getClientRects().length) { + return 0; + } + + var rect = element.getBoundingClientRect(); + + if (rect.width || rect.height) { + if (container === window) { + container = element.ownerDocument.documentElement; + return rect.top - container.clientTop; + } + return rect.top - container.getBoundingClientRect().top; + } + + return rect.top; +} + +function easeInOutCubic(t, b, c, d) { + var cc = c - b; + t /= d / 2; + if (t < 1) { + return cc / 2 * t * t * t + b; + } + return cc / 2 * ((t -= 2) * t * t + 2) + b; +} + +var reqAnimFrame = getRequestAnimationFrame(); +var sharpMatcherRegx = /#([^#]+)$/; +function scrollTo(href) { + var offsetTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var getContainer = arguments[2]; + var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {}; + + var container = getContainer(); + var scrollTop = getScroll(container, true); + var sharpLinkMatch = sharpMatcherRegx.exec(href); + if (!sharpLinkMatch) { + return; + } + var targetElement = document.getElementById(sharpLinkMatch[1]); + if (!targetElement) { + return; + } + var eleOffsetTop = getOffsetTop(targetElement, container); + var targetScrollTop = scrollTop + eleOffsetTop - offsetTop; + var startTime = Date.now(); + var frameFunc = function frameFunc() { + var timestamp = Date.now(); + var time = timestamp - startTime; + var nextScrollTop = easeInOutCubic(time, scrollTop, targetScrollTop, 450); + if (container === window) { + window.scrollTo(window.pageXOffset, nextScrollTop); + } else { + container.scrollTop = nextScrollTop; + } + if (time < 450) { + reqAnimFrame(frameFunc); + } else { + callback(); + } + }; + reqAnimFrame(frameFunc); + history.pushState(null, '', href); +} + +export var AnchorProps = { + prefixCls: PropTypes.string, + offsetTop: PropTypes.number, + bounds: PropTypes.number, + affix: PropTypes.bool, + showInkInFixed: PropTypes.bool, + getContainer: PropTypes.func +}; + +export default { + name: 'AAnchor', + mixins: [BaseMixin], + inheritAttrs: false, + props: initDefaultProps(AnchorProps, { + prefixCls: 'ant-anchor', + affix: true, + showInkInFixed: false, + getContainer: getDefaultContainer + }), + + data: function data() { + this.links = []; + return { + activeLink: null + }; + }, + provide: function provide() { + var _this = this; + + return { + antAnchor: { + registerLink: function registerLink(link) { + if (!_this.links.includes(link)) { + _this.links.push(link); + } + }, + unregisterLink: function unregisterLink(link) { + var index = _this.links.indexOf(link); + if (index !== -1) { + _this.links.splice(index, 1); + } + }, + $data: this.$data, + scrollTo: this.handleScrollTo + } + }; + }, + mounted: function mounted() { + var _this2 = this; + + this.$nextTick(function () { + var getContainer = _this2.getContainer; + + _this2.scrollEvent = addEventListener(getContainer(), 'scroll', _this2.handleScroll); + _this2.handleScroll(); + }); + }, + beforeDestroy: function beforeDestroy() { + if (this.scrollEvent) { + this.scrollEvent.remove(); + } + }, + updated: function updated() { + var _this3 = this; + + this.$nextTick(function () { + _this3.updateInk(); + }); + }, + + methods: { + handleScroll: function handleScroll() { + if (this.animating) { + return; + } + var offsetTop = this.offsetTop, + bounds = this.bounds; + + this.setState({ + activeLink: this.getCurrentAnchor(offsetTop, bounds) + }); + }, + handleScrollTo: function handleScrollTo(link) { + var _this4 = this; + + var offsetTop = this.offsetTop, + getContainer = this.getContainer; + + this.animating = true; + this.setState({ activeLink: link }); + scrollTo(link, offsetTop, getContainer, function () { + _this4.animating = false; + }); + }, + getCurrentAnchor: function getCurrentAnchor() { + var offsetTop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var bounds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5; + + var activeLink = ''; + if (typeof document === 'undefined') { + return activeLink; + } + + var linkSections = []; + var getContainer = this.getContainer; + + var container = getContainer(); + this.links.forEach(function (link) { + var sharpLinkMatch = sharpMatcherRegx.exec(link.toString()); + if (!sharpLinkMatch) { + return; + } + var target = document.getElementById(sharpLinkMatch[1]); + if (target) { + var top = getOffsetTop(target, container); + if (top < offsetTop + bounds) { + linkSections.push({ + link: link, + top: top + }); + } + } + }); + + if (linkSections.length) { + var maxSection = linkSections.reduce(function (prev, curr) { + return curr.top > prev.top ? curr : prev; + }); + return maxSection.link; + } + return ''; + }, + updateInk: function updateInk() { + if (typeof document === 'undefined') { + return; + } + var prefixCls = this.prefixCls; + + var linkNode = this.$el.getElementsByClassName(prefixCls + '-link-title-active')[0]; + if (linkNode) { + this.$refs.linkNode.style.top = linkNode.offsetTop + linkNode.clientHeight / 2 - 4.5 + 'px'; + } + } + }, + + render: function render() { + var h = arguments[0]; + var prefixCls = this.prefixCls, + offsetTop = this.offsetTop, + affix = this.affix, + showInkInFixed = this.showInkInFixed, + activeLink = this.activeLink, + $slots = this.$slots; + + + var inkClass = classNames(prefixCls + '-ink-ball', { + visible: activeLink + }); + + var wrapperClass = classNames(getClass(this), prefixCls + '-wrapper'); + + var anchorClass = classNames(prefixCls, { + 'fixed': !affix && !showInkInFixed + }); + + var wrapperStyle = { + maxHeight: offsetTop ? 'calc(100vh - ' + offsetTop + 'px)' : '100vh' + // ...getStyle(this, true), + }; + + var anchorContent = h( + 'div', + { + 'class': wrapperClass, + style: wrapperStyle + }, + [h( + 'div', + { 'class': anchorClass }, + [h( + 'div', + { 'class': prefixCls + '-ink' }, + [h('span', { 'class': inkClass, ref: 'linkNode' })] + ), $slots['default']] + )] + ); + + return !affix ? anchorContent : h( + Affix, + { + attrs: { offsetTop: offsetTop } + }, + [anchorContent] + ); + } +}; \ No newline at end of file diff --git a/es/anchor/AnchorLink.js b/es/anchor/AnchorLink.js new file mode 100644 index 0000000000..648466476b --- /dev/null +++ b/es/anchor/AnchorLink.js @@ -0,0 +1,68 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import PropTypes from '../_util/vue-types'; +import { initDefaultProps, getComponentFromProp } from '../_util/props-util'; +import classNames from 'classnames'; + +export var AnchorLinkProps = { + prefixCls: PropTypes.string, + href: PropTypes.string, + title: PropTypes.any +}; + +export default { + name: 'AAnchorLink', + props: initDefaultProps(AnchorLinkProps, { + prefixCls: 'ant-anchor', + href: '#' + }), + inject: { + antAnchor: { 'default': {} } + }, + + mounted: function mounted() { + this.antAnchor.registerLink(this.href); + }, + beforeDestroy: function beforeDestroy() { + this.antAnchor.unregisterLink(this.href); + }, + + watch: { + href: function href(val) { + this.antAnchor.unregisterLink(val); + this.antAnchor.registerLink(val); + } + }, + methods: { + handleClick: function handleClick() { + this.antAnchor.scrollTo(this.href); + } + }, + render: function render() { + var h = arguments[0]; + var prefixCls = this.prefixCls, + href = this.href, + $slots = this.$slots; + + var title = getComponentFromProp(this, 'title'); + var active = this.antAnchor.$data.activeLink === href; + var wrapperClassName = classNames(prefixCls + '-link', _defineProperty({}, prefixCls + '-link-active', active)); + var titleClassName = classNames(prefixCls + '-link-title', _defineProperty({}, prefixCls + '-link-title-active', active)); + return h( + 'div', + { 'class': wrapperClassName }, + [h( + 'a', + { + 'class': titleClassName, + attrs: { href: href, + title: typeof title === 'string' ? title : '' + }, + on: { + 'click': this.handleClick + } + }, + [title] + ), $slots['default']] + ); + } +}; \ No newline at end of file diff --git a/es/anchor/index.js b/es/anchor/index.js new file mode 100644 index 0000000000..5ad15de147 --- /dev/null +++ b/es/anchor/index.js @@ -0,0 +1,8 @@ +import Anchor from './Anchor'; +import AnchorLink from './AnchorLink'; + +export { AnchorProps } from './Anchor'; +export { AnchorLinkProps } from './AnchorLink'; + +Anchor.Link = AnchorLink; +export default Anchor; \ No newline at end of file diff --git a/es/anchor/style/css.js b/es/anchor/style/css.js new file mode 100644 index 0000000000..579ee46c2e --- /dev/null +++ b/es/anchor/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import './index.css'; \ No newline at end of file diff --git a/es/anchor/style/index.css b/es/anchor/style/index.css new file mode 100644 index 0000000000..02665e03a5 --- /dev/null +++ b/es/anchor/style/index.css @@ -0,0 +1,84 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-anchor { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + position: relative; + padding-left: 2px; +} +.ant-anchor-wrapper { + background-color: #fff; + overflow: auto; + padding-left: 4px; + margin-left: -4px; +} +.ant-anchor-ink { + position: absolute; + height: 100%; + left: 0; + top: 0; +} +.ant-anchor-ink:before { + content: ' '; + position: relative; + width: 2px; + height: 100%; + display: block; + background-color: #e8e8e8; + margin: 0 auto; +} +.ant-anchor-ink-ball { + display: none; + position: absolute; + width: 8px; + height: 8px; + border-radius: 8px; + border: 2px solid #1890ff; + background-color: #fff; + left: 50%; + -webkit-transition: top 0.3s ease-in-out; + transition: top 0.3s ease-in-out; + -webkit-transform: translateX(-50%); + -ms-transform: translateX(-50%); + transform: translateX(-50%); +} +.ant-anchor-ink-ball.visible { + display: inline-block; +} +.ant-anchor.fixed .ant-anchor-ink .ant-anchor-ink-ball { + display: none; +} +.ant-anchor-link { + padding: 8px 0 8px 16px; + line-height: 1; +} +.ant-anchor-link-title { + display: block; + position: relative; + -webkit-transition: all .3s; + transition: all .3s; + color: rgba(0, 0, 0, 0.65); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin-bottom: 8px; +} +.ant-anchor-link-title:only-child { + margin-bottom: 0; +} +.ant-anchor-link-active > .ant-anchor-link-title { + color: #1890ff; +} +.ant-anchor-link .ant-anchor-link { + padding-top: 6px; + padding-bottom: 6px; +} diff --git a/es/anchor/style/index.js b/es/anchor/style/index.js new file mode 100644 index 0000000000..1675ad8fe0 --- /dev/null +++ b/es/anchor/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import './index.less'; \ No newline at end of file diff --git a/es/anchor/style/index.less b/es/anchor/style/index.less new file mode 100644 index 0000000000..235eb78152 --- /dev/null +++ b/es/anchor/style/index.less @@ -0,0 +1,81 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@anchor-border-width: 2px; + +.@{ant-prefix}-anchor { + .reset-component; + position: relative; + padding-left: @anchor-border-width; + + &-wrapper { + background-color: @component-background; + overflow: auto; + padding-left: 4px; + margin-left: -4px; + } + + &-ink { + position: absolute; + height: 100%; + left: 0; + top: 0; + &:before { + content: ' '; + position: relative; + width: @anchor-border-width; + height: 100%; + display: block; + background-color: @border-color-split; + margin: 0 auto; + } + &-ball { + display: none; + position: absolute; + width: 8px; + height: 8px; + border-radius: 8px; + border: 2px solid @primary-color; + background-color: @component-background; + left: 50%; + transition: top .3s ease-in-out; + transform: translateX(-50%); + &.visible { + display: inline-block; + } + } + } + + &.fixed &-ink &-ink-ball { + display: none; + } + + &-link { + padding: 8px 0 8px 16px; + line-height: 1; + + &-title { + display: block; + position: relative; + transition: all .3s; + color: @text-color; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin-bottom: 8px; + + &:only-child { + margin-bottom: 0; + } + } + + &-active > &-title { + color: @primary-color; + } + } + + &-link &-link { + padding-top: 6px; + padding-bottom: 6px; + } +} diff --git a/es/auto-complete/InputElement.js b/es/auto-complete/InputElement.js new file mode 100644 index 0000000000..1a67c2849c --- /dev/null +++ b/es/auto-complete/InputElement.js @@ -0,0 +1,100 @@ +import _slicedToArray from 'babel-runtime/helpers/slicedToArray'; +import _extends from 'babel-runtime/helpers/extends'; + +import PropTypes from '../_util/vue-types'; +import { cloneElement } from '../_util/vnode'; +function chaining() { + for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) { + fns[_key] = arguments[_key]; + } + + return function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + // eslint-disable-line + // eslint-disable-line + for (var i = 0; i < fns.length; i++) { + if (fns[i] && typeof fns[i] === 'function') { + fns[i].apply(this, args); + } + } + }; +} +export default { + props: { + value: PropTypes.any, + disabled: PropTypes.bool + }, + methods: { + focus: function focus() { + var ele = this.$refs.ele; + ele.focus ? ele.focus() : this.$el.focus(); + }, + blur: function blur() { + var ele = this.$refs.ele; + ele.blur ? ele.blur() : this.$el.blur(); + } + }, + + render: function render() { + var _$slots = this.$slots, + $slots = _$slots === undefined ? {} : _$slots, + _$listeners = this.$listeners, + $listeners = _$listeners === undefined ? {} : _$listeners, + _$props = this.$props, + $props = _$props === undefined ? {} : _$props, + _$attrs = this.$attrs, + $attrs = _$attrs === undefined ? {} : _$attrs; + + var value = $props.value === undefined ? '' : $props.value; + var children = $slots['default'][0]; + var _$slots$default$0$com = $slots['default'][0].componentOptions, + componentOptions = _$slots$default$0$com === undefined ? {} : _$slots$default$0$com; + var _componentOptions$lis = componentOptions.listeners, + listeners = _componentOptions$lis === undefined ? {} : _componentOptions$lis; + + var newEvent = _extends({}, listeners); + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = Object.entries($listeners)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref = _step.value; + + var _ref2 = _slicedToArray(_ref, 2); + + var eventName = _ref2[0]; + var event = _ref2[1]; + + newEvent[eventName] = chaining(event, listeners[eventName]); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator['return']) { + _iterator['return'](); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return cloneElement(children, { + domProps: { + value: value + }, + props: $props, + on: newEvent, + attrs: _extends({}, $attrs, { value: value }), + ref: 'ele' + }); + } +}; \ No newline at end of file diff --git a/es/auto-complete/index.js b/es/auto-complete/index.js new file mode 100644 index 0000000000..d9cdf2d634 --- /dev/null +++ b/es/auto-complete/index.js @@ -0,0 +1,132 @@ +import _typeof from 'babel-runtime/helpers/typeof'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _extends from 'babel-runtime/helpers/extends'; + +import { Option, OptGroup } from '../vc-select'; +import Select, { AbstractSelectProps, SelectValue } from '../select'; +import Input from '../input'; +import InputElement from './InputElement'; +import PropTypes from '../_util/vue-types'; +import { getComponentFromProp, getOptionProps, filterEmpty, isValidElement } from '../_util/props-util'; + +// const DataSourceItemObject = PropTypes.shape({ +// value: String, +// text: String, +// }).loose +// const DataSourceItemType = PropTypes.oneOfType([ +// PropTypes.string, +// DataSourceItemObject, +// ]).isRequired + +// export interface AutoCompleteInputProps { +// onChange?: React.FormEventHandler; +// value: any; +// } + +var AutoCompleteProps = _extends({}, AbstractSelectProps(), { + value: SelectValue, + defaultValue: SelectValue, + dataSource: PropTypes.array, + optionLabelProp: String, + dropdownMatchSelectWidth: PropTypes.bool + // onChange?: (value: SelectValue) => void; + // onSelect?: (value: SelectValue, option: Object) => any; +}); + +export default { + name: 'AAutoComplete', + props: _extends({}, AutoCompleteProps, { + prefixCls: PropTypes.string.def('ant-select'), + showSearch: PropTypes.bool.def(false), + transitionName: PropTypes.string.def('slide-up'), + choiceTransitionName: PropTypes.string.def('zoom'), + optionLabelProp: PropTypes.string.def('children'), + filterOption: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]).def(false), + defaultActiveFirstOption: PropTypes.bool.def(true) + }), + Option: _extends({}, Option, { name: 'AAutoCompleteOption' }), + OptGroup: _extends({}, OptGroup, { name: 'AAutoCompleteOptGroup' }), + model: { + prop: 'value', + event: 'change' + }, + methods: { + getInputElement: function getInputElement() { + var h = this.$createElement; + var $slots = this.$slots; + + var children = filterEmpty($slots['default']); + var element = children.length ? children[0] : h(Input); + return h(InputElement, [element]); + }, + focus: function focus() { + if (this.$refs.select) { + this.$refs.select.focus(); + } + }, + blur: function blur() { + if (this.$refs.select) { + this.$refs.select.blur(); + } + } + }, + + render: function render() { + var _cls; + + var h = arguments[0]; + var size = this.size, + prefixCls = this.prefixCls, + optionLabelProp = this.optionLabelProp, + dataSource = this.dataSource, + $slots = this.$slots, + $listeners = this.$listeners; + + + var cls = (_cls = {}, _defineProperty(_cls, prefixCls + '-lg', size === 'large'), _defineProperty(_cls, prefixCls + '-sm', size === 'small'), _defineProperty(_cls, prefixCls + '-show-search', true), _defineProperty(_cls, prefixCls + '-auto-complete', true), _cls); + + var options = void 0; + var childArray = filterEmpty($slots.dataSource); + if (childArray.length) { + options = childArray; + } else { + options = dataSource ? dataSource.map(function (item) { + if (isValidElement(item)) { + return item; + } + switch (typeof item === 'undefined' ? 'undefined' : _typeof(item)) { + case 'string': + return h( + Option, + { key: item }, + [item] + ); + case 'object': + return h( + Option, + { key: item.value }, + [item.text] + ); + default: + throw new Error('AutoComplete[dataSource] only supports type `string[] | Object[]`.'); + } + }) : []; + } + var selectProps = { + props: _extends({}, getOptionProps(this), { + mode: 'combobox', + optionLabelProp: optionLabelProp, + getInputElement: this.getInputElement, + notFoundContent: getComponentFromProp(this, 'notFoundContent') + }), + 'class': cls, + ref: 'select', + on: _extends({}, $listeners) + }; + return h( + Select, + selectProps, + [options] + ); + } +}; \ No newline at end of file diff --git a/es/auto-complete/style/css.js b/es/auto-complete/style/css.js new file mode 100644 index 0000000000..1608d351d8 --- /dev/null +++ b/es/auto-complete/style/css.js @@ -0,0 +1,4 @@ +import '../../style/index.css'; +import './index.css'; + +import '../../select/style/css'; \ No newline at end of file diff --git a/es/auto-complete/style/index.css b/es/auto-complete/style/index.css new file mode 100644 index 0000000000..799af79d73 --- /dev/null +++ b/es/auto-complete/style/index.css @@ -0,0 +1,66 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-select-auto-complete { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; +} +.ant-select-auto-complete.ant-select .ant-select-selection { + border: 0; + -webkit-box-shadow: none; + box-shadow: none; +} +.ant-select-auto-complete.ant-select .ant-select-selection__rendered { + margin-left: 0; + margin-right: 0; + height: 100%; + line-height: 32px; +} +.ant-select-auto-complete.ant-select .ant-select-selection__placeholder { + margin-left: 12px; + margin-right: 12px; +} +.ant-select-auto-complete.ant-select .ant-select-selection--single { + height: auto; +} +.ant-select-auto-complete.ant-select .ant-select-search--inline { + position: static; + float: left; +} +.ant-select-auto-complete.ant-select-allow-clear .ant-select-selection:hover .ant-select-selection__rendered { + margin-right: 0 !important; +} +.ant-select-auto-complete.ant-select .ant-input { + background: transparent; + border-width: 1px; + line-height: 1.5; + height: 32px; +} +.ant-select-auto-complete.ant-select .ant-input:focus, +.ant-select-auto-complete.ant-select .ant-input:hover { + border-color: #40a9ff; +} +.ant-select-auto-complete.ant-select-lg .ant-select-selection__rendered { + line-height: 40px; +} +.ant-select-auto-complete.ant-select-lg .ant-input { + padding-top: 6px; + padding-bottom: 6px; + height: 40px; +} +.ant-select-auto-complete.ant-select-sm .ant-select-selection__rendered { + line-height: 24px; +} +.ant-select-auto-complete.ant-select-sm .ant-input { + padding-top: 1px; + padding-bottom: 1px; + height: 24px; +} diff --git a/es/auto-complete/style/index.js b/es/auto-complete/style/index.js new file mode 100644 index 0000000000..323760849e --- /dev/null +++ b/es/auto-complete/style/index.js @@ -0,0 +1,4 @@ +import '../../style/index.less'; +import './index.less'; + +import '../../select/style'; \ No newline at end of file diff --git a/es/auto-complete/style/index.less b/es/auto-complete/style/index.less new file mode 100644 index 0000000000..a8105799c5 --- /dev/null +++ b/es/auto-complete/style/index.less @@ -0,0 +1,79 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; +@import "../../input/style/mixin"; + +@input-prefix-cls: ~"@{ant-prefix}-input"; +@select-prefix-cls: ~"@{ant-prefix}-select"; +@autocomplete-prefix-cls: ~"@{select-prefix-cls}-auto-complete"; + +.@{autocomplete-prefix-cls} { + .reset-component; + + &.@{select-prefix-cls} { + .@{select-prefix-cls} { + &-selection { + border: 0; + box-shadow: none; + &__rendered { + margin-left: 0; + margin-right: 0; + height: 100%; + line-height: @input-height-base; + } + &__placeholder { + margin-left: (@input-padding-horizontal-base + 1px); + margin-right: (@input-padding-horizontal-base + 1px); + } + + &--single { + height: auto; + } + } + } + + // Fix https://github.com/ant-design/ant-design/issues/7800 + .@{select-prefix-cls}-search--inline { + position: static; + float: left; + } + + &-allow-clear { + .@{select-prefix-cls}-selection:hover .@{select-prefix-cls}-selection__rendered { + margin-right: 0 !important; + } + } + + .@{input-prefix-cls} { + background: transparent; + border-width: @border-width-base; + line-height: @line-height-base; + height: @input-height-base; + &:focus, + &:hover { + .hover; + } + } + + &-lg { + .@{select-prefix-cls}-selection__rendered { + line-height: @input-height-lg; + } + .@{input-prefix-cls} { + padding-top: @input-padding-vertical-lg; + padding-bottom: @input-padding-vertical-lg; + height: @input-height-lg; + } + } + + &-sm { + .@{select-prefix-cls}-selection__rendered { + line-height: @input-height-sm; + } + .@{input-prefix-cls} { + padding-top: @input-padding-vertical-sm; + padding-bottom: @input-padding-vertical-sm; + height: @input-height-sm; + } + } + } +} diff --git a/es/avatar/Avatar.js b/es/avatar/Avatar.js new file mode 100644 index 0000000000..5256ff680f --- /dev/null +++ b/es/avatar/Avatar.js @@ -0,0 +1,126 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; + +import Icon from '../icon'; + +export default { + name: 'AAvatar', + props: { + prefixCls: { + type: String, + 'default': 'ant-avatar' + }, + shape: { + validator: function validator(val) { + return ['circle', 'square'].includes(val); + }, + 'default': 'circle' + }, + size: { + validator: function validator(val) { + return ['small', 'large', 'default'].includes(val); + }, + 'default': 'default' + }, + src: String, + icon: String + }, + data: function data() { + return { + isExistSlot: false, + childrenWidth: 0, + scale: 1 + }; + }, + + computed: { + classes: function classes() { + var _ref; + + var prefixCls = this.prefixCls, + shape = this.shape, + size = this.size, + src = this.src, + icon = this.icon; + + return _ref = {}, _defineProperty(_ref, '' + prefixCls, true), _defineProperty(_ref, prefixCls + '-image', !!src), _defineProperty(_ref, prefixCls + '-icon', !!icon), _defineProperty(_ref, prefixCls + '-' + shape, true), _defineProperty(_ref, prefixCls + '-lg', size === 'large'), _defineProperty(_ref, prefixCls + '-sm', size === 'small'), _ref; + }, + childrenStyle: function childrenStyle() { + var style = {}; + var scale = this.scale, + isExistSlot = this.isExistSlot, + childrenWidth = this.childrenWidth; + + if (isExistSlot) { + style = { + msTransform: 'scale(' + scale + ')', + WebkitTransform: 'scale(' + scale + ')', + transform: 'scale(' + scale + ')', + position: 'absolute', + display: 'inline-block', + left: 'calc(50% - ' + Math.round(childrenWidth / 2) + 'px)' + }; + } + return style; + } + }, + methods: { + setScale: function setScale() { + var src = this.src, + icon = this.icon, + $refs = this.$refs, + $el = this.$el; + + var children = $refs.avatorChildren; + this.isExistSlot = !src && !icon; + if (children) { + this.childrenWidth = children.offsetWidth; + var avatarWidth = $el.getBoundingClientRect().width; + if (avatarWidth - 8 < this.childrenWidth) { + this.scale = (avatarWidth - 8) / this.childrenWidth; + } else { + this.scale = 1; + } + } + } + }, + mounted: function mounted() { + var _this = this; + + this.$nextTick(function () { + _this.setScale(); + }); + }, + updated: function updated() { + var _this2 = this; + + this.$nextTick(function () { + _this2.setScale(); + }); + }, + render: function render() { + var h = arguments[0]; + var classes = this.classes, + prefixCls = this.prefixCls, + src = this.src, + icon = this.icon, + childrenStyle = this.childrenStyle, + $slots = this.$slots; + + return h( + 'span', + { 'class': classes }, + [src ? h('img', { + attrs: { src: src } + }) : icon ? h(Icon, { + attrs: { type: icon } + }) : h( + 'span', + { + ref: 'avatorChildren', + 'class': prefixCls + '-string', + style: childrenStyle }, + [$slots['default']] + )] + ); + } +}; \ No newline at end of file diff --git a/es/avatar/index.js b/es/avatar/index.js new file mode 100644 index 0000000000..d6c32bf509 --- /dev/null +++ b/es/avatar/index.js @@ -0,0 +1,3 @@ +import Avatar from './Avatar'; + +export default Avatar; \ No newline at end of file diff --git a/es/avatar/style/css.js b/es/avatar/style/css.js new file mode 100644 index 0000000000..579ee46c2e --- /dev/null +++ b/es/avatar/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import './index.css'; \ No newline at end of file diff --git a/es/avatar/style/index.css b/es/avatar/style/index.css new file mode 100644 index 0000000000..fb1dfb37b6 --- /dev/null +++ b/es/avatar/style/index.css @@ -0,0 +1,64 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-avatar { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + display: inline-block; + text-align: center; + background: #ccc; + color: #fff; + white-space: nowrap; + position: relative; + overflow: hidden; + width: 32px; + height: 32px; + line-height: 32px; + border-radius: 16px; +} +.ant-avatar > * { + line-height: 32px; +} +.ant-avatar.ant-avatar-icon { + font-size: 18px; +} +.ant-avatar-lg { + width: 40px; + height: 40px; + line-height: 40px; + border-radius: 20px; +} +.ant-avatar-lg > * { + line-height: 40px; +} +.ant-avatar-lg.ant-avatar-icon { + font-size: 24px; +} +.ant-avatar-sm { + width: 24px; + height: 24px; + line-height: 24px; + border-radius: 12px; +} +.ant-avatar-sm > * { + line-height: 24px; +} +.ant-avatar-sm.ant-avatar-icon { + font-size: 14px; +} +.ant-avatar-square { + border-radius: 4px; +} +.ant-avatar > img { + width: 100%; + height: 100%; + display: block; +} diff --git a/es/avatar/style/index.js b/es/avatar/style/index.js new file mode 100644 index 0000000000..1675ad8fe0 --- /dev/null +++ b/es/avatar/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import './index.less'; \ No newline at end of file diff --git a/es/avatar/style/index.less b/es/avatar/style/index.less new file mode 100644 index 0000000000..f151cd5718 --- /dev/null +++ b/es/avatar/style/index.less @@ -0,0 +1,50 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@avatar-prefix-cls: ~"@{ant-prefix}-avatar"; + +.@{avatar-prefix-cls} { + .reset-component; + display: inline-block; + text-align: center; + background: @avatar-bg; + color: @avatar-color; + white-space: nowrap; + position: relative; + overflow: hidden; + + .avatar-size(@avatar-size-base, @avatar-font-size-base); + + &-lg { + .avatar-size(@avatar-size-lg, @avatar-font-size-lg); + } + + &-sm { + .avatar-size(@avatar-size-sm, @avatar-font-size-sm); + } + + &-square { + border-radius: @avatar-border-radius; + } + + & > img { + width: 100%; + height: 100%; + display: block; + } +} + +.avatar-size(@size, @font-size) { + width: @size; + height: @size; + line-height: @size; + border-radius: @size / 2; + + & > * { + line-height: @size; + } + + &.@{avatar-prefix-cls}-icon { + font-size: @font-size; + } +} diff --git a/es/back-top/index.js b/es/back-top/index.js new file mode 100644 index 0000000000..fdc0415a31 --- /dev/null +++ b/es/back-top/index.js @@ -0,0 +1,139 @@ +import _extends from 'babel-runtime/helpers/extends'; + +import PropTypes from '../_util/vue-types'; +import addEventListener from '../_util/Dom/addEventListener'; +import getScroll from '../_util/getScroll'; +import getRequestAnimationFrame from '../_util/getRequestAnimationFrame'; +import BaseMixin from '../_util/BaseMixin'; +import getTransitionProps from '../_util/getTransitionProps'; + +var reqAnimFrame = getRequestAnimationFrame(); + +var easeInOutCubic = function easeInOutCubic(t, b, c, d) { + var cc = c - b; + t /= d / 2; + if (t < 1) { + return cc / 2 * t * t * t + b; + } else { + return cc / 2 * ((t -= 2) * t * t + 2) + b; + } +}; + +function getDefaultTarget() { + return window; +} + +var BackTopProps = { + visibilityHeight: PropTypes.number, + // onClick?: React.MouseEventHandler; + target: PropTypes.func, + prefixCls: PropTypes.string +}; + +export default { + name: 'ABackTop', + mixins: [BaseMixin], + props: _extends({}, BackTopProps, { + visibilityHeight: PropTypes.number.def(400) + }), + data: function data() { + this.scrollEvent = null; + return { + visible: false + }; + }, + mounted: function mounted() { + var _this = this; + + this.$nextTick(function () { + var getTarget = _this.target || getDefaultTarget; + _this.scrollEvent = addEventListener(getTarget(), 'scroll', _this.handleScroll); + _this.handleScroll(); + }); + }, + beforeDestroy: function beforeDestroy() { + if (this.scrollEvent) { + this.scrollEvent.remove(); + } + }, + + methods: { + getCurrentScrollTop: function getCurrentScrollTop() { + var getTarget = this.target || getDefaultTarget; + var targetNode = getTarget(); + if (targetNode === window) { + return window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop; + } + return targetNode.scrollTop; + }, + scrollToTop: function scrollToTop(e) { + var _this2 = this; + + var scrollTop = this.getCurrentScrollTop(); + var startTime = Date.now(); + var frameFunc = function frameFunc() { + var timestamp = Date.now(); + var time = timestamp - startTime; + _this2.setScrollTop(easeInOutCubic(time, scrollTop, 0, 450)); + if (time < 450) { + reqAnimFrame(frameFunc); + } + }; + reqAnimFrame(frameFunc); + this.$emit('click', e); + }, + setScrollTop: function setScrollTop(value) { + var getTarget = this.target || getDefaultTarget; + var targetNode = getTarget(); + if (targetNode === window) { + document.body.scrollTop = value; + document.documentElement.scrollTop = value; + } else { + targetNode.scrollTop = value; + } + }, + handleScroll: function handleScroll() { + var visibilityHeight = this.visibilityHeight, + _target = this.target, + target = _target === undefined ? getDefaultTarget : _target; + + var scrollTop = getScroll(target(), true); + this.setState({ + visible: scrollTop > visibilityHeight + }); + } + }, + + render: function render() { + var h = arguments[0]; + var _prefixCls = this.prefixCls, + prefixCls = _prefixCls === undefined ? 'ant-back-top' : _prefixCls, + $slots = this.$slots, + $listeners = this.$listeners; + + + var defaultElement = h( + 'div', + { 'class': prefixCls + '-content' }, + [h('div', { 'class': prefixCls + '-icon' })] + ); + var divProps = { + on: _extends({}, $listeners, { + click: this.scrollToTop + }), + 'class': prefixCls + }; + + var backTopBtn = this.visible ? h( + 'div', + divProps, + [$slots['default'] || defaultElement] + ) : null; + var transitionProps = getTransitionProps('fade'); + return h( + 'transition', + transitionProps, + [backTopBtn] + ); + } +}; \ No newline at end of file diff --git a/es/back-top/style/css.js b/es/back-top/style/css.js new file mode 100644 index 0000000000..579ee46c2e --- /dev/null +++ b/es/back-top/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import './index.css'; \ No newline at end of file diff --git a/es/back-top/style/index.css b/es/back-top/style/index.css new file mode 100644 index 0000000000..230edc0768 --- /dev/null +++ b/es/back-top/style/index.css @@ -0,0 +1,54 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-back-top { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + z-index: 10; + position: fixed; + right: 100px; + bottom: 50px; + height: 40px; + width: 40px; + cursor: pointer; +} +.ant-back-top-content { + height: 40px; + width: 40px; + border-radius: 20px; + background-color: rgba(0, 0, 0, 0.45); + color: #fff; + text-align: center; + -webkit-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); + overflow: hidden; +} +.ant-back-top-content:hover { + background-color: rgba(0, 0, 0, 0.65); + -webkit-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); +} +.ant-back-top-icon { + margin: 12px auto; + width: 14px; + height: 16px; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAoCAYAAACWwljjAAAABGdBTUEAALGPC/xhBQAAAbtJREFUWAntmMtKw0AUhhMvS5cuxILgQlRUpIggIoKIIoigG1eC+AA+jo+i6FIXBfeuXIgoeKVeitVWJX5HWhhDksnUpp3FDPyZk3Nm5nycmZKkXhAEOXSA3lG7muTeRzmfy6HneUvIhnYkQK+Q9NhAA0Opg0vBEhjBKHiyb8iGMyQMOYuK41BcBSypAL+MYXSKjtFAW7EAGEO3qN4uMQbbAkXiSfRQJ1H6a+yhlkKRcAoVFYiweYNjtCVQJJpBz2GCiPt7fBOZQpFgDpUikse5HgnkM4Fi4QX0Fpc5wf9EbLqpUCy4jMoJSXWhFwbMNgWKhVbRhy5jirhs9fy/oFhgHVVTJEs7RLZ8sSEoJm6iz7SZDMbJ+/OKERQTttCXQRLToRUmrKWCYuA2+jbN0MB4OQobYShfdTCgn/sL1K36M7TLrN3n+758aPy2rrpR6+/od5E8tf/A1uLS9aId5T7J3CNYihkQ4D9PiMdMC7mp4rjB9kjFjZp8BlnVHJBuO1yFXIV0FdDF3RlyFdJVQBdv5AxVdIsq8apiZ2PyYO1EVykesGfZEESsCkweyR8MUW+V8uJ1gkYipmpdP1pm2aJVPEGzAAAAAElFTkSuQmCC) 100%/100% no-repeat; +} +@media screen and (max-width: 768px) { + .ant-back-top { + right: 60px; + } +} +@media screen and (max-width: 480px) { + .ant-back-top { + right: 20px; + } +} diff --git a/es/back-top/style/index.js b/es/back-top/style/index.js new file mode 100644 index 0000000000..1675ad8fe0 --- /dev/null +++ b/es/back-top/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import './index.less'; \ No newline at end of file diff --git a/es/back-top/style/index.less b/es/back-top/style/index.less new file mode 100644 index 0000000000..27d59ff6df --- /dev/null +++ b/es/back-top/style/index.less @@ -0,0 +1,40 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@backtop-prefix-cls: ~"@{ant-prefix}-back-top"; + +.@{backtop-prefix-cls} { + .reset-component; + z-index: @zindex-back-top; + position: fixed; + right: 100px; + bottom: 50px; + height: 40px; + width: 40px; + cursor: pointer; + + &-content { + height: 40px; + width: 40px; + border-radius: 20px; + background-color: @back-top-bg; + color: @back-top-color; + text-align: center; + transition: all .3s @ease-in-out; + overflow: hidden; + + &:hover { + background-color: @back-top-hover-bg; + transition: all .3s @ease-in-out; + } + } + + &-icon { + margin: 12px auto; + width: 14px; + height: 16px; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAoCAYAAACWwljjAAAABGdBTUEAALGPC/xhBQAAAbtJREFUWAntmMtKw0AUhhMvS5cuxILgQlRUpIggIoKIIoigG1eC+AA+jo+i6FIXBfeuXIgoeKVeitVWJX5HWhhDksnUpp3FDPyZk3Nm5nycmZKkXhAEOXSA3lG7muTeRzmfy6HneUvIhnYkQK+Q9NhAA0Opg0vBEhjBKHiyb8iGMyQMOYuK41BcBSypAL+MYXSKjtFAW7EAGEO3qN4uMQbbAkXiSfRQJ1H6a+yhlkKRcAoVFYiweYNjtCVQJJpBz2GCiPt7fBOZQpFgDpUikse5HgnkM4Fi4QX0Fpc5wf9EbLqpUCy4jMoJSXWhFwbMNgWKhVbRhy5jirhs9fy/oFhgHVVTJEs7RLZ8sSEoJm6iz7SZDMbJ+/OKERQTttCXQRLToRUmrKWCYuA2+jbN0MB4OQobYShfdTCgn/sL1K36M7TLrN3n+758aPy2rrpR6+/od5E8tf/A1uLS9aId5T7J3CNYihkQ4D9PiMdMC7mp4rjB9kjFjZp8BlnVHJBuO1yFXIV0FdDF3RlyFdJVQBdv5AxVdIsq8apiZ2PyYO1EVykesGfZEESsCkweyR8MUW+V8uJ1gkYipmpdP1pm2aJVPEGzAAAAAElFTkSuQmCC) ~"100%/100%" no-repeat; + } +} + +@import './responsive'; diff --git a/es/back-top/style/responsive.less b/es/back-top/style/responsive.less new file mode 100644 index 0000000000..7b21a85009 --- /dev/null +++ b/es/back-top/style/responsive.less @@ -0,0 +1,11 @@ +@media screen and (max-width: @screen-md) { + .@{backtop-prefix-cls} { + right: 60px; + } +} + +@media screen and (max-width: @screen-xs) { + .@{backtop-prefix-cls} { + right: 20px; + } +} diff --git a/es/badge/Badge.js b/es/badge/Badge.js new file mode 100644 index 0000000000..63280dde6f --- /dev/null +++ b/es/badge/Badge.js @@ -0,0 +1,116 @@ +import _extends from 'babel-runtime/helpers/extends'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; + +import PropTypes from '../_util/vue-types'; +import ScrollNumber from './ScrollNumber'; +import classNames from 'classnames'; +import { initDefaultProps, filterEmpty } from '../_util/props-util'; +import getTransitionProps from '../_util/getTransitionProps'; + +export var BadgeProps = { + /** Number to show in badge */ + count: PropTypes.oneOfType([PropTypes.number, PropTypes.string, null]), + showZero: PropTypes.bool, + /** Max count to show */ + overflowCount: PropTypes.number, + /** whether to show red dot without number */ + dot: PropTypes.bool, + prefixCls: PropTypes.string, + scrollNumberPrefixCls: PropTypes.string, + status: PropTypes.oneOf(['success', 'processing', 'default', 'error', 'warning']), + text: PropTypes.string, + offset: PropTypes.array, + numberStyle: PropTypes.object.def({}) +}; + +export default { + name: 'ABadge', + props: initDefaultProps(BadgeProps, { + prefixCls: 'ant-badge', + scrollNumberPrefixCls: 'ant-scroll-number', + count: null, + showZero: false, + dot: false, + overflowCount: 99 + }), + + render: function render() { + var _classNames, _classNames2, _classNames3; + + var h = arguments[0]; + var count = this.count, + showZero = this.showZero, + prefixCls = this.prefixCls, + scrollNumberPrefixCls = this.scrollNumberPrefixCls, + overflowCount = this.overflowCount, + dot = this.dot, + status = this.status, + text = this.text, + offset = this.offset, + $slots = this.$slots, + numberStyle = this.numberStyle; + + var displayCount = count > overflowCount ? overflowCount + '+' : count; + var isZero = displayCount === '0' || displayCount === 0; + var isDot = dot && !isZero || status; + // dot mode don't need count + if (isDot) { + displayCount = ''; + } + var children = filterEmpty($slots['default']); + var isEmpty = displayCount === null || displayCount === undefined || displayCount === ''; + var hidden = (isEmpty || isZero && !showZero) && !isDot; + var statusCls = classNames((_classNames = {}, _defineProperty(_classNames, prefixCls + '-status-dot', !!status), _defineProperty(_classNames, prefixCls + '-status-' + status, !!status), _classNames)); + var scrollNumberCls = classNames((_classNames2 = {}, _defineProperty(_classNames2, prefixCls + '-dot', isDot), _defineProperty(_classNames2, prefixCls + '-count', !isDot), _defineProperty(_classNames2, prefixCls + '-multiple-words', !isDot && count && count.toString && count.toString().length > 1), _defineProperty(_classNames2, prefixCls + '-status-' + status, !!status), _classNames2)); + var badgeCls = classNames(prefixCls, (_classNames3 = {}, _defineProperty(_classNames3, prefixCls + '-status', !!status), _defineProperty(_classNames3, prefixCls + '-not-a-wrapper', !children.length), _classNames3)); + var styleWithOffset = offset ? _extends({ + marginTop: offset[0], + marginLeft: offset[1] + }, numberStyle) : numberStyle; + // + + if (!children.length && status) { + return h( + 'span', + { 'class': badgeCls, style: styleWithOffset }, + [h('span', { 'class': statusCls }), h( + 'span', + { 'class': prefixCls + '-status-text' }, + [text] + )] + ); + } + + var scrollNumber = hidden ? null : h(ScrollNumber, { + attrs: { + prefixCls: scrollNumberPrefixCls, + + count: displayCount, + title: count + }, + directives: [{ + name: 'show', + value: !hidden + }], + + 'class': scrollNumberCls, style: styleWithOffset + }); + + var statusText = hidden || !text ? null : h( + 'span', + { 'class': prefixCls + '-status-text' }, + [text] + ); + var transitionProps = getTransitionProps(children.length ? prefixCls + '-zoom' : ''); + + return h( + 'span', + { 'class': badgeCls }, + [children, h( + 'transition', + transitionProps, + [scrollNumber] + ), statusText] + ); + } +}; \ No newline at end of file diff --git a/es/badge/ScrollNumber.js b/es/badge/ScrollNumber.js new file mode 100644 index 0000000000..b375c7a240 --- /dev/null +++ b/es/badge/ScrollNumber.js @@ -0,0 +1,147 @@ +import _extends from 'babel-runtime/helpers/extends'; + +import PropTypes from '../_util/vue-types'; +import BaseMixin from '../_util/BaseMixin'; +import { getStyle } from '../_util/props-util'; +import omit from 'omit.js'; + +function getNumberArray(num) { + return num ? num.toString().split('').reverse().map(function (i) { + return Number(i); + }) : []; +} + +var ScrollNumberProps = { + prefixCls: PropTypes.string.def('ant-scroll-number'), + count: PropTypes.oneOfType([PropTypes.number, PropTypes.string, null]).def(null), + component: PropTypes.string, + title: PropTypes.oneOfType([PropTypes.number, PropTypes.string]) +}; + +export default { + mixins: [BaseMixin], + props: ScrollNumberProps, + data: function data() { + return { + animateStarted: true, + sCount: this.count + }; + }, + + watch: { + count: function count(val) { + var _this = this; + + if (this.sCount !== val) { + this.lastCount = this.sCount; + // 复原数字初始位置 + this.setState({ + animateStarted: true + }, function () { + // 等待数字位置复原完毕 + // 开始设置完整的数字 + setTimeout(function () { + _this.setState({ + animateStarted: false, + sCount: val + }, function () { + _this.$emit('animated'); + }); + }, 5); + }); + } + } + }, + methods: { + getPositionByNum: function getPositionByNum(num, i) { + if (this.animateStarted) { + return 10 + num; + } + var currentDigit = getNumberArray(this.sCount)[i]; + var lastDigit = getNumberArray(this.lastCount)[i]; + // 同方向则在同一侧切换数字 + if (this.sCount > this.lastCount) { + if (currentDigit >= lastDigit) { + return 10 + num; + } + return 20 + num; + } + if (currentDigit <= lastDigit) { + return 10 + num; + } + return num; + }, + renderNumberList: function renderNumberList(position) { + var h = this.$createElement; + + var childrenToReturn = []; + for (var i = 0; i < 30; i++) { + var currentClassName = position === i ? 'current' : ''; + childrenToReturn.push(h( + 'p', + { key: i.toString(), 'class': currentClassName }, + [i % 10] + )); + } + return childrenToReturn; + }, + renderCurrentNumber: function renderCurrentNumber(num, i) { + var h = this.$createElement; + + var position = this.getPositionByNum(num, i); + var removeTransition = this.animateStarted || getNumberArray(this.lastCount)[i] === undefined; + var style = { + transition: removeTransition ? 'none' : undefined, + msTransform: 'translateY(' + -position * 100 + '%)', + WebkitTransform: 'translateY(' + -position * 100 + '%)', + transform: 'translateY(' + -position * 100 + '%)' + }; + return h( + 'span', + { 'class': this.prefixCls + '-only', style: style, key: i }, + [this.renderNumberList(position)] + ); + }, + renderNumberElement: function renderNumberElement() { + var _this2 = this; + + var sCount = this.sCount; + + if (!sCount || isNaN(sCount)) { + return sCount; + } + return getNumberArray(sCount).map(function (num, i) { + return _this2.renderCurrentNumber(num, i); + }).reverse(); + } + }, + + render: function render() { + var h = arguments[0]; + var prefixCls = this.prefixCls, + title = this.title, + _component = this.component, + Tag = _component === undefined ? 'sup' : _component; + + var style = getStyle(this, true); + // fix https://fb.me/react-unknown-prop + var restProps = omit(this.$props, ['count', 'component', 'prefixCls']); + var newProps = { + props: _extends({}, restProps, { + title: title + }), + 'class': prefixCls, + style: style + // allow specify the border + // mock border-color by box-shadow for compatible with old usage: + // + };if (style && style.borderColor) { + newProps.style.boxShadow = '0 0 0 1px ' + style.borderColor + ' inset'; + } + return h( + Tag, + newProps, + [this.renderNumberElement()] + ); + } +}; \ No newline at end of file diff --git a/es/badge/index.js b/es/badge/index.js new file mode 100644 index 0000000000..1c68f62b57 --- /dev/null +++ b/es/badge/index.js @@ -0,0 +1,3 @@ +import Badge from './Badge'; + +export default Badge; \ No newline at end of file diff --git a/es/badge/style/css.js b/es/badge/style/css.js new file mode 100644 index 0000000000..579ee46c2e --- /dev/null +++ b/es/badge/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import './index.css'; \ No newline at end of file diff --git a/es/badge/style/index.css b/es/badge/style/index.css new file mode 100644 index 0000000000..7585828838 --- /dev/null +++ b/es/badge/style/index.css @@ -0,0 +1,216 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-badge { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + position: relative; + display: inline-block; + line-height: 1; + vertical-align: middle; +} +.ant-badge-count { + position: absolute; + -webkit-transform: translateX(-50%); + -ms-transform: translateX(-50%); + transform: translateX(-50%); + top: -10px; + height: 20px; + border-radius: 10px; + min-width: 20px; + background: #f5222d; + color: #fff; + line-height: 20px; + text-align: center; + padding: 0 6px; + font-size: 12px; + font-weight: normal; + white-space: nowrap; + -webkit-transform-origin: -10% center; + -ms-transform-origin: -10% center; + transform-origin: -10% center; + -webkit-box-shadow: 0 0 0 1px #fff; + box-shadow: 0 0 0 1px #fff; +} +.ant-badge-count a, +.ant-badge-count a:hover { + color: #fff; +} +.ant-badge-multiple-words { + padding: 0 8px; +} +.ant-badge-dot { + position: absolute; + -webkit-transform: translateX(-50%); + -ms-transform: translateX(-50%); + transform: translateX(-50%); + -webkit-transform-origin: 0 center; + -ms-transform-origin: 0 center; + transform-origin: 0 center; + top: -3px; + height: 6px; + width: 6px; + border-radius: 100%; + background: #f5222d; + z-index: 10; + -webkit-box-shadow: 0 0 0 1px #fff; + box-shadow: 0 0 0 1px #fff; +} +.ant-badge-status { + line-height: inherit; + vertical-align: baseline; +} +.ant-badge-status-dot { + width: 6px; + height: 6px; + display: inline-block; + border-radius: 50%; + vertical-align: middle; + position: relative; + top: -1px; +} +.ant-badge-status-success { + background-color: #52c41a; +} +.ant-badge-status-processing { + background-color: #1890ff; + position: relative; +} +.ant-badge-status-processing:after { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: 50%; + border: 1px solid #1890ff; + content: ''; + -webkit-animation: antStatusProcessing 1.2s infinite ease-in-out; + animation: antStatusProcessing 1.2s infinite ease-in-out; +} +.ant-badge-status-default { + background-color: #d9d9d9; +} +.ant-badge-status-error { + background-color: #f5222d; +} +.ant-badge-status-warning { + background-color: #faad14; +} +.ant-badge-status-text { + color: rgba(0, 0, 0, 0.65); + font-size: 14px; + margin-left: 8px; +} +.ant-badge-zoom-appear, +.ant-badge-zoom-enter { + -webkit-animation: antZoomBadgeIn 0.3s cubic-bezier(0.12, 0.4, 0.29, 1.46); + animation: antZoomBadgeIn 0.3s cubic-bezier(0.12, 0.4, 0.29, 1.46); + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} +.ant-badge-zoom-leave { + -webkit-animation: antZoomBadgeOut 0.3s cubic-bezier(0.71, -0.46, 0.88, 0.6); + animation: antZoomBadgeOut 0.3s cubic-bezier(0.71, -0.46, 0.88, 0.6); + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} +.ant-badge-not-a-wrapper .ant-scroll-number { + top: auto; + display: block; + position: relative; +} +.ant-badge-not-a-wrapper .ant-badge-count { + -webkit-transform: none; + -ms-transform: none; + transform: none; +} +@-webkit-keyframes antStatusProcessing { + 0% { + -webkit-transform: scale(0.8); + transform: scale(0.8); + opacity: 0.5; + } + 100% { + -webkit-transform: scale(2.4); + transform: scale(2.4); + opacity: 0; + } +} +@keyframes antStatusProcessing { + 0% { + -webkit-transform: scale(0.8); + transform: scale(0.8); + opacity: 0.5; + } + 100% { + -webkit-transform: scale(2.4); + transform: scale(2.4); + opacity: 0; + } +} +.ant-scroll-number { + overflow: hidden; +} +.ant-scroll-number-only { + display: inline-block; + -webkit-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); + height: 20px; +} +.ant-scroll-number-only > p { + height: 20px; + margin: 0; +} +@-webkit-keyframes antZoomBadgeIn { + 0% { + opacity: 0; + -webkit-transform: scale(0) translateX(-50%); + transform: scale(0) translateX(-50%); + } + 100% { + -webkit-transform: scale(1) translateX(-50%); + transform: scale(1) translateX(-50%); + } +} +@keyframes antZoomBadgeIn { + 0% { + opacity: 0; + -webkit-transform: scale(0) translateX(-50%); + transform: scale(0) translateX(-50%); + } + 100% { + -webkit-transform: scale(1) translateX(-50%); + transform: scale(1) translateX(-50%); + } +} +@-webkit-keyframes antZoomBadgeOut { + 0% { + -webkit-transform: scale(1) translateX(-50%); + transform: scale(1) translateX(-50%); + } + 100% { + opacity: 0; + -webkit-transform: scale(0) translateX(-50%); + transform: scale(0) translateX(-50%); + } +} +@keyframes antZoomBadgeOut { + 0% { + -webkit-transform: scale(1) translateX(-50%); + transform: scale(1) translateX(-50%); + } + 100% { + opacity: 0; + -webkit-transform: scale(0) translateX(-50%); + transform: scale(0) translateX(-50%); + } +} diff --git a/es/badge/style/index.js b/es/badge/style/index.js new file mode 100644 index 0000000000..1675ad8fe0 --- /dev/null +++ b/es/badge/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import './index.less'; \ No newline at end of file diff --git a/es/badge/style/index.less b/es/badge/style/index.less new file mode 100644 index 0000000000..988687702f --- /dev/null +++ b/es/badge/style/index.less @@ -0,0 +1,164 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@badge-prefix-cls: ~"@{ant-prefix}-badge"; +@number-prefix-cls: ~"@{ant-prefix}-scroll-number"; + +.@{badge-prefix-cls} { + .reset-component; + position: relative; + display: inline-block; + line-height: 1; + vertical-align: middle; + + &-count { + position: absolute; + transform: translateX(-50%); + top: -@badge-height / 2; + height: @badge-height; + border-radius: @badge-height / 2; + min-width: @badge-height; + background: @highlight-color; + color: #fff; + line-height: @badge-height; + text-align: center; + padding: 0 6px; + font-size: @badge-font-size; + font-weight: @badge-font-weight; + white-space: nowrap; + transform-origin: -10% center; + box-shadow: 0 0 0 1px #fff; + a, + a:hover { + color: #fff; + } + } + + &-multiple-words { + padding: 0 8px; + } + + &-dot { + position: absolute; + transform: translateX(-50%); + transform-origin: 0 center; + top: -@badge-dot-size / 2; + height: @badge-dot-size; + width: @badge-dot-size; + border-radius: 100%; + background: @highlight-color; + z-index: 10; + box-shadow: 0 0 0 1px #fff; + } + + &-status { + line-height: inherit; + vertical-align: baseline; + + &-dot { + width: @badge-status-size; + height: @badge-status-size; + display: inline-block; + border-radius: 50%; + vertical-align: middle; + position: relative; + top: -1px; + } + &-success { + background-color: @success-color; + } + &-processing { + background-color: @processing-color; + position: relative; + &:after { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: 50%; + border: 1px solid @processing-color; + content: ''; + animation: antStatusProcessing 1.2s infinite ease-in-out; + } + } + &-default { + background-color: @normal-color; + } + &-error { + background-color: @error-color; + } + &-warning { + background-color: @warning-color; + } + &-text { + color: @text-color; + font-size: @font-size-base; + margin-left: 8px; + } + } + + &-zoom-appear, + &-zoom-enter { + animation: antZoomBadgeIn .3s @ease-out-back; + animation-fill-mode: both; + } + + &-zoom-leave { + animation: antZoomBadgeOut .3s @ease-in-back; + animation-fill-mode: both; + } + + &-not-a-wrapper .@{ant-prefix}-scroll-number { + top: auto; + display: block; + position: relative; + } + &-not-a-wrapper .@{badge-prefix-cls}-count { + transform: none; + } +} + +@keyframes antStatusProcessing { + 0% { + transform: scale(0.8); + opacity: 0.5; + } + 100% { + transform: scale(2.4); + opacity: 0; + } +} + +.@{number-prefix-cls} { + overflow: hidden; + &-only { + display: inline-block; + transition: all .3s @ease-in-out; + height: @badge-height; + > p { + height: @badge-height; + margin: 0; + } + } +} + +@keyframes antZoomBadgeIn { + 0% { + opacity: 0; + transform: scale(0) translateX(-50%); + } + 100% { + transform: scale(1) translateX(-50%); + } +} + +@keyframes antZoomBadgeOut { + 0% { + transform: scale(1) translateX(-50%); + } + 100% { + opacity: 0; + transform: scale(0) translateX(-50%); + } +} diff --git a/es/breadcrumb/Breadcrumb.js b/es/breadcrumb/Breadcrumb.js new file mode 100644 index 0000000000..a5f187cd0e --- /dev/null +++ b/es/breadcrumb/Breadcrumb.js @@ -0,0 +1,102 @@ + +import PropTypes from '../_util/vue-types'; +import { cloneElement } from '../_util/vnode'; +import { filterEmpty, getComponentFromProp, getSlotOptions } from '../_util/props-util'; +import warning from '../_util/warning'; +import BreadcrumbItem from './BreadcrumbItem'; + +var Route = PropTypes.shape({ + path: PropTypes.string, + breadcrumbName: PropTypes.string +}).loose; + +var BreadcrumbProps = { + prefixCls: PropTypes.string.def('ant-breadcrumb'), + routes: PropTypes.arrayOf(Route), + params: PropTypes.any, + separator: PropTypes.any, + itemRender: PropTypes.func +}; + +function getBreadcrumbName(route, params) { + if (!route.breadcrumbName) { + return null; + } + var paramsKeys = Object.keys(params).join('|'); + var name = route.breadcrumbName.replace(new RegExp(':(' + paramsKeys + ')', 'g'), function (replacement, key) { + return params[key] || replacement; + }); + return name; +} + +export default { + name: 'ABreadcrumb', + props: BreadcrumbProps, + methods: { + defaultItemRender: function defaultItemRender(_ref) { + var route = _ref.route, + params = _ref.params, + routes = _ref.routes, + paths = _ref.paths; + var h = this.$createElement; + + var isLastItem = routes.indexOf(route) === routes.length - 1; + var name = getBreadcrumbName(route, params); + return isLastItem ? h('span', [name]) : h( + 'a', + { + attrs: { href: '#/' + paths.join('/') } + }, + [name] + ); + } + }, + render: function render() { + var h = arguments[0]; + + var crumbs = void 0; + var prefixCls = this.prefixCls, + routes = this.routes, + _params = this.params, + params = _params === undefined ? {} : _params, + $slots = this.$slots, + $scopedSlots = this.$scopedSlots; + + var children = filterEmpty($slots['default']); + var separator = getComponentFromProp(this, 'separator'); + if (routes && routes.length > 0) { + var paths = []; + var itemRender = this.itemRender || $scopedSlots.itemRender || this.defaultItemRender; + crumbs = routes.map(function (route) { + route.path = route.path || ''; + var path = route.path.replace(/^\//, ''); + Object.keys(params).forEach(function (key) { + path = path.replace(':' + key, params[key]); + }); + if (path) { + paths.push(path); + } + return h( + BreadcrumbItem, + { + attrs: { separator: separator }, + key: route.breadcrumbName || path }, + [itemRender({ route: route, params: params, routes: routes, paths: paths })] + ); + }); + } else if (children.length) { + crumbs = children.map(function (element, index) { + warning(getSlotOptions(element).__ANT_BREADCRUMB_ITEM, 'Breadcrumb only accepts Breadcrumb.Item as it\'s children'); + return cloneElement(element, { + props: { separator: separator }, + key: index + }); + }); + } + return h( + 'div', + { 'class': prefixCls }, + [crumbs] + ); + } +}; \ No newline at end of file diff --git a/es/breadcrumb/BreadcrumbItem.js b/es/breadcrumb/BreadcrumbItem.js new file mode 100644 index 0000000000..476fa98558 --- /dev/null +++ b/es/breadcrumb/BreadcrumbItem.js @@ -0,0 +1,42 @@ + +import PropTypes from '../_util/vue-types'; +import { hasProp, getComponentFromProp } from '../_util/props-util'; + +export default { + name: 'ABreadcrumbItem', + __ANT_BREADCRUMB_ITEM: true, + props: { + prefixCls: PropTypes.string.def('ant-breadcrumb'), + href: PropTypes.string, + separator: PropTypes.any + }, + render: function render() { + var h = arguments[0]; + var prefixCls = this.prefixCls, + $slots = this.$slots; + + var children = $slots['default']; + var link = void 0; + if (hasProp(this, 'href')) { + link = h( + 'a', + { 'class': prefixCls + '-link' }, + [children] + ); + } else { + link = h( + 'span', + { 'class': prefixCls + '-link' }, + [children] + ); + } + if (children) { + return h('span', [link, h( + 'span', + { 'class': prefixCls + '-separator' }, + [getComponentFromProp(this, 'separator') || '/'] + )]); + } + return null; + } +}; \ No newline at end of file diff --git a/es/breadcrumb/index.js b/es/breadcrumb/index.js new file mode 100644 index 0000000000..67d71f7f7b --- /dev/null +++ b/es/breadcrumb/index.js @@ -0,0 +1,5 @@ +import Breadcrumb from './Breadcrumb'; +import BreadcrumbItem from './BreadcrumbItem'; + +Breadcrumb.Item = BreadcrumbItem; +export default Breadcrumb; \ No newline at end of file diff --git a/es/breadcrumb/style/css.js b/es/breadcrumb/style/css.js new file mode 100644 index 0000000000..579ee46c2e --- /dev/null +++ b/es/breadcrumb/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import './index.css'; \ No newline at end of file diff --git a/es/breadcrumb/style/index.css b/es/breadcrumb/style/index.css new file mode 100644 index 0000000000..871dea5461 --- /dev/null +++ b/es/breadcrumb/style/index.css @@ -0,0 +1,40 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-breadcrumb { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + color: rgba(0, 0, 0, 0.45); + font-size: 14px; +} +.ant-breadcrumb .anticon { + font-size: 12px; +} +.ant-breadcrumb a { + color: rgba(0, 0, 0, 0.45); + -webkit-transition: color .3s; + transition: color .3s; +} +.ant-breadcrumb a:hover { + color: #40a9ff; +} +.ant-breadcrumb > span:last-child { + color: rgba(0, 0, 0, 0.65); +} +.ant-breadcrumb > span:last-child .ant-breadcrumb-separator { + display: none; +} +.ant-breadcrumb-separator { + margin: 0 8px; + color: rgba(0, 0, 0, 0.45); +} +.ant-breadcrumb-link > .anticon + span { + margin-left: 4px; +} diff --git a/es/breadcrumb/style/index.js b/es/breadcrumb/style/index.js new file mode 100644 index 0000000000..1675ad8fe0 --- /dev/null +++ b/es/breadcrumb/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import './index.less'; \ No newline at end of file diff --git a/es/breadcrumb/style/index.less b/es/breadcrumb/style/index.less new file mode 100644 index 0000000000..2d73ab20c7 --- /dev/null +++ b/es/breadcrumb/style/index.less @@ -0,0 +1,41 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@breadcrumb-prefix-cls: ~"@{ant-prefix}-breadcrumb"; + +.@{breadcrumb-prefix-cls} { + .reset-component; + color: @breadcrumb-base-color; + font-size: @breadcrumb-font-size; + + .@{iconfont-css-prefix} { + font-size: @breadcrumb-icon-font-size; + } + + a { + color: @breadcrumb-link-color; + transition: color .3s; + &:hover { + color: @breadcrumb-link-color-hover; + } + } + + & > span:last-child { + color: @breadcrumb-last-item-color; + } + + & > span:last-child &-separator { + display: none; + } + + &-separator { + margin: @breadcrumb-separator-margin; + color: @breadcrumb-separator-color; + } + + &-link { + > .@{iconfont-css-prefix} + span { + margin-left: 4px; + } + } +} diff --git a/es/button/button-group.js b/es/button/button-group.js new file mode 100644 index 0000000000..8fecba9b84 --- /dev/null +++ b/es/button/button-group.js @@ -0,0 +1,51 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; + +import { filterEmpty } from '../_util/props-util'; +var ButtonGroupProps = { + prefixCls: { + 'default': 'ant-btn-group', + type: String + }, + size: { + validator: function validator(value) { + return ['small', 'large', 'default'].includes(value); + } + } +}; +export { ButtonGroupProps }; +export default { + name: 'AButtonGroup', + props: ButtonGroupProps, + data: function data() { + return { + sizeMap: { + large: 'lg', + small: 'sm' + } + }; + }, + + computed: { + classes: function classes() { + var _ref; + + var prefixCls = this.prefixCls, + size = this.size, + sizeMap = this.sizeMap; + + var sizeCls = sizeMap[size] || ''; + return [(_ref = {}, _defineProperty(_ref, '' + prefixCls, true), _defineProperty(_ref, prefixCls + '-' + sizeCls, sizeCls), _ref)]; + } + }, + render: function render() { + var h = arguments[0]; + var classes = this.classes, + $slots = this.$slots; + + return h( + 'div', + { 'class': classes }, + [filterEmpty($slots['default'])] + ); + } +}; \ No newline at end of file diff --git a/es/button/button.js b/es/button/button.js new file mode 100644 index 0000000000..2e05d8db05 --- /dev/null +++ b/es/button/button.js @@ -0,0 +1,153 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _extends from 'babel-runtime/helpers/extends'; + +import Icon from '../icon'; +var rxTwoCNChar = /^[\u4e00-\u9fa5]{2}$/; +var isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar); +import buttonTypes from './buttonTypes'; +var props = buttonTypes(); +export default { + name: 'AButton', + __ANT_BUTTON: true, + props: _extends({}, props), + data: function data() { + return { + sizeMap: { + large: 'lg', + small: 'sm' + }, + clicked: false, + sLoading: !!this.loading, + hasTwoCNChar: false + }; + }, + mounted: function mounted() { + this.fixTwoCNChar(); + }, + updated: function updated() { + this.fixTwoCNChar(); + }, + + watch: { + loading: function loading(val) { + var _this = this; + + clearTimeout(this.delayTimeout); + if (typeof val !== 'boolean' && val && val.delay) { + this.delayTimeout = setTimeout(function () { + _this.sLoading = !!val; + }, val.delay); + } else { + this.sLoading = !!val; + } + } + }, + computed: { + classes: function classes() { + var _ref; + + var prefixCls = this.prefixCls, + type = this.type, + shape = this.shape, + size = this.size, + hasTwoCNChar = this.hasTwoCNChar, + sLoading = this.sLoading, + ghost = this.ghost, + clicked = this.clicked, + sizeMap = this.sizeMap; + + var sizeCls = sizeMap[size] || ''; + return _ref = {}, _defineProperty(_ref, '' + prefixCls, true), _defineProperty(_ref, prefixCls + '-' + type, type), _defineProperty(_ref, prefixCls + '-' + shape, shape), _defineProperty(_ref, prefixCls + '-' + sizeCls, sizeCls), _defineProperty(_ref, prefixCls + '-loading', sLoading), _defineProperty(_ref, prefixCls + '-clicked', clicked), _defineProperty(_ref, prefixCls + '-background-ghost', ghost || type === 'ghost'), _defineProperty(_ref, prefixCls + '-two-chinese-chars', hasTwoCNChar), _ref; + }, + iconType: function iconType() { + var sLoading = this.sLoading, + icon = this.icon; + + return sLoading ? 'loading' : icon; + } + }, + methods: { + fixTwoCNChar: function fixTwoCNChar() { + // Fix for HOC usage like + var node = this.$el; + var buttonText = node.textContent || node.innerText; + if (this.isNeedInserted() && isTwoCNChar(buttonText)) { + if (!this.hasTwoCNChar) { + this.hasTwoCNChar = true; + } + } else if (this.hasTwoCNChar) { + this.hasTwoCNChar = false; + } + }, + handleClick: function handleClick(event) { + var _this2 = this; + + this.clicked = true; + clearTimeout(this.timeout); + this.timeout = setTimeout(function () { + return _this2.clicked = false; + }, 500); + this.$emit('click', event); + }, + insertSpace: function insertSpace(child, needInserted) { + var h = this.$createElement; + + var SPACE = needInserted ? ' ' : ''; + if (typeof child.text === 'string') { + var text = child.text.trim(); + if (isTwoCNChar(text)) { + text = text.split('').join(SPACE); + } + return h('span', [text]); + } + return child; + }, + isNeedInserted: function isNeedInserted() { + var loading = this.loading, + icon = this.icon, + $slots = this.$slots; + + var iconType = loading ? 'loading' : icon; + return $slots['default'] && $slots['default'].length === 1 && (!iconType || iconType === 'loading'); + } + }, + render: function render() { + var h = arguments[0]; + var htmlType = this.htmlType, + classes = this.classes, + disabled = this.disabled, + handleClick = this.handleClick, + iconType = this.iconType, + $slots = this.$slots, + $attrs = this.$attrs, + $listeners = this.$listeners; + + var buttonProps = { + props: {}, + attrs: _extends({}, $attrs, { + type: htmlType, + disabled: disabled + }), + 'class': classes, + on: _extends({}, $listeners, { + click: handleClick + }) + }; + var kids = $slots['default'] && $slots['default'].length === 1 ? this.insertSpace($slots['default'][0], this.isNeedInserted()) : $slots['default']; + return h( + 'button', + buttonProps, + [iconType ? h(Icon, { + attrs: { type: iconType } + }) : null, kids] + ); + }, + beforeDestroy: function beforeDestroy() { + if (this.timeout) { + clearTimeout(this.timeout); + } + if (this.delayTimeout) { + clearTimeout(this.delayTimeout); + } + } +}; \ No newline at end of file diff --git a/es/button/buttonTypes.js b/es/button/buttonTypes.js new file mode 100644 index 0000000000..5dcb7b6c8a --- /dev/null +++ b/es/button/buttonTypes.js @@ -0,0 +1,14 @@ +import PropTypes from '../_util/vue-types'; +export default (function () { + return { + prefixCls: PropTypes.string.def('ant-btn'), + type: PropTypes.oneOf(['primary', 'danger', 'dashed', 'ghost', 'default']).def('default'), + htmlType: PropTypes.oneOf(['button', 'submit', 'reset']).def('button'), + icon: PropTypes.string, + shape: PropTypes.oneOf(['circle', 'circle-outline']), + size: PropTypes.oneOf(['small', 'large', 'default']).def('default'), + loading: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]), + disabled: PropTypes.bool, + ghost: PropTypes.bool + }; +}); \ No newline at end of file diff --git a/es/button/index.js b/es/button/index.js new file mode 100644 index 0000000000..3c970b743d --- /dev/null +++ b/es/button/index.js @@ -0,0 +1,5 @@ +import Button from './button'; +import ButtonGroup from './button-group'; + +Button.Group = ButtonGroup; +export default Button; \ No newline at end of file diff --git a/es/button/style/css.js b/es/button/style/css.js new file mode 100644 index 0000000000..579ee46c2e --- /dev/null +++ b/es/button/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import './index.css'; \ No newline at end of file diff --git a/es/button/style/index.css b/es/button/style/index.css new file mode 100644 index 0000000000..5a0f2398bf --- /dev/null +++ b/es/button/style/index.css @@ -0,0 +1,1056 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-btn { + line-height: 1.5; + display: inline-block; + font-weight: 400; + text-align: center; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 0 15px; + font-size: 14px; + border-radius: 4px; + height: 32px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); + position: relative; + color: rgba(0, 0, 0, 0.65); + background-color: #fff; + border-color: #d9d9d9; +} +.ant-btn > .anticon { + line-height: 1; +} +.ant-btn, +.ant-btn:active, +.ant-btn:focus { + outline: 0; +} +.ant-btn:not([disabled]):hover { + text-decoration: none; +} +.ant-btn:not([disabled]):active { + outline: 0; + -webkit-transition: none; + transition: none; +} +.ant-btn.disabled, +.ant-btn[disabled] { + cursor: not-allowed; +} +.ant-btn.disabled > *, +.ant-btn[disabled] > * { + pointer-events: none; +} +.ant-btn-lg { + padding: 0 15px; + font-size: 16px; + border-radius: 4px; + height: 40px; +} +.ant-btn-sm { + padding: 0 7px; + font-size: 14px; + border-radius: 4px; + height: 24px; +} +.ant-btn > a:only-child { + color: currentColor; +} +.ant-btn > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn:hover, +.ant-btn:focus { + color: #40a9ff; + background-color: #fff; + border-color: #40a9ff; +} +.ant-btn:hover > a:only-child, +.ant-btn:focus > a:only-child { + color: currentColor; +} +.ant-btn:hover > a:only-child:after, +.ant-btn:focus > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn:active, +.ant-btn.active { + color: #096dd9; + background-color: #fff; + border-color: #096dd9; +} +.ant-btn:active > a:only-child, +.ant-btn.active > a:only-child { + color: currentColor; +} +.ant-btn:active > a:only-child:after, +.ant-btn.active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn.disabled, +.ant-btn[disabled], +.ant-btn.disabled:hover, +.ant-btn[disabled]:hover, +.ant-btn.disabled:focus, +.ant-btn[disabled]:focus, +.ant-btn.disabled:active, +.ant-btn[disabled]:active, +.ant-btn.disabled.active, +.ant-btn[disabled].active { + color: rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + border-color: #d9d9d9; +} +.ant-btn.disabled > a:only-child, +.ant-btn[disabled] > a:only-child, +.ant-btn.disabled:hover > a:only-child, +.ant-btn[disabled]:hover > a:only-child, +.ant-btn.disabled:focus > a:only-child, +.ant-btn[disabled]:focus > a:only-child, +.ant-btn.disabled:active > a:only-child, +.ant-btn[disabled]:active > a:only-child, +.ant-btn.disabled.active > a:only-child, +.ant-btn[disabled].active > a:only-child { + color: currentColor; +} +.ant-btn.disabled > a:only-child:after, +.ant-btn[disabled] > a:only-child:after, +.ant-btn.disabled:hover > a:only-child:after, +.ant-btn[disabled]:hover > a:only-child:after, +.ant-btn.disabled:focus > a:only-child:after, +.ant-btn[disabled]:focus > a:only-child:after, +.ant-btn.disabled:active > a:only-child:after, +.ant-btn[disabled]:active > a:only-child:after, +.ant-btn.disabled.active > a:only-child:after, +.ant-btn[disabled].active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn:hover, +.ant-btn:focus, +.ant-btn:active, +.ant-btn.active { + background: #fff; + text-decoration: none; +} +.ant-btn > i, +.ant-btn > span { + pointer-events: none; +} +.ant-btn-primary { + color: #fff; + background-color: #1890ff; + border-color: #1890ff; +} +.ant-btn-primary > a:only-child { + color: currentColor; +} +.ant-btn-primary > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-primary:hover, +.ant-btn-primary:focus { + color: #fff; + background-color: #40a9ff; + border-color: #40a9ff; +} +.ant-btn-primary:hover > a:only-child, +.ant-btn-primary:focus > a:only-child { + color: currentColor; +} +.ant-btn-primary:hover > a:only-child:after, +.ant-btn-primary:focus > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-primary:active, +.ant-btn-primary.active { + color: #fff; + background-color: #096dd9; + border-color: #096dd9; +} +.ant-btn-primary:active > a:only-child, +.ant-btn-primary.active > a:only-child { + color: currentColor; +} +.ant-btn-primary:active > a:only-child:after, +.ant-btn-primary.active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-primary.disabled, +.ant-btn-primary[disabled], +.ant-btn-primary.disabled:hover, +.ant-btn-primary[disabled]:hover, +.ant-btn-primary.disabled:focus, +.ant-btn-primary[disabled]:focus, +.ant-btn-primary.disabled:active, +.ant-btn-primary[disabled]:active, +.ant-btn-primary.disabled.active, +.ant-btn-primary[disabled].active { + color: rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + border-color: #d9d9d9; +} +.ant-btn-primary.disabled > a:only-child, +.ant-btn-primary[disabled] > a:only-child, +.ant-btn-primary.disabled:hover > a:only-child, +.ant-btn-primary[disabled]:hover > a:only-child, +.ant-btn-primary.disabled:focus > a:only-child, +.ant-btn-primary[disabled]:focus > a:only-child, +.ant-btn-primary.disabled:active > a:only-child, +.ant-btn-primary[disabled]:active > a:only-child, +.ant-btn-primary.disabled.active > a:only-child, +.ant-btn-primary[disabled].active > a:only-child { + color: currentColor; +} +.ant-btn-primary.disabled > a:only-child:after, +.ant-btn-primary[disabled] > a:only-child:after, +.ant-btn-primary.disabled:hover > a:only-child:after, +.ant-btn-primary[disabled]:hover > a:only-child:after, +.ant-btn-primary.disabled:focus > a:only-child:after, +.ant-btn-primary[disabled]:focus > a:only-child:after, +.ant-btn-primary.disabled:active > a:only-child:after, +.ant-btn-primary[disabled]:active > a:only-child:after, +.ant-btn-primary.disabled.active > a:only-child:after, +.ant-btn-primary[disabled].active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-group .ant-btn-primary:not(:first-child):not(:last-child) { + border-right-color: #40a9ff; + border-left-color: #40a9ff; +} +.ant-btn-group .ant-btn-primary:not(:first-child):not(:last-child):disabled { + border-color: #d9d9d9; +} +.ant-btn-group .ant-btn-primary:first-child:not(:last-child) { + border-right-color: #40a9ff; +} +.ant-btn-group .ant-btn-primary:first-child:not(:last-child)[disabled] { + border-right-color: #d9d9d9; +} +.ant-btn-group .ant-btn-primary:last-child:not(:first-child), +.ant-btn-group .ant-btn-primary + .ant-btn-primary { + border-left-color: #40a9ff; +} +.ant-btn-group .ant-btn-primary:last-child:not(:first-child)[disabled], +.ant-btn-group .ant-btn-primary + .ant-btn-primary[disabled] { + border-left-color: #d9d9d9; +} +.ant-btn-ghost { + color: rgba(0, 0, 0, 0.65); + background-color: transparent; + border-color: #d9d9d9; +} +.ant-btn-ghost > a:only-child { + color: currentColor; +} +.ant-btn-ghost > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-ghost:hover, +.ant-btn-ghost:focus { + color: #40a9ff; + background-color: transparent; + border-color: #40a9ff; +} +.ant-btn-ghost:hover > a:only-child, +.ant-btn-ghost:focus > a:only-child { + color: currentColor; +} +.ant-btn-ghost:hover > a:only-child:after, +.ant-btn-ghost:focus > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-ghost:active, +.ant-btn-ghost.active { + color: #096dd9; + background-color: transparent; + border-color: #096dd9; +} +.ant-btn-ghost:active > a:only-child, +.ant-btn-ghost.active > a:only-child { + color: currentColor; +} +.ant-btn-ghost:active > a:only-child:after, +.ant-btn-ghost.active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-ghost.disabled, +.ant-btn-ghost[disabled], +.ant-btn-ghost.disabled:hover, +.ant-btn-ghost[disabled]:hover, +.ant-btn-ghost.disabled:focus, +.ant-btn-ghost[disabled]:focus, +.ant-btn-ghost.disabled:active, +.ant-btn-ghost[disabled]:active, +.ant-btn-ghost.disabled.active, +.ant-btn-ghost[disabled].active { + color: rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + border-color: #d9d9d9; +} +.ant-btn-ghost.disabled > a:only-child, +.ant-btn-ghost[disabled] > a:only-child, +.ant-btn-ghost.disabled:hover > a:only-child, +.ant-btn-ghost[disabled]:hover > a:only-child, +.ant-btn-ghost.disabled:focus > a:only-child, +.ant-btn-ghost[disabled]:focus > a:only-child, +.ant-btn-ghost.disabled:active > a:only-child, +.ant-btn-ghost[disabled]:active > a:only-child, +.ant-btn-ghost.disabled.active > a:only-child, +.ant-btn-ghost[disabled].active > a:only-child { + color: currentColor; +} +.ant-btn-ghost.disabled > a:only-child:after, +.ant-btn-ghost[disabled] > a:only-child:after, +.ant-btn-ghost.disabled:hover > a:only-child:after, +.ant-btn-ghost[disabled]:hover > a:only-child:after, +.ant-btn-ghost.disabled:focus > a:only-child:after, +.ant-btn-ghost[disabled]:focus > a:only-child:after, +.ant-btn-ghost.disabled:active > a:only-child:after, +.ant-btn-ghost[disabled]:active > a:only-child:after, +.ant-btn-ghost.disabled.active > a:only-child:after, +.ant-btn-ghost[disabled].active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-dashed { + color: rgba(0, 0, 0, 0.65); + background-color: #fff; + border-color: #d9d9d9; + border-style: dashed; +} +.ant-btn-dashed > a:only-child { + color: currentColor; +} +.ant-btn-dashed > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-dashed:hover, +.ant-btn-dashed:focus { + color: #40a9ff; + background-color: #fff; + border-color: #40a9ff; +} +.ant-btn-dashed:hover > a:only-child, +.ant-btn-dashed:focus > a:only-child { + color: currentColor; +} +.ant-btn-dashed:hover > a:only-child:after, +.ant-btn-dashed:focus > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-dashed:active, +.ant-btn-dashed.active { + color: #096dd9; + background-color: #fff; + border-color: #096dd9; +} +.ant-btn-dashed:active > a:only-child, +.ant-btn-dashed.active > a:only-child { + color: currentColor; +} +.ant-btn-dashed:active > a:only-child:after, +.ant-btn-dashed.active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-dashed.disabled, +.ant-btn-dashed[disabled], +.ant-btn-dashed.disabled:hover, +.ant-btn-dashed[disabled]:hover, +.ant-btn-dashed.disabled:focus, +.ant-btn-dashed[disabled]:focus, +.ant-btn-dashed.disabled:active, +.ant-btn-dashed[disabled]:active, +.ant-btn-dashed.disabled.active, +.ant-btn-dashed[disabled].active { + color: rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + border-color: #d9d9d9; +} +.ant-btn-dashed.disabled > a:only-child, +.ant-btn-dashed[disabled] > a:only-child, +.ant-btn-dashed.disabled:hover > a:only-child, +.ant-btn-dashed[disabled]:hover > a:only-child, +.ant-btn-dashed.disabled:focus > a:only-child, +.ant-btn-dashed[disabled]:focus > a:only-child, +.ant-btn-dashed.disabled:active > a:only-child, +.ant-btn-dashed[disabled]:active > a:only-child, +.ant-btn-dashed.disabled.active > a:only-child, +.ant-btn-dashed[disabled].active > a:only-child { + color: currentColor; +} +.ant-btn-dashed.disabled > a:only-child:after, +.ant-btn-dashed[disabled] > a:only-child:after, +.ant-btn-dashed.disabled:hover > a:only-child:after, +.ant-btn-dashed[disabled]:hover > a:only-child:after, +.ant-btn-dashed.disabled:focus > a:only-child:after, +.ant-btn-dashed[disabled]:focus > a:only-child:after, +.ant-btn-dashed.disabled:active > a:only-child:after, +.ant-btn-dashed[disabled]:active > a:only-child:after, +.ant-btn-dashed.disabled.active > a:only-child:after, +.ant-btn-dashed[disabled].active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-danger { + color: #f5222d; + background-color: #f5f5f5; + border-color: #d9d9d9; +} +.ant-btn-danger > a:only-child { + color: currentColor; +} +.ant-btn-danger > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-danger:hover { + color: #fff; + background-color: #ff4d4f; + border-color: #ff4d4f; +} +.ant-btn-danger:hover > a:only-child { + color: currentColor; +} +.ant-btn-danger:hover > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-danger:focus { + color: #ff4d4f; + background-color: #fff; + border-color: #ff4d4f; +} +.ant-btn-danger:focus > a:only-child { + color: currentColor; +} +.ant-btn-danger:focus > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-danger:active, +.ant-btn-danger.active { + color: #fff; + background-color: #cf1322; + border-color: #cf1322; +} +.ant-btn-danger:active > a:only-child, +.ant-btn-danger.active > a:only-child { + color: currentColor; +} +.ant-btn-danger:active > a:only-child:after, +.ant-btn-danger.active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-danger.disabled, +.ant-btn-danger[disabled], +.ant-btn-danger.disabled:hover, +.ant-btn-danger[disabled]:hover, +.ant-btn-danger.disabled:focus, +.ant-btn-danger[disabled]:focus, +.ant-btn-danger.disabled:active, +.ant-btn-danger[disabled]:active, +.ant-btn-danger.disabled.active, +.ant-btn-danger[disabled].active { + color: rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + border-color: #d9d9d9; +} +.ant-btn-danger.disabled > a:only-child, +.ant-btn-danger[disabled] > a:only-child, +.ant-btn-danger.disabled:hover > a:only-child, +.ant-btn-danger[disabled]:hover > a:only-child, +.ant-btn-danger.disabled:focus > a:only-child, +.ant-btn-danger[disabled]:focus > a:only-child, +.ant-btn-danger.disabled:active > a:only-child, +.ant-btn-danger[disabled]:active > a:only-child, +.ant-btn-danger.disabled.active > a:only-child, +.ant-btn-danger[disabled].active > a:only-child { + color: currentColor; +} +.ant-btn-danger.disabled > a:only-child:after, +.ant-btn-danger[disabled] > a:only-child:after, +.ant-btn-danger.disabled:hover > a:only-child:after, +.ant-btn-danger[disabled]:hover > a:only-child:after, +.ant-btn-danger.disabled:focus > a:only-child:after, +.ant-btn-danger[disabled]:focus > a:only-child:after, +.ant-btn-danger.disabled:active > a:only-child:after, +.ant-btn-danger[disabled]:active > a:only-child:after, +.ant-btn-danger.disabled.active > a:only-child:after, +.ant-btn-danger[disabled].active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-circle, +.ant-btn-circle-outline { + width: 32px; + padding: 0; + font-size: 16px; + border-radius: 50%; + height: 32px; +} +.ant-btn-circle.ant-btn-lg, +.ant-btn-circle-outline.ant-btn-lg { + width: 40px; + padding: 0; + font-size: 18px; + border-radius: 50%; + height: 40px; +} +.ant-btn-circle.ant-btn-sm, +.ant-btn-circle-outline.ant-btn-sm { + width: 24px; + padding: 0; + font-size: 14px; + border-radius: 50%; + height: 24px; +} +.ant-btn:before { + position: absolute; + top: -1px; + left: -1px; + bottom: -1px; + right: -1px; + background: #fff; + opacity: 0.35; + content: ''; + border-radius: inherit; + z-index: 1; + -webkit-transition: opacity .2s; + transition: opacity .2s; + pointer-events: none; + display: none; +} +.ant-btn .anticon { + -webkit-transition: margin-left 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: margin-left 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); +} +.ant-btn.ant-btn-loading:before { + display: block; +} +.ant-btn.ant-btn-loading:not(.ant-btn-circle):not(.ant-btn-circle-outline):not(.ant-btn-icon-only) { + padding-left: 29px; + pointer-events: none; + position: relative; +} +.ant-btn.ant-btn-loading:not(.ant-btn-circle):not(.ant-btn-circle-outline):not(.ant-btn-icon-only) .anticon { + margin-left: -14px; +} +.ant-btn-sm.ant-btn-loading:not(.ant-btn-circle):not(.ant-btn-circle-outline):not(.ant-btn-icon-only) { + padding-left: 24px; +} +.ant-btn-sm.ant-btn-loading:not(.ant-btn-circle):not(.ant-btn-circle-outline):not(.ant-btn-icon-only) .anticon { + margin-left: -17px; +} +.ant-btn-group { + position: relative; + display: inline-block; +} +.ant-btn-group > .ant-btn, +.ant-btn-group > span > .ant-btn { + position: relative; + line-height: 30px; +} +.ant-btn-group > .ant-btn:hover, +.ant-btn-group > span > .ant-btn:hover, +.ant-btn-group > .ant-btn:focus, +.ant-btn-group > span > .ant-btn:focus, +.ant-btn-group > .ant-btn:active, +.ant-btn-group > span > .ant-btn:active, +.ant-btn-group > .ant-btn.active, +.ant-btn-group > span > .ant-btn.active { + z-index: 2; +} +.ant-btn-group > .ant-btn:disabled, +.ant-btn-group > span > .ant-btn:disabled { + z-index: 0; +} +.ant-btn-group-lg > .ant-btn, +.ant-btn-group-lg > span > .ant-btn { + padding: 0 15px; + font-size: 16px; + border-radius: 0; + height: 40px; + line-height: 38px; +} +.ant-btn-group-sm > .ant-btn, +.ant-btn-group-sm > span > .ant-btn { + padding: 0 7px; + font-size: 14px; + border-radius: 0; + height: 24px; + line-height: 22px; +} +.ant-btn-group-sm > .ant-btn > .anticon, +.ant-btn-group-sm > span > .ant-btn > .anticon { + font-size: 14px; +} +.ant-btn-group .ant-btn + .ant-btn, +.ant-btn + .ant-btn-group, +.ant-btn-group span + .ant-btn, +.ant-btn-group .ant-btn + span, +.ant-btn-group > span + span, +.ant-btn-group + .ant-btn, +.ant-btn-group + .ant-btn-group { + margin-left: -1px; +} +.ant-btn-group .ant-btn-primary + .ant-btn:not(.ant-btn-primary):not([disabled]) { + border-left-color: transparent; +} +.ant-btn-group .ant-btn { + border-radius: 0; +} +.ant-btn-group > .ant-btn:first-child, +.ant-btn-group > span:first-child > .ant-btn { + margin-left: 0; +} +.ant-btn-group > .ant-btn:only-child { + border-radius: 4px; +} +.ant-btn-group > span:only-child > .ant-btn { + border-radius: 4px; +} +.ant-btn-group > .ant-btn:first-child:not(:last-child), +.ant-btn-group > span:first-child:not(:last-child) > .ant-btn { + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.ant-btn-group > .ant-btn:last-child:not(:first-child), +.ant-btn-group > span:last-child:not(:first-child) > .ant-btn { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.ant-btn-group-sm > .ant-btn:only-child { + border-radius: 4px; +} +.ant-btn-group-sm > span:only-child > .ant-btn { + border-radius: 4px; +} +.ant-btn-group-sm > .ant-btn:first-child:not(:last-child), +.ant-btn-group-sm > span:first-child:not(:last-child) > .ant-btn { + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.ant-btn-group-sm > .ant-btn:last-child:not(:first-child), +.ant-btn-group-sm > span:last-child:not(:first-child) > .ant-btn { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.ant-btn-group > .ant-btn-group { + float: left; +} +.ant-btn-group > .ant-btn-group:not(:first-child):not(:last-child) > .ant-btn { + border-radius: 0; +} +.ant-btn-group > .ant-btn-group:first-child:not(:last-child) > .ant-btn:last-child { + border-bottom-right-radius: 0; + border-top-right-radius: 0; + padding-right: 8px; +} +.ant-btn-group > .ant-btn-group:last-child:not(:first-child) > .ant-btn:first-child { + border-bottom-left-radius: 0; + border-top-left-radius: 0; + padding-left: 8px; +} +.ant-btn:not(.ant-btn-circle):not(.ant-btn-circle-outline).ant-btn-icon-only { + padding-left: 8px; + padding-right: 8px; +} +.ant-btn:focus > span, +.ant-btn:active > span { + position: relative; +} +.ant-btn > .anticon + span, +.ant-btn > span + .anticon { + margin-left: 8px; +} +.ant-btn-clicked:after { + content: ''; + position: absolute; + top: -1px; + left: -1px; + bottom: -1px; + right: -1px; + border-radius: inherit; + border: 0 solid #1890ff; + opacity: 0.4; + -webkit-animation: buttonEffect .4s; + animation: buttonEffect .4s; + display: block; +} +.ant-btn-danger.ant-btn-clicked:after { + border-color: #f5222d; +} +.ant-btn-background-ghost { + background: transparent !important; + border-color: #fff; + color: #fff; +} +.ant-btn-background-ghost.ant-btn-primary { + color: #1890ff; + background-color: transparent; + border-color: #1890ff; +} +.ant-btn-background-ghost.ant-btn-primary > a:only-child { + color: currentColor; +} +.ant-btn-background-ghost.ant-btn-primary > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-background-ghost.ant-btn-primary:hover, +.ant-btn-background-ghost.ant-btn-primary:focus { + color: #40a9ff; + background-color: transparent; + border-color: #40a9ff; +} +.ant-btn-background-ghost.ant-btn-primary:hover > a:only-child, +.ant-btn-background-ghost.ant-btn-primary:focus > a:only-child { + color: currentColor; +} +.ant-btn-background-ghost.ant-btn-primary:hover > a:only-child:after, +.ant-btn-background-ghost.ant-btn-primary:focus > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-background-ghost.ant-btn-primary:active, +.ant-btn-background-ghost.ant-btn-primary.active { + color: #096dd9; + background-color: transparent; + border-color: #096dd9; +} +.ant-btn-background-ghost.ant-btn-primary:active > a:only-child, +.ant-btn-background-ghost.ant-btn-primary.active > a:only-child { + color: currentColor; +} +.ant-btn-background-ghost.ant-btn-primary:active > a:only-child:after, +.ant-btn-background-ghost.ant-btn-primary.active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-background-ghost.ant-btn-primary.disabled, +.ant-btn-background-ghost.ant-btn-primary[disabled], +.ant-btn-background-ghost.ant-btn-primary.disabled:hover, +.ant-btn-background-ghost.ant-btn-primary[disabled]:hover, +.ant-btn-background-ghost.ant-btn-primary.disabled:focus, +.ant-btn-background-ghost.ant-btn-primary[disabled]:focus, +.ant-btn-background-ghost.ant-btn-primary.disabled:active, +.ant-btn-background-ghost.ant-btn-primary[disabled]:active, +.ant-btn-background-ghost.ant-btn-primary.disabled.active, +.ant-btn-background-ghost.ant-btn-primary[disabled].active { + color: rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + border-color: #d9d9d9; +} +.ant-btn-background-ghost.ant-btn-primary.disabled > a:only-child, +.ant-btn-background-ghost.ant-btn-primary[disabled] > a:only-child, +.ant-btn-background-ghost.ant-btn-primary.disabled:hover > a:only-child, +.ant-btn-background-ghost.ant-btn-primary[disabled]:hover > a:only-child, +.ant-btn-background-ghost.ant-btn-primary.disabled:focus > a:only-child, +.ant-btn-background-ghost.ant-btn-primary[disabled]:focus > a:only-child, +.ant-btn-background-ghost.ant-btn-primary.disabled:active > a:only-child, +.ant-btn-background-ghost.ant-btn-primary[disabled]:active > a:only-child, +.ant-btn-background-ghost.ant-btn-primary.disabled.active > a:only-child, +.ant-btn-background-ghost.ant-btn-primary[disabled].active > a:only-child { + color: currentColor; +} +.ant-btn-background-ghost.ant-btn-primary.disabled > a:only-child:after, +.ant-btn-background-ghost.ant-btn-primary[disabled] > a:only-child:after, +.ant-btn-background-ghost.ant-btn-primary.disabled:hover > a:only-child:after, +.ant-btn-background-ghost.ant-btn-primary[disabled]:hover > a:only-child:after, +.ant-btn-background-ghost.ant-btn-primary.disabled:focus > a:only-child:after, +.ant-btn-background-ghost.ant-btn-primary[disabled]:focus > a:only-child:after, +.ant-btn-background-ghost.ant-btn-primary.disabled:active > a:only-child:after, +.ant-btn-background-ghost.ant-btn-primary[disabled]:active > a:only-child:after, +.ant-btn-background-ghost.ant-btn-primary.disabled.active > a:only-child:after, +.ant-btn-background-ghost.ant-btn-primary[disabled].active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-background-ghost.ant-btn-danger { + color: #f5222d; + background-color: transparent; + border-color: #f5222d; +} +.ant-btn-background-ghost.ant-btn-danger > a:only-child { + color: currentColor; +} +.ant-btn-background-ghost.ant-btn-danger > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-background-ghost.ant-btn-danger:hover, +.ant-btn-background-ghost.ant-btn-danger:focus { + color: #ff4d4f; + background-color: transparent; + border-color: #ff4d4f; +} +.ant-btn-background-ghost.ant-btn-danger:hover > a:only-child, +.ant-btn-background-ghost.ant-btn-danger:focus > a:only-child { + color: currentColor; +} +.ant-btn-background-ghost.ant-btn-danger:hover > a:only-child:after, +.ant-btn-background-ghost.ant-btn-danger:focus > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-background-ghost.ant-btn-danger:active, +.ant-btn-background-ghost.ant-btn-danger.active { + color: #cf1322; + background-color: transparent; + border-color: #cf1322; +} +.ant-btn-background-ghost.ant-btn-danger:active > a:only-child, +.ant-btn-background-ghost.ant-btn-danger.active > a:only-child { + color: currentColor; +} +.ant-btn-background-ghost.ant-btn-danger:active > a:only-child:after, +.ant-btn-background-ghost.ant-btn-danger.active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-background-ghost.ant-btn-danger.disabled, +.ant-btn-background-ghost.ant-btn-danger[disabled], +.ant-btn-background-ghost.ant-btn-danger.disabled:hover, +.ant-btn-background-ghost.ant-btn-danger[disabled]:hover, +.ant-btn-background-ghost.ant-btn-danger.disabled:focus, +.ant-btn-background-ghost.ant-btn-danger[disabled]:focus, +.ant-btn-background-ghost.ant-btn-danger.disabled:active, +.ant-btn-background-ghost.ant-btn-danger[disabled]:active, +.ant-btn-background-ghost.ant-btn-danger.disabled.active, +.ant-btn-background-ghost.ant-btn-danger[disabled].active { + color: rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + border-color: #d9d9d9; +} +.ant-btn-background-ghost.ant-btn-danger.disabled > a:only-child, +.ant-btn-background-ghost.ant-btn-danger[disabled] > a:only-child, +.ant-btn-background-ghost.ant-btn-danger.disabled:hover > a:only-child, +.ant-btn-background-ghost.ant-btn-danger[disabled]:hover > a:only-child, +.ant-btn-background-ghost.ant-btn-danger.disabled:focus > a:only-child, +.ant-btn-background-ghost.ant-btn-danger[disabled]:focus > a:only-child, +.ant-btn-background-ghost.ant-btn-danger.disabled:active > a:only-child, +.ant-btn-background-ghost.ant-btn-danger[disabled]:active > a:only-child, +.ant-btn-background-ghost.ant-btn-danger.disabled.active > a:only-child, +.ant-btn-background-ghost.ant-btn-danger[disabled].active > a:only-child { + color: currentColor; +} +.ant-btn-background-ghost.ant-btn-danger.disabled > a:only-child:after, +.ant-btn-background-ghost.ant-btn-danger[disabled] > a:only-child:after, +.ant-btn-background-ghost.ant-btn-danger.disabled:hover > a:only-child:after, +.ant-btn-background-ghost.ant-btn-danger[disabled]:hover > a:only-child:after, +.ant-btn-background-ghost.ant-btn-danger.disabled:focus > a:only-child:after, +.ant-btn-background-ghost.ant-btn-danger[disabled]:focus > a:only-child:after, +.ant-btn-background-ghost.ant-btn-danger.disabled:active > a:only-child:after, +.ant-btn-background-ghost.ant-btn-danger[disabled]:active > a:only-child:after, +.ant-btn-background-ghost.ant-btn-danger.disabled.active > a:only-child:after, +.ant-btn-background-ghost.ant-btn-danger[disabled].active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-btn-two-chinese-chars:first-letter { + letter-spacing: .34em; +} +.ant-btn-two-chinese-chars > * { + letter-spacing: .34em; + margin-right: -0.34em; +} +@-webkit-keyframes buttonEffect { + to { + opacity: 0; + top: -6px; + left: -6px; + bottom: -6px; + right: -6px; + border-width: 6px; + } +} +@keyframes buttonEffect { + to { + opacity: 0; + top: -6px; + left: -6px; + bottom: -6px; + right: -6px; + border-width: 6px; + } +} +a.ant-btn { + line-height: 30px; +} +a.ant-btn-lg { + line-height: 38px; +} +a.ant-btn-sm { + line-height: 22px; +} diff --git a/es/button/style/index.js b/es/button/style/index.js new file mode 100644 index 0000000000..1675ad8fe0 --- /dev/null +++ b/es/button/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import './index.less'; \ No newline at end of file diff --git a/es/button/style/index.less b/es/button/style/index.less new file mode 100644 index 0000000000..132538c532 --- /dev/null +++ b/es/button/style/index.less @@ -0,0 +1,195 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; +@import "./mixin"; + +@btn-prefix-cls: ~"@{ant-prefix}-btn"; + +// for compatible +@btn-ghost-color: @text-color; +@btn-ghost-bg: transparent; +@btn-ghost-border: @border-color-base; + +// Button styles +// ----------------------------- +.@{btn-prefix-cls} { + line-height: @line-height-base; + .btn; + .btn-default; + + // Make sure that the target of Button's click event always be `button` + // Ref: https://github.com/ant-design/ant-design/issues/7034 + > i, + > span { + pointer-events: none; + } + + &-primary { + .btn-primary; + + .@{btn-prefix-cls}-group &:not(:first-child):not(:last-child) { + border-right-color: @btn-group-border; + border-left-color: @btn-group-border; + + &:disabled { + border-color: @btn-default-border; + } + } + + .@{btn-prefix-cls}-group &:first-child { + &:not(:last-child) { + border-right-color: @btn-group-border; + &[disabled] { + border-right-color: @btn-default-border; + } + } + } + + .@{btn-prefix-cls}-group &:last-child:not(:first-child), + .@{btn-prefix-cls}-group & + & { + border-left-color: @btn-group-border; + &[disabled] { + border-left-color: @btn-default-border; + } + } + } + + &-ghost { + .btn-ghost; + } + + &-dashed { + .btn-dashed; + } + + &-danger { + .btn-danger; + } + + &-circle, + &-circle-outline { + .btn-circle(@btn-prefix-cls); + } + + &:before { + position: absolute; + top: -1px; + left: -1px; + bottom: -1px; + right: -1px; + background: #fff; + opacity: 0.35; + content: ''; + border-radius: inherit; + z-index: 1; + transition: opacity .2s; + pointer-events: none; + display: none; + } + + .@{iconfont-css-prefix} { + transition: margin-left .3s @ease-in-out; + } + + &&-loading:before { + display: block; + } + + &&-loading:not(&-circle):not(&-circle-outline):not(&-icon-only) { + padding-left: 29px; + pointer-events: none; + position: relative; + .@{iconfont-css-prefix} { + margin-left: -14px; + } + } + + &-sm&-loading:not(&-circle):not(&-circle-outline):not(&-icon-only) { + padding-left: 24px; + .@{iconfont-css-prefix} { + margin-left: -17px; + } + } + + &-group { + .btn-group(@btn-prefix-cls); + } + + &:not(&-circle):not(&-circle-outline)&-icon-only { + padding-left: 8px; + padding-right: 8px; + } + + // http://stackoverflow.com/a/21281554/3040605 + &:focus > span, + &:active > span { + position: relative; + } + + // To ensure that a space will be placed between character and `Icon`. + > .@{iconfont-css-prefix} + span, + > span + .@{iconfont-css-prefix} { + margin-left: 8px; + } + + &-clicked:after { + content: ''; + position: absolute; + top: -1px; + left: -1px; + bottom: -1px; + right: -1px; + border-radius: inherit; + border: 0 solid @primary-color; + opacity: 0.4; + animation: buttonEffect .4s; + display: block; + } + + &-danger&-clicked:after { + border-color: @btn-danger-color; + } + + &-background-ghost { + background: transparent !important; + border-color: #fff; + color: #fff; + } + + &-background-ghost&-primary { + .button-variant-ghost(@btn-primary-bg); + } + + &-background-ghost&-danger { + .button-variant-ghost(@btn-danger-color); + } + + &-two-chinese-chars:first-letter { + letter-spacing: .34em; + } + + &-two-chinese-chars > * { + letter-spacing: .34em; + margin-right: -.34em; + } +} + +@keyframes buttonEffect { + to { + opacity: 0; + top: -6px; + left: -6px; + bottom: -6px; + right: -6px; + border-width: 6px; + } +} + +a.@{btn-prefix-cls} { + line-height: @btn-height-base - 2px; + &-lg { + line-height: @btn-height-lg - 2px; + } + &-sm { + line-height: @btn-height-sm - 2px; + } +} diff --git a/es/button/style/mixin.less b/es/button/style/mixin.less new file mode 100644 index 0000000000..699aa8646b --- /dev/null +++ b/es/button/style/mixin.less @@ -0,0 +1,333 @@ +// mixins for button +// ------------------------ +.button-size(@height; @padding; @font-size; @border-radius) { + padding: @padding; + font-size: @font-size; + border-radius: @border-radius; + height: @height; +} + +.button-disabled() { + &.disabled, + &[disabled] { + &, + &:hover, + &:focus, + &:active, + &.active { + .button-color(@btn-disable-color; @btn-disable-bg; @btn-disable-border); + } + } +} + +.button-variant-primary(@color; @background) { + .button-color(@color; @background; @background); + &:hover, + &:focus { + .button-color(@color; ~`colorPalette("@{background}", 5)`; ~`colorPalette("@{background}", 5)`); + } + + &:active, + &.active { + .button-color(@color; ~`colorPalette("@{background}", 7)`; ~`colorPalette("@{background}", 7)`); + } + + .button-disabled(); +} + +.button-variant-other(@color; @background; @border) { + .button-color(@color; @background; @border); + + &:hover, + &:focus { + .button-color(@primary-5; @background; @primary-5); + } + + &:active, + &.active { + .button-color(@primary-7; @background; @primary-7); + } + + .button-disabled(); +} + +.button-variant-danger(@color; @background; @border) { + .button-color(@color; @background; @border); + + &:hover { + .button-color(@btn-primary-color; ~`colorPalette("@{color}", 5)`; ~`colorPalette("@{color}", 5)`); + } + + &:focus { + .button-color(~`colorPalette("@{color}", 5)`; #fff; ~`colorPalette("@{color}", 5)`); + } + + &:active, + &.active { + .button-color(@btn-primary-color; ~`colorPalette("@{color}", 7)`; ~`colorPalette("@{color}", 7)`); + } + + .button-disabled(); +} + +.button-variant-ghost(@color) { + .button-color(@color; transparent; @color); + + &:hover, + &:focus { + .button-color(~`colorPalette("@{color}", 5)`; transparent; ~`colorPalette("@{color}", 5)`); + } + + &:active, + &.active { + .button-color(~`colorPalette("@{color}", 7)`; transparent; ~`colorPalette("@{color}", 7)`); + } + + .button-disabled(); +} + +.button-color(@color; @background; @border) { + color: @color; + background-color: @background; + border-color: @border; + // a inside Button which only work in Chrome + // http://stackoverflow.com/a/17253457 + > a:only-child { + color: currentColor; + &:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; + } + } +} + +.button-group-base(@btnClassName) { + position: relative; + display: inline-block; + > .@{btnClassName}, + > span > .@{btnClassName} { + position: relative; + line-height: @btn-height-base - 2px; + + &:hover, + &:focus, + &:active, + &.active { + z-index: 2; + } + + &:disabled { + z-index: 0; + } + } + + // size + &-lg > .@{btnClassName}, + &-lg > span > .@{btnClassName} { + .button-size(@btn-height-lg; @btn-padding-lg; @btn-font-size-lg; 0); + line-height: @btn-height-lg - 2px; + } + + &-sm > .@{btnClassName}, + &-sm > span > .@{btnClassName} { + .button-size(@btn-height-sm; @btn-padding-sm; @font-size-base; 0); + line-height: @btn-height-sm - 2px; + > .@{iconfont-css-prefix} { + font-size: @font-size-base; + } + } +} + +// Base styles of buttons +// -------------------------------------------------- +.btn() { + display: inline-block; + font-weight: @btn-font-weight; + text-align: center; + touch-action: manipulation; + cursor: pointer; + background-image: none; + border: @border-width-base @border-style-base transparent; + white-space: nowrap; + .button-size(@btn-height-base; @btn-padding-base; @font-size-base; @btn-border-radius-base); + user-select: none; + transition: all .3s @ease-in-out; + position: relative; + + > .@{iconfont-css-prefix} { + line-height: 1; + } + + &, + &:active, + &:focus { + outline: 0; + } + + &:not([disabled]):hover { + text-decoration: none; + } + + &:not([disabled]):active { + outline: 0; + transition: none; + } + + &.disabled, + &[disabled] { + cursor: not-allowed; + > * { + pointer-events: none; + } + } + + &-lg { + .button-size(@btn-height-lg; @btn-padding-lg; @btn-font-size-lg; @btn-border-radius-base); + } + + &-sm { + .button-size(@btn-height-sm; @btn-padding-sm; @btn-font-size-sm; @btn-border-radius-sm); + } +} + +// primary button style +.btn-primary() { + .button-variant-primary(@btn-primary-color; @btn-primary-bg); +} + +// default button style +.btn-default() { + .button-variant-other(@btn-default-color; @btn-default-bg; @btn-default-border); + &:hover, + &:focus, + &:active, + &.active { + background: @btn-default-bg; + text-decoration: none; + } +} + +// ghost button style +.btn-ghost() { + .button-variant-other(@btn-ghost-color, @btn-ghost-bg, @btn-ghost-border); +} + +// dashed button style +.btn-dashed() { + .button-variant-other(@btn-default-color, @btn-default-bg, @btn-default-border); + border-style: dashed; +} + +// danger button style +.btn-danger() { + .button-variant-danger(@btn-danger-color, @btn-danger-bg, @btn-danger-border); +} + +// circle button: the content only contains icon +.btn-circle(@btnClassName: btn) { + .square(@btn-circle-size); + .button-size(@btn-circle-size; 0; @font-size-base + 2px; 50%); + + &.@{btnClassName}-lg { + .square(@btn-circle-size-lg); + .button-size(@btn-circle-size-lg; 0; @btn-font-size-lg + 2px; 50%); + } + + &.@{btnClassName}-sm { + .square(@btn-circle-size-sm); + .button-size(@btn-circle-size-sm; 0; @font-size-base; 50%); + } +} + +// Horizontal button groups styl +// -------------------------------------------------- +.btn-group(@btnClassName: btn) { + .button-group-base(@btnClassName); + + .@{btnClassName} + .@{btnClassName}, + .@{btnClassName} + &, + span + .@{btnClassName}, + .@{btnClassName} + span, + > span + span, + & + .@{btnClassName}, + & + & { + margin-left: -1px; + } + + .@{btnClassName}-primary + .@{btnClassName}:not(.@{btnClassName}-primary):not([disabled]) { + border-left-color: transparent; + } + + .@{btnClassName} { + border-radius: 0; + } + + > .@{btnClassName}:first-child, + > span:first-child > .@{btnClassName} { + margin-left: 0; + } + > .@{btnClassName}:only-child { + border-radius: @btn-border-radius-base; + } + > span:only-child > .@{btnClassName} { + border-radius: @btn-border-radius-base; + } + + > .@{btnClassName}:first-child:not(:last-child), + > span:first-child:not(:last-child) > .@{btnClassName} { + border-bottom-left-radius: @btn-border-radius-base; + border-top-left-radius: @btn-border-radius-base; + } + + > .@{btnClassName}:last-child:not(:first-child), + > span:last-child:not(:first-child) > .@{btnClassName} { + border-bottom-right-radius: @btn-border-radius-base; + border-top-right-radius: @btn-border-radius-base; + } + + &-sm { + > .@{btnClassName}:only-child { + border-radius: @btn-border-radius-sm; + } + > span:only-child > .@{btnClassName} { + border-radius: @btn-border-radius-sm; + } + > .@{btnClassName}:first-child:not(:last-child), + > span:first-child:not(:last-child) > .@{btnClassName} { + border-bottom-left-radius: @btn-border-radius-sm; + border-top-left-radius: @btn-border-radius-sm; + } + > .@{btnClassName}:last-child:not(:first-child), + > span:last-child:not(:first-child) > .@{btnClassName} { + border-bottom-right-radius: @btn-border-radius-sm; + border-top-right-radius: @btn-border-radius-sm; + } + } + + & > & { + float: left; + } + + & > &:not(:first-child):not(:last-child) > .@{btnClassName} { + border-radius: 0; + } + + & > &:first-child:not(:last-child) { + > .@{btnClassName}:last-child { + border-bottom-right-radius: 0; + border-top-right-radius: 0; + padding-right: 8px; + } + } + + & > &:last-child:not(:first-child) > .@{btnClassName}:first-child { + border-bottom-left-radius: 0; + border-top-left-radius: 0; + padding-left: 8px; + } +} diff --git a/es/calendar/Constants.js b/es/calendar/Constants.js new file mode 100644 index 0000000000..4f6e6aff80 --- /dev/null +++ b/es/calendar/Constants.js @@ -0,0 +1 @@ +export var PREFIX_CLS = 'ant-fullcalendar'; \ No newline at end of file diff --git a/es/calendar/Header.js b/es/calendar/Header.js new file mode 100644 index 0000000000..162d3b05c7 --- /dev/null +++ b/es/calendar/Header.js @@ -0,0 +1,217 @@ +import _slicedToArray from 'babel-runtime/helpers/slicedToArray'; + +import { PREFIX_CLS } from './Constants'; +import Select from '../select'; +import { Group, Button } from '../radio'; +import PropTypes from '../_util/vue-types'; +import { initDefaultProps } from '../_util/props-util'; +var Option = Select.Option; + +export var HeaderProps = { + prefixCls: PropTypes.string, + locale: PropTypes.any, + fullscreen: PropTypes.boolean, + yearSelectOffset: PropTypes.number, + yearSelectTotal: PropTypes.number, + type: PropTypes.string, + // onValueChange: PropTypes.(value: moment.Moment) => void, + // onTypeChange: PropTypes.(type: string) => void, + value: PropTypes.any, + validRange: PropTypes.array +}; + +export default { + props: initDefaultProps(HeaderProps, { + prefixCls: PREFIX_CLS + '-header', + yearSelectOffset: 10, + yearSelectTotal: 20 + }), + + // private calenderHeaderNode: HTMLDivElement; + methods: { + getYearSelectElement: function getYearSelectElement(year) { + var _this = this; + + var h = this.$createElement; + var yearSelectOffset = this.yearSelectOffset, + yearSelectTotal = this.yearSelectTotal, + locale = this.locale, + prefixCls = this.prefixCls, + fullscreen = this.fullscreen, + validRange = this.validRange; + + var start = year - yearSelectOffset; + var end = start + yearSelectTotal; + if (validRange) { + start = validRange[0].get('year'); + end = validRange[1].get('year') + 1; + } + var suffix = locale.year === '年' ? '年' : ''; + + var options = []; + for (var index = start; index <= end; index++) { + options.push(h( + Option, + { key: '' + index }, + [index + suffix] + )); + } + return h( + Select, + { + attrs: { + size: fullscreen ? 'default' : 'small', + dropdownMatchSelectWidth: false, + + value: String(year), + getPopupContainer: function getPopupContainer() { + return _this.getCalenderHeaderNode(); + } + }, + 'class': prefixCls + '-year-select', + on: { + 'change': this.onYearChange + } + }, + [options] + ); + }, + getMonthsLocale: function getMonthsLocale(value) { + var current = value.clone(); + var localeData = value.localeData(); + var months = []; + for (var i = 0; i < 12; i++) { + current.month(i); + months.push(localeData.monthsShort(current)); + } + return months; + }, + getMonthSelectElement: function getMonthSelectElement(month, months) { + var _this2 = this; + + var h = this.$createElement; + var prefixCls = this.prefixCls, + fullscreen = this.fullscreen, + validRange = this.validRange, + value = this.value; + + var options = []; + var start = 0; + var end = 12; + if (validRange) { + var _validRange = _slicedToArray(validRange, 2), + rangeStart = _validRange[0], + rangeEnd = _validRange[1]; + + var currentYear = value.get('year'); + if (rangeEnd.get('year') === currentYear) { + end = rangeEnd.get('month') + 1; + } else { + start = rangeStart.get('month'); + } + } + for (var index = start; index < end; index++) { + options.push(h( + Option, + { key: '' + index }, + [months[index]] + )); + } + + return h( + Select, + { + attrs: { + size: fullscreen ? 'default' : 'small', + dropdownMatchSelectWidth: false, + + value: String(month), + + getPopupContainer: function getPopupContainer() { + return _this2.getCalenderHeaderNode(); + } + }, + 'class': prefixCls + '-month-select', on: { + 'change': this.onMonthChange + } + }, + [options] + ); + }, + onYearChange: function onYearChange(year) { + var value = this.value, + validRange = this.validRange; + + var newValue = value.clone(); + newValue.year(parseInt(year, 10)); + // switch the month so that it remains within range when year changes + if (validRange) { + var _validRange2 = _slicedToArray(validRange, 2), + start = _validRange2[0], + end = _validRange2[1]; + + var newYear = newValue.get('year'); + var newMonth = newValue.get('month'); + if (newYear === end.get('year') && newMonth > end.get('month')) { + newValue.month(end.get('month')); + } + if (newYear === start.get('year') && newMonth < start.get('month')) { + newValue.month(start.get('month')); + } + } + this.$emit('valueChange', newValue); + }, + onMonthChange: function onMonthChange(month) { + var newValue = this.value.clone(); + newValue.month(parseInt(month, 10)); + this.$emit('valueChange', newValue); + }, + onTypeChange: function onTypeChange(e) { + this.$emit('typeChange', e.target.value); + }, + getCalenderHeaderNode: function getCalenderHeaderNode() { + return this.$refs.calenderHeaderNode; + } + }, + + render: function render() { + var h = arguments[0]; + var type = this.type, + value = this.value, + prefixCls = this.prefixCls, + locale = this.locale, + fullscreen = this.fullscreen; + + var yearSelect = this.getYearSelectElement(value.year()); + var monthSelect = type === 'date' ? this.getMonthSelectElement(value.month(), this.getMonthsLocale(value)) : null; + var size = fullscreen ? 'default' : 'small'; + var typeSwitch = h( + Group, + { + on: { + 'change': this.onTypeChange + }, + attrs: { value: type, size: size } + }, + [h( + Button, + { + attrs: { value: 'date' } + }, + [locale.month] + ), h( + Button, + { + attrs: { value: 'month' } + }, + [locale.year] + )] + ); + + return h( + 'div', + { 'class': prefixCls + '-header', ref: 'calenderHeaderNode' }, + [yearSelect, monthSelect, typeSwitch] + ); + } +}; \ No newline at end of file diff --git a/es/calendar/index.js b/es/calendar/index.js new file mode 100644 index 0000000000..9e2cca1f53 --- /dev/null +++ b/es/calendar/index.js @@ -0,0 +1,267 @@ +import _extends from 'babel-runtime/helpers/extends'; +import _slicedToArray from 'babel-runtime/helpers/slicedToArray'; + +import PropTypes from '../_util/vue-types'; +import BaseMixin from '../_util/BaseMixin'; +import { getOptionProps, hasProp, initDefaultProps } from '../_util/props-util'; +import * as moment from 'moment'; +import FullCalendar from '../vc-calendar/src/FullCalendar'; +import LocaleReceiver from '../locale-provider/LocaleReceiver'; +import { PREFIX_CLS } from './Constants'; +import Header from './Header'; +import interopDefault from '../_util/interopDefault'; +import enUS from './locale/en_US'; + +export { HeaderProps } from './Header'; + +function noop() { + return null; +} + +function zerofixed(v) { + if (v < 10) { + return '0' + v; + } + return '' + v; +} +export var MomentType = { + type: Object, + validator: function validator(value) { + return moment.isMoment(value); + } +}; +function isMomentArray(value) { + return Array.isArray(value) && !!value.find(function (val) { + return moment.isMoment(val); + }); +} +export var CalendarMode = PropTypes.oneOf(['month', 'year']); + +export var CalendarProps = function CalendarProps() { + return { + prefixCls: PropTypes.string, + value: MomentType, + defaultValue: MomentType, + mode: CalendarMode, + fullscreen: PropTypes.bool, + // dateCellRender: PropTypes.func, + // monthCellRender: PropTypes.func, + // dateFullCellRender: PropTypes.func, + // monthFullCellRender: PropTypes.func, + locale: PropTypes.any, + // onPanelChange?: (date?: moment.Moment, mode?: CalendarMode) => void; + // onSelect?: (date?: moment.Moment) => void; + disabledDate: PropTypes.func, + validRange: PropTypes.custom(isMomentArray) + }; +}; + +export default { + name: 'ACalendar', + mixins: [BaseMixin], + props: initDefaultProps(CalendarProps(), { + locale: {}, + fullscreen: true, + prefixCls: PREFIX_CLS, + mode: 'month' + }), + model: { + prop: 'value', + event: 'change' + }, + data: function data() { + var value = this.value || this.defaultValue || interopDefault(moment)(); + if (!interopDefault(moment).isMoment(value)) { + throw new Error('The value/defaultValue of Calendar must be a moment object, '); + } + return { + sValue: value, + sMode: this.mode + }; + }, + + watch: { + value: function value(val) { + this.setState({ + sValue: val + }); + }, + mode: function mode(val) { + this.setState({ + sMode: val + }); + } + }, + methods: { + monthCellRender2: function monthCellRender2(value) { + var h = this.$createElement; + var prefixCls = this.prefixCls, + $scopedSlots = this.$scopedSlots; + + var monthCellRender = this.monthCellRender || $scopedSlots.monthCellRender || noop; + return h( + 'div', + { 'class': prefixCls + '-month' }, + [h( + 'div', + { 'class': prefixCls + '-value' }, + [value.localeData().monthsShort(value)] + ), h( + 'div', + { 'class': prefixCls + '-content' }, + [monthCellRender(value)] + )] + ); + }, + dateCellRender2: function dateCellRender2(value) { + var h = this.$createElement; + var prefixCls = this.prefixCls, + $scopedSlots = this.$scopedSlots; + + var dateCellRender = this.dateCellRender || $scopedSlots.dateCellRender || noop; + return h( + 'div', + { 'class': prefixCls + '-date' }, + [h( + 'div', + { 'class': prefixCls + '-value' }, + [zerofixed(value.date())] + ), h( + 'div', + { 'class': prefixCls + '-content' }, + [dateCellRender(value)] + )] + ); + }, + setValue: function setValue(value, way) { + if (!hasProp(this, 'value')) { + this.setState({ sValue: value }); + } + if (way === 'select') { + this.$emit('select', value); + this.$emit('onChange', value); + } else if (way === 'changePanel') { + this.onPanelChange(value, this.sMode); + } + }, + setType: function setType(type) { + var mode = type === 'date' ? 'month' : 'year'; + if (this.sMode !== mode) { + this.setState({ sMode: mode }); + this.onPanelChange(this.sValue, mode); + } + }, + onHeaderValueChange: function onHeaderValueChange(value) { + this.setValue(value, 'changePanel'); + }, + onHeaderTypeChange: function onHeaderTypeChange(type) { + this.setType(type); + }, + onPanelChange: function onPanelChange(value, mode) { + this.$emit('panelChange', value, mode); + if (value !== this.sValue) { + this.$emit('onChange', value); + } + }, + onSelect: function onSelect(value) { + this.setValue(value, 'select'); + }, + getDateRange: function getDateRange(validRange, disabledDate) { + return function (current) { + if (!current) { + return false; + } + + var _validRange = _slicedToArray(validRange, 2), + startDate = _validRange[0], + endDate = _validRange[1]; + + var inRange = !current.isBetween(startDate, endDate, 'days', '[]'); + if (disabledDate) { + return disabledDate(current) || inRange; + } + return inRange; + }; + }, + renderCalendar: function renderCalendar(locale, localeCode) { + var h = this.$createElement; + + var props = getOptionProps(this); + var value = this.sValue, + mode = this.sMode, + $listeners = this.$listeners, + $scopedSlots = this.$scopedSlots; + + if (value && localeCode) { + value.locale(localeCode); + } + var prefixCls = props.prefixCls, + fullscreen = props.fullscreen, + dateFullCellRender = props.dateFullCellRender, + monthFullCellRender = props.monthFullCellRender; + + var type = mode === 'year' ? 'month' : 'date'; + + var cls = ''; + if (fullscreen) { + cls += ' ' + prefixCls + '-fullscreen'; + } + + var monthCellRender = monthFullCellRender || $scopedSlots.monthFullCellRender || this.monthCellRender2; + var dateCellRender = dateFullCellRender || $scopedSlots.dateFullCellRender || this.dateCellRender2; + + var disabledDate = props.disabledDate; + + if (props.validRange) { + disabledDate = this.getDateRange(props.validRange, disabledDate); + } + var fullCalendarProps = { + props: _extends({}, props, { + Select: {}, + locale: locale.lang, + type: type, + prefixCls: prefixCls, + showHeader: false, + value: value, + monthCellRender: monthCellRender, + dateCellRender: dateCellRender, + disabledDate: disabledDate + }), + on: _extends({}, $listeners, { + select: this.onSelect + }) + }; + return h( + 'div', + { 'class': cls }, + [h(Header, { + attrs: { + fullscreen: fullscreen, + type: type, + value: value, + locale: locale.lang, + prefixCls: prefixCls, + + validRange: props.validRange + }, + on: { + 'typeChange': this.onHeaderTypeChange, + 'valueChange': this.onHeaderValueChange + } + }), h(FullCalendar, fullCalendarProps)] + ); + } + }, + + render: function render() { + var h = arguments[0]; + + return h(LocaleReceiver, { + attrs: { + componentName: 'Calendar', + defaultLocale: enUS + }, + scopedSlots: { 'default': this.renderCalendar } + }); + } +}; \ No newline at end of file diff --git a/es/calendar/locale/ar_EG.js b/es/calendar/locale/ar_EG.js new file mode 100644 index 0000000000..7b6cf59ba9 --- /dev/null +++ b/es/calendar/locale/ar_EG.js @@ -0,0 +1,2 @@ +import ar_EG from '../../date-picker/locale/ar_EG'; +export default ar_EG; \ No newline at end of file diff --git a/es/calendar/locale/bg_BG.js b/es/calendar/locale/bg_BG.js new file mode 100644 index 0000000000..e949bea9a8 --- /dev/null +++ b/es/calendar/locale/bg_BG.js @@ -0,0 +1,2 @@ +import bg_BG from '../../date-picker/locale/bg_BG'; +export default bg_BG; \ No newline at end of file diff --git a/es/calendar/locale/ca_ES.js b/es/calendar/locale/ca_ES.js new file mode 100644 index 0000000000..a54c5d507c --- /dev/null +++ b/es/calendar/locale/ca_ES.js @@ -0,0 +1,2 @@ +import ca_ES from '../../date-picker/locale/ca_ES'; +export default ca_ES; \ No newline at end of file diff --git a/es/calendar/locale/cs_CZ.js b/es/calendar/locale/cs_CZ.js new file mode 100644 index 0000000000..68d2e26a25 --- /dev/null +++ b/es/calendar/locale/cs_CZ.js @@ -0,0 +1,2 @@ +import cs_CZ from '../../date-picker/locale/cs_CZ'; +export default cs_CZ; \ No newline at end of file diff --git a/es/calendar/locale/de_DE.js b/es/calendar/locale/de_DE.js new file mode 100644 index 0000000000..e1fe3ecedf --- /dev/null +++ b/es/calendar/locale/de_DE.js @@ -0,0 +1,2 @@ +import de_DE from '../../date-picker/locale/de_DE'; +export default de_DE; \ No newline at end of file diff --git a/es/calendar/locale/el_GR.js b/es/calendar/locale/el_GR.js new file mode 100644 index 0000000000..8822c43ff7 --- /dev/null +++ b/es/calendar/locale/el_GR.js @@ -0,0 +1,2 @@ +import el_GR from '../../date-picker/locale/el_GR'; +export default el_GR; \ No newline at end of file diff --git a/es/calendar/locale/en_GB.js b/es/calendar/locale/en_GB.js new file mode 100644 index 0000000000..096ef565b8 --- /dev/null +++ b/es/calendar/locale/en_GB.js @@ -0,0 +1,2 @@ +import en_GB from '../../date-picker/locale/en_GB'; +export default en_GB; \ No newline at end of file diff --git a/es/calendar/locale/en_US.js b/es/calendar/locale/en_US.js new file mode 100644 index 0000000000..a74db86798 --- /dev/null +++ b/es/calendar/locale/en_US.js @@ -0,0 +1,2 @@ +import en_US from '../../date-picker/locale/en_US'; +export default en_US; \ No newline at end of file diff --git a/es/calendar/locale/es_ES.js b/es/calendar/locale/es_ES.js new file mode 100644 index 0000000000..209436d375 --- /dev/null +++ b/es/calendar/locale/es_ES.js @@ -0,0 +1,2 @@ +import es_ES from '../../date-picker/locale/es_ES'; +export default es_ES; \ No newline at end of file diff --git a/es/calendar/locale/et_EE.js b/es/calendar/locale/et_EE.js new file mode 100644 index 0000000000..6c95df3e3b --- /dev/null +++ b/es/calendar/locale/et_EE.js @@ -0,0 +1,2 @@ +import et_EE from '../../date-picker/locale/et_EE'; +export default et_EE; \ No newline at end of file diff --git a/es/calendar/locale/fa_IR.js b/es/calendar/locale/fa_IR.js new file mode 100644 index 0000000000..1213eadd6b --- /dev/null +++ b/es/calendar/locale/fa_IR.js @@ -0,0 +1,2 @@ +import fa_IR from '../../date-picker/locale/fa_IR'; +export default fa_IR; \ No newline at end of file diff --git a/es/calendar/locale/fi_FI.js b/es/calendar/locale/fi_FI.js new file mode 100644 index 0000000000..75c75b6767 --- /dev/null +++ b/es/calendar/locale/fi_FI.js @@ -0,0 +1,2 @@ +import fi_FI from '../../date-picker/locale/fi_FI'; +export default fi_FI; \ No newline at end of file diff --git a/es/calendar/locale/fr_BE.js b/es/calendar/locale/fr_BE.js new file mode 100644 index 0000000000..32985acfb4 --- /dev/null +++ b/es/calendar/locale/fr_BE.js @@ -0,0 +1,2 @@ +import fr_BE from '../../date-picker/locale/fr_BE'; +export default fr_BE; \ No newline at end of file diff --git a/es/calendar/locale/fr_FR.js b/es/calendar/locale/fr_FR.js new file mode 100644 index 0000000000..1378917f29 --- /dev/null +++ b/es/calendar/locale/fr_FR.js @@ -0,0 +1,2 @@ +import fr_FR from '../../date-picker/locale/fr_FR'; +export default fr_FR; \ No newline at end of file diff --git a/es/calendar/locale/is_IS.js b/es/calendar/locale/is_IS.js new file mode 100644 index 0000000000..779dcf1c53 --- /dev/null +++ b/es/calendar/locale/is_IS.js @@ -0,0 +1,2 @@ +import is_IS from '../../date-picker/locale/is_IS'; +export default is_IS; \ No newline at end of file diff --git a/es/calendar/locale/it_IT.js b/es/calendar/locale/it_IT.js new file mode 100644 index 0000000000..d190767327 --- /dev/null +++ b/es/calendar/locale/it_IT.js @@ -0,0 +1,2 @@ +import it_IT from '../../date-picker/locale/it_IT'; +export default it_IT; \ No newline at end of file diff --git a/es/calendar/locale/ja_JP.js b/es/calendar/locale/ja_JP.js new file mode 100644 index 0000000000..61b77db5b8 --- /dev/null +++ b/es/calendar/locale/ja_JP.js @@ -0,0 +1,2 @@ +import ja_JP from '../../date-picker/locale/ja_JP'; +export default ja_JP; \ No newline at end of file diff --git a/es/calendar/locale/ko_KR.js b/es/calendar/locale/ko_KR.js new file mode 100644 index 0000000000..d27c4ea128 --- /dev/null +++ b/es/calendar/locale/ko_KR.js @@ -0,0 +1,2 @@ +import ko_KR from '../../date-picker/locale/ko_KR'; +export default ko_KR; \ No newline at end of file diff --git a/es/calendar/locale/ku_IQ.js b/es/calendar/locale/ku_IQ.js new file mode 100755 index 0000000000..4a0ae9a072 --- /dev/null +++ b/es/calendar/locale/ku_IQ.js @@ -0,0 +1,2 @@ +import ku_IQ from '../../date-picker/locale/ku_IQ'; +export default ku_IQ; \ No newline at end of file diff --git a/es/calendar/locale/nb_NO.js b/es/calendar/locale/nb_NO.js new file mode 100644 index 0000000000..7c9a343576 --- /dev/null +++ b/es/calendar/locale/nb_NO.js @@ -0,0 +1,2 @@ +import nb_NO from '../../date-picker/locale/nb_NO'; +export default nb_NO; \ No newline at end of file diff --git a/es/calendar/locale/nl_BE.js b/es/calendar/locale/nl_BE.js new file mode 100644 index 0000000000..1b80ed0126 --- /dev/null +++ b/es/calendar/locale/nl_BE.js @@ -0,0 +1,2 @@ +import nl_BE from '../../date-picker/locale/nl_BE'; +export default nl_BE; \ No newline at end of file diff --git a/es/calendar/locale/nl_NL.js b/es/calendar/locale/nl_NL.js new file mode 100644 index 0000000000..51d5bf833d --- /dev/null +++ b/es/calendar/locale/nl_NL.js @@ -0,0 +1,2 @@ +import nl_NL from '../../date-picker/locale/nl_NL'; +export default nl_NL; \ No newline at end of file diff --git a/es/calendar/locale/pl_PL.js b/es/calendar/locale/pl_PL.js new file mode 100644 index 0000000000..04bd9013ba --- /dev/null +++ b/es/calendar/locale/pl_PL.js @@ -0,0 +1,2 @@ +import pl_PL from '../../date-picker/locale/pl_PL'; +export default pl_PL; \ No newline at end of file diff --git a/es/calendar/locale/pt_BR.js b/es/calendar/locale/pt_BR.js new file mode 100644 index 0000000000..d730b1c4bf --- /dev/null +++ b/es/calendar/locale/pt_BR.js @@ -0,0 +1,2 @@ +import pt_BR from '../../date-picker/locale/pt_BR'; +export default pt_BR; \ No newline at end of file diff --git a/es/calendar/locale/pt_PT.js b/es/calendar/locale/pt_PT.js new file mode 100644 index 0000000000..abcfcac726 --- /dev/null +++ b/es/calendar/locale/pt_PT.js @@ -0,0 +1,2 @@ +import pt_PT from '../../date-picker/locale/pt_PT'; +export default pt_PT; \ No newline at end of file diff --git a/es/calendar/locale/ru_RU.js b/es/calendar/locale/ru_RU.js new file mode 100644 index 0000000000..f170203278 --- /dev/null +++ b/es/calendar/locale/ru_RU.js @@ -0,0 +1,2 @@ +import ru_RU from '../../date-picker/locale/ru_RU'; +export default ru_RU; \ No newline at end of file diff --git a/es/calendar/locale/sk_SK.js b/es/calendar/locale/sk_SK.js new file mode 100644 index 0000000000..c3776b06eb --- /dev/null +++ b/es/calendar/locale/sk_SK.js @@ -0,0 +1,2 @@ +import sk_SK from '../../date-picker/locale/sk_SK'; +export default sk_SK; \ No newline at end of file diff --git a/es/calendar/locale/sl_SI.js b/es/calendar/locale/sl_SI.js new file mode 100644 index 0000000000..46591a9464 --- /dev/null +++ b/es/calendar/locale/sl_SI.js @@ -0,0 +1,2 @@ +import sl_SI from '../../date-picker/locale/sl_SI'; +export default sl_SI; \ No newline at end of file diff --git a/es/calendar/locale/sr_RS.js b/es/calendar/locale/sr_RS.js new file mode 100644 index 0000000000..9e220e1380 --- /dev/null +++ b/es/calendar/locale/sr_RS.js @@ -0,0 +1,2 @@ +import sr_RS from '../../date-picker/locale/sr_RS'; +export default sr_RS; \ No newline at end of file diff --git a/es/calendar/locale/sv_SE.js b/es/calendar/locale/sv_SE.js new file mode 100644 index 0000000000..4ac4ed3134 --- /dev/null +++ b/es/calendar/locale/sv_SE.js @@ -0,0 +1,2 @@ +import sv_SE from '../../date-picker/locale/sv_SE'; +export default sv_SE; \ No newline at end of file diff --git a/es/calendar/locale/th_TH.js b/es/calendar/locale/th_TH.js new file mode 100644 index 0000000000..f0177b97ad --- /dev/null +++ b/es/calendar/locale/th_TH.js @@ -0,0 +1,2 @@ +import th_TH from '../../date-picker/locale/th_TH'; +export default th_TH; \ No newline at end of file diff --git a/es/calendar/locale/tr_TR.js b/es/calendar/locale/tr_TR.js new file mode 100644 index 0000000000..0d9693f870 --- /dev/null +++ b/es/calendar/locale/tr_TR.js @@ -0,0 +1,2 @@ +import tr_TR from '../../date-picker/locale/tr_TR'; +export default tr_TR; \ No newline at end of file diff --git a/es/calendar/locale/uk_UA.js b/es/calendar/locale/uk_UA.js new file mode 100644 index 0000000000..a3b0f5edc8 --- /dev/null +++ b/es/calendar/locale/uk_UA.js @@ -0,0 +1,2 @@ +import uk_UA from '../../date-picker/locale/uk_UA'; +export default uk_UA; \ No newline at end of file diff --git a/es/calendar/locale/vi_VN.js b/es/calendar/locale/vi_VN.js new file mode 100644 index 0000000000..d71d81105a --- /dev/null +++ b/es/calendar/locale/vi_VN.js @@ -0,0 +1,2 @@ +import vi_VN from '../../date-picker/locale/vi_VN'; +export default vi_VN; \ No newline at end of file diff --git a/es/calendar/locale/zh_CN.js b/es/calendar/locale/zh_CN.js new file mode 100644 index 0000000000..42802b7b87 --- /dev/null +++ b/es/calendar/locale/zh_CN.js @@ -0,0 +1,2 @@ +import zh_CN from '../../date-picker/locale/zh_CN'; +export default zh_CN; \ No newline at end of file diff --git a/es/calendar/locale/zh_TW.js b/es/calendar/locale/zh_TW.js new file mode 100644 index 0000000000..4b2fcafdbf --- /dev/null +++ b/es/calendar/locale/zh_TW.js @@ -0,0 +1,2 @@ +import zh_TW from '../../date-picker/locale/zh_TW'; +export default zh_TW; \ No newline at end of file diff --git a/es/calendar/style/css.js b/es/calendar/style/css.js new file mode 100644 index 0000000000..c247688d19 --- /dev/null +++ b/es/calendar/style/css.js @@ -0,0 +1,6 @@ +import '../../style/index.css'; +import './index.css'; + +// style dependencies +import '../../select/style/css'; +import '../../radio/style/css'; \ No newline at end of file diff --git a/es/calendar/style/index.css b/es/calendar/style/index.css new file mode 100644 index 0000000000..3d0843bab8 --- /dev/null +++ b/es/calendar/style/index.css @@ -0,0 +1,229 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-fullcalendar { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + outline: none; + border-top: 1px solid #d9d9d9; +} +.ant-fullcalendar-month-select { + margin-left: 5px; +} +.ant-fullcalendar-header { + padding: 11px 16px 11px 0; + text-align: right; +} +.ant-fullcalendar-header .ant-select-dropdown { + text-align: left; +} +.ant-fullcalendar-header .ant-radio-group { + margin-left: 8px; + text-align: left; +} +.ant-fullcalendar-header label.ant-radio-button { + height: 22px; + line-height: 20px; + padding: 0 10px; +} +.ant-fullcalendar-date-panel { + position: relative; + outline: none; +} +.ant-fullcalendar-calendar-body { + padding: 8px 12px; +} +.ant-fullcalendar table { + border-collapse: collapse; + max-width: 100%; + background-color: transparent; + width: 100%; + height: 256px; +} +.ant-fullcalendar table, +.ant-fullcalendar th, +.ant-fullcalendar td { + border: 0; +} +.ant-fullcalendar td { + position: relative; +} +.ant-fullcalendar-calendar-table { + border-spacing: 0; + margin-bottom: 0; +} +.ant-fullcalendar-column-header { + line-height: 18px; + padding: 0; + width: 33px; + text-align: center; +} +.ant-fullcalendar-column-header .ant-fullcalendar-column-header-inner { + display: block; + font-weight: normal; +} +.ant-fullcalendar-week-number-header .ant-fullcalendar-column-header-inner { + display: none; +} +.ant-fullcalendar-month, +.ant-fullcalendar-date { + text-align: center; + -webkit-transition: all .3s; + transition: all .3s; +} +.ant-fullcalendar-value { + display: block; + margin: 0 auto; + color: rgba(0, 0, 0, 0.65); + border-radius: 2px; + width: 24px; + height: 24px; + padding: 0; + background: transparent; + line-height: 24px; + -webkit-transition: all .3s; + transition: all .3s; +} +.ant-fullcalendar-value:hover { + background: #e6f7ff; + cursor: pointer; +} +.ant-fullcalendar-value:active { + background: #1890ff; + color: #fff; +} +.ant-fullcalendar-month-panel-cell .ant-fullcalendar-value { + width: 48px; +} +.ant-fullcalendar-today .ant-fullcalendar-value, +.ant-fullcalendar-month-panel-current-cell .ant-fullcalendar-value { + -webkit-box-shadow: 0 0 0 1px #1890ff inset; + box-shadow: 0 0 0 1px #1890ff inset; +} +.ant-fullcalendar-selected-day .ant-fullcalendar-value, +.ant-fullcalendar-month-panel-selected-cell .ant-fullcalendar-value { + background: #1890ff; + color: #fff; +} +.ant-fullcalendar-disabled-cell-first-of-row .ant-fullcalendar-value { + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +.ant-fullcalendar-disabled-cell-last-of-row .ant-fullcalendar-value { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +.ant-fullcalendar-last-month-cell .ant-fullcalendar-value, +.ant-fullcalendar-next-month-btn-day .ant-fullcalendar-value { + color: rgba(0, 0, 0, 0.25); +} +.ant-fullcalendar-month-panel-table { + table-layout: fixed; + width: 100%; + border-collapse: separate; +} +.ant-fullcalendar-content { + position: absolute; + width: 100%; + left: 0; + bottom: -9px; +} +.ant-fullcalendar-fullscreen { + border-top: 0; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-table { + table-layout: fixed; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-header .ant-radio-group { + margin-left: 16px; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-header label.ant-radio-button { + height: 32px; + line-height: 30px; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-month, +.ant-fullcalendar-fullscreen .ant-fullcalendar-date { + text-align: left; + margin: 0 4px; + display: block; + color: rgba(0, 0, 0, 0.65); + height: 116px; + padding: 4px 8px; + border-top: 2px solid #e8e8e8; + -webkit-transition: background .3s; + transition: background .3s; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-month:hover, +.ant-fullcalendar-fullscreen .ant-fullcalendar-date:hover { + background: #e6f7ff; + cursor: pointer; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-month:active, +.ant-fullcalendar-fullscreen .ant-fullcalendar-date:active { + background: #bae7ff; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-column-header { + text-align: right; + padding-right: 12px; + padding-bottom: 5px; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-value { + text-align: right; + background: transparent; + width: auto; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-today .ant-fullcalendar-value { + color: rgba(0, 0, 0, 0.65); +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-month-panel-current-cell .ant-fullcalendar-month, +.ant-fullcalendar-fullscreen .ant-fullcalendar-today .ant-fullcalendar-date { + border-top-color: #1890ff; + background: transparent; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-month-panel-current-cell .ant-fullcalendar-value, +.ant-fullcalendar-fullscreen .ant-fullcalendar-today .ant-fullcalendar-value { + -webkit-box-shadow: none; + box-shadow: none; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-month-panel-selected-cell .ant-fullcalendar-month, +.ant-fullcalendar-fullscreen .ant-fullcalendar-selected-day .ant-fullcalendar-date { + background: #e6f7ff; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-month-panel-selected-cell .ant-fullcalendar-value, +.ant-fullcalendar-fullscreen .ant-fullcalendar-selected-day .ant-fullcalendar-value { + color: #1890ff; +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-last-month-cell .ant-fullcalendar-date, +.ant-fullcalendar-fullscreen .ant-fullcalendar-next-month-btn-day .ant-fullcalendar-date { + color: rgba(0, 0, 0, 0.25); +} +.ant-fullcalendar-fullscreen .ant-fullcalendar-content { + height: 90px; + overflow-y: auto; + position: static; + width: auto; + left: auto; + bottom: auto; +} +.ant-fullcalendar-disabled-cell .ant-fullcalendar-date, +.ant-fullcalendar-disabled-cell .ant-fullcalendar-date:hover { + cursor: not-allowed; +} +.ant-fullcalendar-disabled-cell:not(.ant-fullcalendar-today) .ant-fullcalendar-date, +.ant-fullcalendar-disabled-cell:not(.ant-fullcalendar-today) .ant-fullcalendar-date:hover { + background: transparent; +} +.ant-fullcalendar-disabled-cell .ant-fullcalendar-value { + color: rgba(0, 0, 0, 0.25); + border-radius: 0; + width: auto; + cursor: not-allowed; +} diff --git a/es/calendar/style/index.js b/es/calendar/style/index.js new file mode 100644 index 0000000000..983bb09935 --- /dev/null +++ b/es/calendar/style/index.js @@ -0,0 +1,6 @@ +import '../../style/index.less'; +import './index.less'; + +// style dependencies +import '../../select/style'; +import '../../radio/style'; \ No newline at end of file diff --git a/es/calendar/style/index.less b/es/calendar/style/index.less new file mode 100644 index 0000000000..32ca13deaa --- /dev/null +++ b/es/calendar/style/index.less @@ -0,0 +1,266 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@full-calendar-prefix-cls: ~"@{ant-prefix}-fullcalendar"; + +.@{full-calendar-prefix-cls} { + .reset-component; + outline: none; + border-top: @border-width-base @border-style-base @border-color-base; + + &-month-select { + margin-left: 5px; + } + + &-header { + padding: 11px 16px 11px 0; + text-align: right; + + .@{ant-prefix}-select-dropdown { + text-align: left; + } + + .@{ant-prefix}-radio-group { + margin-left: 8px; + text-align: left; + } + + label.@{ant-prefix}-radio-button { + height: 22px; + line-height: 20px; + padding: 0 10px; + } + } + + &-date-panel { + position: relative; + outline: none; + } + + &-calendar-body { + padding: 8px 12px; + } + + table { + border-collapse: collapse; + max-width: 100%; + background-color: transparent; + width: 100%; + height: 256px; + } + + table, + th, + td { + border: 0; + } + + td { + position: relative; + } + + &-calendar-table { + border-spacing: 0; + margin-bottom: 0; + } + + &-column-header { + line-height: 18px; + padding: 0; + width: 33px; + text-align: center; + .@{full-calendar-prefix-cls}-column-header-inner { + display: block; + font-weight: normal; + } + } + + &-week-number-header { + .@{full-calendar-prefix-cls}-column-header-inner { + display: none; + } + } + + &-month, + &-date { + text-align: center; + transition: all .3s; + } + + &-value { + display: block; + margin: 0 auto; + color: @text-color; + border-radius: @border-radius-sm; + width: 24px; + height: 24px; + padding: 0; + background: transparent; + line-height: 24px; + transition: all .3s; + + &:hover { + background: @item-hover-bg; + cursor: pointer; + } + + &:active { + background: @primary-color; + color: #fff; + } + } + + &-month-panel-cell &-value { + width: 48px; + } + + &-today &-value, + &-month-panel-current-cell &-value { + box-shadow: 0 0 0 1px @primary-color inset; + } + + &-selected-day &-value, + &-month-panel-selected-cell &-value { + background: @primary-color; + color: #fff; + } + + &-disabled-cell-first-of-row &-value { + border-top-left-radius: @border-radius-base; + border-bottom-left-radius: @border-radius-base; + } + + &-disabled-cell-last-of-row &-value { + border-top-right-radius: @border-radius-base; + border-bottom-right-radius: @border-radius-base; + } + + &-last-month-cell &-value, + &-next-month-btn-day &-value { + color: @disabled-color; + } + + &-month-panel-table { + table-layout: fixed; + width: 100%; + border-collapse: separate; + } + + &-content { + position: absolute; + width: 100%; + left: 0; + bottom: -9px; + } + + &-fullscreen { + border-top: 0; + } + + &-fullscreen &-table { + table-layout: fixed; + } + + &-fullscreen &-header { + .@{ant-prefix}-radio-group { + margin-left: 16px; + } + label.@{ant-prefix}-radio-button { + height: @input-height-base; + line-height: @input-height-base - 2px; + } + } + + &-fullscreen &-month, + &-fullscreen &-date { + text-align: left; + margin: 0 4px; + display: block; + color: @text-color; + height: 116px; + padding: 4px 8px; + border-top: 2px solid @border-color-split; + transition: background .3s; + + &:hover { + background: @item-hover-bg; + cursor: pointer; + } + + &:active { + background: @primary-2; + } + } + + &-fullscreen &-column-header { + text-align: right; + padding-right: 12px; + padding-bottom: 5px; + } + + &-fullscreen &-value { + text-align: right; + background: transparent; + width: auto; + } + + &-fullscreen &-today &-value { + color: @text-color; + } + + &-fullscreen &-month-panel-current-cell &-month, + &-fullscreen &-today &-date { + border-top-color: @primary-color; + background: transparent; + } + + &-fullscreen &-month-panel-current-cell &-value, + &-fullscreen &-today &-value { + box-shadow: none; + } + + &-fullscreen &-month-panel-selected-cell &-month, + &-fullscreen &-selected-day &-date { + background: @primary-1; + } + + &-fullscreen &-month-panel-selected-cell &-value, + &-fullscreen &-selected-day &-value { + color: @primary-color; + } + + &-fullscreen &-last-month-cell &-date, + &-fullscreen &-next-month-btn-day &-date { + color: @disabled-color; + } + + &-fullscreen &-content { + height: 90px; + overflow-y: auto; + position: static; + width: auto; + left: auto; + bottom: auto; + } + + &-disabled-cell &-date { + &, + &:hover { + cursor: not-allowed; + } + } + + &-disabled-cell:not(&-today) &-date { + &, + &:hover { + background: transparent; + } + } + + &-disabled-cell &-value { + color: @disabled-color; + border-radius: 0; + width: auto; + cursor: not-allowed; + } +} diff --git a/es/card/Card.js b/es/card/Card.js new file mode 100644 index 0000000000..d3faa18559 --- /dev/null +++ b/es/card/Card.js @@ -0,0 +1,183 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; + +import Tabs from '../tabs'; +import PropTypes from '../_util/vue-types'; +import addEventListener from '../_util/Dom/addEventListener'; +import { getComponentFromProp, getComponentName } from '../_util/props-util'; +import throttleByAnimationFrame from '../_util/throttleByAnimationFrame'; +import BaseMixin from '../_util/BaseMixin'; + +var TabPane = Tabs.TabPane; + +export default { + name: 'ACard', + mixins: [BaseMixin], + props: { + prefixCls: PropTypes.string.def('ant-card'), + title: PropTypes.string, + extra: PropTypes.any, + bordered: PropTypes.bool.def(true), + bodyStyle: PropTypes.object, + loading: PropTypes.bool.def(false), + hoverable: PropTypes.bool.def(false), + type: PropTypes.string, + actions: PropTypes.any, + tabList: PropTypes.array, + activeTabKey: PropTypes.string, + defaultActiveTabKey: PropTypes.string + }, + data: function data() { + this.updateWiderPaddingCalled = false; + return { + widerPadding: false + }; + }, + beforeMount: function beforeMount() { + this.updateWiderPadding = throttleByAnimationFrame(this.updateWiderPadding); + }, + mounted: function mounted() { + this.updateWiderPadding(); + this.resizeEvent = addEventListener(window, 'resize', this.updateWiderPadding); + }, + beforeDestroy: function beforeDestroy() { + if (this.resizeEvent) { + this.resizeEvent.remove(); + } + this.updateWiderPadding.cancel && this.updateWiderPadding.cancel(); + }, + + methods: { + updateWiderPadding: function updateWiderPadding() { + var _this = this; + + var cardContainerRef = this.$refs.cardContainerRef; + if (!cardContainerRef) { + return; + } + // 936 is a magic card width pixer number indicated by designer + var WIDTH_BOUDARY_PX = 936; + if (cardContainerRef.offsetWidth >= WIDTH_BOUDARY_PX && !this.widerPadding) { + this.setState({ widerPadding: true }, function () { + _this.updateWiderPaddingCalled = true; // first render without css transition + }); + } + if (cardContainerRef.offsetWidth < WIDTH_BOUDARY_PX && this.widerPadding) { + this.setState({ widerPadding: false }, function () { + _this.updateWiderPaddingCalled = true; // first render without css transition + }); + } + }, + onHandleTabChange: function onHandleTabChange(key) { + this.$emit('tabChange', key); + }, + isContainGrid: function isContainGrid() { + var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + var containGrid = void 0; + obj.forEach(function (element) { + if (element && element.componentOptions && getComponentName(element.componentOptions) === 'Grid') { + containGrid = true; + } + }); + return containGrid; + } + }, + render: function render() { + var _classString; + + var h = arguments[0]; + var _$props = this.$props, + _$props$prefixCls = _$props.prefixCls, + prefixCls = _$props$prefixCls === undefined ? 'ant-card' : _$props$prefixCls, + bodyStyle = _$props.bodyStyle, + loading = _$props.loading, + _$props$bordered = _$props.bordered, + bordered = _$props$bordered === undefined ? true : _$props$bordered, + type = _$props.type, + tabList = _$props.tabList, + hoverable = _$props.hoverable, + activeTabKey = _$props.activeTabKey, + defaultActiveTabKey = _$props.defaultActiveTabKey; + var $slots = this.$slots, + $scopedSlots = this.$scopedSlots; + + + var classString = (_classString = {}, _defineProperty(_classString, '' + prefixCls, true), _defineProperty(_classString, prefixCls + '-loading', loading), _defineProperty(_classString, prefixCls + '-bordered', bordered), _defineProperty(_classString, prefixCls + '-hoverable', !!hoverable), _defineProperty(_classString, prefixCls + '-wider-padding', this.widerPadding), _defineProperty(_classString, prefixCls + '-padding-transition', this.updateWiderPaddingCalled), _defineProperty(_classString, prefixCls + '-contain-grid', this.isContainGrid($slots['default'])), _defineProperty(_classString, prefixCls + '-contain-tabs', tabList && tabList.length), _defineProperty(_classString, prefixCls + '-type-' + type, !!type), _classString); + + var loadingBlock = h( + 'div', + { 'class': prefixCls + '-loading-content' }, + [h('p', { 'class': prefixCls + '-loading-block', style: { width: '94%' } }), h('p', [h('span', { 'class': prefixCls + '-loading-block', style: { width: '28%' } }), h('span', { 'class': prefixCls + '-loading-block', style: { width: '62%' } })]), h('p', [h('span', { 'class': prefixCls + '-loading-block', style: { width: '22%' } }), h('span', { 'class': prefixCls + '-loading-block', style: { width: '66%' } })]), h('p', [h('span', { 'class': prefixCls + '-loading-block', style: { width: '56%' } }), h('span', { 'class': prefixCls + '-loading-block', style: { width: '39%' } })]), h('p', [h('span', { 'class': prefixCls + '-loading-block', style: { width: '21%' } }), h('span', { 'class': prefixCls + '-loading-block', style: { width: '15%' } }), h('span', { 'class': prefixCls + '-loading-block', style: { width: '40%' } })])] + ); + + var hasActiveTabKey = activeTabKey !== undefined; + var tabsProps = { + props: _defineProperty({ + size: 'large' + }, hasActiveTabKey ? 'activeKey' : 'defaultActiveKey', hasActiveTabKey ? activeTabKey : defaultActiveTabKey), + on: { + change: this.onHandleTabChange + }, + 'class': prefixCls + '-head-tabs' + }; + + var head = void 0; + var tabs = tabList && tabList.length ? h( + Tabs, + tabsProps, + [tabList.map(function (item) { + var temp = item.tab, + _item$scopedSlots = item.scopedSlots, + scopedSlots = _item$scopedSlots === undefined ? {} : _item$scopedSlots; + + var name = scopedSlots.tab; + var tab = temp !== undefined ? temp : $scopedSlots[name] ? $scopedSlots[name](item) : null; + return h(TabPane, { + attrs: { tab: tab }, + key: item.key }); + })] + ) : null; + var titleDom = getComponentFromProp(this, 'title'); + var extraDom = getComponentFromProp(this, 'extra'); + if (titleDom || extraDom || tabs) { + head = h( + 'div', + { 'class': prefixCls + '-head' }, + [h( + 'div', + { 'class': prefixCls + '-head-wrapper' }, + [titleDom && h( + 'div', + { 'class': prefixCls + '-head-title' }, + [titleDom] + ), extraDom && h( + 'div', + { 'class': prefixCls + '-extra' }, + [extraDom] + )] + ), tabs] + ); + } + + var children = $slots['default']; + var cover = getComponentFromProp(this, 'cover'); + var coverDom = cover ? h( + 'div', + { 'class': prefixCls + '-cover' }, + [cover] + ) : null; + var body = h( + 'div', + { 'class': prefixCls + '-body', style: bodyStyle }, + [loading ? loadingBlock : children] + ); + var actions = getComponentFromProp(this, 'actions'); + var actionDom = actions || null; + + return h( + 'div', + { 'class': classString, ref: 'cardContainerRef' }, + [head, coverDom, children ? body : null, actionDom] + ); + } +}; \ No newline at end of file diff --git a/es/card/Grid.js b/es/card/Grid.js new file mode 100644 index 0000000000..c47b08b747 --- /dev/null +++ b/es/card/Grid.js @@ -0,0 +1,27 @@ +import _mergeJSXProps from 'babel-helper-vue-jsx-merge-props'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; + +import PropTypes from '../_util/vue-types'; + +export default { + name: 'ACardGrid', + props: { + prefixCls: PropTypes.string.def('ant-card') + }, + render: function render() { + var h = arguments[0]; + + var _$props = this.$props, + _$props$prefixCls = _$props.prefixCls, + prefixCls = _$props$prefixCls === undefined ? 'ant-card' : _$props$prefixCls, + others = _objectWithoutProperties(_$props, ['prefixCls']); + + var classString = _defineProperty({}, prefixCls + '-grid', true); + return h( + 'div', + _mergeJSXProps([others, { 'class': classString }]), + [this.$slots['default']] + ); + } +}; \ No newline at end of file diff --git a/es/card/Meta.js b/es/card/Meta.js new file mode 100644 index 0000000000..2c6a27b02b --- /dev/null +++ b/es/card/Meta.js @@ -0,0 +1,54 @@ +import _mergeJSXProps from 'babel-helper-vue-jsx-merge-props'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; + +import PropTypes from '../_util/vue-types'; +import { getComponentFromProp } from '../_util/props-util'; + +export default { + name: 'ACardMeta', + props: { + prefixCls: PropTypes.string.def('ant-card'), + title: PropTypes.string, + description: PropTypes.string + }, + render: function render() { + var h = arguments[0]; + + var _$props = this.$props, + _$props$prefixCls = _$props.prefixCls, + prefixCls = _$props$prefixCls === undefined ? 'ant-card' : _$props$prefixCls, + title = _$props.title, + description = _$props.description, + others = _objectWithoutProperties(_$props, ['prefixCls', 'title', 'description']); + + var classString = _defineProperty({}, prefixCls + '-meta', true); + + var avatar = getComponentFromProp(this, 'avatar'); + var avatarDom = avatar ? h( + 'div', + { 'class': prefixCls + '-meta-avatar' }, + [avatar] + ) : null; + var titleDom = title ? h( + 'div', + { 'class': prefixCls + '-meta-title' }, + [title] + ) : null; + var descriptionDom = description ? h( + 'div', + { 'class': prefixCls + '-meta-description' }, + [description] + ) : null; + var MetaDetail = titleDom || descriptionDom ? h( + 'div', + { 'class': prefixCls + '-meta-detail' }, + [titleDom, descriptionDom] + ) : null; + return h( + 'div', + _mergeJSXProps([others, { 'class': classString }]), + [avatarDom, MetaDetail] + ); + } +}; \ No newline at end of file diff --git a/es/card/index.js b/es/card/index.js new file mode 100644 index 0000000000..0926d115f3 --- /dev/null +++ b/es/card/index.js @@ -0,0 +1,6 @@ +import Card from './Card'; +import Meta from './Meta'; +import Grid from './Grid'; +Card.Meta = Meta; +Card.Grid = Grid; +export default Card; \ No newline at end of file diff --git a/es/card/style/css.js b/es/card/style/css.js new file mode 100644 index 0000000000..ae8d2870a7 --- /dev/null +++ b/es/card/style/css.js @@ -0,0 +1,5 @@ +import '../../style/index.css'; +import './index.css'; + +// style dependencies +import '../../tabs/style/css'; \ No newline at end of file diff --git a/es/card/style/index.css b/es/card/style/index.css new file mode 100644 index 0000000000..c1aaedcb54 --- /dev/null +++ b/es/card/style/index.css @@ -0,0 +1,295 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-card { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + background: #fff; + border-radius: 2px; + position: relative; + -webkit-transition: all .3s; + transition: all .3s; +} +.ant-card-hoverable { + cursor: pointer; +} +.ant-card-hoverable:hover { + -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09); + border-color: rgba(0, 0, 0, 0.09); +} +.ant-card-bordered { + border: 1px solid #e8e8e8; +} +.ant-card-head { + background: #fff; + border-bottom: 1px solid #e8e8e8; + padding: 0 24px; + border-radius: 2px 2px 0 0; + zoom: 1; + margin-bottom: -1px; + min-height: 48px; +} +.ant-card-head:before, +.ant-card-head:after { + content: " "; + display: table; +} +.ant-card-head:after { + clear: both; + visibility: hidden; + font-size: 0; + height: 0; +} +.ant-card-head-wrapper { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} +.ant-card-head-title { + font-size: 16px; + padding: 16px 0; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + color: rgba(0, 0, 0, 0.85); + font-weight: 500; + display: inline-block; + -webkit-box-flex: 1; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; +} +.ant-card-head .ant-tabs { + margin-bottom: -17px; + clear: both; +} +.ant-card-head .ant-tabs-bar { + border-bottom: 1px solid #e8e8e8; +} +.ant-card-extra { + float: right; + padding: 17.5px 0; + text-align: right; + margin-left: auto; +} +.ant-card-body { + padding: 24px; + zoom: 1; +} +.ant-card-body:before, +.ant-card-body:after { + content: " "; + display: table; +} +.ant-card-body:after { + clear: both; + visibility: hidden; + font-size: 0; + height: 0; +} +.ant-card-contain-grid .ant-card-body { + margin: -1px 0 0 -1px; + padding: 0; +} +.ant-card-grid { + border-radius: 0; + border: 0; + -webkit-box-shadow: 1px 0 0 0 #e8e8e8, 0 1px 0 0 #e8e8e8, 1px 1px 0 0 #e8e8e8, 1px 0 0 0 #e8e8e8 inset, 0 1px 0 0 #e8e8e8 inset; + box-shadow: 1px 0 0 0 #e8e8e8, 0 1px 0 0 #e8e8e8, 1px 1px 0 0 #e8e8e8, 1px 0 0 0 #e8e8e8 inset, 0 1px 0 0 #e8e8e8 inset; + width: 33.33%; + float: left; + padding: 24px; + -webkit-transition: all .3s; + transition: all .3s; +} +.ant-card-grid:hover { + position: relative; + z-index: 1; + -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); +} +.ant-card-contain-tabs .ant-card-head-title { + padding-bottom: 0; + min-height: 32px; +} +.ant-card-contain-tabs .ant-card-extra { + padding-bottom: 0; +} +.ant-card-cover > * { + width: 100%; + display: block; +} +.ant-card-actions { + border-top: 1px solid #e8e8e8; + background: #fafafa; + zoom: 1; + list-style: none; + margin: 0; + padding: 0; +} +.ant-card-actions:before, +.ant-card-actions:after { + content: " "; + display: table; +} +.ant-card-actions:after { + clear: both; + visibility: hidden; + font-size: 0; + height: 0; +} +.ant-card-actions > li { + float: left; + text-align: center; + margin: 12px 0; + color: rgba(0, 0, 0, 0.45); +} +.ant-card-actions > li > span { + display: inline-block; + font-size: 14px; + cursor: pointer; + line-height: 22px; + min-width: 32px; + position: relative; +} +.ant-card-actions > li > span:hover { + color: #1890ff; + -webkit-transition: color .3s; + transition: color .3s; +} +.ant-card-actions > li > span > .anticon { + font-size: 16px; + line-height: 22px; + display: block; + width: 100%; +} +.ant-card-actions > li > span a { + color: rgba(0, 0, 0, 0.45); + line-height: 22px; + display: inline-block; + width: 100%; +} +.ant-card-actions > li > span a:hover { + color: #1890ff; +} +.ant-card-actions > li:not(:last-child) { + border-right: 1px solid #e8e8e8; +} +.ant-card-wider-padding .ant-card-head { + padding: 0 32px; +} +.ant-card-wider-padding .ant-card-body { + padding: 24px 32px; +} +.ant-card-padding-transition .ant-card-head, +.ant-card-padding-transition .ant-card-body { + -webkit-transition: padding .3s; + transition: padding .3s; +} +.ant-card-padding-transition .ant-card-extra { + -webkit-transition: right .3s; + transition: right .3s; +} +.ant-card-type-inner .ant-card-head { + padding: 0 24px; + background: #fafafa; +} +.ant-card-type-inner .ant-card-head-title { + padding: 12px 0; + font-size: 14px; +} +.ant-card-type-inner .ant-card-body { + padding: 16px 24px; +} +.ant-card-type-inner .ant-card-extra { + padding: 13.5px 0; +} +.ant-card-meta { + margin: -4px 0; + zoom: 1; +} +.ant-card-meta:before, +.ant-card-meta:after { + content: " "; + display: table; +} +.ant-card-meta:after { + clear: both; + visibility: hidden; + font-size: 0; + height: 0; +} +.ant-card-meta-avatar { + padding-right: 16px; + float: left; +} +.ant-card-meta-detail { + overflow: hidden; +} +.ant-card-meta-detail > div:not(:last-child) { + margin-bottom: 8px; +} +.ant-card-meta-title { + font-size: 16px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + color: rgba(0, 0, 0, 0.85); + font-weight: 500; +} +.ant-card-meta-description { + color: rgba(0, 0, 0, 0.45); +} +.ant-card-loading .ant-card-body { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + padding: 0; +} +.ant-card-loading-content { + padding: 24px; +} +.ant-card-loading-content p { + margin: 0; +} +.ant-card-loading-block { + display: inline-block; + margin: 5px 2% 0 0; + height: 14px; + border-radius: 2px; + background: -webkit-gradient(linear, left top, right top, from(rgba(207, 216, 220, 0.2)), color-stop(rgba(207, 216, 220, 0.4)), to(rgba(207, 216, 220, 0.2))); + background: -webkit-linear-gradient(left, rgba(207, 216, 220, 0.2), rgba(207, 216, 220, 0.4), rgba(207, 216, 220, 0.2)); + background: linear-gradient(90deg, rgba(207, 216, 220, 0.2), rgba(207, 216, 220, 0.4), rgba(207, 216, 220, 0.2)); + -webkit-animation: card-loading 1.4s ease infinite; + animation: card-loading 1.4s ease infinite; + background-size: 600% 600%; +} +@-webkit-keyframes card-loading { + 0%, + 100% { + background-position: 0 50%; + } + 50% { + background-position: 100% 50%; + } +} +@keyframes card-loading { + 0%, + 100% { + background-position: 0 50%; + } + 50% { + background-position: 100% 50%; + } +} diff --git a/es/card/style/index.js b/es/card/style/index.js new file mode 100644 index 0000000000..9c647fa70f --- /dev/null +++ b/es/card/style/index.js @@ -0,0 +1,5 @@ +import '../../style/index.less'; +import './index.less'; + +// style dependencies +import '../../tabs/style'; \ No newline at end of file diff --git a/es/card/style/index.less b/es/card/style/index.less new file mode 100644 index 0000000000..d87ab79738 --- /dev/null +++ b/es/card/style/index.less @@ -0,0 +1,257 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@card-prefix-cls: ~"@{ant-prefix}-card"; +@card-head-height: 48px; +@card-hover-border: rgba(0, 0, 0, 0.09); + +.@{card-prefix-cls} { + .reset-component; + background: @component-background; + border-radius: @border-radius-sm; + position: relative; + transition: all .3s; + + &-hoverable { + cursor: pointer; + &:hover { + box-shadow: @card-shadow; + border-color: @card-hover-border; + } + } + + &-bordered { + border: @border-width-base @border-style-base @border-color-split; + } + + &-head { + background: @card-head-background; + border-bottom: @border-width-base @border-style-base @border-color-split; + padding: 0 @card-padding-base; + border-radius: @border-radius-sm @border-radius-sm 0 0; + .clearfix; + margin-bottom: -1px; // Fix card grid overflow bug: https://gw.alipayobjects.com/zos/rmsportal/XonYxBikwpgbqIQBeuhk.png + min-height: @card-head-height; + + &-wrapper { + display: flex; + } + + &-title { + font-size: @font-size-lg; + padding: @card-head-padding 0; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + color: @card-head-color; + font-weight: 500; + display: inline-block; + flex: 1; + } + + .@{ant-prefix}-tabs { + margin-bottom: -17px; + clear: both; + + &-bar { + border-bottom: @border-width-base @border-style-base @border-color-split; + } + } + } + + &-extra { + float: right; + padding: @card-head-padding + 1.5px 0; + text-align: right; + // https://stackoverflow.com/a/22429853/3040605 + margin-left: auto; + } + + &-body { + padding: @card-padding-base; + .clearfix; + } + + &-contain-grid &-body { + margin: -1px 0 0 -1px; + padding: 0; + } + + &-grid { + border-radius: 0; + border: 0; + box-shadow: 1px 0 0 0 @border-color-split, 0 1px 0 0 @border-color-split, 1px 1px 0 0 @border-color-split, 1px 0 0 0 @border-color-split inset, 0 1px 0 0 @border-color-split inset; + width: 33.33%; + float: left; + padding: @card-padding-base; + transition: all .3s; + &:hover { + position: relative; + z-index: 1; + box-shadow: @box-shadow-base; + } + } + + &-contain-tabs &-head-title { + padding-bottom: 0; + min-height: @card-head-height - @card-head-padding; + } + + &-contain-tabs &-extra { + padding-bottom: 0; + } + + &-cover > * { + width: 100%; + display: block; + } + + &-actions { + border-top: @border-width-base @border-style-base @border-color-split; + background: @card-actions-background; + .clearfix; + list-style: none; + margin: 0; + padding: 0; + + & > li { + float: left; + text-align: center; + margin: 12px 0; + color: @text-color-secondary; + + & > span { + display: inline-block; + font-size: 14px; + cursor: pointer; + line-height: 22px; + min-width: 32px; + position: relative; + + &:hover { + color: @primary-color; + transition: color .3s; + } + + & > .anticon { + font-size: 16px; + line-height: 22px; + display: block; + width: 100%; + } + + a { + color: @text-color-secondary; + line-height: 22px; + display: inline-block; + width: 100%; + + &:hover { + color: @primary-color; + } + } + } + + &:not(:last-child) { + border-right: @border-width-base @border-style-base @border-color-split; + } + } + } + + &-wider-padding &-head { + padding: 0 @card-padding-wider; + } + + &-wider-padding &-body { + padding: @card-padding-base @card-padding-wider; + } + + &-padding-transition &-head, + &-padding-transition &-body { + transition: padding .3s; + } + + &-padding-transition &-extra { + transition: right .3s; + } + + &-type-inner &-head { + padding: 0 @card-padding-base; + background: @background-color-light; + + &-title { + padding: @card-inner-head-padding 0; + font-size: @font-size-base; + } + } + + &-type-inner &-body { + padding: 16px @card-padding-base; + } + + &-type-inner &-extra { + padding: @card-inner-head-padding + 1.5px 0; + } + + &-meta { + margin: -4px 0; + .clearfix; + + &-avatar { + padding-right: 16px; + float: left; + } + + &-detail { + overflow: hidden; + > div:not(:last-child) { + margin-bottom: 8px; + } + } + + &-title { + font-size: @font-size-lg; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + color: @card-head-color; + font-weight: 500; + } + + &-description { + color: @text-color-secondary; + } + } + + &-loading &-body { + user-select: none; + padding: 0; + } + + &-loading-content { + padding: @card-padding-base; + p { + margin: 0; + } + } + + &-loading-block { + display: inline-block; + margin: 5px 2% 0 0; + height: 14px; + border-radius: @border-radius-sm; + background: linear-gradient(90deg, rgba(207, 216, 220, .2), rgba(207, 216, 220, .4), rgba(207, 216, 220, .2)); + animation: card-loading 1.4s ease infinite; + background-size: 600% 600%; + } +} + +@keyframes card-loading { + 0%, + 100% { + background-position: 0 50%; + } + 50% { + background-position: 100% 50%; + } +} diff --git a/es/carousel/index.js b/es/carousel/index.js new file mode 100644 index 0000000000..8d06ef8f6a --- /dev/null +++ b/es/carousel/index.js @@ -0,0 +1,161 @@ +import _mergeJSXProps from 'babel-helper-vue-jsx-merge-props'; +import _extends from 'babel-runtime/helpers/extends'; +import PropTypes from '../_util/vue-types'; +import debounce from 'lodash/debounce'; +import { initDefaultProps, getComponentFromProp, filterEmpty } from '../_util/props-util'; + +// matchMedia polyfill for +// https://github.com/WickyNilliams/enquire.js/issues/82 +if (typeof window !== 'undefined') { + var matchMediaPolyfill = function matchMediaPolyfill(mediaQuery) { + return { + media: mediaQuery, + matches: false, + addListener: function addListener() {}, + removeListener: function removeListener() {} + }; + }; + window.matchMedia = window.matchMedia || matchMediaPolyfill; +} +// Use require over import (will be lifted up) +// make sure matchMedia polyfill run before require('vc-slick') +// Fix https://github.com/ant-design/ant-design/issues/6560 +// Fix https://github.com/ant-design/ant-design/issues/3308 +var SlickCarousel = require('../vc-slick/src')['default']; + +export var CarouselEffect = PropTypes.oneOf(['scrollx', 'fade']); +// Carousel +export var CarouselProps = { + effect: CarouselEffect, + dots: PropTypes.bool, + vertical: PropTypes.bool, + autoplay: PropTypes.bool, + easing: PropTypes.string, + beforeChange: PropTypes.func, + afterChange: PropTypes.func, + // style: PropTypes.React.CSSProperties, + prefixCls: PropTypes.string, + accessibility: PropTypes.bool, + nextArrow: PropTypes.any, + prevArrow: PropTypes.any, + pauseOnHover: PropTypes.bool, + // className: PropTypes.string, + adaptiveHeight: PropTypes.bool, + arrows: PropTypes.bool, + autoplaySpeed: PropTypes.number, + centerMode: PropTypes.bool, + centerPadding: PropTypes.string, + cssEase: PropTypes.string, + dotsClass: PropTypes.string, + draggable: PropTypes.bool, + fade: PropTypes.bool, + focusOnSelect: PropTypes.bool, + infinite: PropTypes.bool, + initialSlide: PropTypes.number, + lazyLoad: PropTypes.bool, + rtl: PropTypes.bool, + slide: PropTypes.string, + slidesToShow: PropTypes.number, + slidesToScroll: PropTypes.number, + speed: PropTypes.number, + swipe: PropTypes.bool, + swipeToSlide: PropTypes.bool, + touchMove: PropTypes.bool, + touchThreshold: PropTypes.number, + variableWidth: PropTypes.bool, + useCSS: PropTypes.bool, + slickGoTo: PropTypes.number +}; + +export default { + name: 'ACarousel', + props: initDefaultProps(CarouselProps, { + dots: true, + arrows: false, + prefixCls: 'ant-carousel', + draggable: false + }), + + // innerSlider: any; + + // private slick: any; + + beforeMount: function beforeMount() { + this.onWindowResized = debounce(this.onWindowResized, 500, { + leading: false + }); + }, + mounted: function mounted() { + var autoplay = this.autoplay; + + if (autoplay) { + window.addEventListener('resize', this.onWindowResized); + } + // https://github.com/ant-design/ant-design/issues/7191 + this.innerSlider = this.$refs.slick && this.$refs.slick.innerSlider; + }, + beforeDestroy: function beforeDestroy() { + var autoplay = this.autoplay; + + if (autoplay) { + window.removeEventListener('resize', this.onWindowResized); + this.onWindowResized.cancel(); + } + }, + + methods: { + onWindowResized: function onWindowResized() { + // Fix https://github.com/ant-design/ant-design/issues/2550 + var autoplay = this.autoplay; + + if (autoplay && this.$refs.slick && this.$refs.slick.innerSlider && this.$refs.slick.innerSlider.autoPlay) { + this.$refs.slick.innerSlider.autoPlay(); + } + }, + next: function next() { + this.$refs.slick.slickNext(); + }, + prev: function prev() { + this.$refs.slick.slickPrev(); + }, + goTo: function goTo(slide) { + this.$refs.slick.slickGoTo(slide); + } + }, + + render: function render() { + var h = arguments[0]; + + var props = _extends({}, this.$props); + var $slots = this.$slots, + $listeners = this.$listeners; + + + if (props.effect === 'fade') { + props.fade = true; + } + + var className = props.prefixCls; + if (props.vertical) { + className = className + ' ' + className + '-vertical'; + } + var SlickCarouselProps = { + props: _extends({}, props, { + nextArrow: getComponentFromProp(this, 'nextArrow'), + prevArrow: getComponentFromProp(this, 'prevArrow') + }), + on: $listeners, + scopedSlots: this.$scopedSlots + }; + + return h( + 'div', + { 'class': className }, + [h( + SlickCarousel, + _mergeJSXProps([{ ref: 'slick' }, SlickCarouselProps]), + [filterEmpty($slots['default'])] + )] + ); + } +}; \ No newline at end of file diff --git a/es/carousel/style/css.js b/es/carousel/style/css.js new file mode 100644 index 0000000000..579ee46c2e --- /dev/null +++ b/es/carousel/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import './index.css'; \ No newline at end of file diff --git a/es/carousel/style/index.css b/es/carousel/style/index.css new file mode 100644 index 0000000000..ac9384687c --- /dev/null +++ b/es/carousel/style/index.css @@ -0,0 +1,209 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-carousel { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; +} +.ant-carousel .slick-slider { + position: relative; + display: block; + -webkit-box-sizing: border-box; + box-sizing: border-box; + -webkit-touch-callout: none; + -ms-touch-action: pan-y; + touch-action: pan-y; + -webkit-tap-highlight-color: transparent; +} +.ant-carousel .slick-list { + position: relative; + overflow: hidden; + display: block; + margin: 0; + padding: 0; +} +.ant-carousel .slick-list:focus { + outline: none; +} +.ant-carousel .slick-list.dragging { + cursor: pointer; +} +.ant-carousel .slick-slider .slick-track, +.ant-carousel .slick-slider .slick-list { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.ant-carousel .slick-track { + position: relative; + left: 0; + top: 0; + display: block; +} +.ant-carousel .slick-track:before, +.ant-carousel .slick-track:after { + content: ""; + display: table; +} +.ant-carousel .slick-track:after { + clear: both; +} +.slick-loading .ant-carousel .slick-track { + visibility: hidden; +} +.ant-carousel .slick-slide { + float: left; + height: 100%; + min-height: 1px; + display: none; +} +[dir="rtl"] .ant-carousel .slick-slide { + float: right; +} +.ant-carousel .slick-slide img { + display: block; +} +.ant-carousel .slick-slide.slick-loading img { + display: none; +} +.ant-carousel .slick-slide.dragging img { + pointer-events: none; +} +.ant-carousel .slick-initialized .slick-slide { + display: block; +} +.ant-carousel .slick-loading .slick-slide { + visibility: hidden; +} +.ant-carousel .slick-vertical .slick-slide { + display: block; + height: auto; + border: 1px solid transparent; +} +.ant-carousel .slick-arrow.slick-hidden { + display: none; +} +.ant-carousel .slick-prev, +.ant-carousel .slick-next { + position: absolute; + display: block; + height: 20px; + width: 20px; + line-height: 0; + font-size: 0; + cursor: pointer; + background: transparent; + color: transparent; + top: 50%; + margin-top: -10px; + padding: 0; + border: 0; + outline: none; +} +.ant-carousel .slick-prev:hover, +.ant-carousel .slick-next:hover, +.ant-carousel .slick-prev:focus, +.ant-carousel .slick-next:focus { + outline: none; + background: transparent; + color: transparent; +} +.ant-carousel .slick-prev:hover:before, +.ant-carousel .slick-next:hover:before, +.ant-carousel .slick-prev:focus:before, +.ant-carousel .slick-next:focus:before { + opacity: 1; +} +.ant-carousel .slick-prev.slick-disabled:before, +.ant-carousel .slick-next.slick-disabled:before { + opacity: 0.25; +} +.ant-carousel .slick-prev { + left: -25px; +} +.ant-carousel .slick-prev:before { + content: "←"; +} +.ant-carousel .slick-next { + right: -25px; +} +.ant-carousel .slick-next:before { + content: "→"; +} +.ant-carousel .slick-dots { + position: absolute; + bottom: 12px; + list-style: none; + display: block; + text-align: center; + margin: 0; + padding: 0; + width: 100%; + height: 3px; +} +.ant-carousel .slick-dots li { + position: relative; + display: inline-block; + vertical-align: top; + text-align: center; + margin: 0 2px; + padding: 0; +} +.ant-carousel .slick-dots li button { + border: 0; + cursor: pointer; + background: #fff; + opacity: 0.3; + display: block; + width: 16px; + height: 3px; + border-radius: 1px; + outline: none; + font-size: 0; + color: transparent; + -webkit-transition: all .5s; + transition: all .5s; + padding: 0; +} +.ant-carousel .slick-dots li button:hover, +.ant-carousel .slick-dots li button:focus { + opacity: 0.75; +} +.ant-carousel .slick-dots li.slick-active button { + background: #fff; + opacity: 1; + width: 24px; +} +.ant-carousel .slick-dots li.slick-active button:hover, +.ant-carousel .slick-dots li.slick-active button:focus { + opacity: 1; +} +.ant-carousel-vertical .slick-dots { + width: 3px; + bottom: auto; + right: 12px; + top: 50%; + -webkit-transform: translateY(-50%); + -ms-transform: translateY(-50%); + transform: translateY(-50%); + height: auto; +} +.ant-carousel-vertical .slick-dots li { + margin: 0 2px; + vertical-align: baseline; +} +.ant-carousel-vertical .slick-dots li button { + width: 3px; + height: 16px; +} +.ant-carousel-vertical .slick-dots li.slick-active button { + width: 3px; + height: 24px; +} diff --git a/es/carousel/style/index.js b/es/carousel/style/index.js new file mode 100644 index 0000000000..1675ad8fe0 --- /dev/null +++ b/es/carousel/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import './index.less'; \ No newline at end of file diff --git a/es/carousel/style/index.less b/es/carousel/style/index.less new file mode 100644 index 0000000000..613f42bcb3 --- /dev/null +++ b/es/carousel/style/index.less @@ -0,0 +1,210 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +.@{ant-prefix}-carousel { + .reset-component; + + .slick-slider { + position: relative; + display: block; + box-sizing: border-box; + -webkit-touch-callout: none; + -ms-touch-action: pan-y; + touch-action: pan-y; + -webkit-tap-highlight-color: transparent; + } + .slick-list { + position: relative; + overflow: hidden; + display: block; + margin: 0; + padding: 0; + + &:focus { + outline: none; + } + + &.dragging { + cursor: pointer; + } + } + .slick-slider .slick-track, + .slick-slider .slick-list { + transform: translate3d(0, 0, 0); + } + + .slick-track { + position: relative; + left: 0; + top: 0; + display: block; + + &:before, + &:after { + content: ""; + display: table; + } + + &:after { + clear: both; + } + + .slick-loading & { + visibility: hidden; + } + } + .slick-slide { + float: left; + height: 100%; + min-height: 1px; + [dir="rtl"] & { + float: right; + } + img { + display: block; + } + &.slick-loading img { + display: none; + } + + display: none; + + &.dragging img { + pointer-events: none; + } + } + + .slick-initialized .slick-slide { + display: block; + } + + .slick-loading .slick-slide { + visibility: hidden; + } + + .slick-vertical .slick-slide { + display: block; + height: auto; + border: @border-width-base @border-style-base transparent; + } + .slick-arrow.slick-hidden { + display: none; + } + + // Arrows + .slick-prev, + .slick-next { + position: absolute; + display: block; + height: 20px; + width: 20px; + line-height: 0; + font-size: 0; + cursor: pointer; + background: transparent; + color: transparent; + top: 50%; + margin-top: -10px; + padding: 0; + border: 0; + outline: none; + &:hover, + &:focus { + outline: none; + background: transparent; + color: transparent; + &:before { + opacity: 1; + } + } + &.slick-disabled:before { + opacity: 0.25; + } + } + + .slick-prev { + left: -25px; + &:before { + content: "←"; + } + } + + .slick-next { + right: -25px; + &:before { + content: "→"; + } + } + + // Dots + .slick-dots { + position: absolute; + bottom: 12px; + list-style: none; + display: block; + text-align: center; + margin: 0; + padding: 0; + width: 100%; + height: @carousel-dot-height; + li { + position: relative; + display: inline-block; + vertical-align: top; + text-align: center; + margin: 0 2px; + padding: 0; + button { + border: 0; + cursor: pointer; + background: #fff; + opacity: 0.3; + display: block; + width: @carousel-dot-width; + height: @carousel-dot-height; + border-radius: 1px; + outline: none; + font-size: 0; + color: transparent; + transition: all .5s; + padding: 0; + &:hover, + &:focus { + opacity: 0.75; + } + } + &.slick-active button { + background: #fff; + opacity: 1; + width: @carousel-dot-active-width; + &:hover, + &:focus { + opacity: 1; + } + } + } + } +} + +.@{ant-prefix}-carousel-vertical { + .slick-dots { + width: @carousel-dot-height; + bottom: auto; + right: 12px; + top: 50%; + transform: translateY(-50%); + height: auto; + li { + margin: 0 2px; + vertical-align: baseline; + button { + width: @carousel-dot-height; + height: @carousel-dot-width; + } + &.slick-active button { + width: @carousel-dot-height; + height: @carousel-dot-active-width; + } + } + } +} diff --git a/es/cascader/index.js b/es/cascader/index.js new file mode 100644 index 0000000000..e3b5cf7afb --- /dev/null +++ b/es/cascader/index.js @@ -0,0 +1,438 @@ +import _extends from 'babel-runtime/helpers/extends'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; + +import PropTypes from '../_util/vue-types'; +import VcCascader from '../vc-cascader'; +import arrayTreeFilter from 'array-tree-filter'; +import classNames from 'classnames'; +import omit from 'omit.js'; +import KeyCode from '../_util/KeyCode'; +import Input from '../input'; +import Icon from '../icon'; +import { hasProp, filterEmpty, getOptionProps, getStyle, getClass, getAttrs } from '../_util/props-util'; +import BaseMixin from '../_util/BaseMixin'; + +var CascaderOptionType = PropTypes.shape({ + value: PropTypes.string.isRequired, + label: PropTypes.any.isRequired, + disabled: PropTypes.bool, + children: PropTypes.array, + __IS_FILTERED_OPTION: PropTypes.bool +}).loose; + +var CascaderExpandTrigger = PropTypes.oneOf(['click', 'hover']); + +var ShowSearchType = PropTypes.shape({ + filter: PropTypes.func, + render: PropTypes.func, + sort: PropTypes.func, + matchInputWidth: PropTypes.bool +}).loose; +function noop() {} + +var CascaderProps = { + /** 可选项数据源 */ + options: PropTypes.arrayOf(CascaderOptionType).def([]), + /** 默认的选中项 */ + defaultValue: PropTypes.arrayOf(PropTypes.string), + /** 指定选中项 */ + value: PropTypes.arrayOf(PropTypes.string), + /** 选择完成后的回调 */ + // onChange?: (value: string[], selectedOptions?: CascaderOptionType[]) => void; + /** 选择后展示的渲染函数 */ + displayRender: PropTypes.func, + transitionName: PropTypes.string.def('slide-up'), + popupStyle: PropTypes.object.def({}), + /** 自定义浮层类名 */ + popupClassName: PropTypes.string, + /** 浮层预设位置:`bottomLeft` `bottomRight` `topLeft` `topRight` */ + popupPlacement: PropTypes.oneOf(['bottomLeft', 'bottomRight', 'topLeft', 'topRight']).def('bottomLeft'), + /** 输入框占位文本*/ + placeholder: PropTypes.string.def('Please select'), + /** 输入框大小,可选 `large` `default` `small` */ + size: PropTypes.oneOf(['large', 'default', 'small']), + /** 禁用*/ + disabled: PropTypes.bool.def(false), + /** 是否支持清除*/ + allowClear: PropTypes.bool.def(true), + showSearch: PropTypes.oneOfType([Boolean, ShowSearchType]), + notFoundContent: PropTypes.any.def('Not Found'), + loadData: PropTypes.func, + /** 次级菜单的展开方式,可选 'click' 和 'hover' */ + expandTrigger: CascaderExpandTrigger, + /** 当此项为 true 时,点选每级菜单选项值都会发生变化 */ + changeOnSelect: PropTypes.bool, + /** 浮层可见变化时回调 */ + // onPopupVisibleChange?: (popupVisible: boolean) => void; + prefixCls: PropTypes.string.def('ant-cascader'), + inputPrefixCls: PropTypes.string.def('ant-input'), + getPopupContainer: PropTypes.func, + popupVisible: PropTypes.bool, + autoFocus: PropTypes.bool +}; + +function defaultFilterOption(inputValue, path) { + return path.some(function (option) { + return option.label.indexOf(inputValue) > -1; + }); +} + +function defaultSortFilteredOption(a, b, inputValue) { + function callback(elem) { + return elem.label.indexOf(inputValue) > -1; + } + + return a.findIndex(callback) - b.findIndex(callback); +} + +var defaultDisplayRender = function defaultDisplayRender(_ref) { + var labels = _ref.labels; + return labels.join(' / '); +}; + +export default { + inheritAttrs: false, + name: 'ACascader', + mixins: [BaseMixin], + props: CascaderProps, + model: { + prop: 'value', + event: 'change' + }, + data: function data() { + this.cachedOptions = []; + var value = this.value, + defaultValue = this.defaultValue, + popupVisible = this.popupVisible, + showSearch = this.showSearch, + options = this.options, + changeOnSelect = this.changeOnSelect, + flattenTree = this.flattenTree; + + return { + sValue: value || defaultValue || [], + inputValue: '', + inputFocused: false, + sPopupVisible: popupVisible, + flattenOptions: showSearch && flattenTree(options, changeOnSelect) + }; + }, + mounted: function mounted() { + var _this = this; + + this.$nextTick(function () { + if (_this.autoFocus && !_this.showSearch && !_this.disabled) { + _this.$refs.picker.focus(); + } + }); + }, + + watch: { + value: function value(val) { + this.setState({ sValue: val || [] }); + }, + popupVisible: function popupVisible(val) { + this.setState({ sPopupVisible: val }); + }, + options: function options(val) { + if (this.showSearch) { + this.setState({ flattenOptions: this.flattenTree(this.options, this.changeOnSelect) }); + } + } + }, + methods: { + highlightKeyword: function highlightKeyword(str, keyword, prefixCls) { + var h = this.$createElement; + + return str.split(keyword).map(function (node, index) { + return index === 0 ? node : [h( + 'span', + { 'class': prefixCls + '-menu-item-keyword' }, + [keyword] + ), node]; + }); + }, + defaultRenderFilteredOption: function defaultRenderFilteredOption(_ref2) { + var _this2 = this; + + var inputValue = _ref2.inputValue, + path = _ref2.path, + prefixCls = _ref2.prefixCls; + + return path.map(function (_ref3, index) { + var label = _ref3.label; + + var node = label.indexOf(inputValue) > -1 ? _this2.highlightKeyword(label, inputValue, prefixCls) : label; + return index === 0 ? node : [' / ', node]; + }); + }, + handleChange: function handleChange(value, selectedOptions) { + this.setState({ inputValue: '' }); + if (selectedOptions[0].__IS_FILTERED_OPTION) { + var unwrappedValue = value[0]; + var unwrappedSelectedOptions = selectedOptions[0].path; + this.setValue(unwrappedValue, unwrappedSelectedOptions); + return; + } + this.setValue(value, selectedOptions); + }, + handlePopupVisibleChange: function handlePopupVisibleChange(popupVisible) { + if (!hasProp(this, 'popupVisible')) { + this.setState({ + sPopupVisible: popupVisible, + inputFocused: popupVisible, + inputValue: popupVisible ? this.inputValue : '' + }); + } + this.$emit('popupVisibleChange', popupVisible); + }, + handleInputFocus: function handleInputFocus(e) { + this.$emit('focus', e); + }, + handleInputBlur: function handleInputBlur(e) { + this.setState({ + inputFocused: false + }); + this.$emit('blur', e); + }, + handleInputClick: function handleInputClick(e) { + var inputFocused = this.inputFocused, + sPopupVisible = this.sPopupVisible; + // Prevent `Trigger` behaviour. + + if (inputFocused || sPopupVisible) { + e.stopPropagation(); + e.nativeEvent && e.nativeEvent.stopImmediatePropagation(); + } + }, + handleKeyDown: function handleKeyDown(e) { + if (e.keyCode === KeyCode.BACKSPACE) { + e.stopPropagation(); + } + }, + handleInputChange: function handleInputChange(e) { + var inputValue = e.target.value; + this.setState({ inputValue: inputValue }); + }, + setValue: function setValue(value, selectedOptions) { + if (!hasProp(this, 'value')) { + this.setState({ sValue: value }); + } + this.$emit('change', value, selectedOptions); + }, + getLabel: function getLabel() { + var options = this.options, + $scopedSlots = this.$scopedSlots; + + var displayRender = this.displayRender || $scopedSlots.displayRender || defaultDisplayRender; + var value = this.sValue; + var unwrappedValue = Array.isArray(value[0]) ? value[0] : value; + var selectedOptions = arrayTreeFilter(options, function (o, level) { + return o.value === unwrappedValue[level]; + }); + var labels = selectedOptions.map(function (o) { + return o.label; + }); + return displayRender({ labels: labels, selectedOptions: selectedOptions }); + }, + clearSelection: function clearSelection(e) { + e.preventDefault(); + e.stopPropagation(); + if (!this.inputValue) { + this.setValue([]); + this.handlePopupVisibleChange(false); + } else { + this.setState({ inputValue: '' }); + } + }, + flattenTree: function flattenTree(options, changeOnSelect) { + var _this3 = this; + + var ancestor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + + var flattenOptions = []; + options.forEach(function (option) { + var path = ancestor.concat(option); + if (changeOnSelect || !option.children || !option.children.length) { + flattenOptions.push(path); + } + if (option.children) { + flattenOptions = flattenOptions.concat(_this3.flattenTree(option.children, changeOnSelect, path)); + } + }); + return flattenOptions; + }, + generateFilteredOptions: function generateFilteredOptions(prefixCls) { + var showSearch = this.showSearch, + notFoundContent = this.notFoundContent, + flattenOptions = this.flattenOptions, + inputValue = this.inputValue, + $scopedSlots = this.$scopedSlots; + var _showSearch$filter = showSearch.filter, + filter = _showSearch$filter === undefined ? defaultFilterOption : _showSearch$filter, + _showSearch$sort = showSearch.sort, + sort = _showSearch$sort === undefined ? defaultSortFilteredOption : _showSearch$sort; + + var render = showSearch.render || $scopedSlots.showSearchRender || this.defaultRenderFilteredOption; + var filtered = flattenOptions.filter(function (path) { + return filter(inputValue, path); + }).sort(function (a, b) { + return sort(a, b, inputValue); + }); + + if (filtered.length > 0) { + return filtered.map(function (path) { + return { + __IS_FILTERED_OPTION: true, + path: path, + label: render({ inputValue: inputValue, path: path, prefixCls: prefixCls }), + value: path.map(function (o) { + return o.value; + }), + disabled: path.some(function (o) { + return o.disabled; + }) + }; + }); + } + return [{ label: notFoundContent, value: 'ANT_CASCADER_NOT_FOUND', disabled: true }]; + }, + focus: function focus() { + if (this.showSearch) { + this.$refs.input.focus(); + } else { + this.$refs.picker.focus(); + } + }, + blur: function blur() { + if (this.showSearch) { + this.$refs.input.blur(); + } else { + this.$refs.picker.blur(); + } + } + }, + + render: function render() { + var _classNames, _classNames2, _classNames3; + + var h = arguments[0]; + var $slots = this.$slots, + value = this.sValue, + sPopupVisible = this.sPopupVisible, + inputValue = this.inputValue, + $listeners = this.$listeners; + + var props = getOptionProps(this); + + var prefixCls = props.prefixCls, + inputPrefixCls = props.inputPrefixCls, + placeholder = props.placeholder, + size = props.size, + disabled = props.disabled, + allowClear = props.allowClear, + _props$showSearch = props.showSearch, + showSearch = _props$showSearch === undefined ? false : _props$showSearch, + otherProps = _objectWithoutProperties(props, ['prefixCls', 'inputPrefixCls', 'placeholder', 'size', 'disabled', 'allowClear', 'showSearch']); + + var sizeCls = classNames((_classNames = {}, _defineProperty(_classNames, inputPrefixCls + '-lg', size === 'large'), _defineProperty(_classNames, inputPrefixCls + '-sm', size === 'small'), _classNames)); + var clearIcon = allowClear && !disabled && value.length > 0 || inputValue ? h(Icon, { + attrs: { + type: 'cross-circle' + }, + 'class': prefixCls + '-picker-clear', + on: { + 'click': this.clearSelection + }, + + key: 'clear-icon' + }) : null; + var arrowCls = classNames((_classNames2 = {}, _defineProperty(_classNames2, prefixCls + '-picker-arrow', true), _defineProperty(_classNames2, prefixCls + '-picker-arrow-expand', sPopupVisible), _classNames2)); + var pickerCls = classNames(getClass(this), prefixCls + '-picker', (_classNames3 = {}, _defineProperty(_classNames3, prefixCls + '-picker-with-value', inputValue), _defineProperty(_classNames3, prefixCls + '-picker-disabled', disabled), _defineProperty(_classNames3, prefixCls + '-picker-' + size, !!size), _classNames3)); + + // Fix bug of https://github.com/facebook/react/pull/5004 + // and https://fb.me/react-unknown-prop + var tempInputProps = omit(otherProps, ['options', 'popupPlacement', 'transitionName', 'displayRender', 'changeOnSelect', 'expandTrigger', 'popupVisible', 'getPopupContainer', 'loadData', 'popupClassName', 'filterOption', 'renderFilteredOption', 'sortFilteredOption', 'notFoundContent', 'defaultValue']); + + var options = this.options; + if (inputValue) { + options = this.generateFilteredOptions(prefixCls); + } + // Dropdown menu should keep previous status until it is fully closed. + if (!sPopupVisible) { + options = this.cachedOptions; + } else { + this.cachedOptions = options; + } + + var dropdownMenuColumnStyle = {}; + var isNotFound = (options || []).length === 1 && options[0].value === 'ANT_CASCADER_NOT_FOUND'; + if (isNotFound) { + dropdownMenuColumnStyle.height = 'auto'; // Height of one row. + } + // The default value of `matchInputWidth` is `true` + var resultListMatchInputWidth = showSearch.matchInputWidth !== false; + if (resultListMatchInputWidth && inputValue && this.input) { + dropdownMenuColumnStyle.width = this.input.input.offsetWidth; + } + // showSearch时,focus、blur在input上触发,反之在ref='picker'上触发 + var inputProps = { + props: _extends({}, tempInputProps, { + prefixCls: inputPrefixCls, + placeholder: value && value.length > 0 ? undefined : placeholder, + value: inputValue, + disabled: disabled, + readOnly: !showSearch, + autoComplete: 'off' + }), + 'class': prefixCls + '-input ' + sizeCls, + ref: 'input', + on: { + focus: showSearch ? this.handleInputFocus : noop, + click: showSearch ? this.handleInputClick : noop, + blur: showSearch ? this.handleInputBlur : noop, + keydown: this.handleKeyDown, + change: showSearch ? this.handleInputChange : noop + }, + attrs: getAttrs(this) + }; + var children = filterEmpty($slots['default']); + var input = children.length ? children : h( + 'span', + { + 'class': pickerCls, + style: getStyle(this), + ref: 'picker' + }, + [showSearch ? h( + 'span', + { 'class': prefixCls + '-picker-label' }, + [this.getLabel()] + ) : null, h(Input, inputProps), !showSearch ? h( + 'span', + { 'class': prefixCls + '-picker-label' }, + [this.getLabel()] + ) : null, clearIcon, h(Icon, { + attrs: { type: 'down' }, + key: 'down-icon', 'class': arrowCls })] + ); + var cascaderProps = { + props: _extends({}, props, { + options: options, + value: value, + popupVisible: sPopupVisible, + dropdownMenuColumnStyle: dropdownMenuColumnStyle + }), + on: _extends({}, $listeners, { + popupVisibleChange: this.handlePopupVisibleChange, + change: this.handleChange + }) + }; + return h( + VcCascader, + cascaderProps, + [input] + ); + } +}; \ No newline at end of file diff --git a/es/cascader/style/css.js b/es/cascader/style/css.js new file mode 100644 index 0000000000..b5d9b8dc7c --- /dev/null +++ b/es/cascader/style/css.js @@ -0,0 +1,5 @@ +import '../../style/index.css'; +import './index.css'; + +// style dependencies +import '../../input/style/css'; \ No newline at end of file diff --git a/es/cascader/style/index.css b/es/cascader/style/index.css new file mode 100644 index 0000000000..b9061c96b2 --- /dev/null +++ b/es/cascader/style/index.css @@ -0,0 +1,236 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-cascader { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; +} +.ant-cascader-input.ant-input { + background-color: transparent !important; + cursor: pointer; + width: 100%; + display: block; +} +.ant-cascader-picker { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + position: relative; + display: inline-block; + cursor: pointer; + background-color: #fff; + border-radius: 4px; + outline: 0; +} +.ant-cascader-picker-with-value .ant-cascader-picker-label { + color: transparent; +} +.ant-cascader-picker-disabled { + cursor: not-allowed; + background: #f5f5f5; + color: rgba(0, 0, 0, 0.25); +} +.ant-cascader-picker-disabled .ant-cascader-input { + cursor: not-allowed; +} +.ant-cascader-picker:focus .ant-cascader-input { + border-color: #40a9ff; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); + box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); +} +.ant-cascader-picker-label { + position: absolute; + left: 0; + height: 20px; + line-height: 20px; + top: 50%; + margin-top: -10px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + width: 100%; + padding: 0 12px; +} +.ant-cascader-picker-clear { + opacity: 0; + position: absolute; + right: 12px; + z-index: 2; + background: #fff; + top: 50%; + font-size: 12px; + color: rgba(0, 0, 0, 0.25); + width: 12px; + height: 12px; + margin-top: -6px; + line-height: 12px; + cursor: pointer; + -webkit-transition: color 0.3s ease, opacity 0.15s ease; + transition: color 0.3s ease, opacity 0.15s ease; +} +.ant-cascader-picker-clear:hover { + color: rgba(0, 0, 0, 0.45); +} +.ant-cascader-picker:hover .ant-cascader-picker-clear { + opacity: 1; +} +.ant-cascader-picker-arrow { + position: absolute; + z-index: 1; + top: 50%; + right: 12px; + width: 12px; + height: 12px; + font-size: 12px; + margin-top: -6px; + line-height: 12px; + color: rgba(0, 0, 0, 0.25); +} +.ant-cascader-picker-arrow:before { + -webkit-transition: -webkit-transform .2s; + transition: -webkit-transform .2s; + transition: transform .2s; + transition: transform .2s, -webkit-transform .2s; +} +.ant-cascader-picker-arrow.ant-cascader-picker-arrow-expand:before { + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} +.ant-cascader-picker-small .ant-cascader-picker-clear, +.ant-cascader-picker-small .ant-cascader-picker-arrow { + right: 8px; +} +.ant-cascader-menus { + font-size: 14px; + background: #fff; + position: absolute; + z-index: 1050; + border-radius: 4px; + -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); + white-space: nowrap; +} +.ant-cascader-menus ul, +.ant-cascader-menus ol { + list-style: none; + margin: 0; + padding: 0; +} +.ant-cascader-menus-empty, +.ant-cascader-menus-hidden { + display: none; +} +.ant-cascader-menus.slide-up-enter.slide-up-enter-active.ant-cascader-menus-placement-bottomLeft, +.ant-cascader-menus.slide-up-appear.slide-up-appear-active.ant-cascader-menus-placement-bottomLeft { + -webkit-animation-name: antSlideUpIn; + animation-name: antSlideUpIn; +} +.ant-cascader-menus.slide-up-enter.slide-up-enter-active.ant-cascader-menus-placement-topLeft, +.ant-cascader-menus.slide-up-appear.slide-up-appear-active.ant-cascader-menus-placement-topLeft { + -webkit-animation-name: antSlideDownIn; + animation-name: antSlideDownIn; +} +.ant-cascader-menus.slide-up-leave.slide-up-leave-active.ant-cascader-menus-placement-bottomLeft { + -webkit-animation-name: antSlideUpOut; + animation-name: antSlideUpOut; +} +.ant-cascader-menus.slide-up-leave.slide-up-leave-active.ant-cascader-menus-placement-topLeft { + -webkit-animation-name: antSlideDownOut; + animation-name: antSlideDownOut; +} +.ant-cascader-menu { + display: inline-block; + vertical-align: top; + min-width: 111px; + height: 180px; + list-style: none; + margin: 0; + padding: 0; + border-right: 1px solid #e8e8e8; + overflow: auto; +} +.ant-cascader-menu:first-child { + border-radius: 4px 0 0 4px; +} +.ant-cascader-menu:last-child { + border-right-color: transparent; + margin-right: -1px; + border-radius: 0 4px 4px 0; +} +.ant-cascader-menu:only-child { + border-radius: 4px; +} +.ant-cascader-menu-item { + padding: 5px 12px; + line-height: 22px; + cursor: pointer; + white-space: nowrap; + -webkit-transition: all 0.3s; + transition: all 0.3s; +} +.ant-cascader-menu-item:hover { + background: #e6f7ff; +} +.ant-cascader-menu-item-disabled { + cursor: not-allowed; + color: rgba(0, 0, 0, 0.25); +} +.ant-cascader-menu-item-disabled:hover { + background: transparent; +} +.ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled), +.ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled):hover { + background: #f5f5f5; + font-weight: 600; +} +.ant-cascader-menu-item-expand { + position: relative; + padding-right: 24px; +} +.ant-cascader-menu-item-expand:after { + font-family: 'anticon'; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + content: "\e61f"; + display: inline-block; + font-size: 12px; + font-size: 8px \9; + -webkit-transform: scale(0.66666667) rotate(0deg); + -ms-transform: scale(0.66666667) rotate(0deg); + transform: scale(0.66666667) rotate(0deg); + color: rgba(0, 0, 0, 0.45); + position: absolute; + right: 12px; +} +:root .ant-cascader-menu-item-expand:after { + font-size: 12px; +} +.ant-cascader-menu-item-loading:after { + font-family: 'anticon'; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + content: "\e64d"; + -webkit-animation: loadingCircle 1s infinite linear; + animation: loadingCircle 1s infinite linear; +} +.ant-cascader-menu-item .ant-cascader-menu-item-keyword { + color: #f5222d; +} diff --git a/es/cascader/style/index.js b/es/cascader/style/index.js new file mode 100644 index 0000000000..f99cbbb33f --- /dev/null +++ b/es/cascader/style/index.js @@ -0,0 +1,5 @@ +import '../../style/index.less'; +import './index.less'; + +// style dependencies +import '../../input/style'; \ No newline at end of file diff --git a/es/cascader/style/index.less b/es/cascader/style/index.less new file mode 100644 index 0000000000..f3d3b6ca38 --- /dev/null +++ b/es/cascader/style/index.less @@ -0,0 +1,214 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; +@import "../../input/style/mixin"; + +@cascader-prefix-cls: ~"@{ant-prefix}-cascader"; + +.@{cascader-prefix-cls} { + .reset-component; + + &-input.@{ant-prefix}-input { + // Add important to fix https://github.com/ant-design/ant-design/issues/5078 + // because input.less will compile after cascader.less + background-color: transparent !important; + cursor: pointer; + width: 100%; + display: block; + } + + &-picker { + .reset-component; + position: relative; + display: inline-block; + cursor: pointer; + background-color: @component-background; + border-radius: @border-radius-base; + outline: 0; + + &-with-value &-label { + color: transparent; + } + + &-disabled { + cursor: not-allowed; + background: @input-disabled-bg; + color: @disabled-color; + .@{cascader-prefix-cls}-input { + cursor: not-allowed; + } + } + + &:focus .@{cascader-prefix-cls}-input { + .active; + } + + &-label { + position: absolute; + left: 0; + height: 20px; + line-height: 20px; + top: 50%; + margin-top: -10px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + width: 100%; + padding: 0 @control-padding-horizontal; + } + + &-clear { + opacity: 0; + position: absolute; + right: @control-padding-horizontal; + z-index: 2; + background: @component-background; + top: 50%; + font-size: @font-size-sm; + color: @disabled-color; + width: 12px; + height: 12px; + margin-top: -6px; + line-height: 12px; + cursor: pointer; + transition: color 0.3s ease, opacity 0.15s ease; + &:hover { + color: @text-color-secondary; + } + } + + &:hover &-clear { + opacity: 1; + } + + // arrow + &-arrow { + position: absolute; + z-index: 1; + top: 50%; + right: @control-padding-horizontal; + width: 12px; + height: 12px; + font-size: 12px; + margin-top: -6px; + line-height: 12px; + color: @disabled-color; + &:before { + transition: transform .2s; + } + &&-expand { + &:before { + transform: rotate(180deg); + } + } + } + } + + &-picker-small &-picker-clear, + &-picker-small &-picker-arrow { + right: @control-padding-horizontal-sm; + } + + &-menus { + font-size: @font-size-base; + background: @component-background; + position: absolute; + z-index: @zindex-dropdown; + border-radius: @border-radius-base; + box-shadow: @box-shadow-base; + white-space: nowrap; + + ul, + ol { + list-style: none; + margin: 0; + padding: 0; + } + + &-empty, + &-hidden { + display: none; + } + &.slide-up-enter.slide-up-enter-active&-placement-bottomLeft, + &.slide-up-appear.slide-up-appear-active&-placement-bottomLeft { + animation-name: antSlideUpIn; + } + + &.slide-up-enter.slide-up-enter-active&-placement-topLeft, + &.slide-up-appear.slide-up-appear-active&-placement-topLeft { + animation-name: antSlideDownIn; + } + + &.slide-up-leave.slide-up-leave-active&-placement-bottomLeft { + animation-name: antSlideUpOut; + } + + &.slide-up-leave.slide-up-leave-active&-placement-topLeft { + animation-name: antSlideDownOut; + } + } + &-menu { + display: inline-block; + vertical-align: top; + min-width: 111px; + height: 180px; + list-style: none; + margin: 0; + padding: 0; + border-right: @border-width-base @border-style-base @border-color-split; + overflow: auto; + &:first-child { + border-radius: @border-radius-base 0 0 @border-radius-base; + } + &:last-child { + border-right-color: transparent; + margin-right: -1px; + border-radius: 0 @border-radius-base @border-radius-base 0; + } + &:only-child { + border-radius: @border-radius-base; + } + } + &-menu-item { + padding: 5px @control-padding-horizontal; + line-height: 22px; + cursor: pointer; + white-space: nowrap; + transition: all 0.3s; + &:hover { + background: @item-hover-bg; + } + &-disabled { + cursor: not-allowed; + color: @disabled-color; + &:hover { + background: transparent; + } + } + &-active:not(&-disabled) { + &, + &:hover { + background: @background-color-base; + font-weight: 600; + } + } + &-expand { + position: relative; + padding-right: 24px; + &:after { + .iconfont-font("\e61f"); + .iconfont-size-under-12px(8px); + color: @text-color-secondary; + position: absolute; + right: @control-padding-horizontal; + } + } + &-loading:after { + .iconfont-font("\e64d"); + animation: loadingCircle 1s infinite linear; + } + + & &-keyword { + color: @highlight-color; + } + } +} diff --git a/es/checkbox/Checkbox.js b/es/checkbox/Checkbox.js new file mode 100644 index 0000000000..b703f4c113 --- /dev/null +++ b/es/checkbox/Checkbox.js @@ -0,0 +1,176 @@ +import _extends from 'babel-runtime/helpers/extends'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import classNames from 'classnames'; +import hasProp, { getClass, getStyle } from '../_util/props-util'; +import PropTypes from '../_util/vue-types'; +export default { + inheritAttrs: false, + name: 'ACheckbox', + props: { + prefixCls: { + 'default': 'ant-checkbox', + type: String + }, + defaultChecked: PropTypes.bool, + checked: PropTypes.bool, + disabled: PropTypes.bool, + isGroup: Boolean, + value: [String, Number, Boolean], + name: String, + id: String, + indeterminate: Boolean, + type: PropTypes.string.def('checkbox'), + autoFocus: Boolean + }, + model: { + prop: 'checked' + }, + inject: { + checkboxGroupContext: { 'default': null } + }, + mounted: function mounted() { + var _this = this; + + this.$nextTick(function () { + if (_this.autoFocus) { + _this.$refs.input.focus(); + } + }); + }, + data: function data() { + var checkboxGroupContext = this.checkboxGroupContext, + checked = this.checked, + defaultChecked = this.defaultChecked, + value = this.value; + + var sChecked = void 0; + if (checkboxGroupContext) { + sChecked = checkboxGroupContext.sValue.indexOf(value) !== -1; + } else { + sChecked = !hasProp(this, 'checked') ? defaultChecked : checked; + } + return { + sChecked: sChecked + }; + }, + + computed: { + checkboxClass: function checkboxClass() { + var _ref; + + var prefixCls = this.prefixCls, + indeterminate = this.indeterminate, + sChecked = this.sChecked, + $props = this.$props, + checkboxGroupContext = this.checkboxGroupContext; + + var disabled = $props.disabled; + if (checkboxGroupContext) { + disabled = disabled || checkboxGroupContext.disabled; + } + return _ref = {}, _defineProperty(_ref, '' + prefixCls, true), _defineProperty(_ref, prefixCls + '-checked', sChecked), _defineProperty(_ref, prefixCls + '-disabled', disabled), _defineProperty(_ref, prefixCls + '-indeterminate', indeterminate), _ref; + } + }, + methods: { + handleChange: function handleChange(event) { + var targetChecked = event.target.checked; + this.$emit('input', targetChecked); + var checked = this.checked, + checkboxGroupContext = this.checkboxGroupContext; + + if (checked === undefined && !checkboxGroupContext || checkboxGroupContext && checkboxGroupContext.sValue === undefined) { + this.sChecked = targetChecked; + } + var target = _extends({}, this.$props, { + checked: targetChecked + }); + this.$emit('change', { + target: target, + stopPropagation: function stopPropagation() { + event.stopPropagation(); + }, + preventDefault: function preventDefault() { + event.preventDefault(); + } + }); + }, + onMouseEnter: function onMouseEnter(e) { + this.$emit('mouseenter', e); + }, + onMouseLeave: function onMouseLeave(e) { + this.$emit('mouseleave', e); + }, + focus: function focus() { + this.$refs.input.focus(); + }, + blur: function blur() { + this.$refs.input.blur(); + }, + onFocus: function onFocus(e) { + this.$emit('focus', e); + }, + onBlur: function onBlur(e) { + this.$emit('blur', e); + } + }, + watch: { + checked: function checked(val) { + this.sChecked = val; + }, + + 'checkboxGroupContext.sValue': function checkboxGroupContextSValue(val) { + this.sChecked = val.indexOf(this.value) !== -1; + } + }, + render: function render() { + var h = arguments[0]; + var props = this.$props, + checkboxGroupContext = this.checkboxGroupContext, + checkboxClass = this.checkboxClass, + name = this.name, + $slots = this.$slots, + sChecked = this.sChecked, + onFocus = this.onFocus, + onBlur = this.onBlur, + id = this.id; + var prefixCls = props.prefixCls; + + var disabled = props.disabled; + var onChange = this.handleChange; + if (checkboxGroupContext) { + onChange = function onChange() { + return checkboxGroupContext.toggleOption({ value: props.value }); + }; + disabled = props.disabled || checkboxGroupContext.disabled; + } + var classString = classNames(getClass(this), _defineProperty({}, prefixCls + '-wrapper', true)); + return h( + 'label', + { + 'class': classString, + style: getStyle(this), + on: { + 'mouseenter': this.onMouseEnter, + 'mouseleave': this.onMouseLeave + } + }, + [h( + 'span', + { 'class': checkboxClass }, + [h('input', { + attrs: { name: name, type: 'checkbox', disabled: disabled, + id: id + }, + 'class': prefixCls + '-input', domProps: { + 'checked': sChecked + }, + on: { + 'change': onChange, + 'focus': onFocus, + 'blur': onBlur + }, + ref: 'input' }), h('span', { 'class': prefixCls + '-inner' })] + ), $slots['default'] ? h('span', [$slots['default']]) : null] + ); + } +}; \ No newline at end of file diff --git a/es/checkbox/Group.js b/es/checkbox/Group.js new file mode 100644 index 0000000000..6d35ed4daf --- /dev/null +++ b/es/checkbox/Group.js @@ -0,0 +1,142 @@ +import _toConsumableArray from 'babel-runtime/helpers/toConsumableArray'; + +import Checkbox from './Checkbox'; +import hasProp from '../_util/props-util'; +export default { + name: 'ACheckboxGroup', + props: { + prefixCls: { + 'default': 'ant-checkbox-group', + type: String + }, + defaultValue: { + 'default': function _default() { + return []; + }, + type: Array + }, + value: { + 'default': undefined, + type: Array + }, + options: { + 'default': function _default() { + return []; + }, + type: Array + }, + disabled: Boolean + }, + model: { + prop: 'value' + }, + provide: function provide() { + return { + checkboxGroupContext: this + }; + }, + data: function data() { + var value = this.value, + defaultValue = this.defaultValue; + + return { + sValue: value || defaultValue + }; + }, + + methods: { + handleChange: function handleChange(event) { + var target = event.target; + var targetValue = target.value, + checked = target.checked; + var sValue = this.sValue; + + var newVal = []; + if (checked) { + newVal = [].concat(_toConsumableArray(sValue), [targetValue]); + } else { + newVal = [].concat(_toConsumableArray(sValue)); + var index = newVal.indexOf(targetValue); + index >= 0 && newVal.splice(index, 1); + } + newVal = [].concat(_toConsumableArray(new Set(newVal))); + if (!hasProp(this, 'value')) { + this.sValue = newVal; + } + this.$emit('input', newVal); + this.$emit('change', newVal); + }, + getOptions: function getOptions() { + var options = this.$props.options; + + return options.map(function (option) { + if (typeof option === 'string') { + return { + label: option, + value: option + }; + } + return option; + }); + }, + toggleOption: function toggleOption(option) { + var optionIndex = this.sValue.indexOf(option.value); + var value = [].concat(_toConsumableArray(this.sValue)); + if (optionIndex === -1) { + value.push(option.value); + } else { + value.splice(optionIndex, 1); + } + if (!hasProp(this, 'value')) { + this.sValue = value; + } + this.$emit('input', value); + this.$emit('change', value); + } + }, + render: function render() { + var _this = this; + + var h = arguments[0]; + var props = this.$props, + state = this.$data, + $slots = this.$slots; + var prefixCls = props.prefixCls, + options = props.options; + + var children = $slots['default']; + if (options && options.length > 0) { + children = this.getOptions().map(function (option) { + return h( + Checkbox, + { + key: option.value, + attrs: { disabled: 'disabled' in option ? option.disabled : props.disabled, + value: option.value, + checked: state.sValue.indexOf(option.value) !== -1 + }, + on: { + 'change': function change() { + return _this.toggleOption(option); + } + }, + + 'class': prefixCls + '-item' + }, + [option.label] + ); + }); + } + return h( + 'div', + { 'class': prefixCls }, + [children] + ); + }, + + watch: { + value: function value(val) { + this.sValue = val; + } + } +}; \ No newline at end of file diff --git a/es/checkbox/index.js b/es/checkbox/index.js new file mode 100644 index 0000000000..74118b331b --- /dev/null +++ b/es/checkbox/index.js @@ -0,0 +1,5 @@ +import Checkbox from './Checkbox'; +import CheckboxGroup from './Group'; + +Checkbox.Group = CheckboxGroup; +export default Checkbox; \ No newline at end of file diff --git a/es/checkbox/style/css.js b/es/checkbox/style/css.js new file mode 100644 index 0000000000..579ee46c2e --- /dev/null +++ b/es/checkbox/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import './index.css'; \ No newline at end of file diff --git a/es/checkbox/style/index.css b/es/checkbox/style/index.css new file mode 100644 index 0000000000..fb45b40019 --- /dev/null +++ b/es/checkbox/style/index.css @@ -0,0 +1,213 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +@-webkit-keyframes antCheckboxEffect { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 0.5; + } + 100% { + -webkit-transform: scale(1.6); + transform: scale(1.6); + opacity: 0; + } +} +@keyframes antCheckboxEffect { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 0.5; + } + 100% { + -webkit-transform: scale(1.6); + transform: scale(1.6); + opacity: 0; + } +} +.ant-checkbox { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + white-space: nowrap; + cursor: pointer; + outline: none; + display: inline-block; + line-height: 1; + position: relative; + vertical-align: middle; + top: -0.09em; +} +.ant-checkbox-wrapper:hover .ant-checkbox-inner, +.ant-checkbox:hover .ant-checkbox-inner, +.ant-checkbox-input:focus + .ant-checkbox-inner { + border-color: #1890ff; +} +.ant-checkbox-checked:after { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: 2px; + border: 1px solid #1890ff; + content: ''; + -webkit-animation: antCheckboxEffect 0.36s ease-in-out; + animation: antCheckboxEffect 0.36s ease-in-out; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + visibility: hidden; +} +.ant-checkbox:hover:after, +.ant-checkbox-wrapper:hover .ant-checkbox:after { + visibility: visible; +} +.ant-checkbox-inner { + position: relative; + top: 0; + left: 0; + display: block; + width: 16px; + height: 16px; + border: 1px solid #d9d9d9; + border-radius: 2px; + background-color: #fff; + -webkit-transition: all .3s; + transition: all .3s; +} +.ant-checkbox-inner:after { + -webkit-transform: rotate(45deg) scale(0); + -ms-transform: rotate(45deg) scale(0); + transform: rotate(45deg) scale(0); + position: absolute; + left: 4.57142857px; + top: 1.14285714px; + display: table; + width: 5.71428571px; + height: 9.14285714px; + border: 2px solid #fff; + border-top: 0; + border-left: 0; + content: ' '; + -webkit-transition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6); + transition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6); +} +.ant-checkbox-input { + position: absolute; + left: 0; + z-index: 1; + cursor: pointer; + opacity: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%; + height: 100%; +} +.ant-checkbox-indeterminate .ant-checkbox-inner:after { + content: ' '; + -webkit-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); + position: absolute; + left: 2.42857143px; + top: 5.92857143px; + width: 9.14285714px; + height: 1.14285714px; +} +.ant-checkbox-indeterminate.ant-checkbox-disabled .ant-checkbox-inner:after { + border-color: rgba(0, 0, 0, 0.25); +} +.ant-checkbox-checked .ant-checkbox-inner:after { + -webkit-transform: rotate(45deg) scale(1); + -ms-transform: rotate(45deg) scale(1); + transform: rotate(45deg) scale(1); + position: absolute; + display: table; + border: 2px solid #fff; + border-top: 0; + border-left: 0; + content: ' '; + -webkit-transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s; + transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s; +} +.ant-checkbox-checked .ant-checkbox-inner, +.ant-checkbox-indeterminate .ant-checkbox-inner { + background-color: #1890ff; + border-color: #1890ff; +} +.ant-checkbox-disabled { + cursor: not-allowed; +} +.ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner:after { + -webkit-animation-name: none; + animation-name: none; + border-color: rgba(0, 0, 0, 0.25); +} +.ant-checkbox-disabled .ant-checkbox-input { + cursor: not-allowed; +} +.ant-checkbox-disabled .ant-checkbox-inner { + border-color: #d9d9d9 !important; + background-color: #f5f5f5; +} +.ant-checkbox-disabled .ant-checkbox-inner:after { + -webkit-animation-name: none; + animation-name: none; + border-color: #f5f5f5; +} +.ant-checkbox-disabled + span { + color: rgba(0, 0, 0, 0.25); + cursor: not-allowed; +} +.ant-checkbox-wrapper { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + line-height: unset; + cursor: pointer; + display: inline-block; +} +.ant-checkbox-wrapper + .ant-checkbox-wrapper { + margin-left: 8px; +} +.ant-checkbox-wrapper + span, +.ant-checkbox + span { + padding-left: 8px; + padding-right: 8px; +} +.ant-checkbox-group { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + display: inline-block; +} +.ant-checkbox-group-item { + display: inline-block; + margin-right: 8px; +} +.ant-checkbox-group-item:last-child { + margin-right: 0; +} +.ant-checkbox-group-item + .ant-checkbox-group-item { + margin-left: 0; +} diff --git a/es/checkbox/style/index.js b/es/checkbox/style/index.js new file mode 100644 index 0000000000..1675ad8fe0 --- /dev/null +++ b/es/checkbox/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import './index.less'; \ No newline at end of file diff --git a/es/checkbox/style/index.less b/es/checkbox/style/index.less new file mode 100644 index 0000000000..fa88d365aa --- /dev/null +++ b/es/checkbox/style/index.less @@ -0,0 +1,4 @@ +@import "../../style/themes/default"; +@import "./mixin"; + +.antCheckboxFn(); diff --git a/es/checkbox/style/mixin.less b/es/checkbox/style/mixin.less new file mode 100644 index 0000000000..2851d2b68c --- /dev/null +++ b/es/checkbox/style/mixin.less @@ -0,0 +1,193 @@ +@import "../../style/mixins/index"; + +.antCheckboxFn(@checkbox-prefix-cls: ~"@{ant-prefix}-checkbox") { + @checkbox-inner-prefix-cls: ~"@{checkbox-prefix-cls}-inner"; + // 一般状态 + .@{checkbox-prefix-cls} { + .reset-component; + white-space: nowrap; + cursor: pointer; + outline: none; + display: inline-block; + line-height: 1; + position: relative; + vertical-align: middle; + top: -0.09em; + + .@{checkbox-prefix-cls}-wrapper:hover &-inner, + &:hover &-inner, + &-input:focus + &-inner { + border-color: @primary-color; + } + + &-checked:after { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: @border-radius-sm; + border: 1px solid @primary-color; + content: ''; + animation: antCheckboxEffect 0.36s ease-in-out; + animation-fill-mode: both; + visibility: hidden; + } + + &:hover:after, + .@{checkbox-prefix-cls}-wrapper:hover &:after { + visibility: visible; + } + + &-inner { + position: relative; + top: 0; + left: 0; + display: block; + width: @checkbox-size; + height: @checkbox-size; + border: @border-width-base @border-style-base @border-color-base; + border-radius: @border-radius-sm; + background-color: #fff; + transition: all .3s; + + &:after { + @check-width: (@checkbox-size / 14) * 5px; + @check-height: (@checkbox-size / 14) * 8px; + transform: rotate(45deg) scale(0); + position: absolute; + left: (@checkbox-size - @check-width) / 2 - 0.5px * (@checkbox-size / 14); + top: (@checkbox-size - @check-height) / 2 - 2px * (@checkbox-size / 14); + display: table; + width: @check-width; + height: @check-height; + border: 2px solid #fff; + border-top: 0; + border-left: 0; + content: ' '; + transition: all .1s @ease-in-back; + } + } + + &-input { + position: absolute; + left: 0; + z-index: 1; + cursor: pointer; + opacity: 0; + top: 0; + bottom: 0; + right: 0; + width: 100%; + height: 100%; + } + } + + // 半选状态 + .@{checkbox-prefix-cls}-indeterminate .@{checkbox-inner-prefix-cls}:after { + @indeterminate-width: (@checkbox-size / 14) * 8px; + @indeterminate-height: (@checkbox-size / 14) * 1px; + content: ' '; + transform: scale(1); + position: absolute; + left: (@checkbox-size - 2 - @indeterminate-width) / 2; + top: (@checkbox-size - 3 - @indeterminate-height) / 2; + width: @indeterminate-width; + height: @indeterminate-height; + } + + .@{checkbox-prefix-cls}-indeterminate.@{checkbox-prefix-cls}-disabled .@{checkbox-inner-prefix-cls}:after { + border-color: @disabled-color; + } + + // 选中状态 + .@{checkbox-prefix-cls}-checked .@{checkbox-inner-prefix-cls}:after { + transform: rotate(45deg) scale(1); + position: absolute; + display: table; + border: 2px solid #fff; + border-top: 0; + border-left: 0; + content: ' '; + transition: all .2s @ease-out-back .1s; + } + + .@{checkbox-prefix-cls}-checked, + .@{checkbox-prefix-cls}-indeterminate { + .@{checkbox-inner-prefix-cls} { + background-color: @primary-color; + border-color: @primary-color; + } + } + + .@{checkbox-prefix-cls}-disabled { + cursor: not-allowed; + + &.@{checkbox-prefix-cls}-checked { + .@{checkbox-inner-prefix-cls}:after { + animation-name: none; + border-color: @disabled-color; + } + } + + .@{checkbox-prefix-cls}-input { + cursor: not-allowed; + } + + .@{checkbox-inner-prefix-cls} { + border-color: @border-color-base !important; + background-color: @input-disabled-bg; + &:after { + animation-name: none; + border-color: @input-disabled-bg; + } + } + + & + span { + color: @disabled-color; + cursor: not-allowed; + } + } + + .@{checkbox-prefix-cls}-wrapper { + .reset-component; + line-height: unset; + cursor: pointer; + display: inline-block; + & + & { + margin-left: 8px; + } + } + + .@{checkbox-prefix-cls}-wrapper + span, + .@{checkbox-prefix-cls} + span { + padding-left: 8px; + padding-right: 8px; + } + + .@{checkbox-prefix-cls}-group { + .reset-component; + display: inline-block; + &-item { + display: inline-block; + margin-right: 8px; + &:last-child { + margin-right: 0; + } + } + &-item + &-item { + margin-left: 0; + } + } +} + +@keyframes antCheckboxEffect { + 0% { + transform: scale(1); + opacity: 0.5; + } + 100% { + transform: scale(1.6); + opacity: 0; + } +} diff --git a/es/col/index.js b/es/col/index.js new file mode 100644 index 0000000000..4f221e80d7 --- /dev/null +++ b/es/col/index.js @@ -0,0 +1,3 @@ +import { Col } from '../grid'; + +export default Col; \ No newline at end of file diff --git a/es/col/style/css.js b/es/col/style/css.js new file mode 100644 index 0000000000..f67c62c53e --- /dev/null +++ b/es/col/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import '../../grid/style/index.css'; \ No newline at end of file diff --git a/es/col/style/index.js b/es/col/style/index.js new file mode 100644 index 0000000000..f767ce1b5c --- /dev/null +++ b/es/col/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import '../../grid/style/index.less'; \ No newline at end of file diff --git a/es/collapse/Collapse.js b/es/collapse/Collapse.js new file mode 100644 index 0000000000..b73eb72371 --- /dev/null +++ b/es/collapse/Collapse.js @@ -0,0 +1,40 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _extends from 'babel-runtime/helpers/extends'; + +import PropTypes from '../_util/vue-types'; +import animation from '../_util/openAnimation'; +import { getOptionProps } from '../_util/props-util'; +import RcCollapse from './src'; +import { collapseProps } from './src/commonProps'; + +export default { + name: 'ACollapse', + model: { + prop: 'activeKey', + event: 'change' + }, + props: _extends({}, collapseProps, { + bordered: PropTypes.bool.def(true), + openAnimation: PropTypes.any.def(animation), + change: PropTypes.func.def(function () {}), + accordion: PropTypes.bool + }), + render: function render() { + var h = arguments[0]; + var prefixCls = this.prefixCls, + bordered = this.bordered, + $listeners = this.$listeners; + + var collapseClassName = _defineProperty({}, prefixCls + '-borderless', !bordered); + var rcCollapeProps = { + props: _extends({}, getOptionProps(this)), + 'class': collapseClassName, + on: $listeners + }; + return h( + RcCollapse, + rcCollapeProps, + [this.$slots['default']] + ); + } +}; \ No newline at end of file diff --git a/es/collapse/CollapsePanel.js b/es/collapse/CollapsePanel.js new file mode 100644 index 0000000000..3b9681e0a8 --- /dev/null +++ b/es/collapse/CollapsePanel.js @@ -0,0 +1,41 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _extends from 'babel-runtime/helpers/extends'; + +import PropTypes from '../_util/vue-types'; +import { getOptionProps } from '../_util/props-util'; +import RcCollapse from './src'; +import { panelProps } from './src/commonProps'; + +export default { + name: 'ACollapsePanel', + props: _extends({ + name: PropTypes.string + }, panelProps), + render: function render() { + var h = arguments[0]; + var prefixCls = this.prefixCls, + _showArrow = this.showArrow, + showArrow = _showArrow === undefined ? true : _showArrow, + $listeners = this.$listeners; + + var collapsePanelClassName = _defineProperty({}, prefixCls + '-no-arrow', !showArrow); + var rcCollapePanelProps = { + props: _extends({}, getOptionProps(this)), + 'class': collapsePanelClassName, + on: $listeners + }; + var _$slots = this.$slots, + defaultSlots = _$slots['default'], + header = _$slots.header; + + return h( + RcCollapse.Panel, + rcCollapePanelProps, + [defaultSlots, header ? h( + 'template', + { slot: 'header' }, + [header] + ) : null] + ); + } +}; \ No newline at end of file diff --git a/es/collapse/index.js b/es/collapse/index.js new file mode 100644 index 0000000000..b75d98497c --- /dev/null +++ b/es/collapse/index.js @@ -0,0 +1,5 @@ +import Collapse from './Collapse'; +import CollapsePanel from './CollapsePanel'; + +Collapse.Panel = CollapsePanel; +export default Collapse; \ No newline at end of file diff --git a/es/collapse/src/Collapse.js b/es/collapse/src/Collapse.js new file mode 100644 index 0000000000..dbc20b03e2 --- /dev/null +++ b/es/collapse/src/Collapse.js @@ -0,0 +1,145 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _toConsumableArray from 'babel-runtime/helpers/toConsumableArray'; +import _extends from 'babel-runtime/helpers/extends'; + +import PropTypes from '../../_util/vue-types'; +import BaseMixin from '../../_util/BaseMixin'; +import { hasProp, getPropsData, isEmptyElement } from '../../_util/props-util'; +import { cloneElement } from '../../_util/vnode'; +import openAnimationFactory from './openAnimationFactory'; +import { collapseProps } from './commonProps'; + +function _toArray(activeKey) { + var currentActiveKey = activeKey; + if (!Array.isArray(currentActiveKey)) { + currentActiveKey = currentActiveKey ? [currentActiveKey] : []; + } + return currentActiveKey; +} + +export default { + name: 'Collapse', + mixins: [BaseMixin], + model: { + prop: 'activeKey', + event: 'change' + }, + props: _extends({}, collapseProps, { + openAnimation: PropTypes.object + }), + data: function data() { + var _$props = this.$props, + activeKey = _$props.activeKey, + defaultActiveKey = _$props.defaultActiveKey, + openAnimation = _$props.openAnimation, + prefixCls = _$props.prefixCls; + + var currentActiveKey = defaultActiveKey; + if (hasProp(this, 'activeKey')) { + currentActiveKey = activeKey; + } + var currentOpenAnimations = openAnimation || openAnimationFactory(prefixCls); + return { + currentOpenAnimations: currentOpenAnimations, + stateActiveKey: _toArray(currentActiveKey) + }; + }, + + methods: { + onClickItem: function onClickItem(key) { + var activeKey = this.stateActiveKey; + if (this.accordion) { + activeKey = activeKey[0] === key ? [] : [key]; + } else { + activeKey = [].concat(_toConsumableArray(activeKey)); + var index = activeKey.indexOf(key); + var isActive = index > -1; + if (isActive) { + // remove active state + activeKey.splice(index, 1); + } else { + activeKey.push(key); + } + } + this.setActiveKey(activeKey); + }, + getItems: function getItems() { + var _this = this; + + var activeKey = this.stateActiveKey; + var _$props2 = this.$props, + prefixCls = _$props2.prefixCls, + accordion = _$props2.accordion, + destroyInactivePanel = _$props2.destroyInactivePanel; + + var newChildren = []; + this.$slots['default'].forEach(function (child, index) { + if (isEmptyElement(child)) return; + + var _getPropsData = getPropsData(child), + header = _getPropsData.header, + headerClass = _getPropsData.headerClass, + disabled = _getPropsData.disabled; + + var isActive = false; + var key = child.key || String(index); + if (accordion) { + isActive = activeKey[0] === key; + } else { + isActive = activeKey.indexOf(key) > -1; + } + + var panelEvents = {}; + if (!disabled && disabled !== '') { + panelEvents = { + itemClick: function itemClick() { + _this.onClickItem(key); + } + }; + } + + var props = { + props: { + header: header, + headerClass: headerClass, + isActive: isActive, + prefixCls: prefixCls, + destroyInactivePanel: destroyInactivePanel, + openAnimation: _this.currentOpenAnimations + }, + on: _extends({}, panelEvents) + }; + + newChildren.push(cloneElement(child, props)); + }); + return newChildren; + }, + setActiveKey: function setActiveKey(activeKey) { + this.setState({ stateActiveKey: activeKey }); + this.$emit('change', this.accordion ? activeKey[0] : activeKey); + } + }, + watch: { + activeKey: function activeKey(val) { + this.setState({ + stateActiveKey: _toArray(val) + }); + }, + openAnimation: function openAnimation(val) { + this.setState({ + currentOpenAnimations: val + }); + } + }, + render: function render() { + var h = arguments[0]; + var prefixCls = this.$props.prefixCls; + + var collapseClassName = _defineProperty({}, prefixCls, true); + return h( + 'div', + { 'class': collapseClassName }, + [this.getItems()] + ); + } +}; \ No newline at end of file diff --git a/es/collapse/src/Panel.js b/es/collapse/src/Panel.js new file mode 100644 index 0000000000..90ba6975cd --- /dev/null +++ b/es/collapse/src/Panel.js @@ -0,0 +1,79 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _extends from 'babel-runtime/helpers/extends'; + +import PanelContent from './PanelContent'; +import { panelProps } from './commonProps'; + +export default { + name: 'Panel', + props: _extends({}, panelProps), + methods: { + handleItemClick: function handleItemClick() { + this.$emit('itemClick'); + } + }, + render: function render() { + var _headerCls, _itemCls; + + var h = arguments[0]; + var _$props = this.$props, + prefixCls = _$props.prefixCls, + header = _$props.header, + headerClass = _$props.headerClass, + isActive = _$props.isActive, + showArrow = _$props.showArrow, + destroyInactivePanel = _$props.destroyInactivePanel, + disabled = _$props.disabled, + openAnimation = _$props.openAnimation; + var $slots = this.$slots; + + + var transitionProps = { + props: _extends({ + appear: true, + css: false + }), + on: _extends({}, openAnimation) + }; + var headerCls = (_headerCls = {}, _defineProperty(_headerCls, prefixCls + '-header', true), _defineProperty(_headerCls, headerClass, headerClass), _headerCls); + var headerCon = header || $slots.header; + var itemCls = (_itemCls = {}, _defineProperty(_itemCls, prefixCls + '-item', true), _defineProperty(_itemCls, prefixCls + '-item-active', isActive), _defineProperty(_itemCls, prefixCls + '-item-disabled', disabled), _itemCls); + return h( + 'div', + { 'class': itemCls, attrs: { role: 'tablist' } + }, + [h( + 'div', + { + 'class': headerCls, + on: { + 'click': this.handleItemClick.bind(this) + }, + attrs: { + role: 'tab', + 'aria-expanded': isActive + } + }, + [showArrow && h('i', { 'class': 'arrow' }), headerCon] + ), h( + 'transition', + transitionProps, + [h( + PanelContent, + { + directives: [{ + name: 'show', + value: isActive + }], + attrs: { + prefixCls: prefixCls, + isActive: isActive, + destroyInactivePanel: destroyInactivePanel + } + }, + [$slots['default']] + )] + )] + ); + } +}; \ No newline at end of file diff --git a/es/collapse/src/PanelContent.js b/es/collapse/src/PanelContent.js new file mode 100644 index 0000000000..2f9b1257a4 --- /dev/null +++ b/es/collapse/src/PanelContent.js @@ -0,0 +1,48 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; + +import PropTypes from '../../_util/vue-types'; + +export default { + name: 'PanelContent', + props: { + prefixCls: PropTypes.string, + isActive: PropTypes.bool, + destroyInactivePanel: PropTypes.bool + }, + data: function data() { + return { + _isActive: undefined + }; + }, + render: function render() { + var _contentCls; + + var h = arguments[0]; + + this._isActive = this._isActive || this.isActive; + if (!this._isActive) { + return null; + } + var _$props = this.$props, + prefixCls = _$props.prefixCls, + isActive = _$props.isActive, + destroyInactivePanel = _$props.destroyInactivePanel; + var $slots = this.$slots; + + var contentCls = (_contentCls = {}, _defineProperty(_contentCls, prefixCls + '-content', true), _defineProperty(_contentCls, prefixCls + '-content-active', isActive), _contentCls); + var child = !isActive && destroyInactivePanel ? null : h( + 'div', + { 'class': prefixCls + '-content-box' }, + [$slots['default']] + ); + return h( + 'div', + { + 'class': contentCls, + attrs: { role: 'tabpanel' + } + }, + [child] + ); + } +}; \ No newline at end of file diff --git a/es/collapse/src/commonProps.js b/es/collapse/src/commonProps.js new file mode 100644 index 0000000000..4100715742 --- /dev/null +++ b/es/collapse/src/commonProps.js @@ -0,0 +1,22 @@ +import PropTypes from '../../_util/vue-types'; + +var collapseProps = { + prefixCls: PropTypes.string.def('ant-collapse'), + activeKey: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), + defaultActiveKey: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), + accordion: PropTypes.bool.def(false), + destroyInactivePanel: PropTypes.bool.def(false) +}; + +var panelProps = { + openAnimation: PropTypes.object, + prefixCls: PropTypes.string.def('ant-collapse'), + header: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.node]), + headerClass: PropTypes.string.def(''), + showArrow: PropTypes.bool.def(true), + isActive: PropTypes.bool.def(false), + destroyInactivePanel: PropTypes.bool.def(false), + disabled: PropTypes.bool.def(false) +}; + +export { collapseProps, panelProps }; \ No newline at end of file diff --git a/es/collapse/src/index.js b/es/collapse/src/index.js new file mode 100644 index 0000000000..3597eb5397 --- /dev/null +++ b/es/collapse/src/index.js @@ -0,0 +1,6 @@ +import CollapsePanel from './Panel'; +import Collapse from './Collapse'; + +Collapse.Panel = CollapsePanel; + +export default Collapse; \ No newline at end of file diff --git a/es/collapse/src/openAnimationFactory.js b/es/collapse/src/openAnimationFactory.js new file mode 100644 index 0000000000..dc0289ae89 --- /dev/null +++ b/es/collapse/src/openAnimationFactory.js @@ -0,0 +1,35 @@ +import cssAnimation from '../../_util/css-animation'; + +function animate(node, show, transitionName, done) { + var height = void 0; + return cssAnimation(node, transitionName, { + start: function start() { + if (!show) { + node.style.height = node.offsetHeight + 'px'; + } else { + height = node.offsetHeight; + node.style.height = 0; + } + }, + active: function active() { + node.style.height = (show ? height : 0) + 'px'; + }, + end: function end() { + node.style.height = ''; + done(); + } + }); +} + +function animation(prefixCls) { + return { + enter: function enter(node, done) { + return animate(node, true, prefixCls + '-anim', done); + }, + leave: function leave(node, done) { + return animate(node, false, prefixCls + '-anim', done); + } + }; +} + +export default animation; \ No newline at end of file diff --git a/es/collapse/style/css.js b/es/collapse/style/css.js new file mode 100644 index 0000000000..579ee46c2e --- /dev/null +++ b/es/collapse/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import './index.css'; \ No newline at end of file diff --git a/es/collapse/style/index.css b/es/collapse/style/index.css new file mode 100644 index 0000000000..5f9d5ad672 --- /dev/null +++ b/es/collapse/style/index.css @@ -0,0 +1,118 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-collapse { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + background-color: #fafafa; + border-radius: 4px; + border: 1px solid #d9d9d9; + border-bottom: 0; +} +.ant-collapse > .ant-collapse-item { + border-bottom: 1px solid #d9d9d9; +} +.ant-collapse > .ant-collapse-item:last-child, +.ant-collapse > .ant-collapse-item:last-child > .ant-collapse-header { + border-radius: 0 0 4px 4px; +} +.ant-collapse > .ant-collapse-item > .ant-collapse-header { + line-height: 22px; + padding: 12px 0 12px 40px; + color: rgba(0, 0, 0, 0.85); + cursor: pointer; + position: relative; + -webkit-transition: all .3s; + transition: all .3s; +} +.ant-collapse > .ant-collapse-item > .ant-collapse-header .arrow { + font-style: normal; + vertical-align: baseline; + text-align: center; + text-transform: none; + line-height: 1; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-transform: rotate(0); + -ms-transform: rotate(0); + transform: rotate(0); + font-size: 12px; + position: absolute; + display: inline-block; + line-height: 46px; + vertical-align: top; + -webkit-transition: -webkit-transform 0.24s; + transition: -webkit-transform 0.24s; + transition: transform 0.24s; + transition: transform 0.24s, -webkit-transform 0.24s; + top: 0; + left: 16px; +} +.ant-collapse > .ant-collapse-item > .ant-collapse-header .arrow:before { + display: block; + font-family: "anticon" !important; +} +.ant-collapse > .ant-collapse-item > .ant-collapse-header .arrow:before { + content: "\E61F"; +} +.ant-collapse > .ant-collapse-item.ant-collapse-no-arrow > .ant-collapse-header { + padding-left: 12px; +} +.ant-collapse-anim-active { + -webkit-transition: height 0.2s cubic-bezier(0.215, 0.61, 0.355, 1); + transition: height 0.2s cubic-bezier(0.215, 0.61, 0.355, 1); +} +.ant-collapse-content { + overflow: hidden; + color: rgba(0, 0, 0, 0.65); + padding: 0 16px; + background-color: #fff; + border-top: 1px solid #d9d9d9; +} +.ant-collapse-content > .ant-collapse-content-box { + padding-top: 16px; + padding-bottom: 16px; +} +.ant-collapse-content-inactive { + display: none; +} +.ant-collapse-item:last-child > .ant-collapse-content { + border-radius: 0 0 4px 4px; +} +.ant-collapse > .ant-collapse-item > .ant-collapse-header[aria-expanded="true"] .arrow { + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); +} +.ant-collapse-borderless { + background-color: #fff; + border: 0; +} +.ant-collapse-borderless > .ant-collapse-item { + border-bottom: 1px solid #d9d9d9; +} +.ant-collapse-borderless > .ant-collapse-item:last-child, +.ant-collapse-borderless > .ant-collapse-item:last-child .ant-collapse-header { + border-radius: 0; +} +.ant-collapse-borderless > .ant-collapse-item > .ant-collapse-content { + background-color: transparent; + border-top: 0; +} +.ant-collapse-borderless > .ant-collapse-item > .ant-collapse-content > .ant-collapse-content-box { + padding-top: 4px; +} +.ant-collapse .ant-collapse-item-disabled > .ant-collapse-header, +.ant-collapse .ant-collapse-item-disabled > .ant-collapse-header > .arrow { + cursor: not-allowed; + color: rgba(0, 0, 0, 0.25); +} diff --git a/es/collapse/style/index.js b/es/collapse/style/index.js new file mode 100644 index 0000000000..1675ad8fe0 --- /dev/null +++ b/es/collapse/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import './index.less'; \ No newline at end of file diff --git a/es/collapse/style/index.less b/es/collapse/style/index.less new file mode 100644 index 0000000000..39e59f1d8a --- /dev/null +++ b/es/collapse/style/index.less @@ -0,0 +1,128 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@collapse-prefix-cls: ~"@{ant-prefix}-collapse"; + +@collapse-header-bg: @background-color-light; +@collapse-active-bg: @background-color-base; + +.collapse-close() { + transform: rotate(0); +} +.collapse-open() { + transform: rotate(90deg); +} + +.@{collapse-prefix-cls} { + .reset-component; + background-color: @collapse-header-bg; + border-radius: @border-radius-base; + border: @border-width-base @border-style-base @border-color-base; + border-bottom: 0; + + & > &-item { + border-bottom: @border-width-base @border-style-base @border-color-base; + + &:last-child { + &, + & > .@{collapse-prefix-cls}-header { + border-radius: 0 0 @border-radius-base @border-radius-base; + } + } + + > .@{collapse-prefix-cls}-header { + line-height: 22px; + padding: 12px 0 12px 40px; + color: @heading-color; + cursor: pointer; + position: relative; + transition: all .3s; + + .arrow { + .iconfont-mixin(); + .collapse-close(); + font-size: @font-size-sm; + position: absolute; + display: inline-block; + line-height: 46px; + vertical-align: top; + transition: transform 0.24s; + top: 0; + left: @padding-md; + &:before { + content: "\E61F"; + } + } + } + + &.@{collapse-prefix-cls}-no-arrow { + > .@{collapse-prefix-cls}-header { + padding-left: 12px; + } + } + } + + &-anim-active { + transition: height .2s @ease-out; + } + + &-content { + overflow: hidden; + color: @text-color; + padding: 0 @padding-md; + background-color: @component-background; + border-top: @border-width-base @border-style-base @border-color-base; + + & > &-box { + padding-top: @padding-md; + padding-bottom: @padding-md; + } + + &-inactive { + display: none; + } + } + + &-item:last-child { + > .@{collapse-prefix-cls}-content { + border-radius: 0 0 @border-radius-base @border-radius-base; + } + } + + & > &-item > &-header[aria-expanded="true"] { + .arrow { + .collapse-open(); + } + } + + &-borderless { + background-color: @component-background; + border: 0; + } + + &-borderless > &-item { + border-bottom: 1px solid @border-color-base; + } + + &-borderless > &-item:last-child, + &-borderless > &-item:last-child &-header { + border-radius: 0; + } + + &-borderless > &-item > &-content { + background-color: transparent; + border-top: 0; + } + + &-borderless > &-item > &-content > &-content-box { + padding-top: 4px; + } + + & &-item-disabled > &-header { + &, + & > .arrow { + cursor: not-allowed; + color: @disabled-color; + } + } +} diff --git a/es/date-picker/RangePicker.js b/es/date-picker/RangePicker.js new file mode 100644 index 0000000000..5b8f178918 --- /dev/null +++ b/es/date-picker/RangePicker.js @@ -0,0 +1,409 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _slicedToArray from 'babel-runtime/helpers/slicedToArray'; + +import * as moment from 'moment'; +import RangeCalendar from '../vc-calendar/src/RangeCalendar'; +import VcDatePicker from '../vc-calendar/src/Picker'; +import classNames from 'classnames'; +import Icon from '../icon'; +import interopDefault from '../_util/interopDefault'; +import { RangePickerProps } from './interface'; +import { hasProp, getOptionProps, initDefaultProps, mergeProps } from '../_util/props-util'; +import BaseMixin from '../_util/BaseMixin'; +function noop() {} +function getShowDateFromValue(value) { + var _value = _slicedToArray(value, 2), + start = _value[0], + end = _value[1]; + // value could be an empty array, then we should not reset showDate + + + if (!start && !end) { + return; + } + var newEnd = end && end.isSame(start, 'month') ? end.clone().add(1, 'month') : end; + return [start, newEnd]; +} + +function formatValue(value, format) { + return value && value.format(format) || ''; +} + +function pickerValueAdapter(value) { + if (!value) { + return; + } + if (Array.isArray(value)) { + return value; + } + return [value, value.clone().add(1, 'month')]; +} + +function isEmptyArray(arr) { + if (Array.isArray(arr)) { + return arr.length === 0 || arr.every(function (i) { + return !i; + }); + } + return false; +} + +function fixLocale(value, localeCode) { + if (!localeCode) { + return; + } + if (!value || value.length === 0) { + return; + } + if (value[0]) { + value[0].locale(localeCode); + } + if (value[1]) { + value[1].locale(localeCode); + } +} + +export default { + mixins: [BaseMixin], + name: 'ARangePicker', + props: initDefaultProps(RangePickerProps(), { + prefixCls: 'ant-calendar', + allowClear: true, + showToday: false + }), + model: { + prop: 'value', + event: 'change' + }, + data: function data() { + var value = this.value || this.defaultValue || []; + if (value[0] && !interopDefault(moment).isMoment(value[0]) || value[1] && !interopDefault(moment).isMoment(value[1])) { + throw new Error('The value/defaultValue of RangePicker must be a moment object array after `antd@2.0`, ' + 'see: https://u.ant.design/date-picker-value'); + } + var pickerValue = !value || isEmptyArray(value) ? this.defaultPickerValue : value; + return { + sValue: value, + sShowDate: pickerValueAdapter(pickerValue || interopDefault(moment)()), + sOpen: this.open, + sHoverValue: [] + }; + }, + + watch: { + value: function value(val) { + var value = val || []; + this.setState({ + sValue: value, + sShowDate: getShowDateFromValue(value) || this.sShowDate + }); + }, + open: function open(val) { + this.setState({ + sOpen: val + }); + } + }, + methods: { + clearSelection: function clearSelection(e) { + e.preventDefault(); + e.stopPropagation(); + this.setState({ sValue: [] }); + this.handleChange([]); + }, + clearHoverValue: function clearHoverValue() { + this.setState({ sHoverValue: [] }); + }, + handleChange: function handleChange(value) { + if (!hasProp(this, 'value')) { + this.setState(function (_ref) { + var sShowDate = _ref.sShowDate; + return { + sValue: value, + sShowDate: getShowDateFromValue(value) || sShowDate + }; + }); + } + this.$emit('change', value, [formatValue(value[0], this.format), formatValue(value[1], this.format)]); + }, + handleOpenChange: function handleOpenChange(open) { + if (!hasProp(this, 'open')) { + this.setState({ sOpen: open }); + } + + if (open === false) { + this.clearHoverValue(); + } + this.$emit('openChange', open); + }, + handleShowDateChange: function handleShowDateChange(showDate) { + this.setState({ sShowDate: showDate }); + }, + handleHoverChange: function handleHoverChange(hoverValue) { + this.setState({ sHoverValue: hoverValue }); + }, + handleRangeMouseLeave: function handleRangeMouseLeave() { + if (this.sOpen) { + this.clearHoverValue(); + } + }, + handleCalendarInputSelect: function handleCalendarInputSelect(value) { + if (!value[0]) { + return; + } + this.setState(function (_ref2) { + var sShowDate = _ref2.sShowDate; + return { + sValue: value, + sShowDate: getShowDateFromValue(value) || sShowDate + }; + }); + }, + handleRangeClick: function handleRangeClick(value) { + if (typeof value === 'function') { + value = value(); + } + + this.setValue(value, true); + this.$emit('ok', value); + }, + setValue: function setValue(value, hidePanel) { + this.handleChange(value); + if ((hidePanel || !this.showTime) && !hasProp(this, 'open')) { + this.setState({ sOpen: false }); + } + }, + focus: function focus() { + this.$refs.picker.focus(); + }, + blur: function blur() { + this.$refs.picker.blur(); + }, + renderFooter: function renderFooter() { + var _this = this; + + var h = this.$createElement; + var prefixCls = this.prefixCls, + ranges = this.ranges, + $scopedSlots = this.$scopedSlots, + $slots = this.$slots; + + var renderExtraFooter = this.renderExtraFooter || $scopedSlots.renderExtraFooter || $slots.renderExtraFooter; + if (!ranges && !renderExtraFooter) { + return null; + } + var customFooter = renderExtraFooter ? h( + 'div', + { 'class': prefixCls + '-footer-extra', key: 'extra' }, + [typeof renderExtraFooter === 'function' ? renderExtraFooter.apply(undefined, arguments) : renderExtraFooter] + ) : null; + var operations = Object.keys(ranges || {}).map(function (range) { + var value = ranges[range]; + return h( + 'a', + { + key: range, + on: { + 'click': function click() { + return _this.handleRangeClick(value); + }, + 'mouseenter': function mouseenter() { + return _this.setState({ sHoverValue: value }); + }, + 'mouseleave': _this.handleRangeMouseLeave + } + }, + [range] + ); + }); + var rangeNode = h( + 'div', + { 'class': prefixCls + '-footer-extra ' + prefixCls + '-range-quick-selector', key: 'range' }, + [operations] + ); + return [rangeNode, customFooter]; + } + }, + + render: function render() { + var _classNames, + _this2 = this; + + var h = arguments[0]; + + var props = getOptionProps(this); + var value = this.sValue, + showDate = this.sShowDate, + hoverValue = this.sHoverValue, + open = this.sOpen, + $listeners = this.$listeners, + $scopedSlots = this.$scopedSlots; + var _$listeners$calendarC = $listeners.calendarChange, + calendarChange = _$listeners$calendarC === undefined ? noop : _$listeners$calendarC, + _$listeners$ok = $listeners.ok, + ok = _$listeners$ok === undefined ? noop : _$listeners$ok, + _$listeners$focus = $listeners.focus, + focus = _$listeners$focus === undefined ? noop : _$listeners$focus, + _$listeners$blur = $listeners.blur, + blur = _$listeners$blur === undefined ? noop : _$listeners$blur, + _$listeners$panelChan = $listeners.panelChange, + panelChange = _$listeners$panelChan === undefined ? noop : _$listeners$panelChan; + var prefixCls = props.prefixCls, + popupStyle = props.popupStyle, + disabledDate = props.disabledDate, + disabledTime = props.disabledTime, + showTime = props.showTime, + showToday = props.showToday, + ranges = props.ranges, + locale = props.locale, + localeCode = props.localeCode, + format = props.format; + + var dateRender = props.dateRender || $scopedSlots.dateRender; + fixLocale(value, localeCode); + fixLocale(showDate, localeCode); + + var calendarClassName = classNames((_classNames = {}, _defineProperty(_classNames, prefixCls + '-time', showTime), _defineProperty(_classNames, prefixCls + '-range-with-ranges', ranges), _classNames)); + + // 需要选择时间时,点击 ok 时才触发 onChange + var pickerChangeHandler = { + on: { + change: this.handleChange + } + }; + var calendarProps = { + on: { + ok: this.handleChange + }, props: {} + }; + if (props.timePicker) { + pickerChangeHandler.on.change = function (changedValue) { + return _this2.handleChange(changedValue); + }; + } else { + calendarProps = { on: {}, props: {} }; + } + if ('mode' in props) { + calendarProps.props.mode = props.mode; + } + + var startPlaceholder = 'placeholder' in props ? props.placeholder[0] : locale.lang.rangePlaceholder[0]; + var endPlaceholder = 'placeholder' in props ? props.placeholder[1] : locale.lang.rangePlaceholder[1]; + var rangeCalendarProps = mergeProps(calendarProps, { + props: { + format: format, + prefixCls: prefixCls, + renderFooter: this.renderFooter, + timePicker: props.timePicker, + disabledDate: disabledDate, + disabledTime: disabledTime, + dateInputPlaceholder: [startPlaceholder, endPlaceholder], + locale: locale.lang, + dateRender: dateRender, + value: showDate, + hoverValue: hoverValue, + showToday: showToday + }, + on: { + change: calendarChange, + ok: ok, + valueChange: this.handleShowDateChange, + hoverChange: this.handleHoverChange, + panelChange: panelChange, + inputSelect: this.handleCalendarInputSelect + }, + 'class': calendarClassName, + scopedSlots: $scopedSlots + }); + var calendar = h(RangeCalendar, rangeCalendarProps); + + // default width for showTime + var pickerStyle = {}; + if (props.showTime) { + pickerStyle.width = '350px'; + } + + var clearIcon = !props.disabled && props.allowClear && value && (value[0] || value[1]) ? h(Icon, { + attrs: { + type: 'cross-circle' + }, + 'class': prefixCls + '-picker-clear', + on: { + 'click': this.clearSelection + } + }) : null; + + var input = function input(_ref3) { + var inputValue = _ref3.value; + + var start = inputValue[0]; + var end = inputValue[1]; + return h( + 'span', + { 'class': props.pickerInputClass }, + [h('input', { + attrs: { + disabled: props.disabled, + readOnly: true, + + placeholder: startPlaceholder, + + tabIndex: -1 + }, + domProps: { + 'value': start && start.format(props.format) || '' + }, + 'class': prefixCls + '-range-picker-input' }), h( + 'span', + { 'class': prefixCls + '-range-picker-separator' }, + [' ~ '] + ), h('input', { + attrs: { + disabled: props.disabled, + readOnly: true, + + placeholder: endPlaceholder, + + tabIndex: -1 + }, + domProps: { + 'value': end && end.format(props.format) || '' + }, + 'class': prefixCls + '-range-picker-input' }), clearIcon, h('span', { 'class': prefixCls + '-picker-icon' })] + ); + }; + var vcDatePickerProps = mergeProps({ + props: props, + on: $listeners + }, pickerChangeHandler, { + props: { + calendar: calendar, + value: value, + open: open, + prefixCls: prefixCls + '-picker-container' + }, + on: { + openChange: this.handleOpenChange + }, + style: popupStyle + }); + return h( + 'span', + { + ref: 'picker', + 'class': props.pickerClass, + style: pickerStyle, + attrs: { tabIndex: props.disabled ? -1 : 0 + }, + on: { + 'focus': focus, + 'blur': blur + } + }, + [h( + VcDatePicker, + vcDatePickerProps, + [input] + )] + ); + } +}; \ No newline at end of file diff --git a/es/date-picker/WeekPicker.js b/es/date-picker/WeekPicker.js new file mode 100644 index 0000000000..54c302e424 --- /dev/null +++ b/es/date-picker/WeekPicker.js @@ -0,0 +1,184 @@ +import _extends from 'babel-runtime/helpers/extends'; + +import * as moment from 'moment'; +import Calendar from '../vc-calendar'; +import VcDatePicker from '../vc-calendar/src/Picker'; +import Icon from '../icon'; +import { hasProp, getOptionProps, initDefaultProps } from '../_util/props-util'; +import BaseMixin from '../_util/BaseMixin'; +import { WeekPickerProps } from './interface'; +import interopDefault from '../_util/interopDefault'; + +function formatValue(value, format) { + return value && value.format(format) || ''; +} +function noop() {} + +export default { + // static defaultProps = { + // format: 'YYYY-wo', + // allowClear: true, + // }; + + // private input: any; + props: initDefaultProps(WeekPickerProps(), { + format: 'gggg-wo', + allowClear: true + }), + name: 'AWeekPicker', + mixins: [BaseMixin], + model: { + prop: 'value', + event: 'change' + }, + data: function data() { + var value = this.value || this.defaultValue; + if (value && !interopDefault(moment).isMoment(value)) { + throw new Error('The value/defaultValue of DatePicker or MonthPicker must be ' + 'a moment object'); + } + return { + sValue: value + }; + }, + + watch: { + value: function value(val) { + this.setState({ sValue: val }); + } + }, + + methods: { + weekDateRender: function weekDateRender(current) { + var h = this.$createElement; + + var selectedValue = this.sValue; + var prefixCls = this.prefixCls; + + if (selectedValue && current.year() === selectedValue.year() && current.week() === selectedValue.week()) { + return h( + 'div', + { 'class': prefixCls + '-selected-day' }, + [h( + 'div', + { 'class': prefixCls + '-date' }, + [current.date()] + )] + ); + } + return h( + 'div', + { 'class': prefixCls + '-calendar-date' }, + [current.date()] + ); + }, + handleChange: function handleChange(value) { + if (!hasProp(this, 'value')) { + this.setState({ sValue: value }); + } + this.$emit('change', value, formatValue(value, this.format)); + }, + clearSelection: function clearSelection(e) { + e.preventDefault(); + e.stopPropagation(); + this.handleChange(null); + }, + focus: function focus() { + this.$refs.input.focus(); + }, + blur: function blur() { + this.$refs.input.blur(); + } + }, + + render: function render() { + var h = arguments[0]; + + var props = getOptionProps(this); + var prefixCls = this.prefixCls, + disabled = this.disabled, + pickerClass = this.pickerClass, + popupStyle = this.popupStyle, + pickerInputClass = this.pickerInputClass, + format = this.format, + allowClear = this.allowClear, + locale = this.locale, + localeCode = this.localeCode, + disabledDate = this.disabledDate, + pickerValue = this.sValue, + $listeners = this.$listeners, + $scopedSlots = this.$scopedSlots; + var _$listeners$focus = $listeners.focus, + focus = _$listeners$focus === undefined ? noop : _$listeners$focus, + _$listeners$blur = $listeners.blur, + blur = _$listeners$blur === undefined ? noop : _$listeners$blur; + + + if (pickerValue && localeCode) { + pickerValue.locale(localeCode); + } + + var placeholder = hasProp(this, 'placeholder') ? this.placeholder : locale.lang.placeholder; + var weekDateRender = this.dateRender || $scopedSlots.dateRender || this.weekDateRender; + var calendar = h(Calendar, { + attrs: { + showWeekNumber: true, + dateRender: weekDateRender, + prefixCls: prefixCls, + format: format, + locale: locale.lang, + showDateInput: false, + showToday: false, + disabledDate: disabledDate + } + }); + var clearIcon = !disabled && allowClear && this.sValue ? h(Icon, { + attrs: { + type: 'cross-circle' + }, + 'class': prefixCls + '-picker-clear', + on: { + 'click': this.clearSelection + } + }) : null; + var input = function input(_ref) { + var value = _ref.value; + + return h('span', [h('input', { + ref: 'input', + attrs: { disabled: disabled, + readOnly: true, + + placeholder: placeholder + }, + domProps: { + 'value': value && value.format(format) || '' + }, + 'class': pickerInputClass, + on: { + 'focus': focus, + 'blur': blur + } + }), clearIcon, h('span', { 'class': prefixCls + '-picker-icon' })]); + }; + var vcDatePickerProps = { + props: _extends({}, props, { + calendar: calendar, + prefixCls: prefixCls + '-picker-container', + value: pickerValue + }), + on: _extends({}, $listeners, { + change: this.handleChange + }), + style: popupStyle + }; + return h( + 'span', + { 'class': pickerClass }, + [h( + VcDatePicker, + vcDatePickerProps, + [input] + )] + ); + } +}; \ No newline at end of file diff --git a/es/date-picker/createPicker.js b/es/date-picker/createPicker.js new file mode 100644 index 0000000000..7f38a34eb7 --- /dev/null +++ b/es/date-picker/createPicker.js @@ -0,0 +1,222 @@ +import _extends from 'babel-runtime/helpers/extends'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; + +import * as moment from 'moment'; +import omit from 'lodash/omit'; +import MonthCalendar from '../vc-calendar/src/MonthCalendar'; +import VcDatePicker from '../vc-calendar/src/Picker'; +import classNames from 'classnames'; +import Icon from '../icon'; +import interopDefault from '../_util/interopDefault'; +import BaseMixin from '../_util/BaseMixin'; +import { hasProp, getOptionProps, initDefaultProps, mergeProps } from '../_util/props-util'; + +// export const PickerProps = { +// value?: moment.Moment; +// prefixCls: string; +// } +function noop() {} +export default function createPicker(TheCalendar, props) { + return { + // static defaultProps = { + // prefixCls: 'ant-calendar', + // allowClear: true, + // showToday: true, + // }; + + // private input: any; + props: initDefaultProps(props, { + prefixCls: 'ant-calendar', + allowClear: true, + showToday: true + }), + mixins: [BaseMixin], + model: { + prop: 'value', + event: 'change' + }, + data: function data() { + var value = this.value || this.defaultValue; + if (value && !interopDefault(moment).isMoment(value)) { + throw new Error('The value/defaultValue of DatePicker or MonthPicker must be ' + 'a moment object'); + } + return { + sValue: value, + showDate: value + }; + }, + + watch: { + value: function value(val) { + this.setState({ + sValue: val, + showDate: val + }); + } + }, + methods: { + renderFooter: function renderFooter() { + var h = this.$createElement; + var prefixCls = this.prefixCls, + $scopedSlots = this.$scopedSlots, + $slots = this.$slots; + + var renderExtraFooter = this.renderExtraFooter || $scopedSlots.renderExtraFooter || $slots.renderExtraFooter; + return renderExtraFooter ? h( + 'div', + { 'class': prefixCls + '-footer-extra' }, + [typeof renderExtraFooter === 'function' ? renderExtraFooter.apply(undefined, arguments) : renderExtraFooter] + ) : null; + }, + clearSelection: function clearSelection(e) { + e.preventDefault(); + e.stopPropagation(); + this.handleChange(null); + }, + handleChange: function handleChange(value) { + if (!hasProp(this, 'value')) { + this.setState({ + sValue: value, + showDate: value + }); + } + this.$emit('change', value, value && value.format(this.format) || ''); + }, + handleCalendarChange: function handleCalendarChange(value) { + this.setState({ showDate: value }); + }, + focus: function focus() { + this.$refs.input.focus(); + }, + blur: function blur() { + this.$refs.input.blur(); + } + }, + + render: function render() { + var _classNames; + + var h = arguments[0]; + var value = this.sValue, + showDate = this.showDate, + $listeners = this.$listeners, + $scopedSlots = this.$scopedSlots; + var _$listeners$panelChan = $listeners.panelChange, + panelChange = _$listeners$panelChan === undefined ? noop : _$listeners$panelChan, + _$listeners$focus = $listeners.focus, + focus = _$listeners$focus === undefined ? noop : _$listeners$focus, + _$listeners$blur = $listeners.blur, + blur = _$listeners$blur === undefined ? noop : _$listeners$blur, + _$listeners$ok = $listeners.ok, + ok = _$listeners$ok === undefined ? noop : _$listeners$ok; + + var props = getOptionProps(this); + var prefixCls = props.prefixCls, + locale = props.locale, + localeCode = props.localeCode; + + var dateRender = props.dateRender || $scopedSlots.dateRender; + var monthCellContentRender = props.monthCellContentRender || $scopedSlots.monthCellContentRender; + var placeholder = 'placeholder' in props ? props.placeholder : locale.lang.placeholder; + + var disabledTime = props.showTime ? props.disabledTime : null; + + var calendarClassName = classNames((_classNames = {}, _defineProperty(_classNames, prefixCls + '-time', props.showTime), _defineProperty(_classNames, prefixCls + '-month', MonthCalendar === TheCalendar), _classNames)); + + if (value && localeCode) { + value.locale(localeCode); + } + + var pickerProps = { props: {}, on: {} }; + var calendarProps = { props: {}, on: {} }; + if (props.showTime) { + // fix https://github.com/ant-design/ant-design/issues/1902 + calendarProps.on.select = this.handleChange; + } else { + pickerProps.on.change = this.handleChange; + } + if ('mode' in props) { + calendarProps.props.mode = props.mode; + } + var theCalendarProps = mergeProps(calendarProps, { + props: { + disabledDate: props.disabledDate, + disabledTime: disabledTime, + locale: locale.lang, + timePicker: props.timePicker, + defaultValue: props.defaultPickerValue || interopDefault(moment)(), + dateInputPlaceholder: placeholder, + prefixCls: prefixCls, + dateRender: dateRender, + format: props.format, + showToday: props.showToday, + monthCellContentRender: monthCellContentRender, + renderFooter: this.renderFooter, + value: showDate + }, + on: { + ok: ok, + panelChange: panelChange, + change: this.handleCalendarChange + }, + 'class': calendarClassName, + scopedSlots: $scopedSlots + }); + var calendar = h(TheCalendar, theCalendarProps); + + var clearIcon = !props.disabled && props.allowClear && value ? h(Icon, { + attrs: { + type: 'cross-circle' + }, + 'class': prefixCls + '-picker-clear', + on: { + 'click': this.clearSelection + } + }) : null; + + var input = function input(_ref) { + var inputValue = _ref.value; + return h('div', [h('input', { + ref: 'input', + attrs: { disabled: props.disabled, + + readOnly: true, + + placeholder: placeholder + }, + on: { + 'focus': focus, + 'blur': blur + }, + domProps: { + 'value': inputValue && inputValue.format(props.format) || '' + }, + 'class': props.pickerInputClass + }), clearIcon, h('span', { 'class': prefixCls + '-picker-icon' })]); + }; + var vcDatePickerProps = { + props: _extends({}, props, pickerProps.props, { + calendar: calendar, + value: value, + prefixCls: prefixCls + '-picker-container' + }), + on: _extends({}, omit($listeners, 'change'), pickerProps.on), + style: props.popupStyle + }; + return h( + 'span', + { + 'class': props.pickerClass + // tabIndex={props.disabled ? -1 : 0} + // onFocus={focus} + // onBlur={blur} + }, + [h( + VcDatePicker, + vcDatePickerProps, + [input] + )] + ); + } + }; +} \ No newline at end of file diff --git a/es/date-picker/index.js b/es/date-picker/index.js new file mode 100755 index 0000000000..f5ec1a3fee --- /dev/null +++ b/es/date-picker/index.js @@ -0,0 +1,20 @@ +import _extends from 'babel-runtime/helpers/extends'; +import VcCalendar from '../vc-calendar'; +import MonthCalendar from '../vc-calendar/src/MonthCalendar'; +import createPicker from './createPicker'; +import wrapPicker from './wrapPicker'; +import RangePicker from './RangePicker'; +import WeekPicker from './WeekPicker'; +import { DatePickerProps, MonthPickerProps, WeekPickerProps, RangePickerProps } from './interface'; + +var DatePicker = wrapPicker(_extends({}, createPicker(VcCalendar, DatePickerProps()), { name: 'ADatePicker' }), DatePickerProps()); + +var MonthPicker = wrapPicker(_extends({}, createPicker(MonthCalendar, MonthPickerProps()), { name: 'AMonthPicker' }), MonthPickerProps(), 'YYYY-MM'); + +_extends(DatePicker, { + RangePicker: wrapPicker(RangePicker, RangePickerProps()), + MonthPicker: MonthPicker, + WeekPicker: wrapPicker(WeekPicker, WeekPickerProps(), 'gggg-wo') +}); + +export default DatePicker; \ No newline at end of file diff --git a/es/date-picker/interface.js b/es/date-picker/interface.js new file mode 100644 index 0000000000..c43af1c1a2 --- /dev/null +++ b/es/date-picker/interface.js @@ -0,0 +1,106 @@ +import _extends from 'babel-runtime/helpers/extends'; +import * as moment from 'moment'; +// import { TimePickerProps } from '../time-picker' +import PropTypes from '../_util/vue-types'; + +export var MomentType = { + type: Object, + validator: function validator(value) { + return value === undefined || moment.isMoment(value); + } +}; + +export var PickerProps = function PickerProps() { + return { + transitionName: PropTypes.string, + prefixCls: PropTypes.string, + inputPrefixCls: PropTypes.string, + format: PropTypes.string, + disabled: PropTypes.bool, + allowClear: PropTypes.bool, + popupStyle: PropTypes.object, + dropdownClassName: PropTypes.string, + locale: PropTypes.any, + localeCode: PropTypes.string, + size: PropTypes.oneOf(['large', 'small', 'default']), + getCalendarContainer: PropTypes.func, + open: PropTypes.bool, + // onOpenChange: PropTypes.(status: bool) => void, + disabledDate: PropTypes.func, + renderExtraFooter: PropTypes.any, + showToday: PropTypes.bool, + dateRender: PropTypes.any, // (current: moment.Moment, today: moment.Moment) => React.ReactNode, + pickerClass: PropTypes.string, + pickerInputClass: PropTypes.string, + timePicker: PropTypes.any, + autoFocus: PropTypes.bool + }; +}; + +export var SinglePickerProps = function SinglePickerProps() { + return { + value: MomentType, + defaultValue: MomentType, + defaultPickerValue: MomentType + // onChange?: (date: moment.Moment, dateString: string) => void; + }; +}; + +export var DatePickerProps = function DatePickerProps() { + return _extends({}, PickerProps(), SinglePickerProps(), { + showTime: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]), + open: PropTypes.bool, + disabledTime: PropTypes.func, + // onOpenChange?: (status: bool) => void; + // onOk?: (selectedTime: moment.Moment) => void; + placeholder: PropTypes.string + }); +}; + +export var MonthPickerProps = function MonthPickerProps() { + return _extends({}, PickerProps(), SinglePickerProps(), { + placeholder: PropTypes.string, + monthCellContentRender: PropTypes.func + }); +}; +function isMomentArray(value) { + if (Array.isArray(value)) { + return value.length === 0 || value.findIndex(function (val) { + return val === undefined || moment.isMoment(val); + }) !== -1; + } + return false; +} + +export var RangePickerValue = PropTypes.custom(isMomentArray); +// export const RangePickerPresetRange = PropTypes.oneOfType([RangePickerValue, PropTypes.func]) + +export var RangePickerProps = function RangePickerProps() { + return _extends({}, PickerProps(), { + value: RangePickerValue, + defaultValue: RangePickerValue, + defaultPickerValue: RangePickerValue, + // onChange?: (dates: RangePickerValue, dateStrings: [string, string]) => void; + // onCalendarChange?: (dates: RangePickerValue, dateStrings: [string, string]) => void; + // onOk?: (selectedTime: moment.Moment) => void; + showTime: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]), + ranges: PropTypes.object, + placeholder: PropTypes.arrayOf(String), + mode: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(String)]), + disabledTime: PropTypes.func, + showToday: PropTypes.bool + // onPanelChange?: (value?: RangePickerValue, mode?: string | string[]) => void; + }); +}; + +export var WeekPickerProps = function WeekPickerProps() { + return _extends({}, PickerProps(), SinglePickerProps(), { + placeholder: PropTypes.string + }); +}; + +// export interface DatePickerDecorator extends React.ClassicComponentClass { +// RangePicker: React.ClassicComponentClass; +// MonthPicker: React.ClassicComponentClass; +// WeekPicker: React.ClassicComponentClass; +// } \ No newline at end of file diff --git a/es/date-picker/locale/ar_EG.js b/es/date-picker/locale/ar_EG.js new file mode 100644 index 0000000000..197b609ddd --- /dev/null +++ b/es/date-picker/locale/ar_EG.js @@ -0,0 +1,16 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/ar_EG'; +import TimePickerLocale from '../../time-picker/locale/ar_EG'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'اختيار التاريخ', + rangePlaceholder: ['البداية', 'النهاية'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/bg_BG.js b/es/date-picker/locale/bg_BG.js new file mode 100644 index 0000000000..5590bd52b7 --- /dev/null +++ b/es/date-picker/locale/bg_BG.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/bg_BG'; +import TimePickerLocale from '../../time-picker/locale/bg_BG'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Избор на дата', + rangePlaceholder: ['Начална', 'Крайна'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/l + // o cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/ca_ES.js b/es/date-picker/locale/ca_ES.js new file mode 100644 index 0000000000..b9db56795e --- /dev/null +++ b/es/date-picker/locale/ca_ES.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/ca_ES'; +import TimePickerLocale from '../../time-picker/locale/ca_ES'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Seleccionar data', + rangePlaceholder: ['Data inicial', 'Data final'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/l + // o cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/cs_CZ.js b/es/date-picker/locale/cs_CZ.js new file mode 100644 index 0000000000..b9af3252ab --- /dev/null +++ b/es/date-picker/locale/cs_CZ.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/cs_CZ'; +import TimePickerLocale from '../../time-picker/locale/cs_CZ'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Vybrat datum', + rangePlaceholder: ['Od', 'Do'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/l + // o cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/de_DE.js b/es/date-picker/locale/de_DE.js new file mode 100644 index 0000000000..f3998bd60e --- /dev/null +++ b/es/date-picker/locale/de_DE.js @@ -0,0 +1,15 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/de_DE'; +import TimePickerLocale from '../../time-picker/locale/de_DE'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Datum auswählen', + rangePlaceholder: ['Startdatum', 'Enddatum'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: https://github.com/ant-design/ant-design/issues/424 + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/el_GR.js b/es/date-picker/locale/el_GR.js new file mode 100644 index 0000000000..4f399c2a01 --- /dev/null +++ b/es/date-picker/locale/el_GR.js @@ -0,0 +1,15 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/el_GR'; +import TimePickerLocale from '../../time-picker/locale/el_GR'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Επιλέξτε ημερομηνία', + rangePlaceholder: ['Αρχική ημερομηνία', 'Τελική ημερομηνία'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: https://github.com/ant-design/ant-design/issues/424 + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/en_GB.js b/es/date-picker/locale/en_GB.js new file mode 100644 index 0000000000..a81c919a6c --- /dev/null +++ b/es/date-picker/locale/en_GB.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/en_GB'; +import TimePickerLocale from '../../time-picker/locale/en_GB'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Select date', + rangePlaceholder: ['Start date', 'End date'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/l + // o cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/en_US.js b/es/date-picker/locale/en_US.js new file mode 100644 index 0000000000..54d75245b4 --- /dev/null +++ b/es/date-picker/locale/en_US.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/en_US'; +import TimePickerLocale from '../../time-picker/locale/en_US'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Select date', + rangePlaceholder: ['Start date', 'End date'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/es_ES.js b/es/date-picker/locale/es_ES.js new file mode 100644 index 0000000000..f99fabb22b --- /dev/null +++ b/es/date-picker/locale/es_ES.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/es_ES'; +import TimePickerLocale from '../../time-picker/locale/es_ES'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Seleccionar fecha', + rangePlaceholder: ['Fecha inicial', 'Fecha final'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/et_EE.js b/es/date-picker/locale/et_EE.js new file mode 100644 index 0000000000..d985168f19 --- /dev/null +++ b/es/date-picker/locale/et_EE.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/et_EE'; +import TimePickerLocale from '../../time-picker/locale/et_EE'; + +// 统一合并为完整的 Locale +var locale = { + lang: _extends({ + placeholder: 'Vali kuupäev', + rangePlaceholder: ['Algus kuupäev', 'Lõpu kuupäev'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/fa_IR.js b/es/date-picker/locale/fa_IR.js new file mode 100644 index 0000000000..0ce0671d64 --- /dev/null +++ b/es/date-picker/locale/fa_IR.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/fa_IR'; +import TimePickerLocale from '../../time-picker/locale/fa_IR'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'انتخاب تاریخ', + rangePlaceholder: ['تاریخ شروع', 'تاریخ پایان'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/l + // o cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/fi_FI.js b/es/date-picker/locale/fi_FI.js new file mode 100644 index 0000000000..8c96cc678a --- /dev/null +++ b/es/date-picker/locale/fi_FI.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/fi_FI'; +import TimePickerLocale from '../../time-picker/locale/fi_FI'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Valitse päivä', + rangePlaceholder: ['Alku päivä', 'Loppu päivä'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/fr_BE.js b/es/date-picker/locale/fr_BE.js new file mode 100644 index 0000000000..a8a7aefcb6 --- /dev/null +++ b/es/date-picker/locale/fr_BE.js @@ -0,0 +1,15 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/fr_BE'; +import TimePickerLocale from '../../time-picker/locale/fr_BE'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Sélectionner une date', + rangePlaceholder: ['Date de début', 'Date de fin'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: https://github.com/ant-design/ant-design/issues/424 + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/fr_FR.js b/es/date-picker/locale/fr_FR.js new file mode 100644 index 0000000000..98de250c55 --- /dev/null +++ b/es/date-picker/locale/fr_FR.js @@ -0,0 +1,15 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/fr_FR'; +import TimePickerLocale from '../../time-picker/locale/fr_FR'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Sélectionner une date', + rangePlaceholder: ['Date de début', 'Date de fin'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: https://github.com/ant-design/ant-design/issues/424 + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/is_IS.js b/es/date-picker/locale/is_IS.js new file mode 100644 index 0000000000..68f96e6b7d --- /dev/null +++ b/es/date-picker/locale/is_IS.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/is_IS'; +import TimePickerLocale from '../../time-picker/locale/is_IS'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Veldu dag', + rangePlaceholder: ['Upphafsdagur', 'Lokadagur'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/l + // o cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/it_IT.js b/es/date-picker/locale/it_IT.js new file mode 100644 index 0000000000..be16853252 --- /dev/null +++ b/es/date-picker/locale/it_IT.js @@ -0,0 +1,15 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/it_IT'; +import TimePickerLocale from '../../time-picker/locale/it_IT'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Selezionare la data', + rangePlaceholder: ['Data d\'inizio', 'Data di fine'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: https://github.com/ant-design/ant-design/issues/424 + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/ja_JP.js b/es/date-picker/locale/ja_JP.js new file mode 100644 index 0000000000..7f10cf8189 --- /dev/null +++ b/es/date-picker/locale/ja_JP.js @@ -0,0 +1,16 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/ja_JP'; +import TimePickerLocale from '../../time-picker/locale/ja_JP'; + +var locale = { + lang: _extends({ + placeholder: '日付を選択', + rangePlaceholder: ['開始日付', '終了日付'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/ko_KR.js b/es/date-picker/locale/ko_KR.js new file mode 100644 index 0000000000..d1f9e396e6 --- /dev/null +++ b/es/date-picker/locale/ko_KR.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/ko_KR'; +import TimePickerLocale from '../../time-picker/locale/ko_KR'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: '날짜 선택', + rangePlaceholder: ['시작일', '종료일'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/l + // o cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/ku_IQ.js b/es/date-picker/locale/ku_IQ.js new file mode 100755 index 0000000000..73c138815c --- /dev/null +++ b/es/date-picker/locale/ku_IQ.js @@ -0,0 +1,16 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/ku_IQ'; +import TimePickerLocale from '../../time-picker/locale/ku_IQ'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Dîrok hilbijêre', + rangePlaceholder: ['Dîroka destpêkê', 'Dîroka dawîn'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/nb_NO.js b/es/date-picker/locale/nb_NO.js new file mode 100644 index 0000000000..f737ed24c3 --- /dev/null +++ b/es/date-picker/locale/nb_NO.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/nb_NO'; +import TimePickerLocale from '../../time-picker/locale/nb_NO'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Velg dato', + rangePlaceholder: ['Startdato', 'Sluttdato'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/l + // o cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/nl_BE.js b/es/date-picker/locale/nl_BE.js new file mode 100644 index 0000000000..09c0a23a1b --- /dev/null +++ b/es/date-picker/locale/nl_BE.js @@ -0,0 +1,15 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/nl_BE'; +import TimePickerLocale from '../../time-picker/locale/nl_BE'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Selecteer datum', + rangePlaceholder: ['Begin datum', 'Eind datum'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: https://github.com/ant-design/ant-design/issues/424 + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/nl_NL.js b/es/date-picker/locale/nl_NL.js new file mode 100644 index 0000000000..b55417e50f --- /dev/null +++ b/es/date-picker/locale/nl_NL.js @@ -0,0 +1,15 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/nl_NL'; +import TimePickerLocale from '../../time-picker/locale/nl_NL'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Selecteer datum', + rangePlaceholder: ['Begin datum', 'Eind datum'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: https://github.com/ant-design/ant-design/issues/424 + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/pl_PL.js b/es/date-picker/locale/pl_PL.js new file mode 100644 index 0000000000..ef22e2d0d9 --- /dev/null +++ b/es/date-picker/locale/pl_PL.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/pl_PL'; +import TimePickerLocale from '../../time-picker/locale/pl_PL'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Wybierz datę', + rangePlaceholder: ['Data początkowa', 'Data końcowa'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/pt_BR.js b/es/date-picker/locale/pt_BR.js new file mode 100644 index 0000000000..7d4f7b2b11 --- /dev/null +++ b/es/date-picker/locale/pt_BR.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/pt_BR'; +import TimePickerLocale from '../../time-picker/locale/pt_BR'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Selecionar data', + rangePlaceholder: ['Data de início', 'Data de fim'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/l + // o cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/pt_PT.js b/es/date-picker/locale/pt_PT.js new file mode 100644 index 0000000000..6b88fdc259 --- /dev/null +++ b/es/date-picker/locale/pt_PT.js @@ -0,0 +1,45 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/pt_PT'; +import TimePickerLocale from '../../time-picker/locale/pt_PT'; + +// Merge into a locale object +var locale = { + lang: _extends({}, CalendarLocale, { + placeholder: 'Data', + rangePlaceholder: ['Data inicial', 'Data final'], + today: 'Hoje', + now: 'Agora', + backToToday: 'Hoje', + ok: 'Ok', + clear: 'Limpar', + month: 'Mês', + year: 'Ano', + timeSelect: 'Hora', + dateSelect: 'Selecionar data', + monthSelect: 'Selecionar mês', + yearSelect: 'Selecionar ano', + decadeSelect: 'Selecionar década', + yearFormat: 'YYYY', + dateFormat: 'D/M/YYYY', + dayFormat: 'D', + dateTimeFormat: 'D/M/YYYY HH:mm:ss', + monthFormat: 'MMMM', + monthBeforeYear: false, + previousMonth: 'Mês anterior (PageUp)', + nextMonth: 'Mês seguinte (PageDown)', + previousYear: 'Ano anterior (Control + left)', + nextYear: 'Ano seguinte (Control + right)', + previousDecade: 'Última década', + nextDecade: 'Próxima década', + previousCentury: 'Último século', + nextCentury: 'Próximo século' + }), + timePickerLocale: _extends({}, TimePickerLocale, { + placeholder: 'Hora' + }) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/ru_RU.js b/es/date-picker/locale/ru_RU.js new file mode 100644 index 0000000000..291cd0a34c --- /dev/null +++ b/es/date-picker/locale/ru_RU.js @@ -0,0 +1,20 @@ +import _extends from 'babel-runtime/helpers/extends'; +/** + * Created by Andrey Gayvoronsky on 13/04/16. + */ + +import CalendarLocale from '../../vc-calendar/src/locale/ru_RU'; +import TimePickerLocale from '../../time-picker/locale/ru_RU'; + +var locale = { + lang: _extends({ + placeholder: 'Выберите дату', + rangePlaceholder: ['Начальная дата', 'Конечная дата'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/sk_SK.js b/es/date-picker/locale/sk_SK.js new file mode 100644 index 0000000000..a3a620aa36 --- /dev/null +++ b/es/date-picker/locale/sk_SK.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/sk_SK'; +import TimePickerLocale from '../../time-picker/locale/sk_SK'; + +// 统一合并为完整的 Locale +var locale = { + lang: _extends({ + placeholder: 'Vybrať dátum', + rangePlaceholder: ['Od', 'Do'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/sl_SI.js b/es/date-picker/locale/sl_SI.js new file mode 100644 index 0000000000..1ebbfc5279 --- /dev/null +++ b/es/date-picker/locale/sl_SI.js @@ -0,0 +1,41 @@ +import _extends from 'babel-runtime/helpers/extends'; +import TimePickerLocale from '../../time-picker/locale/sl_SI'; + +// Merge into a locale object +var locale = { + lang: { + placeholder: 'Izberite datum', + rangePlaceholder: ['Začetni datum', 'Končni datum'], + today: 'Danes', + now: 'Trenutno', + backToToday: 'Nazaj na trenutni datum', + ok: 'Ok', + clear: 'Počisti', + month: 'Mesec', + year: 'Leto', + timeSelect: 'Izberi čas', + dateSelect: 'Izberi datum', + monthSelect: 'Izberite mesec', + yearSelect: 'Izberite leto', + decadeSelect: 'Izberite desetletje', + yearFormat: 'YYYY', + dateFormat: 'D.M.YYYY', + dayFormat: 'D', + dateTimeFormat: 'D.M.YYYY HH:mm:ss', + monthFormat: 'MMMM', + monthBeforeYear: true, + previousMonth: 'Prejšnji mesec (PageUp)', + nextMonth: 'Naslednji mesec (PageDown)', + previousYear: 'Lansko leto (Control + left)', + nextYear: 'Naslednje leto (Control + right)', + previousDecade: 'Prejšnje desetletje', + nextDecade: 'Naslednje desetletje', + previousCentury: 'Zadnje stoletje', + nextCentury: 'Naslednje stoletje' + }, + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/sr_RS.js b/es/date-picker/locale/sr_RS.js new file mode 100644 index 0000000000..4845a52d32 --- /dev/null +++ b/es/date-picker/locale/sr_RS.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/sr_RS'; +import TimePickerLocale from '../../time-picker/locale/sr_RS'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Izaberite datum', + rangePlaceholder: ['Početni datum', 'Krajnji datum'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/sv_SE.js b/es/date-picker/locale/sv_SE.js new file mode 100644 index 0000000000..c605895fc5 --- /dev/null +++ b/es/date-picker/locale/sv_SE.js @@ -0,0 +1,16 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/sv_SE'; +import TimePickerLocale from '../../time-picker/locale/sv_SE'; + +var locale = { + lang: _extends({ + placeholder: 'Välj datum', + rangePlaceholder: ['Startdatum', 'Slutdatum'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/th_TH.js b/es/date-picker/locale/th_TH.js new file mode 100644 index 0000000000..a409072f4c --- /dev/null +++ b/es/date-picker/locale/th_TH.js @@ -0,0 +1,17 @@ +import CalendarLocale from '../../vc-calendar/src/locale/th_TH'; +import TimePickerLocale from '../../time-picker/locale/th_TH'; +import assign from 'object-assign'; + +// Merge into a locale object +var locale = { + lang: assign({ + placeholder: 'เลือกวันที่', + rangePlaceholder: ['วันเริ่มต้น', 'วันสิ้นสุด'] + }, CalendarLocale), + timePickerLocale: assign({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/tr_TR.js b/es/date-picker/locale/tr_TR.js new file mode 100644 index 0000000000..f6c5714ff8 --- /dev/null +++ b/es/date-picker/locale/tr_TR.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/en_US'; +import TimePickerLocale from '../../time-picker/locale/tr_TR'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Tarih Seç', + rangePlaceholder: ['Başlangıç Tarihi', 'Bitiş Tarihi'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/l + // o cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/uk_UA.js b/es/date-picker/locale/uk_UA.js new file mode 100644 index 0000000000..58f9703524 --- /dev/null +++ b/es/date-picker/locale/uk_UA.js @@ -0,0 +1,16 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/uk_UA'; +import TimePickerLocale from '../../time-picker/locale/uk_UA'; + +var locale = { + lang: _extends({ + placeholder: 'Оберіть дату', + rangePlaceholder: ['Початкова дата', 'Кінцева дата'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/vi_VN.js b/es/date-picker/locale/vi_VN.js new file mode 100644 index 0000000000..f34e71bd27 --- /dev/null +++ b/es/date-picker/locale/vi_VN.js @@ -0,0 +1,17 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/en_US'; +import TimePickerLocale from '../../time-picker/locale/en_US'; + +// Merge into a locale object +var locale = { + lang: _extends({ + placeholder: 'Chọn thời điểm', + rangePlaceholder: ['Ngày bắt đầu', 'Ngày kết thúc'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // All settings at: + // https://github.com/ant-design/ant-design/blob/master/components/date-picker/lo + // cale/example.json + +};export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/zh_CN.js b/es/date-picker/locale/zh_CN.js new file mode 100644 index 0000000000..c8cf54e56b --- /dev/null +++ b/es/date-picker/locale/zh_CN.js @@ -0,0 +1,19 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/zh_CN'; +import TimePickerLocale from '../../time-picker/locale/zh_CN'; + +var locale = { + lang: _extends({ + placeholder: '请选择日期', + rangePlaceholder: ['开始日期', '结束日期'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) + + // should add whitespace between char in Button +};locale.lang.ok = '确 定'; + +// All settings at: +// https://github.com/ant-design/ant-design/blob/master/components/date-picker/l +// o cale/example.json + +export default locale; \ No newline at end of file diff --git a/es/date-picker/locale/zh_TW.js b/es/date-picker/locale/zh_TW.js new file mode 100644 index 0000000000..2c0dde90e2 --- /dev/null +++ b/es/date-picker/locale/zh_TW.js @@ -0,0 +1,19 @@ +import _extends from 'babel-runtime/helpers/extends'; +import CalendarLocale from '../../vc-calendar/src/locale/zh_TW'; +import TimePickerLocale from '../../time-picker/locale/zh_TW'; + +var locale = { + lang: _extends({ + placeholder: '請選擇日期', + rangePlaceholder: ['開始日期', '結束日期'] + }, CalendarLocale), + timePickerLocale: _extends({}, TimePickerLocale) +}; + +locale.lang.ok = '確 定'; + +// All settings at: +// https://github.com/ant-design/ant-design/blob/master/components/date-picker/l +// o cale/example.json + +export default locale; \ No newline at end of file diff --git a/es/date-picker/style/Calendar.less b/es/date-picker/style/Calendar.less new file mode 100644 index 0000000000..623a7b1787 --- /dev/null +++ b/es/date-picker/style/Calendar.less @@ -0,0 +1,336 @@ +.calendarPanelHeader(@calendar-prefix-cls) { + height: 40px; + line-height: 40px; + text-align: center; + user-select: none; + border-bottom: @border-width-base @border-style-base @border-color-split; + + a:hover { + color: @link-hover-color; + } + + .@{calendar-prefix-cls}-century-select, + .@{calendar-prefix-cls}-decade-select, + .@{calendar-prefix-cls}-year-select, + .@{calendar-prefix-cls}-month-select { + padding: 0 2px; + font-weight: 500; + display: inline-block; + color: @heading-color; + line-height: 40px; + } + + .@{calendar-prefix-cls}-century-select-arrow, + .@{calendar-prefix-cls}-decade-select-arrow, + .@{calendar-prefix-cls}-year-select-arrow, + .@{calendar-prefix-cls}-month-select-arrow { + display: none; + } + + .@{calendar-prefix-cls}-prev-century-btn, + .@{calendar-prefix-cls}-next-century-btn, + .@{calendar-prefix-cls}-prev-decade-btn, + .@{calendar-prefix-cls}-next-decade-btn, + .@{calendar-prefix-cls}-prev-month-btn, + .@{calendar-prefix-cls}-next-month-btn, + .@{calendar-prefix-cls}-prev-year-btn, + .@{calendar-prefix-cls}-next-year-btn { + position: absolute; + top: 0; + color: @text-color-secondary; + font-family: Arial, "Hiragino Sans GB", "Microsoft Yahei", "Microsoft Sans Serif", sans-serif; + padding: 0 5px; + font-size: 16px; + display: inline-block; + line-height: 40px; + } + + .@{calendar-prefix-cls}-prev-century-btn, + .@{calendar-prefix-cls}-prev-decade-btn, + .@{calendar-prefix-cls}-prev-year-btn { + left: 7px; + + &:after { + content: '«'; + } + } + + .@{calendar-prefix-cls}-next-century-btn, + .@{calendar-prefix-cls}-next-decade-btn, + .@{calendar-prefix-cls}-next-year-btn { + right: 7px; + + &:after { + content: '»'; + } + } + + .@{calendar-prefix-cls}-prev-month-btn { + left: 29px; + + &:after { + content: '‹'; + } + } + + .@{calendar-prefix-cls}-next-month-btn { + right: 29px; + + &:after { + content: '›'; + } + } +} + +.@{calendar-prefix-cls} { + position: relative; + outline: none; + width: 280px; + border: @border-width-base @border-style-base #fff; + list-style: none; + font-size: @font-size-base; + text-align: left; + background-color: @component-background; + border-radius: @border-radius-base; + box-shadow: @box-shadow-base; + background-clip: padding-box; + line-height: @line-height-base; + + &-input-wrap { + height: 34px; + padding: 6px @control-padding-horizontal - 2px; + border-bottom: @border-width-base @border-style-base @border-color-split; + } + + &-input { + border: 0; + width: 100%; + cursor: auto; + outline: 0; + height: 22px; + color: @input-color; + background: @input-bg; + .placeholder; + } + + &-week-number { + width: 286px; + + &-cell { + text-align: center; + } + } + + &-header { + .calendarPanelHeader(@calendar-prefix-cls); + } + + &-body { + padding: 8px 12px; + } + + table { + border-collapse: collapse; + max-width: 100%; + background-color: transparent; + width: 100%; + } + + table, + th, + td { + border: 0; + text-align: center; + } + + &-calendar-table { + border-spacing: 0; + margin-bottom: 0; + } + + &-column-header { + line-height: 18px; + width: 33px; + padding: 6px 0; + text-align: center; + .@{calendar-prefix-cls}-column-header-inner { + display: block; + font-weight: normal; + } + } + + &-week-number-header { + .@{calendar-prefix-cls}-column-header-inner { + display: none; + } + } + + &-cell { + padding: 3px 0; + height: 30px; + } + + &-date { + display: block; + margin: 0 auto; + color: @text-color; + border-radius: @border-radius-sm; + width: 24px; + height: 24px; + line-height: 22px; + border: @border-width-base @border-style-base transparent; + padding: 0; + background: transparent; + text-align: center; + transition: background 0.3s ease; + + &-panel { + position: relative; + } + + &:hover { + background: @item-hover-bg; + cursor: pointer; + } + + &:active { + color: #fff; + background: @primary-5; + } + } + + &-today &-date { + border-color: @primary-color; + font-weight: bold; + color: @primary-color; + } + + &-last-month-cell &-date, + &-next-month-btn-day &-date { + color: @disabled-color; + } + + &-selected-day &-date { + background: @primary-color; + color: #fff; + border: @border-width-base @border-style-base transparent; + + &:hover { + background: @primary-color; + } + } + + &-disabled-cell &-date { + cursor: not-allowed; + color: #bcbcbc; + background: @disabled-bg; + border-radius: 0; + width: auto; + border: @border-width-base @border-style-base transparent; + + &:hover { + background: @disabled-bg; + } + } + &-disabled-cell&-today &-date { + position: relative; + margin-right: 5px; + padding-left: 5px; + &:before { + content: " "; + position: absolute; + top: -1px; + left: 5px; + width: 24px; + height: 24px; + border: @border-width-base @border-style-base #bcbcbc; + border-radius: @border-radius-sm; + } + } + + &-disabled-cell-first-of-row &-date { + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + } + + &-disabled-cell-last-of-row &-date { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + } + + &-footer { + border-top: @border-width-base @border-style-base @border-color-split; + line-height: 38px; + padding: 0 12px; + &:empty { + border-top: 0; + } + &-btn { + text-align: center; + display: block; + } + &-extra + &-btn { + border-top: @border-width-base @border-style-base @border-color-split; + margin: 0 -12px; + padding: 0 12px; + } + } + + .@{calendar-prefix-cls}-today-btn, + .@{calendar-prefix-cls}-clear-btn { + display: inline-block; + text-align: center; + margin: 0 0 0 8px; + &-disabled { + color: @disabled-color; + cursor: not-allowed; + } + &:only-child { + margin: 0; + } + } + + .@{calendar-prefix-cls}-clear-btn { + display: none; + position: absolute; + right: 5px; + text-indent: -76px; + overflow: hidden; + width: 20px; + height: 20px; + text-align: center; + line-height: 20px; + top: 7px; + margin: 0; + } + + .@{calendar-prefix-cls}-clear-btn:after { + .iconfont-font("\e62e"); + font-size: @font-size-base; + color: @disabled-color; + display: inline-block; + line-height: 1; + width: 20px; + text-indent: 43px; + transition: color 0.3s ease; + } + + .@{calendar-prefix-cls}-clear-btn:hover:after { + color: @text-color-secondary; + } + + .@{calendar-prefix-cls}-ok-btn { + .btn; + .btn-primary; + .button-size(@btn-height-sm; @btn-padding-sm; @font-size-base; @border-radius-base); + line-height: @btn-height-sm - 2px; + + &-disabled { + .button-color(@btn-disable-color; @btn-disable-bg; @btn-disable-border); + cursor: not-allowed; + &:hover { + .button-color(@btn-disable-color; @btn-disable-bg; @btn-disable-border); + } + } + } +} diff --git a/es/date-picker/style/DecadePanel.less b/es/date-picker/style/DecadePanel.less new file mode 100644 index 0000000000..fc563ebbfd --- /dev/null +++ b/es/date-picker/style/DecadePanel.less @@ -0,0 +1,71 @@ +.@{calendar-prefix-cls}-decade-panel { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 10; + background: @component-background; + border-radius: @border-radius-base; + outline: none; +} + +.@{calendar-prefix-cls}-decade-panel-hidden { + display: none; +} + +.@{calendar-prefix-cls}-decade-panel-header { + .calendarPanelHeader(~"@{calendar-prefix-cls}-decade-panel"); +} + +.@{calendar-prefix-cls}-decade-panel-body { + height: ~"calc(100% - 40px)"; +} + +.@{calendar-prefix-cls}-decade-panel-table { + table-layout: fixed; + width: 100%; + height: 100%; + border-collapse: separate; +} + +.@{calendar-prefix-cls}-decade-panel-cell { + text-align: center; + white-space: nowrap; +} + +.@{calendar-prefix-cls}-decade-panel-decade { + display: inline-block; + margin: 0 auto; + color: @text-color; + background: transparent; + text-align: center; + height: 24px; + line-height: 24px; + padding: 0 6px; + border-radius: @border-radius-sm; + transition: background 0.3s ease; + + &:hover { + background: @item-hover-bg; + cursor: pointer; + } +} + +.@{calendar-prefix-cls}-decade-panel-selected-cell .@{calendar-prefix-cls}-decade-panel-decade { + background: @primary-color; + color: #fff; + + &:hover { + background: @primary-color; + color: #fff; + } +} + +.@{calendar-prefix-cls}-decade-panel-last-century-cell, +.@{calendar-prefix-cls}-decade-panel-next-century-cell { + .@{calendar-prefix-cls}-decade-panel-decade { + user-select: none; + color: @disabled-color; + } +} diff --git a/es/date-picker/style/MonthPanel.less b/es/date-picker/style/MonthPanel.less new file mode 100644 index 0000000000..fbeceec8c3 --- /dev/null +++ b/es/date-picker/style/MonthPanel.less @@ -0,0 +1,75 @@ +.@{calendar-prefix-cls}-month-panel { + position: absolute; + top: 1px; + right: 0; + bottom: 0; + left: 0; + z-index: 10; + border-radius: @border-radius-base; + background: @component-background; + outline: none; + + > div { // TODO: this is a useless wrapper, and we need to remove it in rc-calendar + height: 100%; + } +} + +.@{calendar-prefix-cls}-month-panel-hidden { + display: none; +} + +.@{calendar-prefix-cls}-month-panel-header { + .calendarPanelHeader(~"@{calendar-prefix-cls}-month-panel"); +} + +.@{calendar-prefix-cls}-month-panel-body { + height: ~"calc(100% - 40px)"; +} + +.@{calendar-prefix-cls}-month-panel-table { + table-layout: fixed; + width: 100%; + height: 100%; + border-collapse: separate; +} + +.@{calendar-prefix-cls}-month-panel-selected-cell .@{calendar-prefix-cls}-month-panel-month { + background: @primary-color; + color: #fff; + + &:hover { + background: @primary-color; + color: #fff; + } +} + +.@{calendar-prefix-cls}-month-panel-cell { + text-align: center; + + &-disabled .@{calendar-prefix-cls}-month-panel-month { + &, + &:hover { + cursor: not-allowed; + color: #bcbcbc; + background: @disabled-bg; + } + } +} + +.@{calendar-prefix-cls}-month-panel-month { + display: inline-block; + margin: 0 auto; + color: @text-color; + background: transparent; + text-align: center; + height: 24px; + line-height: 24px; + padding: 0 8px; + border-radius: @border-radius-sm; + transition: background 0.3s ease; + + &:hover { + background: @item-hover-bg; + cursor: pointer; + } +} diff --git a/es/date-picker/style/MonthPicker.less b/es/date-picker/style/MonthPicker.less new file mode 100644 index 0000000000..27955fe370 --- /dev/null +++ b/es/date-picker/style/MonthPicker.less @@ -0,0 +1,11 @@ +.@{calendar-prefix-cls}-month { + .@{calendar-prefix-cls}-month-header-wrap { + position: relative; + height: 288px; + } + .@{calendar-prefix-cls}-month-panel, + .@{calendar-prefix-cls}-year-panel { + top: 0; + height: 100%; + } +} diff --git a/es/date-picker/style/Picker.less b/es/date-picker/style/Picker.less new file mode 100644 index 0000000000..ca574099df --- /dev/null +++ b/es/date-picker/style/Picker.less @@ -0,0 +1,100 @@ +@import "../../button/style/mixin"; + +.@{calendar-prefix-cls}-picker-container { + .reset-component; + position: absolute; + z-index: @zindex-picker; + + &.slide-up-enter.slide-up-enter-active&-placement-topLeft, + &.slide-up-enter.slide-up-enter-active&-placement-topRight, + &.slide-up-appear.slide-up-appear-active&-placement-topLeft, + &.slide-up-appear.slide-up-appear-active&-placement-topRight { + animation-name: antSlideDownIn; + } + + &.slide-up-enter.slide-up-enter-active&-placement-bottomLeft, + &.slide-up-enter.slide-up-enter-active&-placement-bottomRight, + &.slide-up-appear.slide-up-appear-active&-placement-bottomLeft, + &.slide-up-appear.slide-up-appear-active&-placement-bottomRight { + animation-name: antSlideUpIn; + } + + &.slide-up-leave.slide-up-leave-active&-placement-topLeft, + &.slide-up-leave.slide-up-leave-active&-placement-topRight { + animation-name: antSlideDownOut; + } + + &.slide-up-leave.slide-up-leave-active&-placement-bottomLeft, + &.slide-up-leave.slide-up-leave-active&-placement-bottomRight { + animation-name: antSlideUpOut; + } +} + +.@{calendar-prefix-cls}-picker { + .reset-component; + position: relative; + display: inline-block; + outline: none; + transition: opacity 0.3s; + + &-input { + outline: none; + display: block; + } + + &:hover &-input:not(.@{ant-prefix}-input-disabled) { + border-color: @primary-color; + } + + &:focus &-input:not(.@{ant-prefix}-input-disabled) { + .active(); + } + + &-clear, + &-icon { + position: absolute; + width: 14px; + height: 14px; + right: @control-padding-horizontal; + top: 50%; + margin-top: -7px; + line-height: 14px; + font-size: @font-size-sm; + transition: all .3s; + user-select: none; + } + + &-clear { + opacity: 0; + z-index: 1; + color: @disabled-color; + background: @input-bg; + pointer-events: none; + cursor: pointer; + &:hover { + color: @text-color-secondary; + } + } + + &:hover &-clear { + opacity: 1; + pointer-events: auto; + } + + &-icon { + color: @disabled-color; + &:after { + content: "\e6bb"; + font-family: "anticon"; + font-size: @font-size-base; + color: @disabled-color; + display: inline-block; + line-height: 1; + } + } + + &-small &-clear, + &-small &-icon { + right: @control-padding-horizontal-sm; + } +} diff --git a/es/date-picker/style/RangePicker.less b/es/date-picker/style/RangePicker.less new file mode 100644 index 0000000000..0256debf49 --- /dev/null +++ b/es/date-picker/style/RangePicker.less @@ -0,0 +1,222 @@ +@input-box-height: 34px; + +.@{calendar-prefix-cls}-range-picker-input { + background-color: transparent; + border: 0; + height: 99%; + outline: 0; + width: 44%; + text-align: center; + .placeholder(); + + &[disabled] { + cursor: not-allowed; + } +} + +.@{calendar-prefix-cls}-range-picker-separator { + color: @text-color-secondary; + width: 10px; + display: inline-block; + height: 100%; + vertical-align: top; +} + +.@{calendar-prefix-cls}-range { + width: 552px; + overflow: hidden; + + .@{calendar-prefix-cls}-date-panel { + &::after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } + } + &-part { + width: 50%; + position: relative; + } + + &-left { + float: left; + .@{calendar-prefix-cls} { + &-time-picker-inner { + border-right: 1.5px solid @border-color-split; + } + } + } + + &-right { + float: right; + .@{calendar-prefix-cls} { + &-time-picker-inner { + border-left: 1.5px solid @border-color-split; + } + } + } + + &-middle { + position: absolute; + left: 50%; + width: 20px; + margin-left: -132px; + text-align: center; + height: @input-box-height; + line-height: @input-box-height; + color: @text-color-secondary; + } + + &-right .@{calendar-prefix-cls}-date-input-wrap { + margin-left: -118px; + } + + &.@{calendar-prefix-cls}-time &-middle { + margin-left: -12px; + } + + &.@{calendar-prefix-cls}-time &-right .@{calendar-prefix-cls}-date-input-wrap { + margin-left: 0; + } + + .@{calendar-prefix-cls}-input-wrap { + position: relative; + height: @input-box-height; + } + + .@{calendar-prefix-cls}-input, + .@{calendar-timepicker-prefix-cls}-input { + .input; + height: @input-height-sm; + border: 0; + box-shadow: none; + padding-left: 0; + padding-right: 0; + + &:focus { + box-shadow: none; + } + } + + .@{calendar-timepicker-prefix-cls}-icon { + display: none; + } + + &.@{calendar-prefix-cls}-week-number { + width: 574px; + + .@{calendar-prefix-cls}-range-part { + width: 286px; + } + } + + .@{calendar-prefix-cls}-year-panel, + .@{calendar-prefix-cls}-month-panel, + .@{calendar-prefix-cls}-decade-panel { + top: @input-box-height; + } + .@{calendar-prefix-cls}-month-panel .@{calendar-prefix-cls}-year-panel { + top: 0; + } + .@{calendar-prefix-cls}-decade-panel-table, + .@{calendar-prefix-cls}-year-panel-table, + .@{calendar-prefix-cls}-month-panel-table { + height: 208px; + } + + .@{calendar-prefix-cls}-in-range-cell { + border-radius: 0; + position: relative; + > div { + position: relative; + z-index: 1; + } + &:before { + content: ''; + display: block; + background: @item-active-bg; + border-radius: 0; + border: 0; + position: absolute; + top: 4px; + bottom: 4px; + left: 0; + right: 0; + } + } + + // `div` for selector specificity + div&-quick-selector { + text-align: left; + + > a { + margin-right: 8px; + } + } + + .@{calendar-prefix-cls}, + .@{calendar-prefix-cls}-month-panel, + .@{calendar-prefix-cls}-year-panel { + &-header { + border-bottom: 0; + } + &-body { + border-top: @border-width-base @border-style-base @border-color-split; + } + } + + &.@{calendar-prefix-cls}-time { + .@{calendar-timepicker-prefix-cls} { + height: 207px; + width: 100%; + top: 68px; + z-index: 2; // cover .ant-calendar-range .ant-calendar-in-range-cell > div (z-index: 1) + &-panel { + height: 267px; + margin-top: -34px; + } + + &-inner { + padding-top: 40px; + height: 100%; + background: none; + } + + &-combobox { + display: inline-block; + height: 100%; + background-color: @component-background; + border-top: @border-width-base @border-style-base @border-color-split; + } + &-select { + height: 100%; + ul { + max-height: 100%; + } + } + } + .@{calendar-prefix-cls}-footer .@{calendar-prefix-cls}-time-picker-btn { + margin-right: 8px; + } + .@{calendar-prefix-cls}-today-btn { + margin: 8px 12px; + height: 22px; + line-height: 22px; + } + } + + &-with-ranges.@{calendar-prefix-cls}-time .@{calendar-timepicker-prefix-cls} { + height: 247px; + &-panel { + height: 281px; + } + } +} + +.@{calendar-prefix-cls}-range.@{calendar-prefix-cls}-show-time-picker { + .@{calendar-prefix-cls}-body { + border-top-color: transparent; + } +} diff --git a/es/date-picker/style/TimePicker.less b/es/date-picker/style/TimePicker.less new file mode 100644 index 0000000000..42d381b7f5 --- /dev/null +++ b/es/date-picker/style/TimePicker.less @@ -0,0 +1,148 @@ +.@{calendar-timepicker-prefix-cls} { + position: absolute; + width: 100%; + top: 40px; + background-color: @component-background; + + &-panel { + z-index: @zindex-picker; + position: absolute; + width: 100%; + } + + &-inner { + display: inline-block; + position: relative; + outline: none; + list-style: none; + font-size: @font-size-base; + text-align: left; + background-color: @component-background; + background-clip: padding-box; + line-height: 1.5; + overflow: hidden; + width: 100%; + } + &-combobox { + width: 100%; + } + + &-column-1, + &-column-1 &-select { + width: 100%; + } + &-column-2 &-select { + width: 50%; + } + &-column-3 &-select { + width: 33.33%; + } + &-column-4 &-select { + width: 25%; + } + + &-input-wrap { + display: none; + } + + &-select { + float: left; + font-size: @font-size-base; + border-right: @border-width-base @border-style-base @border-color-split; + box-sizing: border-box; + overflow: hidden; + position: relative; // Fix chrome weird render bug + height: 226px; + + &:hover { + overflow-y: auto; + } + + &:first-child { + border-left: 0; + margin-left: 0; + } + + &:last-child { + border-right: 0; + } + + ul { + list-style: none; + box-sizing: border-box; + margin: 0; + padding: 0; + width: 100%; + max-height: 206px; + } + + li { + text-align: center; + list-style: none; + box-sizing: content-box; + margin: 0; + width: 100%; + height: 24px; + line-height: 24px; + cursor: pointer; + user-select: none; + transition: background 0.3s ease; + } + + li:last-child:after { + content: ''; + height: 202px; + display: block; + } + + li:hover { + background: @item-hover-bg; + } + + li&-option-selected { + background: @time-picker-selected-bg; + font-weight: bold; + } + + li&-option-disabled { + color: @btn-disable-color; + &:hover { + background: transparent; + cursor: not-allowed; + } + } + } +} + +.@{calendar-prefix-cls}-time { + .@{calendar-prefix-cls}-day-select { + padding: 0 2px; + font-weight: 500; + display: inline-block; + color: @heading-color; + line-height: 34px; + } + + .@{calendar-prefix-cls}-footer { + position: relative; + height: auto; + + &-btn { + text-align: right; + } + + .@{calendar-prefix-cls}-today-btn { + float: left; + margin: 0; + } + + .@{calendar-prefix-cls}-time-picker-btn { + display: inline-block; + margin-right: 8px; + + &-disabled { + color: @disabled-color; + } + } + } +} diff --git a/es/date-picker/style/WeekPicker.less b/es/date-picker/style/WeekPicker.less new file mode 100644 index 0000000000..c2f6748080 --- /dev/null +++ b/es/date-picker/style/WeekPicker.less @@ -0,0 +1,21 @@ +.@{calendar-prefix-cls}-week-number { + &-cell { + opacity: 0.5; + } + .@{calendar-prefix-cls}-body tr { + transition: all .3s; + cursor: pointer; + &:hover { + background: @primary-1; + } + &.@{calendar-prefix-cls}-active-week { + background: @primary-2; + font-weight: bold; + } + .@{calendar-prefix-cls}-selected-day .@{calendar-prefix-cls}-date, + .@{calendar-prefix-cls}-selected-day:hover .@{calendar-prefix-cls}-date { + background: transparent; + color: @text-color; + } + } +} diff --git a/es/date-picker/style/YearPanel.less b/es/date-picker/style/YearPanel.less new file mode 100644 index 0000000000..cd7a328bc8 --- /dev/null +++ b/es/date-picker/style/YearPanel.less @@ -0,0 +1,74 @@ +.@{calendar-prefix-cls}-year-panel { + position: absolute; + top: 1px; + right: 0; + bottom: 0; + left: 0; + z-index: 10; + border-radius: @border-radius-base; + background: @component-background; + outline: none; + + > div { // TODO: this is a useless wrapper, and we need to remove it in rc-calendar + height: 100%; + } +} + +.@{calendar-prefix-cls}-year-panel-hidden { + display: none; +} + +.@{calendar-prefix-cls}-year-panel-header { + .calendarPanelHeader(~"@{calendar-prefix-cls}-year-panel"); +} + +.@{calendar-prefix-cls}-year-panel-body { + height: ~"calc(100% - 40px)"; +} + +.@{calendar-prefix-cls}-year-panel-table { + table-layout: fixed; + width: 100%; + height: 100%; + border-collapse: separate; +} + +.@{calendar-prefix-cls}-year-panel-cell { + text-align: center; +} + +.@{calendar-prefix-cls}-year-panel-year { + display: inline-block; + margin: 0 auto; + color: @text-color; + background: transparent; + text-align: center; + height: 24px; + line-height: 24px; + padding: 0 8px; + border-radius: @border-radius-sm; + transition: background 0.3s ease; + + &:hover { + background: @item-hover-bg; + cursor: pointer; + } +} + +.@{calendar-prefix-cls}-year-panel-selected-cell .@{calendar-prefix-cls}-year-panel-year { + background: @primary-color; + color: #fff; + + &:hover { + background: @primary-color; + color: #fff; + } +} + +.@{calendar-prefix-cls}-year-panel-last-decade-cell, +.@{calendar-prefix-cls}-year-panel-next-decade-cell { + .@{calendar-prefix-cls}-year-panel-year { + user-select: none; + color: @disabled-color; + } +} diff --git a/es/date-picker/style/css.js b/es/date-picker/style/css.js new file mode 100644 index 0000000000..7bfc7f033f --- /dev/null +++ b/es/date-picker/style/css.js @@ -0,0 +1,6 @@ +import '../../style/index.css'; +import './index.css'; + +// style dependencies +import '../../input/style/css'; +import '../../time-picker/style/css'; \ No newline at end of file diff --git a/es/date-picker/style/index.css b/es/date-picker/style/index.css new file mode 100644 index 0000000000..676e013622 --- /dev/null +++ b/es/date-picker/style/index.css @@ -0,0 +1,1452 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-calendar-picker-container { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + position: absolute; + z-index: 1050; +} +.ant-calendar-picker-container.slide-up-enter.slide-up-enter-active.ant-calendar-picker-container-placement-topLeft, +.ant-calendar-picker-container.slide-up-enter.slide-up-enter-active.ant-calendar-picker-container-placement-topRight, +.ant-calendar-picker-container.slide-up-appear.slide-up-appear-active.ant-calendar-picker-container-placement-topLeft, +.ant-calendar-picker-container.slide-up-appear.slide-up-appear-active.ant-calendar-picker-container-placement-topRight { + -webkit-animation-name: antSlideDownIn; + animation-name: antSlideDownIn; +} +.ant-calendar-picker-container.slide-up-enter.slide-up-enter-active.ant-calendar-picker-container-placement-bottomLeft, +.ant-calendar-picker-container.slide-up-enter.slide-up-enter-active.ant-calendar-picker-container-placement-bottomRight, +.ant-calendar-picker-container.slide-up-appear.slide-up-appear-active.ant-calendar-picker-container-placement-bottomLeft, +.ant-calendar-picker-container.slide-up-appear.slide-up-appear-active.ant-calendar-picker-container-placement-bottomRight { + -webkit-animation-name: antSlideUpIn; + animation-name: antSlideUpIn; +} +.ant-calendar-picker-container.slide-up-leave.slide-up-leave-active.ant-calendar-picker-container-placement-topLeft, +.ant-calendar-picker-container.slide-up-leave.slide-up-leave-active.ant-calendar-picker-container-placement-topRight { + -webkit-animation-name: antSlideDownOut; + animation-name: antSlideDownOut; +} +.ant-calendar-picker-container.slide-up-leave.slide-up-leave-active.ant-calendar-picker-container-placement-bottomLeft, +.ant-calendar-picker-container.slide-up-leave.slide-up-leave-active.ant-calendar-picker-container-placement-bottomRight { + -webkit-animation-name: antSlideUpOut; + animation-name: antSlideUpOut; +} +.ant-calendar-picker { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + position: relative; + display: inline-block; + outline: none; + -webkit-transition: opacity 0.3s; + transition: opacity 0.3s; +} +.ant-calendar-picker-input { + outline: none; + display: block; +} +.ant-calendar-picker:hover .ant-calendar-picker-input:not(.ant-input-disabled) { + border-color: #1890ff; +} +.ant-calendar-picker:focus .ant-calendar-picker-input:not(.ant-input-disabled) { + border-color: #40a9ff; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); + box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); +} +.ant-calendar-picker-clear, +.ant-calendar-picker-icon { + position: absolute; + width: 14px; + height: 14px; + right: 12px; + top: 50%; + margin-top: -7px; + line-height: 14px; + font-size: 12px; + -webkit-transition: all .3s; + transition: all .3s; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.ant-calendar-picker-clear { + opacity: 0; + z-index: 1; + color: rgba(0, 0, 0, 0.25); + background: #fff; + pointer-events: none; + cursor: pointer; +} +.ant-calendar-picker-clear:hover { + color: rgba(0, 0, 0, 0.45); +} +.ant-calendar-picker:hover .ant-calendar-picker-clear { + opacity: 1; + pointer-events: auto; +} +.ant-calendar-picker-icon { + color: rgba(0, 0, 0, 0.25); +} +.ant-calendar-picker-icon:after { + content: "\e6bb"; + font-family: "anticon"; + font-size: 14px; + color: rgba(0, 0, 0, 0.25); + display: inline-block; + line-height: 1; +} +.ant-calendar-picker-small .ant-calendar-picker-clear, +.ant-calendar-picker-small .ant-calendar-picker-icon { + right: 8px; +} +.ant-calendar { + position: relative; + outline: none; + width: 280px; + border: 1px solid #fff; + list-style: none; + font-size: 14px; + text-align: left; + background-color: #fff; + border-radius: 4px; + -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); + background-clip: padding-box; + line-height: 1.5; +} +.ant-calendar-input-wrap { + height: 34px; + padding: 6px 10px; + border-bottom: 1px solid #e8e8e8; +} +.ant-calendar-input { + border: 0; + width: 100%; + cursor: auto; + outline: 0; + height: 22px; + color: rgba(0, 0, 0, 0.65); + background: #fff; +} +.ant-calendar-input::-moz-placeholder { + color: #bfbfbf; + opacity: 1; +} +.ant-calendar-input:-ms-input-placeholder { + color: #bfbfbf; +} +.ant-calendar-input::-webkit-input-placeholder { + color: #bfbfbf; +} +.ant-calendar-week-number { + width: 286px; +} +.ant-calendar-week-number-cell { + text-align: center; +} +.ant-calendar-header { + height: 40px; + line-height: 40px; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + border-bottom: 1px solid #e8e8e8; +} +.ant-calendar-header a:hover { + color: #40a9ff; +} +.ant-calendar-header .ant-calendar-century-select, +.ant-calendar-header .ant-calendar-decade-select, +.ant-calendar-header .ant-calendar-year-select, +.ant-calendar-header .ant-calendar-month-select { + padding: 0 2px; + font-weight: 500; + display: inline-block; + color: rgba(0, 0, 0, 0.85); + line-height: 40px; +} +.ant-calendar-header .ant-calendar-century-select-arrow, +.ant-calendar-header .ant-calendar-decade-select-arrow, +.ant-calendar-header .ant-calendar-year-select-arrow, +.ant-calendar-header .ant-calendar-month-select-arrow { + display: none; +} +.ant-calendar-header .ant-calendar-prev-century-btn, +.ant-calendar-header .ant-calendar-next-century-btn, +.ant-calendar-header .ant-calendar-prev-decade-btn, +.ant-calendar-header .ant-calendar-next-decade-btn, +.ant-calendar-header .ant-calendar-prev-month-btn, +.ant-calendar-header .ant-calendar-next-month-btn, +.ant-calendar-header .ant-calendar-prev-year-btn, +.ant-calendar-header .ant-calendar-next-year-btn { + position: absolute; + top: 0; + color: rgba(0, 0, 0, 0.45); + font-family: Arial, "Hiragino Sans GB", "Microsoft Yahei", "Microsoft Sans Serif", sans-serif; + padding: 0 5px; + font-size: 16px; + display: inline-block; + line-height: 40px; +} +.ant-calendar-header .ant-calendar-prev-century-btn, +.ant-calendar-header .ant-calendar-prev-decade-btn, +.ant-calendar-header .ant-calendar-prev-year-btn { + left: 7px; +} +.ant-calendar-header .ant-calendar-prev-century-btn:after, +.ant-calendar-header .ant-calendar-prev-decade-btn:after, +.ant-calendar-header .ant-calendar-prev-year-btn:after { + content: '«'; +} +.ant-calendar-header .ant-calendar-next-century-btn, +.ant-calendar-header .ant-calendar-next-decade-btn, +.ant-calendar-header .ant-calendar-next-year-btn { + right: 7px; +} +.ant-calendar-header .ant-calendar-next-century-btn:after, +.ant-calendar-header .ant-calendar-next-decade-btn:after, +.ant-calendar-header .ant-calendar-next-year-btn:after { + content: '»'; +} +.ant-calendar-header .ant-calendar-prev-month-btn { + left: 29px; +} +.ant-calendar-header .ant-calendar-prev-month-btn:after { + content: '‹'; +} +.ant-calendar-header .ant-calendar-next-month-btn { + right: 29px; +} +.ant-calendar-header .ant-calendar-next-month-btn:after { + content: '›'; +} +.ant-calendar-body { + padding: 8px 12px; +} +.ant-calendar table { + border-collapse: collapse; + max-width: 100%; + background-color: transparent; + width: 100%; +} +.ant-calendar table, +.ant-calendar th, +.ant-calendar td { + border: 0; + text-align: center; +} +.ant-calendar-calendar-table { + border-spacing: 0; + margin-bottom: 0; +} +.ant-calendar-column-header { + line-height: 18px; + width: 33px; + padding: 6px 0; + text-align: center; +} +.ant-calendar-column-header .ant-calendar-column-header-inner { + display: block; + font-weight: normal; +} +.ant-calendar-week-number-header .ant-calendar-column-header-inner { + display: none; +} +.ant-calendar-cell { + padding: 3px 0; + height: 30px; +} +.ant-calendar-date { + display: block; + margin: 0 auto; + color: rgba(0, 0, 0, 0.65); + border-radius: 2px; + width: 24px; + height: 24px; + line-height: 22px; + border: 1px solid transparent; + padding: 0; + background: transparent; + text-align: center; + -webkit-transition: background 0.3s ease; + transition: background 0.3s ease; +} +.ant-calendar-date-panel { + position: relative; +} +.ant-calendar-date:hover { + background: #e6f7ff; + cursor: pointer; +} +.ant-calendar-date:active { + color: #fff; + background: #40a9ff; +} +.ant-calendar-today .ant-calendar-date { + border-color: #1890ff; + font-weight: bold; + color: #1890ff; +} +.ant-calendar-last-month-cell .ant-calendar-date, +.ant-calendar-next-month-btn-day .ant-calendar-date { + color: rgba(0, 0, 0, 0.25); +} +.ant-calendar-selected-day .ant-calendar-date { + background: #1890ff; + color: #fff; + border: 1px solid transparent; +} +.ant-calendar-selected-day .ant-calendar-date:hover { + background: #1890ff; +} +.ant-calendar-disabled-cell .ant-calendar-date { + cursor: not-allowed; + color: #bcbcbc; + background: #f5f5f5; + border-radius: 0; + width: auto; + border: 1px solid transparent; +} +.ant-calendar-disabled-cell .ant-calendar-date:hover { + background: #f5f5f5; +} +.ant-calendar-disabled-cell.ant-calendar-today .ant-calendar-date { + position: relative; + margin-right: 5px; + padding-left: 5px; +} +.ant-calendar-disabled-cell.ant-calendar-today .ant-calendar-date:before { + content: " "; + position: absolute; + top: -1px; + left: 5px; + width: 24px; + height: 24px; + border: 1px solid #bcbcbc; + border-radius: 2px; +} +.ant-calendar-disabled-cell-first-of-row .ant-calendar-date { + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +.ant-calendar-disabled-cell-last-of-row .ant-calendar-date { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +.ant-calendar-footer { + border-top: 1px solid #e8e8e8; + line-height: 38px; + padding: 0 12px; +} +.ant-calendar-footer:empty { + border-top: 0; +} +.ant-calendar-footer-btn { + text-align: center; + display: block; +} +.ant-calendar-footer-extra + .ant-calendar-footer-btn { + border-top: 1px solid #e8e8e8; + margin: 0 -12px; + padding: 0 12px; +} +.ant-calendar .ant-calendar-today-btn, +.ant-calendar .ant-calendar-clear-btn { + display: inline-block; + text-align: center; + margin: 0 0 0 8px; +} +.ant-calendar .ant-calendar-today-btn-disabled, +.ant-calendar .ant-calendar-clear-btn-disabled { + color: rgba(0, 0, 0, 0.25); + cursor: not-allowed; +} +.ant-calendar .ant-calendar-today-btn:only-child, +.ant-calendar .ant-calendar-clear-btn:only-child { + margin: 0; +} +.ant-calendar .ant-calendar-clear-btn { + display: none; + position: absolute; + right: 5px; + text-indent: -76px; + overflow: hidden; + width: 20px; + height: 20px; + text-align: center; + line-height: 20px; + top: 7px; + margin: 0; +} +.ant-calendar .ant-calendar-clear-btn:after { + font-family: 'anticon'; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + content: "\e62e"; + font-size: 14px; + color: rgba(0, 0, 0, 0.25); + display: inline-block; + line-height: 1; + width: 20px; + text-indent: 43px; + -webkit-transition: color 0.3s ease; + transition: color 0.3s ease; +} +.ant-calendar .ant-calendar-clear-btn:hover:after { + color: rgba(0, 0, 0, 0.45); +} +.ant-calendar .ant-calendar-ok-btn { + display: inline-block; + font-weight: 400; + text-align: center; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 0 15px; + height: 32px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); + transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); + position: relative; + color: #fff; + background-color: #1890ff; + border-color: #1890ff; + padding: 0 7px; + font-size: 14px; + border-radius: 4px; + height: 24px; + line-height: 22px; +} +.ant-calendar .ant-calendar-ok-btn > .anticon { + line-height: 1; +} +.ant-calendar .ant-calendar-ok-btn, +.ant-calendar .ant-calendar-ok-btn:active, +.ant-calendar .ant-calendar-ok-btn:focus { + outline: 0; +} +.ant-calendar .ant-calendar-ok-btn:not([disabled]):hover { + text-decoration: none; +} +.ant-calendar .ant-calendar-ok-btn:not([disabled]):active { + outline: 0; + -webkit-transition: none; + transition: none; +} +.ant-calendar .ant-calendar-ok-btn.disabled, +.ant-calendar .ant-calendar-ok-btn[disabled] { + cursor: not-allowed; +} +.ant-calendar .ant-calendar-ok-btn.disabled > *, +.ant-calendar .ant-calendar-ok-btn[disabled] > * { + pointer-events: none; +} +.ant-calendar .ant-calendar-ok-btn-lg { + padding: 0 15px; + font-size: 16px; + border-radius: 4px; + height: 40px; +} +.ant-calendar .ant-calendar-ok-btn-sm { + padding: 0 7px; + font-size: 14px; + border-radius: 4px; + height: 24px; +} +.ant-calendar .ant-calendar-ok-btn > a:only-child { + color: currentColor; +} +.ant-calendar .ant-calendar-ok-btn > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-calendar .ant-calendar-ok-btn:hover, +.ant-calendar .ant-calendar-ok-btn:focus { + color: #fff; + background-color: #40a9ff; + border-color: #40a9ff; +} +.ant-calendar .ant-calendar-ok-btn:hover > a:only-child, +.ant-calendar .ant-calendar-ok-btn:focus > a:only-child { + color: currentColor; +} +.ant-calendar .ant-calendar-ok-btn:hover > a:only-child:after, +.ant-calendar .ant-calendar-ok-btn:focus > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-calendar .ant-calendar-ok-btn:active, +.ant-calendar .ant-calendar-ok-btn.active { + color: #fff; + background-color: #096dd9; + border-color: #096dd9; +} +.ant-calendar .ant-calendar-ok-btn:active > a:only-child, +.ant-calendar .ant-calendar-ok-btn.active > a:only-child { + color: currentColor; +} +.ant-calendar .ant-calendar-ok-btn:active > a:only-child:after, +.ant-calendar .ant-calendar-ok-btn.active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-calendar .ant-calendar-ok-btn.disabled, +.ant-calendar .ant-calendar-ok-btn[disabled], +.ant-calendar .ant-calendar-ok-btn.disabled:hover, +.ant-calendar .ant-calendar-ok-btn[disabled]:hover, +.ant-calendar .ant-calendar-ok-btn.disabled:focus, +.ant-calendar .ant-calendar-ok-btn[disabled]:focus, +.ant-calendar .ant-calendar-ok-btn.disabled:active, +.ant-calendar .ant-calendar-ok-btn[disabled]:active, +.ant-calendar .ant-calendar-ok-btn.disabled.active, +.ant-calendar .ant-calendar-ok-btn[disabled].active { + color: rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + border-color: #d9d9d9; +} +.ant-calendar .ant-calendar-ok-btn.disabled > a:only-child, +.ant-calendar .ant-calendar-ok-btn[disabled] > a:only-child, +.ant-calendar .ant-calendar-ok-btn.disabled:hover > a:only-child, +.ant-calendar .ant-calendar-ok-btn[disabled]:hover > a:only-child, +.ant-calendar .ant-calendar-ok-btn.disabled:focus > a:only-child, +.ant-calendar .ant-calendar-ok-btn[disabled]:focus > a:only-child, +.ant-calendar .ant-calendar-ok-btn.disabled:active > a:only-child, +.ant-calendar .ant-calendar-ok-btn[disabled]:active > a:only-child, +.ant-calendar .ant-calendar-ok-btn.disabled.active > a:only-child, +.ant-calendar .ant-calendar-ok-btn[disabled].active > a:only-child { + color: currentColor; +} +.ant-calendar .ant-calendar-ok-btn.disabled > a:only-child:after, +.ant-calendar .ant-calendar-ok-btn[disabled] > a:only-child:after, +.ant-calendar .ant-calendar-ok-btn.disabled:hover > a:only-child:after, +.ant-calendar .ant-calendar-ok-btn[disabled]:hover > a:only-child:after, +.ant-calendar .ant-calendar-ok-btn.disabled:focus > a:only-child:after, +.ant-calendar .ant-calendar-ok-btn[disabled]:focus > a:only-child:after, +.ant-calendar .ant-calendar-ok-btn.disabled:active > a:only-child:after, +.ant-calendar .ant-calendar-ok-btn[disabled]:active > a:only-child:after, +.ant-calendar .ant-calendar-ok-btn.disabled.active > a:only-child:after, +.ant-calendar .ant-calendar-ok-btn[disabled].active > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-calendar .ant-calendar-ok-btn-disabled { + color: rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + border-color: #d9d9d9; + cursor: not-allowed; +} +.ant-calendar .ant-calendar-ok-btn-disabled > a:only-child { + color: currentColor; +} +.ant-calendar .ant-calendar-ok-btn-disabled > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-calendar .ant-calendar-ok-btn-disabled:hover { + color: rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + border-color: #d9d9d9; +} +.ant-calendar .ant-calendar-ok-btn-disabled:hover > a:only-child { + color: currentColor; +} +.ant-calendar .ant-calendar-ok-btn-disabled:hover > a:only-child:after { + content: ''; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: transparent; +} +.ant-calendar-range-picker-input { + background-color: transparent; + border: 0; + height: 99%; + outline: 0; + width: 44%; + text-align: center; +} +.ant-calendar-range-picker-input::-moz-placeholder { + color: #bfbfbf; + opacity: 1; +} +.ant-calendar-range-picker-input:-ms-input-placeholder { + color: #bfbfbf; +} +.ant-calendar-range-picker-input::-webkit-input-placeholder { + color: #bfbfbf; +} +.ant-calendar-range-picker-input[disabled] { + cursor: not-allowed; +} +.ant-calendar-range-picker-separator { + color: rgba(0, 0, 0, 0.45); + width: 10px; + display: inline-block; + height: 100%; + vertical-align: top; +} +.ant-calendar-range { + width: 552px; + overflow: hidden; +} +.ant-calendar-range .ant-calendar-date-panel::after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.ant-calendar-range-part { + width: 50%; + position: relative; +} +.ant-calendar-range-left { + float: left; +} +.ant-calendar-range-left .ant-calendar-time-picker-inner { + border-right: 1.5px solid #e8e8e8; +} +.ant-calendar-range-right { + float: right; +} +.ant-calendar-range-right .ant-calendar-time-picker-inner { + border-left: 1.5px solid #e8e8e8; +} +.ant-calendar-range-middle { + position: absolute; + left: 50%; + width: 20px; + margin-left: -132px; + text-align: center; + height: 34px; + line-height: 34px; + color: rgba(0, 0, 0, 0.45); +} +.ant-calendar-range-right .ant-calendar-date-input-wrap { + margin-left: -118px; +} +.ant-calendar-range.ant-calendar-time .ant-calendar-range-middle { + margin-left: -12px; +} +.ant-calendar-range.ant-calendar-time .ant-calendar-range-right .ant-calendar-date-input-wrap { + margin-left: 0; +} +.ant-calendar-range .ant-calendar-input-wrap { + position: relative; + height: 34px; +} +.ant-calendar-range .ant-calendar-input, +.ant-calendar-range .ant-calendar-time-picker-input { + position: relative; + display: inline-block; + padding: 4px 11px; + width: 100%; + height: 32px; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + background-color: #fff; + background-image: none; + border: 1px solid #d9d9d9; + border-radius: 4px; + -webkit-transition: all .3s; + transition: all .3s; + height: 24px; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + padding-left: 0; + padding-right: 0; +} +.ant-calendar-range .ant-calendar-input::-moz-placeholder, +.ant-calendar-range .ant-calendar-time-picker-input::-moz-placeholder { + color: #bfbfbf; + opacity: 1; +} +.ant-calendar-range .ant-calendar-input:-ms-input-placeholder, +.ant-calendar-range .ant-calendar-time-picker-input:-ms-input-placeholder { + color: #bfbfbf; +} +.ant-calendar-range .ant-calendar-input::-webkit-input-placeholder, +.ant-calendar-range .ant-calendar-time-picker-input::-webkit-input-placeholder { + color: #bfbfbf; +} +.ant-calendar-range .ant-calendar-input:hover, +.ant-calendar-range .ant-calendar-time-picker-input:hover { + border-color: #40a9ff; +} +.ant-calendar-range .ant-calendar-input:focus, +.ant-calendar-range .ant-calendar-time-picker-input:focus { + border-color: #40a9ff; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); + box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); +} +.ant-calendar-range .ant-calendar-input-disabled, +.ant-calendar-range .ant-calendar-time-picker-input-disabled { + background-color: #f5f5f5; + opacity: 1; + cursor: not-allowed; + color: rgba(0, 0, 0, 0.25); +} +.ant-calendar-range .ant-calendar-input-disabled:hover, +.ant-calendar-range .ant-calendar-time-picker-input-disabled:hover { + border-color: #e6d8d8; +} +textarea.ant-calendar-range .ant-calendar-input, +textarea.ant-calendar-range .ant-calendar-time-picker-input { + max-width: 100%; + height: auto; + vertical-align: bottom; + -webkit-transition: all .3s, height 0s; + transition: all .3s, height 0s; + min-height: 32px; +} +.ant-calendar-range .ant-calendar-input-lg, +.ant-calendar-range .ant-calendar-time-picker-input-lg { + padding: 6px 11px; + height: 40px; + font-size: 16px; +} +.ant-calendar-range .ant-calendar-input-sm, +.ant-calendar-range .ant-calendar-time-picker-input-sm { + padding: 1px 7px; + height: 24px; +} +.ant-calendar-range .ant-calendar-input:focus, +.ant-calendar-range .ant-calendar-time-picker-input:focus { + -webkit-box-shadow: none; + box-shadow: none; +} +.ant-calendar-range .ant-calendar-time-picker-icon { + display: none; +} +.ant-calendar-range.ant-calendar-week-number { + width: 574px; +} +.ant-calendar-range.ant-calendar-week-number .ant-calendar-range-part { + width: 286px; +} +.ant-calendar-range .ant-calendar-year-panel, +.ant-calendar-range .ant-calendar-month-panel, +.ant-calendar-range .ant-calendar-decade-panel { + top: 34px; +} +.ant-calendar-range .ant-calendar-month-panel .ant-calendar-year-panel { + top: 0; +} +.ant-calendar-range .ant-calendar-decade-panel-table, +.ant-calendar-range .ant-calendar-year-panel-table, +.ant-calendar-range .ant-calendar-month-panel-table { + height: 208px; +} +.ant-calendar-range .ant-calendar-in-range-cell { + border-radius: 0; + position: relative; +} +.ant-calendar-range .ant-calendar-in-range-cell > div { + position: relative; + z-index: 1; +} +.ant-calendar-range .ant-calendar-in-range-cell:before { + content: ''; + display: block; + background: #e6f7ff; + border-radius: 0; + border: 0; + position: absolute; + top: 4px; + bottom: 4px; + left: 0; + right: 0; +} +div.ant-calendar-range-quick-selector { + text-align: left; +} +div.ant-calendar-range-quick-selector > a { + margin-right: 8px; +} +.ant-calendar-range .ant-calendar-header, +.ant-calendar-range .ant-calendar-month-panel-header, +.ant-calendar-range .ant-calendar-year-panel-header { + border-bottom: 0; +} +.ant-calendar-range .ant-calendar-body, +.ant-calendar-range .ant-calendar-month-panel-body, +.ant-calendar-range .ant-calendar-year-panel-body { + border-top: 1px solid #e8e8e8; +} +.ant-calendar-range.ant-calendar-time .ant-calendar-time-picker { + height: 207px; + width: 100%; + top: 68px; + z-index: 2; +} +.ant-calendar-range.ant-calendar-time .ant-calendar-time-picker-panel { + height: 267px; + margin-top: -34px; +} +.ant-calendar-range.ant-calendar-time .ant-calendar-time-picker-inner { + padding-top: 40px; + height: 100%; + background: none; +} +.ant-calendar-range.ant-calendar-time .ant-calendar-time-picker-combobox { + display: inline-block; + height: 100%; + background-color: #fff; + border-top: 1px solid #e8e8e8; +} +.ant-calendar-range.ant-calendar-time .ant-calendar-time-picker-select { + height: 100%; +} +.ant-calendar-range.ant-calendar-time .ant-calendar-time-picker-select ul { + max-height: 100%; +} +.ant-calendar-range.ant-calendar-time .ant-calendar-footer .ant-calendar-time-picker-btn { + margin-right: 8px; +} +.ant-calendar-range.ant-calendar-time .ant-calendar-today-btn { + margin: 8px 12px; + height: 22px; + line-height: 22px; +} +.ant-calendar-range-with-ranges.ant-calendar-time .ant-calendar-time-picker { + height: 247px; +} +.ant-calendar-range-with-ranges.ant-calendar-time .ant-calendar-time-picker-panel { + height: 281px; +} +.ant-calendar-range.ant-calendar-show-time-picker .ant-calendar-body { + border-top-color: transparent; +} +.ant-calendar-time-picker { + position: absolute; + width: 100%; + top: 40px; + background-color: #fff; +} +.ant-calendar-time-picker-panel { + z-index: 1050; + position: absolute; + width: 100%; +} +.ant-calendar-time-picker-inner { + display: inline-block; + position: relative; + outline: none; + list-style: none; + font-size: 14px; + text-align: left; + background-color: #fff; + background-clip: padding-box; + line-height: 1.5; + overflow: hidden; + width: 100%; +} +.ant-calendar-time-picker-combobox { + width: 100%; +} +.ant-calendar-time-picker-column-1, +.ant-calendar-time-picker-column-1 .ant-calendar-time-picker-select { + width: 100%; +} +.ant-calendar-time-picker-column-2 .ant-calendar-time-picker-select { + width: 50%; +} +.ant-calendar-time-picker-column-3 .ant-calendar-time-picker-select { + width: 33.33%; +} +.ant-calendar-time-picker-column-4 .ant-calendar-time-picker-select { + width: 25%; +} +.ant-calendar-time-picker-input-wrap { + display: none; +} +.ant-calendar-time-picker-select { + float: left; + font-size: 14px; + border-right: 1px solid #e8e8e8; + -webkit-box-sizing: border-box; + box-sizing: border-box; + overflow: hidden; + position: relative; + height: 226px; +} +.ant-calendar-time-picker-select:hover { + overflow-y: auto; +} +.ant-calendar-time-picker-select:first-child { + border-left: 0; + margin-left: 0; +} +.ant-calendar-time-picker-select:last-child { + border-right: 0; +} +.ant-calendar-time-picker-select ul { + list-style: none; + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + width: 100%; + max-height: 206px; +} +.ant-calendar-time-picker-select li { + text-align: center; + list-style: none; + -webkit-box-sizing: content-box; + box-sizing: content-box; + margin: 0; + width: 100%; + height: 24px; + line-height: 24px; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-transition: background 0.3s ease; + transition: background 0.3s ease; +} +.ant-calendar-time-picker-select li:last-child:after { + content: ''; + height: 202px; + display: block; +} +.ant-calendar-time-picker-select li:hover { + background: #e6f7ff; +} +li.ant-calendar-time-picker-select-option-selected { + background: #f5f5f5; + font-weight: bold; +} +li.ant-calendar-time-picker-select-option-disabled { + color: rgba(0, 0, 0, 0.25); +} +li.ant-calendar-time-picker-select-option-disabled:hover { + background: transparent; + cursor: not-allowed; +} +.ant-calendar-time .ant-calendar-day-select { + padding: 0 2px; + font-weight: 500; + display: inline-block; + color: rgba(0, 0, 0, 0.85); + line-height: 34px; +} +.ant-calendar-time .ant-calendar-footer { + position: relative; + height: auto; +} +.ant-calendar-time .ant-calendar-footer-btn { + text-align: right; +} +.ant-calendar-time .ant-calendar-footer .ant-calendar-today-btn { + float: left; + margin: 0; +} +.ant-calendar-time .ant-calendar-footer .ant-calendar-time-picker-btn { + display: inline-block; + margin-right: 8px; +} +.ant-calendar-time .ant-calendar-footer .ant-calendar-time-picker-btn-disabled { + color: rgba(0, 0, 0, 0.25); +} +.ant-calendar-month-panel { + position: absolute; + top: 1px; + right: 0; + bottom: 0; + left: 0; + z-index: 10; + border-radius: 4px; + background: #fff; + outline: none; +} +.ant-calendar-month-panel > div { + height: 100%; +} +.ant-calendar-month-panel-hidden { + display: none; +} +.ant-calendar-month-panel-header { + height: 40px; + line-height: 40px; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + border-bottom: 1px solid #e8e8e8; +} +.ant-calendar-month-panel-header a:hover { + color: #40a9ff; +} +.ant-calendar-month-panel-header .ant-calendar-month-panel-century-select, +.ant-calendar-month-panel-header .ant-calendar-month-panel-decade-select, +.ant-calendar-month-panel-header .ant-calendar-month-panel-year-select, +.ant-calendar-month-panel-header .ant-calendar-month-panel-month-select { + padding: 0 2px; + font-weight: 500; + display: inline-block; + color: rgba(0, 0, 0, 0.85); + line-height: 40px; +} +.ant-calendar-month-panel-header .ant-calendar-month-panel-century-select-arrow, +.ant-calendar-month-panel-header .ant-calendar-month-panel-decade-select-arrow, +.ant-calendar-month-panel-header .ant-calendar-month-panel-year-select-arrow, +.ant-calendar-month-panel-header .ant-calendar-month-panel-month-select-arrow { + display: none; +} +.ant-calendar-month-panel-header .ant-calendar-month-panel-prev-century-btn, +.ant-calendar-month-panel-header .ant-calendar-month-panel-next-century-btn, +.ant-calendar-month-panel-header .ant-calendar-month-panel-prev-decade-btn, +.ant-calendar-month-panel-header .ant-calendar-month-panel-next-decade-btn, +.ant-calendar-month-panel-header .ant-calendar-month-panel-prev-month-btn, +.ant-calendar-month-panel-header .ant-calendar-month-panel-next-month-btn, +.ant-calendar-month-panel-header .ant-calendar-month-panel-prev-year-btn, +.ant-calendar-month-panel-header .ant-calendar-month-panel-next-year-btn { + position: absolute; + top: 0; + color: rgba(0, 0, 0, 0.45); + font-family: Arial, "Hiragino Sans GB", "Microsoft Yahei", "Microsoft Sans Serif", sans-serif; + padding: 0 5px; + font-size: 16px; + display: inline-block; + line-height: 40px; +} +.ant-calendar-month-panel-header .ant-calendar-month-panel-prev-century-btn, +.ant-calendar-month-panel-header .ant-calendar-month-panel-prev-decade-btn, +.ant-calendar-month-panel-header .ant-calendar-month-panel-prev-year-btn { + left: 7px; +} +.ant-calendar-month-panel-header .ant-calendar-month-panel-prev-century-btn:after, +.ant-calendar-month-panel-header .ant-calendar-month-panel-prev-decade-btn:after, +.ant-calendar-month-panel-header .ant-calendar-month-panel-prev-year-btn:after { + content: '«'; +} +.ant-calendar-month-panel-header .ant-calendar-month-panel-next-century-btn, +.ant-calendar-month-panel-header .ant-calendar-month-panel-next-decade-btn, +.ant-calendar-month-panel-header .ant-calendar-month-panel-next-year-btn { + right: 7px; +} +.ant-calendar-month-panel-header .ant-calendar-month-panel-next-century-btn:after, +.ant-calendar-month-panel-header .ant-calendar-month-panel-next-decade-btn:after, +.ant-calendar-month-panel-header .ant-calendar-month-panel-next-year-btn:after { + content: '»'; +} +.ant-calendar-month-panel-header .ant-calendar-month-panel-prev-month-btn { + left: 29px; +} +.ant-calendar-month-panel-header .ant-calendar-month-panel-prev-month-btn:after { + content: '‹'; +} +.ant-calendar-month-panel-header .ant-calendar-month-panel-next-month-btn { + right: 29px; +} +.ant-calendar-month-panel-header .ant-calendar-month-panel-next-month-btn:after { + content: '›'; +} +.ant-calendar-month-panel-body { + height: calc(100% - 40px); +} +.ant-calendar-month-panel-table { + table-layout: fixed; + width: 100%; + height: 100%; + border-collapse: separate; +} +.ant-calendar-month-panel-selected-cell .ant-calendar-month-panel-month { + background: #1890ff; + color: #fff; +} +.ant-calendar-month-panel-selected-cell .ant-calendar-month-panel-month:hover { + background: #1890ff; + color: #fff; +} +.ant-calendar-month-panel-cell { + text-align: center; +} +.ant-calendar-month-panel-cell-disabled .ant-calendar-month-panel-month, +.ant-calendar-month-panel-cell-disabled .ant-calendar-month-panel-month:hover { + cursor: not-allowed; + color: #bcbcbc; + background: #f5f5f5; +} +.ant-calendar-month-panel-month { + display: inline-block; + margin: 0 auto; + color: rgba(0, 0, 0, 0.65); + background: transparent; + text-align: center; + height: 24px; + line-height: 24px; + padding: 0 8px; + border-radius: 2px; + -webkit-transition: background 0.3s ease; + transition: background 0.3s ease; +} +.ant-calendar-month-panel-month:hover { + background: #e6f7ff; + cursor: pointer; +} +.ant-calendar-year-panel { + position: absolute; + top: 1px; + right: 0; + bottom: 0; + left: 0; + z-index: 10; + border-radius: 4px; + background: #fff; + outline: none; +} +.ant-calendar-year-panel > div { + height: 100%; +} +.ant-calendar-year-panel-hidden { + display: none; +} +.ant-calendar-year-panel-header { + height: 40px; + line-height: 40px; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + border-bottom: 1px solid #e8e8e8; +} +.ant-calendar-year-panel-header a:hover { + color: #40a9ff; +} +.ant-calendar-year-panel-header .ant-calendar-year-panel-century-select, +.ant-calendar-year-panel-header .ant-calendar-year-panel-decade-select, +.ant-calendar-year-panel-header .ant-calendar-year-panel-year-select, +.ant-calendar-year-panel-header .ant-calendar-year-panel-month-select { + padding: 0 2px; + font-weight: 500; + display: inline-block; + color: rgba(0, 0, 0, 0.85); + line-height: 40px; +} +.ant-calendar-year-panel-header .ant-calendar-year-panel-century-select-arrow, +.ant-calendar-year-panel-header .ant-calendar-year-panel-decade-select-arrow, +.ant-calendar-year-panel-header .ant-calendar-year-panel-year-select-arrow, +.ant-calendar-year-panel-header .ant-calendar-year-panel-month-select-arrow { + display: none; +} +.ant-calendar-year-panel-header .ant-calendar-year-panel-prev-century-btn, +.ant-calendar-year-panel-header .ant-calendar-year-panel-next-century-btn, +.ant-calendar-year-panel-header .ant-calendar-year-panel-prev-decade-btn, +.ant-calendar-year-panel-header .ant-calendar-year-panel-next-decade-btn, +.ant-calendar-year-panel-header .ant-calendar-year-panel-prev-month-btn, +.ant-calendar-year-panel-header .ant-calendar-year-panel-next-month-btn, +.ant-calendar-year-panel-header .ant-calendar-year-panel-prev-year-btn, +.ant-calendar-year-panel-header .ant-calendar-year-panel-next-year-btn { + position: absolute; + top: 0; + color: rgba(0, 0, 0, 0.45); + font-family: Arial, "Hiragino Sans GB", "Microsoft Yahei", "Microsoft Sans Serif", sans-serif; + padding: 0 5px; + font-size: 16px; + display: inline-block; + line-height: 40px; +} +.ant-calendar-year-panel-header .ant-calendar-year-panel-prev-century-btn, +.ant-calendar-year-panel-header .ant-calendar-year-panel-prev-decade-btn, +.ant-calendar-year-panel-header .ant-calendar-year-panel-prev-year-btn { + left: 7px; +} +.ant-calendar-year-panel-header .ant-calendar-year-panel-prev-century-btn:after, +.ant-calendar-year-panel-header .ant-calendar-year-panel-prev-decade-btn:after, +.ant-calendar-year-panel-header .ant-calendar-year-panel-prev-year-btn:after { + content: '«'; +} +.ant-calendar-year-panel-header .ant-calendar-year-panel-next-century-btn, +.ant-calendar-year-panel-header .ant-calendar-year-panel-next-decade-btn, +.ant-calendar-year-panel-header .ant-calendar-year-panel-next-year-btn { + right: 7px; +} +.ant-calendar-year-panel-header .ant-calendar-year-panel-next-century-btn:after, +.ant-calendar-year-panel-header .ant-calendar-year-panel-next-decade-btn:after, +.ant-calendar-year-panel-header .ant-calendar-year-panel-next-year-btn:after { + content: '»'; +} +.ant-calendar-year-panel-header .ant-calendar-year-panel-prev-month-btn { + left: 29px; +} +.ant-calendar-year-panel-header .ant-calendar-year-panel-prev-month-btn:after { + content: '‹'; +} +.ant-calendar-year-panel-header .ant-calendar-year-panel-next-month-btn { + right: 29px; +} +.ant-calendar-year-panel-header .ant-calendar-year-panel-next-month-btn:after { + content: '›'; +} +.ant-calendar-year-panel-body { + height: calc(100% - 40px); +} +.ant-calendar-year-panel-table { + table-layout: fixed; + width: 100%; + height: 100%; + border-collapse: separate; +} +.ant-calendar-year-panel-cell { + text-align: center; +} +.ant-calendar-year-panel-year { + display: inline-block; + margin: 0 auto; + color: rgba(0, 0, 0, 0.65); + background: transparent; + text-align: center; + height: 24px; + line-height: 24px; + padding: 0 8px; + border-radius: 2px; + -webkit-transition: background 0.3s ease; + transition: background 0.3s ease; +} +.ant-calendar-year-panel-year:hover { + background: #e6f7ff; + cursor: pointer; +} +.ant-calendar-year-panel-selected-cell .ant-calendar-year-panel-year { + background: #1890ff; + color: #fff; +} +.ant-calendar-year-panel-selected-cell .ant-calendar-year-panel-year:hover { + background: #1890ff; + color: #fff; +} +.ant-calendar-year-panel-last-decade-cell .ant-calendar-year-panel-year, +.ant-calendar-year-panel-next-decade-cell .ant-calendar-year-panel-year { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + color: rgba(0, 0, 0, 0.25); +} +.ant-calendar-decade-panel { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 10; + background: #fff; + border-radius: 4px; + outline: none; +} +.ant-calendar-decade-panel-hidden { + display: none; +} +.ant-calendar-decade-panel-header { + height: 40px; + line-height: 40px; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + border-bottom: 1px solid #e8e8e8; +} +.ant-calendar-decade-panel-header a:hover { + color: #40a9ff; +} +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-century-select, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-decade-select, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-year-select, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-month-select { + padding: 0 2px; + font-weight: 500; + display: inline-block; + color: rgba(0, 0, 0, 0.85); + line-height: 40px; +} +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-century-select-arrow, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-decade-select-arrow, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-year-select-arrow, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-month-select-arrow { + display: none; +} +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-prev-century-btn, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-next-century-btn, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-prev-decade-btn, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-next-decade-btn, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-prev-month-btn, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-next-month-btn, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-prev-year-btn, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-next-year-btn { + position: absolute; + top: 0; + color: rgba(0, 0, 0, 0.45); + font-family: Arial, "Hiragino Sans GB", "Microsoft Yahei", "Microsoft Sans Serif", sans-serif; + padding: 0 5px; + font-size: 16px; + display: inline-block; + line-height: 40px; +} +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-prev-century-btn, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-prev-decade-btn, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-prev-year-btn { + left: 7px; +} +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-prev-century-btn:after, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-prev-decade-btn:after, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-prev-year-btn:after { + content: '«'; +} +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-next-century-btn, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-next-decade-btn, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-next-year-btn { + right: 7px; +} +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-next-century-btn:after, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-next-decade-btn:after, +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-next-year-btn:after { + content: '»'; +} +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-prev-month-btn { + left: 29px; +} +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-prev-month-btn:after { + content: '‹'; +} +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-next-month-btn { + right: 29px; +} +.ant-calendar-decade-panel-header .ant-calendar-decade-panel-next-month-btn:after { + content: '›'; +} +.ant-calendar-decade-panel-body { + height: calc(100% - 40px); +} +.ant-calendar-decade-panel-table { + table-layout: fixed; + width: 100%; + height: 100%; + border-collapse: separate; +} +.ant-calendar-decade-panel-cell { + text-align: center; + white-space: nowrap; +} +.ant-calendar-decade-panel-decade { + display: inline-block; + margin: 0 auto; + color: rgba(0, 0, 0, 0.65); + background: transparent; + text-align: center; + height: 24px; + line-height: 24px; + padding: 0 6px; + border-radius: 2px; + -webkit-transition: background 0.3s ease; + transition: background 0.3s ease; +} +.ant-calendar-decade-panel-decade:hover { + background: #e6f7ff; + cursor: pointer; +} +.ant-calendar-decade-panel-selected-cell .ant-calendar-decade-panel-decade { + background: #1890ff; + color: #fff; +} +.ant-calendar-decade-panel-selected-cell .ant-calendar-decade-panel-decade:hover { + background: #1890ff; + color: #fff; +} +.ant-calendar-decade-panel-last-century-cell .ant-calendar-decade-panel-decade, +.ant-calendar-decade-panel-next-century-cell .ant-calendar-decade-panel-decade { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + color: rgba(0, 0, 0, 0.25); +} +.ant-calendar-month .ant-calendar-month-header-wrap { + position: relative; + height: 288px; +} +.ant-calendar-month .ant-calendar-month-panel, +.ant-calendar-month .ant-calendar-year-panel { + top: 0; + height: 100%; +} +.ant-calendar-week-number-cell { + opacity: 0.5; +} +.ant-calendar-week-number .ant-calendar-body tr { + -webkit-transition: all .3s; + transition: all .3s; + cursor: pointer; +} +.ant-calendar-week-number .ant-calendar-body tr:hover { + background: #e6f7ff; +} +.ant-calendar-week-number .ant-calendar-body tr.ant-calendar-active-week { + background: #bae7ff; + font-weight: bold; +} +.ant-calendar-week-number .ant-calendar-body tr .ant-calendar-selected-day .ant-calendar-date, +.ant-calendar-week-number .ant-calendar-body tr .ant-calendar-selected-day:hover .ant-calendar-date { + background: transparent; + color: rgba(0, 0, 0, 0.65); +} diff --git a/es/date-picker/style/index.js b/es/date-picker/style/index.js new file mode 100644 index 0000000000..8f231b536a --- /dev/null +++ b/es/date-picker/style/index.js @@ -0,0 +1,6 @@ +import '../../style/index.less'; +import './index.less'; + +// style dependencies +import '../../input/style'; +import '../../time-picker/style'; \ No newline at end of file diff --git a/es/date-picker/style/index.less b/es/date-picker/style/index.less new file mode 100644 index 0000000000..466b7e889f --- /dev/null +++ b/es/date-picker/style/index.less @@ -0,0 +1,17 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; +@import "../../input/style/mixin"; +@import "../../button/style/mixin"; + +@calendar-prefix-cls: ~"@{ant-prefix}-calendar"; +@calendar-timepicker-prefix-cls: ~"@{ant-prefix}-calendar-time-picker"; + +@import "Picker"; +@import "Calendar"; +@import "RangePicker"; +@import "TimePicker"; +@import "MonthPanel"; +@import "YearPanel"; +@import "DecadePanel"; +@import "MonthPicker"; +@import "WeekPicker"; diff --git a/es/date-picker/wrapPicker.js b/es/date-picker/wrapPicker.js new file mode 100644 index 0000000000..310878a0f7 --- /dev/null +++ b/es/date-picker/wrapPicker.js @@ -0,0 +1,154 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _extends from 'babel-runtime/helpers/extends'; + +import TimePickerPanel from '../vc-time-picker/Panel'; +import classNames from 'classnames'; +import LocaleReceiver from '../locale-provider/LocaleReceiver'; +import { generateShowHourMinuteSecond } from '../time-picker'; +import enUS from './locale/en_US'; +import { getOptionProps, initDefaultProps } from '../_util/props-util'; + +function getColumns(_ref) { + var showHour = _ref.showHour, + showMinute = _ref.showMinute, + showSecond = _ref.showSecond, + use12Hours = _ref.use12Hours; + + var column = 0; + if (showHour) { + column += 1; + } + if (showMinute) { + column += 1; + } + if (showSecond) { + column += 1; + } + if (use12Hours) { + column += 1; + } + return column; +} + +export default function wrapPicker(Picker, props, defaultFormat) { + return { + name: Picker.name, + props: initDefaultProps(props, { + format: defaultFormat || 'YYYY-MM-DD', + transitionName: 'slide-up', + popupStyle: {}, + locale: {}, + prefixCls: 'ant-calendar', + inputPrefixCls: 'ant-input' + }), + model: { + prop: 'value', + event: 'change' + }, + + mounted: function mounted() { + var _this = this; + + var autoFocus = this.autoFocus, + disabled = this.disabled; + + if (autoFocus && !disabled) { + this.$nextTick(function () { + _this.focus(); + }); + } + }, + + methods: { + handleOpenChange: function handleOpenChange(open) { + this.$emit('openChange', open); + }, + handleFocus: function handleFocus(e) { + this.$emit('focus', e); + }, + handleBlur: function handleBlur(e) { + this.$emit('blur', e); + }, + focus: function focus() { + this.$refs.picker.focus(); + }, + blur: function blur() { + this.$refs.picker.blur(); + }, + getDefaultLocale: function getDefaultLocale() { + var result = _extends({}, enUS, this.locale); + result.lang = _extends({}, result.lang, (this.locale || {}).lang); + return result; + }, + renderPicker: function renderPicker(locale, localeCode) { + var _classNames2; + + var h = this.$createElement; + + var props = getOptionProps(this); + var prefixCls = props.prefixCls, + inputPrefixCls = props.inputPrefixCls, + size = props.size, + showTime = props.showTime, + disabled = props.disabled; + + var pickerClass = classNames(prefixCls + '-picker', _defineProperty({}, prefixCls + '-picker-' + size, !!size)); + var pickerInputClass = classNames(prefixCls + '-picker-input', inputPrefixCls, (_classNames2 = {}, _defineProperty(_classNames2, inputPrefixCls + '-lg', size === 'large'), _defineProperty(_classNames2, inputPrefixCls + '-sm', size === 'small'), _defineProperty(_classNames2, inputPrefixCls + '-disabled', disabled), _classNames2)); + + var timeFormat = showTime && showTime.format || 'HH:mm:ss'; + var vcTimePickerProps = _extends({}, generateShowHourMinuteSecond(timeFormat), { + format: timeFormat, + use12Hours: showTime && showTime.use12Hours + }); + var columns = getColumns(vcTimePickerProps); + var timePickerCls = prefixCls + '-time-picker-column-' + columns; + var timePickerPanelProps = { + props: _extends({}, vcTimePickerProps, showTime, { + prefixCls: prefixCls + '-time-picker', + placeholder: locale.timePickerLocale.placeholder, + transitionName: 'slide-up' + }), + 'class': timePickerCls + }; + var timePicker = showTime ? h(TimePickerPanel, timePickerPanelProps) : null; + var pickerProps = { + props: _extends({}, props, { + pickerClass: pickerClass, + pickerInputClass: pickerInputClass, + locale: locale, + localeCode: localeCode, + timePicker: timePicker + }), + on: _extends({}, this.$listeners, { + openChange: this.handleOpenChange, + focus: this.handleFocus, + blur: this.handleBlur + }), + ref: 'picker', + scopedSlots: this.$scopedSlots || {} + }; + return h( + Picker, + pickerProps, + [h( + 'template', + { slot: 'renderExtraFooter' }, + [this.$slots.renderExtraFooter] + )] + ); + } + }, + + render: function render() { + var h = arguments[0]; + + return h(LocaleReceiver, { + attrs: { + componentName: 'DatePicker', + defaultLocale: this.getDefaultLocale + }, + scopedSlots: { 'default': this.renderPicker } + }); + } + }; +} \ No newline at end of file diff --git a/es/divider/index.js b/es/divider/index.js new file mode 100644 index 0000000000..f875682d10 --- /dev/null +++ b/es/divider/index.js @@ -0,0 +1,44 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; + +import PropTypes from '../_util/vue-types'; +export default { + name: 'ADivider', + props: { + prefixCls: PropTypes.string.def('ant'), + type: PropTypes.oneOf(['horizontal', 'vertical']).def('horizontal'), + dashed: PropTypes.bool, + orientation: PropTypes.oneOf(['left', 'right']) + }, + computed: { + classString: function classString() { + var _ref; + + var prefixCls = this.prefixCls, + type = this.type, + $slots = this.$slots, + dashed = this.dashed, + _orientation = this.orientation, + orientation = _orientation === undefined ? '' : _orientation; + + var orientationPrefix = orientation.length > 0 ? '-' + orientation : orientation; + + return _ref = {}, _defineProperty(_ref, prefixCls + '-divider', true), _defineProperty(_ref, prefixCls + '-divider-' + type, true), _defineProperty(_ref, prefixCls + '-divider-with-text' + orientationPrefix, $slots['default']), _defineProperty(_ref, prefixCls + '-divider-dashed', !!dashed), _ref; + } + }, + render: function render() { + var h = arguments[0]; + var classString = this.classString, + prefixCls = this.prefixCls, + $slots = this.$slots; + + return h( + 'div', + { 'class': classString }, + [$slots['default'] && h( + 'span', + { 'class': prefixCls + '-divider-inner-text' }, + [$slots['default']] + )] + ); + } +}; \ No newline at end of file diff --git a/es/divider/style/css.js b/es/divider/style/css.js new file mode 100644 index 0000000000..579ee46c2e --- /dev/null +++ b/es/divider/style/css.js @@ -0,0 +1,2 @@ +import '../../style/index.css'; +import './index.css'; \ No newline at end of file diff --git a/es/divider/style/index.css b/es/divider/style/index.css new file mode 100644 index 0000000000..a9918ddebd --- /dev/null +++ b/es/divider/style/index.css @@ -0,0 +1,141 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-divider { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + background: #e8e8e8; +} +.ant-divider, +.ant-divider-vertical { + margin: 0 8px; + display: inline-block; + height: 0.9em; + width: 1px; + vertical-align: middle; + position: relative; + top: -0.06em; +} +.ant-divider-horizontal { + display: block; + height: 1px; + width: 100%; + margin: 24px 0; +} +.ant-divider-horizontal.ant-divider-with-text { + display: table; + white-space: nowrap; + text-align: center; + background: transparent; + font-weight: 500; + color: rgba(0, 0, 0, 0.85); + font-size: 16px; + margin: 16px 0; +} +.ant-divider-horizontal.ant-divider-with-text:before, +.ant-divider-horizontal.ant-divider-with-text:after { + content: ''; + display: table-cell; + position: relative; + top: 50%; + width: 50%; + border-top: 1px solid #e8e8e8; + -webkit-transform: translateY(50%); + -ms-transform: translateY(50%); + transform: translateY(50%); +} +.ant-divider-inner-text { + display: inline-block; + padding: 0 24px; +} +.ant-divider-horizontal.ant-divider-with-text-left { + display: table; + white-space: nowrap; + text-align: center; + background: transparent; + font-weight: 500; + color: rgba(0, 0, 0, 0.85); + font-size: 14px; + margin: 16px 0; +} +.ant-divider-horizontal.ant-divider-with-text-left:before { + content: ''; + display: table-cell; + position: relative; + top: 50%; + width: 5%; + border-top: 1px solid #e8e8e8; + -webkit-transform: translateY(50%); + -ms-transform: translateY(50%); + transform: translateY(50%); +} +.ant-divider-horizontal.ant-divider-with-text-left:after { + content: ''; + display: table-cell; + position: relative; + top: 50%; + width: 95%; + border-top: 1px solid #e8e8e8; + -webkit-transform: translateY(50%); + -ms-transform: translateY(50%); + transform: translateY(50%); +} +.ant-divider-horizontal.ant-divider-with-text-left-inner-text { + display: inline-block; + padding: 0 10px; +} +.ant-divider-horizontal.ant-divider-with-text-right { + display: table; + white-space: nowrap; + text-align: center; + background: transparent; + font-weight: 500; + color: rgba(0, 0, 0, 0.85); + font-size: 14px; + margin: 16px 0; +} +.ant-divider-horizontal.ant-divider-with-text-right:before { + content: ''; + display: table-cell; + position: relative; + top: 50%; + width: 95%; + border-top: 1px solid #e8e8e8; + -webkit-transform: translateY(50%); + -ms-transform: translateY(50%); + transform: translateY(50%); +} +.ant-divider-horizontal.ant-divider-with-text-right:after { + content: ''; + display: table-cell; + position: relative; + top: 50%; + width: 5%; + border-top: 1px solid #e8e8e8; + -webkit-transform: translateY(50%); + -ms-transform: translateY(50%); + transform: translateY(50%); +} +.ant-divider-horizontal.ant-divider-with-text-right-inner-text { + display: inline-block; + padding: 0 10px; +} +.ant-divider-dashed { + background: none; + border-top: 1px dashed #e8e8e8; +} +.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed { + border-top: 0; +} +.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed:before, +.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed:after { + border-style: dashed none none; +} diff --git a/es/divider/style/index.js b/es/divider/style/index.js new file mode 100644 index 0000000000..1675ad8fe0 --- /dev/null +++ b/es/divider/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less'; +import './index.less'; \ No newline at end of file diff --git a/es/divider/style/index.less b/es/divider/style/index.less new file mode 100644 index 0000000000..50d30153f9 --- /dev/null +++ b/es/divider/style/index.less @@ -0,0 +1,129 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@divider-prefix-cls: ~"@{ant-prefix}-divider"; + +.@{divider-prefix-cls} { + .reset-component; + background: @border-color-split; + + &, // for compatiable + &-vertical { + margin: 0 8px; + display: inline-block; + height: 0.9em; + width: 1px; + vertical-align: middle; + position: relative; + top: -0.06em; + } + &-horizontal { + display: block; + height: 1px; + width: 100%; + margin: 24px 0; + } + &-horizontal&-with-text { + display: table; + white-space: nowrap; + text-align: center; + background: transparent; + font-weight: 500; + color: @heading-color; + font-size: @font-size-lg; + margin: 16px 0; + + &:before, + &:after { + content: ''; + display: table-cell; + position: relative; + top: 50%; + width: 50%; + border-top: 1px solid @border-color-split; + transform: translateY(50%); + } + } + &-inner-text { + display: inline-block; + padding: 0 24px; + } + &-horizontal&-with-text-left { + display: table; + white-space: nowrap; + text-align: center; + background: transparent; + font-weight: 500; + color: @heading-color; + font-size: @font-size-base; + margin: 16px 0; + + &:before { + content: ''; + display: table-cell; + position: relative; + top: 50%; + width: 5%; + border-top: 1px solid @border-color-split; + transform: translateY(50%); + } + &:after { + content: ''; + display: table-cell; + position: relative; + top: 50%; + width: 95%; + border-top: 1px solid @border-color-split; + transform: translateY(50%); + } + &-inner-text { + display: inline-block; + padding: 0 10px; + } + } + + &-horizontal&-with-text-right { + display: table; + white-space: nowrap; + text-align: center; + background: transparent; + font-weight: 500; + color: @heading-color; + font-size: @font-size-base; + margin: 16px 0; + + &:before { + content: ''; + display: table-cell; + position: relative; + top: 50%; + width: 95%; + border-top: 1px solid @border-color-split; + transform: translateY(50%); + } + &:after { + content: ''; + display: table-cell; + position: relative; + top: 50%; + width: 5%; + border-top: 1px solid @border-color-split; + transform: translateY(50%); + } + &-inner-text { + display: inline-block; + padding: 0 10px; + } + } + &-dashed { + background: none; + border-top: 1px dashed @border-color-split; + } + &-horizontal&-with-text&-dashed { + border-top: 0; + &:before, + &:after { + border-style: dashed none none; + } + } +} diff --git a/es/dropdown/dropdown-button.js b/es/dropdown/dropdown-button.js new file mode 100644 index 0000000000..795d88f88a --- /dev/null +++ b/es/dropdown/dropdown-button.js @@ -0,0 +1,102 @@ +import _mergeJSXProps from 'babel-helper-vue-jsx-merge-props'; +import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; +import _extends from 'babel-runtime/helpers/extends'; + +import Button from '../button'; +import { ButtonGroupProps } from '../button/button-group'; +import Icon from '../icon'; +import Dropdown from './dropdown'; +import PropTypes from '../_util/vue-types'; +import { hasProp, getComponentFromProp } from '../_util/props-util'; +import getDropdownProps from './getDropdownProps'; +var DropdownProps = getDropdownProps(); +var ButtonGroup = Button.Group; +var DropdownButtonProps = _extends({}, ButtonGroupProps, DropdownProps, { + type: PropTypes.oneOf(['primary', 'ghost', 'dashed', 'default']).def('default'), + disabled: PropTypes.bool, + prefixCls: PropTypes.string.def('ant-dropdown-button'), + placement: DropdownProps.placement.def('bottomRight') +}); +export { DropdownButtonProps }; +export default { + name: 'ADropdownButton', + props: DropdownButtonProps, + methods: { + onClick: function onClick(e) { + this.$emit('click', e); + }, + onVisibleChange: function onVisibleChange(val) { + this.$emit('visibleChange', val); + } + }, + model: { + prop: 'visible', + event: 'visibleChange' + }, + render: function render() { + var h = arguments[0]; + + var _$props = this.$props, + type = _$props.type, + disabled = _$props.disabled, + prefixCls = _$props.prefixCls, + trigger = _$props.trigger, + align = _$props.align, + visible = _$props.visible, + placement = _$props.placement, + getPopupContainer = _$props.getPopupContainer, + restProps = _objectWithoutProperties(_$props, ['type', 'disabled', 'prefixCls', 'trigger', 'align', 'visible', 'placement', 'getPopupContainer']); + + var dropdownProps = { + props: { + align: align, + disabled: disabled, + trigger: disabled ? [] : trigger, + placement: placement, + getPopupContainer: getPopupContainer + }, + on: { + visibleChange: this.onVisibleChange + } + }; + if (hasProp(this, 'visible')) { + dropdownProps.props.visible = visible; + } + + return h( + ButtonGroup, + _mergeJSXProps([restProps, { + 'class': prefixCls + }]), + [h( + Button, + { + attrs: { + type: type, + disabled: disabled + }, + on: { + 'click': this.onClick + } + }, + [this.$slots['default']] + ), h( + Dropdown, + dropdownProps, + [h( + 'template', + { slot: 'overlay' }, + [getComponentFromProp(this, 'overlay')] + ), h( + Button, + { + attrs: { type: type } + }, + [h(Icon, { + attrs: { type: 'down' } + })] + )] + )] + ); + } +}; \ No newline at end of file diff --git a/es/dropdown/dropdown.js b/es/dropdown/dropdown.js new file mode 100644 index 0000000000..d3697786a4 --- /dev/null +++ b/es/dropdown/dropdown.js @@ -0,0 +1,87 @@ +import _extends from 'babel-runtime/helpers/extends'; + +import RcDropdown from './src/index'; +import DropdownButton from './dropdown-button'; +// import warning from '../_util/warning' +import PropTypes from '../_util/vue-types'; +import { cloneElement } from '../_util/vnode'; +import { getOptionProps, getPropsData } from '../_util/props-util'; +import getDropdownProps from './getDropdownProps'; +var DropdownProps = getDropdownProps(); +var Dropdown = { + name: 'ADropdown', + props: _extends({}, DropdownProps, { + prefixCls: PropTypes.string.def('ant-dropdown'), + mouseEnterDelay: PropTypes.number.def(0.15), + mouseLeaveDelay: PropTypes.number.def(0.1), + placement: DropdownProps.placement.def('bottomLeft') + }), + model: { + prop: 'visible', + event: 'visibleChange' + }, + methods: { + getTransitionName: function getTransitionName() { + var _$props = this.$props, + _$props$placement = _$props.placement, + placement = _$props$placement === undefined ? '' : _$props$placement, + transitionName = _$props.transitionName; + + if (transitionName !== undefined) { + return transitionName; + } + if (placement.indexOf('top') >= 0) { + return 'slide-down'; + } + return 'slide-up'; + } + }, + + render: function render() { + var h = arguments[0]; + var $slots = this.$slots, + prefixCls = this.prefixCls, + trigger = this.trigger, + disabled = this.disabled, + $listeners = this.$listeners; + + var dropdownTrigger = cloneElement($slots['default'], { + 'class': prefixCls + '-trigger', + disabled: disabled + }); + var overlay = this.overlay || $slots.overlay && $slots.overlay[0]; + // menu cannot be selectable in dropdown defaultly, but multiple type can be selectable + var overlayProps = overlay && getPropsData(overlay); + var selectable = false; + if (overlayProps) { + selectable = !!overlayProps.selectable || overlayProps.multiple; + } + var fixedModeOverlay = overlay && cloneElement(overlay, { + props: { + mode: 'vertical', + selectable: selectable, + isRootMenu: false + } + }); + var dropdownProps = { + props: _extends({}, getOptionProps(this), { + transitionName: this.getTransitionName(), + trigger: disabled ? [] : trigger + }), + on: $listeners + }; + return h( + RcDropdown, + dropdownProps, + [dropdownTrigger, h( + 'template', + { slot: 'overlay' }, + [fixedModeOverlay] + )] + ); + } +}; + +Dropdown.Button = DropdownButton; +export default Dropdown; +export { DropdownProps }; \ No newline at end of file diff --git a/es/dropdown/getDropdownProps.js b/es/dropdown/getDropdownProps.js new file mode 100644 index 0000000000..2b5d1350e3 --- /dev/null +++ b/es/dropdown/getDropdownProps.js @@ -0,0 +1,15 @@ +import PropTypes from '../_util/vue-types'; +export default (function () { + return { + trigger: PropTypes.array.def(['hover']), + overlay: PropTypes.any, + visible: PropTypes.bool, + disabled: PropTypes.bool, + align: PropTypes.object, + getPopupContainer: PropTypes.func, + prefixCls: PropTypes.string, + transitionName: PropTypes.string, + placement: PropTypes.oneOf(['topLeft', 'topCenter', 'topRight', 'bottomLeft', 'bottomCenter', 'bottomRight']), + forceRender: PropTypes.bool + }; +}); \ No newline at end of file diff --git a/es/dropdown/index.js b/es/dropdown/index.js new file mode 100644 index 0000000000..ce529b48eb --- /dev/null +++ b/es/dropdown/index.js @@ -0,0 +1,8 @@ +import Dropdown from './dropdown'; +import DropdownButton from './dropdown-button'; + +export { DropDownProps } from './dropdown'; +export { DropdownButtonProps } from './dropdown-button'; + +Dropdown.Button = DropdownButton; +export default Dropdown; \ No newline at end of file diff --git a/es/dropdown/src/Dropdown.js b/es/dropdown/src/Dropdown.js new file mode 100644 index 0000000000..4ceabb5620 --- /dev/null +++ b/es/dropdown/src/Dropdown.js @@ -0,0 +1,159 @@ +import _extends from 'babel-runtime/helpers/extends'; +import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; + +import PropTypes from '../../_util/vue-types'; +import Trigger from '../../trigger'; +import placements from './placements'; +import { hasProp, getEvents } from '../../_util/props-util'; +import BaseMixin from '../../_util/BaseMixin'; +import { cloneElement } from '../../_util/vnode'; + +export default { + mixins: [BaseMixin], + props: { + minOverlayWidthMatchTrigger: PropTypes.bool.def(true), + prefixCls: PropTypes.string.def('rc-dropdown'), + transitionName: PropTypes.string, + overlayClassName: PropTypes.string.def(''), + animation: PropTypes.any, + align: PropTypes.object, + overlayStyle: PropTypes.object.def({}), + placement: PropTypes.string.def('bottomLeft'), + trigger: PropTypes.array.def(['hover']), + showAction: PropTypes.array.def([]), + hideAction: PropTypes.array.def([]), + getPopupContainer: PropTypes.func, + visible: PropTypes.bool, + defaultVisible: PropTypes.bool.def(false), + mouseEnterDelay: PropTypes.number.def(0.15), + mouseLeaveDelay: PropTypes.number.def(0.1) + }, + data: function data() { + var sVisible = this.defaultVisible; + if (hasProp(this, 'visible')) { + sVisible = this.visible; + } + return { + sVisible: sVisible + }; + }, + + watch: { + visible: function visible(val) { + if (val !== undefined) { + this.setState({ + sVisible: val + }); + } + } + }, + methods: { + onClick: function onClick(e) { + // do no call onVisibleChange, if you need click to hide, use onClick and control visible + if (!hasProp(this, 'visible')) { + this.setState({ + sVisible: false + }); + } + this.$emit('overlayClick', e); + if (this.childOriginEvents.click) { + this.childOriginEvents.click(e); + } + }, + onVisibleChange: function onVisibleChange(visible) { + if (!hasProp(this, 'visible')) { + this.setState({ + sVisible: visible + }); + } + this.__emit('visibleChange', visible); + }, + getMenuElement: function getMenuElement() { + var _this = this; + + var onClick = this.onClick, + prefixCls = this.prefixCls, + $slots = this.$slots; + + this.childOriginEvents = getEvents($slots.overlay[0]); + var extraOverlayProps = { + props: { + prefixCls: prefixCls + '-menu', + getPopupContainer: function getPopupContainer() { + return _this.getPopupDomNode(); + } + }, + on: { + click: onClick + } + }; + return cloneElement($slots.overlay[0], extraOverlayProps); + }, + getPopupDomNode: function getPopupDomNode() { + return this.$refs.trigger.getPopupDomNode(); + }, + afterVisibleChange: function afterVisibleChange(visible) { + if (visible && this.$props.minOverlayWidthMatchTrigger) { + var overlayNode = this.getPopupDomNode(); + var rootNode = this.$el; + if (rootNode && overlayNode && rootNode.offsetWidth > overlayNode.offsetWidth) { + overlayNode.style.minWidth = rootNode.offsetWidth + 'px'; + if (this.$refs.trigger && this.$refs.trigger._component && this.$refs.trigger._component.alignInstance) { + this.$refs.trigger._component.alignInstance.forceAlign(); + } + } + } + } + }, + + render: function render() { + var h = arguments[0]; + + var _$props = this.$props, + prefixCls = _$props.prefixCls, + transitionName = _$props.transitionName, + animation = _$props.animation, + align = _$props.align, + placement = _$props.placement, + getPopupContainer = _$props.getPopupContainer, + showAction = _$props.showAction, + hideAction = _$props.hideAction, + overlayClassName = _$props.overlayClassName, + overlayStyle = _$props.overlayStyle, + trigger = _$props.trigger, + otherProps = _objectWithoutProperties(_$props, ['prefixCls', 'transitionName', 'animation', 'align', 'placement', 'getPopupContainer', 'showAction', 'hideAction', 'overlayClassName', 'overlayStyle', 'trigger']); + + var triggerProps = { + props: _extends({}, otherProps, { + prefixCls: prefixCls, + popupClassName: overlayClassName, + popupStyle: overlayStyle, + builtinPlacements: placements, + action: trigger, + showAction: showAction, + hideAction: hideAction, + popupPlacement: placement, + popupAlign: align, + popupTransitionName: transitionName, + popupAnimation: animation, + popupVisible: this.sVisible, + afterPopupVisibleChange: this.afterVisibleChange, + getPopupContainer: getPopupContainer + }), + on: { + popupVisibleChange: this.onVisibleChange + }, + ref: 'trigger' + }; + var child = this.$slots['default'] && this.$slots['default'][0]; + return h( + Trigger, + triggerProps, + [child && !child.tag ? h('span', [child]) : child, h( + 'template', + { slot: 'popup' }, + [this.$slots.overlay && this.getMenuElement()] + )] + ); + } +}; \ No newline at end of file diff --git a/es/dropdown/src/index.js b/es/dropdown/src/index.js new file mode 100644 index 0000000000..106002cbfa --- /dev/null +++ b/es/dropdown/src/index.js @@ -0,0 +1,2 @@ +import Dropdown from './Dropdown'; +export default Dropdown; \ No newline at end of file diff --git a/es/dropdown/src/placements.js b/es/dropdown/src/placements.js new file mode 100644 index 0000000000..ebb1cbbf64 --- /dev/null +++ b/es/dropdown/src/placements.js @@ -0,0 +1,47 @@ +var autoAdjustOverflow = { + adjustX: 1, + adjustY: 1 +}; + +var targetOffset = [0, 0]; + +export var placements = { + topLeft: { + points: ['bl', 'tl'], + overflow: autoAdjustOverflow, + offset: [0, -4], + targetOffset: targetOffset + }, + topCenter: { + points: ['bc', 'tc'], + overflow: autoAdjustOverflow, + offset: [0, -4], + targetOffset: targetOffset + }, + topRight: { + points: ['br', 'tr'], + overflow: autoAdjustOverflow, + offset: [0, -4], + targetOffset: targetOffset + }, + bottomLeft: { + points: ['tl', 'bl'], + overflow: autoAdjustOverflow, + offset: [0, 4], + targetOffset: targetOffset + }, + bottomCenter: { + points: ['tc', 'bc'], + overflow: autoAdjustOverflow, + offset: [0, 4], + targetOffset: targetOffset + }, + bottomRight: { + points: ['tr', 'br'], + overflow: autoAdjustOverflow, + offset: [0, 4], + targetOffset: targetOffset + } +}; + +export default placements; \ No newline at end of file diff --git a/es/dropdown/style/css.js b/es/dropdown/style/css.js new file mode 100644 index 0000000000..597022f606 --- /dev/null +++ b/es/dropdown/style/css.js @@ -0,0 +1,5 @@ +import '../../style/index.css'; +import './index.css'; + +// style dependencies +import '../../button/style/css'; \ No newline at end of file diff --git a/es/dropdown/style/index.css b/es/dropdown/style/index.css new file mode 100644 index 0000000000..3c53f0de68 --- /dev/null +++ b/es/dropdown/style/index.css @@ -0,0 +1,285 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-dropdown { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + position: absolute; + left: -9999px; + top: -9999px; + z-index: 1050; + display: block; +} +.ant-dropdown-wrap { + position: relative; +} +.ant-dropdown-wrap .ant-btn > .anticon-down { + display: inline-block; + font-size: 12px; + font-size: 10px \9; + -webkit-transform: scale(0.83333333) rotate(0deg); + -ms-transform: scale(0.83333333) rotate(0deg); + transform: scale(0.83333333) rotate(0deg); +} +:root .ant-dropdown-wrap .ant-btn > .anticon-down { + font-size: 12px; +} +.ant-dropdown-wrap .anticon-down:before { + -webkit-transition: -webkit-transform .2s; + transition: -webkit-transform .2s; + transition: transform .2s; + transition: transform .2s, -webkit-transform .2s; +} +.ant-dropdown-wrap-open .anticon-down:before { + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} +.ant-dropdown-hidden, +.ant-dropdown-menu-hidden { + display: none; +} +.ant-dropdown-menu { + outline: none; + position: relative; + list-style-type: none; + padding: 0; + margin: 0; + text-align: left; + background-color: #fff; + border-radius: 4px; + -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); + background-clip: padding-box; +} +.ant-dropdown-menu-item-group-title { + color: rgba(0, 0, 0, 0.45); + padding: 5px 12px; + -webkit-transition: all .3s; + transition: all .3s; +} +.ant-dropdown-menu-submenu-popup { + position: absolute; + z-index: 1050; +} +.ant-dropdown-menu-item, +.ant-dropdown-menu-submenu-title { + padding: 5px 12px; + margin: 0; + clear: both; + font-size: 14px; + font-weight: normal; + color: rgba(0, 0, 0, 0.65); + white-space: nowrap; + cursor: pointer; + -webkit-transition: all .3s; + transition: all .3s; + line-height: 22px; +} +.ant-dropdown-menu-item > a, +.ant-dropdown-menu-submenu-title > a { + color: rgba(0, 0, 0, 0.65); + display: block; + padding: 5px 12px; + margin: -5px -12px; + -webkit-transition: all .3s; + transition: all .3s; +} +.ant-dropdown-menu-item > a:focus, +.ant-dropdown-menu-submenu-title > a:focus { + text-decoration: none; +} +.ant-dropdown-menu-item-selected, +.ant-dropdown-menu-submenu-title-selected, +.ant-dropdown-menu-item-selected > a, +.ant-dropdown-menu-submenu-title-selected > a { + color: #1890ff; + background-color: #e6f7ff; +} +.ant-dropdown-menu-item:hover, +.ant-dropdown-menu-submenu-title:hover { + background-color: #e6f7ff; +} +.ant-dropdown-menu-item-disabled, +.ant-dropdown-menu-submenu-title-disabled { + color: rgba(0, 0, 0, 0.25); + cursor: not-allowed; +} +.ant-dropdown-menu-item-disabled:hover, +.ant-dropdown-menu-submenu-title-disabled:hover { + color: rgba(0, 0, 0, 0.25); + background-color: #fff; + cursor: not-allowed; +} +.ant-dropdown-menu-item:first-child, +.ant-dropdown-menu-submenu-title:first-child, +.ant-dropdown-menu-item:first-child > a, +.ant-dropdown-menu-submenu-title:first-child > a { + border-radius: 4px 4px 0 0; +} +.ant-dropdown-menu-item:last-child, +.ant-dropdown-menu-submenu-title:last-child, +.ant-dropdown-menu-item:last-child > a, +.ant-dropdown-menu-submenu-title:last-child > a { + border-radius: 0 0 4px 4px; +} +.ant-dropdown-menu-item:only-child, +.ant-dropdown-menu-submenu-title:only-child, +.ant-dropdown-menu-item:only-child > a, +.ant-dropdown-menu-submenu-title:only-child > a { + border-radius: 4px; +} +.ant-dropdown-menu-item-divider, +.ant-dropdown-menu-submenu-title-divider { + height: 1px; + overflow: hidden; + background-color: #e8e8e8; + line-height: 0; +} +.ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow, +.ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow { + position: absolute; + right: 8px; +} +.ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow:after, +.ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow:after { + font-family: "anticon" !important; + font-style: normal; + content: "\e61f"; + color: rgba(0, 0, 0, 0.45); + display: inline-block; + font-size: 12px; + font-size: 10px \9; + -webkit-transform: scale(0.83333333) rotate(0deg); + -ms-transform: scale(0.83333333) rotate(0deg); + transform: scale(0.83333333) rotate(0deg); +} +:root .ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow:after, +:root .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow:after { + font-size: 12px; +} +.ant-dropdown-menu-submenu-title { + padding-right: 26px; +} +.ant-dropdown-menu-submenu-title:first-child, +.ant-dropdown-menu-submenu-title:last-child { + border-radius: 0; +} +.ant-dropdown-menu-submenu-vertical { + position: relative; +} +.ant-dropdown-menu-submenu-vertical > .ant-dropdown-menu { + top: 0; + left: 100%; + position: absolute; + min-width: 100%; + margin-left: 4px; + -webkit-transform-origin: 0 0; + -ms-transform-origin: 0 0; + transform-origin: 0 0; +} +.ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-disabled .ant-dropdown-menu-submenu-title, +.ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-disabled .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow:after { + color: rgba(0, 0, 0, 0.25); +} +.ant-dropdown-menu-submenu:first-child .ant-dropdown-menu-submenu-title { + border-radius: 4px 4px 0 0; +} +.ant-dropdown-menu-submenu:last-child .ant-dropdown-menu-submenu-title { + border-radius: 0 0 4px 4px; +} +.ant-dropdown.slide-down-enter.slide-down-enter-active.ant-dropdown-placement-bottomLeft, +.ant-dropdown.slide-down-appear.slide-down-appear-active.ant-dropdown-placement-bottomLeft, +.ant-dropdown.slide-down-enter.slide-down-enter-active.ant-dropdown-placement-bottomCenter, +.ant-dropdown.slide-down-appear.slide-down-appear-active.ant-dropdown-placement-bottomCenter, +.ant-dropdown.slide-down-enter.slide-down-enter-active.ant-dropdown-placement-bottomRight, +.ant-dropdown.slide-down-appear.slide-down-appear-active.ant-dropdown-placement-bottomRight { + -webkit-animation-name: antSlideUpIn; + animation-name: antSlideUpIn; +} +.ant-dropdown.slide-up-enter.slide-up-enter-active.ant-dropdown-placement-topLeft, +.ant-dropdown.slide-up-appear.slide-up-appear-active.ant-dropdown-placement-topLeft, +.ant-dropdown.slide-up-enter.slide-up-enter-active.ant-dropdown-placement-topCenter, +.ant-dropdown.slide-up-appear.slide-up-appear-active.ant-dropdown-placement-topCenter, +.ant-dropdown.slide-up-enter.slide-up-enter-active.ant-dropdown-placement-topRight, +.ant-dropdown.slide-up-appear.slide-up-appear-active.ant-dropdown-placement-topRight { + -webkit-animation-name: antSlideDownIn; + animation-name: antSlideDownIn; +} +.ant-dropdown.slide-down-leave.slide-down-leave-active.ant-dropdown-placement-bottomLeft, +.ant-dropdown.slide-down-leave.slide-down-leave-active.ant-dropdown-placement-bottomCenter, +.ant-dropdown.slide-down-leave.slide-down-leave-active.ant-dropdown-placement-bottomRight { + -webkit-animation-name: antSlideUpOut; + animation-name: antSlideUpOut; +} +.ant-dropdown.slide-up-leave.slide-up-leave-active.ant-dropdown-placement-topLeft, +.ant-dropdown.slide-up-leave.slide-up-leave-active.ant-dropdown-placement-topCenter, +.ant-dropdown.slide-up-leave.slide-up-leave-active.ant-dropdown-placement-topRight { + -webkit-animation-name: antSlideDownOut; + animation-name: antSlideDownOut; +} +.ant-dropdown-trigger .anticon-down, +.ant-dropdown-link .anticon-down { + display: inline-block; + font-size: 12px; + font-size: 10px \9; + -webkit-transform: scale(0.83333333) rotate(0deg); + -ms-transform: scale(0.83333333) rotate(0deg); + transform: scale(0.83333333) rotate(0deg); +} +:root .ant-dropdown-trigger .anticon-down, +:root .ant-dropdown-link .anticon-down { + font-size: 12px; +} +.ant-dropdown-button { + white-space: nowrap; +} +.ant-dropdown-button.ant-btn-group > .ant-btn:last-child:not(:first-child) { + padding-left: 8px; + padding-right: 8px; +} +.ant-dropdown-button .anticon-down { + display: inline-block; + font-size: 12px; + font-size: 10px \9; + -webkit-transform: scale(0.83333333) rotate(0deg); + -ms-transform: scale(0.83333333) rotate(0deg); + transform: scale(0.83333333) rotate(0deg); +} +:root .ant-dropdown-button .anticon-down { + font-size: 12px; +} +.ant-dropdown-menu-dark, +.ant-dropdown-menu-dark .ant-dropdown-menu { + background: #001529; +} +.ant-dropdown-menu-dark .ant-dropdown-menu-item, +.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title, +.ant-dropdown-menu-dark .ant-dropdown-menu-item > a { + color: rgba(255, 255, 255, 0.65); +} +.ant-dropdown-menu-dark .ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow:after, +.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow:after, +.ant-dropdown-menu-dark .ant-dropdown-menu-item > a .ant-dropdown-menu-submenu-arrow:after { + color: rgba(255, 255, 255, 0.65); +} +.ant-dropdown-menu-dark .ant-dropdown-menu-item:hover, +.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title:hover, +.ant-dropdown-menu-dark .ant-dropdown-menu-item > a:hover { + color: #fff; + background: transparent; +} +.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected, +.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected:hover, +.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected > a { + background: #1890ff; + color: #fff; +} diff --git a/es/dropdown/style/index.js b/es/dropdown/style/index.js new file mode 100644 index 0000000000..20765d2439 --- /dev/null +++ b/es/dropdown/style/index.js @@ -0,0 +1,5 @@ +import '../../style/index.less'; +import './index.less'; + +// style dependencies +import '../../button/style'; \ No newline at end of file diff --git a/es/dropdown/style/index.less b/es/dropdown/style/index.less new file mode 100644 index 0000000000..d191aa5023 --- /dev/null +++ b/es/dropdown/style/index.less @@ -0,0 +1,251 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@dropdown-prefix-cls: ~"@{ant-prefix}-dropdown"; + +.@{dropdown-prefix-cls} { + .reset-component; + position: absolute; + left: -9999px; + top: -9999px; + z-index: @zindex-dropdown; + display: block; + + &-wrap { + position: relative; + + .@{ant-prefix}-btn > .@{iconfont-css-prefix}-down { + .iconfont-size-under-12px(10px); + } + + .@{iconfont-css-prefix}-down:before { + transition: transform .2s; + } + } + + &-wrap-open { + .@{iconfont-css-prefix}-down:before { + transform: rotate(180deg); + } + } + + &-hidden, + &-menu-hidden { + display: none; + } + + &-menu { + outline: none; + position: relative; + list-style-type: none; + padding: 0; + margin: 0; + text-align: left; + background-color: @component-background; + border-radius: @border-radius-base; + box-shadow: @box-shadow-base; + background-clip: padding-box; + + &-item-group-title { + color: @text-color-secondary; + padding: 5px @control-padding-horizontal; + transition: all .3s; + } + + &-submenu-popup { + position: absolute; + z-index: @zindex-dropdown; + } + + &-item, + &-submenu-title { + padding: 5px @control-padding-horizontal; + margin: 0; + clear: both; + font-size: @font-size-base; + font-weight: normal; + color: @text-color; + white-space: nowrap; + cursor: pointer; + transition: all .3s; + line-height: 22px; + + > a { + color: @text-color; + display: block; + padding: 5px @control-padding-horizontal; + margin: -5px -@control-padding-horizontal; + transition: all .3s; + &:focus { + text-decoration: none; + } + } + + &-selected, + &-selected > a { + color: @primary-color; + background-color: @item-active-bg; + } + + &:hover { + background-color: @item-hover-bg; + } + + &-disabled { + color: @disabled-color; + cursor: not-allowed; + + &:hover { + color: @disabled-color; + background-color: @component-background; + cursor: not-allowed; + } + } + + &:first-child, + &:first-child > a { + border-radius: @border-radius-base @border-radius-base 0 0; + } + + &:last-child, + &:last-child > a { + border-radius: 0 0 @border-radius-base @border-radius-base; + } + + &:only-child, + &:only-child > a { + border-radius: @border-radius-base; + } + + &-divider { + height: 1px; + overflow: hidden; + background-color: @border-color-split; + line-height: 0; + } + .@{dropdown-prefix-cls}-menu-submenu-arrow { + position: absolute; + right: @padding-xs; + &:after { + font-family: "anticon" !important; + font-style: normal; + content: "\e61f"; + color: @text-color-secondary; + .iconfont-size-under-12px(10px); + } + } + } + + &-submenu-title { + padding-right: 26px; + &:first-child, + &:last-child { + border-radius: 0; + } + } + + &-submenu-vertical { + position: relative; + } + + &-submenu-vertical > & { + top: 0; + left: 100%; + position: absolute; + min-width: 100%; + margin-left: 4px; + transform-origin: 0 0; + } + + &-submenu&-submenu-disabled .@{dropdown-prefix-cls}-menu-submenu-title { + &, + .@{dropdown-prefix-cls}-menu-submenu-arrow:after { + color: @disabled-color; + } + } + &-submenu:first-child &-submenu-title { + border-radius: @border-radius-base @border-radius-base 0 0; + } + + &-submenu:last-child &-submenu-title { + border-radius: 0 0 @border-radius-base @border-radius-base; + } + } + + &.slide-down-enter.slide-down-enter-active&-placement-bottomLeft, + &.slide-down-appear.slide-down-appear-active&-placement-bottomLeft, + &.slide-down-enter.slide-down-enter-active&-placement-bottomCenter, + &.slide-down-appear.slide-down-appear-active&-placement-bottomCenter, + &.slide-down-enter.slide-down-enter-active&-placement-bottomRight, + &.slide-down-appear.slide-down-appear-active&-placement-bottomRight { + animation-name: antSlideUpIn; + } + + &.slide-up-enter.slide-up-enter-active&-placement-topLeft, + &.slide-up-appear.slide-up-appear-active&-placement-topLeft, + &.slide-up-enter.slide-up-enter-active&-placement-topCenter, + &.slide-up-appear.slide-up-appear-active&-placement-topCenter, + &.slide-up-enter.slide-up-enter-active&-placement-topRight, + &.slide-up-appear.slide-up-appear-active&-placement-topRight { + animation-name: antSlideDownIn; + } + + &.slide-down-leave.slide-down-leave-active&-placement-bottomLeft, + &.slide-down-leave.slide-down-leave-active&-placement-bottomCenter, + &.slide-down-leave.slide-down-leave-active&-placement-bottomRight { + animation-name: antSlideUpOut; + } + + &.slide-up-leave.slide-up-leave-active&-placement-topLeft, + &.slide-up-leave.slide-up-leave-active&-placement-topCenter, + &.slide-up-leave.slide-up-leave-active&-placement-topRight { + animation-name: antSlideDownOut; + } +} + +.@{dropdown-prefix-cls}-trigger, +.@{dropdown-prefix-cls}-link { + .@{iconfont-css-prefix}-down { + .iconfont-size-under-12px(10px); + } +} + +.@{dropdown-prefix-cls}-button { + white-space: nowrap; + + &.@{ant-prefix}-btn-group > .@{ant-prefix}-btn:last-child:not(:first-child) { + padding-left: @padding-xs; + padding-right: @padding-xs; + } + .@{iconfont-css-prefix}-down { + .iconfont-size-under-12px(10px); + } +} + +// https://github.com/ant-design/ant-design/issues/4903 +.@{dropdown-prefix-cls}-menu-dark { + &, + .@{dropdown-prefix-cls}-menu { + background: @menu-dark-bg; + } + .@{dropdown-prefix-cls}-menu-item, + .@{dropdown-prefix-cls}-menu-submenu-title, + .@{dropdown-prefix-cls}-menu-item > a { + color: @text-color-secondary-dark; + .@{dropdown-prefix-cls}-menu-submenu-arrow:after { + color: @text-color-secondary-dark; + } + &:hover { + color: #fff; + background: transparent; + } + } + .@{dropdown-prefix-cls}-menu-item-selected { + &, + &:hover, + > a { + background: @primary-color; + color: #fff; + } + } +} diff --git a/es/form/Form.js b/es/form/Form.js new file mode 100755 index 0000000000..89038de6a0 --- /dev/null +++ b/es/form/Form.js @@ -0,0 +1,248 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _extends from 'babel-runtime/helpers/extends'; +import PropTypes from '../_util/vue-types'; +import classNames from 'classnames'; +import isRegExp from 'lodash/isRegExp'; +import createDOMForm from '../vc-form/src/createDOMForm'; +import createFormField from '../vc-form/src/createFormField'; +import FormItem from './FormItem'; +import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants'; +import { initDefaultProps } from '../_util/props-util'; + +export var FormCreateOption = { + onFieldsChange: PropTypes.func, + onValuesChange: PropTypes.func, + mapPropsToFields: PropTypes.func, + withRef: PropTypes.bool + + // function create +};export var WrappedFormUtils = { + /** 获取一组输入控件的值,如不传入参数,则获取全部组件的值 */ + getFieldsValue: PropTypes.func, + /** 获取一个输入控件的值*/ + getFieldValue: PropTypes.func, + /** 设置一组输入控件的值*/ + setFieldsValue: PropTypes.func, + /** 设置一组输入控件的值*/ + setFields: PropTypes.func, + /** 校验并获取一组输入域的值与 Error */ + validateFields: PropTypes.func, + // validateFields(fieldNames: Array, options: Object, callback: ValidateCallback): void; + // validateFields(fieldNames: Array, callback: ValidateCallback): void; + // validateFields(options: Object, callback: ValidateCallback): void; + // validateFields(callback: ValidateCallback): void; + // validateFields(): void; + /** 与 `validateFields` 相似,但校验完后,如果校验不通过的菜单域不在可见范围内,则自动滚动进可见范围 */ + validateFieldsAndScroll: PropTypes.func, + // validateFieldsAndScroll(fieldNames?: Array, options?: Object, callback?: ValidateCallback): void; + // validateFieldsAndScroll(fieldNames?: Array, callback?: ValidateCallback): void; + // validateFieldsAndScroll(options?: Object, callback?: ValidateCallback): void; + // validateFieldsAndScroll(callback?: ValidateCallback): void; + // validateFieldsAndScroll(): void; + /** 获取某个输入控件的 Error */ + getFieldError: PropTypes.func, + getFieldsError: PropTypes.func, + /** 判断一个输入控件是否在校验状态*/ + isFieldValidating: PropTypes.func, + isFieldTouched: PropTypes.func, + isFieldsTouched: PropTypes.func, + /** 重置一组输入控件的值与状态,如不传入参数,则重置所有组件 */ + resetFields: PropTypes.func, + + getFieldDecorator: PropTypes.func +}; + +export var FormProps = { + layout: PropTypes.oneOf(['horizontal', 'inline', 'vertical']), + form: PropTypes.shape(WrappedFormUtils).loose, + // onSubmit: React.FormEventHandler; + prefixCls: PropTypes.string, + hideRequiredMark: PropTypes.bool, + autoFormCreate: PropTypes.func, + options: PropTypes.object +}; + +export var ValidationRule = { + /** validation error message */ + message: PropTypes.string, + /** built-in validation type, available options: https://github.com/yiminghe/async-validator#type */ + type: PropTypes.string, + /** indicates whether field is required */ + required: PropTypes.boolean, + /** treat required fields that only contain whitespace as errors */ + whitespace: PropTypes.boolean, + /** validate the exact length of a field */ + len: PropTypes.number, + /** validate the min length of a field */ + min: PropTypes.number, + /** validate the max length of a field */ + max: PropTypes.number, + /** validate the value from a list of possible values */ + 'enum': PropTypes.oneOfType([String, PropTypes.arrayOf(String)]), + /** validate from a regular expression */ + pattern: PropTypes.custom(isRegExp), + /** transform a value before validation */ + transform: PropTypes.func, + /** custom validate function (Note: callback must be called) */ + validator: PropTypes.func + + // export type ValidateCallback = (errors: any, values: any) => void; + + // export type GetFieldDecoratorOptions = { + // /** 子节点的值的属性,如 Checkbox 的是 'checked' */ + // valuePropName?: string; + // /** 子节点的初始值,类型、可选值均由子节点决定 */ + // initialValue?: any; + // /** 收集子节点的值的时机 */ + // trigger?: string; + // /** 可以把 onChange 的参数转化为控件的值,例如 DatePicker 可设为:(date, dateString) => dateString */ + // getValueFromEvent?: (...args: any[]) => any; + // /** 校验子节点值的时机 */ + // validateTrigger?: string | string[]; + // /** 校验规则,参见 [async-validator](https://github.com/yiminghe/async-validator) */ + // rules?: ValidationRule[]; + // /** 是否和其他控件互斥,特别用于 Radio 单选控件 */ + // exclusive?: boolean; + // /** Normalize value to form component */ + // normalize?: (value: any, prevValue: any, allValues: any) => any; + // /** Whether stop validate on first rule of error for this field. */ + // validateFirst?: boolean; + // }; + +};export default { + name: 'AForm', + props: initDefaultProps(FormProps, { + prefixCls: 'ant-form', + layout: 'horizontal', + hideRequiredMark: false + }), + // static defaultProps = { + // prefixCls: 'ant-form', + // layout: 'horizontal', + // hideRequiredMark: false, + // onSubmit (e) { + // e.preventDefault() + // }, + // }; + + // static propTypes = { + // prefixCls: PropTypes.string, + // layout: PropTypes.oneOf(['horizontal', 'inline', 'vertical']), + // children: PropTypes.any, + // onSubmit: PropTypes.func, + // hideRequiredMark: PropTypes.bool, + // }; + + Item: FormItem, + + createFormField: createFormField, + + create: function create() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + return createDOMForm(_extends({ + fieldNameProp: 'id' + }, options, { + fieldMetaProp: FIELD_META_PROP, + fieldDataProp: FIELD_DATA_PROP + })); + }, + provide: function provide() { + return { + FormProps: this.$props + }; + }, + + methods: { + onSubmit: function onSubmit(e) { + var $listeners = this.$listeners; + + if (!$listeners.submit) { + e.preventDefault(); + } else { + this.$emit('submit', e); + } + } + }, + + render: function render() { + var _classNames, + _this = this; + + var h = arguments[0]; + var prefixCls = this.prefixCls, + hideRequiredMark = this.hideRequiredMark, + layout = this.layout, + onSubmit = this.onSubmit, + $slots = this.$slots, + autoFormCreate = this.autoFormCreate, + _options = this.options, + options = _options === undefined ? {} : _options; + + + var formClassName = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, prefixCls + '-horizontal', layout === 'horizontal'), _defineProperty(_classNames, prefixCls + '-vertical', layout === 'vertical'), _defineProperty(_classNames, prefixCls + '-inline', layout === 'inline'), _defineProperty(_classNames, prefixCls + '-hide-required-mark', hideRequiredMark), _classNames)); + if (autoFormCreate) { + var DomForm = this.DomForm || createDOMForm(_extends({ + fieldNameProp: 'id' + }, options, { + fieldMetaProp: FIELD_META_PROP, + fieldDataProp: FIELD_DATA_PROP, + templateContext: this.$vnode.context + }))({ + provide: function provide() { + return { + decoratorFormProps: this.$props + }; + }, + data: function data() { + return { + children: $slots['default'], + formClassName: formClassName, + submit: onSubmit + }; + }, + created: function created() { + autoFormCreate(this.form); + }, + render: function render() { + var h = arguments[0]; + var children = this.children, + formClassName = this.formClassName, + submit = this.submit; + + return h( + 'form', + { + on: { + 'submit': submit + }, + 'class': formClassName }, + [children] + ); + } + }); + if (this.domForm) { + this.domForm.children = $slots['default']; + this.domForm.submit = onSubmit; + this.domForm.formClassName = formClassName; + } + this.DomForm = DomForm; + + return h(DomForm, { + attrs: { wrappedComponentRef: function wrappedComponentRef(inst) { + _this.domForm = inst; + } } + }); + } + + return h( + 'form', + { + on: { + 'submit': onSubmit + }, + 'class': formClassName }, + [$slots['default']] + ); + } +}; \ No newline at end of file diff --git a/es/form/FormItem.js b/es/form/FormItem.js new file mode 100644 index 0000000000..a87a273e1c --- /dev/null +++ b/es/form/FormItem.js @@ -0,0 +1,367 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; +import _mergeJSXProps from 'babel-helper-vue-jsx-merge-props'; + +import PropTypes from '../_util/vue-types'; +import classNames from 'classnames'; +import Row from '../grid/Row'; +import Col, { ColProps } from '../grid/Col'; +import warning from '../_util/warning'; +import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants'; +import { initDefaultProps, getComponentFromProp, filterEmpty, getSlotOptions, getSlots } from '../_util/props-util'; +import getTransitionProps from '../_util/getTransitionProps'; +import BaseMixin from '../_util/BaseMixin'; +export var FormItemProps = { + id: PropTypes.string, + prefixCls: PropTypes.string, + label: PropTypes.any, + labelCol: PropTypes.shape(ColProps).loose, + wrapperCol: PropTypes.shape(ColProps).loose, + help: PropTypes.any, + extra: PropTypes.any, + validateStatus: PropTypes.oneOf(['', 'success', 'warning', 'error', 'validating']), + hasFeedback: PropTypes.bool, + required: PropTypes.bool, + colon: PropTypes.bool, + fieldDecoratorId: PropTypes.string, + fieldDecoratorOptions: PropTypes.object +}; + +export default { + name: 'AFormItem', + __ANT_FORM_ITEM: true, + mixins: [BaseMixin], + props: initDefaultProps(FormItemProps, { + hasFeedback: false, + prefixCls: 'ant-form', + colon: true + }), + inject: { + FormProps: { 'default': {} }, + decoratorFormProps: { 'default': {} } + }, + data: function data() { + return { helpShow: false }; + }, + mounted: function mounted() { + warning(this.getControls(this.slotDefault, true).length <= 1, '`Form.Item` cannot generate `validateStatus` and `help` automatically, ' + 'while there are more than one `getFieldDecorator` in it.'); + }, + + methods: { + getHelpMsg: function getHelpMsg() { + var help = getComponentFromProp(this, 'help'); + var onlyControl = this.getOnlyControl(); + if (help === undefined && onlyControl) { + var errors = this.getField().errors; + return errors ? errors.map(function (e) { + return e.message; + }).join(', ') : ''; + } + + return help; + }, + getControls: function getControls() { + var childrenArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var recursively = arguments[1]; + + var controls = []; + for (var i = 0; i < childrenArray.length; i++) { + if (!recursively && controls.length > 0) { + break; + } + + var child = childrenArray[i]; + if (!child.tag && child.text.trim() === '') { + continue; + } + + if (getSlotOptions(child).__ANT_FORM_ITEM) { + continue; + } + var attrs = child.data && child.data.attrs; + if (!attrs) { + continue; + } + var slots = getSlots(child); + if (FIELD_META_PROP in attrs) { + // And means FIELD_DATA_PROP in chidl.props, too. + controls.push(child); + } else if (slots['default']) { + controls = controls.concat(this.getControls(slots['default'], recursively)); + } + } + return controls; + }, + getOnlyControl: function getOnlyControl() { + var child = this.getControls(this.slotDefault, false)[0]; + return child !== undefined ? child : null; + }, + getChildAttr: function getChildAttr(prop) { + var child = this.getOnlyControl(); + var data = {}; + if (!child) { + return undefined; + } + if (child.data) { + data = child.data; + } else if (child.$vnode && child.$vnode.data) { + data = child.$vnode.data; + } + return data[prop] || data.attrs[prop]; + }, + getId: function getId() { + return this.getChildAttr('id'); + }, + getMeta: function getMeta() { + return this.getChildAttr(FIELD_META_PROP); + }, + getField: function getField() { + return this.getChildAttr(FIELD_DATA_PROP); + }, + onHelpAnimEnd: function onHelpAnimEnd() { + this.setState({ helpShow: false }); + }, + renderHelp: function renderHelp() { + var h = this.$createElement; + + var prefixCls = this.prefixCls; + var help = this.getHelpMsg(); + var children = help ? h( + 'div', + { 'class': prefixCls + '-explain', key: 'help' }, + [help] + ) : null; + var transitionProps = getTransitionProps('show-help', { + afterLeave: this.onHelpAnimEnd + }); + if (children) { + this.setState({ helpShow: true }); + } + return h( + 'transition', + _mergeJSXProps([transitionProps, { + key: 'help' + }]), + [children] + ); + }, + renderExtra: function renderExtra() { + var h = this.$createElement; + var prefixCls = this.prefixCls; + + var extra = getComponentFromProp(this, 'extra'); + return extra ? h( + 'div', + { 'class': prefixCls + '-extra' }, + [extra] + ) : null; + }, + getValidateStatus: function getValidateStatus() { + var onlyControl = this.getOnlyControl(); + if (!onlyControl) { + return ''; + } + var field = this.getField(); + if (field.validating) { + return 'validating'; + } + if (field.errors) { + return 'error'; + } + var fieldValue = 'value' in field ? field.value : this.getMeta().initialValue; + if (fieldValue !== undefined && fieldValue !== null && fieldValue !== '') { + return 'success'; + } + return ''; + }, + renderValidateWrapper: function renderValidateWrapper(c1, c2, c3) { + var h = this.$createElement; + + var props = this.$props; + var onlyControl = this.getOnlyControl; + var validateStatus = props.validateStatus === undefined && onlyControl ? this.getValidateStatus() : props.validateStatus; + + var classes = props.prefixCls + '-item-control'; + if (validateStatus) { + classes = classNames(props.prefixCls + '-item-control', { + 'has-feedback': props.hasFeedback || validateStatus === 'validating', + 'has-success': validateStatus === 'success', + 'has-warning': validateStatus === 'warning', + 'has-error': validateStatus === 'error', + 'is-validating': validateStatus === 'validating' + }); + } + return h( + 'div', + { 'class': classes }, + [h( + 'span', + { 'class': props.prefixCls + '-item-children' }, + [c1] + ), c2, c3] + ); + }, + renderWrapper: function renderWrapper(children) { + var h = this.$createElement; + var prefixCls = this.prefixCls, + _wrapperCol = this.wrapperCol, + wrapperCol = _wrapperCol === undefined ? {} : _wrapperCol; + + var cls = wrapperCol['class'], + style = wrapperCol.style, + id = wrapperCol.id, + on = wrapperCol.on, + restProps = _objectWithoutProperties(wrapperCol, ['class', 'style', 'id', 'on']); + + var className = classNames(prefixCls + '-item-control-wrapper', cls); + var colProps = { + props: restProps, + 'class': className, + key: 'wrapper', + style: style, + id: id, + on: on + }; + return h( + Col, + colProps, + [children] + ); + }, + isRequired: function isRequired() { + var required = this.required; + + if (required !== undefined) { + return required; + } + if (this.getOnlyControl()) { + var meta = this.getMeta() || {}; + var validate = meta.validate || []; + + return validate.filter(function (item) { + return !!item.rules; + }).some(function (item) { + return item.rules.some(function (rule) { + return rule.required; + }); + }); + } + return false; + }, + + + // Resolve duplicated ids bug between different forms + // https://github.com/ant-design/ant-design/issues/7351 + onLabelClick: function onLabelClick(e) { + var label = getComponentFromProp(this, 'label'); + var id = this.id || this.getId(); + if (!id) { + return; + } + var controls = document.querySelectorAll('[id="' + id + '"]'); + if (controls.length !== 1) { + // Only prevent in default situation + // Avoid preventing event in `label={link}`` + if (typeof label === 'string') { + e.preventDefault(); + } + var control = this.$el.querySelector('[id="' + id + '"]'); + if (control && control.focus) { + control.focus(); + } + } + }, + renderLabel: function renderLabel() { + var h = this.$createElement; + var prefixCls = this.prefixCls, + _labelCol = this.labelCol, + labelCol = _labelCol === undefined ? {} : _labelCol, + colon = this.colon, + id = this.id; + + var label = getComponentFromProp(this, 'label'); + var required = this.isRequired(); + + var labelColClass = labelCol['class'], + labelColStyle = labelCol.style, + labelColId = labelCol.id, + on = labelCol.on, + restProps = _objectWithoutProperties(labelCol, ['class', 'style', 'id', 'on']); + + var labelColClassName = classNames(prefixCls + '-item-label', labelColClass); + var labelClassName = classNames(_defineProperty({}, prefixCls + '-item-required', required)); + + var labelChildren = label; + // Keep label is original where there should have no colon + var haveColon = colon && this.FormProps.layout !== 'vertical'; + // Remove duplicated user input colon + if (haveColon && typeof label === 'string' && label.trim() !== '') { + labelChildren = label.replace(/[:|:]\s*$/, ''); + } + var colProps = { + props: restProps, + 'class': labelColClassName, + key: 'label', + style: labelColStyle, + id: labelColId, + on: on + }; + + return label ? h( + Col, + colProps, + [h( + 'label', + { + attrs: { + 'for': id || this.getId(), + + title: typeof label === 'string' ? label : '' + }, + 'class': labelClassName, on: { + 'click': this.onLabelClick + } + }, + [labelChildren] + )] + ) : null; + }, + renderChildren: function renderChildren() { + return [this.renderLabel(), this.renderWrapper(this.renderValidateWrapper(this.slotDefault, this.renderHelp(), this.renderExtra()))]; + }, + renderFormItem: function renderFormItem(children) { + var _itemClassName; + + var h = this.$createElement; + + var props = this.$props; + var prefixCls = props.prefixCls; + var itemClassName = (_itemClassName = {}, _defineProperty(_itemClassName, prefixCls + '-item', true), _defineProperty(_itemClassName, prefixCls + '-item-with-help', !!this.getHelpMsg() || this.helpShow), _defineProperty(_itemClassName, prefixCls + '-item-no-colon', !props.colon), _itemClassName); + + return h( + Row, + { 'class': classNames(itemClassName) }, + [children] + ); + } + }, + + render: function render() { + var $slots = this.$slots, + decoratorFormProps = this.decoratorFormProps, + fieldDecoratorId = this.fieldDecoratorId, + _fieldDecoratorOption = this.fieldDecoratorOptions, + fieldDecoratorOptions = _fieldDecoratorOption === undefined ? {} : _fieldDecoratorOption; + + var child = filterEmpty($slots['default'] || []); + if (decoratorFormProps.form && fieldDecoratorId && child.length) { + var getFieldDecorator = decoratorFormProps.form.getFieldDecorator; + child[0] = getFieldDecorator(fieldDecoratorId, fieldDecoratorOptions)(child[0]); + warning(!(child.length > 1), '`autoFormCreate` just `decorator` then first children. but you can use JSX to support multiple children'); + } + + this.slotDefault = child; + var children = this.renderChildren(); + return this.renderFormItem(children); + } +}; \ No newline at end of file diff --git a/es/form/constants.js b/es/form/constants.js new file mode 100644 index 0000000000..5b9c6e3847 --- /dev/null +++ b/es/form/constants.js @@ -0,0 +1,2 @@ +export var FIELD_META_PROP = 'data-__meta'; +export var FIELD_DATA_PROP = 'data-__field'; \ No newline at end of file diff --git a/es/form/index.js b/es/form/index.js new file mode 100644 index 0000000000..7242f441d9 --- /dev/null +++ b/es/form/index.js @@ -0,0 +1,10 @@ +import Vue from 'vue'; +import Form from './Form'; +import antRefDirective from '../_util/antRefDirective'; + +Vue.use(antRefDirective); + +export { FormProps, FormCreateOption, ValidationRule } from './Form'; +export { FormItemProps } from './FormItem'; + +export default Form; \ No newline at end of file diff --git a/es/form/style/css.js b/es/form/style/css.js new file mode 100644 index 0000000000..46f76d5a48 --- /dev/null +++ b/es/form/style/css.js @@ -0,0 +1,5 @@ +import '../../style/index.css'; +import './index.css'; + +// style dependencies +import '../../grid/style/css'; \ No newline at end of file diff --git a/es/form/style/index.css b/es/form/style/index.css new file mode 100644 index 0000000000..15aaef8d38 --- /dev/null +++ b/es/form/style/index.css @@ -0,0 +1,758 @@ +/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ +/* stylelint-disable no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ +.ant-form { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; +} +.ant-form legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 16px; + line-height: inherit; + color: rgba(0, 0, 0, 0.45); + border: 0; + border-bottom: 1px solid #d9d9d9; +} +.ant-form label { + font-size: 14px; +} +.ant-form input[type="search"] { + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.ant-form input[type="radio"], +.ant-form input[type="checkbox"] { + line-height: normal; +} +.ant-form input[type="file"] { + display: block; +} +.ant-form input[type="range"] { + display: block; + width: 100%; +} +.ant-form select[multiple], +.ant-form select[size] { + height: auto; +} +.ant-form input[type="file"]:focus, +.ant-form input[type="radio"]:focus, +.ant-form input[type="checkbox"]:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.ant-form output { + display: block; + padding-top: 15px; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); +} +.ant-form-item-required:before { + display: inline-block; + margin-right: 4px; + content: "*"; + font-family: SimSun; + line-height: 1; + font-size: 14px; + color: #f5222d; +} +.ant-form-hide-required-mark .ant-form-item-required:before { + display: none; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"].disabled, +input[type="checkbox"].disabled { + cursor: not-allowed; +} +.ant-radio-inline.disabled, +.ant-radio-vertical.disabled, +.ant-checkbox-inline.disabled, +.ant-checkbox-vertical.disabled { + cursor: not-allowed; +} +.ant-radio.disabled label, +.ant-checkbox.disabled label { + cursor: not-allowed; +} +.ant-form-item { + font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; + color: rgba(0, 0, 0, 0.65); + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + padding: 0; + list-style: none; + margin-bottom: 24px; + vertical-align: top; +} +.ant-form-item label { + position: relative; +} +.ant-form-item label > .anticon { + vertical-align: top; + font-size: 14px; +} +.ant-form-item-control > .ant-form-item:last-child, +.ant-form-item [class^="ant-col-"] > .ant-form-item:only-child { + margin-bottom: -24px; +} +.ant-form-item-control { + line-height: 39.9999px; + position: relative; + zoom: 1; +} +.ant-form-item-control:before, +.ant-form-item-control:after { + content: " "; + display: table; +} +.ant-form-item-control:after { + clear: both; + visibility: hidden; + font-size: 0; + height: 0; +} +.ant-form-item-children { + position: relative; +} +.ant-form-item-with-help { + margin-bottom: 5px; +} +.ant-form-item-label { + text-align: right; + vertical-align: middle; + line-height: 39.9999px; + display: inline-block; + overflow: hidden; + white-space: nowrap; +} +.ant-form-item-label label { + color: rgba(0, 0, 0, 0.85); +} +.ant-form-item-label label:after { + content: ":"; + margin: 0 8px 0 2px; + position: relative; + top: -0.5px; +} +.ant-form-item .ant-switch { + margin: 2px 0 4px; +} +.ant-form-item-no-colon .ant-form-item-label label:after { + content: " "; +} +.ant-form-explain, +.ant-form-extra { + color: rgba(0, 0, 0, 0.45); + line-height: 1.5; + -webkit-transition: color 0.15s cubic-bezier(0.215, 0.61, 0.355, 1); + transition: color 0.15s cubic-bezier(0.215, 0.61, 0.355, 1); + margin-top: -2px; +} +.ant-form-extra { + padding-top: 4px; +} +.ant-form-text { + display: inline-block; + padding-right: 8px; +} +.ant-form-split { + display: block; + text-align: center; +} +form .has-feedback .ant-input { + padding-right: 24px; +} +form .has-feedback > .ant-select .ant-select-arrow, +form .has-feedback > .ant-select .ant-select-selection__clear, +form .has-feedback :not(.ant-input-group-addon) > .ant-select .ant-select-arrow, +form .has-feedback :not(.ant-input-group-addon) > .ant-select .ant-select-selection__clear { + right: 28px; +} +form .has-feedback > .ant-select .ant-select-selection-selected-value, +form .has-feedback :not(.ant-input-group-addon) > .ant-select .ant-select-selection-selected-value { + padding-right: 42px; +} +form .has-feedback .ant-cascader-picker-arrow { + margin-right: 17px; +} +form .has-feedback .ant-cascader-picker-clear { + right: 28px; +} +form .has-feedback .ant-input-search:not(.ant-input-search-enter-button) .ant-input-suffix { + right: 28px; +} +form .has-feedback .ant-calendar-picker-icon, +form .has-feedback .ant-time-picker-icon, +form .has-feedback .ant-calendar-picker-clear, +form .has-feedback .ant-time-picker-clear { + right: 28px; +} +form textarea.ant-input { + height: auto; +} +form .ant-upload { + background: transparent; +} +form input[type="radio"], +form input[type="checkbox"] { + width: 14px; + height: 14px; +} +form .ant-radio-inline, +form .ant-checkbox-inline { + display: inline-block; + vertical-align: middle; + font-weight: normal; + cursor: pointer; + margin-left: 8px; +} +form .ant-radio-inline:first-child, +form .ant-checkbox-inline:first-child { + margin-left: 0; +} +form .ant-checkbox-vertical, +form .ant-radio-vertical { + display: block; +} +form .ant-checkbox-vertical + .ant-checkbox-vertical, +form .ant-radio-vertical + .ant-radio-vertical { + margin-left: 0; +} +form .ant-input-number + .ant-form-text { + margin-left: 8px; +} +form .ant-select, +form .ant-cascader-picker { + width: 100%; +} +form .ant-input-group .ant-select, +form .ant-input-group .ant-cascader-picker { + width: auto; +} +form .ant-input-group-wrapper { + vertical-align: middle; + position: relative; + top: -1px; +} +.ant-input-group-wrap .ant-select-selection { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.ant-input-group-wrap .ant-select-selection:hover { + border-color: #d9d9d9; +} +.ant-input-group-wrap .ant-select-selection--single { + margin-left: -1px; + height: 40px; + background-color: #eee; +} +.ant-input-group-wrap .ant-select-selection--single .ant-select-selection__rendered { + padding-left: 8px; + padding-right: 25px; + line-height: 30px; +} +.ant-input-group-wrap .ant-select-open .ant-select-selection { + border-color: #d9d9d9; + -webkit-box-shadow: none; + box-shadow: none; +} +.ant-form-vertical .ant-form-item-label, +.ant-col-24.ant-form-item-label, +.ant-col-xl-24.ant-form-item-label { + padding: 0 0 8px; + margin: 0; + display: block; + text-align: left; + line-height: 1.5; +} +.ant-form-vertical .ant-form-item-label label:after, +.ant-col-24.ant-form-item-label label:after, +.ant-col-xl-24.ant-form-item-label label:after { + display: none; +} +.ant-form-vertical .ant-form-item { + padding-bottom: 8px; +} +.ant-form-vertical .ant-form-item-control { + line-height: 1.5; +} +.ant-form-vertical .ant-form-explain, +.ant-form-vertical .ant-form-extra { + margin-top: 2px; + margin-bottom: -4px; +} +@media (max-width: 575px) { + .ant-form-item-label, + .ant-form-item-control-wrapper { + display: block; + width: 100%; + } + .ant-form-item-label { + padding: 0 0 8px; + margin: 0; + display: block; + text-align: left; + line-height: 1.5; + } + .ant-form-item-label label:after { + display: none; + } + .ant-col-xs-24.ant-form-item-label { + padding: 0 0 8px; + margin: 0; + display: block; + text-align: left; + line-height: 1.5; + } + .ant-col-xs-24.ant-form-item-label label:after { + display: none; + } +} +@media (max-width: 767px) { + .ant-col-sm-24.ant-form-item-label { + padding: 0 0 8px; + margin: 0; + display: block; + text-align: left; + line-height: 1.5; + } + .ant-col-sm-24.ant-form-item-label label:after { + display: none; + } +} +@media (max-width: 991px) { + .ant-col-md-24.ant-form-item-label { + padding: 0 0 8px; + margin: 0; + display: block; + text-align: left; + line-height: 1.5; + } + .ant-col-md-24.ant-form-item-label label:after { + display: none; + } +} +@media (max-width: 1199px) { + .ant-col-lg-24.ant-form-item-label { + padding: 0 0 8px; + margin: 0; + display: block; + text-align: left; + line-height: 1.5; + } + .ant-col-lg-24.ant-form-item-label label:after { + display: none; + } +} +@media (max-width: 1599px) { + .ant-col-xl-24.ant-form-item-label { + padding: 0 0 8px; + margin: 0; + display: block; + text-align: left; + line-height: 1.5; + } + .ant-col-xl-24.ant-form-item-label label:after { + display: none; + } +} +.ant-form-inline .ant-form-item { + display: inline-block; + margin-right: 16px; + margin-bottom: 0; +} +.ant-form-inline .ant-form-item-with-help { + margin-bottom: 24px; +} +.ant-form-inline .ant-form-item > .ant-form-item-control-wrapper, +.ant-form-inline .ant-form-item > .ant-form-item-label { + display: inline-block; + vertical-align: middle; +} +.ant-form-inline .ant-form-text { + display: inline-block; +} +.ant-form-inline .has-feedback { + display: inline-block; +} +.ant-form-inline .ant-form-explain { + position: absolute; +} +.has-success.has-feedback .ant-form-item-children:after, +.has-warning.has-feedback .ant-form-item-children:after, +.has-error.has-feedback .ant-form-item-children:after, +.is-validating.has-feedback .ant-form-item-children:after { + position: absolute; + top: 50%; + right: 0; + visibility: visible; + pointer-events: none; + width: 32px; + height: 20px; + line-height: 20px; + margin-top: -10px; + text-align: center; + font-size: 14px; + -webkit-animation: zoomIn 0.3s cubic-bezier(0.12, 0.4, 0.29, 1.46); + animation: zoomIn 0.3s cubic-bezier(0.12, 0.4, 0.29, 1.46); + font-family: 'anticon'; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + content: ""; + z-index: 1; +} +.has-success.has-feedback .ant-form-item-children:after { + -webkit-animation-name: diffZoomIn1 !important; + animation-name: diffZoomIn1 !important; + content: '\e630'; + color: #52c41a; +} +.has-warning .ant-form-explain, +.has-warning .ant-form-split { + color: #faad14; +} +.has-warning .ant-input, +.has-warning .ant-input:hover { + border-color: #faad14; +} +.has-warning .ant-input:focus { + border-color: #ffc53d; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2); + box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2); +} +.has-warning .ant-input:not([disabled]):hover { + border-color: #faad14; +} +.has-warning .ant-calendar-picker-open .ant-calendar-picker-input { + border-color: #ffc53d; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2); + box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2); +} +.has-warning .ant-input-prefix { + color: #faad14; +} +.has-warning .ant-input-group-addon { + color: #faad14; + border-color: #faad14; + background-color: #fff; +} +.has-warning .has-feedback { + color: #faad14; +} +.has-warning.has-feedback .ant-form-item-children:after { + content: '\e62c'; + color: #faad14; + -webkit-animation-name: diffZoomIn3 !important; + animation-name: diffZoomIn3 !important; +} +.has-warning .ant-select-selection { + border-color: #faad14; +} +.has-warning .ant-select-open .ant-select-selection, +.has-warning .ant-select-focused .ant-select-selection { + border-color: #ffc53d; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2); + box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2); +} +.has-warning .ant-calendar-picker-icon:after, +.has-warning .ant-time-picker-icon:after, +.has-warning .ant-picker-icon:after, +.has-warning .ant-select-arrow, +.has-warning .ant-cascader-picker-arrow { + color: #faad14; +} +.has-warning .ant-input-number, +.has-warning .ant-time-picker-input { + border-color: #faad14; +} +.has-warning .ant-input-number-focused, +.has-warning .ant-time-picker-input-focused, +.has-warning .ant-input-number:focus, +.has-warning .ant-time-picker-input:focus { + border-color: #ffc53d; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2); + box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2); +} +.has-warning .ant-input-number:not([disabled]):hover, +.has-warning .ant-time-picker-input:not([disabled]):hover { + border-color: #faad14; +} +.has-warning .ant-cascader-picker:focus .ant-cascader-input { + border-color: #ffc53d; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2); + box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2); +} +.has-error .ant-form-explain, +.has-error .ant-form-split { + color: #f5222d; +} +.has-error .ant-input, +.has-error .ant-input:hover { + border-color: #f5222d; +} +.has-error .ant-input:focus { + border-color: #ff4d4f; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2); + box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2); +} +.has-error .ant-input:not([disabled]):hover { + border-color: #f5222d; +} +.has-error .ant-calendar-picker-open .ant-calendar-picker-input { + border-color: #ff4d4f; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2); + box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2); +} +.has-error .ant-input-prefix { + color: #f5222d; +} +.has-error .ant-input-group-addon { + color: #f5222d; + border-color: #f5222d; + background-color: #fff; +} +.has-error .has-feedback { + color: #f5222d; +} +.has-error.has-feedback .ant-form-item-children:after { + content: '\e62e'; + color: #f5222d; + -webkit-animation-name: diffZoomIn2 !important; + animation-name: diffZoomIn2 !important; +} +.has-error .ant-select-selection { + border-color: #f5222d; +} +.has-error .ant-select-open .ant-select-selection, +.has-error .ant-select-focused .ant-select-selection { + border-color: #ff4d4f; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2); + box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2); +} +.has-error .ant-select.ant-select-auto-complete .ant-input:focus { + border-color: #f5222d; +} +.has-error .ant-input-group-addon .ant-select-selection { + border-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.has-error .ant-calendar-picker-icon:after, +.has-error .ant-time-picker-icon:after, +.has-error .ant-picker-icon:after, +.has-error .ant-select-arrow, +.has-error .ant-cascader-picker-arrow { + color: #f5222d; +} +.has-error .ant-input-number, +.has-error .ant-time-picker-input { + border-color: #f5222d; +} +.has-error .ant-input-number-focused, +.has-error .ant-time-picker-input-focused, +.has-error .ant-input-number:focus, +.has-error .ant-time-picker-input:focus { + border-color: #ff4d4f; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2); + box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2); +} +.has-error .ant-input-number:not([disabled]):hover, +.has-error .ant-time-picker-input:not([disabled]):hover { + border-color: #f5222d; +} +.has-error .ant-mention-wrapper .ant-mention-editor, +.has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):hover { + border-color: #f5222d; +} +.has-error .ant-mention-wrapper.ant-mention-active:not([disabled]) .ant-mention-editor, +.has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):focus { + border-color: #ff4d4f; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2); + box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2); +} +.has-error .ant-cascader-picker:focus .ant-cascader-input { + border-color: #ff4d4f; + outline: 0; + -webkit-box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2); + box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2); +} +.is-validating.has-feedback .ant-form-item-children:after { + display: inline-block; + -webkit-animation: loadingCircle 1s infinite linear; + animation: loadingCircle 1s infinite linear; + content: "\e64d"; + color: #1890ff; +} +.ant-advanced-search-form .ant-form-item { + margin-bottom: 24px; +} +.ant-advanced-search-form .ant-form-item-with-help { + margin-bottom: 5px; +} +.show-help-enter, +.show-help-appear { + -webkit-animation-duration: 0.15s; + animation-duration: 0.15s; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-play-state: paused; + animation-play-state: paused; +} +.show-help-leave { + -webkit-animation-duration: 0.15s; + animation-duration: 0.15s; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-play-state: paused; + animation-play-state: paused; +} +.show-help-enter.show-help-enter-active, +.show-help-appear.show-help-appear-active { + -webkit-animation-name: antShowHelpIn; + animation-name: antShowHelpIn; + -webkit-animation-play-state: running; + animation-play-state: running; +} +.show-help-leave.show-help-leave-active { + -webkit-animation-name: antShowHelpOut; + animation-name: antShowHelpOut; + -webkit-animation-play-state: running; + animation-play-state: running; + pointer-events: none; +} +.show-help-enter, +.show-help-appear { + opacity: 0; + -webkit-animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1); + animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1); +} +.show-help-leave { + -webkit-animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1); + animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1); +} +@-webkit-keyframes antShowHelpIn { + 0% { + opacity: 0; + -webkit-transform: translateY(-5px); + transform: translateY(-5px); + } + 100% { + opacity: 1; + -webkit-transform: translateY(0); + transform: translateY(0); + } +} +@keyframes antShowHelpIn { + 0% { + opacity: 0; + -webkit-transform: translateY(-5px); + transform: translateY(-5px); + } + 100% { + opacity: 1; + -webkit-transform: translateY(0); + transform: translateY(0); + } +} +@-webkit-keyframes antShowHelpOut { + to { + opacity: 0; + -webkit-transform: translateY(-5px); + transform: translateY(-5px); + } +} +@keyframes antShowHelpOut { + to { + opacity: 0; + -webkit-transform: translateY(-5px); + transform: translateY(-5px); + } +} +@-webkit-keyframes diffZoomIn1 { + 0% { + -webkit-transform: scale(0); + transform: scale(0); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + } +} +@keyframes diffZoomIn1 { + 0% { + -webkit-transform: scale(0); + transform: scale(0); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + } +} +@-webkit-keyframes diffZoomIn2 { + 0% { + -webkit-transform: scale(0); + transform: scale(0); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + } +} +@keyframes diffZoomIn2 { + 0% { + -webkit-transform: scale(0); + transform: scale(0); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + } +} +@-webkit-keyframes diffZoomIn3 { + 0% { + -webkit-transform: scale(0); + transform: scale(0); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + } +} +@keyframes diffZoomIn3 { + 0% { + -webkit-transform: scale(0); + transform: scale(0); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + } +} diff --git a/es/form/style/index.js b/es/form/style/index.js new file mode 100644 index 0000000000..03ca41ddbf --- /dev/null +++ b/es/form/style/index.js @@ -0,0 +1,5 @@ +import '../../style/index.less'; +import './index.less'; + +// style dependencies +import '../../grid/style'; \ No newline at end of file diff --git a/es/form/style/index.less b/es/form/style/index.less new file mode 100644 index 0000000000..a26e07c2c3 --- /dev/null +++ b/es/form/style/index.less @@ -0,0 +1,624 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; +@import "../../input/style/mixin"; +@import "../../button/style/mixin"; +@import "../../grid/style/mixin"; +@import "./mixin"; + +@form-prefix-cls: ~"@{ant-prefix}-form"; +@form-component-height: @input-height-base; +@form-component-max-height: @input-height-lg; +@form-feedback-icon-size: 14px; +@form-help-margin-top: (@form-component-height - @form-component-max-height) / 2 + 2px; + +.@{form-prefix-cls} { + .reset-component; + .reset-form; +} + +.@{form-prefix-cls}-item-required:before { + display: inline-block; + margin-right: 4px; + content: "*"; + font-family: SimSun; + line-height: 1; + font-size: @font-size-base; + color: @label-required-color; + .@{form-prefix-cls}-hide-required-mark & { + display: none; + } +} + +// Radio && Checkbox +input[type="radio"], +input[type="checkbox"] { + &[disabled], + &.disabled { + cursor: not-allowed; + } +} + +// These classes are used directly on