@zat-design/sisyphus-react 3.13.14-deta.2 → 4.0.0-beta.3
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 +34 -1
- package/dist/index.esm.css +557 -341
- package/dist/less.esm.css +527 -309
- package/es/FormsProvider/index.d.ts +4 -1
- package/es/FormsProvider/index.js +4 -2
- package/es/ProAction/components/CheckModalContent/index.js +9 -16
- package/es/ProAction/index.js +39 -40
- package/es/ProAction/index.less +2 -2
- package/es/ProConfigProvider/index.d.ts +21 -4
- package/es/ProConfigProvider/index.js +62 -28
- package/es/ProDownload/index.js +57 -65
- package/es/ProDownload/style/index.less +2 -2
- package/es/ProDownload/utils.js +17 -14
- package/es/ProDrawerForm/components/ProDrawer/index.js +40 -38
- package/es/ProDrawerForm/components/ProModal/index.js +25 -31
- package/es/ProDrawerForm/components/index.js +2 -2
- package/es/ProDrawerForm/index.d.ts +2 -1
- package/es/ProDrawerForm/index.js +16 -16
- package/es/ProDrawerForm/propsType.d.ts +7 -18
- package/es/ProDrawerForm/style/index.less +8 -14
- package/es/ProEditLabel/components/RenderProForm.js +26 -23
- package/es/ProEditLabel/index.js +32 -29
- package/es/ProEditLabel/propsType.d.ts +1 -6
- package/es/ProEditLabel/style/index.less +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +32 -27
- package/es/ProEditTable/components/RcTable/BaseTable.js +77 -58
- package/es/ProEditTable/components/RcTable/DraggableTable.js +78 -58
- package/es/ProEditTable/components/RcTable/index.d.ts +0 -2
- package/es/ProEditTable/components/RcTable/index.js +2 -4
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +32 -25
- package/es/ProEditTable/components/RenderField/index.d.ts +3 -2
- package/es/ProEditTable/components/RenderField/index.js +456 -301
- package/es/ProEditTable/components/RenderToolbar/index.js +17 -15
- package/es/ProEditTable/components/Summary/index.js +14 -15
- package/es/ProEditTable/components/Validator/index.js +8 -10
- package/es/ProEditTable/components/index.js +5 -5
- package/es/ProEditTable/index.d.ts +1 -1
- package/es/ProEditTable/index.js +163 -150
- package/es/ProEditTable/propsType.d.ts +1 -7
- package/es/ProEditTable/style/index.less +3 -7
- package/es/ProEditTable/utils/config.js +24 -21
- package/es/ProEditTable/utils/diffOriginal.js +8 -6
- package/es/ProEditTable/utils/getDefaultProps.js +8 -8
- package/es/ProEditTable/utils/index.js +76 -60
- package/es/ProEditTable/utils/tools.js +61 -55
- package/es/ProEditTable/utils/useEditTableError.js +25 -6
- package/es/ProEnum/components/Group.js +6 -6
- package/es/ProEnum/components/Tag.js +8 -6
- package/es/ProEnum/hooks/useEnum.js +26 -4
- package/es/ProEnum/hooks/useEnumRequest.js +23 -21
- package/es/ProEnum/index.js +52 -60
- package/es/ProEnum/style/index.less +2 -2
- package/es/ProEnum/utils/eventCenter.js +6 -4
- package/es/ProEnum/utils/getEnumLabel.js +9 -10
- package/es/ProEnum/utils/index.d.ts +1 -0
- package/es/ProEnum/utils/index.js +12 -6
- package/es/ProForm/components/Container.d.ts +1 -0
- package/es/ProForm/components/Container.js +8 -7
- package/es/ProForm/components/FormFooter/index.js +20 -18
- package/es/ProForm/components/FormFooter/propsType.d.ts +2 -0
- package/es/ProForm/components/base/Checkbox/index.js +12 -10
- package/es/ProForm/components/base/DatePicker/index.d.ts +1 -3
- package/es/ProForm/components/base/DatePicker/index.js +25 -23
- package/es/ProForm/components/base/DatePicker/useDateLimit.d.ts +1 -7
- package/es/ProForm/components/base/DatePicker/useDateLimit.js +1 -3
- package/es/ProForm/components/base/Input/index.js +21 -26
- package/es/ProForm/components/base/InputNumber/index.js +43 -42
- package/es/ProForm/components/base/Radio/index.js +10 -9
- package/es/ProForm/components/base/RangePicker/index.js +24 -25
- package/es/ProForm/components/base/RangePicker/useDateRange.d.ts +5 -5
- package/es/ProForm/components/base/Select/index.js +12 -11
- package/es/ProForm/components/base/Switch/index.js +13 -13
- package/es/ProForm/components/base/SwitchCheckbox/index.js +16 -16
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +2 -2
- package/es/ProForm/components/base/TextArea/index.js +15 -15
- package/es/ProForm/components/base/TextArea/index.less +12 -2
- package/es/ProForm/components/base/TimePicker/index.d.ts +1 -2
- package/es/ProForm/components/base/TimePicker/index.js +11 -11
- package/es/ProForm/components/base/TimePicker/style/index.less +5 -3
- package/es/ProForm/components/combination/Container/index.js +14 -12
- package/es/ProForm/components/combination/Container/style/index.less +2 -2
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +40 -35
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +15 -17
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +6 -6
- package/es/ProForm/components/combination/FormList/components/Empty.js +16 -14
- package/es/ProForm/components/combination/FormList/components/LineFields.js +13 -13
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +20 -22
- package/es/ProForm/components/combination/FormList/index.js +23 -23
- package/es/ProForm/components/combination/FormList/style/index.less +38 -2
- package/es/ProForm/components/combination/FormList/utils.js +5 -3
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +1 -0
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +7 -5
- package/es/ProForm/components/combination/Group/component/ComRender.js +19 -15
- package/es/ProForm/components/combination/Group/hooks/index.js +19 -16
- package/es/ProForm/components/combination/Group/index.d.ts +2 -8
- package/es/ProForm/components/combination/Group/index.js +27 -20
- package/es/ProForm/components/combination/Group/style/index.less +7 -87
- package/es/ProForm/components/combination/Group/utils.d.ts +1 -1
- package/es/ProForm/components/combination/Group/utils.js +24 -17
- package/es/ProForm/components/combination/ProCascader/index.js +51 -48
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/style/index.less +2 -2
- package/es/ProForm/components/combination/ProCascader/utils/index.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +15 -9
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +99 -100
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +13 -14
- package/es/ProForm/components/combination/ProNumberRange/index.d.ts +3 -2
- package/es/ProForm/components/combination/ProNumberRange/index.js +31 -27
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +5 -52
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -23
- package/es/ProForm/components/combination/ProRangeLimit/index.js +69 -49
- package/es/ProForm/components/combination/ProRangeLimit/propsType.d.ts +23 -0
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +3 -2
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +14 -2
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +5 -6
- package/es/ProForm/components/combination/ProTimeLimit/index.js +54 -45
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +66 -6
- package/es/ProForm/components/index.d.ts +2 -8
- package/es/ProForm/components/index.js +31 -36
- package/es/ProForm/components/render/ChangedWrapper.js +23 -18
- package/es/ProForm/components/render/ConfirmWrapper.js +15 -16
- package/es/ProForm/components/render/Render.js +95 -76
- package/es/ProForm/components/render/RenderFields.js +42 -27
- package/es/ProForm/components/render/propsType.d.ts +2 -6
- package/es/ProForm/components/render/propsType.js +25 -0
- package/es/ProForm/index.js +54 -67
- package/es/ProForm/propsType.d.ts +1 -1
- package/es/ProForm/propsType.js +5 -1
- package/es/ProForm/style/index.less +6 -16
- package/es/ProForm/utils/diffOriginal.js +9 -7
- package/es/ProForm/utils/getDefaultProps.js +7 -7
- package/es/ProForm/utils/index.d.ts +15 -1
- package/es/ProForm/utils/index.js +126 -52
- package/es/ProForm/utils/processDependencies.js +11 -0
- package/es/ProForm/utils/rulesCreator.js +12 -13
- package/es/ProForm/utils/transformNames.js +5 -4
- package/es/ProForm/utils/transformValue.js +11 -6
- package/es/ProForm/utils/useDeepCompareMemo.js +8 -6
- package/es/ProForm/utils/useForm.js +47 -37
- package/es/ProForm/utils/useRules.js +11 -9
- package/es/ProForm/utils/useShouldUpdate.js +39 -37
- package/es/ProForm/utils/useWatch.js +25 -3
- package/es/ProForm/utils/valueType.js +6 -3
- package/es/ProIcon/config/index.js +2 -0
- package/es/ProIcon/index.js +38 -31
- package/es/ProIcon/style/index.less +2 -2
- package/es/ProIcon/utils/index.js +4 -5
- package/es/ProLayout/components/Layout/Header/index.js +13 -11
- package/es/ProLayout/components/Layout/Icon/Icon.js +3 -3
- package/es/ProLayout/components/Layout/Icon/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +33 -27
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +42 -39
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +32 -28
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +12 -6
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +7 -6
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +9 -5
- package/es/ProLayout/components/Layout/Menu/index.js +12 -10
- package/es/ProLayout/components/Layout/Menu/style/index.less +2 -2
- package/es/ProLayout/components/Layout/Notice/index.js +9 -8
- package/es/ProLayout/components/Layout/Notice/style/index.less +2 -2
- package/es/ProLayout/components/Layout/index.js +4 -4
- package/es/ProLayout/components/ProCollapse/index.js +35 -47
- package/es/ProLayout/components/ProCollapse/style/index.less +3 -3
- package/es/ProLayout/components/ProFooter/index.js +5 -6
- package/es/ProLayout/components/ProFooter/style/index.less +2 -2
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +8 -9
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -6
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +9 -9
- package/es/ProLayout/components/ProHeader/components/index.js +2 -2
- package/es/ProLayout/components/ProHeader/index.js +117 -108
- package/es/ProLayout/components/ProHeader/style/index.less +2 -2
- package/es/ProLayout/components/index.js +3 -3
- package/es/ProLayout/index.d.ts +1 -1
- package/es/ProLayout/index.js +24 -19
- package/es/ProLayout/style/index.less +4 -3
- package/es/ProLayout/utils/index.js +21 -18
- package/es/ProSelect/components/AdaptiveTooltip.js +6 -6
- package/es/ProSelect/index.js +48 -57
- package/es/ProSelect/index.less +2 -2
- package/es/ProSelect/propsType.d.ts +1 -1
- package/es/ProSelect/utils/index.js +5 -4
- package/es/ProStep/components/Anchor/index.d.ts +1 -0
- package/es/ProStep/components/Anchor/index.js +20 -20
- package/es/ProStep/components/Item/index.d.ts +1 -0
- package/es/ProStep/components/Item/index.js +16 -11
- package/es/ProStep/components/Listener/index.js +5 -5
- package/es/ProStep/components/Step/index.js +16 -14
- package/es/ProStep/index.js +31 -27
- package/es/ProStep/style/index.less +4 -4
- package/es/ProStep/utils/index.js +6 -5
- package/es/ProStepTab/index.js +32 -9
- package/es/ProTable/components/FormatColumn/index.js +85 -81
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -1
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +4 -6
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +31 -25
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +10 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +6 -8
- package/es/ProTable/components/RcTable/index.js +2 -2
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.js +38 -37
- package/es/ProTable/components/RenderEmptyText/index.js +7 -6
- package/es/ProTable/components/RenderFooter/index.js +2 -2
- package/es/ProTable/components/RenderSummary/index.js +12 -12
- package/es/ProTable/components/RenderTableHeader/index.js +16 -15
- package/es/ProTable/components/RenderTabs/index.js +9 -11
- package/es/ProTable/components/TableResizable/index.js +10 -8
- package/es/ProTable/components/TooltipTitle/index.js +7 -7
- package/es/ProTable/components/index.js +11 -6
- package/es/ProTable/hooks/useAntdTable.d.ts +0 -3
- package/es/ProTable/hooks/useAntdTable.js +97 -122
- package/es/ProTable/index.d.ts +0 -3
- package/es/ProTable/index.js +57 -55
- package/es/ProTable/propsType.d.ts +2 -4
- package/es/ProTable/style/index.less +5 -5
- package/es/ProTable/utils/index.js +12 -5
- package/es/ProTabs/components/Card/index.js +13 -17
- package/es/ProTabs/components/index.js +1 -1
- package/es/ProTabs/index.js +10 -10
- package/es/ProTabs/style/index.less +2 -2
- package/es/ProThemeTools/component/ProTools/index.js +50 -53
- package/es/ProThemeTools/component/index.js +1 -1
- package/es/ProThemeTools/context/ThemeContext.d.ts +31 -0
- package/es/ProThemeTools/context/ThemeContext.js +136 -0
- package/es/ProThemeTools/index.d.ts +4 -1
- package/es/ProThemeTools/index.js +97 -48
- package/es/ProThemeTools/style/index.less +3 -3
- package/es/ProThemeTools/utils/index.d.ts +16 -6
- package/es/ProThemeTools/utils/index.js +37 -24
- package/es/ProTooltip/index.js +35 -28
- package/es/ProTooltip/style/index.less +2 -2
- package/es/ProTree/components/AdaptiveTooltip.js +4 -5
- package/es/ProTree/components/CloseIcon.js +5 -5
- package/es/ProTree/components/List.js +16 -15
- package/es/ProTree/components/ProTree.js +51 -52
- package/es/ProTree/components/ProTreeSelect/index.js +97 -81
- package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/es/ProTree/components/SearchTitle.js +10 -9
- package/es/ProTree/components/Tree.js +46 -52
- package/es/ProTree/components/index.js +4 -4
- package/es/ProTree/index.js +4 -11
- package/es/ProTree/propsType.d.ts +1 -1
- package/es/ProTree/style/index.less +10 -6
- package/es/ProTree/utils.js +21 -14
- package/es/ProTreeModal/components/Cascader.js +24 -23
- package/es/ProTreeModal/components/CloseIcon.js +5 -5
- package/es/ProTreeModal/components/List.js +43 -42
- package/es/ProTreeModal/components/SearchTitle.js +5 -4
- package/es/ProTreeModal/components/SortableItem.js +11 -10
- package/es/ProTreeModal/components/Tree.js +38 -37
- package/es/ProTreeModal/components/Trigger.js +24 -28
- package/es/ProTreeModal/components/index.js +6 -6
- package/es/ProTreeModal/index.d.ts +0 -1
- package/es/ProTreeModal/index.js +90 -80
- package/es/ProTreeModal/style/index.less +14 -3
- package/es/ProTreeModal/utils.js +22 -18
- package/es/ProUpload/components/ButtonRender.js +28 -30
- package/es/ProUpload/components/DragRender.js +43 -37
- package/es/ProUpload/components/DraggableUploadListItem.js +3 -2
- package/es/ProUpload/components/Example.js +10 -9
- package/es/ProUpload/components/FileItem.d.ts +0 -1
- package/es/ProUpload/components/FileItem.js +53 -54
- package/es/ProUpload/components/ImageRender.js +85 -94
- package/es/ProUpload/index.js +25 -21
- package/es/ProUpload/style/index.less +173 -12
- package/es/ProUpload/uitls.js +1 -1
- package/es/ProViewer/index.js +40 -41
- package/es/ProViewer/propsType.js +3 -1
- package/es/ProViewer/style/index.less +2 -2
- package/es/ProWaterMark/index.js +5 -5
- package/es/ProWaterMark/propsType.d.ts +5 -24
- package/es/global.less +2 -1
- package/es/index.d.ts +5 -3
- package/es/index.js +38 -30
- package/es/locale/en_US.js +1 -1
- package/es/locale/index.d.ts +2 -0
- package/es/locale/index.js +18 -4
- package/es/locale/zh_CN.js +1 -1
- package/es/style/components.less +0 -3
- package/es/style/theme/antd.less +38 -48
- package/es/style/theme/base.less +89 -0
- package/es/style/theme/index.less +2 -89
- package/es/tokens.js +1 -0
- package/es/utils/index.d.ts +7 -0
- package/es/utils/index.js +28 -2
- package/lib/FormsProvider/index.d.ts +4 -1
- package/lib/FormsProvider/index.js +53 -29
- package/lib/ProAction/components/CheckModalContent/index.js +27 -42
- package/lib/ProAction/index.js +155 -201
- package/lib/ProAction/index.less +2 -2
- package/lib/ProAction/propsType.js +16 -4
- package/lib/ProConfigProvider/index.d.ts +21 -4
- package/lib/ProConfigProvider/index.js +144 -97
- package/lib/ProDownload/index.js +123 -197
- package/lib/ProDownload/propsType.js +16 -4
- package/lib/ProDownload/style/index.less +2 -2
- package/lib/ProDownload/utils.js +145 -188
- package/lib/ProDrawerForm/components/ProDrawer/index.js +170 -242
- package/lib/ProDrawerForm/components/ProModal/index.js +134 -196
- package/lib/ProDrawerForm/components/index.js +39 -17
- package/lib/ProDrawerForm/index.d.ts +2 -1
- package/lib/ProDrawerForm/index.js +86 -72
- package/lib/ProDrawerForm/propsType.d.ts +7 -18
- package/lib/ProDrawerForm/propsType.js +16 -4
- package/lib/ProDrawerForm/style/index.less +8 -14
- package/lib/ProDrawerForm/utils/index.js +31 -13
- package/lib/ProEditLabel/components/RenderProForm.js +60 -59
- package/lib/ProEditLabel/index.js +183 -243
- package/lib/ProEditLabel/propsType.d.ts +1 -6
- package/lib/ProEditLabel/propsType.js +16 -4
- package/lib/ProEditLabel/style/index.less +4 -3
- package/lib/ProEditLabel/utils/index.js +31 -15
- package/lib/ProEditTable/components/ActionButton/index.js +172 -156
- package/lib/ProEditTable/components/RcTable/BaseTable.js +115 -98
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +174 -183
- package/lib/ProEditTable/components/RcTable/index.d.ts +0 -2
- package/lib/ProEditTable/components/RcTable/index.js +39 -24
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +184 -181
- package/lib/ProEditTable/components/RenderField/index.d.ts +3 -2
- package/lib/ProEditTable/components/RenderField/index.js +604 -562
- package/lib/ProEditTable/components/RenderToolbar/index.js +105 -125
- package/lib/ProEditTable/components/Summary/index.js +61 -70
- package/lib/ProEditTable/components/Validator/index.js +48 -31
- package/lib/ProEditTable/components/index.js +48 -38
- package/lib/ProEditTable/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +376 -437
- package/lib/ProEditTable/propsType.d.ts +1 -7
- package/lib/ProEditTable/propsType.js +16 -4
- package/lib/ProEditTable/style/index.less +3 -7
- package/lib/ProEditTable/utils/config.js +180 -239
- package/lib/ProEditTable/utils/diffOriginal.js +59 -50
- package/lib/ProEditTable/utils/getDefaultProps.js +44 -29
- package/lib/ProEditTable/utils/index.js +259 -326
- package/lib/ProEditTable/utils/tools.js +252 -442
- package/lib/ProEditTable/utils/transform.js +28 -19
- package/lib/ProEditTable/utils/useEditTableError.js +62 -56
- package/lib/ProEnum/components/Group.js +78 -54
- package/lib/ProEnum/components/Tag.js +55 -40
- package/lib/ProEnum/hooks/useEnum.js +53 -53
- package/lib/ProEnum/hooks/useEnumRequest.js +198 -271
- package/lib/ProEnum/index.js +235 -251
- package/lib/ProEnum/propsType.js +16 -4
- package/lib/ProEnum/style/index.less +2 -2
- package/lib/ProEnum/utils/eventCenter.js +25 -37
- package/lib/ProEnum/utils/getEnumLabel.js +65 -63
- package/lib/ProEnum/utils/index.d.ts +1 -0
- package/lib/ProEnum/utils/index.js +68 -91
- package/lib/ProForm/components/Container.d.ts +1 -0
- package/lib/ProForm/components/Container.js +45 -33
- package/lib/ProForm/components/FormFooter/index.js +80 -63
- package/lib/ProForm/components/FormFooter/propsType.d.ts +2 -0
- package/lib/ProForm/components/FormFooter/propsType.js +16 -4
- package/lib/ProForm/components/base/Checkbox/index.js +62 -66
- package/lib/ProForm/components/base/DatePicker/index.d.ts +1 -3
- package/lib/ProForm/components/base/DatePicker/index.js +82 -71
- package/lib/ProForm/components/base/DatePicker/useDateLimit.d.ts +1 -7
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +31 -18
- package/lib/ProForm/components/base/Input/index.js +74 -69
- package/lib/ProForm/components/base/Input/propsType.js +16 -4
- package/lib/ProForm/components/base/InputNumber/index.js +177 -228
- package/lib/ProForm/components/base/Radio/index.js +69 -60
- package/lib/ProForm/components/base/RangePicker/index.js +90 -77
- package/lib/ProForm/components/base/RangePicker/useDateRange.d.ts +5 -5
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +46 -28
- package/lib/ProForm/components/base/Select/index.js +69 -61
- package/lib/ProForm/components/base/Switch/index.js +59 -43
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +63 -63
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +2 -2
- package/lib/ProForm/components/base/TextArea/index.js +67 -53
- package/lib/ProForm/components/base/TextArea/index.less +12 -2
- package/lib/ProForm/components/base/TimePicker/index.d.ts +1 -2
- package/lib/ProForm/components/base/TimePicker/index.js +59 -44
- package/lib/ProForm/components/base/TimePicker/style/index.less +5 -3
- package/lib/ProForm/components/combination/Container/index.js +77 -62
- package/lib/ProForm/components/combination/Container/propsType.js +16 -4
- package/lib/ProForm/components/combination/Container/style/index.less +2 -2
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +195 -245
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +108 -84
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +44 -25
- package/lib/ProForm/components/combination/FormList/components/Empty.js +55 -93
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +120 -95
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +103 -140
- package/lib/ProForm/components/combination/FormList/index.js +168 -143
- package/lib/ProForm/components/combination/FormList/propsType.js +16 -4
- package/lib/ProForm/components/combination/FormList/style/index.less +38 -2
- package/lib/ProForm/components/combination/FormList/utils.js +54 -33
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +38 -21
- package/lib/ProForm/components/combination/Group/component/ComRender.js +74 -76
- package/lib/ProForm/components/combination/Group/hooks/index.js +136 -130
- package/lib/ProForm/components/combination/Group/index.d.ts +2 -8
- package/lib/ProForm/components/combination/Group/index.js +117 -102
- package/lib/ProForm/components/combination/Group/propsType.js +16 -4
- package/lib/ProForm/components/combination/Group/style/index.less +7 -87
- package/lib/ProForm/components/combination/Group/utils.d.ts +1 -1
- package/lib/ProForm/components/combination/Group/utils.js +113 -129
- package/lib/ProForm/components/combination/ProCascader/index.js +195 -250
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/propsType.js +16 -4
- package/lib/ProForm/components/combination/ProCascader/style/index.less +2 -2
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +35 -24
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +121 -116
- package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +498 -686
- package/lib/ProForm/components/combination/ProModalSelect/propsType.js +16 -4
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +13 -14
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +45 -22
- package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/index.js +166 -184
- package/lib/ProForm/components/combination/ProNumberRange/propsType.js +16 -4
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +5 -52
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -23
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +151 -159
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.d.ts +23 -0
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.js +17 -0
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +3 -2
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +58 -25
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +5 -6
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +131 -143
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +66 -6
- package/lib/ProForm/components/index.d.ts +2 -8
- package/lib/ProForm/components/index.js +115 -254
- package/lib/ProForm/components/render/ChangedWrapper.js +146 -133
- package/lib/ProForm/components/render/ConfirmWrapper.js +78 -123
- package/lib/ProForm/components/render/Render.js +348 -421
- package/lib/ProForm/components/render/RenderFields.js +186 -188
- package/lib/ProForm/components/render/propsType.d.ts +2 -6
- package/lib/ProForm/components/render/propsType.js +16 -5
- package/lib/ProForm/index.js +239 -300
- package/lib/ProForm/propsType.d.ts +1 -1
- package/lib/ProForm/propsType.js +38 -5
- package/lib/ProForm/style/index.less +6 -16
- package/lib/ProForm/utils/diffOriginal.js +56 -44
- package/lib/ProForm/utils/getDefaultProps.js +44 -28
- package/lib/ProForm/utils/index.d.ts +15 -1
- package/lib/ProForm/utils/index.js +287 -290
- package/lib/ProForm/utils/processDependencies.js +44 -52
- package/lib/ProForm/utils/rulesCreator.js +84 -61
- package/lib/ProForm/utils/transformNames.js +38 -27
- package/lib/ProForm/utils/transformValue.js +51 -48
- package/lib/ProForm/utils/useDeepCompareMemo.js +36 -16
- package/lib/ProForm/utils/useFieldProps.js +42 -11
- package/lib/ProForm/utils/useForm.js +122 -222
- package/lib/ProForm/utils/useRules.js +67 -60
- package/lib/ProForm/utils/useShouldUpdate.js +105 -177
- package/lib/ProForm/utils/useWatch.js +93 -100
- package/lib/ProForm/utils/valueType.js +157 -224
- package/lib/ProIcon/config/index.js +365 -276
- package/lib/ProIcon/index.js +193 -221
- package/lib/ProIcon/propsTypes.js +16 -4
- package/lib/ProIcon/style/index.less +2 -2
- package/lib/ProIcon/symbolIcon.js +23 -30
- package/lib/ProIcon/utils/index.js +66 -57
- package/lib/ProLayout/components/Layout/Header/index.js +59 -42
- package/lib/ProLayout/components/Layout/Icon/Icon.js +49 -30
- package/lib/ProLayout/components/Layout/Icon/index.js +34 -7
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +112 -118
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +42 -39
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +118 -124
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +16 -4
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +12 -6
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +59 -42
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +9 -5
- package/lib/ProLayout/components/Layout/Menu/index.js +76 -56
- package/lib/ProLayout/components/Layout/Menu/style/index.less +2 -2
- package/lib/ProLayout/components/Layout/Notice/index.js +39 -31
- package/lib/ProLayout/components/Layout/Notice/style/index.less +2 -2
- package/lib/ProLayout/components/Layout/index.js +45 -31
- package/lib/ProLayout/components/ProCollapse/PropTypes.js +16 -4
- package/lib/ProLayout/components/ProCollapse/index.js +132 -151
- package/lib/ProLayout/components/ProCollapse/style/index.less +3 -3
- package/lib/ProLayout/components/ProFooter/PropTypes.js +16 -4
- package/lib/ProLayout/components/ProFooter/index.js +58 -45
- package/lib/ProLayout/components/ProFooter/style/index.less +2 -2
- package/lib/ProLayout/components/ProHeader/PropTypes.js +16 -4
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +53 -26
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +48 -28
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +16 -4
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +9 -9
- package/lib/ProLayout/components/ProHeader/components/index.js +39 -17
- package/lib/ProLayout/components/ProHeader/index.js +281 -462
- package/lib/ProLayout/components/ProHeader/style/index.less +2 -2
- package/lib/ProLayout/components/ProHeader/utils/index.js +32 -14
- package/lib/ProLayout/components/index.js +42 -24
- package/lib/ProLayout/index.d.ts +1 -1
- package/lib/ProLayout/index.js +127 -123
- package/lib/ProLayout/propTypes.js +16 -4
- package/lib/ProLayout/style/index.less +4 -3
- package/lib/ProLayout/utils/index.js +92 -103
- package/lib/ProSelect/components/AdaptiveTooltip.js +46 -41
- package/lib/ProSelect/index.js +218 -260
- package/lib/ProSelect/index.less +2 -2
- package/lib/ProSelect/propsType.d.ts +1 -1
- package/lib/ProSelect/propsType.js +16 -4
- package/lib/ProSelect/utils/index.js +80 -78
- package/lib/ProStep/components/Anchor/index.d.ts +1 -0
- package/lib/ProStep/components/Anchor/index.js +108 -102
- package/lib/ProStep/components/Item/index.d.ts +1 -0
- package/lib/ProStep/components/Item/index.js +83 -74
- package/lib/ProStep/components/Listener/index.js +62 -73
- package/lib/ProStep/components/Step/index.js +76 -66
- package/lib/ProStep/index.js +167 -233
- package/lib/ProStep/propsType.js +16 -4
- package/lib/ProStep/style/index.less +4 -4
- package/lib/ProStep/utils/index.js +59 -52
- package/lib/ProStepTab/index.js +179 -298
- package/lib/ProStepTab/propsType.js +16 -4
- package/lib/ProTable/components/FormatColumn/index.js +446 -494
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -1
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +53 -42
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +139 -198
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +116 -95
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +16 -4
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +80 -61
- package/lib/ProTable/components/RcTable/index.js +39 -17
- package/lib/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/lib/ProTable/components/RenderColumn/index.js +194 -203
- package/lib/ProTable/components/RenderEmptyText/index.js +27 -25
- package/lib/ProTable/components/RenderFooter/index.js +33 -17
- package/lib/ProTable/components/RenderSummary/index.js +46 -57
- package/lib/ProTable/components/RenderTableHeader/index.js +68 -61
- package/lib/ProTable/components/RenderTabs/index.js +89 -81
- package/lib/ProTable/components/TableResizable/index.js +88 -86
- package/lib/ProTable/components/TooltipTitle/index.js +40 -27
- package/lib/ProTable/components/index.js +51 -45
- package/lib/ProTable/hooks/useAntdTable.d.ts +0 -3
- package/lib/ProTable/hooks/useAntdTable.js +315 -409
- package/lib/ProTable/index.d.ts +0 -3
- package/lib/ProTable/index.js +351 -390
- package/lib/ProTable/propsType.d.ts +2 -4
- package/lib/ProTable/propsType.js +16 -4
- package/lib/ProTable/style/index.less +5 -5
- package/lib/ProTable/utils/index.js +84 -84
- package/lib/ProTabs/components/Card/index.js +30 -56
- package/lib/ProTabs/components/index.js +36 -10
- package/lib/ProTabs/index.js +92 -86
- package/lib/ProTabs/propType.js +16 -4
- package/lib/ProTabs/style/index.less +2 -2
- package/lib/ProThemeTools/component/ProTools/index.js +202 -246
- package/lib/ProThemeTools/component/index.js +36 -10
- package/lib/ProThemeTools/context/ThemeContext.d.ts +31 -0
- package/lib/ProThemeTools/context/ThemeContext.js +135 -0
- package/lib/ProThemeTools/index.d.ts +4 -1
- package/lib/ProThemeTools/index.js +200 -173
- package/lib/ProThemeTools/propsType.js +16 -4
- package/lib/ProThemeTools/style/index.less +3 -3
- package/lib/ProThemeTools/utils/index.d.ts +16 -6
- package/lib/ProThemeTools/utils/index.js +94 -84
- package/lib/ProTooltip/index.js +220 -219
- package/lib/ProTooltip/propsType.js +16 -4
- package/lib/ProTooltip/style/index.less +2 -2
- package/lib/ProTree/components/AdaptiveTooltip.js +33 -24
- package/lib/ProTree/components/CloseIcon.js +36 -31
- package/lib/ProTree/components/List.js +68 -73
- package/lib/ProTree/components/ProTree.js +262 -369
- package/lib/ProTree/components/ProTreeSelect/index.js +369 -475
- package/lib/ProTree/components/ProTreeSelect/propsType.js +16 -4
- package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/lib/ProTree/components/SearchTitle.js +47 -50
- package/lib/ProTree/components/Tree.js +232 -311
- package/lib/ProTree/components/index.js +45 -31
- package/lib/ProTree/index.js +45 -30
- package/lib/ProTree/propsType.d.ts +1 -1
- package/lib/ProTree/propsType.js +16 -4
- package/lib/ProTree/style/index.less +10 -6
- package/lib/ProTree/utils.js +83 -135
- package/lib/ProTreeModal/components/Cascader.js +97 -94
- package/lib/ProTreeModal/components/CloseIcon.js +36 -31
- package/lib/ProTreeModal/components/List.js +194 -269
- package/lib/ProTreeModal/components/SearchTitle.js +30 -22
- package/lib/ProTreeModal/components/SortableItem.js +60 -60
- package/lib/ProTreeModal/components/Tree.js +162 -181
- package/lib/ProTreeModal/components/Trigger.js +108 -131
- package/lib/ProTreeModal/components/index.js +51 -45
- package/lib/ProTreeModal/index.d.ts +0 -1
- package/lib/ProTreeModal/index.js +464 -584
- package/lib/ProTreeModal/propsType.js +16 -4
- package/lib/ProTreeModal/style/index.less +14 -3
- package/lib/ProTreeModal/utils.js +105 -158
- package/lib/ProUpload/components/ButtonRender.js +86 -111
- package/lib/ProUpload/components/DragRender.js +120 -168
- package/lib/ProUpload/components/DraggableUploadListItem.js +50 -32
- package/lib/ProUpload/components/Example.js +56 -38
- package/lib/ProUpload/components/FileItem.d.ts +0 -1
- package/lib/ProUpload/components/FileItem.js +115 -210
- package/lib/ProUpload/components/ImageRender.js +176 -255
- package/lib/ProUpload/index.js +204 -216
- package/lib/ProUpload/propsType.js +16 -4
- package/lib/ProUpload/style/index.less +173 -12
- package/lib/ProUpload/uitls.js +34 -10
- package/lib/ProUtils/utils/index.js +38 -26
- package/lib/ProViewer/index.js +175 -209
- package/lib/ProViewer/propsType.js +16 -4
- package/lib/ProViewer/style/index.less +2 -2
- package/lib/ProWaterMark/index.js +38 -19
- package/lib/ProWaterMark/propsType.d.ts +5 -24
- package/lib/ProWaterMark/propsType.js +16 -4
- package/lib/global.less +2 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.js +123 -252
- package/lib/locale/en_US.js +146 -128
- package/lib/locale/index.d.ts +2 -0
- package/lib/locale/index.js +59 -29
- package/lib/locale/zh_CN.js +146 -128
- package/lib/style/components.less +0 -3
- package/lib/style/theme/antd.less +38 -48
- package/lib/style/theme/base.less +89 -0
- package/lib/style/theme/index.less +2 -89
- package/lib/tokens.js +103 -86
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.js +100 -48
- package/package.json +37 -23
- package/es/ProEditTable/components/RcTable/VirtualTable.d.ts +0 -3
- package/es/ProEditTable/components/RcTable/VirtualTable.js +0 -8
- package/es/ProForm/components/combination/ProCombination/index.d.ts +0 -6
- package/es/ProForm/components/combination/ProCombination/index.js +0 -204
- package/es/ProForm/components/combination/ProCombination/propsType.d.ts +0 -68
- package/es/ProForm/components/combination/ProCombination/style/index.less +0 -18
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.d.ts +0 -33
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.js +0 -108
- package/es/ProForm/components/old/EnumSelect/index.d.ts +0 -4
- package/es/ProForm/components/old/EnumSelect/index.js +0 -272
- package/es/ProForm/components/old/EnumSelect/interface.d.ts +0 -29
- package/es/ProForm/components/old/EnumSelect/interface.js +0 -1
- package/es/ProForm/components/old/EnumSelect/style/index.less +0 -113
- package/es/ProForm/components/old/InputRange/index.d.ts +0 -16
- package/es/ProForm/components/old/InputRange/index.js +0 -100
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +0 -3
- package/es/ProForm/components/old/InputWithSuffix/index.js +0 -46
- package/es/ProForm/components/old/InputWithSuffix/propsTypes.d.ts +0 -11
- package/es/ProForm/components/old/InputWithSuffix/propsTypes.js +0 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +0 -27
- package/es/ProForm/components/old/ProAddress/index.js +0 -298
- package/es/ProForm/components/old/ProAddress/propsTypes.d.ts +0 -16
- package/es/ProForm/components/old/ProAddress/propsTypes.js +0 -1
- package/es/ProForm/components/old/ProCertNo/index.d.ts +0 -14
- package/es/ProForm/components/old/ProCertNo/index.js +0 -66
- package/es/ProForm/components/old/ProCertNo/propsType.d.ts +0 -18
- package/es/ProForm/components/old/ProCertNo/propsType.js +0 -1
- package/es/ProForm/components/old/ProCertValidity/index.d.ts +0 -9
- package/es/ProForm/components/old/ProCertValidity/index.js +0 -188
- package/es/ProForm/components/old/ProCertValidity/propsType.d.ts +0 -19
- package/es/ProForm/components/old/ProCertValidity/propsType.js +0 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +0 -2
- package/es/ProForm/components/old/ProRangeBox/index.js +0 -97
- package/es/ProForm/components/old/ProRangeBox/propsType.d.ts +0 -3
- package/es/ProForm/components/old/ProRangeBox/propsType.js +0 -1
- package/es/ProForm/utils/_useChanged.d.ts +0 -8
- package/es/ProForm/utils/_useChanged.js +0 -25
- package/es/ProForm/utils/_useListChanged.d.ts +0 -16
- package/es/ProForm/utils/_useListChanged.js +0 -93
- package/es/ProUpload/style/fileItem.less +0 -159
- package/es/old/ProCertValidity/index.d.ts +0 -9
- package/es/old/ProCertValidity/index.js +0 -188
- package/es/old/ProCertValidity/propsType.d.ts +0 -19
- package/es/old/ProCertValidity/propsType.js +0 -1
- package/es/old/ProEditableTable/index.d.ts +0 -4
- package/es/old/ProEditableTable/index.js +0 -594
- package/es/old/ProEditableTable/propsType.d.ts +0 -68
- package/es/old/ProEditableTable/propsType.js +0 -1
- package/es/old/ProEditableTable/style/index.less +0 -75
- package/es/old/ProEditableTable/utils.d.ts +0 -29
- package/es/old/ProEditableTable/utils.js +0 -323
- package/lib/ProEditTable/components/RcTable/VirtualTable.d.ts +0 -3
- package/lib/ProEditTable/components/RcTable/VirtualTable.js +0 -14
- package/lib/ProForm/components/combination/ProCombination/index.d.ts +0 -6
- package/lib/ProForm/components/combination/ProCombination/index.js +0 -213
- package/lib/ProForm/components/combination/ProCombination/propsType.d.ts +0 -68
- package/lib/ProForm/components/combination/ProCombination/propsType.js +0 -5
- package/lib/ProForm/components/combination/ProCombination/style/index.less +0 -18
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.d.ts +0 -33
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.js +0 -115
- package/lib/ProForm/components/old/EnumSelect/index.d.ts +0 -4
- package/lib/ProForm/components/old/EnumSelect/index.js +0 -279
- package/lib/ProForm/components/old/EnumSelect/interface.d.ts +0 -29
- package/lib/ProForm/components/old/EnumSelect/interface.js +0 -5
- package/lib/ProForm/components/old/EnumSelect/style/index.less +0 -113
- package/lib/ProForm/components/old/InputRange/index.d.ts +0 -16
- package/lib/ProForm/components/old/InputRange/index.js +0 -108
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +0 -3
- package/lib/ProForm/components/old/InputWithSuffix/index.js +0 -53
- package/lib/ProForm/components/old/InputWithSuffix/propsTypes.d.ts +0 -11
- package/lib/ProForm/components/old/InputWithSuffix/propsTypes.js +0 -5
- package/lib/ProForm/components/old/ProAddress/index.d.ts +0 -27
- package/lib/ProForm/components/old/ProAddress/index.js +0 -306
- package/lib/ProForm/components/old/ProAddress/propsTypes.d.ts +0 -16
- package/lib/ProForm/components/old/ProAddress/propsTypes.js +0 -5
- package/lib/ProForm/components/old/ProCertNo/index.d.ts +0 -14
- package/lib/ProForm/components/old/ProCertNo/index.js +0 -73
- package/lib/ProForm/components/old/ProCertNo/propsType.d.ts +0 -18
- package/lib/ProForm/components/old/ProCertNo/propsType.js +0 -5
- package/lib/ProForm/components/old/ProCertValidity/index.d.ts +0 -9
- package/lib/ProForm/components/old/ProCertValidity/index.js +0 -193
- package/lib/ProForm/components/old/ProCertValidity/propsType.d.ts +0 -19
- package/lib/ProForm/components/old/ProCertValidity/propsType.js +0 -5
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +0 -2
- package/lib/ProForm/components/old/ProRangeBox/index.js +0 -105
- package/lib/ProForm/components/old/ProRangeBox/propsType.d.ts +0 -3
- package/lib/ProForm/components/old/ProRangeBox/propsType.js +0 -5
- package/lib/ProForm/utils/_useChanged.d.ts +0 -8
- package/lib/ProForm/utils/_useChanged.js +0 -32
- package/lib/ProForm/utils/_useListChanged.d.ts +0 -16
- package/lib/ProForm/utils/_useListChanged.js +0 -100
- package/lib/ProUpload/style/fileItem.less +0 -159
- package/lib/old/ProCertValidity/index.d.ts +0 -9
- package/lib/old/ProCertValidity/index.js +0 -193
- package/lib/old/ProCertValidity/propsType.d.ts +0 -19
- package/lib/old/ProCertValidity/propsType.js +0 -5
- package/lib/old/ProEditableTable/index.d.ts +0 -4
- package/lib/old/ProEditableTable/index.js +0 -601
- package/lib/old/ProEditableTable/propsType.d.ts +0 -68
- package/lib/old/ProEditableTable/propsType.js +0 -5
- package/lib/old/ProEditableTable/style/index.less +0 -75
- package/lib/old/ProEditableTable/utils.d.ts +0 -29
- package/lib/old/ProEditableTable/utils.js +0 -330
- /package/es/ProForm/components/combination/{ProCombination → ProRangeLimit}/propsType.js +0 -0
@@ -1,37 +1,34 @@
|
|
1
|
-
import "antd/es/form/style";
|
2
|
-
import _Form from "antd/es/form";
|
3
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
4
2
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
5
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
6
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
7
5
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
8
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
9
|
-
import _isFunction from "lodash/isFunction";
|
10
|
-
import _omit from "lodash/omit";
|
11
|
-
import _debounce from "lodash/debounce";
|
12
|
-
import _isEqual from "lodash/isEqual";
|
13
|
-
import _cloneDeep from "lodash/cloneDeep";
|
14
7
|
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "onDiff", "className", "trim", "confirm", "dependencies", "desensitization"];
|
15
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
16
8
|
/* eslint-disable prefer-destructuring */
|
17
9
|
/* eslint-disable prefer-const */
|
18
|
-
import React, { useEffect } from 'react';
|
10
|
+
import React, { useEffect, useCallback, useMemo, memo, useRef } from 'react';
|
11
|
+
import { Form } from 'antd';
|
19
12
|
import classNames from 'classnames';
|
20
|
-
import
|
21
|
-
import
|
22
|
-
import
|
23
|
-
import
|
24
|
-
import {
|
25
|
-
import
|
26
|
-
import
|
27
|
-
import
|
28
|
-
import
|
29
|
-
import {
|
30
|
-
import
|
31
|
-
import {
|
32
|
-
import
|
13
|
+
import { cloneDeep, isEqual, debounce, omit, isFunction, isEqualWith } from 'lodash';
|
14
|
+
import { compatStartTransition, customEqualForFunction } from "../../../utils";
|
15
|
+
import valueTypeMap from "../../../ProForm/utils/valueType";
|
16
|
+
import transformMap from "../../utils/transform";
|
17
|
+
import { getNamePath, difference, getDisabled } from "../../utils/tools";
|
18
|
+
import * as componentMap from "../../../ProForm/components";
|
19
|
+
import { useProConfig } from "../../../ProConfigProvider";
|
20
|
+
import Container from "../../../ProForm/components/Container";
|
21
|
+
import transformNames from "../../../ProForm/utils/transformNames";
|
22
|
+
import { FieldProvider } from "../../../ProForm/utils/useFieldProps";
|
23
|
+
import useRules from "../../../ProForm/utils/useRules";
|
24
|
+
import { isSelect, isTrim } from "../../../ProForm/utils";
|
25
|
+
import ConfirmWrapper from "../../../ProForm/components/render/ConfirmWrapper";
|
26
|
+
import { getDefaultProps } from "../../utils/getDefaultProps";
|
27
|
+
import ListChangedWrapper from "./ListChangedWrapper";
|
28
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
29
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
33
30
|
var RenderField = function RenderField(_ref) {
|
34
|
-
var _type, _type$replace, _fieldProps2, _names,
|
31
|
+
var _type, _type$replace, _fieldProps2, _fieldProps4, _names, _TargetComponent5, _componentProps2;
|
35
32
|
var value = _ref.text,
|
36
33
|
record = _ref.record,
|
37
34
|
index = _ref.index,
|
@@ -90,43 +87,54 @@ var RenderField = function RenderField(_ref) {
|
|
90
87
|
var _desensitization = desensitization || [];
|
91
88
|
var isCell = mode === 'cell';
|
92
89
|
if (isCell) {
|
93
|
-
record['is-view'] = !
|
90
|
+
record['is-view'] = !isEqual(cellNamePath, cellName);
|
94
91
|
}
|
92
|
+
|
95
93
|
// type类型 首字母转大写
|
96
|
-
type = ((_type = type) === null || _type === void 0
|
94
|
+
type = ((_type = type) === null || _type === void 0 || (_type$replace = _type.replace) === null || _type$replace === void 0 ? void 0 : _type$replace.call(_type, type[0], type[0].toUpperCase())) || 'Input';
|
95
|
+
|
97
96
|
// 自定义组件时 防止默认值影像后续判断
|
98
97
|
if ('component' in column) {
|
99
98
|
type = null;
|
100
99
|
}
|
100
|
+
|
101
101
|
// 单行正在编辑时,临时生成一套formItem用来存储中间值,点击取消时候重置回上一次状态
|
102
102
|
var namePath = getNamePath(name, virtualKey);
|
103
103
|
var rowData = form.getFieldValue([].concat(_toConsumableArray(namePath), [index])) || record || {};
|
104
104
|
var currentValue = dataIndex ? rowData === null || rowData === void 0 ? void 0 : rowData[dataIndex] : null;
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
105
|
+
|
106
|
+
// 第三个参数 - 使用useMemo优化
|
107
|
+
var options = useMemo(function () {
|
108
|
+
return {
|
109
|
+
index: index,
|
110
|
+
form: form,
|
111
|
+
name: column === null || column === void 0 ? void 0 : column.name,
|
112
|
+
namePath: [].concat(_toConsumableArray(namePath), [index])
|
113
|
+
};
|
114
|
+
}, [index, column === null || column === void 0 ? void 0 : column.name, namePath]);
|
115
|
+
|
116
|
+
// 行参数 - 使用useMemo优化
|
117
|
+
var rowParams = useMemo(function () {
|
118
|
+
return [currentValue, rowData, options];
|
119
|
+
}, [currentValue, rowData, options]);
|
120
|
+
|
114
121
|
// required & rules & fieldProps & disabled & valueType 函数化处理
|
115
|
-
if (
|
116
|
-
_required = required.apply(void 0, rowParams);
|
122
|
+
if (isFunction(required)) {
|
123
|
+
_required = required.apply(void 0, _toConsumableArray(rowParams));
|
117
124
|
}
|
118
|
-
if (
|
119
|
-
_fieldProps = fieldProps.apply(void 0, rowParams);
|
125
|
+
if (isFunction(fieldProps)) {
|
126
|
+
_fieldProps = fieldProps.apply(void 0, _toConsumableArray(rowParams));
|
120
127
|
}
|
121
|
-
if (
|
122
|
-
_rules = rules.apply(void 0, rowParams);
|
128
|
+
if (isFunction(rules)) {
|
129
|
+
_rules = rules.apply(void 0, _toConsumableArray(rowParams));
|
123
130
|
}
|
124
|
-
if (
|
125
|
-
_valueType = valueType.apply(void 0, rowParams);
|
131
|
+
if (isFunction(valueType)) {
|
132
|
+
_valueType = valueType.apply(void 0, _toConsumableArray(rowParams));
|
126
133
|
}
|
127
|
-
if (
|
128
|
-
_desensitization = desensitization.apply(void 0, rowParams);
|
134
|
+
if (isFunction(desensitization)) {
|
135
|
+
_desensitization = desensitization.apply(void 0, _toConsumableArray(rowParams));
|
129
136
|
}
|
137
|
+
|
130
138
|
// 获取最终的disabled
|
131
139
|
_disabled = getDisabled({
|
132
140
|
globalControl: otherProps === null || otherProps === void 0 ? void 0 : otherProps.globalControl,
|
@@ -136,12 +144,10 @@ var RenderField = function RenderField(_ref) {
|
|
136
144
|
columnFieldProps: _fieldProps,
|
137
145
|
params: rowParams
|
138
146
|
});
|
139
|
-
if (
|
140
|
-
isEditable = isEditable.apply(void 0, rowParams);
|
141
|
-
// setTimeout(() => {
|
142
|
-
// !isEditable && form.validateFields([cellName]);
|
143
|
-
// }, 100);
|
147
|
+
if (isFunction(isEditable)) {
|
148
|
+
isEditable = isEditable.apply(void 0, _toConsumableArray(rowParams));
|
144
149
|
}
|
150
|
+
|
145
151
|
// 是否只读文本
|
146
152
|
var isView = !isEditable || (record === null || record === void 0 ? void 0 : record['is-view']) || config.isView || virtualKey && !_isEditing || getDisabled({
|
147
153
|
globalControl: otherProps === null || otherProps === void 0 ? void 0 : otherProps.globalControl,
|
@@ -152,10 +158,15 @@ var RenderField = function RenderField(_ref) {
|
|
152
158
|
params: rowParams,
|
153
159
|
rowDisabled: rowDisabled || 'empty'
|
154
160
|
});
|
161
|
+
|
155
162
|
// 只读文本时,采用当前formItem的name,单行编辑时,使用生成的虚拟的name
|
156
163
|
var baseName = isView ? name : namePath;
|
157
164
|
var TargetComponent;
|
158
|
-
|
165
|
+
|
166
|
+
// 将Hooks调用移到组件顶层
|
167
|
+
var proConfig = useProConfig();
|
168
|
+
|
169
|
+
// 设置校验规则 - 修复Hooks使用规则
|
159
170
|
var internalRule = useRules({
|
160
171
|
names: names,
|
161
172
|
label: label,
|
@@ -168,39 +179,49 @@ var RenderField = function RenderField(_ref) {
|
|
168
179
|
}),
|
169
180
|
type: type
|
170
181
|
});
|
182
|
+
|
171
183
|
// 分离form item参数,防止对于参数透传(如onChange,防止重复触发)并优先级高于 _fieldProps 内部参数
|
172
184
|
var formItemChildProps = _objectSpread({}, _fieldProps);
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
});
|
185
|
+
|
186
|
+
// 使用useMemo优化defaultProps计算
|
187
|
+
var defaultProps = useMemo(function () {
|
188
|
+
return getDefaultProps({
|
189
|
+
name: name,
|
190
|
+
namePath: formNamePath ? cellName.slice((formNamePath === null || formNamePath === void 0 ? void 0 : formNamePath.length) - 1) : cellName,
|
191
|
+
type: column === null || column === void 0 ? void 0 : column.type,
|
192
|
+
fieldProps: column === null || column === void 0 ? void 0 : column.fieldProps
|
193
|
+
});
|
194
|
+
}, [name, formNamePath, cellName, column === null || column === void 0 ? void 0 : column.type, column === null || column === void 0 ? void 0 : column.fieldProps]);
|
195
|
+
|
196
|
+
// 允许formItem的属性放在column最外层 - 使用useMemo优化
|
197
|
+
var _formItemProps = useMemo(function () {
|
198
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, defaultProps), resetProps), internalRule), {}, {
|
199
|
+
validateTrigger: validateTrigger
|
200
|
+
});
|
201
|
+
}, [defaultProps, resetProps, internalRule, validateTrigger]);
|
183
202
|
if (['Switch', 'SwitchCheckbox'].includes(type)) {
|
184
203
|
_formItemProps.valuePropName = 'checked';
|
185
204
|
_valueType = 'switch';
|
186
205
|
}
|
206
|
+
|
187
207
|
/**
|
188
208
|
* 针对一些特殊类型,基于formItem的normalize与getValueProps进行默认值类型转换
|
189
209
|
* @returns {}
|
190
210
|
*/
|
191
|
-
var defaultTransform = function
|
211
|
+
var defaultTransform = useCallback(function () {
|
192
212
|
var types = ['DatePicker', 'RangePicker'];
|
193
213
|
if (!_valueType && types.includes(type)) {
|
194
214
|
var _transformMap$type;
|
195
|
-
return transformMap === null || transformMap === void 0
|
215
|
+
return transformMap === null || transformMap === void 0 || (_transformMap$type = transformMap[type]) === null || _transformMap$type === void 0 ? void 0 : _transformMap$type.call(transformMap, _fieldProps || {});
|
196
216
|
}
|
197
217
|
return {};
|
198
|
-
};
|
218
|
+
}, [_valueType, type, _fieldProps]);
|
219
|
+
|
199
220
|
/**
|
200
221
|
* 配置valueType时,基于formItem的normalize与getValueProps进行值类型转换
|
201
222
|
* @returns {}
|
202
223
|
*/
|
203
|
-
var valueTypeTransform = function
|
224
|
+
var valueTypeTransform = useCallback(function () {
|
204
225
|
var _fieldProps3;
|
205
226
|
// SwitchCheckbox默认YN, 兼容已有组件
|
206
227
|
if (type === 'SwitchCheckbox') {
|
@@ -209,9 +230,9 @@ var RenderField = function RenderField(_ref) {
|
|
209
230
|
var params = _objectSpread(_objectSpread({}, column), {}, {
|
210
231
|
mode: (_fieldProps3 = _fieldProps) === null || _fieldProps3 === void 0 ? void 0 : _fieldProps3.mode
|
211
232
|
});
|
212
|
-
return
|
213
|
-
};
|
214
|
-
if ((_names = names)
|
233
|
+
return isFunction(valueTypeMap[_valueType]) ? valueTypeMap[_valueType](params) : {};
|
234
|
+
}, [type, _valueType, column, (_fieldProps4 = _fieldProps) === null || _fieldProps4 === void 0 ? void 0 : _fieldProps4.mode]);
|
235
|
+
if ((_names = names) !== null && _names !== void 0 && _names.length) {
|
215
236
|
// 支持names配置,临时生成对应的formItem,用来存储单个对应的值
|
216
237
|
names = names.map(function (key) {
|
217
238
|
if (Array.isArray(key)) {
|
@@ -224,56 +245,60 @@ var RenderField = function RenderField(_ref) {
|
|
224
245
|
var originalNames = names;
|
225
246
|
if (virtualKey) {
|
226
247
|
var _cellName$slice, _names2, _names2$map;
|
227
|
-
originalName = [].concat(_toConsumableArray(name), _toConsumableArray(cellName === null || cellName === void 0
|
228
|
-
originalNames = (_names2 = names) === null || _names2 === void 0
|
248
|
+
originalName = [].concat(_toConsumableArray(name), _toConsumableArray(cellName === null || cellName === void 0 || (_cellName$slice = cellName.slice) === null || _cellName$slice === void 0 ? void 0 : _cellName$slice.call(cellName, name.length)));
|
249
|
+
originalNames = (_names2 = names) === null || _names2 === void 0 || (_names2$map = _names2.map) === null || _names2$map === void 0 ? void 0 : _names2$map.call(_names2, function (item) {
|
229
250
|
var _item$slice;
|
230
|
-
return [].concat(_toConsumableArray(name), _toConsumableArray(item === null || item === void 0
|
251
|
+
return [].concat(_toConsumableArray(name), _toConsumableArray(item === null || item === void 0 || (_item$slice = item.slice) === null || _item$slice === void 0 ? void 0 : _item$slice.call(item, name.length)));
|
231
252
|
});
|
232
253
|
}
|
254
|
+
|
233
255
|
/**
|
234
256
|
* 配置names时,基于formItem的normalize与getValueProps进行值类型转换
|
235
257
|
* @returns {}
|
236
258
|
*/
|
237
|
-
var namesTransform = function
|
259
|
+
var namesTransform = useCallback(function () {
|
238
260
|
var _names3;
|
239
|
-
if (!((_names3 = names)
|
261
|
+
if (!((_names3 = names) !== null && _names3 !== void 0 && _names3.length)) {
|
240
262
|
return valueTypeTransform();
|
241
263
|
}
|
242
264
|
var namesStr = [].concat(_toConsumableArray(baseName), [index, dataIndex]);
|
243
265
|
return transformNames(_objectSpread(_objectSpread({}, _formItemProps), valueTypeTransform()), form, names, namesStr, type);
|
244
|
-
};
|
266
|
+
}, [names, baseName, index, dataIndex, _formItemProps, type]);
|
245
267
|
if (!_editRender && typeof type === 'string') {
|
246
268
|
var _componentMap$type;
|
247
|
-
TargetComponent = (_componentMap$type = componentMap[type]) !== null && _componentMap$type !== void 0 ? _componentMap$type : _jsx(_Fragment, {});
|
269
|
+
TargetComponent = (_componentMap$type = componentMap[type]) !== null && _componentMap$type !== void 0 ? _componentMap$type : /*#__PURE__*/_jsx(_Fragment, {});
|
248
270
|
}
|
249
271
|
if (isEditable && _isEditing) {
|
250
272
|
if (typeof _editRender === 'function') {
|
251
|
-
TargetComponent = _editRender.apply(void 0, rowParams);
|
273
|
+
TargetComponent = _editRender.apply(void 0, _toConsumableArray(rowParams));
|
252
274
|
}
|
253
|
-
if (/*#__PURE__*/React.isValidElement(_editRender)) {
|
275
|
+
if ( /*#__PURE__*/React.isValidElement(_editRender)) {
|
254
276
|
TargetComponent = _editRender;
|
255
277
|
}
|
256
278
|
}
|
279
|
+
|
257
280
|
// 查看模式
|
258
281
|
if (isView) {
|
259
282
|
// 存在viewRender覆盖默认值
|
260
283
|
if (typeof viewRender === 'function') {
|
261
284
|
var _column$dataIndex;
|
262
|
-
currentValue =
|
285
|
+
currentValue = column !== null && column !== void 0 && (_column$dataIndex = column.dataIndex) !== null && _column$dataIndex !== void 0 && _column$dataIndex.includes('-') ? value : currentValue;
|
263
286
|
var View = viewRender(currentValue, record || {}, options);
|
264
|
-
TargetComponent = _jsx(Container, {
|
287
|
+
TargetComponent = /*#__PURE__*/_jsx(Container, {
|
265
288
|
viewEmpty: viewEmpty,
|
266
289
|
children: View
|
267
290
|
});
|
268
291
|
}
|
269
|
-
if (/*#__PURE__*/React.isValidElement(viewRender)) {
|
292
|
+
if ( /*#__PURE__*/React.isValidElement(viewRender)) {
|
270
293
|
TargetComponent = viewRender;
|
271
294
|
}
|
272
295
|
}
|
273
296
|
var onChange = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onChange;
|
274
297
|
var onFieldChange = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onFieldChange;
|
275
298
|
var onBlur = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onBlur;
|
276
|
-
|
299
|
+
|
300
|
+
// 使用useCallback优化formatArgs函数
|
301
|
+
var formatArgs = useCallback(function () {
|
277
302
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
278
303
|
args[_key] = arguments[_key];
|
279
304
|
}
|
@@ -301,239 +326,278 @@ var RenderField = function RenderField(_ref) {
|
|
301
326
|
break;
|
302
327
|
}
|
303
328
|
return nextArgs;
|
304
|
-
};
|
305
|
-
|
329
|
+
}, [options, type]);
|
330
|
+
|
331
|
+
// 使用useCallback优化debounceValidate函数
|
332
|
+
var debounceValidate = useCallback(function () {
|
306
333
|
var validateFieldKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
307
334
|
setTimeout(function () {
|
308
|
-
form.validateFields(validateFieldKeys
|
335
|
+
form.validateFields(validateFieldKeys, {
|
336
|
+
recursive: true
|
337
|
+
});
|
309
338
|
}, 100);
|
310
|
-
};
|
311
|
-
|
312
|
-
|
313
|
-
|
339
|
+
}, [form]);
|
340
|
+
|
341
|
+
// 使用 useRef 保存防抖函数
|
342
|
+
var debounceRef = useRef(null);
|
343
|
+
|
344
|
+
// 使用 useCallback 创建稳定的 onChange 函数
|
345
|
+
var _onChange = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
346
|
+
var _args3 = arguments;
|
347
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
348
|
+
while (1) switch (_context2.prev = _context2.next) {
|
349
|
+
case 0:
|
350
|
+
// 如果防抖函数不存在,创建一个新的防抖函数
|
351
|
+
if (!debounceRef.current) {
|
352
|
+
debounceRef.current = debounce( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
353
|
+
var _len2,
|
354
|
+
innerArgs,
|
355
|
+
_key2,
|
356
|
+
_args,
|
357
|
+
rowPath,
|
358
|
+
_dependencies$map,
|
359
|
+
validateFieldKeys,
|
360
|
+
row,
|
361
|
+
orgRow,
|
362
|
+
_TargetComponent,
|
363
|
+
_TargetComponent$prop,
|
364
|
+
_TargetComponent2,
|
365
|
+
_TargetComponent$prop2,
|
366
|
+
_Object$keys,
|
367
|
+
_Object$keys$map,
|
368
|
+
diff,
|
369
|
+
_validateFieldKeys,
|
370
|
+
_args2 = arguments;
|
371
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
372
|
+
while (1) switch (_context.prev = _context.next) {
|
373
|
+
case 0:
|
374
|
+
for (_len2 = _args2.length, innerArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
375
|
+
innerArgs[_key2] = _args2[_key2];
|
376
|
+
}
|
377
|
+
_args = [].concat(innerArgs);
|
378
|
+
rowPath = [].concat(_toConsumableArray(namePath), [index]);
|
379
|
+
if (!(!onFieldChange && !onChange)) {
|
380
|
+
_context.next = 6;
|
381
|
+
break;
|
382
|
+
}
|
383
|
+
if (dependencies !== null && dependencies !== void 0 && dependencies.length) {
|
384
|
+
validateFieldKeys = dependencies === null || dependencies === void 0 || (_dependencies$map = dependencies.map) === null || _dependencies$map === void 0 ? void 0 : _dependencies$map.call(dependencies, function (key) {
|
385
|
+
return [].concat(_toConsumableArray(rowPath), [key]);
|
386
|
+
});
|
387
|
+
setTimeout(function () {
|
388
|
+
form.validateFields(validateFieldKeys);
|
389
|
+
}, 100);
|
390
|
+
}
|
391
|
+
return _context.abrupt("return", null);
|
392
|
+
case 6:
|
393
|
+
row = form.getFieldValue(rowPath, true);
|
394
|
+
orgRow = cloneDeep(row);
|
395
|
+
if (!onFieldChange) {
|
396
|
+
_context.next = 21;
|
397
|
+
break;
|
398
|
+
}
|
399
|
+
_args = formatArgs(innerArgs);
|
400
|
+
_args[1] = row;
|
401
|
+
_context.t0 = (_TargetComponent = TargetComponent) === null || _TargetComponent === void 0 || (_TargetComponent = _TargetComponent.props) === null || _TargetComponent === void 0 ? void 0 : _TargetComponent.onFieldChange;
|
402
|
+
if (!_context.t0) {
|
403
|
+
_context.next = 15;
|
404
|
+
break;
|
405
|
+
}
|
406
|
+
_context.next = 15;
|
407
|
+
return (_TargetComponent$prop = TargetComponent.props).onFieldChange.apply(_TargetComponent$prop, _toConsumableArray(_args));
|
408
|
+
case 15:
|
409
|
+
_context.t1 = onFieldChange;
|
410
|
+
if (!_context.t1) {
|
411
|
+
_context.next = 19;
|
412
|
+
break;
|
413
|
+
}
|
414
|
+
_context.next = 19;
|
415
|
+
return onFieldChange.apply(void 0, _toConsumableArray(_args));
|
416
|
+
case 19:
|
417
|
+
_context.next = 30;
|
418
|
+
break;
|
419
|
+
case 21:
|
420
|
+
_args = _args.concat([row, index, form]);
|
421
|
+
_context.t2 = (_TargetComponent2 = TargetComponent) === null || _TargetComponent2 === void 0 || (_TargetComponent2 = _TargetComponent2.props) === null || _TargetComponent2 === void 0 ? void 0 : _TargetComponent2.onChange;
|
422
|
+
if (!_context.t2) {
|
423
|
+
_context.next = 26;
|
424
|
+
break;
|
425
|
+
}
|
426
|
+
_context.next = 26;
|
427
|
+
return (_TargetComponent$prop2 = TargetComponent.props).onChange.apply(_TargetComponent$prop2, _toConsumableArray(_args));
|
428
|
+
case 26:
|
429
|
+
_context.t3 = onChange;
|
430
|
+
if (!_context.t3) {
|
431
|
+
_context.next = 30;
|
432
|
+
break;
|
433
|
+
}
|
434
|
+
_context.next = 30;
|
435
|
+
return onChange.apply(void 0, _toConsumableArray(_args));
|
436
|
+
case 30:
|
437
|
+
// 判断属性是否变动
|
438
|
+
form.setFieldValue(rowPath, row);
|
439
|
+
if (validateTrigger && validateTrigger.includes('onChange')) {
|
440
|
+
if (!isEqual(orgRow, row)) {
|
441
|
+
diff = difference(row, orgRow) || {};
|
442
|
+
_validateFieldKeys = (_Object$keys = Object.keys(diff)) === null || _Object$keys === void 0 || (_Object$keys$map = _Object$keys.map) === null || _Object$keys$map === void 0 ? void 0 : _Object$keys$map.call(_Object$keys, function (key) {
|
443
|
+
return [].concat(_toConsumableArray(rowPath), [key]);
|
444
|
+
}).concat(dependencies || []);
|
445
|
+
if (_validateFieldKeys !== null && _validateFieldKeys !== void 0 && _validateFieldKeys.length) {
|
446
|
+
debounceValidate(_validateFieldKeys);
|
447
|
+
}
|
448
|
+
}
|
449
|
+
}
|
450
|
+
// 使用startTransition优化状态更新
|
451
|
+
compatStartTransition(function () {
|
452
|
+
setState({
|
453
|
+
forceUpdate: {
|
454
|
+
d: Date.now()
|
455
|
+
}
|
456
|
+
});
|
457
|
+
});
|
458
|
+
case 33:
|
459
|
+
case "end":
|
460
|
+
return _context.stop();
|
461
|
+
}
|
462
|
+
}, _callee);
|
463
|
+
})), 300);
|
464
|
+
}
|
465
|
+
|
466
|
+
// 调用防抖函数
|
467
|
+
debounceRef.current.apply(debounceRef, _args3);
|
468
|
+
case 2:
|
469
|
+
case "end":
|
470
|
+
return _context2.stop();
|
471
|
+
}
|
472
|
+
}, _callee2);
|
473
|
+
})), [namePath, index, dependencies, formatArgs, onChange, onFieldChange, form, setState, TargetComponent, validateTrigger]);
|
474
|
+
|
475
|
+
// 在组件卸载时清理防抖函数
|
476
|
+
useEffect(function () {
|
477
|
+
return function () {
|
478
|
+
if (debounceRef.current) {
|
479
|
+
debounceRef.current.cancel();
|
480
|
+
}
|
481
|
+
};
|
482
|
+
}, []);
|
483
|
+
|
484
|
+
// 使用useCallback优化_onblur函数
|
485
|
+
var _onblur = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
486
|
+
var _TargetComponent3, _TargetComponent$prop3;
|
487
|
+
var _len3,
|
314
488
|
args,
|
315
|
-
|
489
|
+
_key3,
|
316
490
|
_args,
|
317
491
|
rowPath,
|
318
|
-
_dependencies$map,
|
319
|
-
validateFieldKeys,
|
320
492
|
row,
|
321
493
|
orgRow,
|
322
|
-
|
323
|
-
|
324
|
-
_TargetComponent$prop2,
|
325
|
-
_TargetComponent2,
|
326
|
-
_TargetComponent2$pro,
|
327
|
-
_TargetComponent$prop3,
|
328
|
-
_Object$keys,
|
329
|
-
_Object$keys$map,
|
494
|
+
_Object$keys2,
|
495
|
+
_Object$keys2$map,
|
330
496
|
diff,
|
331
|
-
|
332
|
-
|
333
|
-
return _regeneratorRuntime().wrap(function
|
334
|
-
while (1) switch (
|
497
|
+
validateFieldKeys,
|
498
|
+
_args4 = arguments;
|
499
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
500
|
+
while (1) switch (_context3.prev = _context3.next) {
|
335
501
|
case 0:
|
336
|
-
|
337
|
-
|
338
|
-
}
|
339
|
-
_args = [].concat(args);
|
340
|
-
rowPath = [].concat(_toConsumableArray(namePath), [index]);
|
341
|
-
if (!(!onFieldChange && !onChange)) {
|
342
|
-
_context.next = 6;
|
502
|
+
if (onBlur) {
|
503
|
+
_context3.next = 2;
|
343
504
|
break;
|
344
505
|
}
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
setTimeout(function () {
|
350
|
-
form.validateFields(validateFieldKeys);
|
351
|
-
}, 100);
|
506
|
+
return _context3.abrupt("return", null);
|
507
|
+
case 2:
|
508
|
+
for (_len3 = _args4.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
509
|
+
args[_key3] = _args4[_key3];
|
352
510
|
}
|
353
|
-
|
354
|
-
|
511
|
+
_args = formatArgs([].concat(args));
|
512
|
+
rowPath = [].concat(_toConsumableArray(namePath), [index]);
|
355
513
|
row = form.getFieldValue(rowPath, true);
|
356
|
-
orgRow =
|
357
|
-
if (!onFieldChange) {
|
358
|
-
_context.next = 21;
|
359
|
-
break;
|
360
|
-
}
|
361
|
-
_args = formatArgs(args);
|
514
|
+
orgRow = cloneDeep(row);
|
362
515
|
_args[1] = row;
|
363
|
-
|
364
|
-
if (!
|
365
|
-
|
516
|
+
_context3.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 || (_TargetComponent3 = _TargetComponent3.props) === null || _TargetComponent3 === void 0 ? void 0 : _TargetComponent3.onBlur;
|
517
|
+
if (!_context3.t0) {
|
518
|
+
_context3.next = 12;
|
366
519
|
break;
|
367
520
|
}
|
368
|
-
|
369
|
-
return (_TargetComponent$
|
370
|
-
case
|
371
|
-
|
372
|
-
if (!
|
373
|
-
|
521
|
+
_context3.next = 12;
|
522
|
+
return (_TargetComponent$prop3 = TargetComponent.props).onBlur.apply(_TargetComponent$prop3, _toConsumableArray(_args));
|
523
|
+
case 12:
|
524
|
+
_context3.t1 = onBlur;
|
525
|
+
if (!_context3.t1) {
|
526
|
+
_context3.next = 16;
|
374
527
|
break;
|
375
528
|
}
|
376
|
-
|
377
|
-
return
|
378
|
-
case
|
379
|
-
_context.next = 30;
|
380
|
-
break;
|
381
|
-
case 21:
|
382
|
-
_args = _args.concat([row, index, form]);
|
383
|
-
_context.t2 = (_TargetComponent2 = TargetComponent) === null || _TargetComponent2 === void 0 ? void 0 : (_TargetComponent2$pro = _TargetComponent2.props) === null || _TargetComponent2$pro === void 0 ? void 0 : _TargetComponent2$pro.onChange;
|
384
|
-
if (!_context.t2) {
|
385
|
-
_context.next = 26;
|
386
|
-
break;
|
387
|
-
}
|
388
|
-
_context.next = 26;
|
389
|
-
return (_TargetComponent$prop3 = TargetComponent.props).onChange.apply(_TargetComponent$prop3, _toConsumableArray(_args));
|
390
|
-
case 26:
|
391
|
-
_context.t3 = onChange;
|
392
|
-
if (!_context.t3) {
|
393
|
-
_context.next = 30;
|
394
|
-
break;
|
395
|
-
}
|
396
|
-
_context.next = 30;
|
397
|
-
return onChange.apply(void 0, _toConsumableArray(_args));
|
398
|
-
case 30:
|
529
|
+
_context3.next = 16;
|
530
|
+
return onBlur.apply(void 0, _toConsumableArray(_args));
|
531
|
+
case 16:
|
399
532
|
// 判断属性是否变动
|
400
533
|
form.setFieldValue(rowPath, row);
|
401
|
-
if (validateTrigger && validateTrigger.includes('
|
402
|
-
if (!
|
534
|
+
if (validateTrigger && validateTrigger.includes('onBlur')) {
|
535
|
+
if (!isEqual(orgRow, row)) {
|
403
536
|
diff = difference(row, orgRow) || {};
|
404
|
-
|
537
|
+
validateFieldKeys = (_Object$keys2 = Object.keys(diff)) === null || _Object$keys2 === void 0 || (_Object$keys2$map = _Object$keys2.map) === null || _Object$keys2$map === void 0 ? void 0 : _Object$keys2$map.call(_Object$keys2, function (key) {
|
405
538
|
return [].concat(_toConsumableArray(rowPath), [key]);
|
406
539
|
}).concat(dependencies || []);
|
407
|
-
if (
|
408
|
-
|
409
|
-
form.validateFields(_validateFieldKeys);
|
410
|
-
}, 100);
|
540
|
+
if (validateFieldKeys !== null && validateFieldKeys !== void 0 && validateFieldKeys.length) {
|
541
|
+
debounceValidate(validateFieldKeys);
|
411
542
|
}
|
412
543
|
}
|
413
544
|
}
|
545
|
+
if (!isCell) {
|
546
|
+
_context3.next = 22;
|
547
|
+
break;
|
548
|
+
}
|
549
|
+
_context3.next = 21;
|
550
|
+
return form.validateFields([cellName]);
|
551
|
+
case 21:
|
414
552
|
setState({
|
415
|
-
|
416
|
-
d: Date.now()
|
417
|
-
}
|
553
|
+
cellNamePath: []
|
418
554
|
});
|
419
|
-
case
|
420
|
-
|
421
|
-
|
422
|
-
}
|
423
|
-
}, _callee);
|
424
|
-
})), 300);
|
425
|
-
var _onblur = /*#__PURE__*/function () {
|
426
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
427
|
-
var _TargetComponent3, _TargetComponent3$pro, _TargetComponent$prop4;
|
428
|
-
var _len3,
|
429
|
-
args,
|
430
|
-
_key3,
|
431
|
-
_args,
|
432
|
-
rowPath,
|
433
|
-
row,
|
434
|
-
orgRow,
|
435
|
-
_Object$keys2,
|
436
|
-
_Object$keys2$map,
|
437
|
-
diff,
|
438
|
-
validateFieldKeys,
|
439
|
-
_args3 = arguments;
|
440
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
441
|
-
while (1) switch (_context2.prev = _context2.next) {
|
442
|
-
case 0:
|
443
|
-
if (onBlur) {
|
444
|
-
_context2.next = 2;
|
445
|
-
break;
|
446
|
-
}
|
447
|
-
return _context2.abrupt("return", null);
|
448
|
-
case 2:
|
449
|
-
for (_len3 = _args3.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
450
|
-
args[_key3] = _args3[_key3];
|
451
|
-
}
|
452
|
-
_args = formatArgs([].concat(args));
|
453
|
-
rowPath = [].concat(_toConsumableArray(namePath), [index]);
|
454
|
-
row = form.getFieldValue(rowPath, true);
|
455
|
-
orgRow = _cloneDeep(row);
|
456
|
-
_args[1] = row;
|
457
|
-
_context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
|
458
|
-
if (!_context2.t0) {
|
459
|
-
_context2.next = 12;
|
460
|
-
break;
|
461
|
-
}
|
462
|
-
_context2.next = 12;
|
463
|
-
return (_TargetComponent$prop4 = TargetComponent.props).onBlur.apply(_TargetComponent$prop4, _toConsumableArray(_args));
|
464
|
-
case 12:
|
465
|
-
_context2.t1 = onBlur;
|
466
|
-
if (!_context2.t1) {
|
467
|
-
_context2.next = 16;
|
468
|
-
break;
|
469
|
-
}
|
470
|
-
_context2.next = 16;
|
471
|
-
return onBlur.apply(void 0, _toConsumableArray(_args));
|
472
|
-
case 16:
|
473
|
-
// 判断属性是否变动
|
474
|
-
form.setFieldValue(rowPath, row);
|
475
|
-
if (validateTrigger && validateTrigger.includes('onBlur')) {
|
476
|
-
if (!_isEqual(orgRow, row)) {
|
477
|
-
diff = difference(row, orgRow) || {};
|
478
|
-
validateFieldKeys = (_Object$keys2 = Object.keys(diff)) === null || _Object$keys2 === void 0 ? void 0 : (_Object$keys2$map = _Object$keys2.map) === null || _Object$keys2$map === void 0 ? void 0 : _Object$keys2$map.call(_Object$keys2, function (key) {
|
479
|
-
return [].concat(_toConsumableArray(rowPath), [key]);
|
480
|
-
}).concat(dependencies || []);
|
481
|
-
if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
|
482
|
-
debounceValidate(validateFieldKeys);
|
483
|
-
}
|
484
|
-
}
|
485
|
-
}
|
486
|
-
if (!isCell) {
|
487
|
-
_context2.next = 22;
|
488
|
-
break;
|
489
|
-
}
|
490
|
-
_context2.next = 21;
|
491
|
-
return form.validateFields([cellName]);
|
492
|
-
case 21:
|
493
|
-
setState({
|
494
|
-
cellNamePath: []
|
495
|
-
});
|
496
|
-
case 22:
|
497
|
-
// 单行编辑时需要 强制更新视图
|
555
|
+
case 22:
|
556
|
+
// 单行编辑时需要 强制更新视图
|
557
|
+
compatStartTransition(function () {
|
498
558
|
setState({
|
499
559
|
forceUpdate: {
|
500
560
|
d: Date.now()
|
501
561
|
}
|
502
562
|
});
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
}
|
508
|
-
})
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
name: cellName
|
516
|
-
}, _fieldProps), (_TargetComponent4 = TargetComponent) === null || _TargetComponent4 === void 0 ? void 0 : _TargetComponent4.props), {}, {
|
517
|
-
namePath: [].concat(_toConsumableArray(namePath), [index]),
|
518
|
-
disabled: _disabled,
|
519
|
-
onChange: _onChange,
|
520
|
-
onBlur: _onblur,
|
521
|
-
index: index,
|
522
|
-
confirm: confirm,
|
523
|
-
desensitization: _desensitization,
|
524
|
-
otherProps: {
|
563
|
+
});
|
564
|
+
case 23:
|
565
|
+
case "end":
|
566
|
+
return _context3.stop();
|
567
|
+
}
|
568
|
+
}, _callee3);
|
569
|
+
})), [onBlur, formatArgs, namePath, index, form, TargetComponent, validateTrigger, debounceValidate, isCell, cellName, setState]);
|
570
|
+
|
571
|
+
// 使用useMemo优化componentProps对象
|
572
|
+
var componentProps = useMemo(function () {
|
573
|
+
var _TargetComponent4;
|
574
|
+
return _objectSpread(_objectSpread(_objectSpread({
|
525
575
|
form: form,
|
526
|
-
|
576
|
+
name: cellName
|
577
|
+
}, _fieldProps), (_TargetComponent4 = TargetComponent) === null || _TargetComponent4 === void 0 ? void 0 : _TargetComponent4.props), {}, {
|
527
578
|
namePath: [].concat(_toConsumableArray(namePath), [index]),
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
579
|
+
disabled: _disabled,
|
580
|
+
onChange: _onChange,
|
581
|
+
onBlur: _onblur,
|
582
|
+
index: index,
|
583
|
+
confirm: confirm,
|
584
|
+
desensitization: _desensitization,
|
585
|
+
otherProps: {
|
586
|
+
form: form,
|
587
|
+
names: names,
|
588
|
+
namePath: [].concat(_toConsumableArray(namePath), [index]),
|
589
|
+
name: originalName,
|
590
|
+
listName: cellName,
|
591
|
+
// 用于下拉框去重消费,保持和formlist一致
|
592
|
+
viewEmpty: viewEmpty,
|
593
|
+
valueType: _valueType,
|
594
|
+
isView: isView,
|
595
|
+
desensitizationKey: otherProps === null || otherProps === void 0 ? void 0 : otherProps.desensitizationKey
|
596
|
+
}
|
597
|
+
});
|
598
|
+
}, [cellName, _fieldProps, (_TargetComponent5 = TargetComponent) === null || _TargetComponent5 === void 0 ? void 0 : _TargetComponent5.props, namePath, index, _disabled, _onChange, _onblur, confirm, _desensitization, names, originalName, viewEmpty, _valueType, isView, otherProps === null || otherProps === void 0 ? void 0 : otherProps.desensitizationKey]);
|
599
|
+
componentProps = omit(componentProps, ['onFieldChange', 'namePath', 'index']);
|
600
|
+
|
537
601
|
// 单元格编辑时,设置各个单元格disabled属性
|
538
602
|
if (isCell) {
|
539
603
|
record["".concat(dataIndex, "-Disabled")] = _disabled;
|
@@ -545,25 +609,35 @@ var RenderField = function RenderField(_ref) {
|
|
545
609
|
if (isCell) {
|
546
610
|
var _editingDom$focus;
|
547
611
|
var editingDom = document.getElementById(cellNamePath.join('_'));
|
548
|
-
editingDom === null || editingDom === void 0
|
612
|
+
editingDom === null || editingDom === void 0 || (_editingDom$focus = editingDom.focus) === null || _editingDom$focus === void 0 || _editingDom$focus.call(editingDom);
|
549
613
|
}
|
550
|
-
}, [cellNamePath]);
|
614
|
+
}, [cellNamePath, isCell]);
|
615
|
+
|
551
616
|
// 可编辑表格默认关闭scrollFollowParent
|
552
617
|
if (['Select', 'ProSelect', 'ProEnum'].includes(type)) {
|
553
618
|
componentProps.scrollFollowParent = false;
|
554
619
|
}
|
555
|
-
|
620
|
+
|
621
|
+
// 使用useMemo优化最终的formItemProps - 修复Hooks使用规则
|
622
|
+
var finalFormItemProps = useMemo(function () {
|
623
|
+
return Object.assign(_formItemProps, _objectSpread(_objectSpread(_objectSpread({}, defaultTransform()), namesTransform()), isTrim(type, trim, proConfig)));
|
624
|
+
}, [_formItemProps, defaultTransform, namesTransform, type, trim, proConfig]);
|
625
|
+
|
556
626
|
// 编辑&保存模式,在查看状态下移除表单的rules不做校验
|
557
627
|
if (isView) {
|
558
|
-
delete
|
628
|
+
delete finalFormItemProps.rules;
|
559
629
|
}
|
560
|
-
var _className =
|
561
|
-
|
630
|
+
var _className = useMemo(function () {
|
631
|
+
return classNames(_defineProperty({}, className, className));
|
632
|
+
}, [className]);
|
633
|
+
|
634
|
+
// 使用useCallback优化getFieldItem函数
|
635
|
+
var getFieldItem = useCallback(function () {
|
562
636
|
var _componentProps;
|
563
637
|
var FormItem = null;
|
564
|
-
var FieldComponent = /*#__PURE__*/React.isValidElement(TargetComponent) ? (/*#__PURE__*/React.cloneElement(TargetComponent, componentProps)) : _jsx(TargetComponent, _objectSpread({}, componentProps));
|
638
|
+
var FieldComponent = /*#__PURE__*/React.isValidElement(TargetComponent) ? ( /*#__PURE__*/React.cloneElement(TargetComponent, componentProps)) : /*#__PURE__*/_jsx(TargetComponent, _objectSpread({}, componentProps));
|
565
639
|
if (originalValues && !getIsNew(record)) {
|
566
|
-
FieldComponent = _jsx(ListChangedWrapper, {
|
640
|
+
FieldComponent = /*#__PURE__*/_jsx(ListChangedWrapper, {
|
567
641
|
name: cellName,
|
568
642
|
names: names,
|
569
643
|
namesStr: [].concat(_toConsumableArray(baseName), [index, dataIndex]),
|
@@ -576,35 +650,36 @@ var RenderField = function RenderField(_ref) {
|
|
576
650
|
type: type,
|
577
651
|
onChange: _onChange,
|
578
652
|
onBlur: _onblur,
|
579
|
-
valuePropName:
|
580
|
-
normalize:
|
581
|
-
getValueProps:
|
653
|
+
valuePropName: finalFormItemProps.valuePropName,
|
654
|
+
normalize: finalFormItemProps.normalize,
|
655
|
+
getValueProps: finalFormItemProps.getValueProps,
|
582
656
|
viewRender: viewRender,
|
583
657
|
diffConfig: diffConfig,
|
584
658
|
index: index,
|
585
659
|
children: FieldComponent
|
586
660
|
});
|
587
661
|
}
|
588
|
-
if ((_componentProps = componentProps)
|
589
|
-
FieldComponent = _jsx(ConfirmWrapper, _objectSpread(_objectSpread({}, componentProps), {}, {
|
662
|
+
if ((_componentProps = componentProps) !== null && _componentProps !== void 0 && _componentProps.confirm) {
|
663
|
+
FieldComponent = /*#__PURE__*/_jsx(ConfirmWrapper, _objectSpread(_objectSpread({}, componentProps), {}, {
|
590
664
|
children: FieldComponent
|
591
665
|
}));
|
592
666
|
}
|
593
|
-
FormItem = TargetComponent ? _jsx(
|
667
|
+
FormItem = TargetComponent ? /*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({
|
594
668
|
validateFirst: true
|
595
|
-
},
|
669
|
+
}, omit(finalFormItemProps, ['render', 'key', 'width', 'hiddenNames', 'name', 'onCell', _fieldProps.shouldUpdate ? 'shouldUpdate' : null])), {}, {
|
670
|
+
// 移除非必要字段
|
596
671
|
className: _className,
|
597
672
|
name: formNamePath ? cellName.slice((formNamePath === null || formNamePath === void 0 ? void 0 : formNamePath.length) - 1) : cellName,
|
598
673
|
children: FieldComponent
|
599
|
-
})) : _jsx(Container, {
|
674
|
+
})) : /*#__PURE__*/_jsx(Container, {
|
600
675
|
viewEmpty: viewEmpty
|
601
676
|
});
|
602
677
|
if (type === 'FormList') {
|
603
|
-
FormItem = _jsx(
|
678
|
+
FormItem = /*#__PURE__*/_jsx(Form.List, _objectSpread(_objectSpread({
|
604
679
|
name: formNamePath ? cellName.slice((formNamePath === null || formNamePath === void 0 ? void 0 : formNamePath.length) - 1) : cellName
|
605
|
-
},
|
680
|
+
}, omit(finalFormItemProps, ['render', 'key', 'width', 'hiddenNames', 'name'])), {}, {
|
606
681
|
children: function children(fields, operation, meta) {
|
607
|
-
return _jsx(TargetComponent, _objectSpread(_objectSpread({}, componentProps), {}, {
|
682
|
+
return /*#__PURE__*/_jsx(TargetComponent, _objectSpread(_objectSpread({}, componentProps), {}, {
|
608
683
|
otherProps: otherProps,
|
609
684
|
fields: fields,
|
610
685
|
operation: operation,
|
@@ -614,16 +689,96 @@ var RenderField = function RenderField(_ref) {
|
|
614
689
|
}));
|
615
690
|
}
|
616
691
|
return FormItem;
|
617
|
-
};
|
618
|
-
return _jsx(FieldProvider, {
|
692
|
+
}, [TargetComponent, componentProps, originalValues, record, cellName, names, baseName, index, dataIndex, originalName, originalNames, type, finalFormItemProps, viewRender, diffConfig, _className, formNamePath, viewEmpty, otherProps, getIsNew]);
|
693
|
+
return /*#__PURE__*/_jsx(FieldProvider, {
|
619
694
|
value: (_componentProps2 = componentProps) === null || _componentProps2 === void 0 ? void 0 : _componentProps2.otherProps,
|
620
|
-
children:
|
695
|
+
children: finalFormItemProps.shouldUpdate ? /*#__PURE__*/_jsx(Form.Item, {
|
621
696
|
noStyle: true,
|
622
|
-
shouldUpdate:
|
697
|
+
shouldUpdate: finalFormItemProps.shouldUpdate,
|
623
698
|
children: function children() {
|
624
699
|
return getFieldItem();
|
625
700
|
}
|
626
701
|
}) : getFieldItem()
|
627
702
|
});
|
628
703
|
};
|
629
|
-
export default RenderField
|
704
|
+
export default /*#__PURE__*/memo(RenderField, function (prevProps, nextProps) {
|
705
|
+
// 自定义比较函数,只有关键props变化时才重新渲染
|
706
|
+
var prevText = prevProps.text,
|
707
|
+
prevRecord = prevProps.record,
|
708
|
+
prevIndex = prevProps.index,
|
709
|
+
prevColumn = prevProps.column,
|
710
|
+
prevConfig = prevProps.config;
|
711
|
+
var nextText = nextProps.text,
|
712
|
+
nextRecord = nextProps.record,
|
713
|
+
nextIndex = nextProps.index,
|
714
|
+
nextColumn = nextProps.column,
|
715
|
+
nextConfig = nextProps.config;
|
716
|
+
var prevRowParams = [prevText, prevRecord, {
|
717
|
+
index: prevIndex,
|
718
|
+
form: prevConfig === null || prevConfig === void 0 ? void 0 : prevConfig.form,
|
719
|
+
name: prevConfig === null || prevConfig === void 0 ? void 0 : prevConfig.name
|
720
|
+
}];
|
721
|
+
var nextRowParams = [nextText, nextRecord, {
|
722
|
+
index: nextIndex,
|
723
|
+
form: nextConfig === null || nextConfig === void 0 ? void 0 : nextConfig.form,
|
724
|
+
name: nextConfig === null || nextConfig === void 0 ? void 0 : nextConfig.name
|
725
|
+
}];
|
726
|
+
if (isFunction(prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.disabled) && isFunction(nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.disabled)) {
|
727
|
+
if ((prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.disabled.apply(prevColumn, prevRowParams)) !== (nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.disabled.apply(nextColumn, nextRowParams))) {
|
728
|
+
return false;
|
729
|
+
}
|
730
|
+
}
|
731
|
+
|
732
|
+
// fieldProps 函数化直接更新,无法比对返回值是否一致
|
733
|
+
if (isFunction(prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.fieldProps) && isFunction(nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.fieldProps)) {
|
734
|
+
return false;
|
735
|
+
}
|
736
|
+
|
737
|
+
// 通用函数比较方法
|
738
|
+
var compareFunctionResult = function compareFunctionResult(prevColumn, nextColumn, prevRowParams, nextRowParams, functionName) {
|
739
|
+
var prevFunc = prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn[functionName];
|
740
|
+
var nextFunc = nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn[functionName];
|
741
|
+
if (isFunction(prevFunc) && isFunction(nextFunc)) {
|
742
|
+
return isEqualWith(prevFunc.apply(void 0, _toConsumableArray(prevRowParams)), nextFunc.apply(void 0, _toConsumableArray(nextRowParams)), customEqualForFunction);
|
743
|
+
}
|
744
|
+
return true; // 如果不是函数或只有一个是函数,认为相等
|
745
|
+
};
|
746
|
+
|
747
|
+
// 使用简化后的比较逻辑
|
748
|
+
var functionFields = ['rules', 'component', 'desensitization', 'isEditable'];
|
749
|
+
if (functionFields.some(function (field) {
|
750
|
+
return !compareFunctionResult(prevColumn, nextColumn, prevRowParams, nextRowParams, field);
|
751
|
+
})) {
|
752
|
+
return false;
|
753
|
+
}
|
754
|
+
|
755
|
+
// 基本props比较
|
756
|
+
if (!isEqual(prevText, nextText) || prevIndex !== nextIndex) {
|
757
|
+
return false;
|
758
|
+
}
|
759
|
+
|
760
|
+
// 记录关键字段比较(避免完整对象比较的性能开销)
|
761
|
+
if ((prevRecord === null || prevRecord === void 0 ? void 0 : prevRecord.rowKey) !== (nextRecord === null || nextRecord === void 0 ? void 0 : nextRecord.rowKey) || (prevRecord === null || prevRecord === void 0 ? void 0 : prevRecord._addFlag) !== (nextRecord === null || nextRecord === void 0 ? void 0 : nextRecord._addFlag)) {
|
762
|
+
return false;
|
763
|
+
}
|
764
|
+
|
765
|
+
// 列配置比较(只比较关键字段),required,disabled为函数时,需要重新计算
|
766
|
+
if ((prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.dataIndex) !== (nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.dataIndex) || (prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.type) !== (nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.type) || (prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.name) !== (nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.name)) {
|
767
|
+
return false;
|
768
|
+
}
|
769
|
+
|
770
|
+
// config中关键字段比较
|
771
|
+
if ((prevConfig === null || prevConfig === void 0 ? void 0 : prevConfig._isEditing) !== (nextConfig === null || nextConfig === void 0 ? void 0 : nextConfig._isEditing) || (prevConfig === null || prevConfig === void 0 ? void 0 : prevConfig.mode) !== (nextConfig === null || nextConfig === void 0 ? void 0 : nextConfig.mode)) {
|
772
|
+
return false;
|
773
|
+
}
|
774
|
+
|
775
|
+
// 当前单元格的值比较
|
776
|
+
var prevDataIndex = prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.dataIndex;
|
777
|
+
var nextDataIndex = nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.dataIndex;
|
778
|
+
if (prevDataIndex && nextDataIndex && prevDataIndex === nextDataIndex) {
|
779
|
+
if ((prevRecord === null || prevRecord === void 0 ? void 0 : prevRecord[prevDataIndex]) !== (nextRecord === null || nextRecord === void 0 ? void 0 : nextRecord[nextDataIndex])) {
|
780
|
+
return false;
|
781
|
+
}
|
782
|
+
}
|
783
|
+
return true;
|
784
|
+
});
|