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