json-renderers 1.18.5 → 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,60 +1,60 @@
1
- const Q = {
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
- }, 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
+ }, ct = (t) => {
5
+ const a = t;
6
+ typeof globalThis > "u" || !a || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderers = {
7
+ meta: it,
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
+ }, ut = (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
+ }, dt = (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
+ }, bt = (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
+ }, pt = (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
+ }, P = (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 ut(a), dt(a), bt(a), pt(a), !0;
53
+ }, mt = (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
+ }, ft = (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
+ }, q = (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 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
+ showLog: Tt
98
+ }, G = (t) => {
99
+ const a = typeof t == "object" && t !== null ? t.inKey ?? t.key : t;
100
+ return a && a in g ? g[a] : { ...g };
101
101
  };
102
- Object.assign(P, w);
102
+ Object.assign(G, g);
103
103
  const $ = (t) => {
104
- const o = (t == null ? void 0 : t.inConfig) ?? t;
105
- if (!o || typeof o != "object" || Array.isArray(o))
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 P(a), q(a), !0;
108
108
  };
109
- $.getSpec = P;
110
- $.configSpec = w;
111
- $.guardSpec = x;
112
- $.guardMount = L;
113
- const pt = {
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
- }, mt = (t) => {
116
+ }, Pt = (t) => {
117
117
  t && (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuild = {
118
- meta: pt,
118
+ meta: xt,
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
+ }, At = (t) => typeof t == "object" && t !== null && !Array.isArray(t), It = (t, a) => {
122
+ if (!At(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] = p(a, n);
126
126
  return e;
127
- }, yt = (t, o) => {
127
+ }, kt = (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) => p(a, n)) : void 0;
130
+ }, z = (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
+ }, Bt = (t, a) => z(t, a), Ft = (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
+ }, St = {
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
+ }, jt = (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: St,
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
+ }, p = (t, a, e) => {
154
+ const o = t, n = a;
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
- gt(m);
160
- const Nt = (t, o) => {
159
+ jt(p);
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,17 +165,17 @@ 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
+ }, m = (t, a) => {
172
+ const e = t, o = a;
173
+ return Rt(e, o), e.map((n) => p(n, o));
174
+ }, vt = (t, a) => t.map((o) => ({
175
+ ...o,
176
+ rowData: a[o.columnName]
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)
@@ -187,65 +187,54 @@ const Nt = (t, o) => {
187
187
  if (typeof d.columnName != "string" || !d.columnName.trim())
188
188
  throw new TypeError(`inColumns[${u}].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 u = 0; u < a.length; u++) {
193
+ const d = a[u];
194
194
  if (!d || typeof d != "object")
195
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 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`);
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
+ if (!(o in e))
201
+ throw new Error(`Row template "${o}" not found in inSpec`);
202
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`);
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
- }, At = (t, o) => t.map((r) => {
208
+ }, Ot = (t, a) => t.map((o) => {
209
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) => {
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
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;
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
- }, 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
+ }, Dt = {
232
221
  tagName: "tr",
233
222
  attributes: {
234
223
  class: "align-middle"
235
224
  },
236
225
  children: []
237
- }, jt = {
226
+ }, Lt = {
238
227
  tagName: "col",
239
228
  attributes: {
240
229
  width: "${width}"
241
230
  }
242
- }, Ft = {
231
+ }, Kt = {
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
+ }, Vt = {
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
+ }, Ht = {
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
+ }, Mt = {
268
259
  tagName: "button",
269
260
  textContent: "${columnName}",
270
261
  attributes: {
271
262
  class: "btn btn-primary btn-sm"
272
263
  }
273
- }, Et = {
264
+ }, Wt = {
274
265
  tagName: "td",
275
266
  attributes: {
276
267
  class: "py-2 px-3 text-center"
@@ -284,38 +275,57 @@ const Nt = (t, o) => {
284
275
  }
285
276
  }
286
277
  ]
287
- }, Rt = {
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
+ ]
292
+ }, Gt = {
288
293
  tagName: "option",
289
294
  textContent: "${rowValue}",
290
295
  attributes: {
291
296
  value: "${rowValue}"
292
297
  }
293
- }, Lt = {
298
+ }, zt = {
294
299
  tagName: "select",
295
300
  attributes: {
296
301
  id: "LedgerName"
297
302
  },
298
303
  children: []
299
- }, Pt = {
304
+ }, Ut = {
300
305
  tagName: "datalist",
301
306
  attributes: {
302
307
  "data-name": "${columnName}"
303
308
  },
304
309
  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 = {
310
+ }, Jt = {
311
+ tagName: "td",
312
+ children: []
313
+ }, b = {
314
+ buildBodyTr: Dt,
315
+ buildColGroup: Lt,
316
+ buildHeader: Kt,
317
+ buildFooter: Vt,
318
+ buildBodyCell: Ht,
319
+ button: Mt,
320
+ buttonCell: Wt,
321
+ optionsButtonCell: qt,
322
+ buildOption: Gt,
323
+ buildSelect: zt,
324
+ buildDataList: Ut,
325
+ emptyCell: Jt
326
+ }, _t = "table", Xt = {
317
327
  class: "table table-hover table-striped align-middle border mb-0"
318
- }, Vt = [
328
+ }, Qt = [
319
329
  {
320
330
  tagName: "colgroup",
321
331
  attributes: {
@@ -361,11 +371,11 @@ const Nt = (t, o) => {
361
371
  }
362
372
  ]
363
373
  }
364
- ], V = {
365
- tagName: Dt,
366
- attributes: Ot,
367
- children: Vt
368
- }, Wt = [
374
+ ], Yt = {
375
+ tagName: _t,
376
+ attributes: Xt,
377
+ children: Qt
378
+ }, Zt = [
369
379
  {
370
380
  narration: "Build the column widths for the table using the configured columns.",
371
381
  destinationPath: {
@@ -402,7 +412,7 @@ const Nt = (t, o) => {
402
412
  templateKey: "buildHeader",
403
413
  func: "fromCollection"
404
414
  }
405
- ], qt = [
415
+ ], te = [
406
416
  {
407
417
  narration: "Build the table body rows for the table using the configured columns and data.",
408
418
  destinationPath: {
@@ -420,154 +430,687 @@ const Nt = (t, o) => {
420
430
  },
421
431
  func: "twoDimensional"
422
432
  }
423
- ], g = (t) => Array.isArray(t) ? t : [t], B = {
424
- set: (t, o, e) => {
425
- t[o] = e;
433
+ ], C = (t, a) => {
434
+ var e;
435
+ if (((e = t == null ? void 0 : t.attributes) == null ? void 0 : e["data-role"]) === a) return t;
436
+ for (const o of (t == null ? void 0 : t.children) ?? []) {
437
+ const n = C(o, a);
438
+ if (n) return n;
439
+ }
440
+ return null;
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) => {
445
+ t[a] = e;
446
+ }, ae = (t, a, e) => {
447
+ t[a].push(...A(e));
448
+ }, oe = (t, a, e) => {
449
+ t[a].unshift(...A(e));
450
+ }, ne = (t, a, e) => {
451
+ t[a].forEach((o) => {
452
+ o.children.push(...structuredClone(A(e)));
453
+ });
454
+ }, se = (t, a, e) => {
455
+ t[a].forEach((o) => {
456
+ o.children.unshift(...structuredClone(A(e)));
457
+ });
458
+ }, re = (t, a, e) => {
459
+ t[a].forEach((o, n) => {
460
+ const s = structuredClone(e);
461
+ s.textContent = n + 1, o.children.unshift(s);
462
+ });
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"}`;
479
+ return e.push(n), a && console.log(n), o;
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"}`;
483
+ return e.push(n), a && console.log(n), o;
484
+ }, de = (t, a, e) => {
485
+ const o = t.templateKey === void 0 || typeof t.templateKey == "string" && t.templateKey.length > 0, n = `structure/templateKey: ${o ? "passed" : "failed"}`;
486
+ return e.push(n), a && console.log(n), o;
487
+ }, be = (t, a, e) => {
488
+ const o = typeof t.func == "string" && t.func.length > 0, n = `structure/func: ${o ? "passed" : "failed"}`;
489
+ return e.push(n), a && console.log(n), o;
490
+ }, pe = (t, a, e) => [
491
+ ce(t, a, e),
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);
513
+ });
514
+ }, Ce = (t, a, e, o, n, s) => {
515
+ if (!_(t, e, o, n, s)) return;
516
+ const r = e[t.func](
517
+ a.data.columns,
518
+ a.data.data,
519
+ o
520
+ );
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);
525
+ });
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"
426
647
  },
427
- push: (t, o, e) => {
428
- t[o].push(...g(e));
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"
429
667
  },
430
- unshift: (t, o, e) => {
431
- t[o].unshift(...g(e));
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 = {
742
+ class: "table table-hover table-striped align-middle border mb-0"
743
+ }, ke = [
744
+ {
745
+ tagName: "colgroup",
746
+ attributes: {
747
+ "data-role": "table-colgroup"
748
+ },
749
+ children: []
432
750
  },
433
- pushToRows: (t, o, e) => {
434
- t[o].forEach((r) => {
435
- r.children.push(...structuredClone(g(e)));
436
- });
751
+ {
752
+ tagName: "thead",
753
+ attributes: {
754
+ class: "table-dark",
755
+ "data-role": "table-header"
756
+ },
757
+ children: [
758
+ {
759
+ tagName: "tr",
760
+ attributes: {
761
+ "data-role": "table-header-row"
762
+ },
763
+ children: []
764
+ }
765
+ ]
437
766
  },
438
- unshiftToRows: (t, o, e) => {
439
- t[o].forEach((r) => {
440
- r.children.unshift(...structuredClone(g(e)));
441
- });
767
+ {
768
+ tagName: "tbody",
769
+ attributes: {
770
+ "data-role": "table-body"
771
+ },
772
+ children: []
442
773
  },
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
- });
774
+ {
775
+ tagName: "tfoot",
776
+ attributes: {
777
+ "data-role": "table-footer"
778
+ },
779
+ children: [
780
+ {
781
+ tagName: "tr",
782
+ attributes: {
783
+ "data-role": "table-footer-row"
784
+ },
785
+ children: []
786
+ }
787
+ ]
448
788
  }
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 = ({
789
+ ], Q = {
790
+ tagName: Ae,
791
+ attributes: Ie,
792
+ children: ke
793
+ }, Be = [
794
+ {
795
+ narration: "Build the column widths for the table using the configured columns.",
796
+ destinationPath: {
797
+ fileName: "base",
798
+ dataRole: "table-colgroup",
799
+ filePath: [
800
+ "children"
801
+ ]
802
+ },
803
+ sourcePath: {
804
+ fileName: "data",
805
+ filePath: [
806
+ "columns"
807
+ ]
808
+ },
809
+ templateKey: "buildColGroup",
810
+ func: "fromCollection"
811
+ },
812
+ {
813
+ narration: "Build the header row for the table using the configured columns.",
814
+ destinationPath: {
815
+ fileName: "base",
816
+ dataRole: "table-header-row",
817
+ filePath: [
818
+ "children"
819
+ ]
820
+ },
821
+ sourcePath: {
822
+ fileName: "data",
823
+ filePath: [
824
+ "columns"
825
+ ]
826
+ },
827
+ templateKey: "buildHeader",
828
+ func: "fromCollection"
829
+ }
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 = [
833
+ {
834
+ narration: "Build the table body rows for the table using the configured columns and data.",
835
+ destinationPath: {
836
+ fileName: "base",
837
+ filePath: [
838
+ "children"
839
+ ]
840
+ },
841
+ sourcePath: {
842
+ fileName: "data",
843
+ filePath: [
844
+ "columns"
845
+ ]
846
+ },
847
+ func: "twoDimensional"
848
+ }
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 = {
850
+ class: "table table-hover table-striped align-middle border mb-0"
851
+ }, Le = [
852
+ {
853
+ tagName: "colgroup",
854
+ attributes: {
855
+ "data-role": "table-colgroup"
856
+ },
857
+ children: []
858
+ },
859
+ {
860
+ tagName: "thead",
861
+ attributes: {
862
+ class: "table-dark",
863
+ "data-role": "table-header"
864
+ },
865
+ children: [
866
+ {
867
+ tagName: "tr",
868
+ attributes: {
869
+ "data-role": "table-header-row"
870
+ },
871
+ children: []
872
+ }
873
+ ]
874
+ },
875
+ {
876
+ tagName: "tbody",
877
+ attributes: {
878
+ "data-role": "table-body"
879
+ },
880
+ children: []
881
+ },
882
+ {
883
+ tagName: "tfoot",
884
+ attributes: {
885
+ "data-role": "table-footer"
886
+ },
887
+ children: [
888
+ {
889
+ tagName: "tr",
890
+ attributes: {
891
+ "data-role": "table-footer-row"
892
+ },
893
+ children: []
894
+ }
895
+ ]
896
+ }
897
+ ], Ke = {
898
+ tagName: Oe,
899
+ attributes: De,
900
+ children: Le
901
+ }, Ve = [
902
+ {
903
+ narration: "Build the column widths for the table using the configured columns.",
904
+ destinationPath: {
905
+ fileName: "base",
906
+ dataRole: "table-colgroup",
907
+ filePath: [
908
+ "children"
909
+ ]
910
+ },
911
+ sourcePath: {
912
+ fileName: "data",
913
+ filePath: [
914
+ "columns"
915
+ ]
916
+ },
917
+ templateKey: "buildColGroup",
918
+ func: "fromCollection"
919
+ },
920
+ {
921
+ narration: "Build the header row for the table using the configured columns.",
922
+ destinationPath: {
923
+ fileName: "base",
924
+ dataRole: "table-header-row",
925
+ filePath: [
926
+ "children"
927
+ ]
928
+ },
929
+ sourcePath: {
930
+ fileName: "data",
931
+ filePath: [
932
+ "columns"
933
+ ]
934
+ },
935
+ templateKey: "buildHeader",
936
+ func: "fromCollection"
937
+ },
938
+ {
939
+ narration: "Build the footer row for the table using the configured columns.",
940
+ destinationPath: {
941
+ fileName: "base",
942
+ dataRole: "table-footer-row",
943
+ filePath: [
944
+ "children"
945
+ ]
946
+ },
947
+ sourcePath: {
948
+ fileName: "data",
949
+ filePath: [
950
+ "columns"
951
+ ]
952
+ },
953
+ templateKey: "buildFooter",
954
+ func: "fromCollection"
955
+ }
956
+ ], He = [
957
+ {
958
+ narration: "Build the table body rows for the table using the configured columns and data.",
959
+ destinationPath: {
960
+ fileName: "base",
961
+ dataRole: "table-body",
962
+ filePath: [
963
+ "children"
964
+ ]
965
+ },
966
+ sourcePath: {
967
+ fileName: "data",
968
+ filePath: [
969
+ "columns"
970
+ ]
971
+ },
972
+ func: "twoDimensional"
973
+ }
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 = [
987
+ {
988
+ narration: "Build the footer row for the table using the configured columns.",
989
+ destinationPath: {
990
+ fileName: "base",
991
+ filePath: [
992
+ "children"
993
+ ]
994
+ },
995
+ sourcePath: {
996
+ fileName: "data",
997
+ filePath: [
998
+ "columns"
999
+ ]
1000
+ },
1001
+ templateKey: "buildFooter",
1002
+ func: "fromCollection"
1003
+ }
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
1010
+ }, V = ({
474
1011
  inData: t,
475
- inColumns: o,
1012
+ inColumns: a,
476
1013
  inType: e,
477
- footer: r = [],
478
- options: a
479
- } = {}) => Mt({
480
- columns: o,
481
- data: t
482
- }), Gt = ({ inData: t = [], inColumns: o = [] } = {}) => ({
1014
+ footer: o = [],
1015
+ inOptions: n,
1016
+ inShowLog: s
1017
+ } = {}) => {
1018
+ const r = e, i = Ue[r], l = n, c = s;
1019
+ return c && console.log("table : ", r, l), i({
1020
+ columns: a,
1021
+ data: t,
1022
+ options: l,
1023
+ showLog: c
1024
+ });
1025
+ }, Je = ({ inData: t = [], inColumns: a = [] } = {}) => ({
483
1026
  data: t,
484
- columns: o
485
- }), Kt = {
1027
+ columns: a
1028
+ }), _e = {
486
1029
  tagName: "option",
487
1030
  textContent: "${rowValue}",
488
1031
  attributes: {
489
1032
  value: "${rowValue}"
490
1033
  }
491
- }, Ut = {
1034
+ }, Xe = {
492
1035
  tagName: "select",
493
1036
  attributes: {
494
1037
  id: "LedgerName"
495
1038
  },
496
1039
  children: []
497
- }, Jt = {
1040
+ }, Qe = {
498
1041
  tagName: "datalist",
499
1042
  attributes: {
500
1043
  "data-name": "${columnName}"
501
1044
  },
502
1045
  children: []
503
- }, p = {
504
- buildOption: Kt,
505
- buildSelect: Ut,
506
- buildDataList: Jt
507
- }, _t = (t, o = p.buildOption) => {
508
- const e = structuredClone(o);
1046
+ }, y = {
1047
+ buildOption: _e,
1048
+ buildSelect: Xe,
1049
+ buildDataList: Qe
1050
+ }, Ye = (t, a = y.buildOption) => {
1051
+ const e = structuredClone(a);
509
1052
  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 = [] } = {}) => ({
1053
+ }, Ze = (t, a) => {
1054
+ const e = a == null ? void 0 : a.columnName, o = structuredClone(y.buildSelect);
1055
+ o.attributes.id = e, o.attributes["data-name"] = e;
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 = [] } = {}) => ({
519
1062
  data: t,
520
- columns: o
521
- }), te = (t, o = p.buildOption) => {
522
- const e = structuredClone(o);
1063
+ columns: a
1064
+ }), oa = (t, a = y.buildOption) => {
1065
+ const e = structuredClone(a);
523
1066
  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 = [] } = {}) => ({
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 = [] } = {}) => ({
531
1074
  data: t,
532
- columns: o
533
- }), ae = (t, o = p.buildOption) => {
534
- const e = structuredClone(o);
1075
+ columns: a
1076
+ }), ia = (t, a = y.buildOption) => {
1077
+ const e = structuredClone(a);
535
1078
  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 = {
1079
+ }, ca = (t, a) => {
1080
+ const e = a == null ? void 0 : a.columnName, o = structuredClone(y.buildDataList);
1081
+ o.attributes.id = e, o.attributes["data-name"] = e;
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 = {
545
1088
  version: "1.2.0",
546
1089
  name: "json-renderers-build-input-row"
547
- }, ce = (t) => {
548
- const o = t;
549
- if (typeof globalThis > "u" || !o) return;
1090
+ }, ba = (t) => {
1091
+ const a = t;
1092
+ if (typeof globalThis > "u" || !a) return;
550
1093
  globalThis.ks ?? (globalThis.ks = {});
551
- const e = typeof o == "function" ? o : o.render;
1094
+ const e = typeof a == "function" ? a : a.render;
552
1095
  globalThis.ks.jsonRenderersBuildInputRow = {
553
- meta: ie,
1096
+ meta: da,
554
1097
  render: e,
555
- ...typeof o == "object" ? o : {}
1098
+ ...typeof a == "object" ? a : {}
556
1099
  };
557
- }, ue = "input", de = {
1100
+ }, pa = "input", ma = {
558
1101
  type: "search",
559
1102
  placeholder: "Search...",
560
1103
  class: "form-control",
561
1104
  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 = {
1105
+ }, ha = {
1106
+ tagName: pa,
1107
+ attributes: ma
1108
+ }, x = ({ inOptions: t = {}, options: a = {} } = {}) => {
1109
+ const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(ha);
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;
1111
+ }, fa = "div", ya = {
569
1112
  class: "d-flex align-items-center gap-2"
570
- }, fe = [
1113
+ }, Ca = [
571
1114
  {
572
1115
  tagName: "label",
573
1116
  textContent: "Search:",
@@ -585,16 +1128,16 @@ const Nt = (t, o) => {
585
1128
  id: "searchInputId"
586
1129
  }
587
1130
  }
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 = {
1131
+ ], wa = {
1132
+ tagName: fa,
1133
+ attributes: ya,
1134
+ children: Ca
1135
+ }, I = ({ inOptions: t = {}, options: a = {} } = {}) => {
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 = {
596
1139
  class: "d-flex align-items-center gap-2"
597
- }, we = [
1140
+ }, Na = [
598
1141
  {
599
1142
  tagName: "label",
600
1143
  textContent: "Search:",
@@ -621,45 +1164,45 @@ const Nt = (t, o) => {
621
1164
  id: "searchButtonId"
622
1165
  }
623
1166
  }
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 = ({
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 = {
1175
+ input: x,
1176
+ inputOnly: x,
1177
+ inputWithLabel: I,
1178
+ inputWithLabelButton: j
1179
+ }, Pa = ({
637
1180
  type: t = "inputWithLabel",
638
- options: o = {},
1181
+ options: a = {},
639
1182
  inType: e,
640
- inOptions: r
1183
+ inOptions: o
641
1184
  } = {}) => {
642
- const a = e ?? t, n = r ?? o;
643
- return (ge[a] || T)({ inOptions: n, options: n });
1185
+ const n = e ?? t, s = o ?? a;
1186
+ return (xa[n] || I)({ inOptions: s, options: s });
644
1187
  };
645
- ce({
646
- render: Ne,
647
- inputOnly: N,
648
- inputWithLabel: T,
649
- inputWithLabelButton: F
1188
+ ba({
1189
+ render: Pa,
1190
+ inputOnly: x,
1191
+ inputWithLabel: I,
1192
+ inputWithLabelButton: j
650
1193
  });
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 = {
1194
+ const k = ({ inOptions: t = {}, options: a = {} } = {}) => {
1195
+ const e = t && Object.keys(t).length > 0 ? t : a;
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 = {
655
1198
  version: "1.2.0",
656
1199
  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 = {
1200
+ }, Ia = (t) => {
1201
+ typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuildForm = { meta: Aa, render: t });
1202
+ }, ka = "div", Ba = {
660
1203
  class: "${cardClass}",
661
1204
  "data-role": "form-card"
662
- }, ke = [
1205
+ }, Fa = [
663
1206
  {
664
1207
  tagName: "header",
665
1208
  attributes: {
@@ -740,14 +1283,14 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
740
1283
  }
741
1284
  ]
742
1285
  }
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 = {
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 = {
751
1294
  tagName: "button",
752
1295
  textContent: "${label}",
753
1296
  attributes: {
@@ -755,20 +1298,20 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
755
1298
  form: "${formId}",
756
1299
  class: "${buttonClass} ${buttonSizeClass} ${buttonPaddingClass}"
757
1300
  }
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 = {
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 = {
766
1309
  tagName: "div",
767
1310
  attributes: {
768
1311
  class: "${rowClass}"
769
1312
  },
770
1313
  children: []
771
- }, Oe = {
1314
+ }, Ha = {
772
1315
  tagName: "div",
773
1316
  attributes: {
774
1317
  class: "${fieldClass}"
@@ -794,7 +1337,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
794
1337
  }
795
1338
  }
796
1339
  ]
797
- }, Ve = {
1340
+ }, Ma = {
798
1341
  tagName: "div",
799
1342
  attributes: {
800
1343
  class: "${fieldClass}"
@@ -821,7 +1364,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
821
1364
  }
822
1365
  }
823
1366
  ]
824
- }, We = {
1367
+ }, Wa = {
825
1368
  tagName: "div",
826
1369
  attributes: {
827
1370
  class: "${fieldClass}"
@@ -847,7 +1390,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
847
1390
  }
848
1391
  }
849
1392
  ]
850
- }, qe = {
1393
+ }, qa = {
851
1394
  tagName: "div",
852
1395
  attributes: {
853
1396
  class: "${checkboxWrapperClass} ${fieldClass}"
@@ -872,7 +1415,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
872
1415
  }
873
1416
  }
874
1417
  ]
875
- }, He = {
1418
+ }, Ga = {
876
1419
  tagName: "div",
877
1420
  attributes: {
878
1421
  class: "${fieldClass}"
@@ -898,7 +1441,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
898
1441
  }
899
1442
  }
900
1443
  ]
901
- }, ze = {
1444
+ }, za = {
902
1445
  tagName: "div",
903
1446
  attributes: {
904
1447
  class: "${fieldClass}"
@@ -925,7 +1468,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
925
1468
  }
926
1469
  }
927
1470
  ]
928
- }, Me = {
1471
+ }, Ua = {
929
1472
  tagName: "div",
930
1473
  attributes: {
931
1474
  class: "${fieldClass}"
@@ -959,7 +1502,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
959
1502
  }
960
1503
  }
961
1504
  ]
962
- }, Ge = {
1505
+ }, Ja = {
963
1506
  tagName: "div",
964
1507
  attributes: {
965
1508
  class: "${fieldClass}"
@@ -994,7 +1537,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
994
1537
  }
995
1538
  }
996
1539
  ]
997
- }, Ke = {
1540
+ }, _a = {
998
1541
  tagName: "div",
999
1542
  attributes: {
1000
1543
  class: "${fieldClass}"
@@ -1020,7 +1563,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1020
1563
  }
1021
1564
  }
1022
1565
  ]
1023
- }, Ue = {
1566
+ }, Xa = {
1024
1567
  tagName: "div",
1025
1568
  attributes: {
1026
1569
  class: "${inlineCheckboxWrapperClass}"
@@ -1045,43 +1588,43 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1045
1588
  }
1046
1589
  }
1047
1590
  ]
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");
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");
1064
1607
  let l = ((d = e.fieldTemplates) == null ? void 0 : d[i]) ?? i;
1065
- return s.buttonText && (l = ((b = e.buttonFieldTemplates) == null ? void 0 : b[l]) ?? l), {
1066
- ...s,
1067
- label: s.label ?? s.title ?? s.columnName,
1068
- type: s.type ?? "text",
1069
- placeholder: s.placeholder ?? "",
1070
- buttonType: s.buttonType ?? "button",
1071
- template: { ...s.template, body: { ...(C = s.template) == null ? void 0 : C.body, cell: l } }
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 } }
1072
1615
  };
1073
- }), a = o[0] ?? {}, n = Object.fromEntries(r.map((s) => [
1074
- s.columnName,
1075
- a[s.columnName] ?? s.value ?? ""
1616
+ }), n = a[0] ?? {}, s = Object.fromEntries(o.map((r) => [
1617
+ r.columnName,
1618
+ n[r.columnName] ?? r.value ?? ""
1076
1619
  ]));
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 = {
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 = {
1085
1628
  tagName: "button",
1086
1629
  textContent: "${label}",
1087
1630
  attributes: {
@@ -1089,28 +1632,28 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1089
1632
  form: "${formId}",
1090
1633
  class: "${buttonClass} ${buttonSizeClass} ${buttonPaddingClass}"
1091
1634
  }
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,
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 } = {}) => ({
1641
+ columns: Array.isArray(t) && t.length > 0 ? t : Array.isArray(o) ? o : [],
1642
+ records: Array.isArray(a) && a.length > 0 ? a : Array.isArray(n) ? n : [],
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,
1103
1646
  title: ro,
1104
- description: no,
1105
- recordId: ao,
1106
- header: so,
1107
- body: lo,
1108
- footer: io
1109
- }, uo = {
1647
+ description: lo,
1648
+ recordId: io,
1649
+ header: co,
1650
+ body: uo,
1651
+ footer: bo
1652
+ }, mo = {
1110
1653
  actions: []
1111
- }, bo = {
1654
+ }, ho = {
1112
1655
  actions: []
1113
- }, po = {
1656
+ }, fo = {
1114
1657
  actions: [
1115
1658
  {
1116
1659
  label: "Refresh",
@@ -1118,14 +1661,14 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1118
1661
  buttonClass: "${headerButtonClass}"
1119
1662
  }
1120
1663
  ]
1121
- }, mo = {
1664
+ }, yo = {
1122
1665
  actions: []
1123
- }, fo = {
1124
- none: uo,
1125
- label: bo,
1126
- labelWithRefresh: po,
1127
- labelWithId: mo
1128
- }, ho = {
1666
+ }, Co = {
1667
+ none: mo,
1668
+ label: ho,
1669
+ labelWithRefresh: fo,
1670
+ labelWithId: yo
1671
+ }, wo = {
1129
1672
  fieldTemplates: {
1130
1673
  buildBodyCell: "buildInlineField",
1131
1674
  buildRequiredField: "buildInlineRequiredField",
@@ -1136,19 +1679,19 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1136
1679
  buildInlineField: "buildInlineFieldWithButton",
1137
1680
  buildInlineRequiredField: "buildInlineRequiredFieldWithButton"
1138
1681
  }
1139
- }, yo = {
1682
+ }, go = {
1140
1683
  fieldTemplates: {},
1141
1684
  buttonFieldTemplates: {}
1142
- }, Co = {
1685
+ }, $o = {
1143
1686
  fieldTemplates: {},
1144
1687
  buttonFieldTemplates: {}
1145
- }, wo = {
1146
- inline: ho,
1147
- stacked: yo,
1148
- threeColumns: Co
1149
- }, $o = {
1688
+ }, No = {
1689
+ inline: wo,
1690
+ stacked: go,
1691
+ threeColumns: $o
1692
+ }, To = {
1150
1693
  actions: []
1151
- }, go = {
1694
+ }, xo = {
1152
1695
  actions: [
1153
1696
  {
1154
1697
  label: "Save",
@@ -1161,7 +1704,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1161
1704
  buttonClass: "${secondaryButtonClass}"
1162
1705
  }
1163
1706
  ]
1164
- }, No = {
1707
+ }, Po = {
1165
1708
  actions: [
1166
1709
  {
1167
1710
  label: "Edit",
@@ -1169,31 +1712,31 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1169
1712
  buttonClass: "${infoButtonClass}"
1170
1713
  }
1171
1714
  ]
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) => {
1715
+ }, Ao = {
1716
+ none: To,
1717
+ saveCancel: xo,
1718
+ edit: Po
1719
+ }, B = (t, a, e) => {
1720
+ const o = t[a];
1721
+ if (!o) throw new RangeError("Unknown bigButtons " + e + ": " + a);
1722
+ return o;
1723
+ }, tt = (t) => {
1181
1724
  if (typeof t != "object" || t === null || Array.isArray(t))
1182
1725
  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))
1726
+ const a = t["form.bigButtons"] ?? {};
1727
+ if (typeof a != "object" || a === null || Array.isArray(a))
1185
1728
  throw new TypeError('options["form.bigButtons"] must be an object');
1186
- const e = { ...co, ...o };
1729
+ const e = { ...po, ...a };
1187
1730
  return {
1188
1731
  options: e,
1189
- header: I(fo, e.header, "header"),
1190
- body: I(wo, e.body, "body"),
1191
- footer: I(xo, e.footer, "footer")
1732
+ header: B(Co, e.header, "header"),
1733
+ body: B(No, e.body, "body"),
1734
+ footer: B(Ao, e.footer, "footer")
1192
1735
  };
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 = {
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 = {
1197
1740
  none: {
1198
1741
  headerClass: "d-none",
1199
1742
  headerActionsClass: "d-none"
@@ -1225,14 +1768,14 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1225
1768
  headerActionsClass: "d-none",
1226
1769
  headerButtonClass: "btn btn-outline-secondary text-nowrap"
1227
1770
  }
1228
- }, Io = {
1229
- bootstrap: Ao
1230
- }, ko = (t, o) => {
1231
- var r;
1232
- const e = (r = Io[o]) == null ? void 0 : r[t.header];
1771
+ }, Bo = {
1772
+ bootstrap: ko
1773
+ }, Fo = (t, a) => {
1774
+ var o;
1775
+ const e = (o = Bo[a]) == null ? void 0 : o[t.header];
1233
1776
  if (!e) throw new RangeError("Unknown bigButtons header: " + t.header);
1234
1777
  return e;
1235
- }, jo = "bootstrap", Fo = {
1778
+ }, So = "bootstrap", jo = {
1236
1779
  bootstrap: {
1237
1780
  base: {
1238
1781
  cardClass: "card border-0 shadow-sm w-100",
@@ -1262,15 +1805,15 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1262
1805
  }
1263
1806
  }
1264
1807
  }
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 };
1808
+ }, F = {
1809
+ defaultFramework: So,
1810
+ frameworks: jo
1811
+ }, Ro = (t, a) => {
1812
+ const e = F.frameworks[a];
1813
+ if (!e) throw new RangeError("Unknown bigButtons framework: " + a);
1814
+ const o = e.bodies[t.body];
1815
+ if (!o) throw new RangeError("Unknown bigButtons body: " + t.body);
1816
+ return { ...e.base, ...o };
1274
1817
  }, vo = {
1275
1818
  base: {
1276
1819
  footerClass: "card-footer bg-transparent",
@@ -1289,94 +1832,98 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
1289
1832
  saveCancel: {},
1290
1833
  edit: {}
1291
1834
  }
1292
- }, So = {
1835
+ }, Eo = {
1293
1836
  bootstrap: vo
1294
- }, Eo = (t, o) => {
1295
- const e = So[o], r = e == null ? void 0 : e.footers[t.footer];
1296
- if (!e) throw new RangeError("Unknown bigButtons framework: " + o);
1297
- if (!r) throw new RangeError("Unknown bigButtons footer: " + t.footer);
1298
- return { ...e.base, ...r };
1299
- }, Ro = (t, o = {}) => {
1300
- const e = z(H(o).options), { options: r } = e, a = r.framework ?? k.defaultFramework;
1301
- if (!k.frameworks[a]) throw new RangeError("Unknown bigButtons framework: " + a);
1302
- const s = Object.assign(
1837
+ }, Oo = (t, a) => {
1838
+ const e = Eo[a], o = e == null ? void 0 : e.footers[t.footer];
1839
+ if (!e) throw new RangeError("Unknown bigButtons framework: " + a);
1840
+ if (!o) throw new RangeError("Unknown bigButtons footer: " + t.footer);
1841
+ return { ...e.base, ...o };
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(
1303
1846
  {},
1304
- r,
1305
- Bo(r, a),
1306
- ko(r, a),
1307
- Eo(r, a)
1847
+ o,
1848
+ Ro(o, n),
1849
+ Fo(o, n),
1850
+ Oo(o, n)
1308
1851
  );
1309
- return m(s, structuredClone(t));
1852
+ return p(r, structuredClone(t));
1310
1853
  }, 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);
1854
+ const a = ja(), e = Io(a, t);
1855
+ return Do(e, t);
1856
+ }, et = (t = {}) => {
1857
+ const a = { ...t, type: t.type ?? "form.bigButtons" };
1858
+ return P(a), Lo(a);
1316
1859
  };
1317
- Te(M);
1318
- const Po = ({
1860
+ Ia(et);
1861
+ const Ko = ({
1319
1862
  inType: t = "stacked",
1320
- inData: o,
1863
+ inData: a,
1321
1864
  inColumns: e
1322
- } = {}) => M({
1865
+ } = {}) => et({
1323
1866
  type: t,
1324
1867
  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;
1868
+ data: a
1869
+ }), Vo = {
1870
+ table: V,
1871
+ tableFromSpec: V,
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;
1341
1886
  if (e.includes(".")) {
1342
- const i = e.split(".");
1343
- r = i[0], a = i[1];
1887
+ const l = e.split(".");
1888
+ n = l[0], s = l[1];
1344
1889
  }
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,
1890
+ a && console.log("localMainType : ", n, s);
1891
+ const r = Vo[n];
1892
+ if (!r)
1893
+ throw new Error(`Renderer for type "${n}" not found.`);
1894
+ const i = r({
1895
+ inType: s,
1350
1896
  inColumns: t.columns,
1351
1897
  inData: t.data,
1352
- inOptions: t.options,
1353
- options: t.options
1898
+ inOptions: o,
1899
+ options: t.options,
1900
+ inShowLog: a
1354
1901
  });
1355
- return o && console.log("json-renderers-build output:", s), s;
1902
+ return a && console.log("json-renderers-build output:", i), i;
1356
1903
  };
1357
- mt(G);
1358
- const Oo = ({
1904
+ Pt(at);
1905
+ const Ho = ({
1359
1906
  inColumns: t,
1360
- inType: o = "table",
1907
+ inType: a = "table",
1361
1908
  inData: e,
1362
- inShowLog: r = !1
1363
- } = {}) => G({
1364
- type: o,
1909
+ inShowLog: o = !1
1910
+ } = {}) => at({
1911
+ type: a,
1365
1912
  data: e ?? [],
1366
1913
  columns: t,
1367
- showLog: r
1368
- }), Vo = {
1369
- version: "v9",
1914
+ showLog: o
1915
+ }), Mo = {
1916
+ version: "v10",
1370
1917
  description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
1371
1918
  }, Wo = (t) => {
1372
1919
  if (typeof globalThis > "u" || !t) return;
1373
1920
  globalThis.ks ?? (globalThis.ks = {});
1374
- const o = {
1375
- meta: Vo,
1921
+ const a = {
1922
+ meta: Mo,
1376
1923
  buildSpecElement: t
1377
1924
  };
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([
1925
+ globalThis.ks["json-to-tag"] = a, globalThis.ks.jsonToTag = a;
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([
1380
1927
  "svg",
1381
1928
  "path",
1382
1929
  "symbol",
@@ -1403,100 +1950,100 @@ const Oo = ({
1403
1950
  "fegaussianblur",
1404
1951
  "femerge",
1405
1952
  "femergenode"
1406
- ]), Go = ({ inTagName: t }) => {
1407
- const o = t == null ? void 0 : t.toLowerCase();
1408
- if (!o) return null;
1409
- if (o === "checkbox") {
1953
+ ]), Jo = ({ inTagName: t }) => {
1954
+ const a = t == null ? void 0 : t.toLowerCase();
1955
+ if (!a) return null;
1956
+ if (a === "checkbox") {
1410
1957
  const e = document.createElement("input");
1411
1958
  return e.type = "checkbox", e;
1412
1959
  }
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")
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 }) => {
1962
+ const e = t, o = a;
1963
+ if (!e || !o || typeof o != "object")
1417
1964
  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;
1965
+ const n = typeof SVGElement < "u" ? e instanceof SVGElement : e.namespaceURI === "http://www.w3.org/2000/svg";
1966
+ return Object.entries(o).forEach(([s, r]) => {
1967
+ if (s === "class") {
1968
+ n ? e.setAttribute("class", String(r)) : e.className = r;
1422
1969
  return;
1423
1970
  }
1424
- if (n === "xlink:href" || n === "href") {
1425
- if (s != null) {
1426
- const i = String(s);
1427
- if (a)
1971
+ if (s === "xlink:href" || s === "href") {
1972
+ if (r != null) {
1973
+ const i = String(r);
1974
+ if (n)
1428
1975
  try {
1429
- e.setAttributeNS(Jo, "href", i);
1976
+ e.setAttributeNS(Qo, "href", i);
1430
1977
  } catch {
1431
1978
  }
1432
1979
  e.setAttribute("href", i), e.setAttribute("xlink:href", i);
1433
1980
  }
1434
1981
  return;
1435
1982
  }
1436
- if (typeof s == "boolean") {
1437
- s ? e.setAttribute(n, "") : e.removeAttribute(n);
1983
+ if (typeof r == "boolean") {
1984
+ r ? e.setAttribute(s, "") : e.removeAttribute(s);
1438
1985
  return;
1439
1986
  }
1440
- s != null && e.setAttribute(n, String(s));
1987
+ r != null && e.setAttribute(s, String(r));
1441
1988
  }), 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()) : [];
1989
+ }, Zo = ({ inElement: t, inClassList: a }) => {
1990
+ if (!t || !a) return t;
1991
+ const e = typeof a == "string" ? a.split(/\s+/).filter(Boolean) : Array.isArray(a) ? a.filter((o) => typeof o == "string" && o.trim()) : [];
1445
1992
  return e.length && t.classList.add(...e), t;
1446
- }, Qo = (t) => {
1993
+ }, tn = (t) => {
1447
1994
  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),
1995
+ const a = Jo({ inTagName: t.tagName });
1996
+ if (!a) return null;
1997
+ if (_o({
1998
+ inElement: a,
1999
+ inTextContent: Go(t.textContent),
1453
2000
  inTagName: t.tagName
1454
- }), Uo({
1455
- inElement: o,
2001
+ }), Xo({
2002
+ inElement: a,
1456
2003
  inProperties: t.properties
1457
- }), _o({
1458
- inElement: o,
2004
+ }), Yo({
2005
+ inElement: a,
1459
2006
  inAttributes: t.attributes
1460
- }), Xo({
1461
- inElement: o,
2007
+ }), Zo({
2008
+ inElement: a,
1462
2009
  inClassList: t.classList
1463
2010
  }), Array.isArray(t.children)) {
1464
- const e = K(t.children);
1465
- e.length && o.append(...e);
2011
+ const e = ot(t.children);
2012
+ e.length && a.append(...e);
1466
2013
  }
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);
2014
+ return a;
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 = {}) => {
2016
+ const a = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
2017
+ return nt(a);
1471
2018
  };
1472
- Wo(J);
1473
- const Yo = ({
2019
+ Wo(st);
2020
+ const en = ({
1474
2021
  inSpec: t,
1475
- inTargetHtmlId: o,
2022
+ inTargetHtmlId: a,
1476
2023
  inAppendPosition: e,
1477
- inShowLog: r = !1
2024
+ inShowLog: o = !1
1478
2025
  } = {}) => {
1479
- const a = t, n = o, s = e, i = r, l = J(a);
2026
+ const n = t, s = a, r = e, i = o, l = st(n);
1480
2027
  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 = {}) => {
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 = {}) => {
1484
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);
1485
- const e = Oo({
2032
+ const e = Ho({
1486
2033
  inColumns: t.columns,
1487
2034
  inData: t.data,
1488
2035
  inType: t.type,
1489
2036
  inShowLog: t.showLog
1490
2037
  });
1491
- return Yo({
2038
+ return en({
1492
2039
  inSpec: e,
1493
2040
  inTargetHtmlId: t.targetHtmlId,
1494
2041
  inAppendPosition: t.appendPosition,
1495
2042
  inShowLog: t.showLog
1496
2043
  });
1497
2044
  };
1498
- Y(Zo);
2045
+ ct(an);
1499
2046
  export {
1500
- Zo as default,
1501
- Zo as render
2047
+ an as default,
2048
+ an as render
1502
2049
  };