@zat-design/sisyphus-react 3.13.19-beta.6 → 3.13.19-beta.8
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/.claude/settings.local.json +9 -0
- package/PROJECT_GUIDE.md +250 -0
- package/dist/sisyphus-react.min.css +2 -0
- package/dist/sisyphus-react.min.js +1 -0
- 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 +25 -19
- 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 +16 -16
- package/es/ProEnum/index.js +80 -89
- package/es/ProEnum/utils/eventCenter.js +23 -32
- package/es/ProEnum/utils/frequentEnum.js +15 -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 +23 -16
- 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 +15 -15
- package/lib/ProEnum/index.js +68 -78
- package/lib/ProEnum/utils/eventCenter.js +23 -32
- package/lib/ProEnum/utils/frequentEnum.js +13 -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 +6 -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
@@ -1,43 +1,36 @@
|
|
1
1
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
2
2
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
4
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
5
|
-
import _get from "lodash/get";
|
6
|
-
import _isBoolean from "lodash/isBoolean";
|
7
|
-
import _isFunction from "lodash/isFunction";
|
8
|
-
import _transform from "lodash/transform";
|
9
|
-
import _isEqual from "lodash/isEqual";
|
10
|
-
import _isObject from "lodash/isObject";
|
11
|
-
import _isString from "lodash/isString";
|
12
|
-
import _cloneDeepWith from "lodash/cloneDeepWith";
|
13
|
-
import _cloneDeep from "lodash/cloneDeep";
|
14
4
|
/* eslint-disable no-await-in-loop */
|
15
5
|
/* eslint-disable no-restricted-syntax */
|
16
6
|
import React from 'react';
|
17
7
|
import { tools, validate } from '@zat-design/utils';
|
8
|
+
import { cloneDeep, cloneDeepWith, isString, isObject, isEqual, transform, isFunction, isBoolean, get } from 'lodash';
|
18
9
|
/**
|
19
10
|
* 生成随机字符串
|
20
11
|
* @returns 随机字符串
|
21
12
|
*/
|
22
|
-
export var getRandom =
|
13
|
+
export var getRandom = () => {
|
23
14
|
return Math.random().toString(36).slice(-6);
|
24
15
|
};
|
16
|
+
|
25
17
|
/**
|
26
18
|
* 深层次对比两个对象且取出来差异值
|
27
19
|
* @param object 比较对象
|
28
20
|
* @param base 基准对象
|
29
21
|
* @returns 差异对象
|
30
22
|
*/
|
31
|
-
export var difference =
|
32
|
-
var
|
33
|
-
return
|
34
|
-
if (!
|
35
|
-
result[key] =
|
23
|
+
export var difference = (object, base) => {
|
24
|
+
var changes = (object, base) => {
|
25
|
+
return transform(object, (result, value, key) => {
|
26
|
+
if (!isEqual(value, base === null || base === void 0 ? void 0 : base[key])) {
|
27
|
+
result[key] = isObject(value) && isObject(base === null || base === void 0 ? void 0 : base[key]) ? changes(value, base === null || base === void 0 ? void 0 : base[key]) : value;
|
36
28
|
}
|
37
29
|
});
|
38
30
|
};
|
39
|
-
return
|
31
|
+
return changes(object, base);
|
40
32
|
};
|
33
|
+
|
41
34
|
/**
|
42
35
|
* 数组字段循环校验,解决validateFields无法批量校验的问题
|
43
36
|
* @param validateKeys 校验键数组
|
@@ -45,74 +38,74 @@ export var difference = function difference(object, base) {
|
|
45
38
|
* @param rowName 行名称路径
|
46
39
|
* @returns 校验结果Promise
|
47
40
|
*/
|
48
|
-
export var customValidate =
|
41
|
+
export var customValidate = (validateKeys, form, rowName) => {
|
49
42
|
var array = [];
|
50
|
-
validateKeys.forEach(
|
51
|
-
array.push([
|
43
|
+
validateKeys.forEach(key => {
|
44
|
+
array.push([...(Array.isArray(rowName) ? rowName : [rowName]), key]);
|
52
45
|
});
|
53
46
|
return form.validateFields(array);
|
54
47
|
};
|
48
|
+
|
55
49
|
/**
|
56
50
|
* 拆解数组names
|
57
51
|
* @param names 名称数组
|
58
52
|
* @returns 拆解后的字符串
|
59
53
|
*/
|
60
|
-
export var splitNames =
|
54
|
+
export var splitNames = names => {
|
61
55
|
var result;
|
62
56
|
var resultArray = [];
|
63
|
-
if (
|
57
|
+
if (isString(names[0])) {
|
64
58
|
result = names.join('-');
|
65
59
|
return result;
|
66
60
|
}
|
67
|
-
names.forEach(
|
68
|
-
if (
|
69
|
-
resultArray.push(
|
61
|
+
names.forEach(item => {
|
62
|
+
if (isString(item[0])) {
|
63
|
+
resultArray.push(`${item[0]}_${item[1]}`);
|
70
64
|
}
|
71
65
|
});
|
72
66
|
result = resultArray.join('-');
|
73
67
|
return result;
|
74
68
|
};
|
69
|
+
|
75
70
|
/**
|
76
71
|
* 获取中间formItem的name
|
77
72
|
* @param name 名称路径
|
78
73
|
* @param virtualKey 虚拟键
|
79
74
|
* @returns 完整名称路径数组
|
80
75
|
*/
|
81
|
-
export var getNamePath =
|
82
|
-
var nextName =
|
76
|
+
export var getNamePath = (name, virtualKey) => {
|
77
|
+
var nextName = cloneDeep(Array.isArray(name) ? name : [name]);
|
83
78
|
var lastIndex = nextName.length - 1;
|
84
79
|
// 确保最后一个元素是字符串类型
|
85
|
-
nextName[lastIndex] =
|
80
|
+
nextName[lastIndex] = `${nextName[lastIndex]}${virtualKey ? `-${virtualKey}` : ''}`;
|
86
81
|
return nextName;
|
87
82
|
};
|
83
|
+
|
88
84
|
/**
|
89
85
|
* 删除操作
|
90
86
|
* @param params 删除参数
|
91
87
|
*/
|
92
|
-
export var onDelete =
|
88
|
+
export var onDelete = _ref => {
|
93
89
|
var name = _ref.name,
|
94
90
|
form = _ref.form,
|
95
91
|
virtualKey = _ref.virtualKey,
|
96
92
|
selectedRowKeys = _ref.selectedRowKeys;
|
97
93
|
// 正常的form数据流处理
|
98
94
|
var dataSource = form.getFieldValue(name);
|
99
|
-
dataSource = dataSource.filter(
|
100
|
-
return !selectedRowKeys.includes(row.rowKey);
|
101
|
-
});
|
95
|
+
dataSource = dataSource.filter(row => !selectedRowKeys.includes(row.rowKey));
|
102
96
|
form.setFieldValue(name, dataSource);
|
103
97
|
// 单行模式数据流处理 重置中间正在编辑状态单行数据
|
104
98
|
if (virtualKey) {
|
105
99
|
var _virtualList;
|
106
100
|
var namePath = getNamePath(name, virtualKey);
|
107
101
|
var virtualList = form.getFieldValue(namePath);
|
108
|
-
if ((_virtualList = virtualList)
|
109
|
-
virtualList = virtualList.filter(
|
110
|
-
return !selectedRowKeys.includes(row.rowKey);
|
111
|
-
});
|
102
|
+
if ((_virtualList = virtualList) !== null && _virtualList !== void 0 && _virtualList.length) {
|
103
|
+
virtualList = virtualList.filter(row => !selectedRowKeys.includes(row.rowKey));
|
112
104
|
form.setFieldValue(namePath, virtualList);
|
113
105
|
}
|
114
106
|
}
|
115
107
|
};
|
108
|
+
|
116
109
|
/**
|
117
110
|
* 获取最终的disabled, 两种模式【子级优先,全局优先】
|
118
111
|
* 全局优先:globalControl为true时,全局控制
|
@@ -120,7 +113,7 @@ export var onDelete = function onDelete(_ref) {
|
|
120
113
|
* @param params 禁用参数
|
121
114
|
* @returns 是否禁用
|
122
115
|
*/
|
123
|
-
export var getDisabled =
|
116
|
+
export var getDisabled = _ref2 => {
|
124
117
|
var _ref3, _column$disabled;
|
125
118
|
var globalControl = _ref2.globalControl,
|
126
119
|
formDisabled = _ref2.formDisabled,
|
@@ -129,7 +122,7 @@ export var getDisabled = function getDisabled(_ref2) {
|
|
129
122
|
columnFieldProps = _ref2.columnFieldProps,
|
130
123
|
params = _ref2.params,
|
131
124
|
rowDisabled = _ref2.rowDisabled;
|
132
|
-
var convertToBoolean =
|
125
|
+
var convertToBoolean = value => {
|
133
126
|
if (Array.isArray(value)) {
|
134
127
|
return Boolean(value.length);
|
135
128
|
}
|
@@ -141,16 +134,17 @@ export var getDisabled = function getDisabled(_ref2) {
|
|
141
134
|
}
|
142
135
|
return Boolean(value);
|
143
136
|
};
|
137
|
+
|
144
138
|
// 判断是否有column的disabled属性
|
145
|
-
var noColumnDisabled =
|
146
|
-
if (
|
139
|
+
var noColumnDisabled = () => {
|
140
|
+
if (isFunction(column === null || column === void 0 ? void 0 : column.disabled) || isFunction(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) || isBoolean(column === null || column === void 0 ? void 0 : column.disabled) || isBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
|
147
141
|
return false;
|
148
142
|
}
|
149
143
|
// 判断FieldProps是否有disabled属性
|
150
|
-
if (
|
151
|
-
var _columnFieldProps = columnFieldProps
|
144
|
+
if (isFunction(columnFieldProps)) {
|
145
|
+
var _columnFieldProps = columnFieldProps(...params),
|
152
146
|
disabled = _columnFieldProps.disabled;
|
153
|
-
if (
|
147
|
+
if (isFunction(disabled) || isBoolean(disabled)) {
|
154
148
|
return false;
|
155
149
|
}
|
156
150
|
}
|
@@ -162,6 +156,7 @@ export var getDisabled = function getDisabled(_ref2) {
|
|
162
156
|
if (rowDisabled === 'empty') {
|
163
157
|
return false;
|
164
158
|
}
|
159
|
+
|
165
160
|
// 日期范围选择器和数字范围选择器
|
166
161
|
if (['RangePicker', 'ProNumberRange', 'Group'].includes(column.type)) {
|
167
162
|
if (Array.isArray(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
|
@@ -170,38 +165,41 @@ export var getDisabled = function getDisabled(_ref2) {
|
|
170
165
|
if (Array.isArray(column === null || column === void 0 ? void 0 : column.disabled)) {
|
171
166
|
return column.disabled;
|
172
167
|
}
|
173
|
-
if (
|
174
|
-
return column === null || column === void 0 ? void 0 : column.disabled
|
168
|
+
if (isFunction(column === null || column === void 0 ? void 0 : column.disabled)) {
|
169
|
+
return column === null || column === void 0 ? void 0 : column.disabled(...params);
|
175
170
|
}
|
176
171
|
}
|
172
|
+
|
177
173
|
// 当表单含有diabled属性时,优先使用表单的disabled
|
178
|
-
if (
|
174
|
+
if (isFunction(rowDisabled) && noColumnDisabled()) {
|
179
175
|
return rowDisabled(params[1]);
|
180
176
|
}
|
181
|
-
if (
|
182
|
-
return convertToBoolean(column === null || column === void 0 ? void 0 : column.disabled
|
177
|
+
if (isFunction(column === null || column === void 0 ? void 0 : column.disabled)) {
|
178
|
+
return convertToBoolean(column === null || column === void 0 ? void 0 : column.disabled(...params));
|
183
179
|
}
|
180
|
+
|
184
181
|
// 表单FieldProps为函数时
|
185
|
-
if (
|
186
|
-
var _columnFieldProps2 = columnFieldProps
|
182
|
+
if (isFunction(columnFieldProps)) {
|
183
|
+
var _columnFieldProps2 = columnFieldProps(...params),
|
187
184
|
disabled = _columnFieldProps2.disabled;
|
188
|
-
if (
|
189
|
-
return convertToBoolean(disabled
|
185
|
+
if (isFunction(disabled)) {
|
186
|
+
return convertToBoolean(disabled(...params));
|
190
187
|
}
|
191
|
-
if (
|
188
|
+
if (isBoolean(disabled)) {
|
192
189
|
return convertToBoolean(disabled);
|
193
190
|
}
|
194
191
|
}
|
195
|
-
if (
|
196
|
-
return convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled
|
192
|
+
if (isFunction(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
|
193
|
+
return convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled(...params));
|
197
194
|
}
|
198
195
|
return convertToBoolean((_ref3 = (_column$disabled = column === null || column === void 0 ? void 0 : column.disabled) !== null && _column$disabled !== void 0 ? _column$disabled : columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) !== null && _ref3 !== void 0 ? _ref3 : tabledDisabled);
|
199
196
|
};
|
197
|
+
|
200
198
|
/**
|
201
199
|
* 表格自动滚动到报错位置
|
202
200
|
*/
|
203
|
-
export var handleScrollToError =
|
204
|
-
setTimeout(
|
201
|
+
export var handleScrollToError = () => {
|
202
|
+
setTimeout(() => {
|
205
203
|
var errorDom = document.querySelector('[class*="form-item-has-error"]');
|
206
204
|
if (errorDom) {
|
207
205
|
var tableBody = errorDom.closest('[class*="table-content"]') || errorDom.closest('[class*="table-body"]');
|
@@ -214,27 +212,27 @@ export var handleScrollToError = function handleScrollToError() {
|
|
214
212
|
var childOffsetTop = 0;
|
215
213
|
while (previousSibling) {
|
216
214
|
if (previousSibling.nodeType === 1) {
|
217
|
-
var _previousSibling, _previousSibling$
|
215
|
+
var _previousSibling, _previousSibling$cont, _previousSibling2;
|
218
216
|
var _ref4 = previousSibling.getBoundingClientRect() || {},
|
219
217
|
_ref4$width = _ref4.width,
|
220
218
|
width = _ref4$width === void 0 ? 0 : _ref4$width;
|
221
219
|
childOffsetLeft += width;
|
222
|
-
if ((_previousSibling = previousSibling)
|
220
|
+
if ((_previousSibling = previousSibling) !== null && _previousSibling !== void 0 && (_previousSibling = _previousSibling.classList) !== null && _previousSibling !== void 0 && (_previousSibling$cont = (_previousSibling2 = _previousSibling).contains) !== null && _previousSibling$cont !== void 0 && _previousSibling$cont.call(_previousSibling2, 'ant-table-cell-fix-left')) {
|
223
221
|
childFixedLeft += width;
|
224
222
|
}
|
225
223
|
}
|
226
224
|
previousSibling = previousSibling.previousElementSibling;
|
227
225
|
}
|
228
226
|
if (tableRow) {
|
229
|
-
var
|
230
|
-
while (
|
231
|
-
if (
|
232
|
-
var _ref5 =
|
227
|
+
var _previousSibling3 = tableRow.previousElementSibling;
|
228
|
+
while (_previousSibling3) {
|
229
|
+
if (_previousSibling3.nodeType === 1) {
|
230
|
+
var _ref5 = _previousSibling3.getBoundingClientRect() || {},
|
233
231
|
_ref5$height = _ref5.height,
|
234
232
|
height = _ref5$height === void 0 ? 0 : _ref5$height;
|
235
233
|
childOffsetTop += height;
|
236
234
|
}
|
237
|
-
|
235
|
+
_previousSibling3 = _previousSibling3.previousElementSibling;
|
238
236
|
}
|
239
237
|
}
|
240
238
|
tableBody.scrollTo({
|
@@ -246,33 +244,33 @@ export var handleScrollToError = function handleScrollToError() {
|
|
246
244
|
}
|
247
245
|
}, 0);
|
248
246
|
};
|
247
|
+
|
249
248
|
/**
|
250
249
|
* 深copy一个对象,并过滤掉其中的React节点
|
251
250
|
* @param value 需要深拷贝的对象
|
252
251
|
* @returns 深拷贝后的对象,其中的React节点会被保留
|
253
252
|
*/
|
254
253
|
export function cloneDeepFilterNode(value) {
|
255
|
-
return
|
256
|
-
if (/*#__PURE__*/React.isValidElement(val)) {
|
254
|
+
return cloneDeepWith(value, val => {
|
255
|
+
if ( /*#__PURE__*/React.isValidElement(val)) {
|
257
256
|
return val;
|
258
257
|
}
|
259
258
|
});
|
260
259
|
}
|
260
|
+
|
261
261
|
/**
|
262
262
|
* 判断值是否为空
|
263
263
|
* @param value 需要判断的值
|
264
264
|
* @returns 是否为空
|
265
265
|
*/
|
266
|
-
var
|
266
|
+
var isNull = value => {
|
267
267
|
if (Array.isArray(value) && value.length) {
|
268
|
-
return value.some(
|
269
|
-
return _isNull(item);
|
270
|
-
});
|
268
|
+
return value.some(item => isNull(item));
|
271
269
|
}
|
272
270
|
return value === '' || value === undefined || value === null || Array.isArray(value) && value.length === 0;
|
273
271
|
};
|
274
272
|
var handleCheckCellValue = /*#__PURE__*/function () {
|
275
|
-
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(column, record) {
|
273
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(column, record) {
|
276
274
|
var _column$names, _column$names2, _rules2;
|
277
275
|
var value, _required, _rules, _labelRequired, res, _iterator, _step, rule;
|
278
276
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -280,38 +278,38 @@ var handleCheckCellValue = /*#__PURE__*/function () {
|
|
280
278
|
case 0:
|
281
279
|
value = null;
|
282
280
|
if (column.name) {
|
283
|
-
value =
|
281
|
+
value = get(record, column.name);
|
284
282
|
}
|
285
|
-
if ((_column$names = column.names)
|
286
|
-
value = column.names.map(
|
287
|
-
return
|
283
|
+
if ((_column$names = column.names) !== null && _column$names !== void 0 && _column$names.length) {
|
284
|
+
value = column.names.map(key => {
|
285
|
+
return get(record, key);
|
288
286
|
});
|
289
287
|
}
|
290
288
|
_required = column.required;
|
291
289
|
_rules = column.rules;
|
292
290
|
_labelRequired = column.labelRequired;
|
293
|
-
if (
|
291
|
+
if (isFunction(column.required)) {
|
294
292
|
_required = column.required(value, record);
|
295
293
|
}
|
296
|
-
if (
|
294
|
+
if (isFunction(column.rules)) {
|
297
295
|
_rules = column.rules(value, record);
|
298
296
|
}
|
299
|
-
if (
|
297
|
+
if (isFunction(column.labelRequired)) {
|
300
298
|
_labelRequired = column.labelRequired(value, record);
|
301
299
|
}
|
302
|
-
if (!((
|
300
|
+
if (!((_column$names2 = column.names) !== null && _column$names2 !== void 0 && _column$names2.length && _labelRequired !== null && _labelRequired !== undefined && isNull(value))) {
|
303
301
|
_context.next = 11;
|
304
302
|
break;
|
305
303
|
}
|
306
304
|
return _context.abrupt("return", false);
|
307
305
|
case 11:
|
308
|
-
if (!(_required &&
|
306
|
+
if (!(_required && isNull(value))) {
|
309
307
|
_context.next = 13;
|
310
308
|
break;
|
311
309
|
}
|
312
310
|
return _context.abrupt("return", false);
|
313
311
|
case 13:
|
314
|
-
if (!((_rules2 = _rules)
|
312
|
+
if (!((_rules2 = _rules) !== null && _rules2 !== void 0 && _rules2.length)) {
|
315
313
|
_context.next = 44;
|
316
314
|
break;
|
317
315
|
}
|
@@ -331,10 +329,10 @@ var handleCheckCellValue = /*#__PURE__*/function () {
|
|
331
329
|
}
|
332
330
|
return _context.abrupt("break", 35);
|
333
331
|
case 22:
|
334
|
-
if (rule.required &&
|
332
|
+
if (rule.required && isNull(value)) {
|
335
333
|
res = false;
|
336
334
|
}
|
337
|
-
if (!
|
335
|
+
if (!isFunction(rule.validator)) {
|
338
336
|
_context.next = 32;
|
339
337
|
break;
|
340
338
|
}
|
@@ -380,12 +378,13 @@ var handleCheckCellValue = /*#__PURE__*/function () {
|
|
380
378
|
return _ref6.apply(this, arguments);
|
381
379
|
};
|
382
380
|
}();
|
381
|
+
|
383
382
|
/**
|
384
383
|
* 分页校验
|
385
384
|
*/
|
386
385
|
export var onPageCheck = /*#__PURE__*/function () {
|
387
|
-
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref7) {
|
388
|
-
var form, name, value, columns, setState, page, pagination, isView, disabled, pageNum, pageSize, pageArr, flag, errorNum, errorPageNum, _i, _pageArr, item, start, end, nextValues, _iterator2, _step2,
|
386
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref7) {
|
387
|
+
var form, name, value, columns, setState, page, pagination, isView, disabled, pageNum, pageSize, pageArr, flag, errorNum, errorPageNum, _i, _pageArr, item, start, end, nextValues, _iterator2, _step2, _record, _iterator3, _step3, column, result, nextState;
|
389
388
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
390
389
|
while (1) switch (_context2.prev = _context2.next) {
|
391
390
|
case 0:
|
@@ -397,9 +396,7 @@ export var onPageCheck = /*#__PURE__*/function () {
|
|
397
396
|
pageNum = page.pageNum, pageSize = page.pageSize;
|
398
397
|
pageArr = Array.from({
|
399
398
|
length: Math.ceil(tools.calc(value.length, '/', pageSize))
|
400
|
-
},
|
401
|
-
return i + 1;
|
402
|
-
});
|
399
|
+
}, (_, i) => i + 1);
|
403
400
|
flag = false;
|
404
401
|
errorNum = 0;
|
405
402
|
errorPageNum = 0;
|
@@ -430,7 +427,7 @@ export var onPageCheck = /*#__PURE__*/function () {
|
|
430
427
|
_context2.next = 48;
|
431
428
|
break;
|
432
429
|
}
|
433
|
-
|
430
|
+
_record = _step2.value;
|
434
431
|
_iterator3 = _createForOfIteratorHelper(columns);
|
435
432
|
_context2.prev = 22;
|
436
433
|
_iterator3.s();
|
@@ -442,7 +439,7 @@ export var onPageCheck = /*#__PURE__*/function () {
|
|
442
439
|
column = _step3.value;
|
443
440
|
_context2.prev = 26;
|
444
441
|
_context2.next = 29;
|
445
|
-
return handleCheckCellValue(column,
|
442
|
+
return handleCheckCellValue(column, _record);
|
446
443
|
case 29:
|
447
444
|
result = _context2.sent;
|
448
445
|
if (!result) {
|
@@ -502,7 +499,7 @@ export var onPageCheck = /*#__PURE__*/function () {
|
|
502
499
|
if (pageNum !== errorPageNum) {
|
503
500
|
nextState.page = {
|
504
501
|
pageNum: errorPageNum,
|
505
|
-
pageSize
|
502
|
+
pageSize
|
506
503
|
};
|
507
504
|
}
|
508
505
|
setState(nextState);
|
@@ -1,15 +1,11 @@
|
|
1
1
|
import { transforms } from '@zat-design/utils';
|
2
2
|
var transformDate = transforms.transformDate;
|
3
3
|
export default {
|
4
|
-
RangePicker:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
return transformDate({
|
12
|
-
type: 'DatePicker'
|
13
|
-
});
|
14
|
-
}
|
4
|
+
RangePicker: () => transformDate({
|
5
|
+
type: 'RangePicker',
|
6
|
+
keys: ['form', 'to']
|
7
|
+
}),
|
8
|
+
DatePicker: () => transformDate({
|
9
|
+
type: 'DatePicker'
|
10
|
+
})
|
15
11
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
2
|
-
import _debounce from "lodash/debounce";
|
3
2
|
import { useState, useEffect } from 'react';
|
4
|
-
|
3
|
+
import { debounce } from 'lodash';
|
4
|
+
var useEditTableError = _ref => {
|
5
5
|
var containerNode = _ref.containerNode,
|
6
6
|
className = _ref.className,
|
7
7
|
isEnabled = _ref.isEnabled;
|
@@ -9,28 +9,30 @@ var useEditTableError = function useEditTableError(_ref) {
|
|
9
9
|
_useState2 = _slicedToArray(_useState, 2),
|
10
10
|
errorLength = _useState2[0],
|
11
11
|
setErrorLength = _useState2[1];
|
12
|
-
useEffect(
|
12
|
+
useEffect(() => {
|
13
13
|
// 如果 isEnabled 为 false 或容器节点不存在,直接跳过监听
|
14
14
|
if (!isEnabled || !containerNode) {
|
15
15
|
return; // 如果未启用监听或容器节点不存在,直接返回
|
16
16
|
}
|
17
|
+
|
17
18
|
// 防抖处理:将 setErrorLength 函数进行防抖
|
18
|
-
var debouncedSetErrorLength =
|
19
|
+
var debouncedSetErrorLength = debounce(errorCount => {
|
19
20
|
setErrorLength(errorCount); // 更新错误数量
|
20
21
|
}, 300); // 300ms 后更新状态
|
21
|
-
|
22
|
-
|
22
|
+
|
23
|
+
var observer = new MutationObserver(mutations => {
|
24
|
+
mutations.forEach(mutation => {
|
23
25
|
// 只处理节点的 class 属性变化
|
24
26
|
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
25
27
|
var target = mutation.target;
|
28
|
+
|
26
29
|
// 检查目标节点是否包含指定的类
|
27
30
|
if (target.classList.contains(className)) {
|
28
31
|
// 查找所有包含 className 的节点
|
29
|
-
var errorNodes = containerNode.querySelectorAll(
|
32
|
+
var errorNodes = containerNode.querySelectorAll(`.${className}`);
|
33
|
+
|
30
34
|
// 过滤这些节点,只保留那些类名完全为 `ant-form-item-explain-error` 的节点
|
31
|
-
var validErrorNodes = Array.from(errorNodes).filter(
|
32
|
-
return node.classList.length === 1 && node.classList.contains('ant-form-item-explain-error');
|
33
|
-
});
|
35
|
+
var validErrorNodes = Array.from(errorNodes).filter(node => node.classList.length === 1 && node.classList.contains('ant-form-item-explain-error'));
|
34
36
|
if (errorLength === 0) {
|
35
37
|
debouncedSetErrorLength(0);
|
36
38
|
}
|
@@ -41,13 +43,14 @@ var useEditTableError = function useEditTableError(_ref) {
|
|
41
43
|
debouncedSetErrorLength(validErrorNodes.length);
|
42
44
|
}
|
43
45
|
}
|
46
|
+
|
44
47
|
// 监听子节点的添加或删除
|
45
48
|
if (mutation.type === 'childList') {
|
46
49
|
// 检查删除的节点是否包含指定的类名
|
47
|
-
mutation.removedNodes.forEach(
|
50
|
+
mutation.removedNodes.forEach(removedNode => {
|
48
51
|
if (removedNode instanceof HTMLElement && removedNode.classList.contains('ant-table-row')) {
|
49
52
|
// 更新错误数量
|
50
|
-
var _errorNodes = containerNode.querySelectorAll(
|
53
|
+
var _errorNodes = containerNode.querySelectorAll(`.${className}`);
|
51
54
|
if (errorLength === 0) {
|
52
55
|
debouncedSetErrorLength(0);
|
53
56
|
}
|
@@ -63,18 +66,24 @@ var useEditTableError = function useEditTableError(_ref) {
|
|
63
66
|
});
|
64
67
|
var config = {
|
65
68
|
attributes: true,
|
69
|
+
// 监听属性的变化
|
66
70
|
subtree: true,
|
71
|
+
// 监听子节点的变化
|
67
72
|
attributeFilter: ['class'],
|
73
|
+
// 只监听 class 属性变化
|
68
74
|
childList: true
|
69
75
|
};
|
76
|
+
|
70
77
|
// 启动 MutationObserver
|
71
78
|
observer.observe(containerNode.querySelector('tbody'), config);
|
79
|
+
|
72
80
|
// 清理 MutationObserver 和防抖定时器
|
73
|
-
return
|
81
|
+
return () => {
|
74
82
|
observer.disconnect();
|
75
83
|
debouncedSetErrorLength.cancel(); // 取消防抖定时器
|
76
84
|
};
|
77
85
|
}, [containerNode, className, isEnabled]); // 当 isEnabled 改变时会重新启动或取消监听
|
86
|
+
|
78
87
|
return [errorLength];
|
79
88
|
};
|
80
89
|
export default useEditTableError;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
3
2
|
import classNames from 'classnames';
|
4
3
|
import { useEffect, useRef, useState } from 'react';
|
5
|
-
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
+
var Group = props => {
|
6
6
|
var value = props.value,
|
7
7
|
onChange = props.onChange,
|
8
8
|
dataSource = props.dataSource,
|
@@ -17,52 +17,48 @@ var Group = function Group(props) {
|
|
17
17
|
refresh = _useState2[0],
|
18
18
|
setRefresh = _useState2[1];
|
19
19
|
var idx = useRef(-1);
|
20
|
-
useEffect(
|
21
|
-
var index = dataSource.findIndex(
|
22
|
-
return item[fieldValue] === value;
|
23
|
-
});
|
20
|
+
useEffect(() => {
|
21
|
+
var index = dataSource.findIndex(item => item[fieldValue] === value);
|
24
22
|
idx.current = index;
|
25
23
|
setRefresh(!refresh);
|
26
24
|
}, [value]);
|
27
|
-
var handleClick =
|
25
|
+
var handleClick = (val, index) => {
|
28
26
|
if (value === val) {
|
29
27
|
if (!allowClear) {
|
30
28
|
return false;
|
31
29
|
}
|
32
|
-
onChange === null || onChange === void 0
|
30
|
+
onChange === null || onChange === void 0 || onChange('');
|
33
31
|
idx.current = -1;
|
34
32
|
} else {
|
35
33
|
idx.current = index;
|
36
|
-
onChange === null || onChange === void 0
|
34
|
+
onChange === null || onChange === void 0 || onChange(val);
|
37
35
|
}
|
38
36
|
};
|
39
37
|
if (dataSource.length === 0) {
|
40
|
-
return _jsx("span", {
|
38
|
+
return /*#__PURE__*/_jsx("span", {
|
41
39
|
children: "-"
|
42
40
|
});
|
43
41
|
}
|
44
|
-
return _jsx("div", {
|
42
|
+
return /*#__PURE__*/_jsx("div", {
|
45
43
|
id: id,
|
46
44
|
className: classNames({
|
47
45
|
'pro-enum-group-root': true,
|
48
46
|
'pro-enum-group-root-disabled': disabled
|
49
47
|
}),
|
50
|
-
children: dataSource.map(
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
}, item[fieldValue]);
|
65
|
-
})
|
48
|
+
children: dataSource.map((item, index) => /*#__PURE__*/_jsx("div", {
|
49
|
+
onClick: () => {
|
50
|
+
if (!item.disabled && !disabled) {
|
51
|
+
handleClick(item[fieldValue], index);
|
52
|
+
}
|
53
|
+
},
|
54
|
+
className: classNames({
|
55
|
+
'pro-enum-group-item': true,
|
56
|
+
'pro-enum-group-item-selected': value === item[fieldValue],
|
57
|
+
'pro-enum-group-item-disabled-after': index === idx.current || index + 1 === idx.current,
|
58
|
+
'pro-enum-group-item-disabled': item.disabled
|
59
|
+
}),
|
60
|
+
children: item[fieldLabel]
|
61
|
+
}, item[fieldValue]))
|
66
62
|
});
|
67
63
|
};
|
68
64
|
export default Group;
|