json-renderers 1.18.7 → 1.18.8

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,13 +1,13 @@
1
- const ct = {
1
+ const it = {
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
- }, ut = (t) => {
4
+ }, ct = (t) => {
5
5
  const a = t;
6
6
  typeof globalThis > "u" || !a || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderers = {
7
- meta: ct,
7
+ meta: it,
8
8
  render: a
9
9
  });
10
- }, dt = (t) => {
10
+ }, ut = (t) => {
11
11
  const a = (t == null ? void 0 : t.inConfig) ?? t;
12
12
  if (!a || typeof a != "object")
13
13
  throw new TypeError("Config must be an object");
@@ -17,7 +17,7 @@ const ct = {
17
17
  if (typeof e != "string")
18
18
  throw new TypeError("type must be a string");
19
19
  return !0;
20
- }, bt = (t) => {
20
+ }, dt = (t) => {
21
21
  const a = (t == null ? void 0 : t.inConfig) ?? t;
22
22
  if (!a || typeof a != "object")
23
23
  throw new TypeError("Config must be an object");
@@ -27,7 +27,7 @@ const ct = {
27
27
  if (!Array.isArray(e))
28
28
  throw new TypeError("data must be an Array");
29
29
  return !0;
30
- }, pt = (t) => {
30
+ }, bt = (t) => {
31
31
  const a = (t == null ? void 0 : t.inConfig) ?? t;
32
32
  if (!a || typeof a != "object")
33
33
  throw new TypeError("Config must be an object");
@@ -37,7 +37,7 @@ const ct = {
37
37
  if (!Array.isArray(e))
38
38
  throw new TypeError("columns must be an Array");
39
39
  return !0;
40
- }, mt = (t) => {
40
+ }, pt = (t) => {
41
41
  const a = (t == null ? void 0 : t.inConfig) ?? t;
42
42
  if (!a || typeof a != "object")
43
43
  throw new TypeError("Config must be an object");
@@ -45,12 +45,12 @@ const ct = {
45
45
  if (e !== void 0 && typeof e != "boolean")
46
46
  throw new TypeError("showLog must be a boolean");
47
47
  return !0;
48
- }, T = (t) => {
48
+ }, P = (t) => {
49
49
  const a = (t == null ? void 0 : t.inConfig) ?? t;
50
50
  if (!a || typeof a != "object" || Array.isArray(a))
51
51
  throw new TypeError("Config must be an object");
52
- return dt(a), bt(a), pt(a), mt(a), !0;
53
- }, ft = (t) => {
52
+ return ut(a), dt(a), bt(a), pt(a), !0;
53
+ }, mt = (t) => {
54
54
  const a = (t == null ? void 0 : t.inConfig) ?? t;
55
55
  if (!a || typeof a != "object")
56
56
  throw new TypeError("Config must be an object");
@@ -72,7 +72,7 @@ const ct = {
72
72
  if (typeof e != "string")
73
73
  throw new TypeError("appendPosition must be a string");
74
74
  return !0;
75
- }, yt = (t) => {
75
+ }, ft = (t) => {
76
76
  const a = (t == null ? void 0 : t.inConfig) ?? t;
77
77
  if (!a || typeof a != "object")
78
78
  throw new TypeError("Config must be an object");
@@ -82,58 +82,58 @@ const ct = {
82
82
  if (typeof e != "string")
83
83
  throw new TypeError("classToApply must be a string");
84
84
  return !0;
85
- }, z = (t) => {
85
+ }, q = (t) => {
86
86
  const a = (t == null ? void 0 : t.inConfig) ?? t;
87
87
  if (!a || typeof a != "object" || Array.isArray(a))
88
88
  throw new TypeError("Config must be an object");
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,
89
+ return mt(a), ht(a), ft(a), !0;
90
+ }, yt = "table", Ct = "", wt = [], gt = [], $t = "", Nt = "replace", Tt = !1, g = {
91
+ type: yt,
92
+ targetHtmlId: Ct,
93
+ data: wt,
94
+ columns: gt,
95
+ classToApply: $t,
96
+ appendPosition: Nt,
97
97
  showLog: Tt
98
98
  }, G = (t) => {
99
99
  const a = typeof t == "object" && t !== null ? t.inKey ?? t.key : t;
100
- return a && a in $ ? $[a] : { ...$ };
100
+ return a && a in g ? g[a] : { ...g };
101
101
  };
102
- Object.assign(G, $);
103
- const g = (t) => {
102
+ Object.assign(G, g);
103
+ const $ = (t) => {
104
104
  const a = (t == null ? void 0 : t.inConfig) ?? t;
105
105
  if (!a || typeof a != "object" || Array.isArray(a))
106
106
  throw new TypeError("Config must be an object");
107
- return T(a), z(a), !0;
107
+ return P(a), q(a), !0;
108
108
  };
109
- g.getSpec = G;
110
- g.configSpec = $;
111
- g.guardSpec = T;
112
- g.guardMount = z;
113
- const At = {
109
+ $.getSpec = G;
110
+ $.configSpec = g;
111
+ $.guardSpec = P;
112
+ $.guardMount = q;
113
+ const xt = {
114
114
  version: "1.22.0",
115
115
  name: "json-renderers-build"
116
- }, kt = (t) => {
116
+ }, Pt = (t) => {
117
117
  t && (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuild = {
118
- meta: At,
118
+ meta: xt,
119
119
  render: t
120
120
  });
121
- }, It = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Ft = (t, a) => {
122
- if (!It(t)) return;
121
+ }, At = (t) => typeof t == "object" && t !== null && !Array.isArray(t), It = (t, a) => {
122
+ if (!At(t)) return;
123
123
  let e = {};
124
124
  for (const [o, n] of Object.entries(t))
125
- e[o] = h(a, n);
125
+ e[o] = p(a, n);
126
126
  return e;
127
- }, Pt = (t, a) => {
127
+ }, kt = (t, a) => {
128
128
  const e = structuredClone(t);
129
- return Array.isArray(e) ? e.map((n) => h(a, n)) : void 0;
130
- }, M = (t, a, e) => {
129
+ return Array.isArray(e) ? e.map((n) => p(a, n)) : void 0;
130
+ }, z = (t, a, e) => {
131
131
  if (t === "${agg:count}" && "rowData" in a) {
132
132
  if (Array.isArray(a == null ? void 0 : a.rowData))
133
133
  return a == null ? void 0 : a.rowData.length;
134
134
  } else
135
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) => {
136
+ }, Bt = (t, a) => z(t, a), Ft = (t, a, e) => {
137
137
  if (e && console.log("inElement : ", t), e && console.log("inTemplate : ", a), a == null)
138
138
  throw new TypeError("inTemplate is required");
139
139
  if (typeof a != "object" && typeof a != "string")
@@ -141,22 +141,22 @@ const At = {
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
- }, vt = {
144
+ }, St = {
145
145
  name: "json-transformer-funcs-primitive",
146
146
  version: "1.9.0"
147
- }, St = (t) => {
147
+ }, jt = (t) => {
148
148
  var a, e;
149
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,
150
+ meta: St,
151
151
  applyTemplate: t
152
152
  });
153
- }, h = (t, a, e) => {
153
+ }, p = (t, a, e) => {
154
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);
155
+ Ft(o, n, e);
156
+ const s = structuredClone(n);
157
+ return typeof s == "string" ? z(s, o) : (s === null || typeof s != "object" || ("textContent" in s && (s.textContent = Bt(s == null ? void 0 : s.textContent, o)), "attributes" in s && (s.attributes = It(s == null ? void 0 : s.attributes, o)), "children" in s && (s.children = kt(s == null ? void 0 : s.children, o))), s);
158
158
  };
159
- St(h);
159
+ jt(p);
160
160
  const Rt = (t, a) => {
161
161
  if (!Array.isArray(t))
162
162
  throw new TypeError("inSource must be an Array");
@@ -168,73 +168,73 @@ const Rt = (t, a) => {
168
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
- }, p = (t, a) => {
171
+ }, m = (t, a) => {
172
172
  const e = t, o = a;
173
- return Rt(e, o), e.map((n) => h(n, o));
174
- }, Et = (t, a) => t.map((o) => ({
173
+ return Rt(e, o), e.map((n) => p(n, o));
174
+ }, vt = (t, a) => t.map((o) => ({
175
175
  ...o,
176
176
  rowData: a[o.columnName]
177
- })), Lt = (t, a, e) => {
178
- var n, r, s, l, i, u;
177
+ })), Et = (t, a, e) => {
178
+ var n, s, r, i, l, c;
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 c = 0; c < t.length; c++) {
184
- const d = t[c];
183
+ for (let u = 0; u < t.length; u++) {
184
+ const d = t[u];
185
185
  if (!d || typeof d != "object")
186
- throw new TypeError(`inColumns[${c}] must be an object`);
186
+ throw new TypeError(`inColumns[${u}] must be an object`);
187
187
  if (typeof d.columnName != "string" || !d.columnName.trim())
188
- throw new TypeError(`inColumns[${c}].columnName must be a non-empty string`);
188
+ throw new TypeError(`inColumns[${u}].columnName must be a non-empty string`);
189
189
  }
190
190
  if (!Array.isArray(a))
191
191
  throw new TypeError("inData must be an Array");
192
- for (let c = 0; c < a.length; c++) {
193
- const d = a[c];
192
+ for (let u = 0; u < a.length; u++) {
193
+ const d = a[u];
194
194
  if (!d || typeof d != "object")
195
- throw new TypeError(`inData[${c}] must be an object`);
195
+ throw new TypeError(`inData[${u}] 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 o = ((s = (r = (n = t[0]) == null ? void 0 : n.template) == null ? void 0 : r.body) == null ? void 0 : s.tr) || "buildBodyTr";
199
+ const o = ((r = (s = (n = t[0]) == null ? void 0 : n.template) == null ? void 0 : s.body) == null ? void 0 : r.tr) || "buildBodyTr";
200
200
  if (!(o in e))
201
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`);
202
+ for (let u = 0; u < t.length; u++) {
203
+ const d = t[u], h = ((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 (!(h in e))
205
+ throw new Error(`Cell template "${h}" for column "${d.columnName}" not found in inSpec`);
206
206
  }
207
207
  return !0;
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;
208
+ }, Ot = (t, a) => t.map((o) => {
209
+ var i, l, c;
210
+ const n = ((l = (i = o.template) == null ? void 0 : i.body) == null ? void 0 : l.cell) || ((c = o.template) == null ? void 0 : c.bodyCell) || "buildBodyCell", s = a[n];
211
+ return p(o, s);
212
+ }), N = (t, a, e) => {
213
+ var c, u, d;
214
+ Et(t, a, e);
215
+ const o = t, n = a, s = e, r = ((d = (u = (c = o[0]) == null ? void 0 : c.template) == null ? void 0 : u.body) == null ? void 0 : d.tr) || "buildBodyTr", i = s[r];
216
+ return n.map((h) => {
217
+ const w = p(h, i), rt = vt(o, h), lt = Ot(rt, s);
218
+ return w.children = lt, w;
219
219
  });
220
- }, Ot = {
220
+ }, Dt = {
221
221
  tagName: "tr",
222
222
  attributes: {
223
223
  class: "align-middle"
224
224
  },
225
225
  children: []
226
- }, Kt = {
226
+ }, Lt = {
227
227
  tagName: "col",
228
228
  attributes: {
229
229
  width: "${width}"
230
230
  }
231
- }, Vt = {
231
+ }, Kt = {
232
232
  tagName: "th",
233
233
  textContent: "${columnName}",
234
234
  attributes: {
235
235
  class: "py-3 px-3 fw-semibold text-uppercase small"
236
236
  }
237
- }, Wt = {
237
+ }, Vt = {
238
238
  tagName: "td",
239
239
  children: [
240
240
  {
@@ -249,19 +249,19 @@ const Rt = (t, a) => {
249
249
  }
250
250
  }
251
251
  ]
252
- }, qt = {
252
+ }, Ht = {
253
253
  tagName: "td",
254
254
  textContent: "${rowValue}",
255
255
  attributes: {
256
256
  class: "py-3 px-3 text-secondary"
257
257
  }
258
- }, Ht = {
258
+ }, Mt = {
259
259
  tagName: "button",
260
260
  textContent: "${columnName}",
261
261
  attributes: {
262
262
  class: "btn btn-primary btn-sm"
263
263
  }
264
- }, zt = {
264
+ }, Wt = {
265
265
  tagName: "td",
266
266
  attributes: {
267
267
  class: "py-2 px-3 text-center"
@@ -275,13 +275,27 @@ const Rt = (t, a) => {
275
275
  }
276
276
  }
277
277
  ]
278
+ }, qt = {
279
+ tagName: "td",
280
+ attributes: {
281
+ class: "py-2 px-3 text-center"
282
+ },
283
+ children: [
284
+ {
285
+ tagName: "button",
286
+ textContent: "${columnName}",
287
+ attributes: {
288
+ class: "btn btn-primary btn-sm"
289
+ }
290
+ }
291
+ ]
278
292
  }, Gt = {
279
293
  tagName: "option",
280
294
  textContent: "${rowValue}",
281
295
  attributes: {
282
296
  value: "${rowValue}"
283
297
  }
284
- }, Mt = {
298
+ }, zt = {
285
299
  tagName: "select",
286
300
  attributes: {
287
301
  id: "LedgerName"
@@ -293,20 +307,25 @@ const Rt = (t, a) => {
293
307
  "data-name": "${columnName}"
294
308
  },
295
309
  children: []
310
+ }, Jt = {
311
+ tagName: "td",
312
+ children: []
296
313
  }, b = {
297
- buildBodyTr: Ot,
298
- buildColGroup: Kt,
299
- buildHeader: Vt,
300
- buildFooter: Wt,
301
- buildBodyCell: qt,
302
- button: Ht,
303
- buttonCell: zt,
314
+ buildBodyTr: Dt,
315
+ buildColGroup: Lt,
316
+ buildHeader: Kt,
317
+ buildFooter: Vt,
318
+ buildBodyCell: Ht,
319
+ button: Mt,
320
+ buttonCell: Wt,
321
+ optionsButtonCell: qt,
304
322
  buildOption: Gt,
305
- buildSelect: Mt,
306
- buildDataList: Ut
307
- }, Jt = "table", _t = {
323
+ buildSelect: zt,
324
+ buildDataList: Ut,
325
+ emptyCell: Jt
326
+ }, _t = "table", Xt = {
308
327
  class: "table table-hover table-striped align-middle border mb-0"
309
- }, Xt = [
328
+ }, Qt = [
310
329
  {
311
330
  tagName: "colgroup",
312
331
  attributes: {
@@ -352,11 +371,11 @@ const Rt = (t, a) => {
352
371
  }
353
372
  ]
354
373
  }
355
- ], U = {
356
- tagName: Jt,
357
- attributes: _t,
358
- children: Xt
359
- }, Qt = [
374
+ ], Yt = {
375
+ tagName: _t,
376
+ attributes: Xt,
377
+ children: Qt
378
+ }, Zt = [
360
379
  {
361
380
  narration: "Build the column widths for the table using the configured columns.",
362
381
  destinationPath: {
@@ -393,7 +412,7 @@ const Rt = (t, a) => {
393
412
  templateKey: "buildHeader",
394
413
  func: "fromCollection"
395
414
  }
396
- ], Yt = [
415
+ ], te = [
397
416
  {
398
417
  narration: "Build the table body rows for the table using the configured columns and data.",
399
418
  destinationPath: {
@@ -411,102 +430,317 @@ const Rt = (t, a) => {
411
430
  },
412
431
  func: "twoDimensional"
413
432
  }
414
- ], y = (t, a) => {
433
+ ], C = (t, a) => {
415
434
  var e;
416
435
  if (((e = t == null ? void 0 : t.attributes) == null ? void 0 : e["data-role"]) === a) return t;
417
436
  for (const o of (t == null ? void 0 : t.children) ?? []) {
418
- const n = y(o, a);
437
+ const n = C(o, a);
419
438
  if (n) return n;
420
439
  }
421
440
  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) => {
441
+ }, ee = (t, a) => {
442
+ const e = t[a.fileName], o = a.dataRole ? C(e, a.dataRole) : e;
443
+ return (a.filePath ?? []).reduce((n, s) => n[s], o);
444
+ }, A = (t) => Array.isArray(t) ? t : [t], U = (t, a, e) => {
426
445
  t[a] = e;
427
- }, te = (t, a, e) => {
446
+ }, ae = (t, a, e) => {
428
447
  t[a].push(...A(e));
429
- }, ee = (t, a, e) => {
448
+ }, oe = (t, a, e) => {
430
449
  t[a].unshift(...A(e));
431
- }, ae = (t, a, e) => {
450
+ }, ne = (t, a, e) => {
432
451
  t[a].forEach((o) => {
433
452
  o.children.push(...structuredClone(A(e)));
434
453
  });
435
- }, oe = (t, a, e) => {
454
+ }, se = (t, a, e) => {
436
455
  t[a].forEach((o) => {
437
456
  o.children.unshift(...structuredClone(A(e)));
438
457
  });
439
- }, ne = (t, a, e) => {
458
+ }, re = (t, a, e) => {
440
459
  t[a].forEach((o, n) => {
441
- const r = structuredClone(e);
442
- r.textContent = n + 1, o.children.unshift(r);
460
+ const s = structuredClone(e);
461
+ s.textContent = n + 1, o.children.unshift(s);
443
462
  });
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"}`;
463
+ }, le = {
464
+ set: U,
465
+ push: ae,
466
+ unshift: oe,
467
+ pushToRows: ne,
468
+ unshiftToRows: se,
469
+ unshiftSerialToRows: re
470
+ }, ie = (t, a) => {
471
+ const e = a.dataRole ? C(t[a.fileName], a.dataRole) : t[a.fileName], o = [...a.filePath ?? []], n = o.pop();
472
+ return { parent: o.reduce((r, i) => r[i], e), key: n };
473
+ }, J = (t, a, e) => {
474
+ const { parent: o, key: n } = ie(t, a);
475
+ (le[a.action] || U)(o, n, e);
476
+ }, ce = (t, a, e) => {
477
+ var s, r;
478
+ const o = !!((s = t.sourcePath) != null && s.fileName && Array.isArray((r = t.sourcePath) == null ? void 0 : r.filePath)), n = `structure/sourcePath: ${o ? "passed" : "failed"}`;
460
479
  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"}`;
480
+ }, ue = (t, a, e) => {
481
+ var s, r;
482
+ const o = !!((s = t.destinationPath) != null && s.fileName && Array.isArray((r = t.destinationPath) == null ? void 0 : r.filePath)), n = `structure/destinationPath: ${o ? "passed" : "failed"}`;
464
483
  return e.push(n), a && console.log(n), o;
465
- }, ce = (t, a, e) => {
484
+ }, de = (t, a, e) => {
466
485
  const o = t.templateKey === void 0 || typeof t.templateKey == "string" && t.templateKey.length > 0, n = `structure/templateKey: ${o ? "passed" : "failed"}`;
467
486
  return e.push(n), a && console.log(n), o;
468
- }, ue = (t, a, e) => {
487
+ }, be = (t, a, e) => {
469
488
  const o = typeof t.func == "string" && t.func.length > 0, n = `structure/func: ${o ? "passed" : "failed"}`;
470
489
  return e.push(n), a && console.log(n), o;
471
- }, de = (t, a, e) => [
472
- le(t, a, e),
473
- ie(t, a, e),
490
+ }, pe = (t, a, e) => [
474
491
  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);
492
+ ue(t, a, e),
493
+ de(t, a, e),
494
+ be(t, a, e)
495
+ ].every(Boolean), me = (t, a, e, o) => {
496
+ const n = typeof a[t.func] == "function", s = `references/func (${t.func}): ${n ? "passed" : "failed"}`;
497
+ return o.push(s), e && console.log(s), n;
498
+ }, he = (t, a, e, o) => {
499
+ const n = t.templateKey === void 0 || Object.hasOwn(a, t.templateKey), s = `references/templateKey${t.templateKey === void 0 ? " (not used)" : ` (${t.templateKey})`}: ${n ? "passed" : "failed"}`;
500
+ return o.push(s), e && console.log(s), n;
501
+ }, fe = (t, a, e, o, n) => {
502
+ const s = me(t, a, o, n), r = he(t, e, o, n);
503
+ return s && r;
504
+ }, _ = (t, a, e, o, n) => pe(t, o, n) ? fe(t, a, e, o, n) : !1, ye = (t, a, e, o, n, s) => {
505
+ if (!_(t, e, o, n, s)) return;
506
+ const r = n, i = o, l = t.templateKey, c = i[l];
507
+ r && console.log("singleInstruction ; ", l, c);
508
+ const u = ee(a, t.sourcePath), d = e[t.func](u, c);
509
+ J(a, t.destinationPath, d);
510
+ }, f = (t, a, e, o, n, s) => {
511
+ t.forEach((r) => {
512
+ ye(r, a, e, o, n, s);
494
513
  });
495
- }, he = (t, a, e, o, n, r) => {
496
- if (!X(t, e, o, n, r)) return;
497
- const s = e[t.func](
514
+ }, Ce = (t, a, e, o, n, s) => {
515
+ if (!_(t, e, o, n, s)) return;
516
+ const r = e[t.func](
498
517
  a.data.columns,
499
518
  a.data.data,
500
519
  o
501
520
  );
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);
521
+ J(a, t.destinationPath, r);
522
+ }, S = (t, a, e, o, n, s) => {
523
+ t.forEach((r) => {
524
+ Ce(r, a, e, o, n, s);
506
525
  });
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 = {
526
+ }, we = [
527
+ {
528
+ narration: "Prepend the serial column width to the table colgroup.",
529
+ destinationPath: {
530
+ fileName: "base",
531
+ dataRole: "table-colgroup",
532
+ filePath: [
533
+ "children"
534
+ ],
535
+ action: "unshift"
536
+ },
537
+ sourcePath: {
538
+ fileName: "data",
539
+ filePath: [
540
+ "serial",
541
+ "col"
542
+ ]
543
+ },
544
+ templateKey: "buildColGroup",
545
+ func: "applyTemplate"
546
+ },
547
+ {
548
+ narration: "Prepend the serial header cell to the table header row.",
549
+ destinationPath: {
550
+ fileName: "base",
551
+ dataRole: "table-header-row",
552
+ filePath: [
553
+ "children"
554
+ ],
555
+ action: "unshift"
556
+ },
557
+ sourcePath: {
558
+ fileName: "data",
559
+ filePath: [
560
+ "serial",
561
+ "header"
562
+ ]
563
+ },
564
+ templateKey: "buildHeader",
565
+ func: "applyTemplate"
566
+ },
567
+ {
568
+ narration: "Prepend the serial number cell into each table body row.",
569
+ destinationPath: {
570
+ fileName: "base",
571
+ dataRole: "table-body",
572
+ filePath: [
573
+ "children"
574
+ ],
575
+ action: "unshiftSerialToRows"
576
+ },
577
+ sourcePath: {
578
+ fileName: "data",
579
+ filePath: [
580
+ "serial",
581
+ "body"
582
+ ]
583
+ },
584
+ templateKey: "buildBodyCell",
585
+ func: "applyTemplate"
586
+ }
587
+ ], ge = [
588
+ {
589
+ narration: "Prepend an empty cell into the table footer row if footer row is present.",
590
+ destinationPath: {
591
+ fileName: "base",
592
+ dataRole: "table-footer-row",
593
+ filePath: [
594
+ "children"
595
+ ],
596
+ action: "unshift"
597
+ },
598
+ sourcePath: {
599
+ fileName: "data",
600
+ filePath: [
601
+ "serial",
602
+ "footer"
603
+ ]
604
+ },
605
+ templateKey: "emptyCell",
606
+ func: "applyTemplate"
607
+ }
608
+ ], R = { applyTemplate: p }, $e = (t = {}, a = {}, e = !1, o = []) => {
609
+ let n = t, s = a;
610
+ t && typeof t == "object" && "inTableSpec" in t && (n = t.inTableSpec, s = t.inSerial || a);
611
+ const i = {
612
+ data: {
613
+ serial: {
614
+ col: { width: "50px" },
615
+ header: { columnName: "#" },
616
+ body: {},
617
+ footer: {},
618
+ ...s
619
+ }
620
+ },
621
+ base: n,
622
+ spec: b
623
+ };
624
+ f(we, i, R, b, e, o);
625
+ const l = C(n, "table-footer-row");
626
+ return l && Array.isArray(l.children) && l.children.length > 0 && f(ge, i, R, b, e, o), n;
627
+ }, Ne = [
628
+ {
629
+ narration: "Append the options column width to the table colgroup.",
630
+ destinationPath: {
631
+ fileName: "base",
632
+ dataRole: "table-colgroup",
633
+ filePath: [
634
+ "children"
635
+ ],
636
+ action: "push"
637
+ },
638
+ sourcePath: {
639
+ fileName: "data",
640
+ filePath: [
641
+ "options",
642
+ "col"
643
+ ]
644
+ },
645
+ templateKey: "buildColGroup",
646
+ func: "applyTemplate"
647
+ },
648
+ {
649
+ narration: "Append the options header cell to the table header row.",
650
+ destinationPath: {
651
+ fileName: "base",
652
+ dataRole: "table-header-row",
653
+ filePath: [
654
+ "children"
655
+ ],
656
+ action: "push"
657
+ },
658
+ sourcePath: {
659
+ fileName: "data",
660
+ filePath: [
661
+ "options",
662
+ "header"
663
+ ]
664
+ },
665
+ templateKey: "buildHeader",
666
+ func: "applyTemplate"
667
+ },
668
+ {
669
+ narration: "Append the options button cell into each table body row.",
670
+ destinationPath: {
671
+ fileName: "base",
672
+ dataRole: "table-body",
673
+ filePath: [
674
+ "children"
675
+ ],
676
+ action: "pushToRows"
677
+ },
678
+ sourcePath: {
679
+ fileName: "data",
680
+ filePath: [
681
+ "options",
682
+ "body"
683
+ ]
684
+ },
685
+ templateKey: "optionsButtonCell",
686
+ func: "applyTemplate"
687
+ }
688
+ ], Te = [
689
+ {
690
+ narration: "Append an empty cell into the table footer row if footer row is present.",
691
+ destinationPath: {
692
+ fileName: "base",
693
+ dataRole: "table-footer-row",
694
+ filePath: [
695
+ "children"
696
+ ],
697
+ action: "push"
698
+ },
699
+ sourcePath: {
700
+ fileName: "data",
701
+ filePath: [
702
+ "options",
703
+ "footer"
704
+ ]
705
+ },
706
+ templateKey: "emptyCell",
707
+ func: "applyTemplate"
708
+ }
709
+ ], v = { applyTemplate: p }, xe = (t = {}, a = {}, e = !1, o = []) => {
710
+ let n = t, s = a;
711
+ t && typeof t == "object" && "inTableSpec" in t && (n = t.inTableSpec, s = t.inOptions || a);
712
+ const i = {
713
+ data: {
714
+ options: {
715
+ col: { width: "100px" },
716
+ header: { columnName: "options" },
717
+ body: { columnName: "show" },
718
+ footer: {},
719
+ ...s
720
+ }
721
+ },
722
+ base: n,
723
+ spec: b
724
+ };
725
+ f(Ne, i, v, b, e, o);
726
+ const l = C(n, "table-footer-row");
727
+ return l && Array.isArray(l.children) && l.children.length > 0 && f(Te, i, v, b, e, o), n;
728
+ }, X = ({ inOptions: t = {}, inBase: a, showLog: e = !1, returnLog: o = [] }) => {
729
+ const n = t, s = a;
730
+ return (n.showSerial || n.serial) && $e(s, n.serial || {}, e, o), (n.showOptions || n.options) && xe(s, n.options || {}, e, o), s;
731
+ }, E = { fromCollection: m, twoDimensional: N }, Pe = (t = {}, a = !1, e = []) => {
732
+ const o = t, n = o.columns || [], s = o.data || [], r = o.options, i = structuredClone(Yt), l = {
733
+ data: {
734
+ columns: n,
735
+ data: s
736
+ },
737
+ base: i,
738
+ spec: b
739
+ };
740
+ return f(Zt, l, E, b, a, e), S(te, l, E, b, a, e), X({ inOptions: r, inBase: i }), i;
741
+ }, Ae = "table", Ie = {
508
742
  class: "table table-hover table-striped align-middle border mb-0"
509
- }, ge = [
743
+ }, ke = [
510
744
  {
511
745
  tagName: "colgroup",
512
746
  attributes: {
@@ -553,10 +787,10 @@ const Rt = (t, a) => {
553
787
  ]
554
788
  }
555
789
  ], Q = {
556
- tagName: Ce,
557
- attributes: $e,
558
- children: ge
559
- }, we = [
790
+ tagName: Ae,
791
+ attributes: Ie,
792
+ children: ke
793
+ }, Be = [
560
794
  {
561
795
  narration: "Build the column widths for the table using the configured columns.",
562
796
  destinationPath: {
@@ -593,9 +827,9 @@ const Rt = (t, a) => {
593
827
  templateKey: "buildHeader",
594
828
  func: "fromCollection"
595
829
  }
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 = [
830
+ ], O = { data: {}, base: Q, spec: b }, Fe = { fromCollection: m }, Se = (t, a = !1, e = []) => (O.data = t, f(Be, O, Fe, b, a, e), Q), je = [], Y = {
831
+ children: je
832
+ }, Re = [
599
833
  {
600
834
  narration: "Build the table body rows for the table using the configured columns and data.",
601
835
  destinationPath: {
@@ -612,9 +846,9 @@ const Rt = (t, a) => {
612
846
  },
613
847
  func: "twoDimensional"
614
848
  }
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 = {
849
+ ], D = { data: {}, base: Y, spec: b }, ve = { twoDimensional: N }, Ee = (t, a = !1, e = []) => (D.data = t, S(Re, D, ve, b, a, e), Y.children), Oe = "table", De = {
616
850
  class: "table table-hover table-striped align-middle border mb-0"
617
- }, je = [
851
+ }, Le = [
618
852
  {
619
853
  tagName: "colgroup",
620
854
  attributes: {
@@ -660,11 +894,11 @@ const Rt = (t, a) => {
660
894
  }
661
895
  ]
662
896
  }
663
- ], Z = {
664
- tagName: Fe,
665
- attributes: Pe,
666
- children: je
667
- }, Be = [
897
+ ], Ke = {
898
+ tagName: Oe,
899
+ attributes: De,
900
+ children: Le
901
+ }, Ve = [
668
902
  {
669
903
  narration: "Build the column widths for the table using the configured columns.",
670
904
  destinationPath: {
@@ -719,7 +953,7 @@ const Rt = (t, a) => {
719
953
  templateKey: "buildFooter",
720
954
  func: "fromCollection"
721
955
  }
722
- ], ve = [
956
+ ], He = [
723
957
  {
724
958
  narration: "Build the table body rows for the table using the configured columns and data.",
725
959
  destinationPath: {
@@ -737,9 +971,19 @@ const Rt = (t, a) => {
737
971
  },
738
972
  func: "twoDimensional"
739
973
  }
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 = [
974
+ ], L = { fromCollection: m, twoDimensional: N }, Me = (t = {}, a = !1, e = []) => {
975
+ const o = t, n = o.inColumns || o.columns || [], s = o.inData || o.data || [], r = o.inOptions || o.options || {}, i = structuredClone(Ke), l = {
976
+ data: {
977
+ columns: n,
978
+ data: s
979
+ },
980
+ base: i,
981
+ spec: b
982
+ };
983
+ return f(Ve, l, L, b, a, e), S(He, l, L, b, a, e), X({ inOptions: r, inBase: i }), i;
984
+ }, We = [], T = {
985
+ children: We
986
+ }, qe = [
743
987
  {
744
988
  narration: "Build the footer row for the table using the configured columns.",
745
989
  destinationPath: {
@@ -757,115 +1001,116 @@ const Rt = (t, a) => {
757
1001
  templateKey: "buildFooter",
758
1002
  func: "fromCollection"
759
1003
  }
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
1004
+ ], K = { data: {}, base: T, spec: b }, Ge = { fromCollection: m, twoDimensional: N }, ze = (t, a = !1, e = []) => (K.data = t, f(qe, K, Ge, b, a, e), T == null ? void 0 : T.children), Ue = {
1005
+ simple: Pe,
1006
+ headerOnly: Se,
1007
+ bodyOnly: Ee,
1008
+ withFooter: Me,
1009
+ footerOnly: ze
766
1010
  }, V = ({
767
1011
  inData: t,
768
1012
  inColumns: a,
769
1013
  inType: e,
770
1014
  footer: o = [],
771
- options: n,
772
- inShowLog: r
1015
+ inOptions: n,
1016
+ inShowLog: s
773
1017
  } = {}) => {
774
- const l = Oe[e];
775
- return l({
1018
+ const r = e, i = Ue[r], l = n, c = s;
1019
+ return c && console.log("table : ", r, l), i({
776
1020
  columns: a,
777
1021
  data: t,
778
- showLog: r
1022
+ options: l,
1023
+ showLog: c
779
1024
  });
780
- }, Ke = ({ inData: t = [], inColumns: a = [] } = {}) => ({
1025
+ }, Je = ({ inData: t = [], inColumns: a = [] } = {}) => ({
781
1026
  data: t,
782
1027
  columns: a
783
- }), Ve = {
1028
+ }), _e = {
784
1029
  tagName: "option",
785
1030
  textContent: "${rowValue}",
786
1031
  attributes: {
787
1032
  value: "${rowValue}"
788
1033
  }
789
- }, We = {
1034
+ }, Xe = {
790
1035
  tagName: "select",
791
1036
  attributes: {
792
1037
  id: "LedgerName"
793
1038
  },
794
1039
  children: []
795
- }, qe = {
1040
+ }, Qe = {
796
1041
  tagName: "datalist",
797
1042
  attributes: {
798
1043
  "data-name": "${columnName}"
799
1044
  },
800
1045
  children: []
801
- }, f = {
802
- buildOption: Ve,
803
- buildSelect: We,
804
- buildDataList: qe
805
- }, He = (t, a = f.buildOption) => {
1046
+ }, y = {
1047
+ buildOption: _e,
1048
+ buildSelect: Xe,
1049
+ buildDataList: Qe
1050
+ }, Ye = (t, a = y.buildOption) => {
806
1051
  const e = structuredClone(a);
807
1052
  return e.textContent = e.textContent.replace("rowValue", t), e.attributes.value = e.attributes.value.replace("rowValue", t), e;
808
- }, ze = (t, a) => {
809
- const e = a == null ? void 0 : a.columnName, o = structuredClone(f.buildSelect);
1053
+ }, Ze = (t, a) => {
1054
+ const e = a == null ? void 0 : a.columnName, o = structuredClone(y.buildSelect);
810
1055
  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 = [] } = {}) => ({
1056
+ const n = Ye(e, y.buildOption);
1057
+ return o.children = m(t, n), o;
1058
+ }, ta = ({ data: t, columns: a }) => a.map((e) => Ze(t, e)), ea = (t = {}) => {
1059
+ const { data: a, columns: e } = Je(t);
1060
+ return ta({ data: a, columns: e });
1061
+ }, aa = ({ inData: t = [], inColumns: a = [] } = {}) => ({
817
1062
  data: t,
818
1063
  columns: a
819
- }), Je = (t, a = f.buildOption) => {
1064
+ }), oa = (t, a = y.buildOption) => {
820
1065
  const e = structuredClone(a);
821
1066
  return e.textContent = e.textContent.replace("rowValue", t), e.attributes.value = e.attributes.value.replace("rowValue", t), e;
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 = [] } = {}) => ({
1067
+ }, na = (t, a) => {
1068
+ const e = a == null ? void 0 : a.columnName, o = oa(e, y.buildOption);
1069
+ return m(t, o);
1070
+ }, sa = ({ data: t, columns: a }) => a.map((e) => na(t, e)), ra = (t = {}) => {
1071
+ const { data: a, columns: e } = aa(t);
1072
+ return sa({ data: a, columns: e });
1073
+ }, la = ({ inData: t = [], inColumns: a = [] } = {}) => ({
829
1074
  data: t,
830
1075
  columns: a
831
- }), Ze = (t, a = f.buildOption) => {
1076
+ }), ia = (t, a = y.buildOption) => {
832
1077
  const e = structuredClone(a);
833
1078
  return e.textContent = e.textContent.replace("rowValue", t), e.attributes.value = e.attributes.value.replace("rowValue", t), e;
834
- }, ta = (t, a) => {
835
- const e = a == null ? void 0 : a.columnName, o = structuredClone(f.buildDataList);
1079
+ }, ca = (t, a) => {
1080
+ const e = a == null ? void 0 : a.columnName, o = structuredClone(y.buildDataList);
836
1081
  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 = {
1082
+ const n = ia(e, y.buildOption);
1083
+ return o.children = m(t, n), o;
1084
+ }, ua = ({ data: t, columns: a }) => a.map((e) => ca(t, e)), H = (t = {}) => {
1085
+ const { data: a, columns: e } = la(t);
1086
+ return ua({ data: a, columns: e });
1087
+ }, da = {
843
1088
  version: "1.2.0",
844
1089
  name: "json-renderers-build-input-row"
845
- }, oa = (t) => {
1090
+ }, ba = (t) => {
846
1091
  const a = t;
847
1092
  if (typeof globalThis > "u" || !a) return;
848
1093
  globalThis.ks ?? (globalThis.ks = {});
849
1094
  const e = typeof a == "function" ? a : a.render;
850
1095
  globalThis.ks.jsonRenderersBuildInputRow = {
851
- meta: aa,
1096
+ meta: da,
852
1097
  render: e,
853
1098
  ...typeof a == "object" ? a : {}
854
1099
  };
855
- }, na = "input", ra = {
1100
+ }, pa = "input", ma = {
856
1101
  type: "search",
857
1102
  placeholder: "Search...",
858
1103
  class: "form-control",
859
1104
  id: "searchInputId"
860
- }, sa = {
861
- tagName: na,
862
- attributes: ra
1105
+ }, ha = {
1106
+ tagName: pa,
1107
+ attributes: ma
863
1108
  }, x = ({ inOptions: t = {}, options: a = {} } = {}) => {
864
- const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(sa);
1109
+ const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(ha);
865
1110
  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 = {
1111
+ }, fa = "div", ya = {
867
1112
  class: "d-flex align-items-center gap-2"
868
- }, ca = [
1113
+ }, Ca = [
869
1114
  {
870
1115
  tagName: "label",
871
1116
  textContent: "Search:",
@@ -883,16 +1128,16 @@ const Rt = (t, a) => {
883
1128
  id: "searchInputId"
884
1129
  }
885
1130
  }
886
- ], ua = {
887
- tagName: la,
888
- attributes: ia,
889
- children: ca
1131
+ ], wa = {
1132
+ tagName: fa,
1133
+ attributes: ya,
1134
+ children: Ca
890
1135
  }, 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 = {
1136
+ const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(wa), n = o.children[0], s = o.children[1];
1137
+ return e.label && (n.textContent = e.label), e.id && (n.attributes.for = e.id, s.attributes.id = e.id), e.placeholder && (s.attributes.placeholder = e.placeholder), e.class && (s.attributes.class = e.class), e.name && (s.attributes.name = e.name), e.type && (s.attributes.type = e.type), e.wrapperClass && (o.attributes.class = e.wrapperClass), e.labelClass && (n.attributes.class = e.labelClass), o;
1138
+ }, ga = "div", $a = {
894
1139
  class: "d-flex align-items-center gap-2"
895
- }, pa = [
1140
+ }, Na = [
896
1141
  {
897
1142
  tagName: "label",
898
1143
  textContent: "Search:",
@@ -919,45 +1164,45 @@ const Rt = (t, a) => {
919
1164
  id: "searchButtonId"
920
1165
  }
921
1166
  }
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 = {
1167
+ ], Ta = {
1168
+ tagName: ga,
1169
+ attributes: $a,
1170
+ children: Na
1171
+ }, j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1172
+ const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(Ta), n = o.children[0], s = o.children[1], r = o.children[2];
1173
+ return e.label && (n.textContent = e.label), e.id && (n.attributes.for = e.id, s.attributes.id = e.id), e.placeholder && (s.attributes.placeholder = e.placeholder), e.class && (s.attributes.class = e.class), e.name && (s.attributes.name = e.name), e.type && (s.attributes.type = e.type), e.buttonText && (r.textContent = e.buttonText), e.buttonClass && (r.attributes.class = e.buttonClass), e.buttonId && (r.attributes.id = e.buttonId), e.wrapperClass && (o.attributes.class = e.wrapperClass), e.labelClass && (n.attributes.class = e.labelClass), o;
1174
+ }, xa = {
930
1175
  input: x,
931
1176
  inputOnly: x,
932
1177
  inputWithLabel: I,
933
- inputWithLabelButton: R
934
- }, ha = ({
1178
+ inputWithLabelButton: j
1179
+ }, Pa = ({
935
1180
  type: t = "inputWithLabel",
936
1181
  options: a = {},
937
1182
  inType: e,
938
1183
  inOptions: o
939
1184
  } = {}) => {
940
- const n = e ?? t, r = o ?? a;
941
- return (fa[n] || I)({ inOptions: r, options: r });
1185
+ const n = e ?? t, s = o ?? a;
1186
+ return (xa[n] || I)({ inOptions: s, options: s });
942
1187
  };
943
- oa({
944
- render: ha,
1188
+ ba({
1189
+ render: Pa,
945
1190
  inputOnly: x,
946
1191
  inputWithLabel: I,
947
- inputWithLabelButton: R
1192
+ inputWithLabelButton: j
948
1193
  });
949
- const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1194
+ const k = ({ inOptions: t = {}, options: a = {} } = {}) => {
950
1195
  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 = {
1196
+ 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 ? j({ inOptions: e }) : I({ inOptions: e });
1197
+ }, Aa = {
953
1198
  version: "1.2.0",
954
1199
  name: "json-renderers-build-form"
955
- }, Ca = (t) => {
956
- typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuildForm = { meta: ya, render: t });
957
- }, $a = "div", ga = {
1200
+ }, Ia = (t) => {
1201
+ typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuildForm = { meta: Aa, render: t });
1202
+ }, ka = "div", Ba = {
958
1203
  class: "${cardClass}",
959
1204
  "data-role": "form-card"
960
- }, wa = [
1205
+ }, Fa = [
961
1206
  {
962
1207
  tagName: "header",
963
1208
  attributes: {
@@ -1038,14 +1283,14 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1038
1283
  }
1039
1284
  ]
1040
1285
  }
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 = {
1286
+ ], Sa = {
1287
+ tagName: ka,
1288
+ attributes: Ba,
1289
+ children: Fa
1290
+ }, ja = () => structuredClone(Sa), Ra = "header-actions", va = "button", M = {
1291
+ destinationRole: Ra,
1292
+ template: va
1293
+ }, Ea = {
1049
1294
  tagName: "button",
1050
1295
  textContent: "${label}",
1051
1296
  attributes: {
@@ -1053,20 +1298,20 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1053
1298
  form: "${formId}",
1054
1299
  class: "${buttonClass} ${buttonSizeClass} ${buttonPaddingClass}"
1055
1300
  }
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 = {
1301
+ }, Oa = {
1302
+ button: Ea
1303
+ }, Da = (t, a) => {
1304
+ const e = structuredClone(t), o = m(a.header.actions, Oa[M.template]);
1305
+ return C(e, M.destinationRole).children.push(...o), e;
1306
+ }, La = "form-body", Ka = {
1307
+ destinationRole: La
1308
+ }, Va = {
1064
1309
  tagName: "div",
1065
1310
  attributes: {
1066
1311
  class: "${rowClass}"
1067
1312
  },
1068
1313
  children: []
1069
- }, va = {
1314
+ }, Ha = {
1070
1315
  tagName: "div",
1071
1316
  attributes: {
1072
1317
  class: "${fieldClass}"
@@ -1092,7 +1337,7 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1092
1337
  }
1093
1338
  }
1094
1339
  ]
1095
- }, Sa = {
1340
+ }, Ma = {
1096
1341
  tagName: "div",
1097
1342
  attributes: {
1098
1343
  class: "${fieldClass}"
@@ -1119,7 +1364,7 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1119
1364
  }
1120
1365
  }
1121
1366
  ]
1122
- }, Ra = {
1367
+ }, Wa = {
1123
1368
  tagName: "div",
1124
1369
  attributes: {
1125
1370
  class: "${fieldClass}"
@@ -1145,7 +1390,7 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1145
1390
  }
1146
1391
  }
1147
1392
  ]
1148
- }, Ea = {
1393
+ }, qa = {
1149
1394
  tagName: "div",
1150
1395
  attributes: {
1151
1396
  class: "${checkboxWrapperClass} ${fieldClass}"
@@ -1170,7 +1415,7 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1170
1415
  }
1171
1416
  }
1172
1417
  ]
1173
- }, La = {
1418
+ }, Ga = {
1174
1419
  tagName: "div",
1175
1420
  attributes: {
1176
1421
  class: "${fieldClass}"
@@ -1196,7 +1441,7 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1196
1441
  }
1197
1442
  }
1198
1443
  ]
1199
- }, Da = {
1444
+ }, za = {
1200
1445
  tagName: "div",
1201
1446
  attributes: {
1202
1447
  class: "${fieldClass}"
@@ -1223,7 +1468,7 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1223
1468
  }
1224
1469
  }
1225
1470
  ]
1226
- }, Oa = {
1471
+ }, Ua = {
1227
1472
  tagName: "div",
1228
1473
  attributes: {
1229
1474
  class: "${fieldClass}"
@@ -1257,7 +1502,7 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1257
1502
  }
1258
1503
  }
1259
1504
  ]
1260
- }, Ka = {
1505
+ }, Ja = {
1261
1506
  tagName: "div",
1262
1507
  attributes: {
1263
1508
  class: "${fieldClass}"
@@ -1292,7 +1537,7 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1292
1537
  }
1293
1538
  }
1294
1539
  ]
1295
- }, Va = {
1540
+ }, _a = {
1296
1541
  tagName: "div",
1297
1542
  attributes: {
1298
1543
  class: "${fieldClass}"
@@ -1318,7 +1563,7 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1318
1563
  }
1319
1564
  }
1320
1565
  ]
1321
- }, Wa = {
1566
+ }, Xa = {
1322
1567
  tagName: "div",
1323
1568
  attributes: {
1324
1569
  class: "${inlineCheckboxWrapperClass}"
@@ -1343,43 +1588,43 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1343
1588
  }
1344
1589
  }
1345
1590
  ]
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), {
1364
- ...s,
1365
- label: s.label ?? s.title ?? s.columnName,
1366
- type: s.type ?? "text",
1367
- placeholder: s.placeholder ?? "",
1368
- buttonType: s.buttonType ?? "button",
1369
- template: { ...s.template, body: { ...(C = s.template) == null ? void 0 : C.body, cell: i } }
1591
+ }, Qa = {
1592
+ buildBodyTr: Va,
1593
+ buildBodyCell: Ha,
1594
+ buildRequiredField: Ma,
1595
+ buildTextareaField: Wa,
1596
+ buildCheckboxField: qa,
1597
+ buildInlineField: Ga,
1598
+ buildInlineRequiredField: za,
1599
+ buildInlineFieldWithButton: Ua,
1600
+ buildInlineRequiredFieldWithButton: Ja,
1601
+ buildInlineTextareaField: _a,
1602
+ buildInlineCheckboxField: Xa
1603
+ }, Ya = (t, a, e) => {
1604
+ const o = t.map((r) => {
1605
+ var c, u, d, h, w;
1606
+ const i = ((u = (c = r.template) == null ? void 0 : c.body) == null ? void 0 : u.cell) ?? (r.required ? "buildRequiredField" : "buildBodyCell");
1607
+ let l = ((d = e.fieldTemplates) == null ? void 0 : d[i]) ?? i;
1608
+ return r.buttonText && (l = ((h = e.buttonFieldTemplates) == null ? void 0 : h[l]) ?? l), {
1609
+ ...r,
1610
+ label: r.label ?? r.title ?? r.columnName,
1611
+ type: r.type ?? "text",
1612
+ placeholder: r.placeholder ?? "",
1613
+ buttonType: r.buttonType ?? "button",
1614
+ template: { ...r.template, body: { ...(w = r.template) == null ? void 0 : w.body, cell: l } }
1370
1615
  };
1371
- }), n = a[0] ?? {}, r = Object.fromEntries(o.map((s) => [
1372
- s.columnName,
1373
- n[s.columnName] ?? s.value ?? ""
1616
+ }), n = a[0] ?? {}, s = Object.fromEntries(o.map((r) => [
1617
+ r.columnName,
1618
+ n[r.columnName] ?? r.value ?? ""
1374
1619
  ]));
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 = {
1620
+ return { columns: o, rows: [s] };
1621
+ }, Za = (t, a, e) => {
1622
+ const o = Ya(a.columns, a.records, e.body), n = N(o.columns, o.rows, Qa), s = structuredClone(t);
1623
+ return C(s, Ka.destinationRole).children.push(...Array.isArray(n) ? n : [n]), s;
1624
+ }, to = "footer-actions", eo = "button", W = {
1625
+ destinationRole: to,
1626
+ template: eo
1627
+ }, ao = {
1383
1628
  tagName: "button",
1384
1629
  textContent: "${label}",
1385
1630
  attributes: {
@@ -1387,28 +1632,28 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1387
1632
  form: "${formId}",
1388
1633
  class: "${buttonClass} ${buttonSizeClass} ${buttonPaddingClass}"
1389
1634
  }
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 } = {}) => ({
1635
+ }, oo = {
1636
+ button: ao
1637
+ }, no = (t, a) => {
1638
+ const e = structuredClone(t), o = m(a.footer.actions, oo[W.template]);
1639
+ return C(e, W.destinationRole).children.push(...o), e;
1640
+ }, Z = ({ inColumns: t, inData: a, inOptions: e, columns: o, data: n, options: s } = {}) => ({
1396
1641
  columns: Array.isArray(t) && t.length > 0 ? t : Array.isArray(o) ? o : [],
1397
1642
  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 = {
1643
+ options: e && Object.keys(e).length > 0 ? e : s ?? {}
1644
+ }), so = "bigButtonsForm", ro = "Account details", lo = "Update your profile information.", io = "", co = "label", uo = "stacked", bo = "saveCancel", po = {
1645
+ formId: so,
1646
+ title: ro,
1647
+ description: lo,
1648
+ recordId: io,
1649
+ header: co,
1650
+ body: uo,
1651
+ footer: bo
1652
+ }, mo = {
1408
1653
  actions: []
1409
- }, ro = {
1654
+ }, ho = {
1410
1655
  actions: []
1411
- }, so = {
1656
+ }, fo = {
1412
1657
  actions: [
1413
1658
  {
1414
1659
  label: "Refresh",
@@ -1416,14 +1661,14 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1416
1661
  buttonClass: "${headerButtonClass}"
1417
1662
  }
1418
1663
  ]
1419
- }, lo = {
1664
+ }, yo = {
1420
1665
  actions: []
1421
- }, io = {
1422
- none: no,
1423
- label: ro,
1424
- labelWithRefresh: so,
1425
- labelWithId: lo
1426
- }, co = {
1666
+ }, Co = {
1667
+ none: mo,
1668
+ label: ho,
1669
+ labelWithRefresh: fo,
1670
+ labelWithId: yo
1671
+ }, wo = {
1427
1672
  fieldTemplates: {
1428
1673
  buildBodyCell: "buildInlineField",
1429
1674
  buildRequiredField: "buildInlineRequiredField",
@@ -1434,19 +1679,19 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1434
1679
  buildInlineField: "buildInlineFieldWithButton",
1435
1680
  buildInlineRequiredField: "buildInlineRequiredFieldWithButton"
1436
1681
  }
1437
- }, uo = {
1682
+ }, go = {
1438
1683
  fieldTemplates: {},
1439
1684
  buttonFieldTemplates: {}
1440
- }, bo = {
1685
+ }, $o = {
1441
1686
  fieldTemplates: {},
1442
1687
  buttonFieldTemplates: {}
1443
- }, po = {
1444
- inline: co,
1445
- stacked: uo,
1446
- threeColumns: bo
1447
- }, mo = {
1688
+ }, No = {
1689
+ inline: wo,
1690
+ stacked: go,
1691
+ threeColumns: $o
1692
+ }, To = {
1448
1693
  actions: []
1449
- }, fo = {
1694
+ }, xo = {
1450
1695
  actions: [
1451
1696
  {
1452
1697
  label: "Save",
@@ -1459,7 +1704,7 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1459
1704
  buttonClass: "${secondaryButtonClass}"
1460
1705
  }
1461
1706
  ]
1462
- }, ho = {
1707
+ }, Po = {
1463
1708
  actions: [
1464
1709
  {
1465
1710
  label: "Edit",
@@ -1467,31 +1712,31 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1467
1712
  buttonClass: "${infoButtonClass}"
1468
1713
  }
1469
1714
  ]
1470
- }, yo = {
1471
- none: mo,
1472
- saveCancel: fo,
1473
- edit: ho
1715
+ }, Ao = {
1716
+ none: To,
1717
+ saveCancel: xo,
1718
+ edit: Po
1474
1719
  }, B = (t, a, e) => {
1475
1720
  const o = t[a];
1476
1721
  if (!o) throw new RangeError("Unknown bigButtons " + e + ": " + a);
1477
1722
  return o;
1478
- }, et = (t) => {
1723
+ }, tt = (t) => {
1479
1724
  if (typeof t != "object" || t === null || Array.isArray(t))
1480
1725
  throw new TypeError("bigButtons options must be an object keyed by renderer type");
1481
1726
  const a = t["form.bigButtons"] ?? {};
1482
1727
  if (typeof a != "object" || a === null || Array.isArray(a))
1483
1728
  throw new TypeError('options["form.bigButtons"] must be an object');
1484
- const e = { ...oo, ...a };
1729
+ const e = { ...po, ...a };
1485
1730
  return {
1486
1731
  options: e,
1487
- header: B(io, e.header, "header"),
1488
- body: B(po, e.body, "body"),
1489
- footer: B(yo, e.footer, "footer")
1732
+ header: B(Co, e.header, "header"),
1733
+ body: B(No, e.body, "body"),
1734
+ footer: B(Ao, e.footer, "footer")
1490
1735
  };
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 = {
1736
+ }, Io = (t, a = {}) => {
1737
+ const e = Z(a), o = tt(e.options), n = Da(t, o), s = Za(n, e, o);
1738
+ return no(s, o);
1739
+ }, ko = {
1495
1740
  none: {
1496
1741
  headerClass: "d-none",
1497
1742
  headerActionsClass: "d-none"
@@ -1523,14 +1768,14 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1523
1768
  headerActionsClass: "d-none",
1524
1769
  headerButtonClass: "btn btn-outline-secondary text-nowrap"
1525
1770
  }
1526
- }, go = {
1527
- bootstrap: $o
1528
- }, wo = (t, a) => {
1771
+ }, Bo = {
1772
+ bootstrap: ko
1773
+ }, Fo = (t, a) => {
1529
1774
  var o;
1530
- const e = (o = go[a]) == null ? void 0 : o[t.header];
1775
+ const e = (o = Bo[a]) == null ? void 0 : o[t.header];
1531
1776
  if (!e) throw new RangeError("Unknown bigButtons header: " + t.header);
1532
1777
  return e;
1533
- }, No = "bootstrap", xo = {
1778
+ }, So = "bootstrap", jo = {
1534
1779
  bootstrap: {
1535
1780
  base: {
1536
1781
  cardClass: "card border-0 shadow-sm w-100",
@@ -1560,16 +1805,16 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1560
1805
  }
1561
1806
  }
1562
1807
  }
1563
- }, v = {
1564
- defaultFramework: No,
1565
- frameworks: xo
1566
- }, To = (t, a) => {
1567
- const e = v.frameworks[a];
1808
+ }, F = {
1809
+ defaultFramework: So,
1810
+ frameworks: jo
1811
+ }, Ro = (t, a) => {
1812
+ const e = F.frameworks[a];
1568
1813
  if (!e) throw new RangeError("Unknown bigButtons framework: " + a);
1569
1814
  const o = e.bodies[t.body];
1570
1815
  if (!o) throw new RangeError("Unknown bigButtons body: " + t.body);
1571
1816
  return { ...e.base, ...o };
1572
- }, Ao = {
1817
+ }, vo = {
1573
1818
  base: {
1574
1819
  footerClass: "card-footer bg-transparent",
1575
1820
  footerActionsClass: "d-flex flex-wrap justify-content-end gap-2",
@@ -1587,95 +1832,98 @@ const j = ({ inOptions: t = {}, options: a = {} } = {}) => {
1587
1832
  saveCancel: {},
1588
1833
  edit: {}
1589
1834
  }
1590
- }, ko = {
1591
- bootstrap: Ao
1592
- }, Io = (t, a) => {
1593
- const e = ko[a], o = e == null ? void 0 : e.footers[t.footer];
1835
+ }, Eo = {
1836
+ bootstrap: vo
1837
+ }, Oo = (t, a) => {
1838
+ const e = Eo[a], o = e == null ? void 0 : e.footers[t.footer];
1594
1839
  if (!e) throw new RangeError("Unknown bigButtons framework: " + a);
1595
1840
  if (!o) throw new RangeError("Unknown bigButtons footer: " + t.footer);
1596
1841
  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);
1600
- const s = Object.assign(
1842
+ }, Do = (t, a = {}) => {
1843
+ const e = tt(Z(a).options), { options: o } = e, n = o.framework ?? F.defaultFramework;
1844
+ if (!F.frameworks[n]) throw new RangeError("Unknown bigButtons framework: " + n);
1845
+ const r = Object.assign(
1601
1846
  {},
1602
1847
  o,
1603
- To(o, n),
1604
- wo(o, n),
1605
- Io(o, n)
1848
+ Ro(o, n),
1849
+ Fo(o, n),
1850
+ Oo(o, n)
1606
1851
  );
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 = {}) => {
1852
+ return p(r, structuredClone(t));
1853
+ }, Lo = (t = {}) => {
1854
+ const a = ja(), e = Io(a, t);
1855
+ return Do(e, t);
1856
+ }, et = (t = {}) => {
1612
1857
  const a = { ...t, type: t.type ?? "form.bigButtons" };
1613
- return T(a), Po(a);
1858
+ return P(a), Lo(a);
1614
1859
  };
1615
- Ca(at);
1616
- const jo = ({
1860
+ Ia(et);
1861
+ const Ko = ({
1617
1862
  inType: t = "stacked",
1618
1863
  inData: a,
1619
1864
  inColumns: e
1620
- } = {}) => at({
1865
+ } = {}) => et({
1621
1866
  type: t,
1622
1867
  columns: e,
1623
1868
  data: a
1624
- }), Bo = {
1869
+ }), Vo = {
1625
1870
  table: V,
1626
1871
  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;
1872
+ select: ea,
1873
+ selectOptionsOnly: ra,
1874
+ dataList: H,
1875
+ datalist: H,
1876
+ searchInput: k,
1877
+ search: k,
1878
+ inputRow: k,
1879
+ form: Ko
1880
+ }, at = (t = {}) => {
1881
+ P(t);
1882
+ const a = t == null ? void 0 : t.showLog;
1883
+ console.log("localShowLog : ", a);
1884
+ const e = t.type, o = t == null ? void 0 : t.options;
1885
+ let n = e, s = e;
1639
1886
  if (e.includes(".")) {
1640
1887
  const l = e.split(".");
1641
- o = l[0], n = l[1];
1888
+ n = l[0], s = l[1];
1642
1889
  }
1643
- const r = Bo[o];
1890
+ a && console.log("localMainType : ", n, s);
1891
+ const r = Vo[n];
1644
1892
  if (!r)
1645
- throw new Error(`Renderer for type "${o}" not found.`);
1646
- const s = r({
1647
- inType: n,
1893
+ throw new Error(`Renderer for type "${n}" not found.`);
1894
+ const i = r({
1895
+ inType: s,
1648
1896
  inColumns: t.columns,
1649
1897
  inData: t.data,
1650
- inOptions: t.options,
1898
+ inOptions: o,
1651
1899
  options: t.options,
1652
1900
  inShowLog: a
1653
1901
  });
1654
- return a && console.log("json-renderers-build output:", s), s;
1902
+ return a && console.log("json-renderers-build output:", i), i;
1655
1903
  };
1656
- kt(ot);
1657
- const vo = ({
1904
+ Pt(at);
1905
+ const Ho = ({
1658
1906
  inColumns: t,
1659
1907
  inType: a = "table",
1660
1908
  inData: e,
1661
1909
  inShowLog: o = !1
1662
- } = {}) => ot({
1910
+ } = {}) => at({
1663
1911
  type: a,
1664
1912
  data: e ?? [],
1665
1913
  columns: t,
1666
1914
  showLog: o
1667
- }), So = {
1668
- version: "v9",
1915
+ }), Mo = {
1916
+ version: "v10",
1669
1917
  description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
1670
- }, Ro = (t) => {
1918
+ }, Wo = (t) => {
1671
1919
  if (typeof globalThis > "u" || !t) return;
1672
1920
  globalThis.ks ?? (globalThis.ks = {});
1673
1921
  const a = {
1674
- meta: So,
1922
+ meta: Mo,
1675
1923
  buildSpecElement: t
1676
1924
  };
1677
1925
  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([
1926
+ }, 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 ?? "") : nt(t), ot = (t) => Array.isArray(t) ? t.map(qo).flat(1 / 0).filter(Boolean) : [], Go = (t) => (t == null, t), zo = "http://www.w3.org/2000/svg", Uo = /* @__PURE__ */ new Set([
1679
1927
  "svg",
1680
1928
  "path",
1681
1929
  "symbol",
@@ -1702,100 +1950,100 @@ const vo = ({
1702
1950
  "fegaussianblur",
1703
1951
  "femerge",
1704
1952
  "femergenode"
1705
- ]), Ko = ({ inTagName: t }) => {
1953
+ ]), Jo = ({ inTagName: t }) => {
1706
1954
  const a = t == null ? void 0 : t.toLowerCase();
1707
1955
  if (!a) return null;
1708
1956
  if (a === "checkbox") {
1709
1957
  const e = document.createElement("input");
1710
1958
  return e.type = "checkbox", e;
1711
1959
  }
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 }) => {
1960
+ return Uo.has(a) ? document.createElementNS(zo, a) : document.createElement(a);
1961
+ }, _o = ({ inElement: t, inTextContent: a }) => (!t || a === void 0 || a === null || (t.textContent = a), t), Xo = ({ inElement: t, inProperties: a }) => (t && a && typeof a == "object" && Object.assign(t, a), t), Qo = "http://www.w3.org/1999/xlink", Yo = ({ inElement: t, inAttributes: a }) => {
1714
1962
  const e = t, o = a;
1715
1963
  if (!e || !o || typeof o != "object")
1716
1964
  return e;
1717
1965
  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;
1966
+ return Object.entries(o).forEach(([s, r]) => {
1967
+ if (s === "class") {
1968
+ n ? e.setAttribute("class", String(r)) : e.className = r;
1721
1969
  return;
1722
1970
  }
1723
- if (r === "xlink:href" || r === "href") {
1724
- if (s != null) {
1725
- const l = String(s);
1971
+ if (s === "xlink:href" || s === "href") {
1972
+ if (r != null) {
1973
+ const i = String(r);
1726
1974
  if (n)
1727
1975
  try {
1728
- e.setAttributeNS(qo, "href", l);
1976
+ e.setAttributeNS(Qo, "href", i);
1729
1977
  } catch {
1730
1978
  }
1731
- e.setAttribute("href", l), e.setAttribute("xlink:href", l);
1979
+ e.setAttribute("href", i), e.setAttribute("xlink:href", i);
1732
1980
  }
1733
1981
  return;
1734
1982
  }
1735
- if (typeof s == "boolean") {
1736
- s ? e.setAttribute(r, "") : e.removeAttribute(r);
1983
+ if (typeof r == "boolean") {
1984
+ r ? e.setAttribute(s, "") : e.removeAttribute(s);
1737
1985
  return;
1738
1986
  }
1739
- s != null && e.setAttribute(r, String(s));
1987
+ r != null && e.setAttribute(s, String(r));
1740
1988
  }), e;
1741
- }, zo = ({ inElement: t, inClassList: a }) => {
1989
+ }, Zo = ({ inElement: t, inClassList: a }) => {
1742
1990
  if (!t || !a) return t;
1743
1991
  const e = typeof a == "string" ? a.split(/\s+/).filter(Boolean) : Array.isArray(a) ? a.filter((o) => typeof o == "string" && o.trim()) : [];
1744
1992
  return e.length && t.classList.add(...e), t;
1745
- }, Go = (t) => {
1993
+ }, tn = (t) => {
1746
1994
  if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
1747
- const a = Ko({ inTagName: t.tagName });
1995
+ const a = Jo({ inTagName: t.tagName });
1748
1996
  if (!a) return null;
1749
- if (Vo({
1997
+ if (_o({
1750
1998
  inElement: a,
1751
- inTextContent: Lo(t.textContent),
1999
+ inTextContent: Go(t.textContent),
1752
2000
  inTagName: t.tagName
1753
- }), Wo({
2001
+ }), Xo({
1754
2002
  inElement: a,
1755
2003
  inProperties: t.properties
1756
- }), Ho({
2004
+ }), Yo({
1757
2005
  inElement: a,
1758
2006
  inAttributes: t.attributes
1759
- }), zo({
2007
+ }), Zo({
1760
2008
  inElement: a,
1761
2009
  inClassList: t.classList
1762
2010
  }), Array.isArray(t.children)) {
1763
- const e = nt(t.children);
2011
+ const e = ot(t.children);
1764
2012
  e.length && a.append(...e);
1765
2013
  }
1766
2014
  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 = {}) => {
2015
+ }, nt = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? ot(t) : typeof t == "object" ? tn(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, st = (t = {}) => {
1768
2016
  const a = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
1769
- return rt(a);
2017
+ return nt(a);
1770
2018
  };
1771
- Ro(st);
1772
- const Mo = ({
2019
+ Wo(st);
2020
+ const en = ({
1773
2021
  inSpec: t,
1774
2022
  inTargetHtmlId: a,
1775
2023
  inAppendPosition: e,
1776
2024
  inShowLog: o = !1
1777
2025
  } = {}) => {
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({
2026
+ const n = t, s = a, r = e, i = o, l = st(n);
2027
+ i && console.log("renderToDom 1 (content):", l);
2028
+ const c = document.getElementById(s);
2029
+ return c ? (Array.isArray(l) || l instanceof NodeList || l instanceof HTMLCollection ? r === "prepend" ? c.prepend(...l) : c.append(...l) : r === "prepend" ? c.prepend(l) : (c.innerHTML = "", c.append(l)), i && console.log("renderToDom 2 (mounted):", c), c) : null;
2030
+ }, an = (t = {}) => {
2031
+ $(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);
2032
+ const e = Ho({
1785
2033
  inColumns: t.columns,
1786
2034
  inData: t.data,
1787
2035
  inType: t.type,
1788
2036
  inShowLog: t.showLog
1789
2037
  });
1790
- return Mo({
2038
+ return en({
1791
2039
  inSpec: e,
1792
2040
  inTargetHtmlId: t.targetHtmlId,
1793
2041
  inAppendPosition: t.appendPosition,
1794
2042
  inShowLog: t.showLog
1795
2043
  });
1796
2044
  };
1797
- ut(Uo);
2045
+ ct(an);
1798
2046
  export {
1799
- Uo as default,
1800
- Uo as render
2047
+ an as default,
2048
+ an as render
1801
2049
  };