@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
package/lib/ProEnum/index.js
CHANGED
@@ -14,20 +14,12 @@ require("antd/es/radio/style");
|
|
14
14
|
var _radio = _interopRequireDefault(require("antd/es/radio"));
|
15
15
|
require("antd/es/message/style");
|
16
16
|
var _message2 = _interopRequireDefault(require("antd/es/message"));
|
17
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
18
17
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
19
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
20
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
21
19
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
22
|
-
var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));
|
23
|
-
var _omit2 = _interopRequireDefault(require("lodash/omit"));
|
24
|
-
var _isArray2 = _interopRequireDefault(require("lodash/isArray"));
|
25
|
-
var _isString2 = _interopRequireDefault(require("lodash/isString"));
|
26
|
-
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
27
|
-
var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
|
28
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
29
20
|
var _ahooks = require("ahooks");
|
30
21
|
var _react = _interopRequireWildcard(require("react"));
|
22
|
+
var _lodash = require("lodash");
|
31
23
|
var _ProSelect = _interopRequireDefault(require("../ProSelect"));
|
32
24
|
var _ProConfigProvider = require("../ProConfigProvider");
|
33
25
|
var _Tag = _interopRequireDefault(require("./components/Tag"));
|
@@ -39,9 +31,10 @@ var _useEnum = _interopRequireDefault(require("./hooks/useEnum"));
|
|
39
31
|
var _locale = _interopRequireDefault(require("../locale"));
|
40
32
|
require("./style/index.less");
|
41
33
|
var _useFieldProps2 = require("../ProForm/utils/useFieldProps");
|
34
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
42
35
|
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps", "isView"],
|
43
36
|
_excluded2 = ["fieldNames", "clear", "storage", "cacheKey", "showCodeName", "useRequest", "transformResponse"];
|
44
|
-
var ProEnum =
|
37
|
+
var ProEnum = props => {
|
45
38
|
var _otherProps$isView, _enumProps$showCodeNa;
|
46
39
|
var code = props.code,
|
47
40
|
_props$type = props.type,
|
@@ -72,6 +65,7 @@ var ProEnum = function ProEnum(props) {
|
|
72
65
|
configUseRequest = _ref2.useRequest,
|
73
66
|
configTransformResponse = _ref2.transformResponse,
|
74
67
|
resProps = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
68
|
+
|
75
69
|
// 优先使用props中的配置,如果没有则使用全局配置
|
76
70
|
var finalUseRequest = useRequest || configUseRequest;
|
77
71
|
var finalTransformResponse = transformResponse || configTransformResponse;
|
@@ -84,27 +78,28 @@ var ProEnum = function ProEnum(props) {
|
|
84
78
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
85
79
|
dataList = _useState2[0],
|
86
80
|
setData = _useState2[1];
|
87
|
-
(0, _react.useEffect)(
|
88
|
-
(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) && setData(
|
81
|
+
(0, _react.useEffect)(() => {
|
82
|
+
(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) && setData([...dataSource]);
|
89
83
|
}, [dataSource]);
|
90
84
|
if (fieldNames && Object.keys(fieldNames).length) {
|
91
|
-
if (fieldNames
|
92
|
-
if (fieldNames
|
85
|
+
if (fieldNames !== null && fieldNames !== void 0 && fieldNames.label) label = fieldNames.label;
|
86
|
+
if (fieldNames !== null && fieldNames !== void 0 && fieldNames.value) fieldValue = fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value;
|
93
87
|
}
|
94
88
|
if (props.fieldNames && Object.keys(props.fieldNames).length) {
|
95
89
|
var _props$fieldNames, _props$fieldNames2, _props$fieldNames3, _props$fieldNames4;
|
96
|
-
if (props
|
97
|
-
if (props
|
90
|
+
if (props !== null && props !== void 0 && (_props$fieldNames = props.fieldNames) !== null && _props$fieldNames !== void 0 && _props$fieldNames.label) label = (_props$fieldNames2 = props.fieldNames) === null || _props$fieldNames2 === void 0 ? void 0 : _props$fieldNames2.label;
|
91
|
+
if (props !== null && props !== void 0 && (_props$fieldNames3 = props.fieldNames) !== null && _props$fieldNames3 !== void 0 && _props$fieldNames3.value) fieldValue = (_props$fieldNames4 = props.fieldNames) === null || _props$fieldNames4 === void 0 ? void 0 : _props$fieldNames4.value;
|
98
92
|
}
|
99
93
|
if (clear) {
|
100
94
|
label = 'label';
|
101
95
|
fieldValue = 'value';
|
102
96
|
}
|
97
|
+
|
103
98
|
// 这种时候优先级最高、完全走自定义
|
104
|
-
if (
|
99
|
+
if (finalUseRequest !== null && finalUseRequest !== void 0 && finalUseRequest.service && props.fieldNames) {
|
105
100
|
var _props$fieldNames5, _props$fieldNames6;
|
106
|
-
if ((_props$fieldNames5 = props.fieldNames)
|
107
|
-
if ((_props$fieldNames6 = props.fieldNames)
|
101
|
+
if ((_props$fieldNames5 = props.fieldNames) !== null && _props$fieldNames5 !== void 0 && _props$fieldNames5.label) label = props.fieldNames.label;
|
102
|
+
if ((_props$fieldNames6 = props.fieldNames) !== null && _props$fieldNames6 !== void 0 && _props$fieldNames6.value) fieldValue = props.fieldNames.value;
|
108
103
|
}
|
109
104
|
var _useProConfig = (0, _ProConfigProvider.useProConfig)('ProEnum'),
|
110
105
|
_useProConfig$dics = _useProConfig.dics,
|
@@ -113,10 +108,10 @@ var ProEnum = function ProEnum(props) {
|
|
113
108
|
manual: true,
|
114
109
|
cacheTime: -1
|
115
110
|
}, finalUseRequest === null || finalUseRequest === void 0 ? void 0 : finalUseRequest.options), {}, {
|
116
|
-
onSuccess:
|
111
|
+
onSuccess: res => {
|
117
112
|
if (finalTransformResponse && typeof finalTransformResponse === 'function') {
|
118
113
|
var responseData = finalTransformResponse(res);
|
119
|
-
if (
|
114
|
+
if (typeof responseData !== 'object') {
|
120
115
|
var _locale$ProEnum;
|
121
116
|
return _message2.default.error((_locale$ProEnum = _locale.default.ProEnum) === null || _locale$ProEnum === void 0 ? void 0 : _locale$ProEnum.errorMessage);
|
122
117
|
}
|
@@ -127,14 +122,14 @@ var ProEnum = function ProEnum(props) {
|
|
127
122
|
msg = res.message,
|
128
123
|
data = res.data;
|
129
124
|
if (status === 200) {
|
130
|
-
if (
|
125
|
+
if (typeof data !== 'object') {
|
131
126
|
var _locale$ProEnum2;
|
132
127
|
return _message2.default.error((_locale$ProEnum2 = _locale.default.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
|
133
128
|
}
|
134
129
|
if (Array.isArray(data)) {
|
135
|
-
setData(
|
130
|
+
setData([...data]);
|
136
131
|
}
|
137
|
-
if ((0, _utils.isObject)(data) && (0,
|
132
|
+
if ((0, _utils.isObject)(data) && (0, _lodash.isString)(code)) {
|
138
133
|
setData(data[code]);
|
139
134
|
}
|
140
135
|
} else {
|
@@ -144,35 +139,36 @@ var ProEnum = function ProEnum(props) {
|
|
144
139
|
}
|
145
140
|
})),
|
146
141
|
run = _useRequestFunc.run;
|
142
|
+
|
147
143
|
// 自定义请求
|
148
|
-
(0, _ahooks.useDeepCompareEffect)(
|
144
|
+
(0, _ahooks.useDeepCompareEffect)(() => {
|
149
145
|
var _ref3 = (finalUseRequest === null || finalUseRequest === void 0 ? void 0 : finalUseRequest.options) || {},
|
150
146
|
defaultParams = _ref3.defaultParams;
|
151
147
|
var params = Array.isArray(defaultParams) ? defaultParams === null || defaultParams === void 0 ? void 0 : defaultParams[0] : defaultParams || {};
|
152
148
|
// 如果缓存数据存在,则不请求
|
153
|
-
if (
|
149
|
+
if (finalUseRequest !== null && finalUseRequest !== void 0 && finalUseRequest.service && (!Object.keys(cacheData).length || cacheData !== null && cacheData !== void 0 && cacheData.data && !Object.keys(cacheData === null || cacheData === void 0 ? void 0 : cacheData.data).length)) {
|
154
150
|
run(params);
|
155
151
|
}
|
156
152
|
}, [finalUseRequest === null || finalUseRequest === void 0 ? void 0 : finalUseRequest.options]);
|
157
|
-
var enumLists = (0, _react.useMemo)(
|
153
|
+
var enumLists = (0, _react.useMemo)(() => {
|
158
154
|
var lists = [];
|
159
|
-
if ((0,
|
155
|
+
if ((0, _lodash.isString)(code)) {
|
160
156
|
lists = (dics === null || dics === void 0 ? void 0 : dics[code]) || [];
|
161
157
|
}
|
162
|
-
if ((0,
|
163
|
-
code.forEach(
|
164
|
-
|
165
|
-
(0, _isArray2.default)(dics === null || dics === void 0 ? void 0 : dics[enumCode]) && (_lists = lists).push.apply(_lists, (0, _toConsumableArray2.default)(dics === null || dics === void 0 ? void 0 : dics[enumCode]));
|
158
|
+
if ((0, _lodash.isArray)(code)) {
|
159
|
+
code.forEach(enumCode => {
|
160
|
+
(0, _lodash.isArray)(dics === null || dics === void 0 ? void 0 : dics[enumCode]) && lists.push(...(dics === null || dics === void 0 ? void 0 : dics[enumCode]));
|
166
161
|
});
|
167
162
|
}
|
168
163
|
return lists;
|
169
164
|
}, [dics, code]);
|
170
|
-
var renderComponent =
|
165
|
+
var renderComponent = () => {
|
171
166
|
var list = [];
|
167
|
+
|
172
168
|
// 优先使用组件内部自己传入的数据源或者请求得到的数据
|
173
|
-
list = (0,
|
169
|
+
list = (0, _lodash.cloneDeep)(dataList && dataList.length ? dataList : enumLists);
|
174
170
|
// 对数据进行一系列的过滤等操作
|
175
|
-
if (!(finalUseRequest
|
171
|
+
if (!(finalUseRequest !== null && finalUseRequest !== void 0 && finalUseRequest.service) && finalTransformResponse) {
|
176
172
|
list = finalTransformResponse(list);
|
177
173
|
if (!Array.isArray(list)) {
|
178
174
|
var _locale$ProEnum3;
|
@@ -180,12 +176,12 @@ var ProEnum = function ProEnum(props) {
|
|
180
176
|
list = [];
|
181
177
|
}
|
182
178
|
}
|
183
|
-
if (/*#__PURE__*/_react.default.isValidElement(component)) {
|
179
|
+
if ( /*#__PURE__*/_react.default.isValidElement(component)) {
|
184
180
|
var Component = component;
|
185
|
-
return (0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
|
181
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
|
186
182
|
dataSource: list,
|
187
183
|
fieldNames: {
|
188
|
-
label
|
184
|
+
label,
|
189
185
|
value: fieldValue
|
190
186
|
},
|
191
187
|
value: value,
|
@@ -194,44 +190,40 @@ var ProEnum = function ProEnum(props) {
|
|
194
190
|
}
|
195
191
|
switch (type) {
|
196
192
|
case 'ProSelect':
|
197
|
-
return (0, _jsxRuntime.jsx)(_ProSelect.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
|
193
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProSelect.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
|
198
194
|
otherProps: otherProps,
|
199
195
|
dataSource: list,
|
200
196
|
fieldNames: {
|
201
|
-
label
|
197
|
+
label,
|
202
198
|
value: fieldValue
|
203
199
|
},
|
204
200
|
value: value,
|
205
201
|
onChange: onChange
|
206
202
|
}));
|
207
203
|
case 'Radio':
|
208
|
-
return (0, _jsxRuntime.jsx)(_radio.default.Group, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0,
|
204
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_radio.default.Group, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(enumProps, ['fieldNames', 'showCodeName'])), {}, {
|
209
205
|
options: list,
|
210
206
|
value: value,
|
211
207
|
onChange: onChange,
|
212
|
-
children: list.map(
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
}, item[fieldValue]);
|
218
|
-
})
|
208
|
+
children: list.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_radio.default, {
|
209
|
+
value: item[fieldValue],
|
210
|
+
disabled: !!item.disabled,
|
211
|
+
children: item[label]
|
212
|
+
}, item[fieldValue]))
|
219
213
|
}));
|
220
214
|
case 'Checkbox':
|
221
|
-
return (0, _jsxRuntime.jsx)(_checkbox.default.Group, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0,
|
215
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_checkbox.default.Group, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(enumProps, ['fieldNames', 'showCodeName'])), {}, {
|
222
216
|
options: list,
|
223
217
|
value: value,
|
224
218
|
onChange: onChange,
|
225
|
-
children: list.map(
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
}, item[fieldValue]);
|
231
|
-
})
|
219
|
+
children: list.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_checkbox.default, {
|
220
|
+
value: item[fieldValue],
|
221
|
+
disabled: !!item.disabled,
|
222
|
+
children: item[label]
|
223
|
+
}, item[fieldValue]))
|
232
224
|
}));
|
233
225
|
case 'Tag':
|
234
|
-
return (0, _jsxRuntime.jsx)(_Tag.default, {
|
226
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tag.default, {
|
235
227
|
id: enumProps.id,
|
236
228
|
value: value,
|
237
229
|
onChange: onChange,
|
@@ -240,7 +232,7 @@ var ProEnum = function ProEnum(props) {
|
|
240
232
|
dataSource: list
|
241
233
|
});
|
242
234
|
case 'Group':
|
243
|
-
return (0, _jsxRuntime.jsx)(_Group.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0,
|
235
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Group.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(enumProps, ['showCodeName'])), {}, {
|
244
236
|
value: value,
|
245
237
|
onChange: onChange,
|
246
238
|
fieldLabel: label,
|
@@ -253,15 +245,15 @@ var ProEnum = function ProEnum(props) {
|
|
253
245
|
};
|
254
246
|
if (!code && !dataSource && !useRequest) {
|
255
247
|
var _locale$ProEnum4;
|
256
|
-
_message2.default.error(
|
248
|
+
_message2.default.error(`${otherProps === null || otherProps === void 0 ? void 0 : otherProps.label}-${otherProps === null || otherProps === void 0 ? void 0 : otherProps.name}-${_locale.default === null || _locale.default === void 0 || (_locale$ProEnum4 = _locale.default.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType}`);
|
257
249
|
}
|
258
|
-
var transToLabel =
|
250
|
+
var transToLabel = value => {
|
259
251
|
var list = dataList && dataList.length ? dataList : enumLists;
|
260
252
|
if (!Array.isArray(list) || !list.length) {
|
261
253
|
return viewEmpty;
|
262
254
|
}
|
263
|
-
var labelList = value.map(
|
264
|
-
var option = list.find(
|
255
|
+
var labelList = value.map(v => {
|
256
|
+
var option = list.find(item => {
|
265
257
|
if (enumProps.labelInValue) {
|
266
258
|
return item[fieldValue] === (v === null || v === void 0 ? void 0 : v[fieldValue]);
|
267
259
|
}
|
@@ -270,49 +262,47 @@ var ProEnum = function ProEnum(props) {
|
|
270
262
|
if (!option) {
|
271
263
|
return '';
|
272
264
|
}
|
273
|
-
return enumProps.showCodeName ?
|
265
|
+
return enumProps.showCodeName ? `${option === null || option === void 0 ? void 0 : option[fieldValue]}-${option === null || option === void 0 ? void 0 : option[label]}` : option === null || option === void 0 ? void 0 : option[label];
|
274
266
|
});
|
275
|
-
var record = value.map(
|
276
|
-
return list.find(
|
267
|
+
var record = value.map(v => {
|
268
|
+
return list.find(item => {
|
277
269
|
return item[fieldValue] === v;
|
278
270
|
});
|
279
271
|
});
|
280
272
|
// 自定义option时,默认取optionRender的值
|
281
|
-
var _optionRender =
|
273
|
+
var _optionRender = () => {
|
282
274
|
if (!record.length) {
|
283
275
|
return viewEmpty;
|
284
276
|
}
|
285
277
|
var arr = [];
|
286
|
-
record.forEach(
|
278
|
+
record.forEach(item => {
|
287
279
|
arr.push(props.optionRender(item));
|
288
280
|
});
|
289
|
-
return (0, _jsxRuntime.jsx)(_space.default, {
|
281
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_space.default, {
|
290
282
|
direction: "vertical",
|
291
283
|
size: 4,
|
292
|
-
children: arr.map(
|
293
|
-
|
294
|
-
|
295
|
-
}, item);
|
296
|
-
})
|
284
|
+
children: arr.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
285
|
+
children: item
|
286
|
+
}, item))
|
297
287
|
});
|
298
288
|
};
|
299
|
-
return (0,
|
289
|
+
return (0, _lodash.isFunction)(props.optionRender) && record.length ? _optionRender() : labelList === null || labelList === void 0 ? void 0 : labelList.join(',');
|
300
290
|
};
|
301
291
|
if (_isView) {
|
302
292
|
var __value = value || _defalutValue;
|
303
293
|
if (Array.isArray(__value)) {
|
304
|
-
return (0, _jsxRuntime.jsx)(_Container.default, {
|
294
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
305
295
|
tooltip: true,
|
306
296
|
viewEmpty: viewEmpty,
|
307
297
|
children: transToLabel(__value)
|
308
298
|
});
|
309
299
|
}
|
310
|
-
return (0, _jsxRuntime.jsx)(_Container.default, {
|
300
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
311
301
|
viewEmpty: viewEmpty,
|
312
|
-
children: __value || (0,
|
302
|
+
children: __value || (0, _lodash.isNumber)(__value) ? transToLabel([__value]) : null
|
313
303
|
});
|
314
304
|
}
|
315
|
-
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
305
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
316
306
|
children: renderComponent()
|
317
307
|
});
|
318
308
|
};
|
@@ -1,41 +1,32 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
-
var
|
5
|
-
var
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
(0, _classCallCheck2.default)(this, SimpleEventCenter);
|
10
|
-
this.events = void 0;
|
4
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
5
|
+
var _lodash = require("lodash");
|
6
|
+
class SimpleEventCenter {
|
7
|
+
constructor() {
|
8
|
+
(0, _defineProperty2.default)(this, "events", void 0);
|
11
9
|
this.events = new Map();
|
12
10
|
}
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
if (!this.events.has(eventName)) {
|
17
|
-
this.events.set(eventName, []);
|
18
|
-
}
|
19
|
-
this.events.get(eventName).push(callback);
|
11
|
+
subscribe(eventName, callback) {
|
12
|
+
if (!this.events.has(eventName)) {
|
13
|
+
this.events.set(eventName, []);
|
20
14
|
}
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}
|
15
|
+
this.events.get(eventName).push(callback);
|
16
|
+
}
|
17
|
+
publish(eventName, data) {
|
18
|
+
if (this.events.has(eventName)) {
|
19
|
+
this.events.get(eventName).forEach(callback => {
|
20
|
+
(0, _lodash.isFunction)(callback) && (callback === null || callback === void 0 ? void 0 : callback(data));
|
21
|
+
});
|
29
22
|
}
|
30
|
-
}
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
this.events.set(eventName, this.events.get(eventName).filter(function (cb) {
|
35
|
-
return cb !== callback;
|
36
|
-
}));
|
37
|
-
}
|
23
|
+
}
|
24
|
+
unsubscribe(eventName, callback) {
|
25
|
+
if (this.events.has(eventName)) {
|
26
|
+
this.events.set(eventName, this.events.get(eventName).filter(cb => cb !== callback));
|
38
27
|
}
|
39
|
-
}
|
40
|
-
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
// 将 eventCenter 实例添加到 window 对象上
|
41
32
|
window.eventCenter = new SimpleEventCenter();
|
@@ -9,6 +9,10 @@ exports.replaceFrequentEnumCache = replaceFrequentEnumCache;
|
|
9
9
|
exports.validateFrequentEnumConfig = validateFrequentEnumConfig;
|
10
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
11
11
|
var _index = require("./index");
|
12
|
+
/**
|
13
|
+
* 替换频繁枚举缓存数据的参数接口
|
14
|
+
*/
|
15
|
+
|
12
16
|
/**
|
13
17
|
* 替换频繁枚举缓存数据
|
14
18
|
* @param params 参数对象
|
@@ -31,6 +35,7 @@ function replaceFrequentEnumCache(params) {
|
|
31
35
|
} : _params$fieldNames,
|
32
36
|
_params$clear = params.clear,
|
33
37
|
clear = _params$clear === void 0 ? true : _params$clear;
|
38
|
+
|
34
39
|
// 参数验证
|
35
40
|
if (!storage || !cacheKey) {
|
36
41
|
console.warn('ProEnum: storage and cacheKey are required for replaceFrequentEnumCache');
|
@@ -47,26 +52,31 @@ function replaceFrequentEnumCache(params) {
|
|
47
52
|
var cacheData = (0, _index.getEnumData)(storage, cacheKey) || {
|
48
53
|
data: {}
|
49
54
|
};
|
55
|
+
|
50
56
|
// 确保cacheData.data存在
|
51
57
|
if (!cacheData.data) {
|
52
58
|
cacheData.data = {};
|
53
59
|
}
|
60
|
+
|
54
61
|
// 只替换指定的枚举
|
55
|
-
enums.forEach(
|
62
|
+
enums.forEach(code => {
|
56
63
|
if (newData[code]) {
|
57
64
|
var processedData = newData[code];
|
65
|
+
|
58
66
|
// 应用数据清洗逻辑
|
59
67
|
if (clear && Array.isArray(processedData)) {
|
60
|
-
processedData = processedData.map(
|
68
|
+
processedData = processedData.map(item => {
|
61
69
|
return (0, _index.cacheFieldNames)(fieldNames, item);
|
62
70
|
});
|
63
71
|
}
|
64
72
|
cacheData.data[code] = processedData;
|
73
|
+
cacheData.time = Date.now();
|
65
74
|
}
|
66
75
|
});
|
67
76
|
(0, _index.setEnumData)(storage, cacheKey, cacheData);
|
68
77
|
return cacheData;
|
69
78
|
}
|
79
|
+
|
70
80
|
/**
|
71
81
|
* 验证频繁枚举配置
|
72
82
|
* @param config 频繁枚举配置
|
@@ -74,8 +84,9 @@ function replaceFrequentEnumCache(params) {
|
|
74
84
|
*/
|
75
85
|
function validateFrequentEnumConfig(config) {
|
76
86
|
var _config$enums;
|
77
|
-
return !!(
|
87
|
+
return !!(config !== null && config !== void 0 && (_config$enums = config.enums) !== null && _config$enums !== void 0 && _config$enums.length && config !== null && config !== void 0 && config.service);
|
78
88
|
}
|
89
|
+
|
79
90
|
/**
|
80
91
|
* 合并频繁枚举数据到全局状态
|
81
92
|
* @param cacheData 缓存数据
|
@@ -1,17 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.default = void 0;
|
8
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
9
|
-
var _isString2 = _interopRequireDefault(require("lodash/isString"));
|
10
|
-
var _isArray2 = _interopRequireDefault(require("lodash/isArray"));
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
12
7
|
var _react = require("react");
|
8
|
+
var _lodash = require("lodash");
|
13
9
|
var _ProConfigProvider = require("../../ProConfigProvider");
|
14
|
-
var
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
11
|
+
var EnumLabel = props => {
|
15
12
|
var fieldNameLabel = '';
|
16
13
|
var fieldNameValue = '';
|
17
14
|
var _ref = (0, _ProConfigProvider.useProConfig)('ProEnum') || {},
|
@@ -34,30 +31,27 @@ var EnumLabel = function EnumLabel(props) {
|
|
34
31
|
var _useProConfig = (0, _ProConfigProvider.useProConfig)('ProEnum'),
|
35
32
|
_useProConfig$dics = _useProConfig.dics,
|
36
33
|
dics = _useProConfig$dics === void 0 ? {} : _useProConfig$dics;
|
37
|
-
var enumLists = (0, _react.useMemo)(
|
34
|
+
var enumLists = (0, _react.useMemo)(() => {
|
38
35
|
var lists = [];
|
39
|
-
if ((0,
|
36
|
+
if ((0, _lodash.isString)(code)) {
|
40
37
|
lists = (dics === null || dics === void 0 ? void 0 : dics[code]) || [];
|
41
38
|
}
|
42
|
-
if ((0,
|
43
|
-
code.forEach(
|
44
|
-
|
45
|
-
(0, _isArray2.default)(dics === null || dics === void 0 ? void 0 : dics[enumCode]) && (_lists = lists).push.apply(_lists, (0, _toConsumableArray2.default)(dics === null || dics === void 0 ? void 0 : dics[enumCode]));
|
39
|
+
if ((0, _lodash.isArray)(code)) {
|
40
|
+
code.forEach(enumCode => {
|
41
|
+
(0, _lodash.isArray)(dics === null || dics === void 0 ? void 0 : dics[enumCode]) && lists.push(...(dics === null || dics === void 0 ? void 0 : dics[enumCode]));
|
46
42
|
});
|
47
43
|
}
|
48
44
|
return lists;
|
49
45
|
}, [dics, code]);
|
50
|
-
var transToLabel =
|
51
|
-
var labelList = value.map(
|
52
|
-
var option = enumLists.find(
|
53
|
-
return option[fieldNameValue] === v;
|
54
|
-
});
|
46
|
+
var transToLabel = value => {
|
47
|
+
var labelList = value.map(v => {
|
48
|
+
var option = enumLists.find(option => option[fieldNameValue] === v);
|
55
49
|
if (option && option[fieldNameLabel]) {
|
56
|
-
return compose ?
|
50
|
+
return compose ? `${value}-${option[fieldNameLabel]}` : option[fieldNameLabel];
|
57
51
|
}
|
58
52
|
return '';
|
59
53
|
});
|
60
|
-
return (0, _jsxRuntime.jsx)("span", {
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
61
55
|
children: labelList.join(',') || '-'
|
62
56
|
});
|
63
57
|
};
|
@@ -67,7 +61,7 @@ var EnumLabel = function EnumLabel(props) {
|
|
67
61
|
}
|
68
62
|
return transToLabel([value]);
|
69
63
|
}
|
70
|
-
return (0, _jsxRuntime.jsx)("span", {
|
64
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
71
65
|
children: "-"
|
72
66
|
});
|
73
67
|
};
|
@@ -78,7 +72,7 @@ var getEnumLabel = function getEnumLabel(code, value) {
|
|
78
72
|
if (!code) {
|
79
73
|
return null;
|
80
74
|
}
|
81
|
-
return (0, _jsxRuntime.jsx)(EnumLabel, {
|
75
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(EnumLabel, {
|
82
76
|
code: code,
|
83
77
|
value: value,
|
84
78
|
compose: compose,
|
@@ -12,8 +12,7 @@ exports.isObject = isObject;
|
|
12
12
|
exports.mergeCacheData = mergeCacheData;
|
13
13
|
exports.setEnumData = setEnumData;
|
14
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
15
|
-
var
|
16
|
-
var _isNull2 = _interopRequireDefault(require("lodash/isNull"));
|
15
|
+
var _lodash = require("lodash");
|
17
16
|
var _excluded = ["children"];
|
18
17
|
/**
|
19
18
|
* 获取枚举数据
|
@@ -38,6 +37,7 @@ function getEnumData(storage, cacheKey, baseEnumStorage) {
|
|
38
37
|
return JSON.parse(window.sessionStorage.getItem(cacheKey) || '{}');
|
39
38
|
}
|
40
39
|
}
|
40
|
+
|
41
41
|
/**
|
42
42
|
* 设置枚举数据
|
43
43
|
* @param storage
|
@@ -46,7 +46,7 @@ function getEnumData(storage, cacheKey, baseEnumStorage) {
|
|
46
46
|
*/
|
47
47
|
function setEnumData(storage, cacheKey, data) {
|
48
48
|
var _Object$keys;
|
49
|
-
if (!((_Object$keys = Object.keys(data === null || data === void 0 ? void 0 : data.data))
|
49
|
+
if (!((_Object$keys = Object.keys(data === null || data === void 0 ? void 0 : data.data)) !== null && _Object$keys !== void 0 && _Object$keys.length)) {
|
50
50
|
return false;
|
51
51
|
}
|
52
52
|
if (storage === 'localStorage') {
|
@@ -55,6 +55,7 @@ function setEnumData(storage, cacheKey, data) {
|
|
55
55
|
window.sessionStorage.setItem(cacheKey, JSON.stringify(data));
|
56
56
|
}
|
57
57
|
}
|
58
|
+
|
58
59
|
/**
|
59
60
|
* 判断枚举列表是否存在
|
60
61
|
* @param storage
|
@@ -67,6 +68,7 @@ function hasEnumList(storage, cacheKey, code) {
|
|
67
68
|
var enumList = (res === null || res === void 0 ? void 0 : res.data) || {};
|
68
69
|
return enumList === null || enumList === void 0 ? void 0 : enumList[code];
|
69
70
|
}
|
71
|
+
|
70
72
|
/**
|
71
73
|
* 判断是否是对象
|
72
74
|
* @param obj
|
@@ -75,6 +77,7 @@ function hasEnumList(storage, cacheKey, code) {
|
|
75
77
|
function isObject(obj) {
|
76
78
|
return Object.prototype.toString.call(obj) === '[object Object]';
|
77
79
|
}
|
80
|
+
|
78
81
|
/**
|
79
82
|
* 合并枚举数据
|
80
83
|
* @param storage
|
@@ -90,8 +93,9 @@ function mergeCacheData(storage, code, cacheKey, responseData) {
|
|
90
93
|
if (cacheData && cacheData.data) {
|
91
94
|
cacheData.data[code] = responseData;
|
92
95
|
}
|
93
|
-
(_window2 = window) === null || _window2 === void 0
|
96
|
+
(_window2 = window) === null || _window2 === void 0 || _window2[cacheStorage].setItem(cacheKey, JSON.stringify(cacheData));
|
94
97
|
}
|
98
|
+
|
95
99
|
/**
|
96
100
|
* diff code 差异
|
97
101
|
* @param cacheCodes
|
@@ -111,6 +115,7 @@ function diffCode(cacheCodes, codes) {
|
|
111
115
|
}
|
112
116
|
return diff;
|
113
117
|
}
|
118
|
+
|
114
119
|
/**
|
115
120
|
* 缓存fieldNames制定的值
|
116
121
|
* @param fieldNames 保留映射值
|
@@ -121,15 +126,15 @@ function cacheFieldNames(fieldNames, dataSource) {
|
|
121
126
|
var children = fieldNames.children,
|
122
127
|
restFieldNames = (0, _objectWithoutProperties2.default)(fieldNames, _excluded);
|
123
128
|
var result = {};
|
124
|
-
Object.keys(restFieldNames).forEach(
|
129
|
+
Object.keys(restFieldNames).forEach(key => {
|
125
130
|
var value = dataSource[restFieldNames[key]] ? dataSource[restFieldNames[key]] : dataSource[key];
|
126
|
-
if (!((0,
|
131
|
+
if (!((0, _lodash.isUndefined)(value) || (0, _lodash.isNull)(value))) {
|
127
132
|
result[key] = dataSource[restFieldNames[key]] ? dataSource[restFieldNames[key]] : dataSource[key];
|
128
133
|
}
|
129
134
|
});
|
130
135
|
// 递归去对数据进行清洗
|
131
136
|
if (children && Array.isArray(dataSource[children])) {
|
132
|
-
result.children = dataSource[children].map(
|
137
|
+
result.children = dataSource[children].map(item => {
|
133
138
|
return cacheFieldNames(fieldNames, item);
|
134
139
|
});
|
135
140
|
}
|