@golemui/gui-shared 0.13.2 → 0.13.3
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/CHANGELOG.md +10 -0
- package/index.js +210 -195
- package/index.umd.cjs +1 -1
- package/internals.js +2 -2
- package/internals.umd.cjs +1 -1
- package/lib/dx/__tests__/helpers.d.ts +0 -2
- package/lib/dx/core/dx.domain.d.ts +0 -1
- package/lib/dx/core/eventWiring.service.d.ts +1 -2
- package/lib/dx/dx.service.d.ts +2 -6
- package/package.json +3 -3
- package/{resolveFormInput-CmPoe8iw.js → resolveFormInput-B3y_InQZ.js} +489 -528
- package/resolveFormInput-CyAWrNF6.cjs +1 -0
- package/resolveFormInput-C0LCXSox.cjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "@golemui/core";
|
|
2
|
-
const
|
|
2
|
+
const N = {
|
|
3
3
|
INPUTS: "INPUTS",
|
|
4
4
|
ACTIONS: "ACTIONS",
|
|
5
5
|
LAYOUTS: "LAYOUTS",
|
|
@@ -18,7 +18,7 @@ function R(e) {
|
|
|
18
18
|
function g(e, t) {
|
|
19
19
|
return typeof e == "function" ? e : { type: t, ...e ?? {} };
|
|
20
20
|
}
|
|
21
|
-
class
|
|
21
|
+
class K {
|
|
22
22
|
/**
|
|
23
23
|
* Deep merges two objects, with right taking precedence over left when properties conflict.
|
|
24
24
|
* Arrays are replaced, not merged.
|
|
@@ -31,133 +31,118 @@ class V {
|
|
|
31
31
|
return t;
|
|
32
32
|
if (t == null || typeof t != "object" || typeof s != "object" || Array.isArray(t) || Array.isArray(s))
|
|
33
33
|
return s;
|
|
34
|
-
const
|
|
35
|
-
for (const
|
|
36
|
-
Object.prototype.hasOwnProperty.call(s,
|
|
37
|
-
return
|
|
34
|
+
const a = { ...t };
|
|
35
|
+
for (const l in s)
|
|
36
|
+
Object.prototype.hasOwnProperty.call(s, l) && (typeof s[l] == "object" && !Array.isArray(s[l]) && s[l] !== null && typeof t[l] == "object" && !Array.isArray(t[l]) && t[l] !== null ? a[l] = this.deepMerge(t[l], s[l]) : a[l] = s[l]);
|
|
37
|
+
return a;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
const
|
|
41
|
-
function G(e, t) {
|
|
42
|
-
return {
|
|
43
|
-
items: [e],
|
|
44
|
-
type: "ITEMS",
|
|
45
|
-
itemType: U.ACTIONS,
|
|
46
|
-
tags: t ?? []
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
const X = (e) => {
|
|
50
|
-
const t = {
|
|
51
|
-
uid: "#submit",
|
|
52
|
-
label: "Submit"
|
|
53
|
-
}, s = e != null ? x.deepMerge(t, e) : t;
|
|
54
|
-
return G(s);
|
|
55
|
-
}, H = (e, t) => ({
|
|
40
|
+
const V = new K(), G = (e, t) => ({
|
|
56
41
|
type: "ITEMS",
|
|
57
|
-
itemType:
|
|
42
|
+
itemType: N.DISPLAYS,
|
|
58
43
|
items: [{ render: e }],
|
|
59
44
|
tags: t ?? []
|
|
60
|
-
}),
|
|
61
|
-
function
|
|
62
|
-
if (
|
|
45
|
+
}), C = /* @__PURE__ */ new Map();
|
|
46
|
+
function x(e, t) {
|
|
47
|
+
if (C.has(e))
|
|
63
48
|
throw new Error(`Item type "${e}" is already registered.`);
|
|
64
|
-
|
|
49
|
+
C.set(e, t);
|
|
65
50
|
}
|
|
66
51
|
function f(e) {
|
|
67
|
-
const t =
|
|
52
|
+
const t = C.get(e);
|
|
68
53
|
if (!t)
|
|
69
54
|
throw new Error(
|
|
70
55
|
`No handler registered for item type "${e}". Did you forget to import the registration module?`
|
|
71
56
|
);
|
|
72
57
|
return t;
|
|
73
58
|
}
|
|
74
|
-
function
|
|
75
|
-
return
|
|
59
|
+
function F(e) {
|
|
60
|
+
return C.has(e);
|
|
76
61
|
}
|
|
77
62
|
function c(e) {
|
|
78
|
-
const t = (
|
|
63
|
+
const t = (o) => {
|
|
79
64
|
if (!e.sensibleDefaults)
|
|
80
65
|
return {};
|
|
81
|
-
let
|
|
82
|
-
for (const u of
|
|
66
|
+
let r = { ...e.sensibleDefaults.base };
|
|
67
|
+
for (const u of o) {
|
|
83
68
|
const p = u.config;
|
|
84
69
|
for (const y of e.sensibleDefaults.fields) {
|
|
85
70
|
const d = y;
|
|
86
|
-
p[d] != null && (
|
|
71
|
+
p[d] != null && (r = { ...r, [d]: p[d] });
|
|
87
72
|
}
|
|
88
73
|
}
|
|
89
|
-
return
|
|
90
|
-
}, s = (
|
|
74
|
+
return r;
|
|
75
|
+
}, s = (o, r) => e.sensibleDefaults ? e.sensibleDefaults.apply(o, r) : o, a = (o) => {
|
|
91
76
|
switch (e.entryShape) {
|
|
92
77
|
case "bare":
|
|
93
|
-
return { baseDef:
|
|
78
|
+
return { baseDef: o };
|
|
94
79
|
case "keyed": {
|
|
95
|
-
const
|
|
96
|
-
return { baseDef:
|
|
80
|
+
const r = o;
|
|
81
|
+
return { baseDef: r.def, path: r.key };
|
|
97
82
|
}
|
|
98
83
|
case "compound": {
|
|
99
|
-
const
|
|
100
|
-
return { baseDef:
|
|
84
|
+
const r = o;
|
|
85
|
+
return { baseDef: r.def, children: r.children };
|
|
101
86
|
}
|
|
102
87
|
}
|
|
103
|
-
},
|
|
88
|
+
}, l = {
|
|
104
89
|
rollUpSensibleDefaults: t,
|
|
105
90
|
applySensibleDefaults: s,
|
|
106
91
|
mapToWidget: e.mapToWidget,
|
|
107
|
-
parseEntry:
|
|
92
|
+
parseEntry: a,
|
|
108
93
|
...e.afterMerge ? { afterMerge: e.afterMerge } : {},
|
|
109
94
|
...e.buildCustomWidget ? { buildCustomWidget: e.buildCustomWidget } : {},
|
|
110
95
|
...e.getChildren ? { getChildren: e.getChildren } : {}
|
|
111
96
|
};
|
|
112
|
-
|
|
97
|
+
x(e.itemType, l);
|
|
113
98
|
const n = R(e.itemType);
|
|
114
|
-
return { gsl: n, gslByUid: (
|
|
99
|
+
return { gsl: n, gslByUid: (o, r) => n(r, ((u) => u.uid === o)) };
|
|
115
100
|
}
|
|
116
101
|
function b(e) {
|
|
117
102
|
const {
|
|
118
103
|
uid: t,
|
|
119
104
|
path: s,
|
|
120
|
-
label:
|
|
121
|
-
disabled:
|
|
105
|
+
label: a,
|
|
106
|
+
disabled: l,
|
|
122
107
|
readonly: n,
|
|
123
108
|
defaultValue: i,
|
|
124
|
-
tags:
|
|
125
|
-
type:
|
|
109
|
+
tags: o,
|
|
110
|
+
type: r,
|
|
126
111
|
size: u,
|
|
127
112
|
onLoad: p,
|
|
128
113
|
onChange: y,
|
|
129
114
|
onFilter: d,
|
|
130
|
-
on:
|
|
115
|
+
on: T,
|
|
131
116
|
states: _,
|
|
132
|
-
include:
|
|
133
|
-
exclude:
|
|
117
|
+
include: v,
|
|
118
|
+
exclude: D,
|
|
134
119
|
validator: P,
|
|
135
120
|
...k
|
|
136
121
|
} = e;
|
|
137
122
|
return k;
|
|
138
123
|
}
|
|
139
|
-
function
|
|
124
|
+
function X(e) {
|
|
140
125
|
return e ? e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (t) => t.toUpperCase()) : "";
|
|
141
126
|
}
|
|
142
127
|
function m(e, t) {
|
|
143
|
-
return e.label != null || t.suppressAutomaticLabels || !e.path ? e : { ...e, label:
|
|
128
|
+
return e.label != null || t.suppressAutomaticLabels || !e.path ? e : { ...e, label: X(e.path) };
|
|
144
129
|
}
|
|
145
130
|
function A(e, t) {
|
|
146
131
|
return e.placeholder != null || t.suppressAutomaticPlaceholders || !e.path ? e : { ...e, placeholder: e.path };
|
|
147
132
|
}
|
|
148
|
-
function
|
|
133
|
+
function H(e) {
|
|
149
134
|
switch (e.type) {
|
|
150
135
|
case "text":
|
|
151
|
-
return
|
|
136
|
+
return q(e);
|
|
152
137
|
case "number":
|
|
153
|
-
return ee(e);
|
|
154
|
-
case "boolean":
|
|
155
138
|
return J(e);
|
|
139
|
+
case "boolean":
|
|
140
|
+
return Z(e);
|
|
156
141
|
default:
|
|
157
142
|
throw new Error(`Unsupported field type "${e.type}"`);
|
|
158
143
|
}
|
|
159
144
|
}
|
|
160
|
-
function
|
|
145
|
+
function Z(e) {
|
|
161
146
|
const t = b(e);
|
|
162
147
|
return {
|
|
163
148
|
uid: e.uid ?? "",
|
|
@@ -171,7 +156,7 @@ function J(e) {
|
|
|
171
156
|
props: t
|
|
172
157
|
};
|
|
173
158
|
}
|
|
174
|
-
function
|
|
159
|
+
function q(e) {
|
|
175
160
|
const t = b(e);
|
|
176
161
|
return {
|
|
177
162
|
uid: e.uid ?? "",
|
|
@@ -188,7 +173,7 @@ function Q(e) {
|
|
|
188
173
|
validator: g(e.validator, "string")
|
|
189
174
|
};
|
|
190
175
|
}
|
|
191
|
-
function
|
|
176
|
+
function J(e) {
|
|
192
177
|
const t = b(e);
|
|
193
178
|
return {
|
|
194
179
|
uid: e.uid ?? "",
|
|
@@ -205,7 +190,7 @@ function ee(e) {
|
|
|
205
190
|
validator: g(e.validator, "number")
|
|
206
191
|
};
|
|
207
192
|
}
|
|
208
|
-
const { gsl:
|
|
193
|
+
const { gsl: Ye, gslByUid: ze } = c({
|
|
209
194
|
itemType: "INPUTS",
|
|
210
195
|
entryShape: "keyed",
|
|
211
196
|
sensibleDefaults: {
|
|
@@ -219,8 +204,8 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
219
204
|
return s = A(s, t), s;
|
|
220
205
|
}
|
|
221
206
|
},
|
|
222
|
-
mapToWidget:
|
|
223
|
-
}), { gsl:
|
|
207
|
+
mapToWidget: H
|
|
208
|
+
}), { gsl: Ke, gslByUid: Ve } = c({
|
|
224
209
|
itemType: "SELECT",
|
|
225
210
|
entryShape: "keyed",
|
|
226
211
|
sensibleDefaults: {
|
|
@@ -239,7 +224,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
239
224
|
...e.validator != null ? { validator: e.validator } : {},
|
|
240
225
|
props: b(e)
|
|
241
226
|
})
|
|
242
|
-
}), { gsl:
|
|
227
|
+
}), { gsl: Ge, gslByUid: Xe } = c({
|
|
243
228
|
itemType: "DROPDOWN",
|
|
244
229
|
entryShape: "keyed",
|
|
245
230
|
sensibleDefaults: {
|
|
@@ -261,7 +246,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
261
246
|
...e.validator != null ? { validator: e.validator } : {},
|
|
262
247
|
props: b(e)
|
|
263
248
|
})
|
|
264
|
-
}), { gsl:
|
|
249
|
+
}), { gsl: He, gslByUid: Ze } = c({
|
|
265
250
|
itemType: "RADIOGROUP",
|
|
266
251
|
entryShape: "keyed",
|
|
267
252
|
sensibleDefaults: {
|
|
@@ -280,7 +265,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
280
265
|
...e.validator != null ? { validator: e.validator } : {},
|
|
281
266
|
props: b(e)
|
|
282
267
|
})
|
|
283
|
-
}), { gsl:
|
|
268
|
+
}), { gsl: qe, gslByUid: Je } = c({
|
|
284
269
|
itemType: "CHECKBOX",
|
|
285
270
|
entryShape: "keyed",
|
|
286
271
|
sensibleDefaults: {
|
|
@@ -299,7 +284,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
299
284
|
...e.validator != null ? { validator: g(e.validator, "boolean") } : {},
|
|
300
285
|
props: b(e)
|
|
301
286
|
})
|
|
302
|
-
}), { gsl:
|
|
287
|
+
}), { gsl: Qe, gslByUid: et } = c({
|
|
303
288
|
itemType: "TEXTAREA",
|
|
304
289
|
entryShape: "keyed",
|
|
305
290
|
sensibleDefaults: {
|
|
@@ -318,7 +303,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
318
303
|
...e.validator != null ? { validator: g(e.validator, "string") } : {},
|
|
319
304
|
props: b(e)
|
|
320
305
|
})
|
|
321
|
-
}), { gsl:
|
|
306
|
+
}), { gsl: tt, gslByUid: st } = c({
|
|
322
307
|
itemType: "PASSWORD",
|
|
323
308
|
entryShape: "keyed",
|
|
324
309
|
sensibleDefaults: {
|
|
@@ -337,7 +322,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
337
322
|
...e.validator != null ? { validator: g(e.validator, "string") } : {},
|
|
338
323
|
props: b(e)
|
|
339
324
|
})
|
|
340
|
-
}), { gsl:
|
|
325
|
+
}), { gsl: lt, gslByUid: at } = c({
|
|
341
326
|
itemType: "CURRENCY",
|
|
342
327
|
entryShape: "keyed",
|
|
343
328
|
sensibleDefaults: {
|
|
@@ -356,7 +341,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
356
341
|
...e.validator != null ? { validator: g(e.validator, "number") } : {},
|
|
357
342
|
props: b(e)
|
|
358
343
|
})
|
|
359
|
-
}), { gsl:
|
|
344
|
+
}), { gsl: nt, gslByUid: it } = c({
|
|
360
345
|
itemType: "MARKDOWN",
|
|
361
346
|
entryShape: "keyed",
|
|
362
347
|
sensibleDefaults: {
|
|
@@ -375,7 +360,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
375
360
|
...e.validator != null ? { validator: g(e.validator, "string") } : {},
|
|
376
361
|
props: b(e)
|
|
377
362
|
})
|
|
378
|
-
}), { gsl:
|
|
363
|
+
}), { gsl: rt, gslByUid: ot } = c({
|
|
379
364
|
itemType: "LIST",
|
|
380
365
|
entryShape: "keyed",
|
|
381
366
|
sensibleDefaults: {
|
|
@@ -394,7 +379,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
394
379
|
...e.validator != null ? { validator: e.validator } : {},
|
|
395
380
|
props: b(e)
|
|
396
381
|
})
|
|
397
|
-
}), { gsl:
|
|
382
|
+
}), { gsl: ut, gslByUid: pt } = c({
|
|
398
383
|
itemType: "CALENDAR",
|
|
399
384
|
entryShape: "bare",
|
|
400
385
|
sensibleDefaults: {
|
|
@@ -413,7 +398,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
413
398
|
...e.validator != null ? { validator: g(e.validator, "string") } : {},
|
|
414
399
|
props: b(e)
|
|
415
400
|
})
|
|
416
|
-
}), { gsl:
|
|
401
|
+
}), { gsl: ct, gslByUid: dt } = c({
|
|
417
402
|
itemType: "DATE_INPUT",
|
|
418
403
|
entryShape: "keyed",
|
|
419
404
|
sensibleDefaults: {
|
|
@@ -432,7 +417,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
432
417
|
...e.validator != null ? { validator: g(e.validator, "string") } : {},
|
|
433
418
|
props: b(e)
|
|
434
419
|
})
|
|
435
|
-
}), { gsl:
|
|
420
|
+
}), { gsl: yt, gslByUid: bt } = c({
|
|
436
421
|
itemType: "DATE_PICKER",
|
|
437
422
|
entryShape: "keyed",
|
|
438
423
|
sensibleDefaults: {
|
|
@@ -454,7 +439,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
454
439
|
...e.validator != null ? { validator: g(e.validator, "string") } : {},
|
|
455
440
|
props: b(e)
|
|
456
441
|
})
|
|
457
|
-
}), { gsl:
|
|
442
|
+
}), { gsl: mt, gslByUid: ht } = c({
|
|
458
443
|
itemType: "RANGE_CALENDAR",
|
|
459
444
|
entryShape: "keyed",
|
|
460
445
|
sensibleDefaults: {
|
|
@@ -473,7 +458,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
473
458
|
...e.validator != null ? { validator: g(e.validator, "array") } : {},
|
|
474
459
|
props: b(e)
|
|
475
460
|
})
|
|
476
|
-
}), { gsl:
|
|
461
|
+
}), { gsl: gt, gslByUid: Tt } = c({
|
|
477
462
|
itemType: "RANGE_DATE_INPUT",
|
|
478
463
|
entryShape: "keyed",
|
|
479
464
|
sensibleDefaults: {
|
|
@@ -492,7 +477,7 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
492
477
|
...e.validator != null ? { validator: g(e.validator, "array") } : {},
|
|
493
478
|
props: b(e)
|
|
494
479
|
})
|
|
495
|
-
}), { gsl:
|
|
480
|
+
}), { gsl: St, gslByUid: At } = c({
|
|
496
481
|
itemType: "RANGE_DATE_PICKER",
|
|
497
482
|
entryShape: "keyed",
|
|
498
483
|
sensibleDefaults: {
|
|
@@ -515,11 +500,11 @@ const { gsl: Ke, gslByUid: Ve } = c({
|
|
|
515
500
|
props: b(e)
|
|
516
501
|
})
|
|
517
502
|
});
|
|
518
|
-
function
|
|
503
|
+
function Q(e) {
|
|
519
504
|
const t = {};
|
|
520
505
|
return e.addLabel != null && (t.addLabel = e.addLabel), e.removeLabel != null && (t.removeLabel = e.removeLabel), e.limit != null && (t.limit = e.limit), e.title != null && (t.title = e.title), e.addButtonIcon != null && (t.addButtonIcon = e.addButtonIcon), e.removeButtonIcon != null && (t.removeButtonIcon = e.removeButtonIcon), t;
|
|
521
506
|
}
|
|
522
|
-
function
|
|
507
|
+
function ee(e) {
|
|
523
508
|
return {
|
|
524
509
|
uid: e.uid ?? "",
|
|
525
510
|
kind: "input",
|
|
@@ -530,24 +515,24 @@ function se(e) {
|
|
|
530
515
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
531
516
|
...e.validator != null ? { validator: g(e.validator, "array") } : {},
|
|
532
517
|
props: {
|
|
533
|
-
...
|
|
518
|
+
...Q(e),
|
|
534
519
|
template: { kind: "layout", type: "flex", children: [], props: { direction: "column" } }
|
|
535
520
|
}
|
|
536
521
|
};
|
|
537
522
|
}
|
|
538
|
-
function
|
|
523
|
+
function L(e, t) {
|
|
539
524
|
for (const s of e) {
|
|
540
525
|
if (typeof s == "function") continue;
|
|
541
|
-
const
|
|
542
|
-
typeof
|
|
543
|
-
const
|
|
544
|
-
|
|
526
|
+
const a = s;
|
|
527
|
+
typeof a.path == "string" && a.path && (a.path = t + a.path), "children" in a && Array.isArray(a.children) && L(a.children, t);
|
|
528
|
+
const l = a.props;
|
|
529
|
+
l?.template?.children && Array.isArray(l.template.children) && L(l.template.children, t);
|
|
545
530
|
}
|
|
546
531
|
}
|
|
547
|
-
function
|
|
548
|
-
const s = t.walkChildren(t.children ?? []),
|
|
549
|
-
|
|
550
|
-
const
|
|
532
|
+
function te(e, t) {
|
|
533
|
+
const s = t.walkChildren(t.children ?? []), a = e.kind === "static" ? e.def.path ?? "" : e.fn({})?.path ?? "";
|
|
534
|
+
a && L(s, a + ".items.");
|
|
535
|
+
const l = {
|
|
551
536
|
kind: "layout",
|
|
552
537
|
type: "flex",
|
|
553
538
|
uid: "",
|
|
@@ -558,166 +543,150 @@ function le(e, t) {
|
|
|
558
543
|
const i = t.mapStaticDef(e.def, "REPEATER");
|
|
559
544
|
return {
|
|
560
545
|
...i,
|
|
561
|
-
props: { ...i.props, template:
|
|
546
|
+
props: { ...i.props, template: l }
|
|
562
547
|
};
|
|
563
548
|
}
|
|
564
549
|
const n = e.fn;
|
|
565
550
|
return ((i) => {
|
|
566
|
-
const
|
|
551
|
+
const o = n(i), r = t.mapStaticDef(o, "REPEATER");
|
|
567
552
|
return {
|
|
568
|
-
...
|
|
569
|
-
props: { ...
|
|
553
|
+
...r,
|
|
554
|
+
props: { ...r.props, template: l }
|
|
570
555
|
};
|
|
571
556
|
});
|
|
572
557
|
}
|
|
573
|
-
function
|
|
558
|
+
function se(e) {
|
|
574
559
|
return {
|
|
575
560
|
baseDef: e.def,
|
|
576
561
|
path: e.key,
|
|
577
562
|
children: e.children
|
|
578
563
|
};
|
|
579
564
|
}
|
|
580
|
-
function
|
|
565
|
+
function le(e) {
|
|
581
566
|
return e.children;
|
|
582
567
|
}
|
|
583
|
-
const
|
|
584
|
-
parseEntry:
|
|
568
|
+
const ae = {
|
|
569
|
+
parseEntry: se,
|
|
585
570
|
rollUpSensibleDefaults: () => ({}),
|
|
586
571
|
applySensibleDefaults: (e) => e,
|
|
587
|
-
mapToWidget:
|
|
588
|
-
buildCustomWidget:
|
|
589
|
-
getChildren:
|
|
572
|
+
mapToWidget: ee,
|
|
573
|
+
buildCustomWidget: te,
|
|
574
|
+
getChildren: le
|
|
590
575
|
};
|
|
591
|
-
|
|
592
|
-
const
|
|
576
|
+
x("REPEATER", ae);
|
|
577
|
+
const ne = R("REPEATER"), kt = (e, t) => ne(t, ((s) => s.uid === e)), j = {
|
|
593
578
|
onLoad: "load",
|
|
594
579
|
onChange: "change",
|
|
595
580
|
onFilter: "filter",
|
|
596
581
|
onBlur: "blur"
|
|
597
|
-
},
|
|
598
|
-
class
|
|
582
|
+
}, ie = Object.keys(j);
|
|
583
|
+
class re {
|
|
599
584
|
// ── Action-specific: onClick + submit ─────────────────────────
|
|
600
|
-
extractOnClickFromMergeResult(t, s,
|
|
585
|
+
extractOnClickFromMergeResult(t, s, a, l) {
|
|
601
586
|
if (t.kind === "dynamic") {
|
|
602
|
-
const
|
|
587
|
+
const o = t.fn;
|
|
603
588
|
return { kind: "dynamic", fn: (u) => {
|
|
604
|
-
const p =
|
|
605
|
-
return this.wireOnClick(p, s,
|
|
589
|
+
const p = o(u);
|
|
590
|
+
return this.wireOnClick(p, s, a, l);
|
|
606
591
|
} };
|
|
607
592
|
}
|
|
608
593
|
const n = t.def;
|
|
609
|
-
return { kind: "static", def: this.wireOnClick(n, s,
|
|
610
|
-
}
|
|
611
|
-
countSubmitButtons(t) {
|
|
612
|
-
let s = 0;
|
|
613
|
-
for (const l of t) {
|
|
614
|
-
if (l.type !== "ITEMS") continue;
|
|
615
|
-
const a = f(l.itemType);
|
|
616
|
-
for (const n of l.items) {
|
|
617
|
-
const i = a.getChildren?.(n);
|
|
618
|
-
if (i && (s += this.countSubmitButtons(i)), l.itemType === U.ACTIONS) {
|
|
619
|
-
if (typeof n == "function") continue;
|
|
620
|
-
const r = n;
|
|
621
|
-
(r.uid === "#submit" || r.onClick === "submit") && s++;
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
return s;
|
|
594
|
+
return { kind: "static", def: this.wireOnClick(n, s, a, l) };
|
|
626
595
|
}
|
|
627
|
-
wireOnClick(t, s,
|
|
628
|
-
const n = t.uid === "#submit" || t.onClick === "submit", i = n ? "#submit" :
|
|
596
|
+
wireOnClick(t, s, a, l) {
|
|
597
|
+
const n = t.uid === "#submit" || t.onClick === "submit", i = n ? "#submit" : l.next(), o = n ? "submit" : i, r = t.onClick, p = (typeof r == "function" ? r : void 0) ?? (n ? a.onSubmit : void 0);
|
|
629
598
|
if (p) {
|
|
630
|
-
s.set(
|
|
599
|
+
s.set(o, (T) => p(T.data));
|
|
631
600
|
const { onClick: y, ...d } = t;
|
|
632
|
-
return { ...d, uid: i, on: { click:
|
|
601
|
+
return { ...d, uid: i, on: { click: o } };
|
|
633
602
|
}
|
|
634
603
|
if (n) {
|
|
635
604
|
const { onClick: y, ...d } = t;
|
|
636
605
|
return { ...d, uid: i, on: { click: "submit" } };
|
|
637
606
|
}
|
|
638
|
-
if (typeof
|
|
607
|
+
if (typeof r == "string") {
|
|
639
608
|
const { onClick: y, ...d } = t;
|
|
640
|
-
return { ...d, uid: i, on: { click:
|
|
609
|
+
return { ...d, uid: i, on: { click: r } };
|
|
641
610
|
}
|
|
642
611
|
return { ...t, uid: i };
|
|
643
612
|
}
|
|
644
613
|
// ── Universal: onLoad, onChange, onFilter ──────────────────────
|
|
645
|
-
wireInputLayoutEvents(t, s,
|
|
614
|
+
wireInputLayoutEvents(t, s, a) {
|
|
646
615
|
if (t.kind === "dynamic") {
|
|
647
616
|
const n = t.fn;
|
|
648
|
-
return { kind: "dynamic", fn: (
|
|
649
|
-
const
|
|
650
|
-
return this.wireEventProperties(
|
|
617
|
+
return { kind: "dynamic", fn: (o) => {
|
|
618
|
+
const r = n(o);
|
|
619
|
+
return this.wireEventProperties(r, s, a);
|
|
651
620
|
} };
|
|
652
621
|
}
|
|
653
|
-
return { kind: "static", def: this.wireEventProperties(t.def, s,
|
|
622
|
+
return { kind: "static", def: this.wireEventProperties(t.def, s, a) };
|
|
654
623
|
}
|
|
655
|
-
wireEventProperties(t, s,
|
|
656
|
-
const
|
|
624
|
+
wireEventProperties(t, s, a) {
|
|
625
|
+
const l = { ...t.on || {} };
|
|
657
626
|
let n = !1;
|
|
658
627
|
const i = { ...t };
|
|
659
|
-
for (const
|
|
660
|
-
const
|
|
661
|
-
if (
|
|
662
|
-
const u =
|
|
663
|
-
if (typeof
|
|
664
|
-
const p =
|
|
665
|
-
s.set(p,
|
|
666
|
-
} else typeof
|
|
667
|
-
delete i[
|
|
628
|
+
for (const o of ie) {
|
|
629
|
+
const r = t[o];
|
|
630
|
+
if (r == null) continue;
|
|
631
|
+
const u = j[o];
|
|
632
|
+
if (typeof r == "function") {
|
|
633
|
+
const p = a.next();
|
|
634
|
+
s.set(p, r), l[u] = p, n = !0;
|
|
635
|
+
} else typeof r == "string" && (l[u] = r, n = !0);
|
|
636
|
+
delete i[o];
|
|
668
637
|
}
|
|
669
|
-
return n && (i.on =
|
|
638
|
+
return n && (i.on = l), i;
|
|
670
639
|
}
|
|
671
640
|
}
|
|
672
|
-
const
|
|
673
|
-
function
|
|
641
|
+
const E = new re();
|
|
642
|
+
function oe(e) {
|
|
674
643
|
const {
|
|
675
644
|
uid: t,
|
|
676
645
|
label: s,
|
|
677
|
-
disabled:
|
|
678
|
-
on:
|
|
646
|
+
disabled: a,
|
|
647
|
+
on: l,
|
|
679
648
|
onClick: n,
|
|
680
649
|
data: i,
|
|
681
|
-
type:
|
|
682
|
-
tags:
|
|
650
|
+
type: o,
|
|
651
|
+
tags: r,
|
|
683
652
|
size: u,
|
|
684
653
|
include: p,
|
|
685
654
|
exclude: y,
|
|
686
655
|
states: d,
|
|
687
|
-
...
|
|
656
|
+
...T
|
|
688
657
|
} = e;
|
|
689
658
|
return {
|
|
690
659
|
uid: t ?? "",
|
|
691
660
|
kind: "action",
|
|
692
661
|
type: "button",
|
|
693
|
-
disabled:
|
|
662
|
+
disabled: a,
|
|
694
663
|
label: s,
|
|
695
|
-
...
|
|
696
|
-
props:
|
|
664
|
+
...l != null ? { on: l } : {},
|
|
665
|
+
props: T
|
|
697
666
|
};
|
|
698
667
|
}
|
|
699
|
-
const { gsl:
|
|
668
|
+
const { gsl: _t, gslByUid: vt } = c({
|
|
700
669
|
itemType: "ACTIONS",
|
|
701
670
|
entryShape: "bare",
|
|
702
|
-
mapToWidget:
|
|
703
|
-
afterMerge: (e, t) =>
|
|
671
|
+
mapToWidget: oe,
|
|
672
|
+
afterMerge: (e, t) => E.extractOnClickFromMergeResult(
|
|
704
673
|
e,
|
|
705
674
|
t.eventRegistry,
|
|
706
675
|
t.formConfig,
|
|
707
676
|
t.eventIdGenerator
|
|
708
677
|
)
|
|
709
678
|
});
|
|
710
|
-
function
|
|
679
|
+
function ue(e) {
|
|
711
680
|
const {
|
|
712
681
|
uid: t,
|
|
713
682
|
widgetName: s,
|
|
714
|
-
tags:
|
|
715
|
-
size:
|
|
683
|
+
tags: a,
|
|
684
|
+
size: l,
|
|
716
685
|
onChange: n,
|
|
717
686
|
include: i,
|
|
718
|
-
exclude:
|
|
719
|
-
...
|
|
720
|
-
} = e, { on: u, ...p } =
|
|
687
|
+
exclude: o,
|
|
688
|
+
...r
|
|
689
|
+
} = e, { on: u, ...p } = r;
|
|
721
690
|
return {
|
|
722
691
|
uid: t ?? "",
|
|
723
692
|
kind: "layout",
|
|
@@ -729,27 +698,27 @@ function ce(e) {
|
|
|
729
698
|
children: []
|
|
730
699
|
};
|
|
731
700
|
}
|
|
732
|
-
function
|
|
701
|
+
function pe(e, t) {
|
|
733
702
|
const s = t.walkChildren(t.children ?? []);
|
|
734
703
|
if (e.kind === "static")
|
|
735
704
|
return { ...t.mapStaticDef(e.def, "LAYOUTS"), children: s };
|
|
736
|
-
const
|
|
737
|
-
return ((
|
|
738
|
-
const n = l
|
|
705
|
+
const a = e.fn;
|
|
706
|
+
return ((l) => {
|
|
707
|
+
const n = a(l);
|
|
739
708
|
return { ...t.mapStaticDef(n, "LAYOUTS"), children: s };
|
|
740
709
|
});
|
|
741
710
|
}
|
|
742
|
-
function
|
|
711
|
+
function ce(e) {
|
|
743
712
|
return e.children;
|
|
744
713
|
}
|
|
745
|
-
const { gsl:
|
|
714
|
+
const { gsl: Ct, gslByUid: ft } = c({
|
|
746
715
|
itemType: "LAYOUTS",
|
|
747
716
|
entryShape: "compound",
|
|
748
|
-
mapToWidget:
|
|
749
|
-
buildCustomWidget:
|
|
750
|
-
getChildren:
|
|
717
|
+
mapToWidget: ue,
|
|
718
|
+
buildCustomWidget: pe,
|
|
719
|
+
getChildren: ce
|
|
751
720
|
});
|
|
752
|
-
function
|
|
721
|
+
function de(e) {
|
|
753
722
|
return {
|
|
754
723
|
uid: "",
|
|
755
724
|
kind: "display",
|
|
@@ -757,37 +726,37 @@ function be(e) {
|
|
|
757
726
|
props: { render: e.render }
|
|
758
727
|
};
|
|
759
728
|
}
|
|
760
|
-
function
|
|
729
|
+
function ye(e, t) {
|
|
761
730
|
if (e.kind === "static") {
|
|
762
|
-
const
|
|
763
|
-
return ((
|
|
731
|
+
const a = e.def;
|
|
732
|
+
return ((l) => ({
|
|
764
733
|
uid: "",
|
|
765
734
|
kind: "display",
|
|
766
735
|
type: "renderer",
|
|
767
|
-
...
|
|
768
|
-
...
|
|
769
|
-
props: { render:
|
|
736
|
+
...a.include != null ? { include: a.include } : {},
|
|
737
|
+
...a.exclude != null ? { exclude: a.exclude } : {},
|
|
738
|
+
props: { render: a.render(l ?? {}) }
|
|
770
739
|
}));
|
|
771
740
|
}
|
|
772
741
|
const s = e.fn;
|
|
773
|
-
return ((
|
|
774
|
-
const
|
|
742
|
+
return ((a) => {
|
|
743
|
+
const l = s(a);
|
|
775
744
|
return {
|
|
776
745
|
uid: "",
|
|
777
746
|
kind: "display",
|
|
778
747
|
type: "renderer",
|
|
779
|
-
...
|
|
780
|
-
...
|
|
781
|
-
props: { render:
|
|
748
|
+
...l.include != null ? { include: l.include } : {},
|
|
749
|
+
...l.exclude != null ? { exclude: l.exclude } : {},
|
|
750
|
+
props: { render: l.render(a ?? {}) }
|
|
782
751
|
};
|
|
783
752
|
});
|
|
784
753
|
}
|
|
785
|
-
const { gsl:
|
|
754
|
+
const { gsl: Ut, gslByUid: Ot } = c({
|
|
786
755
|
itemType: "DISPLAYS",
|
|
787
756
|
entryShape: "bare",
|
|
788
|
-
mapToWidget:
|
|
789
|
-
buildCustomWidget:
|
|
790
|
-
}), { gsl:
|
|
757
|
+
mapToWidget: de,
|
|
758
|
+
buildCustomWidget: ye
|
|
759
|
+
}), { gsl: Lt, gslByUid: Et } = c({
|
|
791
760
|
itemType: "ALERTS",
|
|
792
761
|
entryShape: "bare",
|
|
793
762
|
mapToWidget: (e) => ({
|
|
@@ -800,7 +769,7 @@ const { gsl: Lt, gslByUid: Et } = c({
|
|
|
800
769
|
}
|
|
801
770
|
})
|
|
802
771
|
});
|
|
803
|
-
function
|
|
772
|
+
function be(e) {
|
|
804
773
|
return {
|
|
805
774
|
uid: e.uid ?? "",
|
|
806
775
|
kind: "layout",
|
|
@@ -813,27 +782,27 @@ function he(e) {
|
|
|
813
782
|
children: []
|
|
814
783
|
};
|
|
815
784
|
}
|
|
816
|
-
function
|
|
785
|
+
function me(e, t) {
|
|
817
786
|
const s = t.walkChildren(t.children ?? []);
|
|
818
787
|
if (e.kind === "static")
|
|
819
788
|
return { ...t.mapStaticDef(e.def, "TABS"), children: s };
|
|
820
|
-
const
|
|
821
|
-
return ((
|
|
822
|
-
const n = l
|
|
789
|
+
const a = e.fn;
|
|
790
|
+
return ((l) => {
|
|
791
|
+
const n = a(l);
|
|
823
792
|
return { ...t.mapStaticDef(n, "TABS"), children: s };
|
|
824
793
|
});
|
|
825
794
|
}
|
|
826
|
-
function
|
|
795
|
+
function he(e) {
|
|
827
796
|
return e.children;
|
|
828
797
|
}
|
|
829
|
-
const { gsl:
|
|
798
|
+
const { gsl: Dt, gslByUid: Pt } = c({
|
|
830
799
|
itemType: "TABS",
|
|
831
800
|
entryShape: "compound",
|
|
832
|
-
mapToWidget:
|
|
833
|
-
buildCustomWidget:
|
|
834
|
-
getChildren:
|
|
801
|
+
mapToWidget: be,
|
|
802
|
+
buildCustomWidget: me,
|
|
803
|
+
getChildren: he
|
|
835
804
|
});
|
|
836
|
-
function
|
|
805
|
+
function ge(e) {
|
|
837
806
|
return {
|
|
838
807
|
uid: e.uid ?? "",
|
|
839
808
|
kind: "layout",
|
|
@@ -847,26 +816,26 @@ function Te(e) {
|
|
|
847
816
|
children: []
|
|
848
817
|
};
|
|
849
818
|
}
|
|
850
|
-
function
|
|
819
|
+
function Te(e, t) {
|
|
851
820
|
const s = t.walkChildren(t.children ?? []);
|
|
852
821
|
if (e.kind === "static")
|
|
853
822
|
return { ...t.mapStaticDef(e.def, "ACCORDION"), children: s };
|
|
854
|
-
const
|
|
855
|
-
return ((
|
|
856
|
-
const n = l
|
|
823
|
+
const a = e.fn;
|
|
824
|
+
return ((l) => {
|
|
825
|
+
const n = a(l);
|
|
857
826
|
return { ...t.mapStaticDef(n, "ACCORDION"), children: s };
|
|
858
827
|
});
|
|
859
828
|
}
|
|
860
|
-
function
|
|
829
|
+
function Se(e) {
|
|
861
830
|
return e.children;
|
|
862
831
|
}
|
|
863
|
-
const { gsl:
|
|
832
|
+
const { gsl: It, gslByUid: Wt } = c({
|
|
864
833
|
itemType: "ACCORDION",
|
|
865
834
|
entryShape: "compound",
|
|
866
|
-
mapToWidget:
|
|
867
|
-
buildCustomWidget:
|
|
868
|
-
getChildren:
|
|
869
|
-
}), { gsl:
|
|
835
|
+
mapToWidget: ge,
|
|
836
|
+
buildCustomWidget: Te,
|
|
837
|
+
getChildren: Se
|
|
838
|
+
}), { gsl: wt, gslByUid: Bt } = c({
|
|
870
839
|
itemType: "CUSTOM_INPUT",
|
|
871
840
|
entryShape: "keyed",
|
|
872
841
|
sensibleDefaults: {
|
|
@@ -888,24 +857,24 @@ const { gsl: wt, gslByUid: Bt } = c({
|
|
|
888
857
|
...e.validator != null ? { validator: e.validator } : {},
|
|
889
858
|
props: e.props ?? {}
|
|
890
859
|
})
|
|
891
|
-
}), { gsl:
|
|
860
|
+
}), { gsl: Mt, gslByUid: Nt } = c({
|
|
892
861
|
itemType: "CUSTOM_ACTION",
|
|
893
862
|
entryShape: "bare",
|
|
894
863
|
mapToWidget: (e) => {
|
|
895
864
|
const {
|
|
896
865
|
uid: t,
|
|
897
866
|
label: s,
|
|
898
|
-
disabled:
|
|
899
|
-
on:
|
|
867
|
+
disabled: a,
|
|
868
|
+
on: l,
|
|
900
869
|
onClick: n,
|
|
901
870
|
data: i,
|
|
902
|
-
customType:
|
|
903
|
-
tags:
|
|
871
|
+
customType: o,
|
|
872
|
+
tags: r,
|
|
904
873
|
size: u,
|
|
905
874
|
include: p,
|
|
906
875
|
exclude: y,
|
|
907
876
|
states: d,
|
|
908
|
-
props:
|
|
877
|
+
props: T,
|
|
909
878
|
..._
|
|
910
879
|
} = e;
|
|
911
880
|
return {
|
|
@@ -913,18 +882,18 @@ const { gsl: wt, gslByUid: Bt } = c({
|
|
|
913
882
|
kind: "action",
|
|
914
883
|
type: e.customType,
|
|
915
884
|
label: s,
|
|
916
|
-
disabled:
|
|
917
|
-
...
|
|
918
|
-
props: { ...
|
|
885
|
+
disabled: a,
|
|
886
|
+
...l != null ? { on: l } : {},
|
|
887
|
+
props: { ...T, ..._ }
|
|
919
888
|
};
|
|
920
889
|
},
|
|
921
|
-
afterMerge: (e, t) =>
|
|
890
|
+
afterMerge: (e, t) => E.extractOnClickFromMergeResult(
|
|
922
891
|
e,
|
|
923
892
|
t.eventRegistry,
|
|
924
893
|
t.formConfig,
|
|
925
894
|
t.eventIdGenerator
|
|
926
895
|
)
|
|
927
|
-
}), { gsl:
|
|
896
|
+
}), { gsl: Rt, gslByUid: xt } = c({
|
|
928
897
|
itemType: "CUSTOM_DISPLAY",
|
|
929
898
|
entryShape: "bare",
|
|
930
899
|
mapToWidget: (e) => ({
|
|
@@ -934,7 +903,7 @@ const { gsl: wt, gslByUid: Bt } = c({
|
|
|
934
903
|
props: e.props ?? {}
|
|
935
904
|
})
|
|
936
905
|
});
|
|
937
|
-
function
|
|
906
|
+
function Ae(e) {
|
|
938
907
|
return {
|
|
939
908
|
uid: e.uid ?? "",
|
|
940
909
|
kind: "layout",
|
|
@@ -943,26 +912,26 @@ function fe(e) {
|
|
|
943
912
|
children: []
|
|
944
913
|
};
|
|
945
914
|
}
|
|
946
|
-
function
|
|
915
|
+
function ke(e, t) {
|
|
947
916
|
const s = t.walkChildren(t.children ?? []);
|
|
948
917
|
if (e.kind === "static")
|
|
949
918
|
return { ...t.mapStaticDef(e.def, "CUSTOM_LAYOUT"), children: s };
|
|
950
|
-
const
|
|
951
|
-
return ((
|
|
952
|
-
const n = l
|
|
919
|
+
const a = e.fn;
|
|
920
|
+
return ((l) => {
|
|
921
|
+
const n = a(l);
|
|
953
922
|
return { ...t.mapStaticDef(n, "CUSTOM_LAYOUT"), children: s };
|
|
954
923
|
});
|
|
955
924
|
}
|
|
956
|
-
function
|
|
925
|
+
function _e(e) {
|
|
957
926
|
return e.children;
|
|
958
927
|
}
|
|
959
|
-
const { gsl:
|
|
928
|
+
const { gsl: Ft, gslByUid: jt } = c({
|
|
960
929
|
itemType: "CUSTOM_LAYOUT",
|
|
961
930
|
entryShape: "compound",
|
|
962
|
-
mapToWidget:
|
|
963
|
-
buildCustomWidget:
|
|
964
|
-
getChildren:
|
|
965
|
-
}),
|
|
931
|
+
mapToWidget: Ae,
|
|
932
|
+
buildCustomWidget: ke,
|
|
933
|
+
getChildren: _e
|
|
934
|
+
}), $ = {
|
|
966
935
|
INPUTS: /* @__PURE__ */ new Set([
|
|
967
936
|
"INPUTS",
|
|
968
937
|
"TEXTAREA",
|
|
@@ -988,55 +957,55 @@ const { gsl: $t, gslByUid: Yt } = c({
|
|
|
988
957
|
LAYOUTS: /* @__PURE__ */ new Set(["LAYOUTS", "TABS", "ACCORDION", "CUSTOM_LAYOUT"])
|
|
989
958
|
};
|
|
990
959
|
function ve(e, t) {
|
|
991
|
-
const s =
|
|
960
|
+
const s = $[e];
|
|
992
961
|
return s ? s.has(t) : e === t;
|
|
993
962
|
}
|
|
994
|
-
class
|
|
963
|
+
class Ce {
|
|
995
964
|
resolve(t, s) {
|
|
996
|
-
const
|
|
965
|
+
const a = [];
|
|
997
966
|
for (const n of s)
|
|
998
|
-
n.kind === "aggregated" ? this.collectFromAggregated(n, t,
|
|
999
|
-
const
|
|
967
|
+
n.kind === "aggregated" ? this.collectFromAggregated(n, t, a) : this.collectFromLeaf(n, t, a);
|
|
968
|
+
const l = this.rollUpSensibleDefaults(a);
|
|
1000
969
|
return {
|
|
1001
|
-
leafSelectors:
|
|
1002
|
-
sensibleDefaults:
|
|
970
|
+
leafSelectors: a,
|
|
971
|
+
sensibleDefaults: l
|
|
1003
972
|
};
|
|
1004
973
|
}
|
|
1005
|
-
collectFromAggregated(t, s,
|
|
974
|
+
collectFromAggregated(t, s, a) {
|
|
1006
975
|
if (t.matcher(s))
|
|
1007
|
-
for (const
|
|
1008
|
-
this.collectFromLeaf(
|
|
976
|
+
for (const l of t.children)
|
|
977
|
+
this.collectFromLeaf(l, s, a);
|
|
1009
978
|
}
|
|
1010
|
-
collectFromLeaf(t, s,
|
|
1011
|
-
ve(t.selectorType, s.itemType ?? "") && t.matcher(s) &&
|
|
979
|
+
collectFromLeaf(t, s, a) {
|
|
980
|
+
ve(t.selectorType, s.itemType ?? "") && t.matcher(s) && a.push(t);
|
|
1012
981
|
}
|
|
1013
982
|
rollUpSensibleDefaults(t) {
|
|
1014
|
-
const s = /* @__PURE__ */ new Map(),
|
|
1015
|
-
const
|
|
1016
|
-
|
|
983
|
+
const s = /* @__PURE__ */ new Map(), a = (n, i) => {
|
|
984
|
+
const o = s.get(n) ?? [];
|
|
985
|
+
o.push(i), s.set(n, o);
|
|
1017
986
|
};
|
|
1018
987
|
for (const n of t) {
|
|
1019
|
-
const i =
|
|
988
|
+
const i = $[n.selectorType];
|
|
1020
989
|
if (i)
|
|
1021
|
-
for (const
|
|
990
|
+
for (const o of i) a(o, n);
|
|
1022
991
|
else
|
|
1023
|
-
|
|
992
|
+
a(n.selectorType, n);
|
|
1024
993
|
}
|
|
1025
|
-
const
|
|
994
|
+
const l = {};
|
|
1026
995
|
for (const [n, i] of s)
|
|
1027
|
-
|
|
1028
|
-
return
|
|
996
|
+
F(n) && (l[n] = f(n).rollUpSensibleDefaults(i));
|
|
997
|
+
return l;
|
|
1029
998
|
}
|
|
1030
999
|
}
|
|
1031
|
-
const
|
|
1032
|
-
class
|
|
1000
|
+
const fe = new Ce();
|
|
1001
|
+
class Ue {
|
|
1033
1002
|
constructor(t) {
|
|
1034
1003
|
this.objectUtils = t;
|
|
1035
1004
|
}
|
|
1036
|
-
merge(t, s,
|
|
1037
|
-
let
|
|
1005
|
+
merge(t, s, a) {
|
|
1006
|
+
let l = {}, n = null;
|
|
1038
1007
|
typeof t == "function" && (n = t);
|
|
1039
|
-
const i = this.collectDecorators(
|
|
1008
|
+
const i = this.collectDecorators(a);
|
|
1040
1009
|
for (const u of i) {
|
|
1041
1010
|
if (n != null) {
|
|
1042
1011
|
n = this.composeRuntimeFunctions(n, u);
|
|
@@ -1044,87 +1013,87 @@ class Le {
|
|
|
1044
1013
|
}
|
|
1045
1014
|
if (typeof u == "function") {
|
|
1046
1015
|
const p = u({
|
|
1047
|
-
...
|
|
1016
|
+
...l,
|
|
1048
1017
|
...typeof t == "function" ? {} : t
|
|
1049
1018
|
});
|
|
1050
1019
|
if (typeof p == "function") {
|
|
1051
1020
|
n = this.createPromotedFunction(
|
|
1052
|
-
|
|
1021
|
+
l,
|
|
1053
1022
|
t,
|
|
1054
1023
|
p,
|
|
1055
1024
|
s,
|
|
1056
|
-
|
|
1025
|
+
a
|
|
1057
1026
|
);
|
|
1058
1027
|
continue;
|
|
1059
1028
|
}
|
|
1060
|
-
|
|
1029
|
+
l = this.objectUtils.deepMerge(l, p);
|
|
1061
1030
|
} else
|
|
1062
|
-
|
|
1031
|
+
l = this.objectUtils.deepMerge(l, u);
|
|
1063
1032
|
}
|
|
1064
1033
|
if (n != null)
|
|
1065
1034
|
return {
|
|
1066
1035
|
kind: "dynamic",
|
|
1067
|
-
fn: this.wrapWithSensibleDefaults(n,
|
|
1036
|
+
fn: this.wrapWithSensibleDefaults(n, l, s, a)
|
|
1068
1037
|
};
|
|
1069
|
-
const
|
|
1070
|
-
return { kind: "static", def: this.applySensibleDefaults({ ...
|
|
1038
|
+
const o = this.objectUtils.deepMerge(t, l);
|
|
1039
|
+
return { kind: "static", def: this.applySensibleDefaults({ ...o }, s, a) };
|
|
1071
1040
|
}
|
|
1072
1041
|
// ── Collect all decorators in priority order ──
|
|
1073
1042
|
collectDecorators(t) {
|
|
1074
1043
|
const s = [];
|
|
1075
|
-
for (const
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1044
|
+
for (const a of t.leafSelectors) {
|
|
1045
|
+
const l = a.config;
|
|
1046
|
+
l.override != null && s.push(l.override);
|
|
1078
1047
|
}
|
|
1079
1048
|
return s;
|
|
1080
1049
|
}
|
|
1081
1050
|
// ── Apply sensible defaults via registry ──
|
|
1082
|
-
applySensibleDefaults(t, s,
|
|
1083
|
-
if (!
|
|
1084
|
-
const
|
|
1085
|
-
return f(s).applySensibleDefaults(t,
|
|
1051
|
+
applySensibleDefaults(t, s, a) {
|
|
1052
|
+
if (!F(s)) return t;
|
|
1053
|
+
const l = a.sensibleDefaults[s] ?? {};
|
|
1054
|
+
return f(s).applySensibleDefaults(t, l);
|
|
1086
1055
|
}
|
|
1087
1056
|
// ── Create promoted FunctionWidget ──
|
|
1088
|
-
createPromotedFunction(t, s,
|
|
1057
|
+
createPromotedFunction(t, s, a, l, n) {
|
|
1089
1058
|
return (i) => {
|
|
1090
|
-
const
|
|
1091
|
-
let
|
|
1092
|
-
return
|
|
1059
|
+
const o = a(i);
|
|
1060
|
+
let r = this.objectUtils.deepMerge(t, o);
|
|
1061
|
+
return r = this.objectUtils.deepMerge(r, s), this.applySensibleDefaults(r, l, n);
|
|
1093
1062
|
};
|
|
1094
1063
|
}
|
|
1095
1064
|
// ── Wrap runtime function with accumulated static decorators and sensible defaults ──
|
|
1096
|
-
wrapWithSensibleDefaults(t, s,
|
|
1065
|
+
wrapWithSensibleDefaults(t, s, a, l) {
|
|
1097
1066
|
return (n) => {
|
|
1098
1067
|
let i = t(n);
|
|
1099
|
-
return Object.keys(s).length > 0 && (i = this.objectUtils.deepMerge(s, i)), this.applySensibleDefaults(i,
|
|
1068
|
+
return Object.keys(s).length > 0 && (i = this.objectUtils.deepMerge(s, i)), this.applySensibleDefaults(i, a, l);
|
|
1100
1069
|
};
|
|
1101
1070
|
}
|
|
1102
1071
|
// ── Compose two runtime functions ──
|
|
1103
1072
|
composeRuntimeFunctions(t, s) {
|
|
1104
|
-
return typeof s == "function" ? (
|
|
1105
|
-
const
|
|
1106
|
-
return typeof n == "function" ? n(
|
|
1107
|
-
} : (
|
|
1108
|
-
const
|
|
1109
|
-
return this.objectUtils.deepMerge(
|
|
1073
|
+
return typeof s == "function" ? (a) => {
|
|
1074
|
+
const l = t(a), n = s(l);
|
|
1075
|
+
return typeof n == "function" ? n(a) : this.objectUtils.deepMerge(n, l);
|
|
1076
|
+
} : (a) => {
|
|
1077
|
+
const l = t(a);
|
|
1078
|
+
return this.objectUtils.deepMerge(l, s);
|
|
1110
1079
|
};
|
|
1111
1080
|
}
|
|
1112
1081
|
}
|
|
1113
|
-
const
|
|
1114
|
-
class
|
|
1082
|
+
const Oe = new Ue(V);
|
|
1083
|
+
class Le {
|
|
1115
1084
|
mapToWidget(t, s) {
|
|
1116
1085
|
if (t.kind === "dynamic") {
|
|
1117
|
-
const
|
|
1118
|
-
return ((
|
|
1119
|
-
const n = l
|
|
1086
|
+
const a = t.fn;
|
|
1087
|
+
return ((l) => {
|
|
1088
|
+
const n = a(l);
|
|
1120
1089
|
return this.mapStaticDef(n, s);
|
|
1121
1090
|
});
|
|
1122
1091
|
}
|
|
1123
1092
|
return this.mapStaticDef(t.def, s);
|
|
1124
1093
|
}
|
|
1125
1094
|
mapStaticDef(t, s) {
|
|
1126
|
-
const
|
|
1127
|
-
return this.applyBaseWidgetFields(
|
|
1095
|
+
const a = f(s).mapToWidget(t);
|
|
1096
|
+
return this.applyBaseWidgetFields(a, t);
|
|
1128
1097
|
}
|
|
1129
1098
|
/**
|
|
1130
1099
|
* Injects BaseWidget-level fields that all widget types share.
|
|
@@ -1134,8 +1103,8 @@ class De {
|
|
|
1134
1103
|
return s.size != null && (t.size = s.size), s.defaultValue != null && t.kind === "input" && (t.defaultValue = s.defaultValue), s.on != null && (t.on = s.on), s.include != null && (t.include = s.include), s.exclude != null && (t.exclude = s.exclude), t;
|
|
1135
1104
|
}
|
|
1136
1105
|
}
|
|
1137
|
-
const
|
|
1138
|
-
class
|
|
1106
|
+
const Ee = new Le();
|
|
1107
|
+
class De {
|
|
1139
1108
|
/**
|
|
1140
1109
|
* Ensures the output is always a uniform GslSelector[] of aggregated selectors.
|
|
1141
1110
|
*
|
|
@@ -1145,35 +1114,34 @@ class Pe {
|
|
|
1145
1114
|
* deals with one shape.
|
|
1146
1115
|
*/
|
|
1147
1116
|
normalizeSelectors(t) {
|
|
1148
|
-
const s = Array.isArray(t) ? t : [t],
|
|
1117
|
+
const s = Array.isArray(t) ? t : [t], a = [], l = [];
|
|
1149
1118
|
for (const n of s)
|
|
1150
|
-
n.kind === "leaf" ?
|
|
1151
|
-
return
|
|
1119
|
+
n.kind === "leaf" ? l.push(n) : a.push(n);
|
|
1120
|
+
return l.length > 0 && a.unshift({
|
|
1152
1121
|
kind: "aggregated",
|
|
1153
1122
|
matcher: () => !0,
|
|
1154
|
-
children:
|
|
1155
|
-
}),
|
|
1123
|
+
children: l
|
|
1124
|
+
}), a;
|
|
1156
1125
|
}
|
|
1157
1126
|
extractFormConfig() {
|
|
1158
1127
|
return {
|
|
1159
1128
|
suppressAutomaticStack: !1,
|
|
1160
|
-
suppressAutomaticSubmit: !1,
|
|
1161
1129
|
onSubmit: (t) => console.log("Form submitted:", t)
|
|
1162
1130
|
};
|
|
1163
1131
|
}
|
|
1164
1132
|
}
|
|
1165
|
-
const
|
|
1133
|
+
const Pe = new De(), Ie = {
|
|
1166
1134
|
input: /* @__PURE__ */ new Set(["disabled", "readonly", "label", "validator", "size"]),
|
|
1167
1135
|
action: /* @__PURE__ */ new Set(["disabled", "label", "size"]),
|
|
1168
1136
|
layout: /* @__PURE__ */ new Set(["size"]),
|
|
1169
1137
|
display: /* @__PURE__ */ new Set([])
|
|
1170
|
-
},
|
|
1138
|
+
}, W = {
|
|
1171
1139
|
onChange: "change",
|
|
1172
1140
|
onLoad: "load",
|
|
1173
1141
|
onFilter: "filter",
|
|
1174
1142
|
onClick: "click"
|
|
1175
1143
|
};
|
|
1176
|
-
class
|
|
1144
|
+
class We {
|
|
1177
1145
|
/**
|
|
1178
1146
|
* Extracts `states` from a merge result, combining with state-targeted
|
|
1179
1147
|
* GSL leaf selectors from `_gslStates`.
|
|
@@ -1181,32 +1149,32 @@ class Be {
|
|
|
1181
1149
|
* Returns a cleaned merge result (no states) and accumulated state data.
|
|
1182
1150
|
*/
|
|
1183
1151
|
extractFromMergeResult(t, s) {
|
|
1184
|
-
const
|
|
1185
|
-
for (const
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1188
|
-
...
|
|
1152
|
+
const a = {};
|
|
1153
|
+
for (const o of s) {
|
|
1154
|
+
const r = o.targetState, u = o.config, p = u.override && typeof u.override != "function" ? u.override : u;
|
|
1155
|
+
a[r] = {
|
|
1156
|
+
...a[r] || {},
|
|
1189
1157
|
...p
|
|
1190
1158
|
};
|
|
1191
1159
|
}
|
|
1192
1160
|
if (t.kind === "dynamic") {
|
|
1193
|
-
const
|
|
1161
|
+
const o = t.fn;
|
|
1194
1162
|
return {
|
|
1195
1163
|
cleanedResult: { kind: "dynamic", fn: (u) => {
|
|
1196
|
-
const p =
|
|
1164
|
+
const p = o(u), { states: y, ...d } = p;
|
|
1197
1165
|
return d;
|
|
1198
1166
|
} },
|
|
1199
|
-
stateData: { stateOverrides:
|
|
1167
|
+
stateData: { stateOverrides: a }
|
|
1200
1168
|
};
|
|
1201
1169
|
}
|
|
1202
|
-
const { states:
|
|
1203
|
-
for (const [
|
|
1204
|
-
i[
|
|
1205
|
-
if (
|
|
1206
|
-
for (const [
|
|
1207
|
-
|
|
1170
|
+
const { states: l, ...n } = t.def, i = {};
|
|
1171
|
+
for (const [o, r] of Object.entries(a))
|
|
1172
|
+
i[o] = { ...r };
|
|
1173
|
+
if (l)
|
|
1174
|
+
for (const [o, r] of Object.entries(
|
|
1175
|
+
l
|
|
1208
1176
|
))
|
|
1209
|
-
i[
|
|
1177
|
+
i[o] = { ...i[o] || {}, ...r };
|
|
1210
1178
|
return {
|
|
1211
1179
|
cleanedResult: { kind: "static", def: n },
|
|
1212
1180
|
stateData: { stateOverrides: i }
|
|
@@ -1219,152 +1187,152 @@ class Be {
|
|
|
1219
1187
|
* - Event handlers → `on: { 'eventType.stateName': eventId }` with registry wiring
|
|
1220
1188
|
* - Custom props → `props: { 'prop.stateName': value }`
|
|
1221
1189
|
*/
|
|
1222
|
-
applyToWidget(t, s,
|
|
1190
|
+
applyToWidget(t, s, a, l) {
|
|
1223
1191
|
const { stateOverrides: n } = s;
|
|
1224
1192
|
if (Object.keys(n).length === 0)
|
|
1225
1193
|
return t;
|
|
1226
|
-
const i = { ...t },
|
|
1194
|
+
const i = { ...t }, o = t.kind, r = Ie[o] || /* @__PURE__ */ new Set();
|
|
1227
1195
|
t.props && (i.props = { ...t.props }), t.on && (i.on = { ...t.on });
|
|
1228
1196
|
for (const [u, p] of Object.entries(n))
|
|
1229
1197
|
for (const [y, d] of Object.entries(p))
|
|
1230
|
-
y === "visible" ? this.applyVisibility(i, u, d) :
|
|
1198
|
+
y === "visible" ? this.applyVisibility(i, u, d) : W[y] ? this.applyStateEvent(i, u, y, d, a, l) : r.has(y) ? i[`${y}.${u}`] = d : (i.props || (i.props = {}), i.props[`${y}.${u}`] = d);
|
|
1231
1199
|
return i;
|
|
1232
1200
|
}
|
|
1233
1201
|
hasStateData(t) {
|
|
1234
1202
|
return Object.keys(t.stateOverrides).length > 0;
|
|
1235
1203
|
}
|
|
1236
1204
|
// ── Visibility helpers ──
|
|
1237
|
-
applyVisibility(t, s,
|
|
1238
|
-
if (
|
|
1239
|
-
const
|
|
1240
|
-
t.include = { ...t.include || {}, in: [...
|
|
1205
|
+
applyVisibility(t, s, a) {
|
|
1206
|
+
if (a) {
|
|
1207
|
+
const l = t.include?.in || [];
|
|
1208
|
+
t.include = { ...t.include || {}, in: [...l, s] };
|
|
1241
1209
|
} else {
|
|
1242
|
-
const
|
|
1243
|
-
t.exclude = { ...t.exclude || {}, from: [...
|
|
1210
|
+
const l = t.exclude?.from || [];
|
|
1211
|
+
t.exclude = { ...t.exclude || {}, from: [...l, s] };
|
|
1244
1212
|
}
|
|
1245
1213
|
}
|
|
1246
1214
|
// ── State-suffixed event helpers ──
|
|
1247
|
-
applyStateEvent(t, s,
|
|
1248
|
-
const
|
|
1249
|
-
if (t.on || (t.on = {}), typeof
|
|
1250
|
-
const
|
|
1251
|
-
n.set(
|
|
1252
|
-
} else typeof
|
|
1215
|
+
applyStateEvent(t, s, a, l, n, i) {
|
|
1216
|
+
const o = W[a];
|
|
1217
|
+
if (t.on || (t.on = {}), typeof l == "function") {
|
|
1218
|
+
const r = i.next();
|
|
1219
|
+
n.set(r, l), t.on[`${o}.${s}`] = r;
|
|
1220
|
+
} else typeof l == "string" && (t.on[`${o}.${s}`] = l);
|
|
1253
1221
|
}
|
|
1254
1222
|
}
|
|
1255
|
-
const
|
|
1256
|
-
function
|
|
1223
|
+
const we = new We();
|
|
1224
|
+
function Be() {
|
|
1257
1225
|
let e = 0;
|
|
1258
1226
|
return { next: () => `event_${e++}` };
|
|
1259
1227
|
}
|
|
1260
|
-
class
|
|
1261
|
-
constructor(t, s,
|
|
1262
|
-
this.resolver = t, this.merger = s, this.mapper =
|
|
1228
|
+
class Me {
|
|
1229
|
+
constructor(t, s, a, l, n) {
|
|
1230
|
+
this.resolver = t, this.merger = s, this.mapper = a, this.eventWiring = l, this.stateExpansion = n;
|
|
1263
1231
|
}
|
|
1264
|
-
walkAndMap(t, s,
|
|
1265
|
-
const
|
|
1232
|
+
walkAndMap(t, s, a) {
|
|
1233
|
+
const l = /* @__PURE__ */ new Map(), n = Be(), i = { value: 0 }, o = /* @__PURE__ */ new Set();
|
|
1266
1234
|
return { widgets: this.walkItems(
|
|
1267
1235
|
t,
|
|
1268
1236
|
s,
|
|
1269
|
-
a,
|
|
1270
1237
|
l,
|
|
1238
|
+
a,
|
|
1271
1239
|
n,
|
|
1272
1240
|
i,
|
|
1273
|
-
|
|
1274
|
-
), eventRegistry:
|
|
1241
|
+
o
|
|
1242
|
+
), eventRegistry: l };
|
|
1275
1243
|
}
|
|
1276
|
-
walkItems(t, s,
|
|
1277
|
-
return t.flatMap((
|
|
1278
|
-
if (
|
|
1244
|
+
walkItems(t, s, a, l, n, i, o) {
|
|
1245
|
+
return t.flatMap((r) => {
|
|
1246
|
+
if (r.type !== "ITEMS")
|
|
1279
1247
|
throw new Error("Unexpected gui shortcut type");
|
|
1280
|
-
return
|
|
1248
|
+
return r.items.map((u) => this.processItem(
|
|
1281
1249
|
u,
|
|
1282
|
-
|
|
1283
|
-
|
|
1250
|
+
r.itemType,
|
|
1251
|
+
r.tags,
|
|
1284
1252
|
s,
|
|
1285
|
-
l,
|
|
1286
1253
|
a,
|
|
1254
|
+
l,
|
|
1287
1255
|
n,
|
|
1288
1256
|
i,
|
|
1289
|
-
|
|
1257
|
+
o
|
|
1290
1258
|
));
|
|
1291
1259
|
});
|
|
1292
1260
|
}
|
|
1293
|
-
processItem(t, s,
|
|
1294
|
-
const p = s, y = f(s), d = y.parseEntry(t),
|
|
1295
|
-
leafSelectors:
|
|
1296
|
-
sensibleDefaults:
|
|
1261
|
+
processItem(t, s, a, l, n, i, o, r, u) {
|
|
1262
|
+
const p = s, y = f(s), d = y.parseEntry(t), T = this.buildBaseDef(d), _ = this.buildDecoratorForMatching(T, p, a), v = this.resolver.resolve(_, l), D = v.leafSelectors.filter((h) => h.targetState != null), P = {
|
|
1263
|
+
leafSelectors: v.leafSelectors.filter((h) => h.targetState == null),
|
|
1264
|
+
sensibleDefaults: v.sensibleDefaults
|
|
1297
1265
|
};
|
|
1298
|
-
let k = this.merger.merge(
|
|
1266
|
+
let k = this.merger.merge(T, p, P);
|
|
1299
1267
|
y.afterMerge && (k = y.afterMerge(k, {
|
|
1300
1268
|
eventRegistry: n,
|
|
1301
1269
|
formConfig: i,
|
|
1302
|
-
eventIdGenerator:
|
|
1270
|
+
eventIdGenerator: o
|
|
1303
1271
|
})), k = this.eventWiring.wireInputLayoutEvents(
|
|
1304
1272
|
k,
|
|
1305
1273
|
n,
|
|
1306
|
-
|
|
1274
|
+
o
|
|
1307
1275
|
);
|
|
1308
|
-
const { cleanedResult:
|
|
1276
|
+
const { cleanedResult: I, stateData: U } = this.stateExpansion.extractFromMergeResult(
|
|
1309
1277
|
k,
|
|
1310
|
-
|
|
1278
|
+
D
|
|
1311
1279
|
);
|
|
1312
|
-
let
|
|
1280
|
+
let S;
|
|
1313
1281
|
if (y.buildCustomWidget) {
|
|
1314
1282
|
const h = this.buildCustomWidgetContext(
|
|
1315
1283
|
d.children,
|
|
1316
|
-
|
|
1284
|
+
l,
|
|
1317
1285
|
n,
|
|
1318
1286
|
i,
|
|
1319
|
-
r,
|
|
1320
1287
|
o,
|
|
1288
|
+
r,
|
|
1321
1289
|
u
|
|
1322
1290
|
);
|
|
1323
|
-
|
|
1291
|
+
S = this.buildCustomWidget(y, I, h);
|
|
1324
1292
|
} else
|
|
1325
|
-
|
|
1326
|
-
if (typeof
|
|
1327
|
-
const h =
|
|
1328
|
-
h.uid || (h.path && !u.has(h.path) ? (h.uid = h.path, u.add(h.path)) : h.uid = `dx_${
|
|
1293
|
+
S = this.mapper.mapToWidget(I, p);
|
|
1294
|
+
if (typeof S != "function") {
|
|
1295
|
+
const h = S;
|
|
1296
|
+
h.uid || (h.path && !u.has(h.path) ? (h.uid = h.path, u.add(h.path)) : h.uid = `dx_${r.value++}`);
|
|
1329
1297
|
}
|
|
1330
|
-
if (this.stateExpansion.hasStateData(
|
|
1331
|
-
if (typeof
|
|
1332
|
-
const h =
|
|
1333
|
-
|
|
1334
|
-
const
|
|
1298
|
+
if (this.stateExpansion.hasStateData(U))
|
|
1299
|
+
if (typeof S == "function") {
|
|
1300
|
+
const h = S;
|
|
1301
|
+
S = ((Y) => {
|
|
1302
|
+
const z = h(Y);
|
|
1335
1303
|
return this.stateExpansion.applyToWidget(
|
|
1336
|
-
|
|
1337
|
-
|
|
1304
|
+
z,
|
|
1305
|
+
U,
|
|
1338
1306
|
n,
|
|
1339
|
-
|
|
1307
|
+
o
|
|
1340
1308
|
);
|
|
1341
1309
|
});
|
|
1342
1310
|
} else
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1311
|
+
S = this.stateExpansion.applyToWidget(
|
|
1312
|
+
S,
|
|
1313
|
+
U,
|
|
1346
1314
|
n,
|
|
1347
|
-
|
|
1315
|
+
o
|
|
1348
1316
|
);
|
|
1349
|
-
return
|
|
1317
|
+
return S;
|
|
1350
1318
|
}
|
|
1351
|
-
buildCustomWidgetContext(t, s,
|
|
1319
|
+
buildCustomWidgetContext(t, s, a, l, n, i, o) {
|
|
1352
1320
|
return {
|
|
1353
1321
|
children: t,
|
|
1354
|
-
mapStaticDef: (
|
|
1355
|
-
walkChildren: (
|
|
1356
|
-
|
|
1322
|
+
mapStaticDef: (r, u) => this.mapper.mapStaticDef(r, u),
|
|
1323
|
+
walkChildren: (r) => this.walkItems(
|
|
1324
|
+
r,
|
|
1357
1325
|
s,
|
|
1358
|
-
l,
|
|
1359
1326
|
a,
|
|
1327
|
+
l,
|
|
1360
1328
|
n,
|
|
1361
1329
|
i,
|
|
1362
|
-
|
|
1330
|
+
o
|
|
1363
1331
|
)
|
|
1364
1332
|
};
|
|
1365
1333
|
}
|
|
1366
|
-
buildCustomWidget(t, s,
|
|
1367
|
-
return t.buildCustomWidget(s,
|
|
1334
|
+
buildCustomWidget(t, s, a) {
|
|
1335
|
+
return t.buildCustomWidget(s, a);
|
|
1368
1336
|
}
|
|
1369
1337
|
/**
|
|
1370
1338
|
* Resolves the base definition from a parsed entry, injecting the path for keyed entries.
|
|
@@ -1372,33 +1340,33 @@ class Re {
|
|
|
1372
1340
|
*/
|
|
1373
1341
|
buildBaseDef(t) {
|
|
1374
1342
|
const s = t.baseDef;
|
|
1375
|
-
return typeof s == "function" ? (
|
|
1376
|
-
const n = s(
|
|
1343
|
+
return typeof s == "function" ? (a) => {
|
|
1344
|
+
const n = s(a ?? {});
|
|
1377
1345
|
return t.path != null ? { ...n, path: t.path } : n;
|
|
1378
1346
|
} : t.path != null ? { ...s, path: t.path } : s;
|
|
1379
1347
|
}
|
|
1380
|
-
buildDecoratorForMatching(t, s,
|
|
1348
|
+
buildDecoratorForMatching(t, s, a) {
|
|
1381
1349
|
if (typeof t == "function")
|
|
1382
|
-
return { itemType: s, tags: [...
|
|
1383
|
-
const
|
|
1384
|
-
return { itemType: s, tags:
|
|
1350
|
+
return { itemType: s, tags: [...a] };
|
|
1351
|
+
const l = [...a, ..."tags" in t && t.tags ? t.tags : []], n = "uid" in t ? t.uid : void 0, i = "type" in t ? t.type : void 0;
|
|
1352
|
+
return { itemType: s, tags: l, uid: n, type: i };
|
|
1385
1353
|
}
|
|
1386
1354
|
}
|
|
1387
|
-
class
|
|
1388
|
-
constructor(t, s
|
|
1389
|
-
this.selectorNormalizer = t, this.
|
|
1355
|
+
class Ne {
|
|
1356
|
+
constructor(t, s) {
|
|
1357
|
+
this.selectorNormalizer = t, this.walker = s;
|
|
1390
1358
|
}
|
|
1391
|
-
processDxFacade(t, s = [],
|
|
1392
|
-
const { defs:
|
|
1359
|
+
processDxFacade(t, s = [], a) {
|
|
1360
|
+
const { defs: l, gslSelectors: n, formConfig: i } = this.prepareForm(
|
|
1393
1361
|
t,
|
|
1394
1362
|
s,
|
|
1395
|
-
|
|
1396
|
-
), { widgets:
|
|
1397
|
-
|
|
1363
|
+
a
|
|
1364
|
+
), { widgets: o, eventRegistry: r } = this.walker.walkAndMap(
|
|
1365
|
+
l,
|
|
1398
1366
|
n,
|
|
1399
1367
|
i
|
|
1400
|
-
), u =
|
|
1401
|
-
return this.buildResult({ form: u },
|
|
1368
|
+
), u = o[0];
|
|
1369
|
+
return this.buildResult({ form: u }, r, i);
|
|
1402
1370
|
}
|
|
1403
1371
|
/**
|
|
1404
1372
|
* Normalizes raw form definitions and applies form-level defaults.
|
|
@@ -1407,34 +1375,28 @@ class xe {
|
|
|
1407
1375
|
* 1. Normalize definitions — ensure a flat array; convert bare functions to display widgets.
|
|
1408
1376
|
* 2. Normalize selectors — convert mixed leaf/aggregated selectors into a uniform
|
|
1409
1377
|
* aggregated shape, and extract form-level config (see {@link FormConfig}).
|
|
1410
|
-
* 3. Auto-
|
|
1411
|
-
* Throws if more than one submit button is found.
|
|
1412
|
-
* 4. Auto-stack — unless suppressed, wrap all definitions in a synthetic root
|
|
1378
|
+
* 3. Auto-stack — unless suppressed, wrap all definitions in a synthetic root
|
|
1413
1379
|
* flex column layout so the form renders as a single vertical container.
|
|
1414
1380
|
*/
|
|
1415
|
-
prepareForm(t, s,
|
|
1381
|
+
prepareForm(t, s, a) {
|
|
1416
1382
|
const n = (Array.isArray(t) ? [...t] : [t]).map(
|
|
1417
|
-
(
|
|
1418
|
-
), i = this.selectorNormalizer.normalizeSelectors(s),
|
|
1383
|
+
(r) => typeof r == "function" ? G(r) : r
|
|
1384
|
+
), i = this.selectorNormalizer.normalizeSelectors(s), o = {
|
|
1419
1385
|
...this.selectorNormalizer.extractFormConfig(),
|
|
1420
|
-
...
|
|
1421
|
-
}
|
|
1422
|
-
if (o
|
|
1423
|
-
|
|
1424
|
-
`Only one submit button is allowed per form, but ${o} were found. A button is a submit button if it has uid: '#submit' or onClick: 'submit'.`
|
|
1425
|
-
);
|
|
1426
|
-
if (!r.suppressAutomaticSubmit && o === 0 && n.push(X()), !r.suppressAutomaticStack) {
|
|
1427
|
-
const u = {
|
|
1386
|
+
...a
|
|
1387
|
+
};
|
|
1388
|
+
if (!o.suppressAutomaticStack) {
|
|
1389
|
+
const r = {
|
|
1428
1390
|
def: { uid: "#root", direction: "column", widgetName: "flex" },
|
|
1429
1391
|
children: n
|
|
1430
1392
|
};
|
|
1431
1393
|
return {
|
|
1432
|
-
defs: [{ type: "ITEMS", itemType:
|
|
1394
|
+
defs: [{ type: "ITEMS", itemType: N.LAYOUTS, items: [r], tags: [] }],
|
|
1433
1395
|
gslSelectors: i,
|
|
1434
|
-
formConfig:
|
|
1396
|
+
formConfig: o
|
|
1435
1397
|
};
|
|
1436
1398
|
}
|
|
1437
|
-
return { defs: n, gslSelectors: i, formConfig:
|
|
1399
|
+
return { defs: n, gslSelectors: i, formConfig: o };
|
|
1438
1400
|
}
|
|
1439
1401
|
/**
|
|
1440
1402
|
* Converts DX `$`-separated state names to core's `:`-separated names.
|
|
@@ -1442,70 +1404,70 @@ class xe {
|
|
|
1442
1404
|
*/
|
|
1443
1405
|
convertStateNames(t) {
|
|
1444
1406
|
const s = {};
|
|
1445
|
-
for (const [
|
|
1446
|
-
s[
|
|
1407
|
+
for (const [a, l] of Object.entries(t))
|
|
1408
|
+
s[a.replace(/\$/g, ":")] = l;
|
|
1447
1409
|
return s;
|
|
1448
1410
|
}
|
|
1449
|
-
buildResult(t, s,
|
|
1450
|
-
|
|
1411
|
+
buildResult(t, s, a) {
|
|
1412
|
+
a.states && Object.keys(a.states).length > 0 && (t = {
|
|
1451
1413
|
...t,
|
|
1452
|
-
states: this.convertStateNames(
|
|
1414
|
+
states: this.convertStateNames(a.states)
|
|
1453
1415
|
});
|
|
1454
|
-
const
|
|
1455
|
-
return s.size > 0 && (
|
|
1416
|
+
const l = { form: t };
|
|
1417
|
+
return s.size > 0 && (l.events = (n) => {
|
|
1456
1418
|
const i = s.get(n.name);
|
|
1457
1419
|
if (i) {
|
|
1458
|
-
const
|
|
1420
|
+
const o = (u) => {
|
|
1459
1421
|
if (u && typeof u == "object" && "path" in u && !("type" in u)) {
|
|
1460
1422
|
const { path: p, ...y } = u;
|
|
1461
|
-
for (const [d,
|
|
1423
|
+
for (const [d, T] of Object.entries(y))
|
|
1462
1424
|
n.callback({
|
|
1463
1425
|
type: "OVERRIDE_WIDGET_PROP",
|
|
1464
|
-
payload: { path: p, prop: d, value:
|
|
1426
|
+
payload: { path: p, prop: d, value: T }
|
|
1465
1427
|
});
|
|
1466
1428
|
} else
|
|
1467
1429
|
n.callback(u);
|
|
1468
|
-
},
|
|
1430
|
+
}, r = {
|
|
1469
1431
|
...n,
|
|
1470
|
-
callback:
|
|
1471
|
-
update:
|
|
1432
|
+
callback: o,
|
|
1433
|
+
update: o
|
|
1472
1434
|
};
|
|
1473
|
-
i(
|
|
1435
|
+
i(r);
|
|
1474
1436
|
}
|
|
1475
|
-
}),
|
|
1437
|
+
}), a.dependencies && (l.dependencies = a.dependencies), a.widgetLoaders && (l.widgetLoaders = a.widgetLoaders), a.validateOn && (l.validateOn = a.validateOn), a.itemRenderers && (l.itemRenderers = a.itemRenderers), l;
|
|
1476
1438
|
}
|
|
1477
1439
|
}
|
|
1478
|
-
const
|
|
1440
|
+
const Re = new Me(
|
|
1441
|
+
fe,
|
|
1479
1442
|
Oe,
|
|
1480
1443
|
Ee,
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
function
|
|
1486
|
-
return typeof e == "function" ? !0 : Array.isArray(e) ? e.length === 0 || e.every(B) : B(e);
|
|
1444
|
+
E,
|
|
1445
|
+
we
|
|
1446
|
+
), xe = new Ne(Pe, Re);
|
|
1447
|
+
function Fe(e) {
|
|
1448
|
+
return typeof e == "function" ? !0 : Array.isArray(e) ? e.length === 0 || e.every(w) : w(e);
|
|
1487
1449
|
}
|
|
1488
|
-
function
|
|
1450
|
+
function w(e) {
|
|
1489
1451
|
if (typeof e == "function") return !0;
|
|
1490
1452
|
if (e === null || typeof e != "object") return !1;
|
|
1491
1453
|
const t = e;
|
|
1492
1454
|
return t.type === "ITEMS" && typeof t.itemType == "string";
|
|
1493
1455
|
}
|
|
1494
|
-
const
|
|
1495
|
-
function
|
|
1456
|
+
const B = Object.freeze({}), je = Object.freeze({}), M = /* @__PURE__ */ new WeakMap();
|
|
1457
|
+
function O(e, t) {
|
|
1496
1458
|
return e == null ? t : typeof e == "object" ? e : {};
|
|
1497
1459
|
}
|
|
1498
|
-
function
|
|
1499
|
-
if (
|
|
1460
|
+
function $t(e, t, s) {
|
|
1461
|
+
if (!Fe(e))
|
|
1500
1462
|
return { formDef: e };
|
|
1501
|
-
const
|
|
1502
|
-
let i =
|
|
1503
|
-
i || (i = /* @__PURE__ */ new WeakMap(),
|
|
1504
|
-
let
|
|
1505
|
-
|
|
1506
|
-
const
|
|
1507
|
-
if (
|
|
1508
|
-
const u =
|
|
1463
|
+
const a = O(e, B), l = O(t, B), n = O(s, je);
|
|
1464
|
+
let i = M.get(a);
|
|
1465
|
+
i || (i = /* @__PURE__ */ new WeakMap(), M.set(a, i));
|
|
1466
|
+
let o = i.get(l);
|
|
1467
|
+
o || (o = /* @__PURE__ */ new WeakMap(), i.set(l, o));
|
|
1468
|
+
const r = o.get(n);
|
|
1469
|
+
if (r) return r;
|
|
1470
|
+
const u = xe.processDxFacade(
|
|
1509
1471
|
e,
|
|
1510
1472
|
t,
|
|
1511
1473
|
s
|
|
@@ -1517,73 +1479,72 @@ function zt(e, t, s) {
|
|
|
1517
1479
|
validateOn: u.validateOn,
|
|
1518
1480
|
itemRenderers: u.itemRenderers
|
|
1519
1481
|
};
|
|
1520
|
-
return
|
|
1482
|
+
return o.set(n, p), p;
|
|
1521
1483
|
}
|
|
1522
1484
|
export {
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
gt as z
|
|
1485
|
+
xt as $,
|
|
1486
|
+
mt as A,
|
|
1487
|
+
ht as B,
|
|
1488
|
+
gt as C,
|
|
1489
|
+
Tt as D,
|
|
1490
|
+
St as E,
|
|
1491
|
+
At as F,
|
|
1492
|
+
N as G,
|
|
1493
|
+
ne as H,
|
|
1494
|
+
kt as I,
|
|
1495
|
+
_t as J,
|
|
1496
|
+
vt as K,
|
|
1497
|
+
Ct as L,
|
|
1498
|
+
ft as M,
|
|
1499
|
+
Ut as N,
|
|
1500
|
+
Ot as O,
|
|
1501
|
+
Lt as P,
|
|
1502
|
+
Et as Q,
|
|
1503
|
+
Dt as R,
|
|
1504
|
+
Pt as S,
|
|
1505
|
+
It as T,
|
|
1506
|
+
Wt as U,
|
|
1507
|
+
wt as V,
|
|
1508
|
+
Bt as W,
|
|
1509
|
+
Mt as X,
|
|
1510
|
+
Nt as Y,
|
|
1511
|
+
Rt as Z,
|
|
1512
|
+
Ye as _,
|
|
1513
|
+
ze as a,
|
|
1514
|
+
Ft as a0,
|
|
1515
|
+
jt as a1,
|
|
1516
|
+
G as a2,
|
|
1517
|
+
R as a3,
|
|
1518
|
+
c as a4,
|
|
1519
|
+
b as a5,
|
|
1520
|
+
xe as a6,
|
|
1521
|
+
Fe as a7,
|
|
1522
|
+
m as a8,
|
|
1523
|
+
A as a9,
|
|
1524
|
+
$t as aa,
|
|
1525
|
+
Ke as b,
|
|
1526
|
+
Ve as c,
|
|
1527
|
+
Ge as d,
|
|
1528
|
+
Xe as e,
|
|
1529
|
+
He as f,
|
|
1530
|
+
Ze as g,
|
|
1531
|
+
qe as h,
|
|
1532
|
+
Je as i,
|
|
1533
|
+
Qe as j,
|
|
1534
|
+
et as k,
|
|
1535
|
+
tt as l,
|
|
1536
|
+
st as m,
|
|
1537
|
+
lt as n,
|
|
1538
|
+
V as o,
|
|
1539
|
+
at as p,
|
|
1540
|
+
nt as q,
|
|
1541
|
+
it as r,
|
|
1542
|
+
rt as s,
|
|
1543
|
+
ot as t,
|
|
1544
|
+
ut as u,
|
|
1545
|
+
pt as v,
|
|
1546
|
+
ct as w,
|
|
1547
|
+
dt as x,
|
|
1548
|
+
yt as y,
|
|
1549
|
+
bt as z
|
|
1589
1550
|
};
|