@zat-design/sisyphus-react 3.13.13-beta.6 → 4.0.0-beta.2
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/babel.config.js +34 -1
- package/dist/index.esm.css +595 -341
- package/dist/less.esm.css +565 -309
- package/es/FormsProvider/index.d.ts +4 -1
- package/es/ProAction/components/CheckModalContent/index.js +0 -8
- package/es/ProAction/index.js +45 -48
- package/es/ProAction/index.less +2 -2
- package/es/ProConfigProvider/index.d.ts +21 -4
- package/es/ProConfigProvider/index.js +51 -22
- package/es/ProDownload/index.js +62 -65
- package/es/ProDownload/style/index.less +2 -2
- package/es/ProDownload/utils.js +45 -51
- package/es/ProDrawerForm/components/ProDrawer/index.js +64 -69
- package/es/ProDrawerForm/components/ProModal/index.js +59 -67
- package/es/ProDrawerForm/index.d.ts +2 -1
- package/es/ProDrawerForm/index.js +4 -6
- package/es/ProDrawerForm/propsType.d.ts +7 -18
- package/es/ProDrawerForm/style/index.less +8 -14
- package/es/ProEditLabel/components/RenderProForm.js +2 -3
- package/es/ProEditLabel/index.js +40 -45
- package/es/ProEditLabel/propsType.d.ts +1 -6
- package/es/ProEditLabel/style/index.less +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +5 -8
- package/es/ProEditTable/components/RcTable/BaseTable.js +73 -55
- package/es/ProEditTable/components/RcTable/DraggableTable.js +66 -47
- package/es/ProEditTable/components/RcTable/index.d.ts +0 -2
- package/es/ProEditTable/components/RcTable/index.js +1 -3
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +9 -12
- package/es/ProEditTable/components/RenderField/index.d.ts +3 -2
- package/es/ProEditTable/components/RenderField/index.js +377 -253
- package/es/ProEditTable/components/RenderToolbar/index.js +19 -19
- package/es/ProEditTable/components/Summary/index.js +5 -8
- package/es/ProEditTable/components/Validator/index.js +3 -6
- package/es/ProEditTable/index.js +128 -131
- package/es/ProEditTable/propsType.d.ts +1 -7
- package/es/ProEditTable/style/index.less +3 -7
- package/es/ProEditTable/utils/config.js +31 -35
- package/es/ProEditTable/utils/index.js +44 -41
- package/es/ProEditTable/utils/tools.js +107 -110
- package/es/ProEditTable/utils/useEditTableError.js +12 -4
- package/es/ProEnum/hooks/useEnumRequest.js +44 -47
- package/es/ProEnum/index.js +10 -17
- package/es/ProEnum/style/index.less +2 -2
- package/es/ProEnum/utils/index.d.ts +1 -0
- package/es/ProEnum/utils/index.js +2 -1
- package/es/ProForm/components/Container.d.ts +1 -0
- package/es/ProForm/components/Container.js +2 -3
- package/es/ProForm/components/FormFooter/index.js +13 -13
- package/es/ProForm/components/FormFooter/propsType.d.ts +2 -0
- package/es/ProForm/components/base/Checkbox/index.js +3 -4
- package/es/ProForm/components/base/DatePicker/index.d.ts +1 -3
- package/es/ProForm/components/base/DatePicker/index.js +7 -7
- package/es/ProForm/components/base/DatePicker/useDateLimit.d.ts +1 -7
- package/es/ProForm/components/base/DatePicker/useDateLimit.js +1 -3
- package/es/ProForm/components/base/Input/index.js +6 -13
- package/es/ProForm/components/base/InputNumber/index.js +3 -6
- package/es/ProForm/components/base/Radio/index.js +3 -4
- package/es/ProForm/components/base/RangePicker/index.js +6 -7
- package/es/ProForm/components/base/RangePicker/useDateRange.d.ts +5 -5
- package/es/ProForm/components/base/Select/index.js +2 -3
- package/es/ProForm/components/base/Switch/index.js +2 -3
- package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -3
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +2 -2
- package/es/ProForm/components/base/TextArea/index.js +3 -4
- package/es/ProForm/components/base/TextArea/index.less +12 -2
- package/es/ProForm/components/base/TimePicker/index.d.ts +1 -2
- package/es/ProForm/components/base/TimePicker/index.js +6 -7
- package/es/ProForm/components/base/TimePicker/style/index.less +5 -3
- package/es/ProForm/components/combination/Container/style/index.less +2 -2
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +28 -26
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +3 -6
- package/es/ProForm/components/combination/FormList/components/Empty.d.ts +13 -0
- package/es/ProForm/components/combination/FormList/components/Empty.js +89 -0
- package/es/ProForm/components/combination/FormList/components/LineFields.js +2 -3
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +17 -21
- package/es/ProForm/components/combination/FormList/index.js +13 -5
- package/es/ProForm/components/combination/FormList/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/FormList/style/index.less +61 -2
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +1 -0
- package/es/ProForm/components/combination/Group/index.d.ts +2 -8
- package/es/ProForm/components/combination/Group/index.js +12 -6
- package/es/ProForm/components/combination/Group/style/index.less +7 -87
- package/es/ProForm/components/combination/Group/utils.d.ts +1 -1
- package/es/ProForm/components/combination/Group/utils.js +4 -5
- package/es/ProForm/components/combination/ProCascader/index.js +21 -20
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/style/index.less +2 -2
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +6 -8
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +97 -116
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +13 -14
- package/es/ProForm/components/combination/ProNumberRange/index.d.ts +3 -2
- package/es/ProForm/components/combination/ProNumberRange/index.js +17 -16
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +5 -52
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -23
- package/es/ProForm/components/combination/ProRangeLimit/index.js +44 -28
- package/es/ProForm/components/combination/ProRangeLimit/propsType.d.ts +23 -0
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +3 -2
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +14 -2
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +5 -6
- package/es/ProForm/components/combination/ProTimeLimit/index.js +27 -19
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +66 -6
- package/es/ProForm/components/index.d.ts +0 -8
- package/es/ProForm/components/index.js +1 -10
- package/es/ProForm/components/render/ChangedWrapper.js +8 -9
- package/es/ProForm/components/render/ConfirmWrapper.js +28 -29
- package/es/ProForm/components/render/Render.js +37 -40
- package/es/ProForm/components/render/propsType.d.ts +2 -6
- package/es/ProForm/index.js +9 -39
- package/es/ProForm/style/index.less +6 -16
- package/es/ProForm/utils/index.d.ts +15 -1
- package/es/ProForm/utils/index.js +63 -18
- package/es/ProForm/utils/useDeepCompareMemo.js +4 -4
- package/es/ProForm/utils/useForm.js +84 -74
- package/es/ProForm/utils/useShouldUpdate.js +14 -14
- package/es/ProForm/utils/valueType.js +8 -8
- package/es/ProIcon/index.js +10 -13
- package/es/ProIcon/style/index.less +2 -2
- package/es/ProLayout/components/Layout/Header/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +11 -10
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +42 -39
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -4
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +12 -6
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +9 -5
- package/es/ProLayout/components/Layout/Menu/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/style/index.less +2 -2
- package/es/ProLayout/components/Layout/Notice/style/index.less +2 -2
- package/es/ProLayout/components/ProCollapse/index.js +20 -36
- package/es/ProLayout/components/ProCollapse/style/index.less +3 -3
- package/es/ProLayout/components/ProFooter/index.js +3 -4
- package/es/ProLayout/components/ProFooter/style/index.less +2 -2
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +2 -3
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +2 -3
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +9 -9
- package/es/ProLayout/components/ProHeader/index.js +43 -46
- package/es/ProLayout/components/ProHeader/style/index.less +2 -2
- package/es/ProLayout/index.js +7 -6
- package/es/ProLayout/style/index.less +4 -3
- package/es/ProSelect/components/AdaptiveTooltip.js +2 -3
- package/es/ProSelect/index.js +7 -17
- package/es/ProSelect/index.less +2 -2
- package/es/ProSelect/propsType.d.ts +1 -1
- package/es/ProStep/components/Anchor/index.js +2 -3
- package/es/ProStep/components/Item/index.js +2 -1
- package/es/ProStep/components/Listener/index.js +12 -14
- package/es/ProStep/components/Step/index.js +1 -0
- package/es/ProStep/index.js +39 -47
- package/es/ProStep/style/index.less +4 -4
- package/es/ProStepTab/index.js +72 -83
- package/es/ProTable/components/FormatColumn/index.js +32 -31
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -1
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +2 -4
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +39 -37
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +2 -4
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.js +15 -18
- package/es/ProTable/components/RenderSummary/index.js +4 -5
- package/es/ProTable/components/RenderTableHeader/index.js +3 -4
- package/es/ProTable/components/RenderTabs/index.js +3 -6
- package/es/ProTable/components/TableResizable/index.js +2 -1
- package/es/ProTable/components/TooltipTitle/index.js +2 -3
- package/es/ProTable/hooks/useAntdTable.js +21 -26
- package/es/ProTable/index.js +15 -16
- package/es/ProTable/propsType.d.ts +1 -3
- package/es/ProTable/style/index.less +5 -5
- package/es/ProTabs/components/Card/index.js +5 -10
- package/es/ProTabs/index.js +2 -3
- package/es/ProTabs/style/index.less +2 -2
- package/es/ProThemeTools/component/ProTools/index.js +18 -22
- package/es/ProThemeTools/context/ThemeContext.d.ts +31 -0
- package/es/ProThemeTools/context/ThemeContext.js +120 -0
- package/es/ProThemeTools/index.d.ts +4 -1
- package/es/ProThemeTools/index.js +60 -37
- package/es/ProThemeTools/style/index.less +3 -3
- package/es/ProThemeTools/utils/index.d.ts +16 -6
- package/es/ProThemeTools/utils/index.js +28 -24
- package/es/ProTooltip/index.js +14 -9
- package/es/ProTooltip/style/index.less +2 -2
- package/es/ProTree/components/AdaptiveTooltip.js +2 -3
- package/es/ProTree/components/List.js +3 -4
- package/es/ProTree/components/ProTree.js +19 -26
- package/es/ProTree/components/ProTreeSelect/index.js +38 -37
- package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/es/ProTree/components/Tree.js +18 -25
- package/es/ProTree/index.js +0 -7
- package/es/ProTree/propsType.d.ts +1 -1
- package/es/ProTree/style/index.less +10 -6
- package/es/ProTreeModal/components/Cascader.js +3 -4
- package/es/ProTreeModal/components/List.js +11 -17
- package/es/ProTreeModal/components/SortableItem.js +2 -3
- package/es/ProTreeModal/components/Tree.js +3 -4
- package/es/ProTreeModal/components/Trigger.js +6 -11
- package/es/ProTreeModal/index.d.ts +0 -1
- package/es/ProTreeModal/index.js +14 -24
- package/es/ProTreeModal/style/index.less +14 -3
- package/es/ProUpload/components/ButtonRender.js +17 -20
- package/es/ProUpload/components/DragRender.js +2 -3
- package/es/ProUpload/components/FileItem.d.ts +0 -1
- package/es/ProUpload/components/FileItem.js +15 -21
- package/es/ProUpload/components/ImageRender.js +34 -43
- package/es/ProUpload/index.js +3 -4
- package/es/ProUpload/style/index.less +173 -12
- package/es/ProViewer/index.js +38 -45
- package/es/ProViewer/style/index.less +2 -2
- package/es/ProWaterMark/index.js +2 -3
- package/es/ProWaterMark/propsType.d.ts +5 -24
- package/es/global.less +2 -1
- package/es/index.d.ts +4 -2
- package/es/index.js +2 -3
- package/es/locale/en_US.d.ts +1 -0
- package/es/locale/en_US.js +4 -3
- package/es/locale/index.d.ts +2 -0
- package/es/locale/index.js +11 -2
- package/es/locale/zh_CN.d.ts +1 -0
- package/es/locale/zh_CN.js +4 -3
- package/es/style/components.less +0 -3
- package/es/style/theme/antd.less +38 -48
- package/es/style/theme/base.less +89 -0
- package/es/style/theme/index.less +2 -89
- package/es/utils/index.d.ts +7 -0
- package/es/utils/index.js +23 -1
- package/lib/FormsProvider/index.d.ts +4 -1
- package/lib/ProAction/components/CheckModalContent/index.js +0 -9
- package/lib/ProAction/index.js +45 -48
- package/lib/ProAction/index.less +2 -2
- package/lib/ProConfigProvider/index.d.ts +21 -4
- package/lib/ProConfigProvider/index.js +60 -31
- package/lib/ProDownload/index.js +62 -65
- package/lib/ProDownload/style/index.less +2 -2
- package/lib/ProDownload/utils.js +45 -54
- package/lib/ProDrawerForm/components/ProDrawer/index.js +64 -69
- package/lib/ProDrawerForm/components/ProModal/index.js +59 -67
- package/lib/ProDrawerForm/index.d.ts +2 -1
- package/lib/ProDrawerForm/index.js +4 -6
- package/lib/ProDrawerForm/propsType.d.ts +7 -18
- package/lib/ProDrawerForm/style/index.less +8 -14
- package/lib/ProEditLabel/components/RenderProForm.js +2 -3
- package/lib/ProEditLabel/index.js +40 -45
- package/lib/ProEditLabel/propsType.d.ts +1 -6
- package/lib/ProEditLabel/style/index.less +4 -3
- package/lib/ProEditTable/components/ActionButton/index.js +5 -8
- package/lib/ProEditTable/components/RcTable/BaseTable.js +72 -54
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +65 -46
- package/lib/ProEditTable/components/RcTable/index.d.ts +0 -2
- package/lib/ProEditTable/components/RcTable/index.js +1 -8
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +9 -12
- package/lib/ProEditTable/components/RenderField/index.d.ts +3 -2
- package/lib/ProEditTable/components/RenderField/index.js +378 -254
- package/lib/ProEditTable/components/RenderToolbar/index.js +19 -19
- package/lib/ProEditTable/components/Summary/index.js +5 -8
- package/lib/ProEditTable/components/Validator/index.js +3 -7
- package/lib/ProEditTable/index.js +126 -129
- package/lib/ProEditTable/propsType.d.ts +1 -7
- package/lib/ProEditTable/style/index.less +3 -7
- package/lib/ProEditTable/utils/config.js +31 -35
- package/lib/ProEditTable/utils/index.js +44 -41
- package/lib/ProEditTable/utils/tools.js +107 -113
- package/lib/ProEditTable/utils/useEditTableError.js +12 -4
- package/lib/ProEnum/hooks/useEnumRequest.js +43 -46
- package/lib/ProEnum/index.js +10 -17
- package/lib/ProEnum/style/index.less +2 -2
- package/lib/ProEnum/utils/index.d.ts +1 -0
- package/lib/ProEnum/utils/index.js +3 -1
- package/lib/ProForm/components/Container.d.ts +1 -0
- package/lib/ProForm/components/Container.js +2 -3
- package/lib/ProForm/components/FormFooter/index.js +13 -13
- package/lib/ProForm/components/FormFooter/propsType.d.ts +2 -0
- package/lib/ProForm/components/base/Checkbox/index.js +3 -4
- package/lib/ProForm/components/base/DatePicker/index.d.ts +1 -3
- package/lib/ProForm/components/base/DatePicker/index.js +7 -7
- package/lib/ProForm/components/base/DatePicker/useDateLimit.d.ts +1 -7
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +1 -3
- package/lib/ProForm/components/base/Input/index.js +6 -13
- package/lib/ProForm/components/base/InputNumber/index.js +3 -6
- package/lib/ProForm/components/base/Radio/index.js +3 -4
- package/lib/ProForm/components/base/RangePicker/index.js +6 -6
- package/lib/ProForm/components/base/RangePicker/useDateRange.d.ts +5 -5
- package/lib/ProForm/components/base/Select/index.js +2 -3
- package/lib/ProForm/components/base/Switch/index.js +2 -3
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -3
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +2 -2
- package/lib/ProForm/components/base/TextArea/index.js +3 -4
- package/lib/ProForm/components/base/TextArea/index.less +12 -2
- package/lib/ProForm/components/base/TimePicker/index.d.ts +1 -2
- package/lib/ProForm/components/base/TimePicker/index.js +6 -7
- package/lib/ProForm/components/base/TimePicker/style/index.less +5 -3
- package/lib/ProForm/components/combination/Container/style/index.less +2 -2
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +28 -26
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +3 -6
- package/lib/ProForm/components/combination/FormList/components/Empty.d.ts +13 -0
- package/lib/ProForm/components/combination/FormList/components/Empty.js +96 -0
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +2 -3
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +17 -21
- package/lib/ProForm/components/combination/FormList/index.js +13 -5
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/FormList/style/index.less +61 -2
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/index.d.ts +2 -8
- package/lib/ProForm/components/combination/Group/index.js +13 -6
- package/lib/ProForm/components/combination/Group/style/index.less +7 -87
- package/lib/ProForm/components/combination/Group/utils.d.ts +1 -1
- package/lib/ProForm/components/combination/Group/utils.js +4 -5
- package/lib/ProForm/components/combination/ProCascader/index.js +23 -22
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/style/index.less +2 -2
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +6 -8
- package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +97 -116
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +13 -14
- package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/index.js +17 -16
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +5 -52
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -23
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +44 -28
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.d.ts +23 -0
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +3 -2
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +14 -2
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +5 -6
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +27 -19
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +66 -6
- package/lib/ProForm/components/index.d.ts +0 -8
- package/lib/ProForm/components/index.js +1 -63
- package/lib/ProForm/components/render/ChangedWrapper.js +8 -9
- package/lib/ProForm/components/render/ConfirmWrapper.js +28 -29
- package/lib/ProForm/components/render/Render.js +37 -39
- package/lib/ProForm/components/render/propsType.d.ts +2 -6
- package/lib/ProForm/index.js +8 -38
- package/lib/ProForm/style/index.less +6 -16
- package/lib/ProForm/utils/index.d.ts +15 -1
- package/lib/ProForm/utils/index.js +65 -21
- package/lib/ProForm/utils/useDeepCompareMemo.js +4 -4
- package/lib/ProForm/utils/useForm.js +83 -73
- package/lib/ProForm/utils/useShouldUpdate.js +14 -14
- package/lib/ProForm/utils/valueType.js +8 -8
- package/lib/ProIcon/index.js +10 -13
- package/lib/ProIcon/style/index.less +2 -2
- package/lib/ProLayout/components/Layout/Header/index.js +1 -1
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +11 -10
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +42 -39
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -4
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +12 -6
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +9 -5
- package/lib/ProLayout/components/Layout/Menu/index.js +1 -1
- package/lib/ProLayout/components/Layout/Menu/style/index.less +2 -2
- package/lib/ProLayout/components/Layout/Notice/style/index.less +2 -2
- package/lib/ProLayout/components/ProCollapse/index.js +20 -36
- package/lib/ProLayout/components/ProCollapse/style/index.less +3 -3
- package/lib/ProLayout/components/ProFooter/index.js +3 -4
- package/lib/ProLayout/components/ProFooter/style/index.less +2 -2
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +2 -3
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +2 -3
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +9 -9
- package/lib/ProLayout/components/ProHeader/index.js +43 -46
- package/lib/ProLayout/components/ProHeader/style/index.less +2 -2
- package/lib/ProLayout/index.js +7 -6
- package/lib/ProLayout/style/index.less +4 -3
- package/lib/ProSelect/components/AdaptiveTooltip.js +2 -3
- package/lib/ProSelect/index.js +7 -17
- package/lib/ProSelect/index.less +2 -2
- package/lib/ProSelect/propsType.d.ts +1 -1
- package/lib/ProStep/components/Anchor/index.js +2 -3
- package/lib/ProStep/components/Item/index.js +2 -1
- package/lib/ProStep/components/Listener/index.js +12 -14
- package/lib/ProStep/components/Step/index.js +1 -0
- package/lib/ProStep/index.js +39 -47
- package/lib/ProStep/style/index.less +4 -4
- package/lib/ProStepTab/index.js +72 -83
- package/lib/ProTable/components/FormatColumn/index.js +32 -31
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -1
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +2 -4
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +38 -36
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +2 -4
- package/lib/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/lib/ProTable/components/RenderColumn/index.js +15 -18
- package/lib/ProTable/components/RenderSummary/index.js +4 -5
- package/lib/ProTable/components/RenderTableHeader/index.js +3 -5
- package/lib/ProTable/components/RenderTabs/index.js +3 -6
- package/lib/ProTable/components/TableResizable/index.js +2 -1
- package/lib/ProTable/components/TooltipTitle/index.js +2 -3
- package/lib/ProTable/hooks/useAntdTable.js +21 -26
- package/lib/ProTable/index.js +15 -16
- package/lib/ProTable/propsType.d.ts +1 -3
- package/lib/ProTable/style/index.less +5 -5
- package/lib/ProTabs/components/Card/index.js +5 -11
- package/lib/ProTabs/index.js +2 -3
- package/lib/ProTabs/style/index.less +2 -2
- package/lib/ProThemeTools/component/ProTools/index.js +18 -22
- package/lib/ProThemeTools/context/ThemeContext.d.ts +31 -0
- package/lib/ProThemeTools/context/ThemeContext.js +126 -0
- package/lib/ProThemeTools/index.d.ts +4 -1
- package/lib/ProThemeTools/index.js +69 -35
- package/lib/ProThemeTools/style/index.less +3 -3
- package/lib/ProThemeTools/utils/index.d.ts +16 -6
- package/lib/ProThemeTools/utils/index.js +29 -25
- package/lib/ProTooltip/index.js +14 -9
- package/lib/ProTooltip/style/index.less +2 -2
- package/lib/ProTree/components/AdaptiveTooltip.js +2 -4
- package/lib/ProTree/components/List.js +3 -4
- package/lib/ProTree/components/ProTree.js +19 -26
- package/lib/ProTree/components/ProTreeSelect/index.js +38 -37
- package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/lib/ProTree/components/Tree.js +18 -25
- package/lib/ProTree/index.js +0 -8
- package/lib/ProTree/propsType.d.ts +1 -1
- package/lib/ProTree/style/index.less +10 -6
- package/lib/ProTreeModal/components/Cascader.js +3 -4
- package/lib/ProTreeModal/components/List.js +11 -17
- package/lib/ProTreeModal/components/SortableItem.js +2 -3
- package/lib/ProTreeModal/components/Tree.js +3 -4
- package/lib/ProTreeModal/components/Trigger.js +6 -11
- package/lib/ProTreeModal/index.d.ts +0 -1
- package/lib/ProTreeModal/index.js +14 -24
- package/lib/ProTreeModal/style/index.less +14 -3
- package/lib/ProUpload/components/ButtonRender.js +17 -20
- package/lib/ProUpload/components/DragRender.js +2 -3
- package/lib/ProUpload/components/FileItem.d.ts +0 -1
- package/lib/ProUpload/components/FileItem.js +15 -21
- package/lib/ProUpload/components/ImageRender.js +34 -43
- package/lib/ProUpload/index.js +3 -4
- package/lib/ProUpload/style/index.less +173 -12
- package/lib/ProViewer/index.js +39 -47
- package/lib/ProViewer/style/index.less +2 -2
- package/lib/ProWaterMark/index.js +3 -4
- package/lib/ProWaterMark/propsType.d.ts +5 -24
- package/lib/global.less +2 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +36 -16
- package/lib/locale/en_US.d.ts +1 -0
- package/lib/locale/en_US.js +4 -3
- package/lib/locale/index.d.ts +2 -0
- package/lib/locale/index.js +12 -2
- package/lib/locale/zh_CN.d.ts +1 -0
- package/lib/locale/zh_CN.js +4 -3
- package/lib/style/components.less +0 -3
- package/lib/style/theme/antd.less +38 -48
- package/lib/style/theme/base.less +89 -0
- package/lib/style/theme/index.less +2 -89
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.js +26 -2
- package/package.json +31 -18
- package/es/ProEditTable/components/RcTable/VirtualTable.d.ts +0 -3
- package/es/ProEditTable/components/RcTable/VirtualTable.js +0 -8
- package/es/ProForm/components/combination/ProCombination/index.d.ts +0 -6
- package/es/ProForm/components/combination/ProCombination/index.js +0 -204
- package/es/ProForm/components/combination/ProCombination/propsType.d.ts +0 -68
- package/es/ProForm/components/combination/ProCombination/style/index.less +0 -18
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.d.ts +0 -33
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.js +0 -108
- package/es/ProForm/components/old/EnumSelect/index.d.ts +0 -4
- package/es/ProForm/components/old/EnumSelect/index.js +0 -272
- package/es/ProForm/components/old/EnumSelect/interface.d.ts +0 -29
- package/es/ProForm/components/old/EnumSelect/interface.js +0 -1
- package/es/ProForm/components/old/EnumSelect/style/index.less +0 -113
- package/es/ProForm/components/old/InputRange/index.d.ts +0 -16
- package/es/ProForm/components/old/InputRange/index.js +0 -100
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +0 -3
- package/es/ProForm/components/old/InputWithSuffix/index.js +0 -46
- package/es/ProForm/components/old/InputWithSuffix/propsTypes.d.ts +0 -11
- package/es/ProForm/components/old/InputWithSuffix/propsTypes.js +0 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +0 -27
- package/es/ProForm/components/old/ProAddress/index.js +0 -298
- package/es/ProForm/components/old/ProAddress/propsTypes.d.ts +0 -16
- package/es/ProForm/components/old/ProAddress/propsTypes.js +0 -1
- package/es/ProForm/components/old/ProCertNo/index.d.ts +0 -14
- package/es/ProForm/components/old/ProCertNo/index.js +0 -66
- package/es/ProForm/components/old/ProCertNo/propsType.d.ts +0 -18
- package/es/ProForm/components/old/ProCertNo/propsType.js +0 -1
- package/es/ProForm/components/old/ProCertValidity/index.d.ts +0 -9
- package/es/ProForm/components/old/ProCertValidity/index.js +0 -188
- package/es/ProForm/components/old/ProCertValidity/propsType.d.ts +0 -19
- package/es/ProForm/components/old/ProCertValidity/propsType.js +0 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +0 -2
- package/es/ProForm/components/old/ProRangeBox/index.js +0 -97
- package/es/ProForm/components/old/ProRangeBox/propsType.d.ts +0 -3
- package/es/ProForm/components/old/ProRangeBox/propsType.js +0 -1
- package/es/ProForm/utils/_useChanged.d.ts +0 -8
- package/es/ProForm/utils/_useChanged.js +0 -25
- package/es/ProForm/utils/_useListChanged.d.ts +0 -16
- package/es/ProForm/utils/_useListChanged.js +0 -93
- package/es/ProUpload/style/fileItem.less +0 -159
- package/es/old/ProCertValidity/index.d.ts +0 -9
- package/es/old/ProCertValidity/index.js +0 -188
- package/es/old/ProCertValidity/propsType.d.ts +0 -19
- package/es/old/ProCertValidity/propsType.js +0 -1
- package/es/old/ProEditableTable/index.d.ts +0 -4
- package/es/old/ProEditableTable/index.js +0 -594
- package/es/old/ProEditableTable/propsType.d.ts +0 -68
- package/es/old/ProEditableTable/propsType.js +0 -1
- package/es/old/ProEditableTable/style/index.less +0 -75
- package/es/old/ProEditableTable/utils.d.ts +0 -29
- package/es/old/ProEditableTable/utils.js +0 -323
- package/lib/ProEditTable/components/RcTable/VirtualTable.d.ts +0 -3
- package/lib/ProEditTable/components/RcTable/VirtualTable.js +0 -14
- package/lib/ProForm/components/combination/ProCombination/index.d.ts +0 -6
- package/lib/ProForm/components/combination/ProCombination/index.js +0 -213
- package/lib/ProForm/components/combination/ProCombination/propsType.d.ts +0 -68
- package/lib/ProForm/components/combination/ProCombination/style/index.less +0 -18
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.d.ts +0 -33
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.js +0 -115
- package/lib/ProForm/components/old/EnumSelect/index.d.ts +0 -4
- package/lib/ProForm/components/old/EnumSelect/index.js +0 -279
- package/lib/ProForm/components/old/EnumSelect/interface.d.ts +0 -29
- package/lib/ProForm/components/old/EnumSelect/interface.js +0 -5
- package/lib/ProForm/components/old/EnumSelect/style/index.less +0 -113
- package/lib/ProForm/components/old/InputRange/index.d.ts +0 -16
- package/lib/ProForm/components/old/InputRange/index.js +0 -108
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +0 -3
- package/lib/ProForm/components/old/InputWithSuffix/index.js +0 -53
- package/lib/ProForm/components/old/InputWithSuffix/propsTypes.d.ts +0 -11
- package/lib/ProForm/components/old/InputWithSuffix/propsTypes.js +0 -5
- package/lib/ProForm/components/old/ProAddress/index.d.ts +0 -27
- package/lib/ProForm/components/old/ProAddress/index.js +0 -306
- package/lib/ProForm/components/old/ProAddress/propsTypes.d.ts +0 -16
- package/lib/ProForm/components/old/ProAddress/propsTypes.js +0 -5
- package/lib/ProForm/components/old/ProCertNo/index.d.ts +0 -14
- package/lib/ProForm/components/old/ProCertNo/index.js +0 -73
- package/lib/ProForm/components/old/ProCertNo/propsType.d.ts +0 -18
- package/lib/ProForm/components/old/ProCertNo/propsType.js +0 -5
- package/lib/ProForm/components/old/ProCertValidity/index.d.ts +0 -9
- package/lib/ProForm/components/old/ProCertValidity/index.js +0 -193
- package/lib/ProForm/components/old/ProCertValidity/propsType.d.ts +0 -19
- package/lib/ProForm/components/old/ProCertValidity/propsType.js +0 -5
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +0 -2
- package/lib/ProForm/components/old/ProRangeBox/index.js +0 -105
- package/lib/ProForm/components/old/ProRangeBox/propsType.d.ts +0 -3
- package/lib/ProForm/components/old/ProRangeBox/propsType.js +0 -5
- package/lib/ProForm/utils/_useChanged.d.ts +0 -8
- package/lib/ProForm/utils/_useChanged.js +0 -32
- package/lib/ProForm/utils/_useListChanged.d.ts +0 -16
- package/lib/ProForm/utils/_useListChanged.js +0 -100
- package/lib/ProUpload/style/fileItem.less +0 -159
- package/lib/old/ProCertValidity/index.d.ts +0 -9
- package/lib/old/ProCertValidity/index.js +0 -193
- package/lib/old/ProCertValidity/propsType.d.ts +0 -19
- package/lib/old/ProCertValidity/propsType.js +0 -5
- package/lib/old/ProEditableTable/index.d.ts +0 -4
- package/lib/old/ProEditableTable/index.js +0 -601
- package/lib/old/ProEditableTable/propsType.d.ts +0 -68
- package/lib/old/ProEditableTable/propsType.js +0 -5
- package/lib/old/ProEditableTable/style/index.less +0 -75
- package/lib/old/ProEditableTable/utils.d.ts +0 -29
- package/lib/old/ProEditableTable/utils.js +0 -330
- /package/es/ProForm/components/combination/{ProCombination → ProRangeLimit}/propsType.js +0 -0
- /package/lib/ProForm/components/combination/{ProCombination → ProRangeLimit}/propsType.js +0 -0
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports.cloneDeepFilterNode = cloneDeepFilterNode;
|
8
8
|
exports.splitNames = exports.onPageCheck = exports.onDelete = exports.handleScrollToError = exports.getRandom = exports.getNamePath = exports.getDisabled = exports.difference = exports.customValidate = void 0;
|
9
|
-
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
10
9
|
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
11
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
12
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
@@ -21,9 +20,8 @@ var _cloneDeepWith2 = _interopRequireDefault(require("lodash/cloneDeepWith"));
|
|
21
20
|
var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
|
22
21
|
var _react = _interopRequireDefault(require("react"));
|
23
22
|
var _utils = require("@zat-design/utils");
|
24
|
-
|
25
|
-
/* eslint-disable no-restricted-syntax */
|
26
|
-
|
23
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
24
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } /* eslint-disable no-await-in-loop */ /* eslint-disable no-restricted-syntax */
|
27
25
|
/**
|
28
26
|
* 生成随机字符串
|
29
27
|
* @returns 随机字符串
|
@@ -223,12 +221,12 @@ var handleScrollToError = exports.handleScrollToError = function handleScrollToE
|
|
223
221
|
var childOffsetTop = 0;
|
224
222
|
while (previousSibling) {
|
225
223
|
if (previousSibling.nodeType === 1) {
|
226
|
-
var _previousSibling, _previousSibling$clas, _previousSibling$clas2
|
224
|
+
var _previousSibling, _previousSibling$clas, _previousSibling$clas2;
|
227
225
|
var _ref4 = previousSibling.getBoundingClientRect() || {},
|
228
226
|
_ref4$width = _ref4.width,
|
229
227
|
width = _ref4$width === void 0 ? 0 : _ref4$width;
|
230
228
|
childOffsetLeft += width;
|
231
|
-
if ((_previousSibling = previousSibling) === null || _previousSibling === void 0 ? void 0 : (_previousSibling$clas = _previousSibling.classList) === null || _previousSibling$clas === void 0 ? void 0 : (_previousSibling$clas2 =
|
229
|
+
if ((_previousSibling = previousSibling) === null || _previousSibling === void 0 ? void 0 : (_previousSibling$clas = _previousSibling.classList) === null || _previousSibling$clas === void 0 ? void 0 : (_previousSibling$clas2 = _previousSibling$clas.contains) === null || _previousSibling$clas2 === void 0 ? void 0 : _previousSibling$clas2.call(_previousSibling$clas, 'ant-table-cell-fix-left')) {
|
232
230
|
childFixedLeft += width;
|
233
231
|
}
|
234
232
|
}
|
@@ -281,11 +279,11 @@ var _isNull = function isNull(value) {
|
|
281
279
|
return value === '' || value === undefined || value === null || Array.isArray(value) && value.length === 0;
|
282
280
|
};
|
283
281
|
var handleCheckCellValue = /*#__PURE__*/function () {
|
284
|
-
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(
|
282
|
+
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator().m(function _callee(column, record) {
|
285
283
|
var _column$names, _column$names2, _rules2;
|
286
|
-
var value, _required, _rules, _labelRequired, res, _iterator, _step, rule;
|
287
|
-
return (
|
288
|
-
while (1) switch (_context.
|
284
|
+
var value, _required, _rules, _labelRequired, res, _iterator, _step, rule, _t, _t2;
|
285
|
+
return _regenerator().w(function (_context) {
|
286
|
+
while (1) switch (_context.p = _context.n) {
|
289
287
|
case 0:
|
290
288
|
value = null;
|
291
289
|
if (column.name) {
|
@@ -309,81 +307,78 @@ var handleCheckCellValue = /*#__PURE__*/function () {
|
|
309
307
|
_labelRequired = column.labelRequired(value, record);
|
310
308
|
}
|
311
309
|
if (!(((_column$names2 = column.names) === null || _column$names2 === void 0 ? void 0 : _column$names2.length) && _labelRequired !== null && _labelRequired !== undefined && _isNull(value))) {
|
312
|
-
_context.
|
310
|
+
_context.n = 1;
|
313
311
|
break;
|
314
312
|
}
|
315
|
-
return _context.
|
316
|
-
case
|
313
|
+
return _context.a(2, false);
|
314
|
+
case 1:
|
317
315
|
if (!(_required && _isNull(value))) {
|
318
|
-
_context.
|
316
|
+
_context.n = 2;
|
319
317
|
break;
|
320
318
|
}
|
321
|
-
return _context.
|
322
|
-
case
|
319
|
+
return _context.a(2, false);
|
320
|
+
case 2:
|
323
321
|
if (!((_rules2 = _rules) === null || _rules2 === void 0 ? void 0 : _rules2.length)) {
|
324
|
-
_context.
|
322
|
+
_context.n = 15;
|
325
323
|
break;
|
326
324
|
}
|
327
325
|
res = true;
|
328
326
|
_iterator = (0, _createForOfIteratorHelper2.default)(_rules);
|
329
|
-
_context.
|
327
|
+
_context.p = 3;
|
330
328
|
_iterator.s();
|
331
|
-
case
|
329
|
+
case 4:
|
332
330
|
if ((_step = _iterator.n()).done) {
|
333
|
-
_context.
|
331
|
+
_context.n = 11;
|
334
332
|
break;
|
335
333
|
}
|
336
334
|
rule = _step.value;
|
337
335
|
if (res) {
|
338
|
-
_context.
|
336
|
+
_context.n = 5;
|
339
337
|
break;
|
340
338
|
}
|
341
|
-
return _context.
|
342
|
-
case
|
339
|
+
return _context.a(3, 11);
|
340
|
+
case 5:
|
343
341
|
if (rule.required && _isNull(value)) {
|
344
342
|
res = false;
|
345
343
|
}
|
346
344
|
if (!(0, _isFunction2.default)(rule.validator)) {
|
347
|
-
_context.
|
345
|
+
_context.n = 9;
|
348
346
|
break;
|
349
347
|
}
|
350
|
-
_context.
|
351
|
-
_context.
|
348
|
+
_context.p = 6;
|
349
|
+
_context.n = 7;
|
352
350
|
return rule.validator('', value);
|
353
|
-
case
|
354
|
-
_context.
|
351
|
+
case 7:
|
352
|
+
_context.n = 9;
|
355
353
|
break;
|
356
|
-
case
|
357
|
-
_context.
|
358
|
-
|
354
|
+
case 8:
|
355
|
+
_context.p = 8;
|
356
|
+
_t = _context.v;
|
359
357
|
res = false;
|
360
|
-
case
|
358
|
+
case 9:
|
361
359
|
if (rule.type && !_utils.validate[rule.type](value)) {
|
362
360
|
res = false;
|
363
361
|
}
|
364
|
-
case
|
365
|
-
_context.
|
362
|
+
case 10:
|
363
|
+
_context.n = 4;
|
366
364
|
break;
|
367
|
-
case
|
368
|
-
_context.
|
365
|
+
case 11:
|
366
|
+
_context.n = 13;
|
369
367
|
break;
|
370
|
-
case
|
371
|
-
_context.
|
372
|
-
|
373
|
-
_iterator.e(
|
374
|
-
case
|
375
|
-
_context.
|
368
|
+
case 12:
|
369
|
+
_context.p = 12;
|
370
|
+
_t2 = _context.v;
|
371
|
+
_iterator.e(_t2);
|
372
|
+
case 13:
|
373
|
+
_context.p = 13;
|
376
374
|
_iterator.f();
|
377
|
-
return _context.
|
378
|
-
case
|
379
|
-
return _context.
|
380
|
-
case
|
381
|
-
return _context.
|
382
|
-
case 45:
|
383
|
-
case "end":
|
384
|
-
return _context.stop();
|
375
|
+
return _context.f(13);
|
376
|
+
case 14:
|
377
|
+
return _context.a(2, res);
|
378
|
+
case 15:
|
379
|
+
return _context.a(2, true);
|
385
380
|
}
|
386
|
-
}, _callee, null, [[
|
381
|
+
}, _callee, null, [[6, 8], [3, 12, 13, 14]]);
|
387
382
|
}));
|
388
383
|
return function handleCheckCellValue(_x, _x2) {
|
389
384
|
return _ref6.apply(this, arguments);
|
@@ -393,14 +388,14 @@ var handleCheckCellValue = /*#__PURE__*/function () {
|
|
393
388
|
* 分页校验
|
394
389
|
*/
|
395
390
|
var onPageCheck = exports.onPageCheck = /*#__PURE__*/function () {
|
396
|
-
var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(
|
397
|
-
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;
|
398
|
-
return (
|
399
|
-
while (1) switch (_context2.
|
391
|
+
var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator().m(function _callee2(_ref7) {
|
392
|
+
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, _t3, _t4, _t5, _t6;
|
393
|
+
return _regenerator().w(function (_context2) {
|
394
|
+
while (1) switch (_context2.p = _context2.n) {
|
400
395
|
case 0:
|
401
396
|
form = _ref7.form, name = _ref7.name, value = _ref7.value, columns = _ref7.columns, setState = _ref7.setState, page = _ref7.page, pagination = _ref7.pagination, isView = _ref7.isView, disabled = _ref7.disabled;
|
402
397
|
if (!(pagination && !isView && !disabled)) {
|
403
|
-
_context2.
|
398
|
+
_context2.n = 24;
|
404
399
|
break;
|
405
400
|
}
|
406
401
|
pageNum = page.pageNum, pageSize = page.pageSize;
|
@@ -413,18 +408,18 @@ var onPageCheck = exports.onPageCheck = /*#__PURE__*/function () {
|
|
413
408
|
errorNum = 0;
|
414
409
|
errorPageNum = 0;
|
415
410
|
_i = 0, _pageArr = pageArr;
|
416
|
-
case
|
411
|
+
case 1:
|
417
412
|
if (!(_i < _pageArr.length)) {
|
418
|
-
_context2.
|
413
|
+
_context2.n = 20;
|
419
414
|
break;
|
420
415
|
}
|
421
416
|
item = _pageArr[_i];
|
422
417
|
if (!flag) {
|
423
|
-
_context2.
|
418
|
+
_context2.n = 2;
|
424
419
|
break;
|
425
420
|
}
|
426
|
-
return _context2.
|
427
|
-
case
|
421
|
+
return _context2.a(3, 20);
|
422
|
+
case 2:
|
428
423
|
errorNum = 0;
|
429
424
|
// 实现思路:截取每一页数据,手动触发每一行数据的校验,通过column配置的rule规则,
|
430
425
|
// 依次校验每一页数据,有错误就跳出循环,跳转到错误页数,并展示错误单元格数量
|
@@ -432,77 +427,77 @@ var onPageCheck = exports.onPageCheck = /*#__PURE__*/function () {
|
|
432
427
|
end = _utils.tools.calc(start, '+', pageSize);
|
433
428
|
nextValues = value === null || value === void 0 ? void 0 : value.slice(start, end);
|
434
429
|
_iterator2 = (0, _createForOfIteratorHelper2.default)(nextValues);
|
435
|
-
_context2.
|
430
|
+
_context2.p = 3;
|
436
431
|
_iterator2.s();
|
437
|
-
case
|
432
|
+
case 4:
|
438
433
|
if ((_step2 = _iterator2.n()).done) {
|
439
|
-
_context2.
|
434
|
+
_context2.n = 15;
|
440
435
|
break;
|
441
436
|
}
|
442
437
|
record = _step2.value;
|
443
438
|
_iterator3 = (0, _createForOfIteratorHelper2.default)(columns);
|
444
|
-
_context2.
|
439
|
+
_context2.p = 5;
|
445
440
|
_iterator3.s();
|
446
|
-
case
|
441
|
+
case 6:
|
447
442
|
if ((_step3 = _iterator3.n()).done) {
|
448
|
-
_context2.
|
443
|
+
_context2.n = 11;
|
449
444
|
break;
|
450
445
|
}
|
451
446
|
column = _step3.value;
|
452
|
-
_context2.
|
453
|
-
_context2.
|
447
|
+
_context2.p = 7;
|
448
|
+
_context2.n = 8;
|
454
449
|
return handleCheckCellValue(column, record);
|
455
|
-
case
|
456
|
-
result = _context2.
|
450
|
+
case 8:
|
451
|
+
result = _context2.v;
|
457
452
|
if (!result) {
|
458
453
|
errorNum += 1;
|
459
454
|
}
|
460
|
-
_context2.
|
455
|
+
_context2.n = 10;
|
461
456
|
break;
|
462
|
-
case
|
463
|
-
_context2.
|
464
|
-
|
457
|
+
case 9:
|
458
|
+
_context2.p = 9;
|
459
|
+
_t3 = _context2.v;
|
465
460
|
errorNum += 1;
|
466
|
-
case
|
467
|
-
_context2.
|
461
|
+
case 10:
|
462
|
+
_context2.n = 6;
|
468
463
|
break;
|
469
|
-
case
|
470
|
-
_context2.
|
464
|
+
case 11:
|
465
|
+
_context2.n = 13;
|
471
466
|
break;
|
472
|
-
case
|
473
|
-
_context2.
|
474
|
-
|
475
|
-
_iterator3.e(
|
476
|
-
case
|
477
|
-
_context2.
|
467
|
+
case 12:
|
468
|
+
_context2.p = 12;
|
469
|
+
_t4 = _context2.v;
|
470
|
+
_iterator3.e(_t4);
|
471
|
+
case 13:
|
472
|
+
_context2.p = 13;
|
478
473
|
_iterator3.f();
|
479
|
-
return _context2.
|
480
|
-
case
|
481
|
-
_context2.
|
474
|
+
return _context2.f(13);
|
475
|
+
case 14:
|
476
|
+
_context2.n = 4;
|
482
477
|
break;
|
483
|
-
case
|
484
|
-
_context2.
|
478
|
+
case 15:
|
479
|
+
_context2.n = 17;
|
485
480
|
break;
|
486
|
-
case
|
487
|
-
_context2.
|
488
|
-
|
489
|
-
_iterator2.e(
|
490
|
-
case
|
491
|
-
_context2.
|
481
|
+
case 16:
|
482
|
+
_context2.p = 16;
|
483
|
+
_t5 = _context2.v;
|
484
|
+
_iterator2.e(_t5);
|
485
|
+
case 17:
|
486
|
+
_context2.p = 17;
|
492
487
|
_iterator2.f();
|
493
|
-
return _context2.
|
494
|
-
case
|
488
|
+
return _context2.f(17);
|
489
|
+
case 18:
|
495
490
|
if (errorNum > 0) {
|
496
491
|
flag = true;
|
497
492
|
errorPageNum = item;
|
498
493
|
}
|
499
|
-
case
|
494
|
+
case 19:
|
500
495
|
_i++;
|
501
|
-
_context2.
|
496
|
+
_context2.n = 1;
|
502
497
|
break;
|
503
|
-
case
|
498
|
+
case 20:
|
504
499
|
if (!(flag && errorNum > 0)) {
|
505
|
-
_context2.
|
500
|
+
_context2.n = 24;
|
506
501
|
break;
|
507
502
|
}
|
508
503
|
nextState = {
|
@@ -515,23 +510,22 @@ var onPageCheck = exports.onPageCheck = /*#__PURE__*/function () {
|
|
515
510
|
};
|
516
511
|
}
|
517
512
|
setState(nextState);
|
518
|
-
_context2.
|
519
|
-
_context2.
|
513
|
+
_context2.p = 21;
|
514
|
+
_context2.n = 22;
|
520
515
|
return form.validateFields([name], {
|
521
516
|
recursive: true
|
522
517
|
});
|
523
|
-
case
|
524
|
-
_context2.
|
518
|
+
case 22:
|
519
|
+
_context2.n = 24;
|
525
520
|
break;
|
526
|
-
case
|
527
|
-
_context2.
|
528
|
-
|
521
|
+
case 23:
|
522
|
+
_context2.p = 23;
|
523
|
+
_t6 = _context2.v;
|
529
524
|
handleScrollToError();
|
530
|
-
case
|
531
|
-
|
532
|
-
return _context2.stop();
|
525
|
+
case 24:
|
526
|
+
return _context2.a(2);
|
533
527
|
}
|
534
|
-
}, _callee2, null, [[
|
528
|
+
}, _callee2, null, [[21, 23], [7, 9], [5, 12, 13, 14], [3, 16, 17, 18]]);
|
535
529
|
}));
|
536
530
|
return function onPageCheck(_x3) {
|
537
531
|
return _ref8.apply(this, arguments);
|
@@ -17,8 +17,9 @@ var useEditTableError = function useEditTableError(_ref) {
|
|
17
17
|
errorLength = _useState2[0],
|
18
18
|
setErrorLength = _useState2[1];
|
19
19
|
(0, _react.useEffect)(function () {
|
20
|
+
var _containerNode$childr3;
|
20
21
|
// 如果 isEnabled 为 false 或容器节点不存在,直接跳过监听
|
21
|
-
if (!isEnabled || !containerNode) {
|
22
|
+
if (!isEnabled || !containerNode || !(containerNode === null || containerNode === void 0 ? void 0 : containerNode.querySelector)) {
|
22
23
|
return; // 如果未启用监听或容器节点不存在,直接返回
|
23
24
|
}
|
24
25
|
// 防抖处理:将 setErrorLength 函数进行防抖
|
@@ -32,8 +33,9 @@ var useEditTableError = function useEditTableError(_ref) {
|
|
32
33
|
var target = mutation.target;
|
33
34
|
// 检查目标节点是否包含指定的类
|
34
35
|
if (target.classList.contains(className)) {
|
36
|
+
var _containerNode$childr;
|
35
37
|
// 查找所有包含 className 的节点
|
36
|
-
var errorNodes = containerNode.querySelectorAll(".".concat(className));
|
38
|
+
var errorNodes = containerNode === null || containerNode === void 0 ? void 0 : (_containerNode$childr = containerNode.children[0]) === null || _containerNode$childr === void 0 ? void 0 : _containerNode$childr.querySelectorAll(".".concat(className));
|
37
39
|
// 过滤这些节点,只保留那些类名完全为 `ant-form-item-explain-error` 的节点
|
38
40
|
var validErrorNodes = Array.from(errorNodes).filter(function (node) {
|
39
41
|
return node.classList.length === 1 && node.classList.contains('ant-form-item-explain-error');
|
@@ -53,8 +55,9 @@ var useEditTableError = function useEditTableError(_ref) {
|
|
53
55
|
// 检查删除的节点是否包含指定的类名
|
54
56
|
mutation.removedNodes.forEach(function (removedNode) {
|
55
57
|
if (removedNode instanceof HTMLElement && removedNode.classList.contains('ant-table-row')) {
|
58
|
+
var _containerNode$childr2;
|
56
59
|
// 更新错误数量
|
57
|
-
var _errorNodes = containerNode.querySelectorAll(".".concat(className));
|
60
|
+
var _errorNodes = containerNode === null || containerNode === void 0 ? void 0 : (_containerNode$childr2 = containerNode.children[0]) === null || _containerNode$childr2 === void 0 ? void 0 : _containerNode$childr2.querySelectorAll(".".concat(className));
|
58
61
|
if (errorLength === 0) {
|
59
62
|
debouncedSetErrorLength(0);
|
60
63
|
}
|
@@ -75,7 +78,12 @@ var useEditTableError = function useEditTableError(_ref) {
|
|
75
78
|
childList: true
|
76
79
|
};
|
77
80
|
// 启动 MutationObserver
|
78
|
-
|
81
|
+
var targetNode = containerNode === null || containerNode === void 0 ? void 0 : (_containerNode$childr3 = containerNode.children[0]) === null || _containerNode$childr3 === void 0 ? void 0 : _containerNode$childr3.querySelector('tbody');
|
82
|
+
if (targetNode instanceof HTMLElement) {
|
83
|
+
observer.observe(targetNode, config);
|
84
|
+
} else {
|
85
|
+
console.error('warning: tbody element not found or invalid');
|
86
|
+
}
|
79
87
|
// 清理 MutationObserver 和防抖定时器
|
80
88
|
return function () {
|
81
89
|
observer.disconnect();
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.default = void 0;
|
8
|
-
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
9
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
10
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
11
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
@@ -16,7 +15,9 @@ var _utils = require("../utils");
|
|
16
15
|
var _locale = _interopRequireDefault(require("../../locale"));
|
17
16
|
require("../utils/eventCenter");
|
18
17
|
var _ref;
|
19
|
-
var
|
18
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
19
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
|
20
|
+
var baseEnumStorage = (_ref = window.localStorage.getItem(_utils.baseCacheKey) && JSON.parse(window.localStorage.getItem(_utils.baseCacheKey))) !== null && _ref !== void 0 ? _ref : null;
|
20
21
|
var useEnumRequest = function useEnumRequest(props, dispatch) {
|
21
22
|
var _ref2 = props || {},
|
22
23
|
_ref2$main = _ref2.main,
|
@@ -32,7 +33,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
32
33
|
children: 'children'
|
33
34
|
} : _ref2$fieldNames,
|
34
35
|
_ref2$cacheKey = _ref2.cacheKey,
|
35
|
-
cacheKey = _ref2$cacheKey === void 0 ?
|
36
|
+
cacheKey = _ref2$cacheKey === void 0 ? _utils.baseCacheKey : _ref2$cacheKey,
|
36
37
|
_ref2$requestRefresh = _ref2.requestRefresh,
|
37
38
|
requestRefresh = _ref2$requestRefresh === void 0 ? false : _ref2$requestRefresh,
|
38
39
|
_ref2$storage = _ref2.storage,
|
@@ -59,40 +60,40 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
59
60
|
staleTime: 6e4 * 60
|
60
61
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
61
62
|
setCache: function () {
|
62
|
-
var _setCache = (0, _asyncToGenerator2.default)(/*#__PURE__*/(
|
63
|
+
var _setCache = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator().m(function _callee(res) {
|
63
64
|
var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
|
64
|
-
return (
|
65
|
-
while (1) switch (_context.
|
65
|
+
return _regenerator().w(function (_context) {
|
66
|
+
while (1) switch (_context.n) {
|
66
67
|
case 0:
|
67
68
|
response = res.data;
|
68
69
|
if (!(transformResponse && typeof transformResponse === 'function')) {
|
69
|
-
_context.
|
70
|
+
_context.n = 3;
|
70
71
|
break;
|
71
72
|
}
|
72
|
-
_context.
|
73
|
+
_context.n = 1;
|
73
74
|
return transformResponse(res.data);
|
74
|
-
case
|
75
|
-
response = _context.
|
75
|
+
case 1:
|
76
|
+
response = _context.v;
|
76
77
|
if (!((0, _typeof2.default)(response) !== 'object' || response == null)) {
|
77
|
-
_context.
|
78
|
+
_context.n = 2;
|
78
79
|
break;
|
79
80
|
}
|
80
81
|
throw new Error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum2 = _locale.default.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
|
81
|
-
case
|
82
|
+
case 2:
|
82
83
|
res.data = response;
|
83
|
-
case
|
84
|
+
case 3:
|
84
85
|
if (!((0, _typeof2.default)(response) !== 'object' || response === null)) {
|
85
|
-
_context.
|
86
|
+
_context.n = 4;
|
86
87
|
break;
|
87
88
|
}
|
88
89
|
throw Error('response enum data must be object');
|
89
|
-
case
|
90
|
+
case 4:
|
90
91
|
if (!(Object.keys(response).length === 0)) {
|
91
|
-
_context.
|
92
|
+
_context.n = 5;
|
92
93
|
break;
|
93
94
|
}
|
94
95
|
throw Error('Please return valid enumeration data');
|
95
|
-
case
|
96
|
+
case 5:
|
96
97
|
// 只返回fieldNames对象的key
|
97
98
|
if (clear) {
|
98
99
|
// 忽略清洗的 codes
|
@@ -101,7 +102,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
101
102
|
if (!response[key] || !Array.isArray(response[key])) {
|
102
103
|
return;
|
103
104
|
}
|
104
|
-
var options = (0, _toConsumableArray2.default)(response[key])
|
105
|
+
var options = (0, _toConsumableArray2.default)(response[key]);
|
105
106
|
if (ignoreCodes.includes(key)) {
|
106
107
|
response[key] = options;
|
107
108
|
} else {
|
@@ -129,10 +130,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
129
130
|
logDebug(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum3 = _locale.default.ProEnum) === null || _locale$ProEnum3 === void 0 ? void 0 : _locale$ProEnum3.mainInitByRequest);
|
130
131
|
}, 10000);
|
131
132
|
}
|
132
|
-
return _context.
|
133
|
-
case 21:
|
134
|
-
case "end":
|
135
|
-
return _context.stop();
|
133
|
+
return _context.a(2, res);
|
136
134
|
}
|
137
135
|
}, _callee);
|
138
136
|
}));
|
@@ -169,20 +167,20 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
169
167
|
}
|
170
168
|
}));
|
171
169
|
var mergeData = /*#__PURE__*/function () {
|
172
|
-
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(
|
170
|
+
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator().m(function _callee2() {
|
173
171
|
var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res, _locale$ProEnum6;
|
174
|
-
return (
|
175
|
-
while (1) switch (_context2.
|
172
|
+
return _regenerator().w(function (_context2) {
|
173
|
+
while (1) switch (_context2.n) {
|
176
174
|
case 0:
|
177
175
|
cacheData = (0, _utils.getEnumData)(storage, cacheKey, baseEnumStorage) || {
|
178
176
|
data: {}
|
179
177
|
};
|
180
178
|
if (!((0, _typeof2.default)(cacheData) === 'object')) {
|
181
|
-
_context2.
|
179
|
+
_context2.n = 7;
|
182
180
|
break;
|
183
181
|
}
|
184
182
|
if (!((0, _typeof2.default)(cacheData.data) === 'object' && cacheData.data !== null)) {
|
185
|
-
_context2.
|
183
|
+
_context2.n = 7;
|
186
184
|
break;
|
187
185
|
}
|
188
186
|
enumData = cacheData.data;
|
@@ -191,38 +189,38 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
191
189
|
ignoreCodes = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options3 = useRequest.options) === null || _useRequest$options3 === void 0 ? void 0 : _useRequest$options3.ignoreCodes) || []; // 忽略清洗的 codes
|
192
190
|
diff = (0, _utils.diffCode)(cacheCodes, codes);
|
193
191
|
if (!diff) {
|
194
|
-
_context2.
|
192
|
+
_context2.n = 6;
|
195
193
|
break;
|
196
194
|
}
|
197
|
-
_context2.
|
195
|
+
_context2.n = 1;
|
198
196
|
return useRequest === null || useRequest === void 0 ? void 0 : useRequest.service();
|
199
|
-
case
|
200
|
-
res = _context2.
|
197
|
+
case 1:
|
198
|
+
res = _context2.v;
|
201
199
|
if (!(transformResponse && typeof transformResponse === 'function')) {
|
202
|
-
_context2.
|
200
|
+
_context2.n = 4;
|
203
201
|
break;
|
204
202
|
}
|
205
|
-
_context2.
|
203
|
+
_context2.n = 2;
|
206
204
|
return transformResponse(res);
|
207
|
-
case
|
208
|
-
response = _context2.
|
205
|
+
case 2:
|
206
|
+
response = _context2.v;
|
209
207
|
if (!((0, _typeof2.default)(response) !== 'object' || response == null)) {
|
210
|
-
_context2.
|
208
|
+
_context2.n = 3;
|
211
209
|
break;
|
212
210
|
}
|
213
211
|
throw new Error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum6 = _locale.default.ProEnum) === null || _locale$ProEnum6 === void 0 ? void 0 : _locale$ProEnum6.errorMessage);
|
214
|
-
case
|
215
|
-
_context2.
|
212
|
+
case 3:
|
213
|
+
_context2.n = 5;
|
216
214
|
break;
|
217
|
-
case
|
215
|
+
case 4:
|
218
216
|
if (res.status === 200) {
|
219
217
|
response = res.data;
|
220
218
|
}
|
221
|
-
case
|
219
|
+
case 5:
|
222
220
|
// 只返回fieldNames对象的key
|
223
221
|
if (clear) {
|
224
222
|
Object.keys(response).forEach(function (key) {
|
225
|
-
var options = (0, _toConsumableArray2.default)(response[key])
|
223
|
+
var options = (0, _toConsumableArray2.default)(response[key]);
|
226
224
|
if (ignoreCodes.includes(key)) {
|
227
225
|
response[key] = options;
|
228
226
|
} else {
|
@@ -239,9 +237,9 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
239
237
|
type: 'setProEnumDic',
|
240
238
|
payload: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, dics), dataSource), cacheData.data)
|
241
239
|
});
|
242
|
-
_context2.
|
240
|
+
_context2.n = 7;
|
243
241
|
break;
|
244
|
-
case
|
242
|
+
case 6:
|
245
243
|
if (dataSource && Object.keys(dataSource)) {
|
246
244
|
// 子系统也可能会有 dataSource
|
247
245
|
dispatch({
|
@@ -249,9 +247,8 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
249
247
|
payload: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, dics), dataSource)
|
250
248
|
});
|
251
249
|
}
|
252
|
-
case
|
253
|
-
|
254
|
-
return _context2.stop();
|
250
|
+
case 7:
|
251
|
+
return _context2.a(2);
|
255
252
|
}
|
256
253
|
}, _callee2);
|
257
254
|
}));
|