@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,357 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Moment.js 适配器
|
|
3
|
+
* 实现 GenerateConfig 接口,用于与 moment.js 集成
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as moment from 'moment';
|
|
7
|
+
import interopDefault from '../../_util/interopDefault';
|
|
8
|
+
|
|
9
|
+
const momentInstance = interopDefault(moment);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 获取 moment 实例,处理 ES Module 兼容
|
|
13
|
+
* @param {any} value - 输入值
|
|
14
|
+
* @param {string} [format] - 格式字符串
|
|
15
|
+
* @returns {moment.Moment} moment 实例
|
|
16
|
+
*/
|
|
17
|
+
function toMoment(value, format) {
|
|
18
|
+
if (momentInstance.isMoment(value)) {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
if (value === undefined || value === null) {
|
|
22
|
+
return momentInstance();
|
|
23
|
+
}
|
|
24
|
+
if (format) {
|
|
25
|
+
return momentInstance(value, format);
|
|
26
|
+
}
|
|
27
|
+
return momentInstance(value);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Moment.js GenerateConfig 实现
|
|
32
|
+
* @type {import('./index').GenerateConfig}
|
|
33
|
+
*/
|
|
34
|
+
const momentGenerateConfig = {
|
|
35
|
+
// ====================== 获取信息 ======================
|
|
36
|
+
getNow() {
|
|
37
|
+
return momentInstance();
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
getYear(date) {
|
|
41
|
+
return toMoment(date).year();
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
getMonth(date) {
|
|
45
|
+
return toMoment(date).month();
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
getDate(date) {
|
|
49
|
+
return toMoment(date).date();
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
getHour(date) {
|
|
53
|
+
return toMoment(date).hour();
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
getMinute(date) {
|
|
57
|
+
return toMoment(date).minute();
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
getSecond(date) {
|
|
61
|
+
return toMoment(date).second();
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
getWeekDay(date) {
|
|
65
|
+
return toMoment(date).day();
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
getWeek(date) {
|
|
69
|
+
return toMoment(date).week();
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
getQuarter(date) {
|
|
73
|
+
return toMoment(date).quarter();
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
// ====================== 修改日期 ======================
|
|
77
|
+
addYear(date, diff) {
|
|
78
|
+
return toMoment(date)
|
|
79
|
+
.clone()
|
|
80
|
+
.add(diff, 'year');
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
addMonth(date, diff) {
|
|
84
|
+
return toMoment(date)
|
|
85
|
+
.clone()
|
|
86
|
+
.add(diff, 'month');
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
addDate(date, diff) {
|
|
90
|
+
return toMoment(date)
|
|
91
|
+
.clone()
|
|
92
|
+
.add(diff, 'day');
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
setYear(date, year) {
|
|
96
|
+
return toMoment(date)
|
|
97
|
+
.clone()
|
|
98
|
+
.year(year);
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
setMonth(date, month) {
|
|
102
|
+
// 注意: moment 的 month 是 0-11
|
|
103
|
+
return toMoment(date)
|
|
104
|
+
.clone()
|
|
105
|
+
.month(month);
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
setDate(date, num) {
|
|
109
|
+
return toMoment(date)
|
|
110
|
+
.clone()
|
|
111
|
+
.date(num);
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
setHour(date, hour) {
|
|
115
|
+
return toMoment(date)
|
|
116
|
+
.clone()
|
|
117
|
+
.hour(hour);
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
setMinute(date, minute) {
|
|
121
|
+
return toMoment(date)
|
|
122
|
+
.clone()
|
|
123
|
+
.minute(minute);
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
setSecond(date, second) {
|
|
127
|
+
return toMoment(date)
|
|
128
|
+
.clone()
|
|
129
|
+
.second(second);
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
// ====================== 比较 ======================
|
|
133
|
+
isAfter(date1, date2) {
|
|
134
|
+
return toMoment(date1).isAfter(toMoment(date2));
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
isBefore(date1, date2) {
|
|
138
|
+
return toMoment(date1).isBefore(toMoment(date2));
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
isSame(date1, date2, type = 'day') {
|
|
142
|
+
return toMoment(date1).isSame(toMoment(date2), type);
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
isSameYear(date1, date2) {
|
|
146
|
+
return toMoment(date1).isSame(toMoment(date2), 'year');
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
isSameMonth(date1, date2) {
|
|
150
|
+
return toMoment(date1).isSame(toMoment(date2), 'month');
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
isSameDate(date1, date2) {
|
|
154
|
+
return toMoment(date1).isSame(toMoment(date2), 'day');
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
isSameWeek(date1, date2) {
|
|
158
|
+
return toMoment(date1).isSame(toMoment(date2), 'week');
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
// ====================== 验证 ======================
|
|
162
|
+
isValidate(date) {
|
|
163
|
+
return toMoment(date).isValid();
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
isDateType(value) {
|
|
167
|
+
return momentInstance.isMoment(value);
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
// ====================== 转换 ======================
|
|
171
|
+
toDate(value, format) {
|
|
172
|
+
if (momentInstance.isMoment(value)) {
|
|
173
|
+
return value;
|
|
174
|
+
}
|
|
175
|
+
if (value === null || value === undefined) {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
if (format) {
|
|
179
|
+
return momentInstance(value, format);
|
|
180
|
+
}
|
|
181
|
+
return momentInstance(value);
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
toString(date, format) {
|
|
185
|
+
if (!date) {
|
|
186
|
+
return '';
|
|
187
|
+
}
|
|
188
|
+
const m = toMoment(date);
|
|
189
|
+
if (!m.isValid()) {
|
|
190
|
+
return '';
|
|
191
|
+
}
|
|
192
|
+
if (typeof format === 'function') {
|
|
193
|
+
return format(m);
|
|
194
|
+
}
|
|
195
|
+
return m.format(format);
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
clone(date) {
|
|
199
|
+
return toMoment(date).clone();
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
// ====================== 范围操作 ======================
|
|
203
|
+
getStartOfMonth(date) {
|
|
204
|
+
return toMoment(date)
|
|
205
|
+
.clone()
|
|
206
|
+
.startOf('month');
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
getEndOfMonth(date) {
|
|
210
|
+
return toMoment(date)
|
|
211
|
+
.clone()
|
|
212
|
+
.endOf('month');
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
getStartOfYear(date) {
|
|
216
|
+
return toMoment(date)
|
|
217
|
+
.clone()
|
|
218
|
+
.startOf('year');
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
getEndOfYear(date) {
|
|
222
|
+
return toMoment(date)
|
|
223
|
+
.clone()
|
|
224
|
+
.endOf('year');
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
getStartOfWeek(date) {
|
|
228
|
+
return toMoment(date)
|
|
229
|
+
.clone()
|
|
230
|
+
.startOf('week');
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
getEndOfWeek(date) {
|
|
234
|
+
return toMoment(date)
|
|
235
|
+
.clone()
|
|
236
|
+
.endOf('week');
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
getStartOfDay(date) {
|
|
240
|
+
return toMoment(date)
|
|
241
|
+
.clone()
|
|
242
|
+
.startOf('day');
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
getEndOfDay(date) {
|
|
246
|
+
return toMoment(date)
|
|
247
|
+
.clone()
|
|
248
|
+
.endOf('day');
|
|
249
|
+
},
|
|
250
|
+
|
|
251
|
+
// ====================== 国际化 ======================
|
|
252
|
+
locale: {
|
|
253
|
+
/**
|
|
254
|
+
* 获取一周的第一天
|
|
255
|
+
* @param {string} locale - 语言代码
|
|
256
|
+
* @returns {number} 0-6 (0=Sunday)
|
|
257
|
+
*/
|
|
258
|
+
getWeekFirstDay(locale) {
|
|
259
|
+
const m = locale ? momentInstance().locale(locale) : momentInstance();
|
|
260
|
+
return m.localeData().firstDayOfWeek();
|
|
261
|
+
},
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* 获取一周的第一个日期
|
|
265
|
+
* @param {string} locale - 语言代码
|
|
266
|
+
* @param {moment.Moment} date - 日期
|
|
267
|
+
* @returns {moment.Moment} 一周的第一天
|
|
268
|
+
*/
|
|
269
|
+
getWeekFirstDate(locale, date) {
|
|
270
|
+
const m = toMoment(date);
|
|
271
|
+
if (locale) {
|
|
272
|
+
m.locale(locale);
|
|
273
|
+
}
|
|
274
|
+
return m.clone().startOf('week');
|
|
275
|
+
},
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* 获取周数
|
|
279
|
+
* @param {string} locale - 语言代码
|
|
280
|
+
* @param {moment.Moment} date - 日期
|
|
281
|
+
* @returns {number} 周数
|
|
282
|
+
*/
|
|
283
|
+
getWeek(locale, date) {
|
|
284
|
+
const m = toMoment(date);
|
|
285
|
+
if (locale) {
|
|
286
|
+
m.locale(locale);
|
|
287
|
+
}
|
|
288
|
+
return m.week();
|
|
289
|
+
},
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* 格式化日期
|
|
293
|
+
* @param {string} locale - 语言代码
|
|
294
|
+
* @param {moment.Moment} date - 日期
|
|
295
|
+
* @param {string} format - 格式字符串
|
|
296
|
+
* @returns {string} 格式化后的字符串
|
|
297
|
+
*/
|
|
298
|
+
format(locale, date, format) {
|
|
299
|
+
const m = toMoment(date);
|
|
300
|
+
if (locale) {
|
|
301
|
+
m.locale(locale);
|
|
302
|
+
}
|
|
303
|
+
return m.format(format);
|
|
304
|
+
},
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* 解析日期字符串
|
|
308
|
+
* @param {string} locale - 语言代码
|
|
309
|
+
* @param {string} text - 日期字符串
|
|
310
|
+
* @param {string[]} formats - 格式字符串数组
|
|
311
|
+
* @returns {moment.Moment|null} 解析后的日期
|
|
312
|
+
*/
|
|
313
|
+
parse(locale, text, formats) {
|
|
314
|
+
if (!text) {
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
const m = momentInstance(text, formats, locale, true);
|
|
318
|
+
return m.isValid() ? m : null;
|
|
319
|
+
},
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* 设置日期的 locale
|
|
323
|
+
* @param {moment.Moment} date - 日期
|
|
324
|
+
* @param {string} locale - 语言代码
|
|
325
|
+
* @returns {moment.Moment} 设置 locale 后的日期
|
|
326
|
+
*/
|
|
327
|
+
setLocale(date, locale) {
|
|
328
|
+
const m = toMoment(date);
|
|
329
|
+
if (locale) {
|
|
330
|
+
m.locale(locale);
|
|
331
|
+
}
|
|
332
|
+
return m;
|
|
333
|
+
},
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* 获取短月份名称列表
|
|
337
|
+
* @param {string} locale - 语言代码
|
|
338
|
+
* @returns {string[]} 月份名称数组
|
|
339
|
+
*/
|
|
340
|
+
getShortMonths(locale) {
|
|
341
|
+
const m = locale ? momentInstance().locale(locale) : momentInstance();
|
|
342
|
+
return m.localeData().monthsShort();
|
|
343
|
+
},
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* 获取短星期名称列表
|
|
347
|
+
* @param {string} locale - 语言代码
|
|
348
|
+
* @returns {string[]} 星期名称数组
|
|
349
|
+
*/
|
|
350
|
+
getShortWeekDays(locale) {
|
|
351
|
+
const m = locale ? momentInstance().locale(locale) : momentInstance();
|
|
352
|
+
return m.localeData().weekdaysMin();
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
export default momentGenerateConfig;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import VcCalendar from '../vc-calendar';
|
|
2
|
+
import MonthCalendar from '../vc-calendar/src/MonthCalendar';
|
|
3
|
+
import createPicker from './createPicker';
|
|
4
|
+
import wrapPicker from './wrapPicker';
|
|
5
|
+
import RangePicker from './RangePicker';
|
|
6
|
+
import WeekPicker from './WeekPicker';
|
|
7
|
+
import { DatePickerProps, MonthPickerProps, WeekPickerProps, RangePickerProps } from './interface';
|
|
8
|
+
import Base from '../base';
|
|
9
|
+
|
|
10
|
+
const DatePicker = wrapPicker(
|
|
11
|
+
{ ...createPicker(VcCalendar, DatePickerProps()), name: 'ADatePicker' },
|
|
12
|
+
DatePickerProps(),
|
|
13
|
+
'date',
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
const MonthPicker = wrapPicker(
|
|
17
|
+
{ ...createPicker(MonthCalendar, MonthPickerProps()), name: 'AMonthPicker' },
|
|
18
|
+
MonthPickerProps(),
|
|
19
|
+
'month',
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
Object.assign(DatePicker, {
|
|
23
|
+
RangePicker: wrapPicker(RangePicker, RangePickerProps(), 'date'),
|
|
24
|
+
MonthPicker,
|
|
25
|
+
WeekPicker: wrapPicker(WeekPicker, WeekPickerProps(), 'week'),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/* istanbul ignore next */
|
|
29
|
+
DatePicker.install = function(Vue) {
|
|
30
|
+
Vue.use(Base);
|
|
31
|
+
Vue.component(DatePicker.name, DatePicker);
|
|
32
|
+
Vue.component(DatePicker.RangePicker.name, DatePicker.RangePicker);
|
|
33
|
+
Vue.component(DatePicker.MonthPicker.name, DatePicker.MonthPicker);
|
|
34
|
+
Vue.component(DatePicker.WeekPicker.name, DatePicker.WeekPicker);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default DatePicker;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// import { TimePickerProps } from '../time-picker'
|
|
2
|
+
import PropTypes from '../_util/vue-types';
|
|
3
|
+
import { TimesType, TimeType } from '../_util/moment-util';
|
|
4
|
+
|
|
5
|
+
export const PickerProps = () => ({
|
|
6
|
+
name: PropTypes.string,
|
|
7
|
+
transitionName: PropTypes.string,
|
|
8
|
+
prefixCls: PropTypes.string,
|
|
9
|
+
inputPrefixCls: PropTypes.string,
|
|
10
|
+
format: PropTypes.oneOfType([PropTypes.string, PropTypes.array, PropTypes.func]),
|
|
11
|
+
disabled: PropTypes.bool,
|
|
12
|
+
allowClear: PropTypes.bool,
|
|
13
|
+
suffixIcon: PropTypes.any,
|
|
14
|
+
popupStyle: PropTypes.object,
|
|
15
|
+
dropdownClassName: PropTypes.string,
|
|
16
|
+
locale: PropTypes.any,
|
|
17
|
+
localeCode: PropTypes.string,
|
|
18
|
+
size: PropTypes.oneOf(['large', 'small', 'default']),
|
|
19
|
+
getCalendarContainer: PropTypes.func,
|
|
20
|
+
open: PropTypes.bool,
|
|
21
|
+
// onOpenChange: PropTypes.(status: bool) => void,
|
|
22
|
+
disabledDate: PropTypes.func,
|
|
23
|
+
showToday: PropTypes.bool,
|
|
24
|
+
dateRender: PropTypes.any, // (current: moment.Moment, today: moment.Moment) => React.ReactNode,
|
|
25
|
+
pickerClass: PropTypes.string,
|
|
26
|
+
pickerInputClass: PropTypes.string,
|
|
27
|
+
timePicker: PropTypes.any,
|
|
28
|
+
autoFocus: PropTypes.bool,
|
|
29
|
+
tagPrefixCls: PropTypes.string,
|
|
30
|
+
tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
31
|
+
align: PropTypes.object.def(() => ({})),
|
|
32
|
+
inputReadOnly: PropTypes.bool,
|
|
33
|
+
valueFormat: PropTypes.string,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const SinglePickerProps = () => ({
|
|
37
|
+
value: TimeType,
|
|
38
|
+
defaultValue: TimeType,
|
|
39
|
+
defaultPickerValue: TimeType,
|
|
40
|
+
renderExtraFooter: PropTypes.any,
|
|
41
|
+
placeholder: PropTypes.string,
|
|
42
|
+
// onChange?: (date: moment.Moment, dateString: string) => void;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const DatePickerProps = () => ({
|
|
46
|
+
...PickerProps(),
|
|
47
|
+
...SinglePickerProps(),
|
|
48
|
+
showTime: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
|
|
49
|
+
open: PropTypes.bool,
|
|
50
|
+
disabledTime: PropTypes.func,
|
|
51
|
+
// onOpenChange?: (status: bool) => void;
|
|
52
|
+
// onOk?: (selectedTime: moment.Moment) => void;
|
|
53
|
+
mode: PropTypes.oneOf(['time', 'date', 'month', 'year', 'decade']),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export const MonthPickerProps = () => ({
|
|
57
|
+
...PickerProps(),
|
|
58
|
+
...SinglePickerProps(),
|
|
59
|
+
placeholder: PropTypes.string,
|
|
60
|
+
monthCellContentRender: PropTypes.func,
|
|
61
|
+
});
|
|
62
|
+
// export const RangePickerPresetRange = PropTypes.oneOfType([TimesType, PropTypes.func])
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 预设日期项定义
|
|
66
|
+
* @typedef {Object} PresetDate
|
|
67
|
+
* @property {string|VNode} label - 显示标签
|
|
68
|
+
* @property {Array|Function} value - 预设值或返回预设值的函数
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 弹出位置类型
|
|
73
|
+
* @type {Array<string>}
|
|
74
|
+
*/
|
|
75
|
+
export const DatePickerPlacements = ['bottomLeft', 'bottomRight', 'topLeft', 'topRight'];
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 状态类型
|
|
79
|
+
* @type {Array<string>}
|
|
80
|
+
*/
|
|
81
|
+
export const DatePickerStatuses = ['error', 'warning', 'success', 'validating'];
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 选择器类型
|
|
85
|
+
* @type {Array<string>}
|
|
86
|
+
*/
|
|
87
|
+
export const PickerModes = ['date', 'week', 'month', 'quarter', 'year'];
|
|
88
|
+
|
|
89
|
+
export const RangePickerProps = () => ({
|
|
90
|
+
...PickerProps(),
|
|
91
|
+
tagPrefixCls: PropTypes.string,
|
|
92
|
+
value: TimesType,
|
|
93
|
+
defaultValue: TimesType,
|
|
94
|
+
defaultPickerValue: TimesType,
|
|
95
|
+
timePicker: PropTypes.any,
|
|
96
|
+
// onChange?: (dates: TimesType, dateStrings: [string, string]) => void;
|
|
97
|
+
// onCalendarChange?: (dates: TimesType, dateStrings: [string, string]) => void;
|
|
98
|
+
// onOk?: (selectedTime: moment.Moment) => void;
|
|
99
|
+
showTime: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
|
|
100
|
+
ranges: PropTypes.object, // 保留向后兼容
|
|
101
|
+
placeholder: PropTypes.arrayOf(String),
|
|
102
|
+
mode: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(String)]),
|
|
103
|
+
separator: PropTypes.any,
|
|
104
|
+
disabledTime: PropTypes.func,
|
|
105
|
+
showToday: PropTypes.bool,
|
|
106
|
+
renderExtraFooter: PropTypes.any,
|
|
107
|
+
// onPanelChange?: (value?: TimesType, mode?: string | string[]) => void;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 选择器类型 (参考 ant-design-vue 4.x)
|
|
111
|
+
* 设置后会固定选择器模式,选择完成后直接确认,无需进一步选择日期
|
|
112
|
+
* @default 'date'
|
|
113
|
+
* @example picker="year" // 年份范围选择器
|
|
114
|
+
* @example picker="month" // 月份范围选择器
|
|
115
|
+
* @example picker="week" // 周范围选择器
|
|
116
|
+
*/
|
|
117
|
+
picker: PropTypes.oneOf(PickerModes),
|
|
118
|
+
|
|
119
|
+
// ============= 新增属性 (参考 ant-design-vue-main) =============
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 预设时间范围快捷选择
|
|
123
|
+
* 替代旧的 ranges 属性,提供更灵活的配置
|
|
124
|
+
* @example
|
|
125
|
+
* presets: [
|
|
126
|
+
* { label: '今天', value: [moment(), moment()] },
|
|
127
|
+
* { label: '本周', value: () => [moment().startOf('week'), moment().endOf('week')] }
|
|
128
|
+
* ]
|
|
129
|
+
*/
|
|
130
|
+
presets: PropTypes.arrayOf(
|
|
131
|
+
PropTypes.shape({
|
|
132
|
+
label: PropTypes.any, // 支持字符串或 VNode
|
|
133
|
+
value: PropTypes.oneOfType([PropTypes.array, PropTypes.func]),
|
|
134
|
+
}),
|
|
135
|
+
),
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* 弹出位置
|
|
139
|
+
* @default 'bottomLeft'
|
|
140
|
+
*/
|
|
141
|
+
placement: PropTypes.oneOf(DatePickerPlacements),
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* 设置校验状态
|
|
145
|
+
* 用于表单验证反馈
|
|
146
|
+
*/
|
|
147
|
+
status: PropTypes.oneOf(DatePickerStatuses),
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* 是否显示边框
|
|
151
|
+
* @default true
|
|
152
|
+
*/
|
|
153
|
+
bordered: PropTypes.bool.def(true),
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* 允许起始项部分为空
|
|
157
|
+
* @example allowEmpty: [true, false] // 允许起始为空,结束不能为空
|
|
158
|
+
*/
|
|
159
|
+
allowEmpty: PropTypes.arrayOf(PropTypes.bool),
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
export const WeekPickerProps = () => ({
|
|
163
|
+
...PickerProps(),
|
|
164
|
+
...SinglePickerProps(),
|
|
165
|
+
placeholder: PropTypes.string,
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
// export interface DatePickerDecorator extends React.ClassicComponentClass<DatePickerProps> {
|
|
169
|
+
// RangePicker: React.ClassicComponentClass<RangePickerProps>;
|
|
170
|
+
// MonthPicker: React.ClassicComponentClass<MonthPickerProps>;
|
|
171
|
+
// WeekPicker: React.ClassicComponentClass<WeexPickerProps>;
|
|
172
|
+
// }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import CalendarLocale from '../../vc-calendar/src/locale/ar_EG';
|
|
2
|
+
import TimePickerLocale from '../../time-picker/locale/ar_EG';
|
|
3
|
+
|
|
4
|
+
// Merge into a locale object
|
|
5
|
+
const locale = {
|
|
6
|
+
lang: {
|
|
7
|
+
placeholder: 'اختيار التاريخ',
|
|
8
|
+
rangePlaceholder: ['البداية', 'النهاية'],
|
|
9
|
+
...CalendarLocale,
|
|
10
|
+
},
|
|
11
|
+
timePickerLocale: {
|
|
12
|
+
...TimePickerLocale,
|
|
13
|
+
},
|
|
14
|
+
dateFormat: 'DD-MM-YYYY',
|
|
15
|
+
monthFormat: 'MM-YYYY',
|
|
16
|
+
dateTimeFormat: 'DD-MM-YYYY HH:mm:ss',
|
|
17
|
+
weekFormat: 'wo-YYYY',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// All settings at:
|
|
21
|
+
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
|
|
22
|
+
|
|
23
|
+
export default locale;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import CalendarLocale from '../../vc-calendar/src/locale/bg_BG';
|
|
2
|
+
import TimePickerLocale from '../../time-picker/locale/bg_BG';
|
|
3
|
+
|
|
4
|
+
// Merge into a locale object
|
|
5
|
+
const locale = {
|
|
6
|
+
lang: {
|
|
7
|
+
placeholder: 'Избор на дата',
|
|
8
|
+
rangePlaceholder: ['Начална', 'Крайна'],
|
|
9
|
+
...CalendarLocale,
|
|
10
|
+
},
|
|
11
|
+
timePickerLocale: {
|
|
12
|
+
...TimePickerLocale,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// All settings at:
|
|
17
|
+
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
|
|
18
|
+
|
|
19
|
+
export default locale;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import CalendarLocale from '../../vc-calendar/src/locale/ca_ES';
|
|
2
|
+
import TimePickerLocale from '../../time-picker/locale/ca_ES';
|
|
3
|
+
|
|
4
|
+
// Merge into a locale object
|
|
5
|
+
const locale = {
|
|
6
|
+
lang: {
|
|
7
|
+
placeholder: 'Seleccionar data',
|
|
8
|
+
rangePlaceholder: ['Data inicial', 'Data final'],
|
|
9
|
+
...CalendarLocale,
|
|
10
|
+
},
|
|
11
|
+
timePickerLocale: {
|
|
12
|
+
...TimePickerLocale,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// All settings at:
|
|
17
|
+
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
|
|
18
|
+
|
|
19
|
+
export default locale;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import CalendarLocale from '../../vc-calendar/src/locale/cs_CZ';
|
|
2
|
+
import TimePickerLocale from '../../time-picker/locale/cs_CZ';
|
|
3
|
+
|
|
4
|
+
// Merge into a locale object
|
|
5
|
+
const locale = {
|
|
6
|
+
lang: {
|
|
7
|
+
placeholder: 'Vybrat datum',
|
|
8
|
+
rangePlaceholder: ['Od', 'Do'],
|
|
9
|
+
...CalendarLocale,
|
|
10
|
+
},
|
|
11
|
+
timePickerLocale: {
|
|
12
|
+
...TimePickerLocale,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// All settings at:
|
|
17
|
+
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
|
|
18
|
+
|
|
19
|
+
export default locale;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import CalendarLocale from '../../vc-calendar/src/locale/da_DK';
|
|
2
|
+
import TimePickerLocale from '../../time-picker/locale/da_DK';
|
|
3
|
+
|
|
4
|
+
// Merge into a locale object
|
|
5
|
+
const locale = {
|
|
6
|
+
lang: {
|
|
7
|
+
placeholder: 'Vælg dato',
|
|
8
|
+
rangePlaceholder: ['Startdato', 'Slutdato'],
|
|
9
|
+
...CalendarLocale,
|
|
10
|
+
},
|
|
11
|
+
timePickerLocale: {
|
|
12
|
+
...TimePickerLocale,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// All settings at:
|
|
17
|
+
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
|
|
18
|
+
|
|
19
|
+
export default locale;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import CalendarLocale from '../../vc-calendar/src/locale/de_DE';
|
|
2
|
+
import TimePickerLocale from '../../time-picker/locale/de_DE';
|
|
3
|
+
|
|
4
|
+
// Merge into a locale object
|
|
5
|
+
const locale = {
|
|
6
|
+
lang: {
|
|
7
|
+
placeholder: 'Datum auswählen',
|
|
8
|
+
rangePlaceholder: ['Startdatum', 'Enddatum'],
|
|
9
|
+
...CalendarLocale,
|
|
10
|
+
},
|
|
11
|
+
timePickerLocale: {
|
|
12
|
+
...TimePickerLocale,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// All settings at:
|
|
17
|
+
// https://github.com/ant-design/ant-design/issues/424
|
|
18
|
+
|
|
19
|
+
export default locale;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import CalendarLocale from '../../vc-calendar/src/locale/el_GR';
|
|
2
|
+
import TimePickerLocale from '../../time-picker/locale/el_GR';
|
|
3
|
+
|
|
4
|
+
// Merge into a locale object
|
|
5
|
+
const locale = {
|
|
6
|
+
lang: {
|
|
7
|
+
placeholder: 'Επιλέξτε ημερομηνία',
|
|
8
|
+
rangePlaceholder: ['Αρχική ημερομηνία', 'Τελική ημερομηνία'],
|
|
9
|
+
...CalendarLocale,
|
|
10
|
+
},
|
|
11
|
+
timePickerLocale: {
|
|
12
|
+
...TimePickerLocale,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// All settings at:
|
|
17
|
+
// https://github.com/ant-design/ant-design/issues/424
|
|
18
|
+
|
|
19
|
+
export default locale;
|