json-renderers 1.13.2 → 1.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,125 +1,125 @@
1
- const R = {
1
+ const A = {
2
2
  version: "v12.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
- }, F = (t) => {
4
+ }, x = (t) => {
5
5
  var e;
6
6
  typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderers ?? (e.jsonRenderers = {
7
- meta: R,
7
+ meta: A,
8
8
  renderToDom: t
9
9
  }));
10
- }, G = {
11
- version: "v2.0.0",
10
+ }, v = {
11
+ version: "v3.0.0",
12
12
  description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
13
- }, H = (t) => {
13
+ }, j = (t) => {
14
14
  var e;
15
15
  typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderersBuild ?? (e.jsonRenderersBuild = {
16
- meta: G,
16
+ meta: v,
17
17
  renderToDom: t
18
18
  }));
19
- }, S = {
19
+ }, N = {
20
20
  version: "v32",
21
21
  description: "JSON-to-DOM engine with centralized traversal and responsibility-focused construction"
22
- }, L = ({ inFuncDefinition: t } = {}) => {
22
+ }, $ = ({ inFuncDefinition: t } = {}) => {
23
23
  if (typeof globalThis > "u" || !t) return;
24
24
  globalThis.ks ?? (globalThis.ks = {});
25
25
  const e = {
26
- meta: S,
26
+ meta: N,
27
27
  buildSpecElement: t
28
28
  };
29
29
  globalThis.ks.jsonToSpec = e;
30
- }, M = (t, e) => d(t, e), C = (t, e) => Array.isArray(t) ? t.map((l) => M(l, e)).flat(1 / 0).filter(Boolean) : [], z = (t, e) => {
30
+ }, k = (t, e) => c(t, e), w = (t, e) => Array.isArray(t) ? t.map((l) => k(l, e)).flat(1 / 0).filter(Boolean) : [], D = (t, e) => {
31
31
  if ("source" in t && (t == null ? void 0 : t.source) in e) {
32
32
  const l = e[t == null ? void 0 : t.source];
33
33
  if (Array.isArray(l))
34
34
  return l.map((n) => {
35
- const r = t == null ? void 0 : t.template;
36
- if (r)
37
- return d(r, n);
35
+ const o = t == null ? void 0 : t.template;
36
+ if (o)
37
+ return c(o, n);
38
38
  });
39
39
  }
40
- }, P = (t, e) => {
40
+ }, E = (t, e) => {
41
41
  let l = [];
42
- for (const [o, n] of Object.entries(e)) {
43
- const r = t == null ? void 0 : t.template;
44
- if (r) {
45
- const a = d(r, {
46
- key: o,
42
+ for (const [r, n] of Object.entries(e)) {
43
+ const o = t == null ? void 0 : t.template;
44
+ if (o) {
45
+ const a = c(o, {
46
+ key: r,
47
47
  value: n
48
48
  });
49
49
  l.push(a);
50
50
  }
51
51
  }
52
52
  return l;
53
- }, V = (t, e) => {
53
+ }, O = (t, e) => {
54
54
  if ("source" in t && (t == null ? void 0 : t.source) in e) {
55
55
  const l = e[t == null ? void 0 : t.source];
56
56
  if (Array.isArray(l))
57
57
  return l.map((n) => {
58
- const r = t == null ? void 0 : t.template;
59
- if (r)
60
- return d(r, n);
58
+ const o = t == null ? void 0 : t.template;
59
+ if (o)
60
+ return c(o, n);
61
61
  });
62
62
  }
63
- }, q = (t, e) => {
63
+ }, F = (t, e) => {
64
64
  if ("operation" in t) {
65
65
  if (t.operation === "loopArray")
66
- return z(t, e);
66
+ return D(t, e);
67
67
  if (t.operation === "loopObject")
68
- return P(t, e);
68
+ return E(t, e);
69
69
  if (t.operation === "loopCollection")
70
- return V(t, e);
70
+ return O(t, e);
71
71
  }
72
- }, A = (t, e) => {
72
+ }, m = (t, e) => {
73
73
  if (typeof e == "string") return e;
74
74
  if (typeof t != "string") return t;
75
75
  if (t === "${value}")
76
76
  return e.value;
77
77
  const l = t.match(/^\$\{(.+?)\}$/);
78
78
  if (l) {
79
- const o = l[1];
80
- return (e == null ? void 0 : e[o]) ?? "";
79
+ const r = l[1];
80
+ return (e == null ? void 0 : e[r]) ?? "";
81
81
  }
82
82
  return t;
83
- }, B = (t, e) => {
83
+ }, G = (t, e) => {
84
84
  let l = {};
85
- for (const [o, n] of Object.entries(t)) {
86
- const r = A(n, e);
87
- l[o] = r;
85
+ for (const [r, n] of Object.entries(t)) {
86
+ const o = m(n, e);
87
+ l[r] = o;
88
88
  }
89
89
  return l;
90
- }, _ = (t, e) => {
90
+ }, R = (t, e) => {
91
91
  if ("tagName" in t) {
92
92
  if ("textContent" in t) {
93
- const l = A(t.textContent, e);
93
+ const l = m(t.textContent, e);
94
94
  t.textContent = l;
95
95
  }
96
96
  if ("attributes" in t) {
97
- const l = B(t.attributes, e);
97
+ const l = G(t.attributes, e);
98
98
  t.attributes = l;
99
99
  }
100
100
  }
101
- }, U = (t, e) => {
101
+ }, z = (t, e) => {
102
102
  if (!t || typeof t != "object" || Array.isArray(t)) return null;
103
103
  const l = structuredClone(t);
104
104
  if (!l) return null;
105
- if ("tagName" in l && _(l, e), "jsonToSpec" in l) {
106
- const o = l == null ? void 0 : l.jsonToSpec, n = q(o, e);
105
+ if ("tagName" in l && R(l, e), "jsonToSpec" in l) {
106
+ const r = l == null ? void 0 : l.jsonToSpec, n = F(r, e);
107
107
  Array.isArray(n) ? l.children = n : l.children = [n], delete l.jsonToSpec;
108
108
  }
109
109
  if (Array.isArray(l == null ? void 0 : l.children)) {
110
- const o = C(l == null ? void 0 : l.children, e);
111
- l.children = o;
110
+ const r = w(l == null ? void 0 : l.children, e);
111
+ l.children = r;
112
112
  }
113
113
  return l;
114
- }, d = (t, e) => {
114
+ }, c = (t, e) => {
115
115
  if (t == null) return null;
116
116
  debugger;
117
- return typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? C(t, e) : typeof t == "object" ? U(t, e) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : t;
118
- }, x = (t, e) => d(t, e);
119
- L({
120
- inFuncDefinition: x
117
+ return typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? w(t, e) : typeof t == "object" ? z(t, e) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : t;
118
+ }, g = (t, e) => c(t, e);
119
+ $({
120
+ inFuncDefinition: g
121
121
  });
122
- const K = {
122
+ const M = {
123
123
  default: {
124
124
  tagName: "table",
125
125
  attributes: {
@@ -165,68 +165,66 @@ const K = {
165
165
  }
166
166
  ]
167
167
  }
168
- }, X = ({
169
- targetHtmlId: t,
170
- inTargetHtmlId: e,
171
- inColumns: l,
172
- inData: o
168
+ }, S = ({
169
+ inColumns: t,
170
+ inData: e
173
171
  } = {}) => {
174
- const n = o ?? [], r = l;
175
- return x(K.default, {
172
+ const l = e ?? [], r = t;
173
+ return g(M.default, {
176
174
  columns: r,
177
- data: n
175
+ data: l
178
176
  });
179
- }, y = {
180
- table: X
181
- }, v = ({
177
+ }, I = "select", L = {
178
+ id: "LedgerName"
179
+ }, V = {
180
+ operation: "loopArray",
181
+ source: "arrayOfStrings",
182
+ template: {
183
+ tagName: "option",
184
+ attributes: {
185
+ value: "${}"
186
+ },
187
+ textContent: "${}"
188
+ }
189
+ }, q = [], P = {
190
+ tagName: I,
191
+ attributes: L,
192
+ jsonToSpec: V,
193
+ children: q
194
+ }, B = ({
195
+ inData: t
196
+ } = {}) => g(P, {
197
+ arrayOfStrings: t ?? []
198
+ }), b = {
199
+ table: S,
200
+ select: B
201
+ }, p = ({
182
202
  type: t = "table",
183
- targetHtmlId: e,
184
- data: l,
185
- classToApply: o,
186
- inTargetHtmlId: n,
187
- inData: r,
188
- columns: a,
189
- inColumns: s,
190
- colGroup: u,
191
- inColGroup: c,
192
- footerData: i,
193
- inFooterData: f,
194
- config: b,
195
- inConfig: w,
196
- variant: m,
197
- skeletonType: $,
198
- inSkeletonType: E,
199
- showLog: D = !1,
200
- inShowLog: O
203
+ data: e,
204
+ columns: l
201
205
  } = {}) => {
202
- const g = t, I = typeof g == "string" ? g.toLowerCase() : "table", p = y[I];
203
- return p ? p({
204
- targetHtmlId: n ?? e,
205
- inColumns: s ?? a,
206
- inData: r ?? l,
207
- inColGroup: c ?? u,
208
- inFooterData: f ?? i ?? [],
209
- inConfig: w ?? b ?? {},
210
- inSkeletonType: E ?? $ ?? m ?? "default",
211
- inShowLog: O ?? D ?? !1
206
+ const r = t, n = typeof r == "string" ? r.toLowerCase() : "table", o = b[n];
207
+ return o ? o({
208
+ inColumns: l,
209
+ inData: e
212
210
  }) : (console.error(
213
- `[Renderer] Unknown renderer type "${g}". Available types: ${Object.keys(y).join(", ")}`
211
+ `[Renderer] Unknown renderer type "${r}". Available types: ${Object.keys(b).join(", ")}`
214
212
  ), null);
215
213
  };
216
- H(v);
217
- const Q = {
214
+ j(p);
215
+ const H = {
218
216
  version: "v9",
219
217
  description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
220
- }, W = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
218
+ }, _ = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
221
219
  if (typeof globalThis > "u" || !t) return;
222
220
  globalThis.ks ?? (globalThis.ks = {});
223
221
  const l = {
224
- meta: Q,
222
+ meta: H,
225
223
  buildSpecElement: t,
226
224
  reviewSpec: e
227
225
  };
228
226
  globalThis.ks["json-to-tag"] = l, globalThis.ks.jsonToTag = l;
229
- }, Y = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : typeof t == "object" && (t.nodeType === 3 || t.tagName === "#text" || !t.tagName && (t.textContent !== void 0 || t.text !== void 0)) ? document.createTextNode(t.textContent ?? t.text ?? "") : N(t), j = (t) => Array.isArray(t) ? t.map(Y).flat(1 / 0).filter(Boolean) : [], Z = (t) => (t == null, t), J = "http://www.w3.org/2000/svg", tt = /* @__PURE__ */ new Set([
227
+ }, U = (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 ?? "") : T(t), y = (t) => Array.isArray(t) ? t.map(U).flat(1 / 0).filter(Boolean) : [], K = (t) => (t == null, t), X = "http://www.w3.org/2000/svg", Q = /* @__PURE__ */ new Set([
230
228
  "svg",
231
229
  "path",
232
230
  "symbol",
@@ -253,69 +251,69 @@ const Q = {
253
251
  "fegaussianblur",
254
252
  "femerge",
255
253
  "femergenode"
256
- ]), et = ({ inTagName: t }) => {
254
+ ]), W = ({ inTagName: t }) => {
257
255
  const e = t == null ? void 0 : t.toLowerCase();
258
256
  if (!e) return null;
259
257
  if (e === "checkbox") {
260
258
  const l = document.createElement("input");
261
259
  return l.type = "checkbox", l;
262
260
  }
263
- return tt.has(e) ? document.createElementNS(J, e) : document.createElement(e);
264
- }, lt = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), rt = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), ot = "http://www.w3.org/1999/xlink", nt = ({ inElement: t, inAttributes: e }) => {
265
- const l = t, o = e;
266
- if (!l || !o || typeof o != "object")
261
+ return Q.has(e) ? document.createElementNS(X, e) : document.createElement(e);
262
+ }, Y = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), Z = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), J = "http://www.w3.org/1999/xlink", tt = ({ inElement: t, inAttributes: e }) => {
263
+ const l = t, r = e;
264
+ if (!l || !r || typeof r != "object")
267
265
  return l;
268
266
  const n = typeof SVGElement < "u" ? l instanceof SVGElement : l.namespaceURI === "http://www.w3.org/2000/svg";
269
- return Object.entries(o).forEach(([r, a]) => {
270
- if (r === "class") {
267
+ return Object.entries(r).forEach(([o, a]) => {
268
+ if (o === "class") {
271
269
  n ? l.setAttribute("class", String(a)) : l.className = a;
272
270
  return;
273
271
  }
274
- if (r === "xlink:href" || r === "href") {
272
+ if (o === "xlink:href" || o === "href") {
275
273
  if (a != null) {
276
- const s = String(a);
274
+ const i = String(a);
277
275
  if (n)
278
276
  try {
279
- l.setAttributeNS(ot, "href", s);
277
+ l.setAttributeNS(J, "href", i);
280
278
  } catch {
281
279
  }
282
- l.setAttribute("href", s), l.setAttribute("xlink:href", s);
280
+ l.setAttribute("href", i), l.setAttribute("xlink:href", i);
283
281
  }
284
282
  return;
285
283
  }
286
284
  if (typeof a == "boolean") {
287
- a ? l.setAttribute(r, "") : l.removeAttribute(r);
285
+ a ? l.setAttribute(o, "") : l.removeAttribute(o);
288
286
  return;
289
287
  }
290
- a != null && l.setAttribute(r, String(a));
288
+ a != null && l.setAttribute(o, String(a));
291
289
  }), l;
292
- }, at = ({ inElement: t, inClassList: e }) => {
290
+ }, et = ({ inElement: t, inClassList: e }) => {
293
291
  if (!t || !e) return t;
294
- const l = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((o) => typeof o == "string" && o.trim()) : [];
292
+ const l = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((r) => typeof r == "string" && r.trim()) : [];
295
293
  return l.length && t.classList.add(...l), t;
296
- }, st = (t) => {
294
+ }, lt = (t) => {
297
295
  if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
298
- const e = et({ inTagName: t.tagName });
296
+ const e = W({ inTagName: t.tagName });
299
297
  if (!e) return null;
300
- if (lt({
298
+ if (Y({
301
299
  inElement: e,
302
- inTextContent: Z(t.textContent),
300
+ inTextContent: K(t.textContent),
303
301
  inTagName: t.tagName
304
- }), rt({
302
+ }), Z({
305
303
  inElement: e,
306
304
  inProperties: t.properties
307
- }), nt({
305
+ }), tt({
308
306
  inElement: e,
309
307
  inAttributes: t.attributes
310
- }), at({
308
+ }), et({
311
309
  inElement: e,
312
310
  inClassList: t.classList
313
311
  }), Array.isArray(t.children)) {
314
- const l = j(t.children);
312
+ const l = y(t.children);
315
313
  l.length && e.append(...l);
316
314
  }
317
315
  return e;
318
- }, N = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? j(t) : typeof t == "object" ? st(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, it = "./tags.schema.json", ut = {
316
+ }, T = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? y(t) : typeof t == "object" ? lt(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, rt = "./tags.schema.json", ot = {
319
317
  allowsTextContent: !1,
320
318
  allowsChildren: !0,
321
319
  allowedAttributes: [
@@ -323,7 +321,7 @@ const Q = {
323
321
  "role"
324
322
  ],
325
323
  childTags: []
326
- }, ct = {
324
+ }, nt = {
327
325
  allowsTextContent: !1,
328
326
  allowsChildren: !1,
329
327
  allowedAttributes: [
@@ -336,7 +334,7 @@ const Q = {
336
334
  "required",
337
335
  "list"
338
336
  ]
339
- }, dt = {
337
+ }, at = {
340
338
  allowsTextContent: !1,
341
339
  allowsChildren: !1,
342
340
  allowedAttributes: [
@@ -347,7 +345,7 @@ const Q = {
347
345
  "disabled",
348
346
  "required"
349
347
  ]
350
- }, ft = {
348
+ }, st = {
351
349
  allowsTextContent: !1,
352
350
  allowsChildren: !0,
353
351
  allowedAttributes: [
@@ -356,7 +354,7 @@ const Q = {
356
354
  childTags: [
357
355
  "col"
358
356
  ]
359
- }, gt = {
357
+ }, it = {
360
358
  allowsTextContent: !1,
361
359
  allowsChildren: !1,
362
360
  allowedAttributes: [
@@ -364,14 +362,14 @@ const Q = {
364
362
  "style",
365
363
  "width"
366
364
  ]
367
- }, ht = {
365
+ }, ut = {
368
366
  allowsTextContent: !0,
369
367
  allowsChildren: !0,
370
368
  allowedAttributes: [
371
369
  "for"
372
370
  ],
373
371
  childTags: []
374
- }, bt = {
372
+ }, ct = {
375
373
  allowsTextContent: !1,
376
374
  allowsChildren: !0,
377
375
  allowedAttributes: [
@@ -384,7 +382,7 @@ const Q = {
384
382
  "target"
385
383
  ],
386
384
  childTags: []
387
- }, wt = {
385
+ }, dt = {
388
386
  allowsTextContent: !1,
389
387
  allowsChildren: !0,
390
388
  allowedAttributes: [
@@ -397,27 +395,27 @@ const Q = {
397
395
  childTags: [
398
396
  "option"
399
397
  ]
400
- }, mt = {
398
+ }, ft = {
401
399
  allowsTextContent: !0,
402
400
  allowsChildren: !0,
403
401
  allowedAttributes: [],
404
402
  childTags: []
405
- }, pt = {
403
+ }, gt = {
406
404
  allowsTextContent: !0,
407
405
  allowsChildren: !0,
408
406
  allowedAttributes: [],
409
407
  childTags: []
410
- }, yt = {
408
+ }, ht = {
411
409
  allowsTextContent: !0,
412
410
  allowsChildren: !0,
413
411
  allowedAttributes: [],
414
412
  childTags: []
415
- }, Tt = {
413
+ }, bt = {
416
414
  allowsTextContent: !0,
417
415
  allowsChildren: !0,
418
416
  allowedAttributes: [],
419
417
  childTags: []
420
- }, Ct = {
418
+ }, wt = {
421
419
  allowsTextContent: !1,
422
420
  allowsChildren: !1,
423
421
  allowedAttributes: [
@@ -427,7 +425,7 @@ const Q = {
427
425
  "height",
428
426
  "loading"
429
427
  ]
430
- }, At = {
428
+ }, mt = {
431
429
  allowsTextContent: !0,
432
430
  allowsChildren: !0,
433
431
  allowedAttributes: [
@@ -437,7 +435,7 @@ const Q = {
437
435
  "value"
438
436
  ],
439
437
  childTags: []
440
- }, xt = {
438
+ }, pt = {
441
439
  allowsTextContent: !1,
442
440
  allowsChildren: !0,
443
441
  allowedAttributes: [
@@ -453,28 +451,28 @@ const Q = {
453
451
  "tfoot",
454
452
  "tr"
455
453
  ]
456
- }, vt = {
454
+ }, yt = {
457
455
  allowsTextContent: !1,
458
456
  allowsChildren: !0,
459
457
  allowedAttributes: [],
460
458
  childTags: [
461
459
  "tr"
462
460
  ]
463
- }, jt = {
461
+ }, Tt = {
464
462
  allowsTextContent: !1,
465
463
  allowsChildren: !0,
466
464
  allowedAttributes: [],
467
465
  childTags: [
468
466
  "tr"
469
467
  ]
470
- }, Nt = {
468
+ }, Ct = {
471
469
  allowsTextContent: !1,
472
470
  allowsChildren: !0,
473
471
  allowedAttributes: [],
474
472
  childTags: [
475
473
  "tr"
476
474
  ]
477
- }, kt = {
475
+ }, At = {
478
476
  allowsTextContent: !1,
479
477
  allowsChildren: !0,
480
478
  allowedAttributes: [],
@@ -482,7 +480,7 @@ const Q = {
482
480
  "td",
483
481
  "th"
484
482
  ]
485
- }, $t = {
483
+ }, xt = {
486
484
  allowsTextContent: !0,
487
485
  allowsChildren: !0,
488
486
  allowedAttributes: [
@@ -491,7 +489,7 @@ const Q = {
491
489
  "rowspan"
492
490
  ],
493
491
  childTags: []
494
- }, Et = {
492
+ }, vt = {
495
493
  allowsTextContent: !0,
496
494
  allowsChildren: !0,
497
495
  allowedAttributes: [
@@ -499,14 +497,14 @@ const Q = {
499
497
  "rowspan"
500
498
  ],
501
499
  childTags: []
502
- }, Dt = {
500
+ }, jt = {
503
501
  allowsTextContent: !1,
504
502
  allowsChildren: !0,
505
503
  allowedAttributes: [],
506
504
  childTags: [
507
505
  "option"
508
506
  ]
509
- }, Ot = {
507
+ }, Nt = {
510
508
  allowsTextContent: !0,
511
509
  allowsChildren: !1,
512
510
  allowedAttributes: [
@@ -515,14 +513,14 @@ const Q = {
515
513
  "selected",
516
514
  "disabled"
517
515
  ]
518
- }, It = {
516
+ }, $t = {
519
517
  allowsTextContent: !1,
520
518
  allowsChildren: !0,
521
519
  allowedAttributes: [
522
520
  "role"
523
521
  ],
524
522
  childTags: []
525
- }, Rt = {
523
+ }, kt = {
526
524
  allowsTextContent: !0,
527
525
  allowsChildren: !0,
528
526
  allowedAttributes: [
@@ -533,19 +531,19 @@ const Q = {
533
531
  "download"
534
532
  ],
535
533
  childTags: []
536
- }, Ft = {
534
+ }, Dt = {
537
535
  allowsTextContent: !0,
538
536
  allowsChildren: !0,
539
537
  allowedAttributes: [
540
538
  "aria-hidden"
541
539
  ],
542
540
  childTags: []
543
- }, Gt = {
541
+ }, Et = {
544
542
  allowsTextContent: !0,
545
543
  allowsChildren: !0,
546
544
  allowedAttributes: [],
547
545
  childTags: []
548
- }, Ht = {
546
+ }, Ot = {
549
547
  allowsTextContent: !1,
550
548
  allowsChildren: !0,
551
549
  allowedAttributes: [
@@ -554,138 +552,127 @@ const Q = {
554
552
  childTags: [
555
553
  "li"
556
554
  ]
557
- }, St = {
555
+ }, Ft = {
558
556
  allowsTextContent: !0,
559
557
  allowsChildren: !0,
560
558
  allowedAttributes: [
561
559
  "value"
562
560
  ],
563
561
  childTags: []
564
- }, Lt = {
562
+ }, Gt = {
565
563
  allowsTextContent: !1,
566
564
  allowsChildren: !1,
567
565
  allowedAttributes: []
568
- }, Mt = {
569
- $schema: it,
570
- div: ut,
571
- input: ct,
572
- checkbox: dt,
573
- colgroup: ft,
574
- col: gt,
575
- label: ht,
576
- form: bt,
577
- select: wt,
578
- p: mt,
579
- h1: pt,
580
- h2: yt,
581
- span: Tt,
582
- img: Ct,
583
- button: At,
584
- table: xt,
585
- thead: vt,
586
- tbody: jt,
587
- tfoot: Nt,
588
- tr: kt,
589
- th: $t,
590
- td: Et,
591
- datalist: Dt,
592
- option: Ot,
593
- header: It,
594
- a: Rt,
595
- i: Ft,
596
- small: Gt,
597
- ul: Ht,
598
- li: St,
599
- hr: Lt
600
- }, h = ({ inSpec: t }) => {
566
+ }, Rt = {
567
+ $schema: rt,
568
+ div: ot,
569
+ input: nt,
570
+ checkbox: at,
571
+ colgroup: st,
572
+ col: it,
573
+ label: ut,
574
+ form: ct,
575
+ select: dt,
576
+ p: ft,
577
+ h1: gt,
578
+ h2: ht,
579
+ span: bt,
580
+ img: wt,
581
+ button: mt,
582
+ table: pt,
583
+ thead: yt,
584
+ tbody: Tt,
585
+ tfoot: Ct,
586
+ tr: At,
587
+ th: xt,
588
+ td: vt,
589
+ datalist: jt,
590
+ option: Nt,
591
+ header: $t,
592
+ a: kt,
593
+ i: Dt,
594
+ small: Et,
595
+ ul: Ot,
596
+ li: Ft,
597
+ hr: Gt
598
+ }, f = ({ inSpec: t }) => {
601
599
  const e = t;
602
600
  if (!e) return [];
603
601
  if (Array.isArray(e))
604
- return e.flatMap((o) => h({ inSpec: o }));
602
+ return e.flatMap((r) => f({ inSpec: r }));
605
603
  if (typeof e != "object") return [];
606
604
  const l = [];
607
- return typeof e.tagName == "string" && e.tagName.trim().length > 0 && l.push(e.tagName.toLowerCase()), Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((o) => {
608
- const n = h({ inSpec: o });
605
+ return typeof e.tagName == "string" && e.tagName.trim().length > 0 && l.push(e.tagName.toLowerCase()), Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((r) => {
606
+ const n = f({ inSpec: r });
609
607
  l.push(...n);
610
608
  }), l;
611
609
  }, zt = ({ inTagsFound: t, inAllowedTags: e }) => {
612
- const l = t ?? [], o = e ?? {}, n = new Set(
613
- Object.keys(o).filter((i) => i !== "$schema").map((i) => i.toLowerCase())
614
- ), r = {}, a = [], s = [];
615
- l.forEach((i) => {
616
- r[i] = (r[i] || 0) + 1, n.has(i) ? a.includes(i) || a.push(i) : s.includes(i) || s.push(i);
610
+ const l = t ?? [], r = e ?? {}, n = new Set(
611
+ Object.keys(r).filter((s) => s !== "$schema").map((s) => s.toLowerCase())
612
+ ), o = {}, a = [], i = [];
613
+ l.forEach((s) => {
614
+ o[s] = (o[s] || 0) + 1, n.has(s) ? a.includes(s) || a.push(s) : i.includes(s) || i.push(s);
617
615
  });
618
- const u = l.length, c = s.length === 0;
616
+ const d = l.length, h = i.length === 0;
619
617
  return {
620
- totalTags: u,
621
- tagCounts: r,
622
- uniqueTags: Object.keys(r),
618
+ totalTags: d,
619
+ tagCounts: o,
620
+ uniqueTags: Object.keys(o),
623
621
  recognizedTags: a,
624
- unrecognizedTags: s,
625
- areAllTagsPresent: c
622
+ unrecognizedTags: i,
623
+ areAllTagsPresent: h
626
624
  };
627
- }, Pt = ({ inSpec: t, inTags: e = Mt } = {}) => {
628
- const l = t, o = e, n = h({ inSpec: l }), r = zt({
625
+ }, Mt = ({ inSpec: t, inTags: e = Rt } = {}) => {
626
+ const l = t, r = e, n = f({ inSpec: l }), o = zt({
629
627
  inTagsFound: n,
630
- inAllowedTags: o
628
+ inAllowedTags: r
631
629
  });
632
630
  return {
633
- areAllTagsPresent: r.areAllTagsPresent,
634
- totalTags: r.totalTags,
635
- tagCounts: r.tagCounts,
636
- uniqueTags: r.uniqueTags,
637
- recognizedTags: r.recognizedTags,
638
- unrecognizedTags: r.unrecognizedTags
631
+ areAllTagsPresent: o.areAllTagsPresent,
632
+ totalTags: o.totalTags,
633
+ tagCounts: o.tagCounts,
634
+ uniqueTags: o.uniqueTags,
635
+ recognizedTags: o.recognizedTags,
636
+ unrecognizedTags: o.unrecognizedTags
639
637
  };
640
- }, k = (t = {}) => {
638
+ }, C = (t = {}) => {
641
639
  const e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
642
- return N(e);
640
+ return T(e);
643
641
  };
644
- W({
645
- inFuncDefinition: k,
646
- inReviewSpec: Pt
642
+ _({
643
+ inFuncDefinition: C,
644
+ inReviewSpec: Mt
647
645
  });
648
- const Vt = ({
646
+ const St = ({
649
647
  inTargetHtmlId: t,
650
648
  inColumns: e,
651
- inData: l,
652
- inAppendPosition: o
649
+ type: l,
650
+ inData: r
653
651
  } = {}) => {
654
652
  debugger;
655
- const n = t;
656
- let s = v({
653
+ let a = p({
657
654
  type: "table",
658
- targetHtmlId: n,
659
- data: l ?? [],
655
+ data: r ?? [],
660
656
  columns: e
661
657
  });
662
- console.log("specAsJsonToDom : ", o, s);
663
- const u = document.getElementById(n), c = k(s);
664
- o === "prepend" ? u.prepend(c) : (u && (u.innerHTML = ""), u.append(c));
665
- }, T = {
666
- table: Vt
667
- }, qt = ({
658
+ return C(a);
659
+ }, It = ({
668
660
  type: t = "table",
669
661
  targetHtmlId: e,
670
662
  data: l,
671
- classToApply: o,
672
- inTargetHtmlId: n,
673
- inData: r,
674
- columns: a,
675
- inColumns: s,
676
- appendPosition: u
663
+ classToApply: r,
664
+ columns: n,
665
+ appendPosition: o
677
666
  } = {}) => {
678
- const c = t, i = typeof c == "string" ? c.toLowerCase() : "table", f = T[i];
679
- return f ? f({
680
- inTargetHtmlId: n ?? e,
681
- inColumns: s ?? a,
682
- inData: r ?? l,
683
- inAppendPosition: u
684
- }) : (console.error(
685
- `[Renderer] Unknown renderer type "${c}". Available types: ${Object.keys(T).join(", ")}`
686
- ), null);
667
+ const a = t, i = e, s = St({
668
+ inTargetHtmlId: i,
669
+ inColumns: n,
670
+ inData: l,
671
+ type: a
672
+ }), u = document.getElementById(i);
673
+ return o === "prepend" ? u.prepend(s) : (u && (u.innerHTML = ""), u.append(s)), u;
687
674
  };
688
- F(qt);
675
+ x(It);
689
676
  export {
690
- qt as default
677
+ It as default
691
678
  };