@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,103 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders ./antdv-demo/docs/button/demo/basic.md correctly 1`] = `<div><button type="button" class="ant-btn ant-btn-primary"><span>Primary</span></button> <button type="button" class="ant-btn"><span>Default</span></button> <button type="button" class="ant-btn ant-btn-dashed"><span>Dashed</span></button> <button type="button" class="ant-btn ant-btn-danger"><span>Danger</span></button> <button type="button" class="ant-btn ant-btn-primary"><span>按钮</span></button> <button type="button" class="ant-btn ant-btn-primary"><span>按 钮</span></button> <button type="button" class="ant-btn ant-btn-link"><span>Link</span></button></div>`;
|
|
4
|
+
|
|
5
|
+
exports[`renders ./antdv-demo/docs/button/demo/block.md correctly 1`] = `<div><button type="button" class="ant-btn ant-btn-primary ant-btn-block"><span>Primary</span></button> <button type="button" class="ant-btn ant-btn-block"><span>Default</span></button> <button type="button" class="ant-btn ant-btn-dashed ant-btn-block"><span>Dashed</span></button> <button type="button" class="ant-btn ant-btn-danger ant-btn-block"><span>Danger</span></button> <button type="button" class="ant-btn ant-btn-link ant-btn-block"><span>Link</span></button></div>`;
|
|
6
|
+
|
|
7
|
+
exports[`renders ./antdv-demo/docs/button/demo/button-group.md correctly 1`] = `
|
|
8
|
+
<div id="components-button-demo-button-group">
|
|
9
|
+
<h4>Basic</h4>
|
|
10
|
+
<div class="ant-btn-group"><button type="button" class="ant-btn"><span>Cancel</span></button><button type="button" class="ant-btn ant-btn-primary"><span>OK</span></button></div>
|
|
11
|
+
<div class="ant-btn-group"><button disabled="disabled" type="button" class="ant-btn"><span>L</span></button><button disabled="disabled" type="button" class="ant-btn"><span>M</span></button><button disabled="disabled" type="button" class="ant-btn"><span>R</span></button></div>
|
|
12
|
+
<div class="ant-btn-group"><button type="button" class="ant-btn ant-btn-primary"><span>L</span></button><button type="button" class="ant-btn"><span>M</span></button><button type="button" class="ant-btn"><span>M</span></button><button type="button" class="ant-btn ant-btn-dashed"><span>R</span></button></div>
|
|
13
|
+
<h4>With Icon</h4>
|
|
14
|
+
<div class="ant-btn-group"><button type="button" class="ant-btn ant-btn-primary"><i aria-label="icon: left" class="anticon anticon-left"><svg viewBox="64 64 896 896" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
15
|
+
<path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path>
|
|
16
|
+
</svg></i><span>Go back</span></button><button type="button" class="ant-btn ant-btn-primary"><span>Go forward</span><i aria-label="icon: right" class="anticon anticon-right"><svg viewBox="64 64 896 896" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
17
|
+
<path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"></path>
|
|
18
|
+
</svg></i></button></div>
|
|
19
|
+
<div class="ant-btn-group"><button type="button" class="ant-btn ant-btn-primary ant-btn-icon-only"><i aria-label="icon: cloud" class="anticon anticon-cloud"><svg viewBox="64 64 896 896" data-icon="cloud" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
20
|
+
<path d="M811.4 418.7C765.6 297.9 648.9 212 512.2 212S258.8 297.8 213 418.6C127.3 441.1 64 519.1 64 612c0 110.5 89.5 200 199.9 200h496.2C870.5 812 960 722.5 960 612c0-92.7-63.1-170.7-148.6-193.3zm36.3 281a123.07 123.07 0 0 1-87.6 36.3H263.9c-33.1 0-64.2-12.9-87.6-36.3A123.3 123.3 0 0 1 140 612c0-28 9.1-54.3 26.2-76.3a125.7 125.7 0 0 1 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0 1 52.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10c54.3 14.5 92.1 63.8 92.1 120 0 33.1-12.9 64.3-36.3 87.7z"></path>
|
|
21
|
+
</svg></i></button><button type="button" class="ant-btn ant-btn-primary ant-btn-icon-only"><i aria-label="icon: cloud-download" class="anticon anticon-cloud-download"><svg viewBox="64 64 896 896" data-icon="cloud-download" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
22
|
+
<path d="M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"></path>
|
|
23
|
+
<path d="M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0 1 52.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 0 1-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"></path>
|
|
24
|
+
</svg></i></button></div>
|
|
25
|
+
</div>
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
exports[`renders ./antdv-demo/docs/button/demo/disabled.md correctly 1`] = `
|
|
29
|
+
<div><button type="button" class="ant-btn ant-btn-primary"><span>Primary</span></button> <button disabled="disabled" type="button" class="ant-btn ant-btn-primary"><span>Primary(disabled)</span></button> <br> <button type="button" class="ant-btn"><span>Default</span></button> <button disabled="disabled" type="button" class="ant-btn"><span>Default(disabled)</span></button> <br> <button type="button" class="ant-btn ant-btn-dashed"><span>Dashed</span></button> <button disabled="disabled" type="button" class="ant-btn ant-btn-dashed"><span>Dashed(disabled)</span></button> <br> <button type="button" class="ant-btn ant-btn-link"><span>Link</span></button> <button disabled="disabled" type="button" class="ant-btn ant-btn-link"><span>Link(disabled)</span></button>
|
|
30
|
+
<div style="padding: 8px 8px 0px 8px; background: rgb(190, 200, 200);"><button type="button" class="ant-btn ant-btn-background-ghost"><span>Ghost</span></button> <button disabled="disabled" type="button" class="ant-btn ant-btn-background-ghost"><span>Ghost(disabled)</span></button></div>
|
|
31
|
+
</div>
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
exports[`renders ./antdv-demo/docs/button/demo/ghost.md correctly 1`] = `<div style="background: rgb(190, 200, 200); padding: 26px 16px 16px;"><button type="button" class="ant-btn ant-btn-primary ant-btn-background-ghost"><span>Primary</span></button> <button type="button" class="ant-btn ant-btn-background-ghost"><span>Default</span></button> <button type="button" class="ant-btn ant-btn-dashed ant-btn-background-ghost"><span>Dashed</span></button> <button type="button" class="ant-btn ant-btn-danger ant-btn-background-ghost"><span>Danger</span></button> <button type="button" class="ant-btn ant-btn-link ant-btn-background-ghost"><span>Link</span></button></div>`;
|
|
35
|
+
|
|
36
|
+
exports[`renders ./antdv-demo/docs/button/demo/icon.md correctly 1`] = `
|
|
37
|
+
<div><button type="button" class="ant-btn ant-btn-primary ant-btn-circle ant-btn-icon-only"><i aria-label="icon: search" class="anticon anticon-search"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
38
|
+
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
39
|
+
</svg></i></button> <button type="button" class="ant-btn ant-btn-primary ant-btn-circle"><span>A</span></button> <button type="button" class="ant-btn ant-btn-primary"><i aria-label="icon: search" class="anticon anticon-search"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
40
|
+
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
41
|
+
</svg></i><span>Search</span></button> <button type="button" class="ant-btn ant-btn-circle ant-btn-icon-only"><i aria-label="icon: search" class="anticon anticon-search"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
42
|
+
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
43
|
+
</svg></i></button> <button type="button" class="ant-btn"><i aria-label="icon: search" class="anticon anticon-search"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
44
|
+
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
45
|
+
</svg></i><span>Search</span></button> <button type="button" class="ant-btn ant-btn-circle ant-btn-icon-only"><i aria-label="icon: search" class="anticon anticon-search"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
46
|
+
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
47
|
+
</svg></i></button> <button type="button" class="ant-btn"><i aria-label="icon: search" class="anticon anticon-search"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
48
|
+
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
49
|
+
</svg></i><span>Search</span></button> <button type="button" class="ant-btn ant-btn-dashed ant-btn-circle ant-btn-icon-only"><i aria-label="icon: search" class="anticon anticon-search"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
50
|
+
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
51
|
+
</svg></i></button> <button type="button" class="ant-btn ant-btn-dashed"><i aria-label="icon: search" class="anticon anticon-search"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
52
|
+
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
53
|
+
</svg></i><span>Search</span></button></div>
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
exports[`renders ./antdv-demo/docs/button/demo/loading.md correctly 1`] = `
|
|
57
|
+
<div><button type="button" class="ant-btn ant-btn-primary ant-btn-loading"><i aria-label="icon: loading" class="anticon anticon-loading"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="anticon-spin">
|
|
58
|
+
<path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path>
|
|
59
|
+
</svg></i><span>Loading</span></button> <button type="button" class="ant-btn ant-btn-primary ant-btn-sm ant-btn-loading"><i aria-label="icon: loading" class="anticon anticon-loading"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="anticon-spin">
|
|
60
|
+
<path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path>
|
|
61
|
+
</svg></i><span>Loading</span></button> <br> <button type="button" class="ant-btn ant-btn-primary"><span>mouseenter me!</span></button> <button type="button" class="ant-btn ant-btn-primary"><i aria-label="icon: poweroff" class="anticon anticon-poweroff"><svg viewBox="64 64 896 896" data-icon="poweroff" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
62
|
+
<path d="M705.6 124.9a8 8 0 0 0-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0 1 62.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0 1 27.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 0 1-76.3 113.3 353.06 353.06 0 0 1-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 0 1-113.2-76.4A355.92 355.92 0 0 1 184 650.4a355 355 0 0 1-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z"></path>
|
|
63
|
+
</svg></i><span>延迟1s</span></button> <br> <button type="button" class="ant-btn ant-btn-primary ant-btn-icon-only ant-btn-loading"><i aria-label="icon: loading" class="anticon anticon-loading"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="anticon-spin">
|
|
64
|
+
<path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path>
|
|
65
|
+
</svg></i></button> <button type="button" class="ant-btn ant-btn-primary ant-btn-circle ant-btn-icon-only ant-btn-loading"><i aria-label="icon: loading" class="anticon anticon-loading"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="anticon-spin">
|
|
66
|
+
<path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path>
|
|
67
|
+
</svg></i></button> <button type="button" class="ant-btn ant-btn-danger ant-btn-round ant-btn-icon-only ant-btn-loading"><i aria-label="icon: loading" class="anticon anticon-loading"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="anticon-spin">
|
|
68
|
+
<path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path>
|
|
69
|
+
</svg></i></button></div>
|
|
70
|
+
`;
|
|
71
|
+
|
|
72
|
+
exports[`renders ./antdv-demo/docs/button/demo/multiple.md correctly 1`] = `
|
|
73
|
+
<div><button type="button" class="ant-btn ant-btn-primary"><span>Primary</span></button> <button type="button" class="ant-btn"><span>secondary</span></button> <button type="button" class="ant-btn ant-dropdown-trigger"><span>Actions</span><i aria-label="icon: down" class="anticon anticon-down"><svg viewBox="64 64 896 896" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
74
|
+
<path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path>
|
|
75
|
+
</svg></i></button></div>
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
exports[`renders ./antdv-demo/docs/button/demo/size.md correctly 1`] = `
|
|
79
|
+
<div>
|
|
80
|
+
<div class="ant-radio-group ant-radio-group-outline ant-radio-group-default"><label class="ant-radio-button-wrapper ant-radio-button-wrapper-checked"><span class="ant-radio-button ant-radio-button-checked"><input type="radio" class="ant-radio-button-input" value="large"><span class="ant-radio-button-inner"></span></span><span>
|
|
81
|
+
Large
|
|
82
|
+
</span></label><label class="ant-radio-button-wrapper"><span class="ant-radio-button"><input type="radio" class="ant-radio-button-input" value="default"><span class="ant-radio-button-inner"></span></span><span>
|
|
83
|
+
Default
|
|
84
|
+
</span></label><label class="ant-radio-button-wrapper"><span class="ant-radio-button"><input type="radio" class="ant-radio-button-input" value="small"><span class="ant-radio-button-inner"></span></span><span>
|
|
85
|
+
Small
|
|
86
|
+
</span></label></div> <br><br> <button type="button" class="ant-btn ant-btn-primary ant-btn-lg"><span>Primary</span></button> <button type="button" class="ant-btn ant-btn-lg"><span>Normal</span></button> <button type="button" class="ant-btn ant-btn-dashed ant-btn-lg"><span>Dashed</span></button> <button type="button" class="ant-btn ant-btn-danger ant-btn-lg"><span>Danger</span></button> <button type="button" class="ant-btn ant-btn-link ant-btn-lg"><span>Link</span></button> <br> <button type="button" class="ant-btn ant-btn-primary ant-btn-lg ant-btn-icon-only"><i aria-label="icon: download" class="anticon anticon-download"><svg viewBox="64 64 896 896" data-icon="download" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
87
|
+
<path d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"></path>
|
|
88
|
+
</svg></i></button> <button type="button" class="ant-btn ant-btn-primary ant-btn-circle ant-btn-lg ant-btn-icon-only"><i aria-label="icon: download" class="anticon anticon-download"><svg viewBox="64 64 896 896" data-icon="download" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
89
|
+
<path d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"></path>
|
|
90
|
+
</svg></i></button> <button type="button" class="ant-btn ant-btn-primary ant-btn-round ant-btn-lg ant-btn-icon-only"><i aria-label="icon: download" class="anticon anticon-download"><svg viewBox="64 64 896 896" data-icon="download" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
91
|
+
<path d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"></path>
|
|
92
|
+
</svg></i></button>Download <button type="button" class="ant-btn ant-btn-primary ant-btn-round ant-btn-lg ant-btn-icon-only"><i aria-label="icon: download" class="anticon anticon-download"><svg viewBox="64 64 896 896" data-icon="download" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
93
|
+
<path d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"></path>
|
|
94
|
+
</svg></i></button> <button type="button" class="ant-btn ant-btn-primary ant-btn-lg"><i aria-label="icon: download" class="anticon anticon-download"><svg viewBox="64 64 896 896" data-icon="download" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
95
|
+
<path d="M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"></path>
|
|
96
|
+
</svg></i><span>Download</span></button> <br>
|
|
97
|
+
<div class="ant-btn-group ant-btn-group-lg"><button type="button" class="ant-btn ant-btn-primary"><i aria-label="icon: left" class="anticon anticon-left"><svg viewBox="64 64 896 896" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
98
|
+
<path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path>
|
|
99
|
+
</svg></i><span>Backward</span></button><button type="button" class="ant-btn ant-btn-primary"><span>Forward</span><i aria-label="icon: right" class="anticon anticon-right"><svg viewBox="64 64 896 896" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
100
|
+
<path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"></path>
|
|
101
|
+
</svg></i></button></div>
|
|
102
|
+
</div>
|
|
103
|
+
`;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Button fixbug renders {0} , 0 and {false} 1`] = `<button type="button" class="ant-btn"><span>0</span></button>`;
|
|
4
|
+
|
|
5
|
+
exports[`Button fixbug renders {0} , 0 and {false} 2`] = `<button type="button" class="ant-btn"><span>0</span></button>`;
|
|
6
|
+
|
|
7
|
+
exports[`Button fixbug renders {0} , 0 and {false} 3`] = `<button type="button" class="ant-btn"></button>`;
|
|
8
|
+
|
|
9
|
+
exports[`Button renders Chinese characters correctly 1`] = `
|
|
10
|
+
<button type="button" class="ant-btn"><i aria-label="icon: search" class="anticon anticon-search"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
11
|
+
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
12
|
+
</svg></i><span>按钮</span></button>
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
exports[`Button renders Chinese characters correctly 2`] = `
|
|
16
|
+
<button type="button" class="ant-btn"><i aria-label="icon: search" class="anticon anticon-search"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
17
|
+
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
18
|
+
</svg></i><span>按钮</span></button>
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
exports[`Button renders Chinese characters correctly 3`] = `
|
|
22
|
+
<button type="button" class="ant-btn"><i aria-label="icon: search" class="anticon anticon-search"><svg viewBox="64 64 896 896" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="">
|
|
23
|
+
<path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path>
|
|
24
|
+
</svg></i><span>按钮</span></button>
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
exports[`Button renders Chinese characters correctly 4`] = `
|
|
28
|
+
<button type="button" class="ant-btn ant-btn-loading"><i aria-label="icon: loading" class="anticon anticon-loading"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="anticon-spin">
|
|
29
|
+
<path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path>
|
|
30
|
+
</svg></i><span>按钮</span></button>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
exports[`Button renders Chinese characters correctly 5`] = `
|
|
34
|
+
<button type="button" class="ant-btn ant-btn-loading"><i aria-label="icon: loading" class="anticon anticon-loading"><svg viewBox="0 0 1024 1024" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false" class="anticon-spin">
|
|
35
|
+
<path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path>
|
|
36
|
+
</svg></i><span>按 钮</span></button>
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
exports[`Button renders correctly 1`] = `<button type="button" class="ant-btn"><span>Follow</span></button>`;
|
|
40
|
+
|
|
41
|
+
exports[`Button should not render as link button when href is undefined 1`] = `<button type="button" class="ant-btn ant-btn-primary"><span>button</span></button>`;
|
|
42
|
+
|
|
43
|
+
exports[`Button should support link button 1`] = `<a target="_blank" href="http://ant.design" class="ant-btn"><span>link button</span></a>`;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import Button from '../index';
|
|
2
|
+
import Icon from '../../icon';
|
|
3
|
+
import { mount } from '@vue/test-utils';
|
|
4
|
+
import Vue from 'vue';
|
|
5
|
+
import { asyncExpect } from '@/tests/utils';
|
|
6
|
+
import { sleep } from '../../../tests/utils';
|
|
7
|
+
import mountTest from '../../../tests/shared/mountTest';
|
|
8
|
+
|
|
9
|
+
describe('Button', () => {
|
|
10
|
+
mountTest(Button);
|
|
11
|
+
mountTest(Button.Group);
|
|
12
|
+
it('renders correctly', () => {
|
|
13
|
+
const wrapper = mount({
|
|
14
|
+
render() {
|
|
15
|
+
return <Button>Follow</Button>;
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('create primary button', () => {
|
|
22
|
+
const wrapper = mount({
|
|
23
|
+
render() {
|
|
24
|
+
return <Button type="primary">按钮</Button>;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
expect(wrapper.contains('.ant-btn-primary')).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('renders Chinese characters correctly', done => {
|
|
31
|
+
const wrapper = mount({
|
|
32
|
+
render() {
|
|
33
|
+
return <Button>按钮</Button>;
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
expect(wrapper.text()).toBe('按 钮');
|
|
37
|
+
|
|
38
|
+
const wrapper1 = mount({
|
|
39
|
+
render() {
|
|
40
|
+
return <Button icon="search">按钮</Button>;
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
expect(wrapper1.html()).toMatchSnapshot();
|
|
45
|
+
|
|
46
|
+
const wrapper2 = mount({
|
|
47
|
+
render() {
|
|
48
|
+
return (
|
|
49
|
+
<Button>
|
|
50
|
+
<Icon type="search" />
|
|
51
|
+
按钮
|
|
52
|
+
</Button>
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
expect(wrapper2.html()).toMatchSnapshot();
|
|
57
|
+
// should not insert space when there is icon
|
|
58
|
+
const wrapper3 = mount({
|
|
59
|
+
render() {
|
|
60
|
+
return <Button icon="search">按钮</Button>;
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
expect(wrapper3.html()).toMatchSnapshot();
|
|
64
|
+
// should not insert space when there is icon while loading
|
|
65
|
+
const wrapper4 = mount({
|
|
66
|
+
render() {
|
|
67
|
+
return (
|
|
68
|
+
<Button icon="search" loading>
|
|
69
|
+
按钮
|
|
70
|
+
</Button>
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
expect(wrapper4.html()).toMatchSnapshot();
|
|
75
|
+
// should insert space while loading
|
|
76
|
+
const wrapper5 = mount({
|
|
77
|
+
render() {
|
|
78
|
+
return <Button loading>按钮</Button>;
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
expect(wrapper5.html()).toMatchSnapshot();
|
|
82
|
+
const wrapper6 = mount({
|
|
83
|
+
render() {
|
|
84
|
+
return (
|
|
85
|
+
<Button>
|
|
86
|
+
<span>按钮</span>
|
|
87
|
+
</Button>
|
|
88
|
+
);
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
Vue.nextTick(() => {
|
|
92
|
+
expect(wrapper6.find('.ant-btn').contains('.ant-btn-two-chinese-chars')).toBe(true);
|
|
93
|
+
done();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
it('should change loading state instantly by default', async () => {
|
|
97
|
+
const DefaultButton = {
|
|
98
|
+
data() {
|
|
99
|
+
return {
|
|
100
|
+
loading: false,
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
methods: {
|
|
104
|
+
enterLoading() {
|
|
105
|
+
this.loading = true;
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
render() {
|
|
110
|
+
return (
|
|
111
|
+
<Button loading={this.loading} onClick={this.enterLoading}>
|
|
112
|
+
Button
|
|
113
|
+
</Button>
|
|
114
|
+
);
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
const wrapper = mount(DefaultButton, { sync: false });
|
|
118
|
+
await asyncExpect(() => {
|
|
119
|
+
wrapper.trigger('click');
|
|
120
|
+
});
|
|
121
|
+
await asyncExpect(() => {
|
|
122
|
+
expect(wrapper.findAll('.ant-btn-loading').length).toBe(1);
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('should change loading state with delay', async () => {
|
|
127
|
+
const DefaultButton = {
|
|
128
|
+
data() {
|
|
129
|
+
return {
|
|
130
|
+
loading: false,
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
methods: {
|
|
134
|
+
enterLoading() {
|
|
135
|
+
this.loading = { delay: 1000 };
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
render() {
|
|
140
|
+
return (
|
|
141
|
+
<Button loading={this.loading} onClick={this.enterLoading}>
|
|
142
|
+
Button
|
|
143
|
+
</Button>
|
|
144
|
+
);
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
const wrapper = mount(DefaultButton, { sync: false });
|
|
148
|
+
await asyncExpect(() => {
|
|
149
|
+
wrapper.trigger('click');
|
|
150
|
+
});
|
|
151
|
+
await asyncExpect(() => {
|
|
152
|
+
expect(wrapper.contains('.ant-btn-loading')).toBe(false);
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
it('should not clickable when button is loading', () => {
|
|
156
|
+
const onClick = jest.fn();
|
|
157
|
+
const wrapper = mount({
|
|
158
|
+
render() {
|
|
159
|
+
return (
|
|
160
|
+
<Button loading onClick={onClick}>
|
|
161
|
+
button
|
|
162
|
+
</Button>
|
|
163
|
+
);
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
wrapper.trigger('click');
|
|
167
|
+
expect(onClick).not.toHaveBeenCalledWith();
|
|
168
|
+
});
|
|
169
|
+
it('should support link button', () => {
|
|
170
|
+
const wrapper = mount({
|
|
171
|
+
render() {
|
|
172
|
+
return (
|
|
173
|
+
<Button target="_blank" href="http://ant.design">
|
|
174
|
+
link button
|
|
175
|
+
</Button>
|
|
176
|
+
);
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it('fixbug renders {0} , 0 and {false}', () => {
|
|
183
|
+
const wrapper = mount({
|
|
184
|
+
render() {
|
|
185
|
+
return <Button>{0}</Button>;
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
189
|
+
|
|
190
|
+
const wrapper1 = mount({
|
|
191
|
+
render() {
|
|
192
|
+
return <Button>0</Button>;
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
expect(wrapper1.html()).toMatchSnapshot();
|
|
196
|
+
|
|
197
|
+
const wrapper2 = mount({
|
|
198
|
+
render() {
|
|
199
|
+
return <Button>{false}</Button>;
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
expect(wrapper2.html()).toMatchSnapshot();
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
it('should not render as link button when href is undefined', async () => {
|
|
206
|
+
const wrapper = mount({
|
|
207
|
+
render() {
|
|
208
|
+
return (
|
|
209
|
+
<Button type="primary" href={undefined}>
|
|
210
|
+
button
|
|
211
|
+
</Button>
|
|
212
|
+
);
|
|
213
|
+
},
|
|
214
|
+
});
|
|
215
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it('should support to change loading', async () => {
|
|
219
|
+
const wrapper = mount(Button, {
|
|
220
|
+
slots: {
|
|
221
|
+
default: ['button'],
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
wrapper.setProps({ loading: true });
|
|
225
|
+
expect(wrapper.findAll('.ant-btn-loading').length).toBe(1);
|
|
226
|
+
wrapper.setProps({ loading: false });
|
|
227
|
+
expect(wrapper.findAll('.ant-btn-loading').length).toBe(0);
|
|
228
|
+
wrapper.setProps({ loading: { delay: 50 } });
|
|
229
|
+
expect(wrapper.findAll('.ant-btn-loading').length).toBe(0);
|
|
230
|
+
await sleep(50);
|
|
231
|
+
expect(wrapper.findAll('.ant-btn-loading').length).toBe(1);
|
|
232
|
+
wrapper.setProps({ loading: false });
|
|
233
|
+
await sleep(50);
|
|
234
|
+
expect(wrapper.findAll('.ant-btn-loading').length).toBe(0);
|
|
235
|
+
expect(() => {
|
|
236
|
+
wrapper.destroy();
|
|
237
|
+
}).not.toThrow();
|
|
238
|
+
});
|
|
239
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { filterEmpty } from '../_util/props-util';
|
|
2
|
+
import PropTypes from '../_util/vue-types';
|
|
3
|
+
import { ConfigConsumerProps } from '../config-provider/configConsumerProps';
|
|
4
|
+
|
|
5
|
+
const ButtonGroupProps = {
|
|
6
|
+
prefixCls: PropTypes.string,
|
|
7
|
+
size: {
|
|
8
|
+
validator(value) {
|
|
9
|
+
return ['small', 'large', 'default'].includes(value);
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export { ButtonGroupProps };
|
|
14
|
+
export default {
|
|
15
|
+
name: 'AButtonGroup',
|
|
16
|
+
props: ButtonGroupProps,
|
|
17
|
+
inject: {
|
|
18
|
+
configProvider: { default: () => ConfigConsumerProps },
|
|
19
|
+
},
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
sizeMap: {
|
|
23
|
+
large: 'lg',
|
|
24
|
+
small: 'sm',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
render() {
|
|
29
|
+
const { prefixCls: customizePrefixCls, size, $slots } = this;
|
|
30
|
+
const getPrefixCls = this.configProvider.getPrefixCls;
|
|
31
|
+
const prefixCls = getPrefixCls('btn-group', customizePrefixCls);
|
|
32
|
+
|
|
33
|
+
// large => lg
|
|
34
|
+
// small => sm
|
|
35
|
+
let sizeCls = '';
|
|
36
|
+
switch (size) {
|
|
37
|
+
case 'large':
|
|
38
|
+
sizeCls = 'lg';
|
|
39
|
+
break;
|
|
40
|
+
case 'small':
|
|
41
|
+
sizeCls = 'sm';
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
const classes = {
|
|
47
|
+
[`${prefixCls}`]: true,
|
|
48
|
+
[`${prefixCls}-${sizeCls}`]: sizeCls,
|
|
49
|
+
};
|
|
50
|
+
return <div class={classes}>{filterEmpty($slots.default)}</div>;
|
|
51
|
+
},
|
|
52
|
+
};
|