tntd 2.6.7 → 2.7.1
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/es/_util/colors.js +3 -0
- package/es/_util/colors.js.map +1 -0
- package/es/_util/easings.js +9 -0
- package/es/_util/easings.js.map +1 -0
- package/es/_util/getDataOrAriaProps.js +8 -0
- package/es/_util/getDataOrAriaProps.js.map +1 -0
- package/es/_util/getScroll.js +14 -0
- package/es/_util/getScroll.js.map +1 -0
- package/es/_util/interopDefault.js +5 -0
- package/es/_util/interopDefault.js.map +1 -0
- package/es/_util/isNumeric.js +4 -0
- package/es/_util/isNumeric.js.map +1 -0
- package/es/_util/motion.js +22 -0
- package/es/_util/motion.js.map +1 -0
- package/es/_util/openAnimation.js +51 -0
- package/es/_util/openAnimation.js.map +1 -0
- package/es/_util/raf.js +25 -0
- package/es/_util/raf.js.map +1 -0
- package/es/_util/reactNode.js +6 -0
- package/es/_util/reactNode.js.map +1 -0
- package/es/_util/ref.js +15 -0
- package/es/_util/ref.js.map +1 -0
- package/es/_util/responsiveObserve.js +82 -0
- package/es/_util/responsiveObserve.js.map +1 -0
- package/es/_util/scrollTo.js +29 -0
- package/es/_util/scrollTo.js.map +1 -0
- package/es/_util/styleChecker.js +12 -0
- package/es/_util/styleChecker.js.map +1 -0
- package/es/_util/throttleByAnimationFrame.js +40 -0
- package/es/_util/throttleByAnimationFrame.js.map +1 -0
- package/es/_util/transButton.js +103 -0
- package/es/_util/transButton.js.map +1 -0
- package/es/_util/triggerEvent.js +8 -0
- package/es/_util/triggerEvent.js.map +1 -0
- package/es/_util/type.js +3 -0
- package/es/_util/type.js.map +1 -0
- package/es/_util/warning.js +5 -0
- package/es/_util/warning.js.map +1 -0
- package/es/_util/wave.js +228 -0
- package/es/_util/wave.js.map +1 -0
- package/es/affix/index.js +1 -2
- package/es/alert/index.js +1 -2
- package/es/anchor/index.js +1 -2
- package/es/array-input/icon.js +24 -6
- package/es/array-input/index.js +203 -119
- package/es/auth-context/index.js +1 -2
- package/es/auto-complete/index.js +1 -2
- package/es/avatar/index.js +1 -2
- package/es/back-top/index.js +1 -2
- package/es/badge/index.js +1 -2
- package/es/breadcrumb/index.js +1 -2
- package/es/button/index.js +1 -2
- package/es/calendar/index.js +1 -2
- package/es/card/index.js +1 -2
- package/es/carousel/index.js +1 -2
- package/es/cascader/index.js +6 -3
- package/es/cascader/index.js.map +1 -1
- package/es/checkbox/checkbox-group.js +5 -0
- package/es/checkbox/checkbox-group.js.map +1 -0
- package/es/checkbox/index.js +6 -2
- package/es/checkbox/index.js.map +1 -1
- package/es/col/index.js +1 -2
- package/es/collapse/index.js +1 -2
- package/es/color-picker/ColorPicker.js +126 -80
- package/es/color-picker/index.js +8 -5
- package/es/columns/index.js +66 -30
- package/es/columns/style/index.js +1 -2
- package/es/comment/index.js +1 -2
- package/es/config-provider/DisabledContext.js +12 -0
- package/es/config-provider/DisabledContext.js.map +1 -0
- package/es/config-provider/SizeContext.js +9 -0
- package/es/config-provider/SizeContext.js.map +1 -0
- package/es/config-provider/config-provider.js +1 -2
- package/es/config-provider/context.js +41 -0
- package/es/config-provider/context.js.map +1 -0
- package/es/config-provider/index.js +4 -0
- package/es/config-provider/index.js.map +1 -1
- package/es/connect/index.js +26 -0
- package/es/connect/index.js.map +1 -0
- package/es/date-picker/index.js +11 -1
- package/es/date-picker/index.js.map +1 -1
- package/es/input/input.js +37 -25
- package/es/input/input.js.map +1 -1
- package/es/input-number/index.js +3 -1
- package/es/input-number/index.js.map +1 -1
- package/es/preview-text/index.js +195 -0
- package/es/preview-text/index.js.map +1 -0
- package/es/preview-text/index.less +3 -0
- package/es/query-form/index.js.map +1 -1
- package/es/radio/index.js +3 -0
- package/es/radio/index.js.map +1 -1
- package/es/radio/radio-group.js +6 -0
- package/es/radio/radio-group.js.map +1 -0
- package/es/select/index.js.map +1 -1
- package/es/select/select.js +17 -5
- package/es/select/select.js.map +1 -1
- package/es/switch/index.js +2 -3
- package/es/switch/index.js.map +1 -1
- package/es/switch/switch.js +9 -0
- package/es/switch/switch.js.map +1 -0
- package/es/time-picker/index.js +3 -1
- package/es/time-picker/index.js.map +1 -1
- package/es/tntd-form/ErrorList.js +53 -0
- package/es/tntd-form/ErrorList.js.map +1 -0
- package/es/tntd-form/Form.js +101 -0
- package/es/tntd-form/Form.js.map +1 -0
- package/es/tntd-form/FormItem/ItemHolder.js +135 -0
- package/es/tntd-form/FormItem/ItemHolder.js.map +1 -0
- package/es/tntd-form/FormItem/index.js +238 -0
- package/es/tntd-form/FormItem/index.js.map +1 -0
- package/es/tntd-form/FormItemInput.js +38 -0
- package/es/tntd-form/FormItemInput.js.map +1 -0
- package/es/tntd-form/FormItemLabel.js +73 -0
- package/es/tntd-form/FormItemLabel.js.map +1 -0
- package/es/tntd-form/FormList.js +34 -0
- package/es/tntd-form/FormList.js.map +1 -0
- package/es/tntd-form/TntdForm/components/ItemComp.js +2 -2
- package/es/tntd-form/TntdForm/components/ItemComp.js.map +1 -1
- package/es/tntd-form/__tests__/demo-extend.test.js +3 -0
- package/es/tntd-form/__tests__/demo-extend.test.js.map +1 -0
- package/es/tntd-form/__tests__/demo.test.js +3 -0
- package/es/tntd-form/__tests__/demo.test.js.map +1 -0
- package/es/tntd-form/__tests__/image.test.js +5 -0
- package/es/tntd-form/__tests__/image.test.js.map +1 -0
- package/es/tntd-form/__tests__/index.test.js +957 -0
- package/es/tntd-form/__tests__/index.test.js.map +1 -0
- package/es/tntd-form/__tests__/list-noStyle.test.js +41 -0
- package/es/tntd-form/__tests__/list-noStyle.test.js.map +1 -0
- package/es/tntd-form/__tests__/list.test.js +164 -0
- package/es/tntd-form/__tests__/list.test.js.map +1 -0
- package/es/tntd-form/__tests__/ref.test.js +45 -0
- package/es/tntd-form/__tests__/ref.test.js.map +1 -0
- package/es/tntd-form/__tests__/type.test.js +74 -0
- package/es/tntd-form/__tests__/type.test.js.map +1 -0
- package/es/tntd-form/_util/motion.js +38 -0
- package/es/tntd-form/_util/motion.js.map +1 -0
- package/es/tntd-form/_util/reactNode.js +15 -0
- package/es/tntd-form/_util/reactNode.js.map +1 -0
- package/es/tntd-form/_util/scrollTo.js +35 -0
- package/es/tntd-form/_util/scrollTo.js.map +1 -0
- package/es/tntd-form/_util/type.js +4 -0
- package/es/tntd-form/_util/type.js.map +1 -0
- package/es/tntd-form/_util/warning.js +6 -0
- package/es/tntd-form/_util/warning.js.map +1 -0
- package/es/tntd-form/_util/wave.js +168 -0
- package/es/tntd-form/_util/wave.js.map +1 -0
- package/es/tntd-form/context.js +35 -0
- package/es/tntd-form/context.js.map +1 -0
- package/es/tntd-form/hooks/useDebounce.js +14 -0
- package/es/tntd-form/hooks/useDebounce.js.map +1 -0
- package/es/tntd-form/hooks/useForm.js +35 -0
- package/es/tntd-form/hooks/useForm.js.map +1 -0
- package/es/tntd-form/hooks/useFormInstance.js +7 -0
- package/es/tntd-form/hooks/useFormInstance.js.map +1 -0
- package/es/tntd-form/hooks/useFormItemStatus.js +10 -0
- package/es/tntd-form/hooks/useFormItemStatus.js.map +1 -0
- package/es/tntd-form/hooks/useFrameState.js +38 -0
- package/es/tntd-form/hooks/useFrameState.js.map +1 -0
- package/es/tntd-form/hooks/useItemRef.js +19 -0
- package/es/tntd-form/hooks/useItemRef.js.map +1 -0
- package/es/tntd-form/index.js +17 -1
- package/es/tntd-form/index.js.map +1 -1
- package/es/tntd-form/interface.js +3 -0
- package/es/tntd-form/interface.js.map +1 -0
- package/es/tntd-form/style/components.less +16 -0
- package/es/tntd-form/style/horizontal.less +26 -0
- package/es/tntd-form/style/index.js +6 -0
- package/es/tntd-form/style/index.js.map +1 -0
- package/es/tntd-form/style/index.less +342 -0
- package/es/tntd-form/style/inline.less +40 -0
- package/es/tntd-form/style/mixin.less +90 -0
- package/es/tntd-form/style/rtl.less +204 -0
- package/es/tntd-form/style/status.less +45 -0
- package/es/tntd-form/style/vertical.less +95 -0
- package/es/tntd-form/tntd-form.stories.js +426 -0
- package/es/tntd-form/tntd-form.stories.js.map +1 -0
- package/es/tntd-form/util.js +21 -0
- package/es/tntd-form/util.js.map +1 -0
- package/es/tntd-form/validateMessagesContext.js +6 -0
- package/es/tntd-form/validateMessagesContext.js.map +1 -0
- package/es/tree-select/index.js +4 -1
- package/es/tree-select/index.js.map +1 -1
- package/es/upload/index.js +6 -1
- package/es/upload/index.js.map +1 -1
- package/lib/_util/colors.d.ts +3 -0
- package/lib/_util/colors.d.ts.map +1 -0
- package/lib/_util/colors.js +7 -0
- package/lib/_util/colors.js.map +1 -0
- package/lib/_util/easings.d.ts +2 -0
- package/lib/_util/easings.d.ts.map +1 -0
- package/lib/_util/easings.js +14 -0
- package/lib/_util/easings.js.map +1 -0
- package/lib/_util/getDataOrAriaProps.d.ts +2 -0
- package/lib/_util/getDataOrAriaProps.d.ts.map +1 -0
- package/lib/_util/getDataOrAriaProps.js +13 -0
- package/lib/_util/getDataOrAriaProps.js.map +1 -0
- package/lib/_util/getScroll.d.ts +2 -0
- package/lib/_util/getScroll.d.ts.map +1 -0
- package/lib/_util/getScroll.js +18 -0
- package/lib/_util/getScroll.js.map +1 -0
- package/lib/_util/interopDefault.d.ts +2 -0
- package/lib/_util/interopDefault.d.ts.map +1 -0
- package/lib/_util/interopDefault.js +9 -0
- package/lib/_util/interopDefault.js.map +1 -0
- package/lib/_util/isNumeric.d.ts +3 -0
- package/lib/_util/isNumeric.d.ts.map +1 -0
- package/lib/_util/isNumeric.js +7 -0
- package/lib/_util/isNumeric.js.map +1 -0
- package/lib/_util/motion.d.ts +24 -0
- package/lib/_util/motion.d.ts.map +1 -0
- package/lib/_util/motion.js +17 -0
- package/lib/_util/motion.js.map +1 -0
- package/lib/_util/openAnimation.d.ts +7 -0
- package/lib/_util/openAnimation.d.ts.map +1 -0
- package/lib/_util/openAnimation.js +58 -0
- package/lib/_util/openAnimation.js.map +1 -0
- package/lib/_util/raf.d.ts +10 -0
- package/lib/_util/raf.d.ts.map +1 -0
- package/lib/_util/raf.js +34 -0
- package/lib/_util/raf.js.map +1 -0
- package/lib/_util/reactNode.d.ts +3 -0
- package/lib/_util/reactNode.d.ts.map +1 -0
- package/lib/_util/reactNode.js +31 -0
- package/lib/_util/reactNode.js.map +1 -0
- package/lib/_util/ref.d.ts +4 -0
- package/lib/_util/ref.d.ts.map +1 -0
- package/lib/_util/ref.js +22 -0
- package/lib/_util/ref.js.map +1 -0
- package/lib/_util/responsiveObserve.d.ts +14 -0
- package/lib/_util/responsiveObserve.d.ts.map +1 -0
- package/lib/_util/responsiveObserve.js +83 -0
- package/lib/_util/responsiveObserve.js.map +1 -0
- package/lib/_util/scrollTo.d.ts +11 -0
- package/lib/_util/scrollTo.d.ts.map +1 -0
- package/lib/_util/scrollTo.js +34 -0
- package/lib/_util/scrollTo.js.map +1 -0
- package/lib/_util/styleChecker.d.ts +4 -0
- package/lib/_util/styleChecker.d.ts.map +1 -0
- package/lib/_util/styleChecker.js +14 -0
- package/lib/_util/styleChecker.js.map +1 -0
- package/lib/_util/throttleByAnimationFrame.d.ts +6 -0
- package/lib/_util/throttleByAnimationFrame.d.ts.map +1 -0
- package/lib/_util/throttleByAnimationFrame.js +49 -0
- package/lib/_util/throttleByAnimationFrame.js.map +1 -0
- package/lib/_util/transButton.d.ts +21 -0
- package/lib/_util/transButton.d.ts.map +1 -0
- package/lib/_util/transButton.js +112 -0
- package/lib/_util/transButton.js.map +1 -0
- package/lib/_util/triggerEvent.d.ts +2 -0
- package/lib/_util/triggerEvent.d.ts.map +1 -0
- package/lib/_util/triggerEvent.js +12 -0
- package/lib/_util/triggerEvent.js.map +1 -0
- package/lib/_util/type.d.ts +4 -0
- package/lib/_util/type.d.ts.map +1 -0
- package/lib/_util/type.js +9 -0
- package/lib/_util/type.js.map +1 -0
- package/lib/_util/warning.d.ts +5 -0
- package/lib/_util/warning.d.ts.map +1 -0
- package/lib/_util/warning.js +28 -0
- package/lib/_util/warning.js.map +1 -0
- package/lib/_util/wave.d.ts +26 -0
- package/lib/_util/wave.d.ts.map +1 -0
- package/lib/_util/wave.js +249 -0
- package/lib/_util/wave.js.map +1 -0
- package/lib/affix/index.js +5 -1
- package/lib/affix/index.js.map +1 -1
- package/lib/alert/index.js +5 -1
- package/lib/alert/index.js.map +1 -1
- package/lib/anchor/index.js +5 -1
- package/lib/anchor/index.js.map +1 -1
- package/lib/array-input/index.js +5 -1
- package/lib/array-input/index.js.map +1 -1
- package/lib/auto-complete/index.js +5 -1
- package/lib/auto-complete/index.js.map +1 -1
- package/lib/avatar/index.js +5 -1
- package/lib/avatar/index.js.map +1 -1
- package/lib/back-top/index.js +5 -1
- package/lib/back-top/index.js.map +1 -1
- package/lib/badge/index.js +5 -1
- package/lib/badge/index.js.map +1 -1
- package/lib/breadcrumb/index.js +5 -1
- package/lib/breadcrumb/index.js.map +1 -1
- package/lib/button/index.js +5 -1
- package/lib/button/index.js.map +1 -1
- package/lib/calendar/index.js +5 -1
- package/lib/calendar/index.js.map +1 -1
- package/lib/card/index.js +5 -1
- package/lib/card/index.js.map +1 -1
- package/lib/carousel/index.js +5 -1
- package/lib/carousel/index.js.map +1 -1
- package/lib/cascader/index.d.ts +6 -1
- package/lib/cascader/index.d.ts.map +1 -1
- package/lib/cascader/index.js +11 -2
- package/lib/cascader/index.js.map +1 -1
- package/lib/checkbox/checkbox-group.d.ts +8 -0
- package/lib/checkbox/checkbox-group.d.ts.map +1 -0
- package/lib/checkbox/checkbox-group.js +11 -0
- package/lib/checkbox/checkbox-group.js.map +1 -0
- package/lib/checkbox/index.d.ts +1 -0
- package/lib/checkbox/index.d.ts.map +1 -1
- package/lib/checkbox/index.js +10 -1
- package/lib/checkbox/index.js.map +1 -1
- package/lib/col/index.js +5 -1
- package/lib/col/index.js.map +1 -1
- package/lib/collapse/index.js +5 -1
- package/lib/collapse/index.js.map +1 -1
- package/lib/color-picker/ColorPicker.js +5 -1
- package/lib/color-picker/ColorPicker.js.map +1 -1
- package/lib/comment/index.js +5 -1
- package/lib/comment/index.js.map +1 -1
- package/lib/config-provider/DisabledContext.d.ts +10 -0
- package/lib/config-provider/DisabledContext.d.ts.map +1 -0
- package/lib/config-provider/DisabledContext.js +35 -0
- package/lib/config-provider/DisabledContext.js.map +1 -0
- package/lib/config-provider/SizeContext.d.ts +10 -0
- package/lib/config-provider/SizeContext.d.ts.map +1 -0
- package/lib/config-provider/SizeContext.js +32 -0
- package/lib/config-provider/SizeContext.js.map +1 -0
- package/lib/config-provider/context.d.ts +61 -0
- package/lib/config-provider/context.d.ts.map +1 -0
- package/lib/config-provider/context.js +64 -0
- package/lib/config-provider/context.js.map +1 -0
- package/lib/config-provider/index.d.ts +1 -0
- package/lib/config-provider/index.d.ts.map +1 -1
- package/lib/config-provider/index.js +9 -1
- package/lib/config-provider/index.js.map +1 -1
- package/lib/connect/index.d.ts +12 -0
- package/lib/connect/index.d.ts.map +1 -0
- package/lib/connect/index.js +32 -0
- package/lib/connect/index.js.map +1 -0
- package/lib/date-picker/index.d.ts +6 -1
- package/lib/date-picker/index.d.ts.map +1 -1
- package/lib/date-picker/index.js +17 -2
- package/lib/date-picker/index.js.map +1 -1
- package/lib/descriptions/descriptions.d.ts +1 -1
- package/lib/descriptions/descriptions.d.ts.map +1 -1
- package/lib/descriptions/descriptions.js +5 -1
- package/lib/descriptions/descriptions.js.map +1 -1
- package/lib/descriptions/index.js +5 -1
- package/lib/descriptions/index.js.map +1 -1
- package/lib/development-login/LoginModal.js +5 -1
- package/lib/development-login/LoginModal.js.map +1 -1
- package/lib/development-login/index.js +5 -1
- package/lib/development-login/index.js.map +1 -1
- package/lib/divider/index.js +5 -1
- package/lib/divider/index.js.map +1 -1
- package/lib/drawer/index.js +5 -1
- package/lib/drawer/index.js.map +1 -1
- package/lib/dropdown/index.js +5 -1
- package/lib/dropdown/index.js.map +1 -1
- package/lib/ellipsis/index.js +5 -1
- package/lib/ellipsis/index.js.map +1 -1
- package/lib/empty/empty.js +5 -1
- package/lib/empty/empty.js.map +1 -1
- package/lib/empty/index.js +5 -1
- package/lib/empty/index.js.map +1 -1
- package/lib/exception/index.js +5 -1
- package/lib/exception/index.js.map +1 -1
- package/lib/form/index.js +5 -1
- package/lib/form/index.js.map +1 -1
- package/lib/handle/index.js +5 -1
- package/lib/handle/index.js.map +1 -1
- package/lib/icon/index.js +5 -1
- package/lib/icon/index.js.map +1 -1
- package/lib/img/index.js +5 -1
- package/lib/img/index.js.map +1 -1
- package/lib/input/index.js +5 -1
- package/lib/input/index.js.map +1 -1
- package/lib/input/input.d.ts +22 -8
- package/lib/input/input.d.ts.map +1 -1
- package/lib/input/input.js +61 -27
- package/lib/input/input.js.map +1 -1
- package/lib/input-number/index.d.ts +7 -2
- package/lib/input-number/index.d.ts.map +1 -1
- package/lib/input-number/index.js +8 -2
- package/lib/input-number/index.js.map +1 -1
- package/lib/label/index.js +5 -1
- package/lib/label/index.js.map +1 -1
- package/lib/layout/index.js +5 -1
- package/lib/layout/index.js.map +1 -1
- package/lib/list/index.js +5 -1
- package/lib/list/index.js.map +1 -1
- package/lib/loading-button/index.js +5 -1
- package/lib/loading-button/index.js.map +1 -1
- package/lib/locale/index.js +5 -1
- package/lib/locale/index.js.map +1 -1
- package/lib/locale-provider/index.js +5 -1
- package/lib/locale-provider/index.js.map +1 -1
- package/lib/mentions/index.js +5 -1
- package/lib/mentions/index.js.map +1 -1
- package/lib/menu/index.js +5 -1
- package/lib/menu/index.js.map +1 -1
- package/lib/message/index.js +5 -1
- package/lib/message/index.js.map +1 -1
- package/lib/modal/index.js +5 -1
- package/lib/modal/index.js.map +1 -1
- package/lib/modal/modal.js +5 -1
- package/lib/modal/modal.js.map +1 -1
- package/lib/notification/index.js +5 -1
- package/lib/notification/index.js.map +1 -1
- package/lib/page-header/index.js +5 -1
- package/lib/page-header/index.js.map +1 -1
- package/lib/pagination/index.js +5 -1
- package/lib/pagination/index.js.map +1 -1
- package/lib/popconfirm/index.js +5 -1
- package/lib/popconfirm/index.js.map +1 -1
- package/lib/popover/index.js +5 -1
- package/lib/popover/index.js.map +1 -1
- package/lib/preview-text/index.d.ts +20 -0
- package/lib/preview-text/index.d.ts.map +1 -0
- package/lib/preview-text/index.js +224 -0
- package/lib/preview-text/index.js.map +1 -0
- package/lib/preview-text/index.less +3 -0
- package/lib/progress/index.js +5 -1
- package/lib/progress/index.js.map +1 -1
- package/lib/query-form/Field/Select.js +5 -1
- package/lib/query-form/Field/Select.js.map +1 -1
- package/lib/query-form/Field/SelectInput.js +5 -1
- package/lib/query-form/Field/SelectInput.js.map +1 -1
- package/lib/query-form/Field/fieldsMap.d.ts +2 -2
- package/lib/query-form/Field/index.d.ts +6 -0
- package/lib/query-form/Field/index.d.ts.map +1 -1
- package/lib/query-form/Field/index.js +5 -1
- package/lib/query-form/Field/index.js.map +1 -1
- package/lib/query-form/index.d.ts +9 -0
- package/lib/query-form/index.d.ts.map +1 -1
- package/lib/query-form/index.js +5 -1
- package/lib/query-form/index.js.map +1 -1
- package/lib/query-list-scene/List.d.ts +13 -0
- package/lib/query-list-scene/List.d.ts.map +1 -1
- package/lib/query-list-scene/List.js +5 -1
- package/lib/query-list-scene/List.js.map +1 -1
- package/lib/query-list-scene/QueryForm.d.ts +3 -0
- package/lib/query-list-scene/QueryForm.d.ts.map +1 -1
- package/lib/query-list-scene/QueryListScene.d.ts +1 -0
- package/lib/query-list-scene/QueryListScene.d.ts.map +1 -1
- package/lib/radio/index.d.ts.map +1 -1
- package/lib/radio/index.js +8 -1
- package/lib/radio/index.js.map +1 -1
- package/lib/radio/radio-group.d.ts +8 -0
- package/lib/radio/radio-group.d.ts.map +1 -0
- package/lib/radio/radio-group.js +11 -0
- package/lib/radio/radio-group.js.map +1 -0
- package/lib/rate/index.js +5 -1
- package/lib/rate/index.js.map +1 -1
- package/lib/result/index.js +5 -1
- package/lib/result/index.js.map +1 -1
- package/lib/row/index.js +5 -1
- package/lib/row/index.js.map +1 -1
- package/lib/select/index.d.ts +2 -1
- package/lib/select/index.d.ts.map +1 -1
- package/lib/select/index.js +5 -1
- package/lib/select/index.js.map +1 -1
- package/lib/select/select.d.ts +20 -6
- package/lib/select/select.d.ts.map +1 -1
- package/lib/select/select.js +41 -7
- package/lib/select/select.js.map +1 -1
- package/lib/skeleton/index.js +5 -1
- package/lib/skeleton/index.js.map +1 -1
- package/lib/slider/index.js +5 -1
- package/lib/slider/index.js.map +1 -1
- package/lib/spin/index.js +5 -1
- package/lib/spin/index.js.map +1 -1
- package/lib/statistic/index.js +5 -1
- package/lib/statistic/index.js.map +1 -1
- package/lib/steps/index.js +5 -1
- package/lib/steps/index.js.map +1 -1
- package/lib/steps/steps.js +5 -1
- package/lib/steps/steps.js.map +1 -1
- package/lib/svg-components/illustration-403.d.ts +1 -1
- package/lib/svg-components/illustration-403.js +5 -1
- package/lib/svg-components/illustration-403.js.map +1 -1
- package/lib/svg-components/illustration-404.d.ts +1 -1
- package/lib/svg-components/illustration-404.js +5 -1
- package/lib/svg-components/illustration-404.js.map +1 -1
- package/lib/svg-components/illustration-500.d.ts +1 -1
- package/lib/svg-components/illustration-500.js +5 -1
- package/lib/svg-components/illustration-500.js.map +1 -1
- package/lib/svg-components/illustration-empty.d.ts +1 -1
- package/lib/svg-components/illustration-empty.js +5 -1
- package/lib/svg-components/illustration-empty.js.map +1 -1
- package/lib/svg-components/illustration-failure.d.ts +1 -1
- package/lib/svg-components/illustration-failure.js +5 -1
- package/lib/svg-components/illustration-failure.js.map +1 -1
- package/lib/svg-components/illustration-no-access.d.ts +1 -1
- package/lib/svg-components/illustration-no-access.js +5 -1
- package/lib/svg-components/illustration-no-access.js.map +1 -1
- package/lib/svg-components/illustration-no-chart.d.ts +1 -1
- package/lib/svg-components/illustration-no-chart.js +5 -1
- package/lib/svg-components/illustration-no-chart.js.map +1 -1
- package/lib/svg-components/illustration-no-result.d.ts +1 -1
- package/lib/svg-components/illustration-no-result.js +5 -1
- package/lib/svg-components/illustration-no-result.js.map +1 -1
- package/lib/svg-components/illustration-offline.d.ts +1 -1
- package/lib/svg-components/illustration-offline.js +5 -1
- package/lib/svg-components/illustration-offline.js.map +1 -1
- package/lib/svg-components/illustration-success.d.ts +1 -1
- package/lib/svg-components/illustration-success.js +5 -1
- package/lib/svg-components/illustration-success.js.map +1 -1
- package/lib/switch/index.d.ts +2 -3
- package/lib/switch/index.d.ts.map +1 -1
- package/lib/switch/index.js +7 -4
- package/lib/switch/index.js.map +1 -1
- package/lib/switch/switch.d.ts +10 -0
- package/lib/switch/switch.d.ts.map +1 -0
- package/lib/switch/switch.js +29 -0
- package/lib/switch/switch.js.map +1 -0
- package/lib/table/assets/image-loading-background.d.ts +1 -1
- package/lib/table/assets/image-loading-background.js +5 -1
- package/lib/table/assets/image-loading-background.js.map +1 -1
- package/lib/table/assets/image-loading.d.ts +1 -1
- package/lib/table/assets/image-loading.js +5 -1
- package/lib/table/assets/image-loading.js.map +1 -1
- package/lib/table/hooks/index.js +5 -1
- package/lib/table/hooks/index.js.map +1 -1
- package/lib/table/index.js +5 -1
- package/lib/table/index.js.map +1 -1
- package/lib/table/table.js +5 -1
- package/lib/table/table.js.map +1 -1
- package/lib/tabs/index.js +5 -1
- package/lib/tabs/index.js.map +1 -1
- package/lib/tag/index.js +5 -1
- package/lib/tag/index.js.map +1 -1
- package/lib/time-picker/index.d.ts +7 -2
- package/lib/time-picker/index.d.ts.map +1 -1
- package/lib/time-picker/index.js +8 -2
- package/lib/time-picker/index.js.map +1 -1
- package/lib/timeline/index.js +5 -1
- package/lib/timeline/index.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +5 -1
- package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +5 -1
- package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +5 -1
- package/lib/tntd-cascader/AntdCascader/component/SizeContext.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +5 -1
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +5 -1
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +5 -1
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/config/utils.d.ts +1 -1
- package/lib/tntd-cascader/AntdCascader/config/warning.js +5 -1
- package/lib/tntd-cascader/AntdCascader/config/warning.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/index.js +5 -1
- package/lib/tntd-cascader/AntdCascader/index.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/Cascader.js +5 -1
- package/lib/tntd-cascader/rc-cascader/Cascader.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +5 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +5 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +5 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +5 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/context.js +5 -1
- package/lib/tntd-cascader/rc-cascader/context.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +5 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +5 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +5 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +5 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +5 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +5 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js.map +1 -1
- package/lib/tntd-form/ErrorList.d.ts +13 -0
- package/lib/tntd-form/ErrorList.d.ts.map +1 -0
- package/lib/tntd-form/ErrorList.js +82 -0
- package/lib/tntd-form/ErrorList.js.map +1 -0
- package/lib/tntd-form/Form.d.ts +36 -0
- package/lib/tntd-form/Form.d.ts.map +1 -0
- package/lib/tntd-form/Form.js +132 -0
- package/lib/tntd-form/Form.js.map +1 -0
- package/lib/tntd-form/FormItem/ItemHolder.d.ts +18 -0
- package/lib/tntd-form/FormItem/ItemHolder.d.ts.map +1 -0
- package/lib/tntd-form/FormItem/ItemHolder.js +164 -0
- package/lib/tntd-form/FormItem/ItemHolder.js.map +1 -0
- package/lib/tntd-form/FormItem/index.d.ts +36 -0
- package/lib/tntd-form/FormItem/index.d.ts.map +1 -0
- package/lib/tntd-form/FormItem/index.js +266 -0
- package/lib/tntd-form/FormItem/index.js.map +1 -0
- package/lib/tntd-form/FormItemInput.d.ts +30 -0
- package/lib/tntd-form/FormItemInput.d.ts.map +1 -0
- package/lib/tntd-form/FormItemInput.js +66 -0
- package/lib/tntd-form/FormItemInput.js.map +1 -0
- package/lib/tntd-form/FormItemLabel.d.ts +24 -0
- package/lib/tntd-form/FormItemLabel.d.ts.map +1 -0
- package/lib/tntd-form/FormItemLabel.js +101 -0
- package/lib/tntd-form/FormItemLabel.js.map +1 -0
- package/lib/tntd-form/FormList.d.ts +26 -0
- package/lib/tntd-form/FormList.d.ts.map +1 -0
- package/lib/tntd-form/FormList.js +62 -0
- package/lib/tntd-form/FormList.js.map +1 -0
- package/lib/tntd-form/TntdForm/components/Item.js +5 -1
- package/lib/tntd-form/TntdForm/components/Item.js.map +1 -1
- package/lib/tntd-form/TntdForm/components/ItemComp.js +7 -3
- package/lib/tntd-form/TntdForm/components/ItemComp.js.map +1 -1
- package/lib/tntd-form/TntdForm/components/List.js +5 -1
- package/lib/tntd-form/TntdForm/components/List.js.map +1 -1
- package/lib/tntd-form/TntdForm/index.js +5 -1
- package/lib/tntd-form/TntdForm/index.js.map +1 -1
- package/lib/tntd-form/__tests__/demo-extend.test.d.ts +2 -0
- package/lib/tntd-form/__tests__/demo-extend.test.d.ts.map +1 -0
- package/lib/tntd-form/__tests__/demo-extend.test.js +5 -0
- package/lib/tntd-form/__tests__/demo-extend.test.js.map +1 -0
- package/lib/tntd-form/__tests__/demo.test.d.ts +2 -0
- package/lib/tntd-form/__tests__/demo.test.d.ts.map +1 -0
- package/lib/tntd-form/__tests__/demo.test.js +8 -0
- package/lib/tntd-form/__tests__/demo.test.js.map +1 -0
- package/lib/tntd-form/__tests__/image.test.d.ts +2 -0
- package/lib/tntd-form/__tests__/image.test.d.ts.map +1 -0
- package/lib/tntd-form/__tests__/image.test.js +7 -0
- package/lib/tntd-form/__tests__/image.test.js.map +1 -0
- package/lib/tntd-form/__tests__/index.test.d.ts +2 -0
- package/lib/tntd-form/__tests__/index.test.d.ts.map +1 -0
- package/lib/tntd-form/__tests__/index.test.js +981 -0
- package/lib/tntd-form/__tests__/index.test.js.map +1 -0
- package/lib/tntd-form/__tests__/list-noStyle.test.d.ts +2 -0
- package/lib/tntd-form/__tests__/list-noStyle.test.d.ts.map +1 -0
- package/lib/tntd-form/__tests__/list-noStyle.test.js +46 -0
- package/lib/tntd-form/__tests__/list-noStyle.test.js.map +1 -0
- package/lib/tntd-form/__tests__/list.test.d.ts +2 -0
- package/lib/tntd-form/__tests__/list.test.d.ts.map +1 -0
- package/lib/tntd-form/__tests__/list.test.js +169 -0
- package/lib/tntd-form/__tests__/list.test.js.map +1 -0
- package/lib/tntd-form/__tests__/ref.test.d.ts +2 -0
- package/lib/tntd-form/__tests__/ref.test.d.ts.map +1 -0
- package/lib/tntd-form/__tests__/ref.test.js +50 -0
- package/lib/tntd-form/__tests__/ref.test.js.map +1 -0
- package/lib/tntd-form/__tests__/type.test.d.ts +2 -0
- package/lib/tntd-form/__tests__/type.test.d.ts.map +1 -0
- package/lib/tntd-form/__tests__/type.test.js +98 -0
- package/lib/tntd-form/__tests__/type.test.js.map +1 -0
- package/lib/tntd-form/_util/motion.d.ts +9 -0
- package/lib/tntd-form/_util/motion.d.ts.map +1 -0
- package/lib/tntd-form/_util/motion.js +42 -0
- package/lib/tntd-form/_util/motion.js.map +1 -0
- package/lib/tntd-form/_util/reactNode.d.ts +9 -0
- package/lib/tntd-form/_util/reactNode.d.ts.map +1 -0
- package/lib/tntd-form/_util/reactNode.js +44 -0
- package/lib/tntd-form/_util/reactNode.js.map +1 -0
- package/lib/tntd-form/_util/scrollTo.d.ts +1 -0
- package/lib/tntd-form/_util/scrollTo.d.ts.map +1 -0
- package/lib/tntd-form/_util/scrollTo.js +35 -0
- package/lib/tntd-form/_util/scrollTo.js.map +1 -0
- package/lib/tntd-form/_util/type.d.ts +4 -0
- package/lib/tntd-form/_util/type.d.ts.map +1 -0
- package/lib/tntd-form/_util/type.js +9 -0
- package/lib/tntd-form/_util/type.js.map +1 -0
- package/lib/tntd-form/_util/warning.d.ts +5 -0
- package/lib/tntd-form/_util/warning.d.ts.map +1 -0
- package/lib/tntd-form/_util/warning.js +32 -0
- package/lib/tntd-form/_util/warning.js.map +1 -0
- package/lib/tntd-form/_util/wave.d.ts +1 -0
- package/lib/tntd-form/_util/wave.d.ts.map +1 -0
- package/lib/tntd-form/_util/wave.js +168 -0
- package/lib/tntd-form/_util/wave.js.map +1 -0
- package/lib/tntd-form/context.d.ts +51 -0
- package/lib/tntd-form/context.d.ts.map +1 -0
- package/lib/tntd-form/context.js +66 -0
- package/lib/tntd-form/context.js.map +1 -0
- package/lib/tntd-form/hooks/useDebounce.d.ts +2 -0
- package/lib/tntd-form/hooks/useDebounce.d.ts.map +1 -0
- package/lib/tntd-form/hooks/useDebounce.js +40 -0
- package/lib/tntd-form/hooks/useDebounce.js.map +1 -0
- package/lib/tntd-form/hooks/useForm.d.ts +16 -0
- package/lib/tntd-form/hooks/useForm.d.ts.map +1 -0
- package/lib/tntd-form/hooks/useForm.js +64 -0
- package/lib/tntd-form/hooks/useForm.js.map +1 -0
- package/lib/tntd-form/hooks/useFormInstance.d.ts +3 -0
- package/lib/tntd-form/hooks/useFormInstance.d.ts.map +1 -0
- package/lib/tntd-form/hooks/useFormInstance.js +10 -0
- package/lib/tntd-form/hooks/useFormInstance.js.map +1 -0
- package/lib/tntd-form/hooks/useFormItemStatus.d.ts +7 -0
- package/lib/tntd-form/hooks/useFormItemStatus.d.ts.map +1 -0
- package/lib/tntd-form/hooks/useFormItemStatus.js +15 -0
- package/lib/tntd-form/hooks/useFormItemStatus.js.map +1 -0
- package/lib/tntd-form/hooks/useFrameState.d.ts +4 -0
- package/lib/tntd-form/hooks/useFrameState.d.ts.map +1 -0
- package/lib/tntd-form/hooks/useFrameState.js +67 -0
- package/lib/tntd-form/hooks/useFrameState.js.map +1 -0
- package/lib/tntd-form/hooks/useItemRef.d.ts +4 -0
- package/lib/tntd-form/hooks/useItemRef.d.ts.map +1 -0
- package/lib/tntd-form/hooks/useItemRef.js +45 -0
- package/lib/tntd-form/hooks/useItemRef.js.map +1 -0
- package/lib/tntd-form/index.d.ts +23 -1
- package/lib/tntd-form/index.d.ts.map +1 -1
- package/lib/tntd-form/index.js +40 -3
- package/lib/tntd-form/index.js.map +1 -1
- package/lib/tntd-form/interface.d.ts +4 -0
- package/lib/tntd-form/interface.d.ts.map +1 -0
- package/lib/tntd-form/interface.js +5 -0
- package/lib/tntd-form/interface.js.map +1 -0
- package/lib/tntd-form/style/components.less +16 -0
- package/lib/tntd-form/style/horizontal.less +26 -0
- package/lib/tntd-form/style/index.d.ts +5 -0
- package/lib/tntd-form/style/index.d.ts.map +1 -0
- package/lib/tntd-form/style/index.js +8 -0
- package/lib/tntd-form/style/index.js.map +1 -0
- package/lib/tntd-form/style/index.less +342 -0
- package/lib/tntd-form/style/inline.less +40 -0
- package/lib/tntd-form/style/mixin.less +90 -0
- package/lib/tntd-form/style/rtl.less +204 -0
- package/lib/tntd-form/style/status.less +45 -0
- package/lib/tntd-form/style/vertical.less +95 -0
- package/lib/tntd-form/tntd-form.stories.d.ts +33 -0
- package/lib/tntd-form/tntd-form.stories.d.ts.map +1 -0
- package/lib/tntd-form/tntd-form.stories.js +455 -0
- package/lib/tntd-form/tntd-form.stories.js.map +1 -0
- package/lib/tntd-form/util.d.ts +4 -0
- package/lib/tntd-form/util.d.ts.map +1 -0
- package/lib/tntd-form/util.js +26 -0
- package/lib/tntd-form/util.js.map +1 -0
- package/lib/tntd-form/validateMessagesContext.d.ts +5 -0
- package/lib/tntd-form/validateMessagesContext.d.ts.map +1 -0
- package/lib/tntd-form/validateMessagesContext.js +8 -0
- package/lib/tntd-form/validateMessagesContext.js.map +1 -0
- package/lib/tntd-layout/AppList.js +5 -1
- package/lib/tntd-layout/AppList.js.map +1 -1
- package/lib/tntd-layout/Application.js +5 -1
- package/lib/tntd-layout/Application.js.map +1 -1
- package/lib/tntd-layout/Avatar.js +5 -1
- package/lib/tntd-layout/Avatar.js.map +1 -1
- package/lib/tntd-layout/CompatibleLanguage.js +5 -1
- package/lib/tntd-layout/CompatibleLanguage.js.map +1 -1
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +5 -1
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js.map +1 -1
- package/lib/tntd-layout/EnterpriseLayout/Language.js +5 -1
- package/lib/tntd-layout/EnterpriseLayout/Language.js.map +1 -1
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +5 -1
- package/lib/tntd-layout/EnterpriseLayout/Theme.js.map +1 -1
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +5 -1
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js.map +1 -1
- package/lib/tntd-layout/GlobalNavigation/index.js +5 -1
- package/lib/tntd-layout/GlobalNavigation/index.js.map +1 -1
- package/lib/tntd-layout/Header.js +5 -1
- package/lib/tntd-layout/Header.js.map +1 -1
- package/lib/tntd-layout/HeaderActions.js +5 -1
- package/lib/tntd-layout/HeaderActions.js.map +1 -1
- package/lib/tntd-layout/HeaderNavs.js +5 -1
- package/lib/tntd-layout/HeaderNavs.js.map +1 -1
- package/lib/tntd-layout/HeaderTabs.js +5 -1
- package/lib/tntd-layout/HeaderTabs.js.map +1 -1
- package/lib/tntd-layout/Language.js +5 -1
- package/lib/tntd-layout/Language.js.map +1 -1
- package/lib/tntd-layout/Layout.js +5 -1
- package/lib/tntd-layout/Layout.js.map +1 -1
- package/lib/tntd-layout/Logo.js +5 -1
- package/lib/tntd-layout/Logo.js.map +1 -1
- package/lib/tntd-layout/OrgAppList.js +5 -1
- package/lib/tntd-layout/OrgAppList.js.map +1 -1
- package/lib/tntd-layout/SideMenu.js +5 -1
- package/lib/tntd-layout/SideMenu.js.map +1 -1
- package/lib/tntd-layout/Theme.js +5 -1
- package/lib/tntd-layout/Theme.js.map +1 -1
- package/lib/tntd-layout/index.js +5 -1
- package/lib/tntd-layout/index.js.map +1 -1
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +5 -1
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js.map +1 -1
- package/lib/tntd-layout/paaslayout/Header.js +5 -1
- package/lib/tntd-layout/paaslayout/Header.js.map +1 -1
- package/lib/tntd-layout/paaslayout/SideMenu.js +5 -1
- package/lib/tntd-layout/paaslayout/SideMenu.js.map +1 -1
- package/lib/tntd-layout/paaslayout/index.js +5 -1
- package/lib/tntd-layout/paaslayout/index.js.map +1 -1
- package/lib/tntd-modal/index.js +5 -1
- package/lib/tntd-modal/index.js.map +1 -1
- package/lib/tntd-select/DropDownWrap.d.ts +10 -0
- package/lib/tntd-select/DropDownWrap.d.ts.map +1 -1
- package/lib/tntd-select/DropDownWrap.js +5 -1
- package/lib/tntd-select/DropDownWrap.js.map +1 -1
- package/lib/tntd-select/index.d.ts +12 -1
- package/lib/tntd-select/index.d.ts.map +1 -1
- package/lib/tntd-select/index.js +5 -1
- package/lib/tntd-select/index.js.map +1 -1
- package/lib/tooltip/index.js +5 -1
- package/lib/tooltip/index.js.map +1 -1
- package/lib/transfer/index.js +5 -1
- package/lib/transfer/index.js.map +1 -1
- package/lib/tree/index.js +5 -1
- package/lib/tree/index.js.map +1 -1
- package/lib/tree-select/index.d.ts +7 -1
- package/lib/tree-select/index.d.ts.map +1 -1
- package/lib/tree-select/index.js +10 -2
- package/lib/tree-select/index.js.map +1 -1
- package/lib/typography/index.js +5 -1
- package/lib/typography/index.js.map +1 -1
- package/lib/upload/index.d.ts +6 -1
- package/lib/upload/index.d.ts.map +1 -1
- package/lib/upload/index.js +11 -2
- package/lib/upload/index.js.map +1 -1
- package/lib/utils/index.js +5 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/version/index.js +5 -1
- package/lib/version/index.js.map +1 -1
- package/package.json +7 -4
- package/themes/default/variables.less +43 -0
- package/es/mention/index.js +0 -5
- package/es/mention/index.js.map +0 -1
- package/lib/mention/index.d.ts +0 -5
- package/lib/mention/index.d.ts.map +0 -1
- package/lib/mention/index.js +0 -20
- package/lib/mention/index.js.map +0 -1
package/es/_util/wave.js
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { findDOMNode } from 'react-dom';
|
|
3
|
+
import TransitionEvents from 'css-animation/lib/Event';
|
|
4
|
+
import raf from './raf';
|
|
5
|
+
import { ConfigConsumer } from '../config-provider';
|
|
6
|
+
let styleForPesudo;
|
|
7
|
+
// Where el is the DOM element you'd like to test for visibility
|
|
8
|
+
function isHidden(element) {
|
|
9
|
+
if (process.env.NODE_ENV === 'test') {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return !element || element.offsetParent === null;
|
|
13
|
+
}
|
|
14
|
+
function isNotGrey(color) {
|
|
15
|
+
// eslint-disable-next-line no-useless-escape
|
|
16
|
+
const match = (color || '').match(/rgba?\((\d*), (\d*), (\d*)(, [\.\d]*)?\)/);
|
|
17
|
+
if (match && match[1] && match[2] && match[3]) {
|
|
18
|
+
return !(match[1] === match[2] && match[2] === match[3]);
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
export default class Wave extends React.Component {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
Object.defineProperty(this, "instance", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
configurable: true,
|
|
28
|
+
writable: true,
|
|
29
|
+
value: void 0
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(this, "extraNode", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: void 0
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(this, "clickWaveTimeoutId", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: void 0
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(this, "animationStartId", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
configurable: true,
|
|
46
|
+
writable: true,
|
|
47
|
+
value: void 0
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(this, "animationStart", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
configurable: true,
|
|
52
|
+
writable: true,
|
|
53
|
+
value: false
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(this, "destroy", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
configurable: true,
|
|
58
|
+
writable: true,
|
|
59
|
+
value: false
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(this, "csp", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
configurable: true,
|
|
64
|
+
writable: true,
|
|
65
|
+
value: void 0
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(this, "onClick", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
configurable: true,
|
|
70
|
+
writable: true,
|
|
71
|
+
value: (node, waveColor) => {
|
|
72
|
+
if (!node || isHidden(node) || node.className.indexOf('-leave') >= 0) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const {
|
|
76
|
+
insertExtraNode
|
|
77
|
+
} = this.props;
|
|
78
|
+
this.extraNode = document.createElement('div');
|
|
79
|
+
const {
|
|
80
|
+
extraNode
|
|
81
|
+
} = this;
|
|
82
|
+
extraNode.className = 'ant-click-animating-node';
|
|
83
|
+
const attributeName = this.getAttributeName();
|
|
84
|
+
node.setAttribute(attributeName, 'true');
|
|
85
|
+
// Not white or transparnt or grey
|
|
86
|
+
styleForPesudo = styleForPesudo || document.createElement('style');
|
|
87
|
+
if (waveColor && waveColor !== '#ffffff' && waveColor !== 'rgb(255, 255, 255)' && isNotGrey(waveColor) && !/rgba\(\d*, \d*, \d*, 0\)/.test(waveColor) &&
|
|
88
|
+
// any transparent rgba color
|
|
89
|
+
waveColor !== 'transparent') {
|
|
90
|
+
// Add nonce if CSP exist
|
|
91
|
+
if (this.csp && this.csp.nonce) {
|
|
92
|
+
styleForPesudo.nonce = this.csp.nonce;
|
|
93
|
+
}
|
|
94
|
+
extraNode.style.borderColor = waveColor;
|
|
95
|
+
styleForPesudo.innerHTML = `
|
|
96
|
+
[ant-click-animating-without-extra-node='true']::after, .ant-click-animating-node {
|
|
97
|
+
--antd-wave-shadow-color: ${waveColor};
|
|
98
|
+
}`;
|
|
99
|
+
if (!document.body.contains(styleForPesudo)) {
|
|
100
|
+
document.body.appendChild(styleForPesudo);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (insertExtraNode) {
|
|
104
|
+
node.appendChild(extraNode);
|
|
105
|
+
}
|
|
106
|
+
TransitionEvents.addStartEventListener(node, this.onTransitionStart);
|
|
107
|
+
TransitionEvents.addEndEventListener(node, this.onTransitionEnd);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
Object.defineProperty(this, "onTransitionStart", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
configurable: true,
|
|
113
|
+
writable: true,
|
|
114
|
+
value: e => {
|
|
115
|
+
if (this.destroy) return;
|
|
116
|
+
const node = findDOMNode(this);
|
|
117
|
+
if (!e || e.target !== node) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (!this.animationStart) {
|
|
121
|
+
this.resetEffect(node);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
Object.defineProperty(this, "onTransitionEnd", {
|
|
126
|
+
enumerable: true,
|
|
127
|
+
configurable: true,
|
|
128
|
+
writable: true,
|
|
129
|
+
value: e => {
|
|
130
|
+
if (!e || e.animationName !== 'fadeEffect') {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this.resetEffect(e.target);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
Object.defineProperty(this, "bindAnimationEvent", {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
configurable: true,
|
|
139
|
+
writable: true,
|
|
140
|
+
value: node => {
|
|
141
|
+
if (!node || !node.getAttribute || node.getAttribute('disabled') || node.className.indexOf('disabled') >= 0) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const onClick = e => {
|
|
145
|
+
// Fix radio button click twice
|
|
146
|
+
if (e.target.tagName === 'INPUT' || isHidden(e.target)) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
this.resetEffect(node);
|
|
150
|
+
// Get wave color from target
|
|
151
|
+
const waveColor = getComputedStyle(node).getPropertyValue('border-top-color') ||
|
|
152
|
+
// Firefox Compatible
|
|
153
|
+
getComputedStyle(node).getPropertyValue('border-color') || getComputedStyle(node).getPropertyValue('background-color');
|
|
154
|
+
this.clickWaveTimeoutId = window.setTimeout(() => this.onClick(node, waveColor), 0);
|
|
155
|
+
raf.cancel(this.animationStartId);
|
|
156
|
+
this.animationStart = true;
|
|
157
|
+
// Render to trigger transition event cost 3 frames. Let's delay 10 frames to reset this.
|
|
158
|
+
this.animationStartId = raf(() => {
|
|
159
|
+
this.animationStart = false;
|
|
160
|
+
}, 10);
|
|
161
|
+
};
|
|
162
|
+
node.addEventListener('click', onClick, true);
|
|
163
|
+
return {
|
|
164
|
+
cancel: () => {
|
|
165
|
+
node.removeEventListener('click', onClick, true);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
Object.defineProperty(this, "renderWave", {
|
|
171
|
+
enumerable: true,
|
|
172
|
+
configurable: true,
|
|
173
|
+
writable: true,
|
|
174
|
+
value: ({
|
|
175
|
+
csp
|
|
176
|
+
}) => {
|
|
177
|
+
const {
|
|
178
|
+
children
|
|
179
|
+
} = this.props;
|
|
180
|
+
this.csp = csp;
|
|
181
|
+
return children;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
componentDidMount() {
|
|
186
|
+
const node = findDOMNode(this);
|
|
187
|
+
if (!node || node.nodeType !== 1) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
this.instance = this.bindAnimationEvent(node);
|
|
191
|
+
}
|
|
192
|
+
componentWillUnmount() {
|
|
193
|
+
if (this.instance) {
|
|
194
|
+
this.instance.cancel();
|
|
195
|
+
}
|
|
196
|
+
if (this.clickWaveTimeoutId) {
|
|
197
|
+
clearTimeout(this.clickWaveTimeoutId);
|
|
198
|
+
}
|
|
199
|
+
this.destroy = true;
|
|
200
|
+
}
|
|
201
|
+
getAttributeName() {
|
|
202
|
+
const {
|
|
203
|
+
insertExtraNode
|
|
204
|
+
} = this.props;
|
|
205
|
+
return insertExtraNode ? 'ant-click-animating' : 'ant-click-animating-without-extra-node';
|
|
206
|
+
}
|
|
207
|
+
resetEffect(node) {
|
|
208
|
+
if (!node || node === this.extraNode || !(node instanceof Element)) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const {
|
|
212
|
+
insertExtraNode
|
|
213
|
+
} = this.props;
|
|
214
|
+
const attributeName = this.getAttributeName();
|
|
215
|
+
node.setAttribute(attributeName, 'false'); // edge has bug on `removeAttribute` #14466
|
|
216
|
+
if (styleForPesudo) {
|
|
217
|
+
styleForPesudo.innerHTML = '';
|
|
218
|
+
}
|
|
219
|
+
if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {
|
|
220
|
+
node.removeChild(this.extraNode);
|
|
221
|
+
}
|
|
222
|
+
TransitionEvents.removeStartEventListener(node, this.onTransitionStart);
|
|
223
|
+
TransitionEvents.removeEndEventListener(node, this.onTransitionEnd);
|
|
224
|
+
}
|
|
225
|
+
render() {
|
|
226
|
+
return React.createElement(ConfigConsumer, null, this.renderWave);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wave.js","sourceRoot":"","sources":["../../src/_util/wave.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,EAAE,cAAc,EAAkC,MAAM,oBAAoB,CAAC;AAEpF,IAAI,cAAuC,CAAC;AAE5C,gEAAgE;AAChE,SAAS,QAAQ,CAAC,OAAoB;IACpC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE;QACnC,OAAO,KAAK,CAAC;KACd;IACD,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,CAAC;AACnD,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,6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AO,eAAe,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,wCAAwC,CAAC;IAC5F,CAAC;IAwCD,WAAW,CAAC,IAAiB;QAC3B,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,IAAI,YAAY,OAAO,CAAC,EAAE;YAClE,OAAO;SACR;QACD,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACvC,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC9C,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,2CAA2C;QAEtF,IAAI,cAAc,EAAE;YAClB,cAAc,CAAC,SAAS,GAAG,EAAE,CAAC;SAC/B;QAED,IAAI,eAAe,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;YACtE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAClC;QACD,gBAAgB,CAAC,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACxE,gBAAgB,CAAC,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACtE,CAAC;IASD,MAAM;QACJ,OAAO,oBAAC,cAAc,QAAE,IAAI,CAAC,UAAU,CAAkB,CAAC;IAC5D,CAAC;CACF","sourcesContent":["import * as React from 'react';\nimport { findDOMNode } from 'react-dom';\nimport TransitionEvents from 'css-animation/lib/Event';\nimport raf from './raf';\nimport { ConfigConsumer, ConfigConsumerProps, CSPConfig } from '../config-provider';\n\nlet styleForPesudo: HTMLStyleElement | null;\n\n// Where el is the DOM element you'd like to test for visibility\nfunction isHidden(element: HTMLElement) {\n if (process.env.NODE_ENV === 'test') {\n return false;\n }\n return !element || element.offsetParent === null;\n}\n\nfunction isNotGrey(color: string) {\n // eslint-disable-next-line no-useless-escape\n const match = (color || '').match(/rgba?\\((\\d*), (\\d*), (\\d*)(, [\\.\\d]*)?\\)/);\n if (match && match[1] && match[2] && match[3]) {\n return !(match[1] === match[2] && match[2] === match[3]);\n }\n return true;\n}\n\nexport default class Wave extends React.Component<{ insertExtraNode?: boolean }> {\n private instance?: {\n cancel: () => void;\n };\n\n private extraNode: HTMLDivElement;\n\n private clickWaveTimeoutId: number;\n\n private animationStartId: number;\n\n private animationStart: boolean = false;\n\n private destroy: boolean = false;\n\n private csp?: CSPConfig;\n\n componentDidMount() {\n const node = findDOMNode(this) as HTMLElement;\n if (!node || node.nodeType !== 1) {\n return;\n }\n this.instance = this.bindAnimationEvent(node);\n }\n\n componentWillUnmount() {\n if (this.instance) {\n this.instance.cancel();\n }\n if (this.clickWaveTimeoutId) {\n clearTimeout(this.clickWaveTimeoutId);\n }\n\n this.destroy = true;\n }\n\n onClick = (node: HTMLElement, waveColor: string) => {\n if (!node || isHidden(node) || node.className.indexOf('-leave') >= 0) {\n return;\n }\n const { insertExtraNode } = this.props;\n this.extraNode = document.createElement('div');\n const { extraNode } = this;\n extraNode.className = 'ant-click-animating-node';\n const attributeName = this.getAttributeName();\n node.setAttribute(attributeName, 'true');\n // Not white or transparnt or grey\n styleForPesudo = styleForPesudo || document.createElement('style');\n if (\n waveColor &&\n waveColor !== '#ffffff' &&\n waveColor !== 'rgb(255, 255, 255)' &&\n isNotGrey(waveColor) &&\n !/rgba\\(\\d*, \\d*, \\d*, 0\\)/.test(waveColor) && // any transparent rgba color\n waveColor !== 'transparent'\n ) {\n // Add nonce if CSP exist\n if (this.csp && this.csp.nonce) {\n styleForPesudo.nonce = this.csp.nonce;\n }\n\n extraNode.style.borderColor = waveColor;\n styleForPesudo.innerHTML = `\n [ant-click-animating-without-extra-node='true']::after, .ant-click-animating-node {\n --antd-wave-shadow-color: ${waveColor};\n }`;\n if (!document.body.contains(styleForPesudo)) {\n document.body.appendChild(styleForPesudo);\n }\n }\n if (insertExtraNode) {\n node.appendChild(extraNode);\n }\n TransitionEvents.addStartEventListener(node, this.onTransitionStart);\n TransitionEvents.addEndEventListener(node, this.onTransitionEnd);\n };\n\n onTransitionStart = (e: AnimationEvent) => {\n if (this.destroy) return;\n\n const node = findDOMNode(this) as HTMLElement;\n if (!e || e.target !== node) {\n return;\n }\n\n if (!this.animationStart) {\n this.resetEffect(node);\n }\n };\n\n onTransitionEnd = (e: AnimationEvent) => {\n if (!e || e.animationName !== 'fadeEffect') {\n return;\n }\n this.resetEffect(e.target as HTMLElement);\n };\n\n getAttributeName() {\n const { insertExtraNode } = this.props;\n return insertExtraNode ? 'ant-click-animating' : 'ant-click-animating-without-extra-node';\n }\n\n bindAnimationEvent = (node: HTMLElement) => {\n if (\n !node ||\n !node.getAttribute ||\n node.getAttribute('disabled') ||\n node.className.indexOf('disabled') >= 0\n ) {\n return;\n }\n const onClick = (e: MouseEvent) => {\n // Fix radio button click twice\n if ((e.target as HTMLElement).tagName === 'INPUT' || isHidden(e.target as HTMLElement)) {\n return;\n }\n this.resetEffect(node);\n // Get wave color from target\n const waveColor =\n getComputedStyle(node).getPropertyValue('border-top-color') || // Firefox Compatible\n getComputedStyle(node).getPropertyValue('border-color') ||\n getComputedStyle(node).getPropertyValue('background-color');\n this.clickWaveTimeoutId = window.setTimeout(() => this.onClick(node, waveColor), 0);\n\n raf.cancel(this.animationStartId);\n this.animationStart = true;\n\n // Render to trigger transition event cost 3 frames. Let's delay 10 frames to reset this.\n this.animationStartId = raf(() => {\n this.animationStart = false;\n }, 10);\n };\n node.addEventListener('click', onClick, true);\n return {\n cancel: () => {\n node.removeEventListener('click', onClick, true);\n },\n };\n };\n\n resetEffect(node: HTMLElement) {\n if (!node || node === this.extraNode || !(node instanceof Element)) {\n return;\n }\n const { insertExtraNode } = this.props;\n const attributeName = this.getAttributeName();\n node.setAttribute(attributeName, 'false'); // edge has bug on `removeAttribute` #14466\n\n if (styleForPesudo) {\n styleForPesudo.innerHTML = '';\n }\n\n if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {\n node.removeChild(this.extraNode);\n }\n TransitionEvents.removeStartEventListener(node, this.onTransitionStart);\n TransitionEvents.removeEndEventListener(node, this.onTransitionEnd);\n }\n\n renderWave = ({ csp }: ConfigConsumerProps) => {\n const { children } = this.props;\n this.csp = csp;\n\n return children;\n };\n\n render() {\n return <ConfigConsumer>{this.renderWave}</ConfigConsumer>;\n }\n}\n"]}
|
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,7 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export const plusIcon =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
export const plusIcon = React.createElement("svg", {
|
|
3
|
+
viewBox: "64 64 896 896",
|
|
4
|
+
focusable: "false",
|
|
5
|
+
"data-icon": "plus-circle",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
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
|
+
}));
|
package/es/array-input/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import _sumBy from "lodash/sumBy";
|
|
2
|
+
import _sum from "lodash/sum";
|
|
3
|
+
import _set from "lodash/set";
|
|
4
|
+
import _isFunction from "lodash/isFunction";
|
|
5
|
+
import _isArray from "lodash/isArray";
|
|
6
|
+
import _get from "lodash/get";
|
|
7
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
8
|
+
var t = {};
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
10
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
11
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
11
14
|
};
|
|
12
|
-
import { get, isArray, isFunction, set, sum, sumBy } from 'lodash';
|
|
13
15
|
import React, { isValidElement, useCallback, useEffect, useState } from 'react';
|
|
14
16
|
import { deleteIcon, plusIcon } from './icon';
|
|
15
17
|
import Col from '../col';
|
|
@@ -17,116 +19,198 @@ import Row from '../row';
|
|
|
17
19
|
import Table from '../table';
|
|
18
20
|
import Tooltip from '../tooltip';
|
|
19
21
|
import './index.less';
|
|
20
|
-
const {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const {
|
|
23
|
+
Column
|
|
24
|
+
} = Table;
|
|
25
|
+
const getWidth = span => 1000 / span;
|
|
26
|
+
export default function ArrayInput({
|
|
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);
|
|
25
50
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
}, []);
|
|
52
|
+
let inValue = _value || [];
|
|
53
|
+
if (require && inValue.length === 0) {
|
|
54
|
+
inValue = [{}];
|
|
55
|
+
}
|
|
56
|
+
const changeValue = (index, name, value) => {
|
|
57
|
+
inValue[index] = Object.assign(Object.assign({}, inValue[index]), {
|
|
58
|
+
[name]: value
|
|
59
|
+
});
|
|
60
|
+
_onChange([...inValue]);
|
|
61
|
+
};
|
|
62
|
+
const onAdd = index => {
|
|
63
|
+
if (index === undefined) {
|
|
64
|
+
_onChange([...inValue, {}]);
|
|
65
|
+
} else {
|
|
66
|
+
inValue.splice(index + 1, 0, {});
|
|
67
|
+
_onChange([...inValue]);
|
|
41
68
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
69
|
+
};
|
|
70
|
+
const onDelete = i => {
|
|
71
|
+
inValue.splice(i, 1);
|
|
72
|
+
_onChange([...inValue]);
|
|
73
|
+
};
|
|
74
|
+
if (mode === 'list') {
|
|
75
|
+
return React.createElement("div", {
|
|
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) : '';
|
|
49
92
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
93
|
+
const _a = field === null || field === void 0 ? void 0 : field.props,
|
|
94
|
+
{
|
|
95
|
+
name,
|
|
96
|
+
span = 4,
|
|
97
|
+
onChange: fieldChange
|
|
98
|
+
} = _a,
|
|
99
|
+
other = __rest(_a, ["name", "span", "onChange"]);
|
|
100
|
+
return React.createElement(Col, {
|
|
101
|
+
span: span,
|
|
102
|
+
key: i
|
|
103
|
+
}, React.cloneElement(field, Object.assign({
|
|
104
|
+
value: item[name] || undefined,
|
|
105
|
+
onChange: e => {
|
|
106
|
+
fieldChange && fieldChange(e, index, changeValue);
|
|
107
|
+
const newValue = e.target ? e.target.value : e;
|
|
108
|
+
changeValue(index, name, newValue);
|
|
109
|
+
}
|
|
110
|
+
}, other)));
|
|
111
|
+
}), React.createElement(Col, {
|
|
112
|
+
span: 24 - _sum(fields.map(f => _get(f, 'props.span', 4))) % 24
|
|
113
|
+
}, React.createElement("span", {
|
|
114
|
+
className: "tntd-array-input-action"
|
|
115
|
+
}, plusTip ? React.createElement(Tooltip, {
|
|
116
|
+
title: plusTip,
|
|
117
|
+
placement: "left"
|
|
118
|
+
}, React.createElement("span", {
|
|
119
|
+
className: "mr10",
|
|
120
|
+
onClick: () => onAdd(index)
|
|
121
|
+
}, plusIcon)) : React.createElement("span", {
|
|
122
|
+
className: "mr10",
|
|
123
|
+
onClick: () => onAdd(index)
|
|
124
|
+
}, plusIcon), deleteTip ? React.createElement(Tooltip, {
|
|
125
|
+
title: deleteTip,
|
|
126
|
+
placement: "right"
|
|
127
|
+
}, React.createElement("span", {
|
|
128
|
+
onClick: () => onDelete(index)
|
|
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', []);
|
|
86
139
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
140
|
+
const dataSource = inValue.map((value, index) => {
|
|
141
|
+
const fields = children(value, index);
|
|
142
|
+
const back = {};
|
|
143
|
+
fields.forEach(field => {
|
|
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
|
+
});
|
|
91
186
|
}
|
|
92
|
-
|
|
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
|
-
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
|
|
187
|
+
});
|
|
188
|
+
}), React.createElement(Column, {
|
|
189
|
+
key: "action",
|
|
190
|
+
dataIndex: "action",
|
|
191
|
+
title: "\u64CD\u4F5C",
|
|
192
|
+
width: getWidth(24 - _sumBy(fields, 'props.span') % 24),
|
|
193
|
+
render: (text, row, index) => {
|
|
194
|
+
return React.createElement("span", {
|
|
195
|
+
className: "tntd-array-input-action"
|
|
196
|
+
}, plusTip ? React.createElement(Tooltip, {
|
|
197
|
+
title: plusTip,
|
|
198
|
+
placement: "left"
|
|
199
|
+
}, React.createElement("span", {
|
|
200
|
+
className: "mr10",
|
|
201
|
+
onClick: () => onAdd(index)
|
|
202
|
+
}, plusIcon)) : React.createElement("span", {
|
|
203
|
+
className: "mr10",
|
|
204
|
+
onClick: () => onAdd(index)
|
|
205
|
+
}, plusIcon), deleteTip ? React.createElement(Tooltip, {
|
|
206
|
+
title: deleteTip,
|
|
207
|
+
placement: "right"
|
|
208
|
+
}, React.createElement("span", {
|
|
209
|
+
onClick: () => onDelete(index)
|
|
210
|
+
}, deleteIcon)) : React.createElement("span", {
|
|
211
|
+
onClick: () => onDelete(index)
|
|
212
|
+
}, deleteIcon));
|
|
213
|
+
}
|
|
214
|
+
})));
|
|
215
|
+
}
|
|
216
|
+
}
|