@farris/ui-vue 1.7.0-beta.3 → 1.7.0-beta.4
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/components/avatar/index.esm.js +10 -1
- package/components/avatar/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +178 -176
- package/components/calendar/index.umd.cjs +2 -2
- package/components/collection-property-editor/index.esm.js +48 -46
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +319 -300
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +2287 -1161
- package/components/comment/index.umd.cjs +7 -7
- package/components/component/index.esm.js +3 -1
- package/components/component/index.umd.cjs +2 -2
- package/components/condition/index.esm.js +926 -901
- package/components/condition/index.umd.cjs +2 -2
- package/components/data-view/index.esm.js +898 -899
- package/components/data-view/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +3 -1
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +239 -221
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +11 -9
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/expression-editor/index.esm.js +1299 -1279
- package/components/expression-editor/index.umd.cjs +4 -4
- package/components/filter-bar/index.esm.js +731 -678
- package/components/filter-bar/index.umd.cjs +2 -2
- package/components/filter-condition-editor/index.esm.js +1792 -1772
- package/components/filter-condition-editor/index.umd.cjs +4 -4
- package/components/image/index.esm.js +246 -240
- package/components/image/index.umd.cjs +2 -2
- package/components/language-textbox/index.esm.js +9 -7
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/list-view/index.esm.js +1 -1
- package/components/list-view/index.umd.cjs +1 -1
- package/components/locale/index.esm.js +2009 -886
- package/components/locale/index.umd.cjs +6 -6
- package/components/number-range/index.esm.js +190 -181
- package/components/number-range/index.umd.cjs +1 -1
- package/components/order/index.esm.js +734 -714
- package/components/order/index.umd.cjs +5 -5
- package/components/property-panel/index.esm.js +60 -49
- package/components/property-panel/index.umd.cjs +3 -3
- package/components/query-solution/index.esm.js +2461 -2500
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/radio-group/index.esm.js +30 -30
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +238 -238
- package/components/schema-selector/index.umd.cjs +4 -4
- package/components/section/index.esm.js +217 -302
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +1793 -1773
- package/components/sort-condition-editor/index.umd.cjs +4 -4
- package/components/transfer/index.esm.js +155 -155
- package/components/transfer/index.umd.cjs +3 -3
- package/designer/data-grid/index.esm.js +895 -867
- package/designer/data-grid/index.umd.cjs +5 -5
- package/designer/data-view/index.esm.js +145 -144
- package/designer/data-view/index.umd.cjs +2 -2
- package/designer/drawer/index.esm.js +73 -71
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +87 -65
- package/designer/dynamic-form/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +14 -3
- package/designer/farris-designer.all.umd.cjs +3 -3
- package/designer/input-group/index.esm.js +34 -14
- package/designer/input-group/index.umd.cjs +1 -1
- package/designer/list-view/index.esm.js +1 -1
- package/designer/list-view/index.umd.cjs +1 -1
- package/designer/radio-group/index.esm.js +15 -2
- package/designer/radio-group/index.umd.cjs +1 -1
- package/designer/section/index.esm.js +129 -119
- package/designer/section/index.umd.cjs +1 -1
- package/designer/time-picker/index.esm.js +140 -131
- package/designer/time-picker/index.umd.cjs +1 -1
- package/farris.all.esm.js +13578 -12394
- package/farris.all.umd.cjs +26 -26
- package/index.css +1 -1
- package/locales/data-grid/ui/en.json +2 -1
- package/locales/data-grid/ui/zh-CHS.json +2 -1
- package/locales/data-grid/ui/zh-CHT.json +2 -1
- package/locales/designer/en.json +12 -10
- package/locales/designer/zh-CHS.json +19 -17
- package/locales/designer/zh-CHT.json +19 -17
- package/locales/ui/en.json +4 -2
- package/locales/ui/zh-CHS.json +11 -9
- package/locales/ui/zh-CHT.json +11 -9
- package/package.json +1 -1
- package/package.zip +0 -0
- package/types/combo-list/src/composition/types.d.ts +1 -0
- package/types/condition/src/composition/condition-value/number-spinner-value.d.ts +1 -1
- package/types/condition/src/composition/use-field-config.d.ts +1 -1
- package/types/condition/src/condition.props.d.ts +1 -1
- package/types/data-view/designer/property-config/use-command-option.d.ts +12 -0
- package/types/image/src/property-config/image.property-config.d.ts +5 -5
- package/types/locale/src/lib/locale.service.d.ts +2 -2
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +7 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-util.d.ts +0 -20
- package/types/section/src/designer/section.design.props.d.ts +17 -0
- package/types/section/src/section.props.d.ts +0 -25
|
@@ -40,32 +40,32 @@ const te = {
|
|
|
40
40
|
};
|
|
41
41
|
function ie(y) {
|
|
42
42
|
const { formSchemaUtils: n, formStateMachineUtils: e } = y;
|
|
43
|
-
function t(
|
|
43
|
+
function t(o, p = "") {
|
|
44
44
|
return {
|
|
45
|
-
path: p +
|
|
46
|
-
field:
|
|
47
|
-
fullPath:
|
|
45
|
+
path: p + o.code,
|
|
46
|
+
field: o.id,
|
|
47
|
+
fullPath: o.code
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
function i(
|
|
51
|
-
return n.getViewModelById(
|
|
50
|
+
function i(o, p = "") {
|
|
51
|
+
return n.getViewModelById(o).states.map((d) => t(d, p));
|
|
52
52
|
}
|
|
53
|
-
function s(
|
|
54
|
-
const p = n.getRootViewModelId(), c = i(
|
|
55
|
-
if (
|
|
53
|
+
function s(o) {
|
|
54
|
+
const p = n.getRootViewModelId(), c = i(o);
|
|
55
|
+
if (o === p)
|
|
56
56
|
return c;
|
|
57
57
|
const d = i(p, "root-component.");
|
|
58
58
|
return [...c, ...d];
|
|
59
59
|
}
|
|
60
|
-
function o
|
|
61
|
-
return
|
|
60
|
+
function r(o) {
|
|
61
|
+
return o.binding && o.binding.path || o.id || "";
|
|
62
62
|
}
|
|
63
63
|
function a() {
|
|
64
64
|
return e && e.getRenderStates() || [];
|
|
65
65
|
}
|
|
66
|
-
return { getVariables: s, getControlName:
|
|
66
|
+
return { getVariables: s, getControlName: r, getStateMachines: a };
|
|
67
67
|
}
|
|
68
|
-
class
|
|
68
|
+
class N {
|
|
69
69
|
constructor(n) {
|
|
70
70
|
g(this, "sessionVariables", [
|
|
71
71
|
{
|
|
@@ -114,19 +114,19 @@ class U {
|
|
|
114
114
|
required: "必填表达式"
|
|
115
115
|
});
|
|
116
116
|
g(this, "getExpressionConverter", (n, e) => ({
|
|
117
|
-
convertFrom: (t, i, s,
|
|
117
|
+
convertFrom: (t, i, s, r) => {
|
|
118
118
|
const a = s.getExpressionRuleValue(n, e || i);
|
|
119
119
|
return a && a.value || "";
|
|
120
120
|
},
|
|
121
|
-
convertTo: (t, i, s,
|
|
122
|
-
var
|
|
121
|
+
convertTo: (t, i, s, r, a) => {
|
|
122
|
+
var o;
|
|
123
123
|
if (i === "dataPicking" && (s != null && s.target)) {
|
|
124
124
|
const p = `${s.target}_dataPicking`;
|
|
125
|
-
((
|
|
125
|
+
((o = s.rules) == null ? void 0 : o.some(
|
|
126
126
|
(d) => d.id === p && d.value
|
|
127
127
|
)) ? t.dictPickingExpressionId = p : delete t.dictPickingExpressionId;
|
|
128
128
|
}
|
|
129
|
-
|
|
129
|
+
r.updateExpression(s);
|
|
130
130
|
}
|
|
131
131
|
}));
|
|
132
132
|
this.formSchemaService = n;
|
|
@@ -135,10 +135,10 @@ class U {
|
|
|
135
135
|
const t = this.formSchemaService.getExpressions();
|
|
136
136
|
if (!t)
|
|
137
137
|
return "";
|
|
138
|
-
const i = t.find((
|
|
138
|
+
const i = t.find((r) => r.target === n);
|
|
139
139
|
if (!i)
|
|
140
140
|
return "";
|
|
141
|
-
const s = i.rules.find((
|
|
141
|
+
const s = i.rules.find((r) => r.type === e);
|
|
142
142
|
return s || "";
|
|
143
143
|
}
|
|
144
144
|
// 获取上下文表单变量
|
|
@@ -173,10 +173,10 @@ class U {
|
|
|
173
173
|
return n == null || n.forEach((i) => {
|
|
174
174
|
var a;
|
|
175
175
|
const s = this.createTreeNode(i, e);
|
|
176
|
-
let
|
|
177
|
-
(a = i.type) != null && a.fields && (
|
|
176
|
+
let r = [];
|
|
177
|
+
(a = i.type) != null && a.fields && (r = this.buildEntityFieldsTreeData(i.type.fields, [...e, i.label])), t.push({
|
|
178
178
|
data: s,
|
|
179
|
-
children:
|
|
179
|
+
children: r,
|
|
180
180
|
expanded: !0
|
|
181
181
|
});
|
|
182
182
|
}), t;
|
|
@@ -184,13 +184,13 @@ class U {
|
|
|
184
184
|
buildChildEntityTreeData(n = null, e) {
|
|
185
185
|
const t = [];
|
|
186
186
|
return n == null || n.forEach((i) => {
|
|
187
|
-
var
|
|
187
|
+
var o, p;
|
|
188
188
|
const s = this.createTreeNode(i, e);
|
|
189
189
|
s.type = "entity";
|
|
190
|
-
const
|
|
191
|
-
a != null && a.length && (
|
|
190
|
+
const r = this.buildEntityFieldsTreeData((o = i.type) == null ? void 0 : o.fields, [...e, i.label]), a = this.buildChildEntityTreeData((p = i.type) == null ? void 0 : p.entities, [...e, i.label]);
|
|
191
|
+
a != null && a.length && (r == null || r.push(...a)), t.push({
|
|
192
192
|
data: s,
|
|
193
|
-
children:
|
|
193
|
+
children: r || [],
|
|
194
194
|
// 空值回退
|
|
195
195
|
expanded: !0
|
|
196
196
|
});
|
|
@@ -230,70 +230,70 @@ class U {
|
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
232
|
onBeforeOpenExpression(n, e, t) {
|
|
233
|
-
const i = t === "Field" ? n.binding.field : n.id, s = this.getExpressionRule(i, e),
|
|
233
|
+
const i = t === "Field" ? n.binding.field : n.id, s = this.getExpressionRule(i, e), r = this.getEntitiesAndVariables(), a = {
|
|
234
234
|
message: ["validate", "required", "dataPicking"].includes(e) && s ? s.message : "",
|
|
235
|
-
...
|
|
235
|
+
...r
|
|
236
236
|
};
|
|
237
237
|
return s.messageType != null && (a.messageType = s.messageType), a;
|
|
238
238
|
}
|
|
239
239
|
buildRule(n, e, t, i) {
|
|
240
|
-
const { expression: s, message:
|
|
240
|
+
const { expression: s, message: r, messageType: a } = e, o = {
|
|
241
241
|
id: `${n}_${t}`,
|
|
242
242
|
type: t,
|
|
243
243
|
value: s
|
|
244
244
|
};
|
|
245
|
-
return (t === "validate" || t === "dataPicking" || t === "required") && (
|
|
245
|
+
return (t === "validate" || t === "dataPicking" || t === "required") && (o.message = r), t === "dataPicking" && (o.messageType = a), t === "validate" && i && (o.elementId = i), o;
|
|
246
246
|
}
|
|
247
247
|
getExpressionData() {
|
|
248
248
|
const { expressions: n } = this.formSchemaService.getFormSchema().module;
|
|
249
249
|
return n || [];
|
|
250
250
|
}
|
|
251
251
|
updateExpression(n, e, t, i) {
|
|
252
|
-
const s = e === "Field" ? n.binding.field : n.id,
|
|
253
|
-
let
|
|
252
|
+
const s = e === "Field" ? n.binding.field : n.id, r = this.buildRule(s, t, i, n.type === "form-group" ? n.id : "");
|
|
253
|
+
let o = this.getExpressionData().find((c) => c.targetType === e && c.target === s);
|
|
254
254
|
const p = (c) => c.value.trim() === "";
|
|
255
|
-
if (
|
|
256
|
-
const c =
|
|
255
|
+
if (o) {
|
|
256
|
+
const c = o.rules.find((d) => d.id === r.id);
|
|
257
257
|
if (c)
|
|
258
|
-
p(
|
|
258
|
+
p(r) ? o.rules = o.rules.filter((d) => d.id !== r.id) : (Object.assign(c, r), i === "validate" && n.type === "form-group" && (c.elementId = n.id));
|
|
259
259
|
else {
|
|
260
|
-
if (p(
|
|
260
|
+
if (p(r))
|
|
261
261
|
return null;
|
|
262
|
-
|
|
262
|
+
o.rules = o.rules || [], o.rules.push(r);
|
|
263
263
|
}
|
|
264
264
|
} else {
|
|
265
|
-
if (p(
|
|
265
|
+
if (p(r))
|
|
266
266
|
return null;
|
|
267
|
-
|
|
267
|
+
o = {
|
|
268
268
|
target: `${s}`,
|
|
269
|
-
rules: [
|
|
269
|
+
rules: [r],
|
|
270
270
|
targetType: e
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
|
-
return
|
|
273
|
+
return o;
|
|
274
274
|
}
|
|
275
275
|
getExpressionEditorOptions(n, e, t, i) {
|
|
276
|
-
return t.reduce((s,
|
|
277
|
-
var
|
|
278
|
-
const a = e === "Field" ? (
|
|
279
|
-
return s[
|
|
276
|
+
return t.reduce((s, r) => {
|
|
277
|
+
var o, p;
|
|
278
|
+
const a = e === "Field" ? (o = n == null ? void 0 : n.binding) == null ? void 0 : o.field : n.id;
|
|
279
|
+
return s[r] = {
|
|
280
280
|
hide: e === "Field" ? !!((p = n == null ? void 0 : n.binding) != null && p.field) : !1,
|
|
281
281
|
description: "",
|
|
282
|
-
title: this.expressionNames[
|
|
282
|
+
title: this.expressionNames[r],
|
|
283
283
|
type: "string",
|
|
284
284
|
$converter: this.getExpressionConverter(a),
|
|
285
285
|
refreshPanelAfterChanged: !0,
|
|
286
286
|
editor: {
|
|
287
287
|
type: "expression-editor",
|
|
288
288
|
singleExpand: !1,
|
|
289
|
-
dialogTitle: `${this.expressionNames[
|
|
290
|
-
showMessage:
|
|
291
|
-
showMessageType:
|
|
292
|
-
beforeOpen: () => this.onBeforeOpenExpression(n,
|
|
289
|
+
dialogTitle: `${this.expressionNames[r]}编辑器`,
|
|
290
|
+
showMessage: r === "validate" || r === "dataPicking" || r === "required",
|
|
291
|
+
showMessageType: r === "dataPicking",
|
|
292
|
+
beforeOpen: () => this.onBeforeOpenExpression(n, r, e),
|
|
293
293
|
onSubmitModal: (c) => {
|
|
294
|
-
const d = this.updateExpression(n, e, c,
|
|
294
|
+
const d = this.updateExpression(n, e, c, r);
|
|
295
295
|
if (i) {
|
|
296
|
-
const m = this.buildRule(a, c,
|
|
296
|
+
const m = this.buildRule(a, c, r);
|
|
297
297
|
i(m);
|
|
298
298
|
}
|
|
299
299
|
return d;
|
|
@@ -303,13 +303,13 @@ class U {
|
|
|
303
303
|
}, {});
|
|
304
304
|
}
|
|
305
305
|
getExpressionInfo(n, e, t) {
|
|
306
|
-
const i = e === "Field" ? n.binding.field : n.id, s = this.getExpressionRule(i, t),
|
|
306
|
+
const i = e === "Field" ? n.binding.field : n.id, s = this.getExpressionRule(i, t), r = {
|
|
307
307
|
value: s && s.value,
|
|
308
308
|
targetId: i,
|
|
309
309
|
targetType: e,
|
|
310
310
|
expressionType: t
|
|
311
311
|
};
|
|
312
|
-
return s && s.message && (
|
|
312
|
+
return s && s.message && (r.message = s.message), r;
|
|
313
313
|
}
|
|
314
314
|
getExpressionConfig(n, e, t = ["compute", "dependency", "validate"], i) {
|
|
315
315
|
return {
|
|
@@ -419,21 +419,21 @@ class ne {
|
|
|
419
419
|
parentPropertyID: "appearance"
|
|
420
420
|
}
|
|
421
421
|
};
|
|
422
|
-
for (const
|
|
423
|
-
s[
|
|
422
|
+
for (const r in e)
|
|
423
|
+
s[r] = Object.assign(s[r] || {}, e[r]);
|
|
424
424
|
return {
|
|
425
425
|
...i,
|
|
426
426
|
properties: { ...s },
|
|
427
|
-
setPropertyRelates(
|
|
428
|
-
if (
|
|
429
|
-
switch (
|
|
427
|
+
setPropertyRelates(r, a) {
|
|
428
|
+
if (r) {
|
|
429
|
+
switch (r && r.propertyID) {
|
|
430
430
|
case "class":
|
|
431
431
|
case "style": {
|
|
432
432
|
w.value++;
|
|
433
433
|
break;
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
t && t(
|
|
436
|
+
t && t(r, n, a);
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
};
|
|
@@ -448,8 +448,8 @@ class ne {
|
|
|
448
448
|
* @param expressionType 指定表达式类型,存在属性和表达式类型不一致的情况
|
|
449
449
|
* @returns
|
|
450
450
|
*/
|
|
451
|
-
getPropertyEditorParams(n, e = [], t = "visible", i = {}, s = {},
|
|
452
|
-
const { getVariables: a, getControlName:
|
|
451
|
+
getPropertyEditorParams(n, e = [], t = "visible", i = {}, s = {}, r = "") {
|
|
452
|
+
const { getVariables: a, getControlName: o, getStateMachines: p } = ie(this.designerHostService), c = this.getRealTargetType(n), d = e && e.length > 0 ? e : ["Const", "Variable", "StateMachine", "Expression"], m = {
|
|
453
453
|
type: "property-editor",
|
|
454
454
|
propertyTypes: d
|
|
455
455
|
};
|
|
@@ -462,14 +462,14 @@ class ne {
|
|
|
462
462
|
}, i);
|
|
463
463
|
break;
|
|
464
464
|
case "Expression":
|
|
465
|
-
m.expressionConfig = this.getExpressionOptions(n, c,
|
|
465
|
+
m.expressionConfig = this.getExpressionOptions(n, c, r || t);
|
|
466
466
|
break;
|
|
467
467
|
case "StateMachine":
|
|
468
468
|
m.stateMachines = p();
|
|
469
469
|
break;
|
|
470
470
|
case "Variable":
|
|
471
471
|
Object.assign(m, {
|
|
472
|
-
controlName:
|
|
472
|
+
controlName: o(n),
|
|
473
473
|
newVariablePrefix: "is",
|
|
474
474
|
newVariableType: "Boolean",
|
|
475
475
|
variables: a(this.viewModelId),
|
|
@@ -504,23 +504,23 @@ class ne {
|
|
|
504
504
|
const s = {
|
|
505
505
|
title: "行为",
|
|
506
506
|
description: ""
|
|
507
|
-
},
|
|
508
|
-
for (const
|
|
509
|
-
o
|
|
507
|
+
}, r = this.getVisibleProperty(n, e);
|
|
508
|
+
for (const o in t)
|
|
509
|
+
r[o] = Object.assign(r[o] || {}, t[o]);
|
|
510
510
|
const a = this;
|
|
511
511
|
return {
|
|
512
512
|
...s,
|
|
513
|
-
properties: { ...
|
|
514
|
-
setPropertyRelates(
|
|
515
|
-
if (
|
|
516
|
-
switch (
|
|
513
|
+
properties: { ...r },
|
|
514
|
+
setPropertyRelates(o, p) {
|
|
515
|
+
if (o) {
|
|
516
|
+
switch (o.propertyID) {
|
|
517
517
|
case "disabled":
|
|
518
518
|
case "readonly":
|
|
519
519
|
case "visible":
|
|
520
|
-
a.afterMutilEditorChanged(n,
|
|
520
|
+
a.afterMutilEditorChanged(n, o);
|
|
521
521
|
break;
|
|
522
522
|
}
|
|
523
|
-
i && i(
|
|
523
|
+
i && i(o, p);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
526
|
};
|
|
@@ -543,7 +543,7 @@ class ne {
|
|
|
543
543
|
const t = e && e.parent && e.parent.schema;
|
|
544
544
|
if (!t)
|
|
545
545
|
return;
|
|
546
|
-
const i = t.contents.findIndex((
|
|
546
|
+
const i = t.contents.findIndex((r) => r.id === n), s = D(t.contents[i]);
|
|
547
547
|
t.contents.splice(i, 1), t.contents.splice(i, 0, s), Z();
|
|
548
548
|
}
|
|
549
549
|
/**
|
|
@@ -556,7 +556,7 @@ class ne {
|
|
|
556
556
|
const t = n.propertyValue;
|
|
557
557
|
if (!(t && typeof t == "object") || !(t.type === "Variable" && t.isNewVariable))
|
|
558
558
|
return;
|
|
559
|
-
const
|
|
559
|
+
const r = {
|
|
560
560
|
id: t.field,
|
|
561
561
|
category: "locale",
|
|
562
562
|
code: t.fullPath,
|
|
@@ -564,7 +564,7 @@ class ne {
|
|
|
564
564
|
type: t.newVariableType || "String",
|
|
565
565
|
isRtcVariable: this.designerContext.designerMode === "PC_RTC" ? !0 : void 0
|
|
566
566
|
};
|
|
567
|
-
delete t.newVariableType, delete t.isNewVariable, this.formSchemaUtils.getVariableByCode(
|
|
567
|
+
delete t.newVariableType, delete t.isNewVariable, this.formSchemaUtils.getVariableByCode(r.code) || this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(r);
|
|
568
568
|
}
|
|
569
569
|
/**
|
|
570
570
|
* 更新表达式到expressions节点
|
|
@@ -574,11 +574,11 @@ class ne {
|
|
|
574
574
|
const e = n.propertyValue;
|
|
575
575
|
if (!((e && e.type) === "Expression" && e.expressionInfo))
|
|
576
576
|
return;
|
|
577
|
-
const { expressionId: s, expressionInfo:
|
|
577
|
+
const { expressionId: s, expressionInfo: r } = e, { targetId: a, targetType: o, expressionType: p, value: c, message: d } = r, m = this.formSchemaUtils.getModule();
|
|
578
578
|
m.expressions = m.expressions || [];
|
|
579
579
|
const { expressions: f } = m;
|
|
580
580
|
let u = f.find((b) => b.target === a);
|
|
581
|
-
u || (u = { target: a, rules: [], targetType:
|
|
581
|
+
u || (u = { target: a, rules: [], targetType: o }, f.push(u));
|
|
582
582
|
const h = u.rules.find((b) => b.type === p);
|
|
583
583
|
if (h)
|
|
584
584
|
h.value = c, h.message = d;
|
|
@@ -598,11 +598,11 @@ class ne {
|
|
|
598
598
|
const t = n.propertyValue;
|
|
599
599
|
if (t && t.type === "Expression")
|
|
600
600
|
return;
|
|
601
|
-
const s = n.propertyID,
|
|
602
|
-
!
|
|
601
|
+
const s = n.propertyID, r = this.formSchemaUtils.getExpressions(), a = e.binding ? e.binding.field : e.id, o = r.find((p) => p.target === a);
|
|
602
|
+
!o || !o.rules || (o.rules = o.rules.filter((p) => p.type !== s));
|
|
603
603
|
}
|
|
604
604
|
getExpressionOptions(n, e, t) {
|
|
605
|
-
return new
|
|
605
|
+
return new N(this.formSchemaUtils).getExpressionOptions(n, e, t);
|
|
606
606
|
}
|
|
607
607
|
getRealTargetType(n) {
|
|
608
608
|
return ["response-toolbar-item", "tab-toolbar-item", "section-toolbar-item"].indexOf(n.type) > -1 ? "Button" : n.binding && n.binding.field ? "Field" : "Container";
|
|
@@ -631,7 +631,7 @@ const F = class F {
|
|
|
631
631
|
let i = F.fieldControlTypeMapping[n];
|
|
632
632
|
if (t === "data-grid-column" && (i != null && i.length)) {
|
|
633
633
|
const s = [l["check-group"].type, l["radio-group"].type, l.image.type];
|
|
634
|
-
i = i.filter((
|
|
634
|
+
i = i.filter((r) => !s.includes(r.key));
|
|
635
635
|
}
|
|
636
636
|
return i;
|
|
637
637
|
}
|
|
@@ -745,7 +745,7 @@ class se {
|
|
|
745
745
|
g(this, "fieldSetId", "");
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function re(y) {
|
|
749
749
|
let n, e;
|
|
750
750
|
const t = /* @__PURE__ */ new Map();
|
|
751
751
|
let i = [];
|
|
@@ -758,11 +758,11 @@ function oe(y) {
|
|
|
758
758
|
let u = f.find((v) => /^col-([1-9]|10|11|12)$/.test(v)), h = f.find((v) => /^col-md-([1-9]|10|11|12)$/.test(v)), b = f.find((v) => /^col-xl-([1-9]|10|11|12)$/.test(v)), C = f.find((v) => /^col-el-([1-9]|10|11|12)$/.test(v));
|
|
759
759
|
u = u || "col-12", d.columnInSM = parseInt(u.replace("col-", ""), 10), d.displayWidthInSM = d.columnInSM / 12, d.displayWidthInSM !== 1 && (d.isSupportedClass = !1), h = h || "col-md-" + d.columnInSM, d.columnInMD = parseInt(h.replace("col-md-", ""), 10), d.displayWidthInMD = d.columnInMD / 6, [1, 2].includes(d.displayWidthInMD) || (d.isSupportedClass = !1), b = b || "col-xl-" + d.columnInMD, d.columnInLG = parseInt(b.replace("col-xl-", ""), 10), d.displayWidthInLG = d.columnInLG / 3, [1, 2, 3, 4].includes(d.displayWidthInLG) || (d.isSupportedClass = !1), C = C || "col-el-" + d.columnInLG, d.columnInEL = parseInt(C.replace("col-el-", ""), 10), d.displayWidthInEL = d.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(d.displayWidthInEL) || (d.isSupportedClass = !1);
|
|
760
760
|
}
|
|
761
|
-
function
|
|
761
|
+
function r(c, d, m, f = !1) {
|
|
762
762
|
let u = !1;
|
|
763
763
|
c.contents.forEach((h) => {
|
|
764
764
|
if (h.type === "fieldset") {
|
|
765
|
-
m += 1,
|
|
765
|
+
m += 1, r(h, d, m, !0), u = !0;
|
|
766
766
|
return;
|
|
767
767
|
}
|
|
768
768
|
u && (m += 1, u = !1);
|
|
@@ -777,14 +777,14 @@ function oe(y) {
|
|
|
777
777
|
const m = y.selectNode(d, (f) => f.type === l["response-form"].type);
|
|
778
778
|
return !m || !m.contents || m.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: m };
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function o(c, d) {
|
|
781
781
|
d = d || c.id;
|
|
782
782
|
const { result: m, message: f, formNode: u } = a(d);
|
|
783
783
|
if (!m)
|
|
784
784
|
return { result: m, message: f };
|
|
785
785
|
e = c.id, i = [], t.clear();
|
|
786
786
|
const h = u.contents[0].type === l.fieldset.type ? 0 : 1;
|
|
787
|
-
|
|
787
|
+
r(u, i, h);
|
|
788
788
|
const b = i.find((v) => !v.isSupportedClass);
|
|
789
789
|
return {
|
|
790
790
|
defaultState: {
|
|
@@ -816,12 +816,12 @@ function oe(y) {
|
|
|
816
816
|
}
|
|
817
817
|
return {
|
|
818
818
|
checkCanFindFormNode: a,
|
|
819
|
-
checkCanOpenLayoutEditor:
|
|
819
|
+
checkCanOpenLayoutEditor: o,
|
|
820
820
|
changeFormControlsByResponseLayoutConfig: p,
|
|
821
|
-
getResonseFormLayoutConfig:
|
|
821
|
+
getResonseFormLayoutConfig: r
|
|
822
822
|
};
|
|
823
823
|
}
|
|
824
|
-
class
|
|
824
|
+
class oe extends ne {
|
|
825
825
|
constructor(e, t) {
|
|
826
826
|
super(e, t);
|
|
827
827
|
g(this, "responseLayoutEditorFunction");
|
|
@@ -833,7 +833,7 @@ class re extends ne {
|
|
|
833
833
|
keyboard: !1,
|
|
834
834
|
showButton: !1
|
|
835
835
|
});
|
|
836
|
-
this.responseLayoutEditorFunction =
|
|
836
|
+
this.responseLayoutEditorFunction = re(this.formSchemaUtils);
|
|
837
837
|
}
|
|
838
838
|
getCommonPropertyConfig(e, t, i = "Card") {
|
|
839
839
|
this.propertyConfig.categories.basic = this.getBasicProperties(e, t, i), this.propertyConfig.categories.appearance = this.getAppearanceProperties(e, t), this.propertyConfig.categories.behavior = this.getBehaviorConfig(e, "form-group");
|
|
@@ -848,7 +848,7 @@ class re extends ne {
|
|
|
848
848
|
var p;
|
|
849
849
|
const s = this;
|
|
850
850
|
this.setDesignViewModelField(e);
|
|
851
|
-
const { canChangeControlType:
|
|
851
|
+
const { canChangeControlType: r, editorTypeList: a } = this.getAvailableEditorType(e), o = {
|
|
852
852
|
description: "Basic Information",
|
|
853
853
|
title: "基本信息",
|
|
854
854
|
properties: {
|
|
@@ -871,7 +871,7 @@ class re extends ne {
|
|
|
871
871
|
idField: "key",
|
|
872
872
|
editable: !1,
|
|
873
873
|
data: a,
|
|
874
|
-
readonly: !
|
|
874
|
+
readonly: !r
|
|
875
875
|
}
|
|
876
876
|
},
|
|
877
877
|
label: {
|
|
@@ -925,7 +925,7 @@ class re extends ne {
|
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
927
|
};
|
|
928
|
-
return i.toLocaleLowerCase() !== "card" && delete
|
|
928
|
+
return i.toLocaleLowerCase() !== "card" && delete o.properties.showLabelType, o;
|
|
929
929
|
}
|
|
930
930
|
/**
|
|
931
931
|
* 校验控件是否支持切换类型
|
|
@@ -1000,7 +1000,7 @@ class re extends ne {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
1002
|
},
|
|
1003
|
-
setPropertyRelates(s,
|
|
1003
|
+
setPropertyRelates(s, r) {
|
|
1004
1004
|
if (s)
|
|
1005
1005
|
switch (s && s.propertyID) {
|
|
1006
1006
|
case "responseLayout":
|
|
@@ -1026,27 +1026,27 @@ class re extends ne {
|
|
|
1026
1026
|
* @param newControlType 新控件类型
|
|
1027
1027
|
*/
|
|
1028
1028
|
changeControlType(e, t, i) {
|
|
1029
|
-
const s = t.propertyValue,
|
|
1030
|
-
if (!
|
|
1029
|
+
const s = t.propertyValue, r = i && i.parent && i.parent.schema;
|
|
1030
|
+
if (!r)
|
|
1031
1031
|
return;
|
|
1032
|
-
const a =
|
|
1032
|
+
const a = r.contents.findIndex((c) => c.id === e.id);
|
|
1033
1033
|
if (a === -1)
|
|
1034
1034
|
return;
|
|
1035
|
-
const
|
|
1035
|
+
const o = r.contents[a];
|
|
1036
1036
|
let p;
|
|
1037
1037
|
if (this.designViewModelField) {
|
|
1038
1038
|
const m = this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find((u) => u.id === this.designViewModelField.id).fieldSchema || {};
|
|
1039
1039
|
m.editor || (m.editor = {}), m.editor.$type = s, this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, m, !1), p = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, s);
|
|
1040
1040
|
}
|
|
1041
1041
|
p || (p = this.controlCreatorUtils.createFormGroupWithoutField(s)), Object.assign(p, {
|
|
1042
|
-
id:
|
|
1043
|
-
appearance:
|
|
1044
|
-
size:
|
|
1045
|
-
label:
|
|
1046
|
-
binding:
|
|
1047
|
-
}), Object.prototype.hasOwnProperty.call(
|
|
1048
|
-
Object.prototype.hasOwnProperty.call(
|
|
1049
|
-
}), i != null && i.updateContextSchema ? i.updateContextSchema(p) : (i.schema = Object.assign(
|
|
1042
|
+
id: o.id,
|
|
1043
|
+
appearance: o.appearance,
|
|
1044
|
+
size: o.size,
|
|
1045
|
+
label: o.label,
|
|
1046
|
+
binding: o.binding
|
|
1047
|
+
}), Object.prototype.hasOwnProperty.call(o, "visible") && Object.assign(p, { visible: o.visible }), o.editor && ["readonly", "required", "placeholder"].map((c) => {
|
|
1048
|
+
Object.prototype.hasOwnProperty.call(o.editor, c) && (p.editor[c] = o.editor[c]);
|
|
1049
|
+
}), i != null && i.updateContextSchema ? i.updateContextSchema(p) : (i.schema = Object.assign(o, p), Object.assign(e, p)), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
|
|
1050
1050
|
(c) => c.classList.remove("dgComponentSelected")
|
|
1051
1051
|
), Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(
|
|
1052
1052
|
(c) => c.classList.remove("dgComponentFocused")
|
|
@@ -1056,17 +1056,17 @@ class re extends ne {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
getComponentConfig(e, t = {}, i = {}, s) {
|
|
1058
1058
|
var m, f;
|
|
1059
|
-
const
|
|
1059
|
+
const r = Object.assign({
|
|
1060
1060
|
description: "编辑器",
|
|
1061
1061
|
title: "编辑器",
|
|
1062
1062
|
type: "input-group",
|
|
1063
1063
|
$converter: "/converter/property-editor.converter",
|
|
1064
1064
|
parentPropertyID: "editor"
|
|
1065
|
-
}, t), a = (m = e.binding) != null && m.field ? [] : ["Const", "Variable", "StateMachine"],
|
|
1065
|
+
}, t), a = (m = e.binding) != null && m.field ? [] : ["Const", "Variable", "StateMachine"], o = this.getPropertyEditorParams(e, a, "readonly"), p = this.getPropertyEditorParams(e, a, "required"), c = {
|
|
1066
1066
|
readonly: {
|
|
1067
1067
|
description: "",
|
|
1068
1068
|
title: "只读",
|
|
1069
|
-
editor:
|
|
1069
|
+
editor: o
|
|
1070
1070
|
},
|
|
1071
1071
|
required: {
|
|
1072
1072
|
description: "",
|
|
@@ -1085,7 +1085,7 @@ class re extends ne {
|
|
|
1085
1085
|
c[u] = Object.assign(c[u] || {}, i[u]);
|
|
1086
1086
|
const d = this;
|
|
1087
1087
|
return {
|
|
1088
|
-
...
|
|
1088
|
+
...r,
|
|
1089
1089
|
properties: { ...c },
|
|
1090
1090
|
setPropertyRelates(u, h) {
|
|
1091
1091
|
if (u) {
|
|
@@ -1108,13 +1108,13 @@ class re extends ne {
|
|
|
1108
1108
|
*/
|
|
1109
1109
|
updateUnifiedLayoutAfterControlChanged(e, t, i) {
|
|
1110
1110
|
const s = e.split(" ");
|
|
1111
|
-
let
|
|
1112
|
-
|
|
1111
|
+
let r = s.find((d) => /^col-([1-9]|10|11|12)$/.test(d)), a = s.find((d) => /^col-md-([1-9]|10|11|12)$/.test(d)), o = s.find((d) => /^col-xl-([1-9]|10|11|12)$/.test(d)), p = s.find((d) => /^col-el-([1-9]|10|11|12)$/.test(d));
|
|
1112
|
+
r = r || "col-12", a = a || "col-md-" + r.replace("col-", ""), o = o || "col-xl-" + a.replace("col-md-", ""), p = p || "col-el-" + o.replace("col-xl-", "");
|
|
1113
1113
|
const c = {
|
|
1114
1114
|
id: t,
|
|
1115
|
-
columnInSM: parseInt(
|
|
1115
|
+
columnInSM: parseInt(r.replace("col-", ""), 10),
|
|
1116
1116
|
columnInMD: parseInt(a.replace("col-md-", ""), 10),
|
|
1117
|
-
columnInLG: parseInt(
|
|
1117
|
+
columnInLG: parseInt(o.replace("col-xl-", ""), 10),
|
|
1118
1118
|
columnInEL: parseInt(p.replace("col-el-", ""), 10)
|
|
1119
1119
|
};
|
|
1120
1120
|
this.updateUnifiedLayoutAfterResponseLayoutChanged(i, c);
|
|
@@ -1133,7 +1133,7 @@ class re extends ne {
|
|
|
1133
1133
|
const u = s.find((h) => h.id === t.id);
|
|
1134
1134
|
Object.assign(u || {}, t);
|
|
1135
1135
|
}
|
|
1136
|
-
const
|
|
1136
|
+
const r = s.map((u) => u.columnInSM), a = s.map((u) => u.columnInMD), o = s.map((u) => u.columnInLG), p = s.map((u) => u.columnInEL), c = this.checkIsUniqueColumn(r) ? r[0] : null, d = this.checkIsUniqueColumn(a) ? a[0] : null, m = this.checkIsUniqueColumn(o) ? o[0] : null, f = this.checkIsUniqueColumn(p) ? p[0] : null;
|
|
1137
1137
|
Object.assign(i.unifiedLayout, {
|
|
1138
1138
|
uniqueColClassInSM: c,
|
|
1139
1139
|
uniqueColClassInMD: d,
|
|
@@ -1207,26 +1207,35 @@ class re extends ne {
|
|
|
1207
1207
|
* @param customEvent 输入控件特有的事件配置
|
|
1208
1208
|
*/
|
|
1209
1209
|
getEventPropertyConfig(e, t = "card", i, s) {
|
|
1210
|
-
const
|
|
1210
|
+
const r = this;
|
|
1211
1211
|
let a = [];
|
|
1212
|
-
i && (a = a.concat(i)),
|
|
1213
|
-
|
|
1212
|
+
if (i && (a = a.concat(i)), a.length === 0)
|
|
1213
|
+
return {
|
|
1214
|
+
title: "事件",
|
|
1215
|
+
hideTitle: !0,
|
|
1216
|
+
properties: {},
|
|
1217
|
+
tabId: "commands",
|
|
1218
|
+
tabName: "交互",
|
|
1219
|
+
hide: !0
|
|
1220
|
+
};
|
|
1221
|
+
this.appendFieldValueChangeEvents(e, a);
|
|
1222
|
+
const o = r.eventsEditorUtils.formProperties(e, r.viewModelId, a);
|
|
1214
1223
|
return {
|
|
1215
1224
|
title: "事件",
|
|
1216
1225
|
hideTitle: !0,
|
|
1217
|
-
properties:
|
|
1226
|
+
properties: r.createBaseEventProperty(o),
|
|
1218
1227
|
tabId: "commands",
|
|
1219
1228
|
tabName: "交互",
|
|
1220
1229
|
setPropertyRelates(d, m) {
|
|
1221
1230
|
const f = d.propertyValue;
|
|
1222
|
-
delete e[
|
|
1223
|
-
const u =
|
|
1224
|
-
u &&
|
|
1231
|
+
delete e[r.viewModelId], f && (f.setPropertyRelates = this.setPropertyRelates, f.controlInfo = { type: r.getControlMethodType(e), name: e.title }, r.eventsEditorUtils.saveRelatedParameters(e, r.viewModelId, f.events, f)), s && s(d, m, f);
|
|
1232
|
+
const u = r.designViewModelUtils.getDgViewModel(r.viewModelId);
|
|
1233
|
+
u && r.designViewModelField && u.changeField(r.designViewModelField.id, { valueChanging: e.fieldValueChanging, valueChanged: e.fieldValueChanged });
|
|
1225
1234
|
}
|
|
1226
1235
|
};
|
|
1227
1236
|
}
|
|
1228
1237
|
getExpressionConfig(e, t, i = ["compute", "dependency", "validate"], s) {
|
|
1229
|
-
return new
|
|
1238
|
+
return new N(this.formSchemaUtils).getExpressionConfig(
|
|
1230
1239
|
e,
|
|
1231
1240
|
t,
|
|
1232
1241
|
i,
|
|
@@ -1258,7 +1267,7 @@ class re extends ne {
|
|
|
1258
1267
|
};
|
|
1259
1268
|
}
|
|
1260
1269
|
}
|
|
1261
|
-
class le extends
|
|
1270
|
+
class le extends oe {
|
|
1262
1271
|
constructor(n, e) {
|
|
1263
1272
|
super(n, e);
|
|
1264
1273
|
}
|
|
@@ -1344,7 +1353,7 @@ const S = /* @__PURE__ */ _({
|
|
|
1344
1353
|
props: te,
|
|
1345
1354
|
emits: ["datePicked", "update:modelValue"],
|
|
1346
1355
|
setup(y, n) {
|
|
1347
|
-
const e = '<span class="f-icon f-icon-timepicker"></span>', t = x(y.modelValue), i = x(), s = x(),
|
|
1356
|
+
const e = '<span class="f-icon f-icon-timepicker"></span>', t = x(y.modelValue), i = x(), s = x(), r = T("designer-host-service"), a = T("design-item-context"), o = de(a, r), p = K(s, a, o);
|
|
1348
1357
|
J(() => {
|
|
1349
1358
|
s.value.componentInstance = p;
|
|
1350
1359
|
}), n.expose(p.value);
|
|
@@ -1484,15 +1493,15 @@ const S = /* @__PURE__ */ _({
|
|
|
1484
1493
|
function Ce(y, n, e) {
|
|
1485
1494
|
return n;
|
|
1486
1495
|
}
|
|
1487
|
-
const
|
|
1496
|
+
const U = X(W, be, ae, Ce);
|
|
1488
1497
|
S.register = (y, n, e, t) => {
|
|
1489
|
-
y["time-picker"] = O, n["time-picker"] =
|
|
1498
|
+
y["time-picker"] = O, n["time-picker"] = U;
|
|
1490
1499
|
};
|
|
1491
1500
|
S.registerDesigner = (y, n, e) => {
|
|
1492
|
-
y["time-picker"] = S, n["time-picker"] =
|
|
1501
|
+
y["time-picker"] = S, n["time-picker"] = U;
|
|
1493
1502
|
};
|
|
1494
1503
|
export {
|
|
1495
1504
|
S as FTimePickerDesign,
|
|
1496
1505
|
S as default,
|
|
1497
|
-
|
|
1506
|
+
U as propsResolver
|
|
1498
1507
|
};
|