@zat-design/sisyphus-react 4.0.0-beta.4 → 4.0.0-beta.5
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 -0
- package/dist/index.min.js +1 -0
- package/dist/less.esm.css +1 -0
- package/dist/less.min.js +1 -0
- package/es/FormsProvider/index.js +5 -5
- package/es/ProAction/components/CheckModalContent/index.js +5 -7
- package/es/ProAction/index.js +16 -16
- package/es/ProConfigProvider/index.js +31 -17
- package/es/ProDownload/index.js +13 -12
- package/es/ProDownload/utils.js +15 -15
- package/es/ProDrawerForm/components/ProDrawer/index.js +22 -19
- package/es/ProDrawerForm/components/ProModal/index.js +14 -9
- package/es/ProDrawerForm/index.js +6 -10
- package/es/ProDrawerForm/utils/index.js +1 -1
- package/es/ProEditLabel/components/RenderProForm.js +10 -9
- package/es/ProEditLabel/index.js +36 -24
- package/es/ProEditLabel/utils/index.js +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +58 -56
- package/es/ProEditTable/components/RcTable/BaseTable.js +21 -20
- package/es/ProEditTable/components/RcTable/DraggableTable.js +27 -34
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +40 -46
- package/es/ProEditTable/components/RenderField/index.js +98 -121
- package/es/ProEditTable/components/RenderToolbar/index.js +27 -33
- package/es/ProEditTable/components/Summary/index.js +16 -14
- package/es/ProEditTable/components/Validator/index.js +9 -6
- package/es/ProEditTable/index.js +130 -147
- package/es/ProEditTable/utils/config.js +29 -36
- package/es/ProEditTable/utils/diffOriginal.js +13 -13
- package/es/ProEditTable/utils/getDefaultProps.js +6 -7
- package/es/ProEditTable/utils/index.js +52 -58
- package/es/ProEditTable/utils/tools.js +32 -41
- package/es/ProEditTable/utils/transform.js +7 -11
- package/es/ProEditTable/utils/useEditTableError.js +10 -12
- package/es/ProEnum/components/Group.js +18 -22
- package/es/ProEnum/components/Tag.js +10 -14
- package/es/ProEnum/hooks/useEnum.js +6 -10
- package/es/ProEnum/hooks/useEnumRequest.js +23 -25
- package/es/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +76 -0
- package/es/ProEnum/index.js +50 -52
- package/es/ProEnum/propsType.d.ts +29 -0
- package/es/ProEnum/utils/eventCenter.js +20 -31
- package/es/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/es/ProEnum/utils/frequentEnum.js +91 -0
- package/es/ProEnum/utils/getEnumLabel.js +8 -12
- package/es/ProEnum/utils/index.js +6 -6
- package/es/ProForm/components/Container.js +4 -3
- package/es/ProForm/components/FormFooter/index.js +16 -13
- package/es/ProForm/components/base/Checkbox/index.js +10 -11
- package/es/ProForm/components/base/DatePicker/index.js +8 -7
- package/es/ProForm/components/base/DatePicker/useDateLimit.js +2 -4
- package/es/ProForm/components/base/Input/index.js +24 -20
- package/es/ProForm/components/base/InputNumber/index.js +21 -18
- package/es/ProForm/components/base/Radio/index.js +11 -12
- package/es/ProForm/components/base/RangePicker/index.js +9 -12
- package/es/ProForm/components/base/RangePicker/useDateRange.js +3 -3
- package/es/ProForm/components/base/Select/index.js +9 -8
- package/es/ProForm/components/base/Switch/index.js +7 -6
- package/es/ProForm/components/base/SwitchCheckbox/index.js +7 -6
- package/es/ProForm/components/base/TextArea/index.js +9 -8
- package/es/ProForm/components/base/TimePicker/index.js +5 -4
- package/es/ProForm/components/combination/Container/index.js +12 -12
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +60 -70
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +11 -7
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/Empty.js +9 -10
- package/es/ProForm/components/combination/FormList/components/LineFields.js +10 -9
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +32 -36
- package/es/ProForm/components/combination/FormList/index.js +25 -33
- package/es/ProForm/components/combination/FormList/utils.js +5 -7
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.js +14 -14
- package/es/ProForm/components/combination/Group/hooks/index.d.ts +0 -1
- package/es/ProForm/components/combination/Group/hooks/index.js +30 -35
- package/es/ProForm/components/combination/Group/index.js +35 -29
- package/es/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/es/ProForm/components/combination/Group/style/index.less +7 -0
- package/es/ProForm/components/combination/Group/utils.d.ts +0 -1
- package/es/ProForm/components/combination/Group/utils.js +38 -39
- package/es/ProForm/components/combination/ProCascader/index.js +43 -52
- package/es/ProForm/components/combination/ProCascader/utils/index.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +16 -16
- package/es/ProForm/components/combination/ProModalSelect/index.js +102 -108
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +73 -47
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.js +20 -18
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.js +17 -15
- package/es/ProForm/components/render/ChangedWrapper.js +24 -26
- package/es/ProForm/components/render/ConfirmWrapper.js +10 -11
- package/es/ProForm/components/render/Render.js +107 -102
- package/es/ProForm/components/render/RenderFields.d.ts +0 -1
- package/es/ProForm/components/render/RenderFields.js +22 -24
- package/es/ProForm/index.js +44 -45
- package/es/ProForm/propsType.d.ts +1 -4
- package/es/ProForm/utils/diffOriginal.js +9 -9
- package/es/ProForm/utils/getDefaultProps.js +5 -5
- package/es/ProForm/utils/index.js +62 -90
- package/es/ProForm/utils/processDependencies.js +4 -5
- package/es/ProForm/utils/rulesCreator.js +12 -12
- package/es/ProForm/utils/transformNames.js +2 -2
- package/es/ProForm/utils/transformValue.js +6 -8
- package/es/ProForm/utils/useDeepCompareMemo.js +1 -1
- package/es/ProForm/utils/useFieldProps.js +1 -3
- package/es/ProForm/utils/useForm.js +19 -21
- package/es/ProForm/utils/useRules.js +17 -22
- package/es/ProForm/utils/useShouldUpdate.js +79 -83
- package/es/ProForm/utils/useWatch.js +12 -12
- package/es/ProForm/utils/valueType.js +46 -50
- package/es/ProIcon/index.js +30 -31
- package/es/ProIcon/utils/index.js +5 -5
- package/es/ProLayout/components/Layout/Header/index.js +1 -1
- package/es/ProLayout/components/Layout/Icon/Icon.js +4 -4
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +19 -22
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +23 -30
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +3 -3
- package/es/ProLayout/components/Layout/Menu/index.js +9 -9
- package/es/ProLayout/components/Layout/Notice/index.js +3 -3
- package/es/ProLayout/components/ProCollapse/index.js +23 -18
- package/es/ProLayout/components/ProFooter/index.js +13 -14
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +6 -5
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -5
- package/es/ProLayout/components/ProHeader/index.js +68 -59
- package/es/ProLayout/components/ProHeader/utils/index.js +1 -1
- package/es/ProLayout/index.js +33 -32
- package/es/ProLayout/utils/index.js +17 -18
- package/es/ProSelect/components/AdaptiveTooltip.js +8 -9
- package/es/ProSelect/index.js +57 -64
- package/es/ProSelect/utils/index.js +17 -28
- package/es/ProStep/components/Anchor/index.js +10 -9
- package/es/ProStep/components/Item/index.js +11 -11
- package/es/ProStep/components/Listener/index.js +6 -10
- package/es/ProStep/components/Step/index.js +9 -11
- package/es/ProStep/index.js +24 -30
- package/es/ProStep/utils/index.js +8 -8
- package/es/ProStepTab/index.js +27 -28
- package/es/ProTable/components/FormatColumn/index.js +54 -59
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +6 -7
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +21 -37
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +16 -17
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +5 -6
- package/es/ProTable/components/RenderColumn/index.js +36 -35
- package/es/ProTable/components/RenderEmptyText/index.js +1 -1
- package/es/ProTable/components/RenderFooter/index.js +2 -2
- package/es/ProTable/components/RenderSummary/index.js +13 -12
- package/es/ProTable/components/RenderTableHeader/index.js +5 -4
- package/es/ProTable/components/RenderTabs/index.js +26 -29
- package/es/ProTable/components/TableResizable/index.js +8 -8
- package/es/ProTable/components/TooltipTitle/index.js +4 -3
- package/es/ProTable/hooks/useAntdTable.js +80 -95
- package/es/ProTable/index.js +110 -133
- package/es/ProTable/propsType.d.ts +9 -3
- package/es/ProTable/utils/index.js +13 -16
- package/es/ProTabs/components/Card/index.js +14 -8
- package/es/ProTabs/index.js +30 -20
- package/es/ProTabs/propType.d.ts +5 -0
- package/es/ProTabs/style/index.less +40 -3
- package/es/ProThemeTools/component/ProTools/index.js +46 -39
- package/es/ProThemeTools/context/ThemeContext.js +13 -13
- package/es/ProThemeTools/index.js +18 -19
- package/es/ProThemeTools/utils/index.js +14 -18
- package/es/ProTooltip/index.js +24 -27
- package/es/ProTree/components/AdaptiveTooltip.js +5 -6
- package/es/ProTree/components/List.js +10 -13
- package/es/ProTree/components/ProTree.js +47 -64
- package/es/ProTree/components/ProTreeSelect/index.js +77 -76
- package/es/ProTree/components/Tree.js +23 -22
- package/es/ProTree/index.js +1 -1
- package/es/ProTree/utils.js +14 -14
- package/es/ProTreeModal/components/Cascader.js +13 -16
- package/es/ProTreeModal/components/List.js +49 -70
- package/es/ProTreeModal/components/SortableItem.js +7 -8
- package/es/ProTreeModal/components/Tree.js +18 -23
- package/es/ProTreeModal/components/Trigger.js +15 -10
- package/es/ProTreeModal/index.js +98 -151
- package/es/ProTreeModal/utils.js +21 -21
- package/es/ProUpload/components/ButtonRender.js +11 -12
- package/es/ProUpload/components/DragRender.js +17 -20
- package/es/ProUpload/components/DraggableUploadListItem.js +2 -2
- package/es/ProUpload/components/Example.js +3 -3
- package/es/ProUpload/components/FileItem.js +30 -25
- package/es/ProUpload/components/ImageRender.js +29 -22
- package/es/ProUpload/index.js +55 -66
- package/es/ProUpload/uitls.js +2 -2
- package/es/ProUtils/utils/index.js +10 -14
- package/es/ProViewer/index.js +22 -19
- package/es/ProViewer/propsType.js +0 -3
- package/es/ProWaterMark/index.js +4 -3
- package/es/index.d.ts +1 -1
- package/es/locale/index.js +2 -2
- package/es/style/index.less +1 -1
- package/es/style/theme/base.less +1 -0
- package/es/utils/index.js +11 -13
- package/lib/FormsProvider/index.js +30 -50
- package/lib/ProAction/components/CheckModalContent/index.js +31 -27
- package/lib/ProAction/index.js +194 -151
- package/lib/ProAction/propsType.js +4 -16
- package/lib/ProConfigProvider/index.js +136 -136
- package/lib/ProDownload/index.js +192 -124
- package/lib/ProDownload/propsType.js +4 -16
- package/lib/ProDownload/utils.js +189 -143
- package/lib/ProDrawerForm/components/ProDrawer/index.js +243 -169
- package/lib/ProDrawerForm/components/ProModal/index.js +194 -134
- package/lib/ProDrawerForm/components/index.js +17 -39
- package/lib/ProDrawerForm/index.js +79 -88
- package/lib/ProDrawerForm/propsType.js +4 -16
- package/lib/ProDrawerForm/utils/index.js +13 -30
- package/lib/ProEditLabel/components/RenderProForm.js +58 -57
- package/lib/ProEditLabel/index.js +251 -178
- package/lib/ProEditLabel/propsType.js +4 -16
- package/lib/ProEditLabel/utils/index.js +11 -26
- package/lib/ProEditTable/components/ActionButton/index.js +144 -155
- package/lib/ProEditTable/components/RcTable/BaseTable.js +97 -96
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +172 -151
- package/lib/ProEditTable/components/RcTable/index.js +17 -39
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +177 -176
- package/lib/ProEditTable/components/RenderField/index.js +628 -539
- package/lib/ProEditTable/components/RenderToolbar/index.js +119 -105
- package/lib/ProEditTable/components/Summary/index.js +70 -61
- package/lib/ProEditTable/components/Validator/index.js +30 -47
- package/lib/ProEditTable/components/index.js +38 -48
- package/lib/ProEditTable/index.js +379 -324
- package/lib/ProEditTable/propsType.js +4 -16
- package/lib/ProEditTable/utils/config.js +225 -170
- package/lib/ProEditTable/utils/diffOriginal.js +93 -80
- package/lib/ProEditTable/utils/getDefaultProps.js +26 -42
- package/lib/ProEditTable/utils/index.js +318 -244
- package/lib/ProEditTable/utils/tools.js +438 -243
- package/lib/ProEditTable/utils/transform.js +15 -28
- package/lib/ProEditTable/utils/useEditTableError.js +65 -54
- package/lib/ProEnum/components/Group.js +53 -81
- package/lib/ProEnum/components/Tag.js +37 -54
- package/lib/ProEnum/hooks/useEnum.js +72 -52
- package/lib/ProEnum/hooks/useEnumRequest.js +267 -194
- package/lib/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +83 -0
- package/lib/ProEnum/index.js +239 -234
- package/lib/ProEnum/propsType.d.ts +29 -0
- package/lib/ProEnum/propsType.js +4 -16
- package/lib/ProEnum/utils/eventCenter.js +15 -12
- package/lib/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/lib/ProEnum/utils/frequentEnum.js +99 -0
- package/lib/ProEnum/utils/getEnumLabel.js +57 -65
- package/lib/ProEnum/utils/index.js +98 -68
- package/lib/ProForm/components/Container.js +35 -45
- package/lib/ProForm/components/FormFooter/index.js +67 -80
- package/lib/ProForm/components/FormFooter/propsType.js +4 -16
- package/lib/ProForm/components/base/Checkbox/index.js +67 -62
- package/lib/ProForm/components/base/DatePicker/index.js +63 -74
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +13 -29
- package/lib/ProForm/components/base/Input/index.js +65 -73
- package/lib/ProForm/components/base/Input/propsType.js +4 -16
- package/lib/ProForm/components/base/InputNumber/index.js +230 -176
- package/lib/ProForm/components/base/Radio/index.js +60 -69
- package/lib/ProForm/components/base/RangePicker/index.js +73 -88
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +28 -45
- package/lib/ProForm/components/base/Select/index.js +63 -69
- package/lib/ProForm/components/base/Switch/index.js +43 -59
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +63 -62
- package/lib/ProForm/components/base/TextArea/index.js +52 -65
- package/lib/ProForm/components/base/TimePicker/index.js +45 -59
- package/lib/ProForm/components/combination/Container/index.js +58 -72
- package/lib/ProForm/components/combination/Container/propsType.js +4 -16
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +240 -195
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +85 -107
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +25 -44
- package/lib/ProForm/components/combination/FormList/components/Empty.js +92 -55
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +92 -117
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +133 -101
- package/lib/ProForm/components/combination/FormList/index.js +131 -164
- package/lib/ProForm/components/combination/FormList/propsType.js +4 -16
- package/lib/ProForm/components/combination/FormList/utils.js +32 -52
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +23 -38
- package/lib/ProForm/components/combination/Group/component/ComRender.js +78 -74
- package/lib/ProForm/components/combination/Group/hooks/index.d.ts +0 -1
- package/lib/ProForm/components/combination/Group/hooks/index.js +123 -123
- package/lib/ProForm/components/combination/Group/index.js +99 -104
- package/lib/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/lib/ProForm/components/combination/Group/propsType.js +4 -16
- package/lib/ProForm/components/combination/Group/style/index.less +7 -0
- package/lib/ProForm/components/combination/Group/utils.d.ts +0 -1
- package/lib/ProForm/components/combination/Group/utils.js +132 -104
- package/lib/ProForm/components/combination/ProCascader/index.js +271 -226
- package/lib/ProForm/components/combination/ProCascader/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +23 -33
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +113 -114
- package/lib/ProForm/components/combination/ProModalSelect/index.js +651 -472
- package/lib/ProForm/components/combination/ProModalSelect/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +21 -43
- package/lib/ProForm/components/combination/ProNumberRange/index.js +207 -160
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +169 -139
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +28 -49
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +150 -127
- package/lib/ProForm/components/index.js +192 -115
- package/lib/ProForm/components/render/ChangedWrapper.js +130 -141
- package/lib/ProForm/components/render/ConfirmWrapper.js +120 -78
- package/lib/ProForm/components/render/Render.js +445 -346
- package/lib/ProForm/components/render/RenderFields.d.ts +0 -1
- package/lib/ProForm/components/render/RenderFields.js +195 -181
- package/lib/ProForm/components/render/propsType.js +31 -17
- package/lib/ProForm/index.js +282 -235
- package/lib/ProForm/propsType.d.ts +1 -4
- package/lib/ProForm/propsType.js +9 -38
- package/lib/ProForm/utils/diffOriginal.js +88 -81
- package/lib/ProForm/utils/getDefaultProps.js +26 -42
- package/lib/ProForm/utils/index.js +330 -254
- package/lib/ProForm/utils/processDependencies.js +61 -44
- package/lib/ProForm/utils/rulesCreator.js +58 -81
- package/lib/ProForm/utils/transformNames.js +26 -37
- package/lib/ProForm/utils/transformValue.js +47 -47
- package/lib/ProForm/utils/useDeepCompareMemo.js +15 -34
- package/lib/ProForm/utils/useFieldProps.js +10 -42
- package/lib/ProForm/utils/useForm.js +226 -118
- package/lib/ProForm/utils/useRules.js +50 -60
- package/lib/ProForm/utils/useShouldUpdate.js +233 -126
- package/lib/ProForm/utils/useWatch.js +122 -93
- package/lib/ProForm/utils/valueType.js +222 -155
- package/lib/ProIcon/config/index.js +278 -365
- package/lib/ProIcon/index.js +217 -184
- package/lib/ProIcon/propsTypes.js +4 -16
- package/lib/ProIcon/symbolIcon.js +30 -23
- package/lib/ProIcon/utils/index.js +53 -60
- package/lib/ProLayout/components/Layout/Header/index.js +42 -59
- package/lib/ProLayout/components/Layout/Icon/Icon.js +31 -49
- package/lib/ProLayout/components/Layout/Icon/index.js +7 -34
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +170 -139
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +135 -117
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +4 -16
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +44 -60
- package/lib/ProLayout/components/Layout/Menu/index.js +52 -71
- package/lib/ProLayout/components/Layout/Notice/index.js +31 -39
- package/lib/ProLayout/components/Layout/index.js +31 -45
- package/lib/ProLayout/components/ProCollapse/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProCollapse/index.js +159 -148
- package/lib/ProLayout/components/ProFooter/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProFooter/index.js +41 -56
- package/lib/ProLayout/components/ProHeader/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +26 -53
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +27 -48
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +4 -16
- package/lib/ProLayout/components/ProHeader/components/index.js +17 -39
- package/lib/ProLayout/components/ProHeader/index.js +466 -268
- package/lib/ProLayout/components/ProHeader/utils/index.js +14 -31
- package/lib/ProLayout/components/index.js +24 -42
- package/lib/ProLayout/index.js +139 -130
- package/lib/ProLayout/propTypes.js +4 -16
- package/lib/ProLayout/utils/index.js +120 -86
- package/lib/ProSelect/components/AdaptiveTooltip.js +38 -45
- package/lib/ProSelect/index.js +240 -213
- package/lib/ProSelect/propsType.js +4 -16
- package/lib/ProSelect/utils/index.js +114 -93
- package/lib/ProStep/components/Anchor/index.js +102 -107
- package/lib/ProStep/components/Item/index.js +71 -75
- package/lib/ProStep/components/Listener/index.js +69 -62
- package/lib/ProStep/components/Step/index.js +65 -75
- package/lib/ProStep/index.js +227 -165
- package/lib/ProStep/propsType.js +4 -16
- package/lib/ProStep/utils/index.js +54 -57
- package/lib/ProStepTab/index.js +307 -166
- package/lib/ProStepTab/propsType.js +4 -16
- package/lib/ProTable/components/FormatColumn/index.js +472 -425
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +39 -53
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +183 -135
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +85 -104
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +4 -16
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +58 -80
- package/lib/ProTable/components/RcTable/index.js +17 -39
- package/lib/ProTable/components/RenderColumn/index.js +203 -194
- package/lib/ProTable/components/RenderEmptyText/index.js +25 -27
- package/lib/ProTable/components/RenderFooter/index.js +17 -33
- package/lib/ProTable/components/RenderSummary/index.js +57 -46
- package/lib/ProTable/components/RenderTableHeader/index.js +62 -68
- package/lib/ProTable/components/RenderTabs/index.js +67 -80
- package/lib/ProTable/components/TableResizable/index.js +87 -87
- package/lib/ProTable/components/TooltipTitle/index.js +27 -40
- package/lib/ProTable/components/index.js +45 -51
- package/lib/ProTable/hooks/useAntdTable.js +351 -304
- package/lib/ProTable/index.js +354 -333
- package/lib/ProTable/propsType.d.ts +9 -3
- package/lib/ProTable/propsType.js +4 -16
- package/lib/ProTable/utils/index.js +89 -78
- package/lib/ProTabs/components/Card/index.js +57 -30
- package/lib/ProTabs/components/index.js +10 -36
- package/lib/ProTabs/index.js +94 -89
- package/lib/ProTabs/propType.d.ts +5 -0
- package/lib/ProTabs/propType.js +4 -16
- package/lib/ProTabs/style/index.less +40 -3
- package/lib/ProThemeTools/component/ProTools/index.js +246 -198
- package/lib/ProThemeTools/component/index.js +10 -36
- package/lib/ProThemeTools/context/ThemeContext.js +99 -89
- package/lib/ProThemeTools/index.js +207 -172
- package/lib/ProThemeTools/propsType.js +4 -16
- package/lib/ProThemeTools/utils/index.js +84 -80
- package/lib/ProTooltip/index.js +217 -214
- package/lib/ProTooltip/propsType.js +4 -16
- package/lib/ProTree/components/AdaptiveTooltip.js +22 -33
- package/lib/ProTree/components/CloseIcon.js +31 -36
- package/lib/ProTree/components/List.js +69 -68
- package/lib/ProTree/components/ProTree.js +346 -258
- package/lib/ProTree/components/ProTreeSelect/index.js +460 -336
- package/lib/ProTree/components/ProTreeSelect/propsType.js +4 -16
- package/lib/ProTree/components/SearchTitle.js +50 -47
- package/lib/ProTree/components/Tree.js +300 -227
- package/lib/ProTree/components/index.js +31 -45
- package/lib/ProTree/index.js +22 -45
- package/lib/ProTree/propsType.js +4 -16
- package/lib/ProTree/utils.js +140 -79
- package/lib/ProTreeModal/components/Cascader.js +90 -97
- package/lib/ProTreeModal/components/CloseIcon.js +31 -36
- package/lib/ProTreeModal/components/List.js +246 -192
- package/lib/ProTreeModal/components/SearchTitle.js +22 -30
- package/lib/ProTreeModal/components/SortableItem.js +59 -60
- package/lib/ProTreeModal/components/Tree.js +171 -157
- package/lib/ProTreeModal/components/Trigger.js +131 -108
- package/lib/ProTreeModal/components/index.js +45 -51
- package/lib/ProTreeModal/index.js +523 -448
- package/lib/ProTreeModal/propsType.js +4 -16
- package/lib/ProTreeModal/utils.js +160 -99
- package/lib/ProUpload/components/ButtonRender.js +106 -85
- package/lib/ProUpload/components/DragRender.js +167 -117
- package/lib/ProUpload/components/DraggableUploadListItem.js +32 -48
- package/lib/ProUpload/components/Example.js +39 -55
- package/lib/ProUpload/components/FileItem.js +215 -113
- package/lib/ProUpload/components/ImageRender.js +250 -175
- package/lib/ProUpload/index.js +185 -181
- package/lib/ProUpload/propsType.js +4 -16
- package/lib/ProUpload/uitls.js +9 -31
- package/lib/ProUtils/utils/index.js +20 -36
- package/lib/ProViewer/index.js +210 -175
- package/lib/ProViewer/propsType.js +1 -17
- package/lib/ProWaterMark/index.js +20 -38
- package/lib/ProWaterMark/propsType.js +4 -16
- package/lib/index.d.ts +1 -1
- package/lib/index.js +272 -123
- package/lib/locale/en_US.js +127 -145
- package/lib/locale/index.js +40 -55
- package/lib/locale/zh_CN.js +128 -146
- package/lib/style/index.less +1 -1
- package/lib/style/theme/base.less +1 -0
- package/lib/tokens.js +87 -103
- package/lib/utils/index.js +66 -88
- package/package.json +7 -7
- package/dist/esm/index.d.ts +0 -5
- package/dist/esm/index.js +0 -5
- package/dist/esm/regExp/index.d.ts +0 -19
- package/dist/esm/regExp/index.js +0 -73
- package/dist/esm/tools/calc/index.d.ts +0 -4
- package/dist/esm/tools/calc/index.js +0 -67
- package/dist/esm/tools/dateUtils.d.ts +0 -7
- package/dist/esm/tools/dateUtils.js +0 -23
- package/dist/esm/tools/disableDate/index.d.ts +0 -9
- package/dist/esm/tools/disableDate/index.js +0 -43
- package/dist/esm/tools/disableTimeRange/index.d.ts +0 -9
- package/dist/esm/tools/disableTimeRange/index.js +0 -121
- package/dist/esm/tools/formatAmount/index.d.ts +0 -7
- package/dist/esm/tools/formatAmount/index.js +0 -14
- package/dist/esm/tools/formatPerMill/index.d.ts +0 -7
- package/dist/esm/tools/formatPerMill/index.js +0 -11
- package/dist/esm/tools/formatPercent/index.d.ts +0 -7
- package/dist/esm/tools/formatPercent/index.js +0 -11
- package/dist/esm/tools/getDataByIdCard/index.d.ts +0 -16
- package/dist/esm/tools/getDataByIdCard/index.js +0 -65
- package/dist/esm/tools/index.d.ts +0 -12
- package/dist/esm/tools/index.js +0 -14
- package/dist/esm/tools/sumAmount/index.d.ts +0 -16
- package/dist/esm/tools/sumAmount/index.js +0 -40
- package/dist/esm/tools/toChineseNum/index.d.ts +0 -7
- package/dist/esm/tools/toChineseNum/index.js +0 -103
- package/dist/esm/tools/toFixed/index.d.ts +0 -2
- package/dist/esm/tools/toFixed/index.js +0 -5
- package/dist/esm/tools/transformDataName/index.d.ts +0 -12
- package/dist/esm/tools/transformDataName/index.js +0 -37
- package/dist/esm/transforms/dateTransformer/index.d.ts +0 -24
- package/dist/esm/transforms/dateTransformer/index.js +0 -67
- package/dist/esm/transforms/index.d.ts +0 -6
- package/dist/esm/transforms/index.js +0 -6
- package/dist/esm/transforms/propTypes.d.ts +0 -7
- package/dist/esm/transforms/propTypes.js +0 -1
- package/dist/esm/transforms/transformDate/index.d.ts +0 -21
- package/dist/esm/transforms/transformDate/index.js +0 -141
- package/dist/esm/transforms/transformDatePicker/index.d.ts +0 -12
- package/dist/esm/transforms/transformDatePicker/index.js +0 -24
- package/dist/esm/transforms/transformRangePicker/index.d.ts +0 -29
- package/dist/esm/transforms/transformRangePicker/index.js +0 -61
- package/dist/esm/transforms/transformSwitch/index.d.ts +0 -13
- package/dist/esm/transforms/transformSwitch/index.js +0 -35
- package/dist/esm/transforms/utils.d.ts +0 -2
- package/dist/esm/transforms/utils.js +0 -8
- package/dist/esm/validate/index.d.ts +0 -107
- package/dist/esm/validate/index.js +0 -284
- package/tests/__mocks__/fileMock.js +0 -1
- package/tests/__mocks__/zatUtils.js +0 -27
- package/tests/setup.ts +0 -484
- package/tests/test-utils.tsx +0 -81
@@ -1,203 +1,240 @@
|
|
1
|
-
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __export = (target, all) => {
|
8
|
-
for (var name in all)
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
-
};
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
-
for (let key of __getOwnPropNames(from))
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
-
}
|
17
|
-
return to;
|
18
|
-
};
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
25
|
-
mod
|
26
|
-
));
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
1
|
+
"use strict";
|
28
2
|
|
29
|
-
|
30
|
-
var
|
31
|
-
|
32
|
-
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
33
7
|
});
|
34
|
-
|
35
|
-
|
36
|
-
var
|
37
|
-
var
|
38
|
-
var
|
39
|
-
var
|
40
|
-
var
|
41
|
-
|
42
|
-
var
|
43
|
-
|
44
|
-
var
|
45
|
-
var
|
46
|
-
var
|
47
|
-
var
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
8
|
+
exports.default = void 0;
|
9
|
+
require("antd/es/affix/style");
|
10
|
+
var _affix = _interopRequireDefault(require("antd/es/affix"));
|
11
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
12
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
13
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
15
|
+
require("antd/es/config-provider/style");
|
16
|
+
var _configProvider = _interopRequireDefault(require("antd/es/config-provider"));
|
17
|
+
require("antd/es/form/style");
|
18
|
+
var _form = _interopRequireDefault(require("antd/es/form"));
|
19
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
21
|
+
var _lodash = require("lodash");
|
22
|
+
var _ahooks = require("ahooks");
|
23
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
24
|
+
var _utils = require("./utils");
|
25
|
+
var _tools = require("./utils/tools");
|
26
|
+
var _components = require("./components");
|
27
|
+
var _ProForm = _interopRequireDefault(require("../ProForm"));
|
28
|
+
var _empty = _interopRequireDefault(require("../assets/empty.png"));
|
29
|
+
var _locale = _interopRequireWildcard(require("../locale"));
|
30
|
+
var _RcTable = require("./components/RcTable");
|
31
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
32
|
+
var _excluded = ["value", "onChange", "onDrag", "onDragEnd", "className", "columns", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "rowKey", "rowDisabled", "rowDraggable", "footerRender", "scroll", "actionDirection", "diffConfig"];
|
33
|
+
var ProEditTable = (_ref, ref) => {
|
34
|
+
var _resetProps$id, _resetProps$id$split, _themeConfig$data2, _resetProps$otherProp;
|
35
|
+
var _ref$value = _ref.value,
|
36
|
+
value = _ref$value === void 0 ? [] : _ref$value,
|
37
|
+
onChange = _ref.onChange,
|
38
|
+
onDrag = _ref.onDrag,
|
39
|
+
onDragEnd = _ref.onDragEnd,
|
40
|
+
className = _ref.className,
|
41
|
+
columns = _ref.columns,
|
42
|
+
_ref$mode = _ref.mode,
|
43
|
+
mode = _ref$mode === void 0 ? 'multiple' : _ref$mode,
|
44
|
+
_ref$stripe = _ref.stripe,
|
45
|
+
stripe = _ref$stripe === void 0 ? true : _ref$stripe,
|
46
|
+
_ref$draggable = _ref.draggable,
|
47
|
+
draggable = _ref$draggable === void 0 ? false : _ref$draggable,
|
48
|
+
_ref$disabled = _ref.disabled,
|
49
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
50
|
+
_ref$insertType = _ref.insertType,
|
51
|
+
insertType = _ref$insertType === void 0 ? 'after' : _ref$insertType,
|
52
|
+
_ref$emptyBtnText = _ref.emptyBtnText,
|
53
|
+
emptyBtnText = _ref$emptyBtnText === void 0 ? _locale.default.ProEditTable.clickAdd : _ref$emptyBtnText,
|
54
|
+
actionWidth = _ref.actionWidth,
|
55
|
+
_ref$actionProps = _ref.actionProps,
|
56
|
+
actionProps = _ref$actionProps === void 0 ? [] : _ref$actionProps,
|
57
|
+
_ref$toolbarProps = _ref.toolbarProps,
|
58
|
+
toolbarProps = _ref$toolbarProps === void 0 ? [] : _ref$toolbarProps,
|
59
|
+
toolbarSticky = _ref.toolbarSticky,
|
60
|
+
rowSelection = _ref.rowSelection,
|
61
|
+
_ref$onlyOneLineMsg = _ref.onlyOneLineMsg,
|
62
|
+
onlyOneLineMsg = _ref$onlyOneLineMsg === void 0 ? _locale.default.ProEditTable.onlyOneLineMsg : _ref$onlyOneLineMsg,
|
63
|
+
_ref$deletePoConfirmM = _ref.deletePoConfirmMsg,
|
64
|
+
deletePoConfirmMsg = _ref$deletePoConfirmM === void 0 ? _locale.default.ProEditTable.deletePoConfirmMsg : _ref$deletePoConfirmM,
|
65
|
+
_ref$mulDeletePoConfi = _ref.mulDeletePoConfirmMsg,
|
66
|
+
mulDeletePoConfirmMsg = _ref$mulDeletePoConfi === void 0 ? _locale.default.ProEditTable.mulDeletePoConfirmMsg : _ref$mulDeletePoConfi,
|
67
|
+
configRequiredAlign = _ref.requiredAlign,
|
68
|
+
summary = _ref.summary,
|
69
|
+
max = _ref.max,
|
70
|
+
headerRender = _ref.headerRender,
|
71
|
+
pagination = _ref.pagination,
|
72
|
+
rowKey = _ref.rowKey,
|
73
|
+
rowDisabled = _ref.rowDisabled,
|
74
|
+
rowDraggable = _ref.rowDraggable,
|
75
|
+
footerRender = _ref.footerRender,
|
76
|
+
scroll = _ref.scroll,
|
77
|
+
_ref$actionDirection = _ref.actionDirection,
|
78
|
+
actionDirection = _ref$actionDirection === void 0 ? 'horizontal' : _ref$actionDirection,
|
79
|
+
diffConfig = _ref.diffConfig,
|
80
|
+
resetProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
81
|
+
// 上下文form
|
82
|
+
var contentForm = _form.default.useFormInstance();
|
83
|
+
var formFieldProps = _ProForm.default.useFieldProps() || {};
|
84
|
+
var affixRef = (0, _react.useRef)(null);
|
85
|
+
var form = contentForm || (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.form) || (resetProps === null || resetProps === void 0 ? void 0 : resetProps.form);
|
86
|
+
var name = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.name) || (resetProps === null || resetProps === void 0 ? void 0 : resetProps.name) || (resetProps === null || resetProps === void 0 || (_resetProps$id = resetProps.id) === null || _resetProps$id === void 0 || (_resetProps$id$split = _resetProps$id.split) === null || _resetProps$id$split === void 0 ? void 0 : _resetProps$id$split.call(_resetProps$id, '_'));
|
87
|
+
var _formFieldProps$isVie = formFieldProps.isView,
|
88
|
+
isView = _formFieldProps$isVie === void 0 ? false : _formFieldProps$isVie,
|
89
|
+
_formFieldProps$viewE = formFieldProps.viewEmpty,
|
90
|
+
viewEmpty = _formFieldProps$viewE === void 0 ? '-' : _formFieldProps$viewE,
|
91
|
+
namePath = formFieldProps.namePath;
|
92
|
+
|
93
|
+
// 判断是否在formList内
|
94
|
+
if (namePath !== null && namePath !== void 0 && namePath.length) {
|
90
95
|
name = [...namePath, ...name.slice(1)];
|
91
|
-
disabled = (formFieldProps
|
96
|
+
disabled = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.disabled) || disabled; // formFieldProps?.disabled可能是函数??
|
92
97
|
}
|
93
|
-
|
94
|
-
const
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
98
|
+
var tableRef = (0, _react.useRef)(null);
|
99
|
+
// const valueChangeRef = useRef<number>(0);
|
100
|
+
// valueChangeRef.current = 0;
|
101
|
+
|
102
|
+
var _React$useContext = _react.default.useContext(_configProvider.default.ConfigContext),
|
103
|
+
getPrefixCls = _React$useContext.getPrefixCls;
|
104
|
+
var prefixCls = getPrefixCls();
|
105
|
+
var _useLocalStorageState = (0, _ahooks.useLocalStorageState)('themeConfig'),
|
106
|
+
_useLocalStorageState2 = (0, _slicedToArray2.default)(_useLocalStorageState, 1),
|
107
|
+
themeConfig = _useLocalStorageState2[0];
|
108
|
+
var requiredAlign = (0, _react.useMemo)(() => {
|
109
|
+
var _ref2, _themeConfig$data$zau, _themeConfig$data;
|
110
|
+
return (_ref2 = (_themeConfig$data$zau = themeConfig === null || themeConfig === void 0 || (_themeConfig$data = themeConfig.data) === null || _themeConfig$data === void 0 ? void 0 : _themeConfig$data.zauiFormAlign) !== null && _themeConfig$data$zau !== void 0 ? _themeConfig$data$zau : configRequiredAlign) !== null && _ref2 !== void 0 ? _ref2 : 'left';
|
111
|
+
}, [themeConfig === null || themeConfig === void 0 || (_themeConfig$data2 = themeConfig.data) === null || _themeConfig$data2 === void 0 ? void 0 : _themeConfig$data2.zauiFormAlign, configRequiredAlign]);
|
112
|
+
var _useSetState = (0, _ahooks.useSetState)({
|
113
|
+
cellNamePath: [],
|
114
|
+
// hover模式下正在编辑的单元格路径
|
115
|
+
forceUpdate: {},
|
116
|
+
// 表格内部强制刷新开关
|
117
|
+
editingKeys: [],
|
118
|
+
// 正在编辑行的row-key集合
|
119
|
+
selectedRowKeys: [],
|
120
|
+
// 当前选中行的row-key集合
|
121
|
+
selectedRows: [],
|
122
|
+
// 当前选中行的row-key集合
|
123
|
+
virtualKey: mode === 'single' ? (0, _tools.getRandom)() : '',
|
124
|
+
// 单行编辑生成个随机formItem的key
|
125
|
+
page: {
|
126
|
+
pageNum: 1,
|
127
|
+
pageSize: (pagination === null || pagination === void 0 ? void 0 : pagination.pageSize) || 10
|
128
|
+
}
|
129
|
+
}),
|
130
|
+
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
131
|
+
state = _useSetState2[0],
|
132
|
+
setState = _useSetState2[1];
|
133
|
+
var cellNamePath = state.cellNamePath,
|
134
|
+
forceUpdate = state.forceUpdate,
|
135
|
+
editingKeys = state.editingKeys,
|
136
|
+
virtualKey = state.virtualKey,
|
137
|
+
selectedRowKeys = state.selectedRowKeys,
|
138
|
+
selectedRows = state.selectedRows,
|
139
|
+
page = state.page;
|
140
|
+
var virtualRowName = (0, _tools.getNamePath)((0, _lodash.isArray)(name) ? name : [name], virtualKey);
|
141
|
+
|
142
|
+
// 样式处理
|
143
|
+
var _className = (0, _classnames.default)({
|
144
|
+
'pro-edit-table': true,
|
145
|
+
'pro-edit-table-drag': draggable,
|
146
|
+
'pro-table-no-stripe': !stripe,
|
133
147
|
className
|
134
148
|
});
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
if (
|
152
|
-
|
149
|
+
var getRowKey = (0, _react.useCallback)(record => {
|
150
|
+
var key = record.rowKey || (0, _tools.getRandom)();
|
151
|
+
if (rowKey) {
|
152
|
+
var _ref3;
|
153
|
+
key = (_ref3 = (0, _lodash.isFunction)(rowKey) ? rowKey(record) : record[rowKey]) !== null && _ref3 !== void 0 ? _ref3 : key;
|
154
|
+
}
|
155
|
+
return key;
|
156
|
+
}, [rowKey]);
|
157
|
+
var originalValues = (0, _react.useMemo)(() => {
|
158
|
+
var _originalArr$every, _originalArr$some;
|
159
|
+
var nextOriginalValues;
|
160
|
+
// 原始值也需要设置对应的rowkey,后续比对通过rowkey对比
|
161
|
+
var originalArr = (0, _lodash.get)(resetProps === null || resetProps === void 0 ? void 0 : resetProps.originalValues, name);
|
162
|
+
var isOriginalAllHasKey = originalArr ? originalArr === null || originalArr === void 0 || (_originalArr$every = originalArr.every) === null || _originalArr$every === void 0 ? void 0 : _originalArr$every.call(originalArr, item => item.rowKey) : true;
|
163
|
+
var isNeedCoverOriginal = originalArr === null || originalArr === void 0 || (_originalArr$some = originalArr.some) === null || _originalArr$some === void 0 ? void 0 : _originalArr$some.call(originalArr, item => item.rowKey !== getRowKey(item));
|
164
|
+
// 初始化默认生成row-key
|
165
|
+
if (originalArr !== null && originalArr !== void 0 && originalArr.length && (!isOriginalAllHasKey || isNeedCoverOriginal)) {
|
166
|
+
var _originalArr$forEach;
|
167
|
+
originalArr === null || originalArr === void 0 || (_originalArr$forEach = originalArr.forEach) === null || _originalArr$forEach === void 0 || _originalArr$forEach.call(originalArr, item => {
|
153
168
|
item.rowKey = getRowKey(item);
|
154
169
|
});
|
155
170
|
}
|
156
|
-
if (originalArr
|
171
|
+
if (originalArr !== null && originalArr !== void 0 && originalArr.length) {
|
157
172
|
nextOriginalValues = {};
|
158
|
-
(0,
|
173
|
+
(0, _lodash.set)(nextOriginalValues, name, originalArr);
|
159
174
|
}
|
160
175
|
return nextOriginalValues;
|
161
|
-
}, [resetProps
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
)
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
176
|
+
}, [resetProps === null || resetProps === void 0 ? void 0 : resetProps.originalValues]);
|
177
|
+
var getIsNew = (0, _react.useCallback)(record => {
|
178
|
+
var _originalArr$find;
|
179
|
+
var originalArr = (0, _lodash.get)(originalValues, name);
|
180
|
+
if (!(originalArr !== null && originalArr !== void 0 && originalArr.length)) {
|
181
|
+
return false;
|
182
|
+
}
|
183
|
+
return !(originalArr !== null && originalArr !== void 0 && (_originalArr$find = originalArr.find) !== null && _originalArr$find !== void 0 && _originalArr$find.call(originalArr, item => getRowKey(item) === getRowKey(record)));
|
184
|
+
}, [originalValues, name]);
|
185
|
+
|
186
|
+
// 分页变更
|
187
|
+
var handlePageChange = (0, _react.useCallback)( /*#__PURE__*/function () {
|
188
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(current, pageSize) {
|
189
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
190
|
+
while (1) switch (_context.prev = _context.next) {
|
191
|
+
case 0:
|
192
|
+
_context.prev = 0;
|
193
|
+
if (!pagination) {
|
194
|
+
_context.next = 8;
|
195
|
+
break;
|
196
|
+
}
|
197
|
+
if (!(pageSize !== page.pageSize)) {
|
198
|
+
_context.next = 5;
|
199
|
+
break;
|
200
|
+
}
|
178
201
|
setState({
|
179
202
|
page: {
|
180
203
|
pageNum: current,
|
181
204
|
pageSize
|
182
205
|
}
|
183
206
|
});
|
184
|
-
return;
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
207
|
+
return _context.abrupt("return");
|
208
|
+
case 5:
|
209
|
+
_context.next = 7;
|
210
|
+
return form.validateFields([name], {
|
211
|
+
recursive: true
|
212
|
+
});
|
213
|
+
case 7:
|
214
|
+
setState({
|
215
|
+
page: {
|
216
|
+
pageNum: current,
|
217
|
+
pageSize: pageSize !== null && pageSize !== void 0 ? pageSize : page.pageSize
|
218
|
+
}
|
219
|
+
});
|
220
|
+
case 8:
|
221
|
+
_context.next = 13;
|
222
|
+
break;
|
223
|
+
case 10:
|
224
|
+
_context.prev = 10;
|
225
|
+
_context.t0 = _context["catch"](0);
|
226
|
+
(0, _tools.handleScrollToError)();
|
227
|
+
case 13:
|
228
|
+
case "end":
|
229
|
+
return _context.stop();
|
193
230
|
}
|
194
|
-
}
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
);
|
200
|
-
|
231
|
+
}, _callee, null, [[0, 10]]);
|
232
|
+
}));
|
233
|
+
return function (_x, _x2) {
|
234
|
+
return _ref4.apply(this, arguments);
|
235
|
+
};
|
236
|
+
}(), [pagination, page.pageSize, form, name]);
|
237
|
+
var config = (0, _objectSpread2.default)({
|
201
238
|
form,
|
202
239
|
mode,
|
203
240
|
isView,
|
@@ -219,87 +256,102 @@ var ProEditTable = ({
|
|
219
256
|
mulDeletePoConfirmMsg,
|
220
257
|
virtualKey,
|
221
258
|
requiredAlign,
|
222
|
-
name: (0,
|
259
|
+
name: (0, _lodash.isArray)(name) ? name : [name],
|
223
260
|
// name需要处理成namePath形式,为兼容多路径
|
224
261
|
namePath,
|
225
262
|
tableRef,
|
226
263
|
max,
|
227
|
-
tableLength: value
|
264
|
+
tableLength: value === null || value === void 0 ? void 0 : value.length,
|
228
265
|
page,
|
229
266
|
originalValues,
|
230
267
|
prefixCls,
|
231
268
|
rowDisabled,
|
232
269
|
actionDirection,
|
233
|
-
diffConfig:
|
270
|
+
diffConfig: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, resetProps === null || resetProps === void 0 || (_resetProps$otherProp = resetProps.otherProps) === null || _resetProps$otherProp === void 0 ? void 0 : _resetProps$otherProp.diffConfig), diffConfig),
|
234
271
|
getIsNew,
|
235
|
-
handlePageChange
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
272
|
+
handlePageChange
|
273
|
+
}, resetProps);
|
274
|
+
|
275
|
+
// 编辑行设置下样式
|
276
|
+
var _rowClassName = record => {
|
277
|
+
var isEdit = !virtualKey || editingKeys.includes(record.rowKey);
|
278
|
+
var className = isEdit ? 'is-editing' : '';
|
241
279
|
if (getIsNew(record)) {
|
242
|
-
return `is-new-row ${
|
280
|
+
return `is-new-row ${className}`;
|
243
281
|
}
|
244
|
-
return
|
282
|
+
return className;
|
245
283
|
};
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
284
|
+
|
285
|
+
// 判断是否禁止添加、批量删除
|
286
|
+
var isForbiddenBtn = (0, _react.useCallback)(type => {
|
287
|
+
// 当工具栏不渲染时,都不渲染
|
288
|
+
if (toolbarProps === false) {
|
289
|
+
return true;
|
290
|
+
}
|
291
|
+
// 通过配置项配置show 为 false 开启关闭添加与批量删除
|
292
|
+
if (Array.isArray(toolbarProps)) {
|
293
|
+
var addBtnConfig = toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.find(item => item.type === type);
|
294
|
+
if ((0, _lodash.isFunction)(addBtnConfig === null || addBtnConfig === void 0 ? void 0 : addBtnConfig.show)) {
|
295
|
+
var result = addBtnConfig.show();
|
296
|
+
addBtnConfig.show = result;
|
258
297
|
}
|
259
|
-
return false;
|
260
|
-
}
|
261
|
-
|
262
|
-
);
|
263
|
-
|
264
|
-
|
298
|
+
return (addBtnConfig === null || addBtnConfig === void 0 ? void 0 : addBtnConfig.show) === false;
|
299
|
+
}
|
300
|
+
return false;
|
301
|
+
}, [toolbarProps]);
|
302
|
+
|
303
|
+
// 是否隐藏勾选框
|
304
|
+
var isHideCheckBox = isForbiddenBtn('mulDelete');
|
305
|
+
|
306
|
+
// 复选框
|
307
|
+
var _rowSelection = (0, _objectSpread2.default)({
|
265
308
|
fixed: true,
|
266
309
|
selectedRowKeys,
|
267
310
|
columnWidth: 48,
|
268
|
-
onChange: (
|
269
|
-
setState({
|
311
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
312
|
+
setState({
|
313
|
+
selectedRowKeys,
|
314
|
+
selectedRows
|
315
|
+
});
|
270
316
|
},
|
271
|
-
getCheckboxProps:
|
317
|
+
getCheckboxProps: record => {
|
272
318
|
if (rowDisabled) {
|
273
|
-
|
319
|
+
var _disabled = rowDisabled(record);
|
274
320
|
return {
|
275
321
|
disabled: _disabled
|
276
322
|
};
|
277
323
|
}
|
278
324
|
return {};
|
279
325
|
},
|
280
|
-
hideSelectAll: isHideCheckBox
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
326
|
+
hideSelectAll: isHideCheckBox
|
327
|
+
}, rowSelection);
|
328
|
+
|
329
|
+
// 空列表状态
|
330
|
+
var emptyDom = (0, _react.useMemo)(() => () => {
|
331
|
+
var _filter, _ref5;
|
332
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
333
|
+
className: "com-empty",
|
334
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
335
|
+
className: "img",
|
336
|
+
src: _empty.default,
|
337
|
+
alt: "Empty"
|
338
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
339
|
+
className: "content",
|
340
|
+
children: disabled || isForbiddenBtn('add') ? _locale.default.ProEditTable.noData : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
341
|
+
children: [_locale.default.ProEditTable.noData, "\uFF0C", /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RenderToolbar, (0, _objectSpread2.default)({}, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
|
342
|
+
toolbarProps: toolbarProps === null || toolbarProps === void 0 || (_filter = (_ref5 = toolbarProps).filter) === null || _filter === void 0 ? void 0 : _filter.call(_ref5, item => item.type === 'add' || (item === null || item === void 0 ? void 0 : item.persistence)),
|
295
343
|
dataSource: []
|
296
|
-
}
|
297
|
-
}
|
298
|
-
)
|
299
|
-
}
|
300
|
-
|
301
|
-
|
302
|
-
|
344
|
+
})))]
|
345
|
+
})
|
346
|
+
})]
|
347
|
+
});
|
348
|
+
}, [config, disabled, isForbiddenBtn, toolbarProps]);
|
349
|
+
|
350
|
+
/**
|
351
|
+
* 渲染表格选择器
|
352
|
+
* @returns rowSelection
|
353
|
+
*/
|
354
|
+
var renderRowSelection = () => {
|
303
355
|
if (disabled || isView) {
|
304
356
|
return null;
|
305
357
|
}
|
@@ -311,104 +363,107 @@ var ProEditTable = ({
|
|
311
363
|
}
|
312
364
|
return null;
|
313
365
|
};
|
314
|
-
|
315
|
-
return (0,
|
366
|
+
var _columns = (0, _react.useMemo)(() => {
|
367
|
+
return (0, _utils.transformColumns)(columns, config);
|
316
368
|
}, [disabled, forceUpdate, columns, page, actionProps, editingKeys, cellNamePath]);
|
317
|
-
|
318
|
-
var
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
369
|
+
var initDataSource = () => {
|
370
|
+
var _value$every, _value$some;
|
371
|
+
// 检查每一项是否有 rowKey 或通过 rowKey 字段获取的 key
|
372
|
+
var isAllHasKey = value === null || value === void 0 || (_value$every = value.every) === null || _value$every === void 0 ? void 0 : _value$every.call(value, item => item.rowKey || typeof rowKey === 'string' && item[rowKey]);
|
373
|
+
|
374
|
+
// 检查 rowKey 是否需要覆盖(即当前 rowKey 与 getRowKey 生成的不一致)
|
375
|
+
var isNeedCover = value === null || value === void 0 || (_value$some = value.some) === null || _value$some === void 0 ? void 0 : _value$some.call(value, item => item.rowKey !== (getRowKey === null || getRowKey === void 0 ? void 0 : getRowKey(item)));
|
376
|
+
// 初始化默认生成 rowKey
|
377
|
+
if (value !== null && value !== void 0 && value.length && (!isAllHasKey || isNeedCover)) {
|
378
|
+
var nextValues = value === null || value === void 0 ? void 0 : value.map(item => {
|
379
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
328
380
|
rowKey: getRowKey(item)
|
329
|
-
};
|
381
|
+
});
|
330
382
|
});
|
331
|
-
onChange
|
383
|
+
onChange === null || onChange === void 0 || onChange(nextValues);
|
332
384
|
if (virtualKey) {
|
333
385
|
form.setFieldValue(virtualRowName, nextValues);
|
334
386
|
}
|
335
387
|
}
|
336
388
|
};
|
337
|
-
(0,
|
389
|
+
(0, _react.useEffect)(() => {
|
338
390
|
initDataSource();
|
339
391
|
}, [value, originalValues]);
|
340
|
-
(0,
|
392
|
+
(0, _react.useImperativeHandle)((resetProps === null || resetProps === void 0 ? void 0 : resetProps.ref) || ref, () => {
|
341
393
|
return {
|
342
394
|
getInternalState: () => state,
|
343
395
|
setInternalState: setState
|
344
396
|
};
|
345
397
|
});
|
346
|
-
(0,
|
398
|
+
(0, _react.useEffect)(() => {
|
347
399
|
if (toolbarSticky) {
|
348
|
-
|
349
|
-
var
|
350
|
-
|
400
|
+
var updatePos = () => {
|
401
|
+
var _affixRef$current, _affixRef$current$upd;
|
402
|
+
affixRef === null || affixRef === void 0 || (_affixRef$current = affixRef.current) === null || _affixRef$current === void 0 || (_affixRef$current$upd = _affixRef$current.updatePosition) === null || _affixRef$current$upd === void 0 || _affixRef$current$upd.call(_affixRef$current);
|
351
403
|
};
|
352
|
-
window.addEventListener(
|
404
|
+
window.addEventListener('scroll', updatePos, true);
|
353
405
|
return () => {
|
354
|
-
window.removeEventListener(
|
406
|
+
window.removeEventListener('scroll', updatePos, true);
|
355
407
|
};
|
356
408
|
}
|
357
409
|
}, [toolbarSticky]);
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
},
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
{
|
409
|
-
|
410
|
+
var _toolbarSticky = (0, _lodash.isBoolean)(toolbarSticky) ? {} : toolbarSticky;
|
411
|
+
var _summary = typeof summary === 'object' ? data => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Summary, {
|
412
|
+
data: data,
|
413
|
+
summary: summary,
|
414
|
+
rowSelection: renderRowSelection()
|
415
|
+
}) : summary;
|
416
|
+
var TableComponent = draggable ? _RcTable.DraggableTable : _RcTable.BaseTable;
|
417
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
418
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_configProvider.default, {
|
419
|
+
renderEmpty: value !== null && value !== void 0 && value.length ? undefined : emptyDom,
|
420
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TableComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, resetProps), {}, {
|
421
|
+
draggableProps: {
|
422
|
+
onChange,
|
423
|
+
onDrag,
|
424
|
+
onDragEnd,
|
425
|
+
draggable
|
426
|
+
},
|
427
|
+
tableProps: {
|
428
|
+
rowKey,
|
429
|
+
value,
|
430
|
+
headerRender,
|
431
|
+
tableRef,
|
432
|
+
className: _className,
|
433
|
+
columns: _columns,
|
434
|
+
renderRowSelection,
|
435
|
+
rowClassName: _rowClassName,
|
436
|
+
disabled,
|
437
|
+
virtualKey,
|
438
|
+
editingKeys,
|
439
|
+
isHideCheckBox,
|
440
|
+
rowDraggable,
|
441
|
+
pagination,
|
442
|
+
scroll,
|
443
|
+
summary: _summary,
|
444
|
+
page,
|
445
|
+
formatMessage: _locale.formatMessage,
|
446
|
+
locale: _locale.default,
|
447
|
+
handlePageChange
|
448
|
+
}
|
449
|
+
}))
|
450
|
+
}), !isView && value !== null && value !== void 0 && value.length ? toolbarSticky ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_affix.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
451
|
+
ref: affixRef
|
452
|
+
}, _toolbarSticky), {}, {
|
453
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
454
|
+
className: `pro-edit-table-toolbar${pagination ? ' pro-edit-table-toolbar-fixed' : ''}`,
|
455
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RenderToolbar, (0, _objectSpread2.default)({}, config))
|
456
|
+
})
|
457
|
+
})) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
458
|
+
className: `pro-edit-table-toolbar${pagination ? ' pro-edit-table-toolbar-fixed' : ''}`,
|
459
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RenderToolbar, (0, _objectSpread2.default)({}, config))
|
460
|
+
}) : null, footerRender ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
461
|
+
className: "pro-edit-table-footer",
|
462
|
+
children: footerRender
|
463
|
+
}) : null, pagination ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
464
|
+
id: `pro-edit-table-pagination-${config.name.join('-')}`,
|
410
465
|
onClick: () => {
|
411
|
-
(0,
|
466
|
+
(0, _tools.onPageCheck)({
|
412
467
|
form,
|
413
468
|
name,
|
414
469
|
value,
|
@@ -420,20 +475,20 @@ var ProEditTable = ({
|
|
420
475
|
setState
|
421
476
|
});
|
422
477
|
}
|
423
|
-
}
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
onlyOneLineMsg
|
431
|
-
}
|
432
|
-
));
|
478
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Validator, {
|
479
|
+
name: name,
|
480
|
+
virtualKey: virtualKey,
|
481
|
+
editingKeys: editingKeys,
|
482
|
+
onlyOneLineMsg: onlyOneLineMsg
|
483
|
+
})]
|
484
|
+
});
|
433
485
|
};
|
434
|
-
var ForwardProEditTable = (0,
|
486
|
+
var ForwardProEditTable = /*#__PURE__*/(0, _react.forwardRef)(ProEditTable);
|
487
|
+
|
488
|
+
// 删除输入就卡顿,需要研究
|
435
489
|
ForwardProEditTable.defaultProps = {
|
436
490
|
actionProps: [],
|
437
491
|
toolbarProps: []
|
438
492
|
};
|
439
|
-
|
493
|
+
// 导出组件
|
494
|
+
var _default = exports.default = ForwardProEditTable;
|