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