@zat-design/sisyphus-react 3.13.14-deta.2 → 4.0.0-beta.3
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 +557 -341
- package/dist/less.esm.css +527 -309
- package/es/FormsProvider/index.d.ts +4 -1
- package/es/FormsProvider/index.js +4 -2
- package/es/ProAction/components/CheckModalContent/index.js +9 -16
- package/es/ProAction/index.js +39 -40
- package/es/ProAction/index.less +2 -2
- package/es/ProConfigProvider/index.d.ts +21 -4
- package/es/ProConfigProvider/index.js +62 -28
- package/es/ProDownload/index.js +57 -65
- package/es/ProDownload/style/index.less +2 -2
- package/es/ProDownload/utils.js +17 -14
- package/es/ProDrawerForm/components/ProDrawer/index.js +40 -38
- package/es/ProDrawerForm/components/ProModal/index.js +25 -31
- package/es/ProDrawerForm/components/index.js +2 -2
- package/es/ProDrawerForm/index.d.ts +2 -1
- package/es/ProDrawerForm/index.js +16 -16
- package/es/ProDrawerForm/propsType.d.ts +7 -18
- package/es/ProDrawerForm/style/index.less +8 -14
- package/es/ProEditLabel/components/RenderProForm.js +26 -23
- package/es/ProEditLabel/index.js +32 -29
- package/es/ProEditLabel/propsType.d.ts +1 -6
- package/es/ProEditLabel/style/index.less +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +32 -27
- package/es/ProEditTable/components/RcTable/BaseTable.js +77 -58
- package/es/ProEditTable/components/RcTable/DraggableTable.js +78 -58
- package/es/ProEditTable/components/RcTable/index.d.ts +0 -2
- package/es/ProEditTable/components/RcTable/index.js +2 -4
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +32 -25
- package/es/ProEditTable/components/RenderField/index.d.ts +3 -2
- package/es/ProEditTable/components/RenderField/index.js +456 -301
- package/es/ProEditTable/components/RenderToolbar/index.js +17 -15
- package/es/ProEditTable/components/Summary/index.js +14 -15
- package/es/ProEditTable/components/Validator/index.js +8 -10
- package/es/ProEditTable/components/index.js +5 -5
- package/es/ProEditTable/index.d.ts +1 -1
- package/es/ProEditTable/index.js +163 -150
- package/es/ProEditTable/propsType.d.ts +1 -7
- package/es/ProEditTable/style/index.less +3 -7
- package/es/ProEditTable/utils/config.js +24 -21
- package/es/ProEditTable/utils/diffOriginal.js +8 -6
- package/es/ProEditTable/utils/getDefaultProps.js +8 -8
- package/es/ProEditTable/utils/index.js +76 -60
- package/es/ProEditTable/utils/tools.js +61 -55
- package/es/ProEditTable/utils/useEditTableError.js +25 -6
- package/es/ProEnum/components/Group.js +6 -6
- package/es/ProEnum/components/Tag.js +8 -6
- package/es/ProEnum/hooks/useEnum.js +26 -4
- package/es/ProEnum/hooks/useEnumRequest.js +23 -21
- package/es/ProEnum/index.js +52 -60
- package/es/ProEnum/style/index.less +2 -2
- package/es/ProEnum/utils/eventCenter.js +6 -4
- package/es/ProEnum/utils/getEnumLabel.js +9 -10
- package/es/ProEnum/utils/index.d.ts +1 -0
- package/es/ProEnum/utils/index.js +12 -6
- package/es/ProForm/components/Container.d.ts +1 -0
- package/es/ProForm/components/Container.js +8 -7
- package/es/ProForm/components/FormFooter/index.js +20 -18
- package/es/ProForm/components/FormFooter/propsType.d.ts +2 -0
- package/es/ProForm/components/base/Checkbox/index.js +12 -10
- package/es/ProForm/components/base/DatePicker/index.d.ts +1 -3
- package/es/ProForm/components/base/DatePicker/index.js +25 -23
- 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 +21 -26
- package/es/ProForm/components/base/InputNumber/index.js +43 -42
- package/es/ProForm/components/base/Radio/index.js +10 -9
- package/es/ProForm/components/base/RangePicker/index.js +24 -25
- package/es/ProForm/components/base/RangePicker/useDateRange.d.ts +5 -5
- package/es/ProForm/components/base/Select/index.js +12 -11
- package/es/ProForm/components/base/Switch/index.js +13 -13
- package/es/ProForm/components/base/SwitchCheckbox/index.js +16 -16
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +2 -2
- package/es/ProForm/components/base/TextArea/index.js +15 -15
- 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 +11 -11
- package/es/ProForm/components/base/TimePicker/style/index.less +5 -3
- package/es/ProForm/components/combination/Container/index.js +14 -12
- package/es/ProForm/components/combination/Container/style/index.less +2 -2
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +40 -35
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +15 -17
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +6 -6
- package/es/ProForm/components/combination/FormList/components/Empty.js +16 -14
- package/es/ProForm/components/combination/FormList/components/LineFields.js +13 -13
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +20 -22
- package/es/ProForm/components/combination/FormList/index.js +23 -23
- package/es/ProForm/components/combination/FormList/style/index.less +38 -2
- package/es/ProForm/components/combination/FormList/utils.js +5 -3
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +1 -0
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +7 -5
- package/es/ProForm/components/combination/Group/component/ComRender.js +19 -15
- package/es/ProForm/components/combination/Group/hooks/index.js +19 -16
- package/es/ProForm/components/combination/Group/index.d.ts +2 -8
- package/es/ProForm/components/combination/Group/index.js +27 -20
- 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 +24 -17
- package/es/ProForm/components/combination/ProCascader/index.js +51 -48
- 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/ProCascader/utils/index.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +15 -9
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +99 -100
- 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 +31 -27
- 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 +69 -49
- 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 +54 -45
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +66 -6
- package/es/ProForm/components/index.d.ts +2 -8
- package/es/ProForm/components/index.js +31 -36
- package/es/ProForm/components/render/ChangedWrapper.js +23 -18
- package/es/ProForm/components/render/ConfirmWrapper.js +15 -16
- package/es/ProForm/components/render/Render.js +95 -76
- package/es/ProForm/components/render/RenderFields.js +42 -27
- package/es/ProForm/components/render/propsType.d.ts +2 -6
- package/es/ProForm/components/render/propsType.js +25 -0
- package/es/ProForm/index.js +54 -67
- package/es/ProForm/propsType.d.ts +1 -1
- package/es/ProForm/propsType.js +5 -1
- package/es/ProForm/style/index.less +6 -16
- package/es/ProForm/utils/diffOriginal.js +9 -7
- package/es/ProForm/utils/getDefaultProps.js +7 -7
- package/es/ProForm/utils/index.d.ts +15 -1
- package/es/ProForm/utils/index.js +126 -52
- package/es/ProForm/utils/processDependencies.js +11 -0
- package/es/ProForm/utils/rulesCreator.js +12 -13
- package/es/ProForm/utils/transformNames.js +5 -4
- package/es/ProForm/utils/transformValue.js +11 -6
- package/es/ProForm/utils/useDeepCompareMemo.js +8 -6
- package/es/ProForm/utils/useForm.js +47 -37
- package/es/ProForm/utils/useRules.js +11 -9
- package/es/ProForm/utils/useShouldUpdate.js +39 -37
- package/es/ProForm/utils/useWatch.js +25 -3
- package/es/ProForm/utils/valueType.js +6 -3
- package/es/ProIcon/config/index.js +2 -0
- package/es/ProIcon/index.js +38 -31
- package/es/ProIcon/style/index.less +2 -2
- package/es/ProIcon/utils/index.js +4 -5
- package/es/ProLayout/components/Layout/Header/index.js +13 -11
- package/es/ProLayout/components/Layout/Icon/Icon.js +3 -3
- package/es/ProLayout/components/Layout/Icon/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +33 -27
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +42 -39
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +32 -28
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +12 -6
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +7 -6
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +9 -5
- package/es/ProLayout/components/Layout/Menu/index.js +12 -10
- package/es/ProLayout/components/Layout/Menu/style/index.less +2 -2
- package/es/ProLayout/components/Layout/Notice/index.js +9 -8
- package/es/ProLayout/components/Layout/Notice/style/index.less +2 -2
- package/es/ProLayout/components/Layout/index.js +4 -4
- package/es/ProLayout/components/ProCollapse/index.js +35 -47
- package/es/ProLayout/components/ProCollapse/style/index.less +3 -3
- package/es/ProLayout/components/ProFooter/index.js +5 -6
- package/es/ProLayout/components/ProFooter/style/index.less +2 -2
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +8 -9
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -6
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +9 -9
- package/es/ProLayout/components/ProHeader/components/index.js +2 -2
- package/es/ProLayout/components/ProHeader/index.js +117 -108
- package/es/ProLayout/components/ProHeader/style/index.less +2 -2
- package/es/ProLayout/components/index.js +3 -3
- package/es/ProLayout/index.d.ts +1 -1
- package/es/ProLayout/index.js +24 -19
- package/es/ProLayout/style/index.less +4 -3
- package/es/ProLayout/utils/index.js +21 -18
- package/es/ProSelect/components/AdaptiveTooltip.js +6 -6
- package/es/ProSelect/index.js +48 -57
- package/es/ProSelect/index.less +2 -2
- package/es/ProSelect/propsType.d.ts +1 -1
- package/es/ProSelect/utils/index.js +5 -4
- package/es/ProStep/components/Anchor/index.d.ts +1 -0
- package/es/ProStep/components/Anchor/index.js +20 -20
- package/es/ProStep/components/Item/index.d.ts +1 -0
- package/es/ProStep/components/Item/index.js +16 -11
- package/es/ProStep/components/Listener/index.js +5 -5
- package/es/ProStep/components/Step/index.js +16 -14
- package/es/ProStep/index.js +31 -27
- package/es/ProStep/style/index.less +4 -4
- package/es/ProStep/utils/index.js +6 -5
- package/es/ProStepTab/index.js +32 -9
- package/es/ProTable/components/FormatColumn/index.js +85 -81
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -1
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +4 -6
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +31 -25
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +10 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +6 -8
- package/es/ProTable/components/RcTable/index.js +2 -2
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.js +38 -37
- package/es/ProTable/components/RenderEmptyText/index.js +7 -6
- package/es/ProTable/components/RenderFooter/index.js +2 -2
- package/es/ProTable/components/RenderSummary/index.js +12 -12
- package/es/ProTable/components/RenderTableHeader/index.js +16 -15
- package/es/ProTable/components/RenderTabs/index.js +9 -11
- package/es/ProTable/components/TableResizable/index.js +10 -8
- package/es/ProTable/components/TooltipTitle/index.js +7 -7
- package/es/ProTable/components/index.js +11 -6
- package/es/ProTable/hooks/useAntdTable.d.ts +0 -3
- package/es/ProTable/hooks/useAntdTable.js +97 -122
- package/es/ProTable/index.d.ts +0 -3
- package/es/ProTable/index.js +57 -55
- package/es/ProTable/propsType.d.ts +2 -4
- package/es/ProTable/style/index.less +5 -5
- package/es/ProTable/utils/index.js +12 -5
- package/es/ProTabs/components/Card/index.js +13 -17
- package/es/ProTabs/components/index.js +1 -1
- package/es/ProTabs/index.js +10 -10
- package/es/ProTabs/style/index.less +2 -2
- package/es/ProThemeTools/component/ProTools/index.js +50 -53
- package/es/ProThemeTools/component/index.js +1 -1
- package/es/ProThemeTools/context/ThemeContext.d.ts +31 -0
- package/es/ProThemeTools/context/ThemeContext.js +136 -0
- package/es/ProThemeTools/index.d.ts +4 -1
- package/es/ProThemeTools/index.js +97 -48
- package/es/ProThemeTools/style/index.less +3 -3
- package/es/ProThemeTools/utils/index.d.ts +16 -6
- package/es/ProThemeTools/utils/index.js +37 -24
- package/es/ProTooltip/index.js +35 -28
- package/es/ProTooltip/style/index.less +2 -2
- package/es/ProTree/components/AdaptiveTooltip.js +4 -5
- package/es/ProTree/components/CloseIcon.js +5 -5
- package/es/ProTree/components/List.js +16 -15
- package/es/ProTree/components/ProTree.js +51 -52
- package/es/ProTree/components/ProTreeSelect/index.js +97 -81
- package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/es/ProTree/components/SearchTitle.js +10 -9
- package/es/ProTree/components/Tree.js +46 -52
- package/es/ProTree/components/index.js +4 -4
- package/es/ProTree/index.js +4 -11
- package/es/ProTree/propsType.d.ts +1 -1
- package/es/ProTree/style/index.less +10 -6
- package/es/ProTree/utils.js +21 -14
- package/es/ProTreeModal/components/Cascader.js +24 -23
- package/es/ProTreeModal/components/CloseIcon.js +5 -5
- package/es/ProTreeModal/components/List.js +43 -42
- package/es/ProTreeModal/components/SearchTitle.js +5 -4
- package/es/ProTreeModal/components/SortableItem.js +11 -10
- package/es/ProTreeModal/components/Tree.js +38 -37
- package/es/ProTreeModal/components/Trigger.js +24 -28
- package/es/ProTreeModal/components/index.js +6 -6
- package/es/ProTreeModal/index.d.ts +0 -1
- package/es/ProTreeModal/index.js +90 -80
- package/es/ProTreeModal/style/index.less +14 -3
- package/es/ProTreeModal/utils.js +22 -18
- package/es/ProUpload/components/ButtonRender.js +28 -30
- package/es/ProUpload/components/DragRender.js +43 -37
- package/es/ProUpload/components/DraggableUploadListItem.js +3 -2
- package/es/ProUpload/components/Example.js +10 -9
- package/es/ProUpload/components/FileItem.d.ts +0 -1
- package/es/ProUpload/components/FileItem.js +53 -54
- package/es/ProUpload/components/ImageRender.js +85 -94
- package/es/ProUpload/index.js +25 -21
- package/es/ProUpload/style/index.less +173 -12
- package/es/ProUpload/uitls.js +1 -1
- package/es/ProViewer/index.js +40 -41
- package/es/ProViewer/propsType.js +3 -1
- package/es/ProViewer/style/index.less +2 -2
- package/es/ProWaterMark/index.js +5 -5
- package/es/ProWaterMark/propsType.d.ts +5 -24
- package/es/global.less +2 -1
- package/es/index.d.ts +5 -3
- package/es/index.js +38 -30
- package/es/locale/en_US.js +1 -1
- package/es/locale/index.d.ts +2 -0
- package/es/locale/index.js +18 -4
- package/es/locale/zh_CN.js +1 -1
- 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/tokens.js +1 -0
- package/es/utils/index.d.ts +7 -0
- package/es/utils/index.js +28 -2
- package/lib/FormsProvider/index.d.ts +4 -1
- package/lib/FormsProvider/index.js +53 -29
- package/lib/ProAction/components/CheckModalContent/index.js +27 -42
- package/lib/ProAction/index.js +155 -201
- package/lib/ProAction/index.less +2 -2
- package/lib/ProAction/propsType.js +16 -4
- package/lib/ProConfigProvider/index.d.ts +21 -4
- package/lib/ProConfigProvider/index.js +144 -97
- package/lib/ProDownload/index.js +123 -197
- package/lib/ProDownload/propsType.js +16 -4
- package/lib/ProDownload/style/index.less +2 -2
- package/lib/ProDownload/utils.js +145 -188
- package/lib/ProDrawerForm/components/ProDrawer/index.js +170 -242
- package/lib/ProDrawerForm/components/ProModal/index.js +134 -196
- package/lib/ProDrawerForm/components/index.js +39 -17
- package/lib/ProDrawerForm/index.d.ts +2 -1
- package/lib/ProDrawerForm/index.js +86 -72
- package/lib/ProDrawerForm/propsType.d.ts +7 -18
- package/lib/ProDrawerForm/propsType.js +16 -4
- package/lib/ProDrawerForm/style/index.less +8 -14
- package/lib/ProDrawerForm/utils/index.js +31 -13
- package/lib/ProEditLabel/components/RenderProForm.js +60 -59
- package/lib/ProEditLabel/index.js +183 -243
- package/lib/ProEditLabel/propsType.d.ts +1 -6
- package/lib/ProEditLabel/propsType.js +16 -4
- package/lib/ProEditLabel/style/index.less +4 -3
- package/lib/ProEditLabel/utils/index.js +31 -15
- package/lib/ProEditTable/components/ActionButton/index.js +172 -156
- package/lib/ProEditTable/components/RcTable/BaseTable.js +115 -98
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +174 -183
- package/lib/ProEditTable/components/RcTable/index.d.ts +0 -2
- package/lib/ProEditTable/components/RcTable/index.js +39 -24
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +184 -181
- package/lib/ProEditTable/components/RenderField/index.d.ts +3 -2
- package/lib/ProEditTable/components/RenderField/index.js +604 -562
- package/lib/ProEditTable/components/RenderToolbar/index.js +105 -125
- package/lib/ProEditTable/components/Summary/index.js +61 -70
- package/lib/ProEditTable/components/Validator/index.js +48 -31
- package/lib/ProEditTable/components/index.js +48 -38
- package/lib/ProEditTable/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +376 -437
- package/lib/ProEditTable/propsType.d.ts +1 -7
- package/lib/ProEditTable/propsType.js +16 -4
- package/lib/ProEditTable/style/index.less +3 -7
- package/lib/ProEditTable/utils/config.js +180 -239
- package/lib/ProEditTable/utils/diffOriginal.js +59 -50
- package/lib/ProEditTable/utils/getDefaultProps.js +44 -29
- package/lib/ProEditTable/utils/index.js +259 -326
- package/lib/ProEditTable/utils/tools.js +252 -442
- package/lib/ProEditTable/utils/transform.js +28 -19
- package/lib/ProEditTable/utils/useEditTableError.js +62 -56
- package/lib/ProEnum/components/Group.js +78 -54
- package/lib/ProEnum/components/Tag.js +55 -40
- package/lib/ProEnum/hooks/useEnum.js +53 -53
- package/lib/ProEnum/hooks/useEnumRequest.js +198 -271
- package/lib/ProEnum/index.js +235 -251
- package/lib/ProEnum/propsType.js +16 -4
- package/lib/ProEnum/style/index.less +2 -2
- package/lib/ProEnum/utils/eventCenter.js +25 -37
- package/lib/ProEnum/utils/getEnumLabel.js +65 -63
- package/lib/ProEnum/utils/index.d.ts +1 -0
- package/lib/ProEnum/utils/index.js +68 -91
- package/lib/ProForm/components/Container.d.ts +1 -0
- package/lib/ProForm/components/Container.js +45 -33
- package/lib/ProForm/components/FormFooter/index.js +80 -63
- package/lib/ProForm/components/FormFooter/propsType.d.ts +2 -0
- package/lib/ProForm/components/FormFooter/propsType.js +16 -4
- package/lib/ProForm/components/base/Checkbox/index.js +62 -66
- package/lib/ProForm/components/base/DatePicker/index.d.ts +1 -3
- package/lib/ProForm/components/base/DatePicker/index.js +82 -71
- package/lib/ProForm/components/base/DatePicker/useDateLimit.d.ts +1 -7
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +31 -18
- package/lib/ProForm/components/base/Input/index.js +74 -69
- package/lib/ProForm/components/base/Input/propsType.js +16 -4
- package/lib/ProForm/components/base/InputNumber/index.js +177 -228
- package/lib/ProForm/components/base/Radio/index.js +69 -60
- package/lib/ProForm/components/base/RangePicker/index.js +90 -77
- package/lib/ProForm/components/base/RangePicker/useDateRange.d.ts +5 -5
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +46 -28
- package/lib/ProForm/components/base/Select/index.js +69 -61
- package/lib/ProForm/components/base/Switch/index.js +59 -43
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +63 -63
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +2 -2
- package/lib/ProForm/components/base/TextArea/index.js +67 -53
- 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 +59 -44
- package/lib/ProForm/components/base/TimePicker/style/index.less +5 -3
- package/lib/ProForm/components/combination/Container/index.js +77 -62
- package/lib/ProForm/components/combination/Container/propsType.js +16 -4
- package/lib/ProForm/components/combination/Container/style/index.less +2 -2
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +195 -245
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +108 -84
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +44 -25
- package/lib/ProForm/components/combination/FormList/components/Empty.js +55 -93
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +120 -95
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +103 -140
- package/lib/ProForm/components/combination/FormList/index.js +168 -143
- package/lib/ProForm/components/combination/FormList/propsType.js +16 -4
- package/lib/ProForm/components/combination/FormList/style/index.less +38 -2
- package/lib/ProForm/components/combination/FormList/utils.js +54 -33
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +38 -21
- package/lib/ProForm/components/combination/Group/component/ComRender.js +74 -76
- package/lib/ProForm/components/combination/Group/hooks/index.js +136 -130
- package/lib/ProForm/components/combination/Group/index.d.ts +2 -8
- package/lib/ProForm/components/combination/Group/index.js +117 -102
- package/lib/ProForm/components/combination/Group/propsType.js +16 -4
- 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 +113 -129
- package/lib/ProForm/components/combination/ProCascader/index.js +195 -250
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/propsType.js +16 -4
- package/lib/ProForm/components/combination/ProCascader/style/index.less +2 -2
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +35 -24
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +121 -116
- package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +498 -686
- package/lib/ProForm/components/combination/ProModalSelect/propsType.js +16 -4
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +13 -14
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +45 -22
- package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/index.js +166 -184
- package/lib/ProForm/components/combination/ProNumberRange/propsType.js +16 -4
- 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 +151 -159
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.d.ts +23 -0
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.js +17 -0
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +3 -2
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +58 -25
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +5 -6
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +131 -143
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +66 -6
- package/lib/ProForm/components/index.d.ts +2 -8
- package/lib/ProForm/components/index.js +115 -254
- package/lib/ProForm/components/render/ChangedWrapper.js +146 -133
- package/lib/ProForm/components/render/ConfirmWrapper.js +78 -123
- package/lib/ProForm/components/render/Render.js +348 -421
- package/lib/ProForm/components/render/RenderFields.js +186 -188
- package/lib/ProForm/components/render/propsType.d.ts +2 -6
- package/lib/ProForm/components/render/propsType.js +16 -5
- package/lib/ProForm/index.js +239 -300
- package/lib/ProForm/propsType.d.ts +1 -1
- package/lib/ProForm/propsType.js +38 -5
- package/lib/ProForm/style/index.less +6 -16
- package/lib/ProForm/utils/diffOriginal.js +56 -44
- package/lib/ProForm/utils/getDefaultProps.js +44 -28
- package/lib/ProForm/utils/index.d.ts +15 -1
- package/lib/ProForm/utils/index.js +287 -290
- package/lib/ProForm/utils/processDependencies.js +44 -52
- package/lib/ProForm/utils/rulesCreator.js +84 -61
- package/lib/ProForm/utils/transformNames.js +38 -27
- package/lib/ProForm/utils/transformValue.js +51 -48
- package/lib/ProForm/utils/useDeepCompareMemo.js +36 -16
- package/lib/ProForm/utils/useFieldProps.js +42 -11
- package/lib/ProForm/utils/useForm.js +122 -222
- package/lib/ProForm/utils/useRules.js +67 -60
- package/lib/ProForm/utils/useShouldUpdate.js +105 -177
- package/lib/ProForm/utils/useWatch.js +93 -100
- package/lib/ProForm/utils/valueType.js +157 -224
- package/lib/ProIcon/config/index.js +365 -276
- package/lib/ProIcon/index.js +193 -221
- package/lib/ProIcon/propsTypes.js +16 -4
- package/lib/ProIcon/style/index.less +2 -2
- package/lib/ProIcon/symbolIcon.js +23 -30
- package/lib/ProIcon/utils/index.js +66 -57
- package/lib/ProLayout/components/Layout/Header/index.js +59 -42
- package/lib/ProLayout/components/Layout/Icon/Icon.js +49 -30
- package/lib/ProLayout/components/Layout/Icon/index.js +34 -7
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +112 -118
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +42 -39
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +118 -124
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +16 -4
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +12 -6
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +59 -42
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +9 -5
- package/lib/ProLayout/components/Layout/Menu/index.js +76 -56
- package/lib/ProLayout/components/Layout/Menu/style/index.less +2 -2
- package/lib/ProLayout/components/Layout/Notice/index.js +39 -31
- package/lib/ProLayout/components/Layout/Notice/style/index.less +2 -2
- package/lib/ProLayout/components/Layout/index.js +45 -31
- package/lib/ProLayout/components/ProCollapse/PropTypes.js +16 -4
- package/lib/ProLayout/components/ProCollapse/index.js +132 -151
- package/lib/ProLayout/components/ProCollapse/style/index.less +3 -3
- package/lib/ProLayout/components/ProFooter/PropTypes.js +16 -4
- package/lib/ProLayout/components/ProFooter/index.js +58 -45
- package/lib/ProLayout/components/ProFooter/style/index.less +2 -2
- package/lib/ProLayout/components/ProHeader/PropTypes.js +16 -4
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +53 -26
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +48 -28
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +16 -4
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +9 -9
- package/lib/ProLayout/components/ProHeader/components/index.js +39 -17
- package/lib/ProLayout/components/ProHeader/index.js +281 -462
- package/lib/ProLayout/components/ProHeader/style/index.less +2 -2
- package/lib/ProLayout/components/ProHeader/utils/index.js +32 -14
- package/lib/ProLayout/components/index.js +42 -24
- package/lib/ProLayout/index.d.ts +1 -1
- package/lib/ProLayout/index.js +127 -123
- package/lib/ProLayout/propTypes.js +16 -4
- package/lib/ProLayout/style/index.less +4 -3
- package/lib/ProLayout/utils/index.js +92 -103
- package/lib/ProSelect/components/AdaptiveTooltip.js +46 -41
- package/lib/ProSelect/index.js +218 -260
- package/lib/ProSelect/index.less +2 -2
- package/lib/ProSelect/propsType.d.ts +1 -1
- package/lib/ProSelect/propsType.js +16 -4
- package/lib/ProSelect/utils/index.js +80 -78
- package/lib/ProStep/components/Anchor/index.d.ts +1 -0
- package/lib/ProStep/components/Anchor/index.js +108 -102
- package/lib/ProStep/components/Item/index.d.ts +1 -0
- package/lib/ProStep/components/Item/index.js +83 -74
- package/lib/ProStep/components/Listener/index.js +62 -73
- package/lib/ProStep/components/Step/index.js +76 -66
- package/lib/ProStep/index.js +167 -233
- package/lib/ProStep/propsType.js +16 -4
- package/lib/ProStep/style/index.less +4 -4
- package/lib/ProStep/utils/index.js +59 -52
- package/lib/ProStepTab/index.js +179 -298
- package/lib/ProStepTab/propsType.js +16 -4
- package/lib/ProTable/components/FormatColumn/index.js +446 -494
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -1
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +53 -42
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +139 -198
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +116 -95
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +16 -4
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +80 -61
- package/lib/ProTable/components/RcTable/index.js +39 -17
- package/lib/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/lib/ProTable/components/RenderColumn/index.js +194 -203
- package/lib/ProTable/components/RenderEmptyText/index.js +27 -25
- package/lib/ProTable/components/RenderFooter/index.js +33 -17
- package/lib/ProTable/components/RenderSummary/index.js +46 -57
- package/lib/ProTable/components/RenderTableHeader/index.js +68 -61
- package/lib/ProTable/components/RenderTabs/index.js +89 -81
- package/lib/ProTable/components/TableResizable/index.js +88 -86
- package/lib/ProTable/components/TooltipTitle/index.js +40 -27
- package/lib/ProTable/components/index.js +51 -45
- package/lib/ProTable/hooks/useAntdTable.d.ts +0 -3
- package/lib/ProTable/hooks/useAntdTable.js +315 -409
- package/lib/ProTable/index.d.ts +0 -3
- package/lib/ProTable/index.js +351 -390
- package/lib/ProTable/propsType.d.ts +2 -4
- package/lib/ProTable/propsType.js +16 -4
- package/lib/ProTable/style/index.less +5 -5
- package/lib/ProTable/utils/index.js +84 -84
- package/lib/ProTabs/components/Card/index.js +30 -56
- package/lib/ProTabs/components/index.js +36 -10
- package/lib/ProTabs/index.js +92 -86
- package/lib/ProTabs/propType.js +16 -4
- package/lib/ProTabs/style/index.less +2 -2
- package/lib/ProThemeTools/component/ProTools/index.js +202 -246
- package/lib/ProThemeTools/component/index.js +36 -10
- package/lib/ProThemeTools/context/ThemeContext.d.ts +31 -0
- package/lib/ProThemeTools/context/ThemeContext.js +135 -0
- package/lib/ProThemeTools/index.d.ts +4 -1
- package/lib/ProThemeTools/index.js +200 -173
- package/lib/ProThemeTools/propsType.js +16 -4
- package/lib/ProThemeTools/style/index.less +3 -3
- package/lib/ProThemeTools/utils/index.d.ts +16 -6
- package/lib/ProThemeTools/utils/index.js +94 -84
- package/lib/ProTooltip/index.js +220 -219
- package/lib/ProTooltip/propsType.js +16 -4
- package/lib/ProTooltip/style/index.less +2 -2
- package/lib/ProTree/components/AdaptiveTooltip.js +33 -24
- package/lib/ProTree/components/CloseIcon.js +36 -31
- package/lib/ProTree/components/List.js +68 -73
- package/lib/ProTree/components/ProTree.js +262 -369
- package/lib/ProTree/components/ProTreeSelect/index.js +369 -475
- package/lib/ProTree/components/ProTreeSelect/propsType.js +16 -4
- package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/lib/ProTree/components/SearchTitle.js +47 -50
- package/lib/ProTree/components/Tree.js +232 -311
- package/lib/ProTree/components/index.js +45 -31
- package/lib/ProTree/index.js +45 -30
- package/lib/ProTree/propsType.d.ts +1 -1
- package/lib/ProTree/propsType.js +16 -4
- package/lib/ProTree/style/index.less +10 -6
- package/lib/ProTree/utils.js +83 -135
- package/lib/ProTreeModal/components/Cascader.js +97 -94
- package/lib/ProTreeModal/components/CloseIcon.js +36 -31
- package/lib/ProTreeModal/components/List.js +194 -269
- package/lib/ProTreeModal/components/SearchTitle.js +30 -22
- package/lib/ProTreeModal/components/SortableItem.js +60 -60
- package/lib/ProTreeModal/components/Tree.js +162 -181
- package/lib/ProTreeModal/components/Trigger.js +108 -131
- package/lib/ProTreeModal/components/index.js +51 -45
- package/lib/ProTreeModal/index.d.ts +0 -1
- package/lib/ProTreeModal/index.js +464 -584
- package/lib/ProTreeModal/propsType.js +16 -4
- package/lib/ProTreeModal/style/index.less +14 -3
- package/lib/ProTreeModal/utils.js +105 -158
- package/lib/ProUpload/components/ButtonRender.js +86 -111
- package/lib/ProUpload/components/DragRender.js +120 -168
- package/lib/ProUpload/components/DraggableUploadListItem.js +50 -32
- package/lib/ProUpload/components/Example.js +56 -38
- package/lib/ProUpload/components/FileItem.d.ts +0 -1
- package/lib/ProUpload/components/FileItem.js +115 -210
- package/lib/ProUpload/components/ImageRender.js +176 -255
- package/lib/ProUpload/index.js +204 -216
- package/lib/ProUpload/propsType.js +16 -4
- package/lib/ProUpload/style/index.less +173 -12
- package/lib/ProUpload/uitls.js +34 -10
- package/lib/ProUtils/utils/index.js +38 -26
- package/lib/ProViewer/index.js +175 -209
- package/lib/ProViewer/propsType.js +16 -4
- package/lib/ProViewer/style/index.less +2 -2
- package/lib/ProWaterMark/index.js +38 -19
- package/lib/ProWaterMark/propsType.d.ts +5 -24
- package/lib/ProWaterMark/propsType.js +16 -4
- package/lib/global.less +2 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.js +123 -252
- package/lib/locale/en_US.js +146 -128
- package/lib/locale/index.d.ts +2 -0
- package/lib/locale/index.js +59 -29
- package/lib/locale/zh_CN.js +146 -128
- 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/tokens.js +103 -86
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.js +100 -48
- package/package.json +37 -23
- 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/propsType.js +0 -5
- 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
@@ -6,10 +6,10 @@ import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
6
6
|
var _ref;
|
7
7
|
import { useEffect } from 'react';
|
8
8
|
import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
|
9
|
-
import { diffCode, getEnumData, setEnumData, cacheFieldNames } from
|
10
|
-
import locale from
|
11
|
-
import
|
12
|
-
var baseEnumStorage = (_ref = window.localStorage.getItem(
|
9
|
+
import { diffCode, getEnumData, setEnumData, cacheFieldNames, baseCacheKey } from "../utils";
|
10
|
+
import locale from "../../locale";
|
11
|
+
import "../utils/eventCenter";
|
12
|
+
var baseEnumStorage = (_ref = window.localStorage.getItem(baseCacheKey) && JSON.parse(window.localStorage.getItem(baseCacheKey))) !== null && _ref !== void 0 ? _ref : null;
|
13
13
|
var useEnumRequest = function useEnumRequest(props, dispatch) {
|
14
14
|
var _ref2 = props || {},
|
15
15
|
_ref2$main = _ref2.main,
|
@@ -25,7 +25,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
25
25
|
children: 'children'
|
26
26
|
} : _ref2$fieldNames,
|
27
27
|
_ref2$cacheKey = _ref2.cacheKey,
|
28
|
-
cacheKey = _ref2$cacheKey === void 0 ?
|
28
|
+
cacheKey = _ref2$cacheKey === void 0 ? baseCacheKey : _ref2$cacheKey,
|
29
29
|
_ref2$requestRefresh = _ref2.requestRefresh,
|
30
30
|
requestRefresh = _ref2$requestRefresh === void 0 ? false : _ref2$requestRefresh,
|
31
31
|
_ref2$storage = _ref2.storage,
|
@@ -38,7 +38,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
38
38
|
dics = _ref2$dics === void 0 ? {} : _ref2$dics;
|
39
39
|
if (_typeof(dataSource) === 'object' && dataSource === null) {
|
40
40
|
var _locale$ProEnum;
|
41
|
-
throw new Error(locale === null || locale === void 0
|
41
|
+
throw new Error(locale === null || locale === void 0 || (_locale$ProEnum = locale.ProEnum) === null || _locale$ProEnum === void 0 ? void 0 : _locale$ProEnum.errorDataSource);
|
42
42
|
}
|
43
43
|
var logDebug = function logDebug(msg) {
|
44
44
|
if (props.debugger) {
|
@@ -52,7 +52,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
52
52
|
staleTime: 6e4 * 60
|
53
53
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
54
54
|
setCache: function () {
|
55
|
-
var _setCache = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
|
55
|
+
var _setCache = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
|
56
56
|
var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
|
57
57
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
58
58
|
while (1) switch (_context.prev = _context.next) {
|
@@ -70,7 +70,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
70
70
|
_context.next = 9;
|
71
71
|
break;
|
72
72
|
}
|
73
|
-
throw new Error(locale === null || locale === void 0
|
73
|
+
throw new Error(locale === null || locale === void 0 || (_locale$ProEnum2 = locale.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
|
74
74
|
case 9:
|
75
75
|
res.data = response;
|
76
76
|
case 10:
|
@@ -89,12 +89,12 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
89
89
|
// 只返回fieldNames对象的key
|
90
90
|
if (clear) {
|
91
91
|
// 忽略清洗的 codes
|
92
|
-
ignoreCodes = (useRequest === null || useRequest === void 0
|
92
|
+
ignoreCodes = (useRequest === null || useRequest === void 0 || (_useRequest$options = useRequest.options) === null || _useRequest$options === void 0 ? void 0 : _useRequest$options.ignoreCodes) || [];
|
93
93
|
Object.keys(response).forEach(function (key) {
|
94
94
|
if (!response[key] || !Array.isArray(response[key])) {
|
95
95
|
return;
|
96
96
|
}
|
97
|
-
var options = _toConsumableArray(response[key])
|
97
|
+
var options = _toConsumableArray(response[key]);
|
98
98
|
if (ignoreCodes.includes(key)) {
|
99
99
|
response[key] = options;
|
100
100
|
} else {
|
@@ -110,6 +110,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
110
110
|
}; // 合并缓存数据
|
111
111
|
res.data = _objectSpread(_objectSpread({}, cacheData === null || cacheData === void 0 ? void 0 : cacheData.data), res.data);
|
112
112
|
setEnumData(storage, cacheKey, res);
|
113
|
+
|
113
114
|
// 同步数据到全局
|
114
115
|
dispatch({
|
115
116
|
type: 'setProEnumDic',
|
@@ -119,7 +120,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
119
120
|
setTimeout(function () {
|
120
121
|
var _locale$ProEnum3;
|
121
122
|
window.eventCenter.publish('zat-design-pro-component-event', res.data);
|
122
|
-
logDebug(locale === null || locale === void 0
|
123
|
+
logDebug(locale === null || locale === void 0 || (_locale$ProEnum3 = locale.ProEnum) === null || _locale$ProEnum3 === void 0 ? void 0 : _locale$ProEnum3.mainInitByRequest);
|
123
124
|
}, 10000);
|
124
125
|
}
|
125
126
|
return _context.abrupt("return", res);
|
@@ -146,7 +147,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
146
147
|
setTimeout(function () {
|
147
148
|
var _locale$ProEnum4;
|
148
149
|
window.eventCenter.publish('zat-design-pro-component-event', res.data);
|
149
|
-
logDebug(locale === null || locale === void 0
|
150
|
+
logDebug(locale === null || locale === void 0 || (_locale$ProEnum4 = locale.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.mainInitByCache);
|
150
151
|
}, 10000);
|
151
152
|
}
|
152
153
|
return res;
|
@@ -157,12 +158,12 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
157
158
|
msg = res.message;
|
158
159
|
if (status !== 200) {
|
159
160
|
var _locale$ProEnum5;
|
160
|
-
throw new Error(locale === null || locale === void 0
|
161
|
+
throw new Error(locale === null || locale === void 0 || (_locale$ProEnum5 = locale.ProEnum) === null || _locale$ProEnum5 === void 0 ? void 0 : _locale$ProEnum5.requestError);
|
161
162
|
}
|
162
163
|
}
|
163
164
|
}));
|
164
165
|
var mergeData = /*#__PURE__*/function () {
|
165
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
166
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
166
167
|
var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res, _locale$ProEnum6;
|
167
168
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
168
169
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -180,8 +181,8 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
180
181
|
}
|
181
182
|
enumData = cacheData.data;
|
182
183
|
cacheCodes = Object.keys(enumData);
|
183
|
-
codes = (useRequest === null || useRequest === void 0
|
184
|
-
ignoreCodes = (useRequest === null || useRequest === void 0
|
184
|
+
codes = (useRequest === null || useRequest === void 0 || (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.codes) || []; // 缓存的所有 codes
|
185
|
+
ignoreCodes = (useRequest === null || useRequest === void 0 || (_useRequest$options3 = useRequest.options) === null || _useRequest$options3 === void 0 ? void 0 : _useRequest$options3.ignoreCodes) || []; // 忽略清洗的 codes
|
185
186
|
diff = diffCode(cacheCodes, codes);
|
186
187
|
if (!diff) {
|
187
188
|
_context2.next = 27;
|
@@ -203,7 +204,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
203
204
|
_context2.next = 18;
|
204
205
|
break;
|
205
206
|
}
|
206
|
-
throw new Error(locale === null || locale === void 0
|
207
|
+
throw new Error(locale === null || locale === void 0 || (_locale$ProEnum6 = locale.ProEnum) === null || _locale$ProEnum6 === void 0 ? void 0 : _locale$ProEnum6.errorMessage);
|
207
208
|
case 18:
|
208
209
|
_context2.next = 21;
|
209
210
|
break;
|
@@ -215,7 +216,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
215
216
|
// 只返回fieldNames对象的key
|
216
217
|
if (clear) {
|
217
218
|
Object.keys(response).forEach(function (key) {
|
218
|
-
var options = _toConsumableArray(response[key])
|
219
|
+
var options = _toConsumableArray(response[key]);
|
219
220
|
if (ignoreCodes.includes(key)) {
|
220
221
|
response[key] = options;
|
221
222
|
} else {
|
@@ -253,7 +254,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
253
254
|
};
|
254
255
|
}();
|
255
256
|
useDeepCompareEffect(function () {
|
256
|
-
if (useRequest &&
|
257
|
+
if (useRequest && useRequest !== null && useRequest !== void 0 && useRequest.service) {
|
257
258
|
var _ref4 = (useRequest === null || useRequest === void 0 ? void 0 : useRequest.options) || {},
|
258
259
|
defaultParams = _ref4.defaultParams;
|
259
260
|
var params = Array.isArray(defaultParams) ? defaultParams === null || defaultParams === void 0 ? void 0 : defaultParams[0] : defaultParams || {};
|
@@ -262,6 +263,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
262
263
|
window.sessionStorage.removeItem(cacheKey);
|
263
264
|
}
|
264
265
|
enumRes.run(params);
|
266
|
+
|
265
267
|
// TODO 这段代码目前看起来是没啥用的、没起到作用
|
266
268
|
mergeData();
|
267
269
|
} else if (Object.keys(dataSource)) {
|
@@ -296,12 +298,12 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
296
298
|
if (main) {
|
297
299
|
var _locale$ProEnum7;
|
298
300
|
window.eventCenter.publish('zat-design-pro-component-event', {});
|
299
|
-
logDebug(locale === null || locale === void 0
|
301
|
+
logDebug(locale === null || locale === void 0 || (_locale$ProEnum7 = locale.ProEnum) === null || _locale$ProEnum7 === void 0 ? void 0 : _locale$ProEnum7.mainInitOnce);
|
300
302
|
}
|
301
303
|
if (!main && share) {
|
302
304
|
var _locale$ProEnum8;
|
303
305
|
window.eventCenter.subscribe('zat-design-pro-component-event', shareProEnumDic);
|
304
|
-
logDebug(locale === null || locale === void 0
|
306
|
+
logDebug(locale === null || locale === void 0 || (_locale$ProEnum8 = locale.ProEnum) === null || _locale$ProEnum8 === void 0 ? void 0 : _locale$ProEnum8.sonInitEvent);
|
305
307
|
}
|
306
308
|
return function () {
|
307
309
|
window.eventCenter.unsubscribe('zat-design-pro-component-event', shareProEnumDic);
|
package/es/ProEnum/index.js
CHANGED
@@ -1,38 +1,27 @@
|
|
1
|
-
import "antd/es/space/style";
|
2
|
-
import _Space from "antd/es/space";
|
3
|
-
import "antd/es/checkbox/style";
|
4
|
-
import _Checkbox from "antd/es/checkbox";
|
5
|
-
import "antd/es/radio/style";
|
6
|
-
import _Radio from "antd/es/radio";
|
7
|
-
import "antd/es/message/style";
|
8
|
-
import _message from "antd/es/message";
|
9
1
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
10
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
11
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
12
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
13
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
14
|
-
import _isNumber from "lodash/isNumber";
|
15
|
-
import _omit from "lodash/omit";
|
16
|
-
import _isArray from "lodash/isArray";
|
17
|
-
import _isString from "lodash/isString";
|
18
|
-
import _isFunction from "lodash/isFunction";
|
19
|
-
import _cloneDeep from "lodash/cloneDeep";
|
20
6
|
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps", "isView"],
|
21
7
|
_excluded2 = ["fieldNames", "clear", "cacheKey", "showCodeName"];
|
22
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
23
8
|
import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
|
9
|
+
import { message, Radio, Checkbox, Space } from 'antd';
|
24
10
|
import React, { useState, useEffect, useMemo } from 'react';
|
25
|
-
import
|
26
|
-
import
|
27
|
-
import
|
28
|
-
import
|
29
|
-
import
|
30
|
-
import
|
31
|
-
import
|
32
|
-
import
|
33
|
-
import
|
34
|
-
import
|
35
|
-
import
|
11
|
+
import { cloneDeep, isFunction, isString, isArray, omit, isNumber } from 'lodash';
|
12
|
+
import ProSelect from "../ProSelect";
|
13
|
+
import { useProConfig } from "../ProConfigProvider";
|
14
|
+
import ProEnumTag from "./components/Tag";
|
15
|
+
import ProEnumGroup from "./components/Group";
|
16
|
+
import Container from "../ProForm/components/Container";
|
17
|
+
import { isObject } from "./utils";
|
18
|
+
import getEnumLabel from "./utils/getEnumLabel";
|
19
|
+
import useEnum from "./hooks/useEnum";
|
20
|
+
import locale from "../locale";
|
21
|
+
import "./style/index.less";
|
22
|
+
import { useFieldProps } from "../ProForm/utils/useFieldProps";
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
36
25
|
var ProEnum = function ProEnum(props) {
|
37
26
|
var _otherProps$isView, _enumProps$showCodeNa;
|
38
27
|
var code = props.code,
|
@@ -72,23 +61,24 @@ var ProEnum = function ProEnum(props) {
|
|
72
61
|
(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) && setData(_toConsumableArray(dataSource));
|
73
62
|
}, [dataSource]);
|
74
63
|
if (fieldNames && Object.keys(fieldNames).length) {
|
75
|
-
if (fieldNames
|
76
|
-
if (fieldNames
|
64
|
+
if (fieldNames !== null && fieldNames !== void 0 && fieldNames.label) label = fieldNames.label;
|
65
|
+
if (fieldNames !== null && fieldNames !== void 0 && fieldNames.value) fieldValue = fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value;
|
77
66
|
}
|
78
67
|
if (props.fieldNames && Object.keys(props.fieldNames).length) {
|
79
68
|
var _props$fieldNames, _props$fieldNames2, _props$fieldNames3, _props$fieldNames4;
|
80
|
-
if (props
|
81
|
-
if (props
|
69
|
+
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;
|
70
|
+
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;
|
82
71
|
}
|
83
72
|
if (clear) {
|
84
73
|
label = 'label';
|
85
74
|
fieldValue = 'value';
|
86
75
|
}
|
76
|
+
|
87
77
|
// 这种时候优先级最高、完全走自定义
|
88
|
-
if (
|
78
|
+
if (useRequest !== null && useRequest !== void 0 && useRequest.service && props.fieldNames) {
|
89
79
|
var _props$fieldNames5, _props$fieldNames6;
|
90
|
-
if ((_props$fieldNames5 = props.fieldNames)
|
91
|
-
if ((_props$fieldNames6 = props.fieldNames)
|
80
|
+
if ((_props$fieldNames5 = props.fieldNames) !== null && _props$fieldNames5 !== void 0 && _props$fieldNames5.label) label = props.fieldNames.label;
|
81
|
+
if ((_props$fieldNames6 = props.fieldNames) !== null && _props$fieldNames6 !== void 0 && _props$fieldNames6.value) fieldValue = props.fieldNames.value;
|
92
82
|
}
|
93
83
|
var _useProConfig = useProConfig('ProEnum'),
|
94
84
|
_useProConfig$dics = _useProConfig.dics,
|
@@ -102,7 +92,7 @@ var ProEnum = function ProEnum(props) {
|
|
102
92
|
var responseData = transformResponse(res);
|
103
93
|
if (_typeof(responseData) !== 'object') {
|
104
94
|
var _locale$ProEnum;
|
105
|
-
return
|
95
|
+
return message.error((_locale$ProEnum = locale.ProEnum) === null || _locale$ProEnum === void 0 ? void 0 : _locale$ProEnum.errorMessage);
|
106
96
|
}
|
107
97
|
setData(responseData);
|
108
98
|
} else {
|
@@ -113,49 +103,51 @@ var ProEnum = function ProEnum(props) {
|
|
113
103
|
if (status === 200) {
|
114
104
|
if (_typeof(data) !== 'object') {
|
115
105
|
var _locale$ProEnum2;
|
116
|
-
return
|
106
|
+
return message.error((_locale$ProEnum2 = locale.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
|
117
107
|
}
|
118
108
|
if (Array.isArray(data)) {
|
119
109
|
setData(_toConsumableArray(data));
|
120
110
|
}
|
121
|
-
if (isObject(data) &&
|
111
|
+
if (isObject(data) && isString(code)) {
|
122
112
|
setData(data[code]);
|
123
113
|
}
|
124
114
|
} else {
|
125
|
-
|
115
|
+
message.error(msg);
|
126
116
|
}
|
127
117
|
}
|
128
118
|
}
|
129
119
|
})),
|
130
120
|
run = _useRequestFunc.run;
|
121
|
+
|
131
122
|
// 自定义请求
|
132
123
|
useDeepCompareEffect(function () {
|
133
124
|
var _ref3 = (useRequest === null || useRequest === void 0 ? void 0 : useRequest.options) || {},
|
134
125
|
defaultParams = _ref3.defaultParams;
|
135
126
|
var params = Array.isArray(defaultParams) ? defaultParams === null || defaultParams === void 0 ? void 0 : defaultParams[0] : defaultParams || {};
|
136
|
-
if (useRequest
|
127
|
+
if (useRequest !== null && useRequest !== void 0 && useRequest.service) {
|
137
128
|
run(params);
|
138
129
|
}
|
139
130
|
}, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.options]);
|
140
131
|
var enumLists = useMemo(function () {
|
141
132
|
var lists = [];
|
142
|
-
if (
|
133
|
+
if (isString(code)) {
|
143
134
|
lists = (dics === null || dics === void 0 ? void 0 : dics[code]) || [];
|
144
135
|
}
|
145
|
-
if (
|
136
|
+
if (isArray(code)) {
|
146
137
|
code.forEach(function (enumCode) {
|
147
138
|
var _lists;
|
148
|
-
|
139
|
+
isArray(dics === null || dics === void 0 ? void 0 : dics[enumCode]) && (_lists = lists).push.apply(_lists, _toConsumableArray(dics === null || dics === void 0 ? void 0 : dics[enumCode]));
|
149
140
|
});
|
150
141
|
}
|
151
142
|
return lists;
|
152
143
|
}, [dics, code]);
|
153
144
|
var renderComponent = function renderComponent() {
|
154
145
|
var list = [];
|
146
|
+
|
155
147
|
// 优先使用组件内部自己传入的数据源或者请求得到的数据
|
156
|
-
list =
|
148
|
+
list = cloneDeep(dataList && dataList.length ? dataList : enumLists);
|
157
149
|
// 对数据进行一系列的过滤等操作
|
158
|
-
if (!(useRequest
|
150
|
+
if (!(useRequest !== null && useRequest !== void 0 && useRequest.service) && transformResponse) {
|
159
151
|
list = transformResponse(list);
|
160
152
|
if (!Array.isArray(list)) {
|
161
153
|
var _locale$ProEnum3;
|
@@ -163,9 +155,9 @@ var ProEnum = function ProEnum(props) {
|
|
163
155
|
list = [];
|
164
156
|
}
|
165
157
|
}
|
166
|
-
if (/*#__PURE__*/React.isValidElement(component)) {
|
158
|
+
if ( /*#__PURE__*/React.isValidElement(component)) {
|
167
159
|
var Component = component;
|
168
|
-
return _jsx(Component, _objectSpread(_objectSpread({}, enumProps), {}, {
|
160
|
+
return /*#__PURE__*/_jsx(Component, _objectSpread(_objectSpread({}, enumProps), {}, {
|
169
161
|
dataSource: list,
|
170
162
|
fieldNames: {
|
171
163
|
label: label,
|
@@ -177,7 +169,7 @@ var ProEnum = function ProEnum(props) {
|
|
177
169
|
}
|
178
170
|
switch (type) {
|
179
171
|
case 'ProSelect':
|
180
|
-
return _jsx(ProSelect, _objectSpread(_objectSpread({}, enumProps), {}, {
|
172
|
+
return /*#__PURE__*/_jsx(ProSelect, _objectSpread(_objectSpread({}, enumProps), {}, {
|
181
173
|
otherProps: otherProps,
|
182
174
|
dataSource: list,
|
183
175
|
fieldNames: {
|
@@ -188,12 +180,12 @@ var ProEnum = function ProEnum(props) {
|
|
188
180
|
onChange: onChange
|
189
181
|
}));
|
190
182
|
case 'Radio':
|
191
|
-
return _jsx(
|
183
|
+
return /*#__PURE__*/_jsx(Radio.Group, _objectSpread(_objectSpread({}, omit(enumProps, ['fieldNames', 'showCodeName'])), {}, {
|
192
184
|
options: list,
|
193
185
|
value: value,
|
194
186
|
onChange: onChange,
|
195
187
|
children: list.map(function (item) {
|
196
|
-
return _jsx(
|
188
|
+
return /*#__PURE__*/_jsx(Radio, {
|
197
189
|
value: item[fieldValue],
|
198
190
|
disabled: !!item.disabled,
|
199
191
|
children: item[label]
|
@@ -201,12 +193,12 @@ var ProEnum = function ProEnum(props) {
|
|
201
193
|
})
|
202
194
|
}));
|
203
195
|
case 'Checkbox':
|
204
|
-
return _jsx(
|
196
|
+
return /*#__PURE__*/_jsx(Checkbox.Group, _objectSpread(_objectSpread({}, omit(enumProps, ['fieldNames', 'showCodeName'])), {}, {
|
205
197
|
options: list,
|
206
198
|
value: value,
|
207
199
|
onChange: onChange,
|
208
200
|
children: list.map(function (item) {
|
209
|
-
return _jsx(
|
201
|
+
return /*#__PURE__*/_jsx(Checkbox, {
|
210
202
|
value: item[fieldValue],
|
211
203
|
disabled: !!item.disabled,
|
212
204
|
children: item[label]
|
@@ -214,7 +206,7 @@ var ProEnum = function ProEnum(props) {
|
|
214
206
|
})
|
215
207
|
}));
|
216
208
|
case 'Tag':
|
217
|
-
return _jsx(ProEnumTag, {
|
209
|
+
return /*#__PURE__*/_jsx(ProEnumTag, {
|
218
210
|
id: enumProps.id,
|
219
211
|
value: value,
|
220
212
|
onChange: onChange,
|
@@ -223,7 +215,7 @@ var ProEnum = function ProEnum(props) {
|
|
223
215
|
dataSource: list
|
224
216
|
});
|
225
217
|
case 'Group':
|
226
|
-
return _jsx(ProEnumGroup, _objectSpread(_objectSpread({},
|
218
|
+
return /*#__PURE__*/_jsx(ProEnumGroup, _objectSpread(_objectSpread({}, omit(enumProps, ['showCodeName'])), {}, {
|
227
219
|
value: value,
|
228
220
|
onChange: onChange,
|
229
221
|
fieldLabel: label,
|
@@ -236,7 +228,7 @@ var ProEnum = function ProEnum(props) {
|
|
236
228
|
};
|
237
229
|
if (!code && !dataSource && !useRequest) {
|
238
230
|
var _locale$ProEnum4;
|
239
|
-
|
231
|
+
message.error("".concat(otherProps === null || otherProps === void 0 ? void 0 : otherProps.label, "-").concat(otherProps === null || otherProps === void 0 ? void 0 : otherProps.name, "-").concat(locale === null || locale === void 0 || (_locale$ProEnum4 = locale.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType));
|
240
232
|
}
|
241
233
|
var transToLabel = function transToLabel(value) {
|
242
234
|
var list = dataList && dataList.length ? dataList : enumLists;
|
@@ -269,33 +261,33 @@ var ProEnum = function ProEnum(props) {
|
|
269
261
|
record.forEach(function (item) {
|
270
262
|
arr.push(props.optionRender(item));
|
271
263
|
});
|
272
|
-
return _jsx(
|
264
|
+
return /*#__PURE__*/_jsx(Space, {
|
273
265
|
direction: "vertical",
|
274
266
|
size: 4,
|
275
267
|
children: arr.map(function (item) {
|
276
|
-
return _jsx(React.Fragment, {
|
268
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
277
269
|
children: item
|
278
270
|
}, item);
|
279
271
|
})
|
280
272
|
});
|
281
273
|
};
|
282
|
-
return
|
274
|
+
return isFunction(props.optionRender) && record.length ? _optionRender() : labelList === null || labelList === void 0 ? void 0 : labelList.join(',');
|
283
275
|
};
|
284
276
|
if (_isView) {
|
285
277
|
var __value = value || _defalutValue;
|
286
278
|
if (Array.isArray(__value)) {
|
287
|
-
return _jsx(Container, {
|
279
|
+
return /*#__PURE__*/_jsx(Container, {
|
288
280
|
tooltip: true,
|
289
281
|
viewEmpty: viewEmpty,
|
290
282
|
children: transToLabel(__value)
|
291
283
|
});
|
292
284
|
}
|
293
|
-
return _jsx(Container, {
|
285
|
+
return /*#__PURE__*/_jsx(Container, {
|
294
286
|
viewEmpty: viewEmpty,
|
295
|
-
children: __value ||
|
287
|
+
children: __value || isNumber(__value) ? transToLabel([__value]) : null
|
296
288
|
});
|
297
289
|
}
|
298
|
-
return _jsx(_Fragment, {
|
290
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
299
291
|
children: renderComponent()
|
300
292
|
});
|
301
293
|
};
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
3
|
-
import
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
4
|
+
import { isFunction } from 'lodash';
|
4
5
|
var SimpleEventCenter = /*#__PURE__*/function () {
|
5
6
|
function SimpleEventCenter() {
|
6
7
|
_classCallCheck(this, SimpleEventCenter);
|
7
|
-
this
|
8
|
+
_defineProperty(this, "events", void 0);
|
8
9
|
this.events = new Map();
|
9
10
|
}
|
10
|
-
|
11
|
+
_createClass(SimpleEventCenter, [{
|
11
12
|
key: "subscribe",
|
12
13
|
value: function subscribe(eventName, callback) {
|
13
14
|
if (!this.events.has(eventName)) {
|
@@ -20,7 +21,7 @@ var SimpleEventCenter = /*#__PURE__*/function () {
|
|
20
21
|
value: function publish(eventName, data) {
|
21
22
|
if (this.events.has(eventName)) {
|
22
23
|
this.events.get(eventName).forEach(function (callback) {
|
23
|
-
|
24
|
+
isFunction(callback) && (callback === null || callback === void 0 ? void 0 : callback(data));
|
24
25
|
});
|
25
26
|
}
|
26
27
|
}
|
@@ -34,5 +35,6 @@ var SimpleEventCenter = /*#__PURE__*/function () {
|
|
34
35
|
}
|
35
36
|
}
|
36
37
|
}]);
|
38
|
+
return SimpleEventCenter;
|
37
39
|
}(); // 将 eventCenter 实例添加到 window 对象上
|
38
40
|
window.eventCenter = new SimpleEventCenter();
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
2
|
-
import _isString from "lodash/isString";
|
3
|
-
import _isArray from "lodash/isArray";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
2
|
import { useMemo } from 'react';
|
6
|
-
import {
|
3
|
+
import { isArray, isString } from 'lodash';
|
4
|
+
import { useProConfig } from "../../ProConfigProvider";
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
7
6
|
var EnumLabel = function EnumLabel(props) {
|
8
7
|
var fieldNameLabel = '';
|
9
8
|
var fieldNameValue = '';
|
@@ -29,13 +28,13 @@ var EnumLabel = function EnumLabel(props) {
|
|
29
28
|
dics = _useProConfig$dics === void 0 ? {} : _useProConfig$dics;
|
30
29
|
var enumLists = useMemo(function () {
|
31
30
|
var lists = [];
|
32
|
-
if (
|
31
|
+
if (isString(code)) {
|
33
32
|
lists = (dics === null || dics === void 0 ? void 0 : dics[code]) || [];
|
34
33
|
}
|
35
|
-
if (
|
34
|
+
if (isArray(code)) {
|
36
35
|
code.forEach(function (enumCode) {
|
37
36
|
var _lists;
|
38
|
-
|
37
|
+
isArray(dics === null || dics === void 0 ? void 0 : dics[enumCode]) && (_lists = lists).push.apply(_lists, _toConsumableArray(dics === null || dics === void 0 ? void 0 : dics[enumCode]));
|
39
38
|
});
|
40
39
|
}
|
41
40
|
return lists;
|
@@ -50,7 +49,7 @@ var EnumLabel = function EnumLabel(props) {
|
|
50
49
|
}
|
51
50
|
return '';
|
52
51
|
});
|
53
|
-
return _jsx("span", {
|
52
|
+
return /*#__PURE__*/_jsx("span", {
|
54
53
|
children: labelList.join(',') || '-'
|
55
54
|
});
|
56
55
|
};
|
@@ -60,7 +59,7 @@ var EnumLabel = function EnumLabel(props) {
|
|
60
59
|
}
|
61
60
|
return transToLabel([value]);
|
62
61
|
}
|
63
|
-
return _jsx("span", {
|
62
|
+
return /*#__PURE__*/_jsx("span", {
|
64
63
|
children: "-"
|
65
64
|
});
|
66
65
|
};
|
@@ -71,7 +70,7 @@ var getEnumLabel = function getEnumLabel(code, value) {
|
|
71
70
|
if (!code) {
|
72
71
|
return null;
|
73
72
|
}
|
74
|
-
return _jsx(EnumLabel, {
|
73
|
+
return /*#__PURE__*/_jsx(EnumLabel, {
|
75
74
|
code: code,
|
76
75
|
value: value,
|
77
76
|
compose: compose,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
2
|
-
import _isUndefined from "lodash/isUndefined";
|
3
|
-
import _isNull from "lodash/isNull";
|
4
2
|
var _excluded = ["children"];
|
3
|
+
import { isNull, isUndefined } from 'lodash';
|
4
|
+
export var baseCacheKey = 'zat-design-pro-component-cacheKey';
|
5
5
|
/**
|
6
6
|
* 获取枚举数据
|
7
7
|
* @param storage
|
@@ -10,7 +10,7 @@ var _excluded = ["children"];
|
|
10
10
|
* @returns
|
11
11
|
*/
|
12
12
|
export function getEnumData(storage, cacheKey, baseEnumStorage) {
|
13
|
-
if (baseEnumStorage && window.localStorage.getItem(cacheKey)) {
|
13
|
+
if (baseEnumStorage && window.localStorage.getItem(cacheKey) && cacheKey === baseCacheKey) {
|
14
14
|
return baseEnumStorage;
|
15
15
|
}
|
16
16
|
if (storage === 'localStorage') {
|
@@ -20,6 +20,7 @@ export function getEnumData(storage, cacheKey, baseEnumStorage) {
|
|
20
20
|
return JSON.parse(window.sessionStorage.getItem(cacheKey) || '{}');
|
21
21
|
}
|
22
22
|
}
|
23
|
+
|
23
24
|
/**
|
24
25
|
* 设置枚举数据
|
25
26
|
* @param storage
|
@@ -28,7 +29,7 @@ export function getEnumData(storage, cacheKey, baseEnumStorage) {
|
|
28
29
|
*/
|
29
30
|
export function setEnumData(storage, cacheKey, data) {
|
30
31
|
var _Object$keys;
|
31
|
-
if (!((_Object$keys = Object.keys(data === null || data === void 0 ? void 0 : data.data))
|
32
|
+
if (!((_Object$keys = Object.keys(data === null || data === void 0 ? void 0 : data.data)) !== null && _Object$keys !== void 0 && _Object$keys.length)) {
|
32
33
|
return false;
|
33
34
|
}
|
34
35
|
if (storage === 'localStorage') {
|
@@ -37,6 +38,7 @@ export function setEnumData(storage, cacheKey, data) {
|
|
37
38
|
window.sessionStorage.setItem(cacheKey, JSON.stringify(data));
|
38
39
|
}
|
39
40
|
}
|
41
|
+
|
40
42
|
/**
|
41
43
|
* 判断枚举列表是否存在
|
42
44
|
* @param storage
|
@@ -49,6 +51,7 @@ export function hasEnumList(storage, cacheKey, code) {
|
|
49
51
|
var enumList = (res === null || res === void 0 ? void 0 : res.data) || {};
|
50
52
|
return enumList === null || enumList === void 0 ? void 0 : enumList[code];
|
51
53
|
}
|
54
|
+
|
52
55
|
/**
|
53
56
|
* 判断是否是对象
|
54
57
|
* @param obj
|
@@ -57,6 +60,7 @@ export function hasEnumList(storage, cacheKey, code) {
|
|
57
60
|
export function isObject(obj) {
|
58
61
|
return Object.prototype.toString.call(obj) === '[object Object]';
|
59
62
|
}
|
63
|
+
|
60
64
|
/**
|
61
65
|
* 合并枚举数据
|
62
66
|
* @param storage
|
@@ -72,8 +76,9 @@ export function mergeCacheData(storage, code, cacheKey, responseData) {
|
|
72
76
|
if (cacheData && cacheData.data) {
|
73
77
|
cacheData.data[code] = responseData;
|
74
78
|
}
|
75
|
-
(_window2 = window) === null || _window2 === void 0
|
79
|
+
(_window2 = window) === null || _window2 === void 0 || _window2[cacheStorage].setItem(cacheKey, JSON.stringify(cacheData));
|
76
80
|
}
|
81
|
+
|
77
82
|
/**
|
78
83
|
* diff code 差异
|
79
84
|
* @param cacheCodes
|
@@ -93,6 +98,7 @@ export function diffCode(cacheCodes, codes) {
|
|
93
98
|
}
|
94
99
|
return diff;
|
95
100
|
}
|
101
|
+
|
96
102
|
/**
|
97
103
|
* 缓存fieldNames制定的值
|
98
104
|
* @param fieldNames 保留映射值
|
@@ -105,7 +111,7 @@ export function cacheFieldNames(fieldNames, dataSource) {
|
|
105
111
|
var result = {};
|
106
112
|
Object.keys(restFieldNames).forEach(function (key) {
|
107
113
|
var value = dataSource[restFieldNames[key]] ? dataSource[restFieldNames[key]] : dataSource[key];
|
108
|
-
if (!(
|
114
|
+
if (!(isUndefined(value) || isNull(value))) {
|
109
115
|
result[key] = dataSource[restFieldNames[key]] ? dataSource[restFieldNames[key]] : dataSource[key];
|
110
116
|
}
|
111
117
|
});
|