@golemui/gui-shared 0.14.0 → 0.15.0

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.
@@ -1,11 +1,11 @@
1
1
  import "@golemui/core";
2
- const N = {
2
+ const R = {
3
3
  INPUTS: "INPUTS",
4
4
  ACTIONS: "ACTIONS",
5
5
  LAYOUTS: "LAYOUTS",
6
6
  DISPLAYS: "DISPLAYS"
7
7
  };
8
- function R(e) {
8
+ function N(e) {
9
9
  return function(t, s = () => !0) {
10
10
  return {
11
11
  kind: "leaf",
@@ -18,38 +18,19 @@ function R(e) {
18
18
  function g(e, t) {
19
19
  return typeof e == "function" ? e : { type: t, ...e ?? {} };
20
20
  }
21
- class K {
22
- /**
23
- * Deep merges two objects, with right taking precedence over left when properties conflict.
24
- * Arrays are replaced, not merged.
25
- * @param left - The base object
26
- * @param right - The object whose properties take precedence
27
- * @returns A new merged object
28
- */
29
- deepMerge(t, s) {
30
- if (s == null)
31
- return t;
32
- if (t == null || typeof t != "object" || typeof s != "object" || Array.isArray(t) || Array.isArray(s))
33
- return s;
34
- const a = { ...t };
35
- for (const l in s)
36
- Object.prototype.hasOwnProperty.call(s, l) && (typeof s[l] == "object" && !Array.isArray(s[l]) && s[l] !== null && typeof t[l] == "object" && !Array.isArray(t[l]) && t[l] !== null ? a[l] = this.deepMerge(t[l], s[l]) : a[l] = s[l]);
37
- return a;
38
- }
39
- }
40
- const V = new K(), G = (e, t) => ({
21
+ const K = (e, t) => ({
41
22
  type: "ITEMS",
42
- itemType: N.DISPLAYS,
23
+ itemType: R.DISPLAYS,
43
24
  items: [{ render: e }],
44
25
  tags: t ?? []
45
- }), C = /* @__PURE__ */ new Map();
26
+ }), f = /* @__PURE__ */ new Map();
46
27
  function x(e, t) {
47
- if (C.has(e))
28
+ if (f.has(e))
48
29
  throw new Error(`Item type "${e}" is already registered.`);
49
- C.set(e, t);
30
+ f.set(e, t);
50
31
  }
51
- function f(e) {
52
- const t = C.get(e);
32
+ function C(e) {
33
+ const t = f.get(e);
53
34
  if (!t)
54
35
  throw new Error(
55
36
  `No handler registered for item type "${e}". Did you forget to import the registration module?`
@@ -57,7 +38,7 @@ function f(e) {
57
38
  return t;
58
39
  }
59
40
  function F(e) {
60
- return C.has(e);
41
+ return f.has(e);
61
42
  }
62
43
  function c(e) {
63
44
  const t = (o) => {
@@ -66,9 +47,9 @@ function c(e) {
66
47
  let r = { ...e.sensibleDefaults.base };
67
48
  for (const u of o) {
68
49
  const p = u.config;
69
- for (const y of e.sensibleDefaults.fields) {
70
- const d = y;
71
- p[d] != null && (r = { ...r, [d]: p[d] });
50
+ for (const d of e.sensibleDefaults.fields) {
51
+ const y = d;
52
+ p[y] != null && (r = { ...r, [y]: p[y] });
72
53
  }
73
54
  }
74
55
  return r;
@@ -95,7 +76,7 @@ function c(e) {
95
76
  ...e.getChildren ? { getChildren: e.getChildren } : {}
96
77
  };
97
78
  x(e.itemType, l);
98
- const n = R(e.itemType);
79
+ const n = N(e.itemType);
99
80
  return { gsl: n, gslByUid: (o, r) => n(r, ((u) => u.uid === o)) };
100
81
  }
101
82
  function b(e) {
@@ -110,39 +91,39 @@ function b(e) {
110
91
  type: r,
111
92
  size: u,
112
93
  onLoad: p,
113
- onChange: y,
114
- onFilter: d,
115
- on: T,
116
- states: _,
94
+ onChange: d,
95
+ onFilter: y,
96
+ on: A,
97
+ states: k,
117
98
  include: v,
118
- exclude: D,
99
+ exclude: E,
119
100
  validator: P,
120
- ...k
101
+ ..._
121
102
  } = e;
122
- return k;
103
+ return _;
123
104
  }
124
- function X(e) {
105
+ function V(e) {
125
106
  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()) : "";
126
107
  }
127
108
  function m(e, t) {
128
- return e.label != null || t.suppressAutomaticLabels || !e.path ? e : { ...e, label: X(e.path) };
109
+ return e.label != null || t.suppressAutomaticLabels || !e.path ? e : { ...e, label: V(e.path) };
129
110
  }
130
- function A(e, t) {
111
+ function S(e, t) {
131
112
  return e.placeholder != null || t.suppressAutomaticPlaceholders || !e.path ? e : { ...e, placeholder: e.path };
132
113
  }
133
- function H(e) {
114
+ function G(e) {
134
115
  switch (e.type) {
135
116
  case "text":
136
- return q(e);
117
+ return H(e);
137
118
  case "number":
138
- return J(e);
139
- case "boolean":
140
119
  return Z(e);
120
+ case "boolean":
121
+ return X(e);
141
122
  default:
142
123
  throw new Error(`Unsupported field type "${e.type}"`);
143
124
  }
144
125
  }
145
- function Z(e) {
126
+ function X(e) {
146
127
  const t = b(e);
147
128
  return {
148
129
  uid: e.uid ?? "",
@@ -156,7 +137,7 @@ function Z(e) {
156
137
  props: t
157
138
  };
158
139
  }
159
- function q(e) {
140
+ function H(e) {
160
141
  const t = b(e);
161
142
  return {
162
143
  uid: e.uid ?? "",
@@ -173,7 +154,7 @@ function q(e) {
173
154
  validator: g(e.validator, "string")
174
155
  };
175
156
  }
176
- function J(e) {
157
+ function Z(e) {
177
158
  const t = b(e);
178
159
  return {
179
160
  uid: e.uid ?? "",
@@ -201,17 +182,17 @@ const { gsl: Ye, gslByUid: ze } = c({
201
182
  fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
202
183
  apply: (e, t) => {
203
184
  let s = m(e, t);
204
- return s = A(s, t), s;
185
+ return s = S(s, t), s;
205
186
  }
206
187
  },
207
- mapToWidget: H
188
+ mapToWidget: G
208
189
  }), { gsl: Ke, gslByUid: Ve } = c({
209
190
  itemType: "SELECT",
210
191
  entryShape: "keyed",
211
192
  sensibleDefaults: {
212
193
  base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
213
194
  fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
214
- apply: (e, t) => A(m(e, t), t)
195
+ apply: (e, t) => S(m(e, t), t)
215
196
  },
216
197
  mapToWidget: (e) => ({
217
198
  uid: e.uid ?? "",
@@ -233,7 +214,7 @@ const { gsl: Ye, gslByUid: ze } = c({
233
214
  suppressAutomaticPlaceholders: !1
234
215
  },
235
216
  fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
236
- apply: (e, t) => A(m(e, t), t)
217
+ apply: (e, t) => S(m(e, t), t)
237
218
  },
238
219
  mapToWidget: (e) => ({
239
220
  uid: e.uid ?? "",
@@ -290,7 +271,7 @@ const { gsl: Ye, gslByUid: ze } = c({
290
271
  sensibleDefaults: {
291
272
  base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
292
273
  fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
293
- apply: (e, t) => A(m(e, t), t)
274
+ apply: (e, t) => S(m(e, t), t)
294
275
  },
295
276
  mapToWidget: (e) => ({
296
277
  uid: e.uid ?? "",
@@ -309,7 +290,7 @@ const { gsl: Ye, gslByUid: ze } = c({
309
290
  sensibleDefaults: {
310
291
  base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
311
292
  fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
312
- apply: (e, t) => A(m(e, t), t)
293
+ apply: (e, t) => S(m(e, t), t)
313
294
  },
314
295
  mapToWidget: (e) => ({
315
296
  uid: e.uid ?? "",
@@ -328,7 +309,7 @@ const { gsl: Ye, gslByUid: ze } = c({
328
309
  sensibleDefaults: {
329
310
  base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
330
311
  fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
331
- apply: (e, t) => A(m(e, t), t)
312
+ apply: (e, t) => S(m(e, t), t)
332
313
  },
333
314
  mapToWidget: (e) => ({
334
315
  uid: e.uid ?? "",
@@ -347,7 +328,7 @@ const { gsl: Ye, gslByUid: ze } = c({
347
328
  sensibleDefaults: {
348
329
  base: { suppressAutomaticLabels: !1, suppressAutomaticPlaceholders: !1 },
349
330
  fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
350
- apply: (e, t) => A(m(e, t), t)
331
+ apply: (e, t) => S(m(e, t), t)
351
332
  },
352
333
  mapToWidget: (e) => ({
353
334
  uid: e.uid ?? "",
@@ -426,7 +407,7 @@ const { gsl: Ye, gslByUid: ze } = c({
426
407
  suppressAutomaticPlaceholders: !1
427
408
  },
428
409
  fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
429
- apply: (e, t) => A(m(e, t), t)
410
+ apply: (e, t) => S(m(e, t), t)
430
411
  },
431
412
  mapToWidget: (e) => ({
432
413
  uid: e.uid ?? "",
@@ -486,7 +467,7 @@ const { gsl: Ye, gslByUid: ze } = c({
486
467
  suppressAutomaticPlaceholders: !1
487
468
  },
488
469
  fields: ["suppressAutomaticLabels", "suppressAutomaticPlaceholders"],
489
- apply: (e, t) => A(m(e, t), t)
470
+ apply: (e, t) => S(m(e, t), t)
490
471
  },
491
472
  mapToWidget: (e) => ({
492
473
  uid: e.uid ?? "",
@@ -500,11 +481,11 @@ const { gsl: Ye, gslByUid: ze } = c({
500
481
  props: b(e)
501
482
  })
502
483
  });
503
- function Q(e) {
484
+ function q(e) {
504
485
  const t = {};
505
486
  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;
506
487
  }
507
- function ee(e) {
488
+ function J(e) {
508
489
  return {
509
490
  uid: e.uid ?? "",
510
491
  kind: "input",
@@ -515,7 +496,7 @@ function ee(e) {
515
496
  ...e.readonly != null ? { readonly: e.readonly } : {},
516
497
  ...e.validator != null ? { validator: g(e.validator, "array") } : {},
517
498
  props: {
518
- ...Q(e),
499
+ ...q(e),
519
500
  template: { kind: "layout", type: "flex", children: [], props: { direction: "column" } }
520
501
  }
521
502
  };
@@ -529,7 +510,7 @@ function L(e, t) {
529
510
  l?.template?.children && Array.isArray(l.template.children) && L(l.template.children, t);
530
511
  }
531
512
  }
532
- function te(e, t) {
513
+ function Q(e, t) {
533
514
  const s = t.walkChildren(t.children ?? []), a = e.kind === "static" ? e.def.path ?? "" : e.fn({})?.path ?? "";
534
515
  a && L(s, a + ".items.");
535
516
  const l = {
@@ -555,60 +536,51 @@ function te(e, t) {
555
536
  };
556
537
  });
557
538
  }
558
- function se(e) {
539
+ function ee(e) {
559
540
  return {
560
541
  baseDef: e.def,
561
542
  path: e.key,
562
543
  children: e.children
563
544
  };
564
545
  }
565
- function le(e) {
546
+ function te(e) {
566
547
  return e.children;
567
548
  }
568
- const ae = {
569
- parseEntry: se,
549
+ const se = {
550
+ parseEntry: ee,
570
551
  rollUpSensibleDefaults: () => ({}),
571
552
  applySensibleDefaults: (e) => e,
572
- mapToWidget: ee,
573
- buildCustomWidget: te,
574
- getChildren: le
553
+ mapToWidget: J,
554
+ buildCustomWidget: Q,
555
+ getChildren: te
575
556
  };
576
- x("REPEATER", ae);
577
- const ne = R("REPEATER"), kt = (e, t) => ne(t, ((s) => s.uid === e)), j = {
557
+ x("REPEATER", se);
558
+ const le = N("REPEATER"), _t = (e, t) => le(t, ((s) => s.uid === e)), j = {
578
559
  onLoad: "load",
579
560
  onChange: "change",
580
561
  onFilter: "filter",
581
562
  onBlur: "blur"
582
- }, ie = Object.keys(j);
583
- class re {
584
- // ── Action-specific: onClick + submit ─────────────────────────
585
- extractOnClickFromMergeResult(t, s, a, l) {
563
+ }, ae = Object.keys(j);
564
+ class ne {
565
+ // ── Action-specific: onClick ───────────────────────────────────
566
+ extractOnClickFromMergeResult(t, s, a) {
586
567
  if (t.kind === "dynamic") {
587
- const o = t.fn;
588
- return { kind: "dynamic", fn: (u) => {
589
- const p = o(u);
590
- return this.wireOnClick(p, s, a, l);
568
+ const i = t.fn;
569
+ return { kind: "dynamic", fn: (r) => {
570
+ const u = i(r);
571
+ return this.wireOnClick(u, s, a);
591
572
  } };
592
573
  }
593
- const n = t.def;
594
- return { kind: "static", def: this.wireOnClick(n, s, a, l) };
574
+ const l = t.def;
575
+ return { kind: "static", def: this.wireOnClick(l, s, a) };
595
576
  }
596
- wireOnClick(t, s, a, l) {
597
- const n = t.uid === "#submit" || t.onClick === "submit", i = n ? "#submit" : l.next(), o = n ? "submit" : i, r = t.onClick, p = (typeof r == "function" ? r : void 0) ?? (n ? a.onSubmit : void 0);
598
- if (p) {
599
- s.set(o, (T) => p(T.data));
600
- const { onClick: y, ...d } = t;
601
- return { ...d, uid: i, on: { click: o } };
602
- }
603
- if (n) {
604
- const { onClick: y, ...d } = t;
605
- return { ...d, uid: i, on: { click: "submit" } };
577
+ wireOnClick(t, s, a) {
578
+ const l = a.next(), n = t.onClick;
579
+ if (typeof n == "function") {
580
+ const { onClick: i, ...o } = t, r = n(void 0);
581
+ return typeof r == "string" ? { ...o, uid: l, on: { click: r } } : (s.set(l, (u) => n(u.data)), { ...o, uid: l, on: { click: l } });
606
582
  }
607
- if (typeof r == "string") {
608
- const { onClick: y, ...d } = t;
609
- return { ...d, uid: i, on: { click: r } };
610
- }
611
- return { ...t, uid: i };
583
+ return { ...t, uid: l };
612
584
  }
613
585
  // ── Universal: onLoad, onChange, onFilter ──────────────────────
614
586
  wireInputLayoutEvents(t, s, a) {
@@ -625,7 +597,7 @@ class re {
625
597
  const l = { ...t.on || {} };
626
598
  let n = !1;
627
599
  const i = { ...t };
628
- for (const o of ie) {
600
+ for (const o of ae) {
629
601
  const r = t[o];
630
602
  if (r == null) continue;
631
603
  const u = j[o];
@@ -638,45 +610,46 @@ class re {
638
610
  return n && (i.on = l), i;
639
611
  }
640
612
  }
641
- const E = new re();
642
- function oe(e) {
613
+ const D = new ne();
614
+ function ie(e) {
643
615
  const {
644
616
  uid: t,
645
617
  label: s,
646
- disabled: a,
647
- on: l,
648
- onClick: n,
649
- data: i,
650
- type: o,
651
- tags: r,
652
- size: u,
653
- include: p,
618
+ actionType: a,
619
+ disabled: l,
620
+ on: n,
621
+ onClick: i,
622
+ data: o,
623
+ type: r,
624
+ tags: u,
625
+ size: p,
626
+ include: d,
654
627
  exclude: y,
655
- states: d,
656
- ...T
628
+ states: A,
629
+ ...k
657
630
  } = e;
658
631
  return {
659
632
  uid: t ?? "",
660
633
  kind: "action",
661
634
  type: "button",
662
- disabled: a,
635
+ disabled: l,
636
+ actionType: a,
663
637
  label: s,
664
- ...l != null ? { on: l } : {},
665
- props: T
638
+ ...n != null ? { on: n } : {},
639
+ props: k
666
640
  };
667
641
  }
668
- const { gsl: _t, gslByUid: vt } = c({
642
+ const { gsl: kt, gslByUid: vt } = c({
669
643
  itemType: "ACTIONS",
670
644
  entryShape: "bare",
671
- mapToWidget: oe,
672
- afterMerge: (e, t) => E.extractOnClickFromMergeResult(
645
+ mapToWidget: ie,
646
+ afterMerge: (e, t) => D.extractOnClickFromMergeResult(
673
647
  e,
674
648
  t.eventRegistry,
675
- t.formConfig,
676
649
  t.eventIdGenerator
677
650
  )
678
651
  });
679
- function ue(e) {
652
+ function re(e) {
680
653
  const {
681
654
  uid: t,
682
655
  widgetName: s,
@@ -698,7 +671,7 @@ function ue(e) {
698
671
  children: []
699
672
  };
700
673
  }
701
- function pe(e, t) {
674
+ function oe(e, t) {
702
675
  const s = t.walkChildren(t.children ?? []);
703
676
  if (e.kind === "static")
704
677
  return { ...t.mapStaticDef(e.def, "LAYOUTS"), children: s };
@@ -708,17 +681,17 @@ function pe(e, t) {
708
681
  return { ...t.mapStaticDef(n, "LAYOUTS"), children: s };
709
682
  });
710
683
  }
711
- function ce(e) {
684
+ function ue(e) {
712
685
  return e.children;
713
686
  }
714
- const { gsl: Ct, gslByUid: ft } = c({
687
+ const { gsl: ft, gslByUid: Ct } = c({
715
688
  itemType: "LAYOUTS",
716
689
  entryShape: "compound",
717
- mapToWidget: ue,
718
- buildCustomWidget: pe,
719
- getChildren: ce
690
+ mapToWidget: re,
691
+ buildCustomWidget: oe,
692
+ getChildren: ue
720
693
  });
721
- function de(e) {
694
+ function pe(e) {
722
695
  return {
723
696
  uid: "",
724
697
  kind: "display",
@@ -726,7 +699,7 @@ function de(e) {
726
699
  props: { render: e.render }
727
700
  };
728
701
  }
729
- function ye(e, t) {
702
+ function ce(e, t) {
730
703
  if (e.kind === "static") {
731
704
  const a = e.def;
732
705
  return ((l) => ({
@@ -754,9 +727,9 @@ function ye(e, t) {
754
727
  const { gsl: Ut, gslByUid: Ot } = c({
755
728
  itemType: "DISPLAYS",
756
729
  entryShape: "bare",
757
- mapToWidget: de,
758
- buildCustomWidget: ye
759
- }), { gsl: Lt, gslByUid: Et } = c({
730
+ mapToWidget: pe,
731
+ buildCustomWidget: ce
732
+ }), { gsl: Lt, gslByUid: Dt } = c({
760
733
  itemType: "ALERTS",
761
734
  entryShape: "bare",
762
735
  mapToWidget: (e) => ({
@@ -769,7 +742,7 @@ const { gsl: Ut, gslByUid: Ot } = c({
769
742
  }
770
743
  })
771
744
  });
772
- function be(e) {
745
+ function de(e) {
773
746
  return {
774
747
  uid: e.uid ?? "",
775
748
  kind: "layout",
@@ -782,7 +755,7 @@ function be(e) {
782
755
  children: []
783
756
  };
784
757
  }
785
- function me(e, t) {
758
+ function ye(e, t) {
786
759
  const s = t.walkChildren(t.children ?? []);
787
760
  if (e.kind === "static")
788
761
  return { ...t.mapStaticDef(e.def, "TABS"), children: s };
@@ -792,17 +765,17 @@ function me(e, t) {
792
765
  return { ...t.mapStaticDef(n, "TABS"), children: s };
793
766
  });
794
767
  }
795
- function he(e) {
768
+ function be(e) {
796
769
  return e.children;
797
770
  }
798
- const { gsl: Dt, gslByUid: Pt } = c({
771
+ const { gsl: Et, gslByUid: Pt } = c({
799
772
  itemType: "TABS",
800
773
  entryShape: "compound",
801
- mapToWidget: be,
802
- buildCustomWidget: me,
803
- getChildren: he
774
+ mapToWidget: de,
775
+ buildCustomWidget: ye,
776
+ getChildren: be
804
777
  });
805
- function ge(e) {
778
+ function me(e) {
806
779
  return {
807
780
  uid: e.uid ?? "",
808
781
  kind: "layout",
@@ -816,7 +789,7 @@ function ge(e) {
816
789
  children: []
817
790
  };
818
791
  }
819
- function Te(e, t) {
792
+ function he(e, t) {
820
793
  const s = t.walkChildren(t.children ?? []);
821
794
  if (e.kind === "static")
822
795
  return { ...t.mapStaticDef(e.def, "ACCORDION"), children: s };
@@ -826,15 +799,15 @@ function Te(e, t) {
826
799
  return { ...t.mapStaticDef(n, "ACCORDION"), children: s };
827
800
  });
828
801
  }
829
- function Se(e) {
802
+ function ge(e) {
830
803
  return e.children;
831
804
  }
832
805
  const { gsl: It, gslByUid: Wt } = c({
833
806
  itemType: "ACCORDION",
834
807
  entryShape: "compound",
835
- mapToWidget: ge,
836
- buildCustomWidget: Te,
837
- getChildren: Se
808
+ mapToWidget: me,
809
+ buildCustomWidget: he,
810
+ getChildren: ge
838
811
  }), { gsl: wt, gslByUid: Bt } = c({
839
812
  itemType: "CUSTOM_INPUT",
840
813
  entryShape: "keyed",
@@ -857,7 +830,7 @@ const { gsl: It, gslByUid: Wt } = c({
857
830
  ...e.validator != null ? { validator: e.validator } : {},
858
831
  props: e.props ?? {}
859
832
  })
860
- }), { gsl: Mt, gslByUid: Nt } = c({
833
+ }), { gsl: Mt, gslByUid: Rt } = c({
861
834
  itemType: "CUSTOM_ACTION",
862
835
  entryShape: "bare",
863
836
  mapToWidget: (e) => {
@@ -872,10 +845,10 @@ const { gsl: It, gslByUid: Wt } = c({
872
845
  tags: r,
873
846
  size: u,
874
847
  include: p,
875
- exclude: y,
876
- states: d,
877
- props: T,
878
- ..._
848
+ exclude: d,
849
+ states: y,
850
+ props: A,
851
+ ...k
879
852
  } = e;
880
853
  return {
881
854
  uid: t ?? "",
@@ -884,16 +857,15 @@ const { gsl: It, gslByUid: Wt } = c({
884
857
  label: s,
885
858
  disabled: a,
886
859
  ...l != null ? { on: l } : {},
887
- props: { ...T, ..._ }
860
+ props: { ...A, ...k }
888
861
  };
889
862
  },
890
- afterMerge: (e, t) => E.extractOnClickFromMergeResult(
863
+ afterMerge: (e, t) => D.extractOnClickFromMergeResult(
891
864
  e,
892
865
  t.eventRegistry,
893
- t.formConfig,
894
866
  t.eventIdGenerator
895
867
  )
896
- }), { gsl: Rt, gslByUid: xt } = c({
868
+ }), { gsl: Nt, gslByUid: xt } = c({
897
869
  itemType: "CUSTOM_DISPLAY",
898
870
  entryShape: "bare",
899
871
  mapToWidget: (e) => ({
@@ -903,7 +875,7 @@ const { gsl: It, gslByUid: Wt } = c({
903
875
  props: e.props ?? {}
904
876
  })
905
877
  });
906
- function Ae(e) {
878
+ function Te(e) {
907
879
  return {
908
880
  uid: e.uid ?? "",
909
881
  kind: "layout",
@@ -912,7 +884,7 @@ function Ae(e) {
912
884
  children: []
913
885
  };
914
886
  }
915
- function ke(e, t) {
887
+ function Se(e, t) {
916
888
  const s = t.walkChildren(t.children ?? []);
917
889
  if (e.kind === "static")
918
890
  return { ...t.mapStaticDef(e.def, "CUSTOM_LAYOUT"), children: s };
@@ -922,15 +894,15 @@ function ke(e, t) {
922
894
  return { ...t.mapStaticDef(n, "CUSTOM_LAYOUT"), children: s };
923
895
  });
924
896
  }
925
- function _e(e) {
897
+ function Ae(e) {
926
898
  return e.children;
927
899
  }
928
900
  const { gsl: Ft, gslByUid: jt } = c({
929
901
  itemType: "CUSTOM_LAYOUT",
930
902
  entryShape: "compound",
931
- mapToWidget: Ae,
932
- buildCustomWidget: ke,
933
- getChildren: _e
903
+ mapToWidget: Te,
904
+ buildCustomWidget: Se,
905
+ getChildren: Ae
934
906
  }), $ = {
935
907
  INPUTS: /* @__PURE__ */ new Set([
936
908
  "INPUTS",
@@ -950,17 +922,18 @@ const { gsl: Ft, gslByUid: jt } = c({
950
922
  "MARKDOWN",
951
923
  "LIST",
952
924
  "CUSTOM_INPUT",
953
- "REPEATER"
925
+ "REPEATER",
926
+ "TAGS"
954
927
  ]),
955
928
  ACTIONS: /* @__PURE__ */ new Set(["ACTIONS", "CUSTOM_ACTION"]),
956
929
  DISPLAYS: /* @__PURE__ */ new Set(["DISPLAYS", "ALERTS", "CUSTOM_DISPLAY"]),
957
930
  LAYOUTS: /* @__PURE__ */ new Set(["LAYOUTS", "TABS", "ACCORDION", "CUSTOM_LAYOUT"])
958
931
  };
959
- function ve(e, t) {
932
+ function _e(e, t) {
960
933
  const s = $[e];
961
934
  return s ? s.has(t) : e === t;
962
935
  }
963
- class Ce {
936
+ class ke {
964
937
  resolve(t, s) {
965
938
  const a = [];
966
939
  for (const n of s)
@@ -977,7 +950,7 @@ class Ce {
977
950
  this.collectFromLeaf(l, s, a);
978
951
  }
979
952
  collectFromLeaf(t, s, a) {
980
- ve(t.selectorType, s.itemType ?? "") && t.matcher(s) && a.push(t);
953
+ _e(t.selectorType, s.itemType ?? "") && t.matcher(s) && a.push(t);
981
954
  }
982
955
  rollUpSensibleDefaults(t) {
983
956
  const s = /* @__PURE__ */ new Map(), a = (n, i) => {
@@ -993,11 +966,31 @@ class Ce {
993
966
  }
994
967
  const l = {};
995
968
  for (const [n, i] of s)
996
- F(n) && (l[n] = f(n).rollUpSensibleDefaults(i));
969
+ F(n) && (l[n] = C(n).rollUpSensibleDefaults(i));
997
970
  return l;
998
971
  }
999
972
  }
1000
- const fe = new Ce();
973
+ const ve = new ke();
974
+ class fe {
975
+ /**
976
+ * Deep merges two objects, with right taking precedence over left when properties conflict.
977
+ * Arrays are replaced, not merged.
978
+ * @param left - The base object
979
+ * @param right - The object whose properties take precedence
980
+ * @returns A new merged object
981
+ */
982
+ deepMerge(t, s) {
983
+ if (s == null)
984
+ return t;
985
+ if (t == null || typeof t != "object" || typeof s != "object" || Array.isArray(t) || Array.isArray(s))
986
+ return s;
987
+ const a = { ...t };
988
+ for (const l in s)
989
+ Object.prototype.hasOwnProperty.call(s, l) && (typeof s[l] == "object" && !Array.isArray(s[l]) && s[l] !== null && typeof t[l] == "object" && !Array.isArray(t[l]) && t[l] !== null ? a[l] = this.deepMerge(t[l], s[l]) : a[l] = s[l]);
990
+ return a;
991
+ }
992
+ }
993
+ const Ce = new fe();
1001
994
  class Ue {
1002
995
  constructor(t) {
1003
996
  this.objectUtils = t;
@@ -1051,7 +1044,7 @@ class Ue {
1051
1044
  applySensibleDefaults(t, s, a) {
1052
1045
  if (!F(s)) return t;
1053
1046
  const l = a.sensibleDefaults[s] ?? {};
1054
- return f(s).applySensibleDefaults(t, l);
1047
+ return C(s).applySensibleDefaults(t, l);
1055
1048
  }
1056
1049
  // ── Create promoted FunctionWidget ──
1057
1050
  createPromotedFunction(t, s, a, l, n) {
@@ -1079,7 +1072,7 @@ class Ue {
1079
1072
  };
1080
1073
  }
1081
1074
  }
1082
- const Oe = new Ue(V);
1075
+ const Oe = new Ue(Ce);
1083
1076
  class Le {
1084
1077
  mapToWidget(t, s) {
1085
1078
  if (t.kind === "dynamic") {
@@ -1092,7 +1085,7 @@ class Le {
1092
1085
  return this.mapStaticDef(t.def, s);
1093
1086
  }
1094
1087
  mapStaticDef(t, s) {
1095
- const a = f(s).mapToWidget(t);
1088
+ const a = C(s).mapToWidget(t);
1096
1089
  return this.applyBaseWidgetFields(a, t);
1097
1090
  }
1098
1091
  /**
@@ -1103,8 +1096,8 @@ class Le {
1103
1096
  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;
1104
1097
  }
1105
1098
  }
1106
- const Ee = new Le();
1107
- class De {
1099
+ const De = new Le();
1100
+ class Ee {
1108
1101
  /**
1109
1102
  * Ensures the output is always a uniform GslSelector[] of aggregated selectors.
1110
1103
  *
@@ -1125,12 +1118,11 @@ class De {
1125
1118
  }
1126
1119
  extractFormConfig() {
1127
1120
  return {
1128
- suppressAutomaticStack: !1,
1129
- onSubmit: (t) => console.log("Form submitted:", t)
1121
+ suppressAutomaticStack: !1
1130
1122
  };
1131
1123
  }
1132
1124
  }
1133
- const Pe = new De(), Ie = {
1125
+ const Pe = new Ee(), Ie = {
1134
1126
  input: /* @__PURE__ */ new Set(["disabled", "readonly", "label", "validator", "size"]),
1135
1127
  action: /* @__PURE__ */ new Set(["disabled", "label", "size"]),
1136
1128
  layout: /* @__PURE__ */ new Set(["size"]),
@@ -1161,8 +1153,8 @@ class We {
1161
1153
  const o = t.fn;
1162
1154
  return {
1163
1155
  cleanedResult: { kind: "dynamic", fn: (u) => {
1164
- const p = o(u), { states: y, ...d } = p;
1165
- return d;
1156
+ const p = o(u), { states: d, ...y } = p;
1157
+ return y;
1166
1158
  } },
1167
1159
  stateData: { stateOverrides: a }
1168
1160
  };
@@ -1194,8 +1186,8 @@ class We {
1194
1186
  const i = { ...t }, o = t.kind, r = Ie[o] || /* @__PURE__ */ new Set();
1195
1187
  t.props && (i.props = { ...t.props }), t.on && (i.on = { ...t.on });
1196
1188
  for (const [u, p] of Object.entries(n))
1197
- for (const [y, d] of Object.entries(p))
1198
- y === "visible" ? this.applyVisibility(i, u, d) : W[y] ? this.applyStateEvent(i, u, y, d, a, l) : r.has(y) ? i[`${y}.${u}`] = d : (i.props || (i.props = {}), i.props[`${y}.${u}`] = d);
1189
+ for (const [d, y] of Object.entries(p))
1190
+ d === "visible" ? this.applyVisibility(i, u, y) : W[d] ? this.applyStateEvent(i, u, d, y, a, l) : r.has(d) ? i[`${d}.${u}`] = y : (i.props || (i.props = {}), i.props[`${d}.${u}`] = y);
1199
1191
  return i;
1200
1192
  }
1201
1193
  hasStateData(t) {
@@ -1259,28 +1251,28 @@ class Me {
1259
1251
  });
1260
1252
  }
1261
1253
  processItem(t, s, a, l, n, i, o, r, u) {
1262
- const p = s, y = f(s), d = y.parseEntry(t), T = this.buildBaseDef(d), _ = this.buildDecoratorForMatching(T, p, a), v = this.resolver.resolve(_, l), D = v.leafSelectors.filter((h) => h.targetState != null), P = {
1254
+ const p = s, d = C(s), y = d.parseEntry(t), A = this.buildBaseDef(y), k = this.buildDecoratorForMatching(A, p, a), v = this.resolver.resolve(k, l), E = v.leafSelectors.filter((h) => h.targetState != null), P = {
1263
1255
  leafSelectors: v.leafSelectors.filter((h) => h.targetState == null),
1264
1256
  sensibleDefaults: v.sensibleDefaults
1265
1257
  };
1266
- let k = this.merger.merge(T, p, P);
1267
- y.afterMerge && (k = y.afterMerge(k, {
1258
+ let _ = this.merger.merge(A, p, P);
1259
+ d.afterMerge && (_ = d.afterMerge(_, {
1268
1260
  eventRegistry: n,
1269
1261
  formConfig: i,
1270
1262
  eventIdGenerator: o
1271
- })), k = this.eventWiring.wireInputLayoutEvents(
1272
- k,
1263
+ })), _ = this.eventWiring.wireInputLayoutEvents(
1264
+ _,
1273
1265
  n,
1274
1266
  o
1275
1267
  );
1276
1268
  const { cleanedResult: I, stateData: U } = this.stateExpansion.extractFromMergeResult(
1277
- k,
1278
- D
1269
+ _,
1270
+ E
1279
1271
  );
1280
- let S;
1281
- if (y.buildCustomWidget) {
1272
+ let T;
1273
+ if (d.buildCustomWidget) {
1282
1274
  const h = this.buildCustomWidgetContext(
1283
- d.children,
1275
+ y.children,
1284
1276
  l,
1285
1277
  n,
1286
1278
  i,
@@ -1288,17 +1280,17 @@ class Me {
1288
1280
  r,
1289
1281
  u
1290
1282
  );
1291
- S = this.buildCustomWidget(y, I, h);
1283
+ T = this.buildCustomWidget(d, I, h);
1292
1284
  } else
1293
- S = this.mapper.mapToWidget(I, p);
1294
- if (typeof S != "function") {
1295
- const h = S;
1285
+ T = this.mapper.mapToWidget(I, p);
1286
+ if (typeof T != "function") {
1287
+ const h = T;
1296
1288
  h.uid || (h.path && !u.has(h.path) ? (h.uid = h.path, u.add(h.path)) : h.uid = `dx_${r.value++}`);
1297
1289
  }
1298
1290
  if (this.stateExpansion.hasStateData(U))
1299
- if (typeof S == "function") {
1300
- const h = S;
1301
- S = ((Y) => {
1291
+ if (typeof T == "function") {
1292
+ const h = T;
1293
+ T = ((Y) => {
1302
1294
  const z = h(Y);
1303
1295
  return this.stateExpansion.applyToWidget(
1304
1296
  z,
@@ -1308,13 +1300,13 @@ class Me {
1308
1300
  );
1309
1301
  });
1310
1302
  } else
1311
- S = this.stateExpansion.applyToWidget(
1312
- S,
1303
+ T = this.stateExpansion.applyToWidget(
1304
+ T,
1313
1305
  U,
1314
1306
  n,
1315
1307
  o
1316
1308
  );
1317
- return S;
1309
+ return T;
1318
1310
  }
1319
1311
  buildCustomWidgetContext(t, s, a, l, n, i, o) {
1320
1312
  return {
@@ -1352,7 +1344,7 @@ class Me {
1352
1344
  return { itemType: s, tags: l, uid: n, type: i };
1353
1345
  }
1354
1346
  }
1355
- class Ne {
1347
+ class Re {
1356
1348
  constructor(t, s) {
1357
1349
  this.selectorNormalizer = t, this.walker = s;
1358
1350
  }
@@ -1380,7 +1372,7 @@ class Ne {
1380
1372
  */
1381
1373
  prepareForm(t, s, a) {
1382
1374
  const n = (Array.isArray(t) ? [...t] : [t]).map(
1383
- (r) => typeof r == "function" ? G(r) : r
1375
+ (r) => typeof r == "function" ? K(r) : r
1384
1376
  ), i = this.selectorNormalizer.normalizeSelectors(s), o = {
1385
1377
  ...this.selectorNormalizer.extractFormConfig(),
1386
1378
  ...a
@@ -1391,7 +1383,7 @@ class Ne {
1391
1383
  children: n
1392
1384
  };
1393
1385
  return {
1394
- defs: [{ type: "ITEMS", itemType: N.LAYOUTS, items: [r], tags: [] }],
1386
+ defs: [{ type: "ITEMS", itemType: R.LAYOUTS, items: [r], tags: [] }],
1395
1387
  gslSelectors: i,
1396
1388
  formConfig: o
1397
1389
  };
@@ -1419,11 +1411,11 @@ class Ne {
1419
1411
  if (i) {
1420
1412
  const o = (u) => {
1421
1413
  if (u && typeof u == "object" && "path" in u && !("type" in u)) {
1422
- const { path: p, ...y } = u;
1423
- for (const [d, T] of Object.entries(y))
1414
+ const { path: p, ...d } = u;
1415
+ for (const [y, A] of Object.entries(d))
1424
1416
  n.callback({
1425
1417
  type: "OVERRIDE_WIDGET_PROP",
1426
- payload: { path: p, prop: d, value: T }
1418
+ payload: { path: p, prop: y, value: A }
1427
1419
  });
1428
1420
  } else
1429
1421
  n.callback(u);
@@ -1437,13 +1429,13 @@ class Ne {
1437
1429
  }), a.dependencies && (l.dependencies = a.dependencies), a.widgetLoaders && (l.widgetLoaders = a.widgetLoaders), a.validateOn && (l.validateOn = a.validateOn), a.itemRenderers && (l.itemRenderers = a.itemRenderers), l;
1438
1430
  }
1439
1431
  }
1440
- const Re = new Me(
1441
- fe,
1432
+ const Ne = new Me(
1433
+ ve,
1442
1434
  Oe,
1443
- Ee,
1444
- E,
1435
+ De,
1436
+ D,
1445
1437
  we
1446
- ), xe = new Ne(Pe, Re);
1438
+ ), xe = new Re(Pe, Ne);
1447
1439
  function Fe(e) {
1448
1440
  return typeof e == "function" ? !0 : Array.isArray(e) ? e.length === 0 || e.every(w) : w(e);
1449
1441
  }
@@ -1482,45 +1474,45 @@ function $t(e, t, s) {
1482
1474
  return o.set(n, p), p;
1483
1475
  }
1484
1476
  export {
1485
- xt as $,
1486
- mt as A,
1487
- ht as B,
1488
- gt as C,
1489
- Tt as D,
1490
- St as E,
1491
- At as F,
1492
- N as G,
1493
- ne as H,
1477
+ Ft as $,
1478
+ ht as A,
1479
+ gt as B,
1480
+ Tt as C,
1481
+ St as D,
1482
+ At as E,
1483
+ le as F,
1484
+ R as G,
1485
+ _t as H,
1494
1486
  kt as I,
1495
- _t as J,
1496
- vt as K,
1487
+ vt as J,
1488
+ ft as K,
1497
1489
  Ct as L,
1498
- ft as M,
1499
- Ut as N,
1500
- Ot as O,
1501
- Lt as P,
1490
+ Ut as M,
1491
+ Ot as N,
1492
+ Lt as O,
1493
+ Dt as P,
1502
1494
  Et as Q,
1503
- Dt as R,
1504
- Pt as S,
1505
- It as T,
1506
- Wt as U,
1507
- wt as V,
1508
- Bt as W,
1509
- Mt as X,
1495
+ Pt as R,
1496
+ It as S,
1497
+ Wt as T,
1498
+ wt as U,
1499
+ Bt as V,
1500
+ Mt as W,
1501
+ Rt as X,
1510
1502
  Nt as Y,
1511
- Rt as Z,
1503
+ xt as Z,
1512
1504
  Ye as _,
1513
1505
  ze as a,
1514
- Ft as a0,
1515
- jt as a1,
1516
- G as a2,
1517
- R as a3,
1518
- c as a4,
1519
- b as a5,
1520
- xe as a6,
1521
- Fe as a7,
1522
- m as a8,
1523
- A as a9,
1506
+ jt as a0,
1507
+ K as a1,
1508
+ c as a2,
1509
+ b as a3,
1510
+ g as a4,
1511
+ S as a5,
1512
+ m as a6,
1513
+ N as a7,
1514
+ xe as a8,
1515
+ Fe as a9,
1524
1516
  $t as aa,
1525
1517
  Ke as b,
1526
1518
  Ve as c,
@@ -1535,16 +1527,16 @@ export {
1535
1527
  tt as l,
1536
1528
  st as m,
1537
1529
  lt as n,
1538
- V as o,
1539
- at as p,
1540
- nt as q,
1541
- it as r,
1542
- rt as s,
1543
- ot as t,
1544
- ut as u,
1545
- pt as v,
1546
- ct as w,
1547
- dt as x,
1548
- yt as y,
1549
- bt as z
1530
+ at as o,
1531
+ nt as p,
1532
+ it as q,
1533
+ rt as r,
1534
+ ot as s,
1535
+ ut as t,
1536
+ pt as u,
1537
+ ct as v,
1538
+ dt as w,
1539
+ yt as x,
1540
+ bt as y,
1541
+ mt as z
1550
1542
  };