json-renderers 1.18.4 → 1.18.7

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