@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/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ ## 1.1.0 (2026-07-21)
2
+
3
+ ### 🚀 Features
4
+
5
+ - `$fn` host functions for reactive expressions ([#227](https://github.com/golemui/golemui/pull/227))
6
+ - range time and range date time inputs ([#225](https://github.com/golemui/golemui/pull/225))
7
+ - add time and date-time inputs and input error localizable messages ([#220](https://github.com/golemui/golemui/pull/220))
8
+ - add date time input ([#218](https://github.com/golemui/golemui/pull/218))
9
+ - add time input ([#217](https://github.com/golemui/golemui/pull/217))
10
+
11
+ ### ❤️ Thank You
12
+
13
+ - Mud Scientist @mudscientist
14
+ - Raúl Jiménez @Elecash
15
+
16
+ ## 1.0.3 (2026-07-02)
17
+
18
+ ### 🩹 Fixes
19
+
20
+ - runtime functions were failing on init ([#216](https://github.com/golemui/golemui/pull/216))
21
+
22
+ ### ❤️ Thank You
23
+
24
+ - Raúl Jiménez @Elecash
25
+
1
26
  ## 1.0.2 (2026-06-26)
2
27
 
3
28
  This was a version bump only for gui-shared to align it with other projects, there were no code changes.
package/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { gui } from './lib/dx';
2
2
  export type { DxDefinitionItem, DxDefinitions, DxFormConfig, GslSelectorsInput, GuiFormInitConfig, } from './lib/dx';
3
3
  export type { Dependencies } from './lib/shared';
4
+ export type { ExpressionFunction, ExpressionFunctions } from '@golemui/core';
4
5
  export { resolveChunkRefs } from './lib/utils/schema';
package/index.js CHANGED
@@ -1,304 +1,374 @@
1
- import { _ as d, a as y, b as g, c, d as h, e as _, f as B, g as U, h as m, i as k, j as f, k as w, l as I, m as x, n as D, o as C, p as b, q as A, r as R, s as P, t as T, u as L, v as M, w as $, x as F, y as v, z, A as G, B as j, C as O, D as E, E as H, F as N, G as V, H as q, I as W, J as K, K as Q, L as S, M as X, N as Y, O as Z, P as J, Q as ss, R as as, S as ts, T as rs, U as is, V as es, W as ns, X as us, Y as ls, Z as ps, $ as os, a0 as ds, a1 as ys, a2 as gs, a3 as cs, a4 as hs, a5 as _s, a6 as Bs, a7 as Us, a8 as ms, a9 as ks, aa as fs, ab as ws, ac as Is, ad as xs, ae as Ds, af as Cs, ag as bs, ah as As, ai as Rs, aj as Ps, ak as Ts, al as Ls, am as Ms, an as $s, ao as Fs, ap as vs, aq as zs, ar as Gs, as as js, at as Os, au as Es, av as Hs, aw as Ns, ax as Vs, ay as qs, az as Ws, aA as Ks, aB as Qs, aC as Ss, aD as Xs, aE as Ys } from "./register-BaJnbpMX.js";
1
+ import { _ as d, a as y, b as o, c, d as _, e as h, f as m, g as B, h as U, i as T, j as k, k as D, l as I, m as P, n as C, o as f, p as R, q as w, r as x, s as b, t as A, u as L, v as M, w as $, x as F, y as G, z as v, A as z, B as j, C as O, D as H, E as N, F as V, G as E, H as W, I as q, J as K, K as Q, L as S, M as X, N as Y, O as Z, P as J, Q as aa, R as sa, S as ta, T as ea, U as ia, V as ra, W as na, X as ua, Y as la, Z as pa, $ as ga, a0 as da, a1 as ya, a2 as oa, a3 as ca, a4 as _a, a5 as ha, a6 as ma, a7 as Ba, a8 as Ua, a9 as Ta, aa as ka, ab as Da, ac as Ia, ad as Pa, ae as Ca, af as fa, ag as Ra, ah as wa, ai as xa, aj as ba, ak as Aa, al as La, am as Ma, an as $a, ao as Fa, ap as Ga, aq as va, ar as za, as as ja, at as Oa, au as Ha, av as Na, aw as Va, ax as Ea, ay as Wa, az as qa, aA as Ka, aB as Qa, aC as Sa, aD as Xa, aE as Ya, aF as Za, aG as Ja, aH as as, aI as ss, aJ as ts, aK as es, aL as is, aM as rs, aN as ns, aO as us, aP as ls, aQ as ps, aR as gs, aS as ds, aT as ys, aU as os, aV as cs, aW as _s, aX as hs, aY as ms, aZ as Bs, a_ as Us, a$ as Ts, b0 as ks, b1 as Ds, b2 as Is, b3 as Ps, b4 as Cs, b5 as fs, b6 as Rs } from "./register-De8Y1vW5.js";
2
2
  import "@golemui/core";
3
- class e {
4
- constructor(s) {
5
- this.conditions = s;
3
+ class r {
4
+ constructor(a) {
5
+ this.conditions = a;
6
6
  }
7
7
  static root() {
8
- return new e([]);
8
+ return new r([]);
9
9
  }
10
10
  // ─── Scope methods (chain-extending, immutable) ───
11
- tag(s) {
12
- return new e([...this.conditions, { kind: "tagsAnd", tags: [s] }]);
11
+ tag(a) {
12
+ return new r([...this.conditions, { kind: "tagsAnd", tags: [a] }]);
13
13
  }
14
- state(s) {
15
- return new e([...this.conditions, { kind: "state", name: s }]);
14
+ state(a) {
15
+ return new r([...this.conditions, { kind: "state", name: a }]);
16
16
  }
17
- tagsAnd(s) {
18
- return new e([...this.conditions, { kind: "tagsAnd", tags: s }]);
17
+ tagsAnd(a) {
18
+ return new r([...this.conditions, { kind: "tagsAnd", tags: a }]);
19
19
  }
20
- tagsOr(s) {
21
- return new e([...this.conditions, { kind: "tagsOr", tags: s }]);
20
+ tagsOr(a) {
21
+ return new r([...this.conditions, { kind: "tagsOr", tags: a }]);
22
22
  }
23
- apply(s) {
24
- if (this.conditions.length === 0) return s;
25
- const a = this.conditions.find(
23
+ apply(a) {
24
+ if (this.conditions.length === 0) return a;
25
+ const s = this.conditions.find(
26
26
  (i) => i.kind === "state"
27
- ), r = this.conditions.filter(
27
+ ), e = this.conditions.filter(
28
28
  (i) => i.kind !== "state"
29
- ), n = s.matcher;
29
+ ), n = a.matcher;
30
30
  return {
31
- ...s,
31
+ ...a,
32
32
  matcher: (i) => {
33
33
  if (!n(i)) return !1;
34
- for (const u of r) {
35
- const o = i.tags ?? [];
34
+ for (const u of e) {
35
+ const g = i.tags ?? [];
36
36
  if (u.kind === "tagsAnd") {
37
37
  for (const l of u.tags)
38
- if (!o.includes(l)) return !1;
38
+ if (!g.includes(l)) return !1;
39
39
  } else {
40
40
  if (u.tags.length === 0) continue;
41
- if (!u.tags.some((l) => o.includes(l))) return !1;
41
+ if (!u.tags.some((l) => g.includes(l))) return !1;
42
42
  }
43
43
  }
44
44
  return !0;
45
45
  },
46
- ...a ? { targetState: a.name } : {}
46
+ ...s ? { targetState: s.name } : {}
47
47
  };
48
48
  }
49
49
  // ─── Type selectors — inputs ───
50
- inputs(s) {
51
- return this.apply(d(s));
50
+ inputs(a) {
51
+ return this.apply(d(a));
52
52
  }
53
- inputByUid(s, a) {
54
- return this.apply(y(s, a));
53
+ inputByUid(a, s) {
54
+ return this.apply(y(a, s));
55
55
  }
56
- textInputs(s) {
57
- return this.apply(g(s));
56
+ textInputs(a) {
57
+ return this.apply(o(a));
58
58
  }
59
- numberInputs(s) {
60
- return this.apply(c(s));
59
+ numberInputs(a) {
60
+ return this.apply(c(a));
61
61
  }
62
- booleanInputs(s) {
63
- return this.apply(h(s));
62
+ booleanInputs(a) {
63
+ return this.apply(_(a));
64
64
  }
65
- selects(s) {
66
- return this.apply(_(s));
65
+ selects(a) {
66
+ return this.apply(h(a));
67
67
  }
68
- selectByUid(s, a) {
69
- return this.apply(B(s, a));
68
+ selectByUid(a, s) {
69
+ return this.apply(m(a, s));
70
70
  }
71
- dropdowns(s) {
72
- return this.apply(U(s));
71
+ dropdowns(a) {
72
+ return this.apply(B(a));
73
73
  }
74
- dropdownByUid(s, a) {
75
- return this.apply(m(s, a));
74
+ dropdownByUid(a, s) {
75
+ return this.apply(U(a, s));
76
76
  }
77
- radiogroups(s) {
78
- return this.apply(k(s));
77
+ radiogroups(a) {
78
+ return this.apply(T(a));
79
79
  }
80
- radiogroupByUid(s, a) {
81
- return this.apply(f(s, a));
80
+ radiogroupByUid(a, s) {
81
+ return this.apply(k(a, s));
82
82
  }
83
- checkboxes(s) {
84
- return this.apply(w(s));
83
+ checkboxes(a) {
84
+ return this.apply(D(a));
85
85
  }
86
- checkboxByUid(s, a) {
87
- return this.apply(I(s, a));
86
+ checkboxByUid(a, s) {
87
+ return this.apply(I(a, s));
88
88
  }
89
- textareas(s) {
90
- return this.apply(x(s));
89
+ textareas(a) {
90
+ return this.apply(P(a));
91
91
  }
92
- textareaByUid(s, a) {
93
- return this.apply(D(s, a));
92
+ textareaByUid(a, s) {
93
+ return this.apply(C(a, s));
94
94
  }
95
- passwords(s) {
96
- return this.apply(C(s));
95
+ passwords(a) {
96
+ return this.apply(f(a));
97
97
  }
98
- passwordByUid(s, a) {
99
- return this.apply(b(s, a));
98
+ passwordByUid(a, s) {
99
+ return this.apply(R(a, s));
100
100
  }
101
- currencies(s) {
102
- return this.apply(A(s));
101
+ currencies(a) {
102
+ return this.apply(w(a));
103
103
  }
104
- currencyByUid(s, a) {
105
- return this.apply(R(s, a));
104
+ currencyByUid(a, s) {
105
+ return this.apply(x(a, s));
106
106
  }
107
- markdowns(s) {
108
- return this.apply(P(s));
107
+ markdowns(a) {
108
+ return this.apply(b(a));
109
109
  }
110
- markdownByUid(s, a) {
111
- return this.apply(T(s, a));
110
+ markdownByUid(a, s) {
111
+ return this.apply(A(a, s));
112
112
  }
113
- lists(s) {
114
- return this.apply(L(s));
113
+ lists(a) {
114
+ return this.apply(L(a));
115
115
  }
116
- listByUid(s, a) {
117
- return this.apply(M(s, a));
116
+ listByUid(a, s) {
117
+ return this.apply(M(a, s));
118
118
  }
119
- calendars(s) {
120
- return this.apply($(s));
119
+ calendars(a) {
120
+ return this.apply($(a));
121
121
  }
122
- calendarByUid(s, a) {
123
- return this.apply(F(s, a));
122
+ calendarByUid(a, s) {
123
+ return this.apply(F(a, s));
124
124
  }
125
- dateInputs(s) {
126
- return this.apply(v(s));
125
+ dateTimeCalendars(a) {
126
+ return this.apply(G(a));
127
127
  }
128
- dateInputByUid(s, a) {
129
- return this.apply(z(s, a));
128
+ dateTimeCalendarByUid(a, s) {
129
+ return this.apply(v(a, s));
130
130
  }
131
- datePickers(s) {
132
- return this.apply(G(s));
131
+ dateInputs(a) {
132
+ return this.apply(z(a));
133
133
  }
134
- datePickerByUid(s, a) {
135
- return this.apply(j(s, a));
134
+ dateInputByUid(a, s) {
135
+ return this.apply(j(a, s));
136
136
  }
137
- rangeCalendars(s) {
138
- return this.apply(O(s));
137
+ timeInputs(a) {
138
+ return this.apply(O(a));
139
139
  }
140
- rangeCalendarByUid(s, a) {
141
- return this.apply(E(s, a));
140
+ timeInputByUid(a, s) {
141
+ return this.apply(H(a, s));
142
142
  }
143
- rangeDateInputs(s) {
144
- return this.apply(H(s));
143
+ timePickers(a) {
144
+ return this.apply(N(a));
145
145
  }
146
- rangeDateInputByUid(s, a) {
147
- return this.apply(N(s, a));
146
+ timePickerByUid(a, s) {
147
+ return this.apply(V(a, s));
148
148
  }
149
- rangeDatePickers(s) {
150
- return this.apply(V(s));
149
+ dateTimeInputs(a) {
150
+ return this.apply(E(a));
151
151
  }
152
- rangeDatePickerByUid(s, a) {
153
- return this.apply(q(s, a));
152
+ dateTimeInputByUid(a, s) {
153
+ return this.apply(W(a, s));
154
154
  }
155
- repeaters(s) {
156
- return this.apply(W(s));
155
+ datePickers(a) {
156
+ return this.apply(q(a));
157
157
  }
158
- repeaterByUid(s, a) {
159
- return this.apply(K(s, a));
158
+ datePickerByUid(a, s) {
159
+ return this.apply(K(a, s));
160
+ }
161
+ dateTimePickers(a) {
162
+ return this.apply(Q(a));
163
+ }
164
+ dateTimePickerByUid(a, s) {
165
+ return this.apply(S(a, s));
166
+ }
167
+ rangeCalendars(a) {
168
+ return this.apply(X(a));
169
+ }
170
+ rangeCalendarByUid(a, s) {
171
+ return this.apply(Y(a, s));
172
+ }
173
+ rangeDateInputs(a) {
174
+ return this.apply(Z(a));
175
+ }
176
+ rangeDateInputByUid(a, s) {
177
+ return this.apply(J(a, s));
178
+ }
179
+ rangeTimeInputs(a) {
180
+ return this.apply(aa(a));
181
+ }
182
+ rangeTimeInputByUid(a, s) {
183
+ return this.apply(sa(a, s));
184
+ }
185
+ rangeDateTimeInputs(a) {
186
+ return this.apply(ta(a));
187
+ }
188
+ rangeDateTimeInputByUid(a, s) {
189
+ return this.apply(ea(a, s));
190
+ }
191
+ rangeDateTimeCalendars(a) {
192
+ return this.apply(ia(a));
193
+ }
194
+ rangeDateTimeCalendarByUid(a, s) {
195
+ return this.apply(ra(a, s));
196
+ }
197
+ rangeDateTimePickers(a) {
198
+ return this.apply(na(a));
199
+ }
200
+ rangeDateTimePickerByUid(a, s) {
201
+ return this.apply(ua(a, s));
202
+ }
203
+ rangeDatePickers(a) {
204
+ return this.apply(la(a));
205
+ }
206
+ rangeDatePickerByUid(a, s) {
207
+ return this.apply(pa(a, s));
208
+ }
209
+ rangeTimePickers(a) {
210
+ return this.apply(ga(a));
211
+ }
212
+ rangeTimePickerByUid(a, s) {
213
+ return this.apply(da(a, s));
214
+ }
215
+ repeaters(a) {
216
+ return this.apply(ya(a));
217
+ }
218
+ repeaterByUid(a, s) {
219
+ return this.apply(oa(a, s));
160
220
  }
161
221
  // ─── Type selectors — actions, displays, layouts ───
162
- actions(s) {
163
- return this.apply(Q(s));
222
+ actions(a) {
223
+ return this.apply(ca(a));
164
224
  }
165
- actionByUid(s, a) {
166
- return this.apply(S(s, a));
225
+ actionByUid(a, s) {
226
+ return this.apply(_a(a, s));
167
227
  }
168
- layouts(s) {
169
- return this.apply(X(s));
228
+ layouts(a) {
229
+ return this.apply(ha(a));
170
230
  }
171
- layoutByUid(s, a) {
172
- return this.apply(Y(s, a));
231
+ layoutByUid(a, s) {
232
+ return this.apply(ma(a, s));
173
233
  }
174
- displays(s) {
175
- return this.apply(Z(s));
234
+ displays(a) {
235
+ return this.apply(Ba(a));
176
236
  }
177
- displayByUid(s, a) {
178
- return this.apply(J(s, a));
237
+ displayByUid(a, s) {
238
+ return this.apply(Ua(a, s));
179
239
  }
180
- alerts(s) {
181
- return this.apply(ss(s));
240
+ alerts(a) {
241
+ return this.apply(Ta(a));
182
242
  }
183
- alertByUid(s, a) {
184
- return this.apply(as(s, a));
243
+ alertByUid(a, s) {
244
+ return this.apply(ka(a, s));
185
245
  }
186
- markdownTexts(s) {
187
- return this.apply(ts(s));
246
+ markdownTexts(a) {
247
+ return this.apply(Da(a));
188
248
  }
189
- markdownTextByUid(s, a) {
190
- return this.apply(rs(s, a));
249
+ markdownTextByUid(a, s) {
250
+ return this.apply(Ia(a, s));
191
251
  }
192
- tabs(s) {
193
- return this.apply(is(s));
252
+ tabs(a) {
253
+ return this.apply(Pa(a));
194
254
  }
195
- tabsByUid(s, a) {
196
- return this.apply(es(s, a));
255
+ tabsByUid(a, s) {
256
+ return this.apply(Ca(a, s));
197
257
  }
198
- accordions(s) {
199
- return this.apply(ns(s));
258
+ accordions(a) {
259
+ return this.apply(fa(a));
200
260
  }
201
- accordionByUid(s, a) {
202
- return this.apply(us(s, a));
261
+ accordionByUid(a, s) {
262
+ return this.apply(Ra(a, s));
203
263
  }
204
264
  // ─── Type selectors — custom kinds ───
205
- customInputs(s) {
206
- return this.apply(ls(s));
265
+ customInputs(a) {
266
+ return this.apply(wa(a));
207
267
  }
208
- customInputByUid(s, a) {
209
- return this.apply(ps(s, a));
268
+ customInputByUid(a, s) {
269
+ return this.apply(xa(a, s));
210
270
  }
211
- customActions(s) {
212
- return this.apply(os(s));
271
+ customActions(a) {
272
+ return this.apply(ba(a));
213
273
  }
214
- customActionByUid(s, a) {
215
- return this.apply(ds(s, a));
274
+ customActionByUid(a, s) {
275
+ return this.apply(Aa(a, s));
216
276
  }
217
- customDisplays(s) {
218
- return this.apply(ys(s));
277
+ customDisplays(a) {
278
+ return this.apply(La(a));
219
279
  }
220
- customDisplayByUid(s, a) {
221
- return this.apply(gs(s, a));
280
+ customDisplayByUid(a, s) {
281
+ return this.apply(Ma(a, s));
222
282
  }
223
- customLayouts(s) {
224
- return this.apply(cs(s));
283
+ customLayouts(a) {
284
+ return this.apply($a(a));
225
285
  }
226
- customLayoutByUid(s, a) {
227
- return this.apply(hs(s, a));
286
+ customLayoutByUid(a, s) {
287
+ return this.apply(Fa(a, s));
228
288
  }
229
289
  }
230
- const ta = {
290
+ const Ls = {
231
291
  inputs: {
232
- textInput: Ys,
233
- numberInput: Xs,
234
- booleanInput: Ss,
235
- select: Qs,
236
- dropdown: Ks,
237
- radiogroup: Ws,
238
- checkbox: qs,
239
- textarea: Vs,
240
- password: Ns,
241
- currency: Hs,
242
- markdown: Es,
243
- list: Os,
244
- calendar: js,
245
- dateInput: Gs,
246
- datePicker: zs,
247
- rangeCalendar: vs,
248
- rangeDateInput: Fs,
249
- rangeDatePicker: $s,
250
- repeater: Ms,
251
- tags: Ls,
252
- custom: Ts
292
+ textInput: Rs,
293
+ numberInput: fs,
294
+ booleanInput: Cs,
295
+ select: Ps,
296
+ dropdown: Is,
297
+ radiogroup: Ds,
298
+ checkbox: ks,
299
+ textarea: Ts,
300
+ password: Us,
301
+ currency: Bs,
302
+ markdown: ms,
303
+ list: hs,
304
+ calendar: _s,
305
+ dateTimeCalendar: cs,
306
+ dateInput: os,
307
+ datePicker: ys,
308
+ dateTimePicker: ds,
309
+ timeInput: gs,
310
+ timePicker: ps,
311
+ dateTimeInput: ls,
312
+ rangeCalendar: us,
313
+ rangeDateInput: ns,
314
+ rangeDateTimeInput: rs,
315
+ rangeDateTimeCalendar: is,
316
+ rangeDateTimePicker: es,
317
+ rangeTimeInput: ts,
318
+ rangeDatePicker: ss,
319
+ rangeTimePicker: as,
320
+ repeater: Ja,
321
+ tags: Za,
322
+ custom: Ya
253
323
  },
254
324
  actions: {
255
- button: Ps,
256
- custom: Rs
325
+ button: Xa,
326
+ custom: Sa
257
327
  },
258
328
  displays: {
259
- display: As,
260
- alert: bs,
261
- markdownText: Cs,
262
- custom: Ds
329
+ display: Qa,
330
+ alert: Ka,
331
+ markdownText: qa,
332
+ custom: Wa
263
333
  },
264
334
  layouts: {
265
- flex: xs,
266
- horizontalFlex: Is,
267
- verticalFlex: ws,
268
- grid: fs,
269
- horizontalGrid: ks,
270
- verticalGrid: ms,
271
- tabs: Us,
272
- accordion: Bs,
273
- custom: _s
335
+ flex: Ea,
336
+ horizontalFlex: Va,
337
+ verticalFlex: Na,
338
+ grid: Ha,
339
+ horizontalGrid: Oa,
340
+ verticalGrid: ja,
341
+ tabs: za,
342
+ accordion: va,
343
+ custom: Ga
274
344
  },
275
- selectors: e.root()
345
+ selectors: r.root()
276
346
  };
277
- function Zs(t) {
347
+ function ws(t) {
278
348
  return typeof t == "object" && t !== null && "$ref" in t && typeof t.$ref == "string" && Object.keys(t).length === 1;
279
349
  }
280
- async function Js(t, s) {
281
- const a = new URL(t, s).href, r = await fetch(a);
282
- if (!r.ok) throw new Error(`Failed to load form chunk ${a}: ${r.status}`);
283
- const { $schema: n, ...i } = await r.json();
284
- return p(i, a);
350
+ async function xs(t, a) {
351
+ const s = new URL(t, a).href, e = await fetch(s);
352
+ if (!e.ok) throw new Error(`Failed to load form chunk ${s}: ${e.status}`);
353
+ const { $schema: n, ...i } = await e.json();
354
+ return p(i, s);
285
355
  }
286
- async function p(t, s) {
287
- if (Zs(t)) return Js(t.$ref, s);
288
- const a = t;
289
- if (Array.isArray(a.children)) {
290
- const r = await Promise.all(a.children.map((n) => p(n, s)));
291
- return { ...a, children: r };
356
+ async function p(t, a) {
357
+ if (ws(t)) return xs(t.$ref, a);
358
+ const s = t;
359
+ if (Array.isArray(s.children)) {
360
+ const e = await Promise.all(s.children.map((n) => p(n, a)));
361
+ return { ...s, children: e };
292
362
  }
293
363
  return t;
294
364
  }
295
- async function ra(t, s) {
296
- const a = await Promise.all(
297
- t.form.map((r) => p(r, s))
365
+ async function Ms(t, a) {
366
+ const s = await Promise.all(
367
+ t.form.map((e) => p(e, a))
298
368
  );
299
- return { ...t, form: a };
369
+ return { ...t, form: s };
300
370
  }
301
371
  export {
302
- ta as gui,
303
- ra as resolveChunkRefs
372
+ Ls as gui,
373
+ Ms as resolveChunkRefs
304
374
  };
package/index.umd.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./register-BHpCnzXI.cjs");require("@golemui/core");class a{constructor(t){this.conditions=t}static root(){return new a([])}tag(t){return new a([...this.conditions,{kind:"tagsAnd",tags:[t]}])}state(t){return new a([...this.conditions,{kind:"state",name:t}])}tagsAnd(t){return new a([...this.conditions,{kind:"tagsAnd",tags:t}])}tagsOr(t){return new a([...this.conditions,{kind:"tagsOr",tags:t}])}apply(t){if(this.conditions.length===0)return t;const r=this.conditions.find(n=>n.kind==="state"),i=this.conditions.filter(n=>n.kind!=="state"),u=t.matcher;return{...t,matcher:n=>{if(!u(n))return!1;for(const l of i){const d=n.tags??[];if(l.kind==="tagsAnd"){for(const o of l.tags)if(!d.includes(o))return!1}else{if(l.tags.length===0)continue;if(!l.tags.some(o=>d.includes(o)))return!1}}return!0},...r?{targetState:r.name}:{}}}inputs(t){return this.apply(s._gslInputs(t))}inputByUid(t,r){return this.apply(s._gslInputByUid(t,r))}textInputs(t){return this.apply(s._gslTextInputs(t))}numberInputs(t){return this.apply(s._gslNumberInputs(t))}booleanInputs(t){return this.apply(s._gslBooleanInputs(t))}selects(t){return this.apply(s._gslSelects(t))}selectByUid(t,r){return this.apply(s._gslSelectByUid(t,r))}dropdowns(t){return this.apply(s._gslDropdowns(t))}dropdownByUid(t,r){return this.apply(s._gslDropdownByUid(t,r))}radiogroups(t){return this.apply(s._gslRadiogroups(t))}radiogroupByUid(t,r){return this.apply(s._gslRadiogroupByUid(t,r))}checkboxes(t){return this.apply(s._gslCheckboxes(t))}checkboxByUid(t,r){return this.apply(s._gslCheckboxByUid(t,r))}textareas(t){return this.apply(s._gslTextareas(t))}textareaByUid(t,r){return this.apply(s._gslTextareaByUid(t,r))}passwords(t){return this.apply(s._gslPasswords(t))}passwordByUid(t,r){return this.apply(s._gslPasswordByUid(t,r))}currencies(t){return this.apply(s._gslCurrencies(t))}currencyByUid(t,r){return this.apply(s._gslCurrencyByUid(t,r))}markdowns(t){return this.apply(s._gslMarkdowns(t))}markdownByUid(t,r){return this.apply(s._gslMarkdownByUid(t,r))}lists(t){return this.apply(s._gslLists(t))}listByUid(t,r){return this.apply(s._gslListByUid(t,r))}calendars(t){return this.apply(s._gslCalendars(t))}calendarByUid(t,r){return this.apply(s._gslCalendarByUid(t,r))}dateInputs(t){return this.apply(s._gslDateInputs(t))}dateInputByUid(t,r){return this.apply(s._gslDateInputByUid(t,r))}datePickers(t){return this.apply(s._gslDatePickers(t))}datePickerByUid(t,r){return this.apply(s._gslDatePickerByUid(t,r))}rangeCalendars(t){return this.apply(s._gslRangeCalendars(t))}rangeCalendarByUid(t,r){return this.apply(s._gslRangeCalendarByUid(t,r))}rangeDateInputs(t){return this.apply(s._gslRangeDateInputs(t))}rangeDateInputByUid(t,r){return this.apply(s._gslRangeDateInputByUid(t,r))}rangeDatePickers(t){return this.apply(s._gslRangeDatePickers(t))}rangeDatePickerByUid(t,r){return this.apply(s._gslRangeDatePickerByUid(t,r))}repeaters(t){return this.apply(s._gslRepeaters(t))}repeaterByUid(t,r){return this.apply(s._gslRepeaterByUid(t,r))}actions(t){return this.apply(s._gslActions(t))}actionByUid(t,r){return this.apply(s._gslActionByUid(t,r))}layouts(t){return this.apply(s._gslLayouts(t))}layoutByUid(t,r){return this.apply(s._gslLayoutByUid(t,r))}displays(t){return this.apply(s._gslDisplays(t))}displayByUid(t,r){return this.apply(s._gslDisplayByUid(t,r))}alerts(t){return this.apply(s._gslAlerts(t))}alertByUid(t,r){return this.apply(s._gslAlertByUid(t,r))}markdownTexts(t){return this.apply(s._gslMarkdownTexts(t))}markdownTextByUid(t,r){return this.apply(s._gslMarkdownTextByUid(t,r))}tabs(t){return this.apply(s._gslTabs(t))}tabsByUid(t,r){return this.apply(s._gslTabsByUid(t,r))}accordions(t){return this.apply(s._gslAccordions(t))}accordionByUid(t,r){return this.apply(s._gslAccordionByUid(t,r))}customInputs(t){return this.apply(s._gslCustomInputs(t))}customInputByUid(t,r){return this.apply(s._gslCustomInputByUid(t,r))}customActions(t){return this.apply(s._gslCustomActions(t))}customActionByUid(t,r){return this.apply(s._gslCustomActionByUid(t,r))}customDisplays(t){return this.apply(s._gslCustomDisplays(t))}customDisplayByUid(t,r){return this.apply(s._gslCustomDisplayByUid(t,r))}customLayouts(t){return this.apply(s._gslCustomLayouts(t))}customLayoutByUid(t,r){return this.apply(s._gslCustomLayoutByUid(t,r))}}const y={inputs:{textInput:s._guiTextInput,numberInput:s._guiNumberInput,booleanInput:s._guiBooleanInput,select:s._guiSelect,dropdown:s._guiDropdown,radiogroup:s._guiRadiogroup,checkbox:s._guiCheckbox,textarea:s._guiTextarea,password:s._guiPassword,currency:s._guiCurrency,markdown:s._guiMarkdown,list:s._guiList,calendar:s._guiCalendar,dateInput:s._guiDateInput,datePicker:s._guiDatePicker,rangeCalendar:s._guiRangeCalendar,rangeDateInput:s._guiRangeDateInput,rangeDatePicker:s._guiRangeDatePicker,repeater:s._guiRepeater,tags:s._guiTags,custom:s._guiCustomInput},actions:{button:s._guiButton,custom:s._guiCustomAction},displays:{display:s._guiDisplay,alert:s._guiAlert,markdownText:s._guiMarkdownText,custom:s._guiCustomDisplay},layouts:{flex:s._guiFlex,horizontalFlex:s._guiHorizontalFlex,verticalFlex:s._guiVerticalFlex,grid:s._guiGrid,horizontalGrid:s._guiHorizontalGrid,verticalGrid:s._guiVerticalGrid,tabs:s._guiTabs,accordion:s._guiAccordion,custom:s._guiCustomLayout},selectors:a.root()};function g(e){return typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"&&Object.keys(e).length===1}async function c(e,t){const r=new URL(e,t).href,i=await fetch(r);if(!i.ok)throw new Error(`Failed to load form chunk ${r}: ${i.status}`);const{$schema:u,...n}=await i.json();return p(n,r)}async function p(e,t){if(g(e))return c(e.$ref,t);const r=e;if(Array.isArray(r.children)){const i=await Promise.all(r.children.map(u=>p(u,t)));return{...r,children:i}}return e}async function h(e,t){const r=await Promise.all(e.form.map(i=>p(i,t)));return{...e,form:r}}exports.gui=y;exports.resolveChunkRefs=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./register-B3CJMfX9.cjs");require("@golemui/core");class n{constructor(t){this.conditions=t}static root(){return new n([])}tag(t){return new n([...this.conditions,{kind:"tagsAnd",tags:[t]}])}state(t){return new n([...this.conditions,{kind:"state",name:t}])}tagsAnd(t){return new n([...this.conditions,{kind:"tagsAnd",tags:t}])}tagsOr(t){return new n([...this.conditions,{kind:"tagsOr",tags:t}])}apply(t){if(this.conditions.length===0)return t;const i=this.conditions.find(a=>a.kind==="state"),s=this.conditions.filter(a=>a.kind!=="state"),u=t.matcher;return{...t,matcher:a=>{if(!u(a))return!1;for(const l of s){const d=a.tags??[];if(l.kind==="tagsAnd"){for(const p of l.tags)if(!d.includes(p))return!1}else{if(l.tags.length===0)continue;if(!l.tags.some(p=>d.includes(p)))return!1}}return!0},...i?{targetState:i.name}:{}}}inputs(t){return this.apply(e._gslInputs(t))}inputByUid(t,i){return this.apply(e._gslInputByUid(t,i))}textInputs(t){return this.apply(e._gslTextInputs(t))}numberInputs(t){return this.apply(e._gslNumberInputs(t))}booleanInputs(t){return this.apply(e._gslBooleanInputs(t))}selects(t){return this.apply(e._gslSelects(t))}selectByUid(t,i){return this.apply(e._gslSelectByUid(t,i))}dropdowns(t){return this.apply(e._gslDropdowns(t))}dropdownByUid(t,i){return this.apply(e._gslDropdownByUid(t,i))}radiogroups(t){return this.apply(e._gslRadiogroups(t))}radiogroupByUid(t,i){return this.apply(e._gslRadiogroupByUid(t,i))}checkboxes(t){return this.apply(e._gslCheckboxes(t))}checkboxByUid(t,i){return this.apply(e._gslCheckboxByUid(t,i))}textareas(t){return this.apply(e._gslTextareas(t))}textareaByUid(t,i){return this.apply(e._gslTextareaByUid(t,i))}passwords(t){return this.apply(e._gslPasswords(t))}passwordByUid(t,i){return this.apply(e._gslPasswordByUid(t,i))}currencies(t){return this.apply(e._gslCurrencies(t))}currencyByUid(t,i){return this.apply(e._gslCurrencyByUid(t,i))}markdowns(t){return this.apply(e._gslMarkdowns(t))}markdownByUid(t,i){return this.apply(e._gslMarkdownByUid(t,i))}lists(t){return this.apply(e._gslLists(t))}listByUid(t,i){return this.apply(e._gslListByUid(t,i))}calendars(t){return this.apply(e._gslCalendars(t))}calendarByUid(t,i){return this.apply(e._gslCalendarByUid(t,i))}dateTimeCalendars(t){return this.apply(e._gslDateTimeCalendars(t))}dateTimeCalendarByUid(t,i){return this.apply(e._gslDateTimeCalendarByUid(t,i))}dateInputs(t){return this.apply(e._gslDateInputs(t))}dateInputByUid(t,i){return this.apply(e._gslDateInputByUid(t,i))}timeInputs(t){return this.apply(e._gslTimeInputs(t))}timeInputByUid(t,i){return this.apply(e._gslTimeInputByUid(t,i))}timePickers(t){return this.apply(e._gslTimePickers(t))}timePickerByUid(t,i){return this.apply(e._gslTimePickerByUid(t,i))}dateTimeInputs(t){return this.apply(e._gslDateTimeInputs(t))}dateTimeInputByUid(t,i){return this.apply(e._gslDateTimeInputByUid(t,i))}datePickers(t){return this.apply(e._gslDatePickers(t))}datePickerByUid(t,i){return this.apply(e._gslDatePickerByUid(t,i))}dateTimePickers(t){return this.apply(e._gslDateTimePickers(t))}dateTimePickerByUid(t,i){return this.apply(e._gslDateTimePickerByUid(t,i))}rangeCalendars(t){return this.apply(e._gslRangeCalendars(t))}rangeCalendarByUid(t,i){return this.apply(e._gslRangeCalendarByUid(t,i))}rangeDateInputs(t){return this.apply(e._gslRangeDateInputs(t))}rangeDateInputByUid(t,i){return this.apply(e._gslRangeDateInputByUid(t,i))}rangeTimeInputs(t){return this.apply(e._gslRangeTimeInputs(t))}rangeTimeInputByUid(t,i){return this.apply(e._gslRangeTimeInputByUid(t,i))}rangeDateTimeInputs(t){return this.apply(e._gslRangeDateTimeInputs(t))}rangeDateTimeInputByUid(t,i){return this.apply(e._gslRangeDateTimeInputByUid(t,i))}rangeDateTimeCalendars(t){return this.apply(e._gslRangeDateTimeCalendars(t))}rangeDateTimeCalendarByUid(t,i){return this.apply(e._gslRangeDateTimeCalendarByUid(t,i))}rangeDateTimePickers(t){return this.apply(e._gslRangeDateTimePickers(t))}rangeDateTimePickerByUid(t,i){return this.apply(e._gslRangeDateTimePickerByUid(t,i))}rangeDatePickers(t){return this.apply(e._gslRangeDatePickers(t))}rangeDatePickerByUid(t,i){return this.apply(e._gslRangeDatePickerByUid(t,i))}rangeTimePickers(t){return this.apply(e._gslRangeTimePickers(t))}rangeTimePickerByUid(t,i){return this.apply(e._gslRangeTimePickerByUid(t,i))}repeaters(t){return this.apply(e._gslRepeaters(t))}repeaterByUid(t,i){return this.apply(e._gslRepeaterByUid(t,i))}actions(t){return this.apply(e._gslActions(t))}actionByUid(t,i){return this.apply(e._gslActionByUid(t,i))}layouts(t){return this.apply(e._gslLayouts(t))}layoutByUid(t,i){return this.apply(e._gslLayoutByUid(t,i))}displays(t){return this.apply(e._gslDisplays(t))}displayByUid(t,i){return this.apply(e._gslDisplayByUid(t,i))}alerts(t){return this.apply(e._gslAlerts(t))}alertByUid(t,i){return this.apply(e._gslAlertByUid(t,i))}markdownTexts(t){return this.apply(e._gslMarkdownTexts(t))}markdownTextByUid(t,i){return this.apply(e._gslMarkdownTextByUid(t,i))}tabs(t){return this.apply(e._gslTabs(t))}tabsByUid(t,i){return this.apply(e._gslTabsByUid(t,i))}accordions(t){return this.apply(e._gslAccordions(t))}accordionByUid(t,i){return this.apply(e._gslAccordionByUid(t,i))}customInputs(t){return this.apply(e._gslCustomInputs(t))}customInputByUid(t,i){return this.apply(e._gslCustomInputByUid(t,i))}customActions(t){return this.apply(e._gslCustomActions(t))}customActionByUid(t,i){return this.apply(e._gslCustomActionByUid(t,i))}customDisplays(t){return this.apply(e._gslCustomDisplays(t))}customDisplayByUid(t,i){return this.apply(e._gslCustomDisplayByUid(t,i))}customLayouts(t){return this.apply(e._gslCustomLayouts(t))}customLayoutByUid(t,i){return this.apply(e._gslCustomLayoutByUid(t,i))}}const y={inputs:{textInput:e._guiTextInput,numberInput:e._guiNumberInput,booleanInput:e._guiBooleanInput,select:e._guiSelect,dropdown:e._guiDropdown,radiogroup:e._guiRadiogroup,checkbox:e._guiCheckbox,textarea:e._guiTextarea,password:e._guiPassword,currency:e._guiCurrency,markdown:e._guiMarkdown,list:e._guiList,calendar:e._guiCalendar,dateTimeCalendar:e._guiDateTimeCalendar,dateInput:e._guiDateInput,datePicker:e._guiDatePicker,dateTimePicker:e._guiDateTimePicker,timeInput:e._guiTimeInput,timePicker:e._guiTimePicker,dateTimeInput:e._guiDateTimeInput,rangeCalendar:e._guiRangeCalendar,rangeDateInput:e._guiRangeDateInput,rangeDateTimeInput:e._guiRangeDateTimeInput,rangeDateTimeCalendar:e._guiRangeDateTimeCalendar,rangeDateTimePicker:e._guiRangeDateTimePicker,rangeTimeInput:e._guiRangeTimeInput,rangeDatePicker:e._guiRangeDatePicker,rangeTimePicker:e._guiRangeTimePicker,repeater:e._guiRepeater,tags:e._guiTags,custom:e._guiCustomInput},actions:{button:e._guiButton,custom:e._guiCustomAction},displays:{display:e._guiDisplay,alert:e._guiAlert,markdownText:e._guiMarkdownText,custom:e._guiCustomDisplay},layouts:{flex:e._guiFlex,horizontalFlex:e._guiHorizontalFlex,verticalFlex:e._guiVerticalFlex,grid:e._guiGrid,horizontalGrid:e._guiHorizontalGrid,verticalGrid:e._guiVerticalGrid,tabs:e._guiTabs,accordion:e._guiAccordion,custom:e._guiCustomLayout},selectors:n.root()};function o(r){return typeof r=="object"&&r!==null&&"$ref"in r&&typeof r.$ref=="string"&&Object.keys(r).length===1}async function c(r,t){const i=new URL(r,t).href,s=await fetch(i);if(!s.ok)throw new Error(`Failed to load form chunk ${i}: ${s.status}`);const{$schema:u,...a}=await s.json();return g(a,i)}async function g(r,t){if(o(r))return c(r.$ref,t);const i=r;if(Array.isArray(i.children)){const s=await Promise.all(i.children.map(u=>g(u,t)));return{...i,children:s}}return r}async function _(r,t){const i=await Promise.all(r.form.map(s=>g(s,t)));return{...r,form:i}}exports.gui=y;exports.resolveChunkRefs=_;