tntd 2.6.9 → 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 +1 -1
- 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/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 +1 -1
- 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/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,110 @@
|
|
|
1
|
+
import cn from 'classnames';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* 返回当前显示设备的物理像素分辨率与CSS像素分辨率之比
|
|
5
|
+
*
|
|
6
|
+
* @param context
|
|
7
|
+
* @see api 有些废弃了,其实类型 CanvasRenderingContext2D
|
|
8
|
+
*/
|
|
9
|
+
const getPixelRatio = context => {
|
|
10
|
+
if (!context) {
|
|
11
|
+
return 1;
|
|
12
|
+
}
|
|
13
|
+
const backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || 1;
|
|
14
|
+
return (window.devicePixelRatio || 1) / backingStore;
|
|
15
|
+
};
|
|
16
|
+
export const Watermark = props => {
|
|
17
|
+
const {
|
|
18
|
+
children,
|
|
19
|
+
style,
|
|
20
|
+
className,
|
|
21
|
+
markStyle,
|
|
22
|
+
markClassName,
|
|
23
|
+
// antd 内容层 zIndex 基本上在 10 以下 https://github.com/ant-design/ant-design/blob/6192403b2ce517c017f9e58a32d58774921c10cd/components/style/themes/default.less#L335
|
|
24
|
+
zIndex = 9,
|
|
25
|
+
gapX = 212,
|
|
26
|
+
gapY = 222,
|
|
27
|
+
width = 120,
|
|
28
|
+
height = 64,
|
|
29
|
+
rotate = -22,
|
|
30
|
+
// 默认旋转 -22 度
|
|
31
|
+
image,
|
|
32
|
+
content,
|
|
33
|
+
offsetLeft,
|
|
34
|
+
offsetTop,
|
|
35
|
+
fontStyle = 'normal',
|
|
36
|
+
textAlign = 'center',
|
|
37
|
+
fontWeight = 'normal',
|
|
38
|
+
fontColor = 'rgba(0,0,0,.15)',
|
|
39
|
+
fontSize = 14,
|
|
40
|
+
fontFamily = 'sans-serif',
|
|
41
|
+
prefixCls = 'tntd-watermark'
|
|
42
|
+
} = props;
|
|
43
|
+
const wrapperCls = cn([`${prefixCls}-wrapper`, className]);
|
|
44
|
+
const watermarkCls = cn([prefixCls, markClassName]);
|
|
45
|
+
const [base64Url, setBase64Url] = useState('');
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
const canvas = document.createElement('canvas');
|
|
48
|
+
const ctx = canvas.getContext('2d');
|
|
49
|
+
const ratio = getPixelRatio(ctx);
|
|
50
|
+
const canvasWidth = `${(gapX + width) * ratio}px`;
|
|
51
|
+
const canvasHeight = `${(gapY + height) * ratio}px`;
|
|
52
|
+
const canvasOffsetLeft = offsetLeft || gapX / 2;
|
|
53
|
+
const canvasOffsetTop = offsetTop || gapY / 2;
|
|
54
|
+
canvas.setAttribute('width', canvasWidth);
|
|
55
|
+
canvas.setAttribute('height', canvasHeight);
|
|
56
|
+
if (ctx) {
|
|
57
|
+
// 旋转字符 rotate
|
|
58
|
+
ctx.translate(canvasOffsetLeft * ratio, canvasOffsetTop * ratio);
|
|
59
|
+
ctx.rotate(Math.PI / 180 * Number(rotate));
|
|
60
|
+
const markWidth = width * ratio;
|
|
61
|
+
const markHeight = height * ratio;
|
|
62
|
+
if (image) {
|
|
63
|
+
const img = new Image();
|
|
64
|
+
img.crossOrigin = 'anonymous';
|
|
65
|
+
img.referrerPolicy = 'no-referrer';
|
|
66
|
+
img.src = image;
|
|
67
|
+
img.onload = () => {
|
|
68
|
+
ctx.drawImage(img, 0, 0, markWidth, markHeight);
|
|
69
|
+
setBase64Url(canvas.toDataURL());
|
|
70
|
+
};
|
|
71
|
+
} else if (content) {
|
|
72
|
+
const markSize = Number(fontSize) * ratio;
|
|
73
|
+
ctx.font = `${fontStyle} normal ${fontWeight} ${markSize}px/${markHeight}px ${fontFamily}`;
|
|
74
|
+
ctx.fillStyle = fontColor;
|
|
75
|
+
ctx.textAlign = textAlign;
|
|
76
|
+
if (Array.isArray(content)) {
|
|
77
|
+
content === null || content === void 0 ? void 0 : content.forEach((item, index) => ctx.fillText(item, 0, index * markSize));
|
|
78
|
+
} else {
|
|
79
|
+
ctx.fillText(content, 0, 0);
|
|
80
|
+
}
|
|
81
|
+
setBase64Url(canvas.toDataURL());
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
// eslint-disable-next-line no-console
|
|
85
|
+
console.error('当前环境不支持Canvas');
|
|
86
|
+
}
|
|
87
|
+
}, [gapX, gapY, offsetLeft, offsetTop, rotate, fontStyle, textAlign, fontWeight, width, height, fontFamily, fontColor, image, content, fontSize]);
|
|
88
|
+
return React.createElement("div", {
|
|
89
|
+
style: Object.assign({
|
|
90
|
+
position: 'relative'
|
|
91
|
+
}, style),
|
|
92
|
+
className: wrapperCls
|
|
93
|
+
}, children, React.createElement("div", {
|
|
94
|
+
className: watermarkCls,
|
|
95
|
+
style: Object.assign(Object.assign({
|
|
96
|
+
zIndex,
|
|
97
|
+
position: 'absolute',
|
|
98
|
+
left: 0,
|
|
99
|
+
top: 0,
|
|
100
|
+
width: '100%',
|
|
101
|
+
height: '100%',
|
|
102
|
+
backgroundSize: `${gapX + width}px`,
|
|
103
|
+
pointerEvents: 'none',
|
|
104
|
+
backgroundRepeat: 'repeat'
|
|
105
|
+
}, base64Url ? {
|
|
106
|
+
backgroundImage: `url('${base64Url}')`
|
|
107
|
+
} : {}), markStyle)
|
|
108
|
+
}));
|
|
109
|
+
};
|
|
110
|
+
export default Watermark;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/water-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,6BACE,KAAK,kBACH,QAAQ,EAAE,UAAU,IACjB,KAAK,GAEV,SAAS,EAAE,UAAU;QAEpB,QAAQ;QACT,6BACE,SAAS,EAAE,YAAY,EACvB,KAAK,gCACH,MAAM,EACN,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,CAAC,EACP,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,GAAG,IAAI,GAAG,KAAK,IAAI,EACnC,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,QAAQ,IACvB,CAAC,SAAS;gBACX,CAAC,CAAC;oBACE,eAAe,EAAE,QAAQ,SAAS,IAAI;iBACvC;gBACH,CAAC,CAAC,EAAE,CAAC,GACJ,SAAS,IAEd,CACE,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,SAAS,CAAA","sourcesContent":["import cn from 'classnames'\nimport React, { useEffect, useState } from 'react'\n\nexport interface WatermarkProps {\n /** 类名 */\n className?: string\n /** 样式 */\n style?: React.CSSProperties\n /** 水印样式 */\n markStyle?: React.CSSProperties\n /** 水印类名 */\n markClassName?: string\n /** 水印之间的水平间距 */\n gapX?: number\n /** 水印之间的垂直间距 */\n gapY?: number\n /** 追加的水印元素的z-index */\n zIndex?: number\n /** 水印的宽度 */\n width?: number\n /** 水印的高度 */\n height?: number\n /** 水印在canvas 画布上绘制的垂直偏移量,正常情况下,水印绘制在中间位置, 即 offsetTop = gapY / 2 */\n offsetTop?: number // 水印图片距离绘制 canvas 单元的顶部距离\n /** 水印在canvas 画布上绘制的水平偏移量, 正常情况下,水印绘制在中间位置, 即 offsetTop = gapX / 2 */\n offsetLeft?: number\n /** 水印绘制时,旋转的角度,单位 ° */\n rotate?: number\n /** ClassName 前缀 */\n prefixCls?: string\n /** 高清印图片源, 为了高清屏幕显示,建议使用 2倍或3倍图,优先使用图片渲染水印。 */\n image?: string\n /** 水印文字内容 */\n content?: string | string[]\n /** 文字颜色 */\n fontColor?: string\n /** 文字样式 */\n fontStyle?: 'none' | 'normal' | 'italic' | 'oblique'\n /** 文字对齐 */\n textAlign?: 'left' | 'center' | 'right'\n /** 文字族 */\n fontFamily?: string\n /** 文字粗细 */\n fontWeight?: 'normal' | 'light' | 'weight' | number\n /** 文字大小 */\n fontSize?: number | string\n\n children?: React.ReactNode\n}\n/**\n * 返回当前显示设备的物理像素分辨率与CSS像素分辨率之比\n *\n * @param context\n * @see api 有些废弃了,其实类型 CanvasRenderingContext2D\n */\nconst getPixelRatio = (context: any) => {\n if (!context) {\n return 1\n }\n const backingStore =\n context.backingStorePixelRatio ||\n context.webkitBackingStorePixelRatio ||\n context.mozBackingStorePixelRatio ||\n context.msBackingStorePixelRatio ||\n context.oBackingStorePixelRatio ||\n 1\n return (window.devicePixelRatio || 1) / backingStore\n}\n\nexport const Watermark: React.FC<WatermarkProps> = (props) => {\n const {\n children,\n style,\n className,\n markStyle,\n markClassName,\n // antd 内容层 zIndex 基本上在 10 以下 https://github.com/ant-design/ant-design/blob/6192403b2ce517c017f9e58a32d58774921c10cd/components/style/themes/default.less#L335\n zIndex = 9,\n gapX = 212,\n gapY = 222,\n width = 120,\n height = 64,\n rotate = -22, // 默认旋转 -22 度\n image,\n content,\n offsetLeft,\n offsetTop,\n fontStyle = 'normal',\n textAlign = 'center',\n fontWeight = 'normal',\n fontColor = 'rgba(0,0,0,.15)',\n fontSize = 14,\n fontFamily = 'sans-serif',\n prefixCls = 'tntd-watermark',\n } = props\n\n const wrapperCls = cn([`${prefixCls}-wrapper`, className])\n const watermarkCls = cn([prefixCls, markClassName])\n const [base64Url, setBase64Url] = useState('')\n\n useEffect(() => {\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n const ratio = getPixelRatio(ctx)\n\n const canvasWidth = `${(gapX + width) * ratio}px`\n const canvasHeight = `${(gapY + height) * ratio}px`\n const canvasOffsetLeft = offsetLeft || gapX / 2\n const canvasOffsetTop = offsetTop || gapY / 2\n\n canvas.setAttribute('width', canvasWidth)\n canvas.setAttribute('height', canvasHeight)\n\n if (ctx) {\n // 旋转字符 rotate\n ctx.translate(canvasOffsetLeft * ratio, canvasOffsetTop * ratio)\n ctx.rotate((Math.PI / 180) * Number(rotate))\n const markWidth = width * ratio\n const markHeight = height * ratio\n\n if (image) {\n const img = new Image()\n img.crossOrigin = 'anonymous'\n img.referrerPolicy = 'no-referrer'\n img.src = image\n img.onload = () => {\n ctx.drawImage(img, 0, 0, markWidth, markHeight)\n setBase64Url(canvas.toDataURL())\n }\n } else if (content) {\n const markSize = Number(fontSize) * ratio\n ctx.font = `${fontStyle} normal ${fontWeight} ${markSize}px/${markHeight}px ${fontFamily}`\n ctx.fillStyle = fontColor\n ctx.textAlign = textAlign\n if (Array.isArray(content)) {\n content?.forEach((item: string, index: number) => ctx.fillText(item, 0, index * markSize))\n } else {\n ctx.fillText(content, 0, 0)\n }\n setBase64Url(canvas.toDataURL())\n }\n } else {\n // eslint-disable-next-line no-console\n console.error('当前环境不支持Canvas')\n }\n }, [\n gapX,\n gapY,\n offsetLeft,\n offsetTop,\n rotate,\n fontStyle,\n textAlign,\n fontWeight,\n width,\n height,\n fontFamily,\n fontColor,\n image,\n content,\n fontSize,\n ])\n\n return (\n <div\n style={{\n position: 'relative',\n ...style,\n }}\n className={wrapperCls}\n >\n {children}\n <div\n className={watermarkCls}\n style={{\n zIndex,\n position: 'absolute',\n left: 0,\n top: 0,\n width: '100%',\n height: '100%',\n backgroundSize: `${gapX + width}px`,\n pointerEvents: 'none',\n backgroundRepeat: 'repeat',\n ...(base64Url\n ? {\n backgroundImage: `url('${base64Url}')`,\n }\n : {}),\n ...markStyle,\n }}\n />\n </div>\n )\n}\n\nexport default Watermark\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface ProCardActionsProps {
|
|
4
|
+
/**
|
|
5
|
+
* 自定义前缀
|
|
6
|
+
*
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
prefixCls?: string;
|
|
10
|
+
/** 操作按钮 */
|
|
11
|
+
actions?: React.ReactNode[] | React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare const ProCardActions: React.FC<ProCardActionsProps>;
|
|
14
|
+
export default ProCardActions;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,cAAc,CAAA;AAErB,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW;IACX,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,KAAK,CAAC,SAAS,CAAA;CAC9C;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAmBjD,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
require("./index.less");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
var ProCardActions = function ProCardActions(props) {
|
|
12
|
+
var actions = props.actions,
|
|
13
|
+
prefixCls = props.prefixCls;
|
|
14
|
+
if (Array.isArray(actions) && (actions === null || actions === void 0 ? void 0 : actions.length)) {
|
|
15
|
+
return _react["default"].createElement("ul", {
|
|
16
|
+
className: (0, _classnames["default"])("".concat(prefixCls, "-actions"))
|
|
17
|
+
}, actions.map(function (action, index) {
|
|
18
|
+
return _react["default"].createElement("li", {
|
|
19
|
+
style: {
|
|
20
|
+
width: "".concat(100 / actions.length, "%"),
|
|
21
|
+
padding: 0,
|
|
22
|
+
margin: 0
|
|
23
|
+
},
|
|
24
|
+
key: "action-".concat(index),
|
|
25
|
+
className: (0, _classnames["default"])("".concat(prefixCls, "-actions-item"))
|
|
26
|
+
}, action);
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
return _react["default"].createElement("ul", {
|
|
30
|
+
className: (0, _classnames["default"])("".concat(prefixCls, "-actions"))
|
|
31
|
+
}, actions);
|
|
32
|
+
};
|
|
33
|
+
var _default = ProCardActions;
|
|
34
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.tsx"],"names":[],"mappings":";;;;;AAAA,4DAAmC;AACnC,kDAAyB;AACzB,wBAAqB;AAarB,MAAM,cAAc,GAAkC,CAAC,KAAK,EAAE,EAAE;IAC9D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAEpC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAA,EAAE;QAC7C,OAAO,CACL,sCAAI,SAAS,EAAE,IAAA,oBAAU,EAAC,GAAG,SAAS,UAAU,CAAC,IAC9C,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,sCACE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EACnE,GAAG,EAAE,UAAU,KAAK,EAAE,EACtB,SAAS,EAAE,IAAA,oBAAU,EAAC,GAAG,SAAS,eAAe,CAAC,IAEjD,MAAM,CACJ,CACN,CAAC,CACC,CACN,CAAA;KACF;IACD,OAAO,sCAAI,SAAS,EAAE,IAAA,oBAAU,EAAC,GAAG,SAAS,UAAU,CAAC,IAAG,OAAO,CAAM,CAAA;AAC1E,CAAC,CAAA;AAED,kBAAe,cAAc,CAAA","sourcesContent":["import classNames from 'classnames'\nimport React from 'react'\nimport './index.less'\n\nexport interface ProCardActionsProps {\n /**\n * 自定义前缀\n *\n * @ignore\n */\n prefixCls?: string\n /** 操作按钮 */\n actions?: React.ReactNode[] | React.ReactNode\n}\n\nconst ProCardActions: React.FC<ProCardActionsProps> = (props) => {\n const { actions, prefixCls } = props\n\n if (Array.isArray(actions) && actions?.length) {\n return (\n <ul className={classNames(`${prefixCls}-actions`)}>\n {actions.map((action, index) => (\n <li\n style={{ width: `${100 / actions.length}%`, padding: 0, margin: 0 }}\n key={`action-${index}`}\n className={classNames(`${prefixCls}-actions-item`)}\n >\n {action}\n </li>\n ))}\n </ul>\n )\n }\n return <ul className={classNames(`${prefixCls}-actions`)}>{actions}</ul>\n}\n\nexport default ProCardActions\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.tntd-card-actions {
|
|
2
|
+
margin-block:0;
|
|
3
|
+
margin-inline:0;
|
|
4
|
+
padding-block:0;
|
|
5
|
+
padding-inline:0;
|
|
6
|
+
list-style:none;
|
|
7
|
+
display:flex;
|
|
8
|
+
gap:8px;
|
|
9
|
+
background:#ffffff;
|
|
10
|
+
border-block-start:1px solid rgba(5,5,5,0.06);
|
|
11
|
+
min-height:42px;
|
|
12
|
+
}
|
|
13
|
+
.tntd-card-actions>* {
|
|
14
|
+
align-items:center;
|
|
15
|
+
justify-content:center;
|
|
16
|
+
flex:1;
|
|
17
|
+
display:flex;
|
|
18
|
+
cursor:pointer;
|
|
19
|
+
color:rgba(42,46,54,0.65);
|
|
20
|
+
transition:color 0.3s;
|
|
21
|
+
}
|
|
22
|
+
.tntd-card-actions>*:hover {
|
|
23
|
+
color:#468fff;
|
|
24
|
+
}
|
|
25
|
+
.tntd-card-actions>li>div {
|
|
26
|
+
flex:1;
|
|
27
|
+
width:100%;
|
|
28
|
+
margin-block:12px;
|
|
29
|
+
margin-inline:0;
|
|
30
|
+
color:rgba(42,46,54,0.65);
|
|
31
|
+
text-align:center;
|
|
32
|
+
}
|
|
33
|
+
.tntd-card-actions>li>div a {
|
|
34
|
+
color:rgba(42,46,54,0.65);
|
|
35
|
+
transition:color 0.3s;
|
|
36
|
+
}
|
|
37
|
+
.tntd-card-actions>li>div a:hover {
|
|
38
|
+
color:#468fff;
|
|
39
|
+
}
|
|
40
|
+
.tntd-card-actions>li>div div {
|
|
41
|
+
position:relative;
|
|
42
|
+
display:block;
|
|
43
|
+
min-width:32px;
|
|
44
|
+
font-size:14px;
|
|
45
|
+
line-height:1.5714285714285714;
|
|
46
|
+
cursor:pointer;
|
|
47
|
+
}
|
|
48
|
+
.tntd-card-actions>li>div div:hover {
|
|
49
|
+
color:#468fff;
|
|
50
|
+
transition:color 0.3s;
|
|
51
|
+
}
|
|
52
|
+
.tntd-card-actions>li>div div a:not(.ant-btn),
|
|
53
|
+
.tntd-card-actions>li>div div >.anticon {
|
|
54
|
+
display:inline-block;
|
|
55
|
+
width:100%;
|
|
56
|
+
color:rgba(42,46,54,0.65);
|
|
57
|
+
line-height:22px;
|
|
58
|
+
transition:color 0.3s;
|
|
59
|
+
}
|
|
60
|
+
.tntd-card-actions>li>div div a:not(.ant-btn):hover,
|
|
61
|
+
.tntd-card-actions>li>div div >.anticon:hover {
|
|
62
|
+
color:#468fff;
|
|
63
|
+
}
|
|
64
|
+
.tntd-card-actions>li>div div .anticon {
|
|
65
|
+
font-size:16px;
|
|
66
|
+
line-height:22px;
|
|
67
|
+
}
|
|
68
|
+
.tntd-card-actions>li>div:not(:last-child) {
|
|
69
|
+
border-inline-end:1px solid rgba(5,5,5,0.06);
|
|
70
|
+
}
|
package/lib/cascader/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CascaderProps as AntdCascaderProps } from 'antd/lib/cascader';
|
|
2
3
|
import 'antd/lib/cascader/style';
|
|
3
4
|
export * from 'antd/lib/cascader';
|
|
5
|
+
export declare type CascaderProps = AntdCascaderProps & {
|
|
6
|
+
readonly?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const Cascader: import("react").ForwardRefExoticComponent<Pick<any, string | number | symbol> & import("react").RefAttributes<unknown>>;
|
|
4
9
|
export default Cascader;
|
|
5
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cascader/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cascader/index.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAI1E,OAAO,wBAAwB,CAAA;AAE/B,cAAc,kBAAkB,CAAA;AAEhC,oBAAY,aAAa,GAAG,iBAAiB,GAAG;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAGD,eAAO,MAAM,QAAQ,yHAA+D,CAAA;AAEpF,eAAe,QAAQ,CAAA"}
|
package/lib/cascader/index.js
CHANGED
|
@@ -4,8 +4,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
var _exportNames = {
|
|
8
|
-
|
|
7
|
+
var _exportNames = {
|
|
8
|
+
Cascader: true
|
|
9
|
+
};
|
|
10
|
+
exports["default"] = exports.Cascader = void 0;
|
|
9
11
|
var _cascader = _interopRequireWildcard(require("antd/lib/cascader"));
|
|
10
12
|
Object.keys(_cascader).forEach(function (key) {
|
|
11
13
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -18,8 +20,13 @@ Object.keys(_cascader).forEach(function (key) {
|
|
|
18
20
|
}
|
|
19
21
|
});
|
|
20
22
|
});
|
|
23
|
+
var _connect = require("../connect");
|
|
24
|
+
var _previewText = require("../preview-text");
|
|
21
25
|
require("antd/lib/cascader/style");
|
|
22
26
|
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); }
|
|
23
27
|
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; }
|
|
24
|
-
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
var Cascader = (0, _connect.connectReadonlyComponent)(_cascader["default"], _previewText.PreviewText.Cascader);
|
|
30
|
+
exports.Cascader = Cascader;
|
|
31
|
+
var _default = Cascader;
|
|
25
32
|
exports["default"] = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cascader/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cascader/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,gEAA2C;AAE3C,wCAAqD;AACrD,kDAA6C;AAE7C,kCAA+B;AAE/B,mDAAgC;AAMhC,aAAa;AACA,QAAA,QAAQ,GAAG,IAAA,kCAAwB,EAAC,kBAAY,EAAE,0BAAW,CAAC,QAAQ,CAAC,CAAA;AAEpF,kBAAe,gBAAQ,CAAA","sourcesContent":["import AntdCascader from 'antd/lib/cascader'\nimport type { CascaderProps as AntdCascaderProps } from 'antd/lib/cascader'\nimport { connectReadonlyComponent } from '../connect'\nimport { PreviewText } from '../preview-text'\n\nimport 'antd/lib/cascader/style'\n\nexport * from 'antd/lib/cascader'\n\nexport type CascaderProps = AntdCascaderProps & {\n readonly?: boolean\n}\n\n// @ts-ignore\nexport const Cascader = connectReadonlyComponent(AntdCascader, PreviewText.Cascader)\n\nexport default Cascader\n"]}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type CheckCardValueType = string | number | boolean;
|
|
3
|
+
export declare type CheckGroupValueType = CheckCardValueType[] | CheckCardValueType | undefined;
|
|
4
|
+
export interface CheckCardOptionType {
|
|
5
|
+
/**
|
|
6
|
+
* 标题展示
|
|
7
|
+
*
|
|
8
|
+
* @title 标题
|
|
9
|
+
*/
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* 选项值
|
|
13
|
+
*
|
|
14
|
+
* @title 值
|
|
15
|
+
*/
|
|
16
|
+
value: CheckCardValueType;
|
|
17
|
+
/**
|
|
18
|
+
* 描述展示
|
|
19
|
+
*
|
|
20
|
+
* @title 描述
|
|
21
|
+
*/
|
|
22
|
+
description?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* 组件尺寸,支持大,中,小三种默认尺寸,用户可以自定义宽高
|
|
25
|
+
*
|
|
26
|
+
* @default default
|
|
27
|
+
* @title 组件尺寸
|
|
28
|
+
*/
|
|
29
|
+
size?: 'large' | 'default' | 'small';
|
|
30
|
+
/**
|
|
31
|
+
* 左侧头像展示,可以是一个链接也可以是是一个 ReactNode
|
|
32
|
+
*
|
|
33
|
+
* @title 左侧头像区域
|
|
34
|
+
*/
|
|
35
|
+
avatar?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* 图片封面默认,该模式下其他展示值被忽略
|
|
38
|
+
*
|
|
39
|
+
* @title 图片封面
|
|
40
|
+
*/
|
|
41
|
+
cover?: React.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* 不可用
|
|
44
|
+
*
|
|
45
|
+
* @default false
|
|
46
|
+
* @title 不可用
|
|
47
|
+
*/
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
/** Change 回调 */
|
|
50
|
+
onChange?: (checked: boolean) => void;
|
|
51
|
+
}
|
|
52
|
+
export interface AbstractCheckCardGroupProps {
|
|
53
|
+
/** @ignore */
|
|
54
|
+
prefixCls?: string;
|
|
55
|
+
/** @ignore */
|
|
56
|
+
className?: string;
|
|
57
|
+
/** 指定可选项 */
|
|
58
|
+
options?: (CheckCardOptionType | string)[];
|
|
59
|
+
/** 整组失效 */
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
/** @ignore */
|
|
62
|
+
style?: React.CSSProperties;
|
|
63
|
+
/**
|
|
64
|
+
* 组件尺寸,支持大,中,小三种默认尺寸,用户可以自定义宽高
|
|
65
|
+
*
|
|
66
|
+
* @default default
|
|
67
|
+
*/
|
|
68
|
+
size?: 'large' | 'default' | 'small';
|
|
69
|
+
/**
|
|
70
|
+
* @acceptions CheckCard
|
|
71
|
+
* @ignore
|
|
72
|
+
*/
|
|
73
|
+
children?: React.ReactNode;
|
|
74
|
+
}
|
|
75
|
+
export declare const CardLoading: React.FC<{
|
|
76
|
+
prefixCls: string;
|
|
77
|
+
}>;
|
|
78
|
+
export interface CheckCardGroupProps extends AbstractCheckCardGroupProps {
|
|
79
|
+
/**
|
|
80
|
+
* 是否多选
|
|
81
|
+
*
|
|
82
|
+
* @title 是否多选
|
|
83
|
+
*/
|
|
84
|
+
multiple?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* 默认选中的选项
|
|
87
|
+
*
|
|
88
|
+
* @title 默认选中的选项
|
|
89
|
+
*/
|
|
90
|
+
defaultValue?: CheckGroupValueType;
|
|
91
|
+
/**
|
|
92
|
+
* 指定选中的选项
|
|
93
|
+
*
|
|
94
|
+
* @title 指定选中的选项
|
|
95
|
+
*/
|
|
96
|
+
value?: CheckGroupValueType;
|
|
97
|
+
/**
|
|
98
|
+
* 当卡片组内容还在加载中时,可以用 loading 展示一个占位
|
|
99
|
+
*
|
|
100
|
+
* @title 加载中
|
|
101
|
+
*/
|
|
102
|
+
loading?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* 是否显示边框
|
|
105
|
+
*
|
|
106
|
+
* @title 显示边框
|
|
107
|
+
*/
|
|
108
|
+
bordered?: boolean;
|
|
109
|
+
/** 变化时回调函数 */
|
|
110
|
+
onChange?: (checkedValue: CheckGroupValueType) => void;
|
|
111
|
+
}
|
|
112
|
+
export interface CheckCardGroupState {
|
|
113
|
+
value: CheckGroupValueType;
|
|
114
|
+
registeredValues: CheckCardValueType[];
|
|
115
|
+
}
|
|
116
|
+
export interface CheckCardGroupConnextType {
|
|
117
|
+
toggleOption?: (option: CheckCardOptionType) => void;
|
|
118
|
+
value?: any;
|
|
119
|
+
disabled?: boolean;
|
|
120
|
+
size?: 'default' | 'large' | 'small';
|
|
121
|
+
loading?: boolean;
|
|
122
|
+
bordered?: boolean;
|
|
123
|
+
multiple?: boolean;
|
|
124
|
+
registerValue?: (value: any) => void;
|
|
125
|
+
cancelValue?: (value: any) => void;
|
|
126
|
+
}
|
|
127
|
+
export declare const CheckCardGroupConnext: React.Context<CheckCardGroupConnextType | null>;
|
|
128
|
+
declare const CheckCardGroup: React.FC<CheckCardGroupProps>;
|
|
129
|
+
export default CheckCardGroup;
|
|
130
|
+
//# sourceMappingURL=group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../src/check-card/group.tsx"],"names":[],"mappings":"AAMA,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