@zat-design/sisyphus-react 3.11.14 → 3.12.0
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 +26 -15
- package/dist/less.esm.css +26 -15
- package/es/ProAction/index.d.ts +2 -2
- package/es/ProAction/propsType.d.ts +16 -10
- package/es/ProConfigProvider/index.d.ts +7 -7
- package/es/ProDownload/index.d.ts +2 -2
- package/es/ProDownload/propsType.d.ts +2 -1
- package/es/ProDrawerForm/components/ProDrawer/index.d.ts +2 -2
- package/es/ProDrawerForm/components/ProModal/index.d.ts +2 -2
- package/es/ProDrawerForm/index.d.ts +1 -2
- package/es/ProDrawerForm/propsType.d.ts +38 -27
- package/es/ProDrawerForm/utils/index.d.ts +2 -2
- package/es/ProEditLabel/components/RenderProForm.d.ts +2 -2
- package/es/ProEditLabel/index.d.ts +2 -2
- package/es/ProEditLabel/propsType.d.ts +135 -8
- package/es/ProEditLabel/style/index.less +24 -25
- package/es/ProEditTable/components/Summary/index.d.ts +2 -2
- package/es/ProEditTable/index.d.ts +2 -2
- package/es/ProEditTable/index.js +18 -16
- package/es/ProEditTable/propsType.d.ts +243 -106
- package/es/ProEditTable/style/index.less +1 -0
- package/es/ProEditTable/utils/index.d.ts +1 -1
- package/es/ProEditTable/utils/index.js +6 -4
- package/es/ProEditTable/utils/tools.d.ts +57 -22
- package/es/ProEditTable/utils/tools.js +47 -21
- package/es/ProEnum/components/Group.d.ts +2 -2
- package/es/ProEnum/components/Tag.d.ts +2 -2
- package/es/ProEnum/hooks/useEnum.d.ts +2 -2
- package/es/ProEnum/hooks/useEnum.js +46 -17
- package/es/ProEnum/hooks/useEnumRequest.d.ts +2 -2
- package/es/ProEnum/index.d.ts +2 -2
- package/es/ProEnum/propsType.d.ts +231 -42
- package/es/ProEnum/propsType.js +0 -6
- package/es/ProEnum/utils/index.d.ts +9 -2
- package/es/ProEnum/utils/index.js +9 -2
- package/es/ProForm/components/FormFooter/index.d.ts +2 -2
- package/es/ProForm/components/FormFooter/propsType.d.ts +8 -3
- package/es/ProForm/components/base/Checkbox/index.d.ts +2 -2
- package/es/ProForm/components/base/Input/index.d.ts +2 -2
- package/es/ProForm/components/base/Input/propsType.d.ts +10 -6
- package/es/ProForm/components/base/InputNumber/index.d.ts +2 -2
- package/es/ProForm/components/base/Radio/index.d.ts +2 -2
- package/es/ProForm/components/base/RangePicker/index.d.ts +2 -2
- package/es/ProForm/components/base/Select/index.d.ts +2 -2
- package/es/ProForm/components/base/Switch/index.d.ts +2 -2
- package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +2 -2
- package/es/ProForm/components/base/TextArea/index.d.ts +2 -2
- package/es/ProForm/components/base/TimePicker/index.d.ts +2 -2
- package/es/ProForm/components/combination/Container/index.d.ts +2 -2
- package/es/ProForm/components/combination/Container/propsType.d.ts +10 -6
- package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +4 -4
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +4 -4
- package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +4 -4
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +2 -2
- package/es/ProForm/components/combination/FormList/index.d.ts +2 -2
- package/es/ProForm/components/combination/FormList/propsType.d.ts +18 -10
- package/es/ProForm/components/combination/Group/index.d.ts +2 -2
- package/es/ProForm/components/combination/Group/propsType.d.ts +10 -5
- package/es/ProForm/components/combination/Group/utils.d.ts +6 -6
- package/es/ProForm/components/combination/ProCascader/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +8 -3
- package/es/ProForm/components/combination/ProCombination/index.d.ts +3 -3
- package/es/ProForm/components/combination/ProCombination/propsType.d.ts +10 -5
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +58 -5
- package/es/ProForm/components/combination/ProNumberRange/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +7 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +15 -9
- package/es/ProForm/components/old/EnumSelect/index.d.ts +1 -1
- package/es/ProForm/components/old/EnumSelect/interface.d.ts +2 -2
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +1 -1
- package/es/ProForm/components/old/ProCertNo/index.d.ts +1 -1
- package/es/ProForm/components/old/ProCertValidity/index.d.ts +1 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +1 -1
- package/es/ProForm/components/render/ChangedWrapper.d.ts +2 -2
- package/es/ProForm/components/render/ConfirmWrapper.d.ts +2 -2
- package/es/ProForm/components/render/Render.d.ts +2 -2
- package/es/ProForm/components/render/RenderFields.d.ts +4 -4
- package/es/ProForm/components/render/propsType.d.ts +76 -69
- package/es/ProForm/index.d.ts +2 -2
- package/es/ProForm/propsType.d.ts +26 -17
- package/es/ProForm/propsType.js +0 -1
- package/es/ProForm/utils/transformValue.d.ts +2 -2
- package/es/ProForm/utils/useFieldProps.d.ts +3 -3
- package/es/ProForm/utils/useForm.d.ts +1 -1
- package/es/ProForm/utils/useRules.d.ts +1 -1
- package/es/ProForm/utils/useShouldUpdate.d.ts +3 -3
- package/es/ProIcon/index.d.ts +2 -2
- package/es/ProIcon/propsTypes.d.ts +120 -49
- package/es/ProLayout/components/Layout/Header/index.d.ts +2 -2
- package/es/ProLayout/components/Layout/Menu/index.d.ts +2 -2
- package/es/ProLayout/components/Layout/Notice/index.d.ts +2 -2
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +9 -2
- package/es/ProLayout/components/ProCollapse/index.d.ts +2 -2
- package/es/ProLayout/components/ProCollapse/index.js +12 -4
- package/es/ProLayout/components/ProFooter/PropTypes.d.ts +18 -1
- package/es/ProLayout/components/ProFooter/index.d.ts +2 -2
- package/es/ProLayout/components/ProHeader/PropTypes.d.ts +121 -14
- package/es/ProLayout/components/ProHeader/index.d.ts +2 -2
- package/es/ProLayout/index.d.ts +5 -5
- package/es/ProLayout/index.js +6 -2
- package/es/ProLayout/propTypes.d.ts +182 -25
- package/es/ProLayout/utils/index.d.ts +2 -2
- package/es/ProSelect/index.d.ts +3 -3
- package/es/ProSelect/propsType.d.ts +141 -31
- package/es/ProStep/components/Anchor/index.d.ts +2 -1
- package/es/ProStep/components/Item/index.d.ts +2 -2
- package/es/ProStep/components/Item/index.js +6 -2
- package/es/ProStep/components/Listener/index.d.ts +4 -3
- package/es/ProStep/components/Listener/index.js +18 -4
- package/es/ProStep/components/Step/index.d.ts +2 -2
- package/es/ProStep/index.d.ts +7 -7
- package/es/ProStep/index.js +19 -4
- package/es/ProStep/propsType.d.ts +200 -12
- package/es/ProStep/utils/index.d.ts +17 -4
- package/es/ProStep/utils/index.js +11 -2
- package/es/ProTable/components/FormatColumn/index.d.ts +2 -2
- package/es/ProTable/components/FormatColumn/index.js +5 -8
- package/es/ProTable/components/RenderTabs/index.d.ts +4 -0
- package/es/ProTable/components/RenderTabs/index.js +78 -0
- package/es/ProTable/components/index.d.ts +25 -0
- package/es/ProTable/components/index.js +26 -1
- package/es/ProTable/hooks/useAntdTable.d.ts +2 -93
- package/es/ProTable/hooks/useAntdTable.js +6 -2
- package/es/ProTable/index.d.ts +2 -2
- package/es/ProTable/index.js +6 -3
- package/es/ProTable/propsType.d.ts +630 -39
- package/es/ProTable/style/index.less +3 -0
- package/es/ProTabs/index.d.ts +2 -2
- package/es/ProTabs/index.js +4 -4
- package/es/ProTabs/propType.d.ts +66 -9
- package/es/ProThemeTools/index.d.ts +2 -2
- package/es/ProThemeTools/propsType.d.ts +136 -14
- package/es/ProTooltip/index.d.ts +2 -2
- package/es/ProTooltip/propsType.d.ts +49 -9
- package/es/ProTree/components/List.d.ts +2 -2
- package/es/ProTree/components/List.js +2 -2
- package/es/ProTree/components/ProTree.d.ts +2 -2
- package/es/ProTree/components/ProTreeSelect/index.d.ts +3 -3
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +372 -34
- package/es/ProTree/components/SearchTitle.d.ts +2 -2
- package/es/ProTree/components/Tree.d.ts +3 -3
- package/es/ProTree/index.d.ts +2 -2
- package/es/ProTree/index.js +1 -1
- package/es/ProTree/propsType.d.ts +694 -103
- package/es/ProTree/utils.d.ts +7 -7
- package/es/ProTreeModal/components/Cascader.d.ts +3 -3
- package/es/ProTreeModal/components/List.d.ts +3 -3
- package/es/ProTreeModal/components/Tree.d.ts +2 -2
- package/es/ProTreeModal/index.d.ts +2 -2
- package/es/ProTreeModal/index.js +2 -2
- package/es/ProTreeModal/propsType.d.ts +258 -49
- package/es/ProTreeModal/utils.d.ts +7 -7
- package/es/ProUpload/components/ButtonRender.d.ts +2 -2
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +2 -2
- package/es/ProUpload/components/Example.d.ts +2 -2
- package/es/ProUpload/components/ImageRender.d.ts +2 -2
- package/es/ProUpload/index.d.ts +2 -2
- package/es/ProUpload/index.js +7 -9
- package/es/ProUpload/propsType.d.ts +65 -8
- package/es/ProWaterMark/index.d.ts +2 -2
- package/es/ProWaterMark/propsType.d.ts +2 -1
- package/es/index.d.ts +15 -6
- package/es/index.js +1 -7
- package/lib/ProAction/index.d.ts +2 -2
- package/lib/ProAction/propsType.d.ts +16 -10
- package/lib/ProConfigProvider/index.d.ts +7 -7
- package/lib/ProDownload/index.d.ts +2 -2
- package/lib/ProDownload/propsType.d.ts +2 -1
- package/lib/ProDrawerForm/components/ProDrawer/index.d.ts +2 -2
- package/lib/ProDrawerForm/components/ProModal/index.d.ts +2 -2
- package/lib/ProDrawerForm/index.d.ts +1 -2
- package/lib/ProDrawerForm/propsType.d.ts +38 -27
- package/lib/ProDrawerForm/utils/index.d.ts +2 -2
- package/lib/ProEditLabel/components/RenderProForm.d.ts +2 -2
- package/lib/ProEditLabel/index.d.ts +2 -2
- package/lib/ProEditLabel/propsType.d.ts +135 -8
- package/lib/ProEditLabel/style/index.less +24 -25
- package/lib/ProEditTable/components/Summary/index.d.ts +2 -2
- package/lib/ProEditTable/index.d.ts +2 -2
- package/lib/ProEditTable/index.js +18 -16
- package/lib/ProEditTable/propsType.d.ts +243 -106
- package/lib/ProEditTable/style/index.less +1 -0
- package/lib/ProEditTable/utils/index.d.ts +1 -1
- package/lib/ProEditTable/utils/index.js +6 -4
- package/lib/ProEditTable/utils/tools.d.ts +57 -22
- package/lib/ProEditTable/utils/tools.js +47 -21
- package/lib/ProEnum/components/Group.d.ts +2 -2
- package/lib/ProEnum/components/Tag.d.ts +2 -2
- package/lib/ProEnum/hooks/useEnum.d.ts +2 -2
- package/lib/ProEnum/hooks/useEnum.js +48 -17
- package/lib/ProEnum/hooks/useEnumRequest.d.ts +2 -2
- package/lib/ProEnum/index.d.ts +2 -2
- package/lib/ProEnum/propsType.d.ts +231 -42
- package/lib/ProEnum/propsType.js +1 -7
- package/lib/ProEnum/utils/index.d.ts +9 -2
- package/lib/ProEnum/utils/index.js +9 -2
- package/lib/ProForm/components/FormFooter/index.d.ts +2 -2
- package/lib/ProForm/components/FormFooter/propsType.d.ts +8 -3
- package/lib/ProForm/components/base/Checkbox/index.d.ts +2 -2
- package/lib/ProForm/components/base/Input/index.d.ts +2 -2
- package/lib/ProForm/components/base/Input/propsType.d.ts +10 -6
- package/lib/ProForm/components/base/InputNumber/index.d.ts +2 -2
- package/lib/ProForm/components/base/Radio/index.d.ts +2 -2
- package/lib/ProForm/components/base/RangePicker/index.d.ts +2 -2
- package/lib/ProForm/components/base/Select/index.d.ts +2 -2
- package/lib/ProForm/components/base/Switch/index.d.ts +2 -2
- package/lib/ProForm/components/base/SwitchCheckbox/index.d.ts +2 -2
- package/lib/ProForm/components/base/TextArea/index.d.ts +2 -2
- package/lib/ProForm/components/base/TimePicker/index.d.ts +2 -2
- package/lib/ProForm/components/combination/Container/index.d.ts +2 -2
- package/lib/ProForm/components/combination/Container/propsType.d.ts +10 -6
- package/lib/ProForm/components/combination/FormList/components/ActionButton.d.ts +4 -4
- package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +4 -4
- package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +4 -4
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +2 -2
- package/lib/ProForm/components/combination/FormList/index.d.ts +2 -2
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +18 -10
- package/lib/ProForm/components/combination/Group/index.d.ts +2 -2
- package/lib/ProForm/components/combination/Group/propsType.d.ts +10 -5
- package/lib/ProForm/components/combination/Group/utils.d.ts +6 -6
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +8 -3
- package/lib/ProForm/components/combination/ProCombination/index.d.ts +3 -3
- package/lib/ProForm/components/combination/ProCombination/propsType.d.ts +10 -5
- package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +58 -5
- package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +7 -3
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +15 -9
- package/lib/ProForm/components/old/EnumSelect/index.d.ts +1 -1
- package/lib/ProForm/components/old/EnumSelect/interface.d.ts +2 -2
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/lib/ProForm/components/old/ProAddress/index.d.ts +1 -1
- package/lib/ProForm/components/old/ProCertNo/index.d.ts +1 -1
- package/lib/ProForm/components/old/ProCertValidity/index.d.ts +1 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +1 -1
- package/lib/ProForm/components/render/ChangedWrapper.d.ts +2 -2
- package/lib/ProForm/components/render/ConfirmWrapper.d.ts +2 -2
- package/lib/ProForm/components/render/Render.d.ts +2 -2
- package/lib/ProForm/components/render/RenderFields.d.ts +4 -4
- package/lib/ProForm/components/render/propsType.d.ts +76 -69
- package/lib/ProForm/index.d.ts +2 -2
- package/lib/ProForm/propsType.d.ts +26 -17
- package/lib/ProForm/propsType.js +0 -15
- package/lib/ProForm/utils/transformValue.d.ts +2 -2
- package/lib/ProForm/utils/useFieldProps.d.ts +3 -3
- package/lib/ProForm/utils/useForm.d.ts +1 -1
- package/lib/ProForm/utils/useRules.d.ts +1 -1
- package/lib/ProForm/utils/useShouldUpdate.d.ts +3 -3
- package/lib/ProIcon/index.d.ts +2 -2
- package/lib/ProIcon/propsTypes.d.ts +120 -49
- package/lib/ProLayout/components/Layout/Header/index.d.ts +2 -2
- package/lib/ProLayout/components/Layout/Menu/index.d.ts +2 -2
- package/lib/ProLayout/components/Layout/Notice/index.d.ts +2 -2
- package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +9 -2
- package/lib/ProLayout/components/ProCollapse/index.d.ts +2 -2
- package/lib/ProLayout/components/ProCollapse/index.js +12 -4
- package/lib/ProLayout/components/ProFooter/PropTypes.d.ts +18 -1
- package/lib/ProLayout/components/ProFooter/index.d.ts +2 -2
- package/lib/ProLayout/components/ProHeader/PropTypes.d.ts +121 -14
- package/lib/ProLayout/components/ProHeader/index.d.ts +2 -2
- package/lib/ProLayout/index.d.ts +5 -5
- package/lib/ProLayout/index.js +6 -2
- package/lib/ProLayout/propTypes.d.ts +182 -25
- package/lib/ProLayout/utils/index.d.ts +2 -2
- package/lib/ProSelect/index.d.ts +3 -3
- package/lib/ProSelect/propsType.d.ts +141 -31
- package/lib/ProStep/components/Anchor/index.d.ts +2 -1
- package/lib/ProStep/components/Item/index.d.ts +2 -2
- package/lib/ProStep/components/Item/index.js +6 -2
- package/lib/ProStep/components/Listener/index.d.ts +4 -3
- package/lib/ProStep/components/Listener/index.js +18 -4
- package/lib/ProStep/components/Step/index.d.ts +2 -2
- package/lib/ProStep/index.d.ts +7 -7
- package/lib/ProStep/index.js +19 -4
- package/lib/ProStep/propsType.d.ts +200 -12
- package/lib/ProStep/utils/index.d.ts +17 -4
- package/lib/ProStep/utils/index.js +11 -2
- package/lib/ProTable/components/FormatColumn/index.d.ts +2 -2
- package/lib/ProTable/components/FormatColumn/index.js +5 -8
- package/lib/ProTable/components/RenderTabs/index.d.ts +4 -0
- package/lib/ProTable/components/RenderTabs/index.js +82 -0
- package/lib/ProTable/components/index.d.ts +25 -0
- package/lib/ProTable/components/index.js +8 -1
- package/lib/ProTable/hooks/useAntdTable.d.ts +2 -93
- package/lib/ProTable/hooks/useAntdTable.js +5 -1
- package/lib/ProTable/index.d.ts +2 -2
- package/lib/ProTable/index.js +5 -2
- package/lib/ProTable/propsType.d.ts +630 -39
- package/lib/ProTable/style/index.less +3 -0
- package/lib/ProTabs/index.d.ts +2 -2
- package/lib/ProTabs/index.js +4 -4
- package/lib/ProTabs/propType.d.ts +66 -9
- package/lib/ProThemeTools/index.d.ts +2 -2
- package/lib/ProThemeTools/propsType.d.ts +136 -14
- package/lib/ProTooltip/index.d.ts +2 -2
- package/lib/ProTooltip/propsType.d.ts +49 -9
- package/lib/ProTree/components/List.d.ts +2 -2
- package/lib/ProTree/components/List.js +2 -2
- package/lib/ProTree/components/ProTree.d.ts +2 -2
- package/lib/ProTree/components/ProTreeSelect/index.d.ts +3 -3
- package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +372 -34
- package/lib/ProTree/components/SearchTitle.d.ts +2 -2
- package/lib/ProTree/components/Tree.d.ts +3 -3
- package/lib/ProTree/index.d.ts +2 -2
- package/lib/ProTree/index.js +1 -1
- package/lib/ProTree/propsType.d.ts +694 -103
- package/lib/ProTree/utils.d.ts +7 -7
- package/lib/ProTreeModal/components/Cascader.d.ts +3 -3
- package/lib/ProTreeModal/components/List.d.ts +3 -3
- package/lib/ProTreeModal/components/Tree.d.ts +2 -2
- package/lib/ProTreeModal/index.d.ts +2 -2
- package/lib/ProTreeModal/index.js +2 -2
- package/lib/ProTreeModal/propsType.d.ts +258 -49
- package/lib/ProTreeModal/utils.d.ts +7 -7
- package/lib/ProUpload/components/ButtonRender.d.ts +2 -2
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +2 -2
- package/lib/ProUpload/components/Example.d.ts +2 -2
- package/lib/ProUpload/components/ImageRender.d.ts +2 -2
- package/lib/ProUpload/index.d.ts +2 -2
- package/lib/ProUpload/index.js +7 -9
- package/lib/ProUpload/propsType.d.ts +65 -8
- package/lib/ProWaterMark/index.d.ts +2 -2
- package/lib/ProWaterMark/propsType.d.ts +2 -1
- package/lib/index.d.ts +15 -6
- package/lib/index.js +7 -71
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -5
- package/test/__mocks__/fileMock.js +0 -0
- package/test/__mocks__/styleMock.js +0 -0
@@ -7,32 +7,47 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
7
7
|
import React from 'react';
|
8
8
|
import { tools, validate } from '@zat-design/utils';
|
9
9
|
import { cloneDeep, cloneDeepWith, isString, isObject, isEqual, transform, isFunction, isBoolean, get } from 'lodash';
|
10
|
+
/**
|
11
|
+
* 生成随机字符串
|
12
|
+
* @returns 随机字符串
|
13
|
+
*/
|
10
14
|
export var getRandom = function getRandom() {
|
11
15
|
return Math.random().toString(36).slice(-6);
|
12
16
|
};
|
13
|
-
|
17
|
+
/**
|
18
|
+
* 深层次对比两个对象且取出来差异值
|
19
|
+
* @param object 比较对象
|
20
|
+
* @param base 基准对象
|
21
|
+
* @returns 差异对象
|
22
|
+
*/
|
14
23
|
export var difference = function difference(object, base) {
|
15
24
|
var _changes = function changes(object, base) {
|
16
25
|
return transform(object, function (result, value, key) {
|
17
|
-
if (!isEqual(value, base[key])) {
|
18
|
-
result[key] = isObject(value) && isObject(base[key]) ? _changes(value, base[key]) : value;
|
26
|
+
if (!isEqual(value, base === null || base === void 0 ? void 0 : base[key])) {
|
27
|
+
result[key] = isObject(value) && isObject(base === null || base === void 0 ? void 0 : base[key]) ? _changes(value, base === null || base === void 0 ? void 0 : base[key]) : value;
|
19
28
|
}
|
20
29
|
});
|
21
30
|
};
|
22
31
|
return _changes(object, base);
|
23
32
|
};
|
24
|
-
|
33
|
+
/**
|
34
|
+
* 数组字段循环校验,解决validateFields无法批量校验的问题
|
35
|
+
* @param validateKeys 校验键数组
|
36
|
+
* @param form 表单实例
|
37
|
+
* @param rowName 行名称路径
|
38
|
+
* @returns 校验结果Promise
|
39
|
+
*/
|
25
40
|
export var customValidate = function customValidate(validateKeys, form, rowName) {
|
26
41
|
var array = [];
|
27
42
|
validateKeys.forEach(function (key) {
|
28
|
-
array.push(
|
43
|
+
array.push([].concat(_toConsumableArray(Array.isArray(rowName) ? rowName : [rowName]), [key]));
|
29
44
|
});
|
30
45
|
return form.validateFields(array);
|
31
46
|
};
|
32
47
|
/**
|
33
48
|
* 拆解数组names
|
34
|
-
* @param names
|
35
|
-
* @returns
|
49
|
+
* @param names 名称数组
|
50
|
+
* @returns 拆解后的字符串
|
36
51
|
*/
|
37
52
|
export var splitNames = function splitNames(names) {
|
38
53
|
var result;
|
@@ -49,14 +64,23 @@ export var splitNames = function splitNames(names) {
|
|
49
64
|
result = resultArray.join('-');
|
50
65
|
return result;
|
51
66
|
};
|
52
|
-
|
67
|
+
/**
|
68
|
+
* 获取中间formItem的name
|
69
|
+
* @param name 名称路径
|
70
|
+
* @param virtualKey 虚拟键
|
71
|
+
* @returns 完整名称路径数组
|
72
|
+
*/
|
53
73
|
export var getNamePath = function getNamePath(name, virtualKey) {
|
54
74
|
var nextName = cloneDeep(Array.isArray(name) ? name : [name]);
|
55
|
-
var
|
56
|
-
|
75
|
+
var lastIndex = nextName.length - 1;
|
76
|
+
// 确保最后一个元素是字符串类型
|
77
|
+
nextName[lastIndex] = "".concat(nextName[lastIndex]).concat(virtualKey ? "-".concat(virtualKey) : '');
|
57
78
|
return nextName;
|
58
79
|
};
|
59
|
-
|
80
|
+
/**
|
81
|
+
* 删除操作
|
82
|
+
* @param params 删除参数
|
83
|
+
*/
|
60
84
|
export var onDelete = function onDelete(_ref) {
|
61
85
|
var name = _ref.name,
|
62
86
|
form = _ref.form,
|
@@ -81,16 +105,12 @@ export var onDelete = function onDelete(_ref) {
|
|
81
105
|
}
|
82
106
|
}
|
83
107
|
};
|
84
|
-
/**
|
108
|
+
/**
|
109
|
+
* 获取最终的disabled, 两张模式【子级优先,全局优先
|
85
110
|
* 全局优先:globalControl为true时,全局控制
|
86
111
|
* 子级优先:globalControl为false时,子级控制
|
87
|
-
* @param
|
88
|
-
* @
|
89
|
-
* @param column 当前列
|
90
|
-
* @param tabledDisabled 表格的disabled
|
91
|
-
* @param columnFieldProps 当前列的fieldProps
|
92
|
-
* @param params 当前列的参数
|
93
|
-
* @param rowDisabled 行禁用参数
|
112
|
+
* @param params 禁用参数
|
113
|
+
* @returns 是否禁用
|
94
114
|
*/
|
95
115
|
export var getDisabled = function getDisabled(_ref2) {
|
96
116
|
var _ref3, _column$disabled;
|
@@ -103,7 +123,7 @@ export var getDisabled = function getDisabled(_ref2) {
|
|
103
123
|
rowDisabled = _ref2.rowDisabled;
|
104
124
|
var convertToBoolean = function convertToBoolean(value) {
|
105
125
|
if (Array.isArray(value)) {
|
106
|
-
return value;
|
126
|
+
return Boolean(value.length);
|
107
127
|
}
|
108
128
|
if (value === null || value === undefined || value === '') {
|
109
129
|
return false;
|
@@ -157,7 +177,8 @@ export var getDisabled = function getDisabled(_ref2) {
|
|
157
177
|
}
|
158
178
|
return convertToBoolean((_ref3 = (_column$disabled = column === null || column === void 0 ? void 0 : column.disabled) !== null && _column$disabled !== void 0 ? _column$disabled : columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) !== null && _ref3 !== void 0 ? _ref3 : tabledDisabled);
|
159
179
|
};
|
160
|
-
/**
|
180
|
+
/**
|
181
|
+
* 表格自动滚动到报错位置
|
161
182
|
*/
|
162
183
|
export var handleScrollToError = function handleScrollToError() {
|
163
184
|
setTimeout(function () {
|
@@ -217,6 +238,11 @@ export function cloneDeepFilterNode(value) {
|
|
217
238
|
}
|
218
239
|
});
|
219
240
|
}
|
241
|
+
/**
|
242
|
+
* 判断值是否为空
|
243
|
+
* @param value 需要判断的值
|
244
|
+
* @returns 是否为空
|
245
|
+
*/
|
220
246
|
var _isNull = function isNull(value) {
|
221
247
|
if (Array.isArray(value) && value.length) {
|
222
248
|
return value.some(function (item) {
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
interface Props extends Pick<
|
1
|
+
import type { ProEnumType } from '../propsType';
|
2
|
+
interface Props extends Pick<ProEnumType, 'id' | 'value' | 'onChange' | 'dataSource'> {
|
3
3
|
fieldValue: string;
|
4
4
|
fieldLabel: string;
|
5
5
|
disabled?: boolean;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
interface Props extends Pick<
|
1
|
+
import type { ProEnumType } from '../propsType';
|
2
|
+
interface Props extends Pick<ProEnumType, 'id' | 'value' | 'onChange' | 'dataSource'> {
|
3
3
|
fieldValue: string;
|
4
4
|
fieldLabel: string;
|
5
5
|
}
|
@@ -4,7 +4,7 @@ import { DataOption } from '../propsType';
|
|
4
4
|
* @param code
|
5
5
|
* const [options,fn] = useEnum("code")
|
6
6
|
*/
|
7
|
-
declare function useEnum(code
|
7
|
+
declare function useEnum(code?: string): [DataOption[], (val: string, showCodeName?: boolean) => string];
|
8
8
|
/**
|
9
9
|
* input codes output { code1:DataOption[],code2:DataOption[] }
|
10
10
|
* @param codes
|
@@ -17,5 +17,5 @@ declare function useEnum(codes: string[]): Record<string, DataOption[]>;
|
|
17
17
|
* @param value
|
18
18
|
* @param compose 展示 value-label
|
19
19
|
*/
|
20
|
-
declare function useEnum(code
|
20
|
+
declare function useEnum(code?: string, value?: string, compose?: boolean): [string, DataOption];
|
21
21
|
export default useEnum;
|
@@ -1,8 +1,17 @@
|
|
1
|
-
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
/* eslint-disable no-redeclare */
|
3
3
|
import { useProConfig } from '../../ProConfigProvider';
|
4
4
|
import { getEnumData } from '../utils';
|
5
|
-
var baseEnumStorage =
|
5
|
+
var baseEnumStorage = null;
|
6
|
+
try {
|
7
|
+
var storedData = window.localStorage.getItem('zat-design-pro-component-cacheKey');
|
8
|
+
if (storedData) {
|
9
|
+
baseEnumStorage = JSON.parse(storedData);
|
10
|
+
}
|
11
|
+
} catch (error) {
|
12
|
+
console.error('解析枚举缓存数据失败', error);
|
13
|
+
baseEnumStorage = null;
|
14
|
+
}
|
6
15
|
/**
|
7
16
|
* 根据 code 从枚举缓存取出对应的 options 、以及回显
|
8
17
|
* @param codes
|
@@ -11,24 +20,44 @@ var baseEnumStorage = (_ref = window.localStorage.getItem('zat-design-pro-compon
|
|
11
20
|
* @returns
|
12
21
|
*/
|
13
22
|
function useEnum(codes, value, compose) {
|
14
|
-
var
|
15
|
-
|
16
|
-
storage =
|
17
|
-
var
|
18
|
-
|
19
|
-
cacheKey =
|
20
|
-
|
21
|
-
fieldNames =
|
22
|
-
|
23
|
-
clear =
|
24
|
-
|
23
|
+
var _ref = useProConfig('globalConfig') || {},
|
24
|
+
_ref$storage = _ref.storage,
|
25
|
+
storage = _ref$storage === void 0 ? 'localStorage' : _ref$storage;
|
26
|
+
var _ref2 = useProConfig('ProEnum') || {},
|
27
|
+
_ref2$cacheKey = _ref2.cacheKey,
|
28
|
+
cacheKey = _ref2$cacheKey === void 0 ? 'zat-design-pro-component-cacheKey' : _ref2$cacheKey,
|
29
|
+
_ref2$fieldNames = _ref2.fieldNames,
|
30
|
+
fieldNames = _ref2$fieldNames === void 0 ? {} : _ref2$fieldNames,
|
31
|
+
_ref2$clear = _ref2.clear,
|
32
|
+
clear = _ref2$clear === void 0 ? true : _ref2$clear,
|
33
|
+
_ref2$dataSource = _ref2.dataSource,
|
34
|
+
dataSource = _ref2$dataSource === void 0 ? {} : _ref2$dataSource;
|
35
|
+
var catchData = getEnumData(storage, cacheKey, baseEnumStorage, dataSource);
|
25
36
|
// 默认枚举缓存数据
|
26
37
|
baseEnumStorage = catchData;
|
27
38
|
if (!codes) {
|
39
|
+
if (!Object.keys(catchData).length) {
|
40
|
+
return [];
|
41
|
+
}
|
28
42
|
return catchData;
|
29
43
|
}
|
30
44
|
var fieldLabel = '';
|
31
45
|
var fieldValue = '';
|
46
|
+
// 获取枚举数据源
|
47
|
+
var enumDataSource = (catchData === null || catchData === void 0 ? void 0 : catchData.data) || {};
|
48
|
+
// 当dataSource有值时,检查是否需要合并
|
49
|
+
if (dataSource && Object.keys(dataSource).length > 0) {
|
50
|
+
// 创建合并后的数据源
|
51
|
+
var mergedDataSource = _objectSpread({}, enumDataSource);
|
52
|
+
// 遍历dataSource中的每个键
|
53
|
+
Object.keys(dataSource).forEach(function (key) {
|
54
|
+
// 如果enumDataSource中不存在该键或者该键对应的值为空数组,则合并
|
55
|
+
if (!enumDataSource[key] || enumDataSource[key].length === 0) {
|
56
|
+
mergedDataSource[key] = dataSource[key];
|
57
|
+
}
|
58
|
+
});
|
59
|
+
enumDataSource = mergedDataSource;
|
60
|
+
}
|
32
61
|
if (fieldNames && Object.keys(fieldNames).length) {
|
33
62
|
fieldLabel = fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label;
|
34
63
|
fieldValue = fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value;
|
@@ -38,8 +67,8 @@ function useEnum(codes, value, compose) {
|
|
38
67
|
fieldValue = 'value';
|
39
68
|
}
|
40
69
|
if (typeof codes === 'string') {
|
41
|
-
var
|
42
|
-
var options = (
|
70
|
+
var _enumDataSource;
|
71
|
+
var options = ((_enumDataSource = enumDataSource) === null || _enumDataSource === void 0 ? void 0 : _enumDataSource[codes]) || [];
|
43
72
|
var getEnumLabel = function getEnumLabel(v, composezTow) {
|
44
73
|
var option = options.find(function (item) {
|
45
74
|
return item[fieldValue] === v;
|
@@ -62,8 +91,8 @@ function useEnum(codes, value, compose) {
|
|
62
91
|
if (Array.isArray(codes)) {
|
63
92
|
var _options = {};
|
64
93
|
codes.forEach(function (code) {
|
65
|
-
var
|
66
|
-
var values =
|
94
|
+
var _enumDataSource2;
|
95
|
+
var values = (_enumDataSource2 = enumDataSource) === null || _enumDataSource2 === void 0 ? void 0 : _enumDataSource2[code];
|
67
96
|
if (Array.isArray(values) && values.length) {
|
68
97
|
_options[code] = values;
|
69
98
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import type { ProEnumConfigType } from '../propsType';
|
2
2
|
import '../utils/eventCenter';
|
3
|
-
declare const useEnumRequest: (props:
|
3
|
+
declare const useEnumRequest: (props: ProEnumConfigType, dispatch: any) => import("ahooks/lib/useRequest/src/types").Result<any, any>;
|
4
4
|
export default useEnumRequest;
|
package/es/ProEnum/index.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import useEnum from './hooks/useEnum';
|
2
|
-
import {
|
2
|
+
import type { ProEnumType } from './propsType';
|
3
3
|
import './style/index.less';
|
4
4
|
declare const ProEnum: {
|
5
|
-
(props:
|
5
|
+
(props: ProEnumType): import("react/jsx-runtime").JSX.Element;
|
6
6
|
getEnumLabel: (code: string | string[], value: any, compose?: boolean, fieldNameLabel?: string, fieldNameValue?: string) => import("react/jsx-runtime").JSX.Element;
|
7
7
|
useEnum: typeof useEnum;
|
8
8
|
};
|
@@ -1,95 +1,284 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
2
|
import { RadioProps, CheckboxProps } from 'antd';
|
3
3
|
import { Service, Options } from 'ahooks/lib/useRequest/src/types';
|
4
|
-
import {
|
5
|
-
import { PropSelectProps } from '../ProSelect/propsType';
|
6
|
-
|
4
|
+
import type { ProFormOtherType } from '../ProForm/propsType';
|
5
|
+
import type { PropSelectProps } from '../ProSelect/propsType';
|
6
|
+
/**
|
7
|
+
* @description 数据选项类型
|
8
|
+
*/
|
9
|
+
export interface DataOptionType {
|
10
|
+
/**
|
11
|
+
* @description 展示标签
|
12
|
+
* @default -
|
13
|
+
*/
|
7
14
|
label?: string;
|
15
|
+
/**
|
16
|
+
* @description 选项值
|
17
|
+
* @default -
|
18
|
+
*/
|
8
19
|
value?: string;
|
20
|
+
/**
|
21
|
+
* @description 是否禁用
|
22
|
+
* @default false
|
23
|
+
*/
|
9
24
|
disabled?: boolean;
|
25
|
+
/**
|
26
|
+
* @description 允许扩展字段
|
27
|
+
*/
|
10
28
|
[key: string]: any;
|
11
29
|
}
|
12
|
-
|
13
|
-
|
30
|
+
/**
|
31
|
+
* @description ProEnum配置类型
|
32
|
+
*/
|
33
|
+
export interface ProEnumConfigType {
|
34
|
+
/**
|
35
|
+
* @description 是否枚举主入口
|
36
|
+
* @default false
|
37
|
+
*/
|
14
38
|
main?: boolean;
|
15
|
-
/**
|
39
|
+
/**
|
40
|
+
* @description 是否使用主入口枚举
|
41
|
+
* @default false
|
42
|
+
*/
|
16
43
|
share?: boolean;
|
17
|
-
/**
|
44
|
+
/**
|
45
|
+
* @description 是否开启调试 log
|
46
|
+
* @default false
|
47
|
+
*/
|
18
48
|
debugger?: boolean;
|
19
|
-
/**
|
49
|
+
/**
|
50
|
+
* @description 是否对数据进行清洗
|
51
|
+
* @default false
|
52
|
+
*/
|
20
53
|
clear?: boolean;
|
21
|
-
/**
|
54
|
+
/**
|
55
|
+
* @description 字段别名
|
56
|
+
* @default { label: 'label', value: 'value', children: 'children' }
|
57
|
+
*/
|
22
58
|
fieldNames?: Record<'label' | 'value' | 'children', string>;
|
23
|
-
/**
|
59
|
+
/**
|
60
|
+
* @description 缓存的key、默认 zat-design-pro-component-cacheKey
|
61
|
+
* @default "zat-design-pro-component-cacheKey"
|
62
|
+
*/
|
24
63
|
cacheKey: string;
|
25
|
-
/**
|
64
|
+
/**
|
65
|
+
* @description 刷新请求、设置后每次进入都会重新请求
|
66
|
+
* @default false
|
67
|
+
*/
|
26
68
|
requestRefresh: boolean;
|
27
|
-
/**
|
69
|
+
/**
|
70
|
+
* @description 存储位置、不设置、默认读取 globalConfig 里面的
|
71
|
+
* @default "localStorage"
|
72
|
+
*/
|
28
73
|
storage: 'localStorage' | 'sessionStorage';
|
29
|
-
/**
|
30
|
-
|
31
|
-
|
74
|
+
/**
|
75
|
+
* @description 默认静态枚举数据
|
76
|
+
* @default {}
|
77
|
+
*/
|
78
|
+
dataSource: Record<string, DataOptionType[]>;
|
79
|
+
/**
|
80
|
+
* @description 对后台返回数据进行格式化
|
81
|
+
* @param data 后台返回的数据
|
82
|
+
* @returns 格式化后的枚举数据
|
83
|
+
* @default -
|
84
|
+
*/
|
32
85
|
transformResponse?: (data: {
|
33
|
-
data: Record<string,
|
34
|
-
}) => Record<string,
|
35
|
-
/**
|
86
|
+
data: Record<string, DataOptionType[]>;
|
87
|
+
}) => Record<string, DataOptionType[]> | Promise<Record<string, DataOptionType[]>>;
|
88
|
+
/**
|
89
|
+
* @description 批量请求枚举接口
|
90
|
+
* @default -
|
91
|
+
*/
|
36
92
|
useRequest?: {
|
93
|
+
/**
|
94
|
+
* @description 请求服务函数
|
95
|
+
*/
|
37
96
|
service: Service<any, any>;
|
97
|
+
/**
|
98
|
+
* @description 请求选项配置
|
99
|
+
*/
|
38
100
|
options?: Options<any, any> & {
|
101
|
+
/**
|
102
|
+
* @description 指定请求的枚举码
|
103
|
+
*/
|
39
104
|
codes?: string[];
|
105
|
+
/**
|
106
|
+
* @description 忽略的枚举码
|
107
|
+
*/
|
40
108
|
ignoreCodes?: string[];
|
41
109
|
};
|
42
110
|
};
|
43
|
-
|
111
|
+
/**
|
112
|
+
* @description 字典数据
|
113
|
+
* @default {}
|
114
|
+
*/
|
115
|
+
dics: Record<string, DataOptionType[]>;
|
44
116
|
}
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
117
|
+
/**
|
118
|
+
* @description 枚举组件类型枚举
|
119
|
+
*/
|
120
|
+
type EnumComponentType = 'ProSelect' | 'Radio' | 'Checkbox' | 'Tag' | 'Group';
|
121
|
+
/**
|
122
|
+
* @description ProEnum基础属性类型
|
123
|
+
*/
|
124
|
+
export interface ProEnumBaseType {
|
125
|
+
/**
|
126
|
+
* @description 组件展示类型、默认 ProSelect
|
127
|
+
* @default "ProSelect"
|
128
|
+
*/
|
129
|
+
type?: EnumComponentType;
|
130
|
+
/**
|
131
|
+
* @description 用于自定义组件
|
132
|
+
* @default -
|
133
|
+
*/
|
50
134
|
component?: ReactNode;
|
51
|
-
/**
|
135
|
+
/**
|
136
|
+
* @description 用于提交 code
|
137
|
+
* @default -
|
138
|
+
*/
|
52
139
|
code?: string | string[];
|
53
|
-
/**
|
140
|
+
/**
|
141
|
+
* @description 字段别名
|
142
|
+
* @default -
|
143
|
+
*/
|
54
144
|
fieldNames?: Record<string, string>;
|
55
|
-
/**
|
145
|
+
/**
|
146
|
+
* @description 是否查看模式
|
147
|
+
* @default false
|
148
|
+
*/
|
56
149
|
isView?: boolean;
|
57
|
-
/**
|
58
|
-
|
150
|
+
/**
|
151
|
+
* @description 数据源
|
152
|
+
* @default -
|
153
|
+
*/
|
154
|
+
dataSource?: DataOptionType[];
|
155
|
+
/**
|
156
|
+
* @description 当前值
|
157
|
+
* @default -
|
158
|
+
*/
|
59
159
|
value: any;
|
160
|
+
/**
|
161
|
+
* @description 值变化回调
|
162
|
+
* @default -
|
163
|
+
*/
|
60
164
|
onChange?: (value: any) => void;
|
61
|
-
/**
|
165
|
+
/**
|
166
|
+
* @description 远程请求接口
|
167
|
+
* @default -
|
168
|
+
*/
|
62
169
|
useRequest?: {
|
170
|
+
/**
|
171
|
+
* @description 请求服务函数
|
172
|
+
*/
|
63
173
|
service: Service<any, any>;
|
174
|
+
/**
|
175
|
+
* @description 请求选项
|
176
|
+
*/
|
64
177
|
options?: Options<any, any>;
|
65
178
|
};
|
66
|
-
/**
|
67
|
-
|
68
|
-
|
179
|
+
/**
|
180
|
+
* @description 对后台返回数据进行格式化
|
181
|
+
* @param data 后台返回的数据
|
182
|
+
* @returns 格式化后的选项数据
|
183
|
+
* @default -
|
184
|
+
*/
|
185
|
+
transformResponse?: (data: any) => DataOptionType[];
|
186
|
+
/**
|
187
|
+
* @description 是否合并数据
|
188
|
+
* @default false
|
189
|
+
*/
|
69
190
|
merge?: boolean;
|
70
|
-
/**
|
191
|
+
/**
|
192
|
+
* @description 查看模式下为空展示
|
193
|
+
* @default "-"
|
194
|
+
*/
|
71
195
|
viewEmpty?: React.ReactNode;
|
196
|
+
/**
|
197
|
+
* @description 自定义选项渲染
|
198
|
+
* @default -
|
199
|
+
*/
|
72
200
|
optionRender?: any;
|
73
|
-
/**
|
201
|
+
/**
|
202
|
+
* @description 显示 code-value 形式
|
203
|
+
* @default false
|
204
|
+
*/
|
74
205
|
showCodeName?: boolean;
|
75
|
-
/**
|
206
|
+
/**
|
207
|
+
* @description 支持 {label:xx, value: xx} 形式
|
208
|
+
* @default false
|
209
|
+
*/
|
76
210
|
labelInValue?: boolean;
|
77
|
-
|
211
|
+
/**
|
212
|
+
* @description 其他表单属性
|
213
|
+
* @default -
|
214
|
+
*/
|
215
|
+
otherProps?: ProFormOtherType;
|
216
|
+
/**
|
217
|
+
* @description 是否允许清除
|
218
|
+
* @default false
|
219
|
+
*/
|
78
220
|
allowClear?: boolean;
|
221
|
+
/**
|
222
|
+
* @description 组件ID
|
223
|
+
* @default -
|
224
|
+
*/
|
79
225
|
id?: string;
|
226
|
+
/**
|
227
|
+
* @description 默认值
|
228
|
+
* @default -
|
229
|
+
*/
|
80
230
|
defaultValue?: any;
|
81
231
|
}
|
82
|
-
|
232
|
+
/**
|
233
|
+
* @description ProSelect类型映射
|
234
|
+
*/
|
235
|
+
export type PropProSelectsMapType = {
|
236
|
+
/**
|
237
|
+
* @description 类型为ProSelect
|
238
|
+
* @default "ProSelect"
|
239
|
+
*/
|
83
240
|
type?: 'ProSelect';
|
84
241
|
} & PropSelectProps;
|
85
|
-
|
242
|
+
/**
|
243
|
+
* @description Radio类型映射
|
244
|
+
*/
|
245
|
+
export type PropRadioPropsMapType = {
|
246
|
+
/**
|
247
|
+
* @description 类型为Radio
|
248
|
+
* @default "Radio"
|
249
|
+
*/
|
86
250
|
type?: 'Radio';
|
87
251
|
} & RadioProps;
|
88
|
-
|
252
|
+
/**
|
253
|
+
* @description Checkbox类型映射
|
254
|
+
*/
|
255
|
+
export type CheckboxPropsMapType = {
|
256
|
+
/**
|
257
|
+
* @description 类型为Checkbox
|
258
|
+
* @default "Checkbox"
|
259
|
+
*/
|
89
260
|
type?: 'Checkbox';
|
90
261
|
} & CheckboxProps;
|
91
|
-
|
262
|
+
/**
|
263
|
+
* @description Tag类型映射
|
264
|
+
*/
|
265
|
+
export interface TagPropsMapType {
|
266
|
+
/**
|
267
|
+
* @description 类型为Tag或Group
|
268
|
+
* @default -
|
269
|
+
*/
|
92
270
|
type?: 'Tag' | 'Group';
|
93
271
|
}
|
94
|
-
|
272
|
+
/**
|
273
|
+
* @description ProEnum组件属性类型
|
274
|
+
*/
|
275
|
+
export type ProEnumType = Omit<ProEnumBaseType, 'type'> & (PropProSelectsMapType | PropRadioPropsMapType | CheckboxPropsMapType | TagPropsMapType);
|
276
|
+
export type DataOption = DataOptionType;
|
277
|
+
export type ProEnumConfig = ProEnumConfigType;
|
278
|
+
export type ProEnum = ProEnumBaseType;
|
279
|
+
export type PropProSelectsMap = PropProSelectsMapType;
|
280
|
+
export type PropRadioPropsMap = PropRadioPropsMapType;
|
281
|
+
export type CheckboxPropsMap = CheckboxPropsMapType;
|
282
|
+
export type TagPropsMap = TagPropsMapType;
|
283
|
+
export type ProEnumProps = ProEnumBaseType;
|
95
284
|
export {};
|
package/es/ProEnum/propsType.js
CHANGED
@@ -4,9 +4,16 @@ interface EnumRes {
|
|
4
4
|
data: Record<string, DataOption[]>;
|
5
5
|
[key: string]: any;
|
6
6
|
}
|
7
|
-
|
7
|
+
/**
|
8
|
+
* 获取枚举数据
|
9
|
+
* @param storage
|
10
|
+
* @param cacheKey
|
11
|
+
* @param baseEnumStorage
|
12
|
+
* @returns
|
13
|
+
*/
|
14
|
+
export declare function getEnumData(storage: StorageType, cacheKey: string, baseEnumStorage?: any, dataSource?: any[]): EnumRes;
|
8
15
|
export declare function setEnumData(storage: StorageType, cacheKey: string, data: any): boolean;
|
9
|
-
export declare function hasEnumList(storage: StorageType, cacheKey: any, code: string):
|
16
|
+
export declare function hasEnumList(storage: StorageType, cacheKey: any, code: string): import("../propsType").DataOptionType[];
|
10
17
|
export declare function isObject(obj: any): boolean;
|
11
18
|
export declare function mergeCacheData(storage: string, code: string, cacheKey: string, responseData: any): void;
|
12
19
|
/**
|
@@ -1,8 +1,15 @@
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
2
2
|
var _excluded = ["children"];
|
3
3
|
import { isNull, isUndefined } from 'lodash';
|
4
|
-
|
5
|
-
|
4
|
+
/**
|
5
|
+
* 获取枚举数据
|
6
|
+
* @param storage
|
7
|
+
* @param cacheKey
|
8
|
+
* @param baseEnumStorage
|
9
|
+
* @returns
|
10
|
+
*/
|
11
|
+
export function getEnumData(storage, cacheKey, baseEnumStorage, dataSource) {
|
12
|
+
if (baseEnumStorage && cacheKey === 'zat-design-pro-component-cacheKey') {
|
6
13
|
return baseEnumStorage;
|
7
14
|
}
|
8
15
|
if (storage === 'localStorage') {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import type { FooterRenderType } from './propsType';
|
3
3
|
export declare const PRO_FORM_CACHE = "PRO_FORM_CACHE";
|
4
|
-
declare const FormFooter: React.FC<
|
4
|
+
declare const FormFooter: React.FC<FooterRenderType>;
|
5
5
|
export default FormFooter;
|