@zat-design/sisyphus-react 3.13.19-beta.1 → 3.13.19-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +1 -6344
- package/dist/index.min.js +1 -0
- package/dist/less.esm.css +1 -5768
- package/dist/less.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 +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.js +0 -3
- package/dist/less.esm.js +0 -3
@@ -1,19 +1,21 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
-
import _isBoolean from "lodash/isBoolean";
|
4
3
|
var _excluded = ["id", "title", "collapse", "children", "lazyLoad", "order"];
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
6
4
|
import { useEffect } from 'react';
|
7
5
|
import LazyLoad, { forceCheck } from 'react-lazyload';
|
8
|
-
import {
|
9
|
-
import
|
6
|
+
import { isBoolean } from 'lodash';
|
7
|
+
import { useStep } from "../../index";
|
8
|
+
import ProCollapse from "../../../ProLayout/components/ProCollapse";
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
10
10
|
// 默认的懒加载配置
|
11
11
|
var defaultLazyLoadConfig = {
|
12
12
|
height: 200,
|
13
|
+
// Default placeholder height
|
13
14
|
offset: 100,
|
15
|
+
// Start loading when the target is 100px from the viewport
|
14
16
|
once: true // Load only once upon first entry into the viewport
|
15
17
|
};
|
16
|
-
var ProStepItem =
|
18
|
+
var ProStepItem = _ref => {
|
17
19
|
var id = _ref.id,
|
18
20
|
title = _ref.title,
|
19
21
|
_ref$collapse = _ref.collapse,
|
@@ -28,56 +30,58 @@ var ProStepItem = function ProStepItem(_ref) {
|
|
28
30
|
collapse = _useStep.collapse,
|
29
31
|
globalLazyLoad = _useStep.lazyLoad;
|
30
32
|
var lazyLoad = stepLazyLoad !== null && stepLazyLoad !== void 0 ? stepLazyLoad : globalLazyLoad;
|
31
|
-
useEffect(
|
33
|
+
useEffect(() => {
|
32
34
|
// Schedule registration to avoid re-render issues
|
33
|
-
var timeoutId = setTimeout(
|
34
|
-
register === null || register === void 0
|
35
|
-
id
|
36
|
-
title
|
37
|
-
order
|
38
|
-
lazyLoad
|
35
|
+
var timeoutId = setTimeout(() => {
|
36
|
+
register === null || register === void 0 || register(_objectSpread({
|
37
|
+
id,
|
38
|
+
title,
|
39
|
+
order,
|
40
|
+
lazyLoad
|
39
41
|
}, restProps));
|
40
42
|
}, 0);
|
41
|
-
return
|
43
|
+
return () => {
|
42
44
|
clearTimeout(timeoutId);
|
43
45
|
};
|
44
46
|
}, [id, title, order, lazyLoad, restProps, register]);
|
45
|
-
var renderChildren =
|
47
|
+
var renderChildren = () => {
|
46
48
|
if (lazyLoad) {
|
47
|
-
var lazyLoadProps =
|
48
|
-
return _jsx(LazyLoad, _objectSpread(_objectSpread({}, lazyLoadProps), {}, {
|
49
|
+
var lazyLoadProps = isBoolean(lazyLoad) ? defaultLazyLoadConfig : lazyLoad;
|
50
|
+
return /*#__PURE__*/_jsx(LazyLoad, _objectSpread(_objectSpread({}, lazyLoadProps), {}, {
|
49
51
|
classNamePrefix: id,
|
50
52
|
children: children
|
51
53
|
}));
|
52
54
|
}
|
53
55
|
return children;
|
54
56
|
};
|
57
|
+
|
55
58
|
// If there's no `register` function or if collapsing is enabled, wrap in ProCollapse
|
56
59
|
if (!register || collapse && collapseItem && title) {
|
57
|
-
return _jsx("div", {
|
60
|
+
return /*#__PURE__*/_jsx("div", {
|
58
61
|
className: "pro-step-item",
|
59
62
|
id: id,
|
60
|
-
children: _jsx(ProCollapse, _objectSpread(_objectSpread({
|
63
|
+
children: /*#__PURE__*/_jsx(ProCollapse, _objectSpread(_objectSpread({
|
61
64
|
title: title,
|
62
65
|
icon: true
|
63
66
|
}, restProps), {}, {
|
64
|
-
onChange:
|
67
|
+
onChange: e => {
|
65
68
|
var _restProps$onChange;
|
66
69
|
if (lazyLoad) {
|
67
70
|
// 延时执行, 避免在折叠时, 懒加载的元素没有高度
|
68
|
-
setTimeout(
|
71
|
+
setTimeout(() => {
|
69
72
|
forceCheck();
|
70
73
|
}, 100);
|
71
74
|
}
|
72
75
|
// 默认执行
|
73
|
-
restProps === null || restProps === void 0
|
76
|
+
restProps === null || restProps === void 0 || (_restProps$onChange = restProps.onChange) === null || _restProps$onChange === void 0 || _restProps$onChange.call(restProps, e);
|
74
77
|
},
|
75
78
|
children: renderChildren()
|
76
79
|
}))
|
77
80
|
});
|
78
81
|
}
|
82
|
+
|
79
83
|
// Otherwise, just render children
|
80
|
-
return _jsx("div", {
|
84
|
+
return /*#__PURE__*/_jsx("div", {
|
81
85
|
className: "pro-step-item",
|
82
86
|
id: id,
|
83
87
|
children: renderChildren()
|
@@ -2,23 +2,21 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
5
|
-
import _throttle from "lodash/throttle";
|
6
5
|
var _excluded = ["children", "delayTime", "excludes"];
|
6
|
+
import { throttle } from 'lodash';
|
7
7
|
import React from 'react';
|
8
8
|
import { forceVisible } from 'react-lazyload';
|
9
|
-
import { useStep } from
|
10
|
-
import { getLoadedMap } from
|
9
|
+
import { useStep } from "../../index";
|
10
|
+
import { getLoadedMap } from "../../utils";
|
11
11
|
/**
|
12
12
|
* 检查所有模块是否已加载完成
|
13
13
|
* @param data 模块加载数据
|
14
14
|
* @returns 是否所有模块都已加载
|
15
15
|
*/
|
16
|
-
var areAllModulesLoaded =
|
17
|
-
return data.every(
|
18
|
-
return (item === null || item === void 0 ? void 0 : item.loaded) === true;
|
19
|
-
});
|
16
|
+
var areAllModulesLoaded = data => {
|
17
|
+
return data.every(item => (item === null || item === void 0 ? void 0 : item.loaded) === true);
|
20
18
|
};
|
21
|
-
var Listener =
|
19
|
+
var Listener = _ref => {
|
22
20
|
var children = _ref.children,
|
23
21
|
delayTime = _ref.delayTime,
|
24
22
|
excludes = _ref.excludes,
|
@@ -27,7 +25,7 @@ var Listener = function Listener(_ref) {
|
|
27
25
|
notify = _useStep.notify,
|
28
26
|
registerMap = _useStep.registerMap;
|
29
27
|
return /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, props), {}, {
|
30
|
-
onClick:
|
28
|
+
onClick: throttle( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
31
29
|
var loadedMap, loaded, values;
|
32
30
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
33
31
|
while (1) switch (_context.prev = _context.next) {
|
@@ -42,21 +40,19 @@ var Listener = function Listener(_ref) {
|
|
42
40
|
forceVisible();
|
43
41
|
// 等待0.2秒,让dom渲染做form校验
|
44
42
|
_context.next = 7;
|
45
|
-
return new Promise(
|
46
|
-
return setTimeout(resolve, 200);
|
47
|
-
});
|
43
|
+
return new Promise(resolve => setTimeout(resolve, 200));
|
48
44
|
case 7:
|
49
45
|
_context.next = 9;
|
50
46
|
return notify === null || notify === void 0 ? void 0 : notify({
|
51
|
-
excludes
|
47
|
+
excludes
|
52
48
|
});
|
53
49
|
case 9:
|
54
50
|
values = _context.sent;
|
55
|
-
setTimeout(
|
51
|
+
setTimeout(() => {
|
56
52
|
var localData = localStorage.getItem('cache-pro-step');
|
57
53
|
if (localData !== 'false') {
|
58
54
|
var _children$props, _children$props$onCli;
|
59
|
-
children === null || children === void 0
|
55
|
+
children === null || children === void 0 || (_children$props = children.props) === null || _children$props === void 0 || (_children$props$onCli = _children$props.onClick) === null || _children$props$onCli === void 0 || _children$props$onCli.call(_children$props, values);
|
60
56
|
}
|
61
57
|
}, delayTime !== null && delayTime !== void 0 ? delayTime : 0);
|
62
58
|
return _context.abrupt("return", null);
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
|
-
import _cloneDeep from "lodash/cloneDeep";
|
4
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
5
3
|
import React, { useMemo, useState } from 'react';
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
|
4
|
+
import { cloneDeep } from 'lodash';
|
5
|
+
import ProIcon from "../../../ProIcon/index";
|
6
|
+
import catalogSvg from "../../../assets/catalog.svg";
|
7
|
+
import Anchor from "../Anchor";
|
8
|
+
import locale from "../../../locale";
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
|
+
export var Step = _ref => {
|
11
12
|
var _locale$ProStep;
|
12
13
|
var fixedTop = _ref.fixedTop,
|
13
14
|
_ref$dataSource = _ref.dataSource,
|
@@ -21,17 +22,15 @@ export var Step = function Step(_ref) {
|
|
21
22
|
_useState2 = _slicedToArray(_useState, 2),
|
22
23
|
onOff = _useState2[0],
|
23
24
|
setOnOff = _useState2[1];
|
24
|
-
var options = useMemo(
|
25
|
-
var nextDataSource =
|
25
|
+
var options = useMemo(() => {
|
26
|
+
var nextDataSource = cloneDeep(dataSource);
|
26
27
|
var activeIndex;
|
27
28
|
if (activeKey) {
|
28
|
-
activeIndex = nextDataSource.findIndex(
|
29
|
-
return item.code === activeKey;
|
30
|
-
});
|
29
|
+
activeIndex = nextDataSource.findIndex(item => item.code === activeKey);
|
31
30
|
} else {
|
32
31
|
activeIndex = nextDataSource.length - 1;
|
33
32
|
}
|
34
|
-
nextDataSource.forEach(
|
33
|
+
nextDataSource.forEach((item, index) => {
|
35
34
|
var errorNum = errorCollection === null || errorCollection === void 0 ? void 0 : errorCollection[item.code];
|
36
35
|
item.isStart = index === 0;
|
37
36
|
item.isEnd = index === dataSource.length - 1;
|
@@ -44,32 +43,32 @@ export var Step = function Step(_ref) {
|
|
44
43
|
});
|
45
44
|
return nextDataSource;
|
46
45
|
}, [dataSource, activeKey, errorCollection]);
|
47
|
-
var handleMouseEnter =
|
46
|
+
var handleMouseEnter = () => {
|
48
47
|
setOnOff(true);
|
49
48
|
};
|
50
|
-
var handleMouseLeave =
|
49
|
+
var handleMouseLeave = () => {
|
51
50
|
setOnOff(false);
|
52
51
|
};
|
53
|
-
return _jsxs("div", {
|
54
|
-
className:
|
52
|
+
return /*#__PURE__*/_jsxs("div", {
|
53
|
+
className: `pro-step ${onOff ? 'open' : 'closed'}`,
|
55
54
|
style: _objectSpread({
|
56
55
|
top: fixedTop !== null && fixedTop !== void 0 ? fixedTop : 0,
|
57
|
-
maxHeight:
|
56
|
+
maxHeight: `calc(100vh - ${fixedTop}px)`
|
58
57
|
}, style),
|
59
58
|
onMouseEnter: handleMouseEnter,
|
60
59
|
onMouseLeave: handleMouseLeave,
|
61
|
-
children: [_jsxs("div", {
|
60
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
62
61
|
className: "pro-step-menu",
|
63
|
-
children: [_jsx(ProIcon, {
|
62
|
+
children: [/*#__PURE__*/_jsx(ProIcon, {
|
64
63
|
src: catalogSvg,
|
65
64
|
className: "pro-step-menu-icon",
|
66
65
|
actionMap: {}
|
67
|
-
}), onOff && _jsx("div", {
|
68
|
-
children: locale === null || locale === void 0
|
66
|
+
}), onOff && /*#__PURE__*/_jsx("div", {
|
67
|
+
children: locale === null || locale === void 0 || (_locale$ProStep = locale.ProStep) === null || _locale$ProStep === void 0 ? void 0 : _locale$ProStep.catalogue
|
69
68
|
})]
|
70
|
-
}), options.map(
|
71
|
-
return _jsx(React.Fragment, {
|
72
|
-
children: _jsx(Anchor, _objectSpread(_objectSpread({}, item), {}, {
|
69
|
+
}), options.map(item => {
|
70
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
71
|
+
children: /*#__PURE__*/_jsx(Anchor, _objectSpread(_objectSpread({}, item), {}, {
|
73
72
|
scrollToError: scrollToError,
|
74
73
|
onOff: onOff
|
75
74
|
}))
|
package/es/ProStep/index.js
CHANGED
@@ -3,23 +3,25 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
6
|
-
import _debounce from "lodash/debounce";
|
7
6
|
var _excluded = ["children"],
|
8
7
|
_excluded2 = ["id", "form", "title", "validator", "order", "disabled", "lazyLoad"];
|
9
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
10
8
|
import { createContext, useCallback, useContext, useMemo, useRef, useState } from 'react';
|
9
|
+
import { debounce } from 'lodash';
|
11
10
|
import { useSetState, useLocalStorageState } from 'ahooks';
|
12
|
-
import { handleScroll, handleScrollError } from
|
13
|
-
import Step from
|
14
|
-
import Item from
|
15
|
-
import Listener from
|
16
|
-
import
|
11
|
+
import { handleScroll, handleScrollError } from "./utils";
|
12
|
+
import Step from "./components/Step";
|
13
|
+
import Item from "./components/Item";
|
14
|
+
import Listener from "./components/Listener";
|
15
|
+
import "./style/index.less";
|
16
|
+
|
17
17
|
// 创建上下文并提供类型
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
19
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
18
20
|
export var ProStepContext = /*#__PURE__*/createContext(null);
|
19
|
-
export var useStep =
|
21
|
+
export var useStep = () => {
|
20
22
|
return useContext(ProStepContext) || {};
|
21
23
|
};
|
22
|
-
var ProStep =
|
24
|
+
var ProStep = _ref => {
|
23
25
|
var children = _ref.children,
|
24
26
|
resetProps = _objectWithoutProperties(_ref, _excluded);
|
25
27
|
var _useState = useState({}),
|
@@ -41,12 +43,12 @@ var ProStep = function ProStep(_ref) {
|
|
41
43
|
collapse = _resetProps$collapse === void 0 ? false : _resetProps$collapse,
|
42
44
|
_resetProps$lazyLoad = resetProps.lazyLoad,
|
43
45
|
lazyLoad = _resetProps$lazyLoad === void 0 ? false : _resetProps$lazyLoad;
|
44
|
-
var dataSource = useMemo(
|
46
|
+
var dataSource = useMemo(() => {
|
45
47
|
var _Object$entries, _Object$entries$map;
|
46
|
-
if (resetProps
|
48
|
+
if (resetProps !== null && resetProps !== void 0 && resetProps.dataSource) {
|
47
49
|
return resetProps === null || resetProps === void 0 ? void 0 : resetProps.dataSource;
|
48
50
|
}
|
49
|
-
return (_Object$entries = Object.entries(registerMap.current)) === null || _Object$entries === void 0
|
51
|
+
return (_Object$entries = Object.entries(registerMap.current)) === null || _Object$entries === void 0 || (_Object$entries$map = _Object$entries.map) === null || _Object$entries$map === void 0 ? void 0 : _Object$entries$map.call(_Object$entries, _ref2 => {
|
50
52
|
var _ref3 = _slicedToArray(_ref2, 2),
|
51
53
|
key = _ref3[0],
|
52
54
|
_ref3$ = _ref3[1],
|
@@ -55,20 +57,17 @@ var ProStep = function ProStep(_ref) {
|
|
55
57
|
return {
|
56
58
|
code: key,
|
57
59
|
name: title,
|
58
|
-
order
|
60
|
+
order
|
59
61
|
};
|
60
|
-
}).filter(
|
62
|
+
}).filter(item => {
|
61
63
|
var _ids$includes;
|
62
|
-
return ids === null || ids === void 0
|
63
|
-
}).sort(
|
64
|
-
return pre.order - next.order;
|
65
|
-
});
|
64
|
+
return ids === null || ids === void 0 || (_ids$includes = ids.includes) === null || _ids$includes === void 0 ? void 0 : _ids$includes.call(ids, item.code);
|
65
|
+
}).sort((pre, next) => pre.order - next.order);
|
66
66
|
}, [resetProps === null || resetProps === void 0 ? void 0 : resetProps.dataSource, registerMap.current, ids]);
|
67
|
-
var debounceReRender = useCallback(
|
68
|
-
|
69
|
-
}, 500), []);
|
67
|
+
var debounceReRender = useCallback(debounce(() => reRender({}), 500), []);
|
68
|
+
|
70
69
|
// 用来注册form匹配到对应的模块id
|
71
|
-
var register =
|
70
|
+
var register = _ref4 => {
|
72
71
|
var id = _ref4.id,
|
73
72
|
form = _ref4.form,
|
74
73
|
title = _ref4.title,
|
@@ -89,7 +88,7 @@ var ProStep = function ProStep(_ref) {
|
|
89
88
|
return;
|
90
89
|
}
|
91
90
|
var subEvent = /*#__PURE__*/function () {
|
92
|
-
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
91
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
93
92
|
var value, _form$validateFields, _error$errorFields;
|
94
93
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
95
94
|
while (1) switch (_context.prev = _context.next) {
|
@@ -108,7 +107,7 @@ var ProStep = function ProStep(_ref) {
|
|
108
107
|
break;
|
109
108
|
case 8:
|
110
109
|
_context.next = 10;
|
111
|
-
return form === null || form === void 0
|
110
|
+
return form === null || form === void 0 || (_form$validateFields = form.validateFields) === null || _form$validateFields === void 0 ? void 0 : _form$validateFields.call(form);
|
112
111
|
case 10:
|
113
112
|
value = _context.sent;
|
114
113
|
case 11:
|
@@ -116,7 +115,7 @@ var ProStep = function ProStep(_ref) {
|
|
116
115
|
case 14:
|
117
116
|
_context.prev = 14;
|
118
117
|
_context.t0 = _context["catch"](0);
|
119
|
-
if (_context.t0
|
118
|
+
if (_context.t0 !== null && _context.t0 !== void 0 && (_error$errorFields = _context.t0.errorFields) !== null && _error$errorFields !== void 0 && _error$errorFields.length) {
|
120
119
|
console.error(_context.t0);
|
121
120
|
setLocalData(false);
|
122
121
|
}
|
@@ -134,39 +133,38 @@ var ProStep = function ProStep(_ref) {
|
|
134
133
|
record.subEvent = subEvent;
|
135
134
|
registerMap.current[id] = record;
|
136
135
|
};
|
136
|
+
|
137
137
|
// 取消注册
|
138
|
-
var unNotify =
|
138
|
+
var unNotify = keys => {
|
139
139
|
if (typeof keys === 'string') {
|
140
140
|
delete registerMap.current[keys];
|
141
141
|
} else if (Array.isArray(keys)) {
|
142
|
-
keys.forEach(
|
142
|
+
keys.forEach(key => {
|
143
143
|
delete registerMap.current[key];
|
144
144
|
});
|
145
145
|
}
|
146
146
|
};
|
147
147
|
var notify = /*#__PURE__*/function () {
|
148
|
-
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
148
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
149
149
|
var _ref7, excludes, triggerIds, events, res, nextErrorCollection;
|
150
150
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
151
151
|
while (1) switch (_context2.prev = _context2.next) {
|
152
152
|
case 0:
|
153
153
|
_ref7 = params || {}, excludes = _ref7.excludes;
|
154
154
|
triggerIds = Object.keys(registerMap.current); // 排除指定模块不触发校验
|
155
|
-
if (excludes
|
156
|
-
triggerIds = triggerIds.filter(
|
157
|
-
return !excludes.includes(id);
|
158
|
-
});
|
155
|
+
if (excludes !== null && excludes !== void 0 && excludes.length) {
|
156
|
+
triggerIds = triggerIds.filter(id => !excludes.includes(id));
|
159
157
|
}
|
160
|
-
events = triggerIds.map(
|
158
|
+
events = triggerIds.map(id => {
|
161
159
|
var _registerMap$current$, _registerMap$current$2;
|
162
|
-
return (_registerMap$current$ = registerMap.current[id]) === null || _registerMap$current$ === void 0
|
160
|
+
return (_registerMap$current$ = registerMap.current[id]) === null || _registerMap$current$ === void 0 || (_registerMap$current$2 = _registerMap$current$.subEvent) === null || _registerMap$current$2 === void 0 ? void 0 : _registerMap$current$2.call(_registerMap$current$);
|
163
161
|
});
|
164
162
|
_context2.next = 6;
|
165
163
|
return Promise.all(events);
|
166
164
|
case 6:
|
167
165
|
res = _context2.sent;
|
168
166
|
nextErrorCollection = {};
|
169
|
-
triggerIds.forEach(
|
167
|
+
triggerIds.forEach((id, index) => {
|
170
168
|
var _ref8 = (res === null || res === void 0 ? void 0 : res[index]) || {},
|
171
169
|
errorFields = _ref8.errorFields;
|
172
170
|
nextErrorCollection[id] = (errorFields === null || errorFields === void 0 ? void 0 : errorFields.length) || 0;
|
@@ -187,26 +185,26 @@ var ProStep = function ProStep(_ref) {
|
|
187
185
|
};
|
188
186
|
}();
|
189
187
|
var triggerTo = /*#__PURE__*/function () {
|
190
|
-
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(keys) {
|
188
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(keys) {
|
191
189
|
var events, result, nextErrorCollection;
|
192
190
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
193
191
|
while (1) switch (_context3.prev = _context3.next) {
|
194
192
|
case 0:
|
195
193
|
events = [];
|
196
|
-
keys === null || keys === void 0
|
197
|
-
var _registerMap$current, _registerMap$current$3
|
198
|
-
events.push(registerMap === null || registerMap === void 0
|
194
|
+
keys === null || keys === void 0 || keys.forEach(key => {
|
195
|
+
var _registerMap$current, _registerMap$current$3;
|
196
|
+
events.push(registerMap === null || registerMap === void 0 || (_registerMap$current = registerMap.current) === null || _registerMap$current === void 0 || (_registerMap$current = _registerMap$current[key]) === null || _registerMap$current === void 0 || (_registerMap$current$3 = _registerMap$current.subEvent) === null || _registerMap$current$3 === void 0 ? void 0 : _registerMap$current$3.call(_registerMap$current));
|
199
197
|
});
|
200
198
|
_context3.next = 4;
|
201
199
|
return Promise.all(events);
|
202
200
|
case 4:
|
203
201
|
result = _context3.sent;
|
204
202
|
nextErrorCollection = {};
|
205
|
-
result === null || result === void 0
|
203
|
+
result === null || result === void 0 || result.forEach((item, index) => {
|
206
204
|
var _item$errorFields;
|
207
|
-
if (item
|
205
|
+
if (item !== null && item !== void 0 && (_item$errorFields = item.errorFields) !== null && _item$errorFields !== void 0 && _item$errorFields.length) {
|
208
206
|
var _item$errorFields2;
|
209
|
-
nextErrorCollection[keys[index]] = item === null || item === void 0
|
207
|
+
nextErrorCollection[keys[index]] = item === null || item === void 0 || (_item$errorFields2 = item.errorFields) === null || _item$errorFields2 === void 0 ? void 0 : _item$errorFields2.length;
|
210
208
|
}
|
211
209
|
});
|
212
210
|
setState({
|
@@ -224,22 +222,22 @@ var ProStep = function ProStep(_ref) {
|
|
224
222
|
return _ref9.apply(this, arguments);
|
225
223
|
};
|
226
224
|
}();
|
227
|
-
return _jsx(ProStepContext.Provider, {
|
225
|
+
return /*#__PURE__*/_jsx(ProStepContext.Provider, {
|
228
226
|
value: {
|
229
|
-
registerMap
|
230
|
-
collapse
|
231
|
-
register
|
232
|
-
notify
|
233
|
-
triggerTo
|
234
|
-
handleScroll
|
235
|
-
lazyLoad
|
236
|
-
unNotify
|
227
|
+
registerMap,
|
228
|
+
collapse,
|
229
|
+
register,
|
230
|
+
notify,
|
231
|
+
triggerTo,
|
232
|
+
handleScroll,
|
233
|
+
lazyLoad,
|
234
|
+
unNotify,
|
237
235
|
source: 'ProStep'
|
238
236
|
},
|
239
|
-
children: _jsxs("div", {
|
237
|
+
children: /*#__PURE__*/_jsxs("div", {
|
240
238
|
className: "pro-step-wrapper",
|
241
239
|
id: "pro-step",
|
242
|
-
children: [children, _jsx(Step, _objectSpread(_objectSpread({}, resetProps), {}, {
|
240
|
+
children: [children, /*#__PURE__*/_jsx(Step, _objectSpread(_objectSpread({}, resetProps), {}, {
|
243
241
|
dataSource: dataSource,
|
244
242
|
errorCollection: errorCollection
|
245
243
|
}))]
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
-
import
|
3
|
-
import _debounce from "lodash/debounce";
|
2
|
+
import { debounce, pick } from 'lodash';
|
4
3
|
/**
|
5
4
|
* 滚动到错误位置, 延迟200ms解决ProForm错误还未生成
|
6
5
|
*/
|
7
|
-
export var handleScrollError =
|
8
|
-
setTimeout(
|
6
|
+
export var handleScrollError = dom => {
|
7
|
+
setTimeout(() => {
|
9
8
|
var errorDom = dom || document.querySelector('[class*="form-item-has-error"]');
|
10
9
|
if (errorDom) {
|
11
10
|
errorDom.scrollIntoView({
|
@@ -15,18 +14,19 @@ export var handleScrollError = function handleScrollError(dom) {
|
|
15
14
|
}
|
16
15
|
}, 200);
|
17
16
|
};
|
17
|
+
|
18
18
|
/**
|
19
19
|
* 处理滚动到指定元素位置, 如发现有错误, 则优先滚动到错误位置
|
20
20
|
* @param id 目标元素的ID
|
21
21
|
* @param options 滚动选项
|
22
22
|
*/
|
23
|
-
export var handleScroll =
|
23
|
+
export var handleScroll = (id, options) => {
|
24
24
|
var _ref = options || {},
|
25
25
|
_ref$targetOffset = _ref.targetOffset,
|
26
26
|
targetOffset = _ref$targetOffset === void 0 ? 0 : _ref$targetOffset,
|
27
27
|
scrollToError = _ref.scrollToError;
|
28
28
|
if (!scrollToError) return;
|
29
|
-
var dom = document.querySelector(
|
29
|
+
var dom = document.querySelector(`#${id}`);
|
30
30
|
if (dom) {
|
31
31
|
// 查找指定id下的错误表单项
|
32
32
|
var errorDom = dom.querySelector('[class*="form-item-has-error"]');
|
@@ -35,7 +35,7 @@ export var handleScroll = function handleScroll(id, options) {
|
|
35
35
|
handleScrollError(errorDom);
|
36
36
|
} else {
|
37
37
|
// 如果没有错误表单项,则滚动到指定元素位置
|
38
|
-
setTimeout(
|
38
|
+
setTimeout(debounce(() => {
|
39
39
|
window.scrollTo({
|
40
40
|
top: dom.offsetTop - targetOffset,
|
41
41
|
behavior: 'smooth'
|
@@ -44,18 +44,19 @@ export var handleScroll = function handleScroll(id, options) {
|
|
44
44
|
}
|
45
45
|
}
|
46
46
|
};
|
47
|
+
|
47
48
|
/**
|
48
49
|
* 获取加载模块数据信息
|
49
50
|
* @param registerMap 注册映射对象
|
50
51
|
* @returns 模块加载状态列表
|
51
52
|
*/
|
52
|
-
export var getLoadedMap =
|
53
|
-
if (!(registerMap
|
53
|
+
export var getLoadedMap = registerMap => {
|
54
|
+
if (!(registerMap !== null && registerMap !== void 0 && registerMap.current)) {
|
54
55
|
return [];
|
55
56
|
}
|
56
|
-
var stepList = Object.values(registerMap === null || registerMap === void 0 ? void 0 : registerMap.current).map(
|
57
|
-
return _objectSpread(_objectSpread({},
|
58
|
-
loaded: !document.querySelector(
|
57
|
+
var stepList = Object.values(registerMap === null || registerMap === void 0 ? void 0 : registerMap.current).map(item => {
|
58
|
+
return _objectSpread(_objectSpread({}, pick(item, ['id', 'order', 'title'])), {}, {
|
59
|
+
loaded: !document.querySelector(`.${item === null || item === void 0 ? void 0 : item.id}-placeholder`)
|
59
60
|
});
|
60
61
|
});
|
61
62
|
return stepList;
|