@wangxinowo/vue-datepicker-next 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -0
- package/dist/vue-datepicker-next.min.css +3560 -0
- package/dist/vue-datepicker-next.min.js +11 -0
- package/package.json +84 -0
- package/src/components/_util/BaseMixin.js +40 -0
- package/src/components/_util/ContainerRender.jsx +98 -0
- package/src/components/_util/FormDecoratorDirective.js +10 -0
- package/src/components/_util/KeyCode.js +521 -0
- package/src/components/_util/Portal.js +51 -0
- package/src/components/_util/PortalWrapper.js +156 -0
- package/src/components/_util/StateMixin.js +10 -0
- package/src/components/_util/__tests__/easings.test.js +13 -0
- package/src/components/_util/__tests__/scrollTo.test.js +56 -0
- package/src/components/_util/antDirective.js +13 -0
- package/src/components/_util/antInputDirective.js +73 -0
- package/src/components/_util/callMoment.js +4 -0
- package/src/components/_util/colors.js +17 -0
- package/src/components/_util/createChainedFunction.js +22 -0
- package/src/components/_util/css-animation/Event.js +130 -0
- package/src/components/_util/css-animation/index.js +184 -0
- package/src/components/_util/easings.js +8 -0
- package/src/components/_util/env.js +14 -0
- package/src/components/_util/getLocale.js +30 -0
- package/src/components/_util/getRequestAnimationFrame.js +46 -0
- package/src/components/_util/getScroll.js +17 -0
- package/src/components/_util/getScrollBarSize.js +38 -0
- package/src/components/_util/getTransitionProps.js +34 -0
- package/src/components/_util/interopDefault.js +4 -0
- package/src/components/_util/isCssAnimationSupported.js +24 -0
- package/src/components/_util/isFlexSupported.js +12 -0
- package/src/components/_util/isNumeric.js +4 -0
- package/src/components/_util/isValid.js +4 -0
- package/src/components/_util/moment-util.js +75 -0
- package/src/components/_util/openAnimation.js +67 -0
- package/src/components/_util/portalDirective.js +24 -0
- package/src/components/_util/props-util.js +335 -0
- package/src/components/_util/proxyComponent.jsx +58 -0
- package/src/components/_util/raf.js +32 -0
- package/src/components/_util/requestAnimationTimeout.js +23 -0
- package/src/components/_util/responsiveObserve.js +94 -0
- package/src/components/_util/scrollTo.js +37 -0
- package/src/components/_util/setStyle.js +25 -0
- package/src/components/_util/store/PropTypes.js +7 -0
- package/src/components/_util/store/Provider.jsx +15 -0
- package/src/components/_util/store/connect.jsx +106 -0
- package/src/components/_util/store/create.js +30 -0
- package/src/components/_util/store/index.js +5 -0
- package/src/components/_util/styleChecker.js +13 -0
- package/src/components/_util/switchScrollingEffect.js +20 -0
- package/src/components/_util/throttleByAnimationFrame.js +45 -0
- package/src/components/_util/transButton.jsx +81 -0
- package/src/components/_util/triggerEvent.js +8 -0
- package/src/components/_util/type.js +4 -0
- package/src/components/_util/vnode.js +147 -0
- package/src/components/_util/vue-types/index.js +263 -0
- package/src/components/_util/vue-types/utils.js +200 -0
- package/src/components/_util/warning.js +7 -0
- package/src/components/_util/wave.jsx +169 -0
- package/src/components/base/index.js +9 -0
- package/src/components/base/style/index.js +2 -0
- package/src/components/button/__tests__/__snapshots__/demo.test.js.snap +103 -0
- package/src/components/button/__tests__/__snapshots__/index.test.js.snap +43 -0
- package/src/components/button/__tests__/demo.test.js +3 -0
- package/src/components/button/__tests__/index.test.js +239 -0
- package/src/components/button/button-group.jsx +52 -0
- package/src/components/button/button.jsx +186 -0
- package/src/components/button/buttonTypes.js +13 -0
- package/src/components/button/index.js +14 -0
- package/src/components/button/style/index.js +2 -0
- package/src/components/button/style/index.less +224 -0
- package/src/components/button/style/mixin.less +357 -0
- package/src/components/calendar/locale/en_US.js +2 -0
- package/src/components/config-provider/__tests__/index.test.js +44 -0
- package/src/components/config-provider/configConsumerProps.jsx +9 -0
- package/src/components/config-provider/index.jsx +91 -0
- package/src/components/config-provider/renderEmpty.jsx +42 -0
- package/src/components/config-provider/style/index.js +1 -0
- package/src/components/config-provider/style/index.less +2 -0
- package/src/components/date-picker/InputIcon.js +20 -0
- package/src/components/date-picker/PresetPanel.jsx +102 -0
- package/src/components/date-picker/RangePicker.jsx +1010 -0
- package/src/components/date-picker/WeekPicker.jsx +235 -0
- package/src/components/date-picker/__tests__/DatePicker.test.js +189 -0
- package/src/components/date-picker/__tests__/MonthPicker.test.js +29 -0
- package/src/components/date-picker/__tests__/RangePicker.test.js +417 -0
- package/src/components/date-picker/__tests__/WeekPicker.test.js +24 -0
- package/src/components/date-picker/__tests__/__snapshots__/DatePicker.test.js.snap +3 -0
- package/src/components/date-picker/__tests__/__snapshots__/RangePicker.test.js.snap +695 -0
- package/src/components/date-picker/__tests__/__snapshots__/WeekPicker.test.js.snap +3 -0
- package/src/components/date-picker/__tests__/__snapshots__/demo.test.js.snap +49 -0
- package/src/components/date-picker/__tests__/__snapshots__/other.test.js.snap +240 -0
- package/src/components/date-picker/__tests__/demo.test.js +3 -0
- package/src/components/date-picker/__tests__/mount.test.js +11 -0
- package/src/components/date-picker/__tests__/other.test.js +88 -0
- package/src/components/date-picker/__tests__/showTime.test.js +234 -0
- package/src/components/date-picker/__tests__/utils.js +34 -0
- package/src/components/date-picker/createPicker.js +273 -0
- package/src/components/date-picker/generate/dayjs.js +438 -0
- package/src/components/date-picker/generate/index.js +125 -0
- package/src/components/date-picker/generate/moment.js +357 -0
- package/src/components/date-picker/index.js +37 -0
- package/src/components/date-picker/interface.js +172 -0
- package/src/components/date-picker/locale/ar_EG.js +23 -0
- package/src/components/date-picker/locale/bg_BG.js +19 -0
- package/src/components/date-picker/locale/ca_ES.js +19 -0
- package/src/components/date-picker/locale/cs_CZ.js +19 -0
- package/src/components/date-picker/locale/da_DK.js +19 -0
- package/src/components/date-picker/locale/de_DE.js +19 -0
- package/src/components/date-picker/locale/el_GR.js +19 -0
- package/src/components/date-picker/locale/en_GB.js +19 -0
- package/src/components/date-picker/locale/en_US.js +19 -0
- package/src/components/date-picker/locale/es_ES.js +19 -0
- package/src/components/date-picker/locale/et_EE.js +19 -0
- package/src/components/date-picker/locale/example.json +39 -0
- package/src/components/date-picker/locale/fa_IR.js +19 -0
- package/src/components/date-picker/locale/fi_FI.js +19 -0
- package/src/components/date-picker/locale/fr_BE.js +19 -0
- package/src/components/date-picker/locale/fr_FR.js +19 -0
- package/src/components/date-picker/locale/ga_IE.js +19 -0
- package/src/components/date-picker/locale/he_IL.js +19 -0
- package/src/components/date-picker/locale/hi_IN.js +19 -0
- package/src/components/date-picker/locale/hr_HR.js +19 -0
- package/src/components/date-picker/locale/hu_HU.js +19 -0
- package/src/components/date-picker/locale/id_ID.js +19 -0
- package/src/components/date-picker/locale/is_IS.js +19 -0
- package/src/components/date-picker/locale/it_IT.js +19 -0
- package/src/components/date-picker/locale/ja_JP.js +18 -0
- package/src/components/date-picker/locale/kn_IN.js +19 -0
- package/src/components/date-picker/locale/ko_KR.js +19 -0
- package/src/components/date-picker/locale/ku_IQ.js +18 -0
- package/src/components/date-picker/locale/lv_LV.js +19 -0
- package/src/components/date-picker/locale/mk_MK.js +19 -0
- package/src/components/date-picker/locale/mn_MN.js +19 -0
- package/src/components/date-picker/locale/ms_MY.js +19 -0
- package/src/components/date-picker/locale/nb_NO.js +19 -0
- package/src/components/date-picker/locale/nl_BE.js +19 -0
- package/src/components/date-picker/locale/nl_NL.js +19 -0
- package/src/components/date-picker/locale/pl_PL.js +19 -0
- package/src/components/date-picker/locale/pt_BR.js +19 -0
- package/src/components/date-picker/locale/pt_PT.js +46 -0
- package/src/components/date-picker/locale/ro_RO.js +19 -0
- package/src/components/date-picker/locale/ru_RU.js +22 -0
- package/src/components/date-picker/locale/sk_SK.js +19 -0
- package/src/components/date-picker/locale/sl_SI.js +43 -0
- package/src/components/date-picker/locale/sr_RS.js +19 -0
- package/src/components/date-picker/locale/sv_SE.js +18 -0
- package/src/components/date-picker/locale/ta_IN.js +20 -0
- package/src/components/date-picker/locale/th_TH.js +19 -0
- package/src/components/date-picker/locale/tr_TR.js +19 -0
- package/src/components/date-picker/locale/uk_UA.js +18 -0
- package/src/components/date-picker/locale/vi_VN.js +19 -0
- package/src/components/date-picker/locale/zh_CN.js +21 -0
- package/src/components/date-picker/locale/zh_TW.js +20 -0
- package/src/components/date-picker/statusUtils.js +53 -0
- package/src/components/date-picker/style/Calendar.less +402 -0
- package/src/components/date-picker/style/DecadePanel.less +81 -0
- package/src/components/date-picker/style/MonthPanel.less +86 -0
- package/src/components/date-picker/style/MonthPicker.less +11 -0
- package/src/components/date-picker/style/Picker.less +113 -0
- package/src/components/date-picker/style/RangePicker.less +327 -0
- package/src/components/date-picker/style/TimePicker.less +151 -0
- package/src/components/date-picker/style/WeekPicker.less +21 -0
- package/src/components/date-picker/style/YearPanel.less +93 -0
- package/src/components/date-picker/style/index.js +8 -0
- package/src/components/date-picker/style/index.less +20 -0
- package/src/components/date-picker/style/presets.less +69 -0
- package/src/components/date-picker/style/status.less +94 -0
- package/src/components/date-picker/style/transitions.less +176 -0
- package/src/components/date-picker/utils.js +209 -0
- package/src/components/date-picker/wrapPicker.js +258 -0
- package/src/components/empty/__tests__/__snapshots__/demo.test.js.snap +195 -0
- package/src/components/empty/__tests__/demo.test.js +3 -0
- package/src/components/empty/__tests__/index.test.js +25 -0
- package/src/components/empty/empty.jsx +47 -0
- package/src/components/empty/index.jsx +78 -0
- package/src/components/empty/simple.jsx +20 -0
- package/src/components/empty/style/index.js +2 -0
- package/src/components/empty/style/index.less +52 -0
- package/src/components/icon/IconFont.jsx +52 -0
- package/src/components/icon/__tests__/__snapshots__/demo.test.js.snap +671 -0
- package/src/components/icon/__tests__/__snapshots__/index.test.js.snap +77 -0
- package/src/components/icon/__tests__/demo.test.js +3 -0
- package/src/components/icon/__tests__/index.test.js +236 -0
- package/src/components/icon/index.js +185 -0
- package/src/components/icon/style/index.js +2 -0
- package/src/components/icon/style/index.less +4 -0
- package/src/components/icon/twoTonePrimaryColor.js +12 -0
- package/src/components/icon/utils.js +77 -0
- package/src/components/input/ClearableLabeledInput.jsx +182 -0
- package/src/components/input/Group.jsx +41 -0
- package/src/components/input/Input.jsx +240 -0
- package/src/components/input/Password.jsx +117 -0
- package/src/components/input/ResizableTextArea.jsx +158 -0
- package/src/components/input/Search.jsx +185 -0
- package/src/components/input/TextArea.jsx +131 -0
- package/src/components/input/__tests__/Search.test.js +134 -0
- package/src/components/input/__tests__/__snapshots__/Search.test.js.snap +5 -0
- package/src/components/input/__tests__/__snapshots__/demo.test.js.snap +86 -0
- package/src/components/input/__tests__/__snapshots__/index.test.js.snap +9 -0
- package/src/components/input/__tests__/demo.test.js +3 -0
- package/src/components/input/__tests__/index.test.js +124 -0
- package/src/components/input/calculateNodeHeight.js +151 -0
- package/src/components/input/index.js +27 -0
- package/src/components/input/inputProps.js +36 -0
- package/src/components/input/style/index.js +5 -0
- package/src/components/input/style/index.less +52 -0
- package/src/components/input/style/mixin.less +453 -0
- package/src/components/input/style/search-input.less +34 -0
- package/src/components/locale/ar_EG.js +43 -0
- package/src/components/locale/bg_BG.js +43 -0
- package/src/components/locale/ca_ES.js +41 -0
- package/src/components/locale/cs_CZ.js +41 -0
- package/src/components/locale/da_DK.js +43 -0
- package/src/components/locale/de_DE.js +43 -0
- package/src/components/locale/default.js +62 -0
- package/src/components/locale/el_GR.js +43 -0
- package/src/components/locale/en_GB.js +43 -0
- package/src/components/locale/en_US.js +3 -0
- package/src/components/locale/es_ES.js +59 -0
- package/src/components/locale/et_EE.js +43 -0
- package/src/components/locale/fa_IR.js +43 -0
- package/src/components/locale/fi_FI.js +44 -0
- package/src/components/locale/fr_BE.js +47 -0
- package/src/components/locale/fr_FR.js +47 -0
- package/src/components/locale/ga_IE.js +43 -0
- package/src/components/locale/he_IL.js +43 -0
- package/src/components/locale/hi_IN.js +51 -0
- package/src/components/locale/hr_HR.js +57 -0
- package/src/components/locale/hu_HU.js +44 -0
- package/src/components/locale/hy_AM.js +109 -0
- package/src/components/locale/id_ID.js +45 -0
- package/src/components/locale/is_IS.js +43 -0
- package/src/components/locale/it_IT.js +56 -0
- package/src/components/locale/ja_JP.js +43 -0
- package/src/components/locale/kn_IN.js +51 -0
- package/src/components/locale/ko_KR.js +43 -0
- package/src/components/locale/ku_IQ.js +43 -0
- package/src/components/locale/lv_LV.js +43 -0
- package/src/components/locale/mk_MK.js +58 -0
- package/src/components/locale/mn_MN.js +43 -0
- package/src/components/locale/ms_MY.js +63 -0
- package/src/components/locale/nb_NO.js +43 -0
- package/src/components/locale/ne_NP.js +44 -0
- package/src/components/locale/nl_BE.js +43 -0
- package/src/components/locale/nl_NL.js +62 -0
- package/src/components/locale/pl_PL.js +43 -0
- package/src/components/locale/pt_BR.js +49 -0
- package/src/components/locale/pt_PT.js +44 -0
- package/src/components/locale/ro_RO.js +62 -0
- package/src/components/locale/ru_RU.js +53 -0
- package/src/components/locale/sk_SK.js +62 -0
- package/src/components/locale/sl_SI.js +43 -0
- package/src/components/locale/sr_RS.js +43 -0
- package/src/components/locale/sv_SE.js +47 -0
- package/src/components/locale/ta_IN.js +63 -0
- package/src/components/locale/th_TH.js +62 -0
- package/src/components/locale/tr_TR.js +57 -0
- package/src/components/locale/uk_UA.js +43 -0
- package/src/components/locale/vi_VN.js +43 -0
- package/src/components/locale/zh_CN.js +62 -0
- package/src/components/locale/zh_TW.js +49 -0
- package/src/components/locale-provider/LocaleReceiver.jsx +43 -0
- package/src/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap +434 -0
- package/src/components/locale-provider/__tests__/__snapshots__/index.test.js.snap +22618 -0
- package/src/components/locale-provider/__tests__/demo.test.js +3 -0
- package/src/components/locale-provider/__tests__/index.test.js +271 -0
- package/src/components/locale-provider/ar_EG.js +3 -0
- package/src/components/locale-provider/bg_BG.js +3 -0
- package/src/components/locale-provider/ca_ES.js +3 -0
- package/src/components/locale-provider/cs_CZ.js +3 -0
- package/src/components/locale-provider/da_DK.js +3 -0
- package/src/components/locale-provider/de_DE.js +3 -0
- package/src/components/locale-provider/default.js +3 -0
- package/src/components/locale-provider/el_GR.js +3 -0
- package/src/components/locale-provider/en_GB.js +3 -0
- package/src/components/locale-provider/en_US.js +3 -0
- package/src/components/locale-provider/es_ES.js +3 -0
- package/src/components/locale-provider/et_EE.js +3 -0
- package/src/components/locale-provider/fa_IR.js +3 -0
- package/src/components/locale-provider/fi_FI.js +3 -0
- package/src/components/locale-provider/fr_BE.js +3 -0
- package/src/components/locale-provider/fr_FR.js +3 -0
- package/src/components/locale-provider/ga_IE.js +3 -0
- package/src/components/locale-provider/he_IL.js +3 -0
- package/src/components/locale-provider/hi_IN.js +3 -0
- package/src/components/locale-provider/hr_HR.js +3 -0
- package/src/components/locale-provider/hu_HU.js +3 -0
- package/src/components/locale-provider/hy_AM.js +3 -0
- package/src/components/locale-provider/id_ID.js +3 -0
- package/src/components/locale-provider/index.jsx +82 -0
- package/src/components/locale-provider/is_IS.js +3 -0
- package/src/components/locale-provider/it_IT.js +3 -0
- package/src/components/locale-provider/ja_JP.js +3 -0
- package/src/components/locale-provider/kn_IN.js +3 -0
- package/src/components/locale-provider/ko_KR.js +3 -0
- package/src/components/locale-provider/ku_IQ.js +3 -0
- package/src/components/locale-provider/lv_LV.js +3 -0
- package/src/components/locale-provider/mk_MK.js +3 -0
- package/src/components/locale-provider/mn_MN.js +3 -0
- package/src/components/locale-provider/ms_MY.js +3 -0
- package/src/components/locale-provider/nb_NO.js +3 -0
- package/src/components/locale-provider/ne-NP.js +3 -0
- package/src/components/locale-provider/ne_NP.js +3 -0
- package/src/components/locale-provider/nl_BE.js +3 -0
- package/src/components/locale-provider/nl_NL.js +3 -0
- package/src/components/locale-provider/pl_PL.js +3 -0
- package/src/components/locale-provider/pt_BR.js +3 -0
- package/src/components/locale-provider/pt_PT.js +3 -0
- package/src/components/locale-provider/ro_RO.js +3 -0
- package/src/components/locale-provider/ru_RU.js +3 -0
- package/src/components/locale-provider/sk_SK.js +3 -0
- package/src/components/locale-provider/sl_SI.js +3 -0
- package/src/components/locale-provider/sr_RS.js +3 -0
- package/src/components/locale-provider/style/index.js +1 -0
- package/src/components/locale-provider/style/index.less +2 -0
- package/src/components/locale-provider/sv_SE.js +3 -0
- package/src/components/locale-provider/ta_IN.js +62 -0
- package/src/components/locale-provider/th_TH.js +3 -0
- package/src/components/locale-provider/tr_TR.js +3 -0
- package/src/components/locale-provider/uk_UA.js +3 -0
- package/src/components/locale-provider/vi_VN.js +3 -0
- package/src/components/locale-provider/zh_CN.js +3 -0
- package/src/components/locale-provider/zh_TW.js +3 -0
- package/src/components/style/color/bezierEasing.less +110 -0
- package/src/components/style/color/colorPalette.less +75 -0
- package/src/components/style/color/colors.less +149 -0
- package/src/components/style/color/tinyColor.less +1184 -0
- package/src/components/style/core/base.less +510 -0
- package/src/components/style/core/iconfont.less +19 -0
- package/src/components/style/core/index.less +4 -0
- package/src/components/style/core/motion/fade.less +31 -0
- package/src/components/style/core/motion/move.less +120 -0
- package/src/components/style/core/motion/other.less +45 -0
- package/src/components/style/core/motion/slide.less +120 -0
- package/src/components/style/core/motion/swing.less +34 -0
- package/src/components/style/core/motion/zoom.less +162 -0
- package/src/components/style/core/motion.less +20 -0
- package/src/components/style/index.js +1 -0
- package/src/components/style/index.less +2 -0
- package/src/components/style/index.tsx +1 -0
- package/src/components/style/mixins/clearfix.less +13 -0
- package/src/components/style/mixins/compatibility.less +22 -0
- package/src/components/style/mixins/iconfont.less +43 -0
- package/src/components/style/mixins/index.less +10 -0
- package/src/components/style/mixins/motion.less +35 -0
- package/src/components/style/mixins/operation-unit.less +18 -0
- package/src/components/style/mixins/reset.less +13 -0
- package/src/components/style/mixins/size.less +10 -0
- package/src/components/style/mixins/typography.less +49 -0
- package/src/components/style/themes/default.less +701 -0
- package/src/components/style/themes/index.less +1 -0
- package/src/components/style/v2-compatible-reset.js +1 -0
- package/src/components/style/v2-compatible-reset.less +51 -0
- package/src/components/style/v2-compatible-reset.tsx +1 -0
- package/src/components/tag/CheckableTag.jsx +43 -0
- package/src/components/tag/Tag.jsx +145 -0
- package/src/components/tag/__tests__/__snapshots__/demo.test.js.snap +92 -0
- package/src/components/tag/__tests__/__snapshots__/index.test.js.snap +13 -0
- package/src/components/tag/__tests__/demo.test.js +3 -0
- package/src/components/tag/__tests__/index.test.js +82 -0
- package/src/components/tag/index.js +14 -0
- package/src/components/tag/style/index.js +2 -0
- package/src/components/tag/style/index.less +106 -0
- package/src/components/time-picker/__tests__/__snapshots__/demo.test.js.snap +39 -0
- package/src/components/time-picker/__tests__/__snapshots__/index.test.js.snap +5 -0
- package/src/components/time-picker/__tests__/demo.test.js +3 -0
- package/src/components/time-picker/__tests__/index.test.js +55 -0
- package/src/components/time-picker/index.jsx +267 -0
- package/src/components/time-picker/locale/ar_EG.js +5 -0
- package/src/components/time-picker/locale/bg_BG.js +5 -0
- package/src/components/time-picker/locale/ca_ES.js +5 -0
- package/src/components/time-picker/locale/cs_CZ.js +5 -0
- package/src/components/time-picker/locale/da_DK.js +5 -0
- package/src/components/time-picker/locale/de_DE.js +5 -0
- package/src/components/time-picker/locale/el_GR.js +5 -0
- package/src/components/time-picker/locale/en_GB.js +5 -0
- package/src/components/time-picker/locale/en_US.js +5 -0
- package/src/components/time-picker/locale/es_ES.js +5 -0
- package/src/components/time-picker/locale/et_EE.js +5 -0
- package/src/components/time-picker/locale/fa_IR.js +5 -0
- package/src/components/time-picker/locale/fi_FI.js +5 -0
- package/src/components/time-picker/locale/fr_BE.js +5 -0
- package/src/components/time-picker/locale/fr_FR.js +5 -0
- package/src/components/time-picker/locale/ga_IE.js +5 -0
- package/src/components/time-picker/locale/he_IL.js +5 -0
- package/src/components/time-picker/locale/hi_IN.js +5 -0
- package/src/components/time-picker/locale/hr_HR.js +5 -0
- package/src/components/time-picker/locale/hu_HU.js +5 -0
- package/src/components/time-picker/locale/id_ID.js +5 -0
- package/src/components/time-picker/locale/is_IS.js +5 -0
- package/src/components/time-picker/locale/it_IT.js +5 -0
- package/src/components/time-picker/locale/ja_JP.js +5 -0
- package/src/components/time-picker/locale/kn_IN.js +5 -0
- package/src/components/time-picker/locale/ko_KR.js +5 -0
- package/src/components/time-picker/locale/ku_IQ.js +5 -0
- package/src/components/time-picker/locale/lv_LV.js +5 -0
- package/src/components/time-picker/locale/mk_MK.js +5 -0
- package/src/components/time-picker/locale/mn_MN.js +5 -0
- package/src/components/time-picker/locale/ms_MY.js +5 -0
- package/src/components/time-picker/locale/nb_NO.js +5 -0
- package/src/components/time-picker/locale/nl_BE.js +5 -0
- package/src/components/time-picker/locale/nl_NL.js +5 -0
- package/src/components/time-picker/locale/pl_PL.js +5 -0
- package/src/components/time-picker/locale/pt_BR.js +5 -0
- package/src/components/time-picker/locale/pt_PT.js +5 -0
- package/src/components/time-picker/locale/ro_RO.js +5 -0
- package/src/components/time-picker/locale/ru_RU.js +8 -0
- package/src/components/time-picker/locale/sk_SK.js +5 -0
- package/src/components/time-picker/locale/sl_SI.js +5 -0
- package/src/components/time-picker/locale/sr_RS.js +5 -0
- package/src/components/time-picker/locale/sv_SE.js +5 -0
- package/src/components/time-picker/locale/ta_IN.js +5 -0
- package/src/components/time-picker/locale/th_TH.js +5 -0
- package/src/components/time-picker/locale/tr_TR.js +5 -0
- package/src/components/time-picker/locale/uk_UA.js +5 -0
- package/src/components/time-picker/locale/vi_VN.js +5 -0
- package/src/components/time-picker/locale/zh_CN.js +5 -0
- package/src/components/time-picker/locale/zh_TW.js +5 -0
- package/src/components/time-picker/style/index.js +2 -0
- package/src/components/time-picker/style/index.less +246 -0
- package/src/components/tooltip/Tooltip.jsx +219 -0
- package/src/components/tooltip/__tests__/__snapshots__/demo.test.js.snap +20 -0
- package/src/components/tooltip/__tests__/demo.test.js +3 -0
- package/src/components/tooltip/__tests__/tooltip.test.js +204 -0
- package/src/components/tooltip/abstractTooltipProps.js +34 -0
- package/src/components/tooltip/index.js +10 -0
- package/src/components/tooltip/placements.js +96 -0
- package/src/components/tooltip/style/index.js +2 -0
- package/src/components/tooltip/style/index.less +187 -0
- package/src/components/vc-align/Align.jsx +149 -0
- package/src/components/vc-align/index.js +3 -0
- package/src/components/vc-align/util.js +52 -0
- package/src/components/vc-calendar/assets/common/Calendar.less +106 -0
- package/src/components/vc-calendar/assets/common/FullCalendar.less +91 -0
- package/src/components/vc-calendar/assets/common/Picker.less +10 -0
- package/src/components/vc-calendar/assets/common/RangeCalendar.less +131 -0
- package/src/components/vc-calendar/assets/common/index.less +16 -0
- package/src/components/vc-calendar/assets/index/Calendar.less +301 -0
- package/src/components/vc-calendar/assets/index/DecadePanel.less +122 -0
- package/src/components/vc-calendar/assets/index/Input.less +23 -0
- package/src/components/vc-calendar/assets/index/MonthPanel.less +143 -0
- package/src/components/vc-calendar/assets/index/Picker.less +110 -0
- package/src/components/vc-calendar/assets/index/Time.less +6 -0
- package/src/components/vc-calendar/assets/index/TimePanel.less +72 -0
- package/src/components/vc-calendar/assets/index/YearPanel.less +136 -0
- package/src/components/vc-calendar/assets/index.less +10 -0
- package/src/components/vc-calendar/index.js +8 -0
- package/src/components/vc-calendar/src/Calendar.jsx +390 -0
- package/src/components/vc-calendar/src/FullCalendar.jsx +166 -0
- package/src/components/vc-calendar/src/MonthCalendar.jsx +125 -0
- package/src/components/vc-calendar/src/Picker.jsx +244 -0
- package/src/components/vc-calendar/src/RangeCalendar.jsx +1031 -0
- package/src/components/vc-calendar/src/calendar/CalendarFooter.jsx +86 -0
- package/src/components/vc-calendar/src/calendar/CalendarHeader.jsx +264 -0
- package/src/components/vc-calendar/src/calendar/OkButton.jsx +18 -0
- package/src/components/vc-calendar/src/calendar/TimePickerButton.jsx +22 -0
- package/src/components/vc-calendar/src/calendar/TodayButton.jsx +33 -0
- package/src/components/vc-calendar/src/date/DateConstants.js +4 -0
- package/src/components/vc-calendar/src/date/DateInput.jsx +226 -0
- package/src/components/vc-calendar/src/date/DateTBody.jsx +261 -0
- package/src/components/vc-calendar/src/date/DateTHead.jsx +49 -0
- package/src/components/vc-calendar/src/date/DateTable.jsx +20 -0
- package/src/components/vc-calendar/src/decade/DecadePanel.jsx +131 -0
- package/src/components/vc-calendar/src/full-calendar/CalendarHeader.jsx +134 -0
- package/src/components/vc-calendar/src/index.js +3 -0
- package/src/components/vc-calendar/src/locale/ar_EG.js +27 -0
- package/src/components/vc-calendar/src/locale/bg_BG.js +27 -0
- package/src/components/vc-calendar/src/locale/ca_ES.js +27 -0
- package/src/components/vc-calendar/src/locale/cs_CZ.js +27 -0
- package/src/components/vc-calendar/src/locale/da_DK.js +27 -0
- package/src/components/vc-calendar/src/locale/de_DE.js +27 -0
- package/src/components/vc-calendar/src/locale/el_GR.js +27 -0
- package/src/components/vc-calendar/src/locale/en_GB.js +27 -0
- package/src/components/vc-calendar/src/locale/en_US.js +28 -0
- package/src/components/vc-calendar/src/locale/es_ES.js +27 -0
- package/src/components/vc-calendar/src/locale/et_EE.js +27 -0
- package/src/components/vc-calendar/src/locale/fa_IR.js +27 -0
- package/src/components/vc-calendar/src/locale/fi_FI.js +27 -0
- package/src/components/vc-calendar/src/locale/fr_BE.js +27 -0
- package/src/components/vc-calendar/src/locale/fr_FR.js +27 -0
- package/src/components/vc-calendar/src/locale/ga_IE.js +28 -0
- package/src/components/vc-calendar/src/locale/he_IL.js +28 -0
- package/src/components/vc-calendar/src/locale/hi_IN.js +28 -0
- package/src/components/vc-calendar/src/locale/hr_HR.js +28 -0
- package/src/components/vc-calendar/src/locale/hu_HU.js +27 -0
- package/src/components/vc-calendar/src/locale/id_ID.js +28 -0
- package/src/components/vc-calendar/src/locale/is_IS.js +27 -0
- package/src/components/vc-calendar/src/locale/it_IT.js +27 -0
- package/src/components/vc-calendar/src/locale/ja_JP.js +26 -0
- package/src/components/vc-calendar/src/locale/kn_IN.js +28 -0
- package/src/components/vc-calendar/src/locale/ko_KR.js +27 -0
- package/src/components/vc-calendar/src/locale/ku_IQ.js +27 -0
- package/src/components/vc-calendar/src/locale/lv_LV.js +27 -0
- package/src/components/vc-calendar/src/locale/mk_MK.js +27 -0
- package/src/components/vc-calendar/src/locale/mm_MM.js +28 -0
- package/src/components/vc-calendar/src/locale/mn_MN.js +28 -0
- package/src/components/vc-calendar/src/locale/ms_MY.js +27 -0
- package/src/components/vc-calendar/src/locale/nb_NO.js +27 -0
- package/src/components/vc-calendar/src/locale/nl_BE.js +27 -0
- package/src/components/vc-calendar/src/locale/nl_NL.js +27 -0
- package/src/components/vc-calendar/src/locale/pl_PL.js +27 -0
- package/src/components/vc-calendar/src/locale/pt_BR.js +27 -0
- package/src/components/vc-calendar/src/locale/pt_PT.js +27 -0
- package/src/components/vc-calendar/src/locale/ro_RO.js +28 -0
- package/src/components/vc-calendar/src/locale/ru_RU.js +27 -0
- package/src/components/vc-calendar/src/locale/sk_SK.js +28 -0
- package/src/components/vc-calendar/src/locale/sl_SI.js +27 -0
- package/src/components/vc-calendar/src/locale/sr_RS.js +27 -0
- package/src/components/vc-calendar/src/locale/sv_SE.js +27 -0
- package/src/components/vc-calendar/src/locale/ta_IN.js +28 -0
- package/src/components/vc-calendar/src/locale/th_TH.js +27 -0
- package/src/components/vc-calendar/src/locale/tr_TR.js +27 -0
- package/src/components/vc-calendar/src/locale/ug_CN.js +26 -0
- package/src/components/vc-calendar/src/locale/uk_UA.js +27 -0
- package/src/components/vc-calendar/src/locale/vi_VN.js +28 -0
- package/src/components/vc-calendar/src/locale/zh_CN.js +27 -0
- package/src/components/vc-calendar/src/locale/zh_TW.js +26 -0
- package/src/components/vc-calendar/src/mixin/CalendarMixin.js +122 -0
- package/src/components/vc-calendar/src/mixin/CommonMixin.js +26 -0
- package/src/components/vc-calendar/src/month/MonthPanel.jsx +123 -0
- package/src/components/vc-calendar/src/month/MonthTable.jsx +138 -0
- package/src/components/vc-calendar/src/picker/placements.js +35 -0
- package/src/components/vc-calendar/src/range-calendar/CalendarPart.jsx +171 -0
- package/src/components/vc-calendar/src/util/index.js +113 -0
- package/src/components/vc-calendar/src/util/toTime.js +15 -0
- package/src/components/vc-calendar/src/year/YearPanel.jsx +167 -0
- package/src/components/vc-pagination/locale/en_US.js +15 -0
- package/src/components/vc-select/DropdownMenu.jsx +216 -0
- package/src/components/vc-select/OptGroup.jsx +8 -0
- package/src/components/vc-select/Option.jsx +11 -0
- package/src/components/vc-select/PropTypes.js +59 -0
- package/src/components/vc-select/Select.jsx +1716 -0
- package/src/components/vc-select/SelectTrigger.jsx +259 -0
- package/src/components/vc-select/assets/index.less +541 -0
- package/src/components/vc-select/index.js +11 -0
- package/src/components/vc-select/util.js +223 -0
- package/src/components/vc-time-picker/Combobox.jsx +214 -0
- package/src/components/vc-time-picker/Header.jsx +187 -0
- package/src/components/vc-time-picker/Panel.jsx +225 -0
- package/src/components/vc-time-picker/Select.jsx +140 -0
- package/src/components/vc-time-picker/TimePicker.jsx +386 -0
- package/src/components/vc-time-picker/assets/index/Header.less +22 -0
- package/src/components/vc-time-picker/assets/index/Panel.less +29 -0
- package/src/components/vc-time-picker/assets/index/Picker.less +25 -0
- package/src/components/vc-time-picker/assets/index/Select.less +62 -0
- package/src/components/vc-time-picker/assets/index.less +44 -0
- package/src/components/vc-time-picker/index.js +2 -0
- package/src/components/vc-time-picker/placements.js +35 -0
- package/src/components/vc-tooltip/Content.jsx +23 -0
- package/src/components/vc-tooltip/Tooltip.jsx +106 -0
- package/src/components/vc-tooltip/assets/boostrap/anim.less +61 -0
- package/src/components/vc-tooltip/assets/bootstrap.less +171 -0
- package/src/components/vc-tooltip/assets/bootstrap_white.less +190 -0
- package/src/components/vc-tooltip/index.js +4 -0
- package/src/components/vc-tooltip/placements.js +83 -0
- package/src/components/vc-trigger/LazyRenderBox.jsx +22 -0
- package/src/components/vc-trigger/Popup.jsx +336 -0
- package/src/components/vc-trigger/PopupInner.jsx +25 -0
- package/src/components/vc-trigger/Trigger.jsx +663 -0
- package/src/components/vc-trigger/assets/index.less +72 -0
- package/src/components/vc-trigger/assets/mask.less +65 -0
- package/src/components/vc-trigger/index.js +3 -0
- package/src/components/vc-trigger/index.md +160 -0
- package/src/components/vc-trigger/t.js +665 -0
- package/src/components/vc-trigger/utils.js +27 -0
- package/src/components/vc-util/Dom/addEventListener.js +5 -0
- package/src/components/vc-util/Dom/class.js +28 -0
- package/src/components/vc-util/Dom/contains.js +11 -0
- package/src/components/vc-util/warning.js +38 -0
- package/src/index.js +44 -0
- package/types/index.d.ts +112 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import PropTypes from '../../../_util/vue-types';
|
|
2
|
+
import { getOptionProps, getListeners } from '../../../_util/props-util';
|
|
3
|
+
import cx from 'classnames';
|
|
4
|
+
import DateConstants from './DateConstants';
|
|
5
|
+
import { getTitleString, getTodayTime } from '../util/';
|
|
6
|
+
function noop() {}
|
|
7
|
+
function isSameDay(one, two) {
|
|
8
|
+
return one && two && one.isSame(two, 'day');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function beforeCurrentMonthYear(current, today) {
|
|
12
|
+
if (current.year() < today.year()) {
|
|
13
|
+
return 1;
|
|
14
|
+
}
|
|
15
|
+
return current.year() === today.year() && current.month() < today.month();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function afterCurrentMonthYear(current, today) {
|
|
19
|
+
if (current.year() > today.year()) {
|
|
20
|
+
return 1;
|
|
21
|
+
}
|
|
22
|
+
return current.year() === today.year() && current.month() > today.month();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getIdFromDate(date) {
|
|
26
|
+
return `rc-calendar-${date.year()}-${date.month()}-${date.date()}`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const DateTBody = {
|
|
30
|
+
props: {
|
|
31
|
+
contentRender: PropTypes.func,
|
|
32
|
+
dateRender: PropTypes.func,
|
|
33
|
+
disabledDate: PropTypes.func,
|
|
34
|
+
prefixCls: PropTypes.string,
|
|
35
|
+
selectedValue: PropTypes.oneOfType([PropTypes.any, PropTypes.arrayOf(PropTypes.any)]),
|
|
36
|
+
value: PropTypes.object,
|
|
37
|
+
hoverValue: PropTypes.any.def([]),
|
|
38
|
+
showWeekNumber: PropTypes.bool,
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
render() {
|
|
42
|
+
const props = getOptionProps(this);
|
|
43
|
+
const {
|
|
44
|
+
contentRender,
|
|
45
|
+
prefixCls,
|
|
46
|
+
selectedValue,
|
|
47
|
+
value,
|
|
48
|
+
showWeekNumber,
|
|
49
|
+
dateRender,
|
|
50
|
+
disabledDate,
|
|
51
|
+
hoverValue,
|
|
52
|
+
} = props;
|
|
53
|
+
const { select = noop, dayHover = noop } = getListeners(this);
|
|
54
|
+
let iIndex;
|
|
55
|
+
let jIndex;
|
|
56
|
+
let current;
|
|
57
|
+
const dateTable = [];
|
|
58
|
+
const today = getTodayTime(value);
|
|
59
|
+
const cellClass = `${prefixCls}-cell`;
|
|
60
|
+
const weekNumberCellClass = `${prefixCls}-week-number-cell`;
|
|
61
|
+
const dateClass = `${prefixCls}-date`;
|
|
62
|
+
const todayClass = `${prefixCls}-today`;
|
|
63
|
+
const selectedClass = `${prefixCls}-selected-day`;
|
|
64
|
+
const selectedDateClass = `${prefixCls}-selected-date`; // do not move with mouse operation
|
|
65
|
+
const selectedStartDateClass = `${prefixCls}-selected-start-date`;
|
|
66
|
+
const selectedEndDateClass = `${prefixCls}-selected-end-date`;
|
|
67
|
+
const inRangeClass = `${prefixCls}-in-range-cell`;
|
|
68
|
+
const lastMonthDayClass = `${prefixCls}-last-month-cell`;
|
|
69
|
+
const nextMonthDayClass = `${prefixCls}-next-month-btn-day`;
|
|
70
|
+
const disabledClass = `${prefixCls}-disabled-cell`;
|
|
71
|
+
const firstDisableClass = `${prefixCls}-disabled-cell-first-of-row`;
|
|
72
|
+
const lastDisableClass = `${prefixCls}-disabled-cell-last-of-row`;
|
|
73
|
+
const lastDayOfMonthClass = `${prefixCls}-last-day-of-month`;
|
|
74
|
+
const month1 = value.clone();
|
|
75
|
+
month1.date(1);
|
|
76
|
+
const day = month1.day();
|
|
77
|
+
const lastMonthDiffDay = (day + 7 - value.localeData().firstDayOfWeek()) % 7;
|
|
78
|
+
// calculate last month
|
|
79
|
+
const lastMonth1 = month1.clone();
|
|
80
|
+
lastMonth1.add(0 - lastMonthDiffDay, 'days');
|
|
81
|
+
let passed = 0;
|
|
82
|
+
for (iIndex = 0; iIndex < DateConstants.DATE_ROW_COUNT; iIndex++) {
|
|
83
|
+
for (jIndex = 0; jIndex < DateConstants.DATE_COL_COUNT; jIndex++) {
|
|
84
|
+
current = lastMonth1;
|
|
85
|
+
if (passed) {
|
|
86
|
+
current = current.clone();
|
|
87
|
+
current.add(passed, 'days');
|
|
88
|
+
}
|
|
89
|
+
dateTable.push(current);
|
|
90
|
+
passed++;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const tableHtml = [];
|
|
94
|
+
passed = 0;
|
|
95
|
+
|
|
96
|
+
for (iIndex = 0; iIndex < DateConstants.DATE_ROW_COUNT; iIndex++) {
|
|
97
|
+
let isCurrentWeek;
|
|
98
|
+
let weekNumberCell;
|
|
99
|
+
let isActiveWeek = false;
|
|
100
|
+
const dateCells = [];
|
|
101
|
+
if (showWeekNumber) {
|
|
102
|
+
weekNumberCell = (
|
|
103
|
+
<td key={`week-${dateTable[passed].week()}`} role="gridcell" class={weekNumberCellClass}>
|
|
104
|
+
{dateTable[passed].week()}
|
|
105
|
+
</td>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
for (jIndex = 0; jIndex < DateConstants.DATE_COL_COUNT; jIndex++) {
|
|
109
|
+
let next = null;
|
|
110
|
+
let last = null;
|
|
111
|
+
current = dateTable[passed];
|
|
112
|
+
if (jIndex < DateConstants.DATE_COL_COUNT - 1) {
|
|
113
|
+
next = dateTable[passed + 1];
|
|
114
|
+
}
|
|
115
|
+
if (jIndex > 0) {
|
|
116
|
+
last = dateTable[passed - 1];
|
|
117
|
+
}
|
|
118
|
+
let cls = cellClass;
|
|
119
|
+
let disabled = false;
|
|
120
|
+
let selected = false;
|
|
121
|
+
|
|
122
|
+
if (isSameDay(current, today)) {
|
|
123
|
+
cls += ` ${todayClass}`;
|
|
124
|
+
isCurrentWeek = true;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const isBeforeCurrentMonthYear = beforeCurrentMonthYear(current, value);
|
|
128
|
+
const isAfterCurrentMonthYear = afterCurrentMonthYear(current, value);
|
|
129
|
+
|
|
130
|
+
if (selectedValue && Array.isArray(selectedValue)) {
|
|
131
|
+
const rangeValue = hoverValue.length ? hoverValue : selectedValue;
|
|
132
|
+
if (!isBeforeCurrentMonthYear && !isAfterCurrentMonthYear) {
|
|
133
|
+
const startValue = rangeValue[0];
|
|
134
|
+
const endValue = rangeValue[1];
|
|
135
|
+
if (startValue) {
|
|
136
|
+
if (isSameDay(current, startValue)) {
|
|
137
|
+
selected = true;
|
|
138
|
+
isActiveWeek = true;
|
|
139
|
+
cls += ` ${selectedStartDateClass}`;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (startValue || endValue) {
|
|
143
|
+
if (isSameDay(current, endValue)) {
|
|
144
|
+
selected = true;
|
|
145
|
+
isActiveWeek = true;
|
|
146
|
+
cls += ` ${selectedEndDateClass}`;
|
|
147
|
+
} else if (
|
|
148
|
+
(startValue === null || startValue === undefined) &&
|
|
149
|
+
current.isBefore(endValue, 'day')
|
|
150
|
+
) {
|
|
151
|
+
cls += ` ${inRangeClass}`;
|
|
152
|
+
} else if (
|
|
153
|
+
(endValue === null || endValue === undefined) &&
|
|
154
|
+
current.isAfter(startValue, 'day')
|
|
155
|
+
) {
|
|
156
|
+
cls += ` ${inRangeClass}`;
|
|
157
|
+
} else if (current.isAfter(startValue, 'day') && current.isBefore(endValue, 'day')) {
|
|
158
|
+
cls += ` ${inRangeClass}`;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
} else if (isSameDay(current, value)) {
|
|
163
|
+
// keyboard change value, highlight works
|
|
164
|
+
selected = true;
|
|
165
|
+
isActiveWeek = true;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (isSameDay(current, selectedValue)) {
|
|
169
|
+
cls += ` ${selectedDateClass}`;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (isBeforeCurrentMonthYear) {
|
|
173
|
+
cls += ` ${lastMonthDayClass}`;
|
|
174
|
+
}
|
|
175
|
+
if (isAfterCurrentMonthYear) {
|
|
176
|
+
cls += ` ${nextMonthDayClass}`;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (
|
|
180
|
+
current
|
|
181
|
+
.clone()
|
|
182
|
+
.endOf('month')
|
|
183
|
+
.date() === current.date()
|
|
184
|
+
) {
|
|
185
|
+
cls += ` ${lastDayOfMonthClass}`;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (disabledDate) {
|
|
189
|
+
if (disabledDate(current, value)) {
|
|
190
|
+
disabled = true;
|
|
191
|
+
|
|
192
|
+
if (!last || !disabledDate(last, value)) {
|
|
193
|
+
cls += ` ${firstDisableClass}`;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (!next || !disabledDate(next, value)) {
|
|
197
|
+
cls += ` ${lastDisableClass}`;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (selected) {
|
|
203
|
+
cls += ` ${selectedClass}`;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (disabled) {
|
|
207
|
+
cls += ` ${disabledClass}`;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
let dateHtml;
|
|
211
|
+
if (dateRender) {
|
|
212
|
+
dateHtml = dateRender(current, value);
|
|
213
|
+
} else {
|
|
214
|
+
const content = contentRender ? contentRender(current, value) : current.date();
|
|
215
|
+
dateHtml = (
|
|
216
|
+
<div
|
|
217
|
+
key={getIdFromDate(current)}
|
|
218
|
+
class={dateClass}
|
|
219
|
+
aria-selected={selected}
|
|
220
|
+
aria-disabled={disabled}
|
|
221
|
+
>
|
|
222
|
+
{content}
|
|
223
|
+
</div>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
dateCells.push(
|
|
228
|
+
<td
|
|
229
|
+
key={passed}
|
|
230
|
+
onClick={disabled ? noop : select.bind(null, current)}
|
|
231
|
+
onMouseenter={disabled ? noop : dayHover.bind(null, current)}
|
|
232
|
+
role="gridcell"
|
|
233
|
+
title={getTitleString(current)}
|
|
234
|
+
class={cls}
|
|
235
|
+
>
|
|
236
|
+
{dateHtml}
|
|
237
|
+
</td>,
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
passed++;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
tableHtml.push(
|
|
244
|
+
<tr
|
|
245
|
+
key={iIndex}
|
|
246
|
+
role="row"
|
|
247
|
+
class={cx({
|
|
248
|
+
[`${prefixCls}-current-week`]: isCurrentWeek,
|
|
249
|
+
[`${prefixCls}-active-week`]: isActiveWeek,
|
|
250
|
+
})}
|
|
251
|
+
>
|
|
252
|
+
{weekNumberCell}
|
|
253
|
+
{dateCells}
|
|
254
|
+
</tr>,
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
return <tbody class={`${prefixCls}-tbody`}>{tableHtml}</tbody>;
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export default DateTBody;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import DateConstants from './DateConstants';
|
|
2
|
+
import moment from 'moment';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
functional: true,
|
|
6
|
+
render(createElement, context) {
|
|
7
|
+
const { props } = context;
|
|
8
|
+
const value = props.value;
|
|
9
|
+
const localeData = value.localeData();
|
|
10
|
+
const prefixCls = props.prefixCls;
|
|
11
|
+
const veryShortWeekdays = [];
|
|
12
|
+
const weekDays = [];
|
|
13
|
+
const firstDayOfWeek = localeData.firstDayOfWeek();
|
|
14
|
+
let showWeekNumberEl;
|
|
15
|
+
const now = moment();
|
|
16
|
+
for (let dateColIndex = 0; dateColIndex < DateConstants.DATE_COL_COUNT; dateColIndex++) {
|
|
17
|
+
const index = (firstDayOfWeek + dateColIndex) % DateConstants.DATE_COL_COUNT;
|
|
18
|
+
now.day(index);
|
|
19
|
+
veryShortWeekdays[dateColIndex] = localeData.weekdaysMin(now);
|
|
20
|
+
weekDays[dateColIndex] = localeData.weekdaysShort(now);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (props.showWeekNumber) {
|
|
24
|
+
showWeekNumberEl = (
|
|
25
|
+
<th
|
|
26
|
+
role="columnheader"
|
|
27
|
+
class={`${prefixCls}-column-header ${prefixCls}-week-number-header`}
|
|
28
|
+
>
|
|
29
|
+
<span class={`${prefixCls}-column-header-inner`}>x</span>
|
|
30
|
+
</th>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
const weekDaysEls = weekDays.map((day, xindex) => {
|
|
34
|
+
return (
|
|
35
|
+
<th key={xindex} role="columnheader" title={day} class={`${prefixCls}-column-header`}>
|
|
36
|
+
<span class={`${prefixCls}-column-header-inner`}>{veryShortWeekdays[xindex]}</span>
|
|
37
|
+
</th>
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
return (
|
|
41
|
+
<thead>
|
|
42
|
+
<tr role="row">
|
|
43
|
+
{showWeekNumberEl}
|
|
44
|
+
{weekDaysEls}
|
|
45
|
+
</tr>
|
|
46
|
+
</thead>
|
|
47
|
+
);
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import DateTHead from './DateTHead';
|
|
2
|
+
import DateTBody from './DateTBody';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
functional: true,
|
|
6
|
+
render(createElement, context) {
|
|
7
|
+
const { props, listeners = {} } = context;
|
|
8
|
+
const prefixCls = props.prefixCls;
|
|
9
|
+
const bodyProps = {
|
|
10
|
+
props,
|
|
11
|
+
on: listeners,
|
|
12
|
+
};
|
|
13
|
+
return (
|
|
14
|
+
<table class={`${prefixCls}-table`} cellSpacing="0" role="grid">
|
|
15
|
+
<DateTHead {...bodyProps} />
|
|
16
|
+
<DateTBody {...bodyProps} />
|
|
17
|
+
</table>
|
|
18
|
+
);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import PropTypes from '../../../_util/vue-types';
|
|
2
|
+
import BaseMixin from '../../../_util/BaseMixin';
|
|
3
|
+
const ROW = 4;
|
|
4
|
+
const COL = 3;
|
|
5
|
+
function noop() {}
|
|
6
|
+
function goYear(direction) {
|
|
7
|
+
const next = this.sValue.clone();
|
|
8
|
+
next.add(direction, 'years');
|
|
9
|
+
this.setState({
|
|
10
|
+
sValue: next,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function chooseDecade(year, event) {
|
|
15
|
+
const next = this.sValue.clone();
|
|
16
|
+
next.year(year);
|
|
17
|
+
next.month(this.sValue.month());
|
|
18
|
+
this.__emit('select', next);
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
mixins: [BaseMixin],
|
|
24
|
+
props: {
|
|
25
|
+
locale: PropTypes.object,
|
|
26
|
+
value: PropTypes.object,
|
|
27
|
+
defaultValue: PropTypes.object,
|
|
28
|
+
rootPrefixCls: PropTypes.string,
|
|
29
|
+
renderFooter: PropTypes.func,
|
|
30
|
+
},
|
|
31
|
+
data() {
|
|
32
|
+
this.nextCentury = goYear.bind(this, 100);
|
|
33
|
+
this.previousCentury = goYear.bind(this, -100);
|
|
34
|
+
return {
|
|
35
|
+
sValue: this.value || this.defaultValue,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
watch: {
|
|
39
|
+
value(val) {
|
|
40
|
+
this.sValue = val;
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
render() {
|
|
44
|
+
const value = this.sValue;
|
|
45
|
+
const { locale, renderFooter } = this.$props;
|
|
46
|
+
const currentYear = value.year();
|
|
47
|
+
const startYear = parseInt(currentYear / 100, 10) * 100;
|
|
48
|
+
const preYear = startYear - 10;
|
|
49
|
+
const endYear = startYear + 99;
|
|
50
|
+
const decades = [];
|
|
51
|
+
let index = 0;
|
|
52
|
+
const prefixCls = `${this.rootPrefixCls}-decade-panel`;
|
|
53
|
+
|
|
54
|
+
for (let rowIndex = 0; rowIndex < ROW; rowIndex++) {
|
|
55
|
+
decades[rowIndex] = [];
|
|
56
|
+
for (let colIndex = 0; colIndex < COL; colIndex++) {
|
|
57
|
+
const startDecade = preYear + index * 10;
|
|
58
|
+
const endDecade = preYear + index * 10 + 9;
|
|
59
|
+
decades[rowIndex][colIndex] = {
|
|
60
|
+
startDecade,
|
|
61
|
+
endDecade,
|
|
62
|
+
};
|
|
63
|
+
index++;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const footer = renderFooter && renderFooter('decade');
|
|
68
|
+
const decadesEls = decades.map((row, decadeIndex) => {
|
|
69
|
+
const tds = row.map(decadeData => {
|
|
70
|
+
const dStartDecade = decadeData.startDecade;
|
|
71
|
+
const dEndDecade = decadeData.endDecade;
|
|
72
|
+
const isLast = dStartDecade < startYear;
|
|
73
|
+
const isNext = dEndDecade > endYear;
|
|
74
|
+
const classNameMap = {
|
|
75
|
+
[`${prefixCls}-cell`]: 1,
|
|
76
|
+
[`${prefixCls}-selected-cell`]: dStartDecade <= currentYear && currentYear <= dEndDecade,
|
|
77
|
+
[`${prefixCls}-last-century-cell`]: isLast,
|
|
78
|
+
[`${prefixCls}-next-century-cell`]: isNext,
|
|
79
|
+
};
|
|
80
|
+
const content = `${dStartDecade}-${dEndDecade}`;
|
|
81
|
+
let clickHandler = noop;
|
|
82
|
+
if (isLast) {
|
|
83
|
+
clickHandler = this.previousCentury;
|
|
84
|
+
} else if (isNext) {
|
|
85
|
+
clickHandler = this.nextCentury;
|
|
86
|
+
} else {
|
|
87
|
+
clickHandler = chooseDecade.bind(this, dStartDecade);
|
|
88
|
+
}
|
|
89
|
+
return (
|
|
90
|
+
<td key={dStartDecade} onClick={clickHandler} role="gridcell" class={classNameMap}>
|
|
91
|
+
<a class={`${prefixCls}-decade`}>{content}</a>
|
|
92
|
+
</td>
|
|
93
|
+
);
|
|
94
|
+
});
|
|
95
|
+
return (
|
|
96
|
+
<tr key={decadeIndex} role="row">
|
|
97
|
+
{tds}
|
|
98
|
+
</tr>
|
|
99
|
+
);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<div class={prefixCls}>
|
|
104
|
+
<div class={`${prefixCls}-header`}>
|
|
105
|
+
<a
|
|
106
|
+
class={`${prefixCls}-prev-century-btn`}
|
|
107
|
+
role="button"
|
|
108
|
+
onClick={this.previousCentury}
|
|
109
|
+
title={locale.previousCentury}
|
|
110
|
+
/>
|
|
111
|
+
|
|
112
|
+
<div class={`${prefixCls}-century`}>
|
|
113
|
+
{startYear}-{endYear}
|
|
114
|
+
</div>
|
|
115
|
+
<a
|
|
116
|
+
class={`${prefixCls}-next-century-btn`}
|
|
117
|
+
role="button"
|
|
118
|
+
onClick={this.nextCentury}
|
|
119
|
+
title={locale.nextCentury}
|
|
120
|
+
/>
|
|
121
|
+
</div>
|
|
122
|
+
<div class={`${prefixCls}-body`}>
|
|
123
|
+
<table class={`${prefixCls}-table`} cellSpacing="0" role="grid">
|
|
124
|
+
<tbody class={`${prefixCls}-tbody`}>{decadesEls}</tbody>
|
|
125
|
+
</table>
|
|
126
|
+
</div>
|
|
127
|
+
{footer && <div class={`${prefixCls}-footer`}>{footer}</div>}
|
|
128
|
+
</div>
|
|
129
|
+
);
|
|
130
|
+
},
|
|
131
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import PropTypes from '../../../_util/vue-types';
|
|
2
|
+
import BaseMixin from '../../../_util/BaseMixin';
|
|
3
|
+
import { getMonthName } from '../util';
|
|
4
|
+
|
|
5
|
+
const CalendarHeader = {
|
|
6
|
+
name: 'CalendarHeader',
|
|
7
|
+
mixins: [BaseMixin],
|
|
8
|
+
props: {
|
|
9
|
+
value: PropTypes.object,
|
|
10
|
+
locale: PropTypes.object,
|
|
11
|
+
yearSelectOffset: PropTypes.number.def(10),
|
|
12
|
+
yearSelectTotal: PropTypes.number.def(20),
|
|
13
|
+
// onValueChange: PropTypes.func,
|
|
14
|
+
// onTypeChange: PropTypes.func,
|
|
15
|
+
Select: PropTypes.object,
|
|
16
|
+
prefixCls: PropTypes.string,
|
|
17
|
+
type: PropTypes.string,
|
|
18
|
+
showTypeSwitch: PropTypes.bool,
|
|
19
|
+
headerComponents: PropTypes.array,
|
|
20
|
+
},
|
|
21
|
+
methods: {
|
|
22
|
+
onYearChange(year) {
|
|
23
|
+
const newValue = this.value.clone();
|
|
24
|
+
newValue.year(parseInt(year, 10));
|
|
25
|
+
this.__emit('valueChange', newValue);
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
onMonthChange(month) {
|
|
29
|
+
const newValue = this.value.clone();
|
|
30
|
+
newValue.month(parseInt(month, 10));
|
|
31
|
+
this.__emit('valueChange', newValue);
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
yearSelectElement(year) {
|
|
35
|
+
const { yearSelectOffset, yearSelectTotal, prefixCls, Select } = this;
|
|
36
|
+
const start = year - yearSelectOffset;
|
|
37
|
+
const end = start + yearSelectTotal;
|
|
38
|
+
|
|
39
|
+
const options = [];
|
|
40
|
+
for (let index = start; index < end; index++) {
|
|
41
|
+
options.push(<Select.Option key={`${index}`}>{index}</Select.Option>);
|
|
42
|
+
}
|
|
43
|
+
return (
|
|
44
|
+
<Select
|
|
45
|
+
class={`${prefixCls}-header-year-select`}
|
|
46
|
+
onChange={this.onYearChange}
|
|
47
|
+
dropdownStyle={{ zIndex: 2000 }}
|
|
48
|
+
dropdownMenuStyle={{ maxHeight: '250px', overflow: 'auto', fontSize: '12px' }}
|
|
49
|
+
optionLabelProp="children"
|
|
50
|
+
value={String(year)}
|
|
51
|
+
showSearch={false}
|
|
52
|
+
>
|
|
53
|
+
{options}
|
|
54
|
+
</Select>
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
monthSelectElement(month) {
|
|
59
|
+
const { value, Select, prefixCls } = this;
|
|
60
|
+
const t = value.clone();
|
|
61
|
+
const options = [];
|
|
62
|
+
|
|
63
|
+
for (let index = 0; index < 12; index++) {
|
|
64
|
+
t.month(index);
|
|
65
|
+
options.push(<Select.Option key={`${index}`}>{getMonthName(t)}</Select.Option>);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<Select
|
|
70
|
+
class={`${prefixCls}-header-month-select`}
|
|
71
|
+
dropdownStyle={{ zIndex: 2000 }}
|
|
72
|
+
dropdownMenuStyle={{
|
|
73
|
+
maxHeight: '250px',
|
|
74
|
+
overflow: 'auto',
|
|
75
|
+
overflowX: 'hidden',
|
|
76
|
+
fontSize: '12px',
|
|
77
|
+
}}
|
|
78
|
+
optionLabelProp="children"
|
|
79
|
+
value={String(month)}
|
|
80
|
+
showSearch={false}
|
|
81
|
+
onChange={this.onMonthChange}
|
|
82
|
+
>
|
|
83
|
+
{options}
|
|
84
|
+
</Select>
|
|
85
|
+
);
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
changeTypeToDate() {
|
|
89
|
+
this.__emit('typeChange', 'date');
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
changeTypeToMonth() {
|
|
93
|
+
this.__emit('typeChange', 'month');
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
render() {
|
|
98
|
+
const { value, locale, prefixCls, type, showTypeSwitch, headerComponents } = this;
|
|
99
|
+
const year = value.year();
|
|
100
|
+
const month = value.month();
|
|
101
|
+
const yearSelect = this.yearSelectElement(year);
|
|
102
|
+
const monthSelect = type === 'month' ? null : this.monthSelectElement(month);
|
|
103
|
+
const switchCls = `${prefixCls}-header-switcher`;
|
|
104
|
+
const typeSwitcher = showTypeSwitch ? (
|
|
105
|
+
<span class={switchCls}>
|
|
106
|
+
{type === 'date' ? (
|
|
107
|
+
<span class={`${switchCls}-focus`}>{locale.month}</span>
|
|
108
|
+
) : (
|
|
109
|
+
<span onClick={this.changeTypeToDate} class={`${switchCls}-normal`}>
|
|
110
|
+
{locale.month}
|
|
111
|
+
</span>
|
|
112
|
+
)}
|
|
113
|
+
{type === 'month' ? (
|
|
114
|
+
<span class={`${switchCls}-focus`}>{locale.year}</span>
|
|
115
|
+
) : (
|
|
116
|
+
<span onClick={this.changeTypeToMonth} class={`${switchCls}-normal`}>
|
|
117
|
+
{locale.year}
|
|
118
|
+
</span>
|
|
119
|
+
)}
|
|
120
|
+
</span>
|
|
121
|
+
) : null;
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<div class={`${prefixCls}-header`}>
|
|
125
|
+
{typeSwitcher}
|
|
126
|
+
{monthSelect}
|
|
127
|
+
{yearSelect}
|
|
128
|
+
{headerComponents}
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export default CalendarHeader;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
today: 'اليوم',
|
|
3
|
+
now: 'الأن',
|
|
4
|
+
backToToday: 'العودة إلى اليوم',
|
|
5
|
+
ok: 'تأكيد',
|
|
6
|
+
clear: 'مسح',
|
|
7
|
+
month: 'الشهر',
|
|
8
|
+
year: 'السنة',
|
|
9
|
+
timeSelect: 'اختيار الوقت',
|
|
10
|
+
dateSelect: 'اختيار التاريخ',
|
|
11
|
+
monthSelect: 'اختيار الشهر',
|
|
12
|
+
yearSelect: 'اختيار السنة',
|
|
13
|
+
decadeSelect: 'اختيار العقد',
|
|
14
|
+
yearFormat: 'YYYY',
|
|
15
|
+
dateFormat: 'M/D/YYYY',
|
|
16
|
+
dayFormat: 'D',
|
|
17
|
+
dateTimeFormat: 'M/D/YYYY HH:mm:ss',
|
|
18
|
+
monthBeforeYear: true,
|
|
19
|
+
previousMonth: 'الشهر السابق (PageUp)',
|
|
20
|
+
nextMonth: 'الشهر التالى(PageDown)',
|
|
21
|
+
previousYear: 'العام السابق (Control + left)',
|
|
22
|
+
nextYear: 'العام التالى (Control + right)',
|
|
23
|
+
previousDecade: 'العقد السابق',
|
|
24
|
+
nextDecade: 'العقد التالى',
|
|
25
|
+
previousCentury: 'القرن السابق',
|
|
26
|
+
nextCentury: 'القرن التالى',
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
today: 'Днес',
|
|
3
|
+
now: 'Сега',
|
|
4
|
+
backToToday: 'Към днес',
|
|
5
|
+
ok: 'Добре',
|
|
6
|
+
clear: 'Изчистване',
|
|
7
|
+
month: 'Месец',
|
|
8
|
+
year: 'Година',
|
|
9
|
+
timeSelect: 'Избор на час',
|
|
10
|
+
dateSelect: 'Избор на дата',
|
|
11
|
+
monthSelect: 'Избор на месец',
|
|
12
|
+
yearSelect: 'Избор на година',
|
|
13
|
+
decadeSelect: 'Десетилетие',
|
|
14
|
+
yearFormat: 'YYYY',
|
|
15
|
+
dateFormat: 'D M YYYY',
|
|
16
|
+
dayFormat: 'D',
|
|
17
|
+
dateTimeFormat: 'D M YYYY HH:mm:ss',
|
|
18
|
+
monthBeforeYear: true,
|
|
19
|
+
previousMonth: 'Предишен месец (PageUp)',
|
|
20
|
+
nextMonth: 'Следващ месец (PageDown)',
|
|
21
|
+
previousYear: 'Последна година (Control + left)',
|
|
22
|
+
nextYear: 'Следваща година (Control + right)',
|
|
23
|
+
previousDecade: 'Предишно десетилетие',
|
|
24
|
+
nextDecade: 'Следващо десетилетие',
|
|
25
|
+
previousCentury: 'Последен век',
|
|
26
|
+
nextCentury: 'Следващ век',
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
today: 'Avui',
|
|
3
|
+
now: 'Ara',
|
|
4
|
+
backToToday: 'Tornar a avui',
|
|
5
|
+
ok: 'Acceptar',
|
|
6
|
+
clear: 'Netejar',
|
|
7
|
+
month: 'Mes',
|
|
8
|
+
year: 'Any',
|
|
9
|
+
timeSelect: 'Seleccionar hora',
|
|
10
|
+
dateSelect: 'Seleccionar data',
|
|
11
|
+
monthSelect: 'Escollir un mes',
|
|
12
|
+
yearSelect: 'Escollir un any',
|
|
13
|
+
decadeSelect: 'Escollir una dècada',
|
|
14
|
+
yearFormat: 'YYYY',
|
|
15
|
+
dateFormat: 'D/M/YYYY',
|
|
16
|
+
dayFormat: 'D',
|
|
17
|
+
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
|
|
18
|
+
monthBeforeYear: true,
|
|
19
|
+
previousMonth: 'Mes anterior (PageUp)',
|
|
20
|
+
nextMonth: 'Mes següent (PageDown)',
|
|
21
|
+
previousYear: 'Any anterior (Control + left)',
|
|
22
|
+
nextYear: 'Mes següent (Control + right)',
|
|
23
|
+
previousDecade: 'Dècada anterior',
|
|
24
|
+
nextDecade: 'Dècada següent',
|
|
25
|
+
previousCentury: 'Segle anterior',
|
|
26
|
+
nextCentury: 'Segle següent',
|
|
27
|
+
};
|