@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,246 @@
|
|
|
1
|
+
@import '../../style/themes/index';
|
|
2
|
+
@import '../../style/mixins/index';
|
|
3
|
+
@import '../../input/style/mixin';
|
|
4
|
+
|
|
5
|
+
@timepicker-prefix-cls: ~'@{ant-prefix}-time-picker';
|
|
6
|
+
@timepicker-item-height: 32px;
|
|
7
|
+
|
|
8
|
+
.@{timepicker-prefix-cls}-panel {
|
|
9
|
+
.reset-component;
|
|
10
|
+
|
|
11
|
+
position: absolute;
|
|
12
|
+
z-index: @zindex-picker;
|
|
13
|
+
font-family: @font-family;
|
|
14
|
+
|
|
15
|
+
&-inner {
|
|
16
|
+
position: relative;
|
|
17
|
+
left: -2px;
|
|
18
|
+
font-size: @font-size-base;
|
|
19
|
+
text-align: left;
|
|
20
|
+
list-style: none;
|
|
21
|
+
background-color: @component-background;
|
|
22
|
+
background-clip: padding-box;
|
|
23
|
+
border-radius: @border-radius-base;
|
|
24
|
+
outline: none;
|
|
25
|
+
box-shadow: @box-shadow-base;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-input {
|
|
29
|
+
width: 100%;
|
|
30
|
+
max-width: @time-picker-panel-column-width * 3 - @control-padding-horizontal - 2px;
|
|
31
|
+
margin: 0;
|
|
32
|
+
padding: 0;
|
|
33
|
+
line-height: normal;
|
|
34
|
+
border: 0;
|
|
35
|
+
outline: 0;
|
|
36
|
+
cursor: auto;
|
|
37
|
+
|
|
38
|
+
.placeholder;
|
|
39
|
+
|
|
40
|
+
&-wrap {
|
|
41
|
+
position: relative;
|
|
42
|
+
padding: 7px 2px 7px @control-padding-horizontal;
|
|
43
|
+
border-bottom: @border-width-base @border-style-base @border-color-split;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&-invalid {
|
|
47
|
+
border-color: @error-color;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&-narrow &-input-wrap {
|
|
52
|
+
max-width: @time-picker-panel-column-width * 2;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&-select {
|
|
56
|
+
position: relative; // Fix chrome weird render bug
|
|
57
|
+
float: left;
|
|
58
|
+
width: @time-picker-panel-column-width;
|
|
59
|
+
max-height: @timepicker-item-height * 6;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
font-size: @font-size-base;
|
|
62
|
+
border-left: @border-width-base @border-style-base @border-color-split;
|
|
63
|
+
|
|
64
|
+
&:hover {
|
|
65
|
+
overflow-y: auto;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:first-child {
|
|
69
|
+
margin-left: 0;
|
|
70
|
+
border-left: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:last-child {
|
|
74
|
+
border-right: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&:only-child {
|
|
78
|
+
width: 100%;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
ul {
|
|
82
|
+
// use fixed width instead of 100%
|
|
83
|
+
// to fix strange render bug in safari: https://github.com/ant-design/ant-design/issues/17842
|
|
84
|
+
width: @time-picker-panel-column-width;
|
|
85
|
+
margin: 0;
|
|
86
|
+
padding: 0 0 @timepicker-item-height * 5;
|
|
87
|
+
list-style: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
li {
|
|
91
|
+
width: 100%;
|
|
92
|
+
height: @timepicker-item-height;
|
|
93
|
+
margin: 0;
|
|
94
|
+
padding: 0 0 0 @control-padding-horizontal;
|
|
95
|
+
line-height: @timepicker-item-height;
|
|
96
|
+
text-align: left;
|
|
97
|
+
list-style: none;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
transition: all 0.3s;
|
|
100
|
+
user-select: none;
|
|
101
|
+
|
|
102
|
+
&:focus {
|
|
103
|
+
color: @primary-color;
|
|
104
|
+
font-weight: 600;
|
|
105
|
+
outline: none;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
li:hover {
|
|
110
|
+
background: @item-hover-bg;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
li&-option-selected {
|
|
114
|
+
font-weight: 600;
|
|
115
|
+
background: @time-picker-selected-bg;
|
|
116
|
+
&:hover {
|
|
117
|
+
background: @time-picker-selected-bg;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
li&-option-disabled {
|
|
122
|
+
color: @btn-disable-color;
|
|
123
|
+
&:hover {
|
|
124
|
+
background: transparent;
|
|
125
|
+
cursor: not-allowed;
|
|
126
|
+
}
|
|
127
|
+
&:focus {
|
|
128
|
+
color: @btn-disable-color;
|
|
129
|
+
font-weight: inherit;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&-combobox {
|
|
135
|
+
.clearfix;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&-addon {
|
|
139
|
+
padding: 8px;
|
|
140
|
+
border-top: @border-width-base @border-style-base @border-color-split;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.slide-up-enter.slide-up-enter-active&-placement-topLeft,
|
|
144
|
+
&.slide-up-enter.slide-up-enter-active&-placement-topRight,
|
|
145
|
+
&.slide-up-appear.slide-up-appear-active&-placement-topLeft,
|
|
146
|
+
&.slide-up-appear.slide-up-appear-active&-placement-topRight {
|
|
147
|
+
animation-name: antSlideDownIn;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&.slide-up-enter.slide-up-enter-active&-placement-bottomLeft,
|
|
151
|
+
&.slide-up-enter.slide-up-enter-active&-placement-bottomRight,
|
|
152
|
+
&.slide-up-appear.slide-up-appear-active&-placement-bottomLeft,
|
|
153
|
+
&.slide-up-appear.slide-up-appear-active&-placement-bottomRight {
|
|
154
|
+
animation-name: antSlideUpIn;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&.slide-up-leave.slide-up-leave-active&-placement-topLeft,
|
|
158
|
+
&.slide-up-leave.slide-up-leave-active&-placement-topRight {
|
|
159
|
+
animation-name: antSlideDownOut;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&.slide-up-leave.slide-up-leave-active&-placement-bottomLeft,
|
|
163
|
+
&.slide-up-leave.slide-up-leave-active&-placement-bottomRight {
|
|
164
|
+
animation-name: antSlideUpOut;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.@{timepicker-prefix-cls} {
|
|
169
|
+
.reset-component;
|
|
170
|
+
|
|
171
|
+
position: relative;
|
|
172
|
+
display: inline-block;
|
|
173
|
+
width: 128px;
|
|
174
|
+
outline: none;
|
|
175
|
+
cursor: text;
|
|
176
|
+
transition: opacity 0.3s;
|
|
177
|
+
|
|
178
|
+
&-input {
|
|
179
|
+
.input;
|
|
180
|
+
&[disabled] {
|
|
181
|
+
.disabled;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&-open {
|
|
186
|
+
opacity: 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&-icon,
|
|
190
|
+
&-clear {
|
|
191
|
+
position: absolute;
|
|
192
|
+
top: 50%;
|
|
193
|
+
right: @control-padding-horizontal - 1px;
|
|
194
|
+
z-index: 1;
|
|
195
|
+
width: 14px;
|
|
196
|
+
height: 14px;
|
|
197
|
+
margin-top: -7px;
|
|
198
|
+
color: @disabled-color;
|
|
199
|
+
line-height: 14px;
|
|
200
|
+
transition: all 0.3s @ease-in-out;
|
|
201
|
+
user-select: none;
|
|
202
|
+
.@{timepicker-prefix-cls}-clock-icon {
|
|
203
|
+
display: block;
|
|
204
|
+
color: @disabled-color;
|
|
205
|
+
line-height: 1;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&-clear {
|
|
210
|
+
z-index: 2;
|
|
211
|
+
background: @input-bg;
|
|
212
|
+
opacity: 0;
|
|
213
|
+
pointer-events: none;
|
|
214
|
+
&:hover {
|
|
215
|
+
color: @text-color-secondary;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
&:hover &-clear {
|
|
219
|
+
opacity: 1;
|
|
220
|
+
pointer-events: auto;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&-large &-input {
|
|
224
|
+
.input-lg;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
&-small &-input {
|
|
228
|
+
.input-sm;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&-small &-icon,
|
|
232
|
+
&-small &-clear {
|
|
233
|
+
right: @control-padding-horizontal-sm - 1px;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Fix cursor height in safari
|
|
238
|
+
// https://stackoverflow.com/q/3843408/3040605
|
|
239
|
+
// https://browserstrangeness.github.io/css_hacks.html#safari
|
|
240
|
+
@media not all and (min-resolution: 0.001dpcm) {
|
|
241
|
+
@supports (-webkit-appearance: none) and (stroke-color: transparent) {
|
|
242
|
+
.@{ant-prefix}-input {
|
|
243
|
+
line-height: @line-height-base;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { cloneElement } from '../_util/vnode';
|
|
2
|
+
import VcTooltip from '../vc-tooltip';
|
|
3
|
+
import getPlacements from './placements';
|
|
4
|
+
import PropTypes from '../_util/vue-types';
|
|
5
|
+
import {
|
|
6
|
+
hasProp,
|
|
7
|
+
getComponentFromProp,
|
|
8
|
+
getClass,
|
|
9
|
+
getStyle,
|
|
10
|
+
isValidElement,
|
|
11
|
+
getListeners,
|
|
12
|
+
} from '../_util/props-util';
|
|
13
|
+
import { ConfigConsumerProps } from '../config-provider/configConsumerProps';
|
|
14
|
+
import abstractTooltipProps from './abstractTooltipProps';
|
|
15
|
+
|
|
16
|
+
const splitObject = (obj, keys) => {
|
|
17
|
+
const picked = {};
|
|
18
|
+
const omitted = { ...obj };
|
|
19
|
+
keys.forEach(key => {
|
|
20
|
+
if (obj && key in obj) {
|
|
21
|
+
picked[key] = obj[key];
|
|
22
|
+
delete omitted[key];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return { picked, omitted };
|
|
26
|
+
};
|
|
27
|
+
const props = abstractTooltipProps();
|
|
28
|
+
export default {
|
|
29
|
+
name: 'ATooltip',
|
|
30
|
+
model: {
|
|
31
|
+
prop: 'visible',
|
|
32
|
+
event: 'visibleChange',
|
|
33
|
+
},
|
|
34
|
+
props: {
|
|
35
|
+
...props,
|
|
36
|
+
title: PropTypes.any,
|
|
37
|
+
},
|
|
38
|
+
inject: {
|
|
39
|
+
configProvider: { default: () => ConfigConsumerProps },
|
|
40
|
+
},
|
|
41
|
+
data() {
|
|
42
|
+
return {
|
|
43
|
+
sVisible: !!this.$props.visible || !!this.$props.defaultVisible,
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
watch: {
|
|
47
|
+
visible(val) {
|
|
48
|
+
this.sVisible = val;
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
methods: {
|
|
52
|
+
onVisibleChange(visible) {
|
|
53
|
+
if (!hasProp(this, 'visible')) {
|
|
54
|
+
this.sVisible = this.isNoTitle() ? false : visible;
|
|
55
|
+
}
|
|
56
|
+
if (!this.isNoTitle()) {
|
|
57
|
+
this.$emit('visibleChange', visible);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
getPopupDomNode() {
|
|
62
|
+
return this.$refs.tooltip.getPopupDomNode();
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
getPlacements() {
|
|
66
|
+
const { builtinPlacements, arrowPointAtCenter, autoAdjustOverflow } = this.$props;
|
|
67
|
+
return (
|
|
68
|
+
builtinPlacements ||
|
|
69
|
+
getPlacements({
|
|
70
|
+
arrowPointAtCenter,
|
|
71
|
+
verticalArrowShift: 8,
|
|
72
|
+
autoAdjustOverflow,
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
// Fix Tooltip won't hide at disabled button
|
|
78
|
+
// mouse events don't trigger at disabled button in Chrome
|
|
79
|
+
// https://github.com/react-component/tooltip/issues/18
|
|
80
|
+
getDisabledCompatibleChildren(ele) {
|
|
81
|
+
const options = (ele.componentOptions && ele.componentOptions.Ctor.options) || {};
|
|
82
|
+
|
|
83
|
+
if (
|
|
84
|
+
((options.__ANT_BUTTON === true ||
|
|
85
|
+
options.__ANT_SWITCH === true ||
|
|
86
|
+
options.__ANT_CHECKBOX === true) &&
|
|
87
|
+
(ele.componentOptions.propsData.disabled ||
|
|
88
|
+
ele.componentOptions.propsData.disabled === '')) ||
|
|
89
|
+
(ele.tag === 'button' &&
|
|
90
|
+
ele.data &&
|
|
91
|
+
ele.data.attrs &&
|
|
92
|
+
ele.data.attrs.disabled !== undefined)
|
|
93
|
+
) {
|
|
94
|
+
// Pick some layout related style properties up to span
|
|
95
|
+
// Prevent layout bugs like https://github.com/ant-design/ant-design/issues/5254
|
|
96
|
+
const { picked, omitted } = splitObject(getStyle(ele), [
|
|
97
|
+
'position',
|
|
98
|
+
'left',
|
|
99
|
+
'right',
|
|
100
|
+
'top',
|
|
101
|
+
'bottom',
|
|
102
|
+
'float',
|
|
103
|
+
'display',
|
|
104
|
+
'zIndex',
|
|
105
|
+
]);
|
|
106
|
+
const spanStyle = {
|
|
107
|
+
display: 'inline-block', // default inline-block is important
|
|
108
|
+
...picked,
|
|
109
|
+
cursor: 'not-allowed',
|
|
110
|
+
width: ele.componentOptions.propsData.block ? '100%' : null,
|
|
111
|
+
};
|
|
112
|
+
const buttonStyle = {
|
|
113
|
+
...omitted,
|
|
114
|
+
pointerEvents: 'none',
|
|
115
|
+
};
|
|
116
|
+
const spanCls = getClass(ele);
|
|
117
|
+
const child = cloneElement(ele, {
|
|
118
|
+
style: buttonStyle,
|
|
119
|
+
class: null,
|
|
120
|
+
});
|
|
121
|
+
return (
|
|
122
|
+
<span style={spanStyle} class={spanCls}>
|
|
123
|
+
{child}
|
|
124
|
+
</span>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
return ele;
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
isNoTitle() {
|
|
131
|
+
const title = getComponentFromProp(this, 'title');
|
|
132
|
+
return !title && title !== 0;
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
getOverlay() {
|
|
136
|
+
const title = getComponentFromProp(this, 'title');
|
|
137
|
+
if (title === 0) {
|
|
138
|
+
return title;
|
|
139
|
+
}
|
|
140
|
+
return title || '';
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
// 动态设置动画点
|
|
144
|
+
onPopupAlign(domNode, align) {
|
|
145
|
+
const placements = this.getPlacements();
|
|
146
|
+
// 当前返回的位置
|
|
147
|
+
const placement = Object.keys(placements).filter(
|
|
148
|
+
key =>
|
|
149
|
+
placements[key].points[0] === align.points[0] &&
|
|
150
|
+
placements[key].points[1] === align.points[1],
|
|
151
|
+
)[0];
|
|
152
|
+
if (!placement) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
// 根据当前坐标设置动画点
|
|
156
|
+
const rect = domNode.getBoundingClientRect();
|
|
157
|
+
const transformOrigin = {
|
|
158
|
+
top: '50%',
|
|
159
|
+
left: '50%',
|
|
160
|
+
};
|
|
161
|
+
if (placement.indexOf('top') >= 0 || placement.indexOf('Bottom') >= 0) {
|
|
162
|
+
transformOrigin.top = `${rect.height - align.offset[1]}px`;
|
|
163
|
+
} else if (placement.indexOf('Top') >= 0 || placement.indexOf('bottom') >= 0) {
|
|
164
|
+
transformOrigin.top = `${-align.offset[1]}px`;
|
|
165
|
+
}
|
|
166
|
+
if (placement.indexOf('left') >= 0 || placement.indexOf('Right') >= 0) {
|
|
167
|
+
transformOrigin.left = `${rect.width - align.offset[0]}px`;
|
|
168
|
+
} else if (placement.indexOf('right') >= 0 || placement.indexOf('Left') >= 0) {
|
|
169
|
+
transformOrigin.left = `${-align.offset[0]}px`;
|
|
170
|
+
}
|
|
171
|
+
domNode.style.transformOrigin = `${transformOrigin.left} ${transformOrigin.top}`;
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
render() {
|
|
176
|
+
const { $props, $data, $slots } = this;
|
|
177
|
+
const { prefixCls: customizePrefixCls, openClassName, getPopupContainer } = $props;
|
|
178
|
+
const { getPopupContainer: getContextPopupContainer } = this.configProvider;
|
|
179
|
+
const getPrefixCls = this.configProvider.getPrefixCls;
|
|
180
|
+
const prefixCls = getPrefixCls('tooltip', customizePrefixCls);
|
|
181
|
+
let children = ($slots.default || []).filter(c => c.tag || c.text.trim() !== '');
|
|
182
|
+
children = children.length === 1 ? children[0] : children;
|
|
183
|
+
let sVisible = $data.sVisible;
|
|
184
|
+
// Hide tooltip when there is no title
|
|
185
|
+
if (!hasProp(this, 'visible') && this.isNoTitle()) {
|
|
186
|
+
sVisible = false;
|
|
187
|
+
}
|
|
188
|
+
if (!children) {
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
const child = this.getDisabledCompatibleChildren(
|
|
192
|
+
isValidElement(children) ? children : <span>{children}</span>,
|
|
193
|
+
);
|
|
194
|
+
const childCls = {
|
|
195
|
+
[openClassName || `${prefixCls}-open`]: true,
|
|
196
|
+
};
|
|
197
|
+
const tooltipProps = {
|
|
198
|
+
props: {
|
|
199
|
+
...$props,
|
|
200
|
+
prefixCls,
|
|
201
|
+
getTooltipContainer: getPopupContainer || getContextPopupContainer,
|
|
202
|
+
builtinPlacements: this.getPlacements(),
|
|
203
|
+
overlay: this.getOverlay(),
|
|
204
|
+
visible: sVisible,
|
|
205
|
+
},
|
|
206
|
+
ref: 'tooltip',
|
|
207
|
+
on: {
|
|
208
|
+
...getListeners(this),
|
|
209
|
+
visibleChange: this.onVisibleChange,
|
|
210
|
+
popupAlign: this.onPopupAlign,
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
return (
|
|
214
|
+
<VcTooltip {...tooltipProps}>
|
|
215
|
+
{sVisible ? cloneElement(child, { class: childCls }) : child}
|
|
216
|
+
</VcTooltip>
|
|
217
|
+
);
|
|
218
|
+
},
|
|
219
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders ./antdv-demo/docs/tooltip/demo/arrow-point-at-center.md correctly 1`] = `<div><button type="button" class="ant-btn"><span>Align edge / 边缘对齐</span></button> <button type="button" class="ant-btn"><span>Arrow points to center / 箭头指向中心</span></button></div>`;
|
|
4
|
+
|
|
5
|
+
exports[`renders ./antdv-demo/docs/tooltip/demo/auto-adjust-overflow.md correctly 1`] = `<div style="overflow: hidden; position: relative; padding: 24px; border: 1px solid #e9e9e9;"><button type="button" class="ant-btn"><span>Adjust automatically / 自动调整</span></button> <br> <button type="button" class="ant-btn" style="margin-top: 10px;"><span>Ingore / 不处理</span></button></div>`;
|
|
6
|
+
|
|
7
|
+
exports[`renders ./antdv-demo/docs/tooltip/demo/basic.md correctly 1`] = `
|
|
8
|
+
<span class="">
|
|
9
|
+
Tooltip will show when mouse enter.
|
|
10
|
+
</span>
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
exports[`renders ./antdv-demo/docs/tooltip/demo/placement.md correctly 1`] = `
|
|
14
|
+
<div id="components-a-tooltip-demo-placement">
|
|
15
|
+
<div style="margin-left: 70px; white-space: nowrap;"><button type="button" class="ant-btn"><span>TL</span></button> <button type="button" class="ant-btn"><span>Top</span></button> <button type="button" class="ant-btn"><span>TR</span></button></div>
|
|
16
|
+
<div style="width: 70px; float: left;"><button type="button" class="ant-btn"><span>LT</span></button> <button type="button" class="ant-btn"><span>Left</span></button> <button type="button" class="ant-btn"><span>LB</span></button></div>
|
|
17
|
+
<div style="width: 70px; margin-left: 304px;"><button type="button" class="ant-btn"><span>RT</span></button> <button type="button" class="ant-btn"><span>Right</span></button> <button type="button" class="ant-btn"><span>RB</span></button></div>
|
|
18
|
+
<div style="margin-left: 70px; clear: both; white-space: nowrap;"><button type="button" class="ant-btn"><span>BL</span></button> <button type="button" class="ant-btn"><span>Bottom</span></button> <button type="button" class="ant-btn"><span>BR</span></button></div>
|
|
19
|
+
</div>
|
|
20
|
+
`;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { asyncExpect } from '@/tests/utils';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import Tooltip from '..';
|
|
4
|
+
import mountTest from '../../../tests/shared/mountTest';
|
|
5
|
+
|
|
6
|
+
describe('Tooltip', () => {
|
|
7
|
+
mountTest(Tooltip);
|
|
8
|
+
it('check `onVisibleChange` arguments', async () => {
|
|
9
|
+
const onVisibleChange = jest.fn();
|
|
10
|
+
const wrapper = mount(
|
|
11
|
+
{
|
|
12
|
+
props: ['title', 'visible'],
|
|
13
|
+
render() {
|
|
14
|
+
const props = {
|
|
15
|
+
props: {
|
|
16
|
+
title: this.title || '',
|
|
17
|
+
mouseEnterDelay: 0,
|
|
18
|
+
mouseLeaveDelay: 0,
|
|
19
|
+
},
|
|
20
|
+
on: {
|
|
21
|
+
visibleChange: onVisibleChange,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
if (this.visible !== undefined) {
|
|
25
|
+
props.props.visible = this.visible;
|
|
26
|
+
}
|
|
27
|
+
return (
|
|
28
|
+
<Tooltip ref="tooltip" {...props}>
|
|
29
|
+
<div id="hello">Hello world!</div>
|
|
30
|
+
</Tooltip>
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{ sync: false },
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
let div = null;
|
|
38
|
+
let lastCount = null;
|
|
39
|
+
await asyncExpect(() => {
|
|
40
|
+
// `title` is empty.
|
|
41
|
+
div = wrapper.findAll('#hello').at(0);
|
|
42
|
+
div.trigger('mouseenter');
|
|
43
|
+
});
|
|
44
|
+
await asyncExpect(() => {
|
|
45
|
+
expect(onVisibleChange).not.toHaveBeenCalled();
|
|
46
|
+
expect(wrapper.vm.$refs.tooltip.$refs.tooltip.visible).toBe(false);
|
|
47
|
+
});
|
|
48
|
+
await asyncExpect(() => {
|
|
49
|
+
div.trigger('mouseleave');
|
|
50
|
+
});
|
|
51
|
+
await asyncExpect(() => {
|
|
52
|
+
expect(onVisibleChange).not.toHaveBeenCalled();
|
|
53
|
+
expect(wrapper.vm.$refs.tooltip.$refs.tooltip.visible).toBe(false);
|
|
54
|
+
});
|
|
55
|
+
await asyncExpect(() => {
|
|
56
|
+
// update `title` value.
|
|
57
|
+
wrapper.setProps({ title: 'Have a nice day!' });
|
|
58
|
+
});
|
|
59
|
+
await asyncExpect(() => {
|
|
60
|
+
wrapper
|
|
61
|
+
.findAll('#hello')
|
|
62
|
+
.at(0)
|
|
63
|
+
.trigger('mouseenter');
|
|
64
|
+
});
|
|
65
|
+
await asyncExpect(() => {
|
|
66
|
+
expect(onVisibleChange).toHaveBeenLastCalledWith(true);
|
|
67
|
+
expect(wrapper.vm.$refs.tooltip.$refs.tooltip.visible).toBe(true);
|
|
68
|
+
}, 0);
|
|
69
|
+
await asyncExpect(() => {
|
|
70
|
+
wrapper.find('#hello').trigger('mouseleave');
|
|
71
|
+
});
|
|
72
|
+
await asyncExpect(() => {
|
|
73
|
+
expect(onVisibleChange).toHaveBeenLastCalledWith(false);
|
|
74
|
+
expect(wrapper.vm.$refs.tooltip.$refs.tooltip.visible).toBe(false);
|
|
75
|
+
});
|
|
76
|
+
await asyncExpect(() => {
|
|
77
|
+
// add `visible` props.
|
|
78
|
+
wrapper.setProps({ visible: false });
|
|
79
|
+
});
|
|
80
|
+
await asyncExpect(() => {
|
|
81
|
+
wrapper.find('#hello').trigger('mouseenter');
|
|
82
|
+
});
|
|
83
|
+
await asyncExpect(() => {
|
|
84
|
+
expect(onVisibleChange).toHaveBeenLastCalledWith(true);
|
|
85
|
+
lastCount = onVisibleChange.mock.calls.length;
|
|
86
|
+
expect(wrapper.vm.$refs.tooltip.$refs.tooltip.visible).toBe(false);
|
|
87
|
+
});
|
|
88
|
+
await asyncExpect(() => {
|
|
89
|
+
// always trigger onVisibleChange
|
|
90
|
+
wrapper.trigger('mouseleave');
|
|
91
|
+
});
|
|
92
|
+
await asyncExpect(() => {
|
|
93
|
+
expect(onVisibleChange.mock.calls.length).toBe(lastCount); // no change with lastCount
|
|
94
|
+
expect(wrapper.vm.$refs.tooltip.$refs.tooltip.visible).toBe(false);
|
|
95
|
+
});
|
|
96
|
+
await asyncExpect(() => {});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// it('should hide when mouse leave native disabled button', () => {
|
|
100
|
+
// const onVisibleChange = jest.fn()
|
|
101
|
+
// const wrapper = mount(
|
|
102
|
+
// <Tooltip
|
|
103
|
+
// title='xxxxx'
|
|
104
|
+
// mouseEnterDelay={0}
|
|
105
|
+
// mouseLeaveDelay={0}
|
|
106
|
+
// onVisibleChange={onVisibleChange}
|
|
107
|
+
// >
|
|
108
|
+
// <button disabled>Hello world!</button>
|
|
109
|
+
// </Tooltip>
|
|
110
|
+
// )
|
|
111
|
+
|
|
112
|
+
// expect(wrapper.find('span')).toHaveLength(1)
|
|
113
|
+
// const button = wrapper.find('span').at(0)
|
|
114
|
+
// button.dispatchEvent(new MouseEvent('mouseenter'))
|
|
115
|
+
// expect(onVisibleChange).toBeCalledWith(true)
|
|
116
|
+
// expect(wrapper.vm.$refs.tooltip.$refs.tooltip.visible).toBe(true)
|
|
117
|
+
|
|
118
|
+
// button.trigger('mouseleave')
|
|
119
|
+
// expect(onVisibleChange).toBeCalledWith(false)
|
|
120
|
+
// expect(wrapper.vm.$refs.tooltip.$refs.tooltip.visible).toBe(false)
|
|
121
|
+
// })
|
|
122
|
+
|
|
123
|
+
// it('should hide when mouse leave antd disabled Button', () => {
|
|
124
|
+
// const onVisibleChange = jest.fn()
|
|
125
|
+
// const wrapper = mount(
|
|
126
|
+
// <Tooltip
|
|
127
|
+
// title='xxxxx'
|
|
128
|
+
// mouseEnterDelay={0}
|
|
129
|
+
// mouseLeaveDelay={0}
|
|
130
|
+
// onVisibleChange={onVisibleChange}
|
|
131
|
+
// >
|
|
132
|
+
// <Button disabled>Hello world!</Button>
|
|
133
|
+
// </Tooltip>
|
|
134
|
+
// )
|
|
135
|
+
|
|
136
|
+
// expect(wrapper.render()).toMatchSnapshot()
|
|
137
|
+
// const button = wrapper.find('span').at(0)
|
|
138
|
+
// button.dispatchEvent(new MouseEvent('mouseenter'))
|
|
139
|
+
// expect(onVisibleChange).toBeCalledWith(true)
|
|
140
|
+
// expect(wrapper.vm.$refs.tooltip.$refs.tooltip.visible).toBe(true)
|
|
141
|
+
|
|
142
|
+
// button.trigger('mouseleave')
|
|
143
|
+
// expect(onVisibleChange).toBeCalledWith(false)
|
|
144
|
+
// expect(wrapper.vm.$refs.tooltip.$refs.tooltip.visible).toBe(false)
|
|
145
|
+
// })
|
|
146
|
+
|
|
147
|
+
// it('should render disabled Button style properly', () => {
|
|
148
|
+
// const wrapper1 = mount(
|
|
149
|
+
// <Tooltip title='xxxxx'>
|
|
150
|
+
// <Button disabled>Hello world!</Button>
|
|
151
|
+
// </Tooltip>
|
|
152
|
+
// )
|
|
153
|
+
// const wrapper2 = mount(
|
|
154
|
+
// <Tooltip title='xxxxx'>
|
|
155
|
+
// <Button disabled style={{ display: 'block' }}>Hello world!</Button>
|
|
156
|
+
// </Tooltip>
|
|
157
|
+
// )
|
|
158
|
+
// expect(wrapper1.find('span').at(0).element.style.display).toBe('inline-block')
|
|
159
|
+
// expect(wrapper2.find('span').at(0).element.style.display).toBe('block')
|
|
160
|
+
// })
|
|
161
|
+
|
|
162
|
+
// it('should works for arrowPointAtCenter', () => {
|
|
163
|
+
// const arrowWidth = 5
|
|
164
|
+
// const horizontalArrowShift = 16
|
|
165
|
+
// const triggerWidth = 200
|
|
166
|
+
|
|
167
|
+
// const suit = () => {
|
|
168
|
+
// const wrapper = mount(
|
|
169
|
+
// <Tooltip
|
|
170
|
+
// title='xxxxx'
|
|
171
|
+
// trigger='click'
|
|
172
|
+
// mouseEnterDelay={0}
|
|
173
|
+
// mouseLeaveDelay={0}
|
|
174
|
+
// placement='bottomLeft'
|
|
175
|
+
// >
|
|
176
|
+
// <button style={{ width: triggerWidth }}>
|
|
177
|
+
// Hello world!
|
|
178
|
+
// </button>
|
|
179
|
+
// </Tooltip>
|
|
180
|
+
// )
|
|
181
|
+
// wrapper.find('button').at(0).trigger('click')
|
|
182
|
+
// const popupLeftDefault = parseInt(wrapper.instance().getPopupDomNode().style.left, 10)
|
|
183
|
+
|
|
184
|
+
// const wrapper2 = mount(
|
|
185
|
+
// <Tooltip
|
|
186
|
+
// title='xxxxx'
|
|
187
|
+
// trigger='click'
|
|
188
|
+
// mouseEnterDelay={0}
|
|
189
|
+
// mouseLeaveDelay={0}
|
|
190
|
+
// placement='bottomLeft'
|
|
191
|
+
// arrowPointAtCenter
|
|
192
|
+
// >
|
|
193
|
+
// <button style={{ width: triggerWidth }}>
|
|
194
|
+
// Hello world!
|
|
195
|
+
// </button>
|
|
196
|
+
// </Tooltip>
|
|
197
|
+
// )
|
|
198
|
+
// wrapper2.find('button').at(0).trigger('click')
|
|
199
|
+
// const popupLeftArrowPointAtCenter = parseInt(wrapper2.instance().getPopupDomNode().style.left, 10)
|
|
200
|
+
// expect(popupLeftArrowPointAtCenter - popupLeftDefault).toBe((triggerWidth / 2) - horizontalArrowShift - arrowWidth)
|
|
201
|
+
// }
|
|
202
|
+
// jest.dontMock('rc-trigger', suit)
|
|
203
|
+
// })
|
|
204
|
+
});
|