@zat-design/sisyphus-react 3.4.7 → 3.4.8-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +6 -1
- package/dist/less.esm.css +6 -1
- package/es/ProEditTable/components/RenderField/index.js +4 -8
- package/es/ProEditTable/style/index.less +1 -1
- package/es/ProForm/components/base/TextArea/index.d.ts +1 -0
- package/es/ProForm/components/base/TextArea/index.js +4 -2
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +1 -1
- package/es/ProForm/components/combination/FormList/index.js +1 -1
- package/es/ProForm/components/combination/FormList/propsType.d.ts +1 -1
- package/es/ProForm/components/combination/FormList/utils.js +2 -3
- package/es/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.js +2 -2
- package/es/ProForm/components/combination/Group/index.d.ts +8 -2
- package/es/ProForm/components/combination/Group/index.js +57 -77
- package/es/ProForm/components/combination/Group/propsType.d.ts +27 -14
- package/es/ProForm/components/combination/Group/utils.d.ts +60 -7
- package/es/ProForm/components/combination/Group/utils.js +209 -19
- package/es/ProForm/components/combination/ProModalSelect/index.js +35 -29
- package/es/ProForm/components/combination/_Group/index.d.ts +4 -0
- package/es/ProForm/components/combination/_Group/index.js +109 -0
- package/es/ProForm/components/combination/_Group/propsType.d.ts +35 -0
- package/es/ProForm/components/combination/_Group/utils.d.ts +10 -0
- package/es/ProForm/components/combination/_Group/utils.js +46 -0
- package/es/ProForm/components/render/Render.js +10 -8
- package/es/ProForm/components/render/propsType.d.ts +2 -2
- package/es/ProForm/style/index.less +7 -0
- package/es/ProForm/utils/diffOriginal.js +2 -1
- package/es/ProForm/utils/index.d.ts +2 -0
- package/es/ProForm/utils/index.js +22 -1
- package/es/ProForm/utils/transformNames.js +3 -10
- package/es/ProForm/utils/useDeepCompareMemo.d.ts +2 -0
- package/es/ProForm/utils/useDeepCompareMemo.js +14 -0
- package/es/ProForm/utils/useForm.js +23 -13
- package/es/ProForm/utils/useListChanged.js +2 -2
- package/es/ProForm/utils/useRules.js +2 -20
- package/es/global.less +27 -8
- package/es/locale/zh_CN.js +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +4 -8
- package/lib/ProEditTable/style/index.less +1 -1
- package/lib/ProForm/components/base/TextArea/index.d.ts +1 -0
- package/lib/ProForm/components/base/TextArea/index.js +4 -2
- package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +1 -1
- package/lib/ProForm/components/combination/FormList/index.js +1 -1
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +1 -1
- package/lib/ProForm/components/combination/FormList/utils.js +2 -3
- package/lib/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.js +2 -2
- package/lib/ProForm/components/combination/Group/index.d.ts +8 -2
- package/lib/ProForm/components/combination/Group/index.js +55 -73
- package/lib/ProForm/components/combination/Group/propsType.d.ts +27 -14
- package/lib/ProForm/components/combination/Group/utils.d.ts +60 -7
- package/lib/ProForm/components/combination/Group/utils.js +210 -20
- package/lib/ProForm/components/combination/ProModalSelect/index.js +35 -29
- package/lib/ProForm/components/combination/_Group/index.d.ts +4 -0
- package/lib/ProForm/components/combination/_Group/index.js +113 -0
- package/lib/ProForm/components/combination/_Group/propsType.d.ts +35 -0
- package/lib/ProForm/components/combination/_Group/utils.d.ts +10 -0
- package/lib/ProForm/components/combination/_Group/utils.js +53 -0
- package/lib/ProForm/components/render/Render.js +9 -7
- package/lib/ProForm/components/render/propsType.d.ts +2 -2
- package/lib/ProForm/style/index.less +7 -0
- package/lib/ProForm/utils/diffOriginal.js +2 -1
- package/lib/ProForm/utils/index.d.ts +2 -0
- package/lib/ProForm/utils/index.js +25 -2
- package/lib/ProForm/utils/transformNames.js +2 -9
- package/lib/ProForm/utils/useDeepCompareMemo.d.ts +2 -0
- package/lib/ProForm/utils/useDeepCompareMemo.js +20 -0
- package/lib/ProForm/utils/useForm.js +22 -12
- package/lib/ProForm/utils/useListChanged.js +1 -1
- package/lib/ProForm/utils/useRules.js +2 -20
- package/lib/global.less +27 -8
- package/lib/locale/zh_CN.js +1 -1
- package/package.json +1 -1
- package/es/ProForm/components/combination/GroupCopy/index.d.ts +0 -10
- package/es/ProForm/components/combination/GroupCopy/index.js +0 -84
- package/es/ProForm/components/combination/GroupCopy/propsType.d.ts +0 -47
- package/es/ProForm/components/combination/GroupCopy/utils.d.ts +0 -53
- package/es/ProForm/components/combination/GroupCopy/utils.js +0 -180
- package/lib/ProForm/components/combination/GroupCopy/index.d.ts +0 -10
- package/lib/ProForm/components/combination/GroupCopy/index.js +0 -91
- package/lib/ProForm/components/combination/GroupCopy/propsType.d.ts +0 -47
- package/lib/ProForm/components/combination/GroupCopy/utils.d.ts +0 -53
- package/lib/ProForm/components/combination/GroupCopy/utils.js +0 -187
- /package/es/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.d.ts +0 -0
- /package/es/ProForm/components/combination/{GroupCopy → _Group}/propsType.js +0 -0
- /package/es/ProForm/components/combination/{GroupCopy → _Group}/style/index.less +0 -0
- /package/lib/ProForm/components/combination/{GroupCopy → Group}/component/ComRender.d.ts +0 -0
- /package/lib/ProForm/components/combination/{GroupCopy → _Group}/propsType.js +0 -0
- /package/lib/ProForm/components/combination/{GroupCopy → _Group}/style/index.less +0 -0
|
@@ -28,7 +28,7 @@ import { ProEditTableProps } from '../../../ProEditTable/propsType';
|
|
|
28
28
|
import { ProTreeModalProps } from '../../../ProTreeModal/propsType';
|
|
29
29
|
import { ProUploadProps } from '../../../ProUpload/propsType';
|
|
30
30
|
import { ProTreeProps } from '../../../ProTree/propsType';
|
|
31
|
-
import { GroupProps } from '../combination/Group/propsType';
|
|
31
|
+
import { GroupProps as GroupCopyProps } from '../combination/Group/propsType';
|
|
32
32
|
import { ProCollapseProps } from '../../../ProLayout/components/ProCollapse/PropTypes';
|
|
33
33
|
import { DistributiveOmit } from '../../propsType';
|
|
34
34
|
export type ComponentMap = keyof typeof componentMap;
|
|
@@ -159,7 +159,7 @@ export type ColumnPropsMap<Values = any, T = 'ProForm'> = {
|
|
|
159
159
|
fieldProps?: FieldProps<ProTreeProps, Values, T>;
|
|
160
160
|
} | {
|
|
161
161
|
type?: 'Group';
|
|
162
|
-
fieldProps?:
|
|
162
|
+
fieldProps?: GroupCopyProps | ReactiveFunction<Values, GroupCopyProps>;
|
|
163
163
|
} | {
|
|
164
164
|
type?: 'ProCollapse';
|
|
165
165
|
fieldProps?: ProCollapseProps | ReactiveFunction<Values, ProCollapseProps>;
|
|
@@ -140,6 +140,13 @@
|
|
|
140
140
|
|
|
141
141
|
// 地址组件
|
|
142
142
|
.@{ant-prefix}-form-item-control-input-content {
|
|
143
|
+
// 查看模式
|
|
144
|
+
& > span {
|
|
145
|
+
border-radius: 4px;
|
|
146
|
+
padding: 5px 8px;
|
|
147
|
+
background: @zaui-contract-bg;
|
|
148
|
+
}
|
|
149
|
+
|
|
143
150
|
& > .pro-address {
|
|
144
151
|
.@{ant-prefix}-select-selector,
|
|
145
152
|
.@{ant-prefix}-input-affix-wrapper,
|
|
@@ -40,7 +40,8 @@ export var diffOriginal = function diffOriginal(params) {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
if (!nullValue.includes(value) || !nullValue.includes(originalValue)) {
|
|
43
|
-
|
|
43
|
+
var res = !isEqual(value, originalValue);
|
|
44
|
+
return res;
|
|
44
45
|
}
|
|
45
46
|
return false;
|
|
46
47
|
};
|
|
@@ -95,4 +95,6 @@ export declare const findOptionByValue: (treeData: any[], value: string | number
|
|
|
95
95
|
export declare const equalDependencies: (dependencies: any, prevValues: any, currentValues: any) => any;
|
|
96
96
|
/** 解析namePath */
|
|
97
97
|
export declare const parseNamePath: (input: string) => any;
|
|
98
|
+
/** 解析namePath */
|
|
99
|
+
export declare function findNamesKeyInArray(arr: string[], key: string): string | null;
|
|
98
100
|
export {};
|
|
@@ -434,4 +434,25 @@ export var parseNamePath = function parseNamePath(input) {
|
|
|
434
434
|
return isNaN(Number(item)) ? item : Number(item);
|
|
435
435
|
});
|
|
436
436
|
return [result];
|
|
437
|
-
};
|
|
437
|
+
};
|
|
438
|
+
/** 解析namePath */
|
|
439
|
+
export function findNamesKeyInArray(arr, key) {
|
|
440
|
+
var _iterator2 = _createForOfIteratorHelper(arr),
|
|
441
|
+
_step2;
|
|
442
|
+
try {
|
|
443
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
444
|
+
var item = _step2.value;
|
|
445
|
+
if (!item.includes('_')) {
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
448
|
+
if (item.split('_')[0].includes(key)) {
|
|
449
|
+
return item;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
} catch (err) {
|
|
453
|
+
_iterator2.e(err);
|
|
454
|
+
} finally {
|
|
455
|
+
_iterator2.f();
|
|
456
|
+
}
|
|
457
|
+
return null;
|
|
458
|
+
}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import { union
|
|
1
|
+
import { union } from 'lodash';
|
|
2
2
|
import { transformValue } from './transformValue';
|
|
3
3
|
var transformNames = function transformNames(formItem, form, names, fieldName, type) {
|
|
4
|
-
var _names2, _names3, _names3$;
|
|
5
4
|
var _ref = formItem || {},
|
|
6
5
|
normalize = _ref.normalize,
|
|
7
6
|
getValueProps = _ref.getValueProps,
|
|
8
7
|
_shouldUpdate2 = _ref.shouldUpdate;
|
|
9
|
-
|
|
10
|
-
if (!((_names2 = _names) === null || _names2 === void 0 ? void 0 : _names2.length)) {
|
|
8
|
+
if (!(names === null || names === void 0 ? void 0 : names.length)) {
|
|
11
9
|
return {};
|
|
12
10
|
}
|
|
13
11
|
// 当在formList场景下,给transformValue函数的setFiledProps的name, 需要全namePath
|
|
14
12
|
var _fieldName = Array.isArray(formItem === null || formItem === void 0 ? void 0 : formItem.name) ? union(formItem === null || formItem === void 0 ? void 0 : formItem.namePath, formItem === null || formItem === void 0 ? void 0 : formItem.name) : fieldName;
|
|
15
|
-
|
|
16
|
-
_names = _names.map(function (item) {
|
|
17
|
-
return union(formItem === null || formItem === void 0 ? void 0 : formItem.namePath, item);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
var _transformValue = transformValue(_names, form, _fieldName, normalize, getValueProps),
|
|
13
|
+
var _transformValue = transformValue(names, form, _fieldName, normalize, getValueProps),
|
|
21
14
|
_normalize = _transformValue.normalize,
|
|
22
15
|
_getValueProps = _transformValue.getValueProps,
|
|
23
16
|
_shouldUpdate = _transformValue.shouldUpdate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
import { isEqualWith } from 'lodash';
|
|
3
|
+
import { customEqualForFun } from '.';
|
|
4
|
+
/** 深度比较依赖变化memo */
|
|
5
|
+
export var useDeepCompareMemo = function useDeepCompareMemo(fun, depList) {
|
|
6
|
+
var lastDependency = useRef(); // 上一次的依赖
|
|
7
|
+
var lastRes = useRef(); // 上一次的结果
|
|
8
|
+
if (!isEqualWith(depList, lastDependency.current, customEqualForFun)) {
|
|
9
|
+
var res = fun();
|
|
10
|
+
lastRes.current = res;
|
|
11
|
+
}
|
|
12
|
+
lastDependency.current = depList;
|
|
13
|
+
return lastRes.current;
|
|
14
|
+
};
|
|
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
|
3
3
|
import "antd/es/form/style";
|
|
4
4
|
import _Form from "antd/es/form";
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
|
-
import { filterInternalFields } from './index';
|
|
6
|
+
import { filterInternalFields, findNamesKeyInArray } from './index';
|
|
7
7
|
export var useForm = function useForm(originForm) {
|
|
8
8
|
var _Form$useForm = _Form.useForm(originForm),
|
|
9
9
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
@@ -24,6 +24,8 @@ export var useForm = function useForm(originForm) {
|
|
|
24
24
|
var _len,
|
|
25
25
|
rest,
|
|
26
26
|
_key,
|
|
27
|
+
_form$getFieldsError,
|
|
28
|
+
hasNames,
|
|
27
29
|
values,
|
|
28
30
|
_values,
|
|
29
31
|
_error$errorFields,
|
|
@@ -32,25 +34,33 @@ export var useForm = function useForm(originForm) {
|
|
|
32
34
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
33
35
|
while (1) switch (_context.prev = _context.next) {
|
|
34
36
|
case 0:
|
|
35
|
-
_context.prev = 0;
|
|
36
37
|
for (_len = _args.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
37
38
|
rest[_key - 1] = _args[_key];
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
// 区域性校验,且配置了nameList和names时
|
|
41
|
+
if (Array.isArray(nameList)) {
|
|
42
|
+
hasNames = (_form$getFieldsError = form.getFieldsError()) === null || _form$getFieldsError === void 0 ? void 0 : _form$getFieldsError.filter(function (item) {
|
|
43
|
+
return findNamesKeyInArray(item.name, nameList[0]) !== null;
|
|
44
|
+
});
|
|
45
|
+
if (hasNames.length) {
|
|
46
|
+
hasNames.forEach(function (item) {
|
|
47
|
+
validateFields.apply(void 0, [item.name].concat(rest));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
_context.prev = 2;
|
|
52
|
+
values = validateFields.apply(void 0, [nameList].concat(rest));
|
|
43
53
|
if (!nameList) {
|
|
44
|
-
_context.next =
|
|
54
|
+
_context.next = 6;
|
|
45
55
|
break;
|
|
46
56
|
}
|
|
47
57
|
return _context.abrupt("return", values);
|
|
48
|
-
case
|
|
58
|
+
case 6:
|
|
49
59
|
_values = _getFieldsValue();
|
|
50
60
|
return _context.abrupt("return", _values);
|
|
51
|
-
case
|
|
52
|
-
_context.prev =
|
|
53
|
-
_context.t0 = _context["catch"](
|
|
61
|
+
case 10:
|
|
62
|
+
_context.prev = 10;
|
|
63
|
+
_context.t0 = _context["catch"](2);
|
|
54
64
|
if (_context.t0 && (_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.errorFields)) {
|
|
55
65
|
form === null || form === void 0 ? void 0 : form.scrollToField(_context.t0 === null || _context.t0 === void 0 ? void 0 : (_error$errorFields = _context.t0.errorFields) === null || _error$errorFields === void 0 ? void 0 : (_error$errorFields$ = _error$errorFields[0]) === null || _error$errorFields$ === void 0 ? void 0 : _error$errorFields$.name, {
|
|
56
66
|
block: 'center',
|
|
@@ -58,11 +68,11 @@ export var useForm = function useForm(originForm) {
|
|
|
58
68
|
});
|
|
59
69
|
}
|
|
60
70
|
throw _context.t0;
|
|
61
|
-
case
|
|
71
|
+
case 14:
|
|
62
72
|
case "end":
|
|
63
73
|
return _context.stop();
|
|
64
74
|
}
|
|
65
|
-
}, _callee, null, [[
|
|
75
|
+
}, _callee, null, [[2, 10]]);
|
|
66
76
|
}));
|
|
67
77
|
return function _validateFields(_x) {
|
|
68
78
|
return _ref.apply(this, arguments);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "antd/es/form/style";
|
|
2
2
|
import _Form from "antd/es/form";
|
|
3
|
-
import { get } from 'lodash';
|
|
3
|
+
import { get, isString } from 'lodash';
|
|
4
4
|
import { diffOriginal } from './diffOriginal';
|
|
5
5
|
var toNamePath = function toNamePath(name) {
|
|
6
6
|
if (Array.isArray(name)) {
|
|
@@ -87,7 +87,7 @@ export var useListChanged = function useListChanged(params) {
|
|
|
87
87
|
originalValue: originalValue,
|
|
88
88
|
form: form,
|
|
89
89
|
equalWith: equalWith,
|
|
90
|
-
name: namesStr || name
|
|
90
|
+
name: isString(namesStr) ? namesStr : originalName || name
|
|
91
91
|
});
|
|
92
92
|
return [changed, originalValue];
|
|
93
93
|
};
|
|
@@ -24,10 +24,6 @@ var useRules = function useRules(props) {
|
|
|
24
24
|
var result = {
|
|
25
25
|
rules: rules || []
|
|
26
26
|
};
|
|
27
|
-
// Group required: true时,直接走完整校验
|
|
28
|
-
if (allRequired && type === 'Group') {
|
|
29
|
-
return result;
|
|
30
|
-
}
|
|
31
27
|
if (allRequired) {
|
|
32
28
|
if (!requiredRule) {
|
|
33
29
|
var message = isSelect ? "".concat(locale.ProForm.selectPlaceHolder).concat(_label) : "".concat(locale.ProForm.inputPlaceholder).concat(_label);
|
|
@@ -58,23 +54,9 @@ var useRules = function useRules(props) {
|
|
|
58
54
|
required: required
|
|
59
55
|
});
|
|
60
56
|
useEffect(function () {
|
|
61
|
-
if (type === 'Group' && (allRequired || requiredRule)) {
|
|
62
|
-
var customRequired = {
|
|
63
|
-
validator: function validator(rules, value) {
|
|
64
|
-
// 完整性校验, 数组有值且值不完整则校验不通过
|
|
65
|
-
if (Array.isArray(value) && isNotFullArray(value, names.length, required)) {
|
|
66
|
-
return Promise.reject(new Error("".concat(locale.ProForm.completeText).concat(_label)));
|
|
67
|
-
}
|
|
68
|
-
return Promise.resolve();
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
// 插入rules第一条,完整性校验大于自定义
|
|
72
|
-
internalRule.rules.unshift(customRequired);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
57
|
// 添加完整性校验
|
|
76
58
|
if (names && !isBoolean(labelRequired)) {
|
|
77
|
-
var
|
|
59
|
+
var customRequired = {
|
|
78
60
|
validator: function validator(rules, value) {
|
|
79
61
|
// 完整性校验, 空数组不校验, 数组有值且值不完整则校验不通过
|
|
80
62
|
if (Array.isArray(value) && !isNullArray(value) && isNotFullArray(value, names.length, required)) {
|
|
@@ -83,7 +65,7 @@ var useRules = function useRules(props) {
|
|
|
83
65
|
return Promise.resolve();
|
|
84
66
|
}
|
|
85
67
|
};
|
|
86
|
-
internalRule.rules.unshift(
|
|
68
|
+
internalRule.rules.unshift(customRequired);
|
|
87
69
|
}
|
|
88
70
|
}, [internalRule]);
|
|
89
71
|
return internalRule;
|
package/es/global.less
CHANGED
|
@@ -9,13 +9,21 @@ pre {
|
|
|
9
9
|
scrollbar-face-color: #d2d3d7;
|
|
10
10
|
scrollbar-highlight-color: #979797;
|
|
11
11
|
scrollbar-3dlight-color: #979797;
|
|
12
|
+
|
|
12
13
|
::-webkit-scrollbar {
|
|
13
14
|
width: 16px;
|
|
15
|
+
background: transparent;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
//
|
|
17
|
-
::-webkit-scrollbar-
|
|
18
|
-
background-color: #
|
|
18
|
+
// 轨道
|
|
19
|
+
::-webkit-scrollbar-track {
|
|
20
|
+
background-color: #fff;
|
|
21
|
+
border-radius: 10px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 悬浮轨道
|
|
25
|
+
::-webkit-scrollbar-thumb:hover {
|
|
26
|
+
background-color: #979797;
|
|
19
27
|
background-clip: padding-box;
|
|
20
28
|
border-color: transparent;
|
|
21
29
|
border-style: dashed;
|
|
@@ -24,14 +32,25 @@ pre {
|
|
|
24
32
|
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
|
25
33
|
}
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
:hover::-webkit-scrollbar-track {
|
|
36
|
+
background: transparent;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:hover::-webkit-scrollbar-thumb {
|
|
40
|
+
background-color: #d2d3d7;
|
|
41
|
+
background-clip: padding-box;
|
|
42
|
+
border-color: transparent;
|
|
43
|
+
border-style: dashed;
|
|
44
|
+
border-width: 4px;
|
|
30
45
|
border-radius: 10px;
|
|
46
|
+
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
|
|
31
47
|
}
|
|
32
48
|
|
|
33
|
-
|
|
34
|
-
::-webkit-scrollbar-thumb:hover {
|
|
49
|
+
:hover::-webkit-scrollbar-thumb:hover {
|
|
35
50
|
background-color: #979797;
|
|
36
51
|
}
|
|
52
|
+
|
|
53
|
+
:hover::-webkit-scrollbar-track {
|
|
54
|
+
background-color: #fff;
|
|
55
|
+
}
|
|
37
56
|
}
|
package/es/locale/zh_CN.js
CHANGED
|
@@ -318,7 +318,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
318
318
|
}
|
|
319
319
|
_args = [].concat(args);
|
|
320
320
|
rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
|
|
321
|
-
row =
|
|
321
|
+
row = form.getFieldValue(rowPath, true);
|
|
322
322
|
orgRow = (0, _lodash.cloneDeep)(row);
|
|
323
323
|
if (!onFieldChange) {
|
|
324
324
|
_context.next = 18;
|
|
@@ -363,7 +363,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
363
363
|
return onChange.apply(void 0, (0, _toConsumableArray2.default)(_args));
|
|
364
364
|
case 27:
|
|
365
365
|
// 判断属性是否变动
|
|
366
|
-
|
|
366
|
+
form.setFieldValue(rowPath, row);
|
|
367
367
|
if (!(0, _lodash.isEqual)(orgRow, row)) {
|
|
368
368
|
diff = (0, _tools.difference)(row, orgRow) || {};
|
|
369
369
|
validateFieldKeys = (_Object$keys = Object.keys(diff)) === null || _Object$keys === void 0 ? void 0 : (_Object$keys$map = _Object$keys.map) === null || _Object$keys$map === void 0 ? void 0 : _Object$keys$map.call(_Object$keys, function (key) {
|
|
@@ -409,7 +409,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
409
409
|
}
|
|
410
410
|
_args = formatArgs([].concat(args));
|
|
411
411
|
rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
|
|
412
|
-
row =
|
|
412
|
+
row = form.getFieldValue(rowPath, true);
|
|
413
413
|
orgRow = (0, _lodash.cloneDeep)(row);
|
|
414
414
|
_args[1] = row;
|
|
415
415
|
_context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
|
|
@@ -500,11 +500,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
500
500
|
isView: isView
|
|
501
501
|
}
|
|
502
502
|
});
|
|
503
|
-
|
|
504
|
-
componentProps.onFieldChange = _onchange;
|
|
505
|
-
} else {
|
|
506
|
-
componentProps = (0, _lodash.omit)(componentProps, ['onFieldChange', 'namePath', 'index']);
|
|
507
|
-
}
|
|
503
|
+
componentProps = (0, _lodash.omit)(componentProps, ['onFieldChange', 'namePath', 'index']);
|
|
508
504
|
// 单元格编辑时,设置各个单元格disabled属性
|
|
509
505
|
if (isCell) {
|
|
510
506
|
record["".concat(dataIndex, "-Disabled")] = _disabled;
|
|
@@ -17,12 +17,14 @@ var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
|
17
17
|
var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
|
18
18
|
var _Container = _interopRequireDefault(require("../../Container"));
|
|
19
19
|
require("./index.less");
|
|
20
|
-
var _excluded = ["placeholder", "otherProps", "className"];
|
|
20
|
+
var _excluded = ["placeholder", "otherProps", "className", "tooltip"];
|
|
21
21
|
var TextArea = _antd.Input.TextArea;
|
|
22
22
|
var TextAreaDef = function TextAreaDef(props) {
|
|
23
23
|
var placeholder = props.placeholder,
|
|
24
24
|
otherProps = props.otherProps,
|
|
25
25
|
className = props.className,
|
|
26
|
+
_props$tooltip = props.tooltip,
|
|
27
|
+
tooltip = _props$tooltip === void 0 ? true : _props$tooltip,
|
|
26
28
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
27
29
|
var _ref = _ProForm.default.useFieldProps() || {},
|
|
28
30
|
label = _ref.label,
|
|
@@ -33,7 +35,7 @@ var TextAreaDef = function TextAreaDef(props) {
|
|
|
33
35
|
if (isView) {
|
|
34
36
|
return (0, _jsxRuntime.jsx)(_Container.default, {
|
|
35
37
|
nowrap: false,
|
|
36
|
-
tooltip:
|
|
38
|
+
tooltip: tooltip,
|
|
37
39
|
viewEmpty: viewEmpty,
|
|
38
40
|
children: rest.value
|
|
39
41
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColProps, FormListFieldData } from 'antd';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { InternalNamePath } from 'antd/es/form/interface';
|
|
4
|
-
import type { levelType } from '
|
|
4
|
+
import type { levelType } from '../../../../../ProLayout/components/ProCollapse/PropTypes';
|
|
5
5
|
import type { FormListProps } from '../propsType';
|
|
6
6
|
interface Props extends Omit<FormListProps, 'toolbarProps'> {
|
|
7
7
|
index: number;
|
|
@@ -54,7 +54,7 @@ var FormList = function FormList(props, ref) {
|
|
|
54
54
|
name: _name,
|
|
55
55
|
names: (item === null || item === void 0 ? void 0 : item.names) ? item.names.map(function (nameItem) {
|
|
56
56
|
// 传给Group的names会被渲染成真实FormItem 不能传完整name
|
|
57
|
-
return
|
|
57
|
+
return [].concat((0, _toConsumableArray2.default)(namePath), (0, _toConsumableArray2.default)((0, _utils.toArray)(nameItem)));
|
|
58
58
|
}) : item.names,
|
|
59
59
|
index: fieldName,
|
|
60
60
|
namePath: namePath,
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { FormInstance } from 'antd/es/form/Form';
|
|
3
3
|
import type { ButtonProps, FormListFieldData, FormListOperation, PopconfirmProps } from 'antd';
|
|
4
4
|
import type { InternalNamePath } from 'antd/es/form/interface';
|
|
5
|
-
import type { levelType } from '
|
|
5
|
+
import type { levelType } from '../../../../ProLayout/components/ProCollapse/PropTypes';
|
|
6
6
|
import type { ProColumnProps, ProFormOtherProps } from '../../../propsType';
|
|
7
7
|
export type TitleRender = (record: Record<string, any>, index: number, form: FormInstance) => any;
|
|
8
8
|
export type TitleType = string | React.ReactNode | TitleRender;
|
|
@@ -14,12 +14,11 @@ var namesPathTransform = exports.namesPathTransform = function namesPathTransfor
|
|
|
14
14
|
var names = _ref.names,
|
|
15
15
|
prefixNamePath = _ref.prefixNamePath,
|
|
16
16
|
type = _ref.type;
|
|
17
|
-
if (!Array.isArray(names) ||
|
|
17
|
+
if (!Array.isArray(names) || !Array.isArray(prefixNamePath)) {
|
|
18
18
|
return '';
|
|
19
19
|
}
|
|
20
|
-
var _prefixNamePath = type === 'Group' ? '' : prefixNamePath;
|
|
21
20
|
var newNamePath = names.map(function (val) {
|
|
22
|
-
return
|
|
21
|
+
return prefixNamePath.concat(val);
|
|
23
22
|
});
|
|
24
23
|
return newNamePath === null || newNamePath === void 0 ? void 0 : newNamePath.map(function (name) {
|
|
25
24
|
return Array.isArray(name) ? name.join('_') : name;
|
|
@@ -10,8 +10,8 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
var _ConfirmWrapper = _interopRequireDefault(require("
|
|
14
|
-
var _useFieldProps = require("
|
|
13
|
+
var _ConfirmWrapper = _interopRequireDefault(require("../../../../components/render/ConfirmWrapper"));
|
|
14
|
+
var _useFieldProps = require("../../../../utils/useFieldProps");
|
|
15
15
|
var componentMap = _interopRequireWildcard(require("../../../../../index"));
|
|
16
16
|
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps"];
|
|
17
17
|
/** 渲染组件 */
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { GroupProps } from './propsType';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* 1. 外层过滤FormItem相关属性, 但是子元素上的 required [disabled] [show] rules [fieldProps] [component] 需要取到并
|
|
5
|
+
* 2.
|
|
6
|
+
*
|
|
7
|
+
* render内部能力 show, component, value, onChange, disabled, clearNotShow, fieldProps
|
|
8
|
+
*/
|
|
9
|
+
declare const GroupCopy: React.FC<GroupProps>;
|
|
10
|
+
export default GroupCopy;
|