@golemui/gui-shared 1.0.2 → 1.1.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/index.d.ts +1 -0
  3. package/index.js +268 -198
  4. package/index.umd.cjs +1 -1
  5. package/internals.d.ts +4 -4
  6. package/internals.js +355 -314
  7. package/internals.umd.cjs +1 -1
  8. package/lib/dx/core/dx.domain.d.ts +6 -1
  9. package/lib/dx/core/withForm.d.ts +8 -0
  10. package/lib/dx/formDef.domain.d.ts +2 -1
  11. package/lib/dx/gui.d.ts +20 -0
  12. package/lib/dx/index.d.ts +30 -0
  13. package/lib/dx/resolveFormInput.d.ts +9 -1
  14. package/lib/dx/shortcuts/date-time-calendar/dateTimeCalendar.domain.d.ts +22 -0
  15. package/lib/dx/shortcuts/date-time-calendar/dateTimeCalendarSensibleDefaults.service.d.ts +6 -0
  16. package/lib/dx/shortcuts/date-time-calendar/guiDateTimeCalendar.impl.d.ts +6 -0
  17. package/lib/dx/shortcuts/date-time-calendar/register.d.ts +2 -0
  18. package/lib/dx/shortcuts/date-time-input/dateTimeInput.domain.d.ts +17 -0
  19. package/lib/dx/shortcuts/date-time-input/guiDateTimeInput.impl.d.ts +6 -0
  20. package/lib/dx/shortcuts/date-time-input/register.d.ts +2 -0
  21. package/lib/dx/shortcuts/date-time-picker/dateTimePicker.domain.d.ts +18 -0
  22. package/lib/dx/shortcuts/date-time-picker/guiDateTimePicker.impl.d.ts +7 -0
  23. package/lib/dx/shortcuts/date-time-picker/register.d.ts +2 -0
  24. package/lib/dx/shortcuts/range-date-time-calendar/guiRangeDateTimeCalendar.impl.d.ts +6 -0
  25. package/lib/dx/shortcuts/range-date-time-calendar/rangeDateTimeCalendar.domain.d.ts +17 -0
  26. package/lib/dx/shortcuts/range-date-time-calendar/register.d.ts +2 -0
  27. package/lib/dx/shortcuts/range-date-time-input/guiRangeDateTimeInput.impl.d.ts +6 -0
  28. package/lib/dx/shortcuts/range-date-time-input/rangeDateTimeInput.domain.d.ts +17 -0
  29. package/lib/dx/shortcuts/range-date-time-input/register.d.ts +2 -0
  30. package/lib/dx/shortcuts/range-date-time-picker/guiRangeDateTimePicker.impl.d.ts +6 -0
  31. package/lib/dx/shortcuts/range-date-time-picker/rangeDateTimePicker.domain.d.ts +17 -0
  32. package/lib/dx/shortcuts/range-date-time-picker/register.d.ts +2 -0
  33. package/lib/dx/shortcuts/range-time-input/guiRangeTimeInput.impl.d.ts +6 -0
  34. package/lib/dx/shortcuts/range-time-input/rangeTimeInput.domain.d.ts +17 -0
  35. package/lib/dx/shortcuts/range-time-input/register.d.ts +2 -0
  36. package/lib/dx/shortcuts/range-time-picker/guiRangeTimePicker.impl.d.ts +6 -0
  37. package/lib/dx/shortcuts/range-time-picker/rangeTimePicker.domain.d.ts +17 -0
  38. package/lib/dx/shortcuts/range-time-picker/register.d.ts +2 -0
  39. package/lib/dx/shortcuts/scopes/scopeChain.d.ts +30 -0
  40. package/lib/dx/shortcuts/time-input/guiTimeInput.impl.d.ts +6 -0
  41. package/lib/dx/shortcuts/time-input/register.d.ts +2 -0
  42. package/lib/dx/shortcuts/time-input/timeInput.domain.d.ts +17 -0
  43. package/lib/dx/shortcuts/time-picker/guiTimePicker.impl.d.ts +7 -0
  44. package/lib/dx/shortcuts/time-picker/register.d.ts +2 -0
  45. package/lib/dx/shortcuts/time-picker/timePicker.domain.d.ts +18 -0
  46. package/lib/golem-form.d.ts +32 -2
  47. package/lib/widget.props.d.ts +197 -26
  48. package/lib/widgets.d.ts +2 -2
  49. package/package.json +3 -3
  50. package/{register-BxVKv9Qh.js → register-C4dCzlrS.js} +756 -412
  51. package/register-KU4CGoTQ.cjs +1 -0
  52. package/register-dBzdQbWZ.cjs +0 -1
package/internals.js CHANGED
@@ -1,21 +1,21 @@
1
- import { aF as I, aG as m, aH as M, ah as B, aI as j, aJ as L } from "./register-BxVKv9Qh.js";
2
- import { X as me, W as he, L as Se, K as be, R as Te, Q as De, d as Ae, x as Oe, w as Ue, l as Ie, k as Ee, q as Re, r as we, a0 as ve, $ as xe, a2 as Ce, a1 as ke, Z as Me, Y as Be, a4 as je, a3 as Le, z as Pe, y as Ne, B as Fe, A as We, P as ze, O as Ge, h as $e, g as Ke, a as Ye, _ as Ve, N as He, M as Xe, v as qe, u as Je, t as Qe, T as Ze, S as et, s as tt, c as st, p as at, o as nt, j as rt, i as ot, D as it, C as lt, F as ct, E as ut, H as pt, G as dt, J as ft, I as gt, f as yt, e as _t, U as mt, V as ht, aK as St, aL as bt, b as Tt, n as Dt, m as At, a6 as Ot, ag as Ut, aC as It, aj as Et, as as Rt, ay as wt, av as vt, ai as xt, ae as Ct, ak as kt, a5 as Mt, ar as Bt, aq as jt, aA as Lt, ad as Pt, aa as Nt, ac as Ft, a9 as Wt, at as zt, au as Gt, af as $t, aD as Kt, aw as Yt, az as Vt, ap as Ht, ao as Xt, an as qt, am as Jt, aB as Qt, a7 as Zt, al as es, aE as ts, ax as ss, ab as as, a8 as ns, aM as rs, aN as os, aO as is, aP as ls, aQ as cs } from "./register-BxVKv9Qh.js";
1
+ import { b7 as A, b8 as m, b9 as v, ba as x, aB as B, bb as N, bc as j } from "./register-C4dCzlrS.js";
2
+ import { ag as Te, af as he, a4 as be, a3 as De, aa as Se, a9 as Ie, d as Ee, x as Re, w as Ae, l as Ue, k as ke, q as Ce, r as Oe, ak as Me, aj as Pe, am as we, al as ve, ai as xe, ah as Be, ao as Ne, an as je, B as Le, A as Fe, J as We, I as ze, z as Ge, y as Ke, H as $e, G as Ye, L as Ve, K as He, a8 as Xe, a7 as qe, h as Je, g as Qe, a as Ze, _ as et, a6 as tt, a5 as st, v as at, u as nt, t as it, ac as rt, ab as ot, s as lt, c as ct, p as ut, o as pt, j as dt, i as gt, N as ft, M as _t, P as yt, O as mt, Z as Tt, Y as ht, V as bt, U as Dt, T as St, S as It, X as Et, W as Rt, R as At, Q as Ut, a0 as kt, $ as Ct, a2 as Ot, a1 as Mt, f as Pt, e as wt, ad as vt, ae as xt, bd as Bt, be as Nt, b as jt, n as Lt, m as Ft, D as Wt, C as zt, F as Gt, E as Kt, aq as $t, aA as Yt, b4 as Vt, aD as Ht, aW as Xt, b0 as qt, aZ as Jt, aC as Qt, ay as Zt, aE as es, ap as ts, aU as ss, aT as as, aV as ns, aP as is, aS as rs, b2 as os, ax as ls, au as cs, aw as us, at as ps, aX as ds, aY as gs, az as fs, b5 as _s, a_ as ys, b1 as ms, aO as Ts, aN as hs, aI as bs, aL as Ds, aM as Ss, aK as Is, aJ as Es, aH as Rs, aG as As, b3 as Us, ar as ks, aF as Cs, b6 as Os, a$ as Ms, aR as Ps, aQ as ws, av as vs, as as xs, bf as Bs, bg as Ns, bh as js, bi as Ls, bj as Fs } from "./register-C4dCzlrS.js";
3
3
  import "@golemui/core";
4
4
  import "@golemui/gui-validators";
5
- function ce(o, ...e) {
5
+ function ue(r, ...e) {
6
6
  return e.map((t) => ({
7
7
  ...t,
8
- targetState: o
8
+ targetState: r
9
9
  }));
10
10
  }
11
- function ue(o, ...e) {
11
+ function pe(r, ...e) {
12
12
  return {
13
13
  kind: "aggregated",
14
- matcher: (t) => t.tags?.includes(o) ?? !1,
14
+ matcher: (t) => t.tags?.includes(r) ?? !1,
15
15
  children: e
16
16
  };
17
17
  }
18
- const E = {
18
+ const U = {
19
19
  INPUTS: /* @__PURE__ */ new Set([
20
20
  "INPUTS",
21
21
  "TEXTAREA",
@@ -25,11 +25,21 @@ const E = {
25
25
  "RADIOGROUP",
26
26
  "CHECKBOX",
27
27
  "CALENDAR",
28
+ "DATE_TIME_CALENDAR",
29
+ "DATE_TIME_PICKER",
28
30
  "DATE_INPUT",
29
31
  "DATE_PICKER",
30
32
  "RANGE_CALENDAR",
31
33
  "RANGE_DATE_INPUT",
34
+ "RANGE_DATE_TIME_INPUT",
35
+ "RANGE_DATE_TIME_CALENDAR",
36
+ "RANGE_DATE_TIME_PICKER",
37
+ "RANGE_TIME_INPUT",
32
38
  "RANGE_DATE_PICKER",
39
+ "RANGE_TIME_PICKER",
40
+ "TIME_INPUT",
41
+ "TIME_PICKER",
42
+ "DATE_TIME_INPUT",
33
43
  "CURRENCY",
34
44
  "MARKDOWN",
35
45
  "LIST",
@@ -41,11 +51,11 @@ const E = {
41
51
  DISPLAYS: /* @__PURE__ */ new Set(["DISPLAYS", "ALERTS", "MARKDOWN_TEXTS", "CUSTOM_DISPLAY"]),
42
52
  LAYOUTS: /* @__PURE__ */ new Set(["LAYOUTS", "TABS", "ACCORDION", "CUSTOM_LAYOUT"])
43
53
  };
44
- function P(o, e) {
45
- const t = E[o];
46
- return t ? t.has(e) : o === e;
54
+ function L(r, e) {
55
+ const t = U[r];
56
+ return t ? t.has(e) : r === e;
47
57
  }
48
- class N {
58
+ class F {
49
59
  resolve(e, t) {
50
60
  const a = [];
51
61
  for (const n of t)
@@ -62,28 +72,28 @@ class N {
62
72
  this.collectFromLeaf(s, t, a);
63
73
  }
64
74
  collectFromLeaf(e, t, a) {
65
- P(e.selectorType, t.itemType ?? "") && e.matcher(t) && a.push(e);
75
+ L(e.selectorType, t.itemType ?? "") && e.matcher(t) && a.push(e);
66
76
  }
67
77
  rollUpSensibleDefaults(e) {
68
- const t = /* @__PURE__ */ new Map(), a = (n, r) => {
69
- const i = t.get(n) ?? [];
70
- i.push(r), t.set(n, i);
78
+ const t = /* @__PURE__ */ new Map(), a = (n, i) => {
79
+ const o = t.get(n) ?? [];
80
+ o.push(i), t.set(n, o);
71
81
  };
72
82
  for (const n of e) {
73
- const r = E[n.selectorType];
74
- if (r)
75
- for (const i of r) a(i, n);
83
+ const i = U[n.selectorType];
84
+ if (i)
85
+ for (const o of i) a(o, n);
76
86
  else
77
87
  a(n.selectorType, n);
78
88
  }
79
89
  const s = {};
80
- for (const [n, r] of t)
81
- I(n) && (s[n] = m(n).rollUpSensibleDefaults(r));
90
+ for (const [n, i] of t)
91
+ A(n) && (s[n] = m(n).rollUpSensibleDefaults(i));
82
92
  return s;
83
93
  }
84
94
  }
85
- const F = new N();
86
- class W {
95
+ const W = new F();
96
+ class z {
87
97
  /**
88
98
  * Deep merges two objects, with right taking precedence over left when properties conflict.
89
99
  * Arrays are replaced, not merged.
@@ -102,22 +112,22 @@ class W {
102
112
  return a;
103
113
  }
104
114
  }
105
- const z = new W();
106
- class G {
115
+ const G = new z();
116
+ class K {
107
117
  constructor(e) {
108
118
  this.objectUtils = e;
109
119
  }
110
120
  merge(e, t, a) {
111
121
  let s = {}, n = null;
112
122
  typeof e == "function" && (n = e);
113
- const r = this.collectDecorators(a);
114
- for (const c of r) {
123
+ const i = this.collectDecorators(a);
124
+ for (const l of i) {
115
125
  if (n != null) {
116
- n = this.composeRuntimeFunctions(n, c);
126
+ n = this.composeRuntimeFunctions(n, l);
117
127
  continue;
118
128
  }
119
- if (typeof c == "function") {
120
- const u = c({
129
+ if (typeof l == "function") {
130
+ const u = l({
121
131
  ...s,
122
132
  ...typeof e == "function" ? {} : e
123
133
  });
@@ -133,15 +143,15 @@ class G {
133
143
  }
134
144
  s = this.objectUtils.deepMerge(s, u);
135
145
  } else
136
- s = this.objectUtils.deepMerge(s, c);
146
+ s = this.objectUtils.deepMerge(s, l);
137
147
  }
138
148
  if (n != null)
139
149
  return {
140
150
  kind: "dynamic",
141
151
  fn: this.wrapWithSensibleDefaults(n, s, t, a)
142
152
  };
143
- const i = this.objectUtils.deepMerge(e, s);
144
- return { kind: "static", def: this.applySensibleDefaults({ ...i }, t, a) };
153
+ const o = this.objectUtils.deepMerge(e, s);
154
+ return { kind: "static", def: this.applySensibleDefaults({ ...o }, t, a) };
145
155
  }
146
156
  // ── Collect all decorators in priority order ──
147
157
  collectDecorators(e) {
@@ -154,23 +164,23 @@ class G {
154
164
  }
155
165
  // ── Apply sensible defaults via registry ──
156
166
  applySensibleDefaults(e, t, a) {
157
- if (!I(t)) return e;
167
+ if (!A(t)) return e;
158
168
  const s = a.sensibleDefaults[t] ?? {};
159
169
  return m(t).applySensibleDefaults(e, s);
160
170
  }
161
171
  // ── Create promoted FunctionWidget ──
162
172
  createPromotedFunction(e, t, a, s, n) {
163
- return (r) => {
164
- const i = a(r);
165
- let l = this.objectUtils.deepMerge(e, i);
166
- return l = this.objectUtils.deepMerge(l, t), this.applySensibleDefaults(l, s, n);
173
+ return (i) => {
174
+ const o = a(i);
175
+ let c = this.objectUtils.deepMerge(e, o);
176
+ return c = this.objectUtils.deepMerge(c, t), this.applySensibleDefaults(c, s, n);
167
177
  };
168
178
  }
169
179
  // ── Wrap runtime function with accumulated static decorators and sensible defaults ──
170
180
  wrapWithSensibleDefaults(e, t, a, s) {
171
181
  return (n) => {
172
- let r = e(n);
173
- return Object.keys(t).length > 0 && (r = this.objectUtils.deepMerge(t, r)), this.applySensibleDefaults(r, a, s);
182
+ let i = e(n);
183
+ return Object.keys(t).length > 0 && (i = this.objectUtils.deepMerge(t, i)), this.applySensibleDefaults(i, a, s);
174
184
  };
175
185
  }
176
186
  // ── Compose two runtime functions ──
@@ -184,8 +194,8 @@ class G {
184
194
  };
185
195
  }
186
196
  }
187
- const $ = new G(z);
188
- class K {
197
+ const $ = new K(G);
198
+ class Y {
189
199
  mapToWidget(e, t) {
190
200
  if (e.kind === "dynamic") {
191
201
  const a = e.fn;
@@ -208,8 +218,8 @@ class K {
208
218
  return t.size != null && (e.size = t.size), t.defaultValue != null && e.kind === "input" && (e.defaultValue = t.defaultValue), t.on != null && (e.on = t.on), t.include != null && (e.include = t.include), t.exclude != null && (e.exclude = t.exclude), e;
209
219
  }
210
220
  }
211
- const Y = new K();
212
- class V {
221
+ const V = new Y();
222
+ class H {
213
223
  /**
214
224
  * Ensures the output is always a uniform GslSelector[] of aggregated selectors.
215
225
  *
@@ -234,18 +244,18 @@ class V {
234
244
  };
235
245
  }
236
246
  }
237
- const H = new V(), X = {
247
+ const X = new H(), q = {
238
248
  input: /* @__PURE__ */ new Set(["disabled", "readonly", "label", "validator", "size"]),
239
249
  action: /* @__PURE__ */ new Set(["disabled", "label", "size"]),
240
250
  layout: /* @__PURE__ */ new Set(["size"]),
241
251
  display: /* @__PURE__ */ new Set([])
242
- }, D = {
252
+ }, S = {
243
253
  onChange: "change",
244
254
  onLoad: "load",
245
255
  onFilter: "filter",
246
256
  onClick: "click"
247
257
  };
248
- class q {
258
+ class J {
249
259
  /**
250
260
  * Extracts `states` from a merge result, combining with state-targeted
251
261
  * GSL leaf selectors from `_gslStates`.
@@ -254,34 +264,34 @@ class q {
254
264
  */
255
265
  extractFromMergeResult(e, t) {
256
266
  const a = {};
257
- for (const i of t) {
258
- const l = i.targetState, c = i.config, u = c.override && typeof c.override != "function" ? c.override : c;
259
- a[l] = {
260
- ...a[l] || {},
267
+ for (const o of t) {
268
+ const c = o.targetState, l = o.config, u = l.override && typeof l.override != "function" ? l.override : l;
269
+ a[c] = {
270
+ ...a[c] || {},
261
271
  ...u
262
272
  };
263
273
  }
264
274
  if (e.kind === "dynamic") {
265
- const i = e.fn;
275
+ const o = e.fn;
266
276
  return {
267
- cleanedResult: { kind: "dynamic", fn: (c) => {
268
- const u = i(c), { states: p, ...f } = u;
269
- return f;
277
+ cleanedResult: { kind: "dynamic", fn: (l) => {
278
+ const u = o(l), { states: p, ...g } = u;
279
+ return g;
270
280
  } },
271
281
  stateData: { stateOverrides: a }
272
282
  };
273
283
  }
274
- const { states: s, ...n } = e.def, r = {};
275
- for (const [i, l] of Object.entries(a))
276
- r[i] = { ...l };
284
+ const { states: s, ...n } = e.def, i = {};
285
+ for (const [o, c] of Object.entries(a))
286
+ i[o] = { ...c };
277
287
  if (s)
278
- for (const [i, l] of Object.entries(
288
+ for (const [o, c] of Object.entries(
279
289
  s
280
290
  ))
281
- r[i] = { ...r[i] || {}, ...l };
291
+ i[o] = { ...i[o] || {}, ...c };
282
292
  return {
283
293
  cleanedResult: { kind: "static", def: n },
284
- stateData: { stateOverrides: r }
294
+ stateData: { stateOverrides: i }
285
295
  };
286
296
  }
287
297
  /**
@@ -295,12 +305,12 @@ class q {
295
305
  const { stateOverrides: n } = t;
296
306
  if (Object.keys(n).length === 0)
297
307
  return e;
298
- const r = { ...e }, i = e.kind, l = X[i] || /* @__PURE__ */ new Set();
299
- e.props && (r.props = { ...e.props }), e.on && (r.on = { ...e.on });
300
- for (const [c, u] of Object.entries(n))
301
- for (const [p, f] of Object.entries(u))
302
- p === "visible" ? this.applyVisibility(r, c, f) : D[p] ? this.applyStateEvent(r, c, p, f, a, s) : l.has(p) ? r[`${p}.${c}`] = f : (r.props || (r.props = {}), r.props[`${p}.${c}`] = f);
303
- return r;
308
+ const i = { ...e }, o = e.kind, c = q[o] || /* @__PURE__ */ new Set();
309
+ e.props && (i.props = { ...e.props }), e.on && (i.on = { ...e.on });
310
+ for (const [l, u] of Object.entries(n))
311
+ for (const [p, g] of Object.entries(u))
312
+ p === "visible" ? this.applyVisibility(i, l, g) : S[p] ? this.applyStateEvent(i, l, p, g, a, s) : c.has(p) ? i[`${p}.${l}`] = g : (i.props || (i.props = {}), i.props[`${p}.${l}`] = g);
313
+ return i;
304
314
  }
305
315
  hasStateData(e) {
306
316
  return Object.keys(e.stateOverrides).length > 0;
@@ -316,127 +326,127 @@ class q {
316
326
  }
317
327
  }
318
328
  // ── State-suffixed event helpers ──
319
- applyStateEvent(e, t, a, s, n, r) {
320
- const i = D[a];
329
+ applyStateEvent(e, t, a, s, n, i) {
330
+ const o = S[a];
321
331
  if (e.on || (e.on = {}), typeof s == "function") {
322
- const l = M(s);
323
- if (l != null)
324
- e.on[`${i}.${t}`] = l;
332
+ const c = v(s);
333
+ if (c != null)
334
+ e.on[`${o}.${t}`] = c;
325
335
  else {
326
- const c = r.next();
327
- n.set(c, s), e.on[`${i}.${t}`] = c;
336
+ const l = i.next();
337
+ n.set(l, s), e.on[`${o}.${t}`] = l;
328
338
  }
329
- } else typeof s == "string" && (e.on[`${i}.${t}`] = s);
339
+ } else typeof s == "string" && (e.on[`${o}.${t}`] = s);
330
340
  }
331
341
  }
332
- const J = new q();
333
- function Q() {
334
- let o = 0;
335
- return { next: () => `event_${o++}` };
342
+ const Q = new J();
343
+ function Z() {
344
+ let r = 0;
345
+ return { next: () => `event_${r++}` };
336
346
  }
337
- class Z {
347
+ class ee {
338
348
  constructor(e, t, a, s, n) {
339
349
  this.resolver = e, this.merger = t, this.mapper = a, this.eventWiring = s, this.stateExpansion = n;
340
350
  }
341
351
  walkAndMap(e, t, a) {
342
- const s = /* @__PURE__ */ new Map(), n = Q(), r = { value: 0 }, i = /* @__PURE__ */ new Set();
352
+ const s = /* @__PURE__ */ new Map(), n = Z(), i = { value: 0 }, o = /* @__PURE__ */ new Set();
343
353
  return { widgets: this.walkItems(
344
354
  e,
345
355
  t,
346
356
  s,
347
357
  a,
348
358
  n,
349
- r,
350
- i
359
+ i,
360
+ o
351
361
  ), eventRegistry: s };
352
362
  }
353
- walkItems(e, t, a, s, n, r, i) {
354
- return e.flatMap((l) => {
355
- if (l.type !== "ITEMS")
363
+ walkItems(e, t, a, s, n, i, o) {
364
+ return e.flatMap((c) => {
365
+ if (c.type !== "ITEMS")
356
366
  throw new Error("Unexpected gui shortcut type");
357
- return l.items.map((c) => this.processItem(
358
- c,
359
- l.itemType,
360
- l.tags,
367
+ return c.items.map((l) => this.processItem(
368
+ l,
369
+ c.itemType,
370
+ c.tags,
361
371
  t,
362
372
  a,
363
373
  s,
364
374
  n,
365
- r,
366
- i
375
+ i,
376
+ o
367
377
  ));
368
378
  });
369
379
  }
370
- processItem(e, t, a, s, n, r, i, l, c) {
371
- const u = t, p = m(t), f = p.parseEntry(e), _ = this.buildBaseDef(f), w = this.buildDecoratorForMatching(_, u, a), h = this.resolver.resolve(w, s), v = h.leafSelectors.filter((d) => d.targetState != null), x = {
372
- leafSelectors: h.leafSelectors.filter((d) => d.targetState == null),
373
- sensibleDefaults: h.sensibleDefaults
380
+ processItem(e, t, a, s, n, i, o, c, l) {
381
+ const u = t, p = m(t), g = p.parseEntry(e), y = this.buildBaseDef(g), C = this.buildDecoratorForMatching(y, u, a), T = this.resolver.resolve(C, s), O = T.leafSelectors.filter((d) => d.targetState != null), M = {
382
+ leafSelectors: T.leafSelectors.filter((d) => d.targetState == null),
383
+ sensibleDefaults: T.sensibleDefaults
374
384
  };
375
- let y = this.merger.merge(_, u, x);
376
- p.afterMerge && (y = p.afterMerge(y, {
385
+ let _ = this.merger.merge(y, u, M);
386
+ p.afterMerge && (_ = p.afterMerge(_, {
377
387
  eventRegistry: n,
378
- formConfig: r,
379
- eventIdGenerator: i
380
- })), y = this.eventWiring.wireInputLayoutEvents(
381
- y,
388
+ formConfig: i,
389
+ eventIdGenerator: o
390
+ })), _ = this.eventWiring.wireInputLayoutEvents(
391
+ _,
382
392
  n,
383
- i
393
+ o
384
394
  );
385
- const { cleanedResult: T, stateData: S } = this.stateExpansion.extractFromMergeResult(
386
- y,
387
- v
395
+ const { cleanedResult: D, stateData: h } = this.stateExpansion.extractFromMergeResult(
396
+ _,
397
+ O
388
398
  );
389
- let g;
399
+ let f;
390
400
  if (p.buildCustomWidget) {
391
401
  const d = this.buildCustomWidgetContext(
392
- f.children,
402
+ g.children,
393
403
  s,
394
404
  n,
395
- r,
396
405
  i,
397
- l,
398
- c
406
+ o,
407
+ c,
408
+ l
399
409
  );
400
- g = this.buildCustomWidget(p, T, d);
410
+ f = this.buildCustomWidget(p, D, d);
401
411
  } else
402
- g = this.mapper.mapToWidget(T, u);
403
- if (typeof g != "function") {
404
- const d = g;
405
- d.uid || (d.path && !c.has(d.path) ? (d.uid = d.path, c.add(d.path)) : d.uid = `dx_${l.value++}`);
412
+ f = this.mapper.mapToWidget(D, u);
413
+ if (typeof f != "function") {
414
+ const d = f;
415
+ d.uid || (d.path && !l.has(d.path) ? (d.uid = d.path, l.add(d.path)) : d.uid = `dx_${c.value++}`);
406
416
  }
407
- if (this.stateExpansion.hasStateData(S))
408
- if (typeof g == "function") {
409
- const d = g;
410
- g = ((C) => {
411
- const k = d(C);
417
+ if (this.stateExpansion.hasStateData(h))
418
+ if (typeof f == "function") {
419
+ const d = f;
420
+ f = ((P) => {
421
+ const w = d(P);
412
422
  return this.stateExpansion.applyToWidget(
413
- k,
414
- S,
423
+ w,
424
+ h,
415
425
  n,
416
- i
426
+ o
417
427
  );
418
428
  });
419
429
  } else
420
- g = this.stateExpansion.applyToWidget(
421
- g,
422
- S,
430
+ f = this.stateExpansion.applyToWidget(
431
+ f,
432
+ h,
423
433
  n,
424
- i
434
+ o
425
435
  );
426
- return g;
436
+ return f;
427
437
  }
428
- buildCustomWidgetContext(e, t, a, s, n, r, i) {
438
+ buildCustomWidgetContext(e, t, a, s, n, i, o) {
429
439
  return {
430
440
  children: e,
431
- mapStaticDef: (l, c) => this.mapper.mapStaticDef(l, c),
432
- walkChildren: (l) => this.walkItems(
433
- l,
441
+ mapStaticDef: (c, l) => this.mapper.mapStaticDef(c, l),
442
+ walkChildren: (c) => this.walkItems(
443
+ c,
434
444
  t,
435
445
  a,
436
446
  s,
437
447
  n,
438
- r,
439
- i
448
+ i,
449
+ o
440
450
  )
441
451
  };
442
452
  }
@@ -450,32 +460,32 @@ class Z {
450
460
  buildBaseDef(e) {
451
461
  const t = e.baseDef;
452
462
  return typeof t == "function" ? (a) => {
453
- const n = t(a ?? {});
463
+ const s = x(a), n = t(s);
454
464
  return e.path != null ? { ...n, path: e.path } : n;
455
465
  } : e.path != null ? { ...t, path: e.path } : t;
456
466
  }
457
467
  buildDecoratorForMatching(e, t, a) {
458
468
  if (typeof e == "function")
459
469
  return { itemType: t, tags: [...a] };
460
- const s = [...a, ..."tags" in e && e.tags ? e.tags : []], n = "uid" in e ? e.uid : void 0, r = "type" in e ? e.type : void 0;
461
- return { itemType: t, tags: s, uid: n, type: r };
470
+ const s = [...a, ..."tags" in e && e.tags ? e.tags : []], n = "uid" in e ? e.uid : void 0, i = "type" in e ? e.type : void 0;
471
+ return { itemType: t, tags: s, uid: n, type: i };
462
472
  }
463
473
  }
464
- class ee {
474
+ class te {
465
475
  constructor(e, t) {
466
476
  this.selectorNormalizer = e, this.walker = t;
467
477
  }
468
478
  processDxFacade(e, t = [], a) {
469
- const { defs: s, gslSelectors: n, formConfig: r } = this.prepareForm(
479
+ const { defs: s, gslSelectors: n, formConfig: i } = this.prepareForm(
470
480
  e,
471
481
  t,
472
482
  a
473
- ), { widgets: i, eventRegistry: l } = this.walker.walkAndMap(
483
+ ), { widgets: o, eventRegistry: c } = this.walker.walkAndMap(
474
484
  s,
475
485
  n,
476
- r
477
- ), c = i[0];
478
- return this.buildResult({ form: c }, l, r);
486
+ i
487
+ ), l = o[0];
488
+ return this.buildResult({ form: l }, c, i);
479
489
  }
480
490
  /**
481
491
  * Normalizes raw form definitions and applies form-level defaults.
@@ -489,23 +499,23 @@ class ee {
489
499
  */
490
500
  prepareForm(e, t, a) {
491
501
  const n = (Array.isArray(e) ? [...e] : [e]).map(
492
- (l) => typeof l == "function" ? B(l) : l
493
- ), r = this.selectorNormalizer.normalizeSelectors(t), i = {
502
+ (c) => typeof c == "function" ? B(c) : c
503
+ ), i = this.selectorNormalizer.normalizeSelectors(t), o = {
494
504
  ...this.selectorNormalizer.extractFormConfig(),
495
505
  ...a
496
506
  };
497
- if (!i.suppressAutomaticStack) {
498
- const l = {
507
+ if (!o.suppressAutomaticStack) {
508
+ const c = {
499
509
  def: { uid: "#root", direction: "column", widgetName: "flex" },
500
510
  children: n
501
511
  };
502
512
  return {
503
- defs: [{ type: "ITEMS", itemType: j.LAYOUTS, items: [l], tags: [] }],
504
- gslSelectors: r,
505
- formConfig: i
513
+ defs: [{ type: "ITEMS", itemType: N.LAYOUTS, items: [c], tags: [] }],
514
+ gslSelectors: i,
515
+ formConfig: o
506
516
  };
507
517
  }
508
- return { defs: n, gslSelectors: r, formConfig: i };
518
+ return { defs: n, gslSelectors: i, formConfig: o };
509
519
  }
510
520
  /**
511
521
  * Converts DX `$`-separated state names to core's `:`-separated names.
@@ -524,80 +534,81 @@ class ee {
524
534
  });
525
535
  const s = { form: e };
526
536
  return t.size > 0 && (s.events = (n) => {
527
- const r = t.get(n.name);
528
- if (r) {
529
- const i = (c) => {
530
- if (c && typeof c == "object" && "path" in c && !("type" in c)) {
531
- const { path: u, ...p } = c;
532
- for (const [f, _] of Object.entries(p))
537
+ const i = t.get(n.name);
538
+ if (i) {
539
+ const o = (l) => {
540
+ if (l && typeof l == "object" && "path" in l && !("type" in l)) {
541
+ const { path: u, ...p } = l;
542
+ for (const [g, y] of Object.entries(p))
533
543
  n.callback({
534
544
  type: "OVERRIDE_WIDGET_PROP",
535
- payload: { path: u, prop: f, value: _ }
545
+ payload: { path: u, prop: g, value: y }
536
546
  });
537
547
  } else
538
- n.callback(c);
539
- }, l = {
548
+ n.callback(l);
549
+ }, c = {
540
550
  ...n,
541
- callback: i,
542
- update: i
551
+ callback: o,
552
+ update: o
543
553
  };
544
- r(l);
554
+ i(c);
545
555
  }
546
- }), a.dependencies && (s.dependencies = a.dependencies), a.widgetLoaders && (s.widgetLoaders = a.widgetLoaders), a.validateOn && (s.validateOn = a.validateOn), a.itemRenderers && (s.itemRenderers = a.itemRenderers), s;
556
+ }), a.dependencies && (s.dependencies = a.dependencies), a.functions && (s.functions = a.functions), a.widgetLoaders && (s.widgetLoaders = a.widgetLoaders), a.validateOn && (s.validateOn = a.validateOn), a.itemRenderers && (s.itemRenderers = a.itemRenderers), s;
547
557
  }
548
558
  }
549
- const te = new Z(
550
- F,
559
+ const se = new ee(
560
+ W,
551
561
  $,
552
- Y,
553
- L,
554
- J
555
- ), se = new ee(H, te);
556
- function R(o) {
557
- return typeof o == "function" ? !0 : Array.isArray(o) ? o.length === 0 || o.every(A) : A(o);
562
+ V,
563
+ j,
564
+ Q
565
+ ), ae = new te(X, se);
566
+ function k(r) {
567
+ return typeof r == "function" ? !0 : Array.isArray(r) ? r.length === 0 || r.every(I) : I(r);
558
568
  }
559
- function A(o) {
560
- if (typeof o == "function") return !0;
561
- if (o === null || typeof o != "object") return !1;
562
- const e = o;
569
+ function I(r) {
570
+ if (typeof r == "function") return !0;
571
+ if (r === null || typeof r != "object") return !1;
572
+ const e = r;
563
573
  return e.type === "ITEMS" && typeof e.itemType == "string";
564
574
  }
565
- function ae(o) {
566
- if (!o || typeof o != "object" || Array.isArray(o))
575
+ function ne(r) {
576
+ if (!r || typeof r != "object" || Array.isArray(r))
567
577
  return;
568
- const e = o.form;
569
- if (R(e))
578
+ const e = r.form;
579
+ if (k(e))
570
580
  throw new Error(
571
581
  "[GolemUI] The gui.* form definition was wrapped in an extra `{ form: ... }` object, so its fields were never resolved. Pass the gui.* array DIRECTLY as formDef (`config={{ formDef: form }}`) and put any named `states` in `formConfig`: `config={{ formDef: form, formConfig: { states } }}`. Do NOT wrap them as a `{ form: [...] }` object."
572
582
  );
573
583
  }
574
- const O = Object.freeze({}), ne = Object.freeze({}), U = /* @__PURE__ */ new WeakMap();
575
- function b(o, e) {
576
- return o == null ? e : typeof o == "object" ? o : {};
584
+ const E = Object.freeze({}), ie = Object.freeze({}), R = /* @__PURE__ */ new WeakMap();
585
+ function b(r, e) {
586
+ return r == null ? e : typeof r == "object" ? r : {};
577
587
  }
578
- function pe(o, e, t) {
579
- if (!R(o))
580
- return ae(o), { formDef: o };
581
- const a = b(o, O), s = b(e, O), n = b(t, ne);
582
- let r = U.get(a);
583
- r || (r = /* @__PURE__ */ new WeakMap(), U.set(a, r));
584
- let i = r.get(s);
585
- i || (i = /* @__PURE__ */ new WeakMap(), r.set(s, i));
586
- const l = i.get(n);
587
- if (l) return l;
588
- const c = se.processDxFacade(
589
- o,
588
+ function de(r, e, t) {
589
+ if (!k(r))
590
+ return ne(r), { formDef: r };
591
+ const a = b(r, E), s = b(e, E), n = b(t, ie);
592
+ let i = R.get(a);
593
+ i || (i = /* @__PURE__ */ new WeakMap(), R.set(a, i));
594
+ let o = i.get(s);
595
+ o || (o = /* @__PURE__ */ new WeakMap(), i.set(s, o));
596
+ const c = o.get(n);
597
+ if (c) return c;
598
+ const l = ae.processDxFacade(
599
+ r,
590
600
  e,
591
601
  t
592
602
  ), u = {
593
- formDef: c.form,
594
- formEvent: c.events,
595
- dependencies: c.dependencies,
596
- widgetLoaders: c.widgetLoaders,
597
- validateOn: c.validateOn,
598
- itemRenderers: c.itemRenderers
603
+ formDef: l.form,
604
+ formEvent: l.events,
605
+ dependencies: l.dependencies,
606
+ functions: l.functions,
607
+ widgetLoaders: l.widgetLoaders,
608
+ validateOn: l.validateOn,
609
+ itemRenderers: l.itemRenderers
599
610
  };
600
- return i.set(n, u), u;
611
+ return o.set(n, u), u;
601
612
  }
602
613
  class re {
603
614
  create(e) {
@@ -612,129 +623,159 @@ class re {
612
623
  };
613
624
  }
614
625
  }
615
- function de() {
626
+ function ge() {
616
627
  return new re();
617
628
  }
618
- const fe = (o) => o !== null && typeof o == "object" && Object.prototype.hasOwnProperty.call(o, "label") && Object.prototype.hasOwnProperty.call(o, "value");
619
- function ge(o, e) {
620
- if (o != null && typeof o == "object" && "__rid" in o)
621
- return o.__rid;
629
+ const fe = (r) => r !== null && typeof r == "object" && Object.prototype.hasOwnProperty.call(r, "label") && Object.prototype.hasOwnProperty.call(r, "value");
630
+ function _e(r, e) {
631
+ if (r != null && typeof r == "object" && "__rid" in r)
632
+ return r.__rid;
622
633
  const t = e();
623
- return Object.defineProperty(o, "__rid", {
634
+ return Object.defineProperty(r, "__rid", {
624
635
  value: t,
625
636
  enumerable: !1,
626
637
  configurable: !1
627
638
  }), t;
628
639
  }
629
640
  export {
630
- me as _gslAccordionByUid,
641
+ Te as _gslAccordionByUid,
631
642
  he as _gslAccordions,
632
- Se as _gslActionByUid,
633
- be as _gslActions,
634
- Te as _gslAlertByUid,
635
- De as _gslAlerts,
636
- Ae as _gslBooleanInputs,
637
- Oe as _gslCalendarByUid,
638
- Ue as _gslCalendars,
639
- Ie as _gslCheckboxByUid,
640
- Ee as _gslCheckboxes,
641
- Re as _gslCurrencies,
642
- we as _gslCurrencyByUid,
643
- ve as _gslCustomActionByUid,
644
- xe as _gslCustomActions,
645
- Ce as _gslCustomDisplayByUid,
646
- ke as _gslCustomDisplays,
647
- Me as _gslCustomInputByUid,
643
+ be as _gslActionByUid,
644
+ De as _gslActions,
645
+ Se as _gslAlertByUid,
646
+ Ie as _gslAlerts,
647
+ Ee as _gslBooleanInputs,
648
+ Re as _gslCalendarByUid,
649
+ Ae as _gslCalendars,
650
+ Ue as _gslCheckboxByUid,
651
+ ke as _gslCheckboxes,
652
+ Ce as _gslCurrencies,
653
+ Oe as _gslCurrencyByUid,
654
+ Me as _gslCustomActionByUid,
655
+ Pe as _gslCustomActions,
656
+ we as _gslCustomDisplayByUid,
657
+ ve as _gslCustomDisplays,
658
+ xe as _gslCustomInputByUid,
648
659
  Be as _gslCustomInputs,
649
- je as _gslCustomLayoutByUid,
650
- Le as _gslCustomLayouts,
651
- Pe as _gslDateInputByUid,
652
- Ne as _gslDateInputs,
653
- Fe as _gslDatePickerByUid,
654
- We as _gslDatePickers,
655
- ze as _gslDisplayByUid,
656
- Ge as _gslDisplays,
657
- $e as _gslDropdownByUid,
658
- Ke as _gslDropdowns,
659
- Ye as _gslInputByUid,
660
- Ve as _gslInputs,
661
- He as _gslLayoutByUid,
662
- Xe as _gslLayouts,
663
- qe as _gslListByUid,
664
- Je as _gslLists,
665
- Qe as _gslMarkdownByUid,
666
- Ze as _gslMarkdownTextByUid,
667
- et as _gslMarkdownTexts,
668
- tt as _gslMarkdowns,
669
- st as _gslNumberInputs,
670
- at as _gslPasswordByUid,
671
- nt as _gslPasswords,
672
- rt as _gslRadiogroupByUid,
673
- ot as _gslRadiogroups,
674
- it as _gslRangeCalendarByUid,
675
- lt as _gslRangeCalendars,
676
- ct as _gslRangeDateInputByUid,
677
- ut as _gslRangeDateInputs,
678
- pt as _gslRangeDatePickerByUid,
679
- dt as _gslRangeDatePickers,
680
- ft as _gslRepeaterByUid,
681
- gt as _gslRepeaters,
682
- yt as _gslSelectByUid,
683
- _t as _gslSelects,
684
- ce as _gslStates,
685
- mt as _gslTabs,
686
- ht as _gslTabsByUid,
687
- ue as _gslTag,
688
- St as _gslTags,
689
- bt as _gslTagsByUid,
690
- Tt as _gslTextInputs,
691
- Dt as _gslTextareaByUid,
692
- At as _gslTextareas,
693
- Ot as _guiAccordion,
694
- Ut as _guiAlert,
695
- It as _guiBooleanInput,
696
- Et as _guiButton,
697
- Rt as _guiCalendar,
698
- wt as _guiCheckbox,
699
- vt as _guiCurrency,
700
- xt as _guiCustomAction,
701
- Ct as _guiCustomDisplay,
702
- kt as _guiCustomInput,
703
- Mt as _guiCustomLayout,
704
- Bt as _guiDateInput,
705
- jt as _guiDatePicker,
660
+ Ne as _gslCustomLayoutByUid,
661
+ je as _gslCustomLayouts,
662
+ Le as _gslDateInputByUid,
663
+ Fe as _gslDateInputs,
664
+ We as _gslDatePickerByUid,
665
+ ze as _gslDatePickers,
666
+ Ge as _gslDateTimeCalendarByUid,
667
+ Ke as _gslDateTimeCalendars,
668
+ $e as _gslDateTimeInputByUid,
669
+ Ye as _gslDateTimeInputs,
670
+ Ve as _gslDateTimePickerByUid,
671
+ He as _gslDateTimePickers,
672
+ Xe as _gslDisplayByUid,
673
+ qe as _gslDisplays,
674
+ Je as _gslDropdownByUid,
675
+ Qe as _gslDropdowns,
676
+ Ze as _gslInputByUid,
677
+ et as _gslInputs,
678
+ tt as _gslLayoutByUid,
679
+ st as _gslLayouts,
680
+ at as _gslListByUid,
681
+ nt as _gslLists,
682
+ it as _gslMarkdownByUid,
683
+ rt as _gslMarkdownTextByUid,
684
+ ot as _gslMarkdownTexts,
685
+ lt as _gslMarkdowns,
686
+ ct as _gslNumberInputs,
687
+ ut as _gslPasswordByUid,
688
+ pt as _gslPasswords,
689
+ dt as _gslRadiogroupByUid,
690
+ gt as _gslRadiogroups,
691
+ ft as _gslRangeCalendarByUid,
692
+ _t as _gslRangeCalendars,
693
+ yt as _gslRangeDateInputByUid,
694
+ mt as _gslRangeDateInputs,
695
+ Tt as _gslRangeDatePickerByUid,
696
+ ht as _gslRangeDatePickers,
697
+ bt as _gslRangeDateTimeCalendarByUid,
698
+ Dt as _gslRangeDateTimeCalendars,
699
+ St as _gslRangeDateTimeInputByUid,
700
+ It as _gslRangeDateTimeInputs,
701
+ Et as _gslRangeDateTimePickerByUid,
702
+ Rt as _gslRangeDateTimePickers,
703
+ At as _gslRangeTimeInputByUid,
704
+ Ut as _gslRangeTimeInputs,
705
+ kt as _gslRangeTimePickerByUid,
706
+ Ct as _gslRangeTimePickers,
707
+ Ot as _gslRepeaterByUid,
708
+ Mt as _gslRepeaters,
709
+ Pt as _gslSelectByUid,
710
+ wt as _gslSelects,
711
+ ue as _gslStates,
712
+ vt as _gslTabs,
713
+ xt as _gslTabsByUid,
714
+ pe as _gslTag,
715
+ Bt as _gslTags,
716
+ Nt as _gslTagsByUid,
717
+ jt as _gslTextInputs,
718
+ Lt as _gslTextareaByUid,
719
+ Ft as _gslTextareas,
720
+ Wt as _gslTimeInputByUid,
721
+ zt as _gslTimeInputs,
722
+ Gt as _gslTimePickerByUid,
723
+ Kt as _gslTimePickers,
724
+ $t as _guiAccordion,
725
+ Yt as _guiAlert,
726
+ Vt as _guiBooleanInput,
727
+ Ht as _guiButton,
728
+ Xt as _guiCalendar,
729
+ qt as _guiCheckbox,
730
+ Jt as _guiCurrency,
731
+ Qt as _guiCustomAction,
732
+ Zt as _guiCustomDisplay,
733
+ es as _guiCustomInput,
734
+ ts as _guiCustomLayout,
735
+ ss as _guiDateInput,
736
+ as as _guiDatePicker,
737
+ ns as _guiDateTimeCalendar,
738
+ is as _guiDateTimeInput,
739
+ rs as _guiDateTimePicker,
706
740
  B as _guiDisplay,
707
- Lt as _guiDropdown,
708
- Pt as _guiFlex,
709
- Nt as _guiGrid,
710
- Ft as _guiHorizontalFlex,
711
- Wt as _guiHorizontalGrid,
712
- zt as _guiList,
713
- Gt as _guiMarkdown,
714
- $t as _guiMarkdownText,
715
- Kt as _guiNumberInput,
716
- Yt as _guiPassword,
717
- Vt as _guiRadiogroup,
718
- Ht as _guiRangeCalendar,
719
- Xt as _guiRangeDateInput,
720
- qt as _guiRangeDatePicker,
721
- Jt as _guiRepeater,
722
- Qt as _guiSelect,
723
- Zt as _guiTabs,
724
- es as _guiTags,
725
- ts as _guiTextInput,
726
- ss as _guiTextarea,
727
- as as _guiVerticalFlex,
728
- ns as _guiVerticalGrid,
729
- rs as createGslSelector,
730
- os as defineShortcutType,
731
- is as extractWidgetProps,
732
- se as formDefs,
733
- ge as getItemKey,
734
- de as golemForm,
735
- R as isDxDefinitions,
741
+ os as _guiDropdown,
742
+ ls as _guiFlex,
743
+ cs as _guiGrid,
744
+ us as _guiHorizontalFlex,
745
+ ps as _guiHorizontalGrid,
746
+ ds as _guiList,
747
+ gs as _guiMarkdown,
748
+ fs as _guiMarkdownText,
749
+ _s as _guiNumberInput,
750
+ ys as _guiPassword,
751
+ ms as _guiRadiogroup,
752
+ Ts as _guiRangeCalendar,
753
+ hs as _guiRangeDateInput,
754
+ bs as _guiRangeDatePicker,
755
+ Ds as _guiRangeDateTimeCalendar,
756
+ Ss as _guiRangeDateTimeInput,
757
+ Is as _guiRangeDateTimePicker,
758
+ Es as _guiRangeTimeInput,
759
+ Rs as _guiRangeTimePicker,
760
+ As as _guiRepeater,
761
+ Us as _guiSelect,
762
+ ks as _guiTabs,
763
+ Cs as _guiTags,
764
+ Os as _guiTextInput,
765
+ Ms as _guiTextarea,
766
+ Ps as _guiTimeInput,
767
+ ws as _guiTimePicker,
768
+ vs as _guiVerticalFlex,
769
+ xs as _guiVerticalGrid,
770
+ Bs as createGslSelector,
771
+ Ns as defineShortcutType,
772
+ js as extractWidgetProps,
773
+ ae as formDefs,
774
+ _e as getItemKey,
775
+ ge as golemForm,
776
+ k as isDxDefinitions,
736
777
  fe as isOption,
737
- ls as processAutoLabel,
738
- cs as processAutoPlaceholder,
739
- pe as resolveFormInput
778
+ Ls as processAutoLabel,
779
+ Fs as processAutoPlaceholder,
780
+ de as resolveFormInput
740
781
  };