json-renderers 1.18.4 → 1.18.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/dist/min.js CHANGED
@@ -1,234 +1,245 @@
1
- const et = {
1
+ const Q = {
2
2
  version: "v18.0.0",
3
3
  description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
4
- }, rt = (t) => {
5
- const e = t;
6
- typeof globalThis > "u" || !e || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderers = {
7
- meta: et,
8
- render: e
4
+ }, Y = (t) => {
5
+ const o = t;
6
+ typeof globalThis > "u" || !o || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderers = {
7
+ meta: Q,
8
+ render: o
9
9
  });
10
- }, st = (t) => {
11
- const e = (t == null ? void 0 : t.inConfig) ?? t;
12
- if (!e || typeof e != "object")
10
+ }, Z = (t) => {
11
+ const o = (t == null ? void 0 : t.inConfig) ?? t;
12
+ if (!o || typeof o != "object")
13
13
  throw new TypeError("Config must be an object");
14
- const r = e.type;
15
- if (r === void 0)
14
+ const e = o.type;
15
+ if (e === void 0)
16
16
  throw new Error('Missing compulsory key: "type"');
17
- if (typeof r != "string")
17
+ if (typeof e != "string")
18
18
  throw new TypeError("type must be a string");
19
19
  return !0;
20
- }, nt = (t) => {
21
- const e = (t == null ? void 0 : t.inConfig) ?? t;
22
- if (!e || typeof e != "object")
20
+ }, tt = (t) => {
21
+ const o = (t == null ? void 0 : t.inConfig) ?? t;
22
+ if (!o || typeof o != "object")
23
23
  throw new TypeError("Config must be an object");
24
- const r = e.data;
25
- if (r === void 0)
24
+ const e = o.data;
25
+ if (e === void 0)
26
26
  throw new Error('Missing compulsory key: "data"');
27
- if (!Array.isArray(r))
27
+ if (!Array.isArray(e))
28
28
  throw new TypeError("data must be an Array");
29
29
  return !0;
30
- }, ot = (t) => {
31
- const e = (t == null ? void 0 : t.inConfig) ?? t;
32
- if (!e || typeof e != "object")
30
+ }, et = (t) => {
31
+ const o = (t == null ? void 0 : t.inConfig) ?? t;
32
+ if (!o || typeof o != "object")
33
33
  throw new TypeError("Config must be an object");
34
- const r = e.columns;
35
- if (r === void 0)
34
+ const e = o.columns;
35
+ if (e === void 0)
36
36
  throw new Error('Missing compulsory key: "columns"');
37
- if (!Array.isArray(r))
37
+ if (!Array.isArray(e))
38
38
  throw new TypeError("columns must be an Array");
39
39
  return !0;
40
- }, at = (t) => {
41
- const e = (t == null ? void 0 : t.inConfig) ?? t;
42
- if (!e || typeof e != "object")
40
+ }, ot = (t) => {
41
+ const o = (t == null ? void 0 : t.inConfig) ?? t;
42
+ if (!o || typeof o != "object")
43
43
  throw new TypeError("Config must be an object");
44
- const r = e.showLog;
45
- if (r !== void 0 && typeof r != "boolean")
44
+ const e = o.showLog;
45
+ if (e !== void 0 && typeof e != "boolean")
46
46
  throw new TypeError("showLog must be a boolean");
47
47
  return !0;
48
- }, I = (t) => {
49
- const e = (t == null ? void 0 : t.inConfig) ?? t;
50
- if (!e || typeof e != "object" || Array.isArray(e))
48
+ }, x = (t) => {
49
+ const o = (t == null ? void 0 : t.inConfig) ?? t;
50
+ if (!o || typeof o != "object" || Array.isArray(o))
51
51
  throw new TypeError("Config must be an object");
52
- return st(e), nt(e), ot(e), at(e), !0;
53
- }, lt = (t) => {
54
- const e = (t == null ? void 0 : t.inConfig) ?? t;
55
- if (!e || typeof e != "object")
52
+ return Z(o), tt(o), et(o), ot(o), !0;
53
+ }, rt = (t) => {
54
+ const o = (t == null ? void 0 : t.inConfig) ?? t;
55
+ if (!o || typeof o != "object")
56
56
  throw new TypeError("Config must be an object");
57
- const r = e.targetHtmlId;
58
- if (r === void 0)
57
+ const e = o.targetHtmlId;
58
+ if (e === void 0)
59
59
  throw new Error('Missing compulsory key: "targetHtmlId"');
60
- if (typeof r != "string")
60
+ if (typeof e != "string")
61
61
  throw new TypeError("targetHtmlId must be a string");
62
- if (r.trim().length === 0)
62
+ if (e.trim().length === 0)
63
63
  throw new Error("targetHtmlId must be a non-empty string");
64
64
  return !0;
65
- }, it = (t) => {
66
- const e = (t == null ? void 0 : t.inConfig) ?? t;
67
- if (!e || typeof e != "object")
65
+ }, nt = (t) => {
66
+ const o = (t == null ? void 0 : t.inConfig) ?? t;
67
+ if (!o || typeof o != "object")
68
68
  throw new TypeError("Config must be an object");
69
- const r = e.appendPosition;
70
- if (r === void 0)
69
+ const e = o.appendPosition;
70
+ if (e === void 0)
71
71
  throw new Error('Missing compulsory key: "appendPosition"');
72
- if (typeof r != "string")
72
+ if (typeof e != "string")
73
73
  throw new TypeError("appendPosition must be a string");
74
74
  return !0;
75
- }, ct = (t) => {
76
- const e = (t == null ? void 0 : t.inConfig) ?? t;
77
- if (!e || typeof e != "object")
75
+ }, at = (t) => {
76
+ const o = (t == null ? void 0 : t.inConfig) ?? t;
77
+ if (!o || typeof o != "object")
78
78
  throw new TypeError("Config must be an object");
79
- const r = e.classToApply;
80
- if (r === void 0)
79
+ const e = o.classToApply;
80
+ if (e === void 0)
81
81
  throw new Error('Missing compulsory key: "classToApply"');
82
- if (typeof r != "string")
82
+ if (typeof e != "string")
83
83
  throw new TypeError("classToApply must be a string");
84
84
  return !0;
85
- }, K = (t) => {
86
- const e = (t == null ? void 0 : t.inConfig) ?? t;
87
- if (!e || typeof e != "object" || Array.isArray(e))
85
+ }, L = (t) => {
86
+ const o = (t == null ? void 0 : t.inConfig) ?? t;
87
+ if (!o || typeof o != "object" || Array.isArray(o))
88
88
  throw new TypeError("Config must be an object");
89
- return lt(e), it(e), ct(e), !0;
90
- }, ut = "table", dt = "", bt = [], pt = [], ft = "", ht = "replace", yt = !1, w = {
91
- type: ut,
92
- targetHtmlId: dt,
93
- data: bt,
94
- columns: pt,
95
- classToApply: ft,
96
- appendPosition: ht,
97
- showLog: yt
98
- }, z = (t) => {
99
- const e = typeof t == "object" && t !== null ? t.inKey ?? t.key : t;
100
- return e && e in w ? w[e] : { ...w };
89
+ return rt(o), nt(o), at(o), !0;
90
+ }, st = "table", lt = "", it = [], ct = [], ut = "", dt = "replace", bt = !1, w = {
91
+ type: st,
92
+ targetHtmlId: lt,
93
+ data: it,
94
+ columns: ct,
95
+ classToApply: ut,
96
+ appendPosition: dt,
97
+ showLog: bt
98
+ }, P = (t) => {
99
+ const o = typeof t == "object" && t !== null ? t.inKey ?? t.key : t;
100
+ return o && o in w ? w[o] : { ...w };
101
101
  };
102
- Object.assign(z, w);
103
- const T = (t) => {
104
- const e = (t == null ? void 0 : t.inConfig) ?? t;
105
- if (!e || typeof e != "object" || Array.isArray(e))
102
+ Object.assign(P, w);
103
+ const $ = (t) => {
104
+ const o = (t == null ? void 0 : t.inConfig) ?? t;
105
+ if (!o || typeof o != "object" || Array.isArray(o))
106
106
  throw new TypeError("Config must be an object");
107
- return I(e), K(e), !0;
107
+ return x(o), L(o), !0;
108
108
  };
109
- T.getSpec = z;
110
- T.configSpec = w;
111
- T.guardSpec = I;
112
- T.guardMount = K;
113
- const mt = {
109
+ $.getSpec = P;
110
+ $.configSpec = w;
111
+ $.guardSpec = x;
112
+ $.guardMount = L;
113
+ const pt = {
114
114
  version: "1.22.0",
115
115
  name: "json-renderers-build"
116
- }, wt = (t) => {
116
+ }, mt = (t) => {
117
117
  t && (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuild = {
118
- meta: mt,
118
+ meta: pt,
119
119
  render: t
120
120
  });
121
- }, gt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Tt = (t, e) => {
122
- if (!gt(t)) return;
123
- let r = {};
124
- for (const [s, a] of Object.entries(t))
125
- r[s] = C(e, a);
126
- return r;
127
- }, Ct = (t, e) => {
128
- const r = structuredClone(t);
129
- return Array.isArray(r) ? r.map((a) => C(e, a)) : void 0;
130
- }, W = (t, e, r) => {
131
- if (t === "${agg:count}" && "rowData" in e) {
132
- if (Array.isArray(e == null ? void 0 : e.rowData))
133
- return e == null ? void 0 : e.rowData.length;
121
+ }, ft = (t) => typeof t == "object" && t !== null && !Array.isArray(t), ht = (t, o) => {
122
+ if (!ft(t)) return;
123
+ let e = {};
124
+ for (const [r, a] of Object.entries(t))
125
+ e[r] = m(o, a);
126
+ return e;
127
+ }, yt = (t, o) => {
128
+ const e = structuredClone(t);
129
+ return Array.isArray(e) ? e.map((a) => m(o, a)) : void 0;
130
+ }, D = (t, o, e) => {
131
+ if (t === "${agg:count}" && "rowData" in o) {
132
+ if (Array.isArray(o == null ? void 0 : o.rowData))
133
+ return o == null ? void 0 : o.rowData.length;
134
134
  } else
135
- return t === "${rowValue}" && "rowData" in e ? e == null ? void 0 : e.rowData : t.replace(/\$\{(\w+)\}/g, (s, a) => e[a] !== void 0 ? e[a] : s);
136
- }, At = (t, e) => W(t, e), xt = (t, e, r) => {
137
- if (e == null)
135
+ return t === "${rowValue}" && "rowData" in o ? o == null ? void 0 : o.rowData : t.replace(/\$\{(\w+)\}/g, (r, a) => o[a] !== void 0 ? o[a] : r);
136
+ }, Ct = (t, o) => D(t, o), wt = (t, o, e) => {
137
+ if (e && console.log("inElement : ", t), e && console.log("inTemplate : ", o), o == null)
138
138
  throw new TypeError("inTemplate is required");
139
- if (typeof e != "object" && typeof e != "string")
139
+ if (typeof o != "object" && typeof o != "string")
140
140
  throw new TypeError("inTemplate must be an object or string");
141
141
  if (!t || typeof t != "object" || Array.isArray(t))
142
142
  throw new TypeError("inElement must be an object");
143
143
  return !0;
144
- }, C = (t, e, r) => {
145
- const s = t, a = e;
146
- xt(s, a);
144
+ }, $t = {
145
+ name: "json-transformer-funcs-primitive",
146
+ version: "1.9.0"
147
+ }, gt = (t) => {
148
+ var o, e;
149
+ typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (o = globalThis.ks).applyTemplate ?? (o.applyTemplate = t), (e = globalThis.ks).transformerFuncs ?? (e.transformerFuncs = {}), globalThis.ks.transformerFuncs.primitive = {
150
+ meta: $t,
151
+ applyTemplate: t
152
+ });
153
+ }, m = (t, o, e) => {
154
+ const r = t, a = o;
155
+ wt(r, a, e);
147
156
  const n = structuredClone(a);
148
- return typeof n == "string" ? W(n, s) : (n === null || typeof n != "object" || ("textContent" in n && (n.textContent = At(n == null ? void 0 : n.textContent, s)), "attributes" in n && (n.attributes = Tt(n == null ? void 0 : n.attributes, s)), "children" in n && (n.children = Ct(n == null ? void 0 : n.children, s))), n);
149
- }, Nt = (t, e) => {
157
+ return typeof n == "string" ? D(n, r) : (n === null || typeof n != "object" || ("textContent" in n && (n.textContent = Ct(n == null ? void 0 : n.textContent, r)), "attributes" in n && (n.attributes = ht(n == null ? void 0 : n.attributes, r)), "children" in n && (n.children = yt(n == null ? void 0 : n.children, r))), n);
158
+ };
159
+ gt(m);
160
+ const Nt = (t, o) => {
150
161
  if (!Array.isArray(t))
151
162
  throw new TypeError("inSource must be an Array");
152
163
  if (t.length === 0)
153
164
  throw new Error("inSource cannot be empty");
154
- for (let r = 0; r < t.length; r++)
155
- if (!t[r] || typeof t[r] != "object")
156
- throw new TypeError(`inSource[${r}] must be an object`);
157
- if (!e || typeof e != "object" && typeof e != "string")
165
+ for (let e = 0; e < t.length; e++)
166
+ if (!t[e] || typeof t[e] != "object")
167
+ throw new TypeError(`inSource[${e}] must be an object`);
168
+ if (!o || typeof o != "object" && typeof o != "string")
158
169
  throw new TypeError("inTemplate must be an object or string");
159
170
  return !0;
160
- }, L = (t, e) => {
161
- const r = t, s = e;
162
- return Nt(r, s), r.map((a) => C(a, s));
163
- }, $t = (t, e) => t.map((s) => ({
164
- ...s,
165
- rowData: e[s.columnName]
166
- })), St = (t, e, r) => {
167
- var a, n, i, d, o, u;
171
+ }, h = (t, o) => {
172
+ const e = t, r = o;
173
+ return Nt(e, r), e.map((a) => m(a, r));
174
+ }, xt = (t, o) => t.map((r) => ({
175
+ ...r,
176
+ rowData: o[r.columnName]
177
+ })), Tt = (t, o, e) => {
178
+ var a, n, s, i, l, c;
168
179
  if (!Array.isArray(t))
169
180
  throw new TypeError("inColumns must be an Array");
170
181
  if (t.length === 0)
171
182
  throw new Error("inColumns cannot be empty");
172
- for (let l = 0; l < t.length; l++) {
173
- const c = t[l];
174
- if (!c || typeof c != "object")
175
- throw new TypeError(`inColumns[${l}] must be an object`);
176
- if (typeof c.columnName != "string" || !c.columnName.trim())
177
- throw new TypeError(`inColumns[${l}].columnName must be a non-empty string`);
183
+ for (let u = 0; u < t.length; u++) {
184
+ const d = t[u];
185
+ if (!d || typeof d != "object")
186
+ throw new TypeError(`inColumns[${u}] must be an object`);
187
+ if (typeof d.columnName != "string" || !d.columnName.trim())
188
+ throw new TypeError(`inColumns[${u}].columnName must be a non-empty string`);
178
189
  }
179
- if (!Array.isArray(e))
190
+ if (!Array.isArray(o))
180
191
  throw new TypeError("inData must be an Array");
181
- for (let l = 0; l < e.length; l++) {
182
- const c = e[l];
183
- if (!c || typeof c != "object")
184
- throw new TypeError(`inData[${l}] must be an object`);
192
+ for (let u = 0; u < o.length; u++) {
193
+ const d = o[u];
194
+ if (!d || typeof d != "object")
195
+ throw new TypeError(`inData[${u}] must be an object`);
185
196
  }
186
- if (!r || typeof r != "object" || Array.isArray(r))
197
+ if (!e || typeof e != "object" || Array.isArray(e))
187
198
  throw new TypeError("inSpec must be an object");
188
- const s = ((i = (n = (a = t[0]) == null ? void 0 : a.template) == null ? void 0 : n.body) == null ? void 0 : i.tr) || "buildBodyTr";
189
- if (!(s in r))
190
- throw new Error(`Row template "${s}" not found in inSpec`);
191
- for (let l = 0; l < t.length; l++) {
192
- const c = t[l], b = ((o = (d = c.template) == null ? void 0 : d.body) == null ? void 0 : o.cell) || ((u = c.template) == null ? void 0 : u.bodyCell) || "buildBodyCell";
193
- if (!(b in r))
194
- throw new Error(`Cell template "${b}" for column "${c.columnName}" not found in inSpec`);
199
+ const r = ((s = (n = (a = t[0]) == null ? void 0 : a.template) == null ? void 0 : n.body) == null ? void 0 : s.tr) || "buildBodyTr";
200
+ if (!(r in e))
201
+ throw new Error(`Row template "${r}" not found in inSpec`);
202
+ for (let u = 0; u < t.length; u++) {
203
+ const d = t[u], b = ((l = (i = d.template) == null ? void 0 : i.body) == null ? void 0 : l.cell) || ((c = d.template) == null ? void 0 : c.bodyCell) || "buildBodyCell";
204
+ if (!(b in e))
205
+ throw new Error(`Cell template "${b}" for column "${d.columnName}" not found in inSpec`);
195
206
  }
196
207
  return !0;
197
- }, jt = (t, e) => t.map((s) => {
198
- var d, o, u;
199
- const a = ((o = (d = s.template) == null ? void 0 : d.body) == null ? void 0 : o.cell) || ((u = s.template) == null ? void 0 : u.bodyCell) || "buildBodyCell", n = e[a];
200
- return C(s, n);
201
- }), It = (t, e, r) => {
202
- var u, l, c;
203
- St(t, e, r);
204
- const s = t, a = e, n = r, i = ((c = (l = (u = s[0]) == null ? void 0 : u.template) == null ? void 0 : l.body) == null ? void 0 : c.tr) || "buildBodyTr", d = n[i];
208
+ }, At = (t, o) => t.map((r) => {
209
+ var i, l, c;
210
+ const a = ((l = (i = r.template) == null ? void 0 : i.body) == null ? void 0 : l.cell) || ((c = r.template) == null ? void 0 : c.bodyCell) || "buildBodyCell", n = o[a];
211
+ return m(r, n);
212
+ }), O = (t, o, e) => {
213
+ var c, u, d;
214
+ Tt(t, o, e);
215
+ const r = t, a = o, n = e, s = ((d = (u = (c = r[0]) == null ? void 0 : c.template) == null ? void 0 : u.body) == null ? void 0 : d.tr) || "buildBodyTr", i = n[s];
205
216
  return a.map((b) => {
206
- const f = C(b, d), x = $t(s, b), N = jt(x, n);
207
- return f.children = N, f;
217
+ const C = m(b, i), _ = xt(r, b), X = At(_, n);
218
+ return C.children = X, C;
208
219
  });
209
- }, B = (t, e) => {
210
- var r;
211
- if (((r = t == null ? void 0 : t.attributes) == null ? void 0 : r["data-role"]) === e) return t;
212
- for (const s of (t == null ? void 0 : t.children) ?? []) {
213
- const a = B(s, e);
220
+ }, y = (t, o) => {
221
+ var e;
222
+ if (((e = t == null ? void 0 : t.attributes) == null ? void 0 : e["data-role"]) === o) return t;
223
+ for (const r of (t == null ? void 0 : t.children) ?? []) {
224
+ const a = y(r, o);
214
225
  if (a) return a;
215
226
  }
216
227
  return null;
217
- }, Lt = (t, e) => {
218
- const r = t[e.fileName], s = e.dataRole ? B(r, e.dataRole) : r;
219
- return (e.filePath ?? []).reduce((a, n) => a[n], s);
220
- }, vt = {
228
+ }, It = (t, o) => {
229
+ const e = t[o.fileName], r = o.dataRole ? y(e, o.dataRole) : e;
230
+ return (o.filePath ?? []).reduce((a, n) => a[n], r);
231
+ }, kt = {
221
232
  tagName: "tr",
222
233
  attributes: {
223
234
  class: "align-middle"
224
235
  },
225
236
  children: []
226
- }, kt = {
237
+ }, jt = {
227
238
  tagName: "col",
228
239
  attributes: {
229
240
  width: "${width}"
230
241
  }
231
- }, Et = {
242
+ }, Ft = {
232
243
  tagName: "th",
233
244
  textContent: "${columnName}",
234
245
  attributes: {
@@ -247,19 +258,19 @@ const mt = {
247
258
  }
248
259
  }
249
260
  ]
250
- }, Pt = {
261
+ }, vt = {
251
262
  tagName: "td",
252
263
  textContent: "${rowValue}",
253
264
  attributes: {
254
265
  class: "py-3 px-3 text-secondary"
255
266
  }
256
- }, Dt = {
267
+ }, St = {
257
268
  tagName: "button",
258
269
  textContent: "${columnName}",
259
270
  attributes: {
260
271
  class: "btn btn-primary btn-sm"
261
272
  }
262
- }, Rt = {
273
+ }, Et = {
263
274
  tagName: "td",
264
275
  attributes: {
265
276
  class: "py-2 px-3 text-center"
@@ -273,38 +284,38 @@ const mt = {
273
284
  }
274
285
  }
275
286
  ]
276
- }, Ft = {
287
+ }, Rt = {
277
288
  tagName: "option",
278
289
  textContent: "${rowValue}",
279
290
  attributes: {
280
291
  value: "${rowValue}"
281
292
  }
282
- }, Mt = {
293
+ }, Lt = {
283
294
  tagName: "select",
284
295
  attributes: {
285
296
  id: "LedgerName"
286
297
  },
287
298
  children: []
288
- }, Ht = {
299
+ }, Pt = {
289
300
  tagName: "datalist",
290
301
  attributes: {
291
302
  "data-name": "${columnName}"
292
303
  },
293
304
  children: []
294
- }, P = {
295
- buildBodyTr: vt,
296
- buildColGroup: kt,
297
- buildHeader: Et,
305
+ }, j = {
306
+ buildBodyTr: kt,
307
+ buildColGroup: jt,
308
+ buildHeader: Ft,
298
309
  buildFooter: Bt,
299
- buildBodyCell: Pt,
300
- button: Dt,
301
- buttonCell: Rt,
302
- buildOption: Ft,
303
- buildSelect: Mt,
304
- buildDataList: Ht
305
- }, Vt = "table", Gt = {
310
+ buildBodyCell: vt,
311
+ button: St,
312
+ buttonCell: Et,
313
+ buildOption: Rt,
314
+ buildSelect: Lt,
315
+ buildDataList: Pt
316
+ }, Dt = "table", Ot = {
306
317
  class: "table table-hover table-striped align-middle border mb-0"
307
- }, Kt = [
318
+ }, Vt = [
308
319
  {
309
320
  tagName: "colgroup",
310
321
  attributes: {
@@ -350,11 +361,11 @@ const mt = {
350
361
  }
351
362
  ]
352
363
  }
353
- ], _ = {
354
- tagName: Vt,
355
- attributes: Gt,
356
- children: Kt
357
- }, zt = [
364
+ ], V = {
365
+ tagName: Dt,
366
+ attributes: Ot,
367
+ children: Vt
368
+ }, Wt = [
358
369
  {
359
370
  narration: "Build the column widths for the table using the configured columns.",
360
371
  destinationPath: {
@@ -391,7 +402,7 @@ const mt = {
391
402
  templateKey: "buildHeader",
392
403
  func: "fromCollection"
393
404
  }
394
- ], Wt = [
405
+ ], qt = [
395
406
  {
396
407
  narration: "Build the table body rows for the table using the configured columns and data.",
397
408
  destinationPath: {
@@ -409,66 +420,69 @@ const mt = {
409
420
  },
410
421
  func: "twoDimensional"
411
422
  }
412
- ], $ = (t) => Array.isArray(t) ? t : [t], R = {
413
- set: (t, e, r) => {
414
- t[e] = r;
423
+ ], g = (t) => Array.isArray(t) ? t : [t], B = {
424
+ set: (t, o, e) => {
425
+ t[o] = e;
415
426
  },
416
- push: (t, e, r) => {
417
- t[e].push(...$(r));
427
+ push: (t, o, e) => {
428
+ t[o].push(...g(e));
418
429
  },
419
- unshift: (t, e, r) => {
420
- t[e].unshift(...$(r));
430
+ unshift: (t, o, e) => {
431
+ t[o].unshift(...g(e));
421
432
  },
422
- pushToRows: (t, e, r) => {
423
- t[e].forEach((s) => {
424
- s.children.push(...structuredClone($(r)));
433
+ pushToRows: (t, o, e) => {
434
+ t[o].forEach((r) => {
435
+ r.children.push(...structuredClone(g(e)));
425
436
  });
426
437
  },
427
- unshiftToRows: (t, e, r) => {
428
- t[e].forEach((s) => {
429
- s.children.unshift(...structuredClone($(r)));
438
+ unshiftToRows: (t, o, e) => {
439
+ t[o].forEach((r) => {
440
+ r.children.unshift(...structuredClone(g(e)));
430
441
  });
431
442
  },
432
- unshiftSerialToRows: (t, e, r) => {
433
- t[e].forEach((s, a) => {
434
- const n = structuredClone(r);
435
- n.textContent = a + 1, s.children.unshift(n);
443
+ unshiftSerialToRows: (t, o, e) => {
444
+ t[o].forEach((r, a) => {
445
+ const n = structuredClone(e);
446
+ n.textContent = a + 1, r.children.unshift(n);
436
447
  });
437
448
  }
438
- }, q = (t, e, r) => {
439
- const s = e.dataRole ? B(t[e.fileName], e.dataRole) : t[e.fileName], a = [...e.filePath ?? []], n = a.pop(), i = a.reduce((o, u) => o[u], s);
440
- (R[e.action] || R.set)(i, n, r);
441
- }, m = { data: {}, base: _, spec: P }, O = {
442
- fromCollection: L,
443
- twoDimensional: It
444
- }, _t = (t) => {
445
- t.forEach((e) => {
446
- const r = Lt(m, e.sourcePath);
447
- if (r) {
448
- const s = O[e.func](r, P[e.templateKey]);
449
- q(m, e.destinationPath, s);
449
+ }, W = (t, o, e) => {
450
+ const r = o.dataRole ? y(t[o.fileName], o.dataRole) : t[o.fileName], a = [...o.filePath ?? []], n = a.pop(), s = a.reduce((l, c) => l[c], r);
451
+ (B[o.action] || B.set)(s, n, e);
452
+ }, f = { data: {}, base: V, spec: j }, q = {
453
+ fromCollection: h,
454
+ twoDimensional: O
455
+ }, Ht = (t) => {
456
+ t.forEach((o) => {
457
+ const e = It(f, o.sourcePath);
458
+ if (e) {
459
+ const r = q[o.func](e, j[o.templateKey]);
460
+ W(f, o.destinationPath, r);
450
461
  } else
451
- console.log(" !instruction : ", e), console.log(" !source : ", r);
462
+ console.log(" !instruction : ", o), console.log(" !source : ", e);
452
463
  });
453
- }, qt = (t) => {
454
- t.forEach((e) => {
455
- const r = O[e.func](
456
- m.data.columns,
457
- m.data.data,
458
- P
464
+ }, zt = (t) => {
465
+ t.forEach((o) => {
466
+ const e = q[o.func](
467
+ f.data.columns,
468
+ f.data.data,
469
+ j
459
470
  );
460
- q(m, e.destinationPath, r);
471
+ W(f, o.destinationPath, e);
461
472
  });
462
- }, Ot = (t) => (m.data = t, _t(zt), qt(Wt), _), F = ({
473
+ }, Mt = (t) => (f.data = t, Ht(Wt), zt(qt), V), v = ({
463
474
  inData: t,
464
- inColumns: e,
465
- inType: r,
466
- footer: s = [],
475
+ inColumns: o,
476
+ inType: e,
477
+ footer: r = [],
467
478
  options: a
468
- } = {}) => Ot({
469
- columns: e,
479
+ } = {}) => Mt({
480
+ columns: o,
470
481
  data: t
471
- }), Jt = {
482
+ }), Gt = ({ inData: t = [], inColumns: o = [] } = {}) => ({
483
+ data: t,
484
+ columns: o
485
+ }), Kt = {
472
486
  tagName: "option",
473
487
  textContent: "${rowValue}",
474
488
  attributes: {
@@ -480,58 +494,80 @@ const mt = {
480
494
  id: "LedgerName"
481
495
  },
482
496
  children: []
483
- }, Xt = {
497
+ }, Jt = {
484
498
  tagName: "datalist",
485
499
  attributes: {
486
500
  "data-name": "${columnName}"
487
501
  },
488
502
  children: []
489
- }, g = {
490
- buildOption: Jt,
503
+ }, p = {
504
+ buildOption: Kt,
491
505
  buildSelect: Ut,
492
- buildDataList: Xt
493
- }, Qt = ({ inData: t = [] } = {}) => {
494
- const e = (t ?? []).map(
495
- (s) => typeof s == "object" && s !== null ? s : { rowValue: s }
496
- ), r = structuredClone(g.buildSelect);
497
- return r.children = L(e, g.buildOption), r;
498
- }, Yt = ({ inData: t = [], inColumns: e = [] } = {}) => e.map((s) => {
499
- const a = structuredClone(g.buildOption);
500
- a.textContent = a.textContent.replace("rowValue", s.columnName), a.attributes.value = a.attributes.value.replace("rowValue", s.columnName);
501
- const n = L(t, a);
502
- return console.log("createdArray : ", n[0], a), n;
503
- }), M = ({ inData: t = [] } = {}) => {
504
- const e = (t ?? []).map(
505
- (s) => typeof s == "object" && s !== null ? s : { rowValue: s }
506
- ), r = structuredClone(g.buildDataList);
507
- return r.children = L(e, g.buildOption), r;
508
- }, Zt = {
506
+ buildDataList: Jt
507
+ }, _t = (t, o = p.buildOption) => {
508
+ const e = structuredClone(o);
509
+ return e.textContent = e.textContent.replace("rowValue", t), e.attributes.value = e.attributes.value.replace("rowValue", t), e;
510
+ }, Xt = (t, o) => {
511
+ const e = o == null ? void 0 : o.columnName, r = structuredClone(p.buildSelect);
512
+ r.attributes.id = e, r.attributes["data-name"] = e;
513
+ const a = _t(e, p.buildOption);
514
+ return r.children = h(t, a), r;
515
+ }, Qt = ({ data: t, columns: o }) => o.map((e) => Xt(t, e)), Yt = (t = {}) => {
516
+ const { data: o, columns: e } = Gt(t);
517
+ return Qt({ data: o, columns: e });
518
+ }, Zt = ({ inData: t = [], inColumns: o = [] } = {}) => ({
519
+ data: t,
520
+ columns: o
521
+ }), te = (t, o = p.buildOption) => {
522
+ const e = structuredClone(o);
523
+ return e.textContent = e.textContent.replace("rowValue", t), e.attributes.value = e.attributes.value.replace("rowValue", t), e;
524
+ }, ee = (t, o) => {
525
+ const e = o == null ? void 0 : o.columnName, r = te(e, p.buildOption);
526
+ return h(t, r);
527
+ }, oe = ({ data: t, columns: o }) => o.map((e) => ee(t, e)), re = (t = {}) => {
528
+ const { data: o, columns: e } = Zt(t);
529
+ return oe({ data: o, columns: e });
530
+ }, ne = ({ inData: t = [], inColumns: o = [] } = {}) => ({
531
+ data: t,
532
+ columns: o
533
+ }), ae = (t, o = p.buildOption) => {
534
+ const e = structuredClone(o);
535
+ return e.textContent = e.textContent.replace("rowValue", t), e.attributes.value = e.attributes.value.replace("rowValue", t), e;
536
+ }, se = (t, o) => {
537
+ const e = o == null ? void 0 : o.columnName, r = structuredClone(p.buildDataList);
538
+ r.attributes.id = e, r.attributes["data-name"] = e;
539
+ const a = ae(e, p.buildOption);
540
+ return r.children = h(t, a), r;
541
+ }, le = ({ data: t, columns: o }) => o.map((e) => se(t, e)), S = (t = {}) => {
542
+ const { data: o, columns: e } = ne(t);
543
+ return le({ data: o, columns: e });
544
+ }, ie = {
509
545
  version: "1.2.0",
510
546
  name: "json-renderers-build-input-row"
511
- }, te = (t) => {
512
- const e = t;
513
- if (typeof globalThis > "u" || !e) return;
547
+ }, ce = (t) => {
548
+ const o = t;
549
+ if (typeof globalThis > "u" || !o) return;
514
550
  globalThis.ks ?? (globalThis.ks = {});
515
- const r = typeof e == "function" ? e : e.render;
551
+ const e = typeof o == "function" ? o : o.render;
516
552
  globalThis.ks.jsonRenderersBuildInputRow = {
517
- meta: Zt,
518
- render: r,
519
- ...typeof e == "object" ? e : {}
553
+ meta: ie,
554
+ render: e,
555
+ ...typeof o == "object" ? o : {}
520
556
  };
521
- }, ee = "input", re = {
557
+ }, ue = "input", de = {
522
558
  type: "search",
523
559
  placeholder: "Search...",
524
560
  class: "form-control",
525
561
  id: "searchInputId"
526
- }, se = {
527
- tagName: ee,
528
- attributes: re
529
- }, S = ({ inOptions: t = {}, options: e = {} } = {}) => {
530
- const r = t && Object.keys(t).length > 0 ? t : e, s = structuredClone(se);
531
- return r.placeholder && (s.attributes.placeholder = r.placeholder), r.class && (s.attributes.class = r.class), r.id && (s.attributes.id = r.id), r.name && (s.attributes.name = r.name), r.type && (s.attributes.type = r.type), r.value && (s.attributes.value = r.value), s;
532
- }, ne = "div", oe = {
562
+ }, be = {
563
+ tagName: ue,
564
+ attributes: de
565
+ }, N = ({ inOptions: t = {}, options: o = {} } = {}) => {
566
+ const e = t && Object.keys(t).length > 0 ? t : o, r = structuredClone(be);
567
+ return e.placeholder && (r.attributes.placeholder = e.placeholder), e.class && (r.attributes.class = e.class), e.id && (r.attributes.id = e.id), e.name && (r.attributes.name = e.name), e.type && (r.attributes.type = e.type), e.value && (r.attributes.value = e.value), r;
568
+ }, pe = "div", me = {
533
569
  class: "d-flex align-items-center gap-2"
534
- }, ae = [
570
+ }, fe = [
535
571
  {
536
572
  tagName: "label",
537
573
  textContent: "Search:",
@@ -549,16 +585,16 @@ const mt = {
549
585
  id: "searchInputId"
550
586
  }
551
587
  }
552
- ], le = {
553
- tagName: ne,
554
- attributes: oe,
555
- children: ae
556
- }, A = ({ inOptions: t = {}, options: e = {} } = {}) => {
557
- const r = t && Object.keys(t).length > 0 ? t : e, s = structuredClone(le), a = s.children[0], n = s.children[1];
558
- return r.label && (a.textContent = r.label), r.id && (a.attributes.for = r.id, n.attributes.id = r.id), r.placeholder && (n.attributes.placeholder = r.placeholder), r.class && (n.attributes.class = r.class), r.name && (n.attributes.name = r.name), r.type && (n.attributes.type = r.type), r.wrapperClass && (s.attributes.class = r.wrapperClass), r.labelClass && (a.attributes.class = r.labelClass), s;
559
- }, ie = "div", ce = {
588
+ ], he = {
589
+ tagName: pe,
590
+ attributes: me,
591
+ children: fe
592
+ }, T = ({ inOptions: t = {}, options: o = {} } = {}) => {
593
+ const e = t && Object.keys(t).length > 0 ? t : o, r = structuredClone(he), a = r.children[0], n = r.children[1];
594
+ return e.label && (a.textContent = e.label), e.id && (a.attributes.for = e.id, n.attributes.id = e.id), e.placeholder && (n.attributes.placeholder = e.placeholder), e.class && (n.attributes.class = e.class), e.name && (n.attributes.name = e.name), e.type && (n.attributes.type = e.type), e.wrapperClass && (r.attributes.class = e.wrapperClass), e.labelClass && (a.attributes.class = e.labelClass), r;
595
+ }, ye = "div", Ce = {
560
596
  class: "d-flex align-items-center gap-2"
561
- }, ue = [
597
+ }, we = [
562
598
  {
563
599
  tagName: "label",
564
600
  textContent: "Search:",
@@ -585,323 +621,762 @@ const mt = {
585
621
  id: "searchButtonId"
586
622
  }
587
623
  }
588
- ], de = {
589
- tagName: ie,
590
- attributes: ce,
591
- children: ue
592
- }, v = ({ inOptions: t = {}, options: e = {} } = {}) => {
593
- const r = t && Object.keys(t).length > 0 ? t : e, s = structuredClone(de), a = s.children[0], n = s.children[1], i = s.children[2];
594
- return r.label && (a.textContent = r.label), r.id && (a.attributes.for = r.id, n.attributes.id = r.id), r.placeholder && (n.attributes.placeholder = r.placeholder), r.class && (n.attributes.class = r.class), r.name && (n.attributes.name = r.name), r.type && (n.attributes.type = r.type), r.buttonText && (i.textContent = r.buttonText), r.buttonClass && (i.attributes.class = r.buttonClass), r.buttonId && (i.attributes.id = r.buttonId), r.wrapperClass && (s.attributes.class = r.wrapperClass), r.labelClass && (a.attributes.class = r.labelClass), s;
595
- }, be = {
596
- input: S,
597
- inputOnly: S,
598
- inputWithLabel: A,
599
- inputWithLabelButton: v
600
- }, pe = ({
624
+ ], $e = {
625
+ tagName: ye,
626
+ attributes: Ce,
627
+ children: we
628
+ }, F = ({ inOptions: t = {}, options: o = {} } = {}) => {
629
+ const e = t && Object.keys(t).length > 0 ? t : o, r = structuredClone($e), a = r.children[0], n = r.children[1], s = r.children[2];
630
+ return e.label && (a.textContent = e.label), e.id && (a.attributes.for = e.id, n.attributes.id = e.id), e.placeholder && (n.attributes.placeholder = e.placeholder), e.class && (n.attributes.class = e.class), e.name && (n.attributes.name = e.name), e.type && (n.attributes.type = e.type), e.buttonText && (s.textContent = e.buttonText), e.buttonClass && (s.attributes.class = e.buttonClass), e.buttonId && (s.attributes.id = e.buttonId), e.wrapperClass && (r.attributes.class = e.wrapperClass), e.labelClass && (a.attributes.class = e.labelClass), r;
631
+ }, ge = {
632
+ input: N,
633
+ inputOnly: N,
634
+ inputWithLabel: T,
635
+ inputWithLabelButton: F
636
+ }, Ne = ({
601
637
  type: t = "inputWithLabel",
602
- options: e = {},
603
- inType: r,
604
- inOptions: s
638
+ options: o = {},
639
+ inType: e,
640
+ inOptions: r
605
641
  } = {}) => {
606
- const a = r ?? t, n = s ?? e;
607
- return (be[a] || A)({ inOptions: n, options: n });
642
+ const a = e ?? t, n = r ?? o;
643
+ return (ge[a] || T)({ inOptions: n, options: n });
608
644
  };
609
- te({
610
- render: pe,
611
- inputOnly: S,
612
- inputWithLabel: A,
613
- inputWithLabelButton: v
645
+ ce({
646
+ render: Ne,
647
+ inputOnly: N,
648
+ inputWithLabel: T,
649
+ inputWithLabelButton: F
614
650
  });
615
- const k = ({ inOptions: t = {}, options: e = {} } = {}) => {
616
- const r = t && Object.keys(t).length > 0 ? t : e;
617
- return (r == null ? void 0 : r.label) === !1 || (r == null ? void 0 : r.flavour) === "inputOnly" ? S({ inOptions: r }) : (r == null ? void 0 : r.flavour) === "inputWithLabelButton" || r != null && r.button || r != null && r.buttonText ? v({ inOptions: r }) : A({ inOptions: r });
618
- }, fe = {
651
+ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
652
+ const e = t && Object.keys(t).length > 0 ? t : o;
653
+ return (e == null ? void 0 : e.label) === !1 || (e == null ? void 0 : e.flavour) === "inputOnly" ? N({ inOptions: e }) : (e == null ? void 0 : e.flavour) === "inputWithLabelButton" || e != null && e.button || e != null && e.buttonText ? F({ inOptions: e }) : T({ inOptions: e });
654
+ }, xe = {
619
655
  version: "1.2.0",
620
656
  name: "json-renderers-build-form"
621
- }, he = (t) => {
622
- const e = t;
623
- typeof globalThis > "u" || !e || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuildForm = {
624
- meta: fe,
625
- render: e
626
- });
627
- }, ye = {
628
- tagName: "form",
629
- attributes: {
630
- class: "vstack gap-3",
631
- id: "appFormId"
657
+ }, Te = (t) => {
658
+ typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuildForm = { meta: xe, render: t });
659
+ }, Ae = "div", Ie = {
660
+ class: "${cardClass}",
661
+ "data-role": "form-card"
662
+ }, ke = [
663
+ {
664
+ tagName: "header",
665
+ attributes: {
666
+ class: "${headerClass}",
667
+ "data-role": "form-header"
668
+ },
669
+ children: [
670
+ {
671
+ tagName: "div",
672
+ attributes: {
673
+ class: "${headingClass}"
674
+ },
675
+ children: [
676
+ {
677
+ tagName: "h2",
678
+ textContent: "${title}",
679
+ attributes: {
680
+ class: "${titleClass}"
681
+ }
682
+ },
683
+ {
684
+ tagName: "p",
685
+ textContent: "${description}",
686
+ attributes: {
687
+ class: "${descriptionClass}"
688
+ }
689
+ }
690
+ ]
691
+ },
692
+ {
693
+ tagName: "span",
694
+ textContent: "${recordId}",
695
+ attributes: {
696
+ class: "${recordIdClass}",
697
+ "data-role": "record-id"
698
+ }
699
+ },
700
+ {
701
+ tagName: "div",
702
+ attributes: {
703
+ class: "${headerActionsClass}",
704
+ "data-role": "header-actions"
705
+ },
706
+ children: []
707
+ }
708
+ ]
632
709
  },
633
- children: []
634
- }, me = {
710
+ {
711
+ tagName: "div",
712
+ attributes: {
713
+ class: "${cardBodyClass}"
714
+ },
715
+ children: [
716
+ {
717
+ tagName: "form",
718
+ attributes: {
719
+ id: "${formId}",
720
+ "data-role": "form-body"
721
+ },
722
+ children: []
723
+ }
724
+ ]
725
+ },
726
+ {
727
+ tagName: "footer",
728
+ attributes: {
729
+ class: "${footerClass}",
730
+ "data-role": "form-footer"
731
+ },
732
+ children: [
733
+ {
734
+ tagName: "div",
735
+ attributes: {
736
+ class: "${footerActionsClass}",
737
+ "data-role": "footer-actions"
738
+ },
739
+ children: []
740
+ }
741
+ ]
742
+ }
743
+ ], je = {
744
+ tagName: Ae,
745
+ attributes: Ie,
746
+ children: ke
747
+ }, Fe = () => structuredClone(je), Be = "header-actions", ve = "button", E = {
748
+ destinationRole: Be,
749
+ template: ve
750
+ }, Se = {
751
+ tagName: "button",
752
+ textContent: "${label}",
753
+ attributes: {
754
+ type: "${type}",
755
+ form: "${formId}",
756
+ class: "${buttonClass} ${buttonSizeClass} ${buttonPaddingClass}"
757
+ }
758
+ }, Ee = {
759
+ button: Se
760
+ }, Re = (t, o) => {
761
+ const e = structuredClone(t), r = h(o.header.actions, Ee[E.template]);
762
+ return y(e, E.destinationRole).children.push(...r), e;
763
+ }, Le = "form-body", Pe = {
764
+ destinationRole: Le
765
+ }, De = {
635
766
  tagName: "div",
636
767
  attributes: {
637
- class: "mb-3"
768
+ class: "${rowClass}"
638
769
  },
639
770
  children: []
640
- }, we = {
641
- tagName: "label",
642
- textContent: "Label",
771
+ }, Oe = {
772
+ tagName: "div",
643
773
  attributes: {
644
- class: "form-label fw-semibold",
645
- for: "fieldId"
646
- }
647
- }, ge = {
648
- tagName: "input",
774
+ class: "${fieldClass}"
775
+ },
776
+ children: [
777
+ {
778
+ tagName: "label",
779
+ textContent: "${label}",
780
+ attributes: {
781
+ class: "${labelClass}",
782
+ for: "${columnName}"
783
+ }
784
+ },
785
+ {
786
+ tagName: "input",
787
+ attributes: {
788
+ type: "${type}",
789
+ class: "${inputClass} ${inputSizeClass}",
790
+ id: "${columnName}",
791
+ name: "${columnName}",
792
+ placeholder: "${placeholder}",
793
+ value: "${rowValue}"
794
+ }
795
+ }
796
+ ]
797
+ }, Ve = {
798
+ tagName: "div",
649
799
  attributes: {
650
- type: "text",
651
- placeholder: "",
652
- class: "form-control",
653
- id: "fieldId",
654
- name: "fieldName"
655
- }
656
- }, Te = {
657
- tagName: "button",
658
- textContent: "Submit",
800
+ class: "${fieldClass}"
801
+ },
802
+ children: [
803
+ {
804
+ tagName: "label",
805
+ textContent: "${label}",
806
+ attributes: {
807
+ class: "${labelClass}",
808
+ for: "${columnName}"
809
+ }
810
+ },
811
+ {
812
+ tagName: "input",
813
+ attributes: {
814
+ type: "${type}",
815
+ class: "${inputClass} ${inputSizeClass}",
816
+ id: "${columnName}",
817
+ name: "${columnName}",
818
+ placeholder: "${placeholder}",
819
+ value: "${rowValue}",
820
+ required: "required"
821
+ }
822
+ }
823
+ ]
824
+ }, We = {
825
+ tagName: "div",
659
826
  attributes: {
660
- type: "submit",
661
- class: "btn btn-primary align-self-start",
662
- id: "formSubmitBtnId"
663
- }
664
- }, y = {
665
- form: ye,
666
- fieldWrapper: me,
667
- label: we,
668
- input: ge,
669
- submitButton: Te
670
- }, Ce = ({ inColumn: t, inRow: e = {}, inIndex: r = 0 } = {}) => {
671
- var x, N;
672
- const s = t, a = e, n = r, i = (s == null ? void 0 : s.columnName) ?? `field_${n}`, d = (s == null ? void 0 : s.type) ?? "text", o = (s == null ? void 0 : s.label) ?? (s == null ? void 0 : s.title) ?? i, u = (s == null ? void 0 : s.id) ?? `form-${n}-${i.toLowerCase()}`, l = a[i] ?? (s == null ? void 0 : s.value), c = structuredClone(y.fieldWrapper), b = structuredClone(y.label);
673
- if (b.textContent = o, b.attributes.for = u, d === "checkbox") {
674
- c.attributes.class = "form-check mb-3";
675
- const p = structuredClone(y.input);
676
- return p.attributes.type = "checkbox", p.attributes.class = "form-check-input", p.attributes.id = u, p.attributes.name = i, p.attributes.value = "true", p.properties = { checked: !!(l ?? (s == null ? void 0 : s.checked) ?? !1) }, b.attributes.class = "form-check-label", c.children = [p, b], c;
677
- }
678
- if (d === "textarea") {
679
- const p = {
827
+ class: "${fieldClass}"
828
+ },
829
+ children: [
830
+ {
831
+ tagName: "label",
832
+ textContent: "${label}",
833
+ attributes: {
834
+ class: "${labelClass}",
835
+ for: "${columnName}"
836
+ }
837
+ },
838
+ {
680
839
  tagName: "textarea",
681
- textContent: l ? String(l) : "",
840
+ textContent: "${rowValue}",
682
841
  attributes: {
683
- class: (s == null ? void 0 : s.class) ?? "form-control",
684
- rows: String((s == null ? void 0 : s.rows) ?? 3),
685
- id: u,
686
- name: i,
687
- placeholder: (s == null ? void 0 : s.placeholder) ?? ""
842
+ class: "${inputClass} ${inputSizeClass}",
843
+ rows: "3",
844
+ id: "${columnName}",
845
+ name: "${columnName}",
846
+ placeholder: "${placeholder}"
688
847
  }
689
- };
690
- return c.children = [b, p], c;
691
- }
692
- if (d === "select") {
693
- const p = {
694
- tagName: "select",
848
+ }
849
+ ]
850
+ }, qe = {
851
+ tagName: "div",
852
+ attributes: {
853
+ class: "${checkboxWrapperClass} ${fieldClass}"
854
+ },
855
+ children: [
856
+ {
857
+ tagName: "input",
695
858
  attributes: {
696
- class: (s == null ? void 0 : s.class) ?? "form-select",
697
- id: u,
698
- name: i
699
- },
700
- children: ((s == null ? void 0 : s.options) ?? []).map((h) => {
701
- const D = String(typeof h == "object" ? h.value : h), Z = typeof h == "object" ? h.label ?? h.value : String(h), tt = l != null && String(l) === D;
702
- return {
703
- tagName: "option",
704
- textContent: Z,
705
- attributes: {
706
- value: D,
707
- ...tt ? { selected: !0 } : {}
708
- }
709
- };
710
- })
711
- };
712
- return c.children = [b, p], c;
713
- }
714
- const f = structuredClone(y.input);
715
- if (f.attributes.type = d, f.attributes.id = u, f.attributes.name = i, s != null && s.placeholder && (f.attributes.placeholder = s.placeholder), s != null && s.class && (f.attributes.class = s.class), l != null && (f.attributes.value = String(l)), s != null && s.buttonText || s != null && s.button) {
716
- const p = {
717
- tagName: "button",
718
- textContent: s.buttonText ?? ((x = s.button) == null ? void 0 : x.text) ?? "Action",
859
+ type: "checkbox",
860
+ class: "${checkboxInputClass}",
861
+ id: "${columnName}",
862
+ name: "${columnName}",
863
+ value: "true"
864
+ }
865
+ },
866
+ {
867
+ tagName: "label",
868
+ textContent: "${label}",
719
869
  attributes: {
720
- type: "button",
721
- class: s.buttonClass ?? ((N = s.button) == null ? void 0 : N.class) ?? "btn btn-success",
722
- id: s.buttonId ?? `${u}-btn`
870
+ class: "${checkboxLabelClass}",
871
+ for: "${columnName}"
723
872
  }
724
- };
725
- return c.children = [b, f, p], c;
726
- }
727
- return c.children = [b, f], c;
728
- }, j = ({ inColumns: t = [], inData: e = [], inOptions: r = {}, columns: s, data: a, options: n } = {}) => {
729
- const i = Array.isArray(t) && t.length > 0 ? t : Array.isArray(s) ? s : [], d = Array.isArray(e) && e.length > 0 ? e : Array.isArray(a) ? a : [], o = r && Object.keys(r).length > 0 ? r : n ?? {}, u = d[0] ?? {}, l = structuredClone(y.form);
730
- if (o != null && o.formId && (l.attributes.id = o.formId), o != null && o.className && (l.attributes.class = o.className), l.children = i.map(
731
- (c, b) => Ce({ inColumn: c, inRow: u, inIndex: b })
732
- ), (o == null ? void 0 : o.showSubmit) !== !1 && (o == null ? void 0 : o.submitButton) !== !1) {
733
- const c = structuredClone(y.submitButton);
734
- o != null && o.submitLabel && (c.textContent = o.submitLabel), o != null && o.submitClass && (c.attributes.class = o.submitClass), l.children.push(c);
735
- }
736
- return l;
737
- }, Ae = {
738
- tagName: "form",
873
+ }
874
+ ]
875
+ }, He = {
876
+ tagName: "div",
739
877
  attributes: {
740
- class: "vstack gap-3",
741
- id: "inlineFormId"
878
+ class: "${fieldClass}"
742
879
  },
743
- children: []
744
- }, xe = {
745
- tagName: "button",
746
- textContent: "Submit",
747
- attributes: {
748
- type: "submit",
749
- class: "btn btn-primary align-self-start",
750
- id: "formSubmitBtnId"
751
- }
752
- }, H = {
753
- form: Ae,
754
- submitButton: xe
755
- }, Ne = ({ inColumn: t, inRow: e = {}, inIndex: r = 0 } = {}) => {
756
- var c, b;
757
- const s = t, a = e, n = r, i = (s == null ? void 0 : s.columnName) ?? `field_${n}`, d = (s == null ? void 0 : s.type) ?? "text", o = (s == null ? void 0 : s.label) ?? (s == null ? void 0 : s.title) ?? i, u = (s == null ? void 0 : s.id) ?? `form-${n}-${i.toLowerCase()}`, l = a[i] ?? (s == null ? void 0 : s.value);
758
- return s != null && s.buttonText || s != null && s.button ? v({
759
- inOptions: {
760
- label: o,
761
- type: d,
762
- id: u,
763
- name: i,
764
- placeholder: (s == null ? void 0 : s.placeholder) ?? "",
765
- class: (s == null ? void 0 : s.class) ?? "form-control",
766
- value: l != null ? String(l) : void 0,
767
- buttonText: s.buttonText ?? ((c = s.button) == null ? void 0 : c.text) ?? "Action",
768
- buttonClass: s.buttonClass ?? ((b = s.button) == null ? void 0 : b.class) ?? "btn btn-outline-primary",
769
- buttonId: s.buttonId ?? `${u}-btn`,
770
- wrapperClass: "d-flex align-items-center gap-2 mb-3",
771
- labelClass: "form-label mb-0 text-nowrap fw-semibold"
880
+ children: [
881
+ {
882
+ tagName: "label",
883
+ textContent: "${label}",
884
+ attributes: {
885
+ class: "${inlineLabelClass}",
886
+ for: "${columnName}"
887
+ }
888
+ },
889
+ {
890
+ tagName: "input",
891
+ attributes: {
892
+ type: "${type}",
893
+ class: "${inputClass} ${inputSizeClass} ${inlineInputClass}",
894
+ id: "${columnName}",
895
+ name: "${columnName}",
896
+ placeholder: "${placeholder}",
897
+ value: "${rowValue}"
898
+ }
772
899
  }
773
- }) : A({
774
- inOptions: {
775
- label: o,
776
- type: d,
777
- id: u,
778
- name: i,
779
- placeholder: (s == null ? void 0 : s.placeholder) ?? "",
780
- class: (s == null ? void 0 : s.class) ?? "form-control",
781
- value: l != null ? String(l) : void 0,
782
- wrapperClass: "d-flex align-items-center gap-2 mb-3",
783
- labelClass: "form-label mb-0 text-nowrap fw-semibold"
900
+ ]
901
+ }, ze = {
902
+ tagName: "div",
903
+ attributes: {
904
+ class: "${fieldClass}"
905
+ },
906
+ children: [
907
+ {
908
+ tagName: "label",
909
+ textContent: "${label}",
910
+ attributes: {
911
+ class: "${inlineLabelClass}",
912
+ for: "${columnName}"
913
+ }
914
+ },
915
+ {
916
+ tagName: "input",
917
+ attributes: {
918
+ type: "${type}",
919
+ class: "${inputClass} ${inputSizeClass} ${inlineInputClass}",
920
+ id: "${columnName}",
921
+ name: "${columnName}",
922
+ placeholder: "${placeholder}",
923
+ value: "${rowValue}",
924
+ required: "required"
925
+ }
784
926
  }
785
- });
786
- }, V = ({ inColumns: t = [], inData: e = [], inOptions: r = {}, columns: s, data: a, options: n } = {}) => {
787
- const i = Array.isArray(t) && t.length > 0 ? t : Array.isArray(s) ? s : [], d = Array.isArray(e) && e.length > 0 ? e : Array.isArray(a) ? a : [], o = r && Object.keys(r).length > 0 ? r : n ?? {}, u = d[0] ?? {}, l = structuredClone(H.form);
788
- if (o != null && o.formId && (l.attributes.id = o.formId), o != null && o.className && (l.attributes.class = o.className), l.children = i.map(
789
- (c, b) => Ne({ inColumn: c, inRow: u, inIndex: b })
790
- ), (o == null ? void 0 : o.showSubmit) !== !1 && (o == null ? void 0 : o.submitButton) !== !1) {
791
- const c = structuredClone(H.submitButton);
792
- o != null && o.submitLabel && (c.textContent = o.submitLabel), o != null && o.submitClass && (c.attributes.class = o.submitClass), l.children.push(c);
793
- }
794
- return l;
795
- }, $e = {
927
+ ]
928
+ }, Me = {
796
929
  tagName: "div",
797
930
  attributes: {
798
- class: "d-flex align-items-center gap-2 mt-3"
931
+ class: "${fieldClass}"
799
932
  },
800
933
  children: [
934
+ {
935
+ tagName: "label",
936
+ textContent: "${label}",
937
+ attributes: {
938
+ class: "${inlineLabelClass}",
939
+ for: "${columnName}"
940
+ }
941
+ },
942
+ {
943
+ tagName: "input",
944
+ attributes: {
945
+ type: "${type}",
946
+ class: "${inputClass} ${inputSizeClass} ${inlineInputClass}",
947
+ id: "${columnName}",
948
+ name: "${columnName}",
949
+ placeholder: "${placeholder}",
950
+ value: "${rowValue}"
951
+ }
952
+ },
801
953
  {
802
954
  tagName: "button",
803
- textContent: "Submit",
955
+ textContent: "${buttonText}",
804
956
  attributes: {
805
- type: "submit",
806
- class: "btn btn-primary",
807
- id: "submitBtnId"
957
+ type: "${buttonType}",
958
+ class: "${inlineButtonClass}"
959
+ }
960
+ }
961
+ ]
962
+ }, Ge = {
963
+ tagName: "div",
964
+ attributes: {
965
+ class: "${fieldClass}"
966
+ },
967
+ children: [
968
+ {
969
+ tagName: "label",
970
+ textContent: "${label}",
971
+ attributes: {
972
+ class: "${inlineLabelClass}",
973
+ for: "${columnName}"
974
+ }
975
+ },
976
+ {
977
+ tagName: "input",
978
+ attributes: {
979
+ type: "${type}",
980
+ class: "${inputClass} ${inputSizeClass} ${inlineInputClass}",
981
+ id: "${columnName}",
982
+ name: "${columnName}",
983
+ placeholder: "${placeholder}",
984
+ value: "${rowValue}",
985
+ required: "required"
808
986
  }
809
987
  },
810
988
  {
811
989
  tagName: "button",
812
- textContent: "Cancel",
990
+ textContent: "${buttonText}",
813
991
  attributes: {
814
- type: "button",
815
- class: "btn btn-secondary",
816
- id: "cancelBtnId"
992
+ type: "${buttonType}",
993
+ class: "${inlineButtonClass}"
817
994
  }
818
995
  }
819
996
  ]
820
- }, Se = {
821
- buttonBar: $e
822
- }, G = ({ inColumns: t = [], inData: e = [], inOptions: r = {}, columns: s, data: a, options: n } = {}) => {
823
- const i = Array.isArray(t) && t.length > 0 ? t : Array.isArray(s) ? s : [], d = Array.isArray(e) && e.length > 0 ? e : Array.isArray(a) ? a : [], o = r && Object.keys(r).length > 0 ? r : n ?? {}, u = j({
824
- inColumns: i,
825
- inData: d,
826
- inOptions: { ...o, submitButton: !1, showSubmit: !1 }
827
- }), l = structuredClone(Se.buttonBar);
828
- return o.submitLabel && (l.children[0].textContent = o.submitLabel), o.cancelLabel && (l.children[1].textContent = o.cancelLabel), u.children.push(l), u;
829
- }, je = {
830
- stacked: j,
831
- vertical: j,
832
- inline: V,
833
- horizontal: V,
834
- withButtons: G,
835
- buttons: G
836
- }, J = (t = {}) => (t.type ?? (t.type = "stacked"), I(t), (je[t.type] || j)({
837
- inColumns: t.columns,
838
- inData: t.data,
839
- inOptions: t.options
840
- }));
841
- he(J);
842
- const Ie = ({
997
+ }, Ke = {
998
+ tagName: "div",
999
+ attributes: {
1000
+ class: "${fieldClass}"
1001
+ },
1002
+ children: [
1003
+ {
1004
+ tagName: "label",
1005
+ textContent: "${label}",
1006
+ attributes: {
1007
+ class: "${inlineLabelClass}",
1008
+ for: "${columnName}"
1009
+ }
1010
+ },
1011
+ {
1012
+ tagName: "textarea",
1013
+ textContent: "${rowValue}",
1014
+ attributes: {
1015
+ class: "${inputClass} ${inputSizeClass} ${inlineInputClass}",
1016
+ rows: "3",
1017
+ id: "${columnName}",
1018
+ name: "${columnName}",
1019
+ placeholder: "${placeholder}"
1020
+ }
1021
+ }
1022
+ ]
1023
+ }, Ue = {
1024
+ tagName: "div",
1025
+ attributes: {
1026
+ class: "${inlineCheckboxWrapperClass}"
1027
+ },
1028
+ children: [
1029
+ {
1030
+ tagName: "input",
1031
+ attributes: {
1032
+ type: "checkbox",
1033
+ class: "${checkboxInputClass}",
1034
+ id: "${columnName}",
1035
+ name: "${columnName}",
1036
+ value: "true"
1037
+ }
1038
+ },
1039
+ {
1040
+ tagName: "label",
1041
+ textContent: "${label}",
1042
+ attributes: {
1043
+ class: "${checkboxLabelClass}",
1044
+ for: "${columnName}"
1045
+ }
1046
+ }
1047
+ ]
1048
+ }, Je = {
1049
+ buildBodyTr: De,
1050
+ buildBodyCell: Oe,
1051
+ buildRequiredField: Ve,
1052
+ buildTextareaField: We,
1053
+ buildCheckboxField: qe,
1054
+ buildInlineField: He,
1055
+ buildInlineRequiredField: ze,
1056
+ buildInlineFieldWithButton: Me,
1057
+ buildInlineRequiredFieldWithButton: Ge,
1058
+ buildInlineTextareaField: Ke,
1059
+ buildInlineCheckboxField: Ue
1060
+ }, _e = (t, o, e) => {
1061
+ const r = t.map((s) => {
1062
+ var c, u, d, b, C;
1063
+ const i = ((u = (c = s.template) == null ? void 0 : c.body) == null ? void 0 : u.cell) ?? (s.required ? "buildRequiredField" : "buildBodyCell");
1064
+ let l = ((d = e.fieldTemplates) == null ? void 0 : d[i]) ?? i;
1065
+ return s.buttonText && (l = ((b = e.buttonFieldTemplates) == null ? void 0 : b[l]) ?? l), {
1066
+ ...s,
1067
+ label: s.label ?? s.title ?? s.columnName,
1068
+ type: s.type ?? "text",
1069
+ placeholder: s.placeholder ?? "",
1070
+ buttonType: s.buttonType ?? "button",
1071
+ template: { ...s.template, body: { ...(C = s.template) == null ? void 0 : C.body, cell: l } }
1072
+ };
1073
+ }), a = o[0] ?? {}, n = Object.fromEntries(r.map((s) => [
1074
+ s.columnName,
1075
+ a[s.columnName] ?? s.value ?? ""
1076
+ ]));
1077
+ return { columns: r, rows: [n] };
1078
+ }, Xe = (t, o, e) => {
1079
+ const r = _e(o.columns, o.records, e.body), a = O(r.columns, r.rows, Je), n = structuredClone(t);
1080
+ return y(n, Pe.destinationRole).children.push(...Array.isArray(a) ? a : [a]), n;
1081
+ }, Qe = "footer-actions", Ye = "button", R = {
1082
+ destinationRole: Qe,
1083
+ template: Ye
1084
+ }, Ze = {
1085
+ tagName: "button",
1086
+ textContent: "${label}",
1087
+ attributes: {
1088
+ type: "${type}",
1089
+ form: "${formId}",
1090
+ class: "${buttonClass} ${buttonSizeClass} ${buttonPaddingClass}"
1091
+ }
1092
+ }, to = {
1093
+ button: Ze
1094
+ }, eo = (t, o) => {
1095
+ const e = structuredClone(t), r = h(o.footer.actions, to[R.template]);
1096
+ return y(e, R.destinationRole).children.push(...r), e;
1097
+ }, H = ({ inColumns: t, inData: o, inOptions: e, columns: r, data: a, options: n } = {}) => ({
1098
+ columns: Array.isArray(t) && t.length > 0 ? t : Array.isArray(r) ? r : [],
1099
+ records: Array.isArray(o) && o.length > 0 ? o : Array.isArray(a) ? a : [],
1100
+ options: e && Object.keys(e).length > 0 ? e : n ?? {}
1101
+ }), oo = "bigButtonsForm", ro = "Account details", no = "Update your profile information.", ao = "", so = "label", lo = "stacked", io = "saveCancel", co = {
1102
+ formId: oo,
1103
+ title: ro,
1104
+ description: no,
1105
+ recordId: ao,
1106
+ header: so,
1107
+ body: lo,
1108
+ footer: io
1109
+ }, uo = {
1110
+ actions: []
1111
+ }, bo = {
1112
+ actions: []
1113
+ }, po = {
1114
+ actions: [
1115
+ {
1116
+ label: "Refresh",
1117
+ type: "button",
1118
+ buttonClass: "${headerButtonClass}"
1119
+ }
1120
+ ]
1121
+ }, mo = {
1122
+ actions: []
1123
+ }, fo = {
1124
+ none: uo,
1125
+ label: bo,
1126
+ labelWithRefresh: po,
1127
+ labelWithId: mo
1128
+ }, ho = {
1129
+ fieldTemplates: {
1130
+ buildBodyCell: "buildInlineField",
1131
+ buildRequiredField: "buildInlineRequiredField",
1132
+ buildTextareaField: "buildInlineTextareaField",
1133
+ buildCheckboxField: "buildInlineCheckboxField"
1134
+ },
1135
+ buttonFieldTemplates: {
1136
+ buildInlineField: "buildInlineFieldWithButton",
1137
+ buildInlineRequiredField: "buildInlineRequiredFieldWithButton"
1138
+ }
1139
+ }, yo = {
1140
+ fieldTemplates: {},
1141
+ buttonFieldTemplates: {}
1142
+ }, Co = {
1143
+ fieldTemplates: {},
1144
+ buttonFieldTemplates: {}
1145
+ }, wo = {
1146
+ inline: ho,
1147
+ stacked: yo,
1148
+ threeColumns: Co
1149
+ }, $o = {
1150
+ actions: []
1151
+ }, go = {
1152
+ actions: [
1153
+ {
1154
+ label: "Save",
1155
+ type: "submit",
1156
+ buttonClass: "${primaryButtonClass}"
1157
+ },
1158
+ {
1159
+ label: "Cancel",
1160
+ type: "reset",
1161
+ buttonClass: "${secondaryButtonClass}"
1162
+ }
1163
+ ]
1164
+ }, No = {
1165
+ actions: [
1166
+ {
1167
+ label: "Edit",
1168
+ type: "button",
1169
+ buttonClass: "${infoButtonClass}"
1170
+ }
1171
+ ]
1172
+ }, xo = {
1173
+ none: $o,
1174
+ saveCancel: go,
1175
+ edit: No
1176
+ }, I = (t, o, e) => {
1177
+ const r = t[o];
1178
+ if (!r) throw new RangeError("Unknown bigButtons " + e + ": " + o);
1179
+ return r;
1180
+ }, z = (t) => {
1181
+ if (typeof t != "object" || t === null || Array.isArray(t))
1182
+ throw new TypeError("bigButtons options must be an object keyed by renderer type");
1183
+ const o = t["form.bigButtons"] ?? {};
1184
+ if (typeof o != "object" || o === null || Array.isArray(o))
1185
+ throw new TypeError('options["form.bigButtons"] must be an object');
1186
+ const e = { ...co, ...o };
1187
+ return {
1188
+ options: e,
1189
+ header: I(fo, e.header, "header"),
1190
+ body: I(wo, e.body, "body"),
1191
+ footer: I(xo, e.footer, "footer")
1192
+ };
1193
+ }, To = (t, o = {}) => {
1194
+ const e = H(o), r = z(e.options), a = Re(t, r), n = Xe(a, e, r);
1195
+ return eo(n, r);
1196
+ }, Ao = {
1197
+ none: {
1198
+ headerClass: "d-none",
1199
+ headerActionsClass: "d-none"
1200
+ },
1201
+ label: {
1202
+ headerClass: "card-header d-flex align-items-center justify-content-between gap-3",
1203
+ headingClass: "me-auto",
1204
+ titleClass: "h4 fw-semibold mb-1",
1205
+ descriptionClass: "text-muted mb-0",
1206
+ recordIdClass: "d-none",
1207
+ headerActionsClass: "d-none",
1208
+ headerButtonClass: "btn btn-outline-secondary text-nowrap"
1209
+ },
1210
+ labelWithRefresh: {
1211
+ headerClass: "card-header d-flex align-items-center justify-content-between gap-3",
1212
+ headingClass: "me-auto",
1213
+ titleClass: "h4 fw-semibold mb-1",
1214
+ descriptionClass: "text-muted mb-0",
1215
+ recordIdClass: "d-none",
1216
+ headerActionsClass: "d-flex align-items-center gap-2",
1217
+ headerButtonClass: "btn btn-outline-secondary text-nowrap"
1218
+ },
1219
+ labelWithId: {
1220
+ headerClass: "card-header d-flex align-items-center justify-content-between gap-3",
1221
+ headingClass: "me-auto",
1222
+ titleClass: "h4 fw-semibold mb-1",
1223
+ descriptionClass: "text-muted mb-0",
1224
+ recordIdClass: "badge text-bg-light border text-secondary",
1225
+ headerActionsClass: "d-none",
1226
+ headerButtonClass: "btn btn-outline-secondary text-nowrap"
1227
+ }
1228
+ }, Io = {
1229
+ bootstrap: Ao
1230
+ }, ko = (t, o) => {
1231
+ var r;
1232
+ const e = (r = Io[o]) == null ? void 0 : r[t.header];
1233
+ if (!e) throw new RangeError("Unknown bigButtons header: " + t.header);
1234
+ return e;
1235
+ }, jo = "bootstrap", Fo = {
1236
+ bootstrap: {
1237
+ base: {
1238
+ cardClass: "card border-0 shadow-sm w-100",
1239
+ cardBodyClass: "card-body p-4 p-lg-5",
1240
+ labelClass: "form-label fw-semibold",
1241
+ inputClass: "form-control",
1242
+ inputSizeClass: "form-control-lg",
1243
+ checkboxWrapperClass: "form-check mb-3",
1244
+ checkboxInputClass: "form-check-input",
1245
+ checkboxLabelClass: "form-check-label"
1246
+ },
1247
+ bodies: {
1248
+ inline: {
1249
+ rowClass: "vstack gap-3",
1250
+ fieldClass: "d-flex align-items-center gap-3",
1251
+ inlineLabelClass: "form-label fw-semibold mb-0 text-nowrap",
1252
+ inlineInputClass: "flex-grow-1",
1253
+ inlineCheckboxWrapperClass: "form-check d-flex align-items-center gap-2"
1254
+ },
1255
+ stacked: {
1256
+ rowClass: "vstack gap-3",
1257
+ fieldClass: "w-100"
1258
+ },
1259
+ threeColumns: {
1260
+ rowClass: "row g-3",
1261
+ fieldClass: "col-md-4"
1262
+ }
1263
+ }
1264
+ }
1265
+ }, k = {
1266
+ defaultFramework: jo,
1267
+ frameworks: Fo
1268
+ }, Bo = (t, o) => {
1269
+ const e = k.frameworks[o];
1270
+ if (!e) throw new RangeError("Unknown bigButtons framework: " + o);
1271
+ const r = e.bodies[t.body];
1272
+ if (!r) throw new RangeError("Unknown bigButtons body: " + t.body);
1273
+ return { ...e.base, ...r };
1274
+ }, vo = {
1275
+ base: {
1276
+ footerClass: "card-footer bg-transparent",
1277
+ footerActionsClass: "d-flex flex-wrap justify-content-end gap-2",
1278
+ buttonSizeClass: "btn-lg",
1279
+ buttonPaddingClass: "px-4 py-2",
1280
+ primaryButtonClass: "btn btn-primary text-nowrap",
1281
+ secondaryButtonClass: "btn btn-outline-secondary text-nowrap",
1282
+ infoButtonClass: "btn btn-outline-info text-nowrap",
1283
+ inlineButtonClass: "btn btn-outline-secondary text-nowrap"
1284
+ },
1285
+ footers: {
1286
+ none: {
1287
+ footerClass: "d-none"
1288
+ },
1289
+ saveCancel: {},
1290
+ edit: {}
1291
+ }
1292
+ }, So = {
1293
+ bootstrap: vo
1294
+ }, Eo = (t, o) => {
1295
+ const e = So[o], r = e == null ? void 0 : e.footers[t.footer];
1296
+ if (!e) throw new RangeError("Unknown bigButtons framework: " + o);
1297
+ if (!r) throw new RangeError("Unknown bigButtons footer: " + t.footer);
1298
+ return { ...e.base, ...r };
1299
+ }, Ro = (t, o = {}) => {
1300
+ const e = z(H(o).options), { options: r } = e, a = r.framework ?? k.defaultFramework;
1301
+ if (!k.frameworks[a]) throw new RangeError("Unknown bigButtons framework: " + a);
1302
+ const s = Object.assign(
1303
+ {},
1304
+ r,
1305
+ Bo(r, a),
1306
+ ko(r, a),
1307
+ Eo(r, a)
1308
+ );
1309
+ return m(s, structuredClone(t));
1310
+ }, Lo = (t = {}) => {
1311
+ const o = Fe(), e = To(o, t);
1312
+ return Ro(e, t);
1313
+ }, M = (t = {}) => {
1314
+ const o = { ...t, type: t.type ?? "form.bigButtons" };
1315
+ return x(o), Lo(o);
1316
+ };
1317
+ Te(M);
1318
+ const Po = ({
843
1319
  inType: t = "stacked",
844
- inData: e,
845
- inColumns: r
846
- } = {}) => J({
1320
+ inData: o,
1321
+ inColumns: e
1322
+ } = {}) => M({
847
1323
  type: t,
848
- columns: r,
849
- data: e
850
- }), Le = {
851
- table: F,
852
- tableFromSpec: F,
853
- select: Qt,
854
- selectOptionsOnly: Yt,
855
- dataList: M,
856
- datalist: M,
857
- searchInput: k,
858
- search: k,
859
- inputRow: k,
860
- form: Ie
861
- }, U = (t = {}) => {
862
- I(t);
863
- const e = t == null ? void 0 : t.showLog, r = t.type;
864
- let s = r, a = r;
865
- if (r.includes(".")) {
866
- const d = r.split(".");
867
- s = d[0], a = d[1];
1324
+ columns: e,
1325
+ data: o
1326
+ }), Do = {
1327
+ table: v,
1328
+ tableFromSpec: v,
1329
+ select: Yt,
1330
+ selectOptionsOnly: re,
1331
+ dataList: S,
1332
+ datalist: S,
1333
+ searchInput: A,
1334
+ search: A,
1335
+ inputRow: A,
1336
+ form: Po
1337
+ }, G = (t = {}) => {
1338
+ x(t);
1339
+ const o = t == null ? void 0 : t.showLog, e = t.type;
1340
+ let r = e, a = e;
1341
+ if (e.includes(".")) {
1342
+ const i = e.split(".");
1343
+ r = i[0], a = i[1];
868
1344
  }
869
- const n = Le[s];
1345
+ const n = Do[r];
870
1346
  if (!n)
871
- throw new Error(`Renderer for type "${s}" not found.`);
872
- const i = n({
1347
+ throw new Error(`Renderer for type "${r}" not found.`);
1348
+ const s = n({
873
1349
  inType: a,
874
1350
  inColumns: t.columns,
875
1351
  inData: t.data,
876
1352
  inOptions: t.options,
877
1353
  options: t.options
878
1354
  });
879
- return e && console.log("json-renderers-build output:", i), i;
1355
+ return o && console.log("json-renderers-build output:", s), s;
880
1356
  };
881
- wt(U);
882
- const ve = ({
1357
+ mt(G);
1358
+ const Oo = ({
883
1359
  inColumns: t,
884
- inType: e = "table",
885
- inData: r,
886
- inShowLog: s = !1
887
- } = {}) => U({
888
- type: e,
889
- data: r ?? [],
1360
+ inType: o = "table",
1361
+ inData: e,
1362
+ inShowLog: r = !1
1363
+ } = {}) => G({
1364
+ type: o,
1365
+ data: e ?? [],
890
1366
  columns: t,
891
- showLog: s
892
- }), ke = {
1367
+ showLog: r
1368
+ }), Vo = {
893
1369
  version: "v9",
894
1370
  description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
895
- }, Ee = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
1371
+ }, Wo = (t) => {
896
1372
  if (typeof globalThis > "u" || !t) return;
897
1373
  globalThis.ks ?? (globalThis.ks = {});
898
- const r = {
899
- meta: ke,
900
- buildSpecElement: t,
901
- reviewSpec: e
1374
+ const o = {
1375
+ meta: Vo,
1376
+ buildSpecElement: t
902
1377
  };
903
- globalThis.ks["json-to-tag"] = r, globalThis.ks.jsonToTag = r;
904
- }, Be = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : typeof t == "object" && (t.nodeType === 3 || t.tagName === "#text" || !t.tagName && (t.textContent !== void 0 || t.text !== void 0)) ? document.createTextNode(t.textContent ?? t.text ?? "") : Q(t), X = (t) => Array.isArray(t) ? t.map(Be).flat(1 / 0).filter(Boolean) : [], Pe = (t) => (t == null, t), De = "http://www.w3.org/2000/svg", Re = /* @__PURE__ */ new Set([
1378
+ globalThis.ks["json-to-tag"] = o, globalThis.ks.jsonToTag = o;
1379
+ }, qo = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : typeof t == "object" && (t.nodeType === 3 || t.tagName === "#text" || !t.tagName && (t.textContent !== void 0 || t.text !== void 0)) ? document.createTextNode(t.textContent ?? t.text ?? "") : U(t), K = (t) => Array.isArray(t) ? t.map(qo).flat(1 / 0).filter(Boolean) : [], Ho = (t) => (t == null, t), zo = "http://www.w3.org/2000/svg", Mo = /* @__PURE__ */ new Set([
905
1380
  "svg",
906
1381
  "path",
907
1382
  "symbol",
@@ -928,425 +1403,100 @@ const ve = ({
928
1403
  "fegaussianblur",
929
1404
  "femerge",
930
1405
  "femergenode"
931
- ]), Fe = ({ inTagName: t }) => {
932
- const e = t == null ? void 0 : t.toLowerCase();
933
- if (!e) return null;
934
- if (e === "checkbox") {
935
- const r = document.createElement("input");
936
- return r.type = "checkbox", r;
1406
+ ]), Go = ({ inTagName: t }) => {
1407
+ const o = t == null ? void 0 : t.toLowerCase();
1408
+ if (!o) return null;
1409
+ if (o === "checkbox") {
1410
+ const e = document.createElement("input");
1411
+ return e.type = "checkbox", e;
937
1412
  }
938
- return Re.has(e) ? document.createElementNS(De, e) : document.createElement(e);
939
- }, Me = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), He = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), Ve = "http://www.w3.org/1999/xlink", Ge = ({ inElement: t, inAttributes: e }) => {
940
- const r = t, s = e;
941
- if (!r || !s || typeof s != "object")
942
- return r;
943
- const a = typeof SVGElement < "u" ? r instanceof SVGElement : r.namespaceURI === "http://www.w3.org/2000/svg";
944
- return Object.entries(s).forEach(([n, i]) => {
1413
+ return Mo.has(o) ? document.createElementNS(zo, o) : document.createElement(o);
1414
+ }, Ko = ({ inElement: t, inTextContent: o }) => (!t || o === void 0 || o === null || (t.textContent = o), t), Uo = ({ inElement: t, inProperties: o }) => (t && o && typeof o == "object" && Object.assign(t, o), t), Jo = "http://www.w3.org/1999/xlink", _o = ({ inElement: t, inAttributes: o }) => {
1415
+ const e = t, r = o;
1416
+ if (!e || !r || typeof r != "object")
1417
+ return e;
1418
+ const a = typeof SVGElement < "u" ? e instanceof SVGElement : e.namespaceURI === "http://www.w3.org/2000/svg";
1419
+ return Object.entries(r).forEach(([n, s]) => {
945
1420
  if (n === "class") {
946
- a ? r.setAttribute("class", String(i)) : r.className = i;
1421
+ a ? e.setAttribute("class", String(s)) : e.className = s;
947
1422
  return;
948
1423
  }
949
1424
  if (n === "xlink:href" || n === "href") {
950
- if (i != null) {
951
- const d = String(i);
1425
+ if (s != null) {
1426
+ const i = String(s);
952
1427
  if (a)
953
1428
  try {
954
- r.setAttributeNS(Ve, "href", d);
1429
+ e.setAttributeNS(Jo, "href", i);
955
1430
  } catch {
956
1431
  }
957
- r.setAttribute("href", d), r.setAttribute("xlink:href", d);
1432
+ e.setAttribute("href", i), e.setAttribute("xlink:href", i);
958
1433
  }
959
1434
  return;
960
1435
  }
961
- if (typeof i == "boolean") {
962
- i ? r.setAttribute(n, "") : r.removeAttribute(n);
1436
+ if (typeof s == "boolean") {
1437
+ s ? e.setAttribute(n, "") : e.removeAttribute(n);
963
1438
  return;
964
1439
  }
965
- i != null && r.setAttribute(n, String(i));
966
- }), r;
967
- }, Ke = ({ inElement: t, inClassList: e }) => {
968
- if (!t || !e) return t;
969
- const r = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((s) => typeof s == "string" && s.trim()) : [];
970
- return r.length && t.classList.add(...r), t;
971
- }, ze = (t) => {
1440
+ s != null && e.setAttribute(n, String(s));
1441
+ }), e;
1442
+ }, Xo = ({ inElement: t, inClassList: o }) => {
1443
+ if (!t || !o) return t;
1444
+ const e = typeof o == "string" ? o.split(/\s+/).filter(Boolean) : Array.isArray(o) ? o.filter((r) => typeof r == "string" && r.trim()) : [];
1445
+ return e.length && t.classList.add(...e), t;
1446
+ }, Qo = (t) => {
972
1447
  if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
973
- const e = Fe({ inTagName: t.tagName });
974
- if (!e) return null;
975
- if (Me({
976
- inElement: e,
977
- inTextContent: Pe(t.textContent),
1448
+ const o = Go({ inTagName: t.tagName });
1449
+ if (!o) return null;
1450
+ if (Ko({
1451
+ inElement: o,
1452
+ inTextContent: Ho(t.textContent),
978
1453
  inTagName: t.tagName
979
- }), He({
980
- inElement: e,
1454
+ }), Uo({
1455
+ inElement: o,
981
1456
  inProperties: t.properties
982
- }), Ge({
983
- inElement: e,
1457
+ }), _o({
1458
+ inElement: o,
984
1459
  inAttributes: t.attributes
985
- }), Ke({
986
- inElement: e,
1460
+ }), Xo({
1461
+ inElement: o,
987
1462
  inClassList: t.classList
988
1463
  }), Array.isArray(t.children)) {
989
- const r = X(t.children);
990
- r.length && e.append(...r);
1464
+ const e = K(t.children);
1465
+ e.length && o.append(...e);
991
1466
  }
992
- return e;
993
- }, Q = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? X(t) : typeof t == "object" ? ze(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, We = "./tags.schema.json", _e = {
994
- allowsTextContent: !1,
995
- allowsChildren: !0,
996
- allowedAttributes: [
997
- "title",
998
- "role"
999
- ],
1000
- childTags: []
1001
- }, qe = {
1002
- allowsTextContent: !1,
1003
- allowsChildren: !1,
1004
- allowedAttributes: [
1005
- "type",
1006
- "placeholder",
1007
- "value",
1008
- "name",
1009
- "disabled",
1010
- "readonly",
1011
- "required",
1012
- "list"
1013
- ]
1014
- }, Oe = {
1015
- allowsTextContent: !1,
1016
- allowsChildren: !1,
1017
- allowedAttributes: [
1018
- "type",
1019
- "checked",
1020
- "name",
1021
- "value",
1022
- "disabled",
1023
- "required"
1024
- ]
1025
- }, Je = {
1026
- allowsTextContent: !1,
1027
- allowsChildren: !0,
1028
- allowedAttributes: [
1029
- "span"
1030
- ],
1031
- childTags: [
1032
- "col"
1033
- ]
1034
- }, Ue = {
1035
- allowsTextContent: !1,
1036
- allowsChildren: !1,
1037
- allowedAttributes: [
1038
- "span",
1039
- "style",
1040
- "width"
1041
- ]
1042
- }, Xe = {
1043
- allowsTextContent: !0,
1044
- allowsChildren: !0,
1045
- allowedAttributes: [
1046
- "for"
1047
- ],
1048
- childTags: []
1049
- }, Qe = {
1050
- allowsTextContent: !1,
1051
- allowsChildren: !0,
1052
- allowedAttributes: [
1053
- "action",
1054
- "method",
1055
- "autocomplete",
1056
- "enctype",
1057
- "name",
1058
- "novalidate",
1059
- "target"
1060
- ],
1061
- childTags: []
1062
- }, Ye = {
1063
- allowsTextContent: !1,
1064
- allowsChildren: !0,
1065
- allowedAttributes: [
1066
- "name",
1067
- "disabled",
1068
- "required",
1069
- "multiple",
1070
- "size"
1071
- ],
1072
- childTags: [
1073
- "option"
1074
- ]
1075
- }, Ze = {
1076
- allowsTextContent: !0,
1077
- allowsChildren: !0,
1078
- allowedAttributes: [],
1079
- childTags: []
1080
- }, tr = {
1081
- allowsTextContent: !0,
1082
- allowsChildren: !0,
1083
- allowedAttributes: [],
1084
- childTags: []
1085
- }, er = {
1086
- allowsTextContent: !0,
1087
- allowsChildren: !0,
1088
- allowedAttributes: [],
1089
- childTags: []
1090
- }, rr = {
1091
- allowsTextContent: !0,
1092
- allowsChildren: !0,
1093
- allowedAttributes: [],
1094
- childTags: []
1095
- }, sr = {
1096
- allowsTextContent: !1,
1097
- allowsChildren: !1,
1098
- allowedAttributes: [
1099
- "src",
1100
- "alt",
1101
- "width",
1102
- "height",
1103
- "loading"
1104
- ]
1105
- }, nr = {
1106
- allowsTextContent: !0,
1107
- allowsChildren: !0,
1108
- allowedAttributes: [
1109
- "type",
1110
- "disabled",
1111
- "name",
1112
- "value"
1113
- ],
1114
- childTags: []
1115
- }, or = {
1116
- allowsTextContent: !1,
1117
- allowsChildren: !0,
1118
- allowedAttributes: [
1119
- "border",
1120
- "cellpadding",
1121
- "cellspacing"
1122
- ],
1123
- childTags: [
1124
- "caption",
1125
- "colgroup",
1126
- "thead",
1127
- "tbody",
1128
- "tfoot",
1129
- "tr"
1130
- ]
1131
- }, ar = {
1132
- allowsTextContent: !1,
1133
- allowsChildren: !0,
1134
- allowedAttributes: [],
1135
- childTags: [
1136
- "tr"
1137
- ]
1138
- }, lr = {
1139
- allowsTextContent: !1,
1140
- allowsChildren: !0,
1141
- allowedAttributes: [],
1142
- childTags: [
1143
- "tr"
1144
- ]
1145
- }, ir = {
1146
- allowsTextContent: !1,
1147
- allowsChildren: !0,
1148
- allowedAttributes: [],
1149
- childTags: [
1150
- "tr"
1151
- ]
1152
- }, cr = {
1153
- allowsTextContent: !1,
1154
- allowsChildren: !0,
1155
- allowedAttributes: [],
1156
- childTags: [
1157
- "td",
1158
- "th"
1159
- ]
1160
- }, ur = {
1161
- allowsTextContent: !0,
1162
- allowsChildren: !0,
1163
- allowedAttributes: [
1164
- "scope",
1165
- "colspan",
1166
- "rowspan"
1167
- ],
1168
- childTags: []
1169
- }, dr = {
1170
- allowsTextContent: !0,
1171
- allowsChildren: !0,
1172
- allowedAttributes: [
1173
- "colspan",
1174
- "rowspan"
1175
- ],
1176
- childTags: []
1177
- }, br = {
1178
- allowsTextContent: !1,
1179
- allowsChildren: !0,
1180
- allowedAttributes: [],
1181
- childTags: [
1182
- "option"
1183
- ]
1184
- }, pr = {
1185
- allowsTextContent: !0,
1186
- allowsChildren: !1,
1187
- allowedAttributes: [
1188
- "value",
1189
- "label",
1190
- "selected",
1191
- "disabled"
1192
- ]
1193
- }, fr = {
1194
- allowsTextContent: !1,
1195
- allowsChildren: !0,
1196
- allowedAttributes: [
1197
- "role"
1198
- ],
1199
- childTags: []
1200
- }, hr = {
1201
- allowsTextContent: !0,
1202
- allowsChildren: !0,
1203
- allowedAttributes: [
1204
- "href",
1205
- "target",
1206
- "rel",
1207
- "title",
1208
- "download"
1209
- ],
1210
- childTags: []
1211
- }, yr = {
1212
- allowsTextContent: !0,
1213
- allowsChildren: !0,
1214
- allowedAttributes: [
1215
- "aria-hidden"
1216
- ],
1217
- childTags: []
1218
- }, mr = {
1219
- allowsTextContent: !0,
1220
- allowsChildren: !0,
1221
- allowedAttributes: [],
1222
- childTags: []
1223
- }, wr = {
1224
- allowsTextContent: !1,
1225
- allowsChildren: !0,
1226
- allowedAttributes: [
1227
- "type"
1228
- ],
1229
- childTags: [
1230
- "li"
1231
- ]
1232
- }, gr = {
1233
- allowsTextContent: !0,
1234
- allowsChildren: !0,
1235
- allowedAttributes: [
1236
- "value"
1237
- ],
1238
- childTags: []
1239
- }, Tr = {
1240
- allowsTextContent: !1,
1241
- allowsChildren: !1,
1242
- allowedAttributes: []
1243
- }, Cr = {
1244
- $schema: We,
1245
- div: _e,
1246
- input: qe,
1247
- checkbox: Oe,
1248
- colgroup: Je,
1249
- col: Ue,
1250
- label: Xe,
1251
- form: Qe,
1252
- select: Ye,
1253
- p: Ze,
1254
- h1: tr,
1255
- h2: er,
1256
- span: rr,
1257
- img: sr,
1258
- button: nr,
1259
- table: or,
1260
- thead: ar,
1261
- tbody: lr,
1262
- tfoot: ir,
1263
- tr: cr,
1264
- th: ur,
1265
- td: dr,
1266
- datalist: br,
1267
- option: pr,
1268
- header: fr,
1269
- a: hr,
1270
- i: yr,
1271
- small: mr,
1272
- ul: wr,
1273
- li: gr,
1274
- hr: Tr
1275
- }, E = ({ inSpec: t }) => {
1276
- const e = t;
1277
- if (!e) return [];
1278
- if (Array.isArray(e))
1279
- return e.flatMap((s) => E({ inSpec: s }));
1280
- if (typeof e != "object") return [];
1281
- const r = [];
1282
- return typeof e.tagName == "string" && e.tagName.trim().length > 0 && r.push(e.tagName.toLowerCase()), Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((s) => {
1283
- const a = E({ inSpec: s });
1284
- r.push(...a);
1285
- }), r;
1286
- }, Ar = ({ inTagsFound: t, inAllowedTags: e }) => {
1287
- const r = t ?? [], s = e ?? {}, a = new Set(
1288
- Object.keys(s).filter((l) => l !== "$schema").map((l) => l.toLowerCase())
1289
- ), n = {}, i = [], d = [];
1290
- r.forEach((l) => {
1291
- n[l] = (n[l] || 0) + 1, a.has(l) ? i.includes(l) || i.push(l) : d.includes(l) || d.push(l);
1292
- });
1293
- const o = r.length, u = d.length === 0;
1294
- return {
1295
- totalTags: o,
1296
- tagCounts: n,
1297
- uniqueTags: Object.keys(n),
1298
- recognizedTags: i,
1299
- unrecognizedTags: d,
1300
- areAllTagsPresent: u
1301
- };
1302
- }, xr = ({ inSpec: t, inTags: e = Cr } = {}) => {
1303
- const r = t, s = e, a = E({ inSpec: r }), n = Ar({
1304
- inTagsFound: a,
1305
- inAllowedTags: s
1306
- });
1307
- return {
1308
- areAllTagsPresent: n.areAllTagsPresent,
1309
- totalTags: n.totalTags,
1310
- tagCounts: n.tagCounts,
1311
- uniqueTags: n.uniqueTags,
1312
- recognizedTags: n.recognizedTags,
1313
- unrecognizedTags: n.unrecognizedTags
1314
- };
1315
- }, Y = (t = {}) => {
1316
- const e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
1317
- return Q(e);
1467
+ return o;
1468
+ }, U = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? K(t) : typeof t == "object" ? Qo(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, J = (t = {}) => {
1469
+ const o = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
1470
+ return U(o);
1318
1471
  };
1319
- Ee({
1320
- inFuncDefinition: Y,
1321
- inReviewSpec: xr
1322
- });
1323
- const Nr = ({
1472
+ Wo(J);
1473
+ const Yo = ({
1324
1474
  inSpec: t,
1325
- inTargetHtmlId: e,
1326
- inAppendPosition: r,
1327
- inShowLog: s = !1
1475
+ inTargetHtmlId: o,
1476
+ inAppendPosition: e,
1477
+ inShowLog: r = !1
1328
1478
  } = {}) => {
1329
- const a = t, n = e, i = r, d = s, o = Y(a);
1330
- d && console.log("renderToDom 1 (content):", o);
1331
- const u = document.getElementById(n);
1332
- return u ? (Array.isArray(o) || o instanceof NodeList || o instanceof HTMLCollection ? i === "prepend" ? u.prepend(...o) : u.append(...o) : i === "prepend" ? u.prepend(o) : (u.innerHTML = "", u.append(o)), d && console.log("renderToDom 2 (mounted):", u), u) : null;
1333
- }, $r = (t = {}) => {
1334
- T(t), (t == null ? void 0 : t.showLog) && console.log("first : ", t == null ? void 0 : t.columns, t == null ? void 0 : t.data, t == null ? void 0 : t.appendPosition);
1335
- const r = ve({
1479
+ const a = t, n = o, s = e, i = r, l = J(a);
1480
+ i && console.log("renderToDom 1 (content):", l);
1481
+ const c = document.getElementById(n);
1482
+ return c ? (Array.isArray(l) || l instanceof NodeList || l instanceof HTMLCollection ? s === "prepend" ? c.prepend(...l) : c.append(...l) : s === "prepend" ? c.prepend(l) : (c.innerHTML = "", c.append(l)), i && console.log("renderToDom 2 (mounted):", c), c) : null;
1483
+ }, Zo = (t = {}) => {
1484
+ $(t), (t == null ? void 0 : t.showLog) && console.log("first : ", t == null ? void 0 : t.columns, t == null ? void 0 : t.data, t == null ? void 0 : t.appendPosition);
1485
+ const e = Oo({
1336
1486
  inColumns: t.columns,
1337
1487
  inData: t.data,
1338
1488
  inType: t.type,
1339
1489
  inShowLog: t.showLog
1340
1490
  });
1341
- return Nr({
1342
- inSpec: r,
1491
+ return Yo({
1492
+ inSpec: e,
1343
1493
  inTargetHtmlId: t.targetHtmlId,
1344
1494
  inAppendPosition: t.appendPosition,
1345
1495
  inShowLog: t.showLog
1346
1496
  });
1347
1497
  };
1348
- rt($r);
1498
+ Y(Zo);
1349
1499
  export {
1350
- $r as default,
1351
- $r as render
1500
+ Zo as default,
1501
+ Zo as render
1352
1502
  };