@golemui/gui-shared 1.0.3 → 1.1.1-rc.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 (53) hide show
  1. package/CHANGELOG.md +25 -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 +339 -298
  7. package/internals.umd.cjs +1 -1
  8. package/lib/dx/core/defineShortcutType.d.ts +2 -1
  9. package/lib/dx/core/dx.domain.d.ts +6 -1
  10. package/lib/dx/core/itemTypeRegistry.d.ts +13 -1
  11. package/lib/dx/formDef.domain.d.ts +2 -1
  12. package/lib/dx/gui.d.ts +20 -0
  13. package/lib/dx/index.d.ts +30 -0
  14. package/lib/dx/resolveFormInput.d.ts +9 -1
  15. package/lib/dx/shortcuts/date-time-calendar/dateTimeCalendar.domain.d.ts +22 -0
  16. package/lib/dx/shortcuts/date-time-calendar/dateTimeCalendarSensibleDefaults.service.d.ts +6 -0
  17. package/lib/dx/shortcuts/date-time-calendar/guiDateTimeCalendar.impl.d.ts +6 -0
  18. package/lib/dx/shortcuts/date-time-calendar/register.d.ts +2 -0
  19. package/lib/dx/shortcuts/date-time-input/dateTimeInput.domain.d.ts +17 -0
  20. package/lib/dx/shortcuts/date-time-input/guiDateTimeInput.impl.d.ts +6 -0
  21. package/lib/dx/shortcuts/date-time-input/register.d.ts +2 -0
  22. package/lib/dx/shortcuts/date-time-picker/dateTimePicker.domain.d.ts +18 -0
  23. package/lib/dx/shortcuts/date-time-picker/guiDateTimePicker.impl.d.ts +7 -0
  24. package/lib/dx/shortcuts/date-time-picker/register.d.ts +2 -0
  25. package/lib/dx/shortcuts/range-date-time-calendar/guiRangeDateTimeCalendar.impl.d.ts +6 -0
  26. package/lib/dx/shortcuts/range-date-time-calendar/rangeDateTimeCalendar.domain.d.ts +17 -0
  27. package/lib/dx/shortcuts/range-date-time-calendar/register.d.ts +2 -0
  28. package/lib/dx/shortcuts/range-date-time-input/guiRangeDateTimeInput.impl.d.ts +6 -0
  29. package/lib/dx/shortcuts/range-date-time-input/rangeDateTimeInput.domain.d.ts +17 -0
  30. package/lib/dx/shortcuts/range-date-time-input/register.d.ts +2 -0
  31. package/lib/dx/shortcuts/range-date-time-picker/guiRangeDateTimePicker.impl.d.ts +6 -0
  32. package/lib/dx/shortcuts/range-date-time-picker/rangeDateTimePicker.domain.d.ts +17 -0
  33. package/lib/dx/shortcuts/range-date-time-picker/register.d.ts +2 -0
  34. package/lib/dx/shortcuts/range-time-input/guiRangeTimeInput.impl.d.ts +6 -0
  35. package/lib/dx/shortcuts/range-time-input/rangeTimeInput.domain.d.ts +17 -0
  36. package/lib/dx/shortcuts/range-time-input/register.d.ts +2 -0
  37. package/lib/dx/shortcuts/range-time-picker/guiRangeTimePicker.impl.d.ts +6 -0
  38. package/lib/dx/shortcuts/range-time-picker/rangeTimePicker.domain.d.ts +17 -0
  39. package/lib/dx/shortcuts/range-time-picker/register.d.ts +2 -0
  40. package/lib/dx/shortcuts/scopes/scopeChain.d.ts +30 -0
  41. package/lib/dx/shortcuts/time-input/guiTimeInput.impl.d.ts +6 -0
  42. package/lib/dx/shortcuts/time-input/register.d.ts +2 -0
  43. package/lib/dx/shortcuts/time-input/timeInput.domain.d.ts +17 -0
  44. package/lib/dx/shortcuts/time-picker/guiTimePicker.impl.d.ts +7 -0
  45. package/lib/dx/shortcuts/time-picker/register.d.ts +2 -0
  46. package/lib/dx/shortcuts/time-picker/timePicker.domain.d.ts +18 -0
  47. package/lib/golem-form.d.ts +32 -2
  48. package/lib/widget.props.d.ts +246 -26
  49. package/lib/widgets.d.ts +2 -2
  50. package/package.json +3 -3
  51. package/register-B3CJMfX9.cjs +1 -0
  52. package/{register-BaJnbpMX.js → register-De8Y1vW5.js} +805 -424
  53. package/register-BHpCnzXI.cjs +0 -1
package/internals.js CHANGED
@@ -1,21 +1,21 @@
1
- import { aF as I, aG as m, aH as M, aI as B, ah as j, aJ as L, aK as F } from "./register-BaJnbpMX.js";
2
- import { X as he, W as Se, L as be, K as Te, R as De, Q as Ae, d as Oe, x as Ue, w as Ie, l as Ee, k as Re, q as we, r as ve, a0 as xe, $ as Ce, a2 as ke, a1 as Me, Z as Be, Y as je, a4 as Le, a3 as Fe, z as Ne, y as Pe, B as We, A as ze, P as Ge, O as $e, h as Ke, g as Ye, a as Ve, _ as He, N as Xe, M as qe, v as Je, u as Qe, t as Ze, T as et, S as tt, s as st, c as at, p as nt, o as rt, j as ot, i as it, D as lt, C as ct, F as ut, E as pt, H as dt, G as ft, J as gt, I as yt, f as _t, e as mt, U as ht, V as St, aL as bt, aM as Tt, b as Dt, n as At, m as Ot, a6 as Ut, ag as It, aC as Et, aj as Rt, as as wt, ay as vt, av as xt, ai as Ct, ae as kt, ak as Mt, a5 as Bt, ar as jt, aq as Lt, aA as Ft, ad as Nt, aa as Pt, ac as Wt, a9 as zt, at as Gt, au as $t, af as Kt, aD as Yt, aw as Vt, az as Ht, ap as Xt, ao as qt, an as Jt, am as Qt, aB as Zt, a7 as es, al as ts, aE as ss, ax as as, ab as ns, a8 as rs, aN as os, aO as is, aP as ls, aQ as cs, aR as us } from "./register-BaJnbpMX.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-De8Y1vW5.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-De8Y1vW5.js";
3
3
  import "@golemui/core";
4
4
  import "@golemui/gui-validators";
5
- function ue(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 pe(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 N(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 P {
58
+ class F {
49
59
  resolve(e, t) {
50
60
  const a = [];
51
61
  for (const n of t)
@@ -62,27 +72,27 @@ class P {
62
72
  this.collectFromLeaf(s, t, a);
63
73
  }
64
74
  collectFromLeaf(e, t, a) {
65
- N(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 W = new P();
95
+ const W = new F();
86
96
  class z {
87
97
  /**
88
98
  * Deep merges two objects, with right taking precedence over left when properties conflict.
@@ -103,21 +113,21 @@ class z {
103
113
  }
104
114
  }
105
115
  const G = new z();
106
- class $ {
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 $ {
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 $ {
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,7 +194,7 @@ class $ {
184
194
  };
185
195
  }
186
196
  }
187
- const K = new $(G);
197
+ const $ = new K(G);
188
198
  class Y {
189
199
  mapToWidget(e, t) {
190
200
  if (e.kind === "dynamic") {
@@ -239,7 +249,7 @@ const X = new H(), q = {
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",
@@ -254,34 +264,34 @@ class J {
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 J {
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 = q[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 J {
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
342
  const Q = new J();
333
343
  function Z() {
334
- let o = 0;
335
- return { next: () => `event_${o++}` };
344
+ let r = 0;
345
+ return { next: () => `event_${r++}` };
336
346
  }
337
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 = Z(), 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,15 +460,15 @@ class ee {
450
460
  buildBaseDef(e) {
451
461
  const t = e.baseDef;
452
462
  return typeof t == "function" ? (a) => {
453
- const s = B(a), n = t(s);
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
474
  class te {
@@ -466,16 +476,16 @@ class te {
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 te {
489
499
  */
490
500
  prepareForm(e, t, a) {
491
501
  const n = (Array.isArray(e) ? [...e] : [e]).map(
492
- (l) => typeof l == "function" ? j(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: L.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,82 +534,83 @@ class te {
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
559
  const se = new ee(
550
560
  W,
551
- K,
561
+ $,
552
562
  V,
553
- F,
563
+ j,
554
564
  Q
555
565
  ), ae = new te(X, se);
556
- function R(o) {
557
- return typeof o == "function" ? !0 : Array.isArray(o) ? o.length === 0 || o.every(A) : A(o);
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 ne(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({}), re = 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 de(o, e, t) {
579
- if (!R(o))
580
- return ne(o), { formDef: o };
581
- const a = b(o, O), s = b(e, O), n = b(t, re);
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 = ae.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
- class oe {
613
+ class re {
603
614
  create(e) {
604
615
  return {
605
616
  states: e.states,
@@ -612,129 +623,159 @@ class oe {
612
623
  };
613
624
  }
614
625
  }
615
- function fe() {
616
- return new oe();
626
+ function ge() {
627
+ return new re();
617
628
  }
618
- const ge = (o) => o !== null && typeof o == "object" && Object.prototype.hasOwnProperty.call(o, "label") && Object.prototype.hasOwnProperty.call(o, "value");
619
- function ye(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
- he as _gslAccordionByUid,
631
- Se as _gslAccordions,
641
+ Te as _gslAccordionByUid,
642
+ he as _gslAccordions,
632
643
  be as _gslActionByUid,
633
- Te as _gslActions,
634
- De as _gslAlertByUid,
635
- Ae as _gslAlerts,
636
- Oe as _gslBooleanInputs,
637
- Ue as _gslCalendarByUid,
638
- Ie as _gslCalendars,
639
- Ee as _gslCheckboxByUid,
640
- Re as _gslCheckboxes,
641
- we as _gslCurrencies,
642
- ve as _gslCurrencyByUid,
643
- xe as _gslCustomActionByUid,
644
- Ce as _gslCustomActions,
645
- ke as _gslCustomDisplayByUid,
646
- Me as _gslCustomDisplays,
647
- Be as _gslCustomInputByUid,
648
- je as _gslCustomInputs,
649
- Le as _gslCustomLayoutByUid,
650
- Fe as _gslCustomLayouts,
651
- Ne as _gslDateInputByUid,
652
- Pe as _gslDateInputs,
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,
659
+ Be as _gslCustomInputs,
660
+ Ne as _gslCustomLayoutByUid,
661
+ je as _gslCustomLayouts,
662
+ Le as _gslDateInputByUid,
663
+ Fe as _gslDateInputs,
653
664
  We as _gslDatePickerByUid,
654
665
  ze as _gslDatePickers,
655
- Ge as _gslDisplayByUid,
656
- $e as _gslDisplays,
657
- Ke as _gslDropdownByUid,
658
- Ye as _gslDropdowns,
659
- Ve as _gslInputByUid,
660
- He as _gslInputs,
661
- Xe as _gslLayoutByUid,
662
- qe as _gslLayouts,
663
- Je as _gslListByUid,
664
- Qe as _gslLists,
665
- Ze as _gslMarkdownByUid,
666
- et as _gslMarkdownTextByUid,
667
- tt as _gslMarkdownTexts,
668
- st as _gslMarkdowns,
669
- at as _gslNumberInputs,
670
- nt as _gslPasswordByUid,
671
- rt as _gslPasswords,
672
- ot as _gslRadiogroupByUid,
673
- it as _gslRadiogroups,
674
- lt as _gslRangeCalendarByUid,
675
- ct as _gslRangeCalendars,
676
- ut as _gslRangeDateInputByUid,
677
- pt as _gslRangeDateInputs,
678
- dt as _gslRangeDatePickerByUid,
679
- ft as _gslRangeDatePickers,
680
- gt as _gslRepeaterByUid,
681
- yt as _gslRepeaters,
682
- _t as _gslSelectByUid,
683
- mt as _gslSelects,
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,
684
711
  ue as _gslStates,
685
- ht as _gslTabs,
686
- St as _gslTabsByUid,
712
+ vt as _gslTabs,
713
+ xt as _gslTabsByUid,
687
714
  pe as _gslTag,
688
- bt as _gslTags,
689
- Tt as _gslTagsByUid,
690
- Dt as _gslTextInputs,
691
- At as _gslTextareaByUid,
692
- Ot as _gslTextareas,
693
- Ut as _guiAccordion,
694
- It as _guiAlert,
695
- Et as _guiBooleanInput,
696
- Rt as _guiButton,
697
- wt as _guiCalendar,
698
- vt as _guiCheckbox,
699
- xt as _guiCurrency,
700
- Ct as _guiCustomAction,
701
- kt as _guiCustomDisplay,
702
- Mt as _guiCustomInput,
703
- Bt as _guiCustomLayout,
704
- jt as _guiDateInput,
705
- Lt as _guiDatePicker,
706
- j as _guiDisplay,
707
- Ft as _guiDropdown,
708
- Nt as _guiFlex,
709
- Pt as _guiGrid,
710
- Wt as _guiHorizontalFlex,
711
- zt as _guiHorizontalGrid,
712
- Gt as _guiList,
713
- $t as _guiMarkdown,
714
- Kt as _guiMarkdownText,
715
- Yt as _guiNumberInput,
716
- Vt as _guiPassword,
717
- Ht as _guiRadiogroup,
718
- Xt as _guiRangeCalendar,
719
- qt as _guiRangeDateInput,
720
- Jt as _guiRangeDatePicker,
721
- Qt as _guiRepeater,
722
- Zt as _guiSelect,
723
- es as _guiTabs,
724
- ts as _guiTags,
725
- ss as _guiTextInput,
726
- as as _guiTextarea,
727
- ns as _guiVerticalFlex,
728
- rs as _guiVerticalGrid,
729
- os as createGslSelector,
730
- is as defineShortcutType,
731
- ls as extractWidgetProps,
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,
740
+ B as _guiDisplay,
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,
732
773
  ae as formDefs,
733
- ye as getItemKey,
734
- fe as golemForm,
735
- R as isDxDefinitions,
736
- ge as isOption,
737
- cs as processAutoLabel,
738
- us as processAutoPlaceholder,
774
+ _e as getItemKey,
775
+ ge as golemForm,
776
+ k as isDxDefinitions,
777
+ fe as isOption,
778
+ Ls as processAutoLabel,
779
+ Fs as processAutoPlaceholder,
739
780
  de as resolveFormInput
740
781
  };