@zat-design/sisyphus-react 3.11.14-beta.11 → 3.11.14-beta.12
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/.vscode/extensions.json +5 -0
- package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +2 -2
- package/coverage/lcov-report/src/.umi/core/history.ts.html +3 -3
- package/coverage/lcov-report/src/.umi/core/index.html +8 -8
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +3 -3
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +6 -6
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +2 -2
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +3723 -624
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +2 -2
- package/coverage/lcov-report/src/.umi/dumi/index.html +2 -2
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +3 -3
- package/coverage/lcov-report/src/.umi/index.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +3 -3
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +5 -5
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +3 -3
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +3 -3
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +2 -2
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +6 -6
- package/coverage/lcov-report/src/.umi/umi.ts.html +6 -6
- package/coverage/src/.umi/core/devScripts.ts.html +241 -0
- package/coverage/src/.umi/core/history.ts.html +148 -0
- package/coverage/src/.umi/core/index.html +206 -0
- package/coverage/src/.umi/core/plugin.ts.html +109 -0
- package/coverage/src/.umi/core/pluginRegister.ts.html +160 -0
- package/coverage/src/.umi/core/polyfill.ts.html +97 -0
- package/coverage/src/.umi/core/routes.ts.html +29149 -0
- package/coverage/src/.umi/core/umiExports.ts.html +112 -0
- package/coverage/src/.umi/dumi/index.html +116 -0
- package/coverage/src/.umi/dumi/layout.tsx.html +109 -0
- package/coverage/src/.umi/index.html +116 -0
- package/coverage/src/.umi/plugin-antd/index.html +116 -0
- package/coverage/src/.umi/plugin-antd/runtime.tsx.html +172 -0
- package/coverage/src/.umi/plugin-helmet/exports.ts.html +94 -0
- package/coverage/src/.umi/plugin-helmet/index.html +116 -0
- package/coverage/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
- package/coverage/src/.umi/plugin-initial-state/exports.ts.html +106 -0
- package/coverage/src/.umi/plugin-initial-state/index.html +146 -0
- package/coverage/{lcov-report/src/.umi/dumi/demos → src/.umi/plugin-initial-state/models}/index.html +15 -15
- package/coverage/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
- package/coverage/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
- package/coverage/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
- package/coverage/src/.umi/plugin-locale/index.html +161 -0
- package/coverage/src/.umi/plugin-locale/locale.tsx.html +268 -0
- package/coverage/src/.umi/plugin-locale/localeExports.ts.html +778 -0
- package/coverage/src/.umi/plugin-locale/runtime.tsx.html +115 -0
- package/coverage/src/.umi/plugin-model/Provider.tsx.html +202 -0
- package/coverage/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
- package/coverage/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
- package/coverage/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
- package/coverage/src/.umi/plugin-model/helpers/index.html +146 -0
- package/coverage/src/.umi/plugin-model/index.html +146 -0
- package/coverage/src/.umi/plugin-model/runtime.tsx.html +121 -0
- package/coverage/src/.umi/plugin-model/useModel.tsx.html +298 -0
- package/coverage/src/.umi/plugin-request/index.html +116 -0
- package/coverage/src/.umi/plugin-request/request.ts.html +919 -0
- package/coverage/src/.umi/umi.ts.html +268 -0
- package/es/ProEditTable/components/Summary/index.d.ts +2 -2
- package/es/ProEditTable/index.js +12 -8
- package/es/ProEditTable/propsType.d.ts +39 -41
- 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/propsType.d.ts +1 -1
- package/es/ProForm/components/combination/Group/propsType.d.ts +1 -1
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +2 -2
- package/es/ProForm/components/render/propsType.d.ts +3 -6
- package/es/ProForm/propsType.d.ts +5 -3
- package/es/ProForm/propsType.js +0 -1
- package/es/ProForm/utils/useForm.d.ts +1 -1
- package/es/ProForm/utils/useRules.d.ts +1 -1
- package/es/ProIcon/propsTypes.d.ts +0 -4
- package/es/ProStep/components/Anchor/index.d.ts +2 -1
- package/es/ProStep/components/Item/index.d.ts +1 -1
- 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/index.d.ts +7 -7
- package/es/ProStep/index.js +7 -3
- package/es/ProStep/propsType.d.ts +145 -5
- package/es/ProStep/utils/index.d.ts +16 -3
- package/es/ProStep/utils/index.js +11 -2
- package/es/ProTable/components/FormatColumn/index.js +2 -4
- package/es/ProTable/propsType.d.ts +14 -20
- package/es/ProTooltip/propsType.d.ts +0 -3
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +0 -7
- package/es/ProTree/propsType.d.ts +0 -11
- package/es/ProTreeModal/propsType.d.ts +0 -2
- package/es/index.d.ts +15 -11
- package/es/index.js +1 -12
- package/lib/ProEditTable/components/Summary/index.d.ts +2 -2
- package/lib/ProEditTable/index.js +12 -8
- package/lib/ProEditTable/propsType.d.ts +39 -41
- 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/propsType.d.ts +1 -1
- package/lib/ProForm/components/combination/Group/propsType.d.ts +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +2 -2
- package/lib/ProForm/components/render/propsType.d.ts +3 -6
- package/lib/ProForm/propsType.d.ts +5 -3
- package/lib/ProForm/propsType.js +0 -15
- package/lib/ProForm/utils/useForm.d.ts +1 -1
- package/lib/ProForm/utils/useRules.d.ts +1 -1
- package/lib/ProIcon/propsTypes.d.ts +0 -4
- package/lib/ProStep/components/Anchor/index.d.ts +2 -1
- package/lib/ProStep/components/Item/index.d.ts +1 -1
- 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/index.d.ts +7 -7
- package/lib/ProStep/index.js +7 -3
- package/lib/ProStep/propsType.d.ts +145 -5
- package/lib/ProStep/utils/index.d.ts +16 -3
- package/lib/ProStep/utils/index.js +11 -2
- package/lib/ProTable/components/FormatColumn/index.js +2 -4
- package/lib/ProTable/propsType.d.ts +14 -20
- package/lib/ProTooltip/propsType.d.ts +0 -3
- package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +0 -7
- package/lib/ProTree/propsType.d.ts +0 -11
- package/lib/ProTreeModal/propsType.d.ts +0 -2
- package/lib/index.d.ts +15 -11
- package/lib/index.js +7 -131
- package/package.json +1 -1
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +0 -6340
@@ -1,32 +1,67 @@
|
|
1
|
+
import { Key } from 'react';
|
2
|
+
import { FormInstance } from 'antd/es/form';
|
3
|
+
import { NamePath } from 'antd/es/form/interface';
|
4
|
+
/**
|
5
|
+
* 生成随机字符串
|
6
|
+
* @returns 随机字符串
|
7
|
+
*/
|
1
8
|
export declare const getRandom: () => string;
|
2
|
-
|
3
|
-
|
9
|
+
/**
|
10
|
+
* 深层次对比两个对象且取出来差异值
|
11
|
+
* @param object 比较对象
|
12
|
+
* @param base 基准对象
|
13
|
+
* @returns 差异对象
|
14
|
+
*/
|
15
|
+
export declare const difference: <T extends Record<string, any>, U extends Record<string, any>>(object: T, base: U) => Record<string, any>;
|
16
|
+
/**
|
17
|
+
* 数组字段循环校验,解决validateFields无法批量校验的问题
|
18
|
+
* @param validateKeys 校验键数组
|
19
|
+
* @param form 表单实例
|
20
|
+
* @param rowName 行名称路径
|
21
|
+
* @returns 校验结果Promise
|
22
|
+
*/
|
23
|
+
export declare const customValidate: (validateKeys: string[], form: FormInstance, rowName: NamePath) => Promise<any>;
|
4
24
|
/**
|
5
25
|
* 拆解数组names
|
6
|
-
* @param names
|
7
|
-
* @returns
|
26
|
+
* @param names 名称数组
|
27
|
+
* @returns 拆解后的字符串
|
8
28
|
*/
|
9
|
-
export declare const splitNames: (names: any[]) =>
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
29
|
+
export declare const splitNames: (names: any[]) => string;
|
30
|
+
/**
|
31
|
+
* 获取中间formItem的name
|
32
|
+
* @param name 名称路径
|
33
|
+
* @param virtualKey 虚拟键
|
34
|
+
* @returns 完整名称路径数组
|
35
|
+
*/
|
36
|
+
export declare const getNamePath: (name: NamePath, virtualKey?: string) => (string | number)[];
|
37
|
+
/**
|
38
|
+
* 删除操作
|
39
|
+
* @param params 删除参数
|
40
|
+
*/
|
41
|
+
export declare const onDelete: ({ name, form, virtualKey, selectedRowKeys, }: {
|
42
|
+
name: NamePath;
|
43
|
+
form: FormInstance;
|
44
|
+
virtualKey?: string;
|
45
|
+
selectedRowKeys: Key[];
|
16
46
|
}) => void;
|
17
|
-
/**
|
47
|
+
/**
|
48
|
+
* 获取最终的disabled, 两张模式【子级优先,全局优先
|
18
49
|
* 全局优先:globalControl为true时,全局控制
|
19
50
|
* 子级优先:globalControl为false时,子级控制
|
20
|
-
* @param
|
21
|
-
* @
|
22
|
-
* @param column 当前列
|
23
|
-
* @param tabledDisabled 表格的disabled
|
24
|
-
* @param columnFieldProps 当前列的fieldProps
|
25
|
-
* @param params 当前列的参数
|
26
|
-
* @param rowDisabled 行禁用参数
|
51
|
+
* @param params 禁用参数
|
52
|
+
* @returns 是否禁用
|
27
53
|
*/
|
28
|
-
export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled, }:
|
29
|
-
|
54
|
+
export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled, }: {
|
55
|
+
globalControl: boolean;
|
56
|
+
formDisabled?: boolean | ((record: any) => boolean);
|
57
|
+
column: any;
|
58
|
+
tabledDisabled?: boolean;
|
59
|
+
columnFieldProps?: any;
|
60
|
+
params: any[];
|
61
|
+
rowDisabled?: any;
|
62
|
+
}) => boolean;
|
63
|
+
/**
|
64
|
+
* 表格自动滚动到报错位置
|
30
65
|
*/
|
31
66
|
export declare const handleScrollToError: () => void;
|
32
67
|
/**
|
@@ -34,7 +69,7 @@ export declare const handleScrollToError: () => void;
|
|
34
69
|
* @param value 需要深拷贝的对象
|
35
70
|
* @returns 深拷贝后的对象,其中的React节点会被保留
|
36
71
|
*/
|
37
|
-
export declare function cloneDeepFilterNode(value:
|
72
|
+
export declare function cloneDeepFilterNode<T>(value: T): T;
|
38
73
|
/**
|
39
74
|
* 分页校验
|
40
75
|
*/
|
@@ -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,7 +1,7 @@
|
|
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 type { ProFormOtherType } from '../
|
4
|
+
import type { ProFormOtherType } from '../ProForm/propsType';
|
5
5
|
import type { PropSelectProps } from '../ProSelect/propsType';
|
6
6
|
/**
|
7
7
|
* @description 数据选项类型
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import { FormItemProps, ModalFuncProps, SpaceProps } from 'antd';
|
3
3
|
import { FormInstance } from 'antd/es/form/Form';
|
4
4
|
import { NamePath } from 'antd/lib/form/interface';
|
5
|
-
import type { ColumnTypeMap, FunctionArgs, ProFormValueType, ReactiveFunction, ViewType } from '
|
5
|
+
import type { ColumnTypeMap, FunctionArgs, ProFormValueType, ReactiveFunction, ViewType } from '../../render/propsType';
|
6
6
|
export interface SpaceType extends SpaceProps {
|
7
7
|
/**
|
8
8
|
* 是否紧凑合并
|
@@ -92,10 +92,10 @@ interface ProModalPropsType {
|
|
92
92
|
/** 模态框选择器属性类型(结合Select和Input属性) */
|
93
93
|
export declare type ProModalSelectPropsType = SelectProps & InputProps & ProModalPropsType;
|
94
94
|
/** 配置选项类型 */
|
95
|
-
export type
|
95
|
+
export type ProModalSelectConfigType = ConfigOption;
|
96
96
|
/** 模态框属性类型 */
|
97
97
|
export type ProModalType = Omit<ProModalPropsType, 'configOption'> & {
|
98
|
-
configOption:
|
98
|
+
configOption: ProModalSelectConfigType;
|
99
99
|
};
|
100
100
|
/** 模态框选择器类型(结合Select和Input属性) */
|
101
101
|
export type ProModalSelectType = SelectProps & InputProps & ProModalType;
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import { ColProps, FormInstance, FormItemProps, ModalFuncProps } from 'antd';
|
1
|
+
import type { ColProps, FormInstance, FormItemProps, ModalFuncProps } from 'antd';
|
2
2
|
import type { NamePath } from 'antd/es/form/interface';
|
3
3
|
import React from 'react';
|
4
4
|
import { validate, regExp } from '@zat-design/utils';
|
5
5
|
import type { RuleObject } from 'antd/es/form';
|
6
|
-
import * as componentMap from '../index';
|
7
6
|
import type { Props as InputProps } from '../base/Input/propsType';
|
8
7
|
import type { Props as InputNumberProps } from '../base/InputNumber';
|
9
8
|
import type { Props as RadioProps } from '../base/Radio';
|
@@ -32,14 +31,12 @@ import type { GroupType as GroupCopyProps } from '../combination/Group/propsType
|
|
32
31
|
import type { ProCollapseProps } from '../../../ProLayout/components/ProCollapse/PropTypes';
|
33
32
|
import type { DistributiveOmit, DiffConfigType } from '../../propsType';
|
34
33
|
import type { DiffOriginalParams } from '../../utils/diffOriginal';
|
35
|
-
export type ComponentMap = keyof typeof componentMap;
|
36
34
|
type ValidateKey = keyof typeof validate;
|
37
35
|
type RegExpKey = keyof typeof regExp;
|
38
|
-
interface
|
36
|
+
export interface ProRule extends Omit<RuleObject, 'type'> {
|
39
37
|
type?: ValidateKey | RegExpKey;
|
40
38
|
message?: string;
|
41
39
|
}
|
42
|
-
export type ProRule = ExtendType;
|
43
40
|
/**
|
44
41
|
* percent 百分比 permillage 千分比 amount 金额
|
45
42
|
*/
|
@@ -292,6 +289,6 @@ export type ProEnumTableProps<Values> = ProEnumTableType<Values>;
|
|
292
289
|
export type ProEnumFieldProps<Values, TT> = ProEnumFieldType<Values, TT>;
|
293
290
|
export type FieldProps<T extends ControlProps, Values, TT> = FieldType<T, Values, TT>;
|
294
291
|
export type ColumnPropsMap<Values = any, T = 'ProForm'> = ColumnTypeMap<Values, T>;
|
295
|
-
export type
|
292
|
+
export type ProColumnProps<Values = any> = ProFormColumnType<Values>;
|
296
293
|
export type RenderProps<Values = any> = RenderType<Values>;
|
297
294
|
export {};
|
@@ -4,8 +4,8 @@ import { NamePath } from 'antd/es/form/interface';
|
|
4
4
|
import { StoreValue, Store } from 'rc-field-form/es/interface.d';
|
5
5
|
import { ShouldUpdate } from 'rc-field-form/es/Field.d';
|
6
6
|
import React, { ReactNode } from 'react';
|
7
|
-
import type {
|
8
|
-
|
7
|
+
import type { ProFormColumnType, ViewType } from './components/render/propsType';
|
8
|
+
import type { ProFormComponentType } from './components/index.d';
|
9
9
|
export interface ButtonType extends ButtonProps {
|
10
10
|
children?: any;
|
11
11
|
}
|
@@ -33,7 +33,7 @@ export interface ProFormOtherType {
|
|
33
33
|
name?: NamePath;
|
34
34
|
names?: NamePath[];
|
35
35
|
form?: FormInstance;
|
36
|
-
type?:
|
36
|
+
type?: ProFormComponentType;
|
37
37
|
hiddenNames?: string[] | any[];
|
38
38
|
colProps: ColProps;
|
39
39
|
disabled: boolean;
|
@@ -111,3 +111,5 @@ export type FooterButtonProps = FooterButtonType;
|
|
111
111
|
export type ProFormOtherProps = ProFormOtherType;
|
112
112
|
export type DiffConfigProps = DiffConfigType;
|
113
113
|
export type Transform = TransformType;
|
114
|
+
export type { ProFormColumnType } from './components/render/propsType';
|
115
|
+
export type { ProColumnProps } from './components/render/propsType';
|
package/es/ProForm/propsType.js
CHANGED
@@ -13,4 +13,4 @@ export interface FormInstanceOption {
|
|
13
13
|
optimize?: boolean;
|
14
14
|
formKey?: string;
|
15
15
|
}
|
16
|
-
export declare const useForm: <T>(originForm?:
|
16
|
+
export declare const useForm: <T>(originForm?: ModifiedFormInstance<T> | FormInstanceOption, options?: FormInstanceOption) => [ModifiedFormInstance<T>];
|
@@ -172,9 +172,5 @@ export interface ProIconType {
|
|
172
172
|
*/
|
173
173
|
buttonIcon?: boolean;
|
174
174
|
}
|
175
|
-
export type ModeType = ProIconModeType;
|
176
175
|
export type ProIconProps = ProIconType;
|
177
|
-
export type iconMap = ProIconMapType;
|
178
|
-
export type themeMap = ProIconThemeMapType;
|
179
|
-
export type actionMap = ProIconActionMapType;
|
180
176
|
export {};
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { ProStepItemType } from '../../propsType';
|
2
|
-
declare const ProStepItem: ({ id, title, collapse: collapseItem, children, lazyLoad: stepLazyLoad, ...restProps }: ProStepItemType) =>
|
2
|
+
declare const ProStepItem: ({ id, title, collapse: collapseItem, children, lazyLoad: stepLazyLoad, order, ...restProps }: ProStepItemType) => JSX.Element;
|
3
3
|
export default ProStepItem;
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
-
var _excluded = ["id", "title", "collapse", "children", "lazyLoad"];
|
3
|
+
var _excluded = ["id", "title", "collapse", "children", "lazyLoad", "order"];
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
5
|
import { useEffect } from 'react';
|
6
6
|
import LazyLoad, { forceCheck } from 'react-lazyload';
|
7
7
|
import { isBoolean } from 'lodash';
|
8
8
|
import { useStep } from '../../index';
|
9
9
|
import ProCollapse from '../../../ProLayout/components/ProCollapse';
|
10
|
+
// 默认的懒加载配置
|
10
11
|
var defaultLazyLoadConfig = {
|
11
12
|
height: 200,
|
12
13
|
offset: 100,
|
@@ -19,6 +20,8 @@ var ProStepItem = function ProStepItem(_ref) {
|
|
19
20
|
collapseItem = _ref$collapse === void 0 ? true : _ref$collapse,
|
20
21
|
children = _ref.children,
|
21
22
|
stepLazyLoad = _ref.lazyLoad,
|
23
|
+
_ref$order = _ref.order,
|
24
|
+
order = _ref$order === void 0 ? 0 : _ref$order,
|
22
25
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
23
26
|
var _useStep = useStep(),
|
24
27
|
register = _useStep.register,
|
@@ -31,13 +34,14 @@ var ProStepItem = function ProStepItem(_ref) {
|
|
31
34
|
register === null || register === void 0 ? void 0 : register(_objectSpread({
|
32
35
|
id: id,
|
33
36
|
title: title,
|
37
|
+
order: order,
|
34
38
|
lazyLoad: lazyLoad
|
35
39
|
}, restProps));
|
36
40
|
}, 0);
|
37
41
|
return function () {
|
38
42
|
clearTimeout(timeoutId);
|
39
43
|
};
|
40
|
-
}, [id, title, lazyLoad, restProps, register]);
|
44
|
+
}, [id, title, order, lazyLoad, restProps, register]);
|
41
45
|
var renderChildren = function renderChildren() {
|
42
46
|
if (lazyLoad) {
|
43
47
|
var lazyLoadProps = isBoolean(lazyLoad) ? defaultLazyLoadConfig : lazyLoad;
|
@@ -1,3 +1,4 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
|
1
|
+
import { ReactElement } from 'react';
|
2
|
+
import type { ListenerProps } from '../../propsType';
|
3
|
+
declare const Listener: ({ children, delayTime, excludes, ...props }: ListenerProps) => ReactElement;
|
4
|
+
export default Listener;
|
@@ -8,6 +8,11 @@ import React from 'react';
|
|
8
8
|
import { forceVisible } from 'react-lazyload';
|
9
9
|
import { useStep } from '../../index';
|
10
10
|
import { getLoadedMap } from '../../utils';
|
11
|
+
/**
|
12
|
+
* 检查错误列表并返回第一个错误项
|
13
|
+
* @param arr DOM元素数组
|
14
|
+
* @returns 错误元素信息
|
15
|
+
*/
|
11
16
|
var checkErrorList = function checkErrorList(arr) {
|
12
17
|
for (var i = 0; i < arr.length; i++) {
|
13
18
|
if (arr[i].className.includes('errored')) {
|
@@ -19,8 +24,12 @@ var checkErrorList = function checkErrorList(arr) {
|
|
19
24
|
}
|
20
25
|
return null;
|
21
26
|
};
|
27
|
+
/**
|
28
|
+
* 查找第一个错误的DOM元素
|
29
|
+
* @returns 错误元素信息
|
30
|
+
*/
|
22
31
|
var findFirstErrorDom = function findFirstErrorDom() {
|
23
|
-
var errorList = document.querySelectorAll('.pro-step-com-menu-item')
|
32
|
+
var errorList = document.querySelectorAll('.pro-step-com-menu-item');
|
24
33
|
var hasErrorItem = document.querySelectorAll('.pro-step-com-menu-item .errored');
|
25
34
|
var hasFormError = document.querySelector('.ant-form-item-explain-error');
|
26
35
|
if ((hasErrorItem === null || hasErrorItem === void 0 ? void 0 : hasErrorItem.length) && !hasFormError) {
|
@@ -28,13 +37,17 @@ var findFirstErrorDom = function findFirstErrorDom() {
|
|
28
37
|
}
|
29
38
|
return null;
|
30
39
|
};
|
31
|
-
|
40
|
+
/**
|
41
|
+
* 检查所有模块是否已加载完成
|
42
|
+
* @param data 模块加载数据
|
43
|
+
* @returns 是否所有模块都已加载
|
44
|
+
*/
|
32
45
|
var areAllModulesLoaded = function areAllModulesLoaded(data) {
|
33
46
|
return data.every(function (item) {
|
34
47
|
return (item === null || item === void 0 ? void 0 : item.loaded) === true;
|
35
48
|
});
|
36
49
|
};
|
37
|
-
|
50
|
+
var Listener = function Listener(_ref) {
|
38
51
|
var children = _ref.children,
|
39
52
|
delayTime = _ref.delayTime,
|
40
53
|
excludes = _ref.excludes,
|
@@ -88,4 +101,5 @@ export default (function (_ref) {
|
|
88
101
|
}, _callee);
|
89
102
|
})), 3000)
|
90
103
|
}));
|
91
|
-
}
|
104
|
+
};
|
105
|
+
export default Listener;
|
package/es/ProStep/index.d.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { ProStepType } from './propsType';
|
2
|
+
import { ProStepType, ProStepContextType } from './propsType';
|
3
3
|
import './style/index.less';
|
4
|
-
export declare const ProStepContext: import("react").Context<
|
5
|
-
export declare const useStep: () =>
|
4
|
+
export declare const ProStepContext: import("react").Context<ProStepContextType>;
|
5
|
+
export declare const useStep: () => Partial<ProStepContextType>;
|
6
6
|
declare const ProStep: {
|
7
|
-
({ children, ...resetProps }: ProStepType):
|
8
|
-
useStep: () =>
|
9
|
-
Item: ({ id, title, collapse: collapseItem, children, lazyLoad: stepLazyLoad, ...restProps }: import("./propsType").ProStepItemPropsType) =>
|
10
|
-
Listener: ({ children, delayTime, excludes, ...props }:
|
7
|
+
({ children, ...resetProps }: ProStepType): JSX.Element;
|
8
|
+
useStep: () => Partial<ProStepContextType>;
|
9
|
+
Item: ({ id, title, collapse: collapseItem, children, lazyLoad: stepLazyLoad, order, ...restProps }: import("./propsType").ProStepItemPropsType) => JSX.Element;
|
10
|
+
Listener: ({ children, delayTime, excludes, ...props }: import("./propsType").ListenerProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
11
11
|
};
|
12
12
|
export default ProStep;
|
package/es/ProStep/index.js
CHANGED
@@ -3,7 +3,8 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
6
|
-
var _excluded = ["children"]
|
6
|
+
var _excluded = ["children"],
|
7
|
+
_excluded2 = ["id", "form", "title", "validator", "order", "disabled", "lazyLoad"];
|
7
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
8
9
|
import { createContext, useCallback, useContext, useMemo, useRef, useState } from 'react';
|
9
10
|
import { debounce } from 'lodash';
|
@@ -13,6 +14,7 @@ import Step from './components/Step';
|
|
13
14
|
import Item from './components/Item';
|
14
15
|
import Listener from './components/Listener';
|
15
16
|
import './style/index.less';
|
17
|
+
// 创建上下文并提供类型
|
16
18
|
export var ProStepContext = /*#__PURE__*/createContext(null);
|
17
19
|
export var useStep = function useStep() {
|
18
20
|
return useContext(ProStepContext) || {};
|
@@ -75,7 +77,9 @@ var ProStep = function ProStep(_ref) {
|
|
75
77
|
title = _ref4.title,
|
76
78
|
validator = _ref4.validator,
|
77
79
|
order = _ref4.order,
|
78
|
-
disabled = _ref4.disabled
|
80
|
+
disabled = _ref4.disabled,
|
81
|
+
lazyLoad = _ref4.lazyLoad,
|
82
|
+
rest = _objectWithoutProperties(_ref4, _excluded2);
|
79
83
|
var record = {};
|
80
84
|
record.id = id;
|
81
85
|
record.title = title;
|
@@ -85,7 +89,7 @@ var ProStep = function ProStep(_ref) {
|
|
85
89
|
}
|
86
90
|
if (disabled) {
|
87
91
|
registerMap.current[id] = record;
|
88
|
-
return
|
92
|
+
return;
|
89
93
|
}
|
90
94
|
var subEvent = /*#__PURE__*/function () {
|
91
95
|
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|