@zat-design/sisyphus-react 3.13.19-beta.1 → 3.13.19-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/FormsProvider/index.js +9 -7
- package/es/ProAction/components/CheckModalContent/index.js +14 -14
- package/es/ProAction/index.js +46 -47
- package/es/ProConfigProvider/index.js +26 -20
- package/es/ProDownload/index.js +66 -73
- package/es/ProDownload/utils.js +26 -23
- package/es/ProDrawerForm/components/ProDrawer/index.js +43 -39
- package/es/ProDrawerForm/components/ProModal/index.js +25 -23
- package/es/ProDrawerForm/components/index.js +2 -2
- package/es/ProDrawerForm/index.js +19 -21
- package/es/ProDrawerForm/utils/index.js +1 -1
- package/es/ProEditLabel/components/RenderProForm.js +30 -26
- package/es/ProEditLabel/index.js +49 -36
- package/es/ProEditLabel/utils/index.js +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +83 -76
- package/es/ProEditTable/components/RcTable/BaseTable.js +24 -24
- package/es/ProEditTable/components/RcTable/DraggableTable.js +34 -41
- package/es/ProEditTable/components/RcTable/VirtualTable.js +4 -3
- package/es/ProEditTable/components/RcTable/index.js +3 -3
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +61 -57
- package/es/ProEditTable/components/RenderField/index.js +151 -145
- package/es/ProEditTable/components/RenderToolbar/index.js +37 -42
- package/es/ProEditTable/components/Summary/index.js +22 -21
- package/es/ProEditTable/components/Validator/index.js +11 -10
- package/es/ProEditTable/components/index.js +5 -5
- package/es/ProEditTable/index.d.ts +1 -1
- package/es/ProEditTable/index.js +170 -173
- package/es/ProEditTable/utils/config.js +42 -46
- package/es/ProEditTable/utils/diffOriginal.js +34 -19
- package/es/ProEditTable/utils/getDefaultProps.js +12 -13
- package/es/ProEditTable/utils/index.js +102 -99
- package/es/ProEditTable/utils/tools.js +88 -91
- package/es/ProEditTable/utils/transform.js +7 -11
- package/es/ProEditTable/utils/useEditTableError.js +22 -13
- package/es/ProEnum/components/Group.js +23 -27
- package/es/ProEnum/components/Tag.js +14 -16
- package/es/ProEnum/hooks/useEnum.js +32 -14
- package/es/ProEnum/hooks/useEnumRequest.js +42 -42
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +17 -19
- package/es/ProEnum/index.js +80 -89
- package/es/ProEnum/utils/eventCenter.js +23 -32
- package/es/ProEnum/utils/frequentEnum.js +16 -4
- package/es/ProEnum/utils/getEnumLabel.js +16 -21
- package/es/ProEnum/utils/index.js +12 -7
- package/es/ProForm/components/Container.js +8 -6
- package/es/ProForm/components/FormFooter/index.js +21 -19
- package/es/ProForm/components/base/Checkbox/index.js +16 -15
- package/es/ProForm/components/base/DatePicker/index.js +23 -20
- package/es/ProForm/components/base/Input/index.js +20 -18
- package/es/ProForm/components/base/InputNumber/index.js +57 -53
- package/es/ProForm/components/base/Radio/index.js +15 -15
- package/es/ProForm/components/base/RangePicker/index.js +24 -29
- package/es/ProForm/components/base/RangePicker/useDateRange.js +3 -3
- package/es/ProForm/components/base/Select/index.js +17 -15
- package/es/ProForm/components/base/Switch/index.js +16 -15
- package/es/ProForm/components/base/SwitchCheckbox/index.js +19 -18
- package/es/ProForm/components/base/TextArea/index.js +18 -17
- package/es/ProForm/components/base/TimePicker/index.js +10 -9
- package/es/ProForm/components/combination/Container/index.js +25 -23
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +80 -92
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +21 -19
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +7 -7
- package/es/ProForm/components/combination/FormList/components/Empty.js +21 -20
- package/es/ProForm/components/combination/FormList/components/LineFields.js +19 -18
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +45 -51
- package/es/ProForm/components/combination/FormList/index.js +43 -51
- package/es/ProForm/components/combination/FormList/utils.js +9 -9
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +8 -6
- package/es/ProForm/components/combination/Group/component/ComRender.js +33 -29
- package/es/ProForm/components/combination/Group/hooks/index.js +49 -47
- package/es/ProForm/components/combination/Group/index.js +38 -37
- package/es/ProForm/components/combination/Group/utils.js +56 -50
- package/es/ProForm/components/combination/ProCascader/index.js +81 -85
- package/es/ProForm/components/combination/ProCascader/utils/index.js +6 -6
- package/es/ProForm/components/combination/ProCombination/index.js +41 -37
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +31 -25
- package/es/ProForm/components/combination/ProModalSelect/index.js +166 -173
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +46 -51
- package/es/ProForm/components/combination/ProRangeLimit/index.js +39 -39
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.js +43 -40
- package/es/ProForm/components/index.d.ts +1 -0
- package/es/ProForm/components/index.js +40 -35
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.js +30 -28
- package/es/ProForm/components/old/EnumSelect/index.js +55 -62
- package/es/ProForm/components/old/InputRange/index.js +17 -16
- package/es/ProForm/components/old/InputWithSuffix/index.js +6 -5
- package/es/ProForm/components/old/ProAddress/index.js +53 -75
- package/es/ProForm/components/old/ProCertNo/index.js +17 -17
- package/es/ProForm/components/old/ProCertValidity/index.js +19 -21
- package/es/ProForm/components/old/ProRangeBox/index.js +25 -24
- package/es/ProForm/components/render/ChangedWrapper.js +34 -33
- package/es/ProForm/components/render/ConfirmWrapper.js +16 -18
- package/es/ProForm/components/render/Render.js +150 -135
- package/es/ProForm/components/render/RenderFields.js +65 -50
- package/es/ProForm/components/render/propsType.js +25 -0
- package/es/ProForm/index.js +83 -70
- package/es/ProForm/propsType.d.ts +1 -1
- package/es/ProForm/propsType.js +5 -1
- package/es/ProForm/utils/diffOriginal.js +30 -16
- package/es/ProForm/utils/getDefaultProps.js +10 -10
- package/es/ProForm/utils/index.js +105 -110
- package/es/ProForm/utils/processDependencies.js +15 -5
- package/es/ProForm/utils/rulesCreator.js +21 -22
- package/es/ProForm/utils/transformNames.js +7 -6
- package/es/ProForm/utils/transformValue.js +16 -13
- package/es/ProForm/utils/useDeepCompareMemo.js +6 -4
- package/es/ProForm/utils/useFieldProps.js +1 -3
- package/es/ProForm/utils/useForm.js +36 -34
- package/es/ProForm/utils/useRules.js +28 -31
- package/es/ProForm/utils/useShouldUpdate.js +83 -86
- package/es/ProForm/utils/useWatch.js +36 -14
- package/es/ProForm/utils/valueType.js +51 -52
- package/es/ProIcon/config/index.js +2 -0
- package/es/ProIcon/index.js +53 -49
- package/es/ProIcon/utils/index.js +8 -9
- package/es/ProLayout/components/Layout/Header/index.js +13 -11
- package/es/ProLayout/components/Layout/Icon/Icon.js +7 -7
- package/es/ProLayout/components/Layout/Icon/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +42 -40
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +51 -52
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +10 -9
- package/es/ProLayout/components/Layout/Menu/index.js +20 -18
- package/es/ProLayout/components/Layout/Notice/index.js +12 -11
- package/es/ProLayout/components/Layout/index.js +4 -4
- package/es/ProLayout/components/ProCollapse/index.js +35 -32
- package/es/ProLayout/components/ProFooter/index.js +13 -15
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +9 -9
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +8 -7
- package/es/ProLayout/components/ProHeader/components/index.js +2 -2
- package/es/ProLayout/components/ProHeader/index.js +129 -118
- package/es/ProLayout/components/ProHeader/utils/index.js +1 -1
- package/es/ProLayout/components/index.js +3 -3
- package/es/ProLayout/index.d.ts +1 -1
- package/es/ProLayout/index.js +28 -25
- package/es/ProLayout/utils/index.js +37 -35
- package/es/ProSelect/components/AdaptiveTooltip.js +10 -11
- package/es/ProSelect/index.js +87 -99
- package/es/ProSelect/utils/index.js +27 -33
- package/es/ProStep/components/Anchor/index.d.ts +1 -0
- package/es/ProStep/components/Anchor/index.js +26 -25
- package/es/ProStep/components/Item/index.d.ts +1 -0
- package/es/ProStep/components/Item/index.js +26 -22
- package/es/ProStep/components/Listener/index.js +11 -15
- package/es/ProStep/components/Step/index.js +24 -25
- package/es/ProStep/index.js +51 -53
- package/es/ProStep/utils/index.js +13 -12
- package/es/ProStepTab/index.js +59 -37
- package/es/ProTable/components/FormatColumn/index.js +106 -110
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +7 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +36 -50
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +24 -24
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +8 -10
- package/es/ProTable/components/RcTable/index.js +2 -2
- package/es/ProTable/components/RenderColumn/index.js +51 -51
- package/es/ProTable/components/RenderEmptyText/index.js +8 -7
- package/es/ProTable/components/RenderFooter/index.js +3 -3
- package/es/ProTable/components/RenderSummary/index.js +13 -13
- package/es/ProTable/components/RenderTableHeader/index.js +16 -14
- package/es/ProTable/components/RenderTabs/index.js +28 -33
- package/es/ProTable/components/TableResizable/index.js +17 -16
- package/es/ProTable/components/TooltipTitle/index.js +7 -6
- package/es/ProTable/components/index.js +11 -6
- package/es/ProTable/hooks/useAntdTable.js +106 -119
- package/es/ProTable/index.js +158 -176
- package/es/ProTable/utils/index.js +25 -21
- package/es/ProTabs/components/Card/index.js +15 -14
- package/es/ProTabs/components/index.js +1 -1
- package/es/ProTabs/index.js +24 -25
- package/es/ProThemeTools/component/ProTools/index.js +69 -68
- package/es/ProThemeTools/component/index.js +1 -1
- package/es/ProThemeTools/index.js +47 -33
- package/es/ProThemeTools/utils/index.js +20 -17
- package/es/ProTooltip/index.js +44 -46
- package/es/ProTree/components/AdaptiveTooltip.js +5 -7
- package/es/ProTree/components/CloseIcon.js +5 -5
- package/es/ProTree/components/List.js +22 -24
- package/es/ProTree/components/ProTree.js +84 -102
- package/es/ProTree/components/ProTreeSelect/index.js +128 -119
- package/es/ProTree/components/SearchTitle.js +10 -9
- package/es/ProTree/components/Tree.js +57 -58
- package/es/ProTree/components/index.js +4 -4
- package/es/ProTree/index.js +6 -6
- package/es/ProTree/utils.js +29 -22
- package/es/ProTreeModal/components/Cascader.js +31 -33
- package/es/ProTreeModal/components/CloseIcon.js +5 -5
- package/es/ProTreeModal/components/List.js +74 -93
- package/es/ProTreeModal/components/SearchTitle.js +5 -4
- package/es/ProTreeModal/components/SortableItem.js +14 -14
- package/es/ProTreeModal/components/Tree.js +49 -53
- package/es/ProTreeModal/components/Trigger.js +29 -28
- package/es/ProTreeModal/components/index.js +6 -6
- package/es/ProTreeModal/index.js +166 -206
- package/es/ProTreeModal/utils.js +37 -33
- package/es/ProUpload/components/ButtonRender.js +33 -36
- package/es/ProUpload/components/DragRender.js +54 -51
- package/es/ProUpload/components/DraggableUploadListItem.js +5 -4
- package/es/ProUpload/components/Example.js +13 -12
- package/es/ProUpload/components/FileItem.js +63 -58
- package/es/ProUpload/components/ImageRender.js +98 -100
- package/es/ProUpload/index.js +75 -82
- package/es/ProUpload/uitls.js +3 -3
- package/es/ProUtils/utils/index.js +10 -14
- package/es/ProViewer/index.js +29 -25
- package/es/ProViewer/propsType.js +0 -1
- package/es/ProWaterMark/index.js +5 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +38 -29
- package/es/locale/index.js +7 -4
- package/es/old/ProCertValidity/index.js +19 -21
- package/es/old/ProEditableTable/index.js +156 -156
- package/es/old/ProEditableTable/utils.js +61 -63
- package/es/tokens.js +1 -0
- package/es/utils/index.js +12 -12
- package/lib/FormsProvider/index.js +11 -7
- package/lib/ProAction/components/CheckModalContent/index.js +11 -13
- package/lib/ProAction/index.js +40 -43
- package/lib/ProConfigProvider/index.js +24 -17
- package/lib/ProDownload/index.js +65 -71
- package/lib/ProDownload/utils.js +25 -22
- package/lib/ProDrawerForm/components/ProDrawer/index.js +39 -38
- package/lib/ProDrawerForm/components/ProModal/index.js +23 -22
- package/lib/ProDrawerForm/index.js +18 -18
- package/lib/ProDrawerForm/utils/index.js +3 -2
- package/lib/ProEditLabel/components/RenderProForm.js +26 -24
- package/lib/ProEditLabel/index.js +46 -35
- package/lib/ProEditLabel/utils/index.js +6 -5
- package/lib/ProEditTable/components/ActionButton/index.js +79 -74
- package/lib/ProEditTable/components/RcTable/BaseTable.js +21 -23
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +32 -40
- package/lib/ProEditTable/components/RcTable/VirtualTable.js +3 -3
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +62 -59
- package/lib/ProEditTable/components/RenderField/index.js +137 -132
- package/lib/ProEditTable/components/RenderToolbar/index.js +34 -41
- package/lib/ProEditTable/components/Summary/index.js +20 -20
- package/lib/ProEditTable/components/Validator/index.js +10 -10
- package/lib/ProEditTable/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +159 -164
- package/lib/ProEditTable/utils/config.js +40 -44
- package/lib/ProEditTable/utils/diffOriginal.js +36 -21
- package/lib/ProEditTable/utils/getDefaultProps.js +14 -15
- package/lib/ProEditTable/utils/index.js +97 -97
- package/lib/ProEditTable/utils/tools.js +96 -91
- package/lib/ProEditTable/utils/transform.js +7 -11
- package/lib/ProEditTable/utils/useEditTableError.js +22 -13
- package/lib/ProEnum/components/Group.js +23 -27
- package/lib/ProEnum/components/Tag.js +14 -16
- package/lib/ProEnum/hooks/useEnum.js +30 -12
- package/lib/ProEnum/hooks/useEnumRequest.js +39 -39
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +16 -18
- package/lib/ProEnum/index.js +68 -78
- package/lib/ProEnum/utils/eventCenter.js +23 -32
- package/lib/ProEnum/utils/frequentEnum.js +14 -3
- package/lib/ProEnum/utils/getEnumLabel.js +15 -21
- package/lib/ProEnum/utils/index.js +12 -7
- package/lib/ProForm/components/Container.js +7 -5
- package/lib/ProForm/components/FormFooter/index.js +19 -17
- package/lib/ProForm/components/base/Checkbox/index.js +14 -13
- package/lib/ProForm/components/base/DatePicker/index.js +20 -17
- package/lib/ProForm/components/base/Input/index.js +15 -15
- package/lib/ProForm/components/base/InputNumber/index.js +51 -48
- package/lib/ProForm/components/base/Radio/index.js +13 -13
- package/lib/ProForm/components/base/RangePicker/index.js +19 -22
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +5 -4
- package/lib/ProForm/components/base/Select/index.js +14 -12
- package/lib/ProForm/components/base/Switch/index.js +11 -11
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +16 -15
- package/lib/ProForm/components/base/TextArea/index.js +14 -13
- package/lib/ProForm/components/base/TimePicker/index.js +6 -5
- package/lib/ProForm/components/combination/Container/index.js +22 -21
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +77 -89
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +17 -15
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +7 -7
- package/lib/ProForm/components/combination/FormList/components/Empty.js +17 -18
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +14 -14
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +43 -48
- package/lib/ProForm/components/combination/FormList/index.js +35 -43
- package/lib/ProForm/components/combination/FormList/utils.js +11 -10
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +7 -5
- package/lib/ProForm/components/combination/Group/component/ComRender.js +30 -28
- package/lib/ProForm/components/combination/Group/hooks/index.js +48 -45
- package/lib/ProForm/components/combination/Group/index.js +34 -35
- package/lib/ProForm/components/combination/Group/utils.js +62 -50
- package/lib/ProForm/components/combination/ProCascader/index.js +75 -80
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +8 -7
- package/lib/ProForm/components/combination/ProCombination/index.js +35 -31
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +30 -24
- package/lib/ProForm/components/combination/ProModalSelect/index.js +171 -180
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/index.js +42 -48
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +35 -35
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +37 -34
- package/lib/ProForm/components/index.d.ts +1 -0
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.js +35 -33
- package/lib/ProForm/components/old/EnumSelect/index.js +50 -58
- package/lib/ProForm/components/old/InputRange/index.js +16 -16
- package/lib/ProForm/components/old/InputWithSuffix/index.js +4 -4
- package/lib/ProForm/components/old/ProAddress/index.js +53 -75
- package/lib/ProForm/components/old/ProCertNo/index.js +16 -17
- package/lib/ProForm/components/old/ProCertValidity/index.js +17 -18
- package/lib/ProForm/components/old/ProRangeBox/index.js +24 -24
- package/lib/ProForm/components/render/ChangedWrapper.js +35 -35
- package/lib/ProForm/components/render/ConfirmWrapper.js +14 -17
- package/lib/ProForm/components/render/Render.js +138 -125
- package/lib/ProForm/components/render/RenderFields.js +57 -43
- package/lib/ProForm/components/render/propsType.js +26 -1
- package/lib/ProForm/index.js +74 -61
- package/lib/ProForm/propsType.d.ts +1 -1
- package/lib/ProForm/propsType.js +5 -1
- package/lib/ProForm/utils/diffOriginal.js +30 -17
- package/lib/ProForm/utils/getDefaultProps.js +12 -12
- package/lib/ProForm/utils/index.js +127 -106
- package/lib/ProForm/utils/processDependencies.js +15 -6
- package/lib/ProForm/utils/rulesCreator.js +21 -21
- package/lib/ProForm/utils/transformNames.js +6 -6
- package/lib/ProForm/utils/transformValue.js +14 -11
- package/lib/ProForm/utils/useDeepCompareMemo.js +7 -6
- package/lib/ProForm/utils/useFieldProps.js +2 -3
- package/lib/ProForm/utils/useForm.js +33 -31
- package/lib/ProForm/utils/useRules.js +25 -28
- package/lib/ProForm/utils/useShouldUpdate.js +82 -85
- package/lib/ProForm/utils/useWatch.js +36 -14
- package/lib/ProForm/utils/valueType.js +52 -52
- package/lib/ProIcon/config/index.js +2 -0
- package/lib/ProIcon/index.js +47 -44
- package/lib/ProIcon/utils/index.js +10 -8
- package/lib/ProLayout/components/Layout/Header/index.js +10 -10
- package/lib/ProLayout/components/Layout/Icon/Icon.js +8 -7
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +37 -36
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +49 -52
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +8 -8
- package/lib/ProLayout/components/Layout/Menu/index.js +17 -16
- package/lib/ProLayout/components/Layout/Notice/index.js +8 -8
- package/lib/ProLayout/components/ProCollapse/index.js +32 -30
- package/lib/ProLayout/components/ProFooter/index.js +14 -16
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +7 -7
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -7
- package/lib/ProLayout/components/ProHeader/index.js +131 -120
- package/lib/ProLayout/components/ProHeader/utils/index.js +3 -2
- package/lib/ProLayout/index.d.ts +1 -1
- package/lib/ProLayout/index.js +22 -21
- package/lib/ProLayout/utils/index.js +42 -33
- package/lib/ProSelect/components/AdaptiveTooltip.js +9 -11
- package/lib/ProSelect/index.js +82 -93
- package/lib/ProSelect/utils/index.js +29 -34
- package/lib/ProStep/components/Anchor/index.d.ts +1 -0
- package/lib/ProStep/components/Anchor/index.js +25 -24
- package/lib/ProStep/components/Item/index.d.ts +1 -0
- package/lib/ProStep/components/Item/index.js +24 -20
- package/lib/ProStep/components/Listener/index.js +9 -13
- package/lib/ProStep/components/Step/index.js +20 -21
- package/lib/ProStep/index.js +45 -49
- package/lib/ProStep/utils/index.js +16 -12
- package/lib/ProStepTab/index.js +60 -38
- package/lib/ProTable/components/FormatColumn/index.js +100 -104
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +5 -7
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +34 -48
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +25 -23
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +5 -7
- package/lib/ProTable/components/RenderColumn/index.js +46 -48
- package/lib/ProTable/components/RenderEmptyText/index.js +6 -6
- package/lib/ProTable/components/RenderFooter/index.js +3 -3
- package/lib/ProTable/components/RenderSummary/index.js +11 -12
- package/lib/ProTable/components/RenderTableHeader/index.js +14 -13
- package/lib/ProTable/components/RenderTabs/index.js +27 -32
- package/lib/ProTable/components/TableResizable/index.js +16 -15
- package/lib/ProTable/components/TooltipTitle/index.js +5 -5
- package/lib/ProTable/hooks/useAntdTable.js +103 -116
- package/lib/ProTable/index.js +149 -169
- package/lib/ProTable/utils/index.js +33 -22
- package/lib/ProTabs/components/Card/index.js +14 -14
- package/lib/ProTabs/index.js +24 -24
- package/lib/ProThemeTools/component/ProTools/index.js +66 -65
- package/lib/ProThemeTools/index.js +43 -29
- package/lib/ProThemeTools/utils/index.js +25 -18
- package/lib/ProTooltip/index.js +44 -46
- package/lib/ProTree/components/AdaptiveTooltip.js +5 -7
- package/lib/ProTree/components/CloseIcon.js +5 -5
- package/lib/ProTree/components/List.js +18 -22
- package/lib/ProTree/components/ProTree.js +77 -96
- package/lib/ProTree/components/ProTreeSelect/index.js +126 -116
- package/lib/ProTree/components/SearchTitle.js +8 -8
- package/lib/ProTree/components/Tree.js +53 -55
- package/lib/ProTree/index.js +4 -4
- package/lib/ProTree/utils.js +34 -25
- package/lib/ProTreeModal/components/Cascader.js +28 -32
- package/lib/ProTreeModal/components/CloseIcon.js +5 -5
- package/lib/ProTreeModal/components/List.js +69 -89
- package/lib/ProTreeModal/components/SearchTitle.js +4 -4
- package/lib/ProTreeModal/components/SortableItem.js +11 -12
- package/lib/ProTreeModal/components/Tree.js +44 -49
- package/lib/ProTreeModal/components/Trigger.js +26 -26
- package/lib/ProTreeModal/index.js +157 -199
- package/lib/ProTreeModal/utils.js +43 -35
- package/lib/ProUpload/components/ButtonRender.js +29 -33
- package/lib/ProUpload/components/DragRender.js +50 -48
- package/lib/ProUpload/components/DraggableUploadListItem.js +7 -5
- package/lib/ProUpload/components/Example.js +13 -11
- package/lib/ProUpload/components/FileItem.js +58 -50
- package/lib/ProUpload/components/ImageRender.js +89 -93
- package/lib/ProUpload/index.js +68 -76
- package/lib/ProUpload/uitls.js +5 -3
- package/lib/ProUtils/utils/index.js +10 -14
- package/lib/ProViewer/index.js +26 -24
- package/lib/ProViewer/propsType.js +1 -5
- package/lib/ProWaterMark/index.js +5 -4
- package/lib/index.d.ts +1 -1
- package/lib/locale/index.js +6 -2
- package/lib/old/ProCertValidity/index.js +17 -18
- package/lib/old/ProEditableTable/index.js +153 -156
- package/lib/old/ProEditableTable/utils.js +61 -62
- package/lib/tokens.js +1 -0
- package/lib/utils/index.js +16 -13
- package/package.json +8 -8
- package/dist/index.esm.css +0 -6344
- package/dist/index.esm.js +0 -3
- package/dist/less.esm.css +0 -5768
- package/dist/less.esm.js +0 -3
package/es/ProEditTable/index.js
CHANGED
@@ -1,33 +1,30 @@
|
|
1
1
|
import "antd/es/affix/style";
|
2
2
|
import _Affix from "antd/es/affix";
|
3
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
4
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
5
4
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
6
5
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
7
6
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
8
7
|
import "antd/es/config-provider/style";
|
9
8
|
import _ConfigProvider from "antd/es/config-provider";
|
10
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
11
9
|
import "antd/es/form/style";
|
12
10
|
import _Form from "antd/es/form";
|
13
11
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
14
|
-
import _set from "lodash/set";
|
15
|
-
import _isBoolean from "lodash/isBoolean";
|
16
|
-
import _isArray from "lodash/isArray";
|
17
|
-
import _get from "lodash/get";
|
18
12
|
var _excluded = ["value", "onChange", "onDrag", "onDragEnd", "className", "columns", "type", "mode", "stripe", "draggable", "virtual", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "rowKey", "rowDisabled", "rowDraggable", "footerRender", "scroll", "actionDirection", "diffConfig"];
|
19
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
20
13
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
14
|
+
import { get, isArray, isBoolean, set } from 'lodash';
|
21
15
|
import { useDeepCompareEffect, useLocalStorageState, useSetState } from 'ahooks';
|
22
16
|
import classnames from 'classnames';
|
23
|
-
import { transformColumns } from
|
24
|
-
import { getRandom, getNamePath, handleScrollToError, onPageCheck } from
|
25
|
-
import { Validator, Summary, RenderToolbar } from
|
26
|
-
import ProForm from
|
27
|
-
import Empty from
|
28
|
-
import locale, { formatMessage } from
|
29
|
-
import { BaseTable, DraggableTable, VirtualTable } from
|
30
|
-
|
17
|
+
import { transformColumns } from "./utils";
|
18
|
+
import { getRandom, getNamePath, handleScrollToError, onPageCheck } from "./utils/tools";
|
19
|
+
import { Validator, Summary, RenderToolbar } from "./components";
|
20
|
+
import ProForm from "../ProForm";
|
21
|
+
import Empty from "../assets/empty.png";
|
22
|
+
import locale, { formatMessage } from "../locale";
|
23
|
+
import { BaseTable, DraggableTable, VirtualTable } from "./components/RcTable";
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
25
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
26
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
27
|
+
var ProEditTable = (_ref, ref) => {
|
31
28
|
var _resetProps$id, _resetProps$id$split, _themeConfig$data2, _resetProps$otherProp;
|
32
29
|
var value = _ref.value,
|
33
30
|
onChange = _ref.onChange,
|
@@ -69,15 +66,16 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
69
66
|
var formFieldProps = ProForm.useFieldProps() || {};
|
70
67
|
var affixRef = useRef(null);
|
71
68
|
var form = contentForm || (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.form) || (resetProps === null || resetProps === void 0 ? void 0 : resetProps.form);
|
72
|
-
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
|
69
|
+
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, '_'));
|
73
70
|
var _formFieldProps$isVie = formFieldProps.isView,
|
74
71
|
isView = _formFieldProps$isVie === void 0 ? false : _formFieldProps$isVie,
|
75
72
|
_formFieldProps$viewE = formFieldProps.viewEmpty,
|
76
73
|
viewEmpty = _formFieldProps$viewE === void 0 ? '-' : _formFieldProps$viewE,
|
77
74
|
namePath = formFieldProps.namePath;
|
75
|
+
|
78
76
|
// 判断是否在formList内
|
79
|
-
if (namePath
|
80
|
-
name = [
|
77
|
+
if (namePath !== null && namePath !== void 0 && namePath.length) {
|
78
|
+
name = [...namePath, ...name.slice(1)];
|
81
79
|
disabled = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.disabled) || disabled; // formFieldProps?.disabled可能是函数??
|
82
80
|
}
|
83
81
|
var tableRef = useRef(null);
|
@@ -89,17 +87,23 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
89
87
|
var _useLocalStorageState = useLocalStorageState('themeConfig'),
|
90
88
|
_useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 1),
|
91
89
|
themeConfig = _useLocalStorageState2[0];
|
92
|
-
var requiredAlign = useMemo(
|
90
|
+
var requiredAlign = useMemo(() => {
|
93
91
|
var _ref2, _themeConfig$data$zau, _themeConfig$data;
|
94
|
-
return (_ref2 = (_themeConfig$data$zau = themeConfig === null || themeConfig === void 0
|
95
|
-
}, [themeConfig === null || themeConfig === void 0
|
92
|
+
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';
|
93
|
+
}, [themeConfig === null || themeConfig === void 0 || (_themeConfig$data2 = themeConfig.data) === null || _themeConfig$data2 === void 0 ? void 0 : _themeConfig$data2.zauiFormAlign, configRequiredAlign]);
|
96
94
|
var _useSetState = useSetState({
|
97
95
|
cellNamePath: [],
|
96
|
+
// hover模式下正在编辑的单元格路径
|
98
97
|
forceUpdate: {},
|
98
|
+
// 表格内部强制刷新开关
|
99
99
|
editingKeys: [],
|
100
|
+
// 正在编辑行的row-key集合
|
100
101
|
selectedRowKeys: [],
|
102
|
+
// 当前选中行的row-key集合
|
101
103
|
selectedRows: [],
|
104
|
+
// 当前选中行的row-key集合
|
102
105
|
virtualKey: type === 'single' || mode === 'single' ? getRandom() : '',
|
106
|
+
// 单行编辑生成个随机formItem的key
|
103
107
|
page: {
|
104
108
|
pageNum: 1,
|
105
109
|
pageSize: (pagination === null || pagination === void 0 ? void 0 : pagination.pageSize) || 10
|
@@ -115,15 +119,16 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
115
119
|
selectedRowKeys = state.selectedRowKeys,
|
116
120
|
selectedRows = state.selectedRows,
|
117
121
|
page = state.page;
|
118
|
-
var virtualRowName = getNamePath(
|
122
|
+
var virtualRowName = getNamePath(isArray(name) ? name : [name], virtualKey);
|
123
|
+
|
119
124
|
// 样式处理
|
120
125
|
var _className = classnames({
|
121
126
|
'pro-edit-table': true,
|
122
127
|
'pro-edit-table-drag': draggable,
|
123
128
|
'pro-table-no-stripe': !stripe,
|
124
|
-
className
|
129
|
+
className
|
125
130
|
});
|
126
|
-
var getRowKey =
|
131
|
+
var getRowKey = record => {
|
127
132
|
var key = record.rowKey || getRandom();
|
128
133
|
if (rowKey) {
|
129
134
|
var _ref3;
|
@@ -131,43 +136,38 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
131
136
|
}
|
132
137
|
return key;
|
133
138
|
};
|
134
|
-
var originalValues = useMemo(
|
139
|
+
var originalValues = useMemo(() => {
|
135
140
|
var _originalArr$every, _originalArr$some;
|
136
141
|
var nextOriginalValues;
|
137
142
|
// 原始值也需要设置对应的rowkey,后续比对通过rowkey对比
|
138
|
-
var originalArr =
|
139
|
-
var isOriginalAllHasKey = originalArr ? originalArr === null || originalArr === void 0
|
140
|
-
|
141
|
-
}) : true;
|
142
|
-
var isNeedCoverOriginal = originalArr === null || originalArr === void 0 ? void 0 : (_originalArr$some = originalArr.some) === null || _originalArr$some === void 0 ? void 0 : _originalArr$some.call(originalArr, function (item) {
|
143
|
-
return item.rowKey !== getRowKey(item);
|
144
|
-
});
|
143
|
+
var originalArr = get(resetProps === null || resetProps === void 0 ? void 0 : resetProps.originalValues, name);
|
144
|
+
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;
|
145
|
+
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));
|
145
146
|
// 初始化默认生成row-key
|
146
|
-
if (
|
147
|
+
if (originalArr !== null && originalArr !== void 0 && originalArr.length && (!isOriginalAllHasKey || isNeedCoverOriginal)) {
|
147
148
|
var _originalArr$forEach;
|
148
|
-
originalArr === null || originalArr === void 0
|
149
|
+
originalArr === null || originalArr === void 0 || (_originalArr$forEach = originalArr.forEach) === null || _originalArr$forEach === void 0 || _originalArr$forEach.call(originalArr, item => {
|
149
150
|
item.rowKey = getRowKey(item);
|
150
151
|
});
|
151
152
|
}
|
152
|
-
if (originalArr
|
153
|
+
if (originalArr !== null && originalArr !== void 0 && originalArr.length) {
|
153
154
|
nextOriginalValues = {};
|
154
|
-
|
155
|
+
set(nextOriginalValues, name, originalArr);
|
155
156
|
}
|
156
157
|
return nextOriginalValues;
|
157
158
|
}, [resetProps === null || resetProps === void 0 ? void 0 : resetProps.originalValues]);
|
158
|
-
var getIsNew =
|
159
|
+
var getIsNew = record => {
|
159
160
|
var _originalArr$find;
|
160
|
-
var originalArr =
|
161
|
-
if (!(originalArr
|
161
|
+
var originalArr = get(originalValues, name);
|
162
|
+
if (!(originalArr !== null && originalArr !== void 0 && originalArr.length)) {
|
162
163
|
return false;
|
163
164
|
}
|
164
|
-
return !(originalArr
|
165
|
-
return getRowKey(item) === getRowKey(record);
|
166
|
-
}));
|
165
|
+
return !(originalArr !== null && originalArr !== void 0 && (_originalArr$find = originalArr.find) !== null && _originalArr$find !== void 0 && _originalArr$find.call(originalArr, item => getRowKey(item) === getRowKey(record)));
|
167
166
|
};
|
167
|
+
|
168
168
|
// 分页变更
|
169
|
-
var handlePageChange = useCallback(/*#__PURE__*/function () {
|
170
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(current, pageSize) {
|
169
|
+
var handlePageChange = useCallback( /*#__PURE__*/function () {
|
170
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(current, pageSize) {
|
171
171
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
172
172
|
while (1) switch (_context.prev = _context.next) {
|
173
173
|
case 0:
|
@@ -183,7 +183,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
183
183
|
setState({
|
184
184
|
page: {
|
185
185
|
pageNum: current,
|
186
|
-
pageSize
|
186
|
+
pageSize
|
187
187
|
}
|
188
188
|
});
|
189
189
|
return _context.abrupt("return");
|
@@ -217,61 +217,62 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
217
217
|
};
|
218
218
|
}(), [pagination, page.pageSize, form, name]);
|
219
219
|
var config = _objectSpread({
|
220
|
-
form
|
221
|
-
mode
|
222
|
-
isView
|
223
|
-
viewEmpty
|
224
|
-
disabled
|
225
|
-
cellNamePath
|
226
|
-
forceUpdate
|
227
|
-
insertType
|
228
|
-
emptyBtnText
|
229
|
-
editingKeys
|
230
|
-
actionWidth
|
231
|
-
actionProps
|
232
|
-
toolbarProps
|
233
|
-
setState
|
234
|
-
selectedRowKeys
|
235
|
-
selectedRows
|
236
|
-
onlyOneLineMsg
|
237
|
-
deletePoConfirmMsg
|
238
|
-
mulDeletePoConfirmMsg
|
239
|
-
virtualKey
|
240
|
-
requiredAlign
|
241
|
-
name:
|
242
|
-
|
243
|
-
|
244
|
-
|
220
|
+
form,
|
221
|
+
mode,
|
222
|
+
isView,
|
223
|
+
viewEmpty,
|
224
|
+
disabled,
|
225
|
+
cellNamePath,
|
226
|
+
forceUpdate,
|
227
|
+
insertType,
|
228
|
+
emptyBtnText,
|
229
|
+
editingKeys,
|
230
|
+
actionWidth,
|
231
|
+
actionProps,
|
232
|
+
toolbarProps,
|
233
|
+
setState,
|
234
|
+
selectedRowKeys,
|
235
|
+
selectedRows,
|
236
|
+
onlyOneLineMsg,
|
237
|
+
deletePoConfirmMsg,
|
238
|
+
mulDeletePoConfirmMsg,
|
239
|
+
virtualKey,
|
240
|
+
requiredAlign,
|
241
|
+
name: isArray(name) ? name : [name],
|
242
|
+
// name需要处理成namePath形式,为兼容多路径
|
243
|
+
namePath,
|
244
|
+
tableRef,
|
245
|
+
max,
|
245
246
|
tableLength: value === null || value === void 0 ? void 0 : value.length,
|
246
|
-
page
|
247
|
-
originalValues
|
248
|
-
prefixCls
|
249
|
-
rowDisabled
|
250
|
-
actionDirection
|
251
|
-
diffConfig: _objectSpread(_objectSpread({}, resetProps === null || resetProps === void 0
|
252
|
-
getIsNew
|
253
|
-
handlePageChange
|
247
|
+
page,
|
248
|
+
originalValues,
|
249
|
+
prefixCls,
|
250
|
+
rowDisabled,
|
251
|
+
actionDirection,
|
252
|
+
diffConfig: _objectSpread(_objectSpread({}, resetProps === null || resetProps === void 0 || (_resetProps$otherProp = resetProps.otherProps) === null || _resetProps$otherProp === void 0 ? void 0 : _resetProps$otherProp.diffConfig), diffConfig),
|
253
|
+
getIsNew,
|
254
|
+
handlePageChange
|
254
255
|
}, resetProps);
|
256
|
+
|
255
257
|
// 编辑行设置下样式
|
256
|
-
var _rowClassName =
|
258
|
+
var _rowClassName = record => {
|
257
259
|
var isEdit = !virtualKey || editingKeys.includes(record.rowKey);
|
258
260
|
var className = isEdit ? 'is-editing' : '';
|
259
261
|
if (getIsNew(record)) {
|
260
|
-
return
|
262
|
+
return `is-new-row ${className}`;
|
261
263
|
}
|
262
264
|
return className;
|
263
265
|
};
|
266
|
+
|
264
267
|
// 判断是否禁止添加、批量删除
|
265
|
-
var isForbiddenBtn = useCallback(
|
268
|
+
var isForbiddenBtn = useCallback(type => {
|
266
269
|
// 当工具栏不渲染时,都不渲染
|
267
270
|
if (toolbarProps === false) {
|
268
271
|
return true;
|
269
272
|
}
|
270
273
|
// 通过配置项配置show 为 false 开启关闭添加与批量删除
|
271
274
|
if (Array.isArray(toolbarProps)) {
|
272
|
-
var addBtnConfig = toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.find(
|
273
|
-
return item.type === type;
|
274
|
-
});
|
275
|
+
var addBtnConfig = toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.find(item => item.type === type);
|
275
276
|
if (typeof (addBtnConfig === null || addBtnConfig === void 0 ? void 0 : addBtnConfig.show) === 'function') {
|
276
277
|
var result = addBtnConfig.show();
|
277
278
|
addBtnConfig.show = result;
|
@@ -280,19 +281,21 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
280
281
|
}
|
281
282
|
return false;
|
282
283
|
}, [toolbarProps]);
|
284
|
+
|
283
285
|
// 是否隐藏勾选框
|
284
286
|
var isHideCheckBox = isForbiddenBtn('mulDelete');
|
287
|
+
|
285
288
|
// 复选框
|
286
289
|
var _rowSelection = _objectSpread({
|
287
290
|
fixed: true,
|
288
|
-
selectedRowKeys
|
289
|
-
onChange:
|
291
|
+
selectedRowKeys,
|
292
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
290
293
|
setState({
|
291
|
-
selectedRowKeys
|
292
|
-
selectedRows
|
294
|
+
selectedRowKeys,
|
295
|
+
selectedRows
|
293
296
|
});
|
294
297
|
},
|
295
|
-
getCheckboxProps
|
298
|
+
getCheckboxProps(record) {
|
296
299
|
if (rowDisabled) {
|
297
300
|
var _disabled = rowDisabled(record);
|
298
301
|
return {
|
@@ -303,33 +306,33 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
303
306
|
},
|
304
307
|
hideSelectAll: isHideCheckBox
|
305
308
|
}, rowSelection);
|
309
|
+
|
306
310
|
// 空列表状态
|
307
|
-
var empty =
|
308
|
-
var
|
309
|
-
return _jsxs("div", {
|
311
|
+
var empty = () => {
|
312
|
+
var _filter, _ref5;
|
313
|
+
return /*#__PURE__*/_jsxs("div", {
|
310
314
|
className: "com-empty",
|
311
|
-
children: [_jsx("img", {
|
315
|
+
children: [/*#__PURE__*/_jsx("img", {
|
312
316
|
className: "img",
|
313
317
|
src: Empty,
|
314
318
|
alt: "Empty"
|
315
|
-
}), _jsx("div", {
|
319
|
+
}), /*#__PURE__*/_jsx("div", {
|
316
320
|
className: "content",
|
317
|
-
children: disabled || isForbiddenBtn('add') ? locale.ProEditTable.noData : _jsxs(_Fragment, {
|
318
|
-
children: [locale.ProEditTable.noData, "\uFF0C", _jsx(RenderToolbar, _objectSpread({}, _objectSpread(_objectSpread({}, config), {}, {
|
319
|
-
toolbarProps: toolbarProps === null || toolbarProps === void 0
|
320
|
-
return item.type === 'add' || (item === null || item === void 0 ? void 0 : item.persistence);
|
321
|
-
}),
|
321
|
+
children: disabled || isForbiddenBtn('add') ? locale.ProEditTable.noData : /*#__PURE__*/_jsxs(_Fragment, {
|
322
|
+
children: [locale.ProEditTable.noData, "\uFF0C", /*#__PURE__*/_jsx(RenderToolbar, _objectSpread({}, _objectSpread(_objectSpread({}, config), {}, {
|
323
|
+
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)),
|
322
324
|
dataSource: []
|
323
325
|
})))]
|
324
326
|
})
|
325
327
|
})]
|
326
328
|
});
|
327
329
|
};
|
330
|
+
|
328
331
|
/**
|
329
332
|
* 渲染表格选择器
|
330
333
|
* @returns rowSelection
|
331
334
|
*/
|
332
|
-
var renderRowSelection =
|
335
|
+
var renderRowSelection = () => {
|
333
336
|
if (disabled || isView) {
|
334
337
|
return null;
|
335
338
|
}
|
@@ -341,128 +344,121 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
341
344
|
}
|
342
345
|
return null;
|
343
346
|
};
|
344
|
-
useDeepCompareEffect(
|
347
|
+
useDeepCompareEffect(() => {
|
345
348
|
valueChangeRef.current += 1;
|
346
349
|
// 在这里根据需要计算新的数组
|
347
350
|
}, [value, config.name]);
|
348
|
-
var _columns = useMemo(
|
351
|
+
var _columns = useMemo(() => {
|
349
352
|
return transformColumns(columns, config);
|
350
353
|
}, [valueChangeRef.current, disabled, forceUpdate, columns, page, actionProps, editingKeys, cellNamePath, value === null || value === void 0 ? void 0 : value.length]);
|
351
|
-
var initDataSource =
|
354
|
+
var initDataSource = () => {
|
352
355
|
var _value$every, _value$some;
|
353
|
-
var isAllHasKey = value === null || value === void 0
|
354
|
-
|
355
|
-
});
|
356
|
+
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);
|
357
|
+
|
356
358
|
// 检测当前rowkey是否与制定key的值是否一致,不一致,则执行覆盖
|
357
|
-
var isNeedCover = value === null || value === void 0
|
358
|
-
return item.rowKey !== getRowKey(item);
|
359
|
-
});
|
359
|
+
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(item));
|
360
360
|
// 初始化默认生成row-key
|
361
|
-
if (
|
362
|
-
var nextValues = value === null || value === void 0 ? void 0 : value.map(
|
361
|
+
if (value !== null && value !== void 0 && value.length && (!isAllHasKey || isNeedCover)) {
|
362
|
+
var nextValues = value === null || value === void 0 ? void 0 : value.map(item => {
|
363
363
|
return _objectSpread(_objectSpread({}, item), {}, {
|
364
364
|
rowKey: getRowKey(item)
|
365
365
|
});
|
366
366
|
});
|
367
|
-
onChange === null || onChange === void 0
|
367
|
+
onChange === null || onChange === void 0 || onChange(nextValues);
|
368
368
|
if (virtualKey) {
|
369
369
|
form.setFieldValue(virtualRowName, nextValues);
|
370
370
|
}
|
371
371
|
}
|
372
372
|
};
|
373
|
-
useEffect(
|
373
|
+
useEffect(() => {
|
374
374
|
initDataSource();
|
375
375
|
}, [value, originalValues]);
|
376
|
-
useImperativeHandle((resetProps === null || resetProps === void 0 ? void 0 : resetProps.ref) || ref,
|
376
|
+
useImperativeHandle((resetProps === null || resetProps === void 0 ? void 0 : resetProps.ref) || ref, () => {
|
377
377
|
return {
|
378
|
-
getInternalState:
|
379
|
-
return state;
|
380
|
-
},
|
378
|
+
getInternalState: () => state,
|
381
379
|
setInternalState: setState
|
382
380
|
};
|
383
381
|
});
|
384
|
-
useEffect(
|
382
|
+
useEffect(() => {
|
385
383
|
if (toolbarSticky) {
|
386
|
-
var updatePos =
|
384
|
+
var updatePos = () => {
|
387
385
|
var _affixRef$current, _affixRef$current$upd;
|
388
|
-
affixRef === null || affixRef === void 0
|
386
|
+
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);
|
389
387
|
};
|
390
388
|
window.addEventListener('scroll', updatePos, true);
|
391
|
-
return
|
389
|
+
return () => {
|
392
390
|
window.removeEventListener('scroll', updatePos, true);
|
393
391
|
};
|
394
392
|
}
|
395
393
|
}, [toolbarSticky]);
|
396
|
-
var _toolbarSticky =
|
397
|
-
var _summary =
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
});
|
403
|
-
} : summary;
|
394
|
+
var _toolbarSticky = isBoolean(toolbarSticky) ? {} : toolbarSticky;
|
395
|
+
var _summary = typeof summary === 'object' ? data => /*#__PURE__*/_jsx(Summary, {
|
396
|
+
data: data,
|
397
|
+
summary: summary,
|
398
|
+
rowSelection: renderRowSelection()
|
399
|
+
}) : summary;
|
404
400
|
var TableComponent = draggable ? DraggableTable : virtual ? VirtualTable : BaseTable;
|
405
|
-
return _jsxs(_Fragment, {
|
406
|
-
children: [_jsxs(_ConfigProvider, {
|
407
|
-
renderEmpty:
|
408
|
-
children: [_jsx(TableComponent, _objectSpread(_objectSpread({}, resetProps), {}, {
|
401
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
402
|
+
children: [/*#__PURE__*/_jsxs(_ConfigProvider, {
|
403
|
+
renderEmpty: value !== null && value !== void 0 && value.length ? undefined : empty,
|
404
|
+
children: [/*#__PURE__*/_jsx(TableComponent, _objectSpread(_objectSpread({}, resetProps), {}, {
|
409
405
|
draggableProps: {
|
410
|
-
onChange
|
411
|
-
onDrag
|
412
|
-
onDragEnd
|
413
|
-
draggable
|
406
|
+
onChange,
|
407
|
+
onDrag,
|
408
|
+
onDragEnd,
|
409
|
+
draggable
|
414
410
|
},
|
415
411
|
tableProps: {
|
416
|
-
value
|
417
|
-
headerRender
|
418
|
-
tableRef
|
412
|
+
value,
|
413
|
+
headerRender,
|
414
|
+
tableRef,
|
419
415
|
className: _className,
|
420
416
|
columns: _columns,
|
421
|
-
renderRowSelection
|
417
|
+
renderRowSelection,
|
422
418
|
rowClassName: _rowClassName,
|
423
|
-
disabled
|
424
|
-
virtualKey
|
425
|
-
editingKeys
|
426
|
-
isHideCheckBox
|
427
|
-
rowDraggable
|
428
|
-
pagination
|
429
|
-
scroll
|
419
|
+
disabled,
|
420
|
+
virtualKey,
|
421
|
+
editingKeys,
|
422
|
+
isHideCheckBox,
|
423
|
+
rowDraggable,
|
424
|
+
pagination,
|
425
|
+
scroll,
|
430
426
|
summary: _summary,
|
431
|
-
page
|
432
|
-
formatMessage
|
433
|
-
locale
|
434
|
-
handlePageChange
|
427
|
+
page,
|
428
|
+
formatMessage,
|
429
|
+
locale,
|
430
|
+
handlePageChange
|
435
431
|
}
|
436
|
-
})), !isView &&
|
432
|
+
})), !isView && value !== null && value !== void 0 && value.length ? toolbarSticky ? /*#__PURE__*/_jsx(_Affix, _objectSpread(_objectSpread({
|
437
433
|
ref: affixRef
|
438
434
|
}, _toolbarSticky), {}, {
|
439
|
-
children: _jsx("div", {
|
440
|
-
className:
|
441
|
-
children: _jsx(RenderToolbar, _objectSpread({}, config))
|
435
|
+
children: /*#__PURE__*/_jsx("div", {
|
436
|
+
className: `pro-edit-table-toolbar${pagination ? ' pro-edit-table-toolbar-fixed' : ''}`,
|
437
|
+
children: /*#__PURE__*/_jsx(RenderToolbar, _objectSpread({}, config))
|
442
438
|
})
|
443
|
-
})) : _jsx("div", {
|
444
|
-
className:
|
445
|
-
children: _jsx(RenderToolbar, _objectSpread({}, config))
|
446
|
-
}) : null, footerRender ? _jsx("div", {
|
439
|
+
})) : /*#__PURE__*/_jsx("div", {
|
440
|
+
className: `pro-edit-table-toolbar${pagination ? ' pro-edit-table-toolbar-fixed' : ''}`,
|
441
|
+
children: /*#__PURE__*/_jsx(RenderToolbar, _objectSpread({}, config))
|
442
|
+
}) : null, footerRender ? /*#__PURE__*/_jsx("div", {
|
447
443
|
className: "pro-edit-table-footer",
|
448
444
|
children: footerRender
|
449
|
-
}) : null, pagination ? _jsx("div", {
|
450
|
-
id:
|
451
|
-
onClick:
|
445
|
+
}) : null, pagination ? /*#__PURE__*/_jsx("div", {
|
446
|
+
id: `pro-edit-table-pagination-${config.name.join('-')}`,
|
447
|
+
onClick: () => {
|
452
448
|
onPageCheck({
|
453
|
-
form
|
454
|
-
name
|
455
|
-
value
|
456
|
-
columns
|
457
|
-
page
|
458
|
-
pagination
|
459
|
-
isView
|
460
|
-
disabled
|
461
|
-
setState
|
449
|
+
form,
|
450
|
+
name,
|
451
|
+
value,
|
452
|
+
columns,
|
453
|
+
page,
|
454
|
+
pagination,
|
455
|
+
isView,
|
456
|
+
disabled,
|
457
|
+
setState
|
462
458
|
});
|
463
459
|
}
|
464
460
|
}) : null]
|
465
|
-
}), _jsx(Validator, {
|
461
|
+
}), /*#__PURE__*/_jsx(Validator, {
|
466
462
|
name: name,
|
467
463
|
virtualKey: virtualKey,
|
468
464
|
editingKeys: editingKeys,
|
@@ -488,5 +484,6 @@ ForwardProEditTable.defaultProps = {
|
|
488
484
|
deletePoConfirmMsg: locale.ProEditTable.deletePoConfirmMsg,
|
489
485
|
mulDeletePoConfirmMsg: locale.ProEditTable.mulDeletePoConfirmMsg
|
490
486
|
};
|
487
|
+
|
491
488
|
// 导出组件
|
492
489
|
export default ForwardProEditTable;
|