tntd 2.7.2 → 2.7.4
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/LICENSE +21 -0
- package/README.md +72 -0
- package/es/actions/index.js +12 -0
- package/es/actions/index.js.map +1 -0
- package/es/actions/index.less +70 -0
- package/es/affix/index.js +2 -1
- package/es/alert/index.js +2 -1
- package/es/anchor/index.js +2 -1
- package/es/array-input/icon.js +6 -24
- package/es/array-input/index.js +119 -203
- package/es/auth-context/index.js +2 -1
- package/es/auto-complete/index.js +2 -1
- package/es/avatar/index.js +2 -1
- package/es/back-top/index.js +2 -1
- package/es/badge/index.js +2 -1
- package/es/breadcrumb/index.js +2 -1
- package/es/button/index.js +2 -1
- package/es/calendar/index.js +2 -1
- package/es/card/index.js +2 -1
- package/es/carousel/index.js +2 -1
- package/es/cascader/index.js +2 -1
- package/es/check-card/group.js +149 -0
- package/es/check-card/group.js.map +1 -0
- package/es/check-card/index.js +120 -0
- package/es/check-card/index.js.map +1 -0
- package/es/check-card/index.less +179 -0
- package/es/checkbox/checkbox-group.js +2 -1
- package/es/checkbox/index.js +2 -1
- package/es/col/index.js +2 -1
- package/es/collapse/index.js +2 -1
- package/es/color-picker/ColorPicker.js +81 -127
- package/es/color-picker/ColorPicker.js.map +1 -1
- package/es/color-picker/index.js +5 -8
- package/es/color-picker/index.less +5 -1
- package/es/columns/index.js +30 -66
- package/es/columns/style/index.js +2 -1
- package/es/comment/index.js +2 -1
- package/es/config-provider/DisabledContext.js +5 -9
- package/es/config-provider/SizeContext.js +3 -7
- package/es/config-provider/config-provider.js +2 -1
- package/es/ellipsis/index.js +13 -3
- package/es/ellipsis/index.js.map +1 -1
- package/es/ellipsis/index.less +2 -2
- package/es/handle/index.js +20 -9
- package/es/handle/index.js.map +1 -1
- package/es/handle/index.less +1 -1
- package/es/index.js +7 -0
- package/es/index.js.map +1 -1
- package/es/index.less +5 -0
- package/es/locale/en_US.js +3 -1
- package/es/locale/en_US.js.map +1 -1
- package/es/locale/zh_CN.js +3 -1
- package/es/locale/zh_CN.js.map +1 -1
- package/es/mention/index.js +4 -0
- package/es/mention/index.js.map +1 -0
- package/es/page/Box.js +1 -1
- package/es/page/Box.js.map +1 -1
- package/es/page/index.js +2 -2
- package/es/page/index.js.map +1 -1
- package/es/page/index.less +5 -5
- package/es/prev-locale.js +1 -1
- package/es/prev-locale.js.map +1 -1
- package/es/query-form/Field/SelectInput.js +2 -2
- package/es/query-form/Field/SelectInput.js.map +1 -1
- package/es/query-form/Field/index.js +2 -1
- package/es/query-form/Field/index.js.map +1 -1
- package/es/query-list-scene/QueryForm.js +2 -2
- package/es/query-list-scene/QueryForm.js.map +1 -1
- package/es/segmented/index.js +50 -0
- package/es/segmented/index.js.map +1 -0
- package/es/segmented/index.less +138 -0
- package/es/switch/switch.js.map +1 -1
- package/es/table/constants.js +53 -0
- package/es/table/constants.js.map +1 -1
- package/es/table/context.js.map +1 -1
- package/es/table/hooks/use-column-setting.js.map +1 -1
- package/es/table/table.js +107 -6
- package/es/table/table.js.map +1 -1
- package/es/table/table.less +3 -1
- package/es/table/total-shower.js +6 -0
- package/es/table/total-shower.js.map +1 -0
- package/es/title/index.js +5 -5
- package/es/title/index.js.map +1 -1
- package/es/title/index.less +10 -10
- package/es/tntd-form/Form.js +13 -1
- package/es/tntd-form/Form.js.map +1 -1
- package/es/tntd-form/TntdForm/components/Item.js +42 -30
- package/es/tntd-form/TntdForm/components/ItemComp.js +167 -158
- package/es/tntd-form/TntdForm/components/List.js +89 -78
- package/es/tntd-form/TntdForm/index.js +38 -33
- package/es/tntd-form/TntdForm/interface.js +1 -2
- package/es/tntd-form/TntdForm/store.js +1 -2
- package/es/tntd-form/TntdForm/utils.js +158 -168
- package/es/tntd-form/tntd-form.stories.js +7 -5
- package/es/tntd-form/tntd-form.stories.js.map +1 -1
- package/es/tntd-layout/HeaderActions.js +1 -1
- package/es/tntd-layout/HeaderActions.js.map +1 -1
- package/es/tntd-modal/index.js +54 -21
- package/es/tntd-modal/index.js.map +1 -1
- package/es/tntd-modal/index.less +83 -63
- package/es/tree-select/index.js.map +1 -1
- package/es/utils/index.js +1 -0
- package/es/utils/index.js.map +1 -1
- package/es/utils/simple-template.js +11 -0
- package/es/utils/simple-template.js.map +1 -0
- package/es/water-mark/index.js +99 -0
- package/es/water-mark/index.js.map +1 -0
- package/lib/actions/index.d.ts +15 -0
- package/lib/actions/index.d.ts.map +1 -0
- package/lib/actions/index.js +17 -0
- package/lib/actions/index.js.map +1 -0
- package/lib/actions/index.less +70 -0
- package/lib/check-card/group.d.ts +130 -0
- package/lib/check-card/group.d.ts.map +1 -0
- package/lib/check-card/group.js +179 -0
- package/lib/check-card/group.js.map +1 -0
- package/lib/check-card/index.d.ts +136 -0
- package/lib/check-card/index.d.ts.map +1 -0
- package/lib/check-card/index.js +148 -0
- package/lib/check-card/index.js.map +1 -0
- package/lib/check-card/index.less +179 -0
- package/lib/color-picker/ColorPicker.js +1 -1
- package/lib/color-picker/ColorPicker.js.map +1 -1
- package/lib/color-picker/index.less +5 -1
- package/lib/ellipsis/index.d.ts.map +1 -1
- package/lib/ellipsis/index.js +13 -3
- package/lib/ellipsis/index.js.map +1 -1
- package/lib/ellipsis/index.less +2 -2
- package/lib/handle/index.d.ts.map +1 -1
- package/lib/handle/index.js +20 -9
- package/lib/handle/index.js.map +1 -1
- package/lib/handle/index.less +1 -1
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -1
- package/lib/index.js.map +1 -1
- package/lib/index.less +5 -0
- package/lib/locale/default.d.ts +1 -0
- package/lib/locale/default.d.ts.map +1 -1
- package/lib/locale/en_US.d.ts +1 -0
- package/lib/locale/en_US.d.ts.map +1 -1
- package/lib/locale/en_US.js +3 -1
- package/lib/locale/en_US.js.map +1 -1
- package/lib/locale/zh_CN.d.ts +1 -0
- package/lib/locale/zh_CN.d.ts.map +1 -1
- package/lib/locale/zh_CN.js +3 -1
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/mention/index.js +25 -0
- package/lib/page/Box.js +1 -1
- package/lib/page/Box.js.map +1 -1
- package/lib/page/index.js +2 -2
- package/lib/page/index.js.map +1 -1
- package/lib/page/index.less +5 -5
- package/lib/prev-locale.js +1 -1
- package/lib/prev-locale.js.map +1 -1
- package/lib/query-form/Field/SelectInput.d.ts.map +1 -1
- package/lib/query-form/Field/SelectInput.js +2 -2
- package/lib/query-form/Field/SelectInput.js.map +1 -1
- package/lib/query-form/Field/index.d.ts.map +1 -1
- package/lib/query-form/Field/index.js +2 -1
- package/lib/query-form/Field/index.js.map +1 -1
- package/lib/query-list-scene/QueryForm.d.ts +1 -1
- package/lib/query-list-scene/QueryForm.d.ts.map +1 -1
- package/lib/query-list-scene/QueryForm.js +2 -2
- package/lib/query-list-scene/QueryForm.js.map +1 -1
- package/lib/segmented/index.d.ts +23 -0
- package/lib/segmented/index.d.ts.map +1 -0
- package/lib/segmented/index.js +78 -0
- package/lib/segmented/index.js.map +1 -0
- package/lib/segmented/index.less +138 -0
- package/lib/switch/switch.d.ts +1 -1
- package/lib/switch/switch.d.ts.map +1 -1
- package/lib/switch/switch.js.map +1 -1
- package/lib/table/constants.d.ts +2 -0
- package/lib/table/constants.d.ts.map +1 -1
- package/lib/table/constants.js +54 -1
- package/lib/table/constants.js.map +1 -1
- package/lib/table/context.d.ts +1 -0
- package/lib/table/context.d.ts.map +1 -1
- package/lib/table/context.js.map +1 -1
- package/lib/table/hooks/use-column-setting.d.ts +4 -1
- package/lib/table/hooks/use-column-setting.d.ts.map +1 -1
- package/lib/table/hooks/use-column-setting.js.map +1 -1
- package/lib/table/table.d.ts +2 -1
- package/lib/table/table.d.ts.map +1 -1
- package/lib/table/table.js +107 -6
- package/lib/table/table.js.map +1 -1
- package/lib/table/table.less +3 -1
- package/lib/table/total-shower.d.ts +9 -0
- package/lib/table/total-shower.d.ts.map +1 -0
- package/lib/table/total-shower.js +13 -0
- package/lib/table/total-shower.js.map +1 -0
- package/lib/title/index.d.ts +11 -1
- package/lib/title/index.d.ts.map +1 -1
- package/lib/title/index.js +5 -5
- package/lib/title/index.js.map +1 -1
- package/lib/title/index.less +10 -10
- package/lib/tntd-form/Form.d.ts.map +1 -1
- package/lib/tntd-form/Form.js +12 -0
- package/lib/tntd-form/Form.js.map +1 -1
- package/lib/tntd-form/TntdForm/components/Item.js +55 -61
- package/lib/tntd-form/TntdForm/components/ItemComp.js +203 -190
- package/lib/tntd-form/TntdForm/components/List.js +118 -111
- package/lib/tntd-form/TntdForm/index.js +61 -67
- package/lib/tntd-form/TntdForm/interface.js +4 -2
- package/lib/tntd-form/TntdForm/store.js +8 -7
- package/lib/tntd-form/TntdForm/utils.js +182 -184
- package/lib/tntd-form/tntd-form.stories.d.ts.map +1 -1
- package/lib/tntd-form/tntd-form.stories.js +7 -5
- package/lib/tntd-form/tntd-form.stories.js.map +1 -1
- package/lib/tntd-layout/HeaderActions.js +1 -1
- package/lib/tntd-layout/HeaderActions.js.map +1 -1
- package/lib/tntd-modal/index.d.ts +15 -2
- package/lib/tntd-modal/index.d.ts.map +1 -1
- package/lib/tntd-modal/index.js +58 -23
- package/lib/tntd-modal/index.js.map +1 -1
- package/lib/tntd-modal/index.less +83 -63
- package/lib/tree-select/index.d.ts +7 -5
- package/lib/tree-select/index.d.ts.map +1 -1
- package/lib/tree-select/index.js.map +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/simple-template.d.ts +9 -0
- package/lib/utils/simple-template.d.ts.map +1 -0
- package/lib/utils/simple-template.js +15 -0
- package/lib/utils/simple-template.js.map +1 -0
- package/lib/water-mark/index.d.ts +49 -0
- package/lib/water-mark/index.d.ts.map +1 -0
- package/lib/water-mark/index.js +129 -0
- package/lib/water-mark/index.js.map +1 -0
- package/package.json +21 -3
- package/es/_util/colors.js +0 -3
- package/es/_util/colors.js.map +0 -1
- package/es/_util/easings.js +0 -9
- package/es/_util/easings.js.map +0 -1
- package/es/_util/getDataOrAriaProps.js +0 -8
- package/es/_util/getDataOrAriaProps.js.map +0 -1
- package/es/_util/getScroll.js +0 -14
- package/es/_util/getScroll.js.map +0 -1
- package/es/_util/interopDefault.js +0 -5
- package/es/_util/interopDefault.js.map +0 -1
- package/es/_util/isNumeric.js +0 -4
- package/es/_util/isNumeric.js.map +0 -1
- package/es/_util/motion.js +0 -22
- package/es/_util/motion.js.map +0 -1
- package/es/_util/openAnimation.js +0 -51
- package/es/_util/openAnimation.js.map +0 -1
- package/es/_util/raf.js +0 -25
- package/es/_util/raf.js.map +0 -1
- package/es/_util/reactNode.js +0 -6
- package/es/_util/reactNode.js.map +0 -1
- package/es/_util/ref.js +0 -15
- package/es/_util/ref.js.map +0 -1
- package/es/_util/responsiveObserve.js +0 -82
- package/es/_util/responsiveObserve.js.map +0 -1
- package/es/_util/scrollTo.js +0 -29
- package/es/_util/scrollTo.js.map +0 -1
- package/es/_util/styleChecker.js +0 -12
- package/es/_util/styleChecker.js.map +0 -1
- package/es/_util/throttleByAnimationFrame.js +0 -40
- package/es/_util/throttleByAnimationFrame.js.map +0 -1
- package/es/_util/transButton.js +0 -103
- package/es/_util/transButton.js.map +0 -1
- package/es/_util/triggerEvent.js +0 -8
- package/es/_util/triggerEvent.js.map +0 -1
- package/es/_util/type.js +0 -3
- package/es/_util/type.js.map +0 -1
- package/es/_util/warning.js +0 -5
- package/es/_util/warning.js.map +0 -1
- package/es/_util/wave.js +0 -228
- package/es/_util/wave.js.map +0 -1
- package/es/config-provider/context.js +0 -41
- package/es/config-provider/context.js.map +0 -1
- package/es/tntd-form/__tests__/demo-extend.test.js +0 -3
- package/es/tntd-form/__tests__/demo-extend.test.js.map +0 -1
- package/es/tntd-form/__tests__/demo.test.js +0 -3
- package/es/tntd-form/__tests__/demo.test.js.map +0 -1
- package/es/tntd-form/__tests__/image.test.js +0 -5
- package/es/tntd-form/__tests__/image.test.js.map +0 -1
- package/es/tntd-form/__tests__/index.test.js +0 -957
- package/es/tntd-form/__tests__/index.test.js.map +0 -1
- package/es/tntd-form/__tests__/list-noStyle.test.js +0 -41
- package/es/tntd-form/__tests__/list-noStyle.test.js.map +0 -1
- package/es/tntd-form/__tests__/list.test.js +0 -164
- package/es/tntd-form/__tests__/list.test.js.map +0 -1
- package/es/tntd-form/__tests__/ref.test.js +0 -45
- package/es/tntd-form/__tests__/ref.test.js.map +0 -1
- package/es/tntd-form/__tests__/type.test.js +0 -74
- package/es/tntd-form/__tests__/type.test.js.map +0 -1
- package/lib/_util/colors.d.ts +0 -3
- package/lib/_util/colors.d.ts.map +0 -1
- package/lib/_util/colors.js +0 -7
- package/lib/_util/colors.js.map +0 -1
- package/lib/_util/easings.d.ts +0 -2
- package/lib/_util/easings.d.ts.map +0 -1
- package/lib/_util/easings.js +0 -14
- package/lib/_util/easings.js.map +0 -1
- package/lib/_util/getDataOrAriaProps.d.ts +0 -2
- package/lib/_util/getDataOrAriaProps.d.ts.map +0 -1
- package/lib/_util/getDataOrAriaProps.js +0 -13
- package/lib/_util/getDataOrAriaProps.js.map +0 -1
- package/lib/_util/getScroll.d.ts +0 -2
- package/lib/_util/getScroll.d.ts.map +0 -1
- package/lib/_util/getScroll.js +0 -18
- package/lib/_util/getScroll.js.map +0 -1
- package/lib/_util/interopDefault.d.ts +0 -2
- package/lib/_util/interopDefault.d.ts.map +0 -1
- package/lib/_util/interopDefault.js +0 -9
- package/lib/_util/interopDefault.js.map +0 -1
- package/lib/_util/isNumeric.d.ts +0 -3
- package/lib/_util/isNumeric.d.ts.map +0 -1
- package/lib/_util/isNumeric.js +0 -7
- package/lib/_util/isNumeric.js.map +0 -1
- package/lib/_util/motion.d.ts +0 -24
- package/lib/_util/motion.d.ts.map +0 -1
- package/lib/_util/motion.js +0 -17
- package/lib/_util/motion.js.map +0 -1
- package/lib/_util/openAnimation.d.ts +0 -7
- package/lib/_util/openAnimation.d.ts.map +0 -1
- package/lib/_util/openAnimation.js +0 -58
- package/lib/_util/openAnimation.js.map +0 -1
- package/lib/_util/raf.d.ts +0 -10
- package/lib/_util/raf.d.ts.map +0 -1
- package/lib/_util/raf.js +0 -34
- package/lib/_util/raf.js.map +0 -1
- package/lib/_util/reactNode.d.ts +0 -3
- package/lib/_util/reactNode.d.ts.map +0 -1
- package/lib/_util/reactNode.js +0 -31
- package/lib/_util/reactNode.js.map +0 -1
- package/lib/_util/ref.d.ts +0 -4
- package/lib/_util/ref.d.ts.map +0 -1
- package/lib/_util/ref.js +0 -22
- package/lib/_util/ref.js.map +0 -1
- package/lib/_util/responsiveObserve.d.ts +0 -14
- package/lib/_util/responsiveObserve.d.ts.map +0 -1
- package/lib/_util/responsiveObserve.js +0 -83
- package/lib/_util/responsiveObserve.js.map +0 -1
- package/lib/_util/scrollTo.d.ts +0 -11
- package/lib/_util/scrollTo.d.ts.map +0 -1
- package/lib/_util/scrollTo.js +0 -34
- package/lib/_util/scrollTo.js.map +0 -1
- package/lib/_util/styleChecker.d.ts +0 -4
- package/lib/_util/styleChecker.d.ts.map +0 -1
- package/lib/_util/styleChecker.js +0 -14
- package/lib/_util/styleChecker.js.map +0 -1
- package/lib/_util/throttleByAnimationFrame.d.ts +0 -6
- package/lib/_util/throttleByAnimationFrame.d.ts.map +0 -1
- package/lib/_util/throttleByAnimationFrame.js +0 -49
- package/lib/_util/throttleByAnimationFrame.js.map +0 -1
- package/lib/_util/transButton.d.ts +0 -21
- package/lib/_util/transButton.d.ts.map +0 -1
- package/lib/_util/transButton.js +0 -112
- package/lib/_util/transButton.js.map +0 -1
- package/lib/_util/triggerEvent.d.ts +0 -2
- package/lib/_util/triggerEvent.d.ts.map +0 -1
- package/lib/_util/triggerEvent.js +0 -12
- package/lib/_util/triggerEvent.js.map +0 -1
- package/lib/_util/type.d.ts +0 -4
- package/lib/_util/type.d.ts.map +0 -1
- package/lib/_util/type.js +0 -9
- package/lib/_util/type.js.map +0 -1
- package/lib/_util/warning.d.ts +0 -5
- package/lib/_util/warning.d.ts.map +0 -1
- package/lib/_util/warning.js +0 -28
- package/lib/_util/warning.js.map +0 -1
- package/lib/_util/wave.d.ts +0 -26
- package/lib/_util/wave.d.ts.map +0 -1
- package/lib/_util/wave.js +0 -249
- package/lib/_util/wave.js.map +0 -1
- package/lib/config-provider/context.d.ts +0 -61
- package/lib/config-provider/context.d.ts.map +0 -1
- package/lib/config-provider/context.js +0 -64
- package/lib/config-provider/context.js.map +0 -1
- package/lib/tntd-form/TntdForm/components/Item.d.ts +0 -5
- package/lib/tntd-form/TntdForm/components/Item.d.ts.map +0 -1
- package/lib/tntd-form/TntdForm/components/Item.js.map +0 -1
- package/lib/tntd-form/TntdForm/components/ItemComp.d.ts +0 -5
- package/lib/tntd-form/TntdForm/components/ItemComp.d.ts.map +0 -1
- package/lib/tntd-form/TntdForm/components/ItemComp.js.map +0 -1
- package/lib/tntd-form/TntdForm/components/List.d.ts +0 -5
- package/lib/tntd-form/TntdForm/components/List.d.ts.map +0 -1
- package/lib/tntd-form/TntdForm/components/List.js.map +0 -1
- package/lib/tntd-form/TntdForm/index.d.ts +0 -10
- package/lib/tntd-form/TntdForm/index.d.ts.map +0 -1
- package/lib/tntd-form/TntdForm/index.js.map +0 -1
- package/lib/tntd-form/TntdForm/interface.d.ts +0 -93
- package/lib/tntd-form/TntdForm/interface.d.ts.map +0 -1
- package/lib/tntd-form/TntdForm/interface.js.map +0 -1
- package/lib/tntd-form/TntdForm/store.d.ts +0 -4
- package/lib/tntd-form/TntdForm/store.d.ts.map +0 -1
- package/lib/tntd-form/TntdForm/store.js.map +0 -1
- package/lib/tntd-form/TntdForm/utils.d.ts +0 -48
- package/lib/tntd-form/TntdForm/utils.d.ts.map +0 -1
- package/lib/tntd-form/TntdForm/utils.js.map +0 -1
- package/lib/tntd-form/__tests__/demo-extend.test.d.ts +0 -2
- package/lib/tntd-form/__tests__/demo-extend.test.d.ts.map +0 -1
- package/lib/tntd-form/__tests__/demo-extend.test.js +0 -5
- package/lib/tntd-form/__tests__/demo-extend.test.js.map +0 -1
- package/lib/tntd-form/__tests__/demo.test.d.ts +0 -2
- package/lib/tntd-form/__tests__/demo.test.d.ts.map +0 -1
- package/lib/tntd-form/__tests__/demo.test.js +0 -8
- package/lib/tntd-form/__tests__/demo.test.js.map +0 -1
- package/lib/tntd-form/__tests__/image.test.d.ts +0 -2
- package/lib/tntd-form/__tests__/image.test.d.ts.map +0 -1
- package/lib/tntd-form/__tests__/image.test.js +0 -7
- package/lib/tntd-form/__tests__/image.test.js.map +0 -1
- package/lib/tntd-form/__tests__/index.test.d.ts +0 -2
- package/lib/tntd-form/__tests__/index.test.d.ts.map +0 -1
- package/lib/tntd-form/__tests__/index.test.js +0 -981
- package/lib/tntd-form/__tests__/index.test.js.map +0 -1
- package/lib/tntd-form/__tests__/list-noStyle.test.d.ts +0 -2
- package/lib/tntd-form/__tests__/list-noStyle.test.d.ts.map +0 -1
- package/lib/tntd-form/__tests__/list-noStyle.test.js +0 -46
- package/lib/tntd-form/__tests__/list-noStyle.test.js.map +0 -1
- package/lib/tntd-form/__tests__/list.test.d.ts +0 -2
- package/lib/tntd-form/__tests__/list.test.d.ts.map +0 -1
- package/lib/tntd-form/__tests__/list.test.js +0 -169
- package/lib/tntd-form/__tests__/list.test.js.map +0 -1
- package/lib/tntd-form/__tests__/ref.test.d.ts +0 -2
- package/lib/tntd-form/__tests__/ref.test.d.ts.map +0 -1
- package/lib/tntd-form/__tests__/ref.test.js +0 -50
- package/lib/tntd-form/__tests__/ref.test.js.map +0 -1
- package/lib/tntd-form/__tests__/type.test.d.ts +0 -2
- package/lib/tntd-form/__tests__/type.test.d.ts.map +0 -1
- package/lib/tntd-form/__tests__/type.test.js +0 -98
- package/lib/tntd-form/__tests__/type.test.js.map +0 -1
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import Form from '..';
|
|
3
|
-
import Input from '../../input';
|
|
4
|
-
describe('Form.typescript', () => {
|
|
5
|
-
it('Form.Item', () => {
|
|
6
|
-
const form = (React.createElement(Form, null,
|
|
7
|
-
React.createElement(Form.Item, { name: "test" },
|
|
8
|
-
React.createElement(Input, null))));
|
|
9
|
-
expect(form).toBeTruthy();
|
|
10
|
-
});
|
|
11
|
-
describe('generic', () => {
|
|
12
|
-
it('hooks', () => {
|
|
13
|
-
const Demo = () => {
|
|
14
|
-
const [form] = Form.useForm();
|
|
15
|
-
form.setFieldsValue({ path1: { path2: 2333 } });
|
|
16
|
-
return (React.createElement(Form, { form: form, onFinish: values => {
|
|
17
|
-
var _a;
|
|
18
|
-
expect(values).toBeTruthy();
|
|
19
|
-
expect(values.username).toBeTruthy();
|
|
20
|
-
expect((_a = values.path1) === null || _a === void 0 ? void 0 : _a.path2).toBeTruthy();
|
|
21
|
-
} }));
|
|
22
|
-
};
|
|
23
|
-
expect(Demo).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
it('ref', () => {
|
|
26
|
-
class Demo extends React.Component {
|
|
27
|
-
constructor() {
|
|
28
|
-
super(...arguments);
|
|
29
|
-
Object.defineProperty(this, "formRef", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
configurable: true,
|
|
32
|
-
writable: true,
|
|
33
|
-
value: React.createRef()
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
componentDidMount() {
|
|
37
|
-
var _a;
|
|
38
|
-
(_a = this.formRef.current) === null || _a === void 0 ? void 0 : _a.setFieldsValue({ path1: { path2: 233 } });
|
|
39
|
-
}
|
|
40
|
-
render() {
|
|
41
|
-
return (React.createElement(Form, { ref: this.formRef, onFinish: values => {
|
|
42
|
-
var _a;
|
|
43
|
-
expect(values).toBeTruthy();
|
|
44
|
-
expect(values.username).toBeTruthy();
|
|
45
|
-
expect((_a = values.path1) === null || _a === void 0 ? void 0 : _a.path2).toBeTruthy();
|
|
46
|
-
} }));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
expect(Demo).toBeTruthy();
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
it('FormItem renderProps support generic', () => {
|
|
53
|
-
const Demo = () => (React.createElement(Form, null,
|
|
54
|
-
React.createElement(Form.Item, null, ({ getFieldsValue }) => {
|
|
55
|
-
var _a;
|
|
56
|
-
const values = getFieldsValue();
|
|
57
|
-
expect(values).toBeTruthy();
|
|
58
|
-
expect(values.username).toBeTruthy();
|
|
59
|
-
expect((_a = values.path1) === null || _a === void 0 ? void 0 : _a.path2).toBeTruthy();
|
|
60
|
-
return null;
|
|
61
|
-
})));
|
|
62
|
-
expect(Demo).toBeTruthy();
|
|
63
|
-
});
|
|
64
|
-
// TODO: @crazyair fix for value types
|
|
65
|
-
it('useWatch', () => {
|
|
66
|
-
const Demo = () => {
|
|
67
|
-
const [form] = Form.useForm();
|
|
68
|
-
const value = Form.useWatch('username', form);
|
|
69
|
-
return React.createElement(Form, { form: form }, value);
|
|
70
|
-
};
|
|
71
|
-
expect(Demo).toBeTruthy();
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=type.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.test.js","sourceRoot":"","sources":["../../../src/tntd-form/__tests__/type.test.tsx"],"names":[],"mappings":"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","sourcesContent":["import * as React from 'react';\nimport type { FormInstance } from '..';\nimport Form from '..';\nimport Input from '../../input';\n\ninterface FormValues {\n username?: string;\n path1?: { path2?: number };\n}\n\ndescribe('Form.typescript', () => {\n it('Form.Item', () => {\n const form = (\n <Form>\n <Form.Item name=\"test\">\n <Input />\n </Form.Item>\n </Form>\n );\n expect(form).toBeTruthy();\n });\n\n describe('generic', () => {\n it('hooks', () => {\n const Demo: React.FC = () => {\n const [form] = Form.useForm<FormValues>();\n\n form.setFieldsValue({ path1: { path2: 2333 } });\n\n return (\n <Form\n form={form}\n onFinish={values => {\n expect(values).toBeTruthy();\n expect(values.username).toBeTruthy();\n expect(values.path1?.path2).toBeTruthy();\n }}\n />\n );\n };\n\n expect(Demo).toBeTruthy();\n });\n\n it('ref', () => {\n class Demo extends React.Component {\n formRef = React.createRef<FormInstance<FormValues>>();\n\n componentDidMount() {\n this.formRef.current?.setFieldsValue({ path1: { path2: 233 } });\n }\n\n render() {\n return (\n <Form\n ref={this.formRef}\n onFinish={values => {\n expect(values).toBeTruthy();\n expect(values.username).toBeTruthy();\n expect(values.path1?.path2).toBeTruthy();\n }}\n />\n );\n }\n }\n\n expect(Demo).toBeTruthy();\n });\n });\n\n it('FormItem renderProps support generic', () => {\n const Demo: React.FC = () => (\n <Form<FormValues>>\n <Form.Item<FormValues>>\n {({ getFieldsValue }) => {\n const values = getFieldsValue();\n expect(values).toBeTruthy();\n expect(values.username).toBeTruthy();\n expect(values.path1?.path2).toBeTruthy();\n return null;\n }}\n </Form.Item>\n </Form>\n );\n\n expect(Demo).toBeTruthy();\n });\n\n // TODO: @crazyair fix for value types\n it('useWatch', () => {\n const Demo: React.FC = () => {\n const [form] = Form.useForm<FormValues>();\n const value = Form.useWatch('username', form);\n\n return <Form form={form}>{value}</Form>;\n };\n\n expect(Demo).toBeTruthy();\n });\n});\n"]}
|
package/lib/_util/colors.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/_util/colors.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,0HAc5B,CAAC;AAEF,oBAAY,eAAe,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/lib/_util/colors.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PresetColorTypes = void 0;
|
|
4
|
-
const type_1 = require("./type");
|
|
5
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
6
|
-
exports.PresetColorTypes = (0, type_1.tuple)('pink', 'red', 'yellow', 'orange', 'cyan', 'green', 'blue', 'purple', 'geekblue', 'magenta', 'volcano', 'gold', 'lime');
|
|
7
|
-
//# sourceMappingURL=colors.js.map
|
package/lib/_util/colors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/_util/colors.ts"],"names":[],"mappings":";;;AAAA,iCAA+B;AAE/B,wDAAwD;AAC3C,QAAA,gBAAgB,GAAG,IAAA,YAAK,EACnC,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,OAAO,EACP,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAS,EACT,MAAM,EACN,MAAM,CACP,CAAC","sourcesContent":["import { tuple } from './type';\n\n// eslint-disable-next-line import/prefer-default-export\nexport const PresetColorTypes = tuple(\n 'pink',\n 'red',\n 'yellow',\n 'orange',\n 'cyan',\n 'green',\n 'blue',\n 'purple',\n 'geekblue',\n 'magenta',\n 'volcano',\n 'gold',\n 'lime',\n);\n\nexport type PresetColorType = (typeof PresetColorTypes)[number];\n"]}
|
package/lib/_util/easings.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"easings.d.ts","sourceRoot":"","sources":["../../src/_util/easings.ts"],"names":[],"mappings":"AACA,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAOxE"}
|
package/lib/_util/easings.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.easeInOutCubic = void 0;
|
|
4
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
5
|
-
function easeInOutCubic(t, b, c, d) {
|
|
6
|
-
const cc = c - b;
|
|
7
|
-
t /= d / 2;
|
|
8
|
-
if (t < 1) {
|
|
9
|
-
return (cc / 2) * t * t * t + b;
|
|
10
|
-
}
|
|
11
|
-
return (cc / 2) * ((t -= 2) * t * t + 2) + b;
|
|
12
|
-
}
|
|
13
|
-
exports.easeInOutCubic = easeInOutCubic;
|
|
14
|
-
//# sourceMappingURL=easings.js.map
|
package/lib/_util/easings.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"easings.js","sourceRoot":"","sources":["../../src/_util/easings.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,SAAgB,cAAc,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACvE,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACjB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACX,IAAI,CAAC,GAAG,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KACjC;IACD,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAC/C,CAAC;AAPD,wCAOC","sourcesContent":["// eslint-disable-next-line import/prefer-default-export\nexport function easeInOutCubic(t: number, b: number, c: number, d: number) {\n const cc = c - b;\n t /= d / 2;\n if (t < 1) {\n return (cc / 2) * t * t * t + b;\n }\n return (cc / 2) * ((t -= 2) * t * t + 2) + b;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDataOrAriaProps.d.ts","sourceRoot":"","sources":["../../src/_util/getDataOrAriaProps.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,GAAG,OAUpD"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function getDataOrAriaProps(props) {
|
|
4
|
-
return Object.keys(props).reduce((prev, key) => {
|
|
5
|
-
if ((key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') &&
|
|
6
|
-
key.substr(0, 7) !== 'data-__') {
|
|
7
|
-
prev[key] = props[key];
|
|
8
|
-
}
|
|
9
|
-
return prev;
|
|
10
|
-
}, {});
|
|
11
|
-
}
|
|
12
|
-
exports.default = getDataOrAriaProps;
|
|
13
|
-
//# sourceMappingURL=getDataOrAriaProps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDataOrAriaProps.js","sourceRoot":"","sources":["../../src/_util/getDataOrAriaProps.ts"],"names":[],"mappings":";;AAAA,SAAwB,kBAAkB,CAAC,KAAU;IACnD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAS,EAAE,GAAW,EAAE,EAAE;QAC1D,IACE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,IAAI,GAAG,KAAK,MAAM,CAAC;YAChF,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,EAC9B;YACA,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;SACxB;QACD,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAVD,qCAUC","sourcesContent":["export default function getDataOrAriaProps(props: any) {\n return Object.keys(props).reduce((prev: any, key: string) => {\n if (\n (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') &&\n key.substr(0, 7) !== 'data-__'\n ) {\n prev[key] = props[key];\n }\n return prev;\n }, {});\n}\n"]}
|
package/lib/_util/getScroll.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getScroll.d.ts","sourceRoot":"","sources":["../../src/_util/getScroll.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,OAAO,GAAG,MAAM,CAgB3F"}
|
package/lib/_util/getScroll.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function getScroll(target, top) {
|
|
4
|
-
if (typeof window === 'undefined') {
|
|
5
|
-
return 0;
|
|
6
|
-
}
|
|
7
|
-
const prop = top ? 'pageYOffset' : 'pageXOffset';
|
|
8
|
-
const method = top ? 'scrollTop' : 'scrollLeft';
|
|
9
|
-
const isWindow = target === window;
|
|
10
|
-
let ret = isWindow ? target[prop] : target[method];
|
|
11
|
-
// ie6,7,8 standard mode
|
|
12
|
-
if (isWindow && typeof ret !== 'number') {
|
|
13
|
-
ret = document.documentElement[method];
|
|
14
|
-
}
|
|
15
|
-
return ret;
|
|
16
|
-
}
|
|
17
|
-
exports.default = getScroll;
|
|
18
|
-
//# sourceMappingURL=getScroll.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getScroll.js","sourceRoot":"","sources":["../../src/_util/getScroll.tsx"],"names":[],"mappings":";;AAAA,SAAwB,SAAS,CAAC,MAAmC,EAAE,GAAY;IACjF,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,CAAC,CAAC;KACV;IAED,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;IACjD,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC;IAChD,MAAM,QAAQ,GAAG,MAAM,KAAK,MAAM,CAAC;IAEnC,IAAI,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAE,MAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,MAAsB,CAAC,MAAM,CAAC,CAAC;IAChF,wBAAwB;IACxB,IAAI,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QACvC,GAAG,GAAI,QAAQ,CAAC,eAA+B,CAAC,MAAM,CAAC,CAAC;KACzD;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAhBD,4BAgBC","sourcesContent":["export default function getScroll(target: HTMLElement | Window | null, top: boolean): number {\n if (typeof window === 'undefined') {\n return 0;\n }\n\n const prop = top ? 'pageYOffset' : 'pageXOffset';\n const method = top ? 'scrollTop' : 'scrollLeft';\n const isWindow = target === window;\n\n let ret = isWindow ? (target as Window)[prop] : (target as HTMLElement)[method];\n // ie6,7,8 standard mode\n if (isWindow && typeof ret !== 'number') {\n ret = (document.documentElement as HTMLElement)[method];\n }\n\n return ret;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interopDefault.d.ts","sourceRoot":"","sources":["../../src/_util/interopDefault.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,EAAE,GAAG,OAE5C"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// https://github.com/moment/moment/issues/3650
|
|
4
|
-
// since we are using ts 3.5.1, it should be safe to remove.
|
|
5
|
-
function interopDefault(m) {
|
|
6
|
-
return m.default || m;
|
|
7
|
-
}
|
|
8
|
-
exports.default = interopDefault;
|
|
9
|
-
//# sourceMappingURL=interopDefault.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interopDefault.js","sourceRoot":"","sources":["../../src/_util/interopDefault.ts"],"names":[],"mappings":";;AAAA,+CAA+C;AAC/C,4DAA4D;AAC5D,SAAwB,cAAc,CAAC,CAAM;IAC3C,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC;AACxB,CAAC;AAFD,iCAEC","sourcesContent":["// https://github.com/moment/moment/issues/3650\n// since we are using ts 3.5.1, it should be safe to remove.\nexport default function interopDefault(m: any) {\n return m.default || m;\n}\n"]}
|
package/lib/_util/isNumeric.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isNumeric.d.ts","sourceRoot":"","sources":["../../src/_util/isNumeric.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,SAAS,UAAW,GAAG,KAAG,OAE/B,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/lib/_util/isNumeric.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isNumeric.js","sourceRoot":"","sources":["../../src/_util/isNumeric.ts"],"names":[],"mappings":";;AAAA,MAAM,SAAS,GAAG,CAAC,KAAU,EAAW,EAAE;IACxC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;AACtD,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["const isNumeric = (value: any): boolean => {\n return !isNaN(parseFloat(value)) && isFinite(value);\n};\n\nexport default isNumeric;\n"]}
|
package/lib/_util/motion.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
declare type MotionFunc = (element: HTMLElement) => React.CSSProperties;
|
|
3
|
-
interface Motion {
|
|
4
|
-
visible?: boolean;
|
|
5
|
-
motionName?: string;
|
|
6
|
-
motionAppear?: boolean;
|
|
7
|
-
motionEnter?: boolean;
|
|
8
|
-
motionLeave?: boolean;
|
|
9
|
-
motionLeaveImmediately?: boolean;
|
|
10
|
-
removeOnLeave?: boolean;
|
|
11
|
-
leavedClassName?: string;
|
|
12
|
-
onAppearStart?: MotionFunc;
|
|
13
|
-
onAppearActive?: MotionFunc;
|
|
14
|
-
onAppearEnd?: MotionFunc;
|
|
15
|
-
onEnterStart?: MotionFunc;
|
|
16
|
-
onEnterActive?: MotionFunc;
|
|
17
|
-
onEnterEnd?: MotionFunc;
|
|
18
|
-
onLeaveStart?: MotionFunc;
|
|
19
|
-
onLeaveActive?: MotionFunc;
|
|
20
|
-
onLeaveEnd?: MotionFunc;
|
|
21
|
-
}
|
|
22
|
-
declare const collapseMotion: Motion;
|
|
23
|
-
export default collapseMotion;
|
|
24
|
-
//# sourceMappingURL=motion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/_util/motion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,aAAK,UAAU,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,KAAK,CAAC,aAAa,CAAA;AAE/D,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B,cAAc,CAAC,EAAE,UAAU,CAAA;IAC3B,WAAW,CAAC,EAAE,UAAU,CAAA;IACxB,YAAY,CAAC,EAAE,UAAU,CAAA;IACzB,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,YAAY,CAAC,EAAE,UAAU,CAAA;IACzB,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB;AAOD,QAAA,MAAM,cAAc,EAAE,MAQrB,CAAA;AAED,eAAe,cAAc,CAAA"}
|
package/lib/_util/motion.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// ================== Collapse Motion ==================
|
|
4
|
-
const getCollapsedHeight = () => ({ height: 0, opacity: 0 });
|
|
5
|
-
const getRealHeight = node => ({ height: node.scrollHeight, opacity: 1 });
|
|
6
|
-
const getCurrentHeight = node => ({ height: node.offsetHeight });
|
|
7
|
-
const collapseMotion = {
|
|
8
|
-
motionName: 'ant-motion-collapse',
|
|
9
|
-
onAppearStart: getCollapsedHeight,
|
|
10
|
-
onEnterStart: getCollapsedHeight,
|
|
11
|
-
onAppearActive: getRealHeight,
|
|
12
|
-
onEnterActive: getRealHeight,
|
|
13
|
-
onLeaveStart: getCurrentHeight,
|
|
14
|
-
onLeaveActive: getCollapsedHeight,
|
|
15
|
-
};
|
|
16
|
-
exports.default = collapseMotion;
|
|
17
|
-
//# sourceMappingURL=motion.js.map
|
package/lib/_util/motion.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"motion.js","sourceRoot":"","sources":["../../src/_util/motion.tsx"],"names":[],"mappings":";;AAwBA,wDAAwD;AACxD,MAAM,kBAAkB,GAAe,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAA;AACxE,MAAM,aAAa,GAAe,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAA;AACrF,MAAM,gBAAgB,GAAe,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAA;AAE5E,MAAM,cAAc,GAAW;IAC7B,UAAU,EAAE,qBAAqB;IACjC,aAAa,EAAE,kBAAkB;IACjC,YAAY,EAAE,kBAAkB;IAChC,cAAc,EAAE,aAAa;IAC7B,aAAa,EAAE,aAAa;IAC5B,YAAY,EAAE,gBAAgB;IAC9B,aAAa,EAAE,kBAAkB;CAClC,CAAA;AAED,kBAAe,cAAc,CAAA","sourcesContent":["import type React from 'react'\n\ntype MotionFunc = (element: HTMLElement) => React.CSSProperties\n\ninterface Motion {\n visible?: boolean\n motionName?: string // It also support object, but we only use string here.\n motionAppear?: boolean\n motionEnter?: boolean\n motionLeave?: boolean\n motionLeaveImmediately?: boolean // Trigger leave motion immediately\n removeOnLeave?: boolean\n leavedClassName?: string\n onAppearStart?: MotionFunc\n onAppearActive?: MotionFunc\n onAppearEnd?: MotionFunc\n onEnterStart?: MotionFunc\n onEnterActive?: MotionFunc\n onEnterEnd?: MotionFunc\n onLeaveStart?: MotionFunc\n onLeaveActive?: MotionFunc\n onLeaveEnd?: MotionFunc\n}\n\n// ================== Collapse Motion ==================\nconst getCollapsedHeight: MotionFunc = () => ({ height: 0, opacity: 0 })\nconst getRealHeight: MotionFunc = node => ({ height: node.scrollHeight, opacity: 1 })\nconst getCurrentHeight: MotionFunc = node => ({ height: node.offsetHeight })\n\nconst collapseMotion: Motion = {\n motionName: 'ant-motion-collapse',\n onAppearStart: getCollapsedHeight,\n onEnterStart: getCollapsedHeight,\n onAppearActive: getRealHeight,\n onEnterActive: getRealHeight,\n onLeaveStart: getCurrentHeight,\n onLeaveActive: getCollapsedHeight,\n}\n\nexport default collapseMotion\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openAnimation.d.ts","sourceRoot":"","sources":["../../src/_util/openAnimation.tsx"],"names":[],"mappings":"AAyCA,QAAA,MAAM,SAAS;gBACD,WAAW,QAAQ,MAAM,IAAI;gBAG7B,WAAW,QAAQ,MAAM,IAAI;iBAG5B,WAAW,QAAQ,MAAM,IAAI;CAG3C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
/**
|
|
7
|
-
* Deprecated. We should replace the animation with pure react motion instead of modify style directly.
|
|
8
|
-
* If you are creating new component with animation, please use `./motion`.
|
|
9
|
-
*/
|
|
10
|
-
const css_animation_1 = __importDefault(require("css-animation"));
|
|
11
|
-
const raf_1 = __importDefault(require("raf"));
|
|
12
|
-
function animate(node, show, done) {
|
|
13
|
-
let height;
|
|
14
|
-
let requestAnimationFrameId;
|
|
15
|
-
return (0, css_animation_1.default)(node, 'ant-motion-collapse-legacy', {
|
|
16
|
-
start() {
|
|
17
|
-
if (!show) {
|
|
18
|
-
node.style.height = `${node.offsetHeight}px`;
|
|
19
|
-
node.style.opacity = '1';
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
height = node.offsetHeight;
|
|
23
|
-
node.style.height = '0px';
|
|
24
|
-
node.style.opacity = '0';
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
active() {
|
|
28
|
-
if (requestAnimationFrameId) {
|
|
29
|
-
raf_1.default.cancel(requestAnimationFrameId);
|
|
30
|
-
}
|
|
31
|
-
requestAnimationFrameId = (0, raf_1.default)(() => {
|
|
32
|
-
node.style.height = `${show ? height : 0}px`;
|
|
33
|
-
node.style.opacity = show ? '1' : '0';
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
end() {
|
|
37
|
-
if (requestAnimationFrameId) {
|
|
38
|
-
raf_1.default.cancel(requestAnimationFrameId);
|
|
39
|
-
}
|
|
40
|
-
node.style.height = '';
|
|
41
|
-
node.style.opacity = '';
|
|
42
|
-
done();
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
const animation = {
|
|
47
|
-
enter(node, done) {
|
|
48
|
-
return animate(node, true, done);
|
|
49
|
-
},
|
|
50
|
-
leave(node, done) {
|
|
51
|
-
return animate(node, false, done);
|
|
52
|
-
},
|
|
53
|
-
appear(node, done) {
|
|
54
|
-
return animate(node, true, done);
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
exports.default = animation;
|
|
58
|
-
//# sourceMappingURL=openAnimation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openAnimation.js","sourceRoot":"","sources":["../../src/_util/openAnimation.tsx"],"names":[],"mappings":";;;;;AAAA;;;GAGG;AACH,kEAAyC;AACzC,8CAAsB;AAEtB,SAAS,OAAO,CAAC,IAAiB,EAAE,IAAa,EAAE,IAAgB;IACjE,IAAI,MAAc,CAAC;IACnB,IAAI,uBAA+B,CAAC;IACpC,OAAO,IAAA,uBAAY,EAAC,IAAI,EAAE,4BAA4B,EAAE;QACtD,KAAK;YACH,IAAI,CAAC,IAAI,EAAE;gBACT,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,IAAI,CAAC;gBAC7C,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;aAC1B;iBAAM;gBACL,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;gBAC3B,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;gBAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;aAC1B;QACH,CAAC;QACD,MAAM;YACJ,IAAI,uBAAuB,EAAE;gBAC3B,aAAG,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;aACrC;YACD,uBAAuB,GAAG,IAAA,aAAG,EAAC,GAAG,EAAE;gBACjC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;gBAC7C,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;YACxC,CAAC,CAAC,CAAC;QACL,CAAC;QACD,GAAG;YACD,IAAI,uBAAuB,EAAE;gBAC3B,aAAG,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;aACrC;YACD,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;YACvB,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;YACxB,IAAI,EAAE,CAAC;QACT,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,KAAK,CAAC,IAAiB,EAAE,IAAgB;QACvC,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IACD,KAAK,CAAC,IAAiB,EAAE,IAAgB;QACvC,OAAO,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,MAAM,CAAC,IAAiB,EAAE,IAAgB;QACxC,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;CACF,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n * Deprecated. We should replace the animation with pure react motion instead of modify style directly.\n * If you are creating new component with animation, please use `./motion`.\n */\nimport cssAnimation from 'css-animation';\nimport raf from 'raf';\n\nfunction animate(node: HTMLElement, show: boolean, done: () => void) {\n let height: number;\n let requestAnimationFrameId: number;\n return cssAnimation(node, 'ant-motion-collapse-legacy', {\n start() {\n if (!show) {\n node.style.height = `${node.offsetHeight}px`;\n node.style.opacity = '1';\n } else {\n height = node.offsetHeight;\n node.style.height = '0px';\n node.style.opacity = '0';\n }\n },\n active() {\n if (requestAnimationFrameId) {\n raf.cancel(requestAnimationFrameId);\n }\n requestAnimationFrameId = raf(() => {\n node.style.height = `${show ? height : 0}px`;\n node.style.opacity = show ? '1' : '0';\n });\n },\n end() {\n if (requestAnimationFrameId) {\n raf.cancel(requestAnimationFrameId);\n }\n node.style.height = '';\n node.style.opacity = '';\n done();\n },\n });\n}\n\nconst animation = {\n enter(node: HTMLElement, done: () => void) {\n return animate(node, true, done);\n },\n leave(node: HTMLElement, done: () => void) {\n return animate(node, false, done);\n },\n appear(node: HTMLElement, done: () => void) {\n return animate(node, true, done);\n },\n};\n\nexport default animation;\n"]}
|
package/lib/_util/raf.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface RafMap {
|
|
2
|
-
[id: number]: number;
|
|
3
|
-
}
|
|
4
|
-
declare function wrapperRaf(callback: () => void, delayFrames?: number): number;
|
|
5
|
-
declare namespace wrapperRaf {
|
|
6
|
-
var cancel: (pid?: number | undefined) => void;
|
|
7
|
-
var ids: RafMap;
|
|
8
|
-
}
|
|
9
|
-
export default wrapperRaf;
|
|
10
|
-
//# sourceMappingURL=raf.d.ts.map
|
package/lib/_util/raf.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"raf.d.ts","sourceRoot":"","sources":["../../src/_util/raf.ts"],"names":[],"mappings":"AAEA,UAAU,MAAM;IACd,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;AAMD,iBAAwB,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,WAAW,GAAE,MAAU,GAAG,MAAM,CAkBxF;kBAlBuB,UAAU;;;;eAAV,UAAU"}
|
package/lib/_util/raf.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const raf_1 = __importDefault(require("raf"));
|
|
7
|
-
let id = 0;
|
|
8
|
-
const ids = {};
|
|
9
|
-
// Support call raf with delay specified frame
|
|
10
|
-
function wrapperRaf(callback, delayFrames = 1) {
|
|
11
|
-
const myId = id++;
|
|
12
|
-
let restFrames = delayFrames;
|
|
13
|
-
function internalCallback() {
|
|
14
|
-
restFrames -= 1;
|
|
15
|
-
if (restFrames <= 0) {
|
|
16
|
-
callback();
|
|
17
|
-
delete ids[myId];
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
ids[myId] = (0, raf_1.default)(internalCallback);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
ids[myId] = (0, raf_1.default)(internalCallback);
|
|
24
|
-
return myId;
|
|
25
|
-
}
|
|
26
|
-
exports.default = wrapperRaf;
|
|
27
|
-
wrapperRaf.cancel = function cancel(pid) {
|
|
28
|
-
if (pid === undefined)
|
|
29
|
-
return;
|
|
30
|
-
raf_1.default.cancel(ids[pid]);
|
|
31
|
-
delete ids[pid];
|
|
32
|
-
};
|
|
33
|
-
wrapperRaf.ids = ids; // export this for test usage
|
|
34
|
-
//# sourceMappingURL=raf.js.map
|
package/lib/_util/raf.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"raf.js","sourceRoot":"","sources":["../../src/_util/raf.ts"],"names":[],"mappings":";;;;;AAAA,8CAAsB;AAMtB,IAAI,EAAE,GAAW,CAAC,CAAC;AACnB,MAAM,GAAG,GAAW,EAAE,CAAC;AAEvB,8CAA8C;AAC9C,SAAwB,UAAU,CAAC,QAAoB,EAAE,cAAsB,CAAC;IAC9E,MAAM,IAAI,GAAW,EAAE,EAAE,CAAC;IAC1B,IAAI,UAAU,GAAW,WAAW,CAAC;IAErC,SAAS,gBAAgB;QACvB,UAAU,IAAI,CAAC,CAAC;QAEhB,IAAI,UAAU,IAAI,CAAC,EAAE;YACnB,QAAQ,EAAE,CAAC;YACX,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;SAClB;aAAM;YACL,GAAG,CAAC,IAAI,CAAC,GAAG,IAAA,aAAG,EAAC,gBAAgB,CAAC,CAAC;SACnC;IACH,CAAC;IAED,GAAG,CAAC,IAAI,CAAC,GAAG,IAAA,aAAG,EAAC,gBAAgB,CAAC,CAAC;IAElC,OAAO,IAAI,CAAC;AACd,CAAC;AAlBD,6BAkBC;AAED,UAAU,CAAC,MAAM,GAAG,SAAS,MAAM,CAAC,GAAY;IAC9C,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO;IAE9B,aAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AAClB,CAAC,CAAC;AAEF,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,6BAA6B","sourcesContent":["import raf from 'raf';\n\ninterface RafMap {\n [id: number]: number;\n}\n\nlet id: number = 0;\nconst ids: RafMap = {};\n\n// Support call raf with delay specified frame\nexport default function wrapperRaf(callback: () => void, delayFrames: number = 1): number {\n const myId: number = id++;\n let restFrames: number = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = raf(internalCallback);\n }\n }\n\n ids[myId] = raf(internalCallback);\n\n return myId;\n}\n\nwrapperRaf.cancel = function cancel(pid?: number) {\n if (pid === undefined) return;\n\n raf.cancel(ids[pid]);\n delete ids[pid];\n};\n\nwrapperRaf.ids = ids; // export this for test usage\n"]}
|
package/lib/_util/reactNode.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reactNode.d.ts","sourceRoot":"","sources":["../../src/_util/reactNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,wBAAgB,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,QAAQ,EAAE,GAAG,EAAE,yBAIxE"}
|
package/lib/_util/reactNode.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.cloneElement = void 0;
|
|
23
|
-
const React = __importStar(require("react"));
|
|
24
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
25
|
-
function cloneElement(element, ...restArgs) {
|
|
26
|
-
if (!React.isValidElement(element))
|
|
27
|
-
return element;
|
|
28
|
-
return React.cloneElement(element, ...restArgs);
|
|
29
|
-
}
|
|
30
|
-
exports.cloneElement = cloneElement;
|
|
31
|
-
//# sourceMappingURL=reactNode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reactNode.js","sourceRoot":"","sources":["../../src/_util/reactNode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B,wDAAwD;AACxD,SAAgB,YAAY,CAAC,OAAwB,EAAE,GAAG,QAAe;IACvE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IAEnD,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,CAAC;AAClD,CAAC;AAJD,oCAIC","sourcesContent":["import * as React from 'react';\n\n// eslint-disable-next-line import/prefer-default-export\nexport function cloneElement(element: React.ReactNode, ...restArgs: any[]) {\n if (!React.isValidElement(element)) return element;\n\n return React.cloneElement(element, ...restArgs);\n}\n"]}
|
package/lib/_util/ref.d.ts
DELETED
package/lib/_util/ref.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ref.d.ts","sourceRoot":"","sources":["../../src/_util/ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,QAMpD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAMnE"}
|
package/lib/_util/ref.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.composeRef = exports.fillRef = void 0;
|
|
4
|
-
require("react");
|
|
5
|
-
function fillRef(ref, node) {
|
|
6
|
-
if (typeof ref === 'function') {
|
|
7
|
-
ref(node);
|
|
8
|
-
}
|
|
9
|
-
else if (typeof ref === 'object' && ref && 'current' in ref) {
|
|
10
|
-
ref.current = node;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.fillRef = fillRef;
|
|
14
|
-
function composeRef(...refs) {
|
|
15
|
-
return (node) => {
|
|
16
|
-
refs.forEach(ref => {
|
|
17
|
-
fillRef(ref, node);
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
exports.composeRef = composeRef;
|
|
22
|
-
//# sourceMappingURL=ref.js.map
|
package/lib/_util/ref.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../src/_util/ref.ts"],"names":[],"mappings":";;;AAAA,iBAA0B;AAE1B,SAAgB,OAAO,CAAI,GAAiB,EAAE,IAAO;IACnD,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;QAC7B,GAAG,CAAC,IAAI,CAAC,CAAC;KACX;SAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,EAAE;QAC5D,GAAW,CAAC,OAAO,GAAG,IAAI,CAAC;KAC7B;AACH,CAAC;AAND,0BAMC;AAED,SAAgB,UAAU,CAAI,GAAG,IAAoB;IACnD,OAAO,CAAC,IAAO,EAAE,EAAE;QACjB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACjB,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAND,gCAMC","sourcesContent":["import React from 'react';\n\nexport function fillRef<T>(ref: React.Ref<T>, node: T) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (typeof ref === 'object' && ref && 'current' in ref) {\n (ref as any).current = node;\n }\n}\n\nexport function composeRef<T>(...refs: React.Ref<T>[]): React.Ref<T> {\n return (node: T) => {\n refs.forEach(ref => {\n fillRef(ref, node);\n });\n };\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
|
|
2
|
-
export declare type BreakpointMap = Partial<Record<Breakpoint, string>>;
|
|
3
|
-
export declare const responsiveArray: Breakpoint[];
|
|
4
|
-
export declare const responsiveMap: BreakpointMap;
|
|
5
|
-
declare type SubscribeFunc = (screens: BreakpointMap) => void;
|
|
6
|
-
declare const responsiveObserve: {
|
|
7
|
-
dispatch(pointMap: BreakpointMap): boolean;
|
|
8
|
-
subscribe(func: SubscribeFunc): string;
|
|
9
|
-
unsubscribe(token: string): void;
|
|
10
|
-
unregister(): void;
|
|
11
|
-
register(): void;
|
|
12
|
-
};
|
|
13
|
-
export default responsiveObserve;
|
|
14
|
-
//# sourceMappingURL=responsiveObserve.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responsiveObserve.d.ts","sourceRoot":"","sources":["../../src/_util/responsiveObserve.ts"],"names":[],"mappings":"AAoBA,oBAAY,UAAU,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAClE,oBAAY,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAEhE,eAAO,MAAM,eAAe,EAAE,UAAU,EAA0C,CAAC;AAEnF,eAAO,MAAM,aAAa,EAAE,aAO3B,CAAC;AAEF,aAAK,aAAa,GAAG,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;AAStD,QAAA,MAAM,iBAAiB;uBACF,aAAa;oBAYhB,aAAa;uBAYV,MAAM;;;CAiC1B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.responsiveMap = exports.responsiveArray = void 0;
|
|
4
|
-
// matchMedia polyfill for
|
|
5
|
-
// https://github.com/WickyNilliams/enquire.js/issues/82
|
|
6
|
-
let enquire;
|
|
7
|
-
// TODO: Will be removed in antd 4.0 because we will no longer support ie9
|
|
8
|
-
if (typeof window !== 'undefined') {
|
|
9
|
-
const matchMediaPolyfill = (mediaQuery) => {
|
|
10
|
-
return {
|
|
11
|
-
media: mediaQuery,
|
|
12
|
-
matches: false,
|
|
13
|
-
addListener() { },
|
|
14
|
-
removeListener() { },
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
// ref: https://github.com/ant-design/ant-design/issues/18774
|
|
18
|
-
if (!window.matchMedia)
|
|
19
|
-
window.matchMedia = matchMediaPolyfill;
|
|
20
|
-
// eslint-disable-next-line global-require
|
|
21
|
-
enquire = require('enquire.js');
|
|
22
|
-
}
|
|
23
|
-
exports.responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
|
|
24
|
-
exports.responsiveMap = {
|
|
25
|
-
xs: '(max-width: 575px)',
|
|
26
|
-
sm: '(min-width: 576px)',
|
|
27
|
-
md: '(min-width: 768px)',
|
|
28
|
-
lg: '(min-width: 992px)',
|
|
29
|
-
xl: '(min-width: 1200px)',
|
|
30
|
-
xxl: '(min-width: 1600px)',
|
|
31
|
-
};
|
|
32
|
-
let subscribers = [];
|
|
33
|
-
let subUid = -1;
|
|
34
|
-
let screens = {};
|
|
35
|
-
const responsiveObserve = {
|
|
36
|
-
dispatch(pointMap) {
|
|
37
|
-
screens = pointMap;
|
|
38
|
-
if (subscribers.length < 1) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
subscribers.forEach(item => {
|
|
42
|
-
item.func(screens);
|
|
43
|
-
});
|
|
44
|
-
return true;
|
|
45
|
-
},
|
|
46
|
-
subscribe(func) {
|
|
47
|
-
if (subscribers.length === 0) {
|
|
48
|
-
this.register();
|
|
49
|
-
}
|
|
50
|
-
const token = (++subUid).toString();
|
|
51
|
-
subscribers.push({
|
|
52
|
-
token,
|
|
53
|
-
func,
|
|
54
|
-
});
|
|
55
|
-
func(screens);
|
|
56
|
-
return token;
|
|
57
|
-
},
|
|
58
|
-
unsubscribe(token) {
|
|
59
|
-
subscribers = subscribers.filter(item => item.token !== token);
|
|
60
|
-
if (subscribers.length === 0) {
|
|
61
|
-
this.unregister();
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
unregister() {
|
|
65
|
-
Object.keys(exports.responsiveMap).map((screen) => enquire.unregister(exports.responsiveMap[screen]));
|
|
66
|
-
},
|
|
67
|
-
register() {
|
|
68
|
-
Object.keys(exports.responsiveMap).map((screen) => enquire.register(exports.responsiveMap[screen], {
|
|
69
|
-
match: () => {
|
|
70
|
-
const pointMap = Object.assign(Object.assign({}, screens), { [screen]: true });
|
|
71
|
-
this.dispatch(pointMap);
|
|
72
|
-
},
|
|
73
|
-
unmatch: () => {
|
|
74
|
-
const pointMap = Object.assign(Object.assign({}, screens), { [screen]: false });
|
|
75
|
-
this.dispatch(pointMap);
|
|
76
|
-
},
|
|
77
|
-
// Keep a empty destory to avoid triggering unmatch when unregister
|
|
78
|
-
destroy() { },
|
|
79
|
-
}));
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
exports.default = responsiveObserve;
|
|
83
|
-
//# sourceMappingURL=responsiveObserve.js.map
|