@zat-design/sisyphus-react 4.0.0-beta.9 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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 +7 -2
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +16 -7
- package/es/ProEditTable/components/RenderField/index.js +54 -29
- package/es/ProEditTable/components/RenderToolbar/index.js +10 -4
- package/es/ProEditTable/index.js +16 -10
- package/es/ProEditTable/propsType.d.ts +12 -6
- package/es/ProEditTable/style/index.less +22 -1
- package/es/ProEditTable/utils/config.js +8 -3
- package/es/ProEditTable/utils/index.js +14 -10
- 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.js +10 -4
- package/es/ProForm/components/combination/FormList/components/Empty.js +3 -2
- package/es/ProForm/components/combination/FormList/components/LineFields.js +5 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +10 -4
- package/es/ProForm/components/combination/FormList/index.js +41 -4
- package/es/ProForm/components/combination/FormList/style/index.less +1 -1
- 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 +17 -4
- 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 +6 -1
- 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 +28 -35
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +6 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +54 -35
- 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 +14 -4
- 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 +10 -4
- package/es/ProLayout/index.js +100 -16
- 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 +17 -6
- 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 +122 -76
- 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 +19 -13
- package/lib/ProEditTable/components/RcTable/index.js +2 -2
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +21 -11
- 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 -26
- package/lib/ProEditTable/propsType.d.ts +12 -6
- package/lib/ProEditTable/style/index.less +22 -1
- package/lib/ProEditTable/utils/config.js +20 -15
- package/lib/ProEditTable/utils/index.js +23 -19
- 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.js +26 -19
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +3 -2
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/Empty.js +6 -5
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +7 -3
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +20 -14
- package/lib/ProForm/components/combination/FormList/index.js +48 -10
- package/lib/ProForm/components/combination/FormList/style/index.less +1 -1
- 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 +27 -13
- 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 +8 -3
- 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 +31 -38
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +6 -2
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +55 -36
- 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 +22 -12
- 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 +10 -4
- package/lib/ProLayout/index.js +115 -23
- 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 +42 -31
- 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 +141 -94
- 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 +13 -16
- 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,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
8
|
var _antd = require("antd");
|
|
12
9
|
var _core = require("@dnd-kit/core");
|
|
@@ -21,6 +18,14 @@ var _Empty = _interopRequireDefault(require("./components/Empty"));
|
|
|
21
18
|
var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
|
22
19
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
23
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
23
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
27
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
28
|
+
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); }
|
|
24
29
|
var FormList = (props, ref) => {
|
|
25
30
|
var columns = props.columns,
|
|
26
31
|
min = props.min,
|
|
@@ -38,7 +43,7 @@ var FormList = (props, ref) => {
|
|
|
38
43
|
hideStartEndActionProps = props.hideStartEndActionProps,
|
|
39
44
|
titlePosition = props.titlePosition,
|
|
40
45
|
className = props.className;
|
|
41
|
-
var _fields = fields.map(item => (
|
|
46
|
+
var _fields = fields.map(item => _objectSpread(_objectSpread({}, item), {}, {
|
|
42
47
|
key: String(item.key)
|
|
43
48
|
}));
|
|
44
49
|
var _ref = _ProForm.default.useFieldProps() || {},
|
|
@@ -52,18 +57,51 @@ var FormList = (props, ref) => {
|
|
|
52
57
|
var errors = meta.errors;
|
|
53
58
|
var _namePath = namePath ? [...namePath.slice(0, -1), ...(0, _utils.toArray)(name)] : (0, _utils.toArray)(name);
|
|
54
59
|
var orgValues = (0, _lodash.get)(diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalValues, name);
|
|
55
|
-
var _diffConfig = (
|
|
60
|
+
var _diffConfig = _objectSpread(_objectSpread({}, diffConfig), {}, {
|
|
56
61
|
originalValues: diffConfig !== null && diffConfig !== void 0 && diffConfig.originalValues && isDiffAll ? orgValues || [] : orgValues
|
|
57
62
|
});
|
|
58
63
|
var processColumns = (0, _react.useCallback)((fieldName, namePath) => {
|
|
59
64
|
return columns.map(item => {
|
|
65
|
+
// 如果是灵活模式的 Group,需要给 children 添加参数
|
|
66
|
+
if (!(0, _utils2.isLegacyMode)(item) && (item === null || item === void 0 ? void 0 : item.type) === 'Group') {
|
|
67
|
+
var fieldProps = item === null || item === void 0 ? void 0 : item.fieldProps;
|
|
68
|
+
var children = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.children;
|
|
69
|
+
if (children) {
|
|
70
|
+
var childrenArray = Array.isArray(children) ? children : [children];
|
|
71
|
+
// 给每个 child 添加 index、name、namePath、listName 参数
|
|
72
|
+
var processedChildren = childrenArray.map(child => {
|
|
73
|
+
var childName = child === null || child === void 0 ? void 0 : child.name;
|
|
74
|
+
return _objectSpread(_objectSpread({}, child), {}, {
|
|
75
|
+
index: fieldName,
|
|
76
|
+
name: [fieldName, ...(0, _utils.toArray)(childName)],
|
|
77
|
+
namePath,
|
|
78
|
+
listName: childName ? [...namePath, ...(0, _utils.toArray)(childName)] : undefined,
|
|
79
|
+
source: 'FormList'
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// 创建新的 fieldProps,包含处理后的 children
|
|
84
|
+
var newFieldProps = _objectSpread(_objectSpread({}, fieldProps), {}, {
|
|
85
|
+
children: Array.isArray(children) ? processedChildren : processedChildren[0]
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// 创建新的 column,使用新的 fieldProps
|
|
89
|
+
var _column = _objectSpread(_objectSpread({}, item), {}, {
|
|
90
|
+
fieldProps: newFieldProps,
|
|
91
|
+
index: fieldName,
|
|
92
|
+
label: mode === 'less' ? undefined : item.label
|
|
93
|
+
});
|
|
94
|
+
return _column;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
60
98
|
// names的name处理
|
|
61
99
|
var _name = Array.isArray(item === null || item === void 0 ? void 0 : item.names) ? [fieldName, (0, _utils2.namesPathTransform)({
|
|
62
100
|
names: item === null || item === void 0 ? void 0 : item.names,
|
|
63
101
|
prefixNamePath: namePath,
|
|
64
102
|
type: item.type
|
|
65
103
|
})] : [fieldName, ...(0, _utils.toArray)(item.name)];
|
|
66
|
-
var column = (
|
|
104
|
+
var column = _objectSpread(_objectSpread({}, item), {}, {
|
|
67
105
|
name: _name,
|
|
68
106
|
names: item !== null && item !== void 0 && item.names ? item.names.map(nameItem => {
|
|
69
107
|
// 传给Group的names会被渲染成真实FormItem 不能传完整name
|
|
@@ -71,12 +109,12 @@ var FormList = (props, ref) => {
|
|
|
71
109
|
}) : item.names,
|
|
72
110
|
index: fieldName,
|
|
73
111
|
namePath,
|
|
74
|
-
listName: [...namePath, item.name],
|
|
112
|
+
listName: item.name ? [...namePath, ...(0, _utils.toArray)(item.name)] : undefined,
|
|
75
113
|
label: mode === 'less' ? undefined : item.label
|
|
76
114
|
});
|
|
77
115
|
return column;
|
|
78
116
|
});
|
|
79
|
-
}, [columns]);
|
|
117
|
+
}, [columns, mode]);
|
|
80
118
|
(0, _react.useImperativeHandle)(ref, () => {
|
|
81
119
|
return {
|
|
82
120
|
operation
|
|
@@ -103,7 +141,7 @@ var FormList = (props, ref) => {
|
|
|
103
141
|
children: [_fields.map((field, index) => {
|
|
104
142
|
var namePath = [..._namePath, field.name];
|
|
105
143
|
var _columns = processColumns(index, namePath);
|
|
106
|
-
return mode === 'block' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_BlockFields.default, (
|
|
144
|
+
return mode === 'block' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_BlockFields.default, _objectSpread(_objectSpread({}, props), {}, {
|
|
107
145
|
columns: _columns,
|
|
108
146
|
disabled: disabled,
|
|
109
147
|
isView: isView,
|
|
@@ -117,7 +155,7 @@ var FormList = (props, ref) => {
|
|
|
117
155
|
diffConfig: _diffConfig,
|
|
118
156
|
hideStartEndActionProps: hideStartEndActionProps,
|
|
119
157
|
titlePosition: titlePosition
|
|
120
|
-
}), field.key) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineFields.default, (
|
|
158
|
+
}), field.key) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineFields.default, _objectSpread(_objectSpread({
|
|
121
159
|
className: _fields.length === index + 1 ? 'pro-form-list-last' : ''
|
|
122
160
|
}, props), {}, {
|
|
123
161
|
mode: mode,
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断 Group 组件是否为传统模式(LegacyMode)
|
|
3
|
+
* @param item column 配置项
|
|
4
|
+
* @returns true 表示传统模式,false 表示灵活模式
|
|
5
|
+
*/
|
|
6
|
+
export declare const isLegacyMode: (item: any) => boolean;
|
|
1
7
|
/**
|
|
2
8
|
* namesPath生产 [['list', 0, 'min'], ['list', 0, 'max']] => list_0_min-list_0_max
|
|
3
9
|
* @param names name的集合
|
|
@@ -1,18 +1,36 @@
|
|
|
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.namesPathTransform = exports.memoWith = void 0;
|
|
6
|
+
exports.namesPathTransform = exports.memoWith = exports.isLegacyMode = void 0;
|
|
8
7
|
var _lodash = require("lodash");
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
/**
|
|
11
|
+
* 判断 Group 组件是否为传统模式(LegacyMode)
|
|
12
|
+
* @param item column 配置项
|
|
13
|
+
* @returns true 表示传统模式,false 表示灵活模式
|
|
14
|
+
*/
|
|
15
|
+
var isLegacyMode = item => {
|
|
16
|
+
var _item$otherProps;
|
|
17
|
+
if ((item === null || item === void 0 ? void 0 : item.type) !== 'Group') {
|
|
18
|
+
return true; // 非 Group 类型,不需要特殊处理,返回 true 表示按原样处理
|
|
19
|
+
}
|
|
20
|
+
// names 可能在 item.names 或 item.otherProps.names 中(参考 Group/index.tsx 的实现)
|
|
21
|
+
var names = (item === null || item === void 0 ? void 0 : item.names) || (item === null || item === void 0 || (_item$otherProps = item.otherProps) === null || _item$otherProps === void 0 ? void 0 : _item$otherProps.names);
|
|
22
|
+
// 传统模式:有 names 属性且为非空数组
|
|
23
|
+
// 灵活模式:无 names 属性或 names 为空
|
|
24
|
+
return Array.isArray(names) && names.length > 0;
|
|
25
|
+
};
|
|
26
|
+
|
|
10
27
|
/**
|
|
11
28
|
* namesPath生产 [['list', 0, 'min'], ['list', 0, 'max']] => list_0_min-list_0_max
|
|
12
29
|
* @param names name的集合
|
|
13
30
|
* @param prefixNamePath formList的name前缀
|
|
14
31
|
* @returns list_0_min-list_0_max
|
|
15
32
|
*/
|
|
33
|
+
exports.isLegacyMode = isLegacyMode;
|
|
16
34
|
var namesPathTransform = _ref => {
|
|
17
35
|
var names = _ref.names,
|
|
18
36
|
prefixNamePath = _ref.prefixNamePath,
|
|
@@ -1,6 +1,5 @@
|
|
|
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
|
});
|
|
@@ -8,6 +7,7 @@ exports.default = void 0;
|
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
8
|
require("./index.less");
|
|
10
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
var AddonWrapper = props => {
|
|
12
12
|
var before = props.before,
|
|
13
13
|
after = props.after,
|
|
@@ -17,6 +17,9 @@ interface Props {
|
|
|
17
17
|
isView?: boolean;
|
|
18
18
|
getValueProps?: (value: any) => Record<string, unknown>;
|
|
19
19
|
viewRender?: (props: any) => any;
|
|
20
|
+
formItemClassName?: string;
|
|
21
|
+
formItemStyle?: React.CSSProperties;
|
|
22
|
+
dependencies?: NamePath[];
|
|
20
23
|
}
|
|
21
24
|
/** 渲染组件 */
|
|
22
25
|
declare const ComRender: React.FC<Props>;
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _antd = require("antd");
|
|
12
9
|
var _lodash = require("lodash");
|
|
13
10
|
var _ConfirmWrapper = _interopRequireDefault(require("../../../../components/render/ConfirmWrapper"));
|
|
14
11
|
var _useFieldProps = require("../../../../utils/useFieldProps");
|
|
15
12
|
var componentMap = _interopRequireWildcard(require("../../../../../index"));
|
|
16
13
|
var _AddonWrapper = _interopRequireDefault(require("./AddonWrapper"));
|
|
17
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView", "viewRender"];
|
|
15
|
+
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView", "viewRender", "formItemClassName", "formItemStyle", "dependencies", "name"];
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
20
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
25
|
+
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); }
|
|
19
26
|
// 这里的key与组件内参数一致, 决定使用哪个包裹组件
|
|
20
27
|
var wrapperMap = {
|
|
21
28
|
confirm: _ConfirmWrapper.default,
|
|
@@ -30,7 +37,7 @@ var getComRender = (component, props, componentProps) => {
|
|
|
30
37
|
wrappers.forEach(item => {
|
|
31
38
|
if (item in props) {
|
|
32
39
|
var Wrapper = wrapperMap[item];
|
|
33
|
-
renderComponent = /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, (
|
|
40
|
+
renderComponent = /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, _objectSpread(_objectSpread({}, componentProps), {}, {
|
|
34
41
|
[item]: props[item],
|
|
35
42
|
children: renderComponent
|
|
36
43
|
}));
|
|
@@ -55,13 +62,17 @@ var ComRender = props => {
|
|
|
55
62
|
valueType = props.valueType,
|
|
56
63
|
isView = props.isView,
|
|
57
64
|
viewRender = props.viewRender,
|
|
58
|
-
|
|
65
|
+
formItemClassName = props.formItemClassName,
|
|
66
|
+
formItemStyle = props.formItemStyle,
|
|
67
|
+
dependencies = props.dependencies,
|
|
68
|
+
name = props.name,
|
|
69
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
59
70
|
var TypeComponent = componentMap[type];
|
|
60
71
|
var mergedGetValueProps = getValueProps || (val => ({
|
|
61
72
|
[valuePropName]: val
|
|
62
73
|
}));
|
|
63
74
|
var nextProps = mergedGetValueProps(fieldProps.value);
|
|
64
|
-
var componentProps = (0, _lodash.omit)((
|
|
75
|
+
var componentProps = (0, _lodash.omit)(_objectSpread(_objectSpread(_objectSpread({}, fieldProps), rest), nextProps), ['onFieldChange']);
|
|
65
76
|
var isSeparator = (props === null || props === void 0 || (_props$component = props.component) === null || _props$component === void 0 || (_props$component = _props$component.props) === null || _props$component === void 0 ? void 0 : _props$component.className) === 'group-separator';
|
|
66
77
|
if (isSeparator && isView) {
|
|
67
78
|
var _props$component2;
|
|
@@ -71,7 +82,7 @@ var ComRender = props => {
|
|
|
71
82
|
}
|
|
72
83
|
if (viewRender && isView) {
|
|
73
84
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
74
|
-
value: (
|
|
85
|
+
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
|
75
86
|
valueType,
|
|
76
87
|
type,
|
|
77
88
|
isView
|
|
@@ -79,10 +90,67 @@ var ComRender = props => {
|
|
|
79
90
|
children: viewRender(componentProps)
|
|
80
91
|
});
|
|
81
92
|
}
|
|
82
|
-
var Component = component ? ( /*#__PURE__*/_react.default.cloneElement(component, (
|
|
93
|
+
var Component = component ? ( /*#__PURE__*/_react.default.cloneElement(component, _objectSpread({}, componentProps))) : /*#__PURE__*/(0, _jsxRuntime.jsx)(TypeComponent, _objectSpread({}, componentProps));
|
|
83
94
|
var renderComponent = getComRender(Component, props, componentProps);
|
|
95
|
+
|
|
96
|
+
// 传统模式 compact 模式:需要 Form.Item 包装并应用宽度样式
|
|
97
|
+
// 通过 formItemClassName 和 formItemStyle 来判断是否需要 Form.Item 包装
|
|
98
|
+
if (formItemClassName && name) {
|
|
99
|
+
// 如果有依赖字段,使用 shouldUpdate 来实时更新错误状态
|
|
100
|
+
if (dependencies && dependencies.length > 0) {
|
|
101
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
102
|
+
shouldUpdate: (prevValues, currentValues) => {
|
|
103
|
+
// 检查当前字段和依赖字段是否有变化
|
|
104
|
+
var currentFieldChanged = (prevValues === null || prevValues === void 0 ? void 0 : prevValues[name]) !== (currentValues === null || currentValues === void 0 ? void 0 : currentValues[name]);
|
|
105
|
+
var dependenciesChanged = dependencies.some(dep => {
|
|
106
|
+
var prevValue = prevValues === null || prevValues === void 0 ? void 0 : prevValues[dep];
|
|
107
|
+
var currentValue = currentValues === null || currentValues === void 0 ? void 0 : currentValues[dep];
|
|
108
|
+
return prevValue !== currentValue;
|
|
109
|
+
});
|
|
110
|
+
var hasChanged = currentFieldChanged || dependenciesChanged;
|
|
111
|
+
// 当检测到变化时,触发字段校验以更新错误状态
|
|
112
|
+
if (hasChanged && contextProps !== null && contextProps !== void 0 && contextProps.form && name) {
|
|
113
|
+
setTimeout(() => {
|
|
114
|
+
contextProps.form.validateFields([name]).catch(() => {});
|
|
115
|
+
}, 0);
|
|
116
|
+
}
|
|
117
|
+
return hasChanged;
|
|
118
|
+
},
|
|
119
|
+
noStyle: true,
|
|
120
|
+
children: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
121
|
+
name: name,
|
|
122
|
+
className: formItemClassName,
|
|
123
|
+
style: formItemStyle,
|
|
124
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
125
|
+
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
|
126
|
+
valueType,
|
|
127
|
+
type,
|
|
128
|
+
isView
|
|
129
|
+
}),
|
|
130
|
+
children: renderComponent
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
// 没有依赖字段,直接渲染 Form.Item
|
|
136
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
137
|
+
name: name,
|
|
138
|
+
className: formItemClassName,
|
|
139
|
+
style: formItemStyle,
|
|
140
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
141
|
+
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
|
142
|
+
valueType,
|
|
143
|
+
type,
|
|
144
|
+
isView
|
|
145
|
+
}),
|
|
146
|
+
children: renderComponent
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// 非传统模式 compact 模式:直接渲染组件
|
|
84
152
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
85
|
-
value: (
|
|
153
|
+
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
|
86
154
|
valueType,
|
|
87
155
|
type,
|
|
88
156
|
isView
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { GroupType, FlexibleGroupColumnType } from '../propsType';
|
|
3
|
+
interface FlexibleGroupProps extends Omit<GroupType, 'children'> {
|
|
4
|
+
children: FlexibleGroupColumnType[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* FlexibleGroup主组件
|
|
8
|
+
*/
|
|
9
|
+
declare const FlexibleGroup: React.FC<FlexibleGroupProps>;
|
|
10
|
+
export default FlexibleGroup;
|