json-renderers 1.13.7 → 1.14.1

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,244 +1,606 @@
1
- const x = {
2
- version: "v13.1.0",
1
+ const A = {
2
+ version: "v14.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
- }, j = (t) => {
4
+ }, S = (t) => {
5
5
  var e;
6
6
  typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderers ?? (e.jsonRenderers = {
7
- meta: x,
7
+ meta: A,
8
8
  renderToDom: t
9
9
  }));
10
- }, v = {
11
- version: "v3.0.0",
10
+ }, E = {
11
+ version: "v9.0.0",
12
12
  description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
13
- }, N = (t) => {
13
+ }, v = (t) => {
14
14
  var e;
15
15
  typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderersBuild ?? (e.jsonRenderersBuild = {
16
- meta: v,
16
+ meta: E,
17
17
  renderToDom: t
18
18
  }));
19
- }, $ = {
20
- version: "v32",
21
- description: "JSON-to-DOM engine with centralized traversal and responsibility-focused construction"
22
- }, k = ({ inFuncDefinition: t } = {}) => {
23
- if (typeof globalThis > "u" || !t) return;
24
- globalThis.ks ?? (globalThis.ks = {});
25
- const e = {
26
- meta: $,
27
- buildSpecElement: t
28
- };
29
- globalThis.ks.jsonToSpec = e;
30
- }, D = (t, e) => g(t, e), m = (t, e) => Array.isArray(t) ? t.map((l) => D(l, e)).flat(1 / 0).filter(Boolean) : [], O = (t, e) => {
31
- if ("source" in t && (t == null ? void 0 : t.source) in e) {
32
- const l = e[t == null ? void 0 : t.source];
33
- if (Array.isArray(l))
34
- return l.map((n) => {
35
- const r = t == null ? void 0 : t.template;
36
- if (r)
37
- return g(r, n);
38
- });
39
- }
40
- }, E = (t, e) => {
41
- let l = [];
42
- for (const [o, n] of Object.entries(e)) {
43
- const r = t == null ? void 0 : t.template;
44
- if (r) {
45
- const a = g(r, {
46
- key: o,
47
- value: n
48
- });
49
- l.push(a);
50
- }
51
- }
52
- return l;
53
- }, S = (t, e) => {
54
- if ("source" in t && (t == null ? void 0 : t.source) in e) {
55
- const l = e[t == null ? void 0 : t.source];
56
- if (Array.isArray(l))
57
- return l.map((n) => {
58
- const r = t == null ? void 0 : t.template;
59
- if (r)
60
- return g(r, n);
61
- });
62
- }
63
- }, L = (t, e) => {
64
- if ("operation" in t) {
65
- if (t.operation === "loopArray")
66
- return O(t, e);
67
- if (t.operation === "loopObject")
68
- return E(t, e);
69
- if (t.operation === "loopCollection")
70
- return S(t, e);
71
- }
72
- }, p = (t, e) => {
73
- if (typeof e == "string") return e;
74
- if (typeof t != "string") return t;
75
- if (t === "${value}")
76
- return e.value;
77
- const l = t.match(/^\$\{(.+?)\}$/);
78
- if (l) {
79
- const o = l[1];
80
- return (e == null ? void 0 : e[o]) ?? "";
81
- }
82
- return t;
83
- }, F = (t, e) => {
84
- let l = {};
85
- for (const [o, n] of Object.entries(t)) {
86
- const r = p(n, e);
87
- l[o] = r;
88
- }
89
- return l;
90
- }, G = (t, e) => {
91
- if ("tagName" in t) {
92
- if ("textContent" in t) {
93
- const l = p(t.textContent, e);
94
- t.textContent = l;
19
+ }, k = "table", j = {
20
+ class: "table table-hover table-striped mb-0"
21
+ }, O = [], U = {
22
+ tagName: k,
23
+ attributes: j,
24
+ children: O
25
+ }, J = "thead", R = [], F = {
26
+ tagName: J,
27
+ children: R
28
+ }, W = "tr", D = [], V = {
29
+ tagName: W,
30
+ children: D
31
+ }, B = "th", I = {
32
+ value: ""
33
+ }, M = "", H = {
34
+ tagName: B,
35
+ attributes: I,
36
+ textContent: M
37
+ }, G = ({ inColumn: t } = {}) => {
38
+ const e = structuredClone(H);
39
+ return e.attributes.value = t, e.textContent = t, e;
40
+ }, q = ({ inColumns: t = [] } = {}) => {
41
+ const e = structuredClone(V), n = t.map((o) => G({ inColumn: o }));
42
+ return e.children = n, e;
43
+ }, z = ({ inColumns: t = [] } = {}) => {
44
+ const e = structuredClone(F), n = [
45
+ q({ inColumns: t })
46
+ ];
47
+ return e.children = n, e;
48
+ }, K = "tbody", L = [], P = {
49
+ tagName: K,
50
+ children: L
51
+ }, _ = "tr", X = [], Q = {
52
+ tagName: _,
53
+ children: X
54
+ }, Y = "td", Z = {
55
+ value: ""
56
+ }, tt = "", et = {
57
+ tagName: Y,
58
+ attributes: Z,
59
+ textContent: tt
60
+ }, nt = ({ inValue: t } = {}) => {
61
+ const e = structuredClone(et);
62
+ return e.attributes.value = t, e.textContent = t, e;
63
+ }, ot = ({ inRow: t, inColumns: e = [] } = {}) => {
64
+ const n = structuredClone(Q), o = e.map((s) => {
65
+ const l = Array.isArray(t) ? t[s] : t == null ? void 0 : t[s];
66
+ return nt({ inValue: l });
67
+ });
68
+ return n.children = o, n;
69
+ }, st = ({ inData: t = [], inColumns: e = [] } = {}) => {
70
+ const n = structuredClone(P), o = t.map((s) => ot({
71
+ inRow: s,
72
+ inColumns: e
73
+ }));
74
+ return n.children = o, n;
75
+ }, lt = "tfoot", rt = {
76
+ class: "table-light"
77
+ }, at = [], ct = {
78
+ tagName: lt,
79
+ attributes: rt,
80
+ children: at
81
+ }, it = "tr", ut = {
82
+ class: "align-middle"
83
+ }, dt = [], mt = {
84
+ tagName: it,
85
+ attributes: ut,
86
+ children: dt
87
+ }, bt = "td", ht = {
88
+ class: "align-middle py-2"
89
+ }, pt = [], ft = {
90
+ tagName: bt,
91
+ attributes: ht,
92
+ children: pt
93
+ }, gt = "input", yt = {
94
+ type: "text",
95
+ name: "",
96
+ placeholder: "",
97
+ class: "form-control form-control-sm"
98
+ }, wt = {
99
+ tagName: gt,
100
+ attributes: yt
101
+ }, Tt = ({ inColumn: t } = {}) => {
102
+ const e = structuredClone(ft), n = structuredClone(wt);
103
+ return n.attributes.name = t, n.attributes.placeholder = t, e.children.push(n), e;
104
+ }, Ct = ({ inColumns: t = [] } = {}) => {
105
+ const e = structuredClone(mt);
106
+ return e.children = t.map((n) => Tt({ inColumn: n })), e;
107
+ }, $t = ({ inColumns: t = [] } = {}) => Ct({ inColumns: t }), Nt = "tr", xt = {
108
+ class: "align-middle"
109
+ }, At = [], St = {
110
+ tagName: Nt,
111
+ attributes: xt,
112
+ children: At
113
+ }, Et = "td", vt = {
114
+ class: "align-middle py-2"
115
+ }, kt = [], jt = {
116
+ tagName: Et,
117
+ attributes: vt,
118
+ children: kt
119
+ }, Ot = "input", Ut = {
120
+ type: "text",
121
+ name: "",
122
+ placeholder: "",
123
+ class: "form-control form-control-sm"
124
+ }, Jt = {
125
+ tagName: Ot,
126
+ attributes: Ut
127
+ }, Rt = "button", Ft = {
128
+ type: "button",
129
+ class: "btn btn-primary btn-sm ms-2"
130
+ }, Wt = "Save", Dt = {
131
+ tagName: Rt,
132
+ attributes: Ft,
133
+ textContent: Wt
134
+ }, Vt = ({ inColumn: t, inSave: e = !1 } = {}) => {
135
+ const n = structuredClone(jt), o = structuredClone(Jt);
136
+ return o.attributes.name = t, o.attributes.placeholder = t, n.children.push(o), e && n.children.push(structuredClone(Dt)), n;
137
+ }, Bt = ({ inColumns: t = [] } = {}) => {
138
+ const e = structuredClone(St);
139
+ return e.children = t.map((n, o) => Vt({
140
+ inColumn: n,
141
+ inSave: o === t.length - 1
142
+ })), e;
143
+ }, It = ({ inColumns: t = [] } = {}) => Bt({ inColumns: t }), Mt = "tr", Ht = {
144
+ class: "fw-semibold align-middle"
145
+ }, Gt = [], qt = {
146
+ tagName: Mt,
147
+ attributes: Ht,
148
+ children: Gt
149
+ }, zt = "td", Kt = {
150
+ class: "align-middle py-2"
151
+ }, Lt = "", Pt = {
152
+ tagName: zt,
153
+ attributes: Kt,
154
+ textContent: Lt
155
+ }, _t = (t, e) => Array.isArray(t) ? t[e] : t == null ? void 0 : t[e], Xt = ({ inColumn: t, inIndex: e, inData: n = [] } = {}) => {
156
+ const o = structuredClone(Pt), s = n.map((l) => _t(l, t)).filter((l) => l != null && String(l).trim() !== "").map(Number).filter(Number.isFinite);
157
+ return o.textContent = s.length ? String(s.reduce((l, r) => l + r, 0)) : e === 0 ? "Total" : "", o;
158
+ }, Qt = ({ inColumns: t = [], inData: e = [] } = {}) => {
159
+ const n = structuredClone(qt);
160
+ return n.children = t.map(
161
+ (o, s) => Xt({ inColumn: o, inIndex: s, inData: e })
162
+ ), n;
163
+ }, Yt = ({ inColumns: t = [], inData: e = [] } = {}) => Qt({ inColumns: t, inData: e }), Zt = "tr", te = {
164
+ class: "align-middle"
165
+ }, ee = [], ne = {
166
+ tagName: Zt,
167
+ attributes: te,
168
+ children: ee
169
+ }, oe = "td", se = {
170
+ class: "align-middle py-2"
171
+ }, le = {
172
+ tagName: oe,
173
+ attributes: se
174
+ }, re = () => structuredClone(le), ae = ({ inColumns: t = [] } = {}) => {
175
+ const e = structuredClone(ne);
176
+ return e.children = t.map(() => re()), e;
177
+ }, ce = ({ inColumns: t = [] } = {}) => ae({ inColumns: t }), f = {
178
+ inputs: $t,
179
+ inputsWithSave: It,
180
+ totals: Yt,
181
+ empty: ce
182
+ }, ie = ({ inFooter: t = [], inColumns: e = [], inData: n = [] } = {}) => {
183
+ const o = structuredClone(ct);
184
+ return o.children = t.map((s) => {
185
+ if (!Object.hasOwn(f, s))
186
+ throw new Error(`Unknown footer "${s}".`);
187
+ return f[s]({ inColumns: e, inData: n });
188
+ }), o;
189
+ }, ue = ({
190
+ inColumns: t = [],
191
+ inData: e = [],
192
+ inFooter: n = []
193
+ } = {}) => {
194
+ const o = structuredClone(U), s = [
195
+ z({ inColumns: t }),
196
+ st({ inData: e, inColumns: t })
197
+ ];
198
+ if (!Array.isArray(n))
199
+ throw new TypeError("The footer property must be an array of footer names.");
200
+ return n.length > 0 && s.push(ie({
201
+ inFooter: n,
202
+ inColumns: t,
203
+ inData: e
204
+ })), o.children = s, o;
205
+ }, de = (t) => {
206
+ const [e, n] = t.children;
207
+ e.children[0].children.unshift({
208
+ tagName: "th",
209
+ textContent: "#"
210
+ }), n.children.forEach((o, s) => {
211
+ o.children.unshift({
212
+ tagName: "td",
213
+ textContent: String(s + 1)
214
+ });
215
+ });
216
+ }, me = (t) => t === !0 ? [{ label: "Apply", type: "button" }] : Array.isArray(t) ? t : [], be = (t, e) => {
217
+ const n = me(e);
218
+ if (n.length === 0) return;
219
+ const [o, s] = t.children;
220
+ o.children[0].children.push({
221
+ tagName: "th",
222
+ textContent: "Actions"
223
+ }), s.children.forEach((l) => {
224
+ l.children.push({
225
+ tagName: "td",
226
+ children: n.map((r) => ({
227
+ tagName: "button",
228
+ attributes: { type: r.type || "button" },
229
+ textContent: r.label
230
+ }))
231
+ });
232
+ });
233
+ }, he = (t, e = {}) => (e.showSerial && de(t), e.showOptions && be(t, e.showOptions), t), pe = {
234
+ type: "table",
235
+ data: [
236
+ {
237
+ itemName: "0.09/30mm",
238
+ baseUnit: "kgs"
95
239
  }
96
- if ("attributes" in t) {
97
- const l = F(t.attributes, e);
98
- t.attributes = l;
240
+ ],
241
+ columns: [
242
+ "itemName",
243
+ "baseUnit"
244
+ ],
245
+ options: {}
246
+ }, fe = {
247
+ type: "table",
248
+ data: [
249
+ {
250
+ itemName: "0.09/30mm",
251
+ baseUnit: "kgs"
99
252
  }
253
+ ],
254
+ columns: [
255
+ "itemName",
256
+ "baseUnit"
257
+ ],
258
+ options: {
259
+ showSerial: !0
100
260
  }
101
- }, M = (t, e) => {
102
- if (!t || typeof t != "object" || Array.isArray(t)) return null;
103
- const l = structuredClone(t);
104
- if (!l) return null;
105
- if ("tagName" in l && G(l, e), "jsonToSpec" in l) {
106
- const o = l == null ? void 0 : l.jsonToSpec, n = L(o, e);
107
- Array.isArray(n) ? l.children = n : l.children = [n], delete l.jsonToSpec;
108
- }
109
- if (Array.isArray(l == null ? void 0 : l.children)) {
110
- const o = m(l == null ? void 0 : l.children, e);
111
- l.children = o;
261
+ }, ge = {
262
+ type: "table",
263
+ data: [
264
+ {
265
+ itemName: "0.09/30mm",
266
+ baseUnit: "kgs"
267
+ }
268
+ ],
269
+ columns: [
270
+ "itemName",
271
+ "baseUnit"
272
+ ],
273
+ options: {
274
+ showOptions: !0
112
275
  }
113
- return l;
114
- }, g = (t, e) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? m(t, e) : typeof t == "object" ? M(t, e) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : t, h = (t, e) => g(t, e);
115
- k({
116
- inFuncDefinition: h
117
- });
118
- const R = {
119
- default: {
120
- tagName: "table",
121
- attributes: {
122
- class: "table table-hover table-striped mb-0"
123
- },
124
- children: [
276
+ }, ye = {
277
+ type: "table",
278
+ data: [
279
+ {
280
+ itemName: "0.09/30mm",
281
+ baseUnit: "kgs"
282
+ }
283
+ ],
284
+ columns: [
285
+ "itemName",
286
+ "baseUnit"
287
+ ],
288
+ options: {
289
+ showOptions: [
125
290
  {
126
- tagName: "thead",
127
- children: [
128
- {
129
- tagName: "tr",
130
- jsonToSpec: {
131
- operation: "loopCollection",
132
- source: "columns",
133
- template: {
134
- tagName: "th",
135
- textContent: "${title}"
136
- }
137
- },
138
- children: []
139
- }
140
- ]
291
+ label: "Show",
292
+ type: "button"
141
293
  },
142
294
  {
143
- tagName: "tbody",
144
- jsonToSpec: {
145
- operation: "loopCollection",
146
- source: "data",
147
- template: {
148
- tagName: "tr",
149
- jsonToSpec: {
150
- operation: "loopObject",
151
- source: "data",
152
- template: {
153
- tagName: "td",
154
- textContent: "${value}"
155
- }
156
- },
157
- children: []
158
- }
159
- },
160
- children: []
295
+ label: "Edit",
296
+ type: "button"
161
297
  }
162
298
  ]
163
299
  }
164
- }, z = ({
165
- inColumns: t,
166
- inData: e
167
- } = {}) => {
168
- const l = e ?? [], o = t;
169
- return h(R.default, {
170
- columns: o,
171
- data: l
172
- });
173
- }, I = "select", V = {
174
- id: "LedgerName"
175
- }, q = {
176
- operation: "loopArray",
177
- source: "arrayOfStrings",
178
- template: {
179
- tagName: "option",
180
- attributes: {
181
- value: "${}"
182
- },
183
- textContent: "${}"
300
+ }, we = {
301
+ type: "table",
302
+ data: [
303
+ {
304
+ itemName: "0.09/30mm",
305
+ baseUnit: "kgs"
306
+ }
307
+ ],
308
+ columns: [
309
+ "itemName",
310
+ "baseUnit"
311
+ ],
312
+ options: {
313
+ showSerial: !0,
314
+ showOptions: [
315
+ {
316
+ label: "Show",
317
+ type: "button"
318
+ }
319
+ ]
184
320
  }
185
- }, B = [], P = {
186
- tagName: I,
187
- attributes: V,
188
- jsonToSpec: q,
189
- children: B
190
- }, H = ({
191
- inData: t
192
- } = {}) => h(P, {
193
- arrayOfStrings: t ?? []
194
- }), _ = {
195
- operation: "loopArray",
196
- source: "arrayOfStrings",
197
- template: {
198
- tagName: "option",
199
- attributes: {
200
- value: "${}"
321
+ }, Te = {
322
+ type: "table",
323
+ data: [
324
+ {
325
+ itemName: "0.09/30mm",
326
+ baseUnit: "kgs"
327
+ }
328
+ ],
329
+ columns: [
330
+ "itemName",
331
+ "baseUnit"
332
+ ],
333
+ footer: [
334
+ "inputs"
335
+ ],
336
+ options: {}
337
+ }, Ce = {
338
+ type: "table",
339
+ data: [
340
+ {
341
+ itemName: "0.09/30mm",
342
+ baseUnit: "kgs"
343
+ }
344
+ ],
345
+ columns: [
346
+ "itemName",
347
+ "baseUnit"
348
+ ],
349
+ footer: [
350
+ "inputsWithSave"
351
+ ],
352
+ options: {}
353
+ }, $e = {
354
+ type: "table",
355
+ data: [
356
+ {
357
+ itemName: "0.09/30mm",
358
+ baseUnit: "2"
201
359
  },
202
- textContent: "${}"
360
+ {
361
+ itemName: "0.11-25",
362
+ baseUnit: "3"
363
+ }
364
+ ],
365
+ columns: [
366
+ "itemName",
367
+ "baseUnit"
368
+ ],
369
+ footer: [
370
+ "totals"
371
+ ],
372
+ options: {}
373
+ }, Ne = {
374
+ type: "table",
375
+ data: [
376
+ {
377
+ itemName: "0.09/30mm",
378
+ baseUnit: "2"
379
+ }
380
+ ],
381
+ columns: [
382
+ "itemName",
383
+ "baseUnit"
384
+ ],
385
+ footer: [
386
+ "inputs",
387
+ "totals",
388
+ "inputsWithSave",
389
+ "empty"
390
+ ],
391
+ options: {}
392
+ }, xe = {
393
+ type: "tableHead",
394
+ data: [],
395
+ columns: [
396
+ "itemName",
397
+ "baseUnit"
398
+ ],
399
+ options: {}
400
+ }, Ae = {
401
+ type: "tableBody",
402
+ data: [
403
+ {
404
+ itemName: "0.09/30mm",
405
+ baseUnit: "kgs"
406
+ }
407
+ ],
408
+ columns: [
409
+ "itemName",
410
+ "baseUnit"
411
+ ],
412
+ options: {}
413
+ }, Se = {
414
+ table: pe,
415
+ tableWithSerial: fe,
416
+ tableWithDefaultAction: ge,
417
+ tableWithCustomActions: ye,
418
+ tableWithSerialAndActions: we,
419
+ tableWithFooter: Te,
420
+ tableWithFooterSave: Ce,
421
+ tableWithTotals: $e,
422
+ tableWithMultipleFooters: Ne,
423
+ tableHead: xe,
424
+ tableBody: Ae
425
+ }, g = ({
426
+ type: t = "table",
427
+ inData: e,
428
+ inColumns: n,
429
+ footer: o = [],
430
+ options: s = {}
431
+ } = {}) => {
432
+ if (t === "table") {
433
+ const l = ue({
434
+ inColumns: n,
435
+ inData: e,
436
+ inFooter: o
437
+ });
438
+ return he(l, s);
203
439
  }
204
- }, U = [], K = {
205
- jsonToSpec: _,
206
- children: U
207
- }, X = ({
440
+ throw new Error(`Unknown table renderer type "${t}".`);
441
+ };
442
+ g.requests = Se;
443
+ const y = ({ inItems: t, inRecipe: e, inExecute: n }) => {
444
+ const o = t, s = e, l = n;
445
+ return o.map((r) => p({
446
+ inSource: r,
447
+ inRecipe: s,
448
+ inExecute: l
449
+ })).flat(1 / 0).filter(Boolean);
450
+ }, Ee = ({ inSource: t, inRecipe: e, inExecute: n }) => {
451
+ const o = t, s = e, l = n;
452
+ let r = o;
453
+ typeof l == "function" && (r = l({
454
+ inSource: o,
455
+ inRecipe: s
456
+ }));
457
+ for (const [a, d] of Object.entries(r))
458
+ Array.isArray(d) && s && a in s && (r[a] = y({
459
+ inItems: d,
460
+ inRecipe: s[a],
461
+ inExecute: l
462
+ }));
463
+ return r;
464
+ }, p = ({ inSource: t, inRecipe: e, inExecute: n }) => {
465
+ const o = t, s = e, l = n;
466
+ return Array.isArray(o) ? y({
467
+ inItems: o,
468
+ inRecipe: s,
469
+ inExecute: l
470
+ }) : typeof o == "object" && o !== null ? Ee({
471
+ inSource: o,
472
+ inRecipe: s,
473
+ inExecute: l
474
+ }) : o;
475
+ }, ve = ({ inKey: t, inDirective: e }) => {
476
+ const n = t, o = e;
477
+ return (o == null ? void 0 : o.alterKey) || n;
478
+ }, ke = ({ inValue: t, inDirective: e, inExecute: n }) => {
479
+ const o = t, s = e, l = n;
480
+ return s && "transform" in s ? p({
481
+ inSource: o,
482
+ inRecipe: s,
483
+ inExecute: l
484
+ }) : o;
485
+ }, je = ({ inValue: t, inDirective: e }) => {
486
+ const n = t, o = e;
487
+ return (o == null ? void 0 : o.valueType) === "array" && !Array.isArray(n) ? [n] : n;
488
+ }, Oe = ({ inValue: t, inDirective: e }) => {
489
+ const n = t, o = e;
490
+ return o != null && o.valueKey && n && typeof n == "object" ? n[o.valueKey] : n;
491
+ }, Ue = ({ inSource: t, inTransform: e, inExecute: n }) => {
492
+ const o = t, s = e, l = n, r = {};
493
+ for (const [a, d] of Object.entries(o)) {
494
+ if (!(a in s))
495
+ continue;
496
+ const u = s[a], c = ve({ inKey: a, inDirective: u });
497
+ let i = d;
498
+ i = ke({
499
+ inValue: i,
500
+ inDirective: u,
501
+ inExecute: l
502
+ }), i = je({ inValue: i, inDirective: u }), i = Oe({ inValue: i, inDirective: u }), r[c] = i;
503
+ }
504
+ return r;
505
+ };
506
+ function w(t, e) {
507
+ for (const n in t)
508
+ typeof t[n] == "object" && t[n] !== null ? w(t[n], e) : typeof t[n] == "string" && t[n] === "${}" && (t[n] = e);
509
+ return t;
510
+ }
511
+ const Je = ({ inSource: t, inOperation: e, inExecute: n }) => {
512
+ const o = t, s = e;
513
+ for (const [l, r] of Object.entries(s))
514
+ if ("operationType" in r && r.operationType === "loopArray" && l in o) {
515
+ const a = o[l].map((d) => {
516
+ const u = structuredClone(r == null ? void 0 : r.template);
517
+ return w(u, d), u;
518
+ });
519
+ o[l] = a;
520
+ }
521
+ return o;
522
+ }, b = ({ inSource: t, inRecipe: e }) => {
523
+ let n = t;
524
+ const o = e;
525
+ return o && typeof o == "object" && "transform" in o && (n = Ue({
526
+ inSource: n,
527
+ inTransform: o.transform,
528
+ inExecute: b
529
+ })), o && typeof o == "object" && "operation" in o && (n = Je({
530
+ inSource: n,
531
+ inOperation: o.operation,
532
+ inExecute: b
533
+ })), n;
534
+ }, Re = (t, e) => p({
535
+ inSource: t,
536
+ inRecipe: e,
537
+ inExecute: b
538
+ }), Fe = {
539
+ children: ""
540
+ }, We = {
541
+ children: {
542
+ operationType: "loopArray",
543
+ template: {
544
+ tagName: "option",
545
+ attributes: {
546
+ value: "${}"
547
+ },
548
+ textContent: "${}"
549
+ }
550
+ }
551
+ }, De = {
552
+ transform: Fe,
553
+ operation: We
554
+ }, T = ({
555
+ inData: t
556
+ }) => {
557
+ let n = Re({
558
+ children: t
559
+ }, De);
560
+ return n == null ? void 0 : n.children;
561
+ }, Ve = "select", Be = {
562
+ id: "LedgerName"
563
+ }, Ie = [], Me = {
564
+ tagName: Ve,
565
+ attributes: Be,
566
+ children: Ie
567
+ }, He = ({
208
568
  inData: t
209
- } = {}) => h(K, {
210
- arrayOfStrings: t ?? []
211
- }), w = {
212
- table: z,
213
- select: H,
214
- selectOptionsOnly: X
215
- }, y = ({
569
+ }) => {
570
+ let n = T({
571
+ inData: t
572
+ });
573
+ const o = structuredClone(Me);
574
+ return o.children = n, o;
575
+ }, Ge = {
576
+ table: g,
577
+ select: He,
578
+ selectOptionsOnly: T
579
+ }, C = ({
216
580
  type: t = "table",
217
581
  data: e,
218
- columns: l
219
- } = {}) => {
220
- const o = t, n = w[o];
221
- return n ? n({
222
- inColumns: l,
582
+ columns: n
583
+ }) => {
584
+ const s = Ge[t];
585
+ return s({
586
+ inColumns: n,
223
587
  inData: e
224
- }) : (console.error(
225
- `[Renderer] Unknown renderer type "${o}". Available types: ${Object.keys(w).join(", ")}`
226
- ), null);
588
+ });
227
589
  };
228
- N(y);
229
- const Q = {
590
+ v(C);
591
+ const qe = {
230
592
  version: "v9",
231
593
  description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
232
- }, W = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
594
+ }, ze = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
233
595
  if (typeof globalThis > "u" || !t) return;
234
596
  globalThis.ks ?? (globalThis.ks = {});
235
- const l = {
236
- meta: Q,
597
+ const n = {
598
+ meta: qe,
237
599
  buildSpecElement: t,
238
600
  reviewSpec: e
239
601
  };
240
- globalThis.ks["json-to-tag"] = l, globalThis.ks.jsonToTag = l;
241
- }, Y = (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 ?? "") : C(t), T = (t) => Array.isArray(t) ? t.map(Y).flat(1 / 0).filter(Boolean) : [], Z = (t) => (t == null, t), J = "http://www.w3.org/2000/svg", tt = /* @__PURE__ */ new Set([
602
+ globalThis.ks["json-to-tag"] = n, globalThis.ks.jsonToTag = n;
603
+ }, Ke = (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 ?? "") : N(t), $ = (t) => Array.isArray(t) ? t.map(Ke).flat(1 / 0).filter(Boolean) : [], Le = (t) => (t == null, t), Pe = "http://www.w3.org/2000/svg", _e = /* @__PURE__ */ new Set([
242
604
  "svg",
243
605
  "path",
244
606
  "symbol",
@@ -265,69 +627,69 @@ const Q = {
265
627
  "fegaussianblur",
266
628
  "femerge",
267
629
  "femergenode"
268
- ]), et = ({ inTagName: t }) => {
630
+ ]), Xe = ({ inTagName: t }) => {
269
631
  const e = t == null ? void 0 : t.toLowerCase();
270
632
  if (!e) return null;
271
633
  if (e === "checkbox") {
272
- const l = document.createElement("input");
273
- return l.type = "checkbox", l;
634
+ const n = document.createElement("input");
635
+ return n.type = "checkbox", n;
274
636
  }
275
- return tt.has(e) ? document.createElementNS(J, e) : document.createElement(e);
276
- }, lt = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), ot = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), rt = "http://www.w3.org/1999/xlink", nt = ({ inElement: t, inAttributes: e }) => {
277
- const l = t, o = e;
278
- if (!l || !o || typeof o != "object")
279
- return l;
280
- const n = typeof SVGElement < "u" ? l instanceof SVGElement : l.namespaceURI === "http://www.w3.org/2000/svg";
281
- return Object.entries(o).forEach(([r, a]) => {
282
- if (r === "class") {
283
- n ? l.setAttribute("class", String(a)) : l.className = a;
637
+ return _e.has(e) ? document.createElementNS(Pe, e) : document.createElement(e);
638
+ }, Qe = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), Ye = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), Ze = "http://www.w3.org/1999/xlink", tn = ({ inElement: t, inAttributes: e }) => {
639
+ const n = t, o = e;
640
+ if (!n || !o || typeof o != "object")
641
+ return n;
642
+ const s = typeof SVGElement < "u" ? n instanceof SVGElement : n.namespaceURI === "http://www.w3.org/2000/svg";
643
+ return Object.entries(o).forEach(([l, r]) => {
644
+ if (l === "class") {
645
+ s ? n.setAttribute("class", String(r)) : n.className = r;
284
646
  return;
285
647
  }
286
- if (r === "xlink:href" || r === "href") {
287
- if (a != null) {
288
- const i = String(a);
289
- if (n)
648
+ if (l === "xlink:href" || l === "href") {
649
+ if (r != null) {
650
+ const a = String(r);
651
+ if (s)
290
652
  try {
291
- l.setAttributeNS(rt, "href", i);
653
+ n.setAttributeNS(Ze, "href", a);
292
654
  } catch {
293
655
  }
294
- l.setAttribute("href", i), l.setAttribute("xlink:href", i);
656
+ n.setAttribute("href", a), n.setAttribute("xlink:href", a);
295
657
  }
296
658
  return;
297
659
  }
298
- if (typeof a == "boolean") {
299
- a ? l.setAttribute(r, "") : l.removeAttribute(r);
660
+ if (typeof r == "boolean") {
661
+ r ? n.setAttribute(l, "") : n.removeAttribute(l);
300
662
  return;
301
663
  }
302
- a != null && l.setAttribute(r, String(a));
303
- }), l;
304
- }, at = ({ inElement: t, inClassList: e }) => {
664
+ r != null && n.setAttribute(l, String(r));
665
+ }), n;
666
+ }, en = ({ inElement: t, inClassList: e }) => {
305
667
  if (!t || !e) return t;
306
- const l = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((o) => typeof o == "string" && o.trim()) : [];
307
- return l.length && t.classList.add(...l), t;
308
- }, st = (t) => {
668
+ const n = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((o) => typeof o == "string" && o.trim()) : [];
669
+ return n.length && t.classList.add(...n), t;
670
+ }, nn = (t) => {
309
671
  if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
310
- const e = et({ inTagName: t.tagName });
672
+ const e = Xe({ inTagName: t.tagName });
311
673
  if (!e) return null;
312
- if (lt({
674
+ if (Qe({
313
675
  inElement: e,
314
- inTextContent: Z(t.textContent),
676
+ inTextContent: Le(t.textContent),
315
677
  inTagName: t.tagName
316
- }), ot({
678
+ }), Ye({
317
679
  inElement: e,
318
680
  inProperties: t.properties
319
- }), nt({
681
+ }), tn({
320
682
  inElement: e,
321
683
  inAttributes: t.attributes
322
- }), at({
684
+ }), en({
323
685
  inElement: e,
324
686
  inClassList: t.classList
325
687
  }), Array.isArray(t.children)) {
326
- const l = T(t.children);
327
- l.length && e.append(...l);
688
+ const n = $(t.children);
689
+ n.length && e.append(...n);
328
690
  }
329
691
  return e;
330
- }, C = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? T(t) : typeof t == "object" ? st(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, it = "./tags.schema.json", ct = {
692
+ }, N = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? $(t) : typeof t == "object" ? nn(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, on = "./tags.schema.json", sn = {
331
693
  allowsTextContent: !1,
332
694
  allowsChildren: !0,
333
695
  allowedAttributes: [
@@ -335,7 +697,7 @@ const Q = {
335
697
  "role"
336
698
  ],
337
699
  childTags: []
338
- }, ut = {
700
+ }, ln = {
339
701
  allowsTextContent: !1,
340
702
  allowsChildren: !1,
341
703
  allowedAttributes: [
@@ -348,7 +710,7 @@ const Q = {
348
710
  "required",
349
711
  "list"
350
712
  ]
351
- }, dt = {
713
+ }, rn = {
352
714
  allowsTextContent: !1,
353
715
  allowsChildren: !1,
354
716
  allowedAttributes: [
@@ -359,7 +721,7 @@ const Q = {
359
721
  "disabled",
360
722
  "required"
361
723
  ]
362
- }, ft = {
724
+ }, an = {
363
725
  allowsTextContent: !1,
364
726
  allowsChildren: !0,
365
727
  allowedAttributes: [
@@ -368,7 +730,7 @@ const Q = {
368
730
  childTags: [
369
731
  "col"
370
732
  ]
371
- }, gt = {
733
+ }, cn = {
372
734
  allowsTextContent: !1,
373
735
  allowsChildren: !1,
374
736
  allowedAttributes: [
@@ -376,14 +738,14 @@ const Q = {
376
738
  "style",
377
739
  "width"
378
740
  ]
379
- }, ht = {
741
+ }, un = {
380
742
  allowsTextContent: !0,
381
743
  allowsChildren: !0,
382
744
  allowedAttributes: [
383
745
  "for"
384
746
  ],
385
747
  childTags: []
386
- }, bt = {
748
+ }, dn = {
387
749
  allowsTextContent: !1,
388
750
  allowsChildren: !0,
389
751
  allowedAttributes: [
@@ -396,7 +758,7 @@ const Q = {
396
758
  "target"
397
759
  ],
398
760
  childTags: []
399
- }, wt = {
761
+ }, mn = {
400
762
  allowsTextContent: !1,
401
763
  allowsChildren: !0,
402
764
  allowedAttributes: [
@@ -409,27 +771,27 @@ const Q = {
409
771
  childTags: [
410
772
  "option"
411
773
  ]
412
- }, mt = {
774
+ }, bn = {
413
775
  allowsTextContent: !0,
414
776
  allowsChildren: !0,
415
777
  allowedAttributes: [],
416
778
  childTags: []
417
- }, pt = {
779
+ }, hn = {
418
780
  allowsTextContent: !0,
419
781
  allowsChildren: !0,
420
782
  allowedAttributes: [],
421
783
  childTags: []
422
- }, yt = {
784
+ }, pn = {
423
785
  allowsTextContent: !0,
424
786
  allowsChildren: !0,
425
787
  allowedAttributes: [],
426
788
  childTags: []
427
- }, Tt = {
789
+ }, fn = {
428
790
  allowsTextContent: !0,
429
791
  allowsChildren: !0,
430
792
  allowedAttributes: [],
431
793
  childTags: []
432
- }, Ct = {
794
+ }, gn = {
433
795
  allowsTextContent: !1,
434
796
  allowsChildren: !1,
435
797
  allowedAttributes: [
@@ -439,7 +801,7 @@ const Q = {
439
801
  "height",
440
802
  "loading"
441
803
  ]
442
- }, At = {
804
+ }, yn = {
443
805
  allowsTextContent: !0,
444
806
  allowsChildren: !0,
445
807
  allowedAttributes: [
@@ -449,7 +811,7 @@ const Q = {
449
811
  "value"
450
812
  ],
451
813
  childTags: []
452
- }, xt = {
814
+ }, wn = {
453
815
  allowsTextContent: !1,
454
816
  allowsChildren: !0,
455
817
  allowedAttributes: [
@@ -465,28 +827,28 @@ const Q = {
465
827
  "tfoot",
466
828
  "tr"
467
829
  ]
468
- }, jt = {
830
+ }, Tn = {
469
831
  allowsTextContent: !1,
470
832
  allowsChildren: !0,
471
833
  allowedAttributes: [],
472
834
  childTags: [
473
835
  "tr"
474
836
  ]
475
- }, vt = {
837
+ }, Cn = {
476
838
  allowsTextContent: !1,
477
839
  allowsChildren: !0,
478
840
  allowedAttributes: [],
479
841
  childTags: [
480
842
  "tr"
481
843
  ]
482
- }, Nt = {
844
+ }, $n = {
483
845
  allowsTextContent: !1,
484
846
  allowsChildren: !0,
485
847
  allowedAttributes: [],
486
848
  childTags: [
487
849
  "tr"
488
850
  ]
489
- }, $t = {
851
+ }, Nn = {
490
852
  allowsTextContent: !1,
491
853
  allowsChildren: !0,
492
854
  allowedAttributes: [],
@@ -494,7 +856,7 @@ const Q = {
494
856
  "td",
495
857
  "th"
496
858
  ]
497
- }, kt = {
859
+ }, xn = {
498
860
  allowsTextContent: !0,
499
861
  allowsChildren: !0,
500
862
  allowedAttributes: [
@@ -503,7 +865,7 @@ const Q = {
503
865
  "rowspan"
504
866
  ],
505
867
  childTags: []
506
- }, Dt = {
868
+ }, An = {
507
869
  allowsTextContent: !0,
508
870
  allowsChildren: !0,
509
871
  allowedAttributes: [
@@ -511,14 +873,14 @@ const Q = {
511
873
  "rowspan"
512
874
  ],
513
875
  childTags: []
514
- }, Ot = {
876
+ }, Sn = {
515
877
  allowsTextContent: !1,
516
878
  allowsChildren: !0,
517
879
  allowedAttributes: [],
518
880
  childTags: [
519
881
  "option"
520
882
  ]
521
- }, Et = {
883
+ }, En = {
522
884
  allowsTextContent: !0,
523
885
  allowsChildren: !1,
524
886
  allowedAttributes: [
@@ -527,14 +889,14 @@ const Q = {
527
889
  "selected",
528
890
  "disabled"
529
891
  ]
530
- }, St = {
892
+ }, vn = {
531
893
  allowsTextContent: !1,
532
894
  allowsChildren: !0,
533
895
  allowedAttributes: [
534
896
  "role"
535
897
  ],
536
898
  childTags: []
537
- }, Lt = {
899
+ }, kn = {
538
900
  allowsTextContent: !0,
539
901
  allowsChildren: !0,
540
902
  allowedAttributes: [
@@ -545,19 +907,19 @@ const Q = {
545
907
  "download"
546
908
  ],
547
909
  childTags: []
548
- }, Ft = {
910
+ }, jn = {
549
911
  allowsTextContent: !0,
550
912
  allowsChildren: !0,
551
913
  allowedAttributes: [
552
914
  "aria-hidden"
553
915
  ],
554
916
  childTags: []
555
- }, Gt = {
917
+ }, On = {
556
918
  allowsTextContent: !0,
557
919
  allowsChildren: !0,
558
920
  allowedAttributes: [],
559
921
  childTags: []
560
- }, Mt = {
922
+ }, Un = {
561
923
  allowsTextContent: !1,
562
924
  allowsChildren: !0,
563
925
  allowedAttributes: [
@@ -566,137 +928,136 @@ const Q = {
566
928
  childTags: [
567
929
  "li"
568
930
  ]
569
- }, Rt = {
931
+ }, Jn = {
570
932
  allowsTextContent: !0,
571
933
  allowsChildren: !0,
572
934
  allowedAttributes: [
573
935
  "value"
574
936
  ],
575
937
  childTags: []
576
- }, zt = {
938
+ }, Rn = {
577
939
  allowsTextContent: !1,
578
940
  allowsChildren: !1,
579
941
  allowedAttributes: []
580
- }, It = {
581
- $schema: it,
582
- div: ct,
583
- input: ut,
584
- checkbox: dt,
585
- colgroup: ft,
586
- col: gt,
587
- label: ht,
588
- form: bt,
589
- select: wt,
590
- p: mt,
591
- h1: pt,
592
- h2: yt,
593
- span: Tt,
594
- img: Ct,
595
- button: At,
596
- table: xt,
597
- thead: jt,
598
- tbody: vt,
599
- tfoot: Nt,
600
- tr: $t,
601
- th: kt,
602
- td: Dt,
603
- datalist: Ot,
604
- option: Et,
605
- header: St,
606
- a: Lt,
607
- i: Ft,
608
- small: Gt,
609
- ul: Mt,
610
- li: Rt,
611
- hr: zt
612
- }, b = ({ inSpec: t }) => {
942
+ }, Fn = {
943
+ $schema: on,
944
+ div: sn,
945
+ input: ln,
946
+ checkbox: rn,
947
+ colgroup: an,
948
+ col: cn,
949
+ label: un,
950
+ form: dn,
951
+ select: mn,
952
+ p: bn,
953
+ h1: hn,
954
+ h2: pn,
955
+ span: fn,
956
+ img: gn,
957
+ button: yn,
958
+ table: wn,
959
+ thead: Tn,
960
+ tbody: Cn,
961
+ tfoot: $n,
962
+ tr: Nn,
963
+ th: xn,
964
+ td: An,
965
+ datalist: Sn,
966
+ option: En,
967
+ header: vn,
968
+ a: kn,
969
+ i: jn,
970
+ small: On,
971
+ ul: Un,
972
+ li: Jn,
973
+ hr: Rn
974
+ }, h = ({ inSpec: t }) => {
613
975
  const e = t;
614
976
  if (!e) return [];
615
977
  if (Array.isArray(e))
616
- return e.flatMap((o) => b({ inSpec: o }));
978
+ return e.flatMap((o) => h({ inSpec: o }));
617
979
  if (typeof e != "object") return [];
618
- const l = [];
619
- return typeof e.tagName == "string" && e.tagName.trim().length > 0 && l.push(e.tagName.toLowerCase()), Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((o) => {
620
- const n = b({ inSpec: o });
621
- l.push(...n);
622
- }), l;
623
- }, Vt = ({ inTagsFound: t, inAllowedTags: e }) => {
624
- const l = t ?? [], o = e ?? {}, n = new Set(
625
- Object.keys(o).filter((s) => s !== "$schema").map((s) => s.toLowerCase())
626
- ), r = {}, a = [], i = [];
627
- l.forEach((s) => {
628
- r[s] = (r[s] || 0) + 1, n.has(s) ? a.includes(s) || a.push(s) : i.includes(s) || i.push(s);
980
+ const n = [];
981
+ return typeof e.tagName == "string" && e.tagName.trim().length > 0 && n.push(e.tagName.toLowerCase()), Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((o) => {
982
+ const s = h({ inSpec: o });
983
+ n.push(...s);
984
+ }), n;
985
+ }, Wn = ({ inTagsFound: t, inAllowedTags: e }) => {
986
+ const n = t ?? [], o = e ?? {}, s = new Set(
987
+ Object.keys(o).filter((c) => c !== "$schema").map((c) => c.toLowerCase())
988
+ ), l = {}, r = [], a = [];
989
+ n.forEach((c) => {
990
+ l[c] = (l[c] || 0) + 1, s.has(c) ? r.includes(c) || r.push(c) : a.includes(c) || a.push(c);
629
991
  });
630
- const c = l.length, f = i.length === 0;
992
+ const d = n.length, u = a.length === 0;
631
993
  return {
632
- totalTags: c,
633
- tagCounts: r,
634
- uniqueTags: Object.keys(r),
635
- recognizedTags: a,
636
- unrecognizedTags: i,
637
- areAllTagsPresent: f
994
+ totalTags: d,
995
+ tagCounts: l,
996
+ uniqueTags: Object.keys(l),
997
+ recognizedTags: r,
998
+ unrecognizedTags: a,
999
+ areAllTagsPresent: u
638
1000
  };
639
- }, qt = ({ inSpec: t, inTags: e = It } = {}) => {
640
- const l = t, o = e, n = b({ inSpec: l }), r = Vt({
641
- inTagsFound: n,
1001
+ }, Dn = ({ inSpec: t, inTags: e = Fn } = {}) => {
1002
+ const n = t, o = e, s = h({ inSpec: n }), l = Wn({
1003
+ inTagsFound: s,
642
1004
  inAllowedTags: o
643
1005
  });
644
1006
  return {
645
- areAllTagsPresent: r.areAllTagsPresent,
646
- totalTags: r.totalTags,
647
- tagCounts: r.tagCounts,
648
- uniqueTags: r.uniqueTags,
649
- recognizedTags: r.recognizedTags,
650
- unrecognizedTags: r.unrecognizedTags
1007
+ areAllTagsPresent: l.areAllTagsPresent,
1008
+ totalTags: l.totalTags,
1009
+ tagCounts: l.tagCounts,
1010
+ uniqueTags: l.uniqueTags,
1011
+ recognizedTags: l.recognizedTags,
1012
+ unrecognizedTags: l.unrecognizedTags
651
1013
  };
652
- }, A = (t = {}) => {
1014
+ }, x = (t = {}) => {
653
1015
  const e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
654
- return C(e);
1016
+ return N(e);
655
1017
  };
656
- W({
657
- inFuncDefinition: A,
658
- inReviewSpec: qt
1018
+ ze({
1019
+ inFuncDefinition: x,
1020
+ inReviewSpec: Dn
659
1021
  });
660
- const Bt = ({
1022
+ const Vn = ({
661
1023
  inTargetHtmlId: t,
662
1024
  inColumns: e,
663
- type: l,
1025
+ type: n,
664
1026
  inData: o,
665
- showLog: n
1027
+ showLog: s
666
1028
  } = {}) => {
667
- const r = t, a = o ?? [], i = e;
668
- console.log("buildSpec 1 :", r, a.localColumns);
669
- let c = y({
670
- type: l,
671
- data: a,
672
- columns: i
673
- }), f = c;
674
- !("tagName" in c) && "children" in c && (f = c.children);
675
- const s = A(f);
676
- return console.log("buildSpec 3 :", s), s;
677
- }, Pt = ({
1029
+ const l = t, r = o ?? [], a = e;
1030
+ s && console.log("buildSpec 1 :", l, r.localColumns);
1031
+ let u = C({
1032
+ type: n,
1033
+ data: r,
1034
+ columns: a
1035
+ });
1036
+ const c = x(u);
1037
+ return console.log("buildSpec 2 :", u, c), s && console.log("buildSpec 3 :", c), c;
1038
+ }, Bn = ({
678
1039
  type: t = "table",
679
1040
  targetHtmlId: e,
680
- data: l,
1041
+ data: n,
681
1042
  classToApply: o,
682
- columns: n,
683
- appendPosition: r,
684
- showLog: a = !1
1043
+ columns: s,
1044
+ appendPosition: l,
1045
+ showLog: r = !1
685
1046
  } = {}) => {
686
- const i = t, c = e, f = l, s = n;
687
- console.log("showLog 1 :", i, e, l, o, n, r);
688
- const u = Bt({
689
- inTargetHtmlId: c,
690
- inColumns: s,
691
- showLog: a,
692
- inData: f,
693
- type: i
1047
+ const a = t, d = e, u = n, c = s;
1048
+ r && console.log("showLog 1 :", a, e, n, o, s, l);
1049
+ const i = Vn({
1050
+ inTargetHtmlId: d,
1051
+ inColumns: c,
1052
+ showLog: r,
1053
+ inData: u,
1054
+ type: a
694
1055
  });
695
- console.log("showLog 2 :", u);
696
- const d = document.getElementById(c);
697
- return console.log("showLog 3 :", d), r === "prepend" ? d.prepend(u) : (d && (d.innerHTML = ""), console.log("showLog 4:1 :", u instanceof Node), console.log("showLog 4:2 :", u instanceof NodeList), console.log("showLog 4:3 :", u instanceof HTMLCollection), u != null && typeof u[Symbol.iterator] == "function" ? d.append(...u) : d.append(u)), console.log("showLog 5 :", d), d;
1056
+ r && console.log("showLog 2 :", i);
1057
+ const m = document.getElementById(d);
1058
+ return r && console.log("showLog 3 :", m), Array.isArray(i) || i instanceof NodeList || i instanceof HTMLCollection ? l === "prepend" ? m.prepend(...i) : m.append(...i) : l === "prepend" ? m.prepend(i) : (m && (m.innerHTML = ""), m.append(i)), r && console.log("showLog 5 :", m), m;
698
1059
  };
699
- j(Pt);
1060
+ S(Bn);
700
1061
  export {
701
- Pt as default
1062
+ Bn as default
702
1063
  };