@golemui/gui-shared 0.15.1 → 0.16.1
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 +14 -0
- package/index.js +215 -194
- package/index.umd.cjs +1 -1
- package/internals.js +1 -1
- package/internals.umd.cjs +1 -1
- package/lib/dx/gui.d.ts +2 -0
- package/lib/dx/index.d.ts +2 -0
- package/lib/dx/shortcuts/markdown-text/guiMarkdownText.impl.d.ts +6 -0
- package/lib/dx/shortcuts/markdown-text/markdownText.domain.d.ts +9 -0
- package/lib/dx/shortcuts/markdown-text/register.d.ts +2 -0
- package/lib/dx/shortcuts/scopes/scopeChain.d.ts +3 -0
- package/lib/widgets.d.ts +1 -1
- package/package.json +3 -3
- package/{resolveFormInput-DevnNiv0.cjs → resolveFormInput-BkRkdOqj.cjs} +1 -1
- package/{resolveFormInput-ZK1cOA9Y.js → resolveFormInput-DoBisQ5Q.js} +53 -53
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 0.16.0 (2026-05-30)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **shared:** add markdown text shortcut ([#142](https://github.com/golemui/golemui/pull/142))
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- Raúl Jiménez @Elecash
|
|
10
|
+
|
|
11
|
+
## 0.15.1 (2026-05-27)
|
|
12
|
+
|
|
13
|
+
This was a version bump only for gui-shared to align it with other projects, there were no code changes.
|
|
14
|
+
|
|
1
15
|
## 0.15.0 (2026-05-26)
|
|
2
16
|
|
|
3
17
|
### 🚀 Features
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as y, _ as p,
|
|
2
|
-
import { a7 as
|
|
1
|
+
import { G as y, _ as p, d as I, a as _, b as S, c as E, e as h, f as U, g as A, h as k, i as M, j as B, k as D, l as R, m as P, n as w, o as x, p as N, q as b, r as L, s as G, t as C, u as W, v, w as F, x as K, y as Y, z as $, A as j, B as z, C as H, D as X, E as V, F as q, H as Q, I as Z, J, K as O, L as tt, M as et, N as st, O as nt, P as it, Q as rt, R as ot, S as at, T as ut, U as yt, V as ct, W as dt, X as pt, Y as lt, Z as mt, $ as ft, a0 as gt, a1 as Tt, a2 as It, a3 as _t, a4 as St, a5 as Et, a6 as ht } from "./resolveFormInput-DoBisQ5Q.js";
|
|
2
|
+
import { a7 as Ue, a8 as Ae, a9 as ke, aa as Me } from "./resolveFormInput-DoBisQ5Q.js";
|
|
3
3
|
import "@golemui/core";
|
|
4
4
|
import "@golemui/gui-validators";
|
|
5
5
|
function Ut(s, t, e) {
|
|
@@ -38,7 +38,7 @@ function At(s, t, e) {
|
|
|
38
38
|
tags: e ?? []
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function kt(s, t, e) {
|
|
42
42
|
if (typeof t == "function") {
|
|
43
43
|
const o = t;
|
|
44
44
|
return {
|
|
@@ -56,7 +56,7 @@ function Mt(s, t, e) {
|
|
|
56
56
|
tags: e ?? []
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Mt(s, t, e) {
|
|
60
60
|
if (typeof t == "function") {
|
|
61
61
|
const i = t;
|
|
62
62
|
return { type: "ITEMS", itemType: "SELECT", items: [{ key: s, def: (a) => ({ type: "select", ...i(a) }) }], tags: e ?? [] };
|
|
@@ -83,7 +83,7 @@ function Dt(s, t, e) {
|
|
|
83
83
|
const n = { type: "radiogroup", ...t };
|
|
84
84
|
return { type: "ITEMS", itemType: "RADIOGROUP", items: [{ key: s, def: n }], tags: e ?? [] };
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function Rt(s, t, e) {
|
|
87
87
|
if (typeof t == "function") {
|
|
88
88
|
const i = t;
|
|
89
89
|
return { type: "ITEMS", itemType: "CHECKBOX", items: [{ key: s, def: (a) => ({ type: "checkbox", ...i(a) }) }], tags: e ?? [] };
|
|
@@ -91,7 +91,7 @@ function Pt(s, t, e) {
|
|
|
91
91
|
const n = { type: "checkbox", ...t };
|
|
92
92
|
return { type: "ITEMS", itemType: "CHECKBOX", items: [{ key: s, def: n }], tags: e ?? [] };
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function Pt(s, t, e) {
|
|
95
95
|
if (typeof t == "function") {
|
|
96
96
|
const i = t;
|
|
97
97
|
return { type: "ITEMS", itemType: "TEXTAREA", items: [{ key: s, def: (a) => ({ type: "textarea", ...i(a) }) }], tags: e ?? [] };
|
|
@@ -107,7 +107,7 @@ function wt(s, t, e) {
|
|
|
107
107
|
const n = { type: "password", ...t };
|
|
108
108
|
return { type: "ITEMS", itemType: "PASSWORD", items: [{ key: s, def: n }], tags: e ?? [] };
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function xt(s, t, e) {
|
|
111
111
|
if (typeof t == "function") {
|
|
112
112
|
const i = t;
|
|
113
113
|
return { type: "ITEMS", itemType: "CURRENCY", items: [{ key: s, def: (a) => ({ type: "currency", ...i(a) }) }], tags: e ?? [] };
|
|
@@ -115,7 +115,7 @@ function Nt(s, t, e) {
|
|
|
115
115
|
const n = { type: "currency", ...t };
|
|
116
116
|
return { type: "ITEMS", itemType: "CURRENCY", items: [{ key: s, def: n }], tags: e ?? [] };
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Nt(s, t, e) {
|
|
119
119
|
if (typeof t == "function") {
|
|
120
120
|
const i = t;
|
|
121
121
|
return { type: "ITEMS", itemType: "MARKDOWN", items: [{ key: s, def: (a) => ({ type: "markdown", ...i(a) }) }], tags: e ?? [] };
|
|
@@ -171,7 +171,7 @@ function Ct(s, t, e) {
|
|
|
171
171
|
const n = { type: "datePicker", ...t };
|
|
172
172
|
return { type: "ITEMS", itemType: "DATE_PICKER", items: [{ key: s, def: n }], tags: e ?? [] };
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function Wt(s, t, e) {
|
|
175
175
|
if (typeof t == "function") {
|
|
176
176
|
const i = t;
|
|
177
177
|
return { type: "ITEMS", itemType: "RANGE_CALENDAR", items: [{ key: s, def: (a) => ({
|
|
@@ -182,7 +182,7 @@ function vt(s, t, e) {
|
|
|
182
182
|
const n = { type: "rangeCalendar", ...t };
|
|
183
183
|
return { type: "ITEMS", itemType: "RANGE_CALENDAR", items: [{ key: s, def: n }], tags: e ?? [] };
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function vt(s, t, e) {
|
|
186
186
|
if (typeof t == "function") {
|
|
187
187
|
const i = t;
|
|
188
188
|
return { type: "ITEMS", itemType: "RANGE_DATE_INPUT", items: [{ key: s, def: (a) => ({
|
|
@@ -193,7 +193,7 @@ function Ft(s, t, e) {
|
|
|
193
193
|
const n = { type: "rangeDateInput", ...t };
|
|
194
194
|
return { type: "ITEMS", itemType: "RANGE_DATE_INPUT", items: [{ key: s, def: n }], tags: e ?? [] };
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Ft(s, t, e) {
|
|
197
197
|
if (typeof t == "function") {
|
|
198
198
|
const i = t;
|
|
199
199
|
return { type: "ITEMS", itemType: "RANGE_DATE_PICKER", items: [{ key: s, def: (a) => ({
|
|
@@ -204,7 +204,7 @@ function Yt(s, t, e) {
|
|
|
204
204
|
const n = { type: "rangeDatePicker", ...t };
|
|
205
205
|
return { type: "ITEMS", itemType: "RANGE_DATE_PICKER", items: [{ key: s, def: n }], tags: e ?? [] };
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Kt(s, t, e, n) {
|
|
208
208
|
if (typeof e == "function") {
|
|
209
209
|
const r = e;
|
|
210
210
|
return { type: "ITEMS", itemType: "CUSTOM_INPUT", items: [{ key: t, def: (d) => ({
|
|
@@ -215,7 +215,7 @@ function $t(s, t, e, n) {
|
|
|
215
215
|
const o = { customType: s, ...e };
|
|
216
216
|
return { type: "ITEMS", itemType: "CUSTOM_INPUT", items: [{ key: t, def: o }], tags: n ?? [] };
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Yt(s, t) {
|
|
219
219
|
return {
|
|
220
220
|
items: [s],
|
|
221
221
|
type: "ITEMS",
|
|
@@ -223,7 +223,7 @@ function Wt(s, t) {
|
|
|
223
223
|
tags: t ?? []
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function $t(s, t, e) {
|
|
227
227
|
if (typeof t == "function") {
|
|
228
228
|
const i = t;
|
|
229
229
|
return { type: "ITEMS", itemType: "CUSTOM_ACTION", items: [
|
|
@@ -235,7 +235,10 @@ function Kt(s, t, e) {
|
|
|
235
235
|
function jt(s, t) {
|
|
236
236
|
return { type: "ITEMS", itemType: "ALERTS", items: [s], tags: t ?? [] };
|
|
237
237
|
}
|
|
238
|
-
function zt(s, t
|
|
238
|
+
function zt(s, t) {
|
|
239
|
+
return { type: "ITEMS", itemType: "MARKDOWN_TEXTS", items: [s], tags: t ?? [] };
|
|
240
|
+
}
|
|
241
|
+
function Ht(s, t, e) {
|
|
239
242
|
if (typeof t == "function") {
|
|
240
243
|
const u = t;
|
|
241
244
|
return { type: "ITEMS", itemType: "CUSTOM_DISPLAY", items: [
|
|
@@ -254,7 +257,7 @@ const l = (s, t, e) => ({
|
|
|
254
257
|
itemType: y.LAYOUTS,
|
|
255
258
|
items: [{ def: { widgetName: "flex", ...t ?? {} }, children: s }],
|
|
256
259
|
tags: e ?? []
|
|
257
|
-
}),
|
|
260
|
+
}), Xt = (s, t, e) => l(s, { direction: "row", ...t ?? {} }, e), Vt = (s, t, e) => l(s, { direction: "column", ...t ?? {} }, e), m = (s, t, e) => ({
|
|
258
261
|
type: "ITEMS",
|
|
259
262
|
itemType: y.LAYOUTS,
|
|
260
263
|
items: [
|
|
@@ -269,11 +272,11 @@ const l = (s, t, e) => ({
|
|
|
269
272
|
}
|
|
270
273
|
],
|
|
271
274
|
tags: e ?? []
|
|
272
|
-
}),
|
|
275
|
+
}), qt = (s, t, e) => m(s, { direction: "row", ...t ?? {} }, e), Qt = (s, t, e) => m(s, { direction: "column", ...t ?? {} }, e);
|
|
273
276
|
function g(s) {
|
|
274
277
|
return s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
275
278
|
}
|
|
276
|
-
function
|
|
279
|
+
function Zt(s, t, e) {
|
|
277
280
|
const n = s.map((r) => ({
|
|
278
281
|
label: r.label,
|
|
279
282
|
uid: r.uid ?? g(r.label)
|
|
@@ -301,7 +304,7 @@ function Qt(s, t, e) {
|
|
|
301
304
|
function T(s) {
|
|
302
305
|
return s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
303
306
|
}
|
|
304
|
-
function
|
|
307
|
+
function Jt(s, t, e) {
|
|
305
308
|
const n = s.map((r) => ({
|
|
306
309
|
label: r.label,
|
|
307
310
|
uid: r.uid ?? T(r.label)
|
|
@@ -326,7 +329,7 @@ function Zt(s, t, e) {
|
|
|
326
329
|
tags: e ?? []
|
|
327
330
|
};
|
|
328
331
|
}
|
|
329
|
-
function
|
|
332
|
+
function Ot(s, t, e, n) {
|
|
330
333
|
if (typeof e == "function") {
|
|
331
334
|
const r = e;
|
|
332
335
|
return { type: "ITEMS", itemType: "CUSTOM_LAYOUT", items: [{ def: (d) => ({
|
|
@@ -336,7 +339,7 @@ function Jt(s, t, e, n) {
|
|
|
336
339
|
}
|
|
337
340
|
return { type: "ITEMS", itemType: "CUSTOM_LAYOUT", items: [{ def: { customType: s, ...e }, children: t }], tags: n ?? [] };
|
|
338
341
|
}
|
|
339
|
-
function
|
|
342
|
+
function te(s, t, e) {
|
|
340
343
|
const { template: n, ...o } = t;
|
|
341
344
|
return {
|
|
342
345
|
type: "ITEMS",
|
|
@@ -345,7 +348,7 @@ function Ot(s, t, e) {
|
|
|
345
348
|
tags: e ?? []
|
|
346
349
|
};
|
|
347
350
|
}
|
|
348
|
-
function
|
|
351
|
+
function ee(s, t, e) {
|
|
349
352
|
if (typeof t == "function") {
|
|
350
353
|
const i = t;
|
|
351
354
|
return { type: "ITEMS", itemType: "TAGS", items: [{ key: s, def: (a) => ({ type: "tags", ...i(a) }) }], tags: e ?? [] };
|
|
@@ -353,7 +356,18 @@ function te(s, t, e) {
|
|
|
353
356
|
const n = { type: "tags", ...t };
|
|
354
357
|
return { type: "ITEMS", itemType: "TAGS", items: [{ key: s, def: n }], tags: e ?? [] };
|
|
355
358
|
}
|
|
356
|
-
const
|
|
359
|
+
const se = (s) => p(s, (t) => t.type === "text"), ne = (s) => p(s, (t) => t.type === "number"), ie = (s) => p(s, (t) => t.type === "boolean"), { gsl: re, gslByUid: oe } = I({
|
|
360
|
+
itemType: "MARKDOWN_TEXTS",
|
|
361
|
+
entryShape: "bare",
|
|
362
|
+
mapToWidget: (s) => ({
|
|
363
|
+
uid: s.uid ?? "",
|
|
364
|
+
kind: "display",
|
|
365
|
+
type: "markdownText",
|
|
366
|
+
props: {
|
|
367
|
+
md: s.md
|
|
368
|
+
}
|
|
369
|
+
})
|
|
370
|
+
});
|
|
357
371
|
class c {
|
|
358
372
|
constructor(t) {
|
|
359
373
|
this.conditions = t;
|
|
@@ -405,73 +419,73 @@ class c {
|
|
|
405
419
|
return this.apply(p(t));
|
|
406
420
|
}
|
|
407
421
|
inputByUid(t, e) {
|
|
408
|
-
return this.apply(
|
|
422
|
+
return this.apply(_(t, e));
|
|
409
423
|
}
|
|
410
424
|
textInputs(t) {
|
|
411
|
-
return this.apply(
|
|
425
|
+
return this.apply(se(t));
|
|
412
426
|
}
|
|
413
427
|
numberInputs(t) {
|
|
414
|
-
return this.apply(
|
|
428
|
+
return this.apply(ne(t));
|
|
415
429
|
}
|
|
416
430
|
booleanInputs(t) {
|
|
417
|
-
return this.apply(
|
|
431
|
+
return this.apply(ie(t));
|
|
418
432
|
}
|
|
419
433
|
selects(t) {
|
|
420
|
-
return this.apply(
|
|
434
|
+
return this.apply(S(t));
|
|
421
435
|
}
|
|
422
436
|
selectByUid(t, e) {
|
|
423
437
|
return this.apply(E(t, e));
|
|
424
438
|
}
|
|
425
439
|
dropdowns(t) {
|
|
426
|
-
return this.apply(
|
|
440
|
+
return this.apply(h(t));
|
|
427
441
|
}
|
|
428
442
|
dropdownByUid(t, e) {
|
|
429
|
-
return this.apply(
|
|
443
|
+
return this.apply(U(t, e));
|
|
430
444
|
}
|
|
431
445
|
radiogroups(t) {
|
|
432
|
-
return this.apply(
|
|
446
|
+
return this.apply(A(t));
|
|
433
447
|
}
|
|
434
448
|
radiogroupByUid(t, e) {
|
|
435
|
-
return this.apply(
|
|
449
|
+
return this.apply(k(t, e));
|
|
436
450
|
}
|
|
437
451
|
checkboxes(t) {
|
|
438
452
|
return this.apply(M(t));
|
|
439
453
|
}
|
|
440
454
|
checkboxByUid(t, e) {
|
|
441
|
-
return this.apply(
|
|
455
|
+
return this.apply(B(t, e));
|
|
442
456
|
}
|
|
443
457
|
textareas(t) {
|
|
444
|
-
return this.apply(
|
|
458
|
+
return this.apply(D(t));
|
|
445
459
|
}
|
|
446
460
|
textareaByUid(t, e) {
|
|
447
|
-
return this.apply(
|
|
461
|
+
return this.apply(R(t, e));
|
|
448
462
|
}
|
|
449
463
|
passwords(t) {
|
|
450
464
|
return this.apply(P(t));
|
|
451
465
|
}
|
|
452
466
|
passwordByUid(t, e) {
|
|
453
|
-
return this.apply(
|
|
467
|
+
return this.apply(w(t, e));
|
|
454
468
|
}
|
|
455
469
|
currencies(t) {
|
|
456
|
-
return this.apply(
|
|
470
|
+
return this.apply(x(t));
|
|
457
471
|
}
|
|
458
472
|
currencyByUid(t, e) {
|
|
459
473
|
return this.apply(N(t, e));
|
|
460
474
|
}
|
|
461
475
|
markdowns(t) {
|
|
462
|
-
return this.apply(
|
|
476
|
+
return this.apply(b(t));
|
|
463
477
|
}
|
|
464
478
|
markdownByUid(t, e) {
|
|
465
|
-
return this.apply(
|
|
479
|
+
return this.apply(L(t, e));
|
|
466
480
|
}
|
|
467
481
|
lists(t) {
|
|
468
|
-
return this.apply(
|
|
482
|
+
return this.apply(G(t));
|
|
469
483
|
}
|
|
470
484
|
listByUid(t, e) {
|
|
471
|
-
return this.apply(
|
|
485
|
+
return this.apply(C(t, e));
|
|
472
486
|
}
|
|
473
487
|
calendars(t) {
|
|
474
|
-
return this.apply(
|
|
488
|
+
return this.apply(W(t));
|
|
475
489
|
}
|
|
476
490
|
calendarByUid(t, e) {
|
|
477
491
|
return this.apply(v(t, e));
|
|
@@ -480,153 +494,160 @@ class c {
|
|
|
480
494
|
return this.apply(F(t));
|
|
481
495
|
}
|
|
482
496
|
dateInputByUid(t, e) {
|
|
483
|
-
return this.apply(
|
|
497
|
+
return this.apply(K(t, e));
|
|
484
498
|
}
|
|
485
499
|
datePickers(t) {
|
|
486
|
-
return this.apply(
|
|
500
|
+
return this.apply(Y(t));
|
|
487
501
|
}
|
|
488
502
|
datePickerByUid(t, e) {
|
|
489
|
-
return this.apply(
|
|
503
|
+
return this.apply($(t, e));
|
|
490
504
|
}
|
|
491
505
|
rangeCalendars(t) {
|
|
492
|
-
return this.apply(
|
|
506
|
+
return this.apply(j(t));
|
|
493
507
|
}
|
|
494
508
|
rangeCalendarByUid(t, e) {
|
|
495
|
-
return this.apply(
|
|
509
|
+
return this.apply(z(t, e));
|
|
496
510
|
}
|
|
497
511
|
rangeDateInputs(t) {
|
|
498
|
-
return this.apply(
|
|
512
|
+
return this.apply(H(t));
|
|
499
513
|
}
|
|
500
514
|
rangeDateInputByUid(t, e) {
|
|
501
|
-
return this.apply(
|
|
515
|
+
return this.apply(X(t, e));
|
|
502
516
|
}
|
|
503
517
|
rangeDatePickers(t) {
|
|
504
|
-
return this.apply(
|
|
518
|
+
return this.apply(V(t));
|
|
505
519
|
}
|
|
506
520
|
rangeDatePickerByUid(t, e) {
|
|
507
|
-
return this.apply(
|
|
521
|
+
return this.apply(q(t, e));
|
|
508
522
|
}
|
|
509
523
|
repeaters(t) {
|
|
510
|
-
return this.apply(
|
|
524
|
+
return this.apply(Q(t));
|
|
511
525
|
}
|
|
512
526
|
repeaterByUid(t, e) {
|
|
513
|
-
return this.apply(
|
|
527
|
+
return this.apply(Z(t, e));
|
|
514
528
|
}
|
|
515
529
|
// ─── Type selectors — actions, displays, layouts ───
|
|
516
530
|
actions(t) {
|
|
517
|
-
return this.apply(
|
|
531
|
+
return this.apply(J(t));
|
|
518
532
|
}
|
|
519
533
|
actionByUid(t, e) {
|
|
520
|
-
return this.apply(
|
|
534
|
+
return this.apply(O(t, e));
|
|
521
535
|
}
|
|
522
536
|
layouts(t) {
|
|
523
|
-
return this.apply(
|
|
537
|
+
return this.apply(tt(t));
|
|
524
538
|
}
|
|
525
539
|
layoutByUid(t, e) {
|
|
526
|
-
return this.apply(
|
|
540
|
+
return this.apply(et(t, e));
|
|
527
541
|
}
|
|
528
542
|
displays(t) {
|
|
529
|
-
return this.apply(
|
|
543
|
+
return this.apply(st(t));
|
|
530
544
|
}
|
|
531
545
|
displayByUid(t, e) {
|
|
532
|
-
return this.apply(
|
|
546
|
+
return this.apply(nt(t, e));
|
|
533
547
|
}
|
|
534
548
|
alerts(t) {
|
|
535
|
-
return this.apply(
|
|
549
|
+
return this.apply(it(t));
|
|
536
550
|
}
|
|
537
551
|
alertByUid(t, e) {
|
|
538
|
-
return this.apply(
|
|
552
|
+
return this.apply(rt(t, e));
|
|
553
|
+
}
|
|
554
|
+
markdownTexts(t) {
|
|
555
|
+
return this.apply(re(t));
|
|
556
|
+
}
|
|
557
|
+
markdownTextByUid(t, e) {
|
|
558
|
+
return this.apply(oe(t, e));
|
|
539
559
|
}
|
|
540
560
|
tabs(t) {
|
|
541
|
-
return this.apply(
|
|
561
|
+
return this.apply(ot(t));
|
|
542
562
|
}
|
|
543
563
|
tabsByUid(t, e) {
|
|
544
|
-
return this.apply(
|
|
564
|
+
return this.apply(at(t, e));
|
|
545
565
|
}
|
|
546
566
|
accordions(t) {
|
|
547
|
-
return this.apply(
|
|
567
|
+
return this.apply(ut(t));
|
|
548
568
|
}
|
|
549
569
|
accordionByUid(t, e) {
|
|
550
|
-
return this.apply(
|
|
570
|
+
return this.apply(yt(t, e));
|
|
551
571
|
}
|
|
552
572
|
// ─── Type selectors — custom kinds ───
|
|
553
573
|
customInputs(t) {
|
|
554
|
-
return this.apply(
|
|
574
|
+
return this.apply(ct(t));
|
|
555
575
|
}
|
|
556
576
|
customInputByUid(t, e) {
|
|
557
|
-
return this.apply(
|
|
577
|
+
return this.apply(dt(t, e));
|
|
558
578
|
}
|
|
559
579
|
customActions(t) {
|
|
560
|
-
return this.apply(
|
|
580
|
+
return this.apply(pt(t));
|
|
561
581
|
}
|
|
562
582
|
customActionByUid(t, e) {
|
|
563
|
-
return this.apply(
|
|
583
|
+
return this.apply(lt(t, e));
|
|
564
584
|
}
|
|
565
585
|
customDisplays(t) {
|
|
566
|
-
return this.apply(
|
|
586
|
+
return this.apply(mt(t));
|
|
567
587
|
}
|
|
568
588
|
customDisplayByUid(t, e) {
|
|
569
|
-
return this.apply(
|
|
589
|
+
return this.apply(ft(t, e));
|
|
570
590
|
}
|
|
571
591
|
customLayouts(t) {
|
|
572
|
-
return this.apply(
|
|
592
|
+
return this.apply(gt(t));
|
|
573
593
|
}
|
|
574
594
|
customLayoutByUid(t, e) {
|
|
575
|
-
return this.apply(
|
|
595
|
+
return this.apply(Tt(t, e));
|
|
576
596
|
}
|
|
577
597
|
}
|
|
578
|
-
const
|
|
598
|
+
const le = {
|
|
579
599
|
inputs: {
|
|
580
600
|
textInput: Ut,
|
|
581
601
|
numberInput: At,
|
|
582
|
-
booleanInput:
|
|
583
|
-
select:
|
|
602
|
+
booleanInput: kt,
|
|
603
|
+
select: Mt,
|
|
584
604
|
dropdown: Bt,
|
|
585
605
|
radiogroup: Dt,
|
|
586
|
-
checkbox:
|
|
587
|
-
textarea:
|
|
606
|
+
checkbox: Rt,
|
|
607
|
+
textarea: Pt,
|
|
588
608
|
password: wt,
|
|
589
|
-
currency:
|
|
590
|
-
markdown:
|
|
609
|
+
currency: xt,
|
|
610
|
+
markdown: Nt,
|
|
591
611
|
list: bt,
|
|
592
612
|
calendar: Lt,
|
|
593
613
|
dateInput: Gt,
|
|
594
614
|
datePicker: Ct,
|
|
595
|
-
rangeCalendar:
|
|
596
|
-
rangeDateInput:
|
|
597
|
-
rangeDatePicker:
|
|
598
|
-
repeater:
|
|
599
|
-
tags:
|
|
600
|
-
custom:
|
|
615
|
+
rangeCalendar: Wt,
|
|
616
|
+
rangeDateInput: vt,
|
|
617
|
+
rangeDatePicker: Ft,
|
|
618
|
+
repeater: te,
|
|
619
|
+
tags: ee,
|
|
620
|
+
custom: Kt
|
|
601
621
|
},
|
|
602
622
|
actions: {
|
|
603
|
-
button:
|
|
604
|
-
custom:
|
|
623
|
+
button: Yt,
|
|
624
|
+
custom: $t
|
|
605
625
|
},
|
|
606
626
|
displays: {
|
|
607
|
-
display:
|
|
627
|
+
display: It,
|
|
608
628
|
alert: jt,
|
|
609
|
-
|
|
629
|
+
markdownText: zt,
|
|
630
|
+
custom: Ht
|
|
610
631
|
},
|
|
611
632
|
layouts: {
|
|
612
633
|
flex: l,
|
|
613
|
-
horizontalFlex:
|
|
614
|
-
verticalFlex:
|
|
634
|
+
horizontalFlex: Xt,
|
|
635
|
+
verticalFlex: Vt,
|
|
615
636
|
grid: m,
|
|
616
|
-
horizontalGrid:
|
|
617
|
-
verticalGrid:
|
|
618
|
-
tabs:
|
|
619
|
-
accordion:
|
|
620
|
-
custom:
|
|
637
|
+
horizontalGrid: qt,
|
|
638
|
+
verticalGrid: Qt,
|
|
639
|
+
tabs: Zt,
|
|
640
|
+
accordion: Jt,
|
|
641
|
+
custom: Ot
|
|
621
642
|
},
|
|
622
643
|
selectors: c.root()
|
|
623
|
-
}, { gsl:
|
|
644
|
+
}, { gsl: me, gslByUid: fe } = I({
|
|
624
645
|
itemType: "TAGS",
|
|
625
646
|
entryShape: "keyed",
|
|
626
647
|
sensibleDefaults: {
|
|
627
648
|
base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
|
|
628
649
|
fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
|
|
629
|
-
apply: (s, t) =>
|
|
650
|
+
apply: (s, t) => Et(ht(s, t), t)
|
|
630
651
|
},
|
|
631
652
|
mapToWidget: (s) => ({
|
|
632
653
|
uid: s.uid ?? "",
|
|
@@ -636,24 +657,24 @@ const ce = {
|
|
|
636
657
|
...s.label != null ? { label: s.label } : {},
|
|
637
658
|
...s.disabled != null ? { disabled: s.disabled } : {},
|
|
638
659
|
...s.readonly != null ? { readonly: s.readonly } : {},
|
|
639
|
-
...s.validator != null ? { validator:
|
|
660
|
+
...s.validator != null ? { validator: St(s.validator, "array") } : {},
|
|
640
661
|
props: _t(s)
|
|
641
662
|
})
|
|
642
663
|
});
|
|
643
|
-
function
|
|
664
|
+
function ge(s, ...t) {
|
|
644
665
|
return t.map((e) => ({
|
|
645
666
|
...e,
|
|
646
667
|
targetState: s
|
|
647
668
|
}));
|
|
648
669
|
}
|
|
649
|
-
function
|
|
670
|
+
function Te(s, ...t) {
|
|
650
671
|
return {
|
|
651
672
|
kind: "aggregated",
|
|
652
673
|
matcher: (e) => e.tags?.includes(s) ?? !1,
|
|
653
674
|
children: t
|
|
654
675
|
};
|
|
655
676
|
}
|
|
656
|
-
class
|
|
677
|
+
class ae {
|
|
657
678
|
create(t) {
|
|
658
679
|
return {
|
|
659
680
|
states: t.states,
|
|
@@ -666,21 +687,21 @@ class ie {
|
|
|
666
687
|
};
|
|
667
688
|
}
|
|
668
689
|
}
|
|
669
|
-
function
|
|
670
|
-
return new
|
|
690
|
+
function Ie() {
|
|
691
|
+
return new ae();
|
|
671
692
|
}
|
|
672
|
-
const
|
|
673
|
-
function
|
|
693
|
+
const _e = (s) => s !== null && typeof s == "object" && Object.prototype.hasOwnProperty.call(s, "label") && Object.prototype.hasOwnProperty.call(s, "value");
|
|
694
|
+
function ue(s) {
|
|
674
695
|
return typeof s == "object" && s !== null && "$ref" in s && typeof s.$ref == "string" && Object.keys(s).length === 1;
|
|
675
696
|
}
|
|
676
|
-
async function
|
|
697
|
+
async function ye(s, t) {
|
|
677
698
|
const e = new URL(s, t).href, n = await fetch(e);
|
|
678
699
|
if (!n.ok) throw new Error(`Failed to load form chunk ${e}: ${n.status}`);
|
|
679
700
|
const { $schema: o, ...i } = await n.json();
|
|
680
701
|
return f(i, e);
|
|
681
702
|
}
|
|
682
703
|
async function f(s, t) {
|
|
683
|
-
if (
|
|
704
|
+
if (ue(s)) return ye(s.$ref, t);
|
|
684
705
|
const e = s;
|
|
685
706
|
if (Array.isArray(e.children)) {
|
|
686
707
|
const n = await Promise.all(e.children.map((o) => f(o, t)));
|
|
@@ -688,116 +709,116 @@ async function f(s, t) {
|
|
|
688
709
|
}
|
|
689
710
|
return s;
|
|
690
711
|
}
|
|
691
|
-
async function
|
|
712
|
+
async function Se(s, t) {
|
|
692
713
|
const e = await Promise.all(
|
|
693
714
|
s.form.map((n) => f(n, t))
|
|
694
715
|
);
|
|
695
716
|
return { ...s, form: e };
|
|
696
717
|
}
|
|
697
718
|
export {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
719
|
+
yt as _gslAccordionByUid,
|
|
720
|
+
ut as _gslAccordions,
|
|
721
|
+
O as _gslActionByUid,
|
|
722
|
+
J as _gslActions,
|
|
723
|
+
rt as _gslAlertByUid,
|
|
724
|
+
it as _gslAlerts,
|
|
725
|
+
ie as _gslBooleanInputs,
|
|
705
726
|
v as _gslCalendarByUid,
|
|
706
|
-
|
|
707
|
-
|
|
727
|
+
W as _gslCalendars,
|
|
728
|
+
B as _gslCheckboxByUid,
|
|
708
729
|
M as _gslCheckboxes,
|
|
709
|
-
|
|
730
|
+
x as _gslCurrencies,
|
|
710
731
|
N as _gslCurrencyByUid,
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
732
|
+
lt as _gslCustomActionByUid,
|
|
733
|
+
pt as _gslCustomActions,
|
|
734
|
+
ft as _gslCustomDisplayByUid,
|
|
735
|
+
mt as _gslCustomDisplays,
|
|
736
|
+
dt as _gslCustomInputByUid,
|
|
737
|
+
ct as _gslCustomInputs,
|
|
738
|
+
Tt as _gslCustomLayoutByUid,
|
|
739
|
+
gt as _gslCustomLayouts,
|
|
740
|
+
K as _gslDateInputByUid,
|
|
720
741
|
F as _gslDateInputs,
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
742
|
+
$ as _gslDatePickerByUid,
|
|
743
|
+
Y as _gslDatePickers,
|
|
744
|
+
nt as _gslDisplayByUid,
|
|
745
|
+
st as _gslDisplays,
|
|
746
|
+
U as _gslDropdownByUid,
|
|
747
|
+
h as _gslDropdowns,
|
|
748
|
+
_ as _gslInputByUid,
|
|
728
749
|
p as _gslInputs,
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
750
|
+
et as _gslLayoutByUid,
|
|
751
|
+
tt as _gslLayouts,
|
|
752
|
+
C as _gslListByUid,
|
|
753
|
+
G as _gslLists,
|
|
754
|
+
L as _gslMarkdownByUid,
|
|
755
|
+
b as _gslMarkdowns,
|
|
756
|
+
ne as _gslNumberInputs,
|
|
757
|
+
w as _gslPasswordByUid,
|
|
737
758
|
P as _gslPasswords,
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
759
|
+
k as _gslRadiogroupByUid,
|
|
760
|
+
A as _gslRadiogroups,
|
|
761
|
+
z as _gslRangeCalendarByUid,
|
|
762
|
+
j as _gslRangeCalendars,
|
|
763
|
+
X as _gslRangeDateInputByUid,
|
|
764
|
+
H as _gslRangeDateInputs,
|
|
765
|
+
q as _gslRangeDatePickerByUid,
|
|
766
|
+
V as _gslRangeDatePickers,
|
|
767
|
+
Z as _gslRepeaterByUid,
|
|
768
|
+
Q as _gslRepeaters,
|
|
748
769
|
E as _gslSelectByUid,
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
770
|
+
S as _gslSelects,
|
|
771
|
+
ge as _gslStates,
|
|
772
|
+
ot as _gslTabs,
|
|
773
|
+
at as _gslTabsByUid,
|
|
774
|
+
Te as _gslTag,
|
|
775
|
+
se as _gslTextInputs,
|
|
776
|
+
R as _gslTextareaByUid,
|
|
777
|
+
D as _gslTextareas,
|
|
778
|
+
Jt as _guiAccordion,
|
|
758
779
|
jt as _guiAlert,
|
|
759
|
-
|
|
760
|
-
|
|
780
|
+
kt as _guiBooleanInput,
|
|
781
|
+
Yt as _guiButton,
|
|
761
782
|
Lt as _guiCalendar,
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
783
|
+
Rt as _guiCheckbox,
|
|
784
|
+
xt as _guiCurrency,
|
|
785
|
+
$t as _guiCustomAction,
|
|
786
|
+
Ht as _guiCustomDisplay,
|
|
787
|
+
Kt as _guiCustomInput,
|
|
788
|
+
Ot as _guiCustomLayout,
|
|
768
789
|
Gt as _guiDateInput,
|
|
769
790
|
Ct as _guiDatePicker,
|
|
770
|
-
|
|
791
|
+
It as _guiDisplay,
|
|
771
792
|
Bt as _guiDropdown,
|
|
772
793
|
l as _guiFlex,
|
|
773
794
|
m as _guiGrid,
|
|
774
|
-
|
|
775
|
-
|
|
795
|
+
Xt as _guiHorizontalFlex,
|
|
796
|
+
qt as _guiHorizontalGrid,
|
|
776
797
|
bt as _guiList,
|
|
777
|
-
|
|
798
|
+
Nt as _guiMarkdown,
|
|
778
799
|
At as _guiNumberInput,
|
|
779
800
|
wt as _guiPassword,
|
|
780
801
|
Dt as _guiRadiogroup,
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
802
|
+
Wt as _guiRangeCalendar,
|
|
803
|
+
vt as _guiRangeDateInput,
|
|
804
|
+
Ft as _guiRangeDatePicker,
|
|
805
|
+
te as _guiRepeater,
|
|
806
|
+
Mt as _guiSelect,
|
|
807
|
+
Zt as _guiTabs,
|
|
787
808
|
Ut as _guiTextInput,
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
809
|
+
Pt as _guiTextarea,
|
|
810
|
+
Vt as _guiVerticalFlex,
|
|
811
|
+
Qt as _guiVerticalGrid,
|
|
812
|
+
Ue as createGslSelector,
|
|
813
|
+
I as defineShortcutType,
|
|
793
814
|
_t as extractWidgetProps,
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
815
|
+
Ae as formDefs,
|
|
816
|
+
Ie as golemForm,
|
|
817
|
+
le as gui,
|
|
818
|
+
ke as isDxDefinitions,
|
|
819
|
+
_e as isOption,
|
|
799
820
|
ht as processAutoLabel,
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
821
|
+
Et as processAutoPlaceholder,
|
|
822
|
+
Se as resolveChunkRefs,
|
|
823
|
+
Me as resolveFormInput
|
|
803
824
|
};
|
package/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./resolveFormInput-DevnNiv0.cjs");require("@golemui/core");require("@golemui/gui-validators");function f(s,t,e){if(typeof t=="function"){const u=t;return{items:[{key:s,def:r=>({type:"text",...u(r)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}const n={type:"text",...t};return{items:[{key:s,def:n}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}function T(s,t,e){if(typeof t=="function"){const u=t;return{items:[{key:s,def:r=>({type:"number",...u(r)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}const n={type:"number",...t};return{items:[{key:s,def:n}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}function I(s,t,e){if(typeof t=="function"){const u=t;return{items:[{key:s,def:r=>({type:"boolean",...u(r)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}const n={type:"boolean",...t};return{items:[{key:s,def:n}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}function U(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"SELECT",items:[{key:s,def:a=>({type:"select",...o(a)})}],tags:e??[]}}const n={type:"select",...t};return{type:"ITEMS",itemType:"SELECT",items:[{key:s,def:n}],tags:e??[]}}function B(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:s,def:a=>({type:"dropdown",...o(a)})}],tags:e??[]}}const n={type:"dropdown",...t};return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:s,def:n}],tags:e??[]}}function S(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:s,def:a=>({type:"radiogroup",...o(a)})}],tags:e??[]}}const n={type:"radiogroup",...t};return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:s,def:n}],tags:e??[]}}function D(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:s,def:a=>({type:"checkbox",...o(a)})}],tags:e??[]}}const n={type:"checkbox",...t};return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:s,def:n}],tags:e??[]}}function h(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:s,def:a=>({type:"textarea",...o(a)})}],tags:e??[]}}const n={type:"textarea",...t};return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:s,def:n}],tags:e??[]}}function A(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"PASSWORD",items:[{key:s,def:a=>({type:"password",...o(a)})}],tags:e??[]}}const n={type:"password",...t};return{type:"ITEMS",itemType:"PASSWORD",items:[{key:s,def:n}],tags:e??[]}}function E(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"CURRENCY",items:[{key:s,def:a=>({type:"currency",...o(a)})}],tags:e??[]}}const n={type:"currency",...t};return{type:"ITEMS",itemType:"CURRENCY",items:[{key:s,def:n}],tags:e??[]}}function k(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:s,def:a=>({type:"markdown",...o(a)})}],tags:e??[]}}const n={type:"markdown",...t};return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:s,def:n}],tags:e??[]}}function R(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"LIST",items:[{key:s,def:a=>({type:"list",...o(a)})}],tags:e??[]}}const n={type:"list",...t};return{type:"ITEMS",itemType:"LIST",items:[{key:s,def:n}],tags:e??[]}}function M(s,t,e){if(typeof t=="function"){const u=t;return{items:[r=>({type:"calendar",path:s,...u(r)})],type:"ITEMS",itemType:"CALENDAR",tags:e??[]}}return{items:[{type:"calendar",path:s,...t}],type:"ITEMS",itemType:"CALENDAR",tags:e??[]}}function P(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:s,def:a=>({type:"dateInput",...o(a)})}],tags:e??[]}}const n={type:"dateInput",...t};return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:s,def:n}],tags:e??[]}}function w(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:s,def:a=>({type:"datePicker",...o(a)})}],tags:e??[]}}const n={type:"datePicker",...t};return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:s,def:n}],tags:e??[]}}function C(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:s,def:a=>({type:"rangeCalendar",...o(a)})}],tags:e??[]}}const n={type:"rangeCalendar",...t};return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:s,def:n}],tags:e??[]}}function x(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:s,def:a=>({type:"rangeDateInput",...o(a)})}],tags:e??[]}}const n={type:"rangeDateInput",...t};return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:s,def:n}],tags:e??[]}}function b(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:s,def:a=>({type:"rangeDatePicker",...o(a)})}],tags:e??[]}}const n={type:"rangeDatePicker",...t};return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:s,def:n}],tags:e??[]}}function L(s,t,e,n){if(typeof e=="function"){const r=e;return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:c=>({customType:s,...r(c)})}],tags:n??[]}}const u={customType:s,...e};return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:u}],tags:n??[]}}function N(s,t){return{items:[s],type:"ITEMS",itemType:i.GuiItemTypes.ACTIONS,tags:t??[]}}function G(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[y=>({customType:s,...o(y)})],tags:e??[]}}return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[{customType:s,...t}],tags:e??[]}}function F(s,t){return{type:"ITEMS",itemType:"ALERTS",items:[s],tags:t??[]}}function v(s,t,e){if(typeof t=="function"){const y=t;return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[c=>({customType:s,...y(c)})],tags:e??[]}}const{uid:n,...u}=t??{};return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[{customType:s,...n!=null?{uid:n}:{},props:Object.keys(u).length>0?u:void 0}],tags:e??[]}}const d=(s,t,e)=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{widgetName:"flex",...t??{}},children:s}],tags:e??[]}),W=(s,t,e)=>d(s,{direction:"row",...t??{}},e),Y=(s,t,e)=>d(s,{direction:"column",...t??{}},e),g=(s,t,e)=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{widgetName:"grid",direction:"row",autoFit:!0,...t??{}},children:s}],tags:e??[]}),$=(s,t,e)=>g(s,{direction:"row",...t??{}},e),j=(s,t,e)=>g(s,{direction:"column",...t??{}},e);function m(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function z(s,t,e){const n=s.map(r=>({label:r.label,uid:r.uid??m(r.label)})),u=s.map(r=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{uid:r.uid??m(r.label),direction:"column",widgetName:"flex"},children:r.children}],tags:[]}));return{type:"ITEMS",itemType:"TABS",items:[{def:{tabs:n,...t},children:u}],tags:e??[]}}function _(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function H(s,t,e){const n=s.map(r=>({label:r.label,uid:r.uid??_(r.label)})),u=s.map(r=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{uid:r.uid??_(r.label),direction:"column",widgetName:"flex"},children:r.children}],tags:[]}));return{type:"ITEMS",itemType:"ACCORDION",items:[{def:{sections:n,...t},children:u}],tags:e??[]}}function K(s,t,e,n){if(typeof e=="function"){const r=e;return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:c=>({customType:s,...r(c)}),children:t}],tags:n??[]}}return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:{customType:s,...e},children:t}],tags:n??[]}}function V(s,t,e){const{template:n,...u}=t;return{type:"ITEMS",itemType:"REPEATER",items:[{key:s,def:u,children:n}],tags:e??[]}}function Z(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"TAGS",items:[{key:s,def:a=>({type:"tags",...o(a)})}],tags:e??[]}}const n={type:"tags",...t};return{type:"ITEMS",itemType:"TAGS",items:[{key:s,def:n}],tags:e??[]}}const X=s=>i._gslInputs(s,t=>t.type==="text"),q=s=>i._gslInputs(s,t=>t.type==="number"),Q=s=>i._gslInputs(s,t=>t.type==="boolean");class l{constructor(t){this.conditions=t}static root(){return new l([])}tag(t){return new l([...this.conditions,{kind:"tagsAnd",tags:[t]}])}state(t){return new l([...this.conditions,{kind:"state",name:t}])}tagsAnd(t){return new l([...this.conditions,{kind:"tagsAnd",tags:t}])}tagsOr(t){return new l([...this.conditions,{kind:"tagsOr",tags:t}])}apply(t){if(this.conditions.length===0)return t;const e=this.conditions.find(o=>o.kind==="state"),n=this.conditions.filter(o=>o.kind!=="state"),u=t.matcher;return{...t,matcher:o=>{if(!u(o))return!1;for(const r of n){const y=o.tags??[];if(r.kind==="tagsAnd"){for(const a of r.tags)if(!y.includes(a))return!1}else{if(r.tags.length===0)continue;if(!r.tags.some(a=>y.includes(a)))return!1}}return!0},...e?{targetState:e.name}:{}}}inputs(t){return this.apply(i._gslInputs(t))}inputByUid(t,e){return this.apply(i._gslInputByUid(t,e))}textInputs(t){return this.apply(X(t))}numberInputs(t){return this.apply(q(t))}booleanInputs(t){return this.apply(Q(t))}selects(t){return this.apply(i._gslSelects(t))}selectByUid(t,e){return this.apply(i._gslSelectByUid(t,e))}dropdowns(t){return this.apply(i._gslDropdowns(t))}dropdownByUid(t,e){return this.apply(i._gslDropdownByUid(t,e))}radiogroups(t){return this.apply(i._gslRadiogroups(t))}radiogroupByUid(t,e){return this.apply(i._gslRadiogroupByUid(t,e))}checkboxes(t){return this.apply(i._gslCheckboxes(t))}checkboxByUid(t,e){return this.apply(i._gslCheckboxByUid(t,e))}textareas(t){return this.apply(i._gslTextareas(t))}textareaByUid(t,e){return this.apply(i._gslTextareaByUid(t,e))}passwords(t){return this.apply(i._gslPasswords(t))}passwordByUid(t,e){return this.apply(i._gslPasswordByUid(t,e))}currencies(t){return this.apply(i._gslCurrencies(t))}currencyByUid(t,e){return this.apply(i._gslCurrencyByUid(t,e))}markdowns(t){return this.apply(i._gslMarkdowns(t))}markdownByUid(t,e){return this.apply(i._gslMarkdownByUid(t,e))}lists(t){return this.apply(i._gslLists(t))}listByUid(t,e){return this.apply(i._gslListByUid(t,e))}calendars(t){return this.apply(i._gslCalendars(t))}calendarByUid(t,e){return this.apply(i._gslCalendarByUid(t,e))}dateInputs(t){return this.apply(i._gslDateInputs(t))}dateInputByUid(t,e){return this.apply(i._gslDateInputByUid(t,e))}datePickers(t){return this.apply(i._gslDatePickers(t))}datePickerByUid(t,e){return this.apply(i._gslDatePickerByUid(t,e))}rangeCalendars(t){return this.apply(i._gslRangeCalendars(t))}rangeCalendarByUid(t,e){return this.apply(i._gslRangeCalendarByUid(t,e))}rangeDateInputs(t){return this.apply(i._gslRangeDateInputs(t))}rangeDateInputByUid(t,e){return this.apply(i._gslRangeDateInputByUid(t,e))}rangeDatePickers(t){return this.apply(i._gslRangeDatePickers(t))}rangeDatePickerByUid(t,e){return this.apply(i._gslRangeDatePickerByUid(t,e))}repeaters(t){return this.apply(i._gslRepeaters(t))}repeaterByUid(t,e){return this.apply(i._gslRepeaterByUid(t,e))}actions(t){return this.apply(i._gslActions(t))}actionByUid(t,e){return this.apply(i._gslActionByUid(t,e))}layouts(t){return this.apply(i._gslLayouts(t))}layoutByUid(t,e){return this.apply(i._gslLayoutByUid(t,e))}displays(t){return this.apply(i._gslDisplays(t))}displayByUid(t,e){return this.apply(i._gslDisplayByUid(t,e))}alerts(t){return this.apply(i._gslAlerts(t))}alertByUid(t,e){return this.apply(i._gslAlertByUid(t,e))}tabs(t){return this.apply(i._gslTabs(t))}tabsByUid(t,e){return this.apply(i._gslTabsByUid(t,e))}accordions(t){return this.apply(i._gslAccordions(t))}accordionByUid(t,e){return this.apply(i._gslAccordionByUid(t,e))}customInputs(t){return this.apply(i._gslCustomInputs(t))}customInputByUid(t,e){return this.apply(i._gslCustomInputByUid(t,e))}customActions(t){return this.apply(i._gslCustomActions(t))}customActionByUid(t,e){return this.apply(i._gslCustomActionByUid(t,e))}customDisplays(t){return this.apply(i._gslCustomDisplays(t))}customDisplayByUid(t,e){return this.apply(i._gslCustomDisplayByUid(t,e))}customLayouts(t){return this.apply(i._gslCustomLayouts(t))}customLayoutByUid(t,e){return this.apply(i._gslCustomLayoutByUid(t,e))}}const J={inputs:{textInput:f,numberInput:T,booleanInput:I,select:U,dropdown:B,radiogroup:S,checkbox:D,textarea:h,password:A,currency:E,markdown:k,list:R,calendar:M,dateInput:P,datePicker:w,rangeCalendar:C,rangeDateInput:x,rangeDatePicker:b,repeater:V,tags:Z,custom:L},actions:{button:N,custom:G},displays:{display:i._guiDisplay,alert:F,custom:v},layouts:{flex:d,horizontalFlex:W,verticalFlex:Y,grid:g,horizontalGrid:$,verticalGrid:j,tabs:z,accordion:H,custom:K},selectors:l.root()},{gsl:ut,gslByUid:at}=i.defineShortcutType({itemType:"TAGS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(s,t)=>i.processAutoPlaceholder(i.processAutoLabel(s,t),t)},mapToWidget:s=>({uid:s.uid??"",kind:"input",type:"tags",path:s.path??"",...s.label!=null?{label:s.label}:{},...s.disabled!=null?{disabled:s.disabled}:{},...s.readonly!=null?{readonly:s.readonly}:{},...s.validator!=null?{validator:i.buildTypedValidator(s.validator,"array")}:{},props:i.extractWidgetProps(s)})});function O(s,...t){return t.map(e=>({...e,targetState:s}))}function tt(s,...t){return{kind:"aggregated",matcher:e=>e.tags?.includes(s)??!1,children:t}}class et{create(t){return{states:t.states,form:{uid:"gui-root-uid",type:"flex",kind:"layout",children:t.form}}}}function st(){return new et}const it=s=>s!==null&&typeof s=="object"&&Object.prototype.hasOwnProperty.call(s,"label")&&Object.prototype.hasOwnProperty.call(s,"value");function nt(s){return typeof s=="object"&&s!==null&&"$ref"in s&&typeof s.$ref=="string"&&Object.keys(s).length===1}async function ot(s,t){const e=new URL(s,t).href,n=await fetch(e);if(!n.ok)throw new Error(`Failed to load form chunk ${e}: ${n.status}`);const{$schema:u,...o}=await n.json();return p(o,e)}async function p(s,t){if(nt(s))return ot(s.$ref,t);const e=s;if(Array.isArray(e.children)){const n=await Promise.all(e.children.map(u=>p(u,t)));return{...e,children:n}}return s}async function rt(s,t){const e=await Promise.all(s.form.map(n=>p(n,t)));return{...s,form:e}}exports._gslAccordionByUid=i._gslAccordionByUid;exports._gslAccordions=i._gslAccordions;exports._gslActionByUid=i._gslActionByUid;exports._gslActions=i._gslActions;exports._gslAlertByUid=i._gslAlertByUid;exports._gslAlerts=i._gslAlerts;exports._gslCalendarByUid=i._gslCalendarByUid;exports._gslCalendars=i._gslCalendars;exports._gslCheckboxByUid=i._gslCheckboxByUid;exports._gslCheckboxes=i._gslCheckboxes;exports._gslCurrencies=i._gslCurrencies;exports._gslCurrencyByUid=i._gslCurrencyByUid;exports._gslCustomActionByUid=i._gslCustomActionByUid;exports._gslCustomActions=i._gslCustomActions;exports._gslCustomDisplayByUid=i._gslCustomDisplayByUid;exports._gslCustomDisplays=i._gslCustomDisplays;exports._gslCustomInputByUid=i._gslCustomInputByUid;exports._gslCustomInputs=i._gslCustomInputs;exports._gslCustomLayoutByUid=i._gslCustomLayoutByUid;exports._gslCustomLayouts=i._gslCustomLayouts;exports._gslDateInputByUid=i._gslDateInputByUid;exports._gslDateInputs=i._gslDateInputs;exports._gslDatePickerByUid=i._gslDatePickerByUid;exports._gslDatePickers=i._gslDatePickers;exports._gslDisplayByUid=i._gslDisplayByUid;exports._gslDisplays=i._gslDisplays;exports._gslDropdownByUid=i._gslDropdownByUid;exports._gslDropdowns=i._gslDropdowns;exports._gslInputByUid=i._gslInputByUid;exports._gslInputs=i._gslInputs;exports._gslLayoutByUid=i._gslLayoutByUid;exports._gslLayouts=i._gslLayouts;exports._gslListByUid=i._gslListByUid;exports._gslLists=i._gslLists;exports._gslMarkdownByUid=i._gslMarkdownByUid;exports._gslMarkdowns=i._gslMarkdowns;exports._gslPasswordByUid=i._gslPasswordByUid;exports._gslPasswords=i._gslPasswords;exports._gslRadiogroupByUid=i._gslRadiogroupByUid;exports._gslRadiogroups=i._gslRadiogroups;exports._gslRangeCalendarByUid=i._gslRangeCalendarByUid;exports._gslRangeCalendars=i._gslRangeCalendars;exports._gslRangeDateInputByUid=i._gslRangeDateInputByUid;exports._gslRangeDateInputs=i._gslRangeDateInputs;exports._gslRangeDatePickerByUid=i._gslRangeDatePickerByUid;exports._gslRangeDatePickers=i._gslRangeDatePickers;exports._gslRepeaterByUid=i._gslRepeaterByUid;exports._gslRepeaters=i._gslRepeaters;exports._gslSelectByUid=i._gslSelectByUid;exports._gslSelects=i._gslSelects;exports._gslTabs=i._gslTabs;exports._gslTabsByUid=i._gslTabsByUid;exports._gslTextareaByUid=i._gslTextareaByUid;exports._gslTextareas=i._gslTextareas;exports._guiDisplay=i._guiDisplay;exports.createGslSelector=i.createGslSelector;exports.defineShortcutType=i.defineShortcutType;exports.extractWidgetProps=i.extractWidgetProps;exports.formDefs=i.formDefs;exports.isDxDefinitions=i.isDxDefinitions;exports.processAutoLabel=i.processAutoLabel;exports.processAutoPlaceholder=i.processAutoPlaceholder;exports.resolveFormInput=i.resolveFormInput;exports._gslBooleanInputs=Q;exports._gslNumberInputs=q;exports._gslStates=O;exports._gslTag=tt;exports._gslTextInputs=X;exports._guiAccordion=H;exports._guiAlert=F;exports._guiBooleanInput=I;exports._guiButton=N;exports._guiCalendar=M;exports._guiCheckbox=D;exports._guiCurrency=E;exports._guiCustomAction=G;exports._guiCustomDisplay=v;exports._guiCustomInput=L;exports._guiCustomLayout=K;exports._guiDateInput=P;exports._guiDatePicker=w;exports._guiDropdown=B;exports._guiFlex=d;exports._guiGrid=g;exports._guiHorizontalFlex=W;exports._guiHorizontalGrid=$;exports._guiList=R;exports._guiMarkdown=k;exports._guiNumberInput=T;exports._guiPassword=A;exports._guiRadiogroup=S;exports._guiRangeCalendar=C;exports._guiRangeDateInput=x;exports._guiRangeDatePicker=b;exports._guiRepeater=V;exports._guiSelect=U;exports._guiTabs=z;exports._guiTextInput=f;exports._guiTextarea=h;exports._guiVerticalFlex=Y;exports._guiVerticalGrid=j;exports.golemForm=st;exports.gui=J;exports.isOption=it;exports.resolveChunkRefs=rt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./resolveFormInput-BkRkdOqj.cjs");require("@golemui/core");require("@golemui/gui-validators");function f(s,t,e){if(typeof t=="function"){const u=t;return{items:[{key:s,def:r=>({type:"text",...u(r)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}const n={type:"text",...t};return{items:[{key:s,def:n}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}function T(s,t,e){if(typeof t=="function"){const u=t;return{items:[{key:s,def:r=>({type:"number",...u(r)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}const n={type:"number",...t};return{items:[{key:s,def:n}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}function I(s,t,e){if(typeof t=="function"){const u=t;return{items:[{key:s,def:r=>({type:"boolean",...u(r)})}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}const n={type:"boolean",...t};return{items:[{key:s,def:n}],type:"ITEMS",itemType:i.GuiItemTypes.INPUTS,tags:e??[]}}function U(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"SELECT",items:[{key:s,def:a=>({type:"select",...o(a)})}],tags:e??[]}}const n={type:"select",...t};return{type:"ITEMS",itemType:"SELECT",items:[{key:s,def:n}],tags:e??[]}}function B(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:s,def:a=>({type:"dropdown",...o(a)})}],tags:e??[]}}const n={type:"dropdown",...t};return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:s,def:n}],tags:e??[]}}function S(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:s,def:a=>({type:"radiogroup",...o(a)})}],tags:e??[]}}const n={type:"radiogroup",...t};return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:s,def:n}],tags:e??[]}}function D(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:s,def:a=>({type:"checkbox",...o(a)})}],tags:e??[]}}const n={type:"checkbox",...t};return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:s,def:n}],tags:e??[]}}function h(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:s,def:a=>({type:"textarea",...o(a)})}],tags:e??[]}}const n={type:"textarea",...t};return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:s,def:n}],tags:e??[]}}function A(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"PASSWORD",items:[{key:s,def:a=>({type:"password",...o(a)})}],tags:e??[]}}const n={type:"password",...t};return{type:"ITEMS",itemType:"PASSWORD",items:[{key:s,def:n}],tags:e??[]}}function E(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"CURRENCY",items:[{key:s,def:a=>({type:"currency",...o(a)})}],tags:e??[]}}const n={type:"currency",...t};return{type:"ITEMS",itemType:"CURRENCY",items:[{key:s,def:n}],tags:e??[]}}function k(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:s,def:a=>({type:"markdown",...o(a)})}],tags:e??[]}}const n={type:"markdown",...t};return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:s,def:n}],tags:e??[]}}function M(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"LIST",items:[{key:s,def:a=>({type:"list",...o(a)})}],tags:e??[]}}const n={type:"list",...t};return{type:"ITEMS",itemType:"LIST",items:[{key:s,def:n}],tags:e??[]}}function R(s,t,e){if(typeof t=="function"){const u=t;return{items:[r=>({type:"calendar",path:s,...u(r)})],type:"ITEMS",itemType:"CALENDAR",tags:e??[]}}return{items:[{type:"calendar",path:s,...t}],type:"ITEMS",itemType:"CALENDAR",tags:e??[]}}function P(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:s,def:a=>({type:"dateInput",...o(a)})}],tags:e??[]}}const n={type:"dateInput",...t};return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:s,def:n}],tags:e??[]}}function w(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:s,def:a=>({type:"datePicker",...o(a)})}],tags:e??[]}}const n={type:"datePicker",...t};return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:s,def:n}],tags:e??[]}}function x(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:s,def:a=>({type:"rangeCalendar",...o(a)})}],tags:e??[]}}const n={type:"rangeCalendar",...t};return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:s,def:n}],tags:e??[]}}function C(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:s,def:a=>({type:"rangeDateInput",...o(a)})}],tags:e??[]}}const n={type:"rangeDateInput",...t};return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:s,def:n}],tags:e??[]}}function b(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:s,def:a=>({type:"rangeDatePicker",...o(a)})}],tags:e??[]}}const n={type:"rangeDatePicker",...t};return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:s,def:n}],tags:e??[]}}function L(s,t,e,n){if(typeof e=="function"){const r=e;return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:c=>({customType:s,...r(c)})}],tags:n??[]}}const u={customType:s,...e};return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:u}],tags:n??[]}}function N(s,t){return{items:[s],type:"ITEMS",itemType:i.GuiItemTypes.ACTIONS,tags:t??[]}}function G(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[y=>({customType:s,...o(y)})],tags:e??[]}}return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[{customType:s,...t}],tags:e??[]}}function F(s,t){return{type:"ITEMS",itemType:"ALERTS",items:[s],tags:t??[]}}function Q(s,t){return{type:"ITEMS",itemType:"MARKDOWN_TEXTS",items:[s],tags:t??[]}}function v(s,t,e){if(typeof t=="function"){const y=t;return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[c=>({customType:s,...y(c)})],tags:e??[]}}const{uid:n,...u}=t??{};return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[{customType:s,...n!=null?{uid:n}:{},props:Object.keys(u).length>0?u:void 0}],tags:e??[]}}const d=(s,t,e)=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{widgetName:"flex",...t??{}},children:s}],tags:e??[]}),W=(s,t,e)=>d(s,{direction:"row",...t??{}},e),K=(s,t,e)=>d(s,{direction:"column",...t??{}},e),g=(s,t,e)=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{widgetName:"grid",direction:"row",autoFit:!0,...t??{}},children:s}],tags:e??[]}),Y=(s,t,e)=>g(s,{direction:"row",...t??{}},e),$=(s,t,e)=>g(s,{direction:"column",...t??{}},e);function m(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function j(s,t,e){const n=s.map(r=>({label:r.label,uid:r.uid??m(r.label)})),u=s.map(r=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{uid:r.uid??m(r.label),direction:"column",widgetName:"flex"},children:r.children}],tags:[]}));return{type:"ITEMS",itemType:"TABS",items:[{def:{tabs:n,...t},children:u}],tags:e??[]}}function _(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function z(s,t,e){const n=s.map(r=>({label:r.label,uid:r.uid??_(r.label)})),u=s.map(r=>({type:"ITEMS",itemType:i.GuiItemTypes.LAYOUTS,items:[{def:{uid:r.uid??_(r.label),direction:"column",widgetName:"flex"},children:r.children}],tags:[]}));return{type:"ITEMS",itemType:"ACCORDION",items:[{def:{sections:n,...t},children:u}],tags:e??[]}}function H(s,t,e,n){if(typeof e=="function"){const r=e;return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:c=>({customType:s,...r(c)}),children:t}],tags:n??[]}}return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:{customType:s,...e},children:t}],tags:n??[]}}function X(s,t,e){const{template:n,...u}=t;return{type:"ITEMS",itemType:"REPEATER",items:[{key:s,def:u,children:n}],tags:e??[]}}function Z(s,t,e){if(typeof t=="function"){const o=t;return{type:"ITEMS",itemType:"TAGS",items:[{key:s,def:a=>({type:"tags",...o(a)})}],tags:e??[]}}const n={type:"tags",...t};return{type:"ITEMS",itemType:"TAGS",items:[{key:s,def:n}],tags:e??[]}}const V=s=>i._gslInputs(s,t=>t.type==="text"),q=s=>i._gslInputs(s,t=>t.type==="number"),O=s=>i._gslInputs(s,t=>t.type==="boolean"),{gsl:J,gslByUid:tt}=i.defineShortcutType({itemType:"MARKDOWN_TEXTS",entryShape:"bare",mapToWidget:s=>({uid:s.uid??"",kind:"display",type:"markdownText",props:{md:s.md}})});class l{constructor(t){this.conditions=t}static root(){return new l([])}tag(t){return new l([...this.conditions,{kind:"tagsAnd",tags:[t]}])}state(t){return new l([...this.conditions,{kind:"state",name:t}])}tagsAnd(t){return new l([...this.conditions,{kind:"tagsAnd",tags:t}])}tagsOr(t){return new l([...this.conditions,{kind:"tagsOr",tags:t}])}apply(t){if(this.conditions.length===0)return t;const e=this.conditions.find(o=>o.kind==="state"),n=this.conditions.filter(o=>o.kind!=="state"),u=t.matcher;return{...t,matcher:o=>{if(!u(o))return!1;for(const r of n){const y=o.tags??[];if(r.kind==="tagsAnd"){for(const a of r.tags)if(!y.includes(a))return!1}else{if(r.tags.length===0)continue;if(!r.tags.some(a=>y.includes(a)))return!1}}return!0},...e?{targetState:e.name}:{}}}inputs(t){return this.apply(i._gslInputs(t))}inputByUid(t,e){return this.apply(i._gslInputByUid(t,e))}textInputs(t){return this.apply(V(t))}numberInputs(t){return this.apply(q(t))}booleanInputs(t){return this.apply(O(t))}selects(t){return this.apply(i._gslSelects(t))}selectByUid(t,e){return this.apply(i._gslSelectByUid(t,e))}dropdowns(t){return this.apply(i._gslDropdowns(t))}dropdownByUid(t,e){return this.apply(i._gslDropdownByUid(t,e))}radiogroups(t){return this.apply(i._gslRadiogroups(t))}radiogroupByUid(t,e){return this.apply(i._gslRadiogroupByUid(t,e))}checkboxes(t){return this.apply(i._gslCheckboxes(t))}checkboxByUid(t,e){return this.apply(i._gslCheckboxByUid(t,e))}textareas(t){return this.apply(i._gslTextareas(t))}textareaByUid(t,e){return this.apply(i._gslTextareaByUid(t,e))}passwords(t){return this.apply(i._gslPasswords(t))}passwordByUid(t,e){return this.apply(i._gslPasswordByUid(t,e))}currencies(t){return this.apply(i._gslCurrencies(t))}currencyByUid(t,e){return this.apply(i._gslCurrencyByUid(t,e))}markdowns(t){return this.apply(i._gslMarkdowns(t))}markdownByUid(t,e){return this.apply(i._gslMarkdownByUid(t,e))}lists(t){return this.apply(i._gslLists(t))}listByUid(t,e){return this.apply(i._gslListByUid(t,e))}calendars(t){return this.apply(i._gslCalendars(t))}calendarByUid(t,e){return this.apply(i._gslCalendarByUid(t,e))}dateInputs(t){return this.apply(i._gslDateInputs(t))}dateInputByUid(t,e){return this.apply(i._gslDateInputByUid(t,e))}datePickers(t){return this.apply(i._gslDatePickers(t))}datePickerByUid(t,e){return this.apply(i._gslDatePickerByUid(t,e))}rangeCalendars(t){return this.apply(i._gslRangeCalendars(t))}rangeCalendarByUid(t,e){return this.apply(i._gslRangeCalendarByUid(t,e))}rangeDateInputs(t){return this.apply(i._gslRangeDateInputs(t))}rangeDateInputByUid(t,e){return this.apply(i._gslRangeDateInputByUid(t,e))}rangeDatePickers(t){return this.apply(i._gslRangeDatePickers(t))}rangeDatePickerByUid(t,e){return this.apply(i._gslRangeDatePickerByUid(t,e))}repeaters(t){return this.apply(i._gslRepeaters(t))}repeaterByUid(t,e){return this.apply(i._gslRepeaterByUid(t,e))}actions(t){return this.apply(i._gslActions(t))}actionByUid(t,e){return this.apply(i._gslActionByUid(t,e))}layouts(t){return this.apply(i._gslLayouts(t))}layoutByUid(t,e){return this.apply(i._gslLayoutByUid(t,e))}displays(t){return this.apply(i._gslDisplays(t))}displayByUid(t,e){return this.apply(i._gslDisplayByUid(t,e))}alerts(t){return this.apply(i._gslAlerts(t))}alertByUid(t,e){return this.apply(i._gslAlertByUid(t,e))}markdownTexts(t){return this.apply(J(t))}markdownTextByUid(t,e){return this.apply(tt(t,e))}tabs(t){return this.apply(i._gslTabs(t))}tabsByUid(t,e){return this.apply(i._gslTabsByUid(t,e))}accordions(t){return this.apply(i._gslAccordions(t))}accordionByUid(t,e){return this.apply(i._gslAccordionByUid(t,e))}customInputs(t){return this.apply(i._gslCustomInputs(t))}customInputByUid(t,e){return this.apply(i._gslCustomInputByUid(t,e))}customActions(t){return this.apply(i._gslCustomActions(t))}customActionByUid(t,e){return this.apply(i._gslCustomActionByUid(t,e))}customDisplays(t){return this.apply(i._gslCustomDisplays(t))}customDisplayByUid(t,e){return this.apply(i._gslCustomDisplayByUid(t,e))}customLayouts(t){return this.apply(i._gslCustomLayouts(t))}customLayoutByUid(t,e){return this.apply(i._gslCustomLayoutByUid(t,e))}}const et={inputs:{textInput:f,numberInput:T,booleanInput:I,select:U,dropdown:B,radiogroup:S,checkbox:D,textarea:h,password:A,currency:E,markdown:k,list:M,calendar:R,dateInput:P,datePicker:w,rangeCalendar:x,rangeDateInput:C,rangeDatePicker:b,repeater:X,tags:Z,custom:L},actions:{button:N,custom:G},displays:{display:i._guiDisplay,alert:F,markdownText:Q,custom:v},layouts:{flex:d,horizontalFlex:W,verticalFlex:K,grid:g,horizontalGrid:Y,verticalGrid:$,tabs:j,accordion:z,custom:H},selectors:l.root()},{gsl:lt,gslByUid:ct}=i.defineShortcutType({itemType:"TAGS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(s,t)=>i.processAutoPlaceholder(i.processAutoLabel(s,t),t)},mapToWidget:s=>({uid:s.uid??"",kind:"input",type:"tags",path:s.path??"",...s.label!=null?{label:s.label}:{},...s.disabled!=null?{disabled:s.disabled}:{},...s.readonly!=null?{readonly:s.readonly}:{},...s.validator!=null?{validator:i.buildTypedValidator(s.validator,"array")}:{},props:i.extractWidgetProps(s)})});function st(s,...t){return t.map(e=>({...e,targetState:s}))}function it(s,...t){return{kind:"aggregated",matcher:e=>e.tags?.includes(s)??!1,children:t}}class nt{create(t){return{states:t.states,form:{uid:"gui-root-uid",type:"flex",kind:"layout",children:t.form}}}}function ot(){return new nt}const rt=s=>s!==null&&typeof s=="object"&&Object.prototype.hasOwnProperty.call(s,"label")&&Object.prototype.hasOwnProperty.call(s,"value");function ut(s){return typeof s=="object"&&s!==null&&"$ref"in s&&typeof s.$ref=="string"&&Object.keys(s).length===1}async function at(s,t){const e=new URL(s,t).href,n=await fetch(e);if(!n.ok)throw new Error(`Failed to load form chunk ${e}: ${n.status}`);const{$schema:u,...o}=await n.json();return p(o,e)}async function p(s,t){if(ut(s))return at(s.$ref,t);const e=s;if(Array.isArray(e.children)){const n=await Promise.all(e.children.map(u=>p(u,t)));return{...e,children:n}}return s}async function yt(s,t){const e=await Promise.all(s.form.map(n=>p(n,t)));return{...s,form:e}}exports._gslAccordionByUid=i._gslAccordionByUid;exports._gslAccordions=i._gslAccordions;exports._gslActionByUid=i._gslActionByUid;exports._gslActions=i._gslActions;exports._gslAlertByUid=i._gslAlertByUid;exports._gslAlerts=i._gslAlerts;exports._gslCalendarByUid=i._gslCalendarByUid;exports._gslCalendars=i._gslCalendars;exports._gslCheckboxByUid=i._gslCheckboxByUid;exports._gslCheckboxes=i._gslCheckboxes;exports._gslCurrencies=i._gslCurrencies;exports._gslCurrencyByUid=i._gslCurrencyByUid;exports._gslCustomActionByUid=i._gslCustomActionByUid;exports._gslCustomActions=i._gslCustomActions;exports._gslCustomDisplayByUid=i._gslCustomDisplayByUid;exports._gslCustomDisplays=i._gslCustomDisplays;exports._gslCustomInputByUid=i._gslCustomInputByUid;exports._gslCustomInputs=i._gslCustomInputs;exports._gslCustomLayoutByUid=i._gslCustomLayoutByUid;exports._gslCustomLayouts=i._gslCustomLayouts;exports._gslDateInputByUid=i._gslDateInputByUid;exports._gslDateInputs=i._gslDateInputs;exports._gslDatePickerByUid=i._gslDatePickerByUid;exports._gslDatePickers=i._gslDatePickers;exports._gslDisplayByUid=i._gslDisplayByUid;exports._gslDisplays=i._gslDisplays;exports._gslDropdownByUid=i._gslDropdownByUid;exports._gslDropdowns=i._gslDropdowns;exports._gslInputByUid=i._gslInputByUid;exports._gslInputs=i._gslInputs;exports._gslLayoutByUid=i._gslLayoutByUid;exports._gslLayouts=i._gslLayouts;exports._gslListByUid=i._gslListByUid;exports._gslLists=i._gslLists;exports._gslMarkdownByUid=i._gslMarkdownByUid;exports._gslMarkdowns=i._gslMarkdowns;exports._gslPasswordByUid=i._gslPasswordByUid;exports._gslPasswords=i._gslPasswords;exports._gslRadiogroupByUid=i._gslRadiogroupByUid;exports._gslRadiogroups=i._gslRadiogroups;exports._gslRangeCalendarByUid=i._gslRangeCalendarByUid;exports._gslRangeCalendars=i._gslRangeCalendars;exports._gslRangeDateInputByUid=i._gslRangeDateInputByUid;exports._gslRangeDateInputs=i._gslRangeDateInputs;exports._gslRangeDatePickerByUid=i._gslRangeDatePickerByUid;exports._gslRangeDatePickers=i._gslRangeDatePickers;exports._gslRepeaterByUid=i._gslRepeaterByUid;exports._gslRepeaters=i._gslRepeaters;exports._gslSelectByUid=i._gslSelectByUid;exports._gslSelects=i._gslSelects;exports._gslTabs=i._gslTabs;exports._gslTabsByUid=i._gslTabsByUid;exports._gslTextareaByUid=i._gslTextareaByUid;exports._gslTextareas=i._gslTextareas;exports._guiDisplay=i._guiDisplay;exports.createGslSelector=i.createGslSelector;exports.defineShortcutType=i.defineShortcutType;exports.extractWidgetProps=i.extractWidgetProps;exports.formDefs=i.formDefs;exports.isDxDefinitions=i.isDxDefinitions;exports.processAutoLabel=i.processAutoLabel;exports.processAutoPlaceholder=i.processAutoPlaceholder;exports.resolveFormInput=i.resolveFormInput;exports._gslBooleanInputs=O;exports._gslNumberInputs=q;exports._gslStates=st;exports._gslTag=it;exports._gslTextInputs=V;exports._guiAccordion=z;exports._guiAlert=F;exports._guiBooleanInput=I;exports._guiButton=N;exports._guiCalendar=R;exports._guiCheckbox=D;exports._guiCurrency=E;exports._guiCustomAction=G;exports._guiCustomDisplay=v;exports._guiCustomInput=L;exports._guiCustomLayout=H;exports._guiDateInput=P;exports._guiDatePicker=w;exports._guiDropdown=B;exports._guiFlex=d;exports._guiGrid=g;exports._guiHorizontalFlex=W;exports._guiHorizontalGrid=Y;exports._guiList=M;exports._guiMarkdown=k;exports._guiNumberInput=T;exports._guiPassword=A;exports._guiRadiogroup=S;exports._guiRangeCalendar=x;exports._guiRangeDateInput=C;exports._guiRangeDatePicker=b;exports._guiRepeater=X;exports._guiSelect=U;exports._guiTabs=j;exports._guiTextInput=f;exports._guiTextarea=h;exports._guiVerticalFlex=K;exports._guiVerticalGrid=$;exports.golemForm=ot;exports.gui=et;exports.isOption=rt;exports.resolveChunkRefs=yt;
|
package/internals.js
CHANGED
package/internals.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./resolveFormInput-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./resolveFormInput-BkRkdOqj.cjs");function n(e,t){if(e!=null&&typeof e=="object"&&"__rid"in e)return e.__rid;const r=t();return Object.defineProperty(e,"__rid",{value:r,enumerable:!1,configurable:!1}),r}exports.resolveFormInput=o.resolveFormInput;exports.getItemKey=n;
|
package/lib/dx/gui.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { _guiCustomInput } from './shortcuts/custom-input/guiCustomInput.impl';
|
|
|
20
20
|
import { _guiButton } from './shortcuts/actions/guiActions.impl';
|
|
21
21
|
import { _guiCustomAction } from './shortcuts/custom-action/guiCustomAction.impl';
|
|
22
22
|
import { _guiAlert } from './shortcuts/alert/guiAlert.impl';
|
|
23
|
+
import { _guiMarkdownText } from './shortcuts/markdown-text/guiMarkdownText.impl';
|
|
23
24
|
import { _guiCustomDisplay } from './shortcuts/custom-display/guiCustomDisplay.impl';
|
|
24
25
|
import { _guiTabs } from './shortcuts/tabs/guiTabs.impl';
|
|
25
26
|
import { _guiAccordion } from './shortcuts/accordion/guiAccordion.impl';
|
|
@@ -58,6 +59,7 @@ export declare const gui: {
|
|
|
58
59
|
readonly displays: {
|
|
59
60
|
readonly display: (render: (params: import('./formDef.domain').DxRuntimeParams) => any, tags?: string[]) => import('./shortcuts/display/display.domain').GuiDisplayItemsShortcut;
|
|
60
61
|
readonly alert: typeof _guiAlert;
|
|
62
|
+
readonly markdownText: typeof _guiMarkdownText;
|
|
61
63
|
readonly custom: typeof _guiCustomDisplay;
|
|
62
64
|
};
|
|
63
65
|
readonly layouts: {
|
package/lib/dx/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export { _guiTextInput } from './shortcuts/inputs/guiTextInput.impl';
|
|
|
19
19
|
export { _guiFlex, _guiGrid, _guiHorizontalFlex, _guiHorizontalGrid, _guiVerticalFlex, _guiVerticalGrid, } from './shortcuts/layouts/guiFlex.impl';
|
|
20
20
|
export { _guiList } from './shortcuts/list/guiList.impl';
|
|
21
21
|
export { _guiMarkdown } from './shortcuts/markdown/guiMarkdown.impl';
|
|
22
|
+
export { _guiMarkdownText } from './shortcuts/markdown-text/guiMarkdownText.impl';
|
|
22
23
|
export { _guiPassword } from './shortcuts/password/guiPassword.impl';
|
|
23
24
|
export { _guiRadiogroup } from './shortcuts/radiogroup/guiRadiogroup.impl';
|
|
24
25
|
export { _guiRangeCalendar } from './shortcuts/range-calendar/guiRangeCalendar.impl';
|
|
@@ -48,6 +49,7 @@ export { _gslInputByUid, _gslInputs } from './shortcuts/inputs/register';
|
|
|
48
49
|
export { _gslLayoutByUid, _gslLayouts } from './shortcuts/layouts/register';
|
|
49
50
|
export { _gslListByUid, _gslLists } from './shortcuts/list/register';
|
|
50
51
|
export { _gslMarkdownByUid, _gslMarkdowns } from './shortcuts/markdown/register';
|
|
52
|
+
export { _gslMarkdownTextByUid, _gslMarkdownTexts } from './shortcuts/markdown-text/register';
|
|
51
53
|
export { _gslPasswordByUid, _gslPasswords } from './shortcuts/password/register';
|
|
52
54
|
export { _gslRadiogroupByUid, _gslRadiogroups } from './shortcuts/radiogroup/register';
|
|
53
55
|
export { _gslRangeCalendarByUid, _gslRangeCalendars } from './shortcuts/range-calendar/register';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DxRuntimeParams } from '../../core/dxUtilityTypes';
|
|
2
|
+
import { GuiMarkdownTextShortcut, MarkdownTextDecorator } from './markdownText.domain';
|
|
3
|
+
type MarkdownTextFactoryProps = MarkdownTextDecorator;
|
|
4
|
+
export declare function _guiMarkdownText(props: MarkdownTextFactoryProps, tags?: string[]): GuiMarkdownTextShortcut;
|
|
5
|
+
export declare function _guiMarkdownText(callback: (params: DxRuntimeParams) => MarkdownTextFactoryProps, tags?: string[]): GuiMarkdownTextShortcut;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MarkdownTextProps } from '../../../widget.props';
|
|
2
|
+
import { DxCommonFields } from '../../core/dxBase.types';
|
|
3
|
+
import { DefOrCallback, GslConfigBase, GuiShortcutOf } from '../../core/dxUtilityTypes';
|
|
4
|
+
export interface MarkdownTextDecorator extends DxCommonFields, Partial<MarkdownTextProps> {
|
|
5
|
+
md: string;
|
|
6
|
+
}
|
|
7
|
+
export type GslMarkdownTextsConfig = GslConfigBase<MarkdownTextDecorator>;
|
|
8
|
+
export type MarkdownTextEntry = DefOrCallback<MarkdownTextDecorator>;
|
|
9
|
+
export type GuiMarkdownTextShortcut = GuiShortcutOf<'MARKDOWN_TEXTS', MarkdownTextEntry>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { GslMarkdownTextsConfig, MarkdownTextDecorator } from './markdownText.domain';
|
|
2
|
+
export declare const _gslMarkdownTexts: (config: GslMarkdownTextsConfig, matcher?: ((decorator: MarkdownTextDecorator) => boolean) | undefined) => import('../../core/dx.domain').GslLeafSelector, _gslMarkdownTextByUid: (uid: string, config: GslMarkdownTextsConfig) => import('../../core/dx.domain').GslLeafSelector;
|
|
@@ -21,6 +21,7 @@ import { _gslActions, _gslActionByUid } from '../actions/register';
|
|
|
21
21
|
import { _gslLayouts, _gslLayoutByUid } from '../layouts/register';
|
|
22
22
|
import { _gslDisplays, _gslDisplayByUid } from '../display/register';
|
|
23
23
|
import { _gslAlerts, _gslAlertByUid } from '../alert/register';
|
|
24
|
+
import { _gslMarkdownTexts, _gslMarkdownTextByUid } from '../markdown-text/register';
|
|
24
25
|
import { _gslTabs, _gslTabsByUid } from '../tabs/register';
|
|
25
26
|
import { _gslAccordions, _gslAccordionByUid } from '../accordion/register';
|
|
26
27
|
import { _gslCustomInputs, _gslCustomInputByUid } from '../custom-input/register';
|
|
@@ -83,6 +84,8 @@ export declare class ScopeChain {
|
|
|
83
84
|
displayByUid(uid: string, config: CfgByUid<typeof _gslDisplayByUid>): GslLeafSelector;
|
|
84
85
|
alerts(config: CfgGsl<typeof _gslAlerts>): GslLeafSelector;
|
|
85
86
|
alertByUid(uid: string, config: CfgByUid<typeof _gslAlertByUid>): GslLeafSelector;
|
|
87
|
+
markdownTexts(config: CfgGsl<typeof _gslMarkdownTexts>): GslLeafSelector;
|
|
88
|
+
markdownTextByUid(uid: string, config: CfgByUid<typeof _gslMarkdownTextByUid>): GslLeafSelector;
|
|
86
89
|
tabs(config: CfgGsl<typeof _gslTabs>): GslLeafSelector;
|
|
87
90
|
tabsByUid(uid: string, config: CfgByUid<typeof _gslTabsByUid>): GslLeafSelector;
|
|
88
91
|
accordions(config: CfgGsl<typeof _gslAccordions>): GslLeafSelector;
|
package/lib/widgets.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const inputWidgets: readonly ["calendar", "checkbox", "currency",
|
|
|
2
2
|
export declare const layoutWidgets: readonly ["accordion", "flex", "grid", "tabs"];
|
|
3
3
|
export declare const displayWidgets: readonly ["alert", "markdownText", "renderer"];
|
|
4
4
|
export declare const actionWidgets: readonly ["button"];
|
|
5
|
-
export declare const golemWidgets: ("number" | "button" | "repeater" | "flex" | "tags" | "password" | "checkbox" | "dateInput" | "currency" | "rangeCalendar" | "select" | "radiogroup" | "tabs" | "list" | "datePicker" | "dropdown" | "markdown" | "rangeDateInput" | "rangeDatePicker" | "textarea" | "calendar" | "grid" | "toggle" | "textinput" | "renderer" | "alert" | "
|
|
5
|
+
export declare const golemWidgets: ("number" | "button" | "repeater" | "flex" | "tags" | "password" | "checkbox" | "dateInput" | "currency" | "rangeCalendar" | "select" | "radiogroup" | "tabs" | "list" | "datePicker" | "dropdown" | "markdown" | "rangeDateInput" | "rangeDatePicker" | "textarea" | "calendar" | "grid" | "toggle" | "textinput" | "renderer" | "alert" | "markdownText" | "accordion")[];
|
|
6
6
|
export type GolemInputWidget = (typeof inputWidgets)[number];
|
|
7
7
|
export type GolemLayoutWidget = (typeof layoutWidgets)[number];
|
|
8
8
|
export type GolemDisplayWidget = (typeof displayWidgets)[number];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemui/gui-shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.umd.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"*.md"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@golemui/core": "0.
|
|
34
|
-
"@golemui/gui-validators": "0.
|
|
33
|
+
"@golemui/core": "0.16.1",
|
|
34
|
+
"@golemui/gui-validators": "0.16.1"
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|
|
37
37
|
"type": "git",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("@golemui/core");const O={INPUTS:"INPUTS",ACTIONS:"ACTIONS",LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function B(e){return function(t,s=()=>!0){return{kind:"leaf",selectorType:e,matcher:s,config:t}}}function m(e,t){return typeof e=="function"?e:{type:t,...e??{}}}const x=(e,t)=>({type:"ITEMS",itemType:O.DISPLAYS,items:[{render:e}],tags:t??[]}),C=new Map;function F(e,t){if(C.has(e))throw new Error(`Item type "${e}" is already registered.`);C.set(e,t)}function f(e){const t=C.get(e);if(!t)throw new Error(`No handler registered for item type "${e}". Did you forget to import the registration module?`);return t}function j(e){return C.has(e)}function d(e){const t=o=>{if(!e.sensibleDefaults)return{};let r={...e.sensibleDefaults.base};for(const u of o){const p=u.config;for(const c of e.sensibleDefaults.fields){const b=c;p[b]!=null&&(r={...r,[b]:p[b]})}}return r},s=(o,r)=>e.sensibleDefaults?e.sensibleDefaults.apply(o,r):o,n=o=>{switch(e.entryShape){case"bare":return{baseDef:o};case"keyed":{const r=o;return{baseDef:r.def,path:r.key}}case"compound":{const r=o;return{baseDef:r.def,children:r.children}}}},l={rollUpSensibleDefaults:t,applySensibleDefaults:s,mapToWidget:e.mapToWidget,parseEntry:n,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};F(e.itemType,l);const a=B(e.itemType);return{gsl:a,gslByUid:(o,r)=>a(r,(u=>u.uid===o))}}function y(e){const{uid:t,path:s,label:n,disabled:l,readonly:a,defaultValue:i,tags:o,type:r,size:u,onLoad:p,onChange:c,onFilter:b,on:A,states:U,include:k,exclude:P,validator:I,...S}=e;return S}function H(e){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()):""}function g(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:H(e.path)}}function T(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}function q(e){switch(e.type){case"text":return J(e);case"number":return Q(e);case"boolean":return Z(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function Z(e){const t=y(e);return{uid:e.uid??"",kind:"input",type:"toggle",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"boolean")}:{},props:t}}function J(e){const t=y(e);return{uid:e.uid??"",kind:"input",type:"textinput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:m(e.validator,"string")}}function Q(e){const t=y(e);return{uid:e.uid??"",kind:"input",type:"number",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:m(e.validator,"number")}}const{gsl:ee,gslByUid:te}=d({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let s=g(e,t);return s=T(s,t),s}},mapToWidget:q}),{gsl:se,gslByUid:le}=d({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"select",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:y(e)})}),{gsl:ne,gslByUid:ae}=d({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dropdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:y(e)})}),{gsl:ie,gslByUid:re}=d({itemType:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"radiogroup",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:y(e)})}),{gsl:oe,gslByUid:ue}=d({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"checkbox",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"boolean")}:{},props:y(e)})}),{gsl:pe,gslByUid:de}=d({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"textarea",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"string")}:{},props:y(e)})}),{gsl:ce,gslByUid:ye}=d({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"password",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"string")}:{},props:y(e)})}),{gsl:be,gslByUid:ge}=d({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"currency",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"number")}:{},props:y(e)})}),{gsl:me,gslByUid:he}=d({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"markdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"string")}:{},props:y(e)})}),{gsl:_e,gslByUid:Te}=d({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"list",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:y(e)})}),{gsl:Ae,gslByUid:Se}=d({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"calendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"string")}:{},props:y(e)})}),{gsl:Ue,gslByUid:ke}=d({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"string")}:{},props:y(e)})}),{gsl:Ce,gslByUid:fe}=d({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"datePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"string")}:{},props:y(e)})}),{gsl:ve,gslByUid:De}=d({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"array")}:{},props:y(e)})}),{gsl:Le,gslByUid:Oe}=d({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"array")}:{},props:y(e)})}),{gsl:Be,gslByUid:Ee}=d({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDatePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"array")}:{},props:y(e)})});function Pe(e){const t={};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}function Ie(e){return{uid:e.uid??"",kind:"input",type:"repeater",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"array")}:{},props:{...Pe(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function L(e,t){for(const s of e){if(typeof s=="function")continue;const n=s;typeof n.path=="string"&&n.path&&(n.path=t+n.path),"children"in n&&Array.isArray(n.children)&&L(n.children,t);const l=n.props;l?.template?.children&&Array.isArray(l.template.children)&&L(l.template.children,t)}}function we(e,t){const s=t.walkChildren(t.children??[]),n=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";n&&L(s,n+".items.");const l={kind:"layout",type:"flex",uid:"",children:s,props:{direction:"column"}};if(e.kind==="static"){const i=t.mapStaticDef(e.def,"REPEATER");return{...i,props:{...i.props,template:l}}}const a=e.fn;return(i=>{const o=a(i),r=t.mapStaticDef(o,"REPEATER");return{...r,props:{...r.props,template:l}}})}function We(e){return{baseDef:e.def,path:e.key,children:e.children}}function Re(e){return e.children}const Me={parseEntry:We,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:Ie,buildCustomWidget:we,getChildren:Re};F("REPEATER",Me);const $=B("REPEATER"),Ne=(e,t)=>$(t,(s=>s.uid===e)),Y={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},xe=Object.keys(Y);class Fe{extractOnClickFromMergeResult(t,s,n){if(t.kind==="dynamic"){const i=t.fn;return{kind:"dynamic",fn:r=>{const u=i(r);return this.wireOnClick(u,s,n)}}}const l=t.def;return{kind:"static",def:this.wireOnClick(l,s,n)}}wireOnClick(t,s,n){const l=n.next(),a=t.onClick;if(typeof a=="function"){const{onClick:i,...o}=t,r=a(void 0);return typeof r=="string"?{...o,uid:l,on:{click:r}}:(s.set(l,u=>a(u.data)),{...o,uid:l,on:{click:l}})}return{...t,uid:l}}wireInputLayoutEvents(t,s,n){if(t.kind==="dynamic"){const a=t.fn;return{kind:"dynamic",fn:o=>{const r=a(o);return this.wireEventProperties(r,s,n)}}}return{kind:"static",def:this.wireEventProperties(t.def,s,n)}}wireEventProperties(t,s,n){const l={...t.on||{}};let a=!1;const i={...t};for(const o of xe){const r=t[o];if(r==null)continue;const u=Y[o];if(typeof r=="function"){const p=n.next();s.set(p,r),l[u]=p,a=!0}else typeof r=="string"&&(l[u]=r,a=!0);delete i[o]}return a&&(i.on=l),i}}const E=new Fe;function je(e){const{uid:t,label:s,actionType:n,disabled:l,on:a,onClick:i,data:o,type:r,tags:u,size:p,include:c,exclude:b,states:A,...U}=e;return{uid:t??"",kind:"action",type:"button",disabled:l,actionType:n,label:s,...a!=null?{on:a}:{},props:U}}const{gsl:$e,gslByUid:Ye}=d({itemType:"ACTIONS",entryShape:"bare",mapToWidget:je,afterMerge:(e,t)=>E.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function ze(e){const{uid:t,widgetName:s,tags:n,size:l,onChange:a,include:i,exclude:o,...r}=e,{on:u,...p}=r;return{uid:t??"",kind:"layout",type:s??"flex",props:{direction:p.direction??"column",...p},children:[]}}function Ve(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"LAYOUTS"),children:s}})}function Ke(e){return e.children}const{gsl:Ge,gslByUid:Xe}=d({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:ze,buildCustomWidget:Ve,getChildren:Ke});function He(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function qe(e,t){if(e.kind==="static"){const n=e.def;return(l=>({uid:"",kind:"display",type:"renderer",...n.include!=null?{include:n.include}:{},...n.exclude!=null?{exclude:n.exclude}:{},props:{render:n.render(l??{})}}))}const s=e.fn;return(n=>{const l=s(n);return{uid:"",kind:"display",type:"renderer",...l.include!=null?{include:l.include}:{},...l.exclude!=null?{exclude:l.exclude}:{},props:{render:l.render(n??{})}}})}const{gsl:Ze,gslByUid:Je}=d({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:He,buildCustomWidget:qe}),{gsl:Qe,gslByUid:et}=d({itemType:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})});function tt(e){return{uid:e.uid??"",kind:"layout",type:"tabs",props:{tabs:e.tabs,renderMode:e.renderMode??"all",...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function st(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"TABS"),children:s}})}function lt(e){return e.children}const{gsl:nt,gslByUid:at}=d({itemType:"TABS",entryShape:"compound",mapToWidget:tt,buildCustomWidget:st,getChildren:lt});function it(e){return{uid:e.uid??"",kind:"layout",type:"accordion",props:{sections:e.sections,renderMode:e.renderMode??"all",...e.singleOpen!=null?{singleOpen:e.singleOpen}:{},...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function rt(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"ACCORDION"),children:s}})}function ot(e){return e.children}const{gsl:ut,gslByUid:pt}=d({itemType:"ACCORDION",entryShape:"compound",mapToWidget:it,buildCustomWidget:rt,getChildren:ot}),{gsl:dt,gslByUid:ct}=d({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:e.customType,path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.validator!=null?{validator:e.validator}:{},props:e.props??{}})}),{gsl:yt,gslByUid:bt}=d({itemType:"CUSTOM_ACTION",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:s,disabled:n,on:l,onClick:a,data:i,customType:o,tags:r,size:u,include:p,exclude:c,states:b,props:A,...U}=e;return{uid:t??"",kind:"action",type:e.customType,label:s,disabled:n,...l!=null?{on:l}:{},props:{...A,...U}}},afterMerge:(e,t)=>E.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),{gsl:gt,gslByUid:mt}=d({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})});function ht(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function _t(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"CUSTOM_LAYOUT"),children:s}})}function Tt(e){return e.children}const{gsl:At,gslByUid:St}=d({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:ht,buildCustomWidget:_t,getChildren:Tt}),z={INPUTS:new Set(["INPUTS","TEXTAREA","PASSWORD","SELECT","DROPDOWN","RADIOGROUP","CHECKBOX","CALENDAR","DATE_INPUT","DATE_PICKER","RANGE_CALENDAR","RANGE_DATE_INPUT","RANGE_DATE_PICKER","CURRENCY","MARKDOWN","LIST","CUSTOM_INPUT","REPEATER","TAGS"]),ACTIONS:new Set(["ACTIONS","CUSTOM_ACTION"]),DISPLAYS:new Set(["DISPLAYS","ALERTS","CUSTOM_DISPLAY"]),LAYOUTS:new Set(["LAYOUTS","TABS","ACCORDION","CUSTOM_LAYOUT"])};function Ut(e,t){const s=z[e];return s?s.has(t):e===t}class kt{resolve(t,s){const n=[];for(const a of s)a.kind==="aggregated"?this.collectFromAggregated(a,t,n):this.collectFromLeaf(a,t,n);const l=this.rollUpSensibleDefaults(n);return{leafSelectors:n,sensibleDefaults:l}}collectFromAggregated(t,s,n){if(t.matcher(s))for(const l of t.children)this.collectFromLeaf(l,s,n)}collectFromLeaf(t,s,n){Ut(t.selectorType,s.itemType??"")&&t.matcher(s)&&n.push(t)}rollUpSensibleDefaults(t){const s=new Map,n=(a,i)=>{const o=s.get(a)??[];o.push(i),s.set(a,o)};for(const a of t){const i=z[a.selectorType];if(i)for(const o of i)n(o,a);else n(a.selectorType,a)}const l={};for(const[a,i]of s)j(a)&&(l[a]=f(a).rollUpSensibleDefaults(i));return l}}const Ct=new kt;class ft{deepMerge(t,s){if(s==null)return t;if(t==null||typeof t!="object"||typeof s!="object"||Array.isArray(t)||Array.isArray(s))return s;const n={...t};for(const l in s)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?n[l]=this.deepMerge(t[l],s[l]):n[l]=s[l]);return n}}const vt=new ft;class Dt{constructor(t){this.objectUtils=t}merge(t,s,n){let l={},a=null;typeof t=="function"&&(a=t);const i=this.collectDecorators(n);for(const u of i){if(a!=null){a=this.composeRuntimeFunctions(a,u);continue}if(typeof u=="function"){const p=u({...l,...typeof t=="function"?{}:t});if(typeof p=="function"){a=this.createPromotedFunction(l,t,p,s,n);continue}l=this.objectUtils.deepMerge(l,p)}else l=this.objectUtils.deepMerge(l,u)}if(a!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(a,l,s,n)};const o=this.objectUtils.deepMerge(t,l);return{kind:"static",def:this.applySensibleDefaults({...o},s,n)}}collectDecorators(t){const s=[];for(const n of t.leafSelectors){const l=n.config;l.override!=null&&s.push(l.override)}return s}applySensibleDefaults(t,s,n){if(!j(s))return t;const l=n.sensibleDefaults[s]??{};return f(s).applySensibleDefaults(t,l)}createPromotedFunction(t,s,n,l,a){return i=>{const o=n(i);let r=this.objectUtils.deepMerge(t,o);return r=this.objectUtils.deepMerge(r,s),this.applySensibleDefaults(r,l,a)}}wrapWithSensibleDefaults(t,s,n,l){return a=>{let i=t(a);return Object.keys(s).length>0&&(i=this.objectUtils.deepMerge(s,i)),this.applySensibleDefaults(i,n,l)}}composeRuntimeFunctions(t,s){return typeof s=="function"?n=>{const l=t(n),a=s(l);return typeof a=="function"?a(n):this.objectUtils.deepMerge(a,l)}:n=>{const l=t(n);return this.objectUtils.deepMerge(l,s)}}}const Lt=new Dt(vt);class Ot{mapToWidget(t,s){if(t.kind==="dynamic"){const n=t.fn;return(l=>{const a=n(l);return this.mapStaticDef(a,s)})}return this.mapStaticDef(t.def,s)}mapStaticDef(t,s){const n=f(s).mapToWidget(t);return this.applyBaseWidgetFields(n,t)}applyBaseWidgetFields(t,s){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}}const Bt=new Ot;class Et{normalizeSelectors(t){const s=Array.isArray(t)?t:[t],n=[],l=[];for(const a of s)a.kind==="leaf"?l.push(a):n.push(a);return l.length>0&&n.unshift({kind:"aggregated",matcher:()=>!0,children:l}),n}extractFormConfig(){return{suppressAutomaticStack:!1}}}const Pt=new Et,It={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},W={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class wt{extractFromMergeResult(t,s){const n={};for(const o of s){const r=o.targetState,u=o.config,p=u.override&&typeof u.override!="function"?u.override:u;n[r]={...n[r]||{},...p}}if(t.kind==="dynamic"){const o=t.fn;return{cleanedResult:{kind:"dynamic",fn:u=>{const p=o(u),{states:c,...b}=p;return b}},stateData:{stateOverrides:n}}}const{states:l,...a}=t.def,i={};for(const[o,r]of Object.entries(n))i[o]={...r};if(l)for(const[o,r]of Object.entries(l))i[o]={...i[o]||{},...r};return{cleanedResult:{kind:"static",def:a},stateData:{stateOverrides:i}}}applyToWidget(t,s,n,l){const{stateOverrides:a}=s;if(Object.keys(a).length===0)return t;const i={...t},o=t.kind,r=It[o]||new Set;t.props&&(i.props={...t.props}),t.on&&(i.on={...t.on});for(const[u,p]of Object.entries(a))for(const[c,b]of Object.entries(p))c==="visible"?this.applyVisibility(i,u,b):W[c]?this.applyStateEvent(i,u,c,b,n,l):r.has(c)?i[`${c}.${u}`]=b:(i.props||(i.props={}),i.props[`${c}.${u}`]=b);return i}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,s,n){if(n){const l=t.include?.in||[];t.include={...t.include||{},in:[...l,s]}}else{const l=t.exclude?.from||[];t.exclude={...t.exclude||{},from:[...l,s]}}}applyStateEvent(t,s,n,l,a,i){const o=W[n];if(t.on||(t.on={}),typeof l=="function"){const r=i.next();a.set(r,l),t.on[`${o}.${s}`]=r}else typeof l=="string"&&(t.on[`${o}.${s}`]=l)}}const Wt=new wt;function Rt(){let e=0;return{next:()=>`event_${e++}`}}class Mt{constructor(t,s,n,l,a){this.resolver=t,this.merger=s,this.mapper=n,this.eventWiring=l,this.stateExpansion=a}walkAndMap(t,s,n){const l=new Map,a=Rt(),i={value:0},o=new Set;return{widgets:this.walkItems(t,s,l,n,a,i,o),eventRegistry:l}}walkItems(t,s,n,l,a,i,o){return t.flatMap(r=>{if(r.type!=="ITEMS")throw new Error("Unexpected gui shortcut type");return r.items.map(u=>this.processItem(u,r.itemType,r.tags,s,n,l,a,i,o))})}processItem(t,s,n,l,a,i,o,r,u){const p=s,c=f(s),b=c.parseEntry(t),A=this.buildBaseDef(b),U=this.buildDecoratorForMatching(A,p,n),k=this.resolver.resolve(U,l),P=k.leafSelectors.filter(h=>h.targetState!=null),I={leafSelectors:k.leafSelectors.filter(h=>h.targetState==null),sensibleDefaults:k.sensibleDefaults};let S=this.merger.merge(A,p,I);c.afterMerge&&(S=c.afterMerge(S,{eventRegistry:a,formConfig:i,eventIdGenerator:o})),S=this.eventWiring.wireInputLayoutEvents(S,a,o);const{cleanedResult:w,stateData:v}=this.stateExpansion.extractFromMergeResult(S,P);let _;if(c.buildCustomWidget){const h=this.buildCustomWidgetContext(b.children,l,a,i,o,r,u);_=this.buildCustomWidget(c,w,h)}else _=this.mapper.mapToWidget(w,p);if(typeof _!="function"){const h=_;h.uid||(h.path&&!u.has(h.path)?(h.uid=h.path,u.add(h.path)):h.uid=`dx_${r.value++}`)}if(this.stateExpansion.hasStateData(v))if(typeof _=="function"){const h=_;_=(G=>{const X=h(G);return this.stateExpansion.applyToWidget(X,v,a,o)})}else _=this.stateExpansion.applyToWidget(_,v,a,o);return _}buildCustomWidgetContext(t,s,n,l,a,i,o){return{children:t,mapStaticDef:(r,u)=>this.mapper.mapStaticDef(r,u),walkChildren:r=>this.walkItems(r,s,n,l,a,i,o)}}buildCustomWidget(t,s,n){return t.buildCustomWidget(s,n)}buildBaseDef(t){const s=t.baseDef;return typeof s=="function"?n=>{const a=s(n??{});return t.path!=null?{...a,path:t.path}:a}:t.path!=null?{...s,path:t.path}:s}buildDecoratorForMatching(t,s,n){if(typeof t=="function")return{itemType:s,tags:[...n]};const l=[...n,..."tags"in t&&t.tags?t.tags:[]],a="uid"in t?t.uid:void 0,i="type"in t?t.type:void 0;return{itemType:s,tags:l,uid:a,type:i}}}class Nt{constructor(t,s){this.selectorNormalizer=t,this.walker=s}processDxFacade(t,s=[],n){const{defs:l,gslSelectors:a,formConfig:i}=this.prepareForm(t,s,n),{widgets:o,eventRegistry:r}=this.walker.walkAndMap(l,a,i),u=o[0];return this.buildResult({form:u},r,i)}prepareForm(t,s,n){const a=(Array.isArray(t)?[...t]:[t]).map(r=>typeof r=="function"?x(r):r),i=this.selectorNormalizer.normalizeSelectors(s),o={...this.selectorNormalizer.extractFormConfig(),...n};if(!o.suppressAutomaticStack){const r={def:{uid:"#root",direction:"column",widgetName:"flex"},children:a};return{defs:[{type:"ITEMS",itemType:O.LAYOUTS,items:[r],tags:[]}],gslSelectors:i,formConfig:o}}return{defs:a,gslSelectors:i,formConfig:o}}convertStateNames(t){const s={};for(const[n,l]of Object.entries(t))s[n.replace(/\$/g,":")]=l;return s}buildResult(t,s,n){n.states&&Object.keys(n.states).length>0&&(t={...t,states:this.convertStateNames(n.states)});const l={form:t};return s.size>0&&(l.events=a=>{const i=s.get(a.name);if(i){const o=u=>{if(u&&typeof u=="object"&&"path"in u&&!("type"in u)){const{path:p,...c}=u;for(const[b,A]of Object.entries(c))a.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:p,prop:b,value:A}})}else a.callback(u)},r={...a,callback:o,update:o};i(r)}}),n.dependencies&&(l.dependencies=n.dependencies),n.widgetLoaders&&(l.widgetLoaders=n.widgetLoaders),n.validateOn&&(l.validateOn=n.validateOn),n.itemRenderers&&(l.itemRenderers=n.itemRenderers),l}}const xt=new Mt(Ct,Lt,Bt,E,Wt),V=new Nt(Pt,xt);function K(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(R):R(e)}function R(e){if(typeof e=="function")return!0;if(e===null||typeof e!="object")return!1;const t=e;return t.type==="ITEMS"&&typeof t.itemType=="string"}const M=Object.freeze({}),Ft=Object.freeze({}),N=new WeakMap;function D(e,t){return e==null?t:typeof e=="object"?e:{}}function jt(e,t,s){if(!K(e))return{formDef:e};const n=D(e,M),l=D(t,M),a=D(s,Ft);let i=N.get(n);i||(i=new WeakMap,N.set(n,i));let o=i.get(l);o||(o=new WeakMap,i.set(l,o));const r=o.get(a);if(r)return r;const u=V.processDxFacade(e,t,s),p={formDef:u.form,formEvent:u.events,dependencies:u.dependencies,widgetLoaders:u.widgetLoaders,validateOn:u.validateOn,itemRenderers:u.itemRenderers};return o.set(a,p),p}exports.GuiItemTypes=O;exports._gslAccordionByUid=pt;exports._gslAccordions=ut;exports._gslActionByUid=Ye;exports._gslActions=$e;exports._gslAlertByUid=et;exports._gslAlerts=Qe;exports._gslCalendarByUid=Se;exports._gslCalendars=Ae;exports._gslCheckboxByUid=ue;exports._gslCheckboxes=oe;exports._gslCurrencies=be;exports._gslCurrencyByUid=ge;exports._gslCustomActionByUid=bt;exports._gslCustomActions=yt;exports._gslCustomDisplayByUid=mt;exports._gslCustomDisplays=gt;exports._gslCustomInputByUid=ct;exports._gslCustomInputs=dt;exports._gslCustomLayoutByUid=St;exports._gslCustomLayouts=At;exports._gslDateInputByUid=ke;exports._gslDateInputs=Ue;exports._gslDatePickerByUid=fe;exports._gslDatePickers=Ce;exports._gslDisplayByUid=Je;exports._gslDisplays=Ze;exports._gslDropdownByUid=ae;exports._gslDropdowns=ne;exports._gslInputByUid=te;exports._gslInputs=ee;exports._gslLayoutByUid=Xe;exports._gslLayouts=Ge;exports._gslListByUid=Te;exports._gslLists=_e;exports._gslMarkdownByUid=he;exports._gslMarkdowns=me;exports._gslPasswordByUid=ye;exports._gslPasswords=ce;exports._gslRadiogroupByUid=re;exports._gslRadiogroups=ie;exports._gslRangeCalendarByUid=De;exports._gslRangeCalendars=ve;exports._gslRangeDateInputByUid=Oe;exports._gslRangeDateInputs=Le;exports._gslRangeDatePickerByUid=Ee;exports._gslRangeDatePickers=Be;exports._gslRepeaterByUid=Ne;exports._gslRepeaters=$;exports._gslSelectByUid=le;exports._gslSelects=se;exports._gslTabs=nt;exports._gslTabsByUid=at;exports._gslTextareaByUid=de;exports._gslTextareas=pe;exports._guiDisplay=x;exports.buildTypedValidator=m;exports.createGslSelector=B;exports.defineShortcutType=d;exports.extractWidgetProps=y;exports.formDefs=V;exports.isDxDefinitions=K;exports.processAutoLabel=g;exports.processAutoPlaceholder=T;exports.resolveFormInput=jt;
|
|
1
|
+
"use strict";require("@golemui/core");const O={INPUTS:"INPUTS",ACTIONS:"ACTIONS",LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function B(e){return function(t,s=()=>!0){return{kind:"leaf",selectorType:e,matcher:s,config:t}}}function m(e,t){return typeof e=="function"?e:{type:t,...e??{}}}const x=(e,t)=>({type:"ITEMS",itemType:O.DISPLAYS,items:[{render:e}],tags:t??[]}),C=new Map;function F(e,t){if(C.has(e))throw new Error(`Item type "${e}" is already registered.`);C.set(e,t)}function f(e){const t=C.get(e);if(!t)throw new Error(`No handler registered for item type "${e}". Did you forget to import the registration module?`);return t}function j(e){return C.has(e)}function d(e){const t=o=>{if(!e.sensibleDefaults)return{};let r={...e.sensibleDefaults.base};for(const u of o){const p=u.config;for(const c of e.sensibleDefaults.fields){const b=c;p[b]!=null&&(r={...r,[b]:p[b]})}}return r},s=(o,r)=>e.sensibleDefaults?e.sensibleDefaults.apply(o,r):o,n=o=>{switch(e.entryShape){case"bare":return{baseDef:o};case"keyed":{const r=o;return{baseDef:r.def,path:r.key}}case"compound":{const r=o;return{baseDef:r.def,children:r.children}}}},l={rollUpSensibleDefaults:t,applySensibleDefaults:s,mapToWidget:e.mapToWidget,parseEntry:n,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};F(e.itemType,l);const a=B(e.itemType);return{gsl:a,gslByUid:(o,r)=>a(r,(u=>u.uid===o))}}function y(e){const{uid:t,path:s,label:n,disabled:l,readonly:a,defaultValue:i,tags:o,type:r,size:u,onLoad:p,onChange:c,onFilter:b,on:A,states:U,include:k,exclude:P,validator:I,...S}=e;return S}function H(e){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()):""}function g(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:H(e.path)}}function T(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}function q(e){switch(e.type){case"text":return J(e);case"number":return Q(e);case"boolean":return Z(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function Z(e){const t=y(e);return{uid:e.uid??"",kind:"input",type:"toggle",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"boolean")}:{},props:t}}function J(e){const t=y(e);return{uid:e.uid??"",kind:"input",type:"textinput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:m(e.validator,"string")}}function Q(e){const t=y(e);return{uid:e.uid??"",kind:"input",type:"number",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:m(e.validator,"number")}}const{gsl:ee,gslByUid:te}=d({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let s=g(e,t);return s=T(s,t),s}},mapToWidget:q}),{gsl:se,gslByUid:le}=d({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"select",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:y(e)})}),{gsl:ne,gslByUid:ae}=d({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dropdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:y(e)})}),{gsl:ie,gslByUid:re}=d({itemType:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"radiogroup",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:y(e)})}),{gsl:oe,gslByUid:ue}=d({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"checkbox",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"boolean")}:{},props:y(e)})}),{gsl:pe,gslByUid:de}=d({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"textarea",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"string")}:{},props:y(e)})}),{gsl:ce,gslByUid:ye}=d({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"password",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"string")}:{},props:y(e)})}),{gsl:be,gslByUid:ge}=d({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"currency",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"number")}:{},props:y(e)})}),{gsl:me,gslByUid:he}=d({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"markdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"string")}:{},props:y(e)})}),{gsl:_e,gslByUid:Te}=d({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"list",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:y(e)})}),{gsl:Ae,gslByUid:Se}=d({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"calendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"string")}:{},props:y(e)})}),{gsl:Ue,gslByUid:ke}=d({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"string")}:{},props:y(e)})}),{gsl:Ce,gslByUid:fe}=d({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"datePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"string")}:{},props:y(e)})}),{gsl:ve,gslByUid:De}=d({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"array")}:{},props:y(e)})}),{gsl:Le,gslByUid:Oe}=d({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"array")}:{},props:y(e)})}),{gsl:Be,gslByUid:Ee}=d({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(g(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDatePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"array")}:{},props:y(e)})});function Pe(e){const t={};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}function Ie(e){return{uid:e.uid??"",kind:"input",type:"repeater",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:m(e.validator,"array")}:{},props:{...Pe(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function L(e,t){for(const s of e){if(typeof s=="function")continue;const n=s;typeof n.path=="string"&&n.path&&(n.path=t+n.path),"children"in n&&Array.isArray(n.children)&&L(n.children,t);const l=n.props;l?.template?.children&&Array.isArray(l.template.children)&&L(l.template.children,t)}}function we(e,t){const s=t.walkChildren(t.children??[]),n=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";n&&L(s,n+".items.");const l={kind:"layout",type:"flex",uid:"",children:s,props:{direction:"column"}};if(e.kind==="static"){const i=t.mapStaticDef(e.def,"REPEATER");return{...i,props:{...i.props,template:l}}}const a=e.fn;return(i=>{const o=a(i),r=t.mapStaticDef(o,"REPEATER");return{...r,props:{...r.props,template:l}}})}function We(e){return{baseDef:e.def,path:e.key,children:e.children}}function Re(e){return e.children}const Me={parseEntry:We,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:Ie,buildCustomWidget:we,getChildren:Re};F("REPEATER",Me);const $=B("REPEATER"),Ne=(e,t)=>$(t,(s=>s.uid===e)),Y={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},xe=Object.keys(Y);class Fe{extractOnClickFromMergeResult(t,s,n){if(t.kind==="dynamic"){const i=t.fn;return{kind:"dynamic",fn:r=>{const u=i(r);return this.wireOnClick(u,s,n)}}}const l=t.def;return{kind:"static",def:this.wireOnClick(l,s,n)}}wireOnClick(t,s,n){const l=n.next(),a=t.onClick;if(typeof a=="function"){const{onClick:i,...o}=t,r=a(void 0);return typeof r=="string"?{...o,uid:l,on:{click:r}}:(s.set(l,u=>a(u.data)),{...o,uid:l,on:{click:l}})}return{...t,uid:l}}wireInputLayoutEvents(t,s,n){if(t.kind==="dynamic"){const a=t.fn;return{kind:"dynamic",fn:o=>{const r=a(o);return this.wireEventProperties(r,s,n)}}}return{kind:"static",def:this.wireEventProperties(t.def,s,n)}}wireEventProperties(t,s,n){const l={...t.on||{}};let a=!1;const i={...t};for(const o of xe){const r=t[o];if(r==null)continue;const u=Y[o];if(typeof r=="function"){const p=n.next();s.set(p,r),l[u]=p,a=!0}else typeof r=="string"&&(l[u]=r,a=!0);delete i[o]}return a&&(i.on=l),i}}const E=new Fe;function je(e){const{uid:t,label:s,actionType:n,disabled:l,on:a,onClick:i,data:o,type:r,tags:u,size:p,include:c,exclude:b,states:A,...U}=e;return{uid:t??"",kind:"action",type:"button",disabled:l,actionType:n,label:s,...a!=null?{on:a}:{},props:U}}const{gsl:$e,gslByUid:Ye}=d({itemType:"ACTIONS",entryShape:"bare",mapToWidget:je,afterMerge:(e,t)=>E.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function ze(e){const{uid:t,widgetName:s,tags:n,size:l,onChange:a,include:i,exclude:o,...r}=e,{on:u,...p}=r;return{uid:t??"",kind:"layout",type:s??"flex",props:{direction:p.direction??"column",...p},children:[]}}function Ke(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"LAYOUTS"),children:s}})}function Ve(e){return e.children}const{gsl:Ge,gslByUid:Xe}=d({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:ze,buildCustomWidget:Ke,getChildren:Ve});function He(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function qe(e,t){if(e.kind==="static"){const n=e.def;return(l=>({uid:"",kind:"display",type:"renderer",...n.include!=null?{include:n.include}:{},...n.exclude!=null?{exclude:n.exclude}:{},props:{render:n.render(l??{})}}))}const s=e.fn;return(n=>{const l=s(n);return{uid:"",kind:"display",type:"renderer",...l.include!=null?{include:l.include}:{},...l.exclude!=null?{exclude:l.exclude}:{},props:{render:l.render(n??{})}}})}const{gsl:Ze,gslByUid:Je}=d({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:He,buildCustomWidget:qe}),{gsl:Qe,gslByUid:et}=d({itemType:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})});function tt(e){return{uid:e.uid??"",kind:"layout",type:"tabs",props:{tabs:e.tabs,renderMode:e.renderMode??"all",...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function st(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"TABS"),children:s}})}function lt(e){return e.children}const{gsl:nt,gslByUid:at}=d({itemType:"TABS",entryShape:"compound",mapToWidget:tt,buildCustomWidget:st,getChildren:lt});function it(e){return{uid:e.uid??"",kind:"layout",type:"accordion",props:{sections:e.sections,renderMode:e.renderMode??"all",...e.singleOpen!=null?{singleOpen:e.singleOpen}:{},...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function rt(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"ACCORDION"),children:s}})}function ot(e){return e.children}const{gsl:ut,gslByUid:pt}=d({itemType:"ACCORDION",entryShape:"compound",mapToWidget:it,buildCustomWidget:rt,getChildren:ot}),{gsl:dt,gslByUid:ct}=d({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>g(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:e.customType,path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.validator!=null?{validator:e.validator}:{},props:e.props??{}})}),{gsl:yt,gslByUid:bt}=d({itemType:"CUSTOM_ACTION",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:s,disabled:n,on:l,onClick:a,data:i,customType:o,tags:r,size:u,include:p,exclude:c,states:b,props:A,...U}=e;return{uid:t??"",kind:"action",type:e.customType,label:s,disabled:n,...l!=null?{on:l}:{},props:{...A,...U}}},afterMerge:(e,t)=>E.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),{gsl:gt,gslByUid:mt}=d({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})});function ht(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function _t(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:s};const n=e.fn;return(l=>{const a=n(l);return{...t.mapStaticDef(a,"CUSTOM_LAYOUT"),children:s}})}function Tt(e){return e.children}const{gsl:At,gslByUid:St}=d({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:ht,buildCustomWidget:_t,getChildren:Tt}),z={INPUTS:new Set(["INPUTS","TEXTAREA","PASSWORD","SELECT","DROPDOWN","RADIOGROUP","CHECKBOX","CALENDAR","DATE_INPUT","DATE_PICKER","RANGE_CALENDAR","RANGE_DATE_INPUT","RANGE_DATE_PICKER","CURRENCY","MARKDOWN","LIST","CUSTOM_INPUT","REPEATER","TAGS"]),ACTIONS:new Set(["ACTIONS","CUSTOM_ACTION"]),DISPLAYS:new Set(["DISPLAYS","ALERTS","MARKDOWN_TEXTS","CUSTOM_DISPLAY"]),LAYOUTS:new Set(["LAYOUTS","TABS","ACCORDION","CUSTOM_LAYOUT"])};function Ut(e,t){const s=z[e];return s?s.has(t):e===t}class kt{resolve(t,s){const n=[];for(const a of s)a.kind==="aggregated"?this.collectFromAggregated(a,t,n):this.collectFromLeaf(a,t,n);const l=this.rollUpSensibleDefaults(n);return{leafSelectors:n,sensibleDefaults:l}}collectFromAggregated(t,s,n){if(t.matcher(s))for(const l of t.children)this.collectFromLeaf(l,s,n)}collectFromLeaf(t,s,n){Ut(t.selectorType,s.itemType??"")&&t.matcher(s)&&n.push(t)}rollUpSensibleDefaults(t){const s=new Map,n=(a,i)=>{const o=s.get(a)??[];o.push(i),s.set(a,o)};for(const a of t){const i=z[a.selectorType];if(i)for(const o of i)n(o,a);else n(a.selectorType,a)}const l={};for(const[a,i]of s)j(a)&&(l[a]=f(a).rollUpSensibleDefaults(i));return l}}const Ct=new kt;class ft{deepMerge(t,s){if(s==null)return t;if(t==null||typeof t!="object"||typeof s!="object"||Array.isArray(t)||Array.isArray(s))return s;const n={...t};for(const l in s)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?n[l]=this.deepMerge(t[l],s[l]):n[l]=s[l]);return n}}const vt=new ft;class Dt{constructor(t){this.objectUtils=t}merge(t,s,n){let l={},a=null;typeof t=="function"&&(a=t);const i=this.collectDecorators(n);for(const u of i){if(a!=null){a=this.composeRuntimeFunctions(a,u);continue}if(typeof u=="function"){const p=u({...l,...typeof t=="function"?{}:t});if(typeof p=="function"){a=this.createPromotedFunction(l,t,p,s,n);continue}l=this.objectUtils.deepMerge(l,p)}else l=this.objectUtils.deepMerge(l,u)}if(a!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(a,l,s,n)};const o=this.objectUtils.deepMerge(t,l);return{kind:"static",def:this.applySensibleDefaults({...o},s,n)}}collectDecorators(t){const s=[];for(const n of t.leafSelectors){const l=n.config;l.override!=null&&s.push(l.override)}return s}applySensibleDefaults(t,s,n){if(!j(s))return t;const l=n.sensibleDefaults[s]??{};return f(s).applySensibleDefaults(t,l)}createPromotedFunction(t,s,n,l,a){return i=>{const o=n(i);let r=this.objectUtils.deepMerge(t,o);return r=this.objectUtils.deepMerge(r,s),this.applySensibleDefaults(r,l,a)}}wrapWithSensibleDefaults(t,s,n,l){return a=>{let i=t(a);return Object.keys(s).length>0&&(i=this.objectUtils.deepMerge(s,i)),this.applySensibleDefaults(i,n,l)}}composeRuntimeFunctions(t,s){return typeof s=="function"?n=>{const l=t(n),a=s(l);return typeof a=="function"?a(n):this.objectUtils.deepMerge(a,l)}:n=>{const l=t(n);return this.objectUtils.deepMerge(l,s)}}}const Lt=new Dt(vt);class Ot{mapToWidget(t,s){if(t.kind==="dynamic"){const n=t.fn;return(l=>{const a=n(l);return this.mapStaticDef(a,s)})}return this.mapStaticDef(t.def,s)}mapStaticDef(t,s){const n=f(s).mapToWidget(t);return this.applyBaseWidgetFields(n,t)}applyBaseWidgetFields(t,s){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}}const Bt=new Ot;class Et{normalizeSelectors(t){const s=Array.isArray(t)?t:[t],n=[],l=[];for(const a of s)a.kind==="leaf"?l.push(a):n.push(a);return l.length>0&&n.unshift({kind:"aggregated",matcher:()=>!0,children:l}),n}extractFormConfig(){return{suppressAutomaticStack:!1}}}const Pt=new Et,It={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},W={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class wt{extractFromMergeResult(t,s){const n={};for(const o of s){const r=o.targetState,u=o.config,p=u.override&&typeof u.override!="function"?u.override:u;n[r]={...n[r]||{},...p}}if(t.kind==="dynamic"){const o=t.fn;return{cleanedResult:{kind:"dynamic",fn:u=>{const p=o(u),{states:c,...b}=p;return b}},stateData:{stateOverrides:n}}}const{states:l,...a}=t.def,i={};for(const[o,r]of Object.entries(n))i[o]={...r};if(l)for(const[o,r]of Object.entries(l))i[o]={...i[o]||{},...r};return{cleanedResult:{kind:"static",def:a},stateData:{stateOverrides:i}}}applyToWidget(t,s,n,l){const{stateOverrides:a}=s;if(Object.keys(a).length===0)return t;const i={...t},o=t.kind,r=It[o]||new Set;t.props&&(i.props={...t.props}),t.on&&(i.on={...t.on});for(const[u,p]of Object.entries(a))for(const[c,b]of Object.entries(p))c==="visible"?this.applyVisibility(i,u,b):W[c]?this.applyStateEvent(i,u,c,b,n,l):r.has(c)?i[`${c}.${u}`]=b:(i.props||(i.props={}),i.props[`${c}.${u}`]=b);return i}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,s,n){if(n){const l=t.include?.in||[];t.include={...t.include||{},in:[...l,s]}}else{const l=t.exclude?.from||[];t.exclude={...t.exclude||{},from:[...l,s]}}}applyStateEvent(t,s,n,l,a,i){const o=W[n];if(t.on||(t.on={}),typeof l=="function"){const r=i.next();a.set(r,l),t.on[`${o}.${s}`]=r}else typeof l=="string"&&(t.on[`${o}.${s}`]=l)}}const Wt=new wt;function Rt(){let e=0;return{next:()=>`event_${e++}`}}class Mt{constructor(t,s,n,l,a){this.resolver=t,this.merger=s,this.mapper=n,this.eventWiring=l,this.stateExpansion=a}walkAndMap(t,s,n){const l=new Map,a=Rt(),i={value:0},o=new Set;return{widgets:this.walkItems(t,s,l,n,a,i,o),eventRegistry:l}}walkItems(t,s,n,l,a,i,o){return t.flatMap(r=>{if(r.type!=="ITEMS")throw new Error("Unexpected gui shortcut type");return r.items.map(u=>this.processItem(u,r.itemType,r.tags,s,n,l,a,i,o))})}processItem(t,s,n,l,a,i,o,r,u){const p=s,c=f(s),b=c.parseEntry(t),A=this.buildBaseDef(b),U=this.buildDecoratorForMatching(A,p,n),k=this.resolver.resolve(U,l),P=k.leafSelectors.filter(h=>h.targetState!=null),I={leafSelectors:k.leafSelectors.filter(h=>h.targetState==null),sensibleDefaults:k.sensibleDefaults};let S=this.merger.merge(A,p,I);c.afterMerge&&(S=c.afterMerge(S,{eventRegistry:a,formConfig:i,eventIdGenerator:o})),S=this.eventWiring.wireInputLayoutEvents(S,a,o);const{cleanedResult:w,stateData:v}=this.stateExpansion.extractFromMergeResult(S,P);let _;if(c.buildCustomWidget){const h=this.buildCustomWidgetContext(b.children,l,a,i,o,r,u);_=this.buildCustomWidget(c,w,h)}else _=this.mapper.mapToWidget(w,p);if(typeof _!="function"){const h=_;h.uid||(h.path&&!u.has(h.path)?(h.uid=h.path,u.add(h.path)):h.uid=`dx_${r.value++}`)}if(this.stateExpansion.hasStateData(v))if(typeof _=="function"){const h=_;_=(G=>{const X=h(G);return this.stateExpansion.applyToWidget(X,v,a,o)})}else _=this.stateExpansion.applyToWidget(_,v,a,o);return _}buildCustomWidgetContext(t,s,n,l,a,i,o){return{children:t,mapStaticDef:(r,u)=>this.mapper.mapStaticDef(r,u),walkChildren:r=>this.walkItems(r,s,n,l,a,i,o)}}buildCustomWidget(t,s,n){return t.buildCustomWidget(s,n)}buildBaseDef(t){const s=t.baseDef;return typeof s=="function"?n=>{const a=s(n??{});return t.path!=null?{...a,path:t.path}:a}:t.path!=null?{...s,path:t.path}:s}buildDecoratorForMatching(t,s,n){if(typeof t=="function")return{itemType:s,tags:[...n]};const l=[...n,..."tags"in t&&t.tags?t.tags:[]],a="uid"in t?t.uid:void 0,i="type"in t?t.type:void 0;return{itemType:s,tags:l,uid:a,type:i}}}class Nt{constructor(t,s){this.selectorNormalizer=t,this.walker=s}processDxFacade(t,s=[],n){const{defs:l,gslSelectors:a,formConfig:i}=this.prepareForm(t,s,n),{widgets:o,eventRegistry:r}=this.walker.walkAndMap(l,a,i),u=o[0];return this.buildResult({form:u},r,i)}prepareForm(t,s,n){const a=(Array.isArray(t)?[...t]:[t]).map(r=>typeof r=="function"?x(r):r),i=this.selectorNormalizer.normalizeSelectors(s),o={...this.selectorNormalizer.extractFormConfig(),...n};if(!o.suppressAutomaticStack){const r={def:{uid:"#root",direction:"column",widgetName:"flex"},children:a};return{defs:[{type:"ITEMS",itemType:O.LAYOUTS,items:[r],tags:[]}],gslSelectors:i,formConfig:o}}return{defs:a,gslSelectors:i,formConfig:o}}convertStateNames(t){const s={};for(const[n,l]of Object.entries(t))s[n.replace(/\$/g,":")]=l;return s}buildResult(t,s,n){n.states&&Object.keys(n.states).length>0&&(t={...t,states:this.convertStateNames(n.states)});const l={form:t};return s.size>0&&(l.events=a=>{const i=s.get(a.name);if(i){const o=u=>{if(u&&typeof u=="object"&&"path"in u&&!("type"in u)){const{path:p,...c}=u;for(const[b,A]of Object.entries(c))a.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:p,prop:b,value:A}})}else a.callback(u)},r={...a,callback:o,update:o};i(r)}}),n.dependencies&&(l.dependencies=n.dependencies),n.widgetLoaders&&(l.widgetLoaders=n.widgetLoaders),n.validateOn&&(l.validateOn=n.validateOn),n.itemRenderers&&(l.itemRenderers=n.itemRenderers),l}}const xt=new Mt(Ct,Lt,Bt,E,Wt),K=new Nt(Pt,xt);function V(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(R):R(e)}function R(e){if(typeof e=="function")return!0;if(e===null||typeof e!="object")return!1;const t=e;return t.type==="ITEMS"&&typeof t.itemType=="string"}const M=Object.freeze({}),Ft=Object.freeze({}),N=new WeakMap;function D(e,t){return e==null?t:typeof e=="object"?e:{}}function jt(e,t,s){if(!V(e))return{formDef:e};const n=D(e,M),l=D(t,M),a=D(s,Ft);let i=N.get(n);i||(i=new WeakMap,N.set(n,i));let o=i.get(l);o||(o=new WeakMap,i.set(l,o));const r=o.get(a);if(r)return r;const u=K.processDxFacade(e,t,s),p={formDef:u.form,formEvent:u.events,dependencies:u.dependencies,widgetLoaders:u.widgetLoaders,validateOn:u.validateOn,itemRenderers:u.itemRenderers};return o.set(a,p),p}exports.GuiItemTypes=O;exports._gslAccordionByUid=pt;exports._gslAccordions=ut;exports._gslActionByUid=Ye;exports._gslActions=$e;exports._gslAlertByUid=et;exports._gslAlerts=Qe;exports._gslCalendarByUid=Se;exports._gslCalendars=Ae;exports._gslCheckboxByUid=ue;exports._gslCheckboxes=oe;exports._gslCurrencies=be;exports._gslCurrencyByUid=ge;exports._gslCustomActionByUid=bt;exports._gslCustomActions=yt;exports._gslCustomDisplayByUid=mt;exports._gslCustomDisplays=gt;exports._gslCustomInputByUid=ct;exports._gslCustomInputs=dt;exports._gslCustomLayoutByUid=St;exports._gslCustomLayouts=At;exports._gslDateInputByUid=ke;exports._gslDateInputs=Ue;exports._gslDatePickerByUid=fe;exports._gslDatePickers=Ce;exports._gslDisplayByUid=Je;exports._gslDisplays=Ze;exports._gslDropdownByUid=ae;exports._gslDropdowns=ne;exports._gslInputByUid=te;exports._gslInputs=ee;exports._gslLayoutByUid=Xe;exports._gslLayouts=Ge;exports._gslListByUid=Te;exports._gslLists=_e;exports._gslMarkdownByUid=he;exports._gslMarkdowns=me;exports._gslPasswordByUid=ye;exports._gslPasswords=ce;exports._gslRadiogroupByUid=re;exports._gslRadiogroups=ie;exports._gslRangeCalendarByUid=De;exports._gslRangeCalendars=ve;exports._gslRangeDateInputByUid=Oe;exports._gslRangeDateInputs=Le;exports._gslRangeDatePickerByUid=Ee;exports._gslRangeDatePickers=Be;exports._gslRepeaterByUid=Ne;exports._gslRepeaters=$;exports._gslSelectByUid=le;exports._gslSelects=se;exports._gslTabs=nt;exports._gslTabsByUid=at;exports._gslTextareaByUid=de;exports._gslTextareas=pe;exports._guiDisplay=x;exports.buildTypedValidator=m;exports.createGslSelector=B;exports.defineShortcutType=d;exports.extractWidgetProps=y;exports.formDefs=K;exports.isDxDefinitions=V;exports.processAutoLabel=g;exports.processAutoPlaceholder=T;exports.resolveFormInput=jt;
|
|
@@ -926,7 +926,7 @@ const { gsl: Ft, gslByUid: jt } = c({
|
|
|
926
926
|
"TAGS"
|
|
927
927
|
]),
|
|
928
928
|
ACTIONS: /* @__PURE__ */ new Set(["ACTIONS", "CUSTOM_ACTION"]),
|
|
929
|
-
DISPLAYS: /* @__PURE__ */ new Set(["DISPLAYS", "ALERTS", "CUSTOM_DISPLAY"]),
|
|
929
|
+
DISPLAYS: /* @__PURE__ */ new Set(["DISPLAYS", "ALERTS", "MARKDOWN_TEXTS", "CUSTOM_DISPLAY"]),
|
|
930
930
|
LAYOUTS: /* @__PURE__ */ new Set(["LAYOUTS", "TABS", "ACCORDION", "CUSTOM_LAYOUT"])
|
|
931
931
|
};
|
|
932
932
|
function _e(e, t) {
|
|
@@ -1474,38 +1474,38 @@ function $t(e, t, s) {
|
|
|
1474
1474
|
return o.set(n, p), p;
|
|
1475
1475
|
}
|
|
1476
1476
|
export {
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1477
|
+
xt as $,
|
|
1478
|
+
mt as A,
|
|
1479
|
+
ht as B,
|
|
1480
|
+
gt as C,
|
|
1481
|
+
Tt as D,
|
|
1482
|
+
St as E,
|
|
1483
|
+
At as F,
|
|
1484
1484
|
R as G,
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1485
|
+
le as H,
|
|
1486
|
+
_t as I,
|
|
1487
|
+
kt as J,
|
|
1488
|
+
vt as K,
|
|
1489
|
+
ft as L,
|
|
1490
|
+
Ct as M,
|
|
1491
|
+
Ut as N,
|
|
1492
|
+
Ot as O,
|
|
1493
|
+
Lt as P,
|
|
1494
|
+
Dt as Q,
|
|
1495
|
+
Et as R,
|
|
1496
|
+
Pt as S,
|
|
1497
|
+
It as T,
|
|
1498
|
+
Wt as U,
|
|
1499
|
+
wt as V,
|
|
1500
|
+
Bt as W,
|
|
1501
|
+
Mt as X,
|
|
1502
|
+
Rt as Y,
|
|
1503
|
+
Nt as Z,
|
|
1504
1504
|
Ye as _,
|
|
1505
1505
|
ze as a,
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1506
|
+
Ft as a0,
|
|
1507
|
+
jt as a1,
|
|
1508
|
+
K as a2,
|
|
1509
1509
|
b as a3,
|
|
1510
1510
|
g as a4,
|
|
1511
1511
|
S as a5,
|
|
@@ -1516,27 +1516,27 @@ export {
|
|
|
1516
1516
|
$t as aa,
|
|
1517
1517
|
Ke as b,
|
|
1518
1518
|
Ve as c,
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1519
|
+
c as d,
|
|
1520
|
+
Ge as e,
|
|
1521
|
+
Xe as f,
|
|
1522
|
+
He as g,
|
|
1523
|
+
Ze as h,
|
|
1524
|
+
qe as i,
|
|
1525
|
+
Je as j,
|
|
1526
|
+
Qe as k,
|
|
1527
|
+
et as l,
|
|
1528
|
+
tt as m,
|
|
1529
|
+
st as n,
|
|
1530
|
+
lt as o,
|
|
1531
|
+
at as p,
|
|
1532
|
+
nt as q,
|
|
1533
|
+
it as r,
|
|
1534
|
+
rt as s,
|
|
1535
|
+
ot as t,
|
|
1536
|
+
ut as u,
|
|
1537
|
+
pt as v,
|
|
1538
|
+
ct as w,
|
|
1539
|
+
dt as x,
|
|
1540
|
+
yt as y,
|
|
1541
|
+
bt as z
|
|
1542
1542
|
};
|