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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) rookie
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# 组件介绍
|
|
2
|
+
tntd是基于 TNT Design 设计体系的 React UI 组件库,主要用于研发企业级中后台产品。
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## 如何从 `tntd v1.0` 迁移到 `tntd v2.0`
|
|
6
|
+
|
|
7
|
+
### 安装 `tntd` 最新版本
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install tntd
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### 更改配置
|
|
14
|
+
|
|
15
|
+
1. 添加 .babelrc 中的 import 插件配置,实现按需引入
|
|
16
|
+
|
|
17
|
+
```diff title=".babelrc"
|
|
18
|
+
+ [
|
|
19
|
+
+ "import",
|
|
20
|
+
+ {
|
|
21
|
+
+ "libraryName": "tntd",
|
|
22
|
+
+ libraryDirectory: 'es',
|
|
23
|
+
+ },
|
|
24
|
+
+ "tntd"
|
|
25
|
+
+ ],
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. 更改 webpack.config.js 中的主题配置
|
|
29
|
+
|
|
30
|
+
```diff title="webpack.config.js"
|
|
31
|
+
{
|
|
32
|
+
loader: "less-loader",
|
|
33
|
+
options: {
|
|
34
|
+
javascriptEnabled: true,
|
|
35
|
+
...
|
|
36
|
+
modifyVars: {
|
|
37
|
+
- hack: "true; @import \"~@tntd/antd-cover/tnt.less\";"
|
|
38
|
+
+ hack: "true; @import \"~tntd/themes/default/variables.less\";"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
3. 修改导入名称
|
|
45
|
+
|
|
46
|
+
Layout, Icon, Select 等 tntd 1.0 组件和 antd 组件名称存在冲突,请按下方例子进行重命名:
|
|
47
|
+
|
|
48
|
+
```diff
|
|
49
|
+
- import { Layout, Icon, Select } from 'tntd'
|
|
50
|
+
+ import { TntdLayout, TntdIcon, TntdSelect } from 'tntd'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
4. 更改配置
|
|
54
|
+
|
|
55
|
+
```jsx
|
|
56
|
+
// 使用全新的空状态插画
|
|
57
|
+
import { renderEmpty } from 'tntd'
|
|
58
|
+
// 使用内置语言包替换 antd
|
|
59
|
+
// 英文语言包
|
|
60
|
+
const enUS = import 'tntd/es/locale/en_US'
|
|
61
|
+
// 中文语言包
|
|
62
|
+
const zhCN = import 'tntd/es/locale/zh_CN'
|
|
63
|
+
|
|
64
|
+
export const App = () => {
|
|
65
|
+
return (
|
|
66
|
+
// 使用空状态插画及语言包
|
|
67
|
+
<ConfigProvider locale={zhCN} renderEmpty={renderEmpty}>
|
|
68
|
+
...
|
|
69
|
+
</ConfigProvider>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.less';
|
|
4
|
+
const ProCardActions = (props) => {
|
|
5
|
+
const { actions, prefixCls } = props;
|
|
6
|
+
if (Array.isArray(actions) && (actions === null || actions === void 0 ? void 0 : actions.length)) {
|
|
7
|
+
return (React.createElement("ul", { className: classNames(`${prefixCls}-actions`) }, actions.map((action, index) => (React.createElement("li", { style: { width: `${100 / actions.length}%`, padding: 0, margin: 0 }, key: `action-${index}`, className: classNames(`${prefixCls}-actions-item`) }, action)))));
|
|
8
|
+
}
|
|
9
|
+
return React.createElement("ul", { className: classNames(`${prefixCls}-actions`) }, actions);
|
|
10
|
+
};
|
|
11
|
+
export default ProCardActions;
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,cAAc,CAAA;AAarB,MAAM,cAAc,GAAkC,CAAC,KAAK,EAAE,EAAE;IAC9D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAEpC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAA,EAAE;QAC7C,OAAO,CACL,4BAAI,SAAS,EAAE,UAAU,CAAC,GAAG,SAAS,UAAU,CAAC,IAC9C,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,4BACE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EACnE,GAAG,EAAE,UAAU,KAAK,EAAE,EACtB,SAAS,EAAE,UAAU,CAAC,GAAG,SAAS,eAAe,CAAC,IAEjD,MAAM,CACJ,CACN,CAAC,CACC,CACN,CAAA;KACF;IACD,OAAO,4BAAI,SAAS,EAAE,UAAU,CAAC,GAAG,SAAS,UAAU,CAAC,IAAG,OAAO,CAAM,CAAA;AAC1E,CAAC,CAAA;AAED,eAAe,cAAc,CAAA","sourcesContent":["import classNames from 'classnames'\nimport React from 'react'\nimport './index.less'\n\nexport interface ProCardActionsProps {\n /**\n * 自定义前缀\n *\n * @ignore\n */\n prefixCls?: string\n /** 操作按钮 */\n actions?: React.ReactNode[] | React.ReactNode\n}\n\nconst ProCardActions: React.FC<ProCardActionsProps> = (props) => {\n const { actions, prefixCls } = props\n\n if (Array.isArray(actions) && actions?.length) {\n return (\n <ul className={classNames(`${prefixCls}-actions`)}>\n {actions.map((action, index) => (\n <li\n style={{ width: `${100 / actions.length}%`, padding: 0, margin: 0 }}\n key={`action-${index}`}\n className={classNames(`${prefixCls}-actions-item`)}\n >\n {action}\n </li>\n ))}\n </ul>\n )\n }\n return <ul className={classNames(`${prefixCls}-actions`)}>{actions}</ul>\n}\n\nexport default ProCardActions\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.tntd-card-actions {
|
|
2
|
+
margin-block:0;
|
|
3
|
+
margin-inline:0;
|
|
4
|
+
padding-block:0;
|
|
5
|
+
padding-inline:0;
|
|
6
|
+
list-style:none;
|
|
7
|
+
display:flex;
|
|
8
|
+
gap:8px;
|
|
9
|
+
background:#ffffff;
|
|
10
|
+
border-block-start:1px solid rgba(5,5,5,0.06);
|
|
11
|
+
min-height:42px;
|
|
12
|
+
}
|
|
13
|
+
.tntd-card-actions>* {
|
|
14
|
+
align-items:center;
|
|
15
|
+
justify-content:center;
|
|
16
|
+
flex:1;
|
|
17
|
+
display:flex;
|
|
18
|
+
cursor:pointer;
|
|
19
|
+
color:rgba(42,46,54,0.65);
|
|
20
|
+
transition:color 0.3s;
|
|
21
|
+
}
|
|
22
|
+
.tntd-card-actions>*:hover {
|
|
23
|
+
color:#468fff;
|
|
24
|
+
}
|
|
25
|
+
.tntd-card-actions>li>div {
|
|
26
|
+
flex:1;
|
|
27
|
+
width:100%;
|
|
28
|
+
margin-block:12px;
|
|
29
|
+
margin-inline:0;
|
|
30
|
+
color:rgba(42,46,54,0.65);
|
|
31
|
+
text-align:center;
|
|
32
|
+
}
|
|
33
|
+
.tntd-card-actions>li>div a {
|
|
34
|
+
color:rgba(42,46,54,0.65);
|
|
35
|
+
transition:color 0.3s;
|
|
36
|
+
}
|
|
37
|
+
.tntd-card-actions>li>div a:hover {
|
|
38
|
+
color:#468fff;
|
|
39
|
+
}
|
|
40
|
+
.tntd-card-actions>li>div div {
|
|
41
|
+
position:relative;
|
|
42
|
+
display:block;
|
|
43
|
+
min-width:32px;
|
|
44
|
+
font-size:14px;
|
|
45
|
+
line-height:1.5714285714285714;
|
|
46
|
+
cursor:pointer;
|
|
47
|
+
}
|
|
48
|
+
.tntd-card-actions>li>div div:hover {
|
|
49
|
+
color:#468fff;
|
|
50
|
+
transition:color 0.3s;
|
|
51
|
+
}
|
|
52
|
+
.tntd-card-actions>li>div div a:not(.ant-btn),
|
|
53
|
+
.tntd-card-actions>li>div div >.anticon {
|
|
54
|
+
display:inline-block;
|
|
55
|
+
width:100%;
|
|
56
|
+
color:rgba(42,46,54,0.65);
|
|
57
|
+
line-height:22px;
|
|
58
|
+
transition:color 0.3s;
|
|
59
|
+
}
|
|
60
|
+
.tntd-card-actions>li>div div a:not(.ant-btn):hover,
|
|
61
|
+
.tntd-card-actions>li>div div >.anticon:hover {
|
|
62
|
+
color:#468fff;
|
|
63
|
+
}
|
|
64
|
+
.tntd-card-actions>li>div div .anticon {
|
|
65
|
+
font-size:16px;
|
|
66
|
+
line-height:22px;
|
|
67
|
+
}
|
|
68
|
+
.tntd-card-actions>li>div:not(:last-child) {
|
|
69
|
+
border-inline-end:1px solid rgba(5,5,5,0.06);
|
|
70
|
+
}
|
package/es/affix/index.js
CHANGED
package/es/alert/index.js
CHANGED
package/es/anchor/index.js
CHANGED
package/es/array-input/icon.js
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export const plusIcon = React.createElement("svg", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
fill: "currentColor",
|
|
9
|
-
"aria-hidden": "true"
|
|
10
|
-
}, React.createElement("path", {
|
|
11
|
-
d: "M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"
|
|
12
|
-
}), React.createElement("path", {
|
|
13
|
-
d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
|
|
14
|
-
}));
|
|
15
|
-
export const deleteIcon = React.createElement("svg", {
|
|
16
|
-
viewBox: "64 64 896 896",
|
|
17
|
-
focusable: "false",
|
|
18
|
-
"data-icon": "delete",
|
|
19
|
-
width: "1em",
|
|
20
|
-
height: "1em",
|
|
21
|
-
fill: "currentColor",
|
|
22
|
-
"aria-hidden": "true"
|
|
23
|
-
}, React.createElement("path", {
|
|
24
|
-
d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
|
|
25
|
-
}));
|
|
2
|
+
export const plusIcon = (React.createElement("svg", { viewBox: "64 64 896 896", focusable: "false", "data-icon": "plus-circle", width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" },
|
|
3
|
+
React.createElement("path", { d: "M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" }),
|
|
4
|
+
React.createElement("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" })));
|
|
5
|
+
export const deleteIcon = (React.createElement("svg", { viewBox: "64 64 896 896", focusable: "false", "data-icon": "delete", width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" },
|
|
6
|
+
React.createElement("path", { d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z" })));
|
|
7
|
+
//# sourceMappingURL=icon.js.map
|
package/es/array-input/index.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
14
11
|
};
|
|
12
|
+
import { get, isArray, isFunction, set, sum, sumBy } from 'lodash';
|
|
15
13
|
import React, { isValidElement, useCallback, useEffect, useState } from 'react';
|
|
16
14
|
import { deleteIcon, plusIcon } from './icon';
|
|
17
15
|
import Col from '../col';
|
|
@@ -19,198 +17,116 @@ import Row from '../row';
|
|
|
19
17
|
import Table from '../table';
|
|
20
18
|
import Tooltip from '../tooltip';
|
|
21
19
|
import './index.less';
|
|
22
|
-
const {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
children,
|
|
28
|
-
defaultValue,
|
|
29
|
-
value,
|
|
30
|
-
onChange,
|
|
31
|
-
mode = 'list',
|
|
32
|
-
gutter = 10,
|
|
33
|
-
require = false,
|
|
34
|
-
deleteTip = '',
|
|
35
|
-
plusTip = '',
|
|
36
|
-
addText = '添加'
|
|
37
|
-
}) {
|
|
38
|
-
if (!_isFunction(children)) {
|
|
39
|
-
throw new Error('ArrayInput的children必须是函数');
|
|
40
|
-
}
|
|
41
|
-
const [_value, setValue] = useState(value || defaultValue);
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
setValue(value);
|
|
44
|
-
}, [value]);
|
|
45
|
-
const _onChange = useCallback(value => {
|
|
46
|
-
if (onChange) {
|
|
47
|
-
onChange(value);
|
|
48
|
-
} else {
|
|
49
|
-
setValue(value);
|
|
20
|
+
const { Column } = Table;
|
|
21
|
+
const getWidth = (span) => 1000 / span;
|
|
22
|
+
export default function ArrayInput({ children, defaultValue, value, onChange, mode = 'list', gutter = 10, require = false, deleteTip = '', plusTip = '', addText = '添加', }) {
|
|
23
|
+
if (!isFunction(children)) {
|
|
24
|
+
throw new Error('ArrayInput的children必须是函数');
|
|
50
25
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
inValue.splice(index + 1, 0, {});
|
|
67
|
-
_onChange([...inValue]);
|
|
26
|
+
const [_value, setValue] = useState(value || defaultValue);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
setValue(value);
|
|
29
|
+
}, [value]);
|
|
30
|
+
const _onChange = useCallback((value) => {
|
|
31
|
+
if (onChange) {
|
|
32
|
+
onChange(value);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
setValue(value);
|
|
36
|
+
}
|
|
37
|
+
}, []);
|
|
38
|
+
let inValue = _value || [];
|
|
39
|
+
if (require && inValue.length === 0) {
|
|
40
|
+
inValue = [{}];
|
|
68
41
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
className: "tntd-array-input"
|
|
77
|
-
}, inValue.map((item, index) => {
|
|
78
|
-
let fields = children(item, index);
|
|
79
|
-
if (!_isArray(fields)) {
|
|
80
|
-
fields = _get(fields, 'props.children', []);
|
|
81
|
-
}
|
|
82
|
-
return React.createElement(Row, {
|
|
83
|
-
gutter: gutter,
|
|
84
|
-
key: index,
|
|
85
|
-
className: "tntd-array-input-item"
|
|
86
|
-
}, fields.map((field, i) => {
|
|
87
|
-
if (!isValidElement(field)) {
|
|
88
|
-
return field ? React.createElement(Col, {
|
|
89
|
-
span: 4,
|
|
90
|
-
key: i
|
|
91
|
-
}, field) : '';
|
|
42
|
+
const changeValue = (index, name, value) => {
|
|
43
|
+
inValue[index] = Object.assign(Object.assign({}, inValue[index]), { [name]: value });
|
|
44
|
+
_onChange([...inValue]);
|
|
45
|
+
};
|
|
46
|
+
const onAdd = (index) => {
|
|
47
|
+
if (index === undefined) {
|
|
48
|
+
_onChange([...inValue, {}]);
|
|
92
49
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}, deleteIcon)) : React.createElement("span", {
|
|
130
|
-
onClick: () => onDelete(index)
|
|
131
|
-
}, deleteIcon))));
|
|
132
|
-
}), inValue.length === 0 && React.createElement("a", {
|
|
133
|
-
onClick: () => onAdd()
|
|
134
|
-
}, addText));
|
|
135
|
-
} else {
|
|
136
|
-
let fields = children({}, 0);
|
|
137
|
-
if (!_isArray(fields)) {
|
|
138
|
-
fields = _get(fields, 'props.children', []);
|
|
50
|
+
else {
|
|
51
|
+
inValue.splice(index + 1, 0, {});
|
|
52
|
+
_onChange([...inValue]);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const onDelete = (i) => {
|
|
56
|
+
inValue.splice(i, 1);
|
|
57
|
+
_onChange([...inValue]);
|
|
58
|
+
};
|
|
59
|
+
if (mode === 'list') {
|
|
60
|
+
return (React.createElement("div", { className: "tntd-array-input" },
|
|
61
|
+
inValue.map((item, index) => {
|
|
62
|
+
let fields = children(item, index);
|
|
63
|
+
if (!isArray(fields)) {
|
|
64
|
+
fields = get(fields, 'props.children', []);
|
|
65
|
+
}
|
|
66
|
+
return (React.createElement(Row, { gutter: gutter, key: index, className: "tntd-array-input-item" },
|
|
67
|
+
fields.map((field, i) => {
|
|
68
|
+
if (!isValidElement(field)) {
|
|
69
|
+
return field ? (React.createElement(Col, { span: 4, key: i }, field)) : ('');
|
|
70
|
+
}
|
|
71
|
+
const _a = field === null || field === void 0 ? void 0 : field.props, { name, span = 4, onChange: fieldChange } = _a, other = __rest(_a, ["name", "span", "onChange"]);
|
|
72
|
+
return (React.createElement(Col, { span: span, key: i }, React.cloneElement(field, Object.assign({ value: item[name] || undefined, onChange: (e) => {
|
|
73
|
+
fieldChange && fieldChange(e, index, changeValue);
|
|
74
|
+
const newValue = e.target ? e.target.value : e;
|
|
75
|
+
changeValue(index, name, newValue);
|
|
76
|
+
} }, other))));
|
|
77
|
+
}),
|
|
78
|
+
React.createElement(Col, { span: 24 - (sum(fields.map((f) => get(f, 'props.span', 4))) % 24) },
|
|
79
|
+
React.createElement("span", { className: "tntd-array-input-action" },
|
|
80
|
+
plusTip ? (React.createElement(Tooltip, { title: plusTip, placement: "left" },
|
|
81
|
+
React.createElement("span", { className: "mr10", onClick: () => onAdd(index) }, plusIcon))) : (React.createElement("span", { className: "mr10", onClick: () => onAdd(index) }, plusIcon)),
|
|
82
|
+
deleteTip ? (React.createElement(Tooltip, { title: deleteTip, placement: "right" },
|
|
83
|
+
React.createElement("span", { onClick: () => onDelete(index) }, deleteIcon))) : (React.createElement("span", { onClick: () => onDelete(index) }, deleteIcon))))));
|
|
84
|
+
}),
|
|
85
|
+
inValue.length === 0 && React.createElement("a", { onClick: () => onAdd() }, addText)));
|
|
139
86
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
var _a;
|
|
145
|
-
const name = (_a = field === null || field === void 0 ? void 0 : field.props) === null || _a === void 0 ? void 0 : _a.name;
|
|
146
|
-
name && _set(back, name, field);
|
|
147
|
-
});
|
|
148
|
-
return back;
|
|
149
|
-
});
|
|
150
|
-
return React.createElement("div", {
|
|
151
|
-
className: "tntd-array-input"
|
|
152
|
-
}, React.createElement(Table, {
|
|
153
|
-
dataSource: dataSource,
|
|
154
|
-
pagination: false,
|
|
155
|
-
locale: {
|
|
156
|
-
emptyText: React.createElement("a", {
|
|
157
|
-
onClick: () => onAdd()
|
|
158
|
-
}, addText)
|
|
159
|
-
}
|
|
160
|
-
}, fields.map(field => {
|
|
161
|
-
const {
|
|
162
|
-
name,
|
|
163
|
-
span,
|
|
164
|
-
title
|
|
165
|
-
} = (field === null || field === void 0 ? void 0 : field.props) || {};
|
|
166
|
-
return React.createElement(Column, {
|
|
167
|
-
key: name,
|
|
168
|
-
dataIndex: name,
|
|
169
|
-
title: title,
|
|
170
|
-
width: getWidth(span || 24 / (fields.length + 1)),
|
|
171
|
-
render: (field, row, index) => {
|
|
172
|
-
if (!isValidElement(field)) {
|
|
173
|
-
return field;
|
|
174
|
-
}
|
|
175
|
-
const {
|
|
176
|
-
onChange: fieldChange
|
|
177
|
-
} = field.props;
|
|
178
|
-
return React.cloneElement(field, {
|
|
179
|
-
value: inValue[index][name] || undefined,
|
|
180
|
-
onChange: e => {
|
|
181
|
-
fieldChange && fieldChange(e, index, changeValue);
|
|
182
|
-
const newValue = e.target ? e.target.value : e;
|
|
183
|
-
changeValue(index, name, newValue);
|
|
184
|
-
}
|
|
185
|
-
});
|
|
87
|
+
else {
|
|
88
|
+
let fields = children({}, 0);
|
|
89
|
+
if (!isArray(fields)) {
|
|
90
|
+
fields = get(fields, 'props.children', []);
|
|
186
91
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
92
|
+
const dataSource = inValue.map((value, index) => {
|
|
93
|
+
const fields = children(value, index);
|
|
94
|
+
const back = {};
|
|
95
|
+
fields.forEach((field) => {
|
|
96
|
+
var _a;
|
|
97
|
+
const name = (_a = field === null || field === void 0 ? void 0 : field.props) === null || _a === void 0 ? void 0 : _a.name;
|
|
98
|
+
name && set(back, name, field);
|
|
99
|
+
});
|
|
100
|
+
return back;
|
|
101
|
+
});
|
|
102
|
+
return (React.createElement("div", { className: "tntd-array-input" },
|
|
103
|
+
React.createElement(Table, { dataSource: dataSource, pagination: false, locale: {
|
|
104
|
+
emptyText: React.createElement("a", { onClick: () => onAdd() }, addText),
|
|
105
|
+
} },
|
|
106
|
+
fields.map((field) => {
|
|
107
|
+
const { name, span, title } = (field === null || field === void 0 ? void 0 : field.props) || {};
|
|
108
|
+
return (React.createElement(Column, { key: name, dataIndex: name, title: title, width: getWidth(span || 24 / (fields.length + 1)), render: (field, row, index) => {
|
|
109
|
+
if (!isValidElement(field)) {
|
|
110
|
+
return field;
|
|
111
|
+
}
|
|
112
|
+
const { onChange: fieldChange } = field.props;
|
|
113
|
+
return React.cloneElement(field, {
|
|
114
|
+
value: inValue[index][name] || undefined,
|
|
115
|
+
onChange: (e) => {
|
|
116
|
+
fieldChange && fieldChange(e, index, changeValue);
|
|
117
|
+
const newValue = e.target ? e.target.value : e;
|
|
118
|
+
changeValue(index, name, newValue);
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
} }));
|
|
122
|
+
}),
|
|
123
|
+
React.createElement(Column, { key: "action", dataIndex: "action", title: "\u64CD\u4F5C", width: getWidth(24 - (sumBy(fields, 'props.span') % 24)), render: (text, row, index) => {
|
|
124
|
+
return (React.createElement("span", { className: "tntd-array-input-action" },
|
|
125
|
+
plusTip ? (React.createElement(Tooltip, { title: plusTip, placement: "left" },
|
|
126
|
+
React.createElement("span", { className: "mr10", onClick: () => onAdd(index) }, plusIcon))) : (React.createElement("span", { className: "mr10", onClick: () => onAdd(index) }, plusIcon)),
|
|
127
|
+
deleteTip ? (React.createElement(Tooltip, { title: deleteTip, placement: "right" },
|
|
128
|
+
React.createElement("span", { onClick: () => onDelete(index) }, deleteIcon))) : (React.createElement("span", { onClick: () => onDelete(index) }, deleteIcon))));
|
|
129
|
+
} }))));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=index.js.map
|
package/es/auth-context/index.js
CHANGED
package/es/avatar/index.js
CHANGED
package/es/back-top/index.js
CHANGED
package/es/badge/index.js
CHANGED
package/es/breadcrumb/index.js
CHANGED
package/es/button/index.js
CHANGED
package/es/calendar/index.js
CHANGED