tntd 2.6.8 → 2.6.10
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 +26 -0
- package/es/actions/index.js.map +1 -0
- package/es/actions/index.less +70 -0
- package/es/cascader/index.js +5 -1
- package/es/cascader/index.js.map +1 -1
- package/es/check-card/group.js +197 -0
- package/es/check-card/group.js.map +1 -0
- package/es/check-card/index.js +163 -0
- package/es/check-card/index.js.map +1 -0
- package/es/check-card/index.less +179 -0
- package/es/checkbox/checkbox-group.js +5 -0
- package/es/checkbox/checkbox-group.js.map +1 -0
- package/es/checkbox/index.js +5 -0
- package/es/checkbox/index.js.map +1 -1
- package/es/color-picker/ColorPicker.js +1 -1
- package/es/color-picker/ColorPicker.js.map +1 -1
- package/es/color-picker/index.less +1 -1
- 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/index.js +4 -0
- package/es/config-provider/index.js.map +1 -1
- package/es/connect/index.js +29 -0
- package/es/connect/index.js.map +1 -0
- package/es/date-picker/index.js +15 -1
- package/es/date-picker/index.js.map +1 -1
- package/es/ellipsis/index.js +1 -1
- package/es/ellipsis/index.js.map +1 -1
- package/es/ellipsis/index.less +1 -1
- package/es/handle/index.js +13 -5
- package/es/handle/index.js.map +1 -1
- package/es/handle/index.less +1 -1
- package/es/index.js +8 -1
- package/es/index.js.map +1 -1
- package/es/index.less +5 -0
- package/es/input/input.js +19 -10
- 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/label/label.js +140 -0
- package/es/label/label.js.map +1 -0
- package/es/label/label.test.js +12 -0
- package/es/label/label.test.js.map +1 -0
- package/es/locale/en_US.js +4 -2
- package/es/locale/en_US.js.map +1 -1
- package/es/locale/zh_CN.js +4 -2
- package/es/locale/zh_CN.js.map +1 -1
- package/es/page/Box.js +1 -1
- package/es/page/Box.js.map +1 -1
- package/es/page/index.js +1 -1
- package/es/page/index.js.map +1 -1
- package/es/page/index.less +5 -5
- package/es/preview-text/index.js +265 -0
- package/es/preview-text/index.js.map +1 -0
- package/es/preview-text/index.less +3 -0
- package/es/query-form/Field/SelectInput.js +7 -5
- package/es/query-form/Field/SelectInput.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 +5 -0
- package/es/radio/radio-group.js.map +1 -0
- package/es/segmented/index.js +67 -0
- package/es/segmented/index.js.map +1 -0
- package/es/segmented/index.less +138 -0
- package/es/select/index.js.map +1 -1
- package/es/select/select.js +25 -3
- 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 +10 -0
- package/es/switch/switch.js.map +1 -0
- package/es/table/table.js +10 -4
- package/es/table/table.js.map +1 -1
- package/es/table/total-shower.js +10 -0
- package/es/table/total-shower.js.map +1 -0
- package/es/time-picker/index.js +3 -1
- package/es/time-picker/index.js.map +1 -1
- package/es/title/index.js +9 -11
- package/es/title/index.js.map +1 -1
- package/es/title/index.less +10 -10
- package/es/tntd-form/ErrorList.js +87 -0
- package/es/tntd-form/ErrorList.js.map +1 -0
- package/es/tntd-form/Form.js +122 -0
- package/es/tntd-form/Form.js.map +1 -0
- package/es/tntd-form/FormItem/ItemHolder.js +144 -0
- package/es/tntd-form/FormItem/ItemHolder.js.map +1 -0
- package/es/tntd-form/FormItem/index.js +264 -0
- package/es/tntd-form/FormItem/index.js.map +1 -0
- package/es/tntd-form/FormItemInput.js +79 -0
- package/es/tntd-form/FormItemInput.js.map +1 -0
- package/es/tntd-form/FormItemLabel.js +98 -0
- package/es/tntd-form/FormItemLabel.js.map +1 -0
- package/es/tntd-form/FormList.js +40 -0
- package/es/tntd-form/FormList.js.map +1 -0
- package/es/tntd-form/_util/motion.js +47 -0
- package/es/tntd-form/_util/motion.js.map +1 -0
- package/es/tntd-form/_util/reactNode.js +16 -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 +3 -0
- package/es/tntd-form/_util/type.js.map +1 -0
- package/es/tntd-form/_util/warning.js +5 -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 +40 -0
- package/es/tntd-form/context.js.map +1 -0
- package/es/tntd-form/hooks/useDebounce.js +13 -0
- package/es/tntd-form/hooks/useDebounce.js.map +1 -0
- package/es/tntd-form/hooks/useForm.js +40 -0
- package/es/tntd-form/hooks/useForm.js.map +1 -0
- package/es/tntd-form/hooks/useFormInstance.js +8 -0
- package/es/tntd-form/hooks/useFormInstance.js.map +1 -0
- package/es/tntd-form/hooks/useFormItemStatus.js +13 -0
- package/es/tntd-form/hooks/useFormItemStatus.js.map +1 -0
- package/es/tntd-form/hooks/useFrameState.js +37 -0
- package/es/tntd-form/hooks/useFrameState.js.map +1 -0
- package/es/tntd-form/hooks/useItemRef.js +20 -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 +2 -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 +5 -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 +786 -0
- package/es/tntd-form/tntd-form.stories.js.map +1 -0
- package/es/tntd-form/util.js +18 -0
- package/es/tntd-form/util.js.map +1 -0
- package/es/tntd-form/validateMessagesContext.js +5 -0
- package/es/tntd-form/validateMessagesContext.js.map +1 -0
- package/es/tntd-modal/index.js +71 -56
- package/es/tntd-modal/index.js.map +1 -1
- package/es/tntd-modal/index.less +83 -63
- package/es/tree-select/index.js +4 -1
- package/es/tree-select/index.js.map +1 -1
- package/es/upload/index.js +8 -1
- package/es/upload/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 +10 -0
- package/es/utils/simple-template.js.map +1 -0
- package/es/water-mark/index.js +110 -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 +34 -0
- package/lib/actions/index.js.map +1 -0
- package/lib/actions/index.less +70 -0
- package/lib/cascader/index.d.ts +6 -1
- package/lib/cascader/index.d.ts.map +1 -1
- package/lib/cascader/index.js +10 -3
- package/lib/cascader/index.js.map +1 -1
- 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 +236 -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 +178 -0
- package/lib/check-card/index.js.map +1 -0
- package/lib/check-card/index.less +179 -0
- 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 +13 -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 +16 -0
- package/lib/checkbox/index.js.map +1 -1
- package/lib/color-picker/ColorPicker.js +1 -1
- package/lib/color-picker/ColorPicker.js.map +1 -1
- package/lib/color-picker/index.less +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 +22 -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 +23 -0
- package/lib/config-provider/SizeContext.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 +15 -0
- 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 +50 -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 +29 -3
- package/lib/date-picker/index.js.map +1 -1
- package/lib/ellipsis/index.js +1 -1
- package/lib/ellipsis/index.js.map +1 -1
- package/lib/ellipsis/index.less +1 -1
- package/lib/handle/index.d.ts.map +1 -1
- package/lib/handle/index.js +13 -4
- 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 +22 -0
- package/lib/index.js.map +1 -1
- package/lib/index.less +5 -0
- package/lib/input/input.d.ts +5 -0
- package/lib/input/input.d.ts.map +1 -1
- package/lib/input/input.js +18 -8
- 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 +4 -1
- package/lib/input-number/index.js.map +1 -1
- package/lib/label/label.d.ts +52 -0
- package/lib/label/label.d.ts.map +1 -0
- package/lib/label/label.js +150 -0
- package/lib/label/label.js.map +1 -0
- package/lib/label/label.test.d.ts +2 -0
- package/lib/label/label.test.d.ts.map +1 -0
- package/lib/label/label.test.js +14 -0
- package/lib/label/label.test.js.map +1 -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 +4 -2
- 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 +4 -2
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/page/Box.js +1 -1
- package/lib/page/Box.js.map +1 -1
- package/lib/page/index.js +1 -1
- package/lib/page/index.js.map +1 -1
- package/lib/page/index.less +5 -5
- 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 +278 -0
- package/lib/preview-text/index.js.map +1 -0
- package/lib/preview-text/index.less +3 -0
- package/lib/query-form/Field/SelectInput.d.ts.map +1 -1
- package/lib/query-form/Field/SelectInput.js +6 -4
- package/lib/query-form/Field/SelectInput.js.map +1 -1
- package/lib/radio/index.d.ts.map +1 -1
- package/lib/radio/index.js +4 -0
- 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 +13 -0
- package/lib/radio/radio-group.js.map +1 -0
- package/lib/segmented/index.d.ts +23 -0
- package/lib/segmented/index.d.ts.map +1 -0
- package/lib/segmented/index.js +80 -0
- package/lib/segmented/index.js.map +1 -0
- package/lib/segmented/index.less +138 -0
- package/lib/select/index.d.ts +2 -1
- package/lib/select/index.d.ts.map +1 -1
- package/lib/select/index.js.map +1 -1
- package/lib/select/select.d.ts +12 -0
- package/lib/select/select.d.ts.map +1 -1
- package/lib/select/select.js +25 -4
- package/lib/select/select.js.map +1 -1
- package/lib/svg-components/illustration-403.d.ts +1 -1
- package/lib/svg-components/illustration-404.d.ts +1 -1
- package/lib/svg-components/illustration-500.d.ts +1 -1
- package/lib/svg-components/illustration-empty.d.ts +1 -1
- package/lib/svg-components/illustration-failure.d.ts +1 -1
- package/lib/svg-components/illustration-no-access.d.ts +1 -1
- package/lib/svg-components/illustration-no-chart.d.ts +1 -1
- package/lib/svg-components/illustration-no-result.d.ts +1 -1
- package/lib/svg-components/illustration-offline.d.ts +1 -1
- package/lib/svg-components/illustration-success.d.ts +1 -1
- package/lib/switch/index.d.ts +2 -3
- package/lib/switch/index.d.ts.map +1 -1
- package/lib/switch/index.js +1 -2
- 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 +37 -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.d.ts +1 -1
- package/lib/table/table.d.ts.map +1 -1
- package/lib/table/table.js +14 -7
- package/lib/table/table.js.map +1 -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 +17 -0
- package/lib/table/total-shower.js.map +1 -0
- 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 +3 -1
- package/lib/time-picker/index.js.map +1 -1
- package/lib/title/index.d.ts +11 -1
- package/lib/title/index.d.ts.map +1 -1
- package/lib/title/index.js +8 -10
- package/lib/title/index.js.map +1 -1
- package/lib/title/index.less +10 -10
- package/lib/tntd-cascader/AntdCascader/config/utils.d.ts +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 +104 -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 +160 -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 +163 -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 +301 -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 +92 -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 +106 -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 +56 -0
- package/lib/tntd-form/FormList.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 +59 -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 +27 -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 +21 -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 +20 -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 +54 -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 +31 -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 +63 -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 +13 -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 +20 -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 +55 -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 +28 -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 +24 -8
- 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 +7 -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 +6 -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 +888 -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 +25 -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 +12 -0
- package/lib/tntd-form/validateMessagesContext.js.map +1 -0
- 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 +76 -61
- 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 -1
- package/lib/tree-select/index.d.ts.map +1 -1
- package/lib/tree-select/index.js +9 -3
- package/lib/tree-select/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 -1
- package/lib/upload/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 +12 -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 +19 -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 +142 -0
- package/lib/water-mark/index.js.map +1 -0
- package/package.json +26 -5
- package/themes/default/variables.less +43 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { FormProviderProps as RcFormProviderProps } from 'rc-field-form/lib/FormContext';
|
|
2
|
+
import type { Meta } from 'rc-field-form/lib/interface';
|
|
3
|
+
import type { FC, PropsWithChildren, ReactNode } from 'react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import type { ColProps } from '../col';
|
|
6
|
+
import type { FormInstance, RequiredMark } from './Form';
|
|
7
|
+
import type { ValidateStatus } from './FormItem';
|
|
8
|
+
import type { FormLabelAlign } from './interface';
|
|
9
|
+
/** Form Context. Set top form style and pass to Form Item usage. */
|
|
10
|
+
export interface FormContextProps {
|
|
11
|
+
vertical: boolean;
|
|
12
|
+
name?: string;
|
|
13
|
+
colon?: boolean;
|
|
14
|
+
labelAlign?: FormLabelAlign;
|
|
15
|
+
labelWrap?: boolean;
|
|
16
|
+
labelCol?: ColProps;
|
|
17
|
+
wrapperCol?: ColProps;
|
|
18
|
+
requiredMark?: RequiredMark;
|
|
19
|
+
itemRef: (name: (string | number)[]) => (node: React.ReactElement) => void;
|
|
20
|
+
form?: FormInstance;
|
|
21
|
+
readonly?: boolean;
|
|
22
|
+
placeholder?: string | React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare const FormContext: React.Context<FormContextProps>;
|
|
25
|
+
/** `noStyle` Form Item Context. Used for error collection */
|
|
26
|
+
export declare type ReportMetaChange = (meta: Meta, uniqueKeys: React.Key[]) => void;
|
|
27
|
+
export declare const NoStyleItemContext: React.Context<ReportMetaChange | null>;
|
|
28
|
+
/** Form Provider */
|
|
29
|
+
export interface FormProviderProps extends Omit<RcFormProviderProps, 'validateMessages'> {
|
|
30
|
+
prefixCls?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const FormProvider: React.FC<FormProviderProps>;
|
|
33
|
+
/** Used for ErrorList only */
|
|
34
|
+
export interface FormItemPrefixContextProps {
|
|
35
|
+
prefixCls: string;
|
|
36
|
+
status?: ValidateStatus;
|
|
37
|
+
}
|
|
38
|
+
export declare const FormItemPrefixContext: React.Context<FormItemPrefixContextProps>;
|
|
39
|
+
export interface FormItemStatusContextProps {
|
|
40
|
+
isFormItemInput?: boolean;
|
|
41
|
+
status?: ValidateStatus;
|
|
42
|
+
hasFeedback?: boolean;
|
|
43
|
+
feedbackIcon?: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
export declare const FormItemInputContext: React.Context<FormItemStatusContextProps>;
|
|
46
|
+
export declare type NoFormStyleProps = PropsWithChildren<{
|
|
47
|
+
status?: boolean;
|
|
48
|
+
override?: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
export declare const NoFormStyle: FC<NoFormStyleProps>;
|
|
51
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/tntd-form/context.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,IAAI,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAC7F,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAEvD,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,oEAAoE;AACpE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,UAAU,CAAC,EAAE,QAAQ,CAAA;IACrB,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAA;IAC1E,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;CACvC;AAED,eAAO,MAAM,WAAW,iCAItB,CAAA;AAEF,6DAA6D;AAC7D,oBAAY,gBAAgB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,IAAI,CAAA;AAC5E,eAAO,MAAM,kBAAkB,wCAAqD,CAAA;AAEpF,oBAAoB;AACpB,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,kBAAkB,CAAC;IACtF,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAGpD,CAAA;AAED,8BAA8B;AAC9B,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB;AAED,eAAO,MAAM,qBAAqB,2CAEhC,CAAA;AAEF,MAAM,WAAW,0BAA0B;IACzC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,SAAS,CAAA;CACzB;AAED,eAAO,MAAM,oBAAoB,2CAAsD,CAAA;AAEvF,oBAAY,gBAAgB,GAAG,iBAAiB,CAAC;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAqB5C,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.NoStyleItemContext = exports.NoFormStyle = exports.FormProvider = exports.FormItemPrefixContext = exports.FormItemInputContext = exports.FormContext = void 0;
|
|
8
|
+
var _rcFieldForm = require("rc-field-form");
|
|
9
|
+
var _omit = _interopRequireDefault(require("rc-util/lib/omit"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
+
var FormContext = React.createContext({
|
|
15
|
+
labelAlign: 'right',
|
|
16
|
+
vertical: false,
|
|
17
|
+
itemRef: function itemRef() {}
|
|
18
|
+
});
|
|
19
|
+
exports.FormContext = FormContext;
|
|
20
|
+
var NoStyleItemContext = React.createContext(null);
|
|
21
|
+
exports.NoStyleItemContext = NoStyleItemContext;
|
|
22
|
+
var FormProvider = function FormProvider(props) {
|
|
23
|
+
var providerProps = (0, _omit["default"])(props, ['prefixCls']);
|
|
24
|
+
return React.createElement(_rcFieldForm.FormProvider, Object.assign({}, providerProps));
|
|
25
|
+
};
|
|
26
|
+
exports.FormProvider = FormProvider;
|
|
27
|
+
var FormItemPrefixContext = React.createContext({
|
|
28
|
+
prefixCls: ''
|
|
29
|
+
});
|
|
30
|
+
exports.FormItemPrefixContext = FormItemPrefixContext;
|
|
31
|
+
var FormItemInputContext = React.createContext({});
|
|
32
|
+
exports.FormItemInputContext = FormItemInputContext;
|
|
33
|
+
var NoFormStyle = function NoFormStyle(_ref) {
|
|
34
|
+
var children = _ref.children,
|
|
35
|
+
status = _ref.status,
|
|
36
|
+
override = _ref.override;
|
|
37
|
+
var formItemInputContext = (0, React.useContext)(FormItemInputContext);
|
|
38
|
+
var newFormItemInputContext = (0, React.useMemo)(function () {
|
|
39
|
+
var newContext = Object.assign({}, formItemInputContext);
|
|
40
|
+
if (override) {
|
|
41
|
+
delete newContext.isFormItemInput;
|
|
42
|
+
}
|
|
43
|
+
if (status) {
|
|
44
|
+
delete newContext.status;
|
|
45
|
+
delete newContext.hasFeedback;
|
|
46
|
+
delete newContext.feedbackIcon;
|
|
47
|
+
}
|
|
48
|
+
return newContext;
|
|
49
|
+
}, [status, override, formItemInputContext]);
|
|
50
|
+
return React.createElement(FormItemInputContext.Provider, {
|
|
51
|
+
value: newFormItemInputContext
|
|
52
|
+
}, children);
|
|
53
|
+
};
|
|
54
|
+
exports.NoFormStyle = NoFormStyle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/tntd-form/context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA8D;AAG9D,4DAAmC;AAEnC,6CAA8B;AAC9B,iCAA2C;AAsB9B,QAAA,WAAW,GAAG,KAAK,CAAC,aAAa,CAAmB;IAC/D,UAAU,EAAE,OAAO;IACnB,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAQ;CAC3B,CAAC,CAAA;AAIW,QAAA,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAA0B,IAAI,CAAC,CAAA;AAO7E,MAAM,YAAY,GAAgC,CAAC,KAAK,EAAE,EAAE;IACjE,MAAM,aAAa,GAAG,IAAA,cAAI,EAAC,KAAK,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;IAChD,OAAO,oBAAC,4BAAc,oBAAK,aAAa,EAAI,CAAA;AAC9C,CAAC,CAAA;AAHY,QAAA,YAAY,gBAGxB;AAQY,QAAA,qBAAqB,GAAG,KAAK,CAAC,aAAa,CAA6B;IACnF,SAAS,EAAE,EAAE;CACd,CAAC,CAAA;AASW,QAAA,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAA6B,EAAE,CAAC,CAAA;AAOhF,MAAM,WAAW,GAAyB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE;IAClF,MAAM,oBAAoB,GAAG,IAAA,kBAAU,EAAC,4BAAoB,CAAC,CAAA;IAE7D,MAAM,uBAAuB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAC3C,MAAM,UAAU,qBAAQ,oBAAoB,CAAE,CAAA;QAC9C,IAAI,QAAQ,EAAE;YACZ,OAAO,UAAU,CAAC,eAAe,CAAA;SAClC;QACD,IAAI,MAAM,EAAE;YACV,OAAO,UAAU,CAAC,MAAM,CAAA;YACxB,OAAO,UAAU,CAAC,WAAW,CAAA;YAC7B,OAAO,UAAU,CAAC,YAAY,CAAA;SAC/B;QACD,OAAO,UAAU,CAAA;IACnB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAA;IAE5C,OAAO,CACL,oBAAC,4BAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,uBAAuB,IAC1D,QAAQ,CACqB,CACjC,CAAA;AACH,CAAC,CAAA;AArBY,QAAA,WAAW,eAqBvB","sourcesContent":["import { FormProvider as RcFormProvider } from 'rc-field-form'\nimport type { FormProviderProps as RcFormProviderProps } from 'rc-field-form/lib/FormContext'\nimport type { Meta } from 'rc-field-form/lib/interface'\nimport omit from 'rc-util/lib/omit'\nimport type { FC, PropsWithChildren, ReactNode } from 'react'\nimport * as React from 'react'\nimport { useContext, useMemo } from 'react'\nimport type { ColProps } from '../col'\nimport type { FormInstance, RequiredMark } from './Form'\nimport type { ValidateStatus } from './FormItem'\nimport type { FormLabelAlign } from './interface'\n\n/** Form Context. Set top form style and pass to Form Item usage. */\nexport interface FormContextProps {\n vertical: boolean\n name?: string\n colon?: boolean\n labelAlign?: FormLabelAlign\n labelWrap?: boolean\n labelCol?: ColProps\n wrapperCol?: ColProps\n requiredMark?: RequiredMark\n itemRef: (name: (string | number)[]) => (node: React.ReactElement) => void\n form?: FormInstance\n readonly?: boolean\n placeholder?: string | React.ReactNode\n}\n\nexport const FormContext = React.createContext<FormContextProps>({\n labelAlign: 'right',\n vertical: false,\n itemRef: (() => {}) as any,\n})\n\n/** `noStyle` Form Item Context. Used for error collection */\nexport type ReportMetaChange = (meta: Meta, uniqueKeys: React.Key[]) => void\nexport const NoStyleItemContext = React.createContext<ReportMetaChange | null>(null)\n\n/** Form Provider */\nexport interface FormProviderProps extends Omit<RcFormProviderProps, 'validateMessages'> {\n prefixCls?: string\n}\n\nexport const FormProvider: React.FC<FormProviderProps> = (props) => {\n const providerProps = omit(props, ['prefixCls'])\n return <RcFormProvider {...providerProps} />\n}\n\n/** Used for ErrorList only */\nexport interface FormItemPrefixContextProps {\n prefixCls: string\n status?: ValidateStatus\n}\n\nexport const FormItemPrefixContext = React.createContext<FormItemPrefixContextProps>({\n prefixCls: '',\n})\n\nexport interface FormItemStatusContextProps {\n isFormItemInput?: boolean\n status?: ValidateStatus\n hasFeedback?: boolean\n feedbackIcon?: ReactNode\n}\n\nexport const FormItemInputContext = React.createContext<FormItemStatusContextProps>({})\n\nexport type NoFormStyleProps = PropsWithChildren<{\n status?: boolean\n override?: boolean\n}>\n\nexport const NoFormStyle: FC<NoFormStyleProps> = ({ children, status, override }) => {\n const formItemInputContext = useContext(FormItemInputContext)\n\n const newFormItemInputContext = useMemo(() => {\n const newContext = { ...formItemInputContext }\n if (override) {\n delete newContext.isFormItemInput\n }\n if (status) {\n delete newContext.status\n delete newContext.hasFeedback\n delete newContext.feedbackIcon\n }\n return newContext\n }, [status, override, formItemInputContext])\n\n return (\n <FormItemInputContext.Provider value={newFormItemInputContext}>\n {children}\n </FormItemInputContext.Provider>\n )\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebounce.d.ts","sourceRoot":"","sources":["../../../src/tntd-form/hooks/useDebounce.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAgBtD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = useDebounce;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
function useDebounce(value) {
|
|
18
|
+
var _React$useState = React.useState(value),
|
|
19
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
20
|
+
cacheValue = _React$useState2[0],
|
|
21
|
+
setCacheValue = _React$useState2[1];
|
|
22
|
+
React.useEffect(function () {
|
|
23
|
+
var timeout = setTimeout(function () {
|
|
24
|
+
setCacheValue(value);
|
|
25
|
+
}, value.length ? 0 : 10);
|
|
26
|
+
return function () {
|
|
27
|
+
clearTimeout(timeout);
|
|
28
|
+
};
|
|
29
|
+
}, [value]);
|
|
30
|
+
return cacheValue;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebounce.js","sourceRoot":"","sources":["../../../src/tntd-form/hooks/useDebounce.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA8B;AAE9B,SAAwB,WAAW,CAAI,KAAU;IAC/C,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IACzD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,OAAO,GAAG,UAAU,CACxB,GAAG,EAAE;YACH,aAAa,CAAC,KAAK,CAAC,CAAA;QACtB,CAAC,EACD,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CACtB,CAAA;QAED,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAA;QACvB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,OAAO,UAAU,CAAA;AACnB,CAAC;AAhBD,8BAgBC","sourcesContent":["import * as React from 'react'\n\nexport default function useDebounce<T>(value: T[]): T[] {\n const [cacheValue, setCacheValue] = React.useState(value)\n React.useEffect(() => {\n const timeout = setTimeout(\n () => {\n setCacheValue(value)\n },\n value.length ? 0 : 10\n )\n\n return () => {\n clearTimeout(timeout)\n }\n }, [value])\n\n return cacheValue\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FormInstance as RcFormInstance } from 'rc-field-form';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import type { InternalNamePath, NamePath, ScrollOptions } from '../interface';
|
|
4
|
+
export interface FormInstance<Values = any> extends RcFormInstance<Values> {
|
|
5
|
+
scrollToField: (name: NamePath, options?: ScrollOptions) => void;
|
|
6
|
+
/** @internal: This is an internal usage. Do not use in your prod */
|
|
7
|
+
__INTERNAL__: {
|
|
8
|
+
/** No! Do not use this in your code! */
|
|
9
|
+
name?: string;
|
|
10
|
+
/** No! Do not use this in your code! */
|
|
11
|
+
itemRef: (name: InternalNamePath) => (node: React.ReactElement) => void;
|
|
12
|
+
};
|
|
13
|
+
getFieldInstance: (name: NamePath) => any;
|
|
14
|
+
}
|
|
15
|
+
export default function useForm<Values = any>(form?: FormInstance<Values>): [FormInstance<Values>];
|
|
16
|
+
//# sourceMappingURL=useForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../src/tntd-form/hooks/useForm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAG7E,MAAM,WAAW,YAAY,CAAC,MAAM,GAAG,GAAG,CAAE,SAAQ,cAAc,CAAC,MAAM,CAAC;IACxE,aAAa,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,IAAI,CAAA;IAChE,oEAAoE;IACpE,YAAY,EAAE;QACZ,wCAAwC;QACxC,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,wCAAwC;QACxC,OAAO,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAA;KACxE,CAAA;IACD,gBAAgB,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,GAAG,CAAA;CAC1C;AAOD,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAwCjG"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = useForm;
|
|
8
|
+
var _rcFieldForm = require("rc-field-form");
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _scrollIntoViewIfNeeded = _interopRequireDefault(require("scroll-into-view-if-needed"));
|
|
11
|
+
var _util = require("../util");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
19
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
20
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
+
function toNamePathStr(name) {
|
|
22
|
+
var namePath = (0, _util.toArray)(name);
|
|
23
|
+
return namePath.join('_');
|
|
24
|
+
}
|
|
25
|
+
function useForm(form) {
|
|
26
|
+
var _useRcForm = (0, _rcFieldForm.useForm)(),
|
|
27
|
+
_useRcForm2 = _slicedToArray(_useRcForm, 1),
|
|
28
|
+
rcForm = _useRcForm2[0];
|
|
29
|
+
var itemsRef = React.useRef({});
|
|
30
|
+
var wrapForm = React.useMemo(function () {
|
|
31
|
+
return form !== null && form !== void 0 ? form : Object.assign(Object.assign({}, rcForm), {
|
|
32
|
+
__INTERNAL__: {
|
|
33
|
+
itemRef: function itemRef(name) {
|
|
34
|
+
return function (node) {
|
|
35
|
+
var namePathStr = toNamePathStr(name);
|
|
36
|
+
if (node) {
|
|
37
|
+
itemsRef.current[namePathStr] = node;
|
|
38
|
+
} else {
|
|
39
|
+
delete itemsRef.current[namePathStr];
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
scrollToField: function scrollToField(name) {
|
|
45
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
46
|
+
var namePath = (0, _util.toArray)(name);
|
|
47
|
+
var fieldId = (0, _util.getFieldId)(namePath, wrapForm.__INTERNAL__.name);
|
|
48
|
+
var node = fieldId ? document.getElementById(fieldId) : null;
|
|
49
|
+
if (node) {
|
|
50
|
+
(0, _scrollIntoViewIfNeeded["default"])(node, Object.assign({
|
|
51
|
+
scrollMode: 'if-needed',
|
|
52
|
+
block: 'nearest'
|
|
53
|
+
}, options));
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
getFieldInstance: function getFieldInstance(name) {
|
|
57
|
+
var namePathStr = toNamePathStr(name);
|
|
58
|
+
return itemsRef.current[namePathStr];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}, [form, rcForm]);
|
|
62
|
+
return [wrapForm];
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForm.js","sourceRoot":"","sources":["../../../src/tntd-form/hooks/useForm.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iDAAoD;AACpD,6CAA8B;AAC9B,4FAAuD;AAEvD,kCAA6C;AAc7C,SAAS,aAAa,CAAC,IAAc;IACnC,MAAM,QAAQ,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,CAAA;IAC9B,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC3B,CAAC;AAED,SAAwB,OAAO,CAAe,IAA2B;IACvE,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,uBAAS,GAAE,CAAA;IAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAqC,EAAE,CAAC,CAAA;IAErE,MAAM,QAAQ,GAAyB,KAAK,CAAC,OAAO,CAClD,GAAG,EAAE,CACH,IAAI,aAAJ,IAAI,cAAJ,IAAI,mCACC,MAAM,KACT,YAAY,EAAE;YACZ,OAAO,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,CAAC,IAAwB,EAAE,EAAE;gBAChE,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;gBACvC,IAAI,IAAI,EAAE;oBACR,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAAA;iBACrC;qBAAM;oBACL,OAAO,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;iBACrC;YACH,CAAC;SACF,EACD,aAAa,EAAE,CAAC,IAAc,EAAE,UAAyB,EAAE,EAAE,EAAE;YAC7D,MAAM,QAAQ,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,CAAA;YAC9B,MAAM,OAAO,GAAG,IAAA,iBAAU,EAAC,QAAQ,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;YAChE,MAAM,IAAI,GAAuB,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;YAElF,IAAI,IAAI,EAAE;gBACR,IAAA,oCAAc,EAAC,IAAI,kBACjB,UAAU,EAAE,WAAW,EACvB,KAAK,EAAE,SAAS,IACb,OAAO,EACV,CAAA;aACH;QACH,CAAC,EACD,gBAAgB,EAAE,CAAC,IAAc,EAAE,EAAE;YACnC,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;YACvC,OAAO,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QACtC,CAAC,GACF,EACH,CAAC,IAAI,EAAE,MAAM,CAAC,CACf,CAAA;IAED,OAAO,CAAC,QAAQ,CAAC,CAAA;AACnB,CAAC;AAxCD,0BAwCC","sourcesContent":["import type { FormInstance as RcFormInstance } from 'rc-field-form'\nimport { useForm as useRcForm } from 'rc-field-form'\nimport * as React from 'react'\nimport scrollIntoView from 'scroll-into-view-if-needed'\nimport type { InternalNamePath, NamePath, ScrollOptions } from '../interface'\nimport { getFieldId, toArray } from '../util'\n\nexport interface FormInstance<Values = any> extends RcFormInstance<Values> {\n scrollToField: (name: NamePath, options?: ScrollOptions) => void\n /** @internal: This is an internal usage. Do not use in your prod */\n __INTERNAL__: {\n /** No! Do not use this in your code! */\n name?: string\n /** No! Do not use this in your code! */\n itemRef: (name: InternalNamePath) => (node: React.ReactElement) => void\n }\n getFieldInstance: (name: NamePath) => any\n}\n\nfunction toNamePathStr(name: NamePath) {\n const namePath = toArray(name)\n return namePath.join('_')\n}\n\nexport default function useForm<Values = any>(form?: FormInstance<Values>): [FormInstance<Values>] {\n const [rcForm] = useRcForm()\n const itemsRef = React.useRef<Record<string, React.ReactElement>>({})\n\n const wrapForm: FormInstance<Values> = React.useMemo(\n () =>\n form ?? {\n ...rcForm,\n __INTERNAL__: {\n itemRef: (name: InternalNamePath) => (node: React.ReactElement) => {\n const namePathStr = toNamePathStr(name)\n if (node) {\n itemsRef.current[namePathStr] = node\n } else {\n delete itemsRef.current[namePathStr]\n }\n },\n },\n scrollToField: (name: NamePath, options: ScrollOptions = {}) => {\n const namePath = toArray(name)\n const fieldId = getFieldId(namePath, wrapForm.__INTERNAL__.name)\n const node: HTMLElement | null = fieldId ? document.getElementById(fieldId) : null\n\n if (node) {\n scrollIntoView(node, {\n scrollMode: 'if-needed',\n block: 'nearest',\n ...options,\n })\n }\n },\n getFieldInstance: (name: NamePath) => {\n const namePathStr = toNamePathStr(name)\n return itemsRef.current[namePathStr]\n },\n },\n [form, rcForm]\n )\n\n return [wrapForm]\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormInstance.d.ts","sourceRoot":"","sources":["../../../src/tntd-form/hooks/useFormInstance.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,GAAG,GAAG,KAAK,YAAY,CAAC,KAAK,CAAC,CAI1E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = useFormInstance;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _context = require("../context");
|
|
9
|
+
function useFormInstance() {
|
|
10
|
+
var _useContext = (0, _react.useContext)(_context.FormContext),
|
|
11
|
+
form = _useContext.form;
|
|
12
|
+
return form;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormInstance.js","sourceRoot":"","sources":["../../../src/tntd-form/hooks/useFormInstance.ts"],"names":[],"mappings":";;AAAA,iCAAkC;AAClC,wCAAwC;AAGxC,SAAwB,eAAe;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,kBAAU,EAAC,qBAAW,CAAC,CAAA;IAExC,OAAO,IAAK,CAAA;AACd,CAAC;AAJD,kCAIC","sourcesContent":["import { useContext } from 'react'\nimport { FormContext } from '../context'\nimport type { FormInstance } from './useForm'\n\nexport default function useFormInstance<Value = any>(): FormInstance<Value> {\n const { form } = useContext(FormContext)\n\n return form!\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormItemStatus.d.ts","sourceRoot":"","sources":["../../../src/tntd-form/hooks/useFormItemStatus.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIjD,aAAK,iBAAiB,GAAG,MAAM;IAC7B,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB,CAAA;AAED,QAAA,MAAM,iBAAiB,EAAE,iBAUxB,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _context = require("../context");
|
|
9
|
+
var _warning = _interopRequireDefault(require("../_util/warning"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
var useFormItemStatus = function useFormItemStatus() {
|
|
12
|
+
var _useContext = (0, _react.useContext)(_context.FormItemInputContext),
|
|
13
|
+
status = _useContext.status;
|
|
14
|
+
(0, _warning["default"])(status !== undefined, 'Form.Item', "Form.Item.useStatus should be used under Form.Item component. For more information: ".concat(window.location.protocol, "//").concat(window.location.host, "/components/form-cn/#Form.Item.useStatus"));
|
|
15
|
+
return {
|
|
16
|
+
status: status
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
var _default = useFormItemStatus;
|
|
20
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormItemStatus.js","sourceRoot":"","sources":["../../../src/tntd-form/hooks/useFormItemStatus.ts"],"names":[],"mappings":";;;;;AAAA,iCAAkC;AAElC,wCAAiD;AACjD,+DAAsC;AAMtC,MAAM,iBAAiB,GAAsB,GAAG,EAAE;IAChD,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAU,EAAC,8BAAoB,CAAC,CAAA;IAEnD,IAAA,iBAAO,EACL,MAAM,KAAK,SAAS,EACpB,WAAW,EACX,uFAAuF,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,IAAI,0CAA0C,CACnL,CAAA;IAED,OAAO,EAAE,MAAM,EAAE,CAAA;AACnB,CAAC,CAAA;AAED,kBAAe,iBAAiB,CAAA","sourcesContent":["import { useContext } from 'react'\nimport type { ValidateStatus } from '../FormItem'\nimport { FormItemInputContext } from '../context'\nimport warning from '../_util/warning'\n\ntype UseFormItemStatus = () => {\n status?: ValidateStatus\n}\n\nconst useFormItemStatus: UseFormItemStatus = () => {\n const { status } = useContext(FormItemInputContext)\n\n warning(\n status !== undefined,\n 'Form.Item',\n `Form.Item.useStatus should be used under Form.Item component. For more information: ${window.location.protocol}//${window.location.host}/components/form-cn/#Form.Item.useStatus`\n )\n\n return { status }\n}\n\nexport default useFormItemStatus\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFrameState.d.ts","sourceRoot":"","sources":["../../../src/tntd-form/hooks/useFrameState.ts"],"names":[],"mappings":"AAIA,aAAK,OAAO,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,KAAK,SAAS,CAAA;AAEzD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,SAAS,EAC7C,YAAY,EAAE,SAAS,GACtB,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC,CAwCpD"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = useFrameState;
|
|
8
|
+
var _raf = _interopRequireDefault(require("rc-util/lib/raf"));
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
17
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
18
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
+
function useFrameState(defaultValue) {
|
|
20
|
+
var _React$useState = React.useState(defaultValue),
|
|
21
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
22
|
+
value = _React$useState2[0],
|
|
23
|
+
setValue = _React$useState2[1];
|
|
24
|
+
var frameRef = (0, React.useRef)(null);
|
|
25
|
+
var batchRef = (0, React.useRef)([]);
|
|
26
|
+
var destroyRef = (0, React.useRef)(false);
|
|
27
|
+
React.useEffect(function () {
|
|
28
|
+
destroyRef.current = false;
|
|
29
|
+
return function () {
|
|
30
|
+
destroyRef.current = true;
|
|
31
|
+
_raf["default"].cancel(frameRef.current);
|
|
32
|
+
frameRef.current = null;
|
|
33
|
+
};
|
|
34
|
+
}, []);
|
|
35
|
+
function setFrameValue(updater) {
|
|
36
|
+
if (destroyRef.current) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (frameRef.current === null) {
|
|
40
|
+
batchRef.current = [];
|
|
41
|
+
frameRef.current = (0, _raf["default"])(function () {
|
|
42
|
+
frameRef.current = null;
|
|
43
|
+
setValue(function (prevValue) {
|
|
44
|
+
var current = prevValue;
|
|
45
|
+
batchRef.current.forEach(function (func) {
|
|
46
|
+
current = func(current);
|
|
47
|
+
});
|
|
48
|
+
return current;
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
batchRef.current.push(updater);
|
|
53
|
+
}
|
|
54
|
+
return [value, setFrameValue];
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFrameState.js","sourceRoot":"","sources":["../../../src/tntd-form/hooks/useFrameState.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAiC;AACjC,6CAA8B;AAC9B,iCAA8B;AAI9B,SAAwB,aAAa,CACnC,YAAuB;IAEvB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA;IACtD,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAgB,IAAI,CAAC,CAAA;IAC5C,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAuB,EAAE,CAAC,CAAA;IACjD,MAAM,UAAU,GAAG,IAAA,cAAM,EAAC,KAAK,CAAC,CAAA;IAEhC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,UAAU,CAAC,OAAO,GAAG,KAAK,CAAA;QAC1B,OAAO,GAAG,EAAE;YACV,UAAU,CAAC,OAAO,GAAG,IAAI,CAAA;YACzB,aAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAQ,CAAC,CAAA;YAC7B,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAA;QACzB,CAAC,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,SAAS,aAAa,CAAC,OAA2B;QAChD,IAAI,UAAU,CAAC,OAAO,EAAE;YACtB,OAAM;SACP;QAED,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,EAAE;YAC7B,QAAQ,CAAC,OAAO,GAAG,EAAE,CAAA;YACrB,QAAQ,CAAC,OAAO,GAAG,IAAA,aAAG,EAAC,GAAG,EAAE;gBAC1B,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAA;gBACvB,QAAQ,CAAC,CAAC,SAAS,EAAE,EAAE;oBACrB,IAAI,OAAO,GAAG,SAAS,CAAA;oBAEvB,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;wBAChC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAA;oBACzB,CAAC,CAAC,CAAA;oBAEF,OAAO,OAAO,CAAA;gBAChB,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;SACH;QAED,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChC,CAAC;IAED,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,CAAA;AAC/B,CAAC;AA1CD,gCA0CC","sourcesContent":["import raf from 'rc-util/lib/raf'\nimport * as React from 'react'\nimport { useRef } from 'react'\n\ntype Updater<ValueType> = (prev?: ValueType) => ValueType\n\nexport default function useFrameState<ValueType>(\n defaultValue: ValueType\n): [ValueType, (updater: Updater<ValueType>) => void] {\n const [value, setValue] = React.useState(defaultValue)\n const frameRef = useRef<number | null>(null)\n const batchRef = useRef<Updater<ValueType>[]>([])\n const destroyRef = useRef(false)\n\n React.useEffect(() => {\n destroyRef.current = false\n return () => {\n destroyRef.current = true\n raf.cancel(frameRef.current!)\n frameRef.current = null\n }\n }, [])\n\n function setFrameValue(updater: Updater<ValueType>) {\n if (destroyRef.current) {\n return\n }\n\n if (frameRef.current === null) {\n batchRef.current = []\n frameRef.current = raf(() => {\n frameRef.current = null\n setValue((prevValue) => {\n let current = prevValue\n\n batchRef.current.forEach((func) => {\n current = func(current)\n })\n\n return current\n })\n })\n }\n\n batchRef.current.push(updater)\n }\n\n return [value, setFrameValue]\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useItemRef.d.ts","sourceRoot":"","sources":["../../../src/tntd-form/hooks/useItemRef.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,MAAM,CAAC,OAAO,UAAU,UAAU,uCAQkB,GAAG,gCActD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = useItemRef;
|
|
7
|
+
var _ref = require("rc-util/lib/ref");
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _context = require("../context");
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
13
|
+
function useItemRef() {
|
|
14
|
+
var _React$useContext = React.useContext(_context.FormContext),
|
|
15
|
+
itemRef = _React$useContext.itemRef;
|
|
16
|
+
var cacheRef = React.useRef({});
|
|
17
|
+
function getRef(name, children) {
|
|
18
|
+
var childrenRef = children && _typeof(children) === 'object' && children.ref;
|
|
19
|
+
var nameStr = name.join('_');
|
|
20
|
+
if (cacheRef.current.name !== nameStr || cacheRef.current.originRef !== childrenRef) {
|
|
21
|
+
cacheRef.current.name = nameStr;
|
|
22
|
+
cacheRef.current.originRef = childrenRef;
|
|
23
|
+
cacheRef.current.ref = (0, _ref.composeRef)(itemRef(name), childrenRef);
|
|
24
|
+
}
|
|
25
|
+
return cacheRef.current.ref;
|
|
26
|
+
}
|
|
27
|
+
return getRef;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useItemRef.js","sourceRoot":"","sources":["../../../src/tntd-form/hooks/useItemRef.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA4C;AAC5C,6CAA8B;AAC9B,wCAAwC;AAGxC,SAAwB,UAAU;IAChC,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,qBAAW,CAAC,CAAA;IACjD,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAI1B,EAAE,CAAC,CAAA;IAEN,SAAS,MAAM,CAAC,IAAsB,EAAE,QAAa;QACnD,MAAM,WAAW,GACf,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,GAAG,CAAA;QAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC9B,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,SAAS,KAAK,WAAW,EAAE;YACnF,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAA;YAC/B,QAAQ,CAAC,OAAO,CAAC,SAAS,GAAG,WAAW,CAAA;YACxC,QAAQ,CAAC,OAAO,CAAC,GAAG,GAAG,IAAA,gBAAU,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAA;SAC9D;QAED,OAAO,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAA;IAC7B,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAtBD,6BAsBC","sourcesContent":["import { composeRef } from 'rc-util/lib/ref'\nimport * as React from 'react'\nimport { FormContext } from '../context'\nimport type { InternalNamePath } from '../interface'\n\nexport default function useItemRef() {\n const { itemRef } = React.useContext(FormContext)\n const cacheRef = React.useRef<{\n name?: string\n originRef?: React.Ref<any>\n ref?: React.Ref<any>\n }>({})\n\n function getRef(name: InternalNamePath, children: any) {\n const childrenRef: React.Ref<React.ReactElement> =\n children && typeof children === 'object' && children.ref\n const nameStr = name.join('_')\n if (cacheRef.current.name !== nameStr || cacheRef.current.originRef !== childrenRef) {\n cacheRef.current.name = nameStr\n cacheRef.current.originRef = childrenRef\n cacheRef.current.ref = composeRef(itemRef(name), childrenRef)\n }\n\n return cacheRef.current.ref\n }\n\n return getRef\n}\n"]}
|
package/lib/tntd-form/index.d.ts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Rule, RuleObject, RuleRender } from 'rc-field-form/lib/interface';
|
|
2
|
+
import { FormProvider } from './context';
|
|
3
|
+
import ErrorList, { ErrorListProps } from './ErrorList';
|
|
4
|
+
import InternalForm, { FormInstance, FormProps, useForm, useWatch } from './Form';
|
|
5
|
+
import Item, { FormItemProps } from './FormItem';
|
|
6
|
+
import List, { FormListFieldData, FormListOperation, FormListProps } from './FormList';
|
|
7
|
+
import useFormInstance from './hooks/useFormInstance';
|
|
8
|
+
import './style/index.less';
|
|
9
|
+
declare type InternalFormType = typeof InternalForm;
|
|
10
|
+
declare type CompoundedComponent = InternalFormType & {
|
|
11
|
+
useForm: typeof useForm;
|
|
12
|
+
useFormInstance: typeof useFormInstance;
|
|
13
|
+
useWatch: typeof useWatch;
|
|
14
|
+
Item: typeof Item;
|
|
15
|
+
List: typeof List;
|
|
16
|
+
ErrorList: typeof ErrorList;
|
|
17
|
+
Provider: typeof FormProvider;
|
|
18
|
+
/** @deprecated Only for warning usage. Do not use. */
|
|
19
|
+
create: () => void;
|
|
20
|
+
};
|
|
21
|
+
declare const Form: CompoundedComponent;
|
|
22
|
+
export { FormInstance, FormProps, FormItemProps, ErrorListProps, Rule, RuleObject, RuleRender, FormListProps, FormListFieldData, FormListOperation, };
|
|
23
|
+
export default Form;
|
|
2
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tntd-form/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tntd-form/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE/E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,SAAS,EAAE,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,YAAY,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjF,OAAO,IAAI,EAAE,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,IAAI,EAAE,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AACtF,OAAO,eAAe,MAAM,yBAAyB,CAAA;AAErD,OAAO,oBAAoB,CAAA;AAE3B,aAAK,gBAAgB,GAAG,OAAO,YAAY,CAAA;AAE3C,aAAK,mBAAmB,GAAG,gBAAgB,GAAG;IAC5C,OAAO,EAAE,OAAO,OAAO,CAAA;IACvB,eAAe,EAAE,OAAO,eAAe,CAAA;IACvC,QAAQ,EAAE,OAAO,QAAQ,CAAA;IACzB,IAAI,EAAE,OAAO,IAAI,CAAA;IACjB,IAAI,EAAE,OAAO,IAAI,CAAA;IACjB,SAAS,EAAE,OAAO,SAAS,CAAA;IAC3B,QAAQ,EAAE,OAAO,YAAY,CAAA;IAE7B,sDAAsD;IACtD,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB,CAAA;AAED,QAAA,MAAM,IAAI,qBAAsC,CAAA;AAiBhD,OAAO,EACL,YAAY,EACZ,SAAS,EACT,aAAa,EACb,cAAc,EACd,IAAI,EACJ,UAAU,EACV,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,iBAAiB,GAClB,CAAA;AAED,eAAe,IAAI,CAAA"}
|
package/lib/tntd-form/index.js
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _context = require("./context");
|
|
9
|
+
var _ErrorList = _interopRequireDefault(require("./ErrorList"));
|
|
10
|
+
var _Form = _interopRequireWildcard(require("./Form"));
|
|
11
|
+
var _FormItem = _interopRequireDefault(require("./FormItem"));
|
|
12
|
+
var _FormList = _interopRequireDefault(require("./FormList"));
|
|
13
|
+
var _useFormInstance = _interopRequireDefault(require("./hooks/useFormInstance"));
|
|
14
|
+
require("./style/index.less");
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
18
|
+
// import warning from '../_util/warning';
|
|
19
|
+
|
|
20
|
+
var Form = _Form["default"];
|
|
21
|
+
Form.Item = _FormItem["default"];
|
|
22
|
+
Form.List = _FormList["default"];
|
|
23
|
+
Form.ErrorList = _ErrorList["default"];
|
|
24
|
+
Form.useForm = _Form.useForm;
|
|
25
|
+
Form.useFormInstance = _useFormInstance["default"];
|
|
26
|
+
Form.useWatch = _Form.useWatch;
|
|
27
|
+
Form.Provider = _context.FormProvider;
|
|
28
|
+
var _default = Form;
|
|
29
|
+
exports["default"] = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-form/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-form/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA0C;AAC1C,uCAAwC;AACxC,4DAAuD;AACvD,+CAAiF;AACjF,0DAAgD;AAChD,0DAAsF;AACtF,8EAAqD;AAErD,8BAA2B;AAiB3B,MAAM,IAAI,GAAG,cAAmC,CAAA;AAEhD,IAAI,CAAC,IAAI,GAAG,kBAAI,CAAA;AAChB,IAAI,CAAC,IAAI,GAAG,kBAAI,CAAA;AAChB,IAAI,CAAC,SAAS,GAAG,mBAAS,CAAA;AAC1B,IAAI,CAAC,OAAO,GAAG,cAAO,CAAA;AACtB,IAAI,CAAC,eAAe,GAAG,yBAAe,CAAA;AACtC,IAAI,CAAC,QAAQ,GAAG,eAAQ,CAAA;AACxB,IAAI,CAAC,QAAQ,GAAG,sBAAY,CAAA;AAsB5B,kBAAe,IAAI,CAAA","sourcesContent":["import type { Rule, RuleObject, RuleRender } from 'rc-field-form/lib/interface'\n// import warning from '../_util/warning';\nimport { FormProvider } from './context'\nimport ErrorList, { ErrorListProps } from './ErrorList'\nimport InternalForm, { FormInstance, FormProps, useForm, useWatch } from './Form'\nimport Item, { FormItemProps } from './FormItem'\nimport List, { FormListFieldData, FormListOperation, FormListProps } from './FormList'\nimport useFormInstance from './hooks/useFormInstance'\n\nimport './style/index.less'\n\ntype InternalFormType = typeof InternalForm\n\ntype CompoundedComponent = InternalFormType & {\n useForm: typeof useForm\n useFormInstance: typeof useFormInstance\n useWatch: typeof useWatch\n Item: typeof Item\n List: typeof List\n ErrorList: typeof ErrorList\n Provider: typeof FormProvider\n\n /** @deprecated Only for warning usage. Do not use. */\n create: () => void\n}\n\nconst Form = InternalForm as CompoundedComponent\n\nForm.Item = Item\nForm.List = List\nForm.ErrorList = ErrorList\nForm.useForm = useForm\nForm.useFormInstance = useFormInstance\nForm.useWatch = useWatch\nForm.Provider = FormProvider\n// Form.create = () => {\n// warning(\n// false,\n// 'Form',\n// 'antd v4 removed `Form.create`. Please remove or use `@ant-design/compatible` instead.',\n// );\n// };\n\nexport {\n FormInstance,\n FormProps,\n FormItemProps,\n ErrorListProps,\n Rule,\n RuleObject,\n RuleRender,\n FormListProps,\n FormListFieldData,\n FormListOperation,\n}\n\nexport default Form\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/tntd-form/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC3F,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAA;AACrE,oBAAY,cAAc,GAAG,MAAM,GAAG,OAAO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/tntd-form/interface.ts"],"names":[],"mappings":";;AAAA,yDAA2F;AAC3F,yEAAqE","sourcesContent":["export { InternalNamePath, NamePath, Store, StoreValue } from 'rc-field-form/lib/interface'\nexport { Options as ScrollOptions } from 'scroll-into-view-if-needed'\nexport type FormLabelAlign = 'left' | 'right'\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// @import (reference) '../../style/themes/index';
|
|
2
|
+
|
|
3
|
+
@form-prefix-cls: ~'@{ant-prefix}-form';
|
|
4
|
+
@form-item-prefix-cls: ~'@{form-prefix-cls}-item';
|
|
5
|
+
|
|
6
|
+
// ================================================================
|
|
7
|
+
// = Children Component =
|
|
8
|
+
// ================================================================
|
|
9
|
+
// FIXME: useless, remove in v5
|
|
10
|
+
.@{form-item-prefix-cls} {
|
|
11
|
+
.@{ant-prefix}-input-number {
|
|
12
|
+
+ .@{form-prefix-cls}-text {
|
|
13
|
+
margin-left: 8px;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|