json-renderers 1.13.3 → 1.13.6

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