@zat-design/sisyphus-react 4.2.0-beta.1 → 4.2.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/dist/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/FormsProvider/index.js +7 -7
- package/es/ProAction/components/CheckModalContent/index.js +5 -5
- package/es/ProAction/index.js +98 -164
- package/es/ProConfigProvider/index.js +71 -60
- package/es/ProDownload/index.js +97 -184
- package/es/ProDownload/utils.js +98 -149
- package/es/ProDrawerForm/components/ProDrawer/index.js +100 -177
- package/es/ProDrawerForm/components/ProModal/index.js +73 -140
- package/es/ProDrawerForm/index.js +36 -54
- package/es/ProDrawerForm/utils/index.js +1 -1
- package/es/ProEditLabel/components/RenderProForm.js +29 -35
- package/es/ProEditLabel/index.js +97 -167
- package/es/ProEditLabel/utils/index.js +1 -1
- package/es/ProEditTable/components/ActionButton/index.js +61 -56
- package/es/ProEditTable/components/RcTable/BaseTable.js +51 -65
- package/es/ProEditTable/components/RcTable/DraggableTable.js +112 -106
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +107 -98
- package/es/ProEditTable/components/RenderField/index.js +465 -598
- package/es/ProEditTable/components/RenderToolbar/index.js +71 -90
- package/es/ProEditTable/components/Summary/index.js +40 -35
- package/es/ProEditTable/components/Validator/index.js +7 -6
- package/es/ProEditTable/index.js +256 -307
- package/es/ProEditTable/utils/config.js +158 -184
- package/es/ProEditTable/utils/diffOriginal.js +45 -37
- package/es/ProEditTable/utils/getDefaultProps.js +23 -19
- package/es/ProEditTable/utils/index.js +189 -215
- package/es/ProEditTable/utils/tools.js +213 -344
- package/es/ProEditTable/utils/transform.js +10 -14
- package/es/ProEditTable/utils/useEditTableError.js +18 -29
- package/es/ProEditTable/utils/useShouldUpdateForTable.js +55 -63
- package/es/ProEnum/components/Group.js +17 -25
- package/es/ProEnum/components/Tag.js +12 -19
- package/es/ProEnum/hooks/useEnum.js +54 -72
- package/es/ProEnum/hooks/useEnumRequest.js +226 -341
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +49 -69
- package/es/ProEnum/index.js +127 -137
- package/es/ProEnum/utils/eventCenter.js +2 -2
- package/es/ProEnum/utils/frequentEnum.js +55 -74
- package/es/ProEnum/utils/getEnumLabel.js +29 -29
- package/es/ProEnum/utils/index.js +107 -239
- package/es/ProForm/components/Container.js +10 -8
- package/es/ProForm/components/FormFooter/index.js +42 -44
- package/es/ProForm/components/base/Checkbox/index.js +29 -34
- package/es/ProForm/components/base/DatePicker/index.js +41 -39
- package/es/ProForm/components/base/DatePicker/useDateLimit.js +2 -11
- package/es/ProForm/components/base/Input/index.js +54 -55
- package/es/ProForm/components/base/InputNumber/index.js +115 -136
- package/es/ProForm/components/base/Radio/index.js +26 -32
- package/es/ProForm/components/base/RangePicker/index.js +63 -57
- package/es/ProForm/components/base/RangePicker/useDateRange.js +11 -19
- package/es/ProForm/components/base/Select/index.js +44 -50
- package/es/ProForm/components/base/Switch/index.js +21 -24
- package/es/ProForm/components/base/SwitchCheckbox/index.js +26 -29
- package/es/ProForm/components/base/TextArea/index.js +25 -29
- package/es/ProForm/components/base/TimePicker/index.js +24 -28
- package/es/ProForm/components/combination/Container/index.js +34 -33
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +181 -207
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +30 -29
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +12 -10
- package/es/ProForm/components/combination/FormList/components/Empty.js +32 -60
- package/es/ProForm/components/combination/FormList/components/LineFields.js +42 -42
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +98 -120
- package/es/ProForm/components/combination/FormList/index.js +78 -70
- package/es/ProForm/components/combination/FormList/utils.js +13 -13
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +6 -4
- package/es/ProForm/components/combination/Group/component/ComRender.js +77 -69
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.js +101 -105
- package/es/ProForm/components/combination/Group/hooks/index.js +101 -99
- package/es/ProForm/components/combination/Group/index.js +83 -80
- package/es/ProForm/components/combination/Group/utils/index.d.ts +11 -11
- package/es/ProForm/components/combination/Group/utils/index.js +155 -163
- package/es/ProForm/components/combination/ProCascader/index.js +145 -169
- package/es/ProForm/components/combination/ProCascader/utils/index.js +15 -18
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +65 -90
- package/es/ProForm/components/combination/ProModalSelect/index.js +384 -502
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +11 -11
- package/es/ProForm/components/combination/ProNumberRange/index.js +64 -72
- package/es/ProForm/components/combination/ProRangeLimit/index.js +82 -109
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +10 -18
- package/es/ProForm/components/combination/ProTimeLimit/index.js +78 -88
- package/es/ProForm/components/render/ChangedWrapper.js +71 -64
- package/es/ProForm/components/render/ConfirmWrapper.js +52 -109
- package/es/ProForm/components/render/CustomComponentViewWrapper.js +42 -45
- package/es/ProForm/components/render/Render.js +202 -220
- package/es/ProForm/components/render/RenderFields.js +99 -93
- package/es/ProForm/components/render/propsType.js +1 -1
- package/es/ProForm/index.js +128 -143
- package/es/ProForm/propsType.js +1 -1
- package/es/ProForm/utils/diffOriginal.js +39 -33
- package/es/ProForm/utils/getDefaultProps.js +24 -19
- package/es/ProForm/utils/index.js +115 -132
- package/es/ProForm/utils/processDependencies.js +7 -3
- package/es/ProForm/utils/rulesCreator.js +28 -36
- package/es/ProForm/utils/transformNames.js +18 -19
- package/es/ProForm/utils/transformValue.js +16 -25
- package/es/ProForm/utils/useDeepCompareMemo.js +7 -7
- package/es/ProForm/utils/useFieldProps.js +3 -3
- package/es/ProForm/utils/useForm.js +106 -190
- package/es/ProForm/utils/useRules.js +23 -20
- package/es/ProForm/utils/useShouldUpdate.js +107 -110
- package/es/ProForm/utils/useWatch.js +30 -37
- package/es/ProForm/utils/valueType.js +122 -143
- package/es/ProIcon/config/index.js +3 -3
- package/es/ProIcon/index.js +152 -167
- package/es/ProIcon/utils/index.js +28 -27
- package/es/ProLayout/components/Layout/Header/index.js +28 -36
- package/es/ProLayout/components/Layout/Icon/Icon.js +10 -9
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +61 -55
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +57 -66
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +18 -14
- package/es/ProLayout/components/Layout/Menu/index.js +30 -40
- package/es/ProLayout/components/Layout/Notice/index.js +6 -4
- package/es/ProLayout/components/ProCollapse/index.js +63 -68
- package/es/ProLayout/components/ProFooter/index.js +16 -22
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +6 -3
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +5 -5
- package/es/ProLayout/components/ProHeader/index.js +132 -149
- package/es/ProLayout/components/ProHeader/utils/index.js +5 -5
- package/es/ProLayout/components/TabsManager/components/TabContextMenu.js +20 -31
- package/es/ProLayout/components/TabsManager/components/TabItem.js +18 -18
- package/es/ProLayout/components/TabsManager/components/TabsContext.js +1 -1
- package/es/ProLayout/components/TabsManager/components/TabsHeader.js +9 -17
- package/es/ProLayout/components/TabsManager/hooks/useActiveTab.js +2 -2
- package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +1 -1
- package/es/ProLayout/components/TabsManager/hooks/useTabsCache.js +15 -15
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +103 -119
- package/es/ProLayout/components/TabsManager/index.js +51 -60
- package/es/ProLayout/components/TabsManager/propTypes.js +1 -1
- package/es/ProLayout/components/TabsManager/utils/index.js +20 -21
- package/es/ProLayout/index.js +84 -98
- package/es/ProLayout/propTypes.js +2 -4
- package/es/ProLayout/utils/index.js +66 -85
- package/es/ProSelect/components/AdaptiveTooltip.js +8 -16
- package/es/ProSelect/index.js +168 -186
- package/es/ProSelect/utils/index.js +49 -77
- package/es/ProStep/components/Anchor/index.js +21 -19
- package/es/ProStep/components/Item/index.js +32 -39
- package/es/ProStep/components/Listener/index.js +36 -60
- package/es/ProStep/components/Step/index.js +26 -40
- package/es/ProStep/index.js +104 -192
- package/es/ProStep/utils/index.js +20 -23
- package/es/ProStepTab/index.js +117 -235
- package/es/ProTable/components/FormatColumn/index.js +246 -219
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +21 -25
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +111 -143
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +52 -60
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +28 -30
- package/es/ProTable/components/RenderColumn/index.js +58 -66
- package/es/ProTable/components/RenderEmptyText/index.js +7 -7
- package/es/ProTable/components/RenderFooter/index.js +10 -8
- package/es/ProTable/components/RenderSummary/index.js +31 -30
- package/es/ProTable/components/RenderTableHeader/index.js +19 -17
- package/es/ProTable/components/RenderTabs/index.js +31 -45
- package/es/ProTable/components/TableResizable/index.js +33 -50
- package/es/ProTable/components/TooltipTitle/index.js +10 -7
- package/es/ProTable/hooks/useAntdTable.js +214 -267
- package/es/ProTable/index.js +192 -234
- package/es/ProTable/utils/index.js +23 -31
- package/es/ProTabs/components/Card/index.js +10 -8
- package/es/ProTabs/index.js +51 -61
- package/es/ProThemeTools/component/ProTools/index.js +65 -71
- package/es/ProThemeTools/context/ThemeContext.js +97 -93
- package/es/ProThemeTools/index.js +79 -91
- package/es/ProThemeTools/utils/index.js +49 -71
- package/es/ProTooltip/index.js +110 -120
- package/es/ProTree/components/AdaptiveTooltip.js +3 -2
- package/es/ProTree/components/CloseIcon.js +3 -7
- package/es/ProTree/components/List.js +21 -27
- package/es/ProTree/components/ProTree.js +162 -204
- package/es/ProTree/components/ProTreeSelect/index.js +250 -265
- package/es/ProTree/components/SearchTitle.js +18 -17
- package/es/ProTree/components/Tree.js +109 -148
- package/es/ProTree/index.js +15 -15
- package/es/ProTree/utils.js +48 -83
- package/es/ProTreeModal/components/Cascader.js +28 -41
- package/es/ProTreeModal/components/CloseIcon.js +3 -7
- package/es/ProTreeModal/components/List.js +90 -96
- package/es/ProTreeModal/components/SearchTitle.js +9 -8
- package/es/ProTreeModal/components/SortableItem.js +40 -37
- package/es/ProTreeModal/components/Tree.js +53 -69
- package/es/ProTreeModal/components/Trigger.js +55 -67
- package/es/ProTreeModal/index.js +203 -217
- package/es/ProTreeModal/utils.js +61 -101
- package/es/ProUpload/components/ButtonRender.js +31 -58
- package/es/ProUpload/components/DragRender.js +41 -42
- package/es/ProUpload/components/DraggableUploadListItem.js +19 -21
- package/es/ProUpload/components/Example.js +14 -25
- package/es/ProUpload/components/FileItem.js +39 -38
- package/es/ProUpload/components/ImageRender.js +59 -100
- package/es/ProUpload/index.js +129 -131
- package/es/ProUpload/uitls.js +3 -3
- package/es/ProUtils/utils/index.js +6 -10
- package/es/ProViewer/index.js +66 -102
- package/es/ProWaterMark/index.js +8 -10
- package/es/locale/index.js +5 -5
- package/es/tokens.js +1 -1
- package/es/utils/index.js +11 -20
- package/package.json +10 -10
- package/.claudeignore +0 -40
- package/lib/FormsProvider/index.d.ts +0 -18
- package/lib/FormsProvider/index.js +0 -44
- package/lib/ProAction/components/CheckModalContent/index.css +0 -22
- package/lib/ProAction/components/CheckModalContent/index.d.ts +0 -8
- package/lib/ProAction/components/CheckModalContent/index.js +0 -34
- package/lib/ProAction/components/CheckModalContent/index.less +0 -28
- package/lib/ProAction/index.d.ts +0 -7
- package/lib/ProAction/index.js +0 -232
- package/lib/ProAction/index.less +0 -8
- package/lib/ProAction/propsType.d.ts +0 -45
- package/lib/ProAction/propsType.js +0 -5
- package/lib/ProConfigProvider/index.d.ts +0 -9
- package/lib/ProConfigProvider/index.js +0 -158
- package/lib/ProConfigProvider/propsType.d.ts +0 -55
- package/lib/ProConfigProvider/propsType.js +0 -5
- package/lib/ProDownload/index.d.ts +0 -6
- package/lib/ProDownload/index.js +0 -208
- package/lib/ProDownload/propsType.d.ts +0 -71
- package/lib/ProDownload/propsType.js +0 -5
- package/lib/ProDownload/style/index.less +0 -9
- package/lib/ProDownload/utils.d.ts +0 -60
- package/lib/ProDownload/utils.js +0 -213
- package/lib/ProDrawerForm/components/ProDrawer/index.d.ts +0 -7
- package/lib/ProDrawerForm/components/ProDrawer/index.js +0 -287
- package/lib/ProDrawerForm/components/ProModal/index.d.ts +0 -7
- package/lib/ProDrawerForm/components/ProModal/index.js +0 -222
- package/lib/ProDrawerForm/components/index.d.ts +0 -2
- package/lib/ProDrawerForm/components/index.js +0 -20
- package/lib/ProDrawerForm/index.d.ts +0 -6
- package/lib/ProDrawerForm/index.js +0 -106
- package/lib/ProDrawerForm/propsType.d.ts +0 -100
- package/lib/ProDrawerForm/propsType.js +0 -5
- package/lib/ProDrawerForm/style/index.less +0 -172
- package/lib/ProDrawerForm/utils/index.d.ts +0 -6
- package/lib/ProDrawerForm/utils/index.js +0 -23
- package/lib/ProEditLabel/components/RenderProForm.d.ts +0 -4
- package/lib/ProEditLabel/components/RenderProForm.js +0 -87
- package/lib/ProEditLabel/index.d.ts +0 -4
- package/lib/ProEditLabel/index.js +0 -361
- package/lib/ProEditLabel/propsType.d.ts +0 -163
- package/lib/ProEditLabel/propsType.js +0 -5
- package/lib/ProEditLabel/style/index.less +0 -135
- package/lib/ProEditLabel/utils/index.d.ts +0 -7
- package/lib/ProEditLabel/utils/index.js +0 -24
- package/lib/ProEditTable/components/ActionButton/index.d.ts +0 -2
- package/lib/ProEditTable/components/ActionButton/index.js +0 -189
- package/lib/ProEditTable/components/RcTable/BaseTable.d.ts +0 -6
- package/lib/ProEditTable/components/RcTable/BaseTable.js +0 -125
- package/lib/ProEditTable/components/RcTable/DraggableTable.d.ts +0 -7
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +0 -219
- package/lib/ProEditTable/components/RcTable/index.d.ts +0 -4
- package/lib/ProEditTable/components/RcTable/index.js +0 -20
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +0 -17
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +0 -244
- package/lib/ProEditTable/components/RenderField/index.d.ts +0 -3
- package/lib/ProEditTable/components/RenderField/index.js +0 -1169
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +0 -2
- package/lib/ProEditTable/components/RenderToolbar/index.js +0 -148
- package/lib/ProEditTable/components/Summary/index.d.ts +0 -12
- package/lib/ProEditTable/components/Summary/index.js +0 -89
- package/lib/ProEditTable/components/Validator/index.d.ts +0 -10
- package/lib/ProEditTable/components/Validator/index.js +0 -34
- package/lib/ProEditTable/components/index.d.ts +0 -5
- package/lib/ProEditTable/components/index.js +0 -41
- package/lib/ProEditTable/index.d.ts +0 -4
- package/lib/ProEditTable/index.js +0 -535
- package/lib/ProEditTable/propsType.d.ts +0 -439
- package/lib/ProEditTable/propsType.js +0 -5
- package/lib/ProEditTable/style/index.less +0 -448
- package/lib/ProEditTable/utils/config.d.ts +0 -25
- package/lib/ProEditTable/utils/config.js +0 -293
- package/lib/ProEditTable/utils/diffOriginal.d.ts +0 -22
- package/lib/ProEditTable/utils/diffOriginal.js +0 -142
- package/lib/ProEditTable/utils/getDefaultProps.d.ts +0 -1
- package/lib/ProEditTable/utils/getDefaultProps.js +0 -39
- package/lib/ProEditTable/utils/index.d.ts +0 -9
- package/lib/ProEditTable/utils/index.js +0 -473
- package/lib/ProEditTable/utils/tools.d.ts +0 -93
- package/lib/ProEditTable/utils/tools.js +0 -572
- package/lib/ProEditTable/utils/transform.d.ts +0 -13
- package/lib/ProEditTable/utils/transform.js +0 -50
- package/lib/ProEditTable/utils/useEditTableError.d.ts +0 -7
- package/lib/ProEditTable/utils/useEditTableError.js +0 -108
- package/lib/ProEditTable/utils/useShouldUpdateForTable.d.ts +0 -16
- package/lib/ProEditTable/utils/useShouldUpdateForTable.js +0 -174
- package/lib/ProEnum/components/Group.d.ts +0 -10
- package/lib/ProEnum/components/Group.js +0 -76
- package/lib/ProEnum/components/Tag.d.ts +0 -7
- package/lib/ProEnum/components/Tag.js +0 -52
- package/lib/ProEnum/hooks/useEnum.d.ts +0 -29
- package/lib/ProEnum/hooks/useEnum.js +0 -282
- package/lib/ProEnum/hooks/useEnumRequest.d.ts +0 -4
- package/lib/ProEnum/hooks/useEnumRequest.js +0 -422
- package/lib/ProEnum/hooks/useFrequentEnumRequest.d.ts +0 -14
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +0 -91
- package/lib/ProEnum/index.d.ts +0 -8
- package/lib/ProEnum/index.js +0 -304
- package/lib/ProEnum/propsType.d.ts +0 -310
- package/lib/ProEnum/propsType.js +0 -5
- package/lib/ProEnum/style/index.less +0 -109
- package/lib/ProEnum/utils/eventCenter.d.ts +0 -1
- package/lib/ProEnum/utils/eventCenter.js +0 -33
- package/lib/ProEnum/utils/frequentEnum.d.ts +0 -40
- package/lib/ProEnum/utils/frequentEnum.js +0 -165
- package/lib/ProEnum/utils/getEnumLabel.d.ts +0 -2
- package/lib/ProEnum/utils/getEnumLabel.js +0 -83
- package/lib/ProEnum/utils/index.d.ts +0 -69
- package/lib/ProEnum/utils/index.js +0 -406
- package/lib/ProForm/components/Container.d.ts +0 -9
- package/lib/ProForm/components/Container.js +0 -40
- package/lib/ProForm/components/FormFooter/index.d.ts +0 -5
- package/lib/ProForm/components/FormFooter/index.js +0 -98
- package/lib/ProForm/components/FormFooter/propsType.d.ts +0 -22
- package/lib/ProForm/components/FormFooter/propsType.js +0 -5
- package/lib/ProForm/components/base/Checkbox/index.d.ts +0 -14
- package/lib/ProForm/components/base/Checkbox/index.js +0 -88
- package/lib/ProForm/components/base/DatePicker/index.d.ts +0 -11
- package/lib/ProForm/components/base/DatePicker/index.js +0 -110
- package/lib/ProForm/components/base/DatePicker/useDateLimit.d.ts +0 -3
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +0 -23
- package/lib/ProForm/components/base/Input/index.d.ts +0 -3
- package/lib/ProForm/components/base/Input/index.js +0 -137
- package/lib/ProForm/components/base/Input/propsType.d.ts +0 -21
- package/lib/ProForm/components/base/Input/propsType.js +0 -5
- package/lib/ProForm/components/base/InputNumber/index.d.ts +0 -11
- package/lib/ProForm/components/base/InputNumber/index.js +0 -317
- package/lib/ProForm/components/base/Radio/index.d.ts +0 -15
- package/lib/ProForm/components/base/Radio/index.js +0 -78
- package/lib/ProForm/components/base/RangePicker/index.d.ts +0 -19
- package/lib/ProForm/components/base/RangePicker/index.js +0 -201
- package/lib/ProForm/components/base/RangePicker/useDateRange.d.ts +0 -15
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +0 -45
- package/lib/ProForm/components/base/Select/index.d.ts +0 -11
- package/lib/ProForm/components/base/Select/index.js +0 -122
- package/lib/ProForm/components/base/Switch/index.d.ts +0 -10
- package/lib/ProForm/components/base/Switch/index.js +0 -53
- package/lib/ProForm/components/base/SwitchCheckbox/index.d.ts +0 -10
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +0 -78
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +0 -13
- package/lib/ProForm/components/base/TextArea/index.d.ts +0 -11
- package/lib/ProForm/components/base/TextArea/index.js +0 -63
- package/lib/ProForm/components/base/TextArea/index.less +0 -28
- package/lib/ProForm/components/base/TimePicker/index.d.ts +0 -13
- package/lib/ProForm/components/base/TimePicker/index.js +0 -56
- package/lib/ProForm/components/base/TimePicker/style/index.less +0 -6
- package/lib/ProForm/components/combination/Container/index.d.ts +0 -4
- package/lib/ProForm/components/combination/Container/index.js +0 -79
- package/lib/ProForm/components/combination/Container/propsType.d.ts +0 -13
- package/lib/ProForm/components/combination/Container/propsType.js +0 -5
- package/lib/ProForm/components/combination/Container/style/index.less +0 -47
- package/lib/ProForm/components/combination/FormList/components/ActionButton.d.ts +0 -24
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +0 -378
- package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +0 -23
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +0 -148
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.d.ts +0 -13
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +0 -36
- package/lib/ProForm/components/combination/FormList/components/Empty.d.ts +0 -13
- package/lib/ProForm/components/combination/FormList/components/Empty.js +0 -105
- package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +0 -20
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +0 -108
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +0 -12
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +0 -186
- package/lib/ProForm/components/combination/FormList/index.d.ts +0 -4
- package/lib/ProForm/components/combination/FormList/index.js +0 -204
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +0 -69
- package/lib/ProForm/components/combination/FormList/propsType.js +0 -5
- package/lib/ProForm/components/combination/FormList/style/index.less +0 -175
- package/lib/ProForm/components/combination/FormList/utils.d.ts +0 -18
- package/lib/ProForm/components/combination/FormList/utils.js +0 -60
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +0 -9
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +0 -26
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.less +0 -10
- package/lib/ProForm/components/combination/Group/component/ComRender.d.ts +0 -28
- package/lib/ProForm/components/combination/Group/component/ComRender.js +0 -165
- package/lib/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +0 -10
- package/lib/ProForm/components/combination/Group/component/FlexibleGroup.js +0 -414
- package/lib/ProForm/components/combination/Group/hooks/index.d.ts +0 -34
- package/lib/ProForm/components/combination/Group/hooks/index.js +0 -284
- package/lib/ProForm/components/combination/Group/index.d.ts +0 -9
- package/lib/ProForm/components/combination/Group/index.js +0 -202
- package/lib/ProForm/components/combination/Group/propsType.d.ts +0 -99
- package/lib/ProForm/components/combination/Group/propsType.js +0 -5
- package/lib/ProForm/components/combination/Group/style/index.less +0 -525
- package/lib/ProForm/components/combination/Group/utils/index.d.ts +0 -154
- package/lib/ProForm/components/combination/Group/utils/index.js +0 -444
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +0 -4
- package/lib/ProForm/components/combination/ProCascader/index.js +0 -373
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +0 -48
- package/lib/ProForm/components/combination/ProCascader/propsType.js +0 -5
- package/lib/ProForm/components/combination/ProCascader/style/index.less +0 -28
- package/lib/ProForm/components/combination/ProCascader/utils/index.d.ts +0 -14
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +0 -43
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.d.ts +0 -33
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +0 -167
- package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +0 -4
- package/lib/ProForm/components/combination/ProModalSelect/index.js +0 -885
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +0 -106
- package/lib/ProForm/components/combination/ProModalSelect/propsType.js +0 -5
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +0 -182
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.d.ts +0 -1
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +0 -32
- package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +0 -4
- package/lib/ProForm/components/combination/ProNumberRange/index.js +0 -270
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +0 -85
- package/lib/ProForm/components/combination/ProNumberRange/propsType.js +0 -5
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +0 -50
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +0 -4
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +0 -228
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.d.ts +0 -23
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.js +0 -5
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +0 -9
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +0 -49
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +0 -33
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +0 -189
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +0 -99
- package/lib/ProForm/components/index.d.ts +0 -29
- package/lib/ProForm/components/index.js +0 -194
- package/lib/ProForm/components/render/ChangedWrapper.d.ts +0 -17
- package/lib/ProForm/components/render/ChangedWrapper.js +0 -152
- package/lib/ProForm/components/render/ConfirmWrapper.d.ts +0 -10
- package/lib/ProForm/components/render/ConfirmWrapper.js +0 -131
- package/lib/ProForm/components/render/CustomComponentViewWrapper.d.ts +0 -30
- package/lib/ProForm/components/render/CustomComponentViewWrapper.js +0 -127
- package/lib/ProForm/components/render/Render.d.ts +0 -4
- package/lib/ProForm/components/render/Render.js +0 -590
- package/lib/ProForm/components/render/RenderFields.d.ts +0 -26
- package/lib/ProForm/components/render/RenderFields.js +0 -265
- package/lib/ProForm/components/render/propsType.d.ts +0 -296
- package/lib/ProForm/components/render/propsType.js +0 -31
- package/lib/ProForm/index.d.ts +0 -6
- package/lib/ProForm/index.js +0 -334
- package/lib/ProForm/propsType.d.ts +0 -131
- package/lib/ProForm/propsType.js +0 -13
- package/lib/ProForm/style/index.less +0 -567
- package/lib/ProForm/utils/diffOriginal.d.ts +0 -10
- package/lib/ProForm/utils/diffOriginal.js +0 -129
- package/lib/ProForm/utils/getDefaultProps.d.ts +0 -1
- package/lib/ProForm/utils/getDefaultProps.js +0 -39
- package/lib/ProForm/utils/index.d.ts +0 -119
- package/lib/ProForm/utils/index.js +0 -544
- package/lib/ProForm/utils/processDependencies.d.ts +0 -29
- package/lib/ProForm/utils/processDependencies.js +0 -72
- package/lib/ProForm/utils/rulesCreator.d.ts +0 -7
- package/lib/ProForm/utils/rulesCreator.js +0 -96
- package/lib/ProForm/utils/transformNames.d.ts +0 -10
- package/lib/ProForm/utils/transformNames.js +0 -39
- package/lib/ProForm/utils/transformValue.d.ts +0 -6
- package/lib/ProForm/utils/transformValue.js +0 -73
- package/lib/ProForm/utils/useDeepCompareMemo.d.ts +0 -2
- package/lib/ProForm/utils/useDeepCompareMemo.js +0 -23
- package/lib/ProForm/utils/useFieldProps.d.ts +0 -4
- package/lib/ProForm/utils/useFieldProps.js +0 -13
- package/lib/ProForm/utils/useForm.d.ts +0 -22
- package/lib/ProForm/utils/useForm.js +0 -276
- package/lib/ProForm/utils/useRules.d.ts +0 -16
- package/lib/ProForm/utils/useRules.js +0 -86
- package/lib/ProForm/utils/useShouldUpdate.d.ts +0 -27
- package/lib/ProForm/utils/useShouldUpdate.js +0 -399
- package/lib/ProForm/utils/useWatch.d.ts +0 -12
- package/lib/ProForm/utils/useWatch.js +0 -196
- package/lib/ProForm/utils/valueType.d.ts +0 -70
- package/lib/ProForm/utils/valueType.js +0 -323
- package/lib/ProIcon/config/index.d.ts +0 -19
- package/lib/ProIcon/config/index.js +0 -281
- package/lib/ProIcon/index.d.ts +0 -4
- package/lib/ProIcon/index.js +0 -405
- package/lib/ProIcon/propsTypes.d.ts +0 -181
- package/lib/ProIcon/propsTypes.js +0 -5
- package/lib/ProIcon/style/index.less +0 -27
- package/lib/ProIcon/utils/index.d.ts +0 -6
- package/lib/ProIcon/utils/index.js +0 -95
- package/lib/ProLayout/components/Layout/Header/index.d.ts +0 -4
- package/lib/ProLayout/components/Layout/Header/index.js +0 -188
- package/lib/ProLayout/components/Layout/Header/style/index.less +0 -277
- package/lib/ProLayout/components/Layout/Icon/Icon.d.ts +0 -10
- package/lib/ProLayout/components/Layout/Icon/Icon.js +0 -41
- package/lib/ProLayout/components/Layout/Icon/index.d.ts +0 -2
- package/lib/ProLayout/components/Layout/Icon/index.js +0 -9
- package/lib/ProLayout/components/Layout/Icon/style/index.less +0 -7
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.d.ts +0 -3
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +0 -212
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +0 -111
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +0 -3
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +0 -214
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/propsType.d.ts +0 -15
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +0 -5
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +0 -177
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.d.ts +0 -3
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +0 -47
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +0 -124
- package/lib/ProLayout/components/Layout/Menu/index.d.ts +0 -4
- package/lib/ProLayout/components/Layout/Menu/index.js +0 -178
- package/lib/ProLayout/components/Layout/Menu/style/index.less +0 -136
- package/lib/ProLayout/components/Layout/Notice/index.d.ts +0 -4
- package/lib/ProLayout/components/Layout/Notice/index.js +0 -37
- package/lib/ProLayout/components/Layout/Notice/style/index.less +0 -37
- package/lib/ProLayout/components/Layout/index.d.ts +0 -4
- package/lib/ProLayout/components/Layout/index.js +0 -34
- package/lib/ProLayout/components/Layout/index.less +0 -4
- package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +0 -98
- package/lib/ProLayout/components/ProCollapse/PropTypes.js +0 -5
- package/lib/ProLayout/components/ProCollapse/index.d.ts +0 -3
- package/lib/ProLayout/components/ProCollapse/index.js +0 -200
- package/lib/ProLayout/components/ProCollapse/style/index.less +0 -357
- package/lib/ProLayout/components/ProFooter/PropTypes.d.ts +0 -27
- package/lib/ProLayout/components/ProFooter/PropTypes.js +0 -5
- package/lib/ProLayout/components/ProFooter/index.d.ts +0 -4
- package/lib/ProLayout/components/ProFooter/index.js +0 -59
- package/lib/ProLayout/components/ProFooter/style/index.less +0 -12
- package/lib/ProLayout/components/ProHeader/PropTypes.d.ts +0 -206
- package/lib/ProLayout/components/ProHeader/PropTypes.js +0 -5
- package/lib/ProLayout/components/ProHeader/components/Copy/index.d.ts +0 -4
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +0 -29
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.d.ts +0 -9
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +0 -35
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/propsType.d.ts +0 -4
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +0 -5
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +0 -23
- package/lib/ProLayout/components/ProHeader/components/index.d.ts +0 -2
- package/lib/ProLayout/components/ProHeader/components/index.js +0 -20
- package/lib/ProLayout/components/ProHeader/index.d.ts +0 -4
- package/lib/ProLayout/components/ProHeader/index.js +0 -559
- package/lib/ProLayout/components/ProHeader/style/index.less +0 -416
- package/lib/ProLayout/components/ProHeader/utils/index.d.ts +0 -5
- package/lib/ProLayout/components/ProHeader/utils/index.js +0 -21
- package/lib/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +0 -7
- package/lib/ProLayout/components/TabsManager/components/TabContextMenu.js +0 -106
- package/lib/ProLayout/components/TabsManager/components/TabItem.d.ts +0 -26
- package/lib/ProLayout/components/TabsManager/components/TabItem.js +0 -75
- package/lib/ProLayout/components/TabsManager/components/TabsContext.d.ts +0 -6
- package/lib/ProLayout/components/TabsManager/components/TabsContext.js +0 -11
- package/lib/ProLayout/components/TabsManager/components/TabsHeader.d.ts +0 -12
- package/lib/ProLayout/components/TabsManager/components/TabsHeader.js +0 -58
- package/lib/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +0 -6
- package/lib/ProLayout/components/TabsManager/hooks/useActiveTab.js +0 -20
- package/lib/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +0 -18
- package/lib/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +0 -31
- package/lib/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +0 -31
- package/lib/ProLayout/components/TabsManager/hooks/useTabsCache.js +0 -103
- package/lib/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +0 -5
- package/lib/ProLayout/components/TabsManager/hooks/useTabsState.js +0 -417
- package/lib/ProLayout/components/TabsManager/index.d.ts +0 -7
- package/lib/ProLayout/components/TabsManager/index.js +0 -196
- package/lib/ProLayout/components/TabsManager/propTypes.d.ts +0 -75
- package/lib/ProLayout/components/TabsManager/propTypes.js +0 -21
- package/lib/ProLayout/components/TabsManager/style/index.less +0 -310
- package/lib/ProLayout/components/TabsManager/utils/index.d.ts +0 -41
- package/lib/ProLayout/components/TabsManager/utils/index.js +0 -126
- package/lib/ProLayout/components/index.d.ts +0 -3
- package/lib/ProLayout/components/index.js +0 -27
- package/lib/ProLayout/images/close.png +0 -0
- package/lib/ProLayout/images/logoImg.png +0 -0
- package/lib/ProLayout/images/tipMsg.png +0 -0
- package/lib/ProLayout/index.d.ts +0 -20
- package/lib/ProLayout/index.js +0 -285
- package/lib/ProLayout/propTypes.d.ts +0 -435
- package/lib/ProLayout/propTypes.js +0 -46
- package/lib/ProLayout/style/index.less +0 -344
- package/lib/ProLayout/utils/index.d.ts +0 -43
- package/lib/ProLayout/utils/index.js +0 -278
- package/lib/ProSelect/components/AdaptiveTooltip.d.ts +0 -4
- package/lib/ProSelect/components/AdaptiveTooltip.js +0 -54
- package/lib/ProSelect/index.d.ts +0 -5
- package/lib/ProSelect/index.js +0 -524
- package/lib/ProSelect/propsType.d.ts +0 -160
- package/lib/ProSelect/propsType.js +0 -5
- package/lib/ProSelect/style/index.less +0 -21
- package/lib/ProSelect/utils/index.d.ts +0 -4
- package/lib/ProSelect/utils/index.js +0 -146
- package/lib/ProStep/components/Anchor/index.d.ts +0 -4
- package/lib/ProStep/components/Anchor/index.js +0 -117
- package/lib/ProStep/components/Item/index.d.ts +0 -3
- package/lib/ProStep/components/Item/index.js +0 -104
- package/lib/ProStep/components/Listener/index.d.ts +0 -4
- package/lib/ProStep/components/Listener/index.js +0 -80
- package/lib/ProStep/components/Step/index.d.ts +0 -5
- package/lib/ProStep/components/Step/index.js +0 -99
- package/lib/ProStep/index.d.ts +0 -11
- package/lib/ProStep/index.js +0 -266
- package/lib/ProStep/propsType.d.ts +0 -222
- package/lib/ProStep/propsType.js +0 -5
- package/lib/ProStep/style/index.less +0 -220
- package/lib/ProStep/utils/index.d.ts +0 -22
- package/lib/ProStep/utils/index.js +0 -78
- package/lib/ProStepTab/index.d.ts +0 -22
- package/lib/ProStepTab/index.js +0 -384
- package/lib/ProStepTab/propsType.d.ts +0 -114
- package/lib/ProStepTab/propsType.js +0 -5
- package/lib/ProTable/components/FormatColumn/index.d.ts +0 -20
- package/lib/ProTable/components/FormatColumn/index.js +0 -699
- package/lib/ProTable/components/FormatColumn/propsType.d.ts +0 -29
- package/lib/ProTable/components/FormatColumn/propsType.js +0 -5
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -10
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +0 -49
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +0 -18
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +0 -205
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.d.ts +0 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +0 -182
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.d.ts +0 -61
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +0 -5
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -10
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +0 -65
- package/lib/ProTable/components/RcTable/index.d.ts +0 -4
- package/lib/ProTable/components/RcTable/index.js +0 -20
- package/lib/ProTable/components/RenderColumn/index.d.ts +0 -22
- package/lib/ProTable/components/RenderColumn/index.js +0 -278
- package/lib/ProTable/components/RenderEmptyText/index.d.ts +0 -3
- package/lib/ProTable/components/RenderEmptyText/index.js +0 -28
- package/lib/ProTable/components/RenderFooter/index.d.ts +0 -2
- package/lib/ProTable/components/RenderFooter/index.js +0 -20
- package/lib/ProTable/components/RenderSummary/index.d.ts +0 -3
- package/lib/ProTable/components/RenderSummary/index.js +0 -60
- package/lib/ProTable/components/RenderTableHeader/index.d.ts +0 -2
- package/lib/ProTable/components/RenderTableHeader/index.js +0 -67
- package/lib/ProTable/components/RenderTabs/index.d.ts +0 -4
- package/lib/ProTable/components/RenderTabs/index.js +0 -97
- package/lib/ProTable/components/TableResizable/index.d.ts +0 -13
- package/lib/ProTable/components/TableResizable/index.js +0 -109
- package/lib/ProTable/components/TooltipTitle/index.d.ts +0 -11
- package/lib/ProTable/components/TooltipTitle/index.js +0 -26
- package/lib/ProTable/components/index.d.ts +0 -30
- package/lib/ProTable/components/index.js +0 -48
- package/lib/ProTable/hooks/useAntdTable.d.ts +0 -7
- package/lib/ProTable/hooks/useAntdTable.js +0 -581
- package/lib/ProTable/index.d.ts +0 -16
- package/lib/ProTable/index.js +0 -476
- package/lib/ProTable/propsType.d.ts +0 -757
- package/lib/ProTable/propsType.js +0 -5
- package/lib/ProTable/style/index.less +0 -644
- package/lib/ProTable/utils/index.d.ts +0 -38
- package/lib/ProTable/utils/index.js +0 -142
- package/lib/ProTabs/components/Card/index.d.ts +0 -3
- package/lib/ProTabs/components/Card/index.js +0 -54
- package/lib/ProTabs/components/index.d.ts +0 -1
- package/lib/ProTabs/components/index.js +0 -13
- package/lib/ProTabs/index.d.ts +0 -4
- package/lib/ProTabs/index.js +0 -138
- package/lib/ProTabs/propType.d.ts +0 -94
- package/lib/ProTabs/propType.js +0 -5
- package/lib/ProTabs/style/index.less +0 -157
- package/lib/ProThemeTools/component/ProTools/index.d.ts +0 -3
- package/lib/ProThemeTools/component/ProTools/index.js +0 -301
- package/lib/ProThemeTools/component/ProTools/style/index.less +0 -178
- package/lib/ProThemeTools/component/index.d.ts +0 -1
- package/lib/ProThemeTools/component/index.js +0 -13
- package/lib/ProThemeTools/context/ThemeContext.d.ts +0 -43
- package/lib/ProThemeTools/context/ThemeContext.js +0 -291
- package/lib/ProThemeTools/index.d.ts +0 -9
- package/lib/ProThemeTools/index.js +0 -302
- package/lib/ProThemeTools/propsType.d.ts +0 -170
- package/lib/ProThemeTools/propsType.js +0 -5
- package/lib/ProThemeTools/style/index.less +0 -74
- package/lib/ProThemeTools/utils/index.d.ts +0 -51
- package/lib/ProThemeTools/utils/index.js +0 -261
- package/lib/ProTooltip/index.d.ts +0 -3
- package/lib/ProTooltip/index.js +0 -309
- package/lib/ProTooltip/propsType.d.ts +0 -57
- package/lib/ProTooltip/propsType.js +0 -5
- package/lib/ProTooltip/style/index.less +0 -34
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +0 -4
- package/lib/ProTree/components/AdaptiveTooltip.js +0 -23
- package/lib/ProTree/components/CloseIcon.d.ts +0 -2
- package/lib/ProTree/components/CloseIcon.js +0 -38
- package/lib/ProTree/components/List.d.ts +0 -17
- package/lib/ProTree/components/List.js +0 -79
- package/lib/ProTree/components/ProTree.d.ts +0 -3
- package/lib/ProTree/components/ProTree.js +0 -505
- package/lib/ProTree/components/ProTreeSelect/index.d.ts +0 -5
- package/lib/ProTree/components/ProTreeSelect/index.js +0 -770
- package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +0 -439
- package/lib/ProTree/components/ProTreeSelect/propsType.js +0 -5
- package/lib/ProTree/components/ProTreeSelect/style/index.less +0 -119
- package/lib/ProTree/components/SearchTitle.d.ts +0 -11
- package/lib/ProTree/components/SearchTitle.js +0 -60
- package/lib/ProTree/components/Tree.d.ts +0 -27
- package/lib/ProTree/components/Tree.js +0 -393
- package/lib/ProTree/components/index.d.ts +0 -4
- package/lib/ProTree/components/index.js +0 -34
- package/lib/ProTree/index.d.ts +0 -3
- package/lib/ProTree/index.js +0 -30
- package/lib/ProTree/propsType.d.ts +0 -812
- package/lib/ProTree/propsType.js +0 -5
- package/lib/ProTree/style/index.less +0 -393
- package/lib/ProTree/utils.d.ts +0 -43
- package/lib/ProTree/utils.js +0 -221
- package/lib/ProTreeModal/components/Cascader.d.ts +0 -14
- package/lib/ProTreeModal/components/Cascader.js +0 -110
- package/lib/ProTreeModal/components/CloseIcon.d.ts +0 -2
- package/lib/ProTreeModal/components/CloseIcon.js +0 -38
- package/lib/ProTreeModal/components/List.d.ts +0 -21
- package/lib/ProTreeModal/components/List.js +0 -294
- package/lib/ProTreeModal/components/SearchTitle.d.ts +0 -7
- package/lib/ProTreeModal/components/SearchTitle.js +0 -27
- package/lib/ProTreeModal/components/SortableItem.d.ts +0 -12
- package/lib/ProTreeModal/components/SortableItem.js +0 -80
- package/lib/ProTreeModal/components/Tree.d.ts +0 -25
- package/lib/ProTreeModal/components/Tree.js +0 -241
- package/lib/ProTreeModal/components/Trigger.d.ts +0 -21
- package/lib/ProTreeModal/components/Trigger.js +0 -195
- package/lib/ProTreeModal/components/index.d.ts +0 -6
- package/lib/ProTreeModal/components/index.js +0 -48
- package/lib/ProTreeModal/index.d.ts +0 -4
- package/lib/ProTreeModal/index.js +0 -837
- package/lib/ProTreeModal/propsType.d.ts +0 -298
- package/lib/ProTreeModal/propsType.js +0 -5
- package/lib/ProTreeModal/style/index.less +0 -414
- package/lib/ProTreeModal/utils.d.ts +0 -39
- package/lib/ProTreeModal/utils.js +0 -243
- package/lib/ProUpload/components/ButtonRender.d.ts +0 -20
- package/lib/ProUpload/components/ButtonRender.js +0 -114
- package/lib/ProUpload/components/DragRender.d.ts +0 -21
- package/lib/ProUpload/components/DragRender.js +0 -196
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +0 -2
- package/lib/ProUpload/components/DraggableUploadListItem.js +0 -42
- package/lib/ProUpload/components/Example.d.ts +0 -10
- package/lib/ProUpload/components/Example.js +0 -61
- package/lib/ProUpload/components/FileItem.d.ts +0 -33
- package/lib/ProUpload/components/FileItem.js +0 -238
- package/lib/ProUpload/components/ImageRender.d.ts +0 -19
- package/lib/ProUpload/components/ImageRender.js +0 -279
- package/lib/ProUpload/index.d.ts +0 -4
- package/lib/ProUpload/index.js +0 -311
- package/lib/ProUpload/propsType.d.ts +0 -264
- package/lib/ProUpload/propsType.js +0 -5
- package/lib/ProUpload/style/icon-PDF.png +0 -0
- package/lib/ProUpload/style/icon-TXT.png +0 -0
- package/lib/ProUpload/style/icon-excel.png +0 -0
- package/lib/ProUpload/style/icon-pic.png +0 -0
- package/lib/ProUpload/style/icon-word.png +0 -0
- package/lib/ProUpload/style/index.less +0 -480
- package/lib/ProUpload/uitls.d.ts +0 -3
- package/lib/ProUpload/uitls.js +0 -22
- package/lib/ProUtils/utils/index.d.ts +0 -6
- package/lib/ProUtils/utils/index.js +0 -26
- package/lib/ProViewer/index.d.ts +0 -4
- package/lib/ProViewer/index.js +0 -229
- package/lib/ProViewer/propsType.d.ts +0 -35
- package/lib/ProViewer/propsType.js +0 -3
- package/lib/ProViewer/style/index.less +0 -10
- package/lib/ProWaterMark/index.d.ts +0 -4
- package/lib/ProWaterMark/index.js +0 -26
- package/lib/ProWaterMark/propsType.d.ts +0 -6
- package/lib/ProWaterMark/propsType.js +0 -5
- package/lib/assets/apps.svg +0 -23
- package/lib/assets/arrow.svg +0 -1
- package/lib/assets/catalog.svg +0 -30
- package/lib/assets/close.svg +0 -1
- package/lib/assets/close2.svg +0 -1
- package/lib/assets/copy.svg +0 -1
- package/lib/assets/customColumn.svg +0 -2
- package/lib/assets/delete.svg +0 -1
- package/lib/assets/disabled.svg +0 -18
- package/lib/assets/download.svg +0 -1
- package/lib/assets/drag.svg +0 -1
- package/lib/assets/empty.png +0 -0
- package/lib/assets/fold.svg +0 -27
- package/lib/assets/header_bg.png +0 -0
- package/lib/assets/input-search.svg +0 -11
- package/lib/assets/look.svg +0 -1
- package/lib/assets/reset.svg +0 -11
- package/lib/assets/search.svg +0 -1
- package/lib/assets/setting.svg +0 -14
- package/lib/assets/view.svg +0 -20
- package/lib/global.less +0 -57
- package/lib/index.d.ts +0 -47
- package/lib/index.js +0 -276
- package/lib/locale/en_US.d.ts +0 -176
- package/lib/locale/en_US.js +0 -181
- package/lib/locale/index.d.ts +0 -15
- package/lib/locale/index.js +0 -65
- package/lib/locale/zh_CN.d.ts +0 -176
- package/lib/locale/zh_CN.js +0 -181
- package/lib/style/components.less +0 -27
- package/lib/style/core/compatible.less +0 -5
- package/lib/style/core/index.less +0 -3
- package/lib/style/core/mixins.less +0 -77
- package/lib/style/core/normalize.less +0 -251
- package/lib/style/index.less +0 -2
- package/lib/style/less.less +0 -2
- package/lib/style/theme/antd.less +0 -743
- package/lib/style/theme/base.less +0 -90
- package/lib/style/theme/index.less +0 -2
- package/lib/style/theme/tokens.less +0 -90
- package/lib/style/variables.less +0 -2
- package/lib/tokens.d.ts +0 -83
- package/lib/tokens.js +0 -91
- package/lib/utils/index.d.ts +0 -21
- package/lib/utils/index.js +0 -116
- package/typings.d.ts +0 -17
|
@@ -1,1169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _antd = require("antd");
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _lodash = require("lodash");
|
|
11
|
-
var _utils = require("../../../utils");
|
|
12
|
-
var _valueType2 = _interopRequireDefault(require("../../../ProForm/utils/valueType"));
|
|
13
|
-
var _transform = _interopRequireDefault(require("../../utils/transform"));
|
|
14
|
-
var _tools = require("../../utils/tools");
|
|
15
|
-
var componentMap = _interopRequireWildcard(require("../../../ProForm/components"));
|
|
16
|
-
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
17
|
-
var _Container = _interopRequireDefault(require("../../../ProForm/components/Container"));
|
|
18
|
-
var _transformNames = _interopRequireDefault(require("../../../ProForm/utils/transformNames"));
|
|
19
|
-
var _useFieldProps = require("../../../ProForm/utils/useFieldProps");
|
|
20
|
-
var _useRules = _interopRequireDefault(require("../../../ProForm/utils/useRules"));
|
|
21
|
-
var _utils2 = require("../../../ProForm/utils");
|
|
22
|
-
var _locale = _interopRequireDefault(require("../../../locale"));
|
|
23
|
-
var _ConfirmWrapper = _interopRequireDefault(require("../../../ProForm/components/render/ConfirmWrapper"));
|
|
24
|
-
var _getDefaultProps = require("../../utils/getDefaultProps");
|
|
25
|
-
var _ListChangedWrapper = _interopRequireDefault(require("./ListChangedWrapper"));
|
|
26
|
-
var _useShouldUpdateForTable = _interopRequireDefault(require("../../utils/useShouldUpdateForTable"));
|
|
27
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
|
-
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "onDiff", "className", "trim", "confirm", "dependencies", "desensitization"];
|
|
29
|
-
/* eslint-disable prefer-destructuring */
|
|
30
|
-
/* eslint-disable prefer-const */
|
|
31
|
-
/** 列配置中不应透传到 Form.Item 或 DOM 的字段(与 ProForm Render 保持一致) */
|
|
32
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
34
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
35
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
36
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
37
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
38
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
39
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
40
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
42
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
43
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
44
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
45
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
46
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
47
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
48
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
49
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
50
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
51
|
-
var OMIT_FORM_ITEM_AND_DOM_KEYS = ['format', 'toISOString', 'toCSTString', 'switchValue', 'precision', 'clearNotShow', 'dependNames', 'shouldCellUpdate' // 表格内部性能优化属性,不应传递给 Form.Item
|
|
52
|
-
];
|
|
53
|
-
var RenderField = _ref => {
|
|
54
|
-
var _type, _type$replace, _fieldProps2, _fieldProps4, _names, _TargetComponent5, _componentProps3;
|
|
55
|
-
var value = _ref.text,
|
|
56
|
-
record = _ref.record,
|
|
57
|
-
index = _ref.index,
|
|
58
|
-
column = _ref.column,
|
|
59
|
-
config = _ref.config;
|
|
60
|
-
var type = column.type,
|
|
61
|
-
valueType = column.valueType,
|
|
62
|
-
names = column.names,
|
|
63
|
-
fieldProps = column.fieldProps,
|
|
64
|
-
labelRequired = column.labelRequired,
|
|
65
|
-
editRender = column.editRender,
|
|
66
|
-
component = column.component,
|
|
67
|
-
viewRender = column.viewRender,
|
|
68
|
-
title = column.title,
|
|
69
|
-
originTitle = column.originTitle,
|
|
70
|
-
label = column.label,
|
|
71
|
-
dataIndex = column.dataIndex,
|
|
72
|
-
formItemProps = column.formItemProps,
|
|
73
|
-
_column$isEditable = column.isEditable,
|
|
74
|
-
isEditable = _column$isEditable === void 0 ? true : _column$isEditable,
|
|
75
|
-
_column$required = column.required,
|
|
76
|
-
required = _column$required === void 0 ? false : _column$required,
|
|
77
|
-
_column$rules = column.rules,
|
|
78
|
-
rules = _column$rules === void 0 ? [] : _column$rules,
|
|
79
|
-
onDiff = column.onDiff,
|
|
80
|
-
className = column.className,
|
|
81
|
-
trim = column.trim,
|
|
82
|
-
confirm = column.confirm,
|
|
83
|
-
dependencies = column.dependencies,
|
|
84
|
-
desensitization = column.desensitization,
|
|
85
|
-
resetProps = _objectWithoutProperties(column, _excluded);
|
|
86
|
-
var mode = config.mode,
|
|
87
|
-
cellName = config.cellName,
|
|
88
|
-
cellNamePath = config.cellNamePath,
|
|
89
|
-
_isEditing = config._isEditing,
|
|
90
|
-
form = config.form,
|
|
91
|
-
setState = config.setState,
|
|
92
|
-
name = config.name,
|
|
93
|
-
virtualKey = config.virtualKey,
|
|
94
|
-
viewEmpty = config.viewEmpty,
|
|
95
|
-
originalValues = config.originalValues,
|
|
96
|
-
formNamePath = config.namePath,
|
|
97
|
-
rowDisabled = config.rowDisabled,
|
|
98
|
-
_config$validateTrigg = config.validateTrigger,
|
|
99
|
-
validateTrigger = _config$validateTrigg === void 0 ? ['onChange', 'onBlur', 'onSubmit'] : _config$validateTrigg,
|
|
100
|
-
otherProps = config.otherProps,
|
|
101
|
-
diffConfig = config.diffConfig,
|
|
102
|
-
getIsNew = config.getIsNew,
|
|
103
|
-
shouldUpdateDebounce = config.shouldUpdateDebounce;
|
|
104
|
-
var _fieldProps = fieldProps || formItemProps || {};
|
|
105
|
-
var _rules = rules || [];
|
|
106
|
-
var _required = required;
|
|
107
|
-
var _valueType = valueType;
|
|
108
|
-
var _disabled = false;
|
|
109
|
-
var _desensitization = desensitization || [];
|
|
110
|
-
var _component = component || editRender;
|
|
111
|
-
var isCell = mode === 'cell';
|
|
112
|
-
var isSingleMode = mode === 'single';
|
|
113
|
-
if (isCell) {
|
|
114
|
-
record['is-view'] = !(0, _lodash.isEqual)(cellNamePath, cellName);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// type类型 首字母转大写
|
|
118
|
-
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';
|
|
119
|
-
|
|
120
|
-
// 自定义组件时 防止默认值影像后续判断
|
|
121
|
-
if ('component' in column) {
|
|
122
|
-
type = null;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// 单行正在编辑时,临时生成一套formItem用来存储中间值,点击取消时候重置回上一次状态
|
|
126
|
-
var namePath = (0, _tools.getNamePath)(name, virtualKey);
|
|
127
|
-
var rowData = form.getFieldValue([...namePath, index]) || record || {};
|
|
128
|
-
var currentValue = dataIndex ? rowData === null || rowData === void 0 ? void 0 : rowData[dataIndex] : null;
|
|
129
|
-
|
|
130
|
-
// 构建新的参数格式(与 ProForm 保持一致)
|
|
131
|
-
var reactiveParams = (0, _react.useMemo)(() => ({
|
|
132
|
-
form,
|
|
133
|
-
index,
|
|
134
|
-
namePath: [...namePath, index]
|
|
135
|
-
}), [form, index, namePath]);
|
|
136
|
-
|
|
137
|
-
// 保留 options 用于 viewRender 和 formatArgs(兼容旧格式)
|
|
138
|
-
var options = (0, _react.useMemo)(() => ({
|
|
139
|
-
index,
|
|
140
|
-
form,
|
|
141
|
-
name: column === null || column === void 0 ? void 0 : column.name,
|
|
142
|
-
namePath: [...namePath, index]
|
|
143
|
-
}), [index, column === null || column === void 0 ? void 0 : column.name, namePath, form]);
|
|
144
|
-
|
|
145
|
-
// 行参数 - 使用useMemo优化(新格式:values, { form, index, namePath })
|
|
146
|
-
var rowParams = (0, _react.useMemo)(() => [rowData, reactiveParams], [rowData, reactiveParams]);
|
|
147
|
-
|
|
148
|
-
// 使用 hook 处理动态属性(带选择性防抖)
|
|
149
|
-
var dynamicProps = (0, _useShouldUpdateForTable.default)({
|
|
150
|
-
rowParams,
|
|
151
|
-
column,
|
|
152
|
-
shouldUpdateDebounce
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
// required & rules & fieldProps & disabled & valueType 函数化处理
|
|
156
|
-
// 优先使用 hook 返回的值,fallback 到原始值
|
|
157
|
-
if ((0, _lodash.isFunction)(required)) {
|
|
158
|
-
var _dynamicProps$require;
|
|
159
|
-
_required = (_dynamicProps$require = dynamicProps.required) !== null && _dynamicProps$require !== void 0 ? _dynamicProps$require : required(rowData, reactiveParams);
|
|
160
|
-
}
|
|
161
|
-
if ((0, _lodash.isFunction)(fieldProps)) {
|
|
162
|
-
var _dynamicProps$fieldPr;
|
|
163
|
-
_fieldProps = (_dynamicProps$fieldPr = dynamicProps.fieldProps) !== null && _dynamicProps$fieldPr !== void 0 ? _dynamicProps$fieldPr : fieldProps(rowData, reactiveParams);
|
|
164
|
-
}
|
|
165
|
-
if ((0, _lodash.isFunction)(rules)) {
|
|
166
|
-
var _dynamicProps$rules;
|
|
167
|
-
_rules = (_dynamicProps$rules = dynamicProps.rules) !== null && _dynamicProps$rules !== void 0 ? _dynamicProps$rules : rules(rowData, reactiveParams);
|
|
168
|
-
}
|
|
169
|
-
if ((0, _lodash.isFunction)(valueType)) {
|
|
170
|
-
var _dynamicProps$valueTy;
|
|
171
|
-
_valueType = (_dynamicProps$valueTy = dynamicProps.valueType) !== null && _dynamicProps$valueTy !== void 0 ? _dynamicProps$valueTy : valueType(currentValue, rowData, {
|
|
172
|
-
index,
|
|
173
|
-
form,
|
|
174
|
-
namePath: [...namePath, index],
|
|
175
|
-
name: column === null || column === void 0 ? void 0 : column.name
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
if ((0, _lodash.isFunction)(desensitization)) {
|
|
179
|
-
var _dynamicProps$desensi;
|
|
180
|
-
_desensitization = (_dynamicProps$desensi = dynamicProps.desensitization) !== null && _dynamicProps$desensi !== void 0 ? _dynamicProps$desensi : desensitization(rowData, reactiveParams);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// 获取最终的disabled
|
|
184
|
-
_disabled = (0, _tools.getDisabled)({
|
|
185
|
-
globalControl: otherProps === null || otherProps === void 0 ? void 0 : otherProps.globalControl,
|
|
186
|
-
formDisabled: otherProps === null || otherProps === void 0 ? void 0 : otherProps.formDisabled,
|
|
187
|
-
column,
|
|
188
|
-
tabledDisabled: config === null || config === void 0 ? void 0 : config.disabled,
|
|
189
|
-
columnFieldProps: _fieldProps,
|
|
190
|
-
params: rowParams
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
// isEditable 处理 - 优先使用 hook 返回的值
|
|
194
|
-
if ((0, _lodash.isFunction)(isEditable)) {
|
|
195
|
-
var _dynamicProps$isEdita;
|
|
196
|
-
isEditable = (_dynamicProps$isEdita = dynamicProps.isEditable) !== null && _dynamicProps$isEdita !== void 0 ? _dynamicProps$isEdita : isEditable(rowData, reactiveParams);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// component 处理 - 优先使用 hook 返回的值
|
|
200
|
-
if ((0, _lodash.isFunction)(_component)) {
|
|
201
|
-
var _dynamicProps$compone;
|
|
202
|
-
_component = (_dynamicProps$compone = dynamicProps.component) !== null && _dynamicProps$compone !== void 0 ? _dynamicProps$compone : _component(rowData, reactiveParams);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// 更新 _editRender 为处理后的 _component
|
|
206
|
-
var _editRender = _component;
|
|
207
|
-
|
|
208
|
-
// 是否只读文本
|
|
209
|
-
var isView = !isEditable || (record === null || record === void 0 ? void 0 : record['is-view']) || config.isView || virtualKey && !_isEditing || (0, _tools.getDisabled)({
|
|
210
|
-
globalControl: otherProps === null || otherProps === void 0 ? void 0 : otherProps.globalControl,
|
|
211
|
-
formDisabled: otherProps === null || otherProps === void 0 ? void 0 : otherProps.formDisabled,
|
|
212
|
-
column,
|
|
213
|
-
tabledDisabled: config === null || config === void 0 ? void 0 : config.disabled,
|
|
214
|
-
columnFieldProps: _fieldProps,
|
|
215
|
-
params: rowParams,
|
|
216
|
-
rowDisabled: rowDisabled || 'empty'
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
// 只读文本时,采用当前formItem的name,单行编辑时,使用生成的虚拟的name
|
|
220
|
-
var baseName = isView ? name : namePath;
|
|
221
|
-
var TargetComponent;
|
|
222
|
-
|
|
223
|
-
// 将Hooks调用移到组件顶层
|
|
224
|
-
var proConfig = (0, _ProConfigProvider.useProConfig)();
|
|
225
|
-
|
|
226
|
-
// 设置校验规则 - 不在此处过滤 isView,由 getFieldItem 内根据 latestIsView 动态决定是否应用规则
|
|
227
|
-
var internalRule = (0, _useRules.default)({
|
|
228
|
-
names,
|
|
229
|
-
label: label,
|
|
230
|
-
labelRequired,
|
|
231
|
-
required: _required,
|
|
232
|
-
rules: _rules,
|
|
233
|
-
isSelect: (0, _utils2.isSelect)({
|
|
234
|
-
dataSource: (_fieldProps2 = _fieldProps) === null || _fieldProps2 === void 0 ? void 0 : _fieldProps2.dataSource,
|
|
235
|
-
type
|
|
236
|
-
}),
|
|
237
|
-
type
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
// 分离form item参数,防止对于参数透传(如onChange,防止重复触发)并优先级高于 _fieldProps 内部参数
|
|
241
|
-
var formItemChildProps = _objectSpread({}, _fieldProps);
|
|
242
|
-
|
|
243
|
-
// 使用useMemo优化defaultProps计算
|
|
244
|
-
var defaultProps = (0, _react.useMemo)(() => (0, _getDefaultProps.getDefaultProps)({
|
|
245
|
-
name,
|
|
246
|
-
namePath: formNamePath ? cellName.slice((formNamePath === null || formNamePath === void 0 ? void 0 : formNamePath.length) - 1) : cellName,
|
|
247
|
-
type: column === null || column === void 0 ? void 0 : column.type,
|
|
248
|
-
fieldProps: column === null || column === void 0 ? void 0 : column.fieldProps
|
|
249
|
-
}), [name, formNamePath, cellName, column === null || column === void 0 ? void 0 : column.type, column === null || column === void 0 ? void 0 : column.fieldProps]);
|
|
250
|
-
|
|
251
|
-
// 允许formItem的属性放在column最外层 - 使用useMemo优化(剔除会透传到 DOM 的字段)
|
|
252
|
-
var _formItemProps = (0, _react.useMemo)(() => _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, defaultProps), (0, _lodash.omit)(resetProps, OMIT_FORM_ITEM_AND_DOM_KEYS)), internalRule), {}, {
|
|
253
|
-
validateTrigger
|
|
254
|
-
// 注意:当 hasFunctionDependency 时会设置 shouldUpdate,shouldUpdate 与 dependencies 互斥,不透传 dependencies
|
|
255
|
-
}), [defaultProps, resetProps, internalRule, validateTrigger]);
|
|
256
|
-
|
|
257
|
-
// 当这些函数类型存在时,自动添加 shouldUpdate
|
|
258
|
-
// 因为这些函数依赖行数据,当行数据变化时需要重新计算
|
|
259
|
-
// 扩展到所有模式(single/multiple/cell),统一行为
|
|
260
|
-
// 注意:需要检查原始的 component/editRender,而不是处理后的 _component
|
|
261
|
-
var hasFunctionDependency = (0, _lodash.isFunction)(column === null || column === void 0 ? void 0 : column.disabled) ||
|
|
262
|
-
// disabled 是函数
|
|
263
|
-
(0, _lodash.isFunction)(fieldProps) ||
|
|
264
|
-
// fieldProps 是函数
|
|
265
|
-
(0, _lodash.isFunction)(required) ||
|
|
266
|
-
// required 是函数
|
|
267
|
-
(0, _lodash.isFunction)(rules) ||
|
|
268
|
-
// rules 是函数
|
|
269
|
-
(0, _lodash.isFunction)(column === null || column === void 0 ? void 0 : column.isEditable) ||
|
|
270
|
-
// isEditable 是函数
|
|
271
|
-
(0, _lodash.isFunction)(component) ||
|
|
272
|
-
// component 是函数
|
|
273
|
-
(0, _lodash.isFunction)(editRender) ||
|
|
274
|
-
// editRender 是函数
|
|
275
|
-
(0, _lodash.isFunction)(viewRender); // viewRender 是函数
|
|
276
|
-
|
|
277
|
-
// 移除 isSingleMode 限制,让所有模式都支持响应式更新
|
|
278
|
-
// 性能优化已通过 useShouldUpdateForTable hook 的缓存和防抖机制实现
|
|
279
|
-
if (hasFunctionDependency) {
|
|
280
|
-
// 使用 shouldUpdate 监听同一行的数据变化;shouldUpdate 与 dependencies 互斥,始终优先 shouldUpdate
|
|
281
|
-
_formItemProps.shouldUpdate = (prevValues, currentValues) => {
|
|
282
|
-
var prevRow = (0, _lodash.get)(prevValues, [...namePath, index]);
|
|
283
|
-
var currentRow = (0, _lodash.get)(currentValues, [...namePath, index]);
|
|
284
|
-
// 如果行数据发生变化,则重新渲染
|
|
285
|
-
return !(0, _lodash.isEqual)(prevRow, currentRow);
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
if (['Switch', 'SwitchCheckbox'].includes(type)) {
|
|
289
|
-
_formItemProps.valuePropName = 'checked';
|
|
290
|
-
_valueType = 'switch';
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* 针对一些特殊类型,基于formItem的normalize与getValueProps进行默认值类型转换
|
|
295
|
-
* @returns {}
|
|
296
|
-
*/
|
|
297
|
-
var defaultTransform = (0, _react.useCallback)(() => {
|
|
298
|
-
var types = ['DatePicker', 'RangePicker'];
|
|
299
|
-
if (!_valueType && types.includes(type)) {
|
|
300
|
-
var _transformMap$type;
|
|
301
|
-
return _transform.default === null || _transform.default === void 0 || (_transformMap$type = _transform.default[type]) === null || _transformMap$type === void 0 ? void 0 : _transformMap$type.call(_transform.default, _fieldProps || {});
|
|
302
|
-
}
|
|
303
|
-
return {};
|
|
304
|
-
}, [_valueType, type, _fieldProps]);
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* 配置valueType时,基于formItem的normalize与getValueProps进行值类型转换
|
|
308
|
-
* @returns {}
|
|
309
|
-
*/
|
|
310
|
-
var valueTypeTransform = (0, _react.useCallback)(() => {
|
|
311
|
-
var _fieldProps3;
|
|
312
|
-
// SwitchCheckbox默认YN, 兼容已有组件
|
|
313
|
-
if (type === 'SwitchCheckbox') {
|
|
314
|
-
_valueType = 'switch';
|
|
315
|
-
}
|
|
316
|
-
var params = _objectSpread(_objectSpread({}, column), {}, {
|
|
317
|
-
mode: (_fieldProps3 = _fieldProps) === null || _fieldProps3 === void 0 ? void 0 : _fieldProps3.mode
|
|
318
|
-
});
|
|
319
|
-
return (0, _lodash.isFunction)(_valueType2.default[_valueType]) ? _valueType2.default[_valueType](params) : {};
|
|
320
|
-
}, [type, _valueType, column, (_fieldProps4 = _fieldProps) === null || _fieldProps4 === void 0 ? void 0 : _fieldProps4.mode]);
|
|
321
|
-
if ((_names = names) !== null && _names !== void 0 && _names.length) {
|
|
322
|
-
// 支持names配置,临时生成对应的formItem,用来存储单个对应的值
|
|
323
|
-
names = names.map(key => {
|
|
324
|
-
if (Array.isArray(key)) {
|
|
325
|
-
return [...baseName, index, ...key];
|
|
326
|
-
}
|
|
327
|
-
return [...baseName, index, key];
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
var originalName = cellName;
|
|
331
|
-
var originalNames = names;
|
|
332
|
-
if (virtualKey) {
|
|
333
|
-
var _cellName$slice, _names2, _names2$map;
|
|
334
|
-
originalName = [...name, ...(cellName === null || cellName === void 0 || (_cellName$slice = cellName.slice) === null || _cellName$slice === void 0 ? void 0 : _cellName$slice.call(cellName, name.length))];
|
|
335
|
-
originalNames = (_names2 = names) === null || _names2 === void 0 || (_names2$map = _names2.map) === null || _names2$map === void 0 ? void 0 : _names2$map.call(_names2, item => {
|
|
336
|
-
var _item$slice;
|
|
337
|
-
return [...name, ...(item === null || item === void 0 || (_item$slice = item.slice) === null || _item$slice === void 0 ? void 0 : _item$slice.call(item, name.length))];
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* 配置names时,基于formItem的normalize与getValueProps进行值类型转换
|
|
343
|
-
* @returns {}
|
|
344
|
-
*/
|
|
345
|
-
var namesTransform = (0, _react.useCallback)(() => {
|
|
346
|
-
var _names3;
|
|
347
|
-
if (!((_names3 = names) !== null && _names3 !== void 0 && _names3.length)) {
|
|
348
|
-
return valueTypeTransform();
|
|
349
|
-
}
|
|
350
|
-
var namesStr = [...baseName, index, dataIndex];
|
|
351
|
-
return (0, _transformNames.default)(_objectSpread(_objectSpread({}, _formItemProps), valueTypeTransform()), form, names, namesStr, type);
|
|
352
|
-
}, [names, baseName, index, dataIndex, _formItemProps, type]);
|
|
353
|
-
if (!_editRender && typeof type === 'string') {
|
|
354
|
-
var _componentMap$type;
|
|
355
|
-
TargetComponent = (_componentMap$type = componentMap[type]) !== null && _componentMap$type !== void 0 ? _componentMap$type : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
|
|
356
|
-
}
|
|
357
|
-
if (isEditable && _isEditing) {
|
|
358
|
-
// _editRender 已经是处理后的值(通过 dynamicProps.component 或直接计算)
|
|
359
|
-
// 如果原本是函数,此时 _editRender 已经是执行后的 ReactNode
|
|
360
|
-
// 如果原本是 ReactElement,_editRender 就是 ReactElement
|
|
361
|
-
if ( /*#__PURE__*/_react.default.isValidElement(_editRender)) {
|
|
362
|
-
TargetComponent = _editRender;
|
|
363
|
-
} else if (_editRender) {
|
|
364
|
-
// 其他情况(可能是字符串或其他类型的 ReactNode)
|
|
365
|
-
TargetComponent = _editRender;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
// 查看模式
|
|
370
|
-
if (isView) {
|
|
371
|
-
// 存在viewRender覆盖默认值
|
|
372
|
-
if (typeof viewRender === 'function') {
|
|
373
|
-
var _column$dataIndex;
|
|
374
|
-
currentValue = column !== null && column !== void 0 && (_column$dataIndex = column.dataIndex) !== null && _column$dataIndex !== void 0 && _column$dataIndex.includes('-') ? value : currentValue;
|
|
375
|
-
var View = viewRender(currentValue, record || {}, options);
|
|
376
|
-
TargetComponent = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
|
377
|
-
viewEmpty: viewEmpty,
|
|
378
|
-
children: View
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
if ( /*#__PURE__*/_react.default.isValidElement(viewRender)) {
|
|
382
|
-
TargetComponent = viewRender;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
var onChange = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onChange;
|
|
386
|
-
var onFieldChange = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onFieldChange;
|
|
387
|
-
var onBlur = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onBlur;
|
|
388
|
-
|
|
389
|
-
// 使用useCallback优化formatArgs函数
|
|
390
|
-
var formatArgs = (0, _react.useCallback)(function () {
|
|
391
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
392
|
-
args[_key] = arguments[_key];
|
|
393
|
-
}
|
|
394
|
-
var rawArgs = (args === null || args === void 0 ? void 0 : args.length) === 1 && Array.isArray(args === null || args === void 0 ? void 0 : args[0]) ? args === null || args === void 0 ? void 0 : args[0] : args;
|
|
395
|
-
var nextArgs = [];
|
|
396
|
-
nextArgs[0] = rawArgs === null || rawArgs === void 0 ? void 0 : rawArgs[0];
|
|
397
|
-
// 返回表单元素默认值
|
|
398
|
-
nextArgs[2] = _objectSpread(_objectSpread({}, options), {}, {
|
|
399
|
-
extra: rawArgs
|
|
400
|
-
});
|
|
401
|
-
switch (type) {
|
|
402
|
-
case 'ProSelect':
|
|
403
|
-
case 'ProModalSelect':
|
|
404
|
-
case 'ProEnum':
|
|
405
|
-
nextArgs[2].option = rawArgs === null || rawArgs === void 0 ? void 0 : rawArgs[1];
|
|
406
|
-
break;
|
|
407
|
-
case 'ProCascader':
|
|
408
|
-
nextArgs[2].selectedOptions = rawArgs === null || rawArgs === void 0 ? void 0 : rawArgs[1];
|
|
409
|
-
break;
|
|
410
|
-
case 'DatePicker':
|
|
411
|
-
case 'RangePicker':
|
|
412
|
-
nextArgs[2].dateString = rawArgs === null || rawArgs === void 0 ? void 0 : rawArgs[1];
|
|
413
|
-
break;
|
|
414
|
-
default:
|
|
415
|
-
break;
|
|
416
|
-
}
|
|
417
|
-
return nextArgs;
|
|
418
|
-
}, [options, type]);
|
|
419
|
-
|
|
420
|
-
// 使用useCallback优化debounceValidate函数
|
|
421
|
-
var debounceValidate = (0, _react.useCallback)(function () {
|
|
422
|
-
var validateFieldKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
423
|
-
setTimeout(() => {
|
|
424
|
-
form.validateFields(validateFieldKeys, {
|
|
425
|
-
recursive: true
|
|
426
|
-
});
|
|
427
|
-
}, 100);
|
|
428
|
-
}, [form]);
|
|
429
|
-
|
|
430
|
-
// 使用 useRef 保存防抖函数
|
|
431
|
-
var debounceRef = (0, _react.useRef)(null);
|
|
432
|
-
|
|
433
|
-
// 使用 useCallback 创建稳定的 onChange 函数
|
|
434
|
-
var _onChange = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
435
|
-
var executeChange,
|
|
436
|
-
_args3 = arguments;
|
|
437
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
438
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
439
|
-
case 0:
|
|
440
|
-
executeChange = /*#__PURE__*/function () {
|
|
441
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
442
|
-
var _len2,
|
|
443
|
-
innerArgs,
|
|
444
|
-
_key2,
|
|
445
|
-
_args,
|
|
446
|
-
rowPath,
|
|
447
|
-
_dependencies$map,
|
|
448
|
-
validateFieldKeys,
|
|
449
|
-
row,
|
|
450
|
-
orgRow,
|
|
451
|
-
_TargetComponent,
|
|
452
|
-
_TargetComponent2,
|
|
453
|
-
rowAfter,
|
|
454
|
-
_Object$keys2,
|
|
455
|
-
_Object$keys2$map,
|
|
456
|
-
diff,
|
|
457
|
-
_validateFieldKeys2,
|
|
458
|
-
_args2 = arguments;
|
|
459
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
460
|
-
while (1) switch (_context.prev = _context.next) {
|
|
461
|
-
case 0:
|
|
462
|
-
for (_len2 = _args2.length, innerArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
463
|
-
innerArgs[_key2] = _args2[_key2];
|
|
464
|
-
}
|
|
465
|
-
_args = [...innerArgs];
|
|
466
|
-
rowPath = [...namePath, index];
|
|
467
|
-
if (!(!onFieldChange && !onChange)) {
|
|
468
|
-
_context.next = 6;
|
|
469
|
-
break;
|
|
470
|
-
}
|
|
471
|
-
if (dependencies !== null && dependencies !== void 0 && dependencies.length) {
|
|
472
|
-
validateFieldKeys = dependencies === null || dependencies === void 0 || (_dependencies$map = dependencies.map) === null || _dependencies$map === void 0 ? void 0 : _dependencies$map.call(dependencies, key => [...rowPath, key]);
|
|
473
|
-
setTimeout(() => {
|
|
474
|
-
form.validateFields(validateFieldKeys);
|
|
475
|
-
}, 100);
|
|
476
|
-
}
|
|
477
|
-
return _context.abrupt("return", null);
|
|
478
|
-
case 6:
|
|
479
|
-
row = form.getFieldValue(rowPath, true);
|
|
480
|
-
orgRow = (0, _lodash.cloneDeep)(row);
|
|
481
|
-
if (!onFieldChange) {
|
|
482
|
-
_context.next = 22;
|
|
483
|
-
break;
|
|
484
|
-
}
|
|
485
|
-
_args = formatArgs(innerArgs);
|
|
486
|
-
_args[1] = row;
|
|
487
|
-
_context.t0 = (_TargetComponent = TargetComponent) === null || _TargetComponent === void 0 || (_TargetComponent = _TargetComponent.props) === null || _TargetComponent === void 0 ? void 0 : _TargetComponent.onFieldChange;
|
|
488
|
-
if (!_context.t0) {
|
|
489
|
-
_context.next = 15;
|
|
490
|
-
break;
|
|
491
|
-
}
|
|
492
|
-
_context.next = 15;
|
|
493
|
-
return TargetComponent.props.onFieldChange(..._args);
|
|
494
|
-
case 15:
|
|
495
|
-
_context.t1 = onFieldChange;
|
|
496
|
-
if (!_context.t1) {
|
|
497
|
-
_context.next = 19;
|
|
498
|
-
break;
|
|
499
|
-
}
|
|
500
|
-
_context.next = 19;
|
|
501
|
-
return onFieldChange(..._args);
|
|
502
|
-
case 19:
|
|
503
|
-
// onFieldChange 内已通过 form.setFieldValue(子路径) 或原地改 record 更新 store;此处再整行 setFieldValue(rowPath, rowAfter) 易用滞后快照覆盖 Field 刚写入的新值(如 formType)。仅延后读表做校验与 forceUpdate,不再整行回写。
|
|
504
|
-
setTimeout(() => {
|
|
505
|
-
var _form$getFieldValue;
|
|
506
|
-
var rowAfter = (_form$getFieldValue = form.getFieldValue(rowPath, true)) !== null && _form$getFieldValue !== void 0 ? _form$getFieldValue : row;
|
|
507
|
-
if (validateTrigger && validateTrigger.includes('onChange')) {
|
|
508
|
-
if (!(0, _lodash.isEqual)(orgRow, rowAfter)) {
|
|
509
|
-
var _Object$keys, _Object$keys$map;
|
|
510
|
-
var diff = (0, _tools.difference)(rowAfter, orgRow) || {};
|
|
511
|
-
var _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, key => [...rowPath, key]).concat(dependencies || []);
|
|
512
|
-
if (_validateFieldKeys !== null && _validateFieldKeys !== void 0 && _validateFieldKeys.length) {
|
|
513
|
-
debounceValidate(_validateFieldKeys);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
if (!(0, _lodash.isEqual)(orgRow, rowAfter)) {
|
|
518
|
-
(0, _utils.compatStartTransition)(() => {
|
|
519
|
-
setState({
|
|
520
|
-
forceUpdate: {
|
|
521
|
-
rowKey: record === null || record === void 0 ? void 0 : record.rowKey
|
|
522
|
-
}
|
|
523
|
-
});
|
|
524
|
-
});
|
|
525
|
-
}
|
|
526
|
-
}, 0);
|
|
527
|
-
_context.next = 34;
|
|
528
|
-
break;
|
|
529
|
-
case 22:
|
|
530
|
-
_args = _args.concat([row, index, form]);
|
|
531
|
-
_context.t2 = (_TargetComponent2 = TargetComponent) === null || _TargetComponent2 === void 0 || (_TargetComponent2 = _TargetComponent2.props) === null || _TargetComponent2 === void 0 ? void 0 : _TargetComponent2.onChange;
|
|
532
|
-
if (!_context.t2) {
|
|
533
|
-
_context.next = 27;
|
|
534
|
-
break;
|
|
535
|
-
}
|
|
536
|
-
_context.next = 27;
|
|
537
|
-
return TargetComponent.props.onChange(..._args);
|
|
538
|
-
case 27:
|
|
539
|
-
_context.t3 = onChange;
|
|
540
|
-
if (!_context.t3) {
|
|
541
|
-
_context.next = 31;
|
|
542
|
-
break;
|
|
543
|
-
}
|
|
544
|
-
_context.next = 31;
|
|
545
|
-
return onChange(..._args);
|
|
546
|
-
case 31:
|
|
547
|
-
rowAfter = row;
|
|
548
|
-
form.setFieldValue(rowPath, rowAfter);
|
|
549
|
-
if (validateTrigger && validateTrigger.includes('onChange')) {
|
|
550
|
-
if (!(0, _lodash.isEqual)(orgRow, rowAfter)) {
|
|
551
|
-
diff = (0, _tools.difference)(rowAfter, orgRow) || {};
|
|
552
|
-
_validateFieldKeys2 = (_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, key => [...rowPath, key]).concat(dependencies || []);
|
|
553
|
-
if (_validateFieldKeys2 !== null && _validateFieldKeys2 !== void 0 && _validateFieldKeys2.length) {
|
|
554
|
-
debounceValidate(_validateFieldKeys2);
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
case 34:
|
|
559
|
-
case "end":
|
|
560
|
-
return _context.stop();
|
|
561
|
-
}
|
|
562
|
-
}, _callee);
|
|
563
|
-
}));
|
|
564
|
-
return function executeChange() {
|
|
565
|
-
return _ref3.apply(this, arguments);
|
|
566
|
-
};
|
|
567
|
-
}(); // onFieldChange 立即执行,不走防抖
|
|
568
|
-
// 表格行数据变化会导致组件卸载重建,防抖回调会在 cleanup 中被取消
|
|
569
|
-
if (!onFieldChange) {
|
|
570
|
-
_context2.next = 5;
|
|
571
|
-
break;
|
|
572
|
-
}
|
|
573
|
-
_context2.next = 4;
|
|
574
|
-
return executeChange(..._args3);
|
|
575
|
-
case 4:
|
|
576
|
-
return _context2.abrupt("return");
|
|
577
|
-
case 5:
|
|
578
|
-
// 没有 onFieldChange 时,使用防抖处理 onChange
|
|
579
|
-
if (!debounceRef.current) {
|
|
580
|
-
debounceRef.current = (0, _lodash.debounce)(executeChange, 300);
|
|
581
|
-
}
|
|
582
|
-
// 调用防抖函数
|
|
583
|
-
debounceRef.current(..._args3);
|
|
584
|
-
case 7:
|
|
585
|
-
case "end":
|
|
586
|
-
return _context2.stop();
|
|
587
|
-
}
|
|
588
|
-
}, _callee2);
|
|
589
|
-
})), [namePath, index, dependencies, formatArgs, onChange, onFieldChange, form, setState, TargetComponent, validateTrigger]);
|
|
590
|
-
|
|
591
|
-
// 在组件卸载时清理防抖函数
|
|
592
|
-
(0, _react.useEffect)(() => {
|
|
593
|
-
return () => {
|
|
594
|
-
if (debounceRef.current) {
|
|
595
|
-
debounceRef.current.cancel();
|
|
596
|
-
}
|
|
597
|
-
};
|
|
598
|
-
}, []);
|
|
599
|
-
|
|
600
|
-
// 使用useCallback优化_onblur函数
|
|
601
|
-
var _onblur = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
602
|
-
var _TargetComponent3;
|
|
603
|
-
var _args,
|
|
604
|
-
rowPath,
|
|
605
|
-
row,
|
|
606
|
-
orgRow,
|
|
607
|
-
_Object$keys3,
|
|
608
|
-
_Object$keys3$map,
|
|
609
|
-
diff,
|
|
610
|
-
validateFieldKeys,
|
|
611
|
-
_args4 = arguments;
|
|
612
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
613
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
614
|
-
case 0:
|
|
615
|
-
if (onBlur) {
|
|
616
|
-
_context3.next = 2;
|
|
617
|
-
break;
|
|
618
|
-
}
|
|
619
|
-
return _context3.abrupt("return", null);
|
|
620
|
-
case 2:
|
|
621
|
-
_args = formatArgs(..._args4);
|
|
622
|
-
rowPath = [...namePath, index];
|
|
623
|
-
row = form.getFieldValue(rowPath, true);
|
|
624
|
-
orgRow = (0, _lodash.cloneDeep)(row);
|
|
625
|
-
_args[1] = row;
|
|
626
|
-
_context3.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 || (_TargetComponent3 = _TargetComponent3.props) === null || _TargetComponent3 === void 0 ? void 0 : _TargetComponent3.onBlur;
|
|
627
|
-
if (!_context3.t0) {
|
|
628
|
-
_context3.next = 11;
|
|
629
|
-
break;
|
|
630
|
-
}
|
|
631
|
-
_context3.next = 11;
|
|
632
|
-
return TargetComponent.props.onBlur(..._args);
|
|
633
|
-
case 11:
|
|
634
|
-
_context3.t1 = onBlur;
|
|
635
|
-
if (!_context3.t1) {
|
|
636
|
-
_context3.next = 15;
|
|
637
|
-
break;
|
|
638
|
-
}
|
|
639
|
-
_context3.next = 15;
|
|
640
|
-
return onBlur(..._args);
|
|
641
|
-
case 15:
|
|
642
|
-
// 判断属性是否变动
|
|
643
|
-
form.setFieldValue(rowPath, row);
|
|
644
|
-
if (validateTrigger && validateTrigger.includes('onBlur')) {
|
|
645
|
-
if (!(0, _lodash.isEqual)(orgRow, row)) {
|
|
646
|
-
diff = (0, _tools.difference)(row, orgRow) || {};
|
|
647
|
-
validateFieldKeys = (_Object$keys3 = Object.keys(diff)) === null || _Object$keys3 === void 0 || (_Object$keys3$map = _Object$keys3.map) === null || _Object$keys3$map === void 0 ? void 0 : _Object$keys3$map.call(_Object$keys3, key => [...rowPath, key]).concat(dependencies || []);
|
|
648
|
-
if (validateFieldKeys !== null && validateFieldKeys !== void 0 && validateFieldKeys.length) {
|
|
649
|
-
debounceValidate(validateFieldKeys);
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
if (!isCell) {
|
|
654
|
-
_context3.next = 21;
|
|
655
|
-
break;
|
|
656
|
-
}
|
|
657
|
-
_context3.next = 20;
|
|
658
|
-
return form.validateFields([cellName]);
|
|
659
|
-
case 20:
|
|
660
|
-
setState({
|
|
661
|
-
cellNamePath: []
|
|
662
|
-
});
|
|
663
|
-
case 21:
|
|
664
|
-
// 单行编辑时需要 强制更新视图,仅对当前行打标记
|
|
665
|
-
(0, _utils.compatStartTransition)(() => {
|
|
666
|
-
setState({
|
|
667
|
-
forceUpdate: {
|
|
668
|
-
rowKey: record === null || record === void 0 ? void 0 : record.rowKey
|
|
669
|
-
}
|
|
670
|
-
});
|
|
671
|
-
});
|
|
672
|
-
case 22:
|
|
673
|
-
case "end":
|
|
674
|
-
return _context3.stop();
|
|
675
|
-
}
|
|
676
|
-
}, _callee3);
|
|
677
|
-
})), [onBlur, formatArgs, namePath, index, form, TargetComponent, validateTrigger, debounceValidate, isCell, cellName, setState]);
|
|
678
|
-
|
|
679
|
-
// 使用useMemo优化componentProps对象
|
|
680
|
-
var componentProps = (0, _react.useMemo)(() => {
|
|
681
|
-
var _TargetComponent4;
|
|
682
|
-
return _objectSpread(_objectSpread(_objectSpread({
|
|
683
|
-
form,
|
|
684
|
-
name: cellName
|
|
685
|
-
}, _fieldProps), (_TargetComponent4 = TargetComponent) === null || _TargetComponent4 === void 0 ? void 0 : _TargetComponent4.props), {}, {
|
|
686
|
-
namePath: [...namePath, index],
|
|
687
|
-
disabled: _disabled,
|
|
688
|
-
onChange: _onChange,
|
|
689
|
-
onBlur: _onblur,
|
|
690
|
-
index,
|
|
691
|
-
confirm,
|
|
692
|
-
desensitization: _desensitization,
|
|
693
|
-
otherProps: {
|
|
694
|
-
form,
|
|
695
|
-
names,
|
|
696
|
-
namePath: [...namePath, index],
|
|
697
|
-
name: originalName,
|
|
698
|
-
listName: cellName,
|
|
699
|
-
// 用于下拉框去重消费,保持和formlist一致
|
|
700
|
-
viewEmpty,
|
|
701
|
-
valueType: _valueType,
|
|
702
|
-
isView,
|
|
703
|
-
desensitizationKey: otherProps === null || otherProps === void 0 ? void 0 : otherProps.desensitizationKey,
|
|
704
|
-
source: 'ProEditTable'
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
}, [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]);
|
|
708
|
-
componentProps = (0, _lodash.omit)(componentProps, ['onFieldChange', 'namePath', 'index', ...OMIT_FORM_ITEM_AND_DOM_KEYS]);
|
|
709
|
-
|
|
710
|
-
// 单元格编辑时,设置各个单元格disabled属性
|
|
711
|
-
if (isCell) {
|
|
712
|
-
record[`${dataIndex}-Disabled`] = _disabled;
|
|
713
|
-
}
|
|
714
|
-
if (['Switch', 'SwitchCheckbox'].includes(type)) {
|
|
715
|
-
_formItemProps.valuePropName = 'checked';
|
|
716
|
-
}
|
|
717
|
-
(0, _react.useEffect)(() => {
|
|
718
|
-
if (isCell) {
|
|
719
|
-
var _editingDom$focus;
|
|
720
|
-
var editingDom = document.getElementById(cellNamePath.join('_'));
|
|
721
|
-
editingDom === null || editingDom === void 0 || (_editingDom$focus = editingDom.focus) === null || _editingDom$focus === void 0 || _editingDom$focus.call(editingDom);
|
|
722
|
-
}
|
|
723
|
-
}, [cellNamePath, isCell]);
|
|
724
|
-
|
|
725
|
-
// 可编辑表格默认关闭scrollFollowParent
|
|
726
|
-
if (['Select', 'ProSelect', 'ProEnum'].includes(type)) {
|
|
727
|
-
componentProps.scrollFollowParent = false;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
// 使用useMemo优化最终的formItemProps - 修复Hooks使用规则
|
|
731
|
-
var finalFormItemProps = (0, _react.useMemo)(() => {
|
|
732
|
-
var _namesTransformProps$, _namesTransformProps$2;
|
|
733
|
-
var defaultTransformProps = defaultTransform();
|
|
734
|
-
var namesTransformProps = namesTransform();
|
|
735
|
-
var trimProps = (0, _utils2.isTrim)(type, trim, proConfig); // 使用顶层调用的proConfig
|
|
736
|
-
|
|
737
|
-
var transformNormalize = (_namesTransformProps$ = namesTransformProps === null || namesTransformProps === void 0 ? void 0 : namesTransformProps.normalize) !== null && _namesTransformProps$ !== void 0 ? _namesTransformProps$ : defaultTransformProps === null || defaultTransformProps === void 0 ? void 0 : defaultTransformProps.normalize;
|
|
738
|
-
var userNormalize = _formItemProps === null || _formItemProps === void 0 ? void 0 : _formItemProps.normalize;
|
|
739
|
-
var transformGetValueProps = (_namesTransformProps$2 = namesTransformProps === null || namesTransformProps === void 0 ? void 0 : namesTransformProps.getValueProps) !== null && _namesTransformProps$2 !== void 0 ? _namesTransformProps$2 : defaultTransformProps === null || defaultTransformProps === void 0 ? void 0 : defaultTransformProps.getValueProps;
|
|
740
|
-
var userGetValueProps = _formItemProps === null || _formItemProps === void 0 ? void 0 : _formItemProps.getValueProps;
|
|
741
|
-
var finalNormalize = transformNormalize && userNormalize ? (value, prevValue, allValues, isDiffMode) => {
|
|
742
|
-
// 用户 normalize 需要拿到组件原始值(如 DatePicker 的 dayjs)
|
|
743
|
-
var userValue = userNormalize(value, prevValue, allValues, isDiffMode);
|
|
744
|
-
// 保持用户优先:用户有明确返回值时直接使用,不再强制走内置转换
|
|
745
|
-
if (userValue !== undefined) {
|
|
746
|
-
return userValue;
|
|
747
|
-
}
|
|
748
|
-
// 仅在用户未返回时,回退到内置 transform 逻辑
|
|
749
|
-
return transformNormalize(value, prevValue, allValues, isDiffMode);
|
|
750
|
-
} : userNormalize || transformNormalize;
|
|
751
|
-
var finalGetValueProps = transformGetValueProps && userGetValueProps ? function (value) {
|
|
752
|
-
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
753
|
-
args[_key3 - 1] = arguments[_key3];
|
|
754
|
-
}
|
|
755
|
-
var transformValueProps = transformGetValueProps(value, ...args) || {};
|
|
756
|
-
var nextValue = Object.prototype.hasOwnProperty.call(transformValueProps, 'value') ? transformValueProps.value : value;
|
|
757
|
-
var userValueProps = userGetValueProps(nextValue, ...args) || {};
|
|
758
|
-
return _objectSpread(_objectSpread({}, transformValueProps), userValueProps);
|
|
759
|
-
} : userGetValueProps || transformGetValueProps;
|
|
760
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _formItemProps), defaultTransformProps), namesTransformProps), trimProps), {}, {
|
|
761
|
-
normalize: finalNormalize,
|
|
762
|
-
getValueProps: finalGetValueProps
|
|
763
|
-
});
|
|
764
|
-
}, [_formItemProps, defaultTransform, namesTransform, type, trim, proConfig]);
|
|
765
|
-
|
|
766
|
-
// rules 的 isView 过滤已移至 getFieldItem 内处理(支持 shouldUpdate 模式下的动态 isEditable)
|
|
767
|
-
|
|
768
|
-
var _className = (0, _react.useMemo)(() => (0, _classnames.default)({
|
|
769
|
-
[className]: className
|
|
770
|
-
}), [className]);
|
|
771
|
-
|
|
772
|
-
// 使用useCallback优化getFieldItem函数
|
|
773
|
-
var getFieldItem = function getFieldItem() {
|
|
774
|
-
var _finalComponentProps;
|
|
775
|
-
var shouldUpdateMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
776
|
-
// 如果处于 shouldUpdate 模式,需要重新获取最新的行数据并重新计算依赖值
|
|
777
|
-
var finalComponentProps = componentProps;
|
|
778
|
-
// shouldUpdate 模式下会被更新为最新值,供外层 FieldProvider 消费
|
|
779
|
-
var latestIsView = isView;
|
|
780
|
-
// 用于在 shouldUpdate 模式下重建正确的 Form.Item rules(外层 finalFormItemProps 是旧闭包)
|
|
781
|
-
var effectiveRequired = _required;
|
|
782
|
-
var effectiveRules = _rules;
|
|
783
|
-
var effectiveFieldProps = _fieldProps;
|
|
784
|
-
if (shouldUpdateMode) {
|
|
785
|
-
var _column$isEditable2;
|
|
786
|
-
// 重新获取最新的行数据(shouldUpdate 触发时,通过 getFieldValue 拿到最新值)
|
|
787
|
-
var latestRowData = form.getFieldValue([...namePath, index]) || record || {};
|
|
788
|
-
var latestReactiveParams = {
|
|
789
|
-
form,
|
|
790
|
-
index,
|
|
791
|
-
namePath: [...namePath, index]
|
|
792
|
-
};
|
|
793
|
-
var latestRowParams = [latestRowData, latestReactiveParams];
|
|
794
|
-
|
|
795
|
-
// ⭐ 关键修改:shouldUpdate 模式下,跳过缓存,直接重新计算所有响应式属性
|
|
796
|
-
var latestFieldProps = fieldProps || formItemProps || {};
|
|
797
|
-
if ((0, _lodash.isFunction)(fieldProps)) {
|
|
798
|
-
latestFieldProps = fieldProps(latestRowData, latestReactiveParams);
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
// 重新计算 required(用于可能的后续逻辑)
|
|
802
|
-
var latestRequired = required;
|
|
803
|
-
if ((0, _lodash.isFunction)(required)) {
|
|
804
|
-
latestRequired = required(latestRowData, latestReactiveParams);
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
// 重新计算 rules(用于可能的后续逻辑)
|
|
808
|
-
var latestRules = rules;
|
|
809
|
-
if ((0, _lodash.isFunction)(rules)) {
|
|
810
|
-
latestRules = rules(latestRowData, latestReactiveParams);
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
// 同步到外层变量,用于后续构建 activeFinalFormItemProps
|
|
814
|
-
effectiveRequired = latestRequired;
|
|
815
|
-
effectiveRules = latestRules;
|
|
816
|
-
effectiveFieldProps = latestFieldProps;
|
|
817
|
-
|
|
818
|
-
// 重新计算 desensitization
|
|
819
|
-
var latestDesensitization = desensitization || [];
|
|
820
|
-
if ((0, _lodash.isFunction)(desensitization)) {
|
|
821
|
-
latestDesensitization = desensitization(latestRowData, latestReactiveParams);
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
// 重新计算 component
|
|
825
|
-
var latestComponent = component || editRender;
|
|
826
|
-
if ((0, _lodash.isFunction)(latestComponent)) {
|
|
827
|
-
latestComponent = latestComponent(latestRowData, latestReactiveParams);
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
// 重新计算 isEditable(使用原始的 column.isEditable,而不是处理后的 isEditable)
|
|
831
|
-
var latestIsEditable = (_column$isEditable2 = column.isEditable) !== null && _column$isEditable2 !== void 0 ? _column$isEditable2 : true;
|
|
832
|
-
if ((0, _lodash.isFunction)(column.isEditable)) {
|
|
833
|
-
latestIsEditable = column.isEditable(latestRowData, latestReactiveParams);
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
// 重新计算 disabled
|
|
837
|
-
var latestDisabled = (0, _tools.getDisabled)({
|
|
838
|
-
globalControl: otherProps === null || otherProps === void 0 ? void 0 : otherProps.globalControl,
|
|
839
|
-
formDisabled: otherProps === null || otherProps === void 0 ? void 0 : otherProps.formDisabled,
|
|
840
|
-
column,
|
|
841
|
-
tabledDisabled: config === null || config === void 0 ? void 0 : config.disabled,
|
|
842
|
-
columnFieldProps: latestFieldProps,
|
|
843
|
-
params: latestRowParams
|
|
844
|
-
});
|
|
845
|
-
|
|
846
|
-
// 更新 componentProps 中的所有响应式属性
|
|
847
|
-
// latestTargetComponent 稍后计算,此处先占位;最终 finalComponentProps 会在下方合并 latestTargetComponent?.props
|
|
848
|
-
finalComponentProps = _objectSpread(_objectSpread(_objectSpread({}, componentProps), latestFieldProps), {}, {
|
|
849
|
-
disabled: latestDisabled,
|
|
850
|
-
desensitization: latestDesensitization,
|
|
851
|
-
// shouldUpdate 模式下,确保事件包装函数不被 fieldProps 覆盖
|
|
852
|
-
onChange: _onChange,
|
|
853
|
-
onBlur: _onblur
|
|
854
|
-
});
|
|
855
|
-
|
|
856
|
-
// ⭐ 关键修改:在 shouldUpdate 模式下,需要重新设置 TargetComponent
|
|
857
|
-
// 因为 component 函数可能返回不同的结果
|
|
858
|
-
var latestTargetComponent = TargetComponent;
|
|
859
|
-
|
|
860
|
-
// 首先检查是否有内置type
|
|
861
|
-
if (!latestComponent && typeof type === 'string') {
|
|
862
|
-
var _componentMap$type2;
|
|
863
|
-
latestTargetComponent = (_componentMap$type2 = componentMap[type]) !== null && _componentMap$type2 !== void 0 ? _componentMap$type2 : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
// 然后处理自定义 component
|
|
867
|
-
latestIsView = !latestIsEditable || (record === null || record === void 0 ? void 0 : record['is-view']) || config.isView || virtualKey && !_isEditing || (0, _tools.getDisabled)({
|
|
868
|
-
globalControl: otherProps === null || otherProps === void 0 ? void 0 : otherProps.globalControl,
|
|
869
|
-
formDisabled: otherProps === null || otherProps === void 0 ? void 0 : otherProps.formDisabled,
|
|
870
|
-
column,
|
|
871
|
-
tabledDisabled: config === null || config === void 0 ? void 0 : config.disabled,
|
|
872
|
-
columnFieldProps: latestFieldProps,
|
|
873
|
-
params: latestRowParams,
|
|
874
|
-
rowDisabled: rowDisabled || 'empty'
|
|
875
|
-
});
|
|
876
|
-
if (latestIsEditable && _isEditing) {
|
|
877
|
-
if ( /*#__PURE__*/_react.default.isValidElement(latestComponent)) {
|
|
878
|
-
latestTargetComponent = latestComponent;
|
|
879
|
-
} else if (latestComponent) {
|
|
880
|
-
latestTargetComponent = latestComponent;
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
// 查看模式
|
|
885
|
-
if (latestIsView) {
|
|
886
|
-
if (typeof viewRender === 'function') {
|
|
887
|
-
var latestCurrentValue = dataIndex ? latestRowData === null || latestRowData === void 0 ? void 0 : latestRowData[dataIndex] : null;
|
|
888
|
-
var _View = viewRender(latestCurrentValue, latestRowData || {}, options);
|
|
889
|
-
latestTargetComponent = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
|
890
|
-
viewEmpty: viewEmpty,
|
|
891
|
-
children: _View
|
|
892
|
-
});
|
|
893
|
-
}
|
|
894
|
-
if ( /*#__PURE__*/_react.default.isValidElement(viewRender)) {
|
|
895
|
-
latestTargetComponent = viewRender;
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
// 使用重新计算的 TargetComponent
|
|
900
|
-
TargetComponent = latestTargetComponent;
|
|
901
|
-
|
|
902
|
-
// shouldUpdate 触发时外层 componentProps.otherProps.isView 是旧快照,需用最新值覆盖
|
|
903
|
-
finalComponentProps = _objectSpread(_objectSpread({}, finalComponentProps), {}, {
|
|
904
|
-
otherProps: _objectSpread(_objectSpread({}, finalComponentProps.otherProps), {}, {
|
|
905
|
-
isView: latestIsView
|
|
906
|
-
})
|
|
907
|
-
});
|
|
908
|
-
|
|
909
|
-
// componentProps 里展开了外层旧 TargetComponent?.props(如 { formType: "Input" }),
|
|
910
|
-
// 用 latestTargetComponent?.props 覆盖,确保不会被旧 cloneElement props 污染
|
|
911
|
-
if ( /*#__PURE__*/_react.default.isValidElement(latestTargetComponent)) {
|
|
912
|
-
var _componentProps = latestTargetComponent.props;
|
|
913
|
-
// 确保 props 是对象类型才进行展开
|
|
914
|
-
if (_componentProps && typeof _componentProps === 'object') {
|
|
915
|
-
finalComponentProps = _objectSpread(_objectSpread(_objectSpread({}, finalComponentProps), _componentProps), {}, {
|
|
916
|
-
// 始终保证事件处理函数不被覆盖
|
|
917
|
-
onChange: _onChange,
|
|
918
|
-
onBlur: _onblur
|
|
919
|
-
});
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
// 根据 latestIsView 和最新的 required/rules 构建正确的 Form.Item props
|
|
925
|
-
// 解决 shouldUpdate 触发时外层 finalFormItemProps 是旧闭包(rules 基于旧 isView 计算)的问题
|
|
926
|
-
var activeFinalFormItemProps = finalFormItemProps;
|
|
927
|
-
if (latestIsView) {
|
|
928
|
-
// 查看模式:移除 rules 不做校验
|
|
929
|
-
activeFinalFormItemProps = (0, _lodash.omit)(finalFormItemProps, ['rules']);
|
|
930
|
-
} else if (shouldUpdateMode) {
|
|
931
|
-
// shouldUpdate 模式下 finalFormItemProps 是旧闭包,需用最新 effectiveRequired/effectiveRules 重建 rules
|
|
932
|
-
var activeRules = Array.isArray(effectiveRules) ? [...effectiveRules] : [];
|
|
933
|
-
var hasRequiredRule = activeRules.some(r => (r === null || r === void 0 ? void 0 : r.required) === true);
|
|
934
|
-
if (effectiveRequired && !hasRequiredRule) {
|
|
935
|
-
var _effectiveFieldProps;
|
|
936
|
-
var _isSelectVal = (0, _utils2.isSelect)({
|
|
937
|
-
dataSource: (_effectiveFieldProps = effectiveFieldProps) === null || _effectiveFieldProps === void 0 ? void 0 : _effectiveFieldProps.dataSource,
|
|
938
|
-
type
|
|
939
|
-
});
|
|
940
|
-
activeRules.push({
|
|
941
|
-
required: true,
|
|
942
|
-
message: `${_isSelectVal ? _locale.default.ProForm.selectPlaceHolder : _locale.default.ProForm.inputPlaceholder}${label || ''}`
|
|
943
|
-
});
|
|
944
|
-
}
|
|
945
|
-
activeFinalFormItemProps = _objectSpread(_objectSpread({}, finalFormItemProps), {}, {
|
|
946
|
-
rules: activeRules.length > 0 ? activeRules : [{
|
|
947
|
-
required: false
|
|
948
|
-
}]
|
|
949
|
-
});
|
|
950
|
-
}
|
|
951
|
-
var FormItem = null;
|
|
952
|
-
// 当 viewRender 存在时,需要排除 finalComponentProps 中的 children,避免覆盖 Container 的 children
|
|
953
|
-
var propsForTarget = isView && typeof viewRender === 'function' ? (0, _lodash.omit)(finalComponentProps, ['children']) : finalComponentProps;
|
|
954
|
-
// 当目标为原生 DOM 元素(如 viewRender 返回 <div>)时,剔除 disabled、toCSTString 等,避免 React 警告
|
|
955
|
-
var isTargetDomElement = /*#__PURE__*/_react.default.isValidElement(TargetComponent) && typeof TargetComponent.type === 'string';
|
|
956
|
-
if (isTargetDomElement) {
|
|
957
|
-
propsForTarget = (0, _lodash.omit)(propsForTarget, ['disabled', ...OMIT_FORM_ITEM_AND_DOM_KEYS]);
|
|
958
|
-
}
|
|
959
|
-
// 当 TargetComponent 未定义时,使用空的占位组件避免渲染错误
|
|
960
|
-
var FieldComponent = null;
|
|
961
|
-
if ( /*#__PURE__*/_react.default.isValidElement(TargetComponent)) {
|
|
962
|
-
FieldComponent = /*#__PURE__*/_react.default.cloneElement(TargetComponent, propsForTarget);
|
|
963
|
-
} else if (TargetComponent) {
|
|
964
|
-
FieldComponent = /*#__PURE__*/(0, _jsxRuntime.jsx)(TargetComponent, _objectSpread({}, propsForTarget));
|
|
965
|
-
} else {
|
|
966
|
-
FieldComponent = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
|
|
967
|
-
}
|
|
968
|
-
if (originalValues && !getIsNew(record)) {
|
|
969
|
-
FieldComponent = /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListChangedWrapper.default, {
|
|
970
|
-
name: cellName,
|
|
971
|
-
names: names,
|
|
972
|
-
namesStr: [...baseName, index, dataIndex],
|
|
973
|
-
rowKeyPath: [...baseName, index, 'rowKey'],
|
|
974
|
-
originalName: originalName,
|
|
975
|
-
originalNames: originalNames,
|
|
976
|
-
originalValues: originalValues,
|
|
977
|
-
form: form,
|
|
978
|
-
onDiff: onDiff,
|
|
979
|
-
type: type,
|
|
980
|
-
onChange: _onChange,
|
|
981
|
-
onBlur: _onblur,
|
|
982
|
-
valuePropName: finalFormItemProps.valuePropName,
|
|
983
|
-
normalize: finalFormItemProps.normalize,
|
|
984
|
-
getValueProps: finalFormItemProps.getValueProps,
|
|
985
|
-
viewRender: viewRender,
|
|
986
|
-
diffConfig: diffConfig,
|
|
987
|
-
index: index,
|
|
988
|
-
children: FieldComponent
|
|
989
|
-
});
|
|
990
|
-
}
|
|
991
|
-
if ((_finalComponentProps = finalComponentProps) !== null && _finalComponentProps !== void 0 && _finalComponentProps.confirm) {
|
|
992
|
-
FieldComponent = /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConfirmWrapper.default, _objectSpread(_objectSpread({}, finalComponentProps), {}, {
|
|
993
|
-
children: FieldComponent
|
|
994
|
-
}));
|
|
995
|
-
}
|
|
996
|
-
FormItem = TargetComponent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, _objectSpread(_objectSpread({
|
|
997
|
-
validateFirst: true
|
|
998
|
-
}, (0, _lodash.omit)(activeFinalFormItemProps, ['render', 'key', 'width', 'hiddenNames', 'name', 'onCell', 'disabled', _formItemProps.shouldUpdate ? 'shouldUpdate' : null])), {}, {
|
|
999
|
-
// 移除非必要字段,但保留 dependencies
|
|
1000
|
-
className: _className,
|
|
1001
|
-
name: formNamePath ? cellName.slice((formNamePath === null || formNamePath === void 0 ? void 0 : formNamePath.length) - 1) : cellName,
|
|
1002
|
-
children: FieldComponent
|
|
1003
|
-
})) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
|
1004
|
-
viewEmpty: viewEmpty
|
|
1005
|
-
});
|
|
1006
|
-
if (type === 'FormList') {
|
|
1007
|
-
FormItem = /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.List, _objectSpread(_objectSpread({
|
|
1008
|
-
name: formNamePath ? cellName.slice((formNamePath === null || formNamePath === void 0 ? void 0 : formNamePath.length) - 1) : cellName
|
|
1009
|
-
}, (0, _lodash.omit)(activeFinalFormItemProps, ['render', 'key', 'width', 'hiddenNames', 'name'])), {}, {
|
|
1010
|
-
children: (fields, operation, meta) => /*#__PURE__*/(0, _jsxRuntime.jsx)(TargetComponent, _objectSpread(_objectSpread({}, finalComponentProps), {}, {
|
|
1011
|
-
otherProps: otherProps,
|
|
1012
|
-
fields: fields,
|
|
1013
|
-
operation: operation,
|
|
1014
|
-
meta: meta
|
|
1015
|
-
}))
|
|
1016
|
-
}));
|
|
1017
|
-
}
|
|
1018
|
-
// shouldUpdateMode 返回元组,将 latestIsView 暴露给外层用于更新 FieldProvider context
|
|
1019
|
-
return shouldUpdateMode ? [FormItem, latestIsView] : FormItem;
|
|
1020
|
-
};
|
|
1021
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
1022
|
-
children: finalFormItemProps.shouldUpdate ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
1023
|
-
noStyle: true,
|
|
1024
|
-
shouldUpdate: finalFormItemProps.shouldUpdate,
|
|
1025
|
-
children: () => {
|
|
1026
|
-
var _componentProps2;
|
|
1027
|
-
// shouldUpdate 触发时外层组件可能因 memo 未重渲染,FieldProvider context 是旧快照
|
|
1028
|
-
// 从 getFieldItem(true) 的元组返回值获取 latestIsView,更新 context 确保 Input 组件读到最新 isView
|
|
1029
|
-
var _ref5 = getFieldItem(true),
|
|
1030
|
-
_ref6 = _slicedToArray(_ref5, 2),
|
|
1031
|
-
formItem = _ref6[0],
|
|
1032
|
-
latestIsView = _ref6[1];
|
|
1033
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
1034
|
-
value: _objectSpread(_objectSpread({}, (_componentProps2 = componentProps) === null || _componentProps2 === void 0 ? void 0 : _componentProps2.otherProps), {}, {
|
|
1035
|
-
isView: latestIsView
|
|
1036
|
-
}),
|
|
1037
|
-
children: formItem
|
|
1038
|
-
});
|
|
1039
|
-
}
|
|
1040
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
1041
|
-
value: ((_componentProps3 = componentProps) === null || _componentProps3 === void 0 ? void 0 : _componentProps3.otherProps) || {},
|
|
1042
|
-
children: getFieldItem()
|
|
1043
|
-
})
|
|
1044
|
-
});
|
|
1045
|
-
};
|
|
1046
|
-
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(RenderField, (prevProps, nextProps) => {
|
|
1047
|
-
// 自定义比较函数,只有关键props变化时才重新渲染
|
|
1048
|
-
var prevText = prevProps.text,
|
|
1049
|
-
prevRecord = prevProps.record,
|
|
1050
|
-
prevIndex = prevProps.index,
|
|
1051
|
-
prevColumn = prevProps.column,
|
|
1052
|
-
prevConfig = prevProps.config;
|
|
1053
|
-
var nextText = nextProps.text,
|
|
1054
|
-
nextRecord = nextProps.record,
|
|
1055
|
-
nextIndex = nextProps.index,
|
|
1056
|
-
nextColumn = nextProps.column,
|
|
1057
|
-
nextConfig = nextProps.config;
|
|
1058
|
-
|
|
1059
|
-
// 自定义 component/editRender 且行对象为同引用时,浅比较无法区分原地修改,需强制重渲染
|
|
1060
|
-
var hasFunctionComponent = (0, _lodash.isFunction)(prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.component) || (0, _lodash.isFunction)(prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.editRender) || (0, _lodash.isFunction)(nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.component) || (0, _lodash.isFunction)(nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.editRender);
|
|
1061
|
-
if (hasFunctionComponent && prevRecord === nextRecord) {
|
|
1062
|
-
return false;
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
// 构建新的参数格式(与 ProForm 保持一致)
|
|
1066
|
-
var prevNamePath = (0, _tools.getNamePath)(prevConfig === null || prevConfig === void 0 ? void 0 : prevConfig.name, prevConfig === null || prevConfig === void 0 ? void 0 : prevConfig.virtualKey);
|
|
1067
|
-
var nextNamePath = (0, _tools.getNamePath)(nextConfig === null || nextConfig === void 0 ? void 0 : nextConfig.name, nextConfig === null || nextConfig === void 0 ? void 0 : nextConfig.virtualKey);
|
|
1068
|
-
var prevReactiveParams = {
|
|
1069
|
-
form: prevConfig === null || prevConfig === void 0 ? void 0 : prevConfig.form,
|
|
1070
|
-
index: prevIndex,
|
|
1071
|
-
namePath: [...prevNamePath, prevIndex]
|
|
1072
|
-
};
|
|
1073
|
-
var nextReactiveParams = {
|
|
1074
|
-
form: nextConfig === null || nextConfig === void 0 ? void 0 : nextConfig.form,
|
|
1075
|
-
index: nextIndex,
|
|
1076
|
-
namePath: [...nextNamePath, nextIndex]
|
|
1077
|
-
};
|
|
1078
|
-
var prevRowParams = [prevRecord, prevReactiveParams];
|
|
1079
|
-
var nextRowParams = [nextRecord, nextReactiveParams];
|
|
1080
|
-
if ((0, _lodash.isFunction)(prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.disabled) && (0, _lodash.isFunction)(nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.disabled)) {
|
|
1081
|
-
if ((prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.disabled(prevRecord, prevReactiveParams)) !== (nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.disabled(nextRecord, nextReactiveParams))) {
|
|
1082
|
-
return false;
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
// fieldProps 函数化直接更新,无法比对返回值是否一致
|
|
1087
|
-
// 优化:不直接调用函数,而是比较输入参数(record 和 reactiveParams)
|
|
1088
|
-
// 如果输入参数相同,fieldProps 的返回值应该相同(纯函数假设)
|
|
1089
|
-
if ((0, _lodash.isFunction)(prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.fieldProps) && (0, _lodash.isFunction)(nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.fieldProps)) {
|
|
1090
|
-
// 比较 record 数据是否变化
|
|
1091
|
-
if (!(0, _lodash.isEqualWith)(prevRecord, nextRecord, _utils.customEqualForFunction)) {
|
|
1092
|
-
return false;
|
|
1093
|
-
}
|
|
1094
|
-
// reactiveParams 中的 form、index、namePath 已经在外层比较过了,无需重复比较
|
|
1095
|
-
}
|
|
1096
|
-
// fieldProps 为对象时,必须比较配置变化(如 dataSource 异步更新)
|
|
1097
|
-
if (!(0, _lodash.isFunction)(prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.fieldProps) && !(0, _lodash.isFunction)(nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.fieldProps)) {
|
|
1098
|
-
var isFieldPropsEqual = (0, _lodash.isEqualWith)(prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.fieldProps, nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.fieldProps, _utils.customEqualForFunction);
|
|
1099
|
-
if (!isFieldPropsEqual) {
|
|
1100
|
-
return false;
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
// 通用函数比较方法
|
|
1105
|
-
// 优化:不直接调用函数,而是比较函数引用和输入参数
|
|
1106
|
-
var compareFunctionResult = (prevColumn, nextColumn, prevValues, nextValues, prevReactiveParams, nextReactiveParams, functionName) => {
|
|
1107
|
-
var prevFunc = prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn[functionName];
|
|
1108
|
-
var nextFunc = nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn[functionName];
|
|
1109
|
-
if ((0, _lodash.isFunction)(prevFunc) && (0, _lodash.isFunction)(nextFunc)) {
|
|
1110
|
-
// 函数引用变化说明闭包可能捕获了新的外部状态(如异步加载的 list),必须重渲染
|
|
1111
|
-
if (prevFunc !== nextFunc) return false;
|
|
1112
|
-
// 同引用函数,比较输入参数(纯函数假设:输入相同则输出相同)
|
|
1113
|
-
return (0, _lodash.isEqualWith)(prevValues, nextValues, _utils.customEqualForFunction);
|
|
1114
|
-
}
|
|
1115
|
-
return true; // 如果不是函数或只有一个是函数,认为相等
|
|
1116
|
-
};
|
|
1117
|
-
|
|
1118
|
-
// 使用简化后的比较逻辑
|
|
1119
|
-
var functionFields = ['rules', 'component', 'desensitization', 'isEditable', 'required'];
|
|
1120
|
-
if (functionFields.some(field => !compareFunctionResult(prevColumn, nextColumn, prevRecord, nextRecord, prevReactiveParams, nextReactiveParams, field))) {
|
|
1121
|
-
return false;
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
// 基本props比较
|
|
1125
|
-
if (!(0, _lodash.isEqual)(prevText, nextText) || prevIndex !== nextIndex) {
|
|
1126
|
-
return false;
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
// 记录关键字段比较(避免完整对象比较的性能开销)
|
|
1130
|
-
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)) {
|
|
1131
|
-
return false;
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
// 列配置比较(只比较关键字段),required,disabled为函数时,需要重新计算
|
|
1135
|
-
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)) {
|
|
1136
|
-
return false;
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
// config中关键字段比较
|
|
1140
|
-
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)) {
|
|
1141
|
-
return false;
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
// 当前单元格的值比较
|
|
1145
|
-
var prevDataIndex = prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.dataIndex;
|
|
1146
|
-
var nextDataIndex = nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.dataIndex;
|
|
1147
|
-
if (prevDataIndex && nextDataIndex && prevDataIndex === nextDataIndex) {
|
|
1148
|
-
if ((prevRecord === null || prevRecord === void 0 ? void 0 : prevRecord[prevDataIndex]) !== (nextRecord === null || nextRecord === void 0 ? void 0 : nextRecord[nextDataIndex])) {
|
|
1149
|
-
return false;
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
// 特殊处理:当使用自定义 component 函数时,比较整个 record 对象
|
|
1154
|
-
// 因为自定义组件可能依赖 record 中的其他字段(不只是当前列的 dataIndex)
|
|
1155
|
-
if ((0, _lodash.isFunction)(prevColumn === null || prevColumn === void 0 ? void 0 : prevColumn.component) || (0, _lodash.isFunction)(nextColumn === null || nextColumn === void 0 ? void 0 : nextColumn.component)) {
|
|
1156
|
-
// 浅比较 record 的所有属性
|
|
1157
|
-
var prevKeys = Object.keys(prevRecord || {});
|
|
1158
|
-
var nextKeys = Object.keys(nextRecord || {});
|
|
1159
|
-
if (prevKeys.length !== nextKeys.length) {
|
|
1160
|
-
return false;
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
// 使用 some 方法代替 for 循环
|
|
1164
|
-
if (prevKeys.some(key => (prevRecord === null || prevRecord === void 0 ? void 0 : prevRecord[key]) !== (nextRecord === null || nextRecord === void 0 ? void 0 : nextRecord[key]))) {
|
|
1165
|
-
return false;
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
return true;
|
|
1169
|
-
});
|