json-renderers 1.17.3 → 1.18.4

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.
@@ -1,868 +1,274 @@
1
- const V = {
1
+ const q = {
2
2
  version: "v17.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
- }, D = (t) => {
5
- const e = t;
6
- if (typeof globalThis > "u" || !e) return;
4
+ }, _ = (e) => {
5
+ const t = e;
6
+ if (typeof globalThis > "u" || !t) return;
7
7
  globalThis.ks ?? (globalThis.ks = {});
8
- const o = typeof e == "function" ? e : e.render, n = typeof e == "object" ? e.getSpec : void 0;
8
+ const o = typeof t == "function" ? t : t.render, n = typeof t == "object" ? t.getSpec : void 0;
9
9
  globalThis.ks.jsonRenderers = {
10
- meta: V,
11
- ...typeof e == "object" ? e : {},
10
+ meta: q,
11
+ ...typeof t == "object" ? t : {},
12
12
  render: o,
13
13
  renderToDom: o,
14
- domMount: e == null ? void 0 : e.renderToDom,
14
+ domMount: t == null ? void 0 : t.renderToDom,
15
15
  ...n ? { getSpec: n } : {}
16
16
  };
17
- }, W = "table", G = "", K = [], M = [], q = "", z = "replace", _ = !1, f = {
18
- type: W,
19
- targetHtmlId: G,
20
- data: K,
21
- columns: M,
22
- classToApply: q,
23
- appendPosition: z,
24
- showLog: _
25
- }, X = ({ inConfig: t } = {}) => {
26
- const e = t;
27
- if (!e || typeof e != "object")
17
+ }, J = "table", Y = "", U = [], X = [], Q = "", W = "replace", Z = !1, b = {
18
+ type: J,
19
+ targetHtmlId: Y,
20
+ data: U,
21
+ columns: X,
22
+ classToApply: Q,
23
+ appendPosition: W,
24
+ showLog: Z
25
+ }, tt = ({ inConfig: e } = {}) => {
26
+ const t = e;
27
+ if (!t || typeof t != "object")
28
28
  throw console.error("Config must be an object"), new TypeError("Config must be an object");
29
- for (const o of Object.keys(f)) {
30
- if (!(o in e) || e[o] === void 0)
29
+ for (const o of Object.keys(b)) {
30
+ if (!(o in t) || t[o] === void 0)
31
31
  throw console.error(`Missing compulsory key: "${o}"`), new Error(`Missing compulsory key: "${o}"`);
32
- if (Array.isArray(f[o])) {
33
- if (!Array.isArray(e[o]))
32
+ if (Array.isArray(b[o])) {
33
+ if (!Array.isArray(t[o]))
34
34
  throw console.error(`${o} must be an Array`), new TypeError(`${o} must be an Array`);
35
- } else if (typeof e[o] != typeof f[o])
36
- throw console.error(`${o} must be of type ${typeof f[o]}`), new TypeError(`${o} must be of type ${typeof f[o]}`);
35
+ } else if (typeof t[o] != typeof b[o])
36
+ throw console.error(`${o} must be of type ${typeof b[o]}`), new TypeError(`${o} must be of type ${typeof b[o]}`);
37
37
  }
38
- if (typeof e.targetHtmlId == "string" && !e.targetHtmlId.trim())
38
+ if (typeof t.targetHtmlId == "string" && !t.targetHtmlId.trim())
39
39
  throw console.error("targetHtmlId must be a non-empty string"), new TypeError("targetHtmlId must be a non-empty string");
40
40
  return !0;
41
- }, T = ({
42
- type: t = "table",
43
- targetHtmlId: e,
41
+ }, O = ({
42
+ type: e = "table",
43
+ targetHtmlId: t,
44
44
  data: o,
45
45
  columns: n,
46
- classToApply: r = "",
47
- appendPosition: s = "replace",
48
- showLog: l = !1
46
+ classToApply: l = "",
47
+ appendPosition: r = "replace",
48
+ showLog: s = !1
49
49
  } = {}) => {
50
- const A = {
51
- type: t,
52
- targetHtmlId: e,
50
+ const y = {
51
+ type: e,
52
+ targetHtmlId: t,
53
53
  data: o,
54
54
  columns: n,
55
- classToApply: r,
56
- appendPosition: s,
57
- showLog: l
55
+ classToApply: l,
56
+ appendPosition: r,
57
+ showLog: s
58
58
  };
59
- return X({ inConfig: A }), A;
60
- }, S = () => ({ ...f });
61
- Object.assign(S, f);
62
- const Y = {
63
- version: "v11.0.0",
64
- description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
65
- }, Q = (t) => {
66
- const e = t;
67
- if (typeof globalThis > "u" || !e) return;
59
+ return tt({ inConfig: y }), y;
60
+ }, P = () => ({ ...b });
61
+ Object.assign(P, b);
62
+ const et = {
63
+ version: "1.15.0",
64
+ name: "json-renderers-build"
65
+ }, ot = (e) => {
66
+ const t = e;
67
+ if (typeof globalThis > "u" || !t) return;
68
68
  globalThis.ks ?? (globalThis.ks = {});
69
- const o = typeof e == "function" ? e : e.render, n = typeof e == "object" ? e.getSpec : void 0;
69
+ const o = typeof t == "function" ? t : t.render, n = typeof t == "object" ? t.getSpec : void 0;
70
70
  globalThis.ks.jsonRenderersBuild = {
71
- meta: Y,
71
+ meta: et,
72
72
  renderToDom: o,
73
73
  render: o,
74
74
  ...n ? { getSpec: n } : {},
75
- ...typeof e == "object" ? e : {}
75
+ ...typeof t == "object" ? t : {}
76
76
  };
77
- }, g = ["table", "select", "selectOptionsOnly", "tableFromSpec"], Z = ({ inConfig: t } = {}) => {
78
- const e = t;
79
- if (!e || typeof e != "object")
77
+ }, N = ["table", "tableFromSpec", "select", "selectOptionsOnly", "dataList", "datalist"], nt = ["table", "tableFromSpec"], F = ({ inConfig: e } = {}) => {
78
+ const t = e;
79
+ if (!t || typeof t != "object")
80
80
  throw console.error("Config must be an object"), new TypeError("Config must be an object");
81
- if (typeof e.type != "string" || !g.includes(e.type))
82
- throw console.error(`type must be one of: ${g.join(", ")}`), new Error(`type must be one of: ${g.join(", ")}`);
83
- if (!Array.isArray(e.data))
84
- throw console.error("data must be an Array"), new TypeError("data must be an Array");
85
- if (!Array.isArray(e.columns))
86
- throw console.error("columns must be an array"), new TypeError("columns must be an array");
87
- if (e.showLog !== void 0 && typeof e.showLog != "boolean")
81
+ if (typeof t.type != "string" || !N.includes(t.type))
82
+ throw console.error(`type must be one of: ${N.join(", ")}`), new Error(`type must be one of: ${N.join(", ")}`);
83
+ if (t.showLog !== void 0 && typeof t.showLog != "boolean")
88
84
  throw console.error("showLog must be a boolean"), new TypeError("showLog must be a boolean");
89
- return !0;
90
- }, tt = "table", et = {
91
- class: "table table-hover table-striped mb-0"
92
- }, ot = [], nt = {
93
- tagName: tt,
94
- attributes: et,
95
- children: ot
96
- }, rt = "thead", st = [], lt = {
97
- tagName: rt,
98
- children: st
99
- }, at = "tr", ct = [], it = {
100
- tagName: at,
101
- children: ct
102
- }, ut = "th", dt = {
103
- value: ""
104
- }, bt = "", ft = {
105
- tagName: ut,
106
- attributes: dt,
107
- textContent: bt
108
- }, ht = ({ inColumn: t } = {}) => {
109
- const e = structuredClone(ft);
110
- return e.attributes.value = t, e.textContent = t, e;
111
- }, mt = ({ inColumns: t = [] } = {}) => {
112
- const e = structuredClone(it), o = t.map((n) => ht({ inColumn: n }));
113
- return e.children = o, e;
114
- }, pt = ({ inColumns: t = [] } = {}) => {
115
- const e = structuredClone(lt), o = [
116
- mt({ inColumns: t })
117
- ];
118
- return e.children = o, e;
119
- }, yt = "tbody", gt = [], wt = {
120
- tagName: yt,
121
- children: gt
122
- }, Ct = "tr", $t = [], At = {
123
- tagName: Ct,
124
- children: $t
125
- }, Nt = "td", xt = {
126
- value: ""
127
- }, Tt = "", St = {
128
- tagName: Nt,
129
- attributes: xt,
130
- textContent: Tt
131
- }, Et = ({ inValue: t } = {}) => {
132
- const e = structuredClone(St);
133
- return e.attributes.value = t, e.textContent = t, e;
134
- }, jt = ({ inRow: t, inColumns: e = [] } = {}) => {
135
- const o = structuredClone(At), n = e.map((r) => {
136
- const s = Array.isArray(t) ? t[r] : t == null ? void 0 : t[r];
137
- return Et({ inValue: s });
138
- });
139
- return o.children = n, o;
140
- }, Ft = ({ inData: t = [], inColumns: e = [] } = {}) => {
141
- const o = structuredClone(wt), n = t.map((r) => jt({
142
- inRow: r,
143
- inColumns: e
144
- }));
145
- return o.children = n, o;
146
- }, Bt = "tfoot", It = {
147
- class: "table-light"
148
- }, kt = [], Ot = {
149
- tagName: Bt,
150
- attributes: It,
151
- children: kt
152
- }, vt = "tr", Pt = {
153
- class: "align-middle"
154
- }, Lt = [], Ht = {
155
- tagName: vt,
156
- attributes: Pt,
157
- children: Lt
158
- }, Rt = "td", Jt = {
159
- class: "align-middle py-2"
160
- }, Ut = [], Vt = {
161
- tagName: Rt,
162
- attributes: Jt,
163
- children: Ut
164
- }, Dt = "input", Wt = {
165
- type: "text",
166
- name: "",
167
- placeholder: "",
168
- class: "form-control form-control-sm"
169
- }, Gt = {
170
- tagName: Dt,
171
- attributes: Wt
172
- }, Kt = ({ inColumn: t } = {}) => {
173
- const e = structuredClone(Vt), o = structuredClone(Gt);
174
- return o.attributes.name = t, o.attributes.placeholder = t, e.children.push(o), e;
175
- }, Mt = ({ inColumns: t = [] } = {}) => {
176
- const e = structuredClone(Ht);
177
- return e.children = t.map((o) => Kt({ inColumn: o })), e;
178
- }, qt = ({ inColumns: t = [] } = {}) => Mt({ inColumns: t }), zt = "tr", _t = {
179
- class: "align-middle"
180
- }, Xt = [], Yt = {
181
- tagName: zt,
182
- attributes: _t,
183
- children: Xt
184
- }, Qt = "td", Zt = {
185
- class: "align-middle py-2"
186
- }, te = [], ee = {
187
- tagName: Qt,
188
- attributes: Zt,
189
- children: te
190
- }, oe = "input", ne = {
191
- type: "text",
192
- name: "",
193
- placeholder: "",
194
- class: "form-control form-control-sm"
195
- }, re = {
196
- tagName: oe,
197
- attributes: ne
198
- }, se = "button", le = {
199
- type: "button",
200
- class: "btn btn-primary btn-sm ms-2"
201
- }, ae = "Save", ce = {
202
- tagName: se,
203
- attributes: le,
204
- textContent: ae
205
- }, ie = ({ inColumn: t, inSave: e = !1 } = {}) => {
206
- const o = structuredClone(ee), n = structuredClone(re);
207
- return n.attributes.name = t, n.attributes.placeholder = t, o.children.push(n), e && o.children.push(structuredClone(ce)), o;
208
- }, ue = ({ inColumns: t = [] } = {}) => {
209
- const e = structuredClone(Yt);
210
- return e.children = t.map((o, n) => ie({
211
- inColumn: o,
212
- inSave: n === t.length - 1
213
- })), e;
214
- }, de = ({ inColumns: t = [] } = {}) => ue({ inColumns: t }), be = "tr", fe = {
215
- class: "fw-semibold align-middle"
216
- }, he = [], me = {
217
- tagName: be,
218
- attributes: fe,
219
- children: he
220
- }, pe = "td", ye = {
221
- class: "align-middle py-2"
222
- }, ge = "", we = {
223
- tagName: pe,
224
- attributes: ye,
225
- textContent: ge
226
- }, Ce = (t, e) => Array.isArray(t) ? t[e] : t == null ? void 0 : t[e], $e = ({ inColumn: t, inIndex: e, inData: o = [] } = {}) => {
227
- const n = structuredClone(we), r = o.map((s) => Ce(s, t)).filter((s) => s != null && String(s).trim() !== "").map(Number).filter(Number.isFinite);
228
- return n.textContent = r.length ? String(r.reduce((s, l) => s + l, 0)) : e === 0 ? "Total" : "", n;
229
- }, Ae = ({ inColumns: t = [], inData: e = [] } = {}) => {
230
- const o = structuredClone(me);
231
- return o.children = t.map(
232
- (n, r) => $e({ inColumn: n, inIndex: r, inData: e })
233
- ), o;
234
- }, Ne = ({ inColumns: t = [], inData: e = [] } = {}) => Ae({ inColumns: t, inData: e }), xe = "tr", Te = {
235
- class: "align-middle"
236
- }, Se = [], Ee = {
237
- tagName: xe,
238
- attributes: Te,
239
- children: Se
240
- }, je = "td", Fe = {
241
- class: "align-middle py-2"
242
- }, Be = {
243
- tagName: je,
244
- attributes: Fe
245
- }, Ie = () => structuredClone(Be), ke = ({ inColumns: t = [] } = {}) => {
246
- const e = structuredClone(Ee);
247
- return e.children = t.map(() => Ie()), e;
248
- }, Oe = ({ inColumns: t = [] } = {}) => ke({ inColumns: t }), N = {
249
- inputs: qt,
250
- inputsWithSave: de,
251
- totals: Ne,
252
- empty: Oe
253
- }, ve = ({ inFooter: t = [], inColumns: e = [], inData: o = [] } = {}) => {
254
- const n = structuredClone(Ot);
255
- return n.children = t.map((r) => {
256
- if (!Object.hasOwn(N, r))
257
- throw new Error(`Unknown footer "${r}".`);
258
- return N[r]({ inColumns: e, inData: o });
259
- }), n;
260
- }, Pe = ({
261
- inColumns: t = [],
262
- inData: e = [],
263
- inFooter: o = []
264
- } = {}) => {
265
- const n = structuredClone(nt), r = [
266
- pt({ inColumns: t }),
267
- Ft({ inData: e, inColumns: t })
268
- ];
269
- if (!Array.isArray(o))
270
- throw new TypeError("The footer property must be an array of footer names.");
271
- return o.length > 0 && r.push(ve({
272
- inFooter: o,
273
- inColumns: t,
274
- inData: e
275
- })), n.children = r, n;
276
- }, Le = (t) => {
277
- const [e, o] = t.children;
278
- e.children[0].children.unshift({
279
- tagName: "th",
280
- textContent: "#"
281
- }), o.children.forEach((n, r) => {
282
- n.children.unshift({
283
- tagName: "td",
284
- textContent: String(r + 1)
285
- });
286
- });
287
- }, He = (t) => t === !0 ? [{ label: "Apply", type: "button" }] : Array.isArray(t) ? t : [], Re = (t, e) => {
288
- const o = He(e);
289
- if (o.length === 0) return;
290
- const [n, r] = t.children;
291
- n.children[0].children.push({
292
- tagName: "th",
293
- textContent: "Actions"
294
- }), r.children.forEach((s) => {
295
- s.children.push({
296
- tagName: "td",
297
- children: o.map((l) => ({
298
- tagName: "button",
299
- attributes: { type: l.type || "button" },
300
- textContent: l.label
301
- }))
302
- });
303
- });
304
- }, Je = (t, e = {}) => (e.showSerial && Le(t), e.showOptions && Re(t, e.showOptions), t), Ue = {
305
- type: "table",
306
- data: [
307
- {
308
- itemName: "0.09/30mm",
309
- baseUnit: "kgs"
310
- }
311
- ],
312
- columns: [
313
- "itemName",
314
- "baseUnit"
315
- ],
316
- options: {}
317
- }, Ve = {
318
- type: "table",
319
- data: [
320
- {
321
- itemName: "0.09/30mm",
322
- baseUnit: "kgs"
323
- }
324
- ],
325
- columns: [
326
- "itemName",
327
- "baseUnit"
328
- ],
329
- options: {
330
- showSerial: !0
331
- }
332
- }, De = {
333
- type: "table",
334
- data: [
335
- {
336
- itemName: "0.09/30mm",
337
- baseUnit: "kgs"
85
+ if (!Array.isArray(t.data))
86
+ throw console.error("data must be an Array"), new TypeError("data must be an Array");
87
+ if (nt.includes(t.type)) {
88
+ if (!Array.isArray(t.columns))
89
+ throw console.error("columns must be an array for table rendering"), new TypeError("columns must be an array for table rendering");
90
+ for (let o = 0; o < t.columns.length; o++) {
91
+ const n = t.columns[o];
92
+ if (!n || typeof n != "object")
93
+ throw console.error(`columns[${o}] must be an object`), new TypeError(`columns[${o}] must be an object`);
94
+ if (typeof n.columnName != "string" || !n.columnName.trim())
95
+ throw console.error(`columns[${o}].columnName must be a non-empty string`), new TypeError(`columns[${o}].columnName must be a non-empty string`);
338
96
  }
339
- ],
340
- columns: [
341
- "itemName",
342
- "baseUnit"
343
- ],
344
- options: {
345
- showOptions: !0
346
- }
347
- }, We = {
348
- type: "table",
349
- data: [
350
- {
351
- itemName: "0.09/30mm",
352
- baseUnit: "kgs"
97
+ for (let o = 0; o < t.data.length; o++) {
98
+ const n = t.data[o];
99
+ if (!n || typeof n != "object")
100
+ throw console.error(`data[${o}] must be an object`), new TypeError(`data[${o}] must be an object`);
353
101
  }
354
- ],
355
- columns: [
356
- "itemName",
357
- "baseUnit"
358
- ],
359
- options: {
360
- showOptions: [
361
- {
362
- label: "Show",
363
- type: "button"
364
- },
365
- {
366
- label: "Edit",
367
- type: "button"
102
+ if (t.columns.length > 0 && t.data.length > 0) {
103
+ const o = t.columns.map((r) => r.columnName), n = Object.keys(t.data[0]);
104
+ if (!o.some((r) => n.includes(r))) {
105
+ const r = `Data alignment error: None of the columns [${o.join(", ")}] match any keys in data rows [${n.join(", ")}]`;
106
+ throw console.error(r), new Error(r);
368
107
  }
369
- ]
370
- }
371
- }, Ge = {
372
- type: "table",
373
- data: [
374
- {
375
- itemName: "0.09/30mm",
376
- baseUnit: "kgs"
377
108
  }
378
- ],
379
- columns: [
380
- "itemName",
381
- "baseUnit"
382
- ],
383
- options: {
384
- showSerial: !0,
385
- showOptions: [
386
- {
387
- label: "Show",
388
- type: "button"
389
- }
390
- ]
391
109
  }
392
- }, Ke = {
393
- type: "table",
394
- data: [
395
- {
396
- itemName: "0.09/30mm",
397
- baseUnit: "kgs"
398
- }
399
- ],
400
- columns: [
401
- "itemName",
402
- "baseUnit"
403
- ],
404
- footer: [
405
- "inputs"
406
- ],
407
- options: {}
408
- }, Me = {
409
- type: "table",
410
- data: [
411
- {
412
- itemName: "0.09/30mm",
413
- baseUnit: "kgs"
414
- }
415
- ],
416
- columns: [
417
- "itemName",
418
- "baseUnit"
419
- ],
420
- footer: [
421
- "inputsWithSave"
422
- ],
423
- options: {}
424
- }, qe = {
425
- type: "table",
426
- data: [
427
- {
428
- itemName: "0.09/30mm",
429
- baseUnit: "2"
430
- },
431
- {
432
- itemName: "0.11-25",
433
- baseUnit: "3"
434
- }
435
- ],
436
- columns: [
437
- "itemName",
438
- "baseUnit"
439
- ],
440
- footer: [
441
- "totals"
442
- ],
443
- options: {}
444
- }, ze = {
445
- type: "table",
446
- data: [
447
- {
448
- itemName: "0.09/30mm",
449
- baseUnit: "2"
450
- }
451
- ],
452
- columns: [
453
- "itemName",
454
- "baseUnit"
455
- ],
456
- footer: [
457
- "inputs",
458
- "totals",
459
- "inputsWithSave",
460
- "empty"
461
- ],
462
- options: {}
463
- }, _e = {
464
- type: "tableHead",
465
- data: [],
466
- columns: [
467
- "itemName",
468
- "baseUnit"
469
- ],
470
- options: {}
471
- }, Xe = {
472
- type: "tableBody",
473
- data: [
474
- {
475
- itemName: "0.09/30mm",
476
- baseUnit: "kgs"
477
- }
478
- ],
479
- columns: [
480
- "itemName",
481
- "baseUnit"
482
- ],
483
- options: {}
484
- }, Ye = {
485
- table: Ue,
486
- tableWithSerial: Ve,
487
- tableWithDefaultAction: De,
488
- tableWithCustomActions: We,
489
- tableWithSerialAndActions: Ge,
490
- tableWithFooter: Ke,
491
- tableWithFooterSave: Me,
492
- tableWithTotals: qe,
493
- tableWithMultipleFooters: ze,
494
- tableHead: _e,
495
- tableBody: Xe
496
- }, E = ({
497
- type: t = "table",
498
- inData: e,
499
- inColumns: o,
500
- footer: n = [],
501
- options: r = {}
502
- } = {}) => {
503
- if (t === "table") {
504
- const s = Pe({
505
- inColumns: o,
506
- inData: e,
507
- inFooter: n
508
- });
509
- return Je(s, r);
110
+ return !0;
111
+ }, rt = "table", lt = [], at = [], st = {}, ct = !1, h = {
112
+ type: rt,
113
+ columns: lt,
114
+ data: at,
115
+ options: st,
116
+ showLog: ct
117
+ }, it = [
118
+ {
119
+ columnName: "Name",
120
+ width: "150px"
121
+ },
122
+ {
123
+ columnName: "Designation",
124
+ width: "100px"
510
125
  }
511
- throw new Error(`Unknown table renderer type "${t}".`);
512
- };
513
- E.requests = Ye;
514
- const j = ({ inItems: t, inRecipe: e, inExecute: o }) => {
515
- const n = t, r = e, s = o;
516
- return n.map((l) => C({
517
- inSource: l,
518
- inRecipe: r,
519
- inExecute: s
520
- })).flat(1 / 0).filter(Boolean);
521
- }, Qe = ({ inSource: t, inRecipe: e, inExecute: o }) => {
522
- const n = t, r = e, s = o;
523
- let l = n;
524
- typeof s == "function" && (l = s({
525
- inSource: n,
526
- inRecipe: r
527
- }));
528
- for (const [a, c] of Object.entries(l))
529
- Array.isArray(c) && r && a in r && (l[a] = j({
530
- inItems: c,
531
- inRecipe: r[a],
532
- inExecute: s
533
- }));
534
- return l;
535
- }, C = ({ inSource: t, inRecipe: e, inExecute: o }) => {
536
- const n = t, r = e, s = o;
537
- return Array.isArray(n) ? j({
538
- inItems: n,
539
- inRecipe: r,
540
- inExecute: s
541
- }) : typeof n == "object" && n !== null ? Qe({
542
- inSource: n,
543
- inRecipe: r,
544
- inExecute: s
545
- }) : n;
546
- }, Ze = ({ inKey: t, inDirective: e }) => {
547
- const o = t, n = e;
548
- return (n == null ? void 0 : n.alterKey) || o;
549
- }, to = ({ inValue: t, inDirective: e, inExecute: o }) => {
550
- const n = t, r = e, s = o;
551
- return r && "transform" in r ? C({
552
- inSource: n,
553
- inRecipe: r,
554
- inExecute: s
555
- }) : n;
556
- }, eo = ({ inValue: t, inDirective: e }) => {
557
- const o = t, n = e;
558
- return (n == null ? void 0 : n.valueType) === "array" && !Array.isArray(o) ? [o] : o;
559
- }, oo = ({ inValue: t, inDirective: e }) => {
560
- const o = t, n = e;
561
- return n != null && n.valueKey && o && typeof o == "object" ? o[n.valueKey] : o;
562
- }, no = ({ inSource: t, inTransform: e, inExecute: o }) => {
563
- const n = t, r = e, s = o, l = {};
564
- for (const [a, c] of Object.entries(n)) {
565
- if (!(a in r))
566
- continue;
567
- const i = r[a], u = Ze({ inKey: a, inDirective: i });
568
- let b = c;
569
- b = to({
570
- inValue: b,
571
- inDirective: i,
572
- inExecute: s
573
- }), b = eo({ inValue: b, inDirective: i }), b = oo({ inValue: b, inDirective: i }), l[u] = b;
126
+ ], ut = [
127
+ {
128
+ Name: "Keshav",
129
+ Designation: "Founder"
574
130
  }
575
- return l;
131
+ ], dt = {
132
+ columns: it,
133
+ data: ut
134
+ }, f = {
135
+ ...h,
136
+ ...dt
137
+ }, x = ({
138
+ type: e = f.type,
139
+ data: t = f.data,
140
+ columns: o = f.columns,
141
+ options: n = f.options,
142
+ showLog: l = f.showLog
143
+ } = {}) => {
144
+ const a = {
145
+ type: e,
146
+ data: t,
147
+ columns: o,
148
+ options: n,
149
+ showLog: l
150
+ };
151
+ return F({ inConfig: a }), a;
576
152
  };
577
- function F(t, e) {
578
- for (const o in t)
579
- typeof t[o] == "object" && t[o] !== null ? F(t[o], e) : typeof t[o] == "string" && t[o] === "${}" && (t[o] = e);
580
- return t;
581
- }
582
- const ro = ({ inSource: t, inOperation: e, inExecute: o }) => {
583
- const n = t, r = e;
584
- for (const [s, l] of Object.entries(r))
585
- if ("operationType" in l && l.operationType === "loopArray" && s in n) {
586
- const a = n[s].map((c) => {
587
- const i = structuredClone(l == null ? void 0 : l.template);
588
- return F(i, c), i;
589
- });
590
- n[s] = a;
591
- }
592
- return n;
593
- }, so = ({ inSource: t, inTemplate: e }) => {
594
- const o = t;
595
- let n = [];
596
- for (const [r, s] of Object.entries(o)) {
597
- const l = structuredClone(e);
598
- l.textContent = s, n.push(l);
599
- }
600
- return n;
601
- }, lo = ({ inSource: t, inBuild: e, inExecute: o }) => {
602
- const n = structuredClone(t), r = structuredClone(e);
603
- for (const [s, l] of Object.entries(r)) {
604
- const a = so({
605
- inSource: n[s],
606
- inTemplate: l
607
- });
608
- n[s] = a;
609
- }
610
- return n;
611
- }, ao = ({ inSource: t, inTemplate: e }) => t.map((n) => {
612
- const r = structuredClone(e == null ? void 0 : e.row), s = co({
613
- inSource: n,
614
- inTemplate: e == null ? void 0 : e.cell
615
- });
616
- return r.children = s, r;
617
- }), co = ({ inSource: t, inTemplate: e }) => {
618
- const o = t;
619
- let n = [];
620
- for (const [r, s] of Object.entries(o)) {
621
- const l = structuredClone(e);
622
- l.textContent = s, n.push(l);
623
- }
624
- return n;
625
- }, io = ({ inSource: t, inBuild: e, inExecute: o }) => {
626
- const n = structuredClone(t), r = structuredClone(e);
627
- for (const [s, l] of Object.entries(r)) {
628
- const a = ao({
629
- inSource: n[s],
630
- inTemplate: l
631
- });
632
- n[s] = a;
633
- }
634
- return n;
635
- }, uo = ({ inSource: t, inTemplate: e }) => t.map((r) => {
636
- const s = structuredClone(e);
637
- return s.textContent = r == null ? void 0 : r.columnName, s;
638
- }), bo = ({ inSource: t, inBuild: e, inExecute: o }) => {
639
- const n = structuredClone(t), r = structuredClone(e);
640
- for (const [s, l] of Object.entries(r)) {
641
- const a = uo({
642
- inSource: n[s],
643
- inTemplate: l == null ? void 0 : l.cell
644
- });
645
- n[s] = l == null ? void 0 : l.row, n[s].children = a;
646
- }
647
- return n;
648
- }, fo = ({ inSource: t, inTemplate: e }) => t.map((n) => {
649
- const r = structuredClone(e == null ? void 0 : e.row), s = ho({
650
- inSource: n,
651
- inTemplate: e == null ? void 0 : e.cell
652
- });
653
- return r.children = s, r;
654
- }), ho = ({ inSource: t, inTemplate: e }) => {
655
- const o = t;
656
- let n = [];
657
- for (const [r, s] of Object.entries(o)) {
658
- const l = structuredClone(e);
659
- l.textContent = s, n.push(l);
660
- }
661
- return n;
662
- }, mo = ({ inSource: t, inBuild: e, inExecute: o }) => {
663
- const n = structuredClone(t), r = structuredClone(e);
664
- for (const [s, l] of Object.entries(r)) {
665
- const a = fo({
666
- inSource: n[s],
667
- inTemplate: l
668
- });
669
- n[s] = l == null ? void 0 : l.body, n[s].children = a;
670
- }
671
- return n;
672
- }, po = ({ inSource: t, inTemplate: e }) => t.map((n) => {
673
- const r = structuredClone(e == null ? void 0 : e.row), s = yo({
674
- inSource: n,
675
- inTemplate: e == null ? void 0 : e.cell
676
- });
677
- return r.children = s, r;
678
- }), yo = ({ inSource: t, inTemplate: e }) => {
679
- const o = t;
680
- let n = [];
681
- for (const [r, s] of Object.entries(o)) {
682
- const l = structuredClone(e);
683
- l.textContent = s, n.push(l);
684
- }
685
- return n;
686
- }, go = ({ inSource: t, inBuild: e, inExecute: o }) => {
687
- const n = structuredClone(t), r = structuredClone(e);
688
- for (const [s, l] of Object.entries(r)) {
689
- const a = po({
690
- inSource: n[s],
691
- inTemplate: l
692
- });
693
- n[s] = l == null ? void 0 : l.body, n[s].children = a;
694
- }
695
- return n;
696
- }, wo = ({ inSource: t, inTransform: e, inExecute: o }) => {
697
- const n = e, r = {};
698
- for (let [s, l] of Object.entries(n))
699
- console.log("aaaaaaaaa : ", s);
700
- return r;
701
- }, d = ({ inSource: t, inRecipe: e }) => {
702
- let o = t;
703
- const n = e;
704
- return n && typeof n == "object" && "transform" in n && (o = no({
705
- inSource: o,
706
- inTransform: n.transform,
707
- inExecute: d
708
- })), n && typeof n == "object" && "operation" in n && (o = ro({
709
- inSource: o,
710
- inOperation: n.operation,
711
- inExecute: d
712
- })), n && typeof n == "object" && "build" in n && (o = lo({
713
- inSource: o,
714
- inBuild: n == null ? void 0 : n.build,
715
- inExecute: d
716
- })), n && typeof n == "object" && "buildCollection" in n && (o = io({
717
- inSource: o,
718
- inBuild: n == null ? void 0 : n.buildCollection,
719
- inExecute: d
720
- })), n && typeof n == "object" && "buildArray" in n && (o = bo({
721
- inSource: o,
722
- inBuild: n == null ? void 0 : n.buildArray,
723
- inExecute: d
724
- })), n && typeof n == "object" && "buildBody" in n && (o = mo({
725
- inSource: o,
726
- inBuild: n == null ? void 0 : n.buildBody,
727
- inExecute: d
728
- })), n && typeof n == "object" && "objectToArray" in n && (o = go({
729
- inSource: o,
730
- inBuild: n == null ? void 0 : n.objectToArray,
731
- inExecute: d
732
- })), n && typeof n == "object" && "spec" in n && (o = wo({
733
- inSource: o,
734
- inTransform: n == null ? void 0 : n.spec,
735
- inExecute: d
736
- })), o;
737
- }, Co = (t, e) => C({
738
- inSource: t,
739
- inRecipe: e,
740
- inExecute: d
741
- }), $o = {
742
- children: ""
743
- }, Ao = {
744
- children: {
745
- operationType: "loopArray",
746
- template: {
747
- tagName: "option",
748
- attributes: {
749
- value: "${}"
750
- },
751
- textContent: "${}"
752
- }
753
- }
754
- }, No = {
755
- transform: $o,
756
- operation: Ao
757
- }, B = ({
758
- inData: t
759
- }) => {
760
- let o = Co({
761
- children: t
762
- }, No);
763
- return o == null ? void 0 : o.children;
764
- }, xo = "select", To = {
765
- id: "LedgerName"
766
- }, So = [], Eo = {
767
- tagName: xo,
768
- attributes: To,
769
- children: So
770
- }, jo = ({
771
- inData: t
772
- }) => {
773
- let o = B({
774
- inData: t
775
- });
776
- const n = structuredClone(Eo);
777
- return n.children = o, n;
778
- }, Fo = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Bo = (t, e) => {
779
- if (!Fo(t)) return;
153
+ Object.assign(x, f);
154
+ x.toJSON = () => structuredClone(f);
155
+ const pt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ft = (e, t) => {
156
+ if (!pt(e)) return;
780
157
  let o = {};
781
- for (const [n, r] of Object.entries(t))
782
- o[n] = $(r, e);
158
+ for (const [n, l] of Object.entries(e))
159
+ o[n] = g(t, l);
783
160
  return o;
784
- }, Io = (t, e) => {
785
- const o = structuredClone(t);
786
- return Array.isArray(o) ? o.map((r) => $(r, e)) : void 0;
787
- }, I = (t, e) => t.replace(/\$\{(\w+)\}/g, (o, n) => e[n] !== void 0 ? e[n] : o), ko = (t, e) => I(t, e), $ = (t, e) => {
788
- const o = structuredClone(t);
789
- return typeof o == "string" ? I(o, e) : (o === null || typeof o != "object" || ("textContent" in o && (o.textContent = ko(o == null ? void 0 : o.textContent, e)), "attributes" in o && (o.attributes = Bo(o == null ? void 0 : o.attributes, e)), "children" in o && (o.children = Io(o == null ? void 0 : o.children, e))), o);
790
- }, Oo = (t, e) => {
791
- const o = t, n = e;
792
- return o.map((r) => $(n, r));
793
- }, k = (t, e, o) => {
794
- const n = o, r = e;
795
- let s = [];
796
- return n.map((l) => {
797
- let a = structuredClone(t);
798
- a.textContent = r[l.columnName], s.push(a);
799
- }), s;
800
- }, O = (t, e, o) => {
801
- t.forEach((n, r) => {
802
- const s = e == null ? void 0 : e.data[r], l = k(o, s, e == null ? void 0 : e.columns);
803
- n.children = l;
804
- });
805
- }, vo = (t, e) => {
806
- const o = structuredClone(e);
807
- o.attributes.width = "50px", t.unshift(o);
808
- }, Po = (t, e) => {
809
- const o = structuredClone(e);
810
- o.textContent = "#", t.unshift(o);
811
- }, Lo = (t, e) => {
812
- t.forEach((o, n) => {
813
- const r = structuredClone(e);
814
- r.textContent = n + 1, o.children.unshift(r);
815
- });
816
- }, Ho = (t, e) => {
817
- const o = structuredClone(e);
818
- delete o.children, t.unshift(o);
819
- }, Ro = (t, e) => {
820
- vo(t == null ? void 0 : t.children[0].children, e == null ? void 0 : e.buildColGroup), Po(t == null ? void 0 : t.children[1].children[0].children, e == null ? void 0 : e.buildHeader), Lo(t == null ? void 0 : t.children[2].children, e == null ? void 0 : e.buildBodyCell), Ho(t == null ? void 0 : t.children[3].children[0].children, e == null ? void 0 : e.buildFooter);
821
- }, Jo = (t, e) => {
822
- const o = structuredClone(e);
823
- o.attributes.width = "100px", t.push(o);
824
- }, Uo = (t, e) => {
161
+ }, bt = (e, t) => {
825
162
  const o = structuredClone(e);
826
- o.textContent = "options", t.push(o);
827
- }, Vo = (t, e) => {
828
- t.forEach((o, n) => {
829
- const r = structuredClone(e);
830
- r.textContent = "show", o.children.push(r);
163
+ return Array.isArray(o) ? o.map((l) => g(t, l)) : void 0;
164
+ }, k = (e, t, o) => {
165
+ if (e === "${agg:count}" && "rowData" in t) {
166
+ if (Array.isArray(t == null ? void 0 : t.rowData))
167
+ return t == null ? void 0 : t.rowData.length;
168
+ } else
169
+ return e === "${rowValue}" && "rowData" in t ? t == null ? void 0 : t.rowData : e.replace(/\$\{(\w+)\}/g, (n, l) => t[l] !== void 0 ? t[l] : n);
170
+ }, ht = (e, t) => k(e, t), mt = (e, t, o) => {
171
+ if (t == null)
172
+ throw new TypeError("inTemplate is required");
173
+ if (typeof t != "object" && typeof t != "string")
174
+ throw new TypeError("inTemplate must be an object or string");
175
+ if (!e || typeof e != "object" || Array.isArray(e))
176
+ throw new TypeError("inElement must be an object");
177
+ return !0;
178
+ }, g = (e, t, o) => {
179
+ const n = e, l = t;
180
+ mt(n, l);
181
+ const r = structuredClone(l);
182
+ return typeof r == "string" ? k(r, n) : (r === null || typeof r != "object" || ("textContent" in r && (r.textContent = ht(r == null ? void 0 : r.textContent, n)), "attributes" in r && (r.attributes = ft(r == null ? void 0 : r.attributes, n)), "children" in r && (r.children = bt(r == null ? void 0 : r.children, n))), r);
183
+ }, wt = (e, t) => {
184
+ if (!Array.isArray(e))
185
+ throw new TypeError("inSource must be an Array");
186
+ if (e.length === 0)
187
+ throw new Error("inSource cannot be empty");
188
+ for (let o = 0; o < e.length; o++)
189
+ if (!e[o] || typeof e[o] != "object")
190
+ throw new TypeError(`inSource[${o}] must be an object`);
191
+ if (!t || typeof t != "object" && typeof t != "string")
192
+ throw new TypeError("inTemplate must be an object or string");
193
+ return !0;
194
+ }, C = (e, t) => {
195
+ const o = e, n = t;
196
+ return wt(o, n), o.map((l) => g(l, n));
197
+ }, gt = (e, t) => e.map((n) => ({
198
+ ...n,
199
+ rowData: t[n.columnName]
200
+ })), yt = (e, t, o) => {
201
+ var l, r, s, c, i, u;
202
+ if (!Array.isArray(e))
203
+ throw new TypeError("inColumns must be an Array");
204
+ if (e.length === 0)
205
+ throw new Error("inColumns cannot be empty");
206
+ for (let a = 0; a < e.length; a++) {
207
+ const d = e[a];
208
+ if (!d || typeof d != "object")
209
+ throw new TypeError(`inColumns[${a}] must be an object`);
210
+ if (typeof d.columnName != "string" || !d.columnName.trim())
211
+ throw new TypeError(`inColumns[${a}].columnName must be a non-empty string`);
212
+ }
213
+ if (!Array.isArray(t))
214
+ throw new TypeError("inData must be an Array");
215
+ for (let a = 0; a < t.length; a++) {
216
+ const d = t[a];
217
+ if (!d || typeof d != "object")
218
+ throw new TypeError(`inData[${a}] must be an object`);
219
+ }
220
+ if (!o || typeof o != "object" || Array.isArray(o))
221
+ throw new TypeError("inSpec must be an object");
222
+ const n = ((s = (r = (l = e[0]) == null ? void 0 : l.template) == null ? void 0 : r.body) == null ? void 0 : s.tr) || "buildBodyTr";
223
+ if (!(n in o))
224
+ throw new Error(`Row template "${n}" not found in inSpec`);
225
+ for (let a = 0; a < e.length; a++) {
226
+ const d = e[a], p = ((i = (c = d.template) == null ? void 0 : c.body) == null ? void 0 : i.cell) || ((u = d.template) == null ? void 0 : u.bodyCell) || "buildBodyCell";
227
+ if (!(p in o))
228
+ throw new Error(`Cell template "${p}" for column "${d.columnName}" not found in inSpec`);
229
+ }
230
+ return !0;
231
+ }, Tt = (e, t) => e.map((n) => {
232
+ var c, i, u;
233
+ const l = ((i = (c = n.template) == null ? void 0 : c.body) == null ? void 0 : i.cell) || ((u = n.template) == null ? void 0 : u.bodyCell) || "buildBodyCell", r = t[l];
234
+ return g(n, r);
235
+ }), Ct = (e, t, o) => {
236
+ var u, a, d;
237
+ yt(e, t, o);
238
+ const n = e, l = t, r = o, s = ((d = (a = (u = n[0]) == null ? void 0 : u.template) == null ? void 0 : a.body) == null ? void 0 : d.tr) || "buildBodyTr", c = r[s];
239
+ return l.map((p) => {
240
+ const A = g(p, c), y = gt(n, p), z = Tt(y, r);
241
+ return A.children = z, A;
831
242
  });
832
- }, Do = (t, e) => {
833
- const o = structuredClone(e);
834
- o.textContent = "save", t.push(o);
835
- }, Wo = (t, e) => {
836
- Jo(t == null ? void 0 : t.children[0].children, e == null ? void 0 : e.buildColGroup), Uo(t == null ? void 0 : t.children[1].children[0].children, e == null ? void 0 : e.buildHeader), Vo(t == null ? void 0 : t.children[2].children, e == null ? void 0 : e.button), Do(t == null ? void 0 : t.children[3].children[0].children, e == null ? void 0 : e.button);
837
- }, y = (t, e) => {
243
+ }, S = (e, t) => {
838
244
  var o;
839
- if (((o = t == null ? void 0 : t.attributes) == null ? void 0 : o["data-role"]) === e) return t;
840
- for (const n of (t == null ? void 0 : t.children) ?? []) {
841
- const r = y(n, e);
842
- if (r) return r;
245
+ if (((o = e == null ? void 0 : e.attributes) == null ? void 0 : o["data-role"]) === t) return e;
246
+ for (const n of (e == null ? void 0 : e.children) ?? []) {
247
+ const l = S(n, t);
248
+ if (l) return l;
843
249
  }
844
250
  return null;
845
- }, Go = (t, e) => {
846
- const o = t[e.fileName], n = e.dataRole ? y(o, e.dataRole) : o;
847
- return (e.filePath ?? []).reduce((r, s) => r[s], n);
848
- }, Ko = {
251
+ }, At = (e, t) => {
252
+ const o = e[t.fileName], n = t.dataRole ? S(o, t.dataRole) : o;
253
+ return (t.filePath ?? []).reduce((l, r) => l[r], n);
254
+ }, Nt = {
849
255
  tagName: "tr",
850
256
  attributes: {
851
257
  class: "align-middle"
852
258
  },
853
259
  children: []
854
- }, Mo = {
260
+ }, $t = {
855
261
  tagName: "col",
856
262
  attributes: {
857
263
  width: "${width}"
858
264
  }
859
- }, qo = {
265
+ }, xt = {
860
266
  tagName: "th",
861
267
  textContent: "${columnName}",
862
268
  attributes: {
863
269
  class: "py-3 px-3 fw-semibold text-uppercase small"
864
270
  }
865
- }, zo = {
271
+ }, St = {
866
272
  tagName: "td",
867
273
  children: [
868
274
  {
@@ -875,49 +281,64 @@ const ro = ({ inSource: t, inOperation: e, inExecute: o }) => {
875
281
  }
876
282
  }
877
283
  ]
878
- }, _o = {
284
+ }, jt = {
879
285
  tagName: "td",
880
286
  textContent: "${rowValue}",
881
287
  attributes: {
882
288
  class: "py-3 px-3 text-secondary"
883
289
  }
884
- }, Xo = {
290
+ }, Lt = {
885
291
  tagName: "button",
886
292
  textContent: "${columnName}",
887
293
  attributes: {
888
294
  class: "btn btn-primary btn-sm"
889
295
  }
890
- }, Yo = {
296
+ }, Dt = {
297
+ tagName: "td",
298
+ attributes: {
299
+ class: "py-2 px-3 text-center"
300
+ },
301
+ children: [
302
+ {
303
+ tagName: "button",
304
+ textContent: "${agg:count}",
305
+ attributes: {
306
+ class: "btn btn-primary btn-sm"
307
+ }
308
+ }
309
+ ]
310
+ }, Et = {
891
311
  tagName: "option",
892
312
  textContent: "${rowValue}",
893
313
  attributes: {
894
314
  value: "${rowValue}"
895
315
  }
896
- }, Qo = {
316
+ }, Ot = {
897
317
  tagName: "select",
898
318
  attributes: {
899
- "data-name": "${columnName}"
319
+ id: "LedgerName"
900
320
  },
901
321
  children: []
902
- }, Zo = {
322
+ }, Pt = {
903
323
  tagName: "datalist",
904
324
  attributes: {
905
325
  "data-name": "${columnName}"
906
326
  },
907
327
  children: []
908
- }, m = {
909
- buildBodyTr: Ko,
910
- buildColGroup: Mo,
911
- buildHeader: qo,
912
- buildFooter: zo,
913
- buildBodyCell: _o,
914
- button: Xo,
915
- buildOption: Yo,
916
- buildSelect: Qo,
917
- buildDataList: Zo
918
- }, tn = "table", en = {
328
+ }, j = {
329
+ buildBodyTr: Nt,
330
+ buildColGroup: $t,
331
+ buildHeader: xt,
332
+ buildFooter: St,
333
+ buildBodyCell: jt,
334
+ button: Lt,
335
+ buttonCell: Dt,
336
+ buildOption: Et,
337
+ buildSelect: Ot,
338
+ buildDataList: Pt
339
+ }, Ft = "table", kt = {
919
340
  class: "table table-hover table-striped align-middle border mb-0"
920
- }, on = [
341
+ }, It = [
921
342
  {
922
343
  tagName: "colgroup",
923
344
  attributes: {
@@ -963,12 +384,13 @@ const ro = ({ inSource: t, inOperation: e, inExecute: o }) => {
963
384
  }
964
385
  ]
965
386
  }
966
- ], h = {
967
- tagName: tn,
968
- attributes: en,
969
- children: on
970
- }, nn = [
387
+ ], I = {
388
+ tagName: Ft,
389
+ attributes: kt,
390
+ children: It
391
+ }, Rt = [
971
392
  {
393
+ narration: "Build the column widths for the table using the configured columns.",
972
394
  destinationPath: {
973
395
  fileName: "base",
974
396
  dataRole: "table-colgroup",
@@ -979,13 +401,14 @@ const ro = ({ inSource: t, inOperation: e, inExecute: o }) => {
979
401
  sourcePath: {
980
402
  fileName: "data",
981
403
  filePath: [
982
- "colGroup"
404
+ "columns"
983
405
  ]
984
406
  },
985
407
  templateKey: "buildColGroup",
986
408
  func: "fromCollection"
987
409
  },
988
410
  {
411
+ narration: "Build the header row for the table using the configured columns.",
989
412
  destinationPath: {
990
413
  fileName: "base",
991
414
  dataRole: "table-header-row",
@@ -1001,26 +424,10 @@ const ro = ({ inSource: t, inOperation: e, inExecute: o }) => {
1001
424
  },
1002
425
  templateKey: "buildHeader",
1003
426
  func: "fromCollection"
1004
- },
1005
- {
1006
- destinationPath: {
1007
- fileName: "base",
1008
- dataRole: "table-footer-row",
1009
- filePath: [
1010
- "children"
1011
- ]
1012
- },
1013
- sourcePath: {
1014
- fileName: "data",
1015
- filePath: [
1016
- "columns"
1017
- ]
1018
- },
1019
- templateKey: "buildFooter",
1020
- func: "fromCollection"
1021
427
  }
1022
- ], rn = [
428
+ ], vt = [
1023
429
  {
430
+ narration: "Build the table body rows for the table using the configured columns and data.",
1024
431
  destinationPath: {
1025
432
  fileName: "base",
1026
433
  dataRole: "table-body",
@@ -1031,99 +438,162 @@ const ro = ({ inSource: t, inOperation: e, inExecute: o }) => {
1031
438
  sourcePath: {
1032
439
  fileName: "data",
1033
440
  filePath: [
1034
- "data"
441
+ "columns"
1035
442
  ]
1036
443
  },
1037
- templateKey: "buildBodyTr",
1038
- func: "fromCollection"
444
+ func: "twoDimensional"
445
+ }
446
+ ], T = (e) => Array.isArray(e) ? e : [e], L = {
447
+ set: (e, t, o) => {
448
+ e[t] = o;
449
+ },
450
+ push: (e, t, o) => {
451
+ e[t].push(...T(o));
452
+ },
453
+ unshift: (e, t, o) => {
454
+ e[t].unshift(...T(o));
455
+ },
456
+ pushToRows: (e, t, o) => {
457
+ e[t].forEach((n) => {
458
+ n.children.push(...structuredClone(T(o)));
459
+ });
460
+ },
461
+ unshiftToRows: (e, t, o) => {
462
+ e[t].forEach((n) => {
463
+ n.children.unshift(...structuredClone(T(o)));
464
+ });
465
+ },
466
+ unshiftSerialToRows: (e, t, o) => {
467
+ e[t].forEach((n, l) => {
468
+ const r = structuredClone(o);
469
+ r.textContent = l + 1, n.children.unshift(r);
470
+ });
1039
471
  }
1040
- ], p = { data: {}, base: h, spec: m }, sn = { fromCollection: Oo, tableBody: k, buildBody: O }, ln = (t, e) => {
1041
- const o = t.dataRole ? y(p[t.fileName], t.dataRole) : p[t.fileName], n = [...t.filePath ?? []], r = n.pop(), s = n.reduce((l, a) => l[a], o);
1042
- s[r] = e;
1043
- }, x = (t) => {
1044
- t.forEach((e) => {
1045
- const o = Go(p, e.sourcePath);
472
+ }, R = (e, t, o) => {
473
+ const n = t.dataRole ? S(e[t.fileName], t.dataRole) : e[t.fileName], l = [...t.filePath ?? []], r = l.pop(), s = l.reduce((i, u) => i[u], n);
474
+ (L[t.action] || L.set)(s, r, o);
475
+ }, m = { data: {}, base: I, spec: j }, v = {
476
+ fromCollection: C,
477
+ twoDimensional: Ct
478
+ }, Ht = (e) => {
479
+ e.forEach((t) => {
480
+ const o = At(m, t.sourcePath);
1046
481
  if (o) {
1047
- const n = sn[e.func](o, m[e.templateKey]);
1048
- ln(e.destinationPath, n);
482
+ const n = v[t.func](o, j[t.templateKey]);
483
+ R(m, t.destinationPath, n);
1049
484
  } else
1050
- console.log(" !instruction : ", e), console.log(" !source : ", o);
485
+ console.log(" !instruction : ", t), console.log(" !source : ", o);
1051
486
  });
1052
- }, an = (t) => (p.data = t, x(rn), x(nn), O(y(h, "table-body").children, t, m.buildBodyCell), Ro(h, m), Wo(h, m), h), cn = ({
1053
- inData: t,
1054
- inColumns: e,
487
+ }, Vt = (e) => {
488
+ e.forEach((t) => {
489
+ const o = v[t.func](
490
+ m.data.columns,
491
+ m.data.data,
492
+ j
493
+ );
494
+ R(m, t.destinationPath, o);
495
+ });
496
+ }, Bt = (e) => (m.data = e, Ht(Rt), Vt(vt), I), D = ({
497
+ inData: e,
498
+ inColumns: t,
1055
499
  footer: o = [],
1056
500
  options: n
1057
- } = {}) => an({
1058
- columns: e,
1059
- data: t
1060
- }), un = {
1061
- table: E,
1062
- select: jo,
1063
- selectOptionsOnly: B,
1064
- tableFromSpec: cn
1065
- }, v = ({
1066
- type: t = "table",
1067
- data: e,
1068
- columns: o,
1069
- options: n,
1070
- showLog: r = !1
501
+ } = {}) => Bt({
502
+ columns: t,
503
+ data: e
504
+ }), Mt = {
505
+ tagName: "option",
506
+ textContent: "${rowValue}",
507
+ attributes: {
508
+ value: "${rowValue}"
509
+ }
510
+ }, Gt = {
511
+ tagName: "select",
512
+ attributes: {
513
+ id: "LedgerName"
514
+ },
515
+ children: []
516
+ }, Kt = {
517
+ tagName: "datalist",
518
+ attributes: {
519
+ "data-name": "${columnName}"
520
+ },
521
+ children: []
522
+ }, w = {
523
+ buildOption: Mt,
524
+ buildSelect: Gt,
525
+ buildDataList: Kt
526
+ }, zt = ({ inData: e = [] } = {}) => {
527
+ const t = (e ?? []).map(
528
+ (n) => typeof n == "object" && n !== null ? n : { rowValue: n }
529
+ ), o = structuredClone(w.buildSelect);
530
+ return o.children = C(t, w.buildOption), o;
531
+ }, qt = ({ inData: e = [], inColumns: t = [] } = {}) => t.map((n) => {
532
+ const l = structuredClone(w.buildOption);
533
+ l.textContent = l.textContent.replace("rowValue", n.columnName), l.attributes.value = l.attributes.value.replace("rowValue", n.columnName);
534
+ const r = C(e, l);
535
+ return console.log("createdArray : ", r[0], l), r;
536
+ }), E = ({ inData: e = [] } = {}) => {
537
+ const t = (e ?? []).map(
538
+ (n) => typeof n == "object" && n !== null ? n : { rowValue: n }
539
+ ), o = structuredClone(w.buildDataList);
540
+ return o.children = C(t, w.buildOption), o;
541
+ }, _t = {
542
+ table: D,
543
+ tableFromSpec: D,
544
+ select: zt,
545
+ selectOptionsOnly: qt,
546
+ dataList: E,
547
+ datalist: E
548
+ }, H = ({
549
+ type: e = h.type,
550
+ data: t = h.data,
551
+ columns: o = h.columns,
552
+ options: n = h.options,
553
+ showLog: l = h.showLog
1071
554
  } = {}) => {
1072
- const u = {
1073
- type: t,
1074
- data: e,
555
+ const a = {
556
+ type: e,
557
+ data: t,
1075
558
  columns: o,
1076
559
  options: n,
1077
- showLog: r
560
+ showLog: l
1078
561
  };
1079
- return Z({ inConfig: u }), u;
1080
- }, P = ({
1081
- type: t = "table",
1082
- data: e,
1083
- columns: o,
1084
- options: n,
1085
- showLog: r = !1
1086
- } = {}) => {
1087
- const s = v({
1088
- type: t,
1089
- data: e,
1090
- columns: o,
1091
- options: n,
1092
- showLog: r
1093
- }), l = un[s.type];
1094
- if (!l)
1095
- throw new Error(`Renderer for type "${s.type}" not found.`);
1096
- const a = l({
1097
- inColumns: s.columns,
1098
- inData: s.data,
1099
- options: s.options
562
+ F({ inConfig: a });
563
+ const d = _t[a.type];
564
+ if (!d)
565
+ throw new Error(`Renderer for type "${a.type}" not found.`);
566
+ const p = d({
567
+ inColumns: a.columns,
568
+ inData: a.data,
569
+ options: a.options
1100
570
  });
1101
- return s.showLog && console.log("json-renderers-build output:", a), a;
571
+ return a.showLog && console.log("json-renderers-build output:", p), p;
1102
572
  };
1103
- Q({ render: P, getSpec: v });
1104
- const L = ({
1105
- inColumns: t,
1106
- inType: e = "table",
573
+ ot({ render: H, getSpec: x, spec: f });
574
+ const V = ({
575
+ inColumns: e,
576
+ inType: t = "table",
1107
577
  inData: o,
1108
578
  inShowLog: n = !1
1109
- } = {}) => P({
1110
- type: e,
579
+ } = {}) => H({
580
+ type: t,
1111
581
  data: o ?? [],
1112
- columns: t,
582
+ columns: e,
1113
583
  showLog: n
1114
- }), dn = {
584
+ }), Jt = {
1115
585
  version: "v9",
1116
586
  description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
1117
- }, bn = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
1118
- if (typeof globalThis > "u" || !t) return;
587
+ }, Yt = ({ inFuncDefinition: e, inReviewSpec: t } = {}) => {
588
+ if (typeof globalThis > "u" || !e) return;
1119
589
  globalThis.ks ?? (globalThis.ks = {});
1120
590
  const o = {
1121
- meta: dn,
1122
- buildSpecElement: t,
1123
- reviewSpec: e
591
+ meta: Jt,
592
+ buildSpecElement: e,
593
+ reviewSpec: t
1124
594
  };
1125
595
  globalThis.ks["json-to-tag"] = o, globalThis.ks.jsonToTag = o;
1126
- }, fn = (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 ?? "") : R(t), H = (t) => Array.isArray(t) ? t.map(fn).flat(1 / 0).filter(Boolean) : [], hn = (t) => (t == null, t), mn = "http://www.w3.org/2000/svg", pn = /* @__PURE__ */ new Set([
596
+ }, Ut = (e) => e == null ? null : typeof Node < "u" && e instanceof Node ? e : typeof e == "string" || typeof e == "number" ? document.createTextNode(String(e)) : typeof e == "object" && (e.nodeType === 3 || e.tagName === "#text" || !e.tagName && (e.textContent !== void 0 || e.text !== void 0)) ? document.createTextNode(e.textContent ?? e.text ?? "") : M(e), B = (e) => Array.isArray(e) ? e.map(Ut).flat(1 / 0).filter(Boolean) : [], Xt = (e) => (e == null, e), Qt = "http://www.w3.org/2000/svg", Wt = /* @__PURE__ */ new Set([
1127
597
  "svg",
1128
598
  "path",
1129
599
  "symbol",
@@ -1150,69 +620,69 @@ const L = ({
1150
620
  "fegaussianblur",
1151
621
  "femerge",
1152
622
  "femergenode"
1153
- ]), yn = ({ inTagName: t }) => {
1154
- const e = t == null ? void 0 : t.toLowerCase();
1155
- if (!e) return null;
1156
- if (e === "checkbox") {
623
+ ]), Zt = ({ inTagName: e }) => {
624
+ const t = e == null ? void 0 : e.toLowerCase();
625
+ if (!t) return null;
626
+ if (t === "checkbox") {
1157
627
  const o = document.createElement("input");
1158
628
  return o.type = "checkbox", o;
1159
629
  }
1160
- return pn.has(e) ? document.createElementNS(mn, e) : document.createElement(e);
1161
- }, gn = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), wn = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), Cn = "http://www.w3.org/1999/xlink", $n = ({ inElement: t, inAttributes: e }) => {
1162
- const o = t, n = e;
630
+ return Wt.has(t) ? document.createElementNS(Qt, t) : document.createElement(t);
631
+ }, te = ({ inElement: e, inTextContent: t }) => (!e || t === void 0 || t === null || (e.textContent = t), e), ee = ({ inElement: e, inProperties: t }) => (e && t && typeof t == "object" && Object.assign(e, t), e), oe = "http://www.w3.org/1999/xlink", ne = ({ inElement: e, inAttributes: t }) => {
632
+ const o = e, n = t;
1163
633
  if (!o || !n || typeof n != "object")
1164
634
  return o;
1165
- const r = typeof SVGElement < "u" ? o instanceof SVGElement : o.namespaceURI === "http://www.w3.org/2000/svg";
1166
- return Object.entries(n).forEach(([s, l]) => {
1167
- if (s === "class") {
1168
- r ? o.setAttribute("class", String(l)) : o.className = l;
635
+ const l = typeof SVGElement < "u" ? o instanceof SVGElement : o.namespaceURI === "http://www.w3.org/2000/svg";
636
+ return Object.entries(n).forEach(([r, s]) => {
637
+ if (r === "class") {
638
+ l ? o.setAttribute("class", String(s)) : o.className = s;
1169
639
  return;
1170
640
  }
1171
- if (s === "xlink:href" || s === "href") {
1172
- if (l != null) {
1173
- const a = String(l);
1174
- if (r)
641
+ if (r === "xlink:href" || r === "href") {
642
+ if (s != null) {
643
+ const c = String(s);
644
+ if (l)
1175
645
  try {
1176
- o.setAttributeNS(Cn, "href", a);
646
+ o.setAttributeNS(oe, "href", c);
1177
647
  } catch {
1178
648
  }
1179
- o.setAttribute("href", a), o.setAttribute("xlink:href", a);
649
+ o.setAttribute("href", c), o.setAttribute("xlink:href", c);
1180
650
  }
1181
651
  return;
1182
652
  }
1183
- if (typeof l == "boolean") {
1184
- l ? o.setAttribute(s, "") : o.removeAttribute(s);
653
+ if (typeof s == "boolean") {
654
+ s ? o.setAttribute(r, "") : o.removeAttribute(r);
1185
655
  return;
1186
656
  }
1187
- l != null && o.setAttribute(s, String(l));
657
+ s != null && o.setAttribute(r, String(s));
1188
658
  }), o;
1189
- }, An = ({ inElement: t, inClassList: e }) => {
1190
- if (!t || !e) return t;
1191
- const o = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((n) => typeof n == "string" && n.trim()) : [];
1192
- return o.length && t.classList.add(...o), t;
1193
- }, Nn = (t) => {
1194
- if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
1195
- const e = yn({ inTagName: t.tagName });
1196
- if (!e) return null;
1197
- if (gn({
1198
- inElement: e,
1199
- inTextContent: hn(t.textContent),
1200
- inTagName: t.tagName
1201
- }), wn({
1202
- inElement: e,
1203
- inProperties: t.properties
1204
- }), $n({
1205
- inElement: e,
1206
- inAttributes: t.attributes
1207
- }), An({
1208
- inElement: e,
1209
- inClassList: t.classList
1210
- }), Array.isArray(t.children)) {
1211
- const o = H(t.children);
1212
- o.length && e.append(...o);
659
+ }, re = ({ inElement: e, inClassList: t }) => {
660
+ if (!e || !t) return e;
661
+ const o = typeof t == "string" ? t.split(/\s+/).filter(Boolean) : Array.isArray(t) ? t.filter((n) => typeof n == "string" && n.trim()) : [];
662
+ return o.length && e.classList.add(...o), e;
663
+ }, le = (e) => {
664
+ if (!e || typeof e != "object" || Array.isArray(e) || !e.tagName) return null;
665
+ const t = Zt({ inTagName: e.tagName });
666
+ if (!t) return null;
667
+ if (te({
668
+ inElement: t,
669
+ inTextContent: Xt(e.textContent),
670
+ inTagName: e.tagName
671
+ }), ee({
672
+ inElement: t,
673
+ inProperties: e.properties
674
+ }), ne({
675
+ inElement: t,
676
+ inAttributes: e.attributes
677
+ }), re({
678
+ inElement: t,
679
+ inClassList: e.classList
680
+ }), Array.isArray(e.children)) {
681
+ const o = B(e.children);
682
+ o.length && t.append(...o);
1213
683
  }
1214
- return e;
1215
- }, R = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? H(t) : typeof t == "object" ? Nn(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, xn = "./tags.schema.json", Tn = {
684
+ return t;
685
+ }, M = (e) => e == null ? null : typeof Node < "u" && e instanceof Node ? e : Array.isArray(e) ? B(e) : typeof e == "object" ? le(e) : typeof e == "string" || typeof e == "number" ? document.createTextNode(String(e)) : null, ae = "./tags.schema.json", se = {
1216
686
  allowsTextContent: !1,
1217
687
  allowsChildren: !0,
1218
688
  allowedAttributes: [
@@ -1220,7 +690,7 @@ const L = ({
1220
690
  "role"
1221
691
  ],
1222
692
  childTags: []
1223
- }, Sn = {
693
+ }, ce = {
1224
694
  allowsTextContent: !1,
1225
695
  allowsChildren: !1,
1226
696
  allowedAttributes: [
@@ -1233,7 +703,7 @@ const L = ({
1233
703
  "required",
1234
704
  "list"
1235
705
  ]
1236
- }, En = {
706
+ }, ie = {
1237
707
  allowsTextContent: !1,
1238
708
  allowsChildren: !1,
1239
709
  allowedAttributes: [
@@ -1244,7 +714,7 @@ const L = ({
1244
714
  "disabled",
1245
715
  "required"
1246
716
  ]
1247
- }, jn = {
717
+ }, ue = {
1248
718
  allowsTextContent: !1,
1249
719
  allowsChildren: !0,
1250
720
  allowedAttributes: [
@@ -1253,7 +723,7 @@ const L = ({
1253
723
  childTags: [
1254
724
  "col"
1255
725
  ]
1256
- }, Fn = {
726
+ }, de = {
1257
727
  allowsTextContent: !1,
1258
728
  allowsChildren: !1,
1259
729
  allowedAttributes: [
@@ -1261,14 +731,14 @@ const L = ({
1261
731
  "style",
1262
732
  "width"
1263
733
  ]
1264
- }, Bn = {
734
+ }, pe = {
1265
735
  allowsTextContent: !0,
1266
736
  allowsChildren: !0,
1267
737
  allowedAttributes: [
1268
738
  "for"
1269
739
  ],
1270
740
  childTags: []
1271
- }, In = {
741
+ }, fe = {
1272
742
  allowsTextContent: !1,
1273
743
  allowsChildren: !0,
1274
744
  allowedAttributes: [
@@ -1281,7 +751,7 @@ const L = ({
1281
751
  "target"
1282
752
  ],
1283
753
  childTags: []
1284
- }, kn = {
754
+ }, be = {
1285
755
  allowsTextContent: !1,
1286
756
  allowsChildren: !0,
1287
757
  allowedAttributes: [
@@ -1294,27 +764,27 @@ const L = ({
1294
764
  childTags: [
1295
765
  "option"
1296
766
  ]
1297
- }, On = {
767
+ }, he = {
1298
768
  allowsTextContent: !0,
1299
769
  allowsChildren: !0,
1300
770
  allowedAttributes: [],
1301
771
  childTags: []
1302
- }, vn = {
772
+ }, me = {
1303
773
  allowsTextContent: !0,
1304
774
  allowsChildren: !0,
1305
775
  allowedAttributes: [],
1306
776
  childTags: []
1307
- }, Pn = {
777
+ }, we = {
1308
778
  allowsTextContent: !0,
1309
779
  allowsChildren: !0,
1310
780
  allowedAttributes: [],
1311
781
  childTags: []
1312
- }, Ln = {
782
+ }, ge = {
1313
783
  allowsTextContent: !0,
1314
784
  allowsChildren: !0,
1315
785
  allowedAttributes: [],
1316
786
  childTags: []
1317
- }, Hn = {
787
+ }, ye = {
1318
788
  allowsTextContent: !1,
1319
789
  allowsChildren: !1,
1320
790
  allowedAttributes: [
@@ -1324,7 +794,7 @@ const L = ({
1324
794
  "height",
1325
795
  "loading"
1326
796
  ]
1327
- }, Rn = {
797
+ }, Te = {
1328
798
  allowsTextContent: !0,
1329
799
  allowsChildren: !0,
1330
800
  allowedAttributes: [
@@ -1334,7 +804,7 @@ const L = ({
1334
804
  "value"
1335
805
  ],
1336
806
  childTags: []
1337
- }, Jn = {
807
+ }, Ce = {
1338
808
  allowsTextContent: !1,
1339
809
  allowsChildren: !0,
1340
810
  allowedAttributes: [
@@ -1350,28 +820,28 @@ const L = ({
1350
820
  "tfoot",
1351
821
  "tr"
1352
822
  ]
1353
- }, Un = {
823
+ }, Ae = {
1354
824
  allowsTextContent: !1,
1355
825
  allowsChildren: !0,
1356
826
  allowedAttributes: [],
1357
827
  childTags: [
1358
828
  "tr"
1359
829
  ]
1360
- }, Vn = {
830
+ }, Ne = {
1361
831
  allowsTextContent: !1,
1362
832
  allowsChildren: !0,
1363
833
  allowedAttributes: [],
1364
834
  childTags: [
1365
835
  "tr"
1366
836
  ]
1367
- }, Dn = {
837
+ }, $e = {
1368
838
  allowsTextContent: !1,
1369
839
  allowsChildren: !0,
1370
840
  allowedAttributes: [],
1371
841
  childTags: [
1372
842
  "tr"
1373
843
  ]
1374
- }, Wn = {
844
+ }, xe = {
1375
845
  allowsTextContent: !1,
1376
846
  allowsChildren: !0,
1377
847
  allowedAttributes: [],
@@ -1379,7 +849,7 @@ const L = ({
1379
849
  "td",
1380
850
  "th"
1381
851
  ]
1382
- }, Gn = {
852
+ }, Se = {
1383
853
  allowsTextContent: !0,
1384
854
  allowsChildren: !0,
1385
855
  allowedAttributes: [
@@ -1388,7 +858,7 @@ const L = ({
1388
858
  "rowspan"
1389
859
  ],
1390
860
  childTags: []
1391
- }, Kn = {
861
+ }, je = {
1392
862
  allowsTextContent: !0,
1393
863
  allowsChildren: !0,
1394
864
  allowedAttributes: [
@@ -1396,14 +866,14 @@ const L = ({
1396
866
  "rowspan"
1397
867
  ],
1398
868
  childTags: []
1399
- }, Mn = {
869
+ }, Le = {
1400
870
  allowsTextContent: !1,
1401
871
  allowsChildren: !0,
1402
872
  allowedAttributes: [],
1403
873
  childTags: [
1404
874
  "option"
1405
875
  ]
1406
- }, qn = {
876
+ }, De = {
1407
877
  allowsTextContent: !0,
1408
878
  allowsChildren: !1,
1409
879
  allowedAttributes: [
@@ -1412,14 +882,14 @@ const L = ({
1412
882
  "selected",
1413
883
  "disabled"
1414
884
  ]
1415
- }, zn = {
885
+ }, Ee = {
1416
886
  allowsTextContent: !1,
1417
887
  allowsChildren: !0,
1418
888
  allowedAttributes: [
1419
889
  "role"
1420
890
  ],
1421
891
  childTags: []
1422
- }, _n = {
892
+ }, Oe = {
1423
893
  allowsTextContent: !0,
1424
894
  allowsChildren: !0,
1425
895
  allowedAttributes: [
@@ -1430,19 +900,19 @@ const L = ({
1430
900
  "download"
1431
901
  ],
1432
902
  childTags: []
1433
- }, Xn = {
903
+ }, Pe = {
1434
904
  allowsTextContent: !0,
1435
905
  allowsChildren: !0,
1436
906
  allowedAttributes: [
1437
907
  "aria-hidden"
1438
908
  ],
1439
909
  childTags: []
1440
- }, Yn = {
910
+ }, Fe = {
1441
911
  allowsTextContent: !0,
1442
912
  allowsChildren: !0,
1443
913
  allowedAttributes: [],
1444
914
  childTags: []
1445
- }, Qn = {
915
+ }, ke = {
1446
916
  allowsTextContent: !1,
1447
917
  allowsChildren: !0,
1448
918
  allowedAttributes: [
@@ -1451,127 +921,129 @@ const L = ({
1451
921
  childTags: [
1452
922
  "li"
1453
923
  ]
1454
- }, Zn = {
924
+ }, Ie = {
1455
925
  allowsTextContent: !0,
1456
926
  allowsChildren: !0,
1457
927
  allowedAttributes: [
1458
928
  "value"
1459
929
  ],
1460
930
  childTags: []
1461
- }, tr = {
931
+ }, Re = {
1462
932
  allowsTextContent: !1,
1463
933
  allowsChildren: !1,
1464
934
  allowedAttributes: []
1465
- }, er = {
1466
- $schema: xn,
1467
- div: Tn,
1468
- input: Sn,
1469
- checkbox: En,
1470
- colgroup: jn,
1471
- col: Fn,
1472
- label: Bn,
1473
- form: In,
1474
- select: kn,
1475
- p: On,
1476
- h1: vn,
1477
- h2: Pn,
1478
- span: Ln,
1479
- img: Hn,
1480
- button: Rn,
1481
- table: Jn,
1482
- thead: Un,
1483
- tbody: Vn,
1484
- tfoot: Dn,
1485
- tr: Wn,
1486
- th: Gn,
1487
- td: Kn,
1488
- datalist: Mn,
1489
- option: qn,
1490
- header: zn,
1491
- a: _n,
1492
- i: Xn,
1493
- small: Yn,
1494
- ul: Qn,
1495
- li: Zn,
1496
- hr: tr
1497
- }, w = ({ inSpec: t }) => {
1498
- const e = t;
1499
- if (!e) return [];
1500
- if (Array.isArray(e))
1501
- return e.flatMap((n) => w({ inSpec: n }));
1502
- if (typeof e != "object") return [];
935
+ }, ve = {
936
+ $schema: ae,
937
+ div: se,
938
+ input: ce,
939
+ checkbox: ie,
940
+ colgroup: ue,
941
+ col: de,
942
+ label: pe,
943
+ form: fe,
944
+ select: be,
945
+ p: he,
946
+ h1: me,
947
+ h2: we,
948
+ span: ge,
949
+ img: ye,
950
+ button: Te,
951
+ table: Ce,
952
+ thead: Ae,
953
+ tbody: Ne,
954
+ tfoot: $e,
955
+ tr: xe,
956
+ th: Se,
957
+ td: je,
958
+ datalist: Le,
959
+ option: De,
960
+ header: Ee,
961
+ a: Oe,
962
+ i: Pe,
963
+ small: Fe,
964
+ ul: ke,
965
+ li: Ie,
966
+ hr: Re
967
+ }, $ = ({ inSpec: e }) => {
968
+ const t = e;
969
+ if (!t) return [];
970
+ if (Array.isArray(t))
971
+ return t.flatMap((n) => $({ inSpec: n }));
972
+ if (typeof t != "object") return [];
1503
973
  const o = [];
1504
- return typeof e.tagName == "string" && e.tagName.trim().length > 0 && o.push(e.tagName.toLowerCase()), Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((n) => {
1505
- const r = w({ inSpec: n });
1506
- o.push(...r);
974
+ return typeof t.tagName == "string" && t.tagName.trim().length > 0 && o.push(t.tagName.toLowerCase()), Array.isArray(t.children) && t.children.length > 0 && t.children.forEach((n) => {
975
+ const l = $({ inSpec: n });
976
+ o.push(...l);
1507
977
  }), o;
1508
- }, or = ({ inTagsFound: t, inAllowedTags: e }) => {
1509
- const o = t ?? [], n = e ?? {}, r = new Set(
1510
- Object.keys(n).filter((u) => u !== "$schema").map((u) => u.toLowerCase())
1511
- ), s = {}, l = [], a = [];
1512
- o.forEach((u) => {
1513
- s[u] = (s[u] || 0) + 1, r.has(u) ? l.includes(u) || l.push(u) : a.includes(u) || a.push(u);
978
+ }, He = ({ inTagsFound: e, inAllowedTags: t }) => {
979
+ const o = e ?? [], n = t ?? {}, l = new Set(
980
+ Object.keys(n).filter((a) => a !== "$schema").map((a) => a.toLowerCase())
981
+ ), r = {}, s = [], c = [];
982
+ o.forEach((a) => {
983
+ r[a] = (r[a] || 0) + 1, l.has(a) ? s.includes(a) || s.push(a) : c.includes(a) || c.push(a);
1514
984
  });
1515
- const c = o.length, i = a.length === 0;
985
+ const i = o.length, u = c.length === 0;
1516
986
  return {
1517
- totalTags: c,
1518
- tagCounts: s,
1519
- uniqueTags: Object.keys(s),
1520
- recognizedTags: l,
1521
- unrecognizedTags: a,
1522
- areAllTagsPresent: i
987
+ totalTags: i,
988
+ tagCounts: r,
989
+ uniqueTags: Object.keys(r),
990
+ recognizedTags: s,
991
+ unrecognizedTags: c,
992
+ areAllTagsPresent: u
1523
993
  };
1524
- }, nr = ({ inSpec: t, inTags: e = er } = {}) => {
1525
- const o = t, n = e, r = w({ inSpec: o }), s = or({
1526
- inTagsFound: r,
994
+ }, Ve = ({ inSpec: e, inTags: t = ve } = {}) => {
995
+ const o = e, n = t, l = $({ inSpec: o }), r = He({
996
+ inTagsFound: l,
1527
997
  inAllowedTags: n
1528
998
  });
1529
999
  return {
1530
- areAllTagsPresent: s.areAllTagsPresent,
1531
- totalTags: s.totalTags,
1532
- tagCounts: s.tagCounts,
1533
- uniqueTags: s.uniqueTags,
1534
- recognizedTags: s.recognizedTags,
1535
- unrecognizedTags: s.unrecognizedTags
1000
+ areAllTagsPresent: r.areAllTagsPresent,
1001
+ totalTags: r.totalTags,
1002
+ tagCounts: r.tagCounts,
1003
+ uniqueTags: r.uniqueTags,
1004
+ recognizedTags: r.recognizedTags,
1005
+ unrecognizedTags: r.unrecognizedTags
1536
1006
  };
1537
- }, J = (t = {}) => {
1538
- const e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
1539
- return R(e);
1007
+ }, G = (e = {}) => {
1008
+ const t = (e == null ? void 0 : e.spec) ?? (e == null ? void 0 : e.inSpec) ?? e;
1009
+ return M(t);
1540
1010
  };
1541
- bn({
1542
- inFuncDefinition: J,
1543
- inReviewSpec: nr
1011
+ Yt({
1012
+ inFuncDefinition: G,
1013
+ inReviewSpec: Ve
1544
1014
  });
1545
- const U = ({
1546
- inSpec: t,
1547
- inTargetHtmlId: e,
1015
+ const K = ({
1016
+ inSpec: e,
1017
+ inTargetHtmlId: t,
1548
1018
  inAppendPosition: o,
1549
1019
  inShowLog: n = !1
1550
1020
  } = {}) => {
1551
- const r = t, s = e, l = o, a = n, c = J(r);
1552
- a && console.log("renderToDom 1 (content):", c);
1553
- const i = document.getElementById(s);
1554
- return i ? (Array.isArray(c) || c instanceof NodeList || c instanceof HTMLCollection ? l === "prepend" ? i.prepend(...c) : i.append(...c) : l === "prepend" ? i.prepend(c) : (i.innerHTML = "", i.append(c)), a && console.log("renderToDom 2 (mounted):", i), i) : null;
1555
- }, rr = (t = {}) => {
1556
- const e = T(t), o = L({
1557
- inColumns: e.columns,
1558
- inData: e.data,
1559
- inType: e.type,
1560
- inShowLog: e.showLog
1021
+ const l = e, r = t, s = o, c = n, i = G(l);
1022
+ c && console.log("renderToDom 1 (content):", i);
1023
+ const u = document.getElementById(r);
1024
+ return u ? (Array.isArray(i) || i instanceof NodeList || i instanceof HTMLCollection ? s === "prepend" ? u.prepend(...i) : u.append(...i) : s === "prepend" ? u.prepend(i) : (u.innerHTML = "", u.append(i)), c && console.log("renderToDom 2 (mounted):", u), u) : null;
1025
+ }, Be = (e = {}) => {
1026
+ const t = O(e);
1027
+ (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);
1028
+ const n = V({
1029
+ inColumns: t.columns,
1030
+ inData: t.data,
1031
+ inType: t.type,
1032
+ inShowLog: t.showLog
1561
1033
  });
1562
- return U({
1563
- inSpec: o,
1564
- inTargetHtmlId: e.targetHtmlId,
1565
- inAppendPosition: e.appendPosition,
1566
- inShowLog: e.showLog
1034
+ return K({
1035
+ inSpec: n,
1036
+ inTargetHtmlId: t.targetHtmlId,
1037
+ inAppendPosition: t.appendPosition,
1038
+ inShowLog: t.showLog
1567
1039
  });
1568
1040
  };
1569
- D({ render: rr, getSpec: S, validateConfig: T, buildSpec: L, renderToDom: U });
1041
+ _({ render: Be, getSpec: P, validateConfig: O, buildSpec: V, renderToDom: K });
1570
1042
  export {
1571
- L as buildSpec,
1572
- rr as default,
1573
- S as getSpec,
1574
- rr as render,
1575
- U as renderToDom,
1576
- T as validateConfig
1043
+ V as buildSpec,
1044
+ Be as default,
1045
+ P as getSpec,
1046
+ Be as render,
1047
+ K as renderToDom,
1048
+ O as validateConfig
1577
1049
  };