json-renderers 1.18.5 → 1.18.7

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,60 +1,60 @@
1
- const Q = {
1
+ const ct = {
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
- }, Y = (t) => {
5
- const o = t;
6
- typeof globalThis > "u" || !o || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderers = {
7
- meta: Q,
8
- render: o
4
+ }, ut = (t) => {
5
+ const a = t;
6
+ typeof globalThis > "u" || !a || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderers = {
7
+ meta: ct,
8
+ render: a
9
9
  });
10
- }, Z = (t) => {
11
- const o = (t == null ? void 0 : t.inConfig) ?? t;
12
- if (!o || typeof o != "object")
10
+ }, dt = (t) => {
11
+ const a = (t == null ? void 0 : t.inConfig) ?? t;
12
+ if (!a || typeof a != "object")
13
13
  throw new TypeError("Config must be an object");
14
- const e = o.type;
14
+ const e = a.type;
15
15
  if (e === void 0)
16
16
  throw new Error('Missing compulsory key: "type"');
17
17
  if (typeof e != "string")
18
18
  throw new TypeError("type must be a string");
19
19
  return !0;
20
- }, tt = (t) => {
21
- const o = (t == null ? void 0 : t.inConfig) ?? t;
22
- if (!o || typeof o != "object")
20
+ }, bt = (t) => {
21
+ const a = (t == null ? void 0 : t.inConfig) ?? t;
22
+ if (!a || typeof a != "object")
23
23
  throw new TypeError("Config must be an object");
24
- const e = o.data;
24
+ const e = a.data;
25
25
  if (e === void 0)
26
26
  throw new Error('Missing compulsory key: "data"');
27
27
  if (!Array.isArray(e))
28
28
  throw new TypeError("data must be an Array");
29
29
  return !0;
30
- }, et = (t) => {
31
- const o = (t == null ? void 0 : t.inConfig) ?? t;
32
- if (!o || typeof o != "object")
30
+ }, pt = (t) => {
31
+ const a = (t == null ? void 0 : t.inConfig) ?? t;
32
+ if (!a || typeof a != "object")
33
33
  throw new TypeError("Config must be an object");
34
- const e = o.columns;
34
+ const e = a.columns;
35
35
  if (e === void 0)
36
36
  throw new Error('Missing compulsory key: "columns"');
37
37
  if (!Array.isArray(e))
38
38
  throw new TypeError("columns must be an Array");
39
39
  return !0;
40
- }, ot = (t) => {
41
- const o = (t == null ? void 0 : t.inConfig) ?? t;
42
- if (!o || typeof o != "object")
40
+ }, mt = (t) => {
41
+ const a = (t == null ? void 0 : t.inConfig) ?? t;
42
+ if (!a || typeof a != "object")
43
43
  throw new TypeError("Config must be an object");
44
- const e = o.showLog;
44
+ const e = a.showLog;
45
45
  if (e !== void 0 && typeof e != "boolean")
46
46
  throw new TypeError("showLog must be a boolean");
47
47
  return !0;
48
- }, x = (t) => {
49
- const o = (t == null ? void 0 : t.inConfig) ?? t;
50
- if (!o || typeof o != "object" || Array.isArray(o))
48
+ }, T = (t) => {
49
+ const a = (t == null ? void 0 : t.inConfig) ?? t;
50
+ if (!a || typeof a != "object" || Array.isArray(a))
51
51
  throw new TypeError("Config must be an 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")
52
+ return dt(a), bt(a), pt(a), mt(a), !0;
53
+ }, ft = (t) => {
54
+ const a = (t == null ? void 0 : t.inConfig) ?? t;
55
+ if (!a || typeof a != "object")
56
56
  throw new TypeError("Config must be an object");
57
- const e = o.targetHtmlId;
57
+ const e = a.targetHtmlId;
58
58
  if (e === void 0)
59
59
  throw new Error('Missing compulsory key: "targetHtmlId"');
60
60
  if (typeof e != "string")
@@ -62,102 +62,102 @@ const Q = {
62
62
  if (e.trim().length === 0)
63
63
  throw new Error("targetHtmlId must be a non-empty string");
64
64
  return !0;
65
- }, nt = (t) => {
66
- const o = (t == null ? void 0 : t.inConfig) ?? t;
67
- if (!o || typeof o != "object")
65
+ }, ht = (t) => {
66
+ const a = (t == null ? void 0 : t.inConfig) ?? t;
67
+ if (!a || typeof a != "object")
68
68
  throw new TypeError("Config must be an object");
69
- const e = o.appendPosition;
69
+ const e = a.appendPosition;
70
70
  if (e === void 0)
71
71
  throw new Error('Missing compulsory key: "appendPosition"');
72
72
  if (typeof e != "string")
73
73
  throw new TypeError("appendPosition must be a string");
74
74
  return !0;
75
- }, at = (t) => {
76
- const o = (t == null ? void 0 : t.inConfig) ?? t;
77
- if (!o || typeof o != "object")
75
+ }, yt = (t) => {
76
+ const a = (t == null ? void 0 : t.inConfig) ?? t;
77
+ if (!a || typeof a != "object")
78
78
  throw new TypeError("Config must be an object");
79
- const e = o.classToApply;
79
+ const e = a.classToApply;
80
80
  if (e === void 0)
81
81
  throw new Error('Missing compulsory key: "classToApply"');
82
82
  if (typeof e != "string")
83
83
  throw new TypeError("classToApply must be a string");
84
84
  return !0;
85
- }, L = (t) => {
86
- const o = (t == null ? void 0 : t.inConfig) ?? t;
87
- if (!o || typeof o != "object" || Array.isArray(o))
85
+ }, z = (t) => {
86
+ const a = (t == null ? void 0 : t.inConfig) ?? t;
87
+ if (!a || typeof a != "object" || Array.isArray(a))
88
88
  throw new TypeError("Config must be an object");
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 };
89
+ return ft(a), ht(a), yt(a), !0;
90
+ }, Ct = "table", $t = "", gt = [], wt = [], Nt = "", xt = "replace", Tt = !1, $ = {
91
+ type: Ct,
92
+ targetHtmlId: $t,
93
+ data: gt,
94
+ columns: wt,
95
+ classToApply: Nt,
96
+ appendPosition: xt,
97
+ showLog: Tt
98
+ }, G = (t) => {
99
+ const a = typeof t == "object" && t !== null ? t.inKey ?? t.key : t;
100
+ return a && a in $ ? $[a] : { ...$ };
101
101
  };
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))
102
+ Object.assign(G, $);
103
+ const g = (t) => {
104
+ const a = (t == null ? void 0 : t.inConfig) ?? t;
105
+ if (!a || typeof a != "object" || Array.isArray(a))
106
106
  throw new TypeError("Config must be an object");
107
- return x(o), L(o), !0;
107
+ return T(a), z(a), !0;
108
108
  };
109
- $.getSpec = P;
110
- $.configSpec = w;
111
- $.guardSpec = x;
112
- $.guardMount = L;
113
- const pt = {
109
+ g.getSpec = G;
110
+ g.configSpec = $;
111
+ g.guardSpec = T;
112
+ g.guardMount = z;
113
+ const At = {
114
114
  version: "1.22.0",
115
115
  name: "json-renderers-build"
116
- }, mt = (t) => {
116
+ }, kt = (t) => {
117
117
  t && (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuild = {
118
- meta: pt,
118
+ meta: At,
119
119
  render: t
120
120
  });
121
- }, ft = (t) => typeof t == "object" && t !== null && !Array.isArray(t), ht = (t, o) => {
122
- if (!ft(t)) return;
121
+ }, It = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Ft = (t, a) => {
122
+ if (!It(t)) return;
123
123
  let e = {};
124
- for (const [r, a] of Object.entries(t))
125
- e[r] = m(o, a);
124
+ for (const [o, n] of Object.entries(t))
125
+ e[o] = h(a, n);
126
126
  return e;
127
- }, yt = (t, o) => {
127
+ }, Pt = (t, a) => {
128
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;
129
+ return Array.isArray(e) ? e.map((n) => h(a, n)) : void 0;
130
+ }, M = (t, a, e) => {
131
+ if (t === "${agg:count}" && "rowData" in a) {
132
+ if (Array.isArray(a == null ? void 0 : a.rowData))
133
+ return a == null ? void 0 : a.rowData.length;
134
134
  } else
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)
135
+ return t === "${rowValue}" && "rowData" in a ? a == null ? void 0 : a.rowData : t.replace(/\$\{(\w+)\}/g, (o, n) => a[n] !== void 0 ? a[n] : o);
136
+ }, jt = (t, a) => M(t, a), Bt = (t, a, e) => {
137
+ if (e && console.log("inElement : ", t), e && console.log("inTemplate : ", a), a == null)
138
138
  throw new TypeError("inTemplate is required");
139
- if (typeof o != "object" && typeof o != "string")
139
+ if (typeof a != "object" && typeof a != "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
- }, $t = {
144
+ }, vt = {
145
145
  name: "json-transformer-funcs-primitive",
146
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,
147
+ }, St = (t) => {
148
+ var a, e;
149
+ typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (a = globalThis.ks).applyTemplate ?? (a.applyTemplate = t), (e = globalThis.ks).transformerFuncs ?? (e.transformerFuncs = {}), globalThis.ks.transformerFuncs.primitive = {
150
+ meta: vt,
151
151
  applyTemplate: t
152
152
  });
153
- }, m = (t, o, e) => {
154
- const r = t, a = o;
155
- wt(r, a, e);
156
- const n = structuredClone(a);
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);
153
+ }, h = (t, a, e) => {
154
+ const o = t, n = a;
155
+ Bt(o, n, e);
156
+ const r = structuredClone(n);
157
+ return typeof r == "string" ? M(r, o) : (r === null || typeof r != "object" || ("textContent" in r && (r.textContent = jt(r == null ? void 0 : r.textContent, o)), "attributes" in r && (r.attributes = Ft(r == null ? void 0 : r.attributes, o)), "children" in r && (r.children = Pt(r == null ? void 0 : r.children, o))), r);
158
158
  };
159
- gt(m);
160
- const Nt = (t, o) => {
159
+ St(h);
160
+ const Rt = (t, a) => {
161
161
  if (!Array.isArray(t))
162
162
  throw new TypeError("inSource must be an Array");
163
163
  if (t.length === 0)
@@ -165,87 +165,76 @@ const Nt = (t, o) => {
165
165
  for (let e = 0; e < t.length; e++)
166
166
  if (!t[e] || typeof t[e] != "object")
167
167
  throw new TypeError(`inSource[${e}] must be an object`);
168
- if (!o || typeof o != "object" && typeof o != "string")
168
+ if (!a || typeof a != "object" && typeof a != "string")
169
169
  throw new TypeError("inTemplate must be an object or string");
170
170
  return !0;
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;
171
+ }, p = (t, a) => {
172
+ const e = t, o = a;
173
+ return Rt(e, o), e.map((n) => h(n, o));
174
+ }, Et = (t, a) => t.map((o) => ({
175
+ ...o,
176
+ rowData: a[o.columnName]
177
+ })), Lt = (t, a, e) => {
178
+ var n, r, s, l, i, u;
179
179
  if (!Array.isArray(t))
180
180
  throw new TypeError("inColumns must be an Array");
181
181
  if (t.length === 0)
182
182
  throw new Error("inColumns cannot be empty");
183
- for (let u = 0; u < t.length; u++) {
184
- const d = t[u];
183
+ for (let c = 0; c < t.length; c++) {
184
+ const d = t[c];
185
185
  if (!d || typeof d != "object")
186
- throw new TypeError(`inColumns[${u}] must be an object`);
186
+ throw new TypeError(`inColumns[${c}] must be an object`);
187
187
  if (typeof d.columnName != "string" || !d.columnName.trim())
188
- throw new TypeError(`inColumns[${u}].columnName must be a non-empty string`);
188
+ throw new TypeError(`inColumns[${c}].columnName must be a non-empty string`);
189
189
  }
190
- if (!Array.isArray(o))
190
+ if (!Array.isArray(a))
191
191
  throw new TypeError("inData must be an Array");
192
- for (let u = 0; u < o.length; u++) {
193
- const d = o[u];
192
+ for (let c = 0; c < a.length; c++) {
193
+ const d = a[c];
194
194
  if (!d || typeof d != "object")
195
- throw new TypeError(`inData[${u}] must be an object`);
195
+ throw new TypeError(`inData[${c}] must be an object`);
196
196
  }
197
197
  if (!e || typeof e != "object" || Array.isArray(e))
198
198
  throw new TypeError("inSpec must be an object");
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`);
199
+ const o = ((s = (r = (n = t[0]) == null ? void 0 : n.template) == null ? void 0 : r.body) == null ? void 0 : s.tr) || "buildBodyTr";
200
+ if (!(o in e))
201
+ throw new Error(`Row template "${o}" not found in inSpec`);
202
+ for (let c = 0; c < t.length; c++) {
203
+ const d = t[c], m = ((i = (l = d.template) == null ? void 0 : l.body) == null ? void 0 : i.cell) || ((u = d.template) == null ? void 0 : u.bodyCell) || "buildBodyCell";
204
+ if (!(m in e))
205
+ throw new Error(`Cell template "${m}" for column "${d.columnName}" not found in inSpec`);
206
206
  }
207
207
  return !0;
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];
216
- return a.map((b) => {
217
- const C = m(b, i), _ = xt(r, b), X = At(_, n);
218
- return C.children = X, C;
208
+ }, Dt = (t, a) => t.map((o) => {
209
+ var l, i, u;
210
+ const n = ((i = (l = o.template) == null ? void 0 : l.body) == null ? void 0 : i.cell) || ((u = o.template) == null ? void 0 : u.bodyCell) || "buildBodyCell", r = a[n];
211
+ return h(o, r);
212
+ }), w = (t, a, e) => {
213
+ var u, c, d;
214
+ Lt(t, a, e);
215
+ const o = t, n = a, r = e, s = ((d = (c = (u = o[0]) == null ? void 0 : u.template) == null ? void 0 : c.body) == null ? void 0 : d.tr) || "buildBodyTr", l = r[s];
216
+ return n.map((m) => {
217
+ const C = h(m, l), lt = Et(o, m), it = Dt(lt, r);
218
+ return C.children = it, C;
219
219
  });
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);
225
- if (a) return a;
226
- }
227
- return null;
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 = {
220
+ }, Ot = {
232
221
  tagName: "tr",
233
222
  attributes: {
234
223
  class: "align-middle"
235
224
  },
236
225
  children: []
237
- }, jt = {
226
+ }, Kt = {
238
227
  tagName: "col",
239
228
  attributes: {
240
229
  width: "${width}"
241
230
  }
242
- }, Ft = {
231
+ }, Vt = {
243
232
  tagName: "th",
244
233
  textContent: "${columnName}",
245
234
  attributes: {
246
235
  class: "py-3 px-3 fw-semibold text-uppercase small"
247
236
  }
248
- }, Bt = {
237
+ }, Wt = {
249
238
  tagName: "td",
250
239
  children: [
251
240
  {
@@ -254,23 +243,25 @@ const Nt = (t, o) => {
254
243
  type: "text",
255
244
  placeholder: "enter ${columnName}",
256
245
  name: "${columnName}",
246
+ id: "${columnName}",
247
+ list: "${columnName}",
257
248
  class: "form-control"
258
249
  }
259
250
  }
260
251
  ]
261
- }, vt = {
252
+ }, qt = {
262
253
  tagName: "td",
263
254
  textContent: "${rowValue}",
264
255
  attributes: {
265
256
  class: "py-3 px-3 text-secondary"
266
257
  }
267
- }, St = {
258
+ }, Ht = {
268
259
  tagName: "button",
269
260
  textContent: "${columnName}",
270
261
  attributes: {
271
262
  class: "btn btn-primary btn-sm"
272
263
  }
273
- }, Et = {
264
+ }, zt = {
274
265
  tagName: "td",
275
266
  attributes: {
276
267
  class: "py-2 px-3 text-center"
@@ -284,38 +275,38 @@ const Nt = (t, o) => {
284
275
  }
285
276
  }
286
277
  ]
287
- }, Rt = {
278
+ }, Gt = {
288
279
  tagName: "option",
289
280
  textContent: "${rowValue}",
290
281
  attributes: {
291
282
  value: "${rowValue}"
292
283
  }
293
- }, Lt = {
284
+ }, Mt = {
294
285
  tagName: "select",
295
286
  attributes: {
296
287
  id: "LedgerName"
297
288
  },
298
289
  children: []
299
- }, Pt = {
290
+ }, Ut = {
300
291
  tagName: "datalist",
301
292
  attributes: {
302
293
  "data-name": "${columnName}"
303
294
  },
304
295
  children: []
305
- }, j = {
306
- buildBodyTr: kt,
307
- buildColGroup: jt,
308
- buildHeader: Ft,
309
- buildFooter: Bt,
310
- buildBodyCell: vt,
311
- button: St,
312
- buttonCell: Et,
313
- buildOption: Rt,
314
- buildSelect: Lt,
315
- buildDataList: Pt
316
- }, Dt = "table", Ot = {
296
+ }, b = {
297
+ buildBodyTr: Ot,
298
+ buildColGroup: Kt,
299
+ buildHeader: Vt,
300
+ buildFooter: Wt,
301
+ buildBodyCell: qt,
302
+ button: Ht,
303
+ buttonCell: zt,
304
+ buildOption: Gt,
305
+ buildSelect: Mt,
306
+ buildDataList: Ut
307
+ }, Jt = "table", _t = {
317
308
  class: "table table-hover table-striped align-middle border mb-0"
318
- }, Vt = [
309
+ }, Xt = [
319
310
  {
320
311
  tagName: "colgroup",
321
312
  attributes: {
@@ -361,11 +352,11 @@ const Nt = (t, o) => {
361
352
  }
362
353
  ]
363
354
  }
364
- ], V = {
365
- tagName: Dt,
366
- attributes: Ot,
367
- children: Vt
368
- }, Wt = [
355
+ ], U = {
356
+ tagName: Jt,
357
+ attributes: _t,
358
+ children: Xt
359
+ }, Qt = [
369
360
  {
370
361
  narration: "Build the column widths for the table using the configured columns.",
371
362
  destinationPath: {
@@ -402,7 +393,7 @@ const Nt = (t, o) => {
402
393
  templateKey: "buildHeader",
403
394
  func: "fromCollection"
404
395
  }
405
- ], qt = [
396
+ ], Yt = [
406
397
  {
407
398
  narration: "Build the table body rows for the table using the configured columns and data.",
408
399
  destinationPath: {
@@ -420,154 +411,461 @@ const Nt = (t, o) => {
420
411
  },
421
412
  func: "twoDimensional"
422
413
  }
423
- ], g = (t) => Array.isArray(t) ? t : [t], B = {
424
- set: (t, o, e) => {
425
- t[o] = e;
414
+ ], y = (t, a) => {
415
+ var e;
416
+ if (((e = t == null ? void 0 : t.attributes) == null ? void 0 : e["data-role"]) === a) return t;
417
+ for (const o of (t == null ? void 0 : t.children) ?? []) {
418
+ const n = y(o, a);
419
+ if (n) return n;
420
+ }
421
+ return null;
422
+ }, Zt = (t, a) => {
423
+ const e = t[a.fileName], o = a.dataRole ? y(e, a.dataRole) : e;
424
+ return (a.filePath ?? []).reduce((n, r) => n[r], o);
425
+ }, A = (t) => Array.isArray(t) ? t : [t], J = (t, a, e) => {
426
+ t[a] = e;
427
+ }, te = (t, a, e) => {
428
+ t[a].push(...A(e));
429
+ }, ee = (t, a, e) => {
430
+ t[a].unshift(...A(e));
431
+ }, ae = (t, a, e) => {
432
+ t[a].forEach((o) => {
433
+ o.children.push(...structuredClone(A(e)));
434
+ });
435
+ }, oe = (t, a, e) => {
436
+ t[a].forEach((o) => {
437
+ o.children.unshift(...structuredClone(A(e)));
438
+ });
439
+ }, ne = (t, a, e) => {
440
+ t[a].forEach((o, n) => {
441
+ const r = structuredClone(e);
442
+ r.textContent = n + 1, o.children.unshift(r);
443
+ });
444
+ }, re = {
445
+ set: J,
446
+ push: te,
447
+ unshift: ee,
448
+ pushToRows: ae,
449
+ unshiftToRows: oe,
450
+ unshiftSerialToRows: ne
451
+ }, se = (t, a) => {
452
+ const e = a.dataRole ? y(t[a.fileName], a.dataRole) : t[a.fileName], o = [...a.filePath ?? []], n = o.pop();
453
+ return { parent: o.reduce((s, l) => s[l], e), key: n };
454
+ }, _ = (t, a, e) => {
455
+ const { parent: o, key: n } = se(t, a);
456
+ (re[a.action] || J)(o, n, e);
457
+ }, le = (t, a, e) => {
458
+ var r, s;
459
+ const o = !!((r = t.sourcePath) != null && r.fileName && Array.isArray((s = t.sourcePath) == null ? void 0 : s.filePath)), n = `structure/sourcePath: ${o ? "passed" : "failed"}`;
460
+ return e.push(n), a && console.log(n), o;
461
+ }, ie = (t, a, e) => {
462
+ var r, s;
463
+ const o = !!((r = t.destinationPath) != null && r.fileName && Array.isArray((s = t.destinationPath) == null ? void 0 : s.filePath)), n = `structure/destinationPath: ${o ? "passed" : "failed"}`;
464
+ return e.push(n), a && console.log(n), o;
465
+ }, ce = (t, a, e) => {
466
+ const o = t.templateKey === void 0 || typeof t.templateKey == "string" && t.templateKey.length > 0, n = `structure/templateKey: ${o ? "passed" : "failed"}`;
467
+ return e.push(n), a && console.log(n), o;
468
+ }, ue = (t, a, e) => {
469
+ const o = typeof t.func == "string" && t.func.length > 0, n = `structure/func: ${o ? "passed" : "failed"}`;
470
+ return e.push(n), a && console.log(n), o;
471
+ }, de = (t, a, e) => [
472
+ le(t, a, e),
473
+ ie(t, a, e),
474
+ ce(t, a, e),
475
+ ue(t, a, e)
476
+ ].every(Boolean), be = (t, a, e, o) => {
477
+ const n = typeof a[t.func] == "function", r = `references/func (${t.func}): ${n ? "passed" : "failed"}`;
478
+ return o.push(r), e && console.log(r), n;
479
+ }, pe = (t, a, e, o) => {
480
+ const n = t.templateKey === void 0 || Object.hasOwn(a, t.templateKey), r = `references/templateKey${t.templateKey === void 0 ? " (not used)" : ` (${t.templateKey})`}: ${n ? "passed" : "failed"}`;
481
+ return o.push(r), e && console.log(r), n;
482
+ }, me = (t, a, e, o, n) => {
483
+ const r = be(t, a, o, n), s = pe(t, e, o, n);
484
+ return r && s;
485
+ }, X = (t, a, e, o, n) => de(t, o, n) ? me(t, a, e, o, n) : !1, fe = (t, a, e, o, n, r) => {
486
+ if (!X(t, e, o, n, r)) return;
487
+ const s = o, l = t.templateKey, i = s[l];
488
+ console.log("templateKey ; ", l), console.log("localSpecKey ; ", i);
489
+ const u = Zt(a, t.sourcePath), c = e[t.func](u, i);
490
+ l === "buildFooter" && console.log("result ; ", c), _(a, t.destinationPath, c);
491
+ }, k = (t, a, e, o, n, r) => {
492
+ t.forEach((s) => {
493
+ fe(s, a, e, o, n, r);
494
+ });
495
+ }, he = (t, a, e, o, n, r) => {
496
+ if (!X(t, e, o, n, r)) return;
497
+ const s = e[t.func](
498
+ a.data.columns,
499
+ a.data.data,
500
+ o
501
+ );
502
+ _(a, t.destinationPath, s);
503
+ }, S = (t, a, e, o, n, r) => {
504
+ t.forEach((s) => {
505
+ he(s, a, e, o, n, r);
506
+ });
507
+ }, F = { data: {}, base: U, spec: b }, E = { fromCollection: p, twoDimensional: w }, ye = (t, a = !1, e = []) => (F.data = t, k(Qt, F, E, b, a, e), S(Yt, F, E, b, a, e), U), Ce = "table", $e = {
508
+ class: "table table-hover table-striped align-middle border mb-0"
509
+ }, ge = [
510
+ {
511
+ tagName: "colgroup",
512
+ attributes: {
513
+ "data-role": "table-colgroup"
514
+ },
515
+ children: []
516
+ },
517
+ {
518
+ tagName: "thead",
519
+ attributes: {
520
+ class: "table-dark",
521
+ "data-role": "table-header"
522
+ },
523
+ children: [
524
+ {
525
+ tagName: "tr",
526
+ attributes: {
527
+ "data-role": "table-header-row"
528
+ },
529
+ children: []
530
+ }
531
+ ]
532
+ },
533
+ {
534
+ tagName: "tbody",
535
+ attributes: {
536
+ "data-role": "table-body"
537
+ },
538
+ children: []
426
539
  },
427
- push: (t, o, e) => {
428
- t[o].push(...g(e));
540
+ {
541
+ tagName: "tfoot",
542
+ attributes: {
543
+ "data-role": "table-footer"
544
+ },
545
+ children: [
546
+ {
547
+ tagName: "tr",
548
+ attributes: {
549
+ "data-role": "table-footer-row"
550
+ },
551
+ children: []
552
+ }
553
+ ]
554
+ }
555
+ ], Q = {
556
+ tagName: Ce,
557
+ attributes: $e,
558
+ children: ge
559
+ }, we = [
560
+ {
561
+ narration: "Build the column widths for the table using the configured columns.",
562
+ destinationPath: {
563
+ fileName: "base",
564
+ dataRole: "table-colgroup",
565
+ filePath: [
566
+ "children"
567
+ ]
568
+ },
569
+ sourcePath: {
570
+ fileName: "data",
571
+ filePath: [
572
+ "columns"
573
+ ]
574
+ },
575
+ templateKey: "buildColGroup",
576
+ func: "fromCollection"
577
+ },
578
+ {
579
+ narration: "Build the header row for the table using the configured columns.",
580
+ destinationPath: {
581
+ fileName: "base",
582
+ dataRole: "table-header-row",
583
+ filePath: [
584
+ "children"
585
+ ]
586
+ },
587
+ sourcePath: {
588
+ fileName: "data",
589
+ filePath: [
590
+ "columns"
591
+ ]
592
+ },
593
+ templateKey: "buildHeader",
594
+ func: "fromCollection"
595
+ }
596
+ ], L = { data: {}, base: Q, spec: b }, Ne = { fromCollection: p }, xe = (t, a = !1, e = []) => (L.data = t, k(we, L, Ne, b, a, e), Q), Te = [], Y = {
597
+ children: Te
598
+ }, Ae = [
599
+ {
600
+ narration: "Build the table body rows for the table using the configured columns and data.",
601
+ destinationPath: {
602
+ fileName: "base",
603
+ filePath: [
604
+ "children"
605
+ ]
606
+ },
607
+ sourcePath: {
608
+ fileName: "data",
609
+ filePath: [
610
+ "columns"
611
+ ]
612
+ },
613
+ func: "twoDimensional"
614
+ }
615
+ ], D = { data: {}, base: Y, spec: b }, ke = { twoDimensional: w }, Ie = (t, a = !1, e = []) => (D.data = t, S(Ae, D, ke, b, a, e), Y.children), Fe = "table", Pe = {
616
+ class: "table table-hover table-striped align-middle border mb-0"
617
+ }, je = [
618
+ {
619
+ tagName: "colgroup",
620
+ attributes: {
621
+ "data-role": "table-colgroup"
622
+ },
623
+ children: []
624
+ },
625
+ {
626
+ tagName: "thead",
627
+ attributes: {
628
+ class: "table-dark",
629
+ "data-role": "table-header"
630
+ },
631
+ children: [
632
+ {
633
+ tagName: "tr",
634
+ attributes: {
635
+ "data-role": "table-header-row"
636
+ },
637
+ children: []
638
+ }
639
+ ]
429
640
  },
430
- unshift: (t, o, e) => {
431
- t[o].unshift(...g(e));
641
+ {
642
+ tagName: "tbody",
643
+ attributes: {
644
+ "data-role": "table-body"
645
+ },
646
+ children: []
432
647
  },
433
- pushToRows: (t, o, e) => {
434
- t[o].forEach((r) => {
435
- r.children.push(...structuredClone(g(e)));
436
- });
648
+ {
649
+ tagName: "tfoot",
650
+ attributes: {
651
+ "data-role": "table-footer"
652
+ },
653
+ children: [
654
+ {
655
+ tagName: "tr",
656
+ attributes: {
657
+ "data-role": "table-footer-row"
658
+ },
659
+ children: []
660
+ }
661
+ ]
662
+ }
663
+ ], Z = {
664
+ tagName: Fe,
665
+ attributes: Pe,
666
+ children: je
667
+ }, Be = [
668
+ {
669
+ narration: "Build the column widths for the table using the configured columns.",
670
+ destinationPath: {
671
+ fileName: "base",
672
+ dataRole: "table-colgroup",
673
+ filePath: [
674
+ "children"
675
+ ]
676
+ },
677
+ sourcePath: {
678
+ fileName: "data",
679
+ filePath: [
680
+ "columns"
681
+ ]
682
+ },
683
+ templateKey: "buildColGroup",
684
+ func: "fromCollection"
437
685
  },
438
- unshiftToRows: (t, o, e) => {
439
- t[o].forEach((r) => {
440
- r.children.unshift(...structuredClone(g(e)));
441
- });
686
+ {
687
+ narration: "Build the header row for the table using the configured columns.",
688
+ destinationPath: {
689
+ fileName: "base",
690
+ dataRole: "table-header-row",
691
+ filePath: [
692
+ "children"
693
+ ]
694
+ },
695
+ sourcePath: {
696
+ fileName: "data",
697
+ filePath: [
698
+ "columns"
699
+ ]
700
+ },
701
+ templateKey: "buildHeader",
702
+ func: "fromCollection"
442
703
  },
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);
447
- });
704
+ {
705
+ narration: "Build the footer row for the table using the configured columns.",
706
+ destinationPath: {
707
+ fileName: "base",
708
+ dataRole: "table-footer-row",
709
+ filePath: [
710
+ "children"
711
+ ]
712
+ },
713
+ sourcePath: {
714
+ fileName: "data",
715
+ filePath: [
716
+ "columns"
717
+ ]
718
+ },
719
+ templateKey: "buildFooter",
720
+ func: "fromCollection"
448
721
  }
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);
461
- } else
462
- console.log(" !instruction : ", o), console.log(" !source : ", e);
463
- });
464
- }, zt = (t) => {
465
- t.forEach((o) => {
466
- const e = q[o.func](
467
- f.data.columns,
468
- f.data.data,
469
- j
470
- );
471
- W(f, o.destinationPath, e);
472
- });
473
- }, Mt = (t) => (f.data = t, Ht(Wt), zt(qt), V), v = ({
722
+ ], ve = [
723
+ {
724
+ narration: "Build the table body rows for the table using the configured columns and data.",
725
+ destinationPath: {
726
+ fileName: "base",
727
+ dataRole: "table-body",
728
+ filePath: [
729
+ "children"
730
+ ]
731
+ },
732
+ sourcePath: {
733
+ fileName: "data",
734
+ filePath: [
735
+ "columns"
736
+ ]
737
+ },
738
+ func: "twoDimensional"
739
+ }
740
+ ], P = { data: {}, base: Z, spec: b }, O = { fromCollection: p, twoDimensional: w }, Se = (t, a = !1, e = []) => (P.data = t, k(Be, P, O, b, a, e), S(ve, P, O, b, a, e), Z), Re = [], N = {
741
+ children: Re
742
+ }, Ee = [
743
+ {
744
+ narration: "Build the footer row for the table using the configured columns.",
745
+ destinationPath: {
746
+ fileName: "base",
747
+ filePath: [
748
+ "children"
749
+ ]
750
+ },
751
+ sourcePath: {
752
+ fileName: "data",
753
+ filePath: [
754
+ "columns"
755
+ ]
756
+ },
757
+ templateKey: "buildFooter",
758
+ func: "fromCollection"
759
+ }
760
+ ], K = { data: {}, base: N, spec: b }, Le = { fromCollection: p, twoDimensional: w }, De = (t, a = !1, e = []) => (K.data = t, k(Ee, K, Le, b, a, e), N == null ? void 0 : N.children), Oe = {
761
+ simple: ye,
762
+ headerOnly: xe,
763
+ bodyOnly: Ie,
764
+ withFooter: Se,
765
+ footerOnly: De
766
+ }, V = ({
474
767
  inData: t,
475
- inColumns: o,
768
+ inColumns: a,
476
769
  inType: e,
477
- footer: r = [],
478
- options: a
479
- } = {}) => Mt({
480
- columns: o,
481
- data: t
482
- }), Gt = ({ inData: t = [], inColumns: o = [] } = {}) => ({
770
+ footer: o = [],
771
+ options: n,
772
+ inShowLog: r
773
+ } = {}) => {
774
+ const l = Oe[e];
775
+ return l({
776
+ columns: a,
777
+ data: t,
778
+ showLog: r
779
+ });
780
+ }, Ke = ({ inData: t = [], inColumns: a = [] } = {}) => ({
483
781
  data: t,
484
- columns: o
485
- }), Kt = {
782
+ columns: a
783
+ }), Ve = {
486
784
  tagName: "option",
487
785
  textContent: "${rowValue}",
488
786
  attributes: {
489
787
  value: "${rowValue}"
490
788
  }
491
- }, Ut = {
789
+ }, We = {
492
790
  tagName: "select",
493
791
  attributes: {
494
792
  id: "LedgerName"
495
793
  },
496
794
  children: []
497
- }, Jt = {
795
+ }, qe = {
498
796
  tagName: "datalist",
499
797
  attributes: {
500
798
  "data-name": "${columnName}"
501
799
  },
502
800
  children: []
503
- }, p = {
504
- buildOption: Kt,
505
- buildSelect: Ut,
506
- buildDataList: Jt
507
- }, _t = (t, o = p.buildOption) => {
508
- const e = structuredClone(o);
801
+ }, f = {
802
+ buildOption: Ve,
803
+ buildSelect: We,
804
+ buildDataList: qe
805
+ }, He = (t, a = f.buildOption) => {
806
+ const e = structuredClone(a);
509
807
  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 = [] } = {}) => ({
808
+ }, ze = (t, a) => {
809
+ const e = a == null ? void 0 : a.columnName, o = structuredClone(f.buildSelect);
810
+ o.attributes.id = e, o.attributes["data-name"] = e;
811
+ const n = He(e, f.buildOption);
812
+ return o.children = p(t, n), o;
813
+ }, Ge = ({ data: t, columns: a }) => a.map((e) => ze(t, e)), Me = (t = {}) => {
814
+ const { data: a, columns: e } = Ke(t);
815
+ return Ge({ data: a, columns: e });
816
+ }, Ue = ({ inData: t = [], inColumns: a = [] } = {}) => ({
519
817
  data: t,
520
- columns: o
521
- }), te = (t, o = p.buildOption) => {
522
- const e = structuredClone(o);
818
+ columns: a
819
+ }), Je = (t, a = f.buildOption) => {
820
+ const e = structuredClone(a);
523
821
  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 = [] } = {}) => ({
822
+ }, _e = (t, a) => {
823
+ const e = a == null ? void 0 : a.columnName, o = Je(e, f.buildOption);
824
+ return p(t, o);
825
+ }, Xe = ({ data: t, columns: a }) => a.map((e) => _e(t, e)), Qe = (t = {}) => {
826
+ const { data: a, columns: e } = Ue(t);
827
+ return Xe({ data: a, columns: e });
828
+ }, Ye = ({ inData: t = [], inColumns: a = [] } = {}) => ({
531
829
  data: t,
532
- columns: o
533
- }), ae = (t, o = p.buildOption) => {
534
- const e = structuredClone(o);
830
+ columns: a
831
+ }), Ze = (t, a = f.buildOption) => {
832
+ const e = structuredClone(a);
535
833
  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 = {
834
+ }, ta = (t, a) => {
835
+ const e = a == null ? void 0 : a.columnName, o = structuredClone(f.buildDataList);
836
+ o.attributes.id = e, o.attributes["data-name"] = e;
837
+ const n = Ze(e, f.buildOption);
838
+ return o.children = p(t, n), o;
839
+ }, ea = ({ data: t, columns: a }) => a.map((e) => ta(t, e)), W = (t = {}) => {
840
+ const { data: a, columns: e } = Ye(t);
841
+ return ea({ data: a, columns: e });
842
+ }, aa = {
545
843
  version: "1.2.0",
546
844
  name: "json-renderers-build-input-row"
547
- }, ce = (t) => {
548
- const o = t;
549
- if (typeof globalThis > "u" || !o) return;
845
+ }, oa = (t) => {
846
+ const a = t;
847
+ if (typeof globalThis > "u" || !a) return;
550
848
  globalThis.ks ?? (globalThis.ks = {});
551
- const e = typeof o == "function" ? o : o.render;
849
+ const e = typeof a == "function" ? a : a.render;
552
850
  globalThis.ks.jsonRenderersBuildInputRow = {
553
- meta: ie,
851
+ meta: aa,
554
852
  render: e,
555
- ...typeof o == "object" ? o : {}
853
+ ...typeof a == "object" ? a : {}
556
854
  };
557
- }, ue = "input", de = {
855
+ }, na = "input", ra = {
558
856
  type: "search",
559
857
  placeholder: "Search...",
560
858
  class: "form-control",
561
859
  id: "searchInputId"
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 = {
860
+ }, sa = {
861
+ tagName: na,
862
+ attributes: ra
863
+ }, x = ({ inOptions: t = {}, options: a = {} } = {}) => {
864
+ const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(sa);
865
+ return e.placeholder && (o.attributes.placeholder = e.placeholder), e.class && (o.attributes.class = e.class), e.id && (o.attributes.id = e.id), e.name && (o.attributes.name = e.name), e.type && (o.attributes.type = e.type), e.value && (o.attributes.value = e.value), o;
866
+ }, la = "div", ia = {
569
867
  class: "d-flex align-items-center gap-2"
570
- }, fe = [
868
+ }, ca = [
571
869
  {
572
870
  tagName: "label",
573
871
  textContent: "Search:",
@@ -585,16 +883,16 @@ const Nt = (t, o) => {
585
883
  id: "searchInputId"
586
884
  }
587
885
  }
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 = {
886
+ ], ua = {
887
+ tagName: la,
888
+ attributes: ia,
889
+ children: ca
890
+ }, I = ({ inOptions: t = {}, options: a = {} } = {}) => {
891
+ const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(ua), n = o.children[0], r = o.children[1];
892
+ return e.label && (n.textContent = e.label), e.id && (n.attributes.for = e.id, r.attributes.id = e.id), e.placeholder && (r.attributes.placeholder = e.placeholder), e.class && (r.attributes.class = e.class), e.name && (r.attributes.name = e.name), e.type && (r.attributes.type = e.type), e.wrapperClass && (o.attributes.class = e.wrapperClass), e.labelClass && (n.attributes.class = e.labelClass), o;
893
+ }, da = "div", ba = {
596
894
  class: "d-flex align-items-center gap-2"
597
- }, we = [
895
+ }, pa = [
598
896
  {
599
897
  tagName: "label",
600
898
  textContent: "Search:",
@@ -621,45 +919,45 @@ const Nt = (t, o) => {
621
919
  id: "searchButtonId"
622
920
  }
623
921
  }
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 = ({
922
+ ], ma = {
923
+ tagName: da,
924
+ attributes: ba,
925
+ children: pa
926
+ }, R = ({ inOptions: t = {}, options: a = {} } = {}) => {
927
+ const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(ma), n = o.children[0], r = o.children[1], s = o.children[2];
928
+ return e.label && (n.textContent = e.label), e.id && (n.attributes.for = e.id, r.attributes.id = e.id), e.placeholder && (r.attributes.placeholder = e.placeholder), e.class && (r.attributes.class = e.class), e.name && (r.attributes.name = e.name), e.type && (r.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 && (o.attributes.class = e.wrapperClass), e.labelClass && (n.attributes.class = e.labelClass), o;
929
+ }, fa = {
930
+ input: x,
931
+ inputOnly: x,
932
+ inputWithLabel: I,
933
+ inputWithLabelButton: R
934
+ }, ha = ({
637
935
  type: t = "inputWithLabel",
638
- options: o = {},
936
+ options: a = {},
639
937
  inType: e,
640
- inOptions: r
938
+ inOptions: o
641
939
  } = {}) => {
642
- const a = e ?? t, n = r ?? o;
643
- return (ge[a] || T)({ inOptions: n, options: n });
940
+ const n = e ?? t, r = o ?? a;
941
+ return (fa[n] || I)({ inOptions: r, options: r });
644
942
  };
645
- ce({
646
- render: Ne,
647
- inputOnly: N,
648
- inputWithLabel: T,
649
- inputWithLabelButton: F
943
+ oa({
944
+ render: ha,
945
+ inputOnly: x,
946
+ inputWithLabel: I,
947
+ inputWithLabelButton: R
650
948
  });
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 = {
949
+ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
950
+ const e = t && Object.keys(t).length > 0 ? t : a;
951
+ return (e == null ? void 0 : e.label) === !1 || (e == null ? void 0 : e.flavour) === "inputOnly" ? x({ inOptions: e }) : (e == null ? void 0 : e.flavour) === "inputWithLabelButton" || e != null && e.button || e != null && e.buttonText ? R({ inOptions: e }) : I({ inOptions: e });
952
+ }, ya = {
655
953
  version: "1.2.0",
656
954
  name: "json-renderers-build-form"
657
- }, Te = (t) => {
658
- typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuildForm = { meta: xe, render: t });
659
- }, Ae = "div", Ie = {
955
+ }, Ca = (t) => {
956
+ typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuildForm = { meta: ya, render: t });
957
+ }, $a = "div", ga = {
660
958
  class: "${cardClass}",
661
959
  "data-role": "form-card"
662
- }, ke = [
960
+ }, wa = [
663
961
  {
664
962
  tagName: "header",
665
963
  attributes: {
@@ -740,14 +1038,14 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
740
1038
  }
741
1039
  ]
742
1040
  }
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 = {
1041
+ ], Na = {
1042
+ tagName: $a,
1043
+ attributes: ga,
1044
+ children: wa
1045
+ }, xa = () => structuredClone(Na), Ta = "header-actions", Aa = "button", q = {
1046
+ destinationRole: Ta,
1047
+ template: Aa
1048
+ }, ka = {
751
1049
  tagName: "button",
752
1050
  textContent: "${label}",
753
1051
  attributes: {
@@ -755,20 +1053,20 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
755
1053
  form: "${formId}",
756
1054
  class: "${buttonClass} ${buttonSizeClass} ${buttonPaddingClass}"
757
1055
  }
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 = {
1056
+ }, Ia = {
1057
+ button: ka
1058
+ }, Fa = (t, a) => {
1059
+ const e = structuredClone(t), o = p(a.header.actions, Ia[q.template]);
1060
+ return y(e, q.destinationRole).children.push(...o), e;
1061
+ }, Pa = "form-body", ja = {
1062
+ destinationRole: Pa
1063
+ }, Ba = {
766
1064
  tagName: "div",
767
1065
  attributes: {
768
1066
  class: "${rowClass}"
769
1067
  },
770
1068
  children: []
771
- }, Oe = {
1069
+ }, va = {
772
1070
  tagName: "div",
773
1071
  attributes: {
774
1072
  class: "${fieldClass}"
@@ -794,7 +1092,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
794
1092
  }
795
1093
  }
796
1094
  ]
797
- }, Ve = {
1095
+ }, Sa = {
798
1096
  tagName: "div",
799
1097
  attributes: {
800
1098
  class: "${fieldClass}"
@@ -821,7 +1119,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
821
1119
  }
822
1120
  }
823
1121
  ]
824
- }, We = {
1122
+ }, Ra = {
825
1123
  tagName: "div",
826
1124
  attributes: {
827
1125
  class: "${fieldClass}"
@@ -847,7 +1145,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
847
1145
  }
848
1146
  }
849
1147
  ]
850
- }, qe = {
1148
+ }, Ea = {
851
1149
  tagName: "div",
852
1150
  attributes: {
853
1151
  class: "${checkboxWrapperClass} ${fieldClass}"
@@ -872,7 +1170,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
872
1170
  }
873
1171
  }
874
1172
  ]
875
- }, He = {
1173
+ }, La = {
876
1174
  tagName: "div",
877
1175
  attributes: {
878
1176
  class: "${fieldClass}"
@@ -898,7 +1196,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
898
1196
  }
899
1197
  }
900
1198
  ]
901
- }, ze = {
1199
+ }, Da = {
902
1200
  tagName: "div",
903
1201
  attributes: {
904
1202
  class: "${fieldClass}"
@@ -925,7 +1223,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
925
1223
  }
926
1224
  }
927
1225
  ]
928
- }, Me = {
1226
+ }, Oa = {
929
1227
  tagName: "div",
930
1228
  attributes: {
931
1229
  class: "${fieldClass}"
@@ -959,7 +1257,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
959
1257
  }
960
1258
  }
961
1259
  ]
962
- }, Ge = {
1260
+ }, Ka = {
963
1261
  tagName: "div",
964
1262
  attributes: {
965
1263
  class: "${fieldClass}"
@@ -994,7 +1292,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
994
1292
  }
995
1293
  }
996
1294
  ]
997
- }, Ke = {
1295
+ }, Va = {
998
1296
  tagName: "div",
999
1297
  attributes: {
1000
1298
  class: "${fieldClass}"
@@ -1020,7 +1318,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1020
1318
  }
1021
1319
  }
1022
1320
  ]
1023
- }, Ue = {
1321
+ }, Wa = {
1024
1322
  tagName: "div",
1025
1323
  attributes: {
1026
1324
  class: "${inlineCheckboxWrapperClass}"
@@ -1045,43 +1343,43 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1045
1343
  }
1046
1344
  }
1047
1345
  ]
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), {
1346
+ }, qa = {
1347
+ buildBodyTr: Ba,
1348
+ buildBodyCell: va,
1349
+ buildRequiredField: Sa,
1350
+ buildTextareaField: Ra,
1351
+ buildCheckboxField: Ea,
1352
+ buildInlineField: La,
1353
+ buildInlineRequiredField: Da,
1354
+ buildInlineFieldWithButton: Oa,
1355
+ buildInlineRequiredFieldWithButton: Ka,
1356
+ buildInlineTextareaField: Va,
1357
+ buildInlineCheckboxField: Wa
1358
+ }, Ha = (t, a, e) => {
1359
+ const o = t.map((s) => {
1360
+ var u, c, d, m, C;
1361
+ const l = ((c = (u = s.template) == null ? void 0 : u.body) == null ? void 0 : c.cell) ?? (s.required ? "buildRequiredField" : "buildBodyCell");
1362
+ let i = ((d = e.fieldTemplates) == null ? void 0 : d[l]) ?? l;
1363
+ return s.buttonText && (i = ((m = e.buttonFieldTemplates) == null ? void 0 : m[i]) ?? i), {
1066
1364
  ...s,
1067
1365
  label: s.label ?? s.title ?? s.columnName,
1068
1366
  type: s.type ?? "text",
1069
1367
  placeholder: s.placeholder ?? "",
1070
1368
  buttonType: s.buttonType ?? "button",
1071
- template: { ...s.template, body: { ...(C = s.template) == null ? void 0 : C.body, cell: l } }
1369
+ template: { ...s.template, body: { ...(C = s.template) == null ? void 0 : C.body, cell: i } }
1072
1370
  };
1073
- }), a = o[0] ?? {}, n = Object.fromEntries(r.map((s) => [
1371
+ }), n = a[0] ?? {}, r = Object.fromEntries(o.map((s) => [
1074
1372
  s.columnName,
1075
- a[s.columnName] ?? s.value ?? ""
1373
+ n[s.columnName] ?? s.value ?? ""
1076
1374
  ]));
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 = {
1375
+ return { columns: o, rows: [r] };
1376
+ }, za = (t, a, e) => {
1377
+ const o = Ha(a.columns, a.records, e.body), n = w(o.columns, o.rows, qa), r = structuredClone(t);
1378
+ return y(r, ja.destinationRole).children.push(...Array.isArray(n) ? n : [n]), r;
1379
+ }, Ga = "footer-actions", Ma = "button", H = {
1380
+ destinationRole: Ga,
1381
+ template: Ma
1382
+ }, Ua = {
1085
1383
  tagName: "button",
1086
1384
  textContent: "${label}",
1087
1385
  attributes: {
@@ -1089,28 +1387,28 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1089
1387
  form: "${formId}",
1090
1388
  class: "${buttonClass} ${buttonSizeClass} ${buttonPaddingClass}"
1091
1389
  }
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 = {
1390
+ }, Ja = {
1391
+ button: Ua
1392
+ }, _a = (t, a) => {
1393
+ const e = structuredClone(t), o = p(a.footer.actions, Ja[H.template]);
1394
+ return y(e, H.destinationRole).children.push(...o), e;
1395
+ }, tt = ({ inColumns: t, inData: a, inOptions: e, columns: o, data: n, options: r } = {}) => ({
1396
+ columns: Array.isArray(t) && t.length > 0 ? t : Array.isArray(o) ? o : [],
1397
+ records: Array.isArray(a) && a.length > 0 ? a : Array.isArray(n) ? n : [],
1398
+ options: e && Object.keys(e).length > 0 ? e : r ?? {}
1399
+ }), Xa = "bigButtonsForm", Qa = "Account details", Ya = "Update your profile information.", Za = "", to = "label", eo = "stacked", ao = "saveCancel", oo = {
1400
+ formId: Xa,
1401
+ title: Qa,
1402
+ description: Ya,
1403
+ recordId: Za,
1404
+ header: to,
1405
+ body: eo,
1406
+ footer: ao
1407
+ }, no = {
1110
1408
  actions: []
1111
- }, bo = {
1409
+ }, ro = {
1112
1410
  actions: []
1113
- }, po = {
1411
+ }, so = {
1114
1412
  actions: [
1115
1413
  {
1116
1414
  label: "Refresh",
@@ -1118,14 +1416,14 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1118
1416
  buttonClass: "${headerButtonClass}"
1119
1417
  }
1120
1418
  ]
1121
- }, mo = {
1419
+ }, lo = {
1122
1420
  actions: []
1123
- }, fo = {
1124
- none: uo,
1125
- label: bo,
1126
- labelWithRefresh: po,
1127
- labelWithId: mo
1128
- }, ho = {
1421
+ }, io = {
1422
+ none: no,
1423
+ label: ro,
1424
+ labelWithRefresh: so,
1425
+ labelWithId: lo
1426
+ }, co = {
1129
1427
  fieldTemplates: {
1130
1428
  buildBodyCell: "buildInlineField",
1131
1429
  buildRequiredField: "buildInlineRequiredField",
@@ -1136,19 +1434,19 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1136
1434
  buildInlineField: "buildInlineFieldWithButton",
1137
1435
  buildInlineRequiredField: "buildInlineRequiredFieldWithButton"
1138
1436
  }
1139
- }, yo = {
1437
+ }, uo = {
1140
1438
  fieldTemplates: {},
1141
1439
  buttonFieldTemplates: {}
1142
- }, Co = {
1440
+ }, bo = {
1143
1441
  fieldTemplates: {},
1144
1442
  buttonFieldTemplates: {}
1145
- }, wo = {
1146
- inline: ho,
1147
- stacked: yo,
1148
- threeColumns: Co
1149
- }, $o = {
1443
+ }, po = {
1444
+ inline: co,
1445
+ stacked: uo,
1446
+ threeColumns: bo
1447
+ }, mo = {
1150
1448
  actions: []
1151
- }, go = {
1449
+ }, fo = {
1152
1450
  actions: [
1153
1451
  {
1154
1452
  label: "Save",
@@ -1161,7 +1459,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1161
1459
  buttonClass: "${secondaryButtonClass}"
1162
1460
  }
1163
1461
  ]
1164
- }, No = {
1462
+ }, ho = {
1165
1463
  actions: [
1166
1464
  {
1167
1465
  label: "Edit",
@@ -1169,31 +1467,31 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1169
1467
  buttonClass: "${infoButtonClass}"
1170
1468
  }
1171
1469
  ]
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) => {
1470
+ }, yo = {
1471
+ none: mo,
1472
+ saveCancel: fo,
1473
+ edit: ho
1474
+ }, B = (t, a, e) => {
1475
+ const o = t[a];
1476
+ if (!o) throw new RangeError("Unknown bigButtons " + e + ": " + a);
1477
+ return o;
1478
+ }, et = (t) => {
1181
1479
  if (typeof t != "object" || t === null || Array.isArray(t))
1182
1480
  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))
1481
+ const a = t["form.bigButtons"] ?? {};
1482
+ if (typeof a != "object" || a === null || Array.isArray(a))
1185
1483
  throw new TypeError('options["form.bigButtons"] must be an object');
1186
- const e = { ...co, ...o };
1484
+ const e = { ...oo, ...a };
1187
1485
  return {
1188
1486
  options: e,
1189
- header: I(fo, e.header, "header"),
1190
- body: I(wo, e.body, "body"),
1191
- footer: I(xo, e.footer, "footer")
1487
+ header: B(io, e.header, "header"),
1488
+ body: B(po, e.body, "body"),
1489
+ footer: B(yo, e.footer, "footer")
1192
1490
  };
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 = {
1491
+ }, Co = (t, a = {}) => {
1492
+ const e = tt(a), o = et(e.options), n = Fa(t, o), r = za(n, e, o);
1493
+ return _a(r, o);
1494
+ }, $o = {
1197
1495
  none: {
1198
1496
  headerClass: "d-none",
1199
1497
  headerActionsClass: "d-none"
@@ -1225,14 +1523,14 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1225
1523
  headerActionsClass: "d-none",
1226
1524
  headerButtonClass: "btn btn-outline-secondary text-nowrap"
1227
1525
  }
1228
- }, Io = {
1229
- bootstrap: Ao
1230
- }, ko = (t, o) => {
1231
- var r;
1232
- const e = (r = Io[o]) == null ? void 0 : r[t.header];
1526
+ }, go = {
1527
+ bootstrap: $o
1528
+ }, wo = (t, a) => {
1529
+ var o;
1530
+ const e = (o = go[a]) == null ? void 0 : o[t.header];
1233
1531
  if (!e) throw new RangeError("Unknown bigButtons header: " + t.header);
1234
1532
  return e;
1235
- }, jo = "bootstrap", Fo = {
1533
+ }, No = "bootstrap", xo = {
1236
1534
  bootstrap: {
1237
1535
  base: {
1238
1536
  cardClass: "card border-0 shadow-sm w-100",
@@ -1262,16 +1560,16 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1262
1560
  }
1263
1561
  }
1264
1562
  }
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 = {
1563
+ }, v = {
1564
+ defaultFramework: No,
1565
+ frameworks: xo
1566
+ }, To = (t, a) => {
1567
+ const e = v.frameworks[a];
1568
+ if (!e) throw new RangeError("Unknown bigButtons framework: " + a);
1569
+ const o = e.bodies[t.body];
1570
+ if (!o) throw new RangeError("Unknown bigButtons body: " + t.body);
1571
+ return { ...e.base, ...o };
1572
+ }, Ao = {
1275
1573
  base: {
1276
1574
  footerClass: "card-footer bg-transparent",
1277
1575
  footerActionsClass: "d-flex flex-wrap justify-content-end gap-2",
@@ -1289,94 +1587,95 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1289
1587
  saveCancel: {},
1290
1588
  edit: {}
1291
1589
  }
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);
1590
+ }, ko = {
1591
+ bootstrap: Ao
1592
+ }, Io = (t, a) => {
1593
+ const e = ko[a], o = e == null ? void 0 : e.footers[t.footer];
1594
+ if (!e) throw new RangeError("Unknown bigButtons framework: " + a);
1595
+ if (!o) throw new RangeError("Unknown bigButtons footer: " + t.footer);
1596
+ return { ...e.base, ...o };
1597
+ }, Fo = (t, a = {}) => {
1598
+ const e = et(tt(a).options), { options: o } = e, n = o.framework ?? v.defaultFramework;
1599
+ if (!v.frameworks[n]) throw new RangeError("Unknown bigButtons framework: " + n);
1302
1600
  const s = Object.assign(
1303
1601
  {},
1304
- r,
1305
- Bo(r, a),
1306
- ko(r, a),
1307
- Eo(r, a)
1602
+ o,
1603
+ To(o, n),
1604
+ wo(o, n),
1605
+ Io(o, n)
1308
1606
  );
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);
1607
+ return h(s, structuredClone(t));
1608
+ }, Po = (t = {}) => {
1609
+ const a = xa(), e = Co(a, t);
1610
+ return Fo(e, t);
1611
+ }, at = (t = {}) => {
1612
+ const a = { ...t, type: t.type ?? "form.bigButtons" };
1613
+ return T(a), Po(a);
1316
1614
  };
1317
- Te(M);
1318
- const Po = ({
1615
+ Ca(at);
1616
+ const jo = ({
1319
1617
  inType: t = "stacked",
1320
- inData: o,
1618
+ inData: a,
1321
1619
  inColumns: e
1322
- } = {}) => M({
1620
+ } = {}) => at({
1323
1621
  type: t,
1324
1622
  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;
1623
+ data: a
1624
+ }), Bo = {
1625
+ table: V,
1626
+ tableFromSpec: V,
1627
+ select: Me,
1628
+ selectOptionsOnly: Qe,
1629
+ dataList: W,
1630
+ datalist: W,
1631
+ searchInput: j,
1632
+ search: j,
1633
+ inputRow: j,
1634
+ form: jo
1635
+ }, ot = (t = {}) => {
1636
+ T(t);
1637
+ const a = t == null ? void 0 : t.showLog, e = t.type;
1638
+ let o = e, n = e;
1341
1639
  if (e.includes(".")) {
1342
- const i = e.split(".");
1343
- r = i[0], a = i[1];
1640
+ const l = e.split(".");
1641
+ o = l[0], n = l[1];
1344
1642
  }
1345
- const n = Do[r];
1346
- if (!n)
1347
- throw new Error(`Renderer for type "${r}" not found.`);
1348
- const s = n({
1349
- inType: a,
1643
+ const r = Bo[o];
1644
+ if (!r)
1645
+ throw new Error(`Renderer for type "${o}" not found.`);
1646
+ const s = r({
1647
+ inType: n,
1350
1648
  inColumns: t.columns,
1351
1649
  inData: t.data,
1352
1650
  inOptions: t.options,
1353
- options: t.options
1651
+ options: t.options,
1652
+ inShowLog: a
1354
1653
  });
1355
- return o && console.log("json-renderers-build output:", s), s;
1654
+ return a && console.log("json-renderers-build output:", s), s;
1356
1655
  };
1357
- mt(G);
1358
- const Oo = ({
1656
+ kt(ot);
1657
+ const vo = ({
1359
1658
  inColumns: t,
1360
- inType: o = "table",
1659
+ inType: a = "table",
1361
1660
  inData: e,
1362
- inShowLog: r = !1
1363
- } = {}) => G({
1364
- type: o,
1661
+ inShowLog: o = !1
1662
+ } = {}) => ot({
1663
+ type: a,
1365
1664
  data: e ?? [],
1366
1665
  columns: t,
1367
- showLog: r
1368
- }), Vo = {
1666
+ showLog: o
1667
+ }), So = {
1369
1668
  version: "v9",
1370
1669
  description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
1371
- }, Wo = (t) => {
1670
+ }, Ro = (t) => {
1372
1671
  if (typeof globalThis > "u" || !t) return;
1373
1672
  globalThis.ks ?? (globalThis.ks = {});
1374
- const o = {
1375
- meta: Vo,
1673
+ const a = {
1674
+ meta: So,
1376
1675
  buildSpecElement: t
1377
1676
  };
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([
1677
+ globalThis.ks["json-to-tag"] = a, globalThis.ks.jsonToTag = a;
1678
+ }, Eo = (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 ?? "") : rt(t), nt = (t) => Array.isArray(t) ? t.map(Eo).flat(1 / 0).filter(Boolean) : [], Lo = (t) => (t == null, t), Do = "http://www.w3.org/2000/svg", Oo = /* @__PURE__ */ new Set([
1380
1679
  "svg",
1381
1680
  "path",
1382
1681
  "symbol",
@@ -1403,100 +1702,100 @@ const Oo = ({
1403
1702
  "fegaussianblur",
1404
1703
  "femerge",
1405
1704
  "femergenode"
1406
- ]), Go = ({ inTagName: t }) => {
1407
- const o = t == null ? void 0 : t.toLowerCase();
1408
- if (!o) return null;
1409
- if (o === "checkbox") {
1705
+ ]), Ko = ({ inTagName: t }) => {
1706
+ const a = t == null ? void 0 : t.toLowerCase();
1707
+ if (!a) return null;
1708
+ if (a === "checkbox") {
1410
1709
  const e = document.createElement("input");
1411
1710
  return e.type = "checkbox", e;
1412
1711
  }
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")
1712
+ return Oo.has(a) ? document.createElementNS(Do, a) : document.createElement(a);
1713
+ }, Vo = ({ inElement: t, inTextContent: a }) => (!t || a === void 0 || a === null || (t.textContent = a), t), Wo = ({ inElement: t, inProperties: a }) => (t && a && typeof a == "object" && Object.assign(t, a), t), qo = "http://www.w3.org/1999/xlink", Ho = ({ inElement: t, inAttributes: a }) => {
1714
+ const e = t, o = a;
1715
+ if (!e || !o || typeof o != "object")
1417
1716
  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]) => {
1420
- if (n === "class") {
1421
- a ? e.setAttribute("class", String(s)) : e.className = s;
1717
+ const n = typeof SVGElement < "u" ? e instanceof SVGElement : e.namespaceURI === "http://www.w3.org/2000/svg";
1718
+ return Object.entries(o).forEach(([r, s]) => {
1719
+ if (r === "class") {
1720
+ n ? e.setAttribute("class", String(s)) : e.className = s;
1422
1721
  return;
1423
1722
  }
1424
- if (n === "xlink:href" || n === "href") {
1723
+ if (r === "xlink:href" || r === "href") {
1425
1724
  if (s != null) {
1426
- const i = String(s);
1427
- if (a)
1725
+ const l = String(s);
1726
+ if (n)
1428
1727
  try {
1429
- e.setAttributeNS(Jo, "href", i);
1728
+ e.setAttributeNS(qo, "href", l);
1430
1729
  } catch {
1431
1730
  }
1432
- e.setAttribute("href", i), e.setAttribute("xlink:href", i);
1731
+ e.setAttribute("href", l), e.setAttribute("xlink:href", l);
1433
1732
  }
1434
1733
  return;
1435
1734
  }
1436
1735
  if (typeof s == "boolean") {
1437
- s ? e.setAttribute(n, "") : e.removeAttribute(n);
1736
+ s ? e.setAttribute(r, "") : e.removeAttribute(r);
1438
1737
  return;
1439
1738
  }
1440
- s != null && e.setAttribute(n, String(s));
1739
+ s != null && e.setAttribute(r, String(s));
1441
1740
  }), 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()) : [];
1741
+ }, zo = ({ inElement: t, inClassList: a }) => {
1742
+ if (!t || !a) return t;
1743
+ const e = typeof a == "string" ? a.split(/\s+/).filter(Boolean) : Array.isArray(a) ? a.filter((o) => typeof o == "string" && o.trim()) : [];
1445
1744
  return e.length && t.classList.add(...e), t;
1446
- }, Qo = (t) => {
1745
+ }, Go = (t) => {
1447
1746
  if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
1448
- const o = Go({ inTagName: t.tagName });
1449
- if (!o) return null;
1450
- if (Ko({
1451
- inElement: o,
1452
- inTextContent: Ho(t.textContent),
1747
+ const a = Ko({ inTagName: t.tagName });
1748
+ if (!a) return null;
1749
+ if (Vo({
1750
+ inElement: a,
1751
+ inTextContent: Lo(t.textContent),
1453
1752
  inTagName: t.tagName
1454
- }), Uo({
1455
- inElement: o,
1753
+ }), Wo({
1754
+ inElement: a,
1456
1755
  inProperties: t.properties
1457
- }), _o({
1458
- inElement: o,
1756
+ }), Ho({
1757
+ inElement: a,
1459
1758
  inAttributes: t.attributes
1460
- }), Xo({
1461
- inElement: o,
1759
+ }), zo({
1760
+ inElement: a,
1462
1761
  inClassList: t.classList
1463
1762
  }), Array.isArray(t.children)) {
1464
- const e = K(t.children);
1465
- e.length && o.append(...e);
1763
+ const e = nt(t.children);
1764
+ e.length && a.append(...e);
1466
1765
  }
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);
1766
+ return a;
1767
+ }, rt = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? nt(t) : typeof t == "object" ? Go(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, st = (t = {}) => {
1768
+ const a = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
1769
+ return rt(a);
1471
1770
  };
1472
- Wo(J);
1473
- const Yo = ({
1771
+ Ro(st);
1772
+ const Mo = ({
1474
1773
  inSpec: t,
1475
- inTargetHtmlId: o,
1774
+ inTargetHtmlId: a,
1476
1775
  inAppendPosition: e,
1477
- inShowLog: r = !1
1776
+ inShowLog: o = !1
1478
1777
  } = {}) => {
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({
1778
+ const n = t, r = a, s = e, l = o, i = st(n);
1779
+ l && console.log("renderToDom 1 (content):", i);
1780
+ const u = document.getElementById(r);
1781
+ return u ? (Array.isArray(i) || i instanceof NodeList || i instanceof HTMLCollection ? s === "prepend" ? u.prepend(...i) : u.append(...i) : s === "prepend" ? u.prepend(i) : (u.innerHTML = "", u.append(i)), l && console.log("renderToDom 2 (mounted):", u), u) : null;
1782
+ }, Uo = (t = {}) => {
1783
+ g(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);
1784
+ const e = vo({
1486
1785
  inColumns: t.columns,
1487
1786
  inData: t.data,
1488
1787
  inType: t.type,
1489
1788
  inShowLog: t.showLog
1490
1789
  });
1491
- return Yo({
1790
+ return Mo({
1492
1791
  inSpec: e,
1493
1792
  inTargetHtmlId: t.targetHtmlId,
1494
1793
  inAppendPosition: t.appendPosition,
1495
1794
  inShowLog: t.showLog
1496
1795
  });
1497
1796
  };
1498
- Y(Zo);
1797
+ ut(Uo);
1499
1798
  export {
1500
- Zo as default,
1501
- Zo as render
1799
+ Uo as default,
1800
+ Uo as render
1502
1801
  };