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