@formily-design/formily-antd 1.0.21 → 1.0.22
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/esm/components/Cascader/preview.js +82 -3
- package/esm/components/DatePicker/preview.js +15 -35
- package/esm/components/Field/valueMapping.d.ts +69 -36
- package/esm/components/Field/valueMapping.js +194 -84
- package/esm/locales/Cascader.d.ts +39 -0
- package/esm/locales/Cascader.js +39 -0
- package/esm/locales/DatePicker.js +6 -6
- package/esm/schemas/Cascader.js +5 -0
- package/lib/components/Cascader/preview.js +81 -2
- package/lib/components/DatePicker/preview.js +14 -34
- package/lib/components/Field/valueMapping.d.ts +69 -36
- package/lib/components/Field/valueMapping.js +195 -84
- package/lib/locales/Cascader.d.ts +39 -0
- package/lib/locales/Cascader.js +39 -0
- package/lib/locales/DatePicker.js +6 -6
- package/lib/schemas/Cascader.js +5 -0
- package/package.json +8 -8
|
@@ -1,109 +1,149 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createValueMappingSettingsReaction = exports.validateValueMappingTargetPaths = void 0;
|
|
14
|
+
exports.createValueMappingGroup = exports.createValueMappingSettingsReaction = exports.validateValueMappingTargetPaths = void 0;
|
|
4
15
|
const reactive_1 = require("@formily/reactive");
|
|
5
16
|
const core_1 = require("@formily-design/core");
|
|
6
|
-
|
|
17
|
+
/** 防止清空字段时 reaction 的同步更新与异步清理互相重复。 */
|
|
7
18
|
const pendingMappingCleanups = new WeakSet();
|
|
19
|
+
/** 只有输入过非空文本才显示“不完整”字段的校验反馈。 */
|
|
8
20
|
const hasInputText = (value) => typeof value === 'string' && Boolean(value.trim());
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* 空数组表示尚未启用映射;一旦任意路径有值,所有 target 都必须填写、合法且唯一。
|
|
13
|
-
* 该方法与具体组件数量无关,日期范围、省市区等配置界面均可复用。
|
|
14
|
-
*/
|
|
15
|
-
const validateValueMappingTargetPaths = (paths) => (0, core_1.validateValueMappingTargetPaths)(paths, { allowEmpty: true });
|
|
21
|
+
const validateValueMappingTargetPaths = (paths, allowEmpty = true) =>
|
|
22
|
+
// 设置器允许固定字段全部为空来表达删除配置;动态字段则由调用方传入对应规则。
|
|
23
|
+
(0, core_1.validateValueMappingFieldPaths)(paths, { allowEmpty });
|
|
16
24
|
exports.validateValueMappingTargetPaths = validateValueMappingTargetPaths;
|
|
17
|
-
/**
|
|
18
|
-
const
|
|
19
|
-
|
|
25
|
+
/** 将静态值或组件属性中的 truthy 值统一映射为协议 cardinality。 */
|
|
26
|
+
const getCardinality = (form, cardinality) => {
|
|
27
|
+
if (typeof cardinality === 'string')
|
|
28
|
+
return cardinality;
|
|
29
|
+
return form.getValuesIn(cardinality.path)
|
|
30
|
+
? core_1.VALUE_MAPPING_CARDINALITY_MULTIPLE
|
|
31
|
+
: core_1.VALUE_MAPPING_CARDINALITY_SINGLE;
|
|
32
|
+
};
|
|
33
|
+
/** 在写入协议前解析静态 target 或组件提供的动态 target。 */
|
|
34
|
+
const resolveTarget = (form, cardinality, target) => {
|
|
35
|
+
if ('resolve' in target) {
|
|
36
|
+
return target.resolve({ form, cardinality });
|
|
37
|
+
}
|
|
38
|
+
return target;
|
|
39
|
+
};
|
|
40
|
+
/** 读取设置器当前字段值,并同时返回用于反馈错误的字段路径。 */
|
|
41
|
+
const getFieldSettings = (form, fields) => {
|
|
42
|
+
if (fields.type === 'fixed') {
|
|
43
|
+
// 通过 query 优先读取已注册字段值,兼容设置器字段尚未注册时的 form 值。
|
|
44
|
+
return {
|
|
45
|
+
values: fields.paths.map((path) => {
|
|
46
|
+
let fieldValue;
|
|
47
|
+
form.query(path).take((field) => {
|
|
48
|
+
fieldValue = field === null || field === void 0 ? void 0 : field.value;
|
|
49
|
+
});
|
|
50
|
+
return fieldValue === undefined ? form.getValuesIn(path) : fieldValue;
|
|
51
|
+
}),
|
|
52
|
+
paths: fields.paths,
|
|
53
|
+
dynamic: false,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
// 动态字段的每一行都映射到协议中的一个 fields 项,路径顺序必须保持一致。
|
|
57
|
+
const current = form.getValuesIn(fields.path);
|
|
58
|
+
const values = Array.isArray(current) ? current : [];
|
|
59
|
+
return {
|
|
60
|
+
values: values.map((item) => item === null || item === void 0 ? void 0 : item.path),
|
|
61
|
+
paths: values.map((_, index) => `${fields.path}.${index}.path`),
|
|
62
|
+
dynamic: true,
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const syncValueMappingProtocol = (form, values, adapter, cardinality, target, fields) => {
|
|
66
|
+
// 协议只保存规范化后的 path;设置器仍保留同一顺序,便于 ArrayItems 增删和排序。
|
|
67
|
+
const normalizedFields = values.map((path) => ({
|
|
20
68
|
path: typeof path === 'string' ? path.trim() : '',
|
|
21
69
|
}));
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
form.setValuesIn(`${core_1.VALUE_MAPPING_SCHEMA_KEY}.targets`, normalizedTargets);
|
|
29
|
-
}
|
|
30
|
-
const setProtocolValue = (path, value) => {
|
|
31
|
-
if (form.getValuesIn(path) !== value) {
|
|
32
|
-
form.setValuesIn(path, value);
|
|
70
|
+
const targetValue = target.type === core_1.VALUE_MAPPING_TARGET_FIELDS
|
|
71
|
+
? {
|
|
72
|
+
type: core_1.VALUE_MAPPING_TARGET_FIELDS,
|
|
73
|
+
scope: target.scope,
|
|
74
|
+
fields: normalizedFields,
|
|
75
|
+
includeSource: target.includeSource === true,
|
|
33
76
|
}
|
|
77
|
+
: {
|
|
78
|
+
type: core_1.VALUE_MAPPING_TARGET_OBJECT,
|
|
79
|
+
scope: target.scope,
|
|
80
|
+
fields: normalizedFields,
|
|
81
|
+
};
|
|
82
|
+
const next = {
|
|
83
|
+
version: core_1.VALUE_MAPPING_VERSION,
|
|
84
|
+
adapter,
|
|
85
|
+
cardinality,
|
|
86
|
+
target: targetValue,
|
|
34
87
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
88
|
+
const current = form.getValuesIn(core_1.VALUE_MAPPING_SCHEMA_KEY);
|
|
89
|
+
// 避免 reaction 在每次运行时重复写入,减少设置表单的二次 reaction。
|
|
90
|
+
if (JSON.stringify(current) !== JSON.stringify(next)) {
|
|
91
|
+
form.setValuesIn(core_1.VALUE_MAPPING_SCHEMA_KEY, next);
|
|
92
|
+
}
|
|
93
|
+
// 动态 ArrayItems 需要保持用户对字段顺序的修改;协议本身与设置数组共用同一顺序。
|
|
94
|
+
if (fields.type === 'dynamic') {
|
|
95
|
+
const currentFields = form.getValuesIn(fields.path);
|
|
96
|
+
if (JSON.stringify(currentFields) !== JSON.stringify(normalizedFields)) {
|
|
97
|
+
form.setValuesIn(fields.path, normalizedFields);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
39
100
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
form.query(path).take((
|
|
44
|
-
if (!(
|
|
101
|
+
const syncValueMappingErrors = (form, paths, values, error, message, dynamic) => {
|
|
102
|
+
// 动态行需要立即提示空项;固定字段只有在用户输入过时才提示 incomplete。
|
|
103
|
+
paths.forEach((path, index) => {
|
|
104
|
+
form.query(path).take((field) => {
|
|
105
|
+
if (!(field === null || field === void 0 ? void 0 : field.setSelfErrors))
|
|
45
106
|
return;
|
|
46
|
-
const hasInput = hasInputText(
|
|
47
|
-
const
|
|
48
|
-
|
|
107
|
+
const hasInput = hasInputText(values[index]);
|
|
108
|
+
const show = Boolean(error && (dynamic || error !== 'incomplete' || hasInput));
|
|
109
|
+
field.setSelfErrors(show && message ? [message] : []);
|
|
49
110
|
});
|
|
50
111
|
});
|
|
51
112
|
};
|
|
113
|
+
const shouldDeleteMapping = (values, fields) => {
|
|
114
|
+
// 动态字段“零行”与固定字段“所有值为空”都表示移除完整协议。
|
|
115
|
+
if (fields.type === 'dynamic') {
|
|
116
|
+
return values.length === 0;
|
|
117
|
+
}
|
|
118
|
+
return values.every((value) => !hasInputText(value));
|
|
119
|
+
};
|
|
52
120
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* 看到的值与主 reaction 不一致。
|
|
56
|
-
*/
|
|
57
|
-
const readValueMappingTargetValues = (form, targetPaths) => targetPaths.map((path) => {
|
|
58
|
-
let hasField = false;
|
|
59
|
-
let fieldValue;
|
|
60
|
-
// 使用 take callback 兼容 Formily Query 和设置表单测试/动态节点实现。
|
|
61
|
-
form.query(path).take((targetField) => {
|
|
62
|
-
hasField = Boolean(targetField);
|
|
63
|
-
fieldValue = targetField === null || targetField === void 0 ? void 0 : targetField.value;
|
|
64
|
-
});
|
|
65
|
-
const fallbackValue = form.getValuesIn(path);
|
|
66
|
-
return hasField && fieldValue !== undefined ? fieldValue : fallbackValue;
|
|
67
|
-
});
|
|
68
|
-
/**
|
|
69
|
-
* 创建设置表单使用的 value-mapping 协议与校验 reaction。
|
|
70
|
-
*
|
|
71
|
-
* 协议和反馈必须由一个 autorun 编排。若分别挂两个 x-reactions,它们对同一
|
|
72
|
-
* 次 onInput 的调度顺序不稳定:协议 reaction 规范化数字路径时会再次写值,
|
|
73
|
-
* 校验 reaction 可能拿到中间快照,导致残留错误或覆盖刚写入的配置。本 reaction
|
|
74
|
-
* 先读取一次 targetValues,再同步反馈和协议,保证二者始终对应同一组输入。
|
|
75
|
-
*
|
|
76
|
-
* target 全空时先同步清除反馈,让界面立即恢复;父级协议延迟到当前 onInput/batch
|
|
77
|
-
* 结束后的 Promise 微任务再删除。微任务执行前会重新读取最新 target:若用户已快速
|
|
78
|
-
* 重新输入则跳过删除,避免旧 cleanup 误删。按 Form 隔离的 WeakSet 会合并同一 Form
|
|
79
|
-
* 的重复 cleanup,同时不会影响其它设置 Form。
|
|
121
|
+
* 创建统一处理协议同步、动态字段和校验反馈的设置 reaction。
|
|
122
|
+
* reaction 先读取设置状态,再决定删除协议、反馈错误或写入 canonical v1 协议。
|
|
80
123
|
*/
|
|
81
|
-
const createValueMappingSettingsReaction = ({ adapter,
|
|
124
|
+
const createValueMappingSettingsReaction = ({ adapter, fields, cardinality, target, getMessage, }) => {
|
|
82
125
|
return (_field, reactionScope) => {
|
|
83
126
|
const form = reactionScope === null || reactionScope === void 0 ? void 0 : reactionScope.$form;
|
|
84
127
|
if (!form)
|
|
85
128
|
return;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const error = (0, exports.validateValueMappingTargetPaths)(targetValues);
|
|
129
|
+
const settings = getFieldSettings(form, fields);
|
|
130
|
+
const error = (0, core_1.validateValueMappingFieldPaths)(settings.values, {
|
|
131
|
+
allowEmpty: fields.type === 'fixed',
|
|
132
|
+
});
|
|
91
133
|
const message = error ? getMessage(error, reactionScope) : undefined;
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
134
|
+
const empty = shouldDeleteMapping(settings.values, fields);
|
|
135
|
+
(0, reactive_1.untracked)(() => {
|
|
136
|
+
syncValueMappingErrors(form, settings.paths, settings.values, error, message, settings.dynamic);
|
|
137
|
+
});
|
|
138
|
+
if (empty) {
|
|
139
|
+
// 清空操作可能触发多次 reaction,放到微任务中读取最新状态后再删除协议。
|
|
98
140
|
if (form.getValuesIn(core_1.VALUE_MAPPING_SCHEMA_KEY) !== undefined &&
|
|
99
141
|
!pendingMappingCleanups.has(form)) {
|
|
100
142
|
pendingMappingCleanups.add(form);
|
|
101
143
|
Promise.resolve().then(() => {
|
|
102
144
|
pendingMappingCleanups.delete(form);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const latestHasTarget = latestTargetValues.some(hasInputText);
|
|
106
|
-
if (!latestHasTarget &&
|
|
145
|
+
const latest = getFieldSettings(form, fields);
|
|
146
|
+
if (shouldDeleteMapping(latest.values, fields) &&
|
|
107
147
|
form.getValuesIn(core_1.VALUE_MAPPING_SCHEMA_KEY) !== undefined) {
|
|
108
148
|
form.deleteValuesIn(core_1.VALUE_MAPPING_SCHEMA_KEY);
|
|
109
149
|
}
|
|
@@ -111,12 +151,83 @@ const createValueMappingSettingsReaction = ({ adapter, targetPaths, scope = core
|
|
|
111
151
|
}
|
|
112
152
|
return;
|
|
113
153
|
}
|
|
114
|
-
|
|
115
|
-
//
|
|
116
|
-
(
|
|
117
|
-
syncValueMappingErrors(form, targetPaths, targetValues, error, message);
|
|
118
|
-
});
|
|
119
|
-
syncValueMappingProtocol(form, targetValues, adapter, scope, submitSource);
|
|
154
|
+
const currentCardinality = getCardinality(form, cardinality);
|
|
155
|
+
// target 必须在 cardinality 确定后解析,保证 Cascader.multiple 切换时协议组合合法。
|
|
156
|
+
syncValueMappingProtocol(form, settings.values, adapter, currentCardinality, resolveTarget(form, currentCardinality, target), fields);
|
|
120
157
|
};
|
|
121
158
|
};
|
|
122
159
|
exports.createValueMappingSettingsReaction = createValueMappingSettingsReaction;
|
|
160
|
+
const createFixedFieldsSchema = (fields, localeKey) => {
|
|
161
|
+
// 固定字段直接生成多个 Input,字段名即协议中对应的 settings path。
|
|
162
|
+
const getLocaleMessage = (token) => `{{$node.getMessage("settings.${localeKey}.${token}")}}`;
|
|
163
|
+
return fields.paths.reduce((properties, path, index) => {
|
|
164
|
+
properties[path] = {
|
|
165
|
+
type: 'string',
|
|
166
|
+
title: getLocaleMessage(fields.tokens[index]),
|
|
167
|
+
'x-decorator': 'FormItem',
|
|
168
|
+
'x-decorator-props': { feedbackLayout: 'loose' },
|
|
169
|
+
'x-component': 'Input',
|
|
170
|
+
'x-component-props': { allowClear: true },
|
|
171
|
+
};
|
|
172
|
+
return properties;
|
|
173
|
+
}, {});
|
|
174
|
+
};
|
|
175
|
+
const createDynamicFieldsSchema = (fields, localeKey) => ({
|
|
176
|
+
// 动态字段使用 ArrayItems 承载可变数量的映射项,顺序就是 tuple 层级顺序。
|
|
177
|
+
[fields.path]: {
|
|
178
|
+
type: 'array',
|
|
179
|
+
default: [],
|
|
180
|
+
'x-component': 'ArrayItems',
|
|
181
|
+
items: {
|
|
182
|
+
type: 'object',
|
|
183
|
+
'x-decorator': 'ArrayItems.Item',
|
|
184
|
+
'x-decorator-props': {
|
|
185
|
+
type: 'divide',
|
|
186
|
+
style: { borderBottom: 'none' },
|
|
187
|
+
},
|
|
188
|
+
properties: {
|
|
189
|
+
// remove 只负责删除当前行;字段顺序由 ArrayItems 自身维护。
|
|
190
|
+
path: {
|
|
191
|
+
type: 'string',
|
|
192
|
+
title: `{{$node.getMessage("settings.${localeKey}.${fields.token}")}}`,
|
|
193
|
+
'x-decorator': 'FormItem',
|
|
194
|
+
'x-decorator-props': { feedbackLayout: 'loose' },
|
|
195
|
+
'x-component': 'Input',
|
|
196
|
+
'x-component-props': { allowClear: true },
|
|
197
|
+
},
|
|
198
|
+
remove: {
|
|
199
|
+
type: 'void',
|
|
200
|
+
'x-component': 'ArrayItems.Remove',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
properties: {
|
|
205
|
+
addition: {
|
|
206
|
+
type: 'void',
|
|
207
|
+
'x-component': 'ArrayItems.Addition',
|
|
208
|
+
'x-component-props': { style: { marginBottom: 8 } },
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
/**
|
|
214
|
+
* 创建组件属性面板中的新 v1 value-mapping 分组。
|
|
215
|
+
* 具体组件可通过 settingsProperties 注入额外设置,但协议同步仍由公共 reaction 负责。
|
|
216
|
+
*/
|
|
217
|
+
const createValueMappingGroup = (_a) => {
|
|
218
|
+
var { localeKey = 'value-mapping-group', settingsProperties } = _a, options = __rest(_a, ["localeKey", "settingsProperties"]);
|
|
219
|
+
const fieldProperties = options.fields.type === 'fixed'
|
|
220
|
+
? createFixedFieldsSchema(options.fields, localeKey)
|
|
221
|
+
: createDynamicFieldsSchema(options.fields, localeKey);
|
|
222
|
+
const properties = Object.assign(Object.assign({}, fieldProperties), settingsProperties);
|
|
223
|
+
return {
|
|
224
|
+
type: 'void',
|
|
225
|
+
'x-component': 'CollapseItem',
|
|
226
|
+
'x-component-props': { defaultExpand: false },
|
|
227
|
+
'x-reactions': [
|
|
228
|
+
(0, exports.createValueMappingSettingsReaction)(Object.assign(Object.assign({}, options), { getMessage: (error, reactionScope) => { var _a; return (_a = reactionScope.$node) === null || _a === void 0 ? void 0 : _a.getMessage(`settings.${localeKey}.${error}`); } })),
|
|
229
|
+
],
|
|
230
|
+
properties,
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
exports.createValueMappingGroup = createValueMappingGroup;
|
|
@@ -7,6 +7,7 @@ export declare const Cascader: {
|
|
|
7
7
|
title: string;
|
|
8
8
|
tooltip: string;
|
|
9
9
|
};
|
|
10
|
+
multiple: string;
|
|
10
11
|
displayRender: {
|
|
11
12
|
title: string;
|
|
12
13
|
tooltip: string;
|
|
@@ -16,6 +17,18 @@ export declare const Cascader: {
|
|
|
16
17
|
tooltip: string;
|
|
17
18
|
};
|
|
18
19
|
};
|
|
20
|
+
'value-mapping-group': {
|
|
21
|
+
title: string;
|
|
22
|
+
fieldPath: string;
|
|
23
|
+
mappingPosition: string;
|
|
24
|
+
currentField: string;
|
|
25
|
+
siblingFields: string;
|
|
26
|
+
multipleOnlyCurrent: string;
|
|
27
|
+
empty: string;
|
|
28
|
+
incomplete: string;
|
|
29
|
+
duplicate: string;
|
|
30
|
+
invalid: string;
|
|
31
|
+
};
|
|
19
32
|
};
|
|
20
33
|
};
|
|
21
34
|
'en-US': {
|
|
@@ -26,6 +39,7 @@ export declare const Cascader: {
|
|
|
26
39
|
title: string;
|
|
27
40
|
tooltip: string;
|
|
28
41
|
};
|
|
42
|
+
multiple: string;
|
|
29
43
|
displayRender: {
|
|
30
44
|
title: string;
|
|
31
45
|
tooltip: string;
|
|
@@ -35,6 +49,18 @@ export declare const Cascader: {
|
|
|
35
49
|
tooltip: string;
|
|
36
50
|
};
|
|
37
51
|
};
|
|
52
|
+
'value-mapping-group': {
|
|
53
|
+
title: string;
|
|
54
|
+
fieldPath: string;
|
|
55
|
+
mappingPosition: string;
|
|
56
|
+
currentField: string;
|
|
57
|
+
siblingFields: string;
|
|
58
|
+
multipleOnlyCurrent: string;
|
|
59
|
+
empty: string;
|
|
60
|
+
incomplete: string;
|
|
61
|
+
duplicate: string;
|
|
62
|
+
invalid: string;
|
|
63
|
+
};
|
|
38
64
|
};
|
|
39
65
|
};
|
|
40
66
|
'ko-KR': {
|
|
@@ -45,6 +71,7 @@ export declare const Cascader: {
|
|
|
45
71
|
title: string;
|
|
46
72
|
tooltip: string;
|
|
47
73
|
};
|
|
74
|
+
multiple: string;
|
|
48
75
|
displayRender: {
|
|
49
76
|
title: string;
|
|
50
77
|
tooltip: string;
|
|
@@ -54,6 +81,18 @@ export declare const Cascader: {
|
|
|
54
81
|
tooltip: string;
|
|
55
82
|
};
|
|
56
83
|
};
|
|
84
|
+
'value-mapping-group': {
|
|
85
|
+
title: string;
|
|
86
|
+
fieldPath: string;
|
|
87
|
+
mappingPosition: string;
|
|
88
|
+
currentField: string;
|
|
89
|
+
siblingFields: string;
|
|
90
|
+
multipleOnlyCurrent: string;
|
|
91
|
+
empty: string;
|
|
92
|
+
incomplete: string;
|
|
93
|
+
duplicate: string;
|
|
94
|
+
invalid: string;
|
|
95
|
+
};
|
|
57
96
|
};
|
|
58
97
|
};
|
|
59
98
|
};
|
package/lib/locales/Cascader.js
CHANGED
|
@@ -10,6 +10,7 @@ exports.Cascader = {
|
|
|
10
10
|
title: '选择时触发',
|
|
11
11
|
tooltip: '点选每级菜单选项值都会发生变化',
|
|
12
12
|
},
|
|
13
|
+
multiple: '多选',
|
|
13
14
|
displayRender: {
|
|
14
15
|
title: '渲染函数',
|
|
15
16
|
tooltip: '选择后展示的渲染函数,默认为label => label.join("/") ',
|
|
@@ -19,6 +20,18 @@ exports.Cascader = {
|
|
|
19
20
|
tooltip: '默认值:{ label: "label", value: "value", children: "children" }',
|
|
20
21
|
},
|
|
21
22
|
},
|
|
23
|
+
'value-mapping-group': {
|
|
24
|
+
title: '数据映射',
|
|
25
|
+
fieldPath: '业务字段路径',
|
|
26
|
+
mappingPosition: '映射位置',
|
|
27
|
+
currentField: '当前字段',
|
|
28
|
+
siblingFields: '同级字段',
|
|
29
|
+
multipleOnlyCurrent: '多选模式仅支持映射到当前字段',
|
|
30
|
+
empty: '至少配置一个业务字段路径',
|
|
31
|
+
incomplete: '各级字段路径必须同时填写',
|
|
32
|
+
duplicate: '各级字段路径不能相同',
|
|
33
|
+
invalid: '请输入合法的相对字段路径',
|
|
34
|
+
},
|
|
22
35
|
},
|
|
23
36
|
},
|
|
24
37
|
'en-US': {
|
|
@@ -29,6 +42,7 @@ exports.Cascader = {
|
|
|
29
42
|
title: 'Change On Select',
|
|
30
43
|
tooltip: 'Click on each level of menu option value will change',
|
|
31
44
|
},
|
|
45
|
+
multiple: 'Multiple',
|
|
32
46
|
displayRender: {
|
|
33
47
|
title: 'Display Render',
|
|
34
48
|
tooltip: 'The rendering function displayed after selection, the default is label => label.join("/") ',
|
|
@@ -38,6 +52,18 @@ exports.Cascader = {
|
|
|
38
52
|
tooltip: 'Defaults:{ label: "label", value: "value", children: "children" }',
|
|
39
53
|
},
|
|
40
54
|
},
|
|
55
|
+
'value-mapping-group': {
|
|
56
|
+
title: 'Data Mapping',
|
|
57
|
+
fieldPath: 'Business field path',
|
|
58
|
+
mappingPosition: 'Mapping position',
|
|
59
|
+
currentField: 'Current field',
|
|
60
|
+
siblingFields: 'Sibling fields',
|
|
61
|
+
multipleOnlyCurrent: 'Multiple mode only supports mapping to the current field',
|
|
62
|
+
empty: 'Configure at least one business field path',
|
|
63
|
+
incomplete: 'All field paths are required',
|
|
64
|
+
duplicate: 'Field paths must be different',
|
|
65
|
+
invalid: 'Enter a valid relative field path',
|
|
66
|
+
},
|
|
41
67
|
},
|
|
42
68
|
},
|
|
43
69
|
'ko-KR': {
|
|
@@ -48,6 +74,7 @@ exports.Cascader = {
|
|
|
48
74
|
title: '선택 시 변경',
|
|
49
75
|
tooltip: '메뉴 옵션 값의 레벨을 클릭하면 변경됩니다.',
|
|
50
76
|
},
|
|
77
|
+
multiple: '다중 선택',
|
|
51
78
|
displayRender: {
|
|
52
79
|
title: '디스플레이 렌더링',
|
|
53
80
|
tooltip: '선택 후 실행되는 렌더링 함수로 기본 값은 label => label.join("/") ',
|
|
@@ -57,6 +84,18 @@ exports.Cascader = {
|
|
|
57
84
|
tooltip: '기본 값:{ label: "label", value: "value", children: "children" }',
|
|
58
85
|
},
|
|
59
86
|
},
|
|
87
|
+
'value-mapping-group': {
|
|
88
|
+
title: '데이터 매핑',
|
|
89
|
+
fieldPath: '업무 필드 경로',
|
|
90
|
+
mappingPosition: '매핑 위치',
|
|
91
|
+
currentField: '현재 필드',
|
|
92
|
+
siblingFields: '동급 필드',
|
|
93
|
+
multipleOnlyCurrent: '다중 선택 모드에서는 현재 필드 매핑만 지원됩니다',
|
|
94
|
+
empty: '하나 이상의 업무 필드 경로를 입력하세요',
|
|
95
|
+
incomplete: '모든 필드 경로를 입력하세요',
|
|
96
|
+
duplicate: '필드 경로는 달라야 합니다',
|
|
97
|
+
invalid: '올바른 상대 필드 경로를 입력하세요',
|
|
98
|
+
},
|
|
60
99
|
},
|
|
61
100
|
},
|
|
62
101
|
};
|
|
@@ -82,8 +82,8 @@ exports.DateRangePicker = (0, core_1.createLocales)(exports.DatePicker, {
|
|
|
82
82
|
settings: {
|
|
83
83
|
'value-mapping-group': {
|
|
84
84
|
title: '数据映射',
|
|
85
|
-
startPath: '
|
|
86
|
-
endPath: '
|
|
85
|
+
startPath: '开始字段路径',
|
|
86
|
+
endPath: '结束字段路径',
|
|
87
87
|
incomplete: '开始和结束字段路径必须同时填写',
|
|
88
88
|
duplicate: '开始和结束字段路径不能相同',
|
|
89
89
|
invalid: '请输入合法的相对字段路径',
|
|
@@ -95,8 +95,8 @@ exports.DateRangePicker = (0, core_1.createLocales)(exports.DatePicker, {
|
|
|
95
95
|
settings: {
|
|
96
96
|
'value-mapping-group': {
|
|
97
97
|
title: 'Data Mapping',
|
|
98
|
-
startPath: 'Start
|
|
99
|
-
endPath: 'End
|
|
98
|
+
startPath: 'Start field path',
|
|
99
|
+
endPath: 'End field path',
|
|
100
100
|
incomplete: 'Both start and end field paths are required',
|
|
101
101
|
duplicate: 'Start and end field paths must be different',
|
|
102
102
|
invalid: 'Enter a valid relative field path',
|
|
@@ -108,8 +108,8 @@ exports.DateRangePicker = (0, core_1.createLocales)(exports.DatePicker, {
|
|
|
108
108
|
settings: {
|
|
109
109
|
'value-mapping-group': {
|
|
110
110
|
title: '데이터 매핑',
|
|
111
|
-
startPath: '시작
|
|
112
|
-
endPath: '종료
|
|
111
|
+
startPath: '시작 필드 경로',
|
|
112
|
+
endPath: '종료 필드 경로',
|
|
113
113
|
incomplete: '시작 및 종료 필드 경로를 모두 입력하세요',
|
|
114
114
|
duplicate: '시작 및 종료 필드 경로는 달라야 합니다',
|
|
115
115
|
invalid: '올바른 상대 필드 경로를 입력하세요',
|
package/lib/schemas/Cascader.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formily-design/formily-antd",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"module": "esm",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"start": "webpack-dev-server --config playground/webpack.dev.ts"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@formily-design/react-settings-form": "1.0.
|
|
27
|
+
"@formily-design/react-settings-form": "1.0.22",
|
|
28
28
|
"@formily/antd-v5": "^1.2.4",
|
|
29
29
|
"@formily/core": "^2.0.2",
|
|
30
30
|
"@formily/json-schema": "^2.0.2",
|
|
@@ -69,14 +69,14 @@
|
|
|
69
69
|
"react-is": ">=16.8.0 || >=17.0.0"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@formily-design/core": "1.0.
|
|
73
|
-
"@formily-design/formily-setters": "1.0.
|
|
74
|
-
"@formily-design/formily-transformer": "1.0.
|
|
75
|
-
"@formily-design/react": "1.0.
|
|
76
|
-
"@formily-design/shared": "1.0.
|
|
72
|
+
"@formily-design/core": "1.0.22",
|
|
73
|
+
"@formily-design/formily-setters": "1.0.22",
|
|
74
|
+
"@formily-design/formily-transformer": "1.0.22",
|
|
75
|
+
"@formily-design/react": "1.0.22",
|
|
76
|
+
"@formily-design/shared": "1.0.22"
|
|
77
77
|
},
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "648b2e984e5823b5e712f4126ec7d675b7bc0f4e"
|
|
82
82
|
}
|