@zat-design/sisyphus-react 3.14.0-beta.2 → 4.0.0-beta.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/README.md +77 -207
- package/babel.config.js +2 -2
- package/dist/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/FormsProvider/index.d.ts +4 -1
- package/es/ProAction/components/CheckModalContent/index.js +0 -9
- package/es/ProAction/index.js +3 -6
- package/es/ProAction/index.less +0 -2
- package/es/ProConfigProvider/index.d.ts +22 -5
- package/es/ProConfigProvider/index.js +58 -26
- package/es/ProDownload/index.js +2 -3
- package/es/ProDownload/style/index.less +0 -2
- package/es/ProDownload/utils.js +3 -4
- package/es/ProDrawerForm/components/ProDrawer/index.js +13 -17
- package/es/ProDrawerForm/components/ProModal/index.js +12 -20
- package/es/ProDrawerForm/index.d.ts +2 -1
- package/es/ProDrawerForm/index.js +35 -33
- package/es/ProDrawerForm/propsType.d.ts +7 -18
- package/es/ProDrawerForm/style/index.less +6 -14
- package/es/ProEditLabel/components/RenderProForm.js +2 -3
- package/es/ProEditLabel/index.js +10 -15
- package/es/ProEditLabel/propsType.d.ts +1 -6
- package/es/ProEditLabel/style/index.less +2 -3
- package/es/ProEditTable/components/ActionButton/index.js +5 -8
- package/es/ProEditTable/components/RcTable/BaseTable.js +70 -53
- package/es/ProEditTable/components/RcTable/DraggableTable.js +70 -49
- package/es/ProEditTable/components/RcTable/index.d.ts +0 -2
- package/es/ProEditTable/components/RcTable/index.js +1 -3
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +9 -12
- package/es/ProEditTable/components/RenderField/index.d.ts +3 -2
- package/es/ProEditTable/components/RenderField/index.js +401 -241
- package/es/ProEditTable/components/RenderToolbar/index.js +5 -5
- package/es/ProEditTable/components/Summary/index.js +5 -8
- package/es/ProEditTable/components/Validator/index.js +3 -6
- package/es/ProEditTable/index.js +99 -103
- package/es/ProEditTable/propsType.d.ts +7 -7
- package/es/ProEditTable/style/index.less +12 -12
- package/es/ProEditTable/utils/config.js +6 -7
- package/es/ProEditTable/utils/index.js +21 -17
- package/es/ProEditTable/utils/useEditTableError.js +12 -4
- package/es/ProEditTable/utils/useShouldUpdateForTable.d.ts +15 -0
- package/es/ProEditTable/utils/useShouldUpdateForTable.js +132 -0
- package/es/ProEnum/hooks/useEnum.js +5 -0
- package/es/ProEnum/hooks/useEnumRequest.js +3 -3
- package/es/ProEnum/index.js +10 -17
- package/es/ProEnum/style/index.less +0 -2
- package/es/ProEnum/utils/index.d.ts +1 -0
- package/es/ProEnum/utils/index.js +3 -7
- package/es/ProForm/components/Container.d.ts +1 -0
- package/es/ProForm/components/Container.js +2 -3
- package/es/ProForm/components/FormFooter/index.js +18 -19
- package/es/ProForm/components/FormFooter/propsType.d.ts +2 -0
- package/es/ProForm/components/base/Checkbox/index.js +3 -4
- package/es/ProForm/components/base/DatePicker/index.d.ts +1 -3
- package/es/ProForm/components/base/DatePicker/index.js +7 -7
- package/es/ProForm/components/base/DatePicker/useDateLimit.d.ts +3 -0
- package/es/ProForm/components/base/DatePicker/useDateLimit.js +11 -0
- package/es/ProForm/components/base/Input/index.js +10 -8
- package/es/ProForm/components/base/InputNumber/index.js +3 -6
- package/es/ProForm/components/base/Radio/index.js +3 -4
- package/es/ProForm/components/base/RangePicker/index.js +7 -6
- package/es/ProForm/components/base/RangePicker/useDateRange.d.ts +5 -5
- package/es/ProForm/components/base/Select/index.js +2 -3
- package/es/ProForm/components/base/Switch/index.js +2 -3
- package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -3
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +0 -2
- package/es/ProForm/components/base/TextArea/index.js +3 -4
- package/es/ProForm/components/base/TextArea/index.less +10 -2
- package/es/ProForm/components/base/TimePicker/index.d.ts +1 -2
- package/es/ProForm/components/base/TimePicker/index.js +6 -7
- package/es/ProForm/components/base/TimePicker/style/index.less +3 -3
- package/es/ProForm/components/combination/Container/style/index.less +0 -2
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +15 -13
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +5 -8
- package/es/ProForm/components/combination/FormList/components/Empty.js +2 -3
- package/es/ProForm/components/combination/FormList/components/LineFields.js +2 -3
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +5 -8
- package/es/ProForm/components/combination/FormList/index.js +2 -3
- package/es/ProForm/components/combination/FormList/style/index.less +36 -2
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +1 -0
- package/es/ProForm/components/combination/Group/component/ComRender.js +0 -1
- package/es/ProForm/components/combination/Group/index.js +3 -4
- package/es/ProForm/components/combination/Group/style/index.less +7 -87
- package/es/ProForm/components/combination/Group/utils.d.ts +1 -1
- package/es/ProForm/components/combination/Group/utils.js +4 -5
- package/es/ProForm/components/combination/ProCascader/index.js +13 -15
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/style/index.less +0 -2
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +24 -39
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +11 -15
- package/es/ProForm/components/combination/ProNumberRange/index.d.ts +3 -2
- package/es/ProForm/components/combination/ProNumberRange/index.js +21 -21
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +3 -54
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -23
- package/es/ProForm/components/combination/ProRangeLimit/index.js +42 -25
- package/es/ProForm/components/combination/ProRangeLimit/propsType.d.ts +23 -0
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +3 -2
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +14 -2
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +5 -6
- package/es/ProForm/components/combination/ProTimeLimit/index.js +23 -20
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +64 -6
- package/es/ProForm/components/index.d.ts +2 -9
- package/es/ProForm/components/index.js +1 -11
- package/es/ProForm/components/render/ChangedWrapper.js +8 -9
- package/es/ProForm/components/render/ConfirmWrapper.js +7 -7
- package/es/ProForm/components/render/Render.js +29 -30
- package/es/ProForm/components/render/RenderFields.d.ts +1 -0
- package/es/ProForm/components/render/RenderFields.js +6 -3
- package/es/ProForm/components/render/propsType.d.ts +3 -6
- package/es/ProForm/index.d.ts +2 -2
- package/es/ProForm/index.js +14 -42
- package/es/ProForm/propsType.d.ts +3 -0
- package/es/ProForm/style/index.less +4 -16
- package/es/ProForm/utils/index.d.ts +15 -1
- package/es/ProForm/utils/index.js +66 -15
- package/es/ProForm/utils/useDeepCompareMemo.js +4 -4
- package/es/ProForm/utils/useForm.js +27 -22
- package/es/ProForm/utils/useShouldUpdate.d.ts +1 -0
- package/es/ProForm/utils/useShouldUpdate.js +103 -17
- package/es/ProIcon/index.js +10 -13
- package/es/ProIcon/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Header/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +3 -6
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +40 -39
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +2 -3
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +0 -3
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +7 -5
- package/es/ProLayout/components/Layout/Menu/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Notice/style/index.less +0 -2
- package/es/ProLayout/components/ProCollapse/index.js +29 -44
- package/es/ProLayout/components/ProCollapse/style/index.less +5 -4
- package/es/ProLayout/components/ProFooter/index.js +2 -3
- package/es/ProLayout/components/ProFooter/style/index.less +0 -2
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +2 -3
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +2 -3
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +7 -9
- package/es/ProLayout/components/ProHeader/index.js +43 -45
- package/es/ProLayout/components/ProHeader/style/index.less +0 -2
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.js +2 -3
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +0 -2
- package/es/ProLayout/index.js +80 -41
- package/es/ProLayout/style/index.less +2 -3
- package/es/ProSelect/components/AdaptiveTooltip.js +2 -3
- package/es/ProSelect/index.js +7 -15
- package/es/ProSelect/index.less +0 -2
- package/es/ProSelect/propsType.d.ts +1 -1
- package/es/ProStep/components/Anchor/index.js +2 -3
- package/es/ProStep/components/Item/index.js +1 -0
- package/es/ProStep/components/Step/index.js +1 -0
- package/es/ProStep/style/index.less +2 -4
- package/es/ProTable/components/FormatColumn/index.js +33 -31
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -1
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +2 -4
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +17 -13
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +2 -4
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.js +15 -18
- package/es/ProTable/components/RenderSummary/index.js +4 -5
- package/es/ProTable/components/RenderTableHeader/index.js +3 -4
- package/es/ProTable/components/RenderTabs/index.js +3 -6
- package/es/ProTable/components/TableResizable/index.js +2 -1
- package/es/ProTable/components/TooltipTitle/index.js +2 -3
- package/es/ProTable/hooks/useAntdTable.js +4 -7
- package/es/ProTable/index.d.ts +0 -7
- package/es/ProTable/index.js +11 -14
- package/es/ProTable/propsType.d.ts +2 -3
- package/es/ProTable/style/index.less +4 -6
- package/es/ProTabs/components/Card/index.js +5 -10
- package/es/ProTabs/index.js +2 -3
- package/es/ProTabs/style/index.less +0 -2
- package/es/ProThemeTools/component/ProTools/index.js +18 -22
- package/es/ProThemeTools/context/ThemeContext.d.ts +31 -0
- package/es/ProThemeTools/context/ThemeContext.js +136 -0
- package/es/ProThemeTools/index.d.ts +4 -8
- package/es/ProThemeTools/index.js +80 -49
- package/es/ProThemeTools/style/index.less +1 -3
- package/es/ProThemeTools/utils/index.d.ts +16 -6
- package/es/ProThemeTools/utils/index.js +30 -24
- package/es/ProTooltip/index.js +14 -9
- package/es/ProTooltip/style/index.less +0 -2
- package/es/ProTree/components/AdaptiveTooltip.js +2 -3
- package/es/ProTree/components/List.js +3 -4
- package/es/ProTree/components/ProTree.js +5 -12
- package/es/ProTree/components/ProTreeSelect/index.js +28 -26
- package/es/ProTree/components/ProTreeSelect/style/index.less +0 -2
- package/es/ProTree/components/Tree.js +6 -13
- package/es/ProTree/index.js +0 -7
- package/es/ProTree/propsType.d.ts +1 -1
- package/es/ProTree/style/index.less +8 -6
- package/es/ProTreeModal/components/Cascader.js +3 -4
- package/es/ProTreeModal/components/List.js +11 -17
- package/es/ProTreeModal/components/SortableItem.js +2 -3
- package/es/ProTreeModal/components/Tree.js +3 -4
- package/es/ProTreeModal/components/Trigger.js +6 -11
- package/es/ProTreeModal/index.d.ts +0 -1
- package/es/ProTreeModal/index.js +10 -20
- package/es/ProTreeModal/style/index.less +12 -3
- package/es/ProUpload/components/ButtonRender.js +4 -7
- package/es/ProUpload/components/DragRender.js +2 -3
- package/es/ProUpload/components/FileItem.d.ts +0 -1
- package/es/ProUpload/components/FileItem.js +15 -21
- package/es/ProUpload/components/ImageRender.js +8 -17
- package/es/ProUpload/index.js +3 -4
- package/es/ProUpload/style/index.less +171 -12
- package/es/ProViewer/index.js +28 -35
- package/es/ProViewer/propsType.js +3 -0
- package/es/ProViewer/style/index.less +0 -2
- package/es/ProWaterMark/index.js +2 -3
- package/es/ProWaterMark/propsType.d.ts +5 -24
- package/es/global.less +2 -1
- package/es/index.d.ts +3 -3
- package/es/index.js +5 -5
- package/es/locale/en_US.js +1 -1
- package/es/locale/index.d.ts +2 -0
- package/es/locale/index.js +13 -2
- package/es/locale/zh_CN.js +1 -1
- package/es/style/components.less +0 -3
- package/es/style/index.less +1 -1
- package/es/style/theme/antd.less +36 -48
- package/es/style/theme/base.less +90 -0
- package/es/style/theme/index.less +2 -89
- package/es/utils/index.d.ts +7 -0
- package/es/utils/index.js +37 -1
- package/lib/FormsProvider/index.d.ts +4 -1
- package/lib/ProAction/components/CheckModalContent/index.js +0 -9
- package/lib/ProAction/index.js +3 -6
- package/lib/ProAction/index.less +0 -2
- package/lib/ProConfigProvider/index.d.ts +22 -5
- package/lib/ProConfigProvider/index.js +58 -26
- package/lib/ProDownload/index.js +2 -3
- package/lib/ProDownload/style/index.less +0 -2
- package/lib/ProDownload/utils.js +3 -4
- package/lib/ProDrawerForm/components/ProDrawer/index.js +13 -17
- package/lib/ProDrawerForm/components/ProModal/index.js +12 -20
- package/lib/ProDrawerForm/index.d.ts +2 -1
- package/lib/ProDrawerForm/index.js +35 -33
- package/lib/ProDrawerForm/propsType.d.ts +7 -18
- package/lib/ProDrawerForm/style/index.less +6 -14
- package/lib/ProEditLabel/components/RenderProForm.js +2 -3
- package/lib/ProEditLabel/index.js +10 -15
- package/lib/ProEditLabel/propsType.d.ts +1 -6
- package/lib/ProEditLabel/style/index.less +2 -3
- package/lib/ProEditTable/components/ActionButton/index.js +5 -8
- package/lib/ProEditTable/components/RcTable/BaseTable.js +69 -52
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +69 -48
- package/lib/ProEditTable/components/RcTable/index.d.ts +0 -2
- package/lib/ProEditTable/components/RcTable/index.js +1 -8
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +9 -12
- package/lib/ProEditTable/components/RenderField/index.d.ts +3 -2
- package/lib/ProEditTable/components/RenderField/index.js +401 -241
- package/lib/ProEditTable/components/RenderToolbar/index.js +5 -5
- package/lib/ProEditTable/components/Summary/index.js +5 -9
- package/lib/ProEditTable/components/Validator/index.js +3 -7
- package/lib/ProEditTable/index.js +96 -100
- package/lib/ProEditTable/propsType.d.ts +7 -7
- package/lib/ProEditTable/style/index.less +12 -12
- package/lib/ProEditTable/utils/config.js +6 -7
- package/lib/ProEditTable/utils/index.js +20 -16
- package/lib/ProEditTable/utils/useEditTableError.js +12 -4
- package/lib/ProEditTable/utils/useShouldUpdateForTable.d.ts +15 -0
- package/lib/ProEditTable/utils/useShouldUpdateForTable.js +139 -0
- package/lib/ProEnum/hooks/useEnum.js +5 -0
- package/lib/ProEnum/hooks/useEnumRequest.js +2 -2
- package/lib/ProEnum/index.js +10 -17
- package/lib/ProEnum/style/index.less +0 -2
- package/lib/ProEnum/utils/index.d.ts +1 -0
- package/lib/ProEnum/utils/index.js +4 -7
- package/lib/ProForm/components/Container.d.ts +1 -0
- package/lib/ProForm/components/Container.js +2 -3
- package/lib/ProForm/components/FormFooter/index.js +18 -19
- package/lib/ProForm/components/FormFooter/propsType.d.ts +2 -0
- package/lib/ProForm/components/base/Checkbox/index.js +3 -4
- package/lib/ProForm/components/base/DatePicker/index.d.ts +1 -3
- package/lib/ProForm/components/base/DatePicker/index.js +7 -7
- package/lib/ProForm/components/base/DatePicker/useDateLimit.d.ts +3 -0
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +19 -0
- package/lib/ProForm/components/base/Input/index.js +10 -8
- package/lib/ProForm/components/base/InputNumber/index.js +3 -6
- package/lib/ProForm/components/base/Radio/index.js +3 -4
- package/lib/ProForm/components/base/RangePicker/index.js +6 -6
- package/lib/ProForm/components/base/RangePicker/useDateRange.d.ts +5 -5
- package/lib/ProForm/components/base/Select/index.js +2 -3
- package/lib/ProForm/components/base/Switch/index.js +2 -3
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -3
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +0 -2
- package/lib/ProForm/components/base/TextArea/index.js +3 -4
- package/lib/ProForm/components/base/TextArea/index.less +10 -2
- package/lib/ProForm/components/base/TimePicker/index.d.ts +1 -2
- package/lib/ProForm/components/base/TimePicker/index.js +6 -7
- package/lib/ProForm/components/base/TimePicker/style/index.less +3 -3
- package/lib/ProForm/components/combination/Container/style/index.less +0 -2
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +15 -13
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +6 -9
- package/lib/ProForm/components/combination/FormList/components/Empty.js +2 -3
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +2 -3
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +4 -7
- package/lib/ProForm/components/combination/FormList/index.js +2 -3
- package/lib/ProForm/components/combination/FormList/style/index.less +36 -2
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/component/ComRender.js +0 -1
- package/lib/ProForm/components/combination/Group/index.js +3 -4
- package/lib/ProForm/components/combination/Group/style/index.less +7 -87
- package/lib/ProForm/components/combination/Group/utils.d.ts +1 -1
- package/lib/ProForm/components/combination/Group/utils.js +4 -5
- package/lib/ProForm/components/combination/ProCascader/index.js +12 -14
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/style/index.less +0 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +24 -39
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +11 -15
- package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/index.js +20 -20
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +3 -54
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -23
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +42 -25
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.d.ts +23 -0
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +3 -2
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +14 -2
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +5 -6
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +23 -20
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +64 -6
- package/lib/ProForm/components/index.d.ts +2 -9
- package/lib/ProForm/components/index.js +1 -63
- package/lib/ProForm/components/render/ChangedWrapper.js +8 -9
- package/lib/ProForm/components/render/ConfirmWrapper.js +7 -7
- package/lib/ProForm/components/render/Render.js +29 -30
- package/lib/ProForm/components/render/RenderFields.d.ts +1 -0
- package/lib/ProForm/components/render/RenderFields.js +6 -3
- package/lib/ProForm/components/render/propsType.d.ts +3 -6
- package/lib/ProForm/index.d.ts +2 -2
- package/lib/ProForm/index.js +13 -42
- package/lib/ProForm/propsType.d.ts +3 -0
- package/lib/ProForm/style/index.less +4 -16
- package/lib/ProForm/utils/index.d.ts +15 -1
- package/lib/ProForm/utils/index.js +69 -17
- package/lib/ProForm/utils/useDeepCompareMemo.js +4 -4
- package/lib/ProForm/utils/useForm.js +26 -21
- package/lib/ProForm/utils/useShouldUpdate.d.ts +1 -0
- package/lib/ProForm/utils/useShouldUpdate.js +101 -15
- package/lib/ProIcon/index.js +10 -13
- package/lib/ProIcon/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Header/index.js +1 -1
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +3 -6
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +40 -39
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +2 -3
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +0 -3
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +7 -5
- package/lib/ProLayout/components/Layout/Menu/index.js +1 -1
- package/lib/ProLayout/components/Layout/Menu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Notice/style/index.less +0 -2
- package/lib/ProLayout/components/ProCollapse/index.js +29 -44
- package/lib/ProLayout/components/ProCollapse/style/index.less +5 -4
- package/lib/ProLayout/components/ProFooter/index.js +2 -3
- package/lib/ProLayout/components/ProFooter/style/index.less +0 -2
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +2 -3
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +2 -3
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +7 -9
- package/lib/ProLayout/components/ProHeader/index.js +44 -47
- package/lib/ProLayout/components/ProHeader/style/index.less +0 -2
- package/lib/ProLayout/components/TabsManager/components/TabContextMenu.js +2 -3
- package/lib/ProLayout/components/TabsManager/hooks/useTabsState.js +0 -2
- package/lib/ProLayout/index.js +79 -40
- package/lib/ProLayout/style/index.less +2 -3
- package/lib/ProSelect/components/AdaptiveTooltip.js +2 -3
- package/lib/ProSelect/index.js +7 -15
- package/lib/ProSelect/index.less +0 -2
- package/lib/ProSelect/propsType.d.ts +1 -1
- package/lib/ProStep/components/Anchor/index.js +2 -3
- package/lib/ProStep/components/Item/index.js +1 -1
- package/lib/ProStep/components/Step/index.js +1 -0
- package/lib/ProStep/style/index.less +2 -4
- package/lib/ProTable/components/FormatColumn/index.js +33 -31
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -1
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +2 -4
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +16 -13
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +2 -4
- package/lib/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/lib/ProTable/components/RenderColumn/index.js +15 -18
- package/lib/ProTable/components/RenderSummary/index.js +4 -6
- package/lib/ProTable/components/RenderTableHeader/index.js +3 -5
- package/lib/ProTable/components/RenderTabs/index.js +3 -6
- package/lib/ProTable/components/TableResizable/index.js +2 -1
- package/lib/ProTable/components/TooltipTitle/index.js +2 -3
- package/lib/ProTable/hooks/useAntdTable.js +4 -7
- package/lib/ProTable/index.d.ts +0 -7
- package/lib/ProTable/index.js +10 -13
- package/lib/ProTable/propsType.d.ts +2 -3
- package/lib/ProTable/style/index.less +4 -6
- package/lib/ProTabs/components/Card/index.js +5 -11
- package/lib/ProTabs/index.js +2 -3
- package/lib/ProTabs/style/index.less +0 -2
- package/lib/ProThemeTools/component/ProTools/index.js +18 -22
- package/lib/ProThemeTools/context/ThemeContext.d.ts +31 -0
- package/lib/ProThemeTools/context/ThemeContext.js +145 -0
- package/lib/ProThemeTools/index.d.ts +4 -8
- package/lib/ProThemeTools/index.js +88 -48
- package/lib/ProThemeTools/style/index.less +1 -3
- package/lib/ProThemeTools/utils/index.d.ts +16 -6
- package/lib/ProThemeTools/utils/index.js +34 -27
- package/lib/ProTooltip/index.js +14 -9
- package/lib/ProTooltip/style/index.less +0 -2
- package/lib/ProTree/components/AdaptiveTooltip.js +2 -4
- package/lib/ProTree/components/List.js +3 -4
- package/lib/ProTree/components/ProTree.js +5 -12
- package/lib/ProTree/components/ProTreeSelect/index.js +28 -26
- package/lib/ProTree/components/ProTreeSelect/style/index.less +0 -2
- package/lib/ProTree/components/Tree.js +6 -13
- package/lib/ProTree/index.js +0 -8
- package/lib/ProTree/propsType.d.ts +1 -1
- package/lib/ProTree/style/index.less +8 -6
- package/lib/ProTreeModal/components/Cascader.js +3 -4
- package/lib/ProTreeModal/components/List.js +11 -17
- package/lib/ProTreeModal/components/SortableItem.js +2 -3
- package/lib/ProTreeModal/components/Tree.js +3 -4
- package/lib/ProTreeModal/components/Trigger.js +6 -11
- package/lib/ProTreeModal/index.d.ts +0 -1
- package/lib/ProTreeModal/index.js +10 -20
- package/lib/ProTreeModal/style/index.less +12 -3
- package/lib/ProUpload/components/ButtonRender.js +4 -7
- package/lib/ProUpload/components/DragRender.js +2 -3
- package/lib/ProUpload/components/FileItem.d.ts +0 -1
- package/lib/ProUpload/components/FileItem.js +15 -21
- package/lib/ProUpload/components/ImageRender.js +8 -17
- package/lib/ProUpload/index.js +3 -4
- package/lib/ProUpload/style/index.less +171 -12
- package/lib/ProViewer/index.js +30 -36
- package/lib/ProViewer/propsType.js +3 -1
- package/lib/ProViewer/style/index.less +0 -2
- package/lib/ProWaterMark/index.js +3 -4
- package/lib/ProWaterMark/propsType.d.ts +5 -24
- package/lib/global.less +2 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +34 -21
- package/lib/locale/en_US.js +1 -1
- package/lib/locale/index.d.ts +2 -0
- package/lib/locale/index.js +14 -3
- package/lib/locale/zh_CN.js +1 -1
- package/lib/style/components.less +0 -3
- package/lib/style/index.less +1 -1
- package/lib/style/theme/antd.less +36 -48
- package/lib/style/theme/base.less +90 -0
- package/lib/style/theme/index.less +2 -89
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.js +41 -2
- package/package.json +37 -25
- package/es/ProEditTable/components/RcTable/VirtualTable.d.ts +0 -3
- package/es/ProEditTable/components/RcTable/VirtualTable.js +0 -9
- package/es/ProForm/components/combination/ProCombination/index.d.ts +0 -6
- package/es/ProForm/components/combination/ProCombination/index.js +0 -208
- package/es/ProForm/components/combination/ProCombination/propsType.d.ts +0 -68
- package/es/ProForm/components/combination/ProCombination/style/index.less +0 -18
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.d.ts +0 -33
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.js +0 -110
- package/es/ProForm/components/old/EnumSelect/index.d.ts +0 -4
- package/es/ProForm/components/old/EnumSelect/index.js +0 -265
- package/es/ProForm/components/old/EnumSelect/interface.d.ts +0 -29
- package/es/ProForm/components/old/EnumSelect/interface.js +0 -1
- package/es/ProForm/components/old/EnumSelect/style/index.less +0 -113
- package/es/ProForm/components/old/InputRange/index.d.ts +0 -16
- package/es/ProForm/components/old/InputRange/index.js +0 -101
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +0 -3
- package/es/ProForm/components/old/InputWithSuffix/index.js +0 -47
- package/es/ProForm/components/old/InputWithSuffix/propsTypes.d.ts +0 -11
- package/es/ProForm/components/old/InputWithSuffix/propsTypes.js +0 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +0 -27
- package/es/ProForm/components/old/ProAddress/index.js +0 -276
- package/es/ProForm/components/old/ProAddress/propsTypes.d.ts +0 -16
- package/es/ProForm/components/old/ProAddress/propsTypes.js +0 -1
- package/es/ProForm/components/old/ProCertNo/index.d.ts +0 -14
- package/es/ProForm/components/old/ProCertNo/index.js +0 -66
- package/es/ProForm/components/old/ProCertNo/propsType.d.ts +0 -18
- package/es/ProForm/components/old/ProCertNo/propsType.js +0 -1
- package/es/ProForm/components/old/ProCertValidity/index.d.ts +0 -9
- package/es/ProForm/components/old/ProCertValidity/index.js +0 -186
- package/es/ProForm/components/old/ProCertValidity/propsType.d.ts +0 -19
- package/es/ProForm/components/old/ProCertValidity/propsType.js +0 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +0 -2
- package/es/ProForm/components/old/ProRangeBox/index.js +0 -98
- package/es/ProForm/components/old/ProRangeBox/propsType.d.ts +0 -3
- package/es/ProForm/components/old/ProRangeBox/propsType.js +0 -1
- package/es/ProUpload/style/fileItem.less +0 -159
- package/es/old/ProCertValidity/index.d.ts +0 -9
- package/es/old/ProCertValidity/index.js +0 -186
- package/es/old/ProCertValidity/propsType.d.ts +0 -19
- package/es/old/ProCertValidity/propsType.js +0 -1
- package/es/old/ProEditableTable/index.d.ts +0 -4
- package/es/old/ProEditableTable/index.js +0 -594
- package/es/old/ProEditableTable/propsType.d.ts +0 -68
- package/es/old/ProEditableTable/propsType.js +0 -1
- package/es/old/ProEditableTable/style/index.less +0 -75
- package/es/old/ProEditableTable/utils.d.ts +0 -29
- package/es/old/ProEditableTable/utils.js +0 -321
- package/lib/ProEditTable/components/RcTable/VirtualTable.d.ts +0 -3
- package/lib/ProEditTable/components/RcTable/VirtualTable.js +0 -14
- package/lib/ProForm/components/combination/ProCombination/index.d.ts +0 -6
- package/lib/ProForm/components/combination/ProCombination/index.js +0 -217
- package/lib/ProForm/components/combination/ProCombination/propsType.d.ts +0 -68
- package/lib/ProForm/components/combination/ProCombination/style/index.less +0 -18
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.d.ts +0 -33
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.js +0 -117
- package/lib/ProForm/components/old/EnumSelect/index.d.ts +0 -4
- package/lib/ProForm/components/old/EnumSelect/index.js +0 -271
- package/lib/ProForm/components/old/EnumSelect/interface.d.ts +0 -29
- package/lib/ProForm/components/old/EnumSelect/interface.js +0 -5
- package/lib/ProForm/components/old/EnumSelect/style/index.less +0 -113
- package/lib/ProForm/components/old/InputRange/index.d.ts +0 -16
- package/lib/ProForm/components/old/InputRange/index.js +0 -108
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +0 -3
- package/lib/ProForm/components/old/InputWithSuffix/index.js +0 -53
- package/lib/ProForm/components/old/InputWithSuffix/propsTypes.d.ts +0 -11
- package/lib/ProForm/components/old/InputWithSuffix/propsTypes.js +0 -5
- package/lib/ProForm/components/old/ProAddress/index.d.ts +0 -27
- package/lib/ProForm/components/old/ProAddress/index.js +0 -284
- package/lib/ProForm/components/old/ProAddress/propsTypes.d.ts +0 -16
- package/lib/ProForm/components/old/ProAddress/propsTypes.js +0 -5
- package/lib/ProForm/components/old/ProCertNo/index.d.ts +0 -14
- package/lib/ProForm/components/old/ProCertNo/index.js +0 -72
- package/lib/ProForm/components/old/ProCertNo/propsType.d.ts +0 -18
- package/lib/ProForm/components/old/ProCertNo/propsType.js +0 -5
- package/lib/ProForm/components/old/ProCertValidity/index.d.ts +0 -9
- package/lib/ProForm/components/old/ProCertValidity/index.js +0 -192
- package/lib/ProForm/components/old/ProCertValidity/propsType.d.ts +0 -19
- package/lib/ProForm/components/old/ProCertValidity/propsType.js +0 -5
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +0 -2
- package/lib/ProForm/components/old/ProRangeBox/index.js +0 -105
- package/lib/ProForm/components/old/ProRangeBox/propsType.d.ts +0 -3
- package/lib/ProForm/components/old/ProRangeBox/propsType.js +0 -5
- package/lib/ProUpload/style/fileItem.less +0 -159
- package/lib/old/ProCertValidity/index.d.ts +0 -9
- package/lib/old/ProCertValidity/index.js +0 -192
- package/lib/old/ProCertValidity/propsType.d.ts +0 -19
- package/lib/old/ProCertValidity/propsType.js +0 -5
- package/lib/old/ProEditableTable/index.d.ts +0 -4
- package/lib/old/ProEditableTable/index.js +0 -598
- package/lib/old/ProEditableTable/propsType.d.ts +0 -68
- package/lib/old/ProEditableTable/propsType.js +0 -5
- package/lib/old/ProEditableTable/style/index.less +0 -75
- package/lib/old/ProEditableTable/utils.d.ts +0 -29
- package/lib/old/ProEditableTable/utils.js +0 -329
- /package/es/ProForm/components/combination/{ProCombination → ProRangeLimit}/propsType.js +0 -0
- /package/lib/ProForm/components/combination/{ProCombination → ProRangeLimit}/propsType.js +0 -0
|
@@ -2,9 +2,9 @@ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIt
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
/* eslint-disable no-restricted-syntax */
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import dayjs from 'dayjs';
|
|
6
|
+
import _, { isObject, get, set, omit, isNaN } from 'lodash';
|
|
7
|
+
import { useState } from 'react';
|
|
8
8
|
export var getLayout = params => {
|
|
9
9
|
var _params$span = params.span,
|
|
10
10
|
span = _params$span === void 0 ? 8 : _params$span,
|
|
@@ -59,7 +59,7 @@ export var isTrim = (type, trim, configData) => {
|
|
|
59
59
|
_ref$state = _ref.state,
|
|
60
60
|
state = _ref$state === void 0 ? {} : _ref$state;
|
|
61
61
|
var _trim = trim || (state === null || state === void 0 || (_state$type = state[type]) === null || _state$type === void 0 ? void 0 : _state$type.trim);
|
|
62
|
-
if (['Input'
|
|
62
|
+
if (['Input'].includes(type) && _trim) {
|
|
63
63
|
result.getValueFromEvent = event => {
|
|
64
64
|
var _event$target$value;
|
|
65
65
|
if (Array.isArray(event)) {
|
|
@@ -79,7 +79,7 @@ export var isTrim = (type, trim, configData) => {
|
|
|
79
79
|
*/
|
|
80
80
|
export var isUpperCase = (type, upperCase) => {
|
|
81
81
|
var result = {};
|
|
82
|
-
if (['Input'
|
|
82
|
+
if (['Input'].includes(type) && upperCase) {
|
|
83
83
|
result.getValueFromEvent = event => {
|
|
84
84
|
var _event$target;
|
|
85
85
|
if (Array.isArray(event)) {
|
|
@@ -128,8 +128,8 @@ export var filterInternalFields = (values, optimize) => {
|
|
|
128
128
|
return values;
|
|
129
129
|
}
|
|
130
130
|
var nextValues = values;
|
|
131
|
-
// fix: braft-editor对象不可遍历
|
|
132
|
-
if (values !== null && values !== void 0 && values._immutable ||
|
|
131
|
+
// fix: braft-editor对象不可遍历 Dayjs不过滤
|
|
132
|
+
if (values !== null && values !== void 0 && values._immutable || dayjs.isDayjs(values)) {
|
|
133
133
|
return nextValues;
|
|
134
134
|
}
|
|
135
135
|
if (values instanceof File) {
|
|
@@ -296,13 +296,6 @@ export function getArrayBeforeNumber(arr) {
|
|
|
296
296
|
return index !== -1 ? arr.slice(0, index + 1) : arr;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
// 自定义深比对 如果两边都是函数类型则认为相等
|
|
300
|
-
export var customEqualForFun = (value, other) => {
|
|
301
|
-
if (isFunction(value) && isFunction(other) || /*#__PURE__*/React.isValidElement(value) && /*#__PURE__*/React.isValidElement(other)) {
|
|
302
|
-
return true;
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
|
|
306
299
|
/**
|
|
307
300
|
* 查询数据中是否包含rowKey
|
|
308
301
|
*/
|
|
@@ -447,4 +440,62 @@ export function findNamesKeyInArray(arr, key) {
|
|
|
447
440
|
_iterator.f();
|
|
448
441
|
}
|
|
449
442
|
return null;
|
|
450
|
-
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// 为内层数组定义一个类型别名,以增加代码清晰度
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* 根据特定规则合并两个数据源 (TypeScript 版本)
|
|
449
|
+
* @param data1 第一个数据源
|
|
450
|
+
* @param data2 第二个数据源
|
|
451
|
+
* @returns 合并后的结果数组
|
|
452
|
+
*/
|
|
453
|
+
export var mergeNames = (data1, data2) => {
|
|
454
|
+
// 步骤 1: 将 data1 的最后一个元素存入 Set 以便快速查找
|
|
455
|
+
var baseFields = new Set(data1.map(item => item[item.length - 1]));
|
|
456
|
+
var finalResult = [];
|
|
457
|
+
var coveredFields = new Set();
|
|
458
|
+
|
|
459
|
+
// 步骤 2 & 3: 处理 data2,找出有效的合并项
|
|
460
|
+
data2.forEach(item => {
|
|
461
|
+
// 确保数组有可处理的合并字段,并且该字段是字符串类型
|
|
462
|
+
var combinedField = item[item.length - 1];
|
|
463
|
+
if (item.length < 3 || typeof combinedField !== 'string') {
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
var subFields = combinedField.split('-');
|
|
467
|
+
|
|
468
|
+
// 检查所有子字段是否都存在于 baseFields 中
|
|
469
|
+
var allFieldsValid = subFields.every(field => baseFields.has(field));
|
|
470
|
+
|
|
471
|
+
// 步骤 4: 如果有效,则添加到结果中,并记录已覆盖的字段
|
|
472
|
+
if (allFieldsValid) {
|
|
473
|
+
finalResult.push(item);
|
|
474
|
+
subFields.forEach(field => coveredFields.add(field));
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
// 步骤 5: 处理 data1,添加未被覆盖的字段
|
|
479
|
+
data1.forEach(item => {
|
|
480
|
+
var field = item[item.length - 1];
|
|
481
|
+
if (!coveredFields.has(field)) {
|
|
482
|
+
finalResult.push(item);
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
return finalResult;
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* 是否 formlist或者pro-edit-table 场景
|
|
490
|
+
* 使用正则表达式判断一个由逗号分隔的字符串中,是否包含一个纯数字的片段。
|
|
491
|
+
* @param {string} str - 输入的字符串。
|
|
492
|
+
* @returns {boolean} - 如果匹配成功,返回 true;否则返回 false。
|
|
493
|
+
*/
|
|
494
|
+
export var isListForm = str => {
|
|
495
|
+
if (!str) {
|
|
496
|
+
return false;
|
|
497
|
+
}
|
|
498
|
+
// 正则表达式:查找被逗号或字符串边界包围的数字
|
|
499
|
+
var regex = /(?:^|,)\s*\d+\s*(?:,|$)/;
|
|
500
|
+
return regex.test(str);
|
|
501
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useRef } from 'react';
|
|
2
2
|
import { isEqualWith } from 'lodash';
|
|
3
|
-
import {
|
|
3
|
+
import { customEqualForFunction } from "../../utils";
|
|
4
4
|
|
|
5
5
|
/** 深度比较依赖变化memo */
|
|
6
6
|
export var useDeepCompareMemo = (fun, changedCb, depList) => {
|
|
7
|
-
var lastDependency = useRef(); // 上一次的依赖
|
|
8
|
-
var lastRes = useRef(); // 上一次的结果
|
|
7
|
+
var lastDependency = useRef({}); // 上一次的依赖
|
|
8
|
+
var lastRes = useRef({}); // 上一次的结果
|
|
9
9
|
|
|
10
|
-
if (!isEqualWith(depList, lastDependency.current,
|
|
10
|
+
if (!isEqualWith(depList, lastDependency === null || lastDependency === void 0 ? void 0 : lastDependency.current, customEqualForFunction)) {
|
|
11
11
|
var res = fun();
|
|
12
12
|
changedCb === null || changedCb === void 0 || changedCb(lastRes.current, res);
|
|
13
13
|
lastRes.current = res;
|
|
@@ -2,11 +2,10 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
4
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
5
|
-
import "antd/es/form/style";
|
|
6
|
-
import _Form from "antd/es/form";
|
|
7
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
|
+
import { Form } from 'antd';
|
|
8
7
|
import { useContext } from 'react';
|
|
9
|
-
import { filterInternalFields, getFormFieldPaths } from "./index";
|
|
8
|
+
import { filterInternalFields, getFormFieldPaths, mergeNames, isListForm } from "./index";
|
|
10
9
|
import { handleScrollToError as handleScrollToErrorProEditTable } from "../../ProEditTable/utils/tools";
|
|
11
10
|
import { FormsContext } from "../../FormsProvider";
|
|
12
11
|
export var useForm = function useForm(originForm, options) {
|
|
@@ -25,7 +24,7 @@ export var useForm = function useForm(originForm, options) {
|
|
|
25
24
|
|
|
26
25
|
// formKey全局共享逻辑
|
|
27
26
|
var forms = useContext(FormsContext);
|
|
28
|
-
var _ref2 =
|
|
27
|
+
var _ref2 = Form.useForm(forms[formKey] || _originForm),
|
|
29
28
|
_ref3 = _slicedToArray(_ref2, 1),
|
|
30
29
|
form = _ref3[0];
|
|
31
30
|
if (formKey && forms[formKey] !== form) {
|
|
@@ -41,7 +40,7 @@ export var useForm = function useForm(originForm, options) {
|
|
|
41
40
|
if (isModified) return [form];
|
|
42
41
|
|
|
43
42
|
// @ts-ignore
|
|
44
|
-
var
|
|
43
|
+
var nextGetFieldsValue = (nameList, filterFunc) => {
|
|
45
44
|
// 全部查询
|
|
46
45
|
if (nameList !== true) {
|
|
47
46
|
var values = getFieldsValue(nameList || true, filterFunc);
|
|
@@ -49,7 +48,7 @@ export var useForm = function useForm(originForm, options) {
|
|
|
49
48
|
}
|
|
50
49
|
return getFieldsValue(nameList, filterFunc);
|
|
51
50
|
};
|
|
52
|
-
var
|
|
51
|
+
var nextValidateFields = /*#__PURE__*/function () {
|
|
53
52
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(nameList) {
|
|
54
53
|
var _rest$,
|
|
55
54
|
_form$__INTERNAL_CONF,
|
|
@@ -69,6 +68,7 @@ export var useForm = function useForm(originForm, options) {
|
|
|
69
68
|
_form$getInternalHook,
|
|
70
69
|
getFields,
|
|
71
70
|
fieldsList,
|
|
71
|
+
fieldsNames,
|
|
72
72
|
_document,
|
|
73
73
|
tablePagination,
|
|
74
74
|
_tablePagination$clic,
|
|
@@ -148,19 +148,24 @@ export var useForm = function useForm(originForm, options) {
|
|
|
148
148
|
}
|
|
149
149
|
// @ts-ignore
|
|
150
150
|
_form$getInternalHook = form.getInternalHooks('RC_FORM_INTERNAL_HOOKS'), getFields = _form$getInternalHook.getFields;
|
|
151
|
-
fieldsList = getFields();
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
151
|
+
fieldsList = getFields(); // formList& proEditTable 特殊处理
|
|
152
|
+
if (Array.isArray(nameList) && isListForm(String(nameList))) {
|
|
153
|
+
fieldsNames = fieldsList.map(item => item.name);
|
|
154
|
+
validateNames = mergeNames(nameList, fieldsNames);
|
|
155
|
+
} else {
|
|
156
|
+
// 其他情况
|
|
157
|
+
fieldsList.forEach(item => {
|
|
158
|
+
var _item$name, _item$name2;
|
|
159
|
+
if (nameList[0] === ((_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name[0]) || (_item$name2 = item.name) !== null && _item$name2 !== void 0 && (_item$name2 = _item$name2[0]) !== null && _item$name2 !== void 0 && _item$name2.startsWith(`${nameList[0]}_`)) {
|
|
160
|
+
validateNames.push(item.name);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
158
164
|
if (Array.isArray(nameList) && nameList.length && !validateNames.length) {
|
|
159
165
|
validateNames = [...nameList];
|
|
160
166
|
}
|
|
161
167
|
|
|
162
168
|
// @ts-ignore
|
|
163
|
-
// delete rest[0].recursive;
|
|
164
169
|
_context.next = 41;
|
|
165
170
|
return validateFields(validateNames, ...rest).then(values => {
|
|
166
171
|
return filterInternalFields(values, optimize);
|
|
@@ -177,7 +182,7 @@ export var useForm = function useForm(originForm, options) {
|
|
|
177
182
|
}
|
|
178
183
|
_context.next = 45;
|
|
179
184
|
return validateFields(nameList, ...rest).then(values => {
|
|
180
|
-
return nameList ? values :
|
|
185
|
+
return nameList ? values : nextGetFieldsValue();
|
|
181
186
|
});
|
|
182
187
|
case 45:
|
|
183
188
|
return _context.abrupt("return", _context.sent);
|
|
@@ -198,11 +203,11 @@ export var useForm = function useForm(originForm, options) {
|
|
|
198
203
|
}
|
|
199
204
|
}, _callee, null, [[0, 48], [7, 26, 29, 32], [11, 18]]);
|
|
200
205
|
}));
|
|
201
|
-
return function
|
|
206
|
+
return function nextValidateFields(_x) {
|
|
202
207
|
return _ref4.apply(this, arguments);
|
|
203
208
|
};
|
|
204
209
|
}();
|
|
205
|
-
var
|
|
210
|
+
var nextSetFieldValue = (name, value, info) => {
|
|
206
211
|
if (info) {
|
|
207
212
|
setFields([_objectSpread({
|
|
208
213
|
name,
|
|
@@ -217,7 +222,7 @@ export var useForm = function useForm(originForm, options) {
|
|
|
217
222
|
}]);
|
|
218
223
|
}
|
|
219
224
|
};
|
|
220
|
-
var
|
|
225
|
+
var nextSetFieldsValue = values => {
|
|
221
226
|
var errors = getFieldsError();
|
|
222
227
|
var errorNames = errors.reduce((acc, entry) => {
|
|
223
228
|
if (entry.errors.length > 0) {
|
|
@@ -241,10 +246,10 @@ export var useForm = function useForm(originForm, options) {
|
|
|
241
246
|
setFieldsValue(values);
|
|
242
247
|
}
|
|
243
248
|
};
|
|
244
|
-
form.getFieldsValue =
|
|
245
|
-
form.setFieldValue =
|
|
246
|
-
form.setFieldsValue =
|
|
247
|
-
form.validateFields =
|
|
249
|
+
form.getFieldsValue = nextGetFieldsValue;
|
|
250
|
+
form.setFieldValue = nextSetFieldValue;
|
|
251
|
+
form.setFieldsValue = nextSetFieldsValue;
|
|
252
|
+
form.validateFields = nextValidateFields;
|
|
248
253
|
form.isModified = true;
|
|
249
254
|
form.__INTERNAL_CONFIG__ = {};
|
|
250
255
|
return [form];
|
|
@@ -19,6 +19,7 @@ interface UseShouldUpdateProps<Values> {
|
|
|
19
19
|
rules?: ProRule[];
|
|
20
20
|
required?: boolean;
|
|
21
21
|
type: string;
|
|
22
|
+
shouldUpdateDebounce?: number;
|
|
22
23
|
[key: string]: any;
|
|
23
24
|
}
|
|
24
25
|
type HookShouldUpdate<Values = any> = (props: UseShouldUpdateProps<Values>) => Result<Values>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import { useRef, useState } from 'react';
|
|
3
|
-
import { isFunction, isEqualWith, get } from 'lodash';
|
|
4
|
-
import {
|
|
2
|
+
import { useRef, useState, useEffect } from 'react';
|
|
3
|
+
import { isFunction, isEqualWith, get, debounce } from 'lodash';
|
|
4
|
+
import { customEqualForFunction } from "../../utils";
|
|
5
5
|
/** FormList中被删除的行也会再触发一次响应式函数 排除这种场景 */
|
|
6
6
|
var isDeleteLine = (form, namePath) => {
|
|
7
7
|
if (namePath) {
|
|
@@ -23,7 +23,8 @@ var useShouldUpdate = props => {
|
|
|
23
23
|
component = props.component,
|
|
24
24
|
originComponent = props.originComponent,
|
|
25
25
|
type = props.type,
|
|
26
|
-
desensitization = props.desensitization
|
|
26
|
+
desensitization = props.desensitization,
|
|
27
|
+
shouldUpdateDebounce = props.shouldUpdateDebounce;
|
|
27
28
|
var _shouldUpdate = formItemProps.shouldUpdate,
|
|
28
29
|
name = formItemProps.name,
|
|
29
30
|
clearNotShow = formItemProps.clearNotShow,
|
|
@@ -31,22 +32,96 @@ var useShouldUpdate = props => {
|
|
|
31
32
|
namePath = formItemProps.namePath,
|
|
32
33
|
names = formItemProps.names,
|
|
33
34
|
dependNames = formItemProps.dependNames;
|
|
34
|
-
var timerRef = useRef();
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
35
|
+
var timerRef = useRef(null); // 清值防抖
|
|
36
|
+
var debouncedShouldUpdateRef = useRef(null); // shouldUpdate防抖函数
|
|
37
|
+
var pendingValuesRef = useRef(null); // 待处理的表单值
|
|
38
|
+
|
|
39
|
+
var needClear = useRef(false); // 是否需要执行清值操作
|
|
40
|
+
var showRef = useRef(false);
|
|
41
|
+
var disabledRef = useRef(false);
|
|
42
|
+
var requiredRef = useRef(false);
|
|
43
|
+
var rulesRef = useRef([]);
|
|
44
|
+
var fieldPropsRef = useRef(null);
|
|
45
|
+
var originComponentRef = useRef(null);
|
|
46
|
+
var dependNamesRef = useRef([]);
|
|
47
|
+
var desensitizationRef = useRef([0, 0]);
|
|
44
48
|
var newComponent = originComponent || component; // 解决component默认赋值污染问题,需要使用originComponent
|
|
45
49
|
var _useState = useState({}),
|
|
46
50
|
_useState2 = _slicedToArray(_useState, 2),
|
|
47
51
|
reRender = _useState2[1];
|
|
48
52
|
var values = {};
|
|
49
53
|
|
|
54
|
+
// 处理表单值更新的函数
|
|
55
|
+
var processValuesUpdate = currentValues => {
|
|
56
|
+
var _currentValues;
|
|
57
|
+
if (namePath) {
|
|
58
|
+
_currentValues = form.getFieldValue(namePath) || {};
|
|
59
|
+
} else {
|
|
60
|
+
_currentValues = currentValues;
|
|
61
|
+
}
|
|
62
|
+
var _show = isFunction(show) ? Boolean(show(_currentValues, {
|
|
63
|
+
form,
|
|
64
|
+
index,
|
|
65
|
+
namePath
|
|
66
|
+
})) : show;
|
|
67
|
+
var _disabled = isFunction(disabled) ? disabled(_currentValues, {
|
|
68
|
+
form,
|
|
69
|
+
index,
|
|
70
|
+
namePath
|
|
71
|
+
}) : disabled;
|
|
72
|
+
var _required = isFunction(required) ? required(_currentValues, {
|
|
73
|
+
form,
|
|
74
|
+
index,
|
|
75
|
+
namePath
|
|
76
|
+
}) : required;
|
|
77
|
+
var _rules = isFunction(rules) ? rules(_currentValues, {
|
|
78
|
+
form,
|
|
79
|
+
index,
|
|
80
|
+
namePath
|
|
81
|
+
}) : rules;
|
|
82
|
+
var _fieldProps = isFunction(fieldProps) ? fieldProps(_currentValues, {
|
|
83
|
+
form,
|
|
84
|
+
index,
|
|
85
|
+
namePath
|
|
86
|
+
}) : fieldProps;
|
|
87
|
+
var _desensitization = isFunction(desensitization) ? desensitization(_currentValues, {
|
|
88
|
+
form,
|
|
89
|
+
index,
|
|
90
|
+
namePath
|
|
91
|
+
}) : desensitization;
|
|
92
|
+
var equalRes = isEqualWith(rulesRef.current, _rules, customEqualForFunction);
|
|
93
|
+
var proEqualRes = isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFunction);
|
|
94
|
+
var desensitizationRes = isEqualWith(desensitizationRef.current, _desensitization);
|
|
95
|
+
if (_show !== showRef.current || !isEqualWith(disabledRef.current, _disabled, customEqualForFunction) || _required !== requiredRef.current || !equalRes || !proEqualRes || !desensitizationRes || _fieldProps !== null && _fieldProps !== void 0 && _fieldProps.transformResponse) {
|
|
96
|
+
showRef.current = _show;
|
|
97
|
+
disabledRef.current = _disabled;
|
|
98
|
+
requiredRef.current = _required;
|
|
99
|
+
rulesRef.current = _rules;
|
|
100
|
+
fieldPropsRef.current = _fieldProps;
|
|
101
|
+
desensitizationRef.current = _desensitization;
|
|
102
|
+
reRender({});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// 创建防抖函数
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (shouldUpdateDebounce > 0 && (dependNames !== null && dependNames !== void 0 && dependNames.length || isFunction(show) || isFunction(disabled) || isFunction(required) || isFunction(rules) || isFunction(fieldProps) || isFunction(originComponent) || isFunction(desensitization))) {
|
|
109
|
+
debouncedShouldUpdateRef.current = debounce(() => {
|
|
110
|
+
if (pendingValuesRef.current) {
|
|
111
|
+
var currentValues = pendingValuesRef.current;
|
|
112
|
+
pendingValuesRef.current = null;
|
|
113
|
+
|
|
114
|
+
// 使用最新的values重新计算状态
|
|
115
|
+
processValuesUpdate(currentValues);
|
|
116
|
+
}
|
|
117
|
+
}, shouldUpdateDebounce);
|
|
118
|
+
}
|
|
119
|
+
return () => {
|
|
120
|
+
var _debouncedShouldUpdat;
|
|
121
|
+
(_debouncedShouldUpdat = debouncedShouldUpdateRef.current) === null || _debouncedShouldUpdat === void 0 || _debouncedShouldUpdat.cancel();
|
|
122
|
+
};
|
|
123
|
+
}, [shouldUpdateDebounce, dependNames === null || dependNames === void 0 ? void 0 : dependNames.length, show, disabled, required, rules, fieldProps, originComponent, desensitization]);
|
|
124
|
+
|
|
50
125
|
// 不是动态函数直接返回
|
|
51
126
|
if (!(dependNames !== null && dependNames !== void 0 && dependNames.length) && !isFunction(show) && !isFunction(disabled) && !isFunction(required) && !isFunction(rules) && !isFunction(fieldProps) && !isFunction(originComponent) && !isFunction(desensitization)) {
|
|
52
127
|
return {
|
|
@@ -150,10 +225,21 @@ var useShouldUpdate = props => {
|
|
|
150
225
|
// @ts-ignore formList场景取当前行数据,不取shouldUpdate变更后值
|
|
151
226
|
if (dependNames !== null && dependNames !== void 0 && dependNames.length) {
|
|
152
227
|
var curDependNamesValue = dependNames.map(name => get(currentValues, name));
|
|
153
|
-
var dependNamesChanged = !isEqualWith(dependNamesRef.current, curDependNamesValue,
|
|
228
|
+
var dependNamesChanged = !isEqualWith(dependNamesRef.current, curDependNamesValue, customEqualForFunction);
|
|
154
229
|
dependNamesRef.current = curDependNamesValue;
|
|
155
230
|
if (!dependNamesChanged) return false;
|
|
156
231
|
}
|
|
232
|
+
|
|
233
|
+
// 如果启用了防抖且存在防抖函数
|
|
234
|
+
if (shouldUpdateDebounce > 0 && debouncedShouldUpdateRef.current) {
|
|
235
|
+
// 缓存最新的表单值
|
|
236
|
+
pendingValuesRef.current = currentValues;
|
|
237
|
+
// 触发防抖函数
|
|
238
|
+
debouncedShouldUpdateRef.current();
|
|
239
|
+
return false; // 暂时不更新,由防抖函数控制
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// 原有的非防抖逻辑
|
|
157
243
|
var _currentValues;
|
|
158
244
|
if (namePath) {
|
|
159
245
|
// formList场景values取当前行数据
|
|
@@ -215,8 +301,8 @@ var useShouldUpdate = props => {
|
|
|
215
301
|
clearTimeout(timerRef.current);
|
|
216
302
|
}
|
|
217
303
|
}
|
|
218
|
-
var equalRes = isEqualWith(rulesRef.current, _rules,
|
|
219
|
-
var proEqualRes = isEqualWith(fieldPropsRef.current, _fieldProps,
|
|
304
|
+
var equalRes = isEqualWith(rulesRef.current, _rules, customEqualForFunction);
|
|
305
|
+
var proEqualRes = isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFunction);
|
|
220
306
|
var desensitizationRes = isEqualWith(desensitizationRef.current, _desensitization);
|
|
221
307
|
if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes || !desensitizationRes || _fieldProps !== null && _fieldProps !== void 0 && _fieldProps.transformResponse // 防止fieldProps变更时,transformResponse根据fieldProps新值无法触发更新
|
|
222
308
|
) {
|
package/es/ProIcon/index.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import "antd/es/tooltip/style";
|
|
2
|
-
import _Tooltip from "antd/es/tooltip";
|
|
3
|
-
import "antd/es/space/style";
|
|
4
|
-
import _Space from "antd/es/space";
|
|
5
|
-
import "antd/es/button/style";
|
|
6
|
-
import _Button from "antd/es/button";
|
|
7
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
9
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
10
4
|
var _excluded = ["type", "onClick", "size", "color", "className", "style", "spin", "rotate", "theme", "disabled", "mode", "buttonProps", "children", "mapList", "src", "actionMap", "tooltip", "buttonIcon"];
|
|
11
5
|
import { useLocalStorageState, useSetState, useDeepCompareLayoutEffect } from 'ahooks';
|
|
6
|
+
import { Button, Tooltip, Space } from 'antd';
|
|
12
7
|
import classNames from 'classnames';
|
|
13
8
|
import { uniqBy } from 'lodash';
|
|
14
9
|
import { ReactSVG } from 'react-svg';
|
|
@@ -168,9 +163,9 @@ var ProIcon = props => {
|
|
|
168
163
|
var RenderIcon = /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({
|
|
169
164
|
className: "anticon"
|
|
170
165
|
}, reset), {}, {
|
|
171
|
-
children: /*#__PURE__*/_jsx(
|
|
166
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
172
167
|
title: iconText,
|
|
173
|
-
children: buttonIcon ? /*#__PURE__*/_jsx(
|
|
168
|
+
children: buttonIcon ? /*#__PURE__*/_jsx(Button, _objectSpread({
|
|
174
169
|
style: {
|
|
175
170
|
width: size,
|
|
176
171
|
height: size,
|
|
@@ -181,7 +176,7 @@ var ProIcon = props => {
|
|
|
181
176
|
},
|
|
182
177
|
type: "text",
|
|
183
178
|
icon: icon
|
|
184
|
-
}, buttonProps)) : /*#__PURE__*/_jsx(
|
|
179
|
+
}, buttonProps)) : /*#__PURE__*/_jsx(Space, {
|
|
185
180
|
children: /*#__PURE__*/_jsx("span", {
|
|
186
181
|
style: {
|
|
187
182
|
width: size,
|
|
@@ -220,7 +215,8 @@ var ProIcon = props => {
|
|
|
220
215
|
theme: {
|
|
221
216
|
primaryColor,
|
|
222
217
|
qiankunPrimaryColor: value === null || value === void 0 ? void 0 : value.trim()
|
|
223
|
-
}
|
|
218
|
+
},
|
|
219
|
+
forms: {}
|
|
224
220
|
}
|
|
225
221
|
});
|
|
226
222
|
}
|
|
@@ -254,7 +250,8 @@ var ProIcon = props => {
|
|
|
254
250
|
theme: {
|
|
255
251
|
primaryColor,
|
|
256
252
|
qiankunPrimaryColor: extendFromMainColor
|
|
257
|
-
}
|
|
253
|
+
},
|
|
254
|
+
forms: {}
|
|
258
255
|
}
|
|
259
256
|
});
|
|
260
257
|
}
|
|
@@ -272,9 +269,9 @@ var ProIcon = props => {
|
|
|
272
269
|
IconInstance: RenderIcon
|
|
273
270
|
});
|
|
274
271
|
}, [_config, primaryColor, qiankunPrimaryColor, language, svgProps]);
|
|
275
|
-
return !isExtendButtonMode ? IconInstance : /*#__PURE__*/_jsx(
|
|
272
|
+
return !isExtendButtonMode ? IconInstance : /*#__PURE__*/_jsx(Tooltip, {
|
|
276
273
|
title: tooltip,
|
|
277
|
-
children: /*#__PURE__*/_jsx(
|
|
274
|
+
children: /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread(_objectSpread({
|
|
278
275
|
type: isIconMode ? 'text' : (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.type) || 'link',
|
|
279
276
|
className: proIconClassNames,
|
|
280
277
|
disabled: disabled,
|
|
@@ -17,7 +17,7 @@ var Header = props => {
|
|
|
17
17
|
return /*#__PURE__*/_jsxs("div", {
|
|
18
18
|
className: classNames({
|
|
19
19
|
'pro-layout-header': true,
|
|
20
|
-
'pro-layout-header-pure': typeof pure !== 'boolean' ? pure.topMenu : pure
|
|
20
|
+
'pro-layout-header-pure': typeof pure !== 'boolean' ? pure === null || pure === void 0 ? void 0 : pure.topMenu : pure
|
|
21
21
|
}),
|
|
22
22
|
style: {
|
|
23
23
|
height: headerHeight
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import "antd/es/tooltip/style";
|
|
2
|
-
import _Tooltip from "antd/es/tooltip";
|
|
3
|
-
import "antd/es/popover/style";
|
|
4
|
-
import _Popover from "antd/es/popover";
|
|
5
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
2
|
import { useContext } from 'react';
|
|
3
|
+
import { Popover, Tooltip } from 'antd';
|
|
7
4
|
import classnames from 'classnames';
|
|
8
5
|
import { Link as RouterLink } from 'react-router-dom';
|
|
9
6
|
import { Icon } from "../../index";
|
|
@@ -88,7 +85,7 @@ var FoldMenu = props => {
|
|
|
88
85
|
})]
|
|
89
86
|
})
|
|
90
87
|
}, `${id}-${name}`);
|
|
91
|
-
return hasChildrenMenu ? /*#__PURE__*/_jsx(
|
|
88
|
+
return hasChildrenMenu ? /*#__PURE__*/_jsx(Popover, {
|
|
92
89
|
mouseEnterDelay: 0,
|
|
93
90
|
content: /*#__PURE__*/_jsx(SideMenu, {
|
|
94
91
|
dataSource: _objectSpread(_objectSpread({}, dataSource), {}, {
|
|
@@ -120,7 +117,7 @@ var FoldMenu = props => {
|
|
|
120
117
|
},
|
|
121
118
|
children: LiNode
|
|
122
119
|
})
|
|
123
|
-
}, `${id}-${name}`) : !collapsed ? /*#__PURE__*/_jsx(
|
|
120
|
+
}, `${id}-${name}`) : !collapsed ? /*#__PURE__*/_jsx(Tooltip, {
|
|
124
121
|
placement: "right",
|
|
125
122
|
title: name,
|
|
126
123
|
children: /*#__PURE__*/_jsx("span", {
|