@zat-design/sisyphus-react 4.0.0-beta.8 → 4.0.0
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/babel.config.js.backup +13 -0
- package/dist/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/ProAction/index.js +14 -4
- package/es/ProConfigProvider/index.js +11 -2
- package/es/ProDownload/index.js +16 -5
- package/es/ProDownload/utils.js +8 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +14 -4
- package/es/ProDrawerForm/components/ProModal/index.js +14 -4
- package/es/ProDrawerForm/index.js +13 -3
- package/es/ProEditLabel/components/RenderProForm.js +5 -1
- package/es/ProEditLabel/index.js +16 -5
- package/es/ProEditTable/components/ActionButton/index.js +5 -1
- package/es/ProEditTable/components/RcTable/BaseTable.js +13 -3
- package/es/ProEditTable/components/RcTable/DraggableTable.js +12 -5
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +7 -2
- package/es/ProEditTable/components/RenderField/index.js +54 -29
- package/es/ProEditTable/components/RenderToolbar/index.js +10 -4
- package/es/ProEditTable/index.js +16 -5
- package/es/ProEditTable/propsType.d.ts +12 -6
- package/es/ProEditTable/style/index.less +30 -3
- package/es/ProEditTable/utils/config.js +8 -3
- package/es/ProEditTable/utils/index.js +13 -9
- package/es/ProEditTable/utils/tools.js +22 -10
- package/es/ProEditTable/utils/useEditTableError.js +6 -1
- package/es/ProEditTable/utils/useShouldUpdateForTable.js +16 -7
- package/es/ProEnum/components/Group.js +6 -1
- package/es/ProEnum/components/Tag.js +6 -1
- package/es/ProEnum/hooks/useEnum.d.ts +8 -0
- package/es/ProEnum/hooks/useEnum.js +76 -4
- package/es/ProEnum/hooks/useEnumRequest.js +8 -3
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +8 -3
- package/es/ProEnum/index.js +25 -15
- package/es/ProEnum/utils/eventCenter.js +3 -1
- package/es/ProEnum/utils/frequentEnum.js +5 -1
- package/es/ProEnum/utils/index.js +2 -1
- package/es/ProForm/components/FormFooter/index.js +5 -1
- package/es/ProForm/components/base/Checkbox/index.js +7 -2
- package/es/ProForm/components/base/DatePicker/index.js +7 -2
- package/es/ProForm/components/base/DatePicker/useDateLimit.js +6 -1
- package/es/ProForm/components/base/Input/index.js +7 -2
- package/es/ProForm/components/base/InputNumber/index.js +13 -3
- package/es/ProForm/components/base/Radio/index.js +7 -2
- package/es/ProForm/components/base/RangePicker/index.d.ts +7 -1
- package/es/ProForm/components/base/RangePicker/index.js +50 -4
- package/es/ProForm/components/base/RangePicker/useDateRange.js +6 -1
- package/es/ProForm/components/base/Select/index.js +7 -2
- package/es/ProForm/components/base/Switch/index.js +7 -2
- package/es/ProForm/components/base/SwitchCheckbox/index.js +7 -2
- package/es/ProForm/components/base/TextArea/index.js +7 -2
- package/es/ProForm/components/base/TimePicker/index.js +7 -2
- package/es/ProForm/components/combination/Container/index.js +5 -1
- package/es/ProForm/components/combination/Container/style/index.less +5 -0
- package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -0
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +94 -7
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +2 -0
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +63 -6
- package/es/ProForm/components/combination/FormList/components/Empty.js +14 -4
- package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +1 -0
- package/es/ProForm/components/combination/FormList/components/LineFields.js +9 -3
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +48 -13
- package/es/ProForm/components/combination/FormList/index.js +108 -61
- package/es/ProForm/components/combination/FormList/propsType.d.ts +7 -2
- package/es/ProForm/components/combination/FormList/style/index.less +41 -0
- package/es/ProForm/components/combination/FormList/utils.d.ts +6 -0
- package/es/ProForm/components/combination/FormList/utils.js +17 -0
- package/es/ProForm/components/combination/Group/component/ComRender.d.ts +3 -0
- package/es/ProForm/components/combination/Group/component/ComRender.js +70 -3
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +10 -0
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.js +351 -0
- package/es/ProForm/components/combination/Group/hooks/index.d.ts +16 -1
- package/es/ProForm/components/combination/Group/hooks/index.js +107 -4
- package/es/ProForm/components/combination/Group/index.d.ts +3 -4
- package/es/ProForm/components/combination/Group/index.js +108 -24
- package/es/ProForm/components/combination/Group/propsType.d.ts +44 -1
- package/es/ProForm/components/combination/Group/style/index.less +425 -3
- package/es/ProForm/components/combination/Group/utils/index.d.ts +154 -0
- package/es/ProForm/components/combination/Group/utils/index.js +428 -0
- package/es/ProForm/components/combination/ProCascader/index.js +13 -3
- package/es/ProForm/components/combination/ProCascader/utils/index.js +7 -2
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +14 -4
- package/es/ProForm/components/combination/ProModalSelect/index.js +16 -5
- package/es/ProForm/components/combination/ProNumberRange/index.js +24 -12
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +4 -0
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +14 -7
- package/es/ProForm/components/combination/ProRangeLimit/index.js +13 -3
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +6 -1
- package/es/ProForm/components/combination/ProTimeLimit/index.js +13 -3
- package/es/ProForm/components/render/ChangedWrapper.js +7 -2
- package/es/ProForm/components/render/ConfirmWrapper.js +10 -4
- package/es/ProForm/components/render/CustomComponentViewWrapper.d.ts +30 -0
- package/es/ProForm/components/render/CustomComponentViewWrapper.js +120 -0
- package/es/ProForm/components/render/Render.js +71 -16
- package/es/ProForm/components/render/RenderFields.js +7 -2
- package/es/ProForm/index.js +13 -3
- package/es/ProForm/propsType.d.ts +7 -0
- package/es/ProForm/style/index.less +11 -2
- package/es/ProForm/utils/index.js +7 -2
- package/es/ProForm/utils/rulesCreator.js +5 -1
- package/es/ProForm/utils/transformValue.js +5 -1
- package/es/ProForm/utils/useForm.js +15 -5
- package/es/ProForm/utils/useShouldUpdate.js +93 -35
- package/es/ProForm/utils/useWatch.js +9 -4
- package/es/ProForm/utils/valueType.js +11 -2
- package/es/ProIcon/index.js +13 -3
- package/es/ProIcon/utils/index.js +5 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +19 -14
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +6 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +48 -31
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -12
- package/es/ProLayout/components/Layout/Notice/style/index.less +4 -0
- package/es/ProLayout/components/ProCollapse/index.js +5 -1
- package/es/ProLayout/components/ProCollapse/style/index.less +9 -9
- package/es/ProLayout/components/ProFooter/index.js +6 -2
- package/es/ProLayout/components/ProHeader/index.js +33 -19
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +7 -0
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.js +100 -0
- package/es/ProLayout/components/TabsManager/components/TabItem.d.ts +26 -0
- package/es/ProLayout/components/TabsManager/components/TabItem.js +61 -0
- package/es/ProLayout/components/TabsManager/components/TabsContext.d.ts +6 -0
- package/es/ProLayout/components/TabsManager/components/TabsContext.js +5 -0
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +6 -0
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.js +14 -0
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +18 -0
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +26 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +31 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.js +96 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +5 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +364 -0
- package/es/ProLayout/components/TabsManager/index.d.ts +8 -0
- package/es/ProLayout/components/TabsManager/index.js +180 -0
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +74 -0
- package/es/ProLayout/components/TabsManager/propTypes.js +16 -0
- package/es/ProLayout/components/TabsManager/style/index.less +179 -0
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +38 -0
- package/es/ProLayout/components/TabsManager/utils/index.js +106 -0
- package/es/ProLayout/index.d.ts +21 -4
- package/es/ProLayout/index.js +107 -14
- package/es/ProLayout/propTypes.d.ts +139 -1
- package/es/ProLayout/propTypes.js +37 -1
- package/es/ProLayout/utils/index.js +16 -7
- package/es/ProSelect/components/AdaptiveTooltip.js +6 -1
- package/es/ProSelect/index.js +13 -3
- package/es/ProSelect/utils/index.js +3 -1
- package/es/ProStep/components/Item/index.js +8 -2
- package/es/ProStep/components/Listener/index.js +10 -4
- package/es/ProStep/components/Step/index.js +11 -2
- package/es/ProStep/index.js +16 -5
- package/es/ProStep/utils/index.js +5 -1
- package/es/ProStepTab/index.js +19 -8
- package/es/ProTable/components/FormatColumn/index.js +7 -2
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +7 -2
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +10 -4
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +5 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +7 -2
- package/es/ProTable/components/RenderColumn/index.js +11 -2
- package/es/ProTable/components/RenderTabs/index.js +11 -2
- package/es/ProTable/components/TableResizable/index.js +13 -3
- package/es/ProTable/components/TooltipTitle/index.js +3 -5
- package/es/ProTable/hooks/useAntdTable.js +69 -35
- package/es/ProTable/index.js +16 -5
- package/es/ProTable/style/index.less +3 -0
- package/es/ProTable/utils/index.js +6 -1
- package/es/ProTabs/index.js +13 -3
- package/es/ProThemeTools/component/ProTools/index.js +11 -2
- package/es/ProThemeTools/context/ThemeContext.js +11 -2
- package/es/ProThemeTools/index.js +13 -3
- package/es/ProThemeTools/utils/index.js +5 -1
- package/es/ProTooltip/index.js +13 -3
- package/es/ProTree/components/CloseIcon.js +5 -1
- package/es/ProTree/components/List.js +7 -2
- package/es/ProTree/components/ProTree.js +16 -5
- package/es/ProTree/components/ProTreeSelect/index.js +119 -75
- package/es/ProTree/components/Tree.js +16 -5
- package/es/ProTree/index.js +5 -1
- package/es/ProTree/utils.js +8 -2
- package/es/ProTreeModal/components/Cascader.js +11 -2
- package/es/ProTreeModal/components/CloseIcon.js +5 -1
- package/es/ProTreeModal/components/List.js +6 -1
- package/es/ProTreeModal/components/SortableItem.js +5 -1
- package/es/ProTreeModal/components/Tree.js +13 -3
- package/es/ProTreeModal/components/Trigger.js +11 -2
- package/es/ProTreeModal/index.js +11 -2
- package/es/ProTreeModal/style/index.less +6 -0
- package/es/ProTreeModal/utils.js +8 -2
- package/es/ProUpload/components/ButtonRender.js +8 -3
- package/es/ProUpload/components/DragRender.d.ts +1 -0
- package/es/ProUpload/components/DragRender.js +10 -2
- package/es/ProUpload/components/DraggableUploadListItem.js +5 -1
- package/es/ProUpload/components/Example.js +11 -2
- package/es/ProUpload/components/ImageRender.js +14 -4
- package/es/ProUpload/index.js +17 -5
- package/es/ProUpload/propsType.d.ts +5 -0
- package/es/ProViewer/index.js +14 -4
- package/es/ProWaterMark/index.js +5 -1
- package/es/index.d.ts +1 -2
- package/es/index.js +1 -0
- package/es/locale/en_US.d.ts +9 -0
- package/es/locale/en_US.js +9 -0
- package/es/locale/zh_CN.d.ts +9 -0
- package/es/locale/zh_CN.js +9 -0
- package/es/style/theme/antd.less +11 -35
- package/es/utils/index.js +6 -1
- package/jest.config.js +3 -1
- package/lib/FormsProvider/index.js +2 -1
- package/lib/ProAction/index.js +20 -10
- package/lib/ProConfigProvider/index.js +29 -19
- package/lib/ProDownload/index.js +29 -17
- package/lib/ProDownload/utils.js +14 -12
- package/lib/ProDrawerForm/components/ProDrawer/index.js +27 -16
- package/lib/ProDrawerForm/components/ProModal/index.js +21 -10
- package/lib/ProDrawerForm/components/index.js +2 -2
- package/lib/ProDrawerForm/index.js +20 -9
- package/lib/ProEditLabel/components/RenderProForm.js +9 -6
- package/lib/ProEditLabel/index.js +30 -18
- package/lib/ProEditTable/components/ActionButton/index.js +14 -11
- package/lib/ProEditTable/components/RcTable/BaseTable.js +19 -9
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +24 -16
- package/lib/ProEditTable/components/RcTable/index.js +2 -2
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +16 -10
- package/lib/ProEditTable/components/RenderField/index.js +76 -50
- package/lib/ProEditTable/components/RenderToolbar/index.js +18 -12
- package/lib/ProEditTable/components/index.js +2 -2
- package/lib/ProEditTable/index.js +33 -21
- package/lib/ProEditTable/propsType.d.ts +12 -6
- package/lib/ProEditTable/style/index.less +30 -3
- package/lib/ProEditTable/utils/config.js +20 -15
- package/lib/ProEditTable/utils/index.js +22 -18
- package/lib/ProEditTable/utils/tools.js +30 -21
- package/lib/ProEditTable/utils/useEditTableError.js +7 -3
- package/lib/ProEditTable/utils/useShouldUpdateForTable.js +17 -9
- package/lib/ProEnum/components/Group.js +8 -3
- package/lib/ProEnum/components/Tag.js +8 -3
- package/lib/ProEnum/hooks/useEnum.d.ts +8 -0
- package/lib/ProEnum/hooks/useEnum.js +76 -4
- package/lib/ProEnum/hooks/useEnumRequest.js +23 -18
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +12 -8
- package/lib/ProEnum/index.js +37 -26
- package/lib/ProEnum/utils/eventCenter.js +4 -3
- package/lib/ProEnum/utils/frequentEnum.js +6 -3
- package/lib/ProEnum/utils/index.js +3 -3
- package/lib/ProForm/components/Container.js +1 -1
- package/lib/ProForm/components/FormFooter/index.js +11 -6
- package/lib/ProForm/components/base/Checkbox/index.js +13 -7
- package/lib/ProForm/components/base/DatePicker/index.js +11 -6
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +7 -3
- package/lib/ProForm/components/base/Input/index.js +11 -6
- package/lib/ProForm/components/base/InputNumber/index.js +21 -10
- package/lib/ProForm/components/base/Radio/index.js +10 -5
- package/lib/ProForm/components/base/RangePicker/index.d.ts +7 -1
- package/lib/ProForm/components/base/RangePicker/index.js +55 -9
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +7 -3
- package/lib/ProForm/components/base/Select/index.js +10 -5
- package/lib/ProForm/components/base/Switch/index.js +10 -5
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +12 -6
- package/lib/ProForm/components/base/TextArea/index.js +10 -5
- package/lib/ProForm/components/base/TimePicker/index.js +10 -5
- package/lib/ProForm/components/combination/Container/index.js +11 -6
- package/lib/ProForm/components/combination/Container/style/index.less +5 -0
- package/lib/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -0
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +108 -20
- package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +2 -0
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +65 -8
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/Empty.js +17 -7
- package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +1 -0
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +11 -5
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +58 -23
- package/lib/ProForm/components/combination/FormList/index.js +113 -65
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +7 -2
- package/lib/ProForm/components/combination/FormList/style/index.less +41 -0
- package/lib/ProForm/components/combination/FormList/utils.d.ts +6 -0
- package/lib/ProForm/components/combination/FormList/utils.js +20 -2
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +1 -1
- package/lib/ProForm/components/combination/Group/component/ComRender.d.ts +3 -0
- package/lib/ProForm/components/combination/Group/component/ComRender.js +79 -11
- package/lib/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +10 -0
- package/lib/ProForm/components/combination/Group/component/FlexibleGroup.js +360 -0
- package/lib/ProForm/components/combination/Group/hooks/index.d.ts +16 -1
- package/lib/ProForm/components/combination/Group/hooks/index.js +111 -9
- package/lib/ProForm/components/combination/Group/index.d.ts +3 -4
- package/lib/ProForm/components/combination/Group/index.js +111 -27
- package/lib/ProForm/components/combination/Group/propsType.d.ts +44 -1
- package/lib/ProForm/components/combination/Group/style/index.less +425 -3
- package/lib/ProForm/components/combination/Group/utils/index.d.ts +154 -0
- package/lib/ProForm/components/combination/Group/utils/index.js +444 -0
- package/lib/ProForm/components/combination/ProCascader/index.js +20 -10
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +9 -5
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +25 -15
- package/lib/ProForm/components/combination/ProModalSelect/index.js +53 -41
- package/lib/ProForm/components/combination/ProNumberRange/index.js +28 -16
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +4 -0
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +14 -7
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +29 -18
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +8 -3
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +26 -15
- package/lib/ProForm/components/index.js +2 -2
- package/lib/ProForm/components/render/ChangedWrapper.js +16 -10
- package/lib/ProForm/components/render/ConfirmWrapper.js +19 -13
- package/lib/ProForm/components/render/CustomComponentViewWrapper.d.ts +30 -0
- package/lib/ProForm/components/render/CustomComponentViewWrapper.js +127 -0
- package/lib/ProForm/components/render/Render.js +93 -37
- package/lib/ProForm/components/render/RenderFields.js +15 -9
- package/lib/ProForm/index.js +23 -12
- package/lib/ProForm/propsType.d.ts +7 -0
- package/lib/ProForm/style/index.less +11 -2
- package/lib/ProForm/utils/index.js +12 -8
- package/lib/ProForm/utils/rulesCreator.js +8 -4
- package/lib/ProForm/utils/transformValue.js +6 -3
- package/lib/ProForm/utils/useFieldProps.js +2 -1
- package/lib/ProForm/utils/useForm.js +21 -12
- package/lib/ProForm/utils/useRules.js +1 -1
- package/lib/ProForm/utils/useShouldUpdate.js +94 -37
- package/lib/ProForm/utils/useWatch.js +11 -6
- package/lib/ProForm/utils/valueType.js +15 -6
- package/lib/ProIcon/index.js +26 -16
- package/lib/ProIcon/utils/index.js +7 -4
- package/lib/ProLayout/components/Layout/Header/index.js +1 -1
- package/lib/ProLayout/components/Layout/Icon/Icon.js +2 -1
- package/lib/ProLayout/components/Layout/Icon/index.js +1 -1
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +24 -19
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +6 -2
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +50 -33
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -12
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +1 -1
- package/lib/ProLayout/components/Layout/Menu/index.js +1 -1
- package/lib/ProLayout/components/Layout/Notice/index.js +1 -1
- package/lib/ProLayout/components/Layout/Notice/style/index.less +4 -0
- package/lib/ProLayout/components/Layout/index.js +2 -2
- package/lib/ProLayout/components/ProCollapse/index.js +10 -6
- package/lib/ProLayout/components/ProCollapse/style/index.less +9 -9
- package/lib/ProLayout/components/ProFooter/index.js +8 -4
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +1 -1
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +1 -1
- package/lib/ProLayout/components/ProHeader/components/index.js +2 -2
- package/lib/ProLayout/components/ProHeader/index.js +41 -27
- package/lib/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +7 -0
- package/lib/ProLayout/components/TabsManager/components/TabContextMenu.js +106 -0
- package/lib/ProLayout/components/TabsManager/components/TabItem.d.ts +26 -0
- package/lib/ProLayout/components/TabsManager/components/TabItem.js +67 -0
- package/lib/ProLayout/components/TabsManager/components/TabsContext.d.ts +6 -0
- package/lib/ProLayout/components/TabsManager/components/TabsContext.js +11 -0
- package/lib/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +6 -0
- package/lib/ProLayout/components/TabsManager/hooks/useActiveTab.js +20 -0
- package/lib/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +18 -0
- package/lib/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +31 -0
- package/lib/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +31 -0
- package/lib/ProLayout/components/TabsManager/hooks/useTabsCache.js +103 -0
- package/lib/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +5 -0
- package/lib/ProLayout/components/TabsManager/hooks/useTabsState.js +370 -0
- package/lib/ProLayout/components/TabsManager/index.d.ts +8 -0
- package/lib/ProLayout/components/TabsManager/index.js +183 -0
- package/lib/ProLayout/components/TabsManager/propTypes.d.ts +74 -0
- package/lib/ProLayout/components/TabsManager/propTypes.js +22 -0
- package/lib/ProLayout/components/TabsManager/style/index.less +179 -0
- package/lib/ProLayout/components/TabsManager/utils/index.d.ts +38 -0
- package/lib/ProLayout/components/TabsManager/utils/index.js +119 -0
- package/lib/ProLayout/components/index.js +2 -2
- package/lib/ProLayout/index.d.ts +21 -4
- package/lib/ProLayout/index.js +122 -21
- package/lib/ProLayout/propTypes.d.ts +139 -1
- package/lib/ProLayout/propTypes.js +40 -1
- package/lib/ProLayout/utils/index.js +18 -13
- package/lib/ProSelect/components/AdaptiveTooltip.js +7 -3
- package/lib/ProSelect/index.js +23 -12
- package/lib/ProSelect/utils/index.js +8 -8
- package/lib/ProStep/components/Anchor/index.js +1 -1
- package/lib/ProStep/components/Item/index.js +15 -9
- package/lib/ProStep/components/Listener/index.js +15 -9
- package/lib/ProStep/components/Step/index.js +17 -7
- package/lib/ProStep/index.js +30 -19
- package/lib/ProStep/utils/index.js +6 -3
- package/lib/ProStepTab/index.js +33 -22
- package/lib/ProTable/components/FormatColumn/index.js +22 -16
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +9 -5
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +22 -16
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -5
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +11 -6
- package/lib/ProTable/components/RcTable/index.js +2 -2
- package/lib/ProTable/components/RenderColumn/index.js +17 -8
- package/lib/ProTable/components/RenderTabs/index.js +16 -7
- package/lib/ProTable/components/TableResizable/index.js +19 -9
- package/lib/ProTable/components/TooltipTitle/index.js +3 -6
- package/lib/ProTable/components/index.js +2 -2
- package/lib/ProTable/hooks/useAntdTable.js +94 -60
- package/lib/ProTable/index.js +41 -29
- package/lib/ProTable/style/index.less +3 -0
- package/lib/ProTable/utils/index.js +7 -3
- package/lib/ProTabs/components/index.js +2 -2
- package/lib/ProTabs/index.js +23 -12
- package/lib/ProThemeTools/component/ProTools/index.js +21 -11
- package/lib/ProThemeTools/component/index.js +2 -2
- package/lib/ProThemeTools/context/ThemeContext.js +20 -16
- package/lib/ProThemeTools/index.js +22 -12
- package/lib/ProThemeTools/utils/index.js +6 -3
- package/lib/ProTooltip/index.js +30 -20
- package/lib/ProTree/components/CloseIcon.js +6 -3
- package/lib/ProTree/components/List.js +10 -5
- package/lib/ProTree/components/ProTree.js +23 -12
- package/lib/ProTree/components/ProTreeSelect/index.js +138 -93
- package/lib/ProTree/components/SearchTitle.js +1 -1
- package/lib/ProTree/components/Tree.js +28 -16
- package/lib/ProTree/components/index.js +2 -2
- package/lib/ProTree/index.js +9 -5
- package/lib/ProTree/utils.js +16 -11
- package/lib/ProTreeModal/components/Cascader.js +14 -5
- package/lib/ProTreeModal/components/CloseIcon.js +6 -3
- package/lib/ProTreeModal/components/List.js +11 -7
- package/lib/ProTreeModal/components/SortableItem.js +10 -6
- package/lib/ProTreeModal/components/Tree.js +24 -13
- package/lib/ProTreeModal/components/Trigger.js +19 -9
- package/lib/ProTreeModal/components/index.js +2 -2
- package/lib/ProTreeModal/index.js +16 -6
- package/lib/ProTreeModal/style/index.less +6 -0
- package/lib/ProTreeModal/utils.js +17 -14
- package/lib/ProUpload/components/ButtonRender.js +14 -9
- package/lib/ProUpload/components/DragRender.d.ts +1 -0
- package/lib/ProUpload/components/DragRender.js +13 -5
- package/lib/ProUpload/components/DraggableUploadListItem.js +7 -3
- package/lib/ProUpload/components/Example.js +16 -6
- package/lib/ProUpload/components/FileItem.js +1 -1
- package/lib/ProUpload/components/ImageRender.js +20 -10
- package/lib/ProUpload/index.js +31 -18
- package/lib/ProUpload/propsType.d.ts +5 -0
- package/lib/ProViewer/index.js +22 -14
- package/lib/ProWaterMark/index.js +7 -3
- package/lib/index.d.ts +1 -2
- package/lib/index.js +4 -3
- package/lib/locale/en_US.d.ts +9 -0
- package/lib/locale/en_US.js +9 -0
- package/lib/locale/index.js +1 -1
- package/lib/locale/zh_CN.d.ts +9 -0
- package/lib/locale/zh_CN.js +9 -0
- package/lib/style/theme/antd.less +11 -35
- package/lib/utils/index.js +9 -4
- package/package.json +14 -17
- package/package.json.backup-antd5 +159 -0
- package/es/ProForm/components/combination/Group/utils.d.ts +0 -54
- package/es/ProForm/components/combination/Group/utils.js +0 -196
- package/es/assets/tip.svg +0 -1
- package/lib/ProForm/components/combination/Group/utils.d.ts +0 -54
- package/lib/ProForm/components/combination/Group/utils.js +0 -210
- package/lib/assets/tip.svg +0 -1
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.useTransformColumns = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
6
|
+
exports.useTransformColumns = exports.useResetProEditTable = exports.checkShouldShow = void 0;
|
|
9
7
|
var _react = require("react");
|
|
10
8
|
var _lodash = require("lodash");
|
|
11
9
|
var _useDeepCompareMemo = require("../../../../utils/useDeepCompareMemo");
|
|
12
10
|
var _tools = require("../../../../../ProEditTable/utils/tools");
|
|
13
11
|
var _utils = require("../utils");
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable no-lonely-if */
|
|
16
17
|
/** 转换columns */
|
|
17
18
|
var useTransformColumns = params => {
|
|
18
19
|
var form = params.form,
|
|
@@ -131,7 +132,6 @@ var useTransformColumns = params => {
|
|
|
131
132
|
form,
|
|
132
133
|
option: args === null || args === void 0 ? void 0 : args[1]
|
|
133
134
|
});
|
|
134
|
-
|
|
135
135
|
// 如果是在可编辑表格或formList内部, 储存当前行的值, 并在变更后更新到表单里
|
|
136
136
|
if (namePath !== null && namePath !== void 0 && namePath.length && !(0, _lodash.isEqual)(originRow, values)) {
|
|
137
137
|
var _Object$keys, _Object$keys$map;
|
|
@@ -166,12 +166,12 @@ var useTransformColumns = params => {
|
|
|
166
166
|
}
|
|
167
167
|
return reactiveProps.disabled || groupProps.disabled;
|
|
168
168
|
};
|
|
169
|
-
return (
|
|
169
|
+
return _objectSpread(_objectSpread(_objectSpread({}, column), {}, {
|
|
170
170
|
name: columnName
|
|
171
171
|
}, reactiveProps), {}, {
|
|
172
172
|
disabled: getLastDisabled(),
|
|
173
173
|
getValueProps: transform === null || transform === void 0 ? void 0 : transform.getValueProps,
|
|
174
|
-
fieldProps: (
|
|
174
|
+
fieldProps: _objectSpread(_objectSpread(_objectSpread({}, column === null || column === void 0 ? void 0 : column.fieldProps), reactiveProps === null || reactiveProps === void 0 ? void 0 : reactiveProps.fieldProps), {}, {
|
|
175
175
|
onChange: handleChange,
|
|
176
176
|
onBlur: handleBlur,
|
|
177
177
|
value: value === null || value === void 0 ? void 0 : value[index]
|
|
@@ -179,4 +179,106 @@ var useTransformColumns = params => {
|
|
|
179
179
|
});
|
|
180
180
|
});
|
|
181
181
|
};
|
|
182
|
-
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* 检查子项是否应该显示(纯函数,不执行副作用)
|
|
185
|
+
*/
|
|
186
|
+
exports.useTransformColumns = useTransformColumns;
|
|
187
|
+
var checkShouldShow = (child, form, namePath, index) => {
|
|
188
|
+
var show = child.show;
|
|
189
|
+
|
|
190
|
+
// 如果没有配置 show,默认显示
|
|
191
|
+
if (show === undefined || show === true) {
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// 如果 show 是 false,不显示
|
|
196
|
+
if (show === false) {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// 如果 show 是函数,需要获取表单值来评估
|
|
201
|
+
if ((0, _lodash.isFunction)(show)) {
|
|
202
|
+
var values = {};
|
|
203
|
+
if (namePath) {
|
|
204
|
+
// FormList 场景:取当前行数据
|
|
205
|
+
values = form.getFieldValue(namePath) || {};
|
|
206
|
+
} else {
|
|
207
|
+
// 普通场景:取整个表单值
|
|
208
|
+
values = form.getFieldsValue(true);
|
|
209
|
+
}
|
|
210
|
+
return Boolean(show(values, {
|
|
211
|
+
form,
|
|
212
|
+
index,
|
|
213
|
+
namePath
|
|
214
|
+
}));
|
|
215
|
+
}
|
|
216
|
+
return true;
|
|
217
|
+
};
|
|
218
|
+
exports.checkShouldShow = checkShouldShow;
|
|
219
|
+
/**
|
|
220
|
+
* ProEditTable 场景下,当字段的 show 从 true 变为 false 时,自动重置字段值
|
|
221
|
+
* 使用 useEffect 在副作用中执行重置,避免在渲染过程中调用 setState
|
|
222
|
+
*/
|
|
223
|
+
var useResetProEditTable = params => {
|
|
224
|
+
var children = params.children,
|
|
225
|
+
form = params.form,
|
|
226
|
+
namePath = params.namePath,
|
|
227
|
+
source = params.source;
|
|
228
|
+
|
|
229
|
+
// 用于跟踪每个子项的显示状态
|
|
230
|
+
var showStateRef = (0, _react.useRef)(new Map());
|
|
231
|
+
// 用于存储重置定时器
|
|
232
|
+
var resetTimersRef = (0, _react.useRef)(new Map());
|
|
233
|
+
(0, _react.useEffect)(() => {
|
|
234
|
+
// 只在 ProEditTable 场景下执行重置逻辑
|
|
235
|
+
if (source !== 'ProEditTable') {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// 检查每个子项的显示状态
|
|
240
|
+
children.forEach(child => {
|
|
241
|
+
var childNamePath = child.namePath || namePath;
|
|
242
|
+
var childIndex = child.index;
|
|
243
|
+
|
|
244
|
+
// 生成唯一 key 用于跟踪状态
|
|
245
|
+
var childKey = child.name ? Array.isArray(child.name) ? `${JSON.stringify(childNamePath)}-${JSON.stringify(child.name)}` : `${JSON.stringify(childNamePath)}-${child.name}` : `child-${children.indexOf(child)}`;
|
|
246
|
+
|
|
247
|
+
// 计算当前显示状态
|
|
248
|
+
var currentShow = checkShouldShow(child, form, childNamePath, childIndex);
|
|
249
|
+
var previousShow = showStateRef.current.get(childKey);
|
|
250
|
+
|
|
251
|
+
// 如果状态发生变化,且从显示变为隐藏,执行重置
|
|
252
|
+
if (previousShow !== undefined && previousShow === true && currentShow === false) {
|
|
253
|
+
// 清除之前的定时器
|
|
254
|
+
var existingTimer = resetTimersRef.current.get(childKey);
|
|
255
|
+
if (existingTimer) {
|
|
256
|
+
clearTimeout(existingTimer);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// 延迟执行重置,避免在渲染过程中调用
|
|
260
|
+
var timer = setTimeout(() => {
|
|
261
|
+
if (Array.isArray(child.name)) {
|
|
262
|
+
form.resetFields([[...childNamePath, ...child.name]]);
|
|
263
|
+
} else {
|
|
264
|
+
form.resetFields([[...childNamePath, child.name]]);
|
|
265
|
+
}
|
|
266
|
+
resetTimersRef.current.delete(childKey);
|
|
267
|
+
}, 300);
|
|
268
|
+
resetTimersRef.current.set(childKey, timer);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// 更新显示状态
|
|
272
|
+
showStateRef.current.set(childKey, currentShow);
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
// 清理函数:组件卸载时清除所有定时器
|
|
276
|
+
return () => {
|
|
277
|
+
resetTimersRef.current.forEach(timer => {
|
|
278
|
+
clearTimeout(timer);
|
|
279
|
+
});
|
|
280
|
+
resetTimersRef.current.clear();
|
|
281
|
+
};
|
|
282
|
+
}, [children, namePath, source, form]);
|
|
283
|
+
};
|
|
284
|
+
exports.useResetProEditTable = useResetProEditTable;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { GroupType } from './propsType';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* render内部能力 show, component, value, onChange, disabled, clearNotShow, fieldProps
|
|
4
|
+
* Group组件 - 支持传统模式和灵活模式
|
|
5
|
+
* - 有names属性 → 传统数组模式(保持向后兼容)
|
|
6
|
+
* - 无names属性 → 新的灵活模式(子组件必须配置name)
|
|
8
7
|
*/
|
|
9
8
|
declare const Group: React.FC<GroupType>;
|
|
10
9
|
export default Group;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
7
|
var _antd = require("antd");
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
var _lodash = require("lodash");
|
|
@@ -14,17 +12,22 @@ var _utils = require("./utils");
|
|
|
14
12
|
var _hooks = require("./hooks");
|
|
15
13
|
var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
|
16
14
|
var _ComRender = _interopRequireDefault(require("./component/ComRender"));
|
|
15
|
+
var _FlexibleGroup = _interopRequireDefault(require("./component/FlexibleGroup"));
|
|
17
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
22
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
23
|
+
* 传统数组模式Group组件(保持向后兼容)
|
|
24
|
+
*/
|
|
25
|
+
var LegacyGroup = props => {
|
|
26
|
+
var _ref, _fieldProps;
|
|
24
27
|
var children = props.children,
|
|
25
28
|
className = props.className,
|
|
26
29
|
_props$space = props.space,
|
|
27
|
-
|
|
30
|
+
propsSpace = _props$space === void 0 ? {
|
|
28
31
|
size: 12
|
|
29
32
|
} : _props$space,
|
|
30
33
|
value = props.value,
|
|
@@ -33,8 +36,15 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
33
36
|
id = props.id,
|
|
34
37
|
isParentView = props.isView,
|
|
35
38
|
formDisabled = props.disabled,
|
|
36
|
-
|
|
37
|
-
split =
|
|
39
|
+
separator = props.separator,
|
|
40
|
+
split = props.split;
|
|
41
|
+
|
|
42
|
+
// 向后兼容处理:优先使用 separator,如果没有则使用 split,最后使用默认值
|
|
43
|
+
var finalSeparator = (_ref = separator !== null && separator !== void 0 ? separator : split) !== null && _ref !== void 0 ? _ref : '/';
|
|
44
|
+
|
|
45
|
+
// 支持从 fieldProps.space 获取 space 配置
|
|
46
|
+
var fieldPropsSpace = (_fieldProps = props.fieldProps) === null || _fieldProps === void 0 ? void 0 : _fieldProps.space;
|
|
47
|
+
var space = fieldPropsSpace || propsSpace;
|
|
38
48
|
var contextProps = _ProForm.default.useFieldProps() || {};
|
|
39
49
|
var names = contextProps.names,
|
|
40
50
|
name = contextProps.name,
|
|
@@ -67,6 +77,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
67
77
|
var columns = (0, _utils.insertSeparator)(columnsProps, space);
|
|
68
78
|
var nextClassName = (0, _classnames.default)({
|
|
69
79
|
'pro-group': true,
|
|
80
|
+
'pro-group-unflexible': true,
|
|
70
81
|
'pro-group-diy-width': columns.some(item => {
|
|
71
82
|
var _item$fieldProps;
|
|
72
83
|
return item === null || item === void 0 || (_item$fieldProps = item.fieldProps) === null || _item$fieldProps === void 0 || (_item$fieldProps = _item$fieldProps.style) === null || _item$fieldProps === void 0 ? void 0 : _item$fieldProps.width;
|
|
@@ -80,26 +91,71 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
80
91
|
if (nextIsView && (0, _lodash.isEmpty)(value)) {
|
|
81
92
|
return (otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewEmpty) || '-';
|
|
82
93
|
}
|
|
94
|
+
|
|
95
|
+
// compact模式专用:为每个字段创建可见的Form.Item,并应用宽度样式
|
|
96
|
+
var renderCompactFormItems = () => {
|
|
97
|
+
var elements = [];
|
|
98
|
+
columns.forEach((column, index) => {
|
|
99
|
+
var _column$fieldProps;
|
|
100
|
+
// 检测是否有自定义宽度
|
|
101
|
+
var childWidth = column === null || column === void 0 || (_column$fieldProps = column.fieldProps) === null || _column$fieldProps === void 0 || (_column$fieldProps = _column$fieldProps.style) === null || _column$fieldProps === void 0 ? void 0 : _column$fieldProps.width;
|
|
102
|
+
var formItemStyle = childWidth ? {
|
|
103
|
+
width: childWidth
|
|
104
|
+
} : undefined;
|
|
105
|
+
var formItemClassName = childWidth ? 'pro-group-form-item pro-group-form-item-has-width' : 'pro-group-form-item';
|
|
106
|
+
|
|
107
|
+
// 创建新的 column 对象,避免直接修改原对象
|
|
108
|
+
var newColumn = _objectSpread({}, column);
|
|
109
|
+
newColumn.otherProps = otherProps;
|
|
110
|
+
|
|
111
|
+
// 如果子组件有自定义宽度,将子组件的宽度改为 100%,让它填充 Form.Item
|
|
112
|
+
if (childWidth) {
|
|
113
|
+
var _newColumn$fieldProps;
|
|
114
|
+
newColumn.fieldProps = _objectSpread(_objectSpread({}, newColumn.fieldProps), {}, {
|
|
115
|
+
style: _objectSpread(_objectSpread({}, (_newColumn$fieldProps = newColumn.fieldProps) === null || _newColumn$fieldProps === void 0 ? void 0 : _newColumn$fieldProps.style), {}, {
|
|
116
|
+
width: '100%'
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// 自定义间隔移除对应参数
|
|
122
|
+
if (newColumn !== null && newColumn !== void 0 && newColumn.separator) {
|
|
123
|
+
delete newColumn.separator;
|
|
124
|
+
delete newColumn.otherProps;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// 传统模式 compact 模式:将 Form.Item 相关的 props 传递给 ComRender
|
|
128
|
+
// ComRender 内部会处理 Form.Item 的渲染,避免嵌套
|
|
129
|
+
var dependencies = names && names.length > 0 ? names.filter(n => n !== newColumn.name) : undefined;
|
|
130
|
+
var formElement = /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComRender.default, _objectSpread({
|
|
131
|
+
contextProps: contextProps,
|
|
132
|
+
isView: nextIsView,
|
|
133
|
+
formItemClassName: formItemClassName,
|
|
134
|
+
formItemStyle: formItemStyle,
|
|
135
|
+
dependencies: dependencies
|
|
136
|
+
}, newColumn), newColumn.name || index);
|
|
137
|
+
elements.push(formElement);
|
|
138
|
+
|
|
139
|
+
// 添加分隔符
|
|
140
|
+
if (newColumn !== null && newColumn !== void 0 && newColumn.separator && index < columns.length - 1) {
|
|
141
|
+
elements.push( /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
142
|
+
className: "pro-group-separator-compact",
|
|
143
|
+
children: newColumn.separator
|
|
144
|
+
}, `separator-${newColumn.name || index}`));
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
148
|
+
className: "ant-space ant-space-horizontal ant-space-compact pro-group-compact-container",
|
|
149
|
+
children: elements
|
|
150
|
+
});
|
|
151
|
+
};
|
|
83
152
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
84
153
|
className: nextClassName,
|
|
85
154
|
id: id,
|
|
86
|
-
children: (space.compact || space !== null && space !== void 0 && space.separator) && !nextIsView ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space
|
|
87
|
-
children: columns.map((column, index) => {
|
|
88
|
-
column.otherProps = otherProps;
|
|
89
|
-
// 自定义间隔移除对应参数
|
|
90
|
-
if (column !== null && column !== void 0 && column.separator) {
|
|
91
|
-
delete column.separator;
|
|
92
|
-
delete column.otherProps;
|
|
93
|
-
}
|
|
94
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComRender.default, (0, _objectSpread2.default)({
|
|
95
|
-
contextProps: contextProps,
|
|
96
|
-
isView: nextIsView
|
|
97
|
-
}, column), column.name || index);
|
|
98
|
-
})
|
|
99
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
155
|
+
children: (space.compact || space !== null && space !== void 0 && space.separator) && !nextIsView ? renderCompactFormItems() : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, _objectSpread(_objectSpread({
|
|
100
156
|
align: "start"
|
|
101
157
|
}, (0, _lodash.omit)(space, ['separator', 'compact'])), {}, {
|
|
102
|
-
|
|
158
|
+
separator: nextIsView ? finalSeparator : null,
|
|
103
159
|
size: nextIsView ? 0 : space.size,
|
|
104
160
|
children: columns.map((column, index) => {
|
|
105
161
|
column.otherProps = otherProps;
|
|
@@ -107,7 +163,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
107
163
|
delete column.separator;
|
|
108
164
|
delete column.otherProps;
|
|
109
165
|
}
|
|
110
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComRender.default, (
|
|
166
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComRender.default, _objectSpread({
|
|
111
167
|
contextProps: contextProps,
|
|
112
168
|
isView: nextIsView
|
|
113
169
|
}, column), column.name || index);
|
|
@@ -115,4 +171,32 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
115
171
|
}))
|
|
116
172
|
});
|
|
117
173
|
};
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Group组件 - 支持传统模式和灵活模式
|
|
177
|
+
* - 有names属性 → 传统数组模式(保持向后兼容)
|
|
178
|
+
* - 无names属性 → 新的灵活模式(子组件必须配置name)
|
|
179
|
+
*/
|
|
180
|
+
var Group = props => {
|
|
181
|
+
var _ref2 = props,
|
|
182
|
+
children = _ref2.children,
|
|
183
|
+
names = _ref2.names,
|
|
184
|
+
otherProps = _ref2.otherProps;
|
|
185
|
+
|
|
186
|
+
// names可能在props.names或props.otherProps.names中(来自ProForm的传递)
|
|
187
|
+
var actualNames = names || (otherProps === null || otherProps === void 0 ? void 0 : otherProps.names);
|
|
188
|
+
|
|
189
|
+
// 模式检测:基于names属性判断使用哪种模式
|
|
190
|
+
// 传统模式:有names属性且为非空数组
|
|
191
|
+
// 灵活模式:无names属性或names为空,children中的子项必须配置name
|
|
192
|
+
var isLegacyMode = Array.isArray(actualNames) && actualNames.length > 0;
|
|
193
|
+
if (isLegacyMode) {
|
|
194
|
+
// 传统模式:使用names数组管理值,确保names被传递给LegacyGroup
|
|
195
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(LegacyGroup, _objectSpread(_objectSpread({}, props), {}, {
|
|
196
|
+
names: actualNames
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
199
|
+
// 灵活模式:子组件独立管理name和rules
|
|
200
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FlexibleGroup.default, _objectSpread({}, props));
|
|
201
|
+
};
|
|
118
202
|
var _default = exports.default = Group;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormItemProps, ModalFuncProps, SpaceProps } from 'antd';
|
|
3
|
+
import type { RuleObject } from 'antd/es/form';
|
|
3
4
|
import { FormInstance } from 'antd/es/form/Form';
|
|
4
5
|
import { NamePath } from 'antd/lib/form/interface';
|
|
5
6
|
import type { ColumnTypeMap, FunctionArgs, ProFormValueType, ReactiveFunction, ViewType } from '../../render/propsType';
|
|
@@ -18,7 +19,9 @@ export interface SpaceType extends SpaceProps {
|
|
|
18
19
|
size?: number;
|
|
19
20
|
}
|
|
20
21
|
export interface GroupType {
|
|
21
|
-
children?: GroupColumnType[];
|
|
22
|
+
children?: GroupColumnType[] | FlexibleGroupColumnType[];
|
|
23
|
+
/** 传统模式:字段名称数组(与children索引对应) */
|
|
24
|
+
names?: NamePath[];
|
|
22
25
|
space?: SpaceType;
|
|
23
26
|
className?: string;
|
|
24
27
|
id?: string;
|
|
@@ -28,6 +31,10 @@ export interface GroupType {
|
|
|
28
31
|
onChange?: (value: any[] | null, options?: any[]) => void;
|
|
29
32
|
otherProps?: any;
|
|
30
33
|
/** 分隔符 */
|
|
34
|
+
separator?: string | React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated 已弃用,请使用 separator 替代
|
|
37
|
+
*/
|
|
31
38
|
split?: string | React.ReactNode;
|
|
32
39
|
}
|
|
33
40
|
export type GroupColumnType<Values = any> = {
|
|
@@ -54,6 +61,42 @@ export type GroupColumnType<Values = any> = {
|
|
|
54
61
|
getValueProps?: (value: any) => Record<string, unknown>;
|
|
55
62
|
desensitization?: [number, number] | ReactiveFunction<Values, [number, number]>;
|
|
56
63
|
} & ColumnTypeMap & FormItemProps;
|
|
64
|
+
/**
|
|
65
|
+
* 灵活模式子组件类型定义(新模式)
|
|
66
|
+
*/
|
|
67
|
+
export interface FlexibleGroupColumnType<Values = any> extends Omit<GroupColumnType<Values>, 'names' | 'tooltip' | 'rules'> {
|
|
68
|
+
/** 字段名称,新模式下必须 */
|
|
69
|
+
name: NamePath;
|
|
70
|
+
/** 字段标签 */
|
|
71
|
+
label?: React.ReactNode;
|
|
72
|
+
/** 校验规则,支持函数化 */
|
|
73
|
+
rules?: RuleObject[] | ReactiveFunction<Values, RuleObject[]>;
|
|
74
|
+
/** 是否必填 */
|
|
75
|
+
required?: boolean;
|
|
76
|
+
/** 字段依赖 */
|
|
77
|
+
dependencies?: NamePath[];
|
|
78
|
+
/** 提示信息 */
|
|
79
|
+
tooltip?: string | {
|
|
80
|
+
title: string;
|
|
81
|
+
icon?: React.ReactNode;
|
|
82
|
+
};
|
|
83
|
+
/** 额外信息 */
|
|
84
|
+
extra?: React.ReactNode;
|
|
85
|
+
/** 前置内容 */
|
|
86
|
+
before?: React.ReactNode;
|
|
87
|
+
/** 后置内容 */
|
|
88
|
+
after?: React.ReactNode;
|
|
89
|
+
/** 确认操作 */
|
|
90
|
+
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps>;
|
|
91
|
+
/** 显示控制,支持函数化 */
|
|
92
|
+
show?: boolean | ReactiveFunction<Values, boolean>;
|
|
93
|
+
/** 禁用状态,支持函数化 */
|
|
94
|
+
disabled?: boolean | ReactiveFunction<Values, boolean>;
|
|
95
|
+
/** 自定义组件,支持函数化 */
|
|
96
|
+
component?: React.ReactNode | ReactiveFunction<Values, React.ReactNode>;
|
|
97
|
+
/** 字段属性,支持函数化 */
|
|
98
|
+
fieldProps?: any | ReactiveFunction<Values, any>;
|
|
99
|
+
}
|
|
57
100
|
/**
|
|
58
101
|
* 兼容旧命名导出
|
|
59
102
|
*/
|