json-renderers 1.12.3 → 1.13.2

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.
Files changed (180) hide show
  1. package/docs/dist/v12/min.js +646 -646
  2. package/docs/dist/v13/min.js +691 -0
  3. package/docs/index.html +14 -0
  4. package/package.json +3 -3
  5. package/src/index.js +2 -2
  6. package/src/v13/index.js +46 -0
  7. package/src/{v10 → v13}/meta.js +1 -1
  8. package/src/{v9/table → v13/select}/index.js +4 -7
  9. package/src/v13/select/skeleton.json +18 -0
  10. package/src/v13/table/index.js +39 -0
  11. package/src/v10/dataLists/fragments.json +0 -1
  12. package/src/v10/dataLists/index.js +0 -32
  13. package/src/v10/dataLists/skeleton.json +0 -38
  14. package/src/v10/index.js +0 -142
  15. package/src/v10/select/fragments.json +0 -1
  16. package/src/v10/select/index.js +0 -34
  17. package/src/v10/select/skeleton.json +0 -23
  18. package/src/v10/table/index.js +0 -35
  19. package/src/v5/dataLists/fragments.json +0 -1
  20. package/src/v5/dataLists/index.js +0 -26
  21. package/src/v5/dataLists/skeleton.json +0 -20
  22. package/src/v5/form/attachFormClickEventListener.js +0 -27
  23. package/src/v5/form/clickFunc/extractFormData.js +0 -27
  24. package/src/v5/form/clickFunc/handleNew.js +0 -24
  25. package/src/v5/form/clickFunc/handleSave.js +0 -33
  26. package/src/v5/form/clickFunc/index.js +0 -32
  27. package/src/v5/form/index.js +0 -87
  28. package/src/v5/form/structure.json +0 -410
  29. package/src/v5/index.js +0 -150
  30. package/src/v5/meta.js +0 -6
  31. package/src/v5/navTabs/fragments.json +0 -59
  32. package/src/v5/navTabs/index.js +0 -82
  33. package/src/v5/navTabs/skeleton.json +0 -18
  34. package/src/v5/registerGlobal.js +0 -14
  35. package/src/v5/select/fragments.json +0 -1
  36. package/src/v5/select/index.js +0 -31
  37. package/src/v5/select/skeleton.json +0 -21
  38. package/src/v5/table/attachTableClickEventListener.js +0 -22
  39. package/src/v5/table/buildTableDataAsJson.js +0 -19
  40. package/src/v5/table/buildTableDomElement.js +0 -21
  41. package/src/v5/table/buildTableStructureSpec.js +0 -28
  42. package/src/v5/table/clickFunc/v3/createTable.js +0 -16
  43. package/src/v5/table/clickFunc/v3/getContainer/extractClickedRowDetails.js +0 -23
  44. package/src/v5/table/clickFunc/v3/getContainer/getOrCreateChildTableContainer.js +0 -21
  45. package/src/v5/table/clickFunc/v3/getContainer/index.js +0 -39
  46. package/src/v5/table/clickFunc/v3/getContainer/isSameRowClickedToToggleOff.js +0 -14
  47. package/src/v5/table/clickFunc/v3/getContainer/resetAndShowChildTableContainer.js +0 -12
  48. package/src/v5/table/clickFunc/v3/index.js +0 -21
  49. package/src/v5/table/fragments.json +0 -112
  50. package/src/v5/table/index.js +0 -72
  51. package/src/v5/table/resolveTargetContainer.js +0 -9
  52. package/src/v5/table/skeleton.json +0 -371
  53. package/src/v6/dataLists/fragments.json +0 -1
  54. package/src/v6/dataLists/index.js +0 -32
  55. package/src/v6/dataLists/skeleton.json +0 -38
  56. package/src/v6/form/attachFormClickEventListener.js +0 -27
  57. package/src/v6/form/clickFunc/extractFormData.js +0 -27
  58. package/src/v6/form/clickFunc/handleNew.js +0 -24
  59. package/src/v6/form/clickFunc/handleSave.js +0 -33
  60. package/src/v6/form/clickFunc/index.js +0 -32
  61. package/src/v6/form/index.js +0 -87
  62. package/src/v6/form/structure.json +0 -410
  63. package/src/v6/index.js +0 -150
  64. package/src/v6/meta.js +0 -6
  65. package/src/v6/navTabs/fragments.json +0 -59
  66. package/src/v6/navTabs/index.js +0 -82
  67. package/src/v6/navTabs/skeleton.json +0 -18
  68. package/src/v6/registerGlobal.js +0 -14
  69. package/src/v6/select/fragments.json +0 -1
  70. package/src/v6/select/index.js +0 -34
  71. package/src/v6/select/skeleton.json +0 -23
  72. package/src/v6/table/attachTableClickEventListener.js +0 -22
  73. package/src/v6/table/buildTableDataAsJson.js +0 -19
  74. package/src/v6/table/buildTableDomElement.js +0 -21
  75. package/src/v6/table/buildTableStructureSpec.js +0 -28
  76. package/src/v6/table/clickFunc/v3/createTable.js +0 -16
  77. package/src/v6/table/clickFunc/v3/getContainer/extractClickedRowDetails.js +0 -23
  78. package/src/v6/table/clickFunc/v3/getContainer/getOrCreateChildTableContainer.js +0 -21
  79. package/src/v6/table/clickFunc/v3/getContainer/index.js +0 -39
  80. package/src/v6/table/clickFunc/v3/getContainer/isSameRowClickedToToggleOff.js +0 -14
  81. package/src/v6/table/clickFunc/v3/getContainer/resetAndShowChildTableContainer.js +0 -12
  82. package/src/v6/table/clickFunc/v3/index.js +0 -21
  83. package/src/v6/table/fragments.json +0 -112
  84. package/src/v6/table/index.js +0 -72
  85. package/src/v6/table/resolveTargetContainer.js +0 -9
  86. package/src/v6/table/skeleton.json +0 -371
  87. package/src/v7/common/deriveColumnsFromData.js +0 -20
  88. package/src/v7/dataLists/fragments.json +0 -1
  89. package/src/v7/dataLists/index.js +0 -32
  90. package/src/v7/dataLists/skeleton.json +0 -38
  91. package/src/v7/form/attachFormClickEventListener.js +0 -27
  92. package/src/v7/form/clickFunc/extractFormData.js +0 -27
  93. package/src/v7/form/clickFunc/handleNew.js +0 -24
  94. package/src/v7/form/clickFunc/handleSave.js +0 -33
  95. package/src/v7/form/clickFunc/index.js +0 -32
  96. package/src/v7/form/index.js +0 -87
  97. package/src/v7/form/structure.json +0 -410
  98. package/src/v7/index.js +0 -141
  99. package/src/v7/meta.js +0 -6
  100. package/src/v7/navTabs/fragments.json +0 -59
  101. package/src/v7/navTabs/index.js +0 -82
  102. package/src/v7/navTabs/skeleton.json +0 -18
  103. package/src/v7/registerGlobal.js +0 -14
  104. package/src/v7/select/fragments.json +0 -1
  105. package/src/v7/select/index.js +0 -34
  106. package/src/v7/select/skeleton.json +0 -23
  107. package/src/v7/table/attachTableClickEventListener.js +0 -28
  108. package/src/v7/table/buildTableDataAsJson.js +0 -25
  109. package/src/v7/table/buildTableDomElement.js +0 -25
  110. package/src/v7/table/buildTableStructureSpec.js +0 -33
  111. package/src/v7/table/clickFunc/v3/createTable.js +0 -20
  112. package/src/v7/table/clickFunc/v3/getContainer/extractClickedRowDetails.js +0 -27
  113. package/src/v7/table/clickFunc/v3/getContainer/getOrCreateChildTableContainer.js +0 -24
  114. package/src/v7/table/clickFunc/v3/getContainer/index.js +0 -44
  115. package/src/v7/table/clickFunc/v3/getContainer/isSameRowClickedToToggleOff.js +0 -17
  116. package/src/v7/table/clickFunc/v3/getContainer/resetAndShowChildTableContainer.js +0 -15
  117. package/src/v7/table/clickFunc/v3/index.js +0 -35
  118. package/src/v7/table/fragments.json +0 -112
  119. package/src/v7/table/index.js +0 -82
  120. package/src/v7/table/resolveTargetContainer.js +0 -11
  121. package/src/v7/table/skeleton.json +0 -371
  122. package/src/v8/common/deriveColumnsFromData.js +0 -20
  123. package/src/v8/dataLists/fragments.json +0 -1
  124. package/src/v8/dataLists/index.js +0 -32
  125. package/src/v8/dataLists/skeleton.json +0 -38
  126. package/src/v8/form/attachFormClickEventListener.js +0 -27
  127. package/src/v8/form/clickFunc/extractFormData.js +0 -27
  128. package/src/v8/form/clickFunc/handleNew.js +0 -24
  129. package/src/v8/form/clickFunc/handleSave.js +0 -33
  130. package/src/v8/form/clickFunc/index.js +0 -32
  131. package/src/v8/form/index.js +0 -87
  132. package/src/v8/form/structure.json +0 -410
  133. package/src/v8/index.js +0 -141
  134. package/src/v8/meta.js +0 -6
  135. package/src/v8/navTabs/fragments.json +0 -59
  136. package/src/v8/navTabs/index.js +0 -82
  137. package/src/v8/navTabs/skeleton.json +0 -18
  138. package/src/v8/registerGlobal.js +0 -14
  139. package/src/v8/select/fragments.json +0 -1
  140. package/src/v8/select/index.js +0 -34
  141. package/src/v8/select/skeleton.json +0 -23
  142. package/src/v8/table/attachTableClickEventListener.js +0 -28
  143. package/src/v8/table/buildTableDataAsJson.js +0 -25
  144. package/src/v8/table/buildTableDomElement.js +0 -25
  145. package/src/v8/table/buildTableStructureSpec.js +0 -33
  146. package/src/v8/table/clickFunc/v3/createTable.js +0 -20
  147. package/src/v8/table/clickFunc/v3/getContainer/extractClickedRowDetails.js +0 -27
  148. package/src/v8/table/clickFunc/v3/getContainer/getOrCreateChildTableContainer.js +0 -24
  149. package/src/v8/table/clickFunc/v3/getContainer/index.js +0 -44
  150. package/src/v8/table/clickFunc/v3/getContainer/isSameRowClickedToToggleOff.js +0 -17
  151. package/src/v8/table/clickFunc/v3/getContainer/resetAndShowChildTableContainer.js +0 -15
  152. package/src/v8/table/clickFunc/v3/index.js +0 -35
  153. package/src/v8/table/fragments.json +0 -112
  154. package/src/v8/table/index.js +0 -82
  155. package/src/v8/table/resolveTargetContainer.js +0 -11
  156. package/src/v8/table/skeleton.json +0 -371
  157. package/src/v9/common/deriveColumnsFromData.js +0 -20
  158. package/src/v9/dataLists/fragments.json +0 -1
  159. package/src/v9/dataLists/index.js +0 -32
  160. package/src/v9/dataLists/skeleton.json +0 -38
  161. package/src/v9/form/attachFormClickEventListener.js +0 -27
  162. package/src/v9/form/clickFunc/extractFormData.js +0 -27
  163. package/src/v9/form/clickFunc/handleNew.js +0 -24
  164. package/src/v9/form/clickFunc/handleSave.js +0 -33
  165. package/src/v9/form/clickFunc/index.js +0 -32
  166. package/src/v9/form/index.js +0 -87
  167. package/src/v9/form/structure.json +0 -410
  168. package/src/v9/index.js +0 -141
  169. package/src/v9/meta.js +0 -6
  170. package/src/v9/navTabs/fragments.json +0 -59
  171. package/src/v9/navTabs/index.js +0 -82
  172. package/src/v9/navTabs/skeleton.json +0 -18
  173. package/src/v9/registerGlobal.js +0 -14
  174. package/src/v9/select/fragments.json +0 -1
  175. package/src/v9/select/index.js +0 -34
  176. package/src/v9/select/skeleton.json +0 -23
  177. package/src/v9/table/skeleton.json +0 -47
  178. /package/src/{v10 → v13}/common/deriveColumnsFromData.js +0 -0
  179. /package/src/{v10 → v13}/registerGlobal.js +0 -0
  180. /package/src/{v10 → v13}/table/skeleton.json +0 -0
@@ -1,646 +1,646 @@
1
- const F = {
2
- version: "v12.0.0",
3
- description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
4
- }, S = (t) => {
5
- var e;
6
- typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderers ?? (e.jsonRenderers = {
7
- meta: F,
8
- renderToDom: t
9
- }));
10
- }, D = {
11
- version: "v32",
12
- description: "JSON-to-DOM engine with centralized traversal and responsibility-focused construction"
13
- }, G = ({ inFuncDefinition: t } = {}) => {
14
- if (typeof globalThis > "u" || !t) return;
15
- globalThis.ks ?? (globalThis.ks = {});
16
- const e = {
17
- meta: D,
18
- buildSpecElement: t
19
- };
20
- globalThis.ks.jsonToSpec = e;
21
- }, z = (t, e) => d(t, e), b = (t, e) => Array.isArray(t) ? t.map((l) => z(l, e)).flat(1 / 0).filter(Boolean) : [], I = (t, e) => {
22
- if ("source" in t && (t == null ? void 0 : t.source) in e) {
23
- const l = e[t == null ? void 0 : t.source];
24
- if (Array.isArray(l))
25
- return l.map((n) => {
26
- const r = t == null ? void 0 : t.template;
27
- if (r)
28
- return d(r, n);
29
- });
30
- }
31
- }, L = (t, e) => {
32
- let l = [];
33
- for (const [o, n] of Object.entries(e)) {
34
- const r = t == null ? void 0 : t.template;
35
- if (r) {
36
- const a = d(r, {
37
- key: o,
38
- value: n
39
- });
40
- l.push(a);
41
- }
42
- }
43
- return l;
44
- }, R = (t, e) => {
45
- if ("source" in t && (t == null ? void 0 : t.source) in e) {
46
- const l = e[t == null ? void 0 : t.source];
47
- if (Array.isArray(l))
48
- return l.map((n) => {
49
- const r = t == null ? void 0 : t.template;
50
- if (r)
51
- return d(r, n);
52
- });
53
- }
54
- }, M = (t, e) => {
55
- if ("operation" in t) {
56
- if (t.operation === "loopArray")
57
- return I(t, e);
58
- if (t.operation === "loopObject")
59
- return L(t, e);
60
- if (t.operation === "loopCollection")
61
- return R(t, e);
62
- }
63
- }, m = (t, e) => {
64
- if (typeof e == "string") return e;
65
- if (typeof t != "string") return t;
66
- if (t === "${value}")
67
- return e.value;
68
- const l = t.match(/^\$\{(.+?)\}$/);
69
- if (l) {
70
- const o = l[1];
71
- return (e == null ? void 0 : e[o]) ?? "";
72
- }
73
- return t;
74
- }, V = (t, e) => {
75
- let l = {};
76
- for (const [o, n] of Object.entries(t)) {
77
- const r = m(n, e);
78
- l[o] = r;
79
- }
80
- return l;
81
- }, q = (t, e) => {
82
- if ("tagName" in t) {
83
- if ("textContent" in t) {
84
- const l = m(t.textContent, e);
85
- t.textContent = l;
86
- }
87
- if ("attributes" in t) {
88
- const l = V(t.attributes, e);
89
- t.attributes = l;
90
- }
91
- }
92
- }, P = (t, e) => {
93
- if (!t || typeof t != "object" || Array.isArray(t)) return null;
94
- const l = structuredClone(t);
95
- if (!l) return null;
96
- if ("tagName" in l && q(l, e), "jsonToSpec" in l) {
97
- const o = l == null ? void 0 : l.jsonToSpec, n = M(o, e);
98
- Array.isArray(n) ? l.children = n : l.children = [n], delete l.jsonToSpec;
99
- }
100
- if (Array.isArray(l == null ? void 0 : l.children)) {
101
- const o = b(l == null ? void 0 : l.children, e);
102
- l.children = o;
103
- }
104
- return l;
105
- }, d = (t, e) => {
106
- if (t == null) return null;
107
- debugger;
108
- return typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? b(t, e) : typeof t == "object" ? P(t, e) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : t;
109
- }, y = (t, e) => d(t, e);
110
- G({
111
- inFuncDefinition: y
112
- });
113
- const H = {
114
- version: "v9",
115
- description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
116
- }, B = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
117
- if (typeof globalThis > "u" || !t) return;
118
- globalThis.ks ?? (globalThis.ks = {});
119
- const l = {
120
- meta: H,
121
- buildSpecElement: t,
122
- reviewSpec: e
123
- };
124
- globalThis.ks["json-to-tag"] = l, globalThis.ks.jsonToTag = l;
125
- }, _ = (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), p = (t) => Array.isArray(t) ? t.map(_).flat(1 / 0).filter(Boolean) : [], U = (t) => (t == null, t), K = "http://www.w3.org/2000/svg", X = /* @__PURE__ */ new Set([
126
- "svg",
127
- "path",
128
- "symbol",
129
- "use",
130
- "g",
131
- "circle",
132
- "ellipse",
133
- "rect",
134
- "line",
135
- "polyline",
136
- "polygon",
137
- "text",
138
- "tspan",
139
- "defs",
140
- "clippath",
141
- "mask",
142
- "pattern",
143
- "marker",
144
- "lineargradient",
145
- "radialgradient",
146
- "stop",
147
- "image",
148
- "filter",
149
- "fegaussianblur",
150
- "femerge",
151
- "femergenode"
152
- ]), Q = ({ inTagName: t }) => {
153
- const e = t == null ? void 0 : t.toLowerCase();
154
- if (!e) return null;
155
- if (e === "checkbox") {
156
- const l = document.createElement("input");
157
- return l.type = "checkbox", l;
158
- }
159
- return X.has(e) ? document.createElementNS(K, e) : document.createElement(e);
160
- }, W = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), Y = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), Z = "http://www.w3.org/1999/xlink", J = ({ inElement: t, inAttributes: e }) => {
161
- const l = t, o = e;
162
- if (!l || !o || typeof o != "object")
163
- return l;
164
- const n = typeof SVGElement < "u" ? l instanceof SVGElement : l.namespaceURI === "http://www.w3.org/2000/svg";
165
- return Object.entries(o).forEach(([r, a]) => {
166
- if (r === "class") {
167
- n ? l.setAttribute("class", String(a)) : l.className = a;
168
- return;
169
- }
170
- if (r === "xlink:href" || r === "href") {
171
- if (a != null) {
172
- const s = String(a);
173
- if (n)
174
- try {
175
- l.setAttributeNS(Z, "href", s);
176
- } catch {
177
- }
178
- l.setAttribute("href", s), l.setAttribute("xlink:href", s);
179
- }
180
- return;
181
- }
182
- if (typeof a == "boolean") {
183
- a ? l.setAttribute(r, "") : l.removeAttribute(r);
184
- return;
185
- }
186
- a != null && l.setAttribute(r, String(a));
187
- }), l;
188
- }, tt = ({ inElement: t, inClassList: e }) => {
189
- if (!t || !e) return t;
190
- const l = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((o) => typeof o == "string" && o.trim()) : [];
191
- return l.length && t.classList.add(...l), t;
192
- }, et = (t) => {
193
- if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
194
- const e = Q({ inTagName: t.tagName });
195
- if (!e) return null;
196
- if (W({
197
- inElement: e,
198
- inTextContent: U(t.textContent),
199
- inTagName: t.tagName
200
- }), Y({
201
- inElement: e,
202
- inProperties: t.properties
203
- }), J({
204
- inElement: e,
205
- inAttributes: t.attributes
206
- }), tt({
207
- inElement: e,
208
- inClassList: t.classList
209
- }), Array.isArray(t.children)) {
210
- const l = p(t.children);
211
- l.length && e.append(...l);
212
- }
213
- return e;
214
- }, T = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? p(t) : typeof t == "object" ? et(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, lt = "./tags.schema.json", rt = {
215
- allowsTextContent: !1,
216
- allowsChildren: !0,
217
- allowedAttributes: [
218
- "title",
219
- "role"
220
- ],
221
- childTags: []
222
- }, ot = {
223
- allowsTextContent: !1,
224
- allowsChildren: !1,
225
- allowedAttributes: [
226
- "type",
227
- "placeholder",
228
- "value",
229
- "name",
230
- "disabled",
231
- "readonly",
232
- "required",
233
- "list"
234
- ]
235
- }, nt = {
236
- allowsTextContent: !1,
237
- allowsChildren: !1,
238
- allowedAttributes: [
239
- "type",
240
- "checked",
241
- "name",
242
- "value",
243
- "disabled",
244
- "required"
245
- ]
246
- }, at = {
247
- allowsTextContent: !1,
248
- allowsChildren: !0,
249
- allowedAttributes: [
250
- "span"
251
- ],
252
- childTags: [
253
- "col"
254
- ]
255
- }, st = {
256
- allowsTextContent: !1,
257
- allowsChildren: !1,
258
- allowedAttributes: [
259
- "span",
260
- "style",
261
- "width"
262
- ]
263
- }, it = {
264
- allowsTextContent: !0,
265
- allowsChildren: !0,
266
- allowedAttributes: [
267
- "for"
268
- ],
269
- childTags: []
270
- }, ut = {
271
- allowsTextContent: !1,
272
- allowsChildren: !0,
273
- allowedAttributes: [
274
- "action",
275
- "method",
276
- "autocomplete",
277
- "enctype",
278
- "name",
279
- "novalidate",
280
- "target"
281
- ],
282
- childTags: []
283
- }, ct = {
284
- allowsTextContent: !1,
285
- allowsChildren: !0,
286
- allowedAttributes: [
287
- "name",
288
- "disabled",
289
- "required",
290
- "multiple",
291
- "size"
292
- ],
293
- childTags: [
294
- "option"
295
- ]
296
- }, dt = {
297
- allowsTextContent: !0,
298
- allowsChildren: !0,
299
- allowedAttributes: [],
300
- childTags: []
301
- }, ft = {
302
- allowsTextContent: !0,
303
- allowsChildren: !0,
304
- allowedAttributes: [],
305
- childTags: []
306
- }, ht = {
307
- allowsTextContent: !0,
308
- allowsChildren: !0,
309
- allowedAttributes: [],
310
- childTags: []
311
- }, gt = {
312
- allowsTextContent: !0,
313
- allowsChildren: !0,
314
- allowedAttributes: [],
315
- childTags: []
316
- }, wt = {
317
- allowsTextContent: !1,
318
- allowsChildren: !1,
319
- allowedAttributes: [
320
- "src",
321
- "alt",
322
- "width",
323
- "height",
324
- "loading"
325
- ]
326
- }, bt = {
327
- allowsTextContent: !0,
328
- allowsChildren: !0,
329
- allowedAttributes: [
330
- "type",
331
- "disabled",
332
- "name",
333
- "value"
334
- ],
335
- childTags: []
336
- }, mt = {
337
- allowsTextContent: !1,
338
- allowsChildren: !0,
339
- allowedAttributes: [
340
- "border",
341
- "cellpadding",
342
- "cellspacing"
343
- ],
344
- childTags: [
345
- "caption",
346
- "colgroup",
347
- "thead",
348
- "tbody",
349
- "tfoot",
350
- "tr"
351
- ]
352
- }, yt = {
353
- allowsTextContent: !1,
354
- allowsChildren: !0,
355
- allowedAttributes: [],
356
- childTags: [
357
- "tr"
358
- ]
359
- }, pt = {
360
- allowsTextContent: !1,
361
- allowsChildren: !0,
362
- allowedAttributes: [],
363
- childTags: [
364
- "tr"
365
- ]
366
- }, Tt = {
367
- allowsTextContent: !1,
368
- allowsChildren: !0,
369
- allowedAttributes: [],
370
- childTags: [
371
- "tr"
372
- ]
373
- }, Ct = {
374
- allowsTextContent: !1,
375
- allowsChildren: !0,
376
- allowedAttributes: [],
377
- childTags: [
378
- "td",
379
- "th"
380
- ]
381
- }, At = {
382
- allowsTextContent: !0,
383
- allowsChildren: !0,
384
- allowedAttributes: [
385
- "scope",
386
- "colspan",
387
- "rowspan"
388
- ],
389
- childTags: []
390
- }, xt = {
391
- allowsTextContent: !0,
392
- allowsChildren: !0,
393
- allowedAttributes: [
394
- "colspan",
395
- "rowspan"
396
- ],
397
- childTags: []
398
- }, vt = {
399
- allowsTextContent: !1,
400
- allowsChildren: !0,
401
- allowedAttributes: [],
402
- childTags: [
403
- "option"
404
- ]
405
- }, jt = {
406
- allowsTextContent: !0,
407
- allowsChildren: !1,
408
- allowedAttributes: [
409
- "value",
410
- "label",
411
- "selected",
412
- "disabled"
413
- ]
414
- }, Nt = {
415
- allowsTextContent: !1,
416
- allowsChildren: !0,
417
- allowedAttributes: [
418
- "role"
419
- ],
420
- childTags: []
421
- }, kt = {
422
- allowsTextContent: !0,
423
- allowsChildren: !0,
424
- allowedAttributes: [
425
- "href",
426
- "target",
427
- "rel",
428
- "title",
429
- "download"
430
- ],
431
- childTags: []
432
- }, $t = {
433
- allowsTextContent: !0,
434
- allowsChildren: !0,
435
- allowedAttributes: [
436
- "aria-hidden"
437
- ],
438
- childTags: []
439
- }, Et = {
440
- allowsTextContent: !0,
441
- allowsChildren: !0,
442
- allowedAttributes: [],
443
- childTags: []
444
- }, Ot = {
445
- allowsTextContent: !1,
446
- allowsChildren: !0,
447
- allowedAttributes: [
448
- "type"
449
- ],
450
- childTags: [
451
- "li"
452
- ]
453
- }, Ft = {
454
- allowsTextContent: !0,
455
- allowsChildren: !0,
456
- allowedAttributes: [
457
- "value"
458
- ],
459
- childTags: []
460
- }, St = {
461
- allowsTextContent: !1,
462
- allowsChildren: !1,
463
- allowedAttributes: []
464
- }, Dt = {
465
- $schema: lt,
466
- div: rt,
467
- input: ot,
468
- checkbox: nt,
469
- colgroup: at,
470
- col: st,
471
- label: it,
472
- form: ut,
473
- select: ct,
474
- p: dt,
475
- h1: ft,
476
- h2: ht,
477
- span: gt,
478
- img: wt,
479
- button: bt,
480
- table: mt,
481
- thead: yt,
482
- tbody: pt,
483
- tfoot: Tt,
484
- tr: Ct,
485
- th: At,
486
- td: xt,
487
- datalist: vt,
488
- option: jt,
489
- header: Nt,
490
- a: kt,
491
- i: $t,
492
- small: Et,
493
- ul: Ot,
494
- li: Ft,
495
- hr: St
496
- }, h = ({ inSpec: t }) => {
497
- const e = t;
498
- if (!e) return [];
499
- if (Array.isArray(e))
500
- return e.flatMap((o) => h({ inSpec: o }));
501
- if (typeof e != "object") return [];
502
- const l = [];
503
- 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) => {
504
- const n = h({ inSpec: o });
505
- l.push(...n);
506
- }), l;
507
- }, Gt = ({ inTagsFound: t, inAllowedTags: e }) => {
508
- const l = t ?? [], o = e ?? {}, n = new Set(
509
- Object.keys(o).filter((i) => i !== "$schema").map((i) => i.toLowerCase())
510
- ), r = {}, a = [], s = [];
511
- l.forEach((i) => {
512
- r[i] = (r[i] || 0) + 1, n.has(i) ? a.includes(i) || a.push(i) : s.includes(i) || s.push(i);
513
- });
514
- const u = l.length, c = s.length === 0;
515
- return {
516
- totalTags: u,
517
- tagCounts: r,
518
- uniqueTags: Object.keys(r),
519
- recognizedTags: a,
520
- unrecognizedTags: s,
521
- areAllTagsPresent: c
522
- };
523
- }, zt = ({ inSpec: t, inTags: e = Dt } = {}) => {
524
- const l = t, o = e, n = h({ inSpec: l }), r = Gt({
525
- inTagsFound: n,
526
- inAllowedTags: o
527
- });
528
- return {
529
- areAllTagsPresent: r.areAllTagsPresent,
530
- totalTags: r.totalTags,
531
- tagCounts: r.tagCounts,
532
- uniqueTags: r.uniqueTags,
533
- recognizedTags: r.recognizedTags,
534
- unrecognizedTags: r.unrecognizedTags
535
- };
536
- }, C = (t = {}) => {
537
- const e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
538
- return T(e);
539
- };
540
- B({
541
- inFuncDefinition: C,
542
- inReviewSpec: zt
543
- });
544
- const It = {
545
- default: {
546
- tagName: "table",
547
- attributes: {
548
- class: "table table-hover table-striped mb-0"
549
- },
550
- children: [
551
- {
552
- tagName: "thead",
553
- children: [
554
- {
555
- tagName: "tr",
556
- jsonToSpec: {
557
- operation: "loopCollection",
558
- source: "columns",
559
- template: {
560
- tagName: "th",
561
- textContent: "${title}"
562
- }
563
- },
564
- children: []
565
- }
566
- ]
567
- },
568
- {
569
- tagName: "tbody",
570
- jsonToSpec: {
571
- operation: "loopCollection",
572
- source: "data",
573
- template: {
574
- tagName: "tr",
575
- jsonToSpec: {
576
- operation: "loopObject",
577
- source: "data",
578
- template: {
579
- tagName: "td",
580
- textContent: "${value}"
581
- }
582
- },
583
- children: []
584
- }
585
- },
586
- children: []
587
- }
588
- ]
589
- }
590
- }, Lt = ({
591
- targetHtmlId: t,
592
- inTargetHtmlId: e,
593
- inColumns: l,
594
- inData: o
595
- } = {}) => {
596
- const n = e ?? t, r = o ?? [], a = l;
597
- let s = y(It.default, {
598
- columns: a,
599
- data: r
600
- });
601
- "tagName" in s || (s = s.children);
602
- const u = document.getElementById(n);
603
- u && (u.innerHTML = "");
604
- const c = C(s);
605
- u.append(c);
606
- }, w = {
607
- table: Lt
608
- }, Rt = ({
609
- type: t = "table",
610
- targetHtmlId: e,
611
- data: l,
612
- classToApply: o,
613
- inTargetHtmlId: n,
614
- inData: r,
615
- columns: a,
616
- inColumns: s,
617
- colGroup: u,
618
- inColGroup: c,
619
- footerData: i,
620
- inFooterData: A,
621
- config: x,
622
- inConfig: v,
623
- variant: j,
624
- skeletonType: N,
625
- inSkeletonType: k,
626
- showLog: $ = !1,
627
- inShowLog: E
628
- } = {}) => {
629
- const f = t, O = typeof f == "string" ? f.toLowerCase() : "table", g = w[O];
630
- return g ? g({
631
- targetHtmlId: n ?? e,
632
- inColumns: s ?? a,
633
- inData: r ?? l,
634
- inColGroup: c ?? u,
635
- inFooterData: A ?? i ?? [],
636
- inConfig: v ?? x ?? {},
637
- inSkeletonType: k ?? N ?? j ?? "default",
638
- inShowLog: E ?? $ ?? !1
639
- }) : (console.error(
640
- `[Renderer] Unknown renderer type "${f}". Available types: ${Object.keys(w).join(", ")}`
641
- ), null);
642
- };
643
- S(Rt);
644
- export {
645
- Rt as default
646
- };
1
+ const F = {
2
+ version: "v12.0.0",
3
+ description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
4
+ }, S = (t) => {
5
+ var e;
6
+ typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderers ?? (e.jsonRenderers = {
7
+ meta: F,
8
+ renderToDom: t
9
+ }));
10
+ }, D = {
11
+ version: "v32",
12
+ description: "JSON-to-DOM engine with centralized traversal and responsibility-focused construction"
13
+ }, G = ({ inFuncDefinition: t } = {}) => {
14
+ if (typeof globalThis > "u" || !t) return;
15
+ globalThis.ks ?? (globalThis.ks = {});
16
+ const e = {
17
+ meta: D,
18
+ buildSpecElement: t
19
+ };
20
+ globalThis.ks.jsonToSpec = e;
21
+ }, z = (t, e) => d(t, e), b = (t, e) => Array.isArray(t) ? t.map((l) => z(l, e)).flat(1 / 0).filter(Boolean) : [], I = (t, e) => {
22
+ if ("source" in t && (t == null ? void 0 : t.source) in e) {
23
+ const l = e[t == null ? void 0 : t.source];
24
+ if (Array.isArray(l))
25
+ return l.map((n) => {
26
+ const r = t == null ? void 0 : t.template;
27
+ if (r)
28
+ return d(r, n);
29
+ });
30
+ }
31
+ }, L = (t, e) => {
32
+ let l = [];
33
+ for (const [o, n] of Object.entries(e)) {
34
+ const r = t == null ? void 0 : t.template;
35
+ if (r) {
36
+ const a = d(r, {
37
+ key: o,
38
+ value: n
39
+ });
40
+ l.push(a);
41
+ }
42
+ }
43
+ return l;
44
+ }, R = (t, e) => {
45
+ if ("source" in t && (t == null ? void 0 : t.source) in e) {
46
+ const l = e[t == null ? void 0 : t.source];
47
+ if (Array.isArray(l))
48
+ return l.map((n) => {
49
+ const r = t == null ? void 0 : t.template;
50
+ if (r)
51
+ return d(r, n);
52
+ });
53
+ }
54
+ }, M = (t, e) => {
55
+ if ("operation" in t) {
56
+ if (t.operation === "loopArray")
57
+ return I(t, e);
58
+ if (t.operation === "loopObject")
59
+ return L(t, e);
60
+ if (t.operation === "loopCollection")
61
+ return R(t, e);
62
+ }
63
+ }, m = (t, e) => {
64
+ if (typeof e == "string") return e;
65
+ if (typeof t != "string") return t;
66
+ if (t === "${value}")
67
+ return e.value;
68
+ const l = t.match(/^\$\{(.+?)\}$/);
69
+ if (l) {
70
+ const o = l[1];
71
+ return (e == null ? void 0 : e[o]) ?? "";
72
+ }
73
+ return t;
74
+ }, V = (t, e) => {
75
+ let l = {};
76
+ for (const [o, n] of Object.entries(t)) {
77
+ const r = m(n, e);
78
+ l[o] = r;
79
+ }
80
+ return l;
81
+ }, q = (t, e) => {
82
+ if ("tagName" in t) {
83
+ if ("textContent" in t) {
84
+ const l = m(t.textContent, e);
85
+ t.textContent = l;
86
+ }
87
+ if ("attributes" in t) {
88
+ const l = V(t.attributes, e);
89
+ t.attributes = l;
90
+ }
91
+ }
92
+ }, P = (t, e) => {
93
+ if (!t || typeof t != "object" || Array.isArray(t)) return null;
94
+ const l = structuredClone(t);
95
+ if (!l) return null;
96
+ if ("tagName" in l && q(l, e), "jsonToSpec" in l) {
97
+ const o = l == null ? void 0 : l.jsonToSpec, n = M(o, e);
98
+ Array.isArray(n) ? l.children = n : l.children = [n], delete l.jsonToSpec;
99
+ }
100
+ if (Array.isArray(l == null ? void 0 : l.children)) {
101
+ const o = b(l == null ? void 0 : l.children, e);
102
+ l.children = o;
103
+ }
104
+ return l;
105
+ }, d = (t, e) => {
106
+ if (t == null) return null;
107
+ debugger;
108
+ return typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? b(t, e) : typeof t == "object" ? P(t, e) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : t;
109
+ }, y = (t, e) => d(t, e);
110
+ G({
111
+ inFuncDefinition: y
112
+ });
113
+ const H = {
114
+ version: "v9",
115
+ description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
116
+ }, B = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
117
+ if (typeof globalThis > "u" || !t) return;
118
+ globalThis.ks ?? (globalThis.ks = {});
119
+ const l = {
120
+ meta: H,
121
+ buildSpecElement: t,
122
+ reviewSpec: e
123
+ };
124
+ globalThis.ks["json-to-tag"] = l, globalThis.ks.jsonToTag = l;
125
+ }, _ = (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), p = (t) => Array.isArray(t) ? t.map(_).flat(1 / 0).filter(Boolean) : [], U = (t) => (t == null, t), K = "http://www.w3.org/2000/svg", X = /* @__PURE__ */ new Set([
126
+ "svg",
127
+ "path",
128
+ "symbol",
129
+ "use",
130
+ "g",
131
+ "circle",
132
+ "ellipse",
133
+ "rect",
134
+ "line",
135
+ "polyline",
136
+ "polygon",
137
+ "text",
138
+ "tspan",
139
+ "defs",
140
+ "clippath",
141
+ "mask",
142
+ "pattern",
143
+ "marker",
144
+ "lineargradient",
145
+ "radialgradient",
146
+ "stop",
147
+ "image",
148
+ "filter",
149
+ "fegaussianblur",
150
+ "femerge",
151
+ "femergenode"
152
+ ]), Q = ({ inTagName: t }) => {
153
+ const e = t == null ? void 0 : t.toLowerCase();
154
+ if (!e) return null;
155
+ if (e === "checkbox") {
156
+ const l = document.createElement("input");
157
+ return l.type = "checkbox", l;
158
+ }
159
+ return X.has(e) ? document.createElementNS(K, e) : document.createElement(e);
160
+ }, W = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), Y = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), Z = "http://www.w3.org/1999/xlink", J = ({ inElement: t, inAttributes: e }) => {
161
+ const l = t, o = e;
162
+ if (!l || !o || typeof o != "object")
163
+ return l;
164
+ const n = typeof SVGElement < "u" ? l instanceof SVGElement : l.namespaceURI === "http://www.w3.org/2000/svg";
165
+ return Object.entries(o).forEach(([r, a]) => {
166
+ if (r === "class") {
167
+ n ? l.setAttribute("class", String(a)) : l.className = a;
168
+ return;
169
+ }
170
+ if (r === "xlink:href" || r === "href") {
171
+ if (a != null) {
172
+ const s = String(a);
173
+ if (n)
174
+ try {
175
+ l.setAttributeNS(Z, "href", s);
176
+ } catch {
177
+ }
178
+ l.setAttribute("href", s), l.setAttribute("xlink:href", s);
179
+ }
180
+ return;
181
+ }
182
+ if (typeof a == "boolean") {
183
+ a ? l.setAttribute(r, "") : l.removeAttribute(r);
184
+ return;
185
+ }
186
+ a != null && l.setAttribute(r, String(a));
187
+ }), l;
188
+ }, tt = ({ inElement: t, inClassList: e }) => {
189
+ if (!t || !e) return t;
190
+ const l = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((o) => typeof o == "string" && o.trim()) : [];
191
+ return l.length && t.classList.add(...l), t;
192
+ }, et = (t) => {
193
+ if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
194
+ const e = Q({ inTagName: t.tagName });
195
+ if (!e) return null;
196
+ if (W({
197
+ inElement: e,
198
+ inTextContent: U(t.textContent),
199
+ inTagName: t.tagName
200
+ }), Y({
201
+ inElement: e,
202
+ inProperties: t.properties
203
+ }), J({
204
+ inElement: e,
205
+ inAttributes: t.attributes
206
+ }), tt({
207
+ inElement: e,
208
+ inClassList: t.classList
209
+ }), Array.isArray(t.children)) {
210
+ const l = p(t.children);
211
+ l.length && e.append(...l);
212
+ }
213
+ return e;
214
+ }, T = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? p(t) : typeof t == "object" ? et(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, lt = "./tags.schema.json", rt = {
215
+ allowsTextContent: !1,
216
+ allowsChildren: !0,
217
+ allowedAttributes: [
218
+ "title",
219
+ "role"
220
+ ],
221
+ childTags: []
222
+ }, ot = {
223
+ allowsTextContent: !1,
224
+ allowsChildren: !1,
225
+ allowedAttributes: [
226
+ "type",
227
+ "placeholder",
228
+ "value",
229
+ "name",
230
+ "disabled",
231
+ "readonly",
232
+ "required",
233
+ "list"
234
+ ]
235
+ }, nt = {
236
+ allowsTextContent: !1,
237
+ allowsChildren: !1,
238
+ allowedAttributes: [
239
+ "type",
240
+ "checked",
241
+ "name",
242
+ "value",
243
+ "disabled",
244
+ "required"
245
+ ]
246
+ }, at = {
247
+ allowsTextContent: !1,
248
+ allowsChildren: !0,
249
+ allowedAttributes: [
250
+ "span"
251
+ ],
252
+ childTags: [
253
+ "col"
254
+ ]
255
+ }, st = {
256
+ allowsTextContent: !1,
257
+ allowsChildren: !1,
258
+ allowedAttributes: [
259
+ "span",
260
+ "style",
261
+ "width"
262
+ ]
263
+ }, it = {
264
+ allowsTextContent: !0,
265
+ allowsChildren: !0,
266
+ allowedAttributes: [
267
+ "for"
268
+ ],
269
+ childTags: []
270
+ }, ut = {
271
+ allowsTextContent: !1,
272
+ allowsChildren: !0,
273
+ allowedAttributes: [
274
+ "action",
275
+ "method",
276
+ "autocomplete",
277
+ "enctype",
278
+ "name",
279
+ "novalidate",
280
+ "target"
281
+ ],
282
+ childTags: []
283
+ }, ct = {
284
+ allowsTextContent: !1,
285
+ allowsChildren: !0,
286
+ allowedAttributes: [
287
+ "name",
288
+ "disabled",
289
+ "required",
290
+ "multiple",
291
+ "size"
292
+ ],
293
+ childTags: [
294
+ "option"
295
+ ]
296
+ }, dt = {
297
+ allowsTextContent: !0,
298
+ allowsChildren: !0,
299
+ allowedAttributes: [],
300
+ childTags: []
301
+ }, ft = {
302
+ allowsTextContent: !0,
303
+ allowsChildren: !0,
304
+ allowedAttributes: [],
305
+ childTags: []
306
+ }, ht = {
307
+ allowsTextContent: !0,
308
+ allowsChildren: !0,
309
+ allowedAttributes: [],
310
+ childTags: []
311
+ }, gt = {
312
+ allowsTextContent: !0,
313
+ allowsChildren: !0,
314
+ allowedAttributes: [],
315
+ childTags: []
316
+ }, wt = {
317
+ allowsTextContent: !1,
318
+ allowsChildren: !1,
319
+ allowedAttributes: [
320
+ "src",
321
+ "alt",
322
+ "width",
323
+ "height",
324
+ "loading"
325
+ ]
326
+ }, bt = {
327
+ allowsTextContent: !0,
328
+ allowsChildren: !0,
329
+ allowedAttributes: [
330
+ "type",
331
+ "disabled",
332
+ "name",
333
+ "value"
334
+ ],
335
+ childTags: []
336
+ }, mt = {
337
+ allowsTextContent: !1,
338
+ allowsChildren: !0,
339
+ allowedAttributes: [
340
+ "border",
341
+ "cellpadding",
342
+ "cellspacing"
343
+ ],
344
+ childTags: [
345
+ "caption",
346
+ "colgroup",
347
+ "thead",
348
+ "tbody",
349
+ "tfoot",
350
+ "tr"
351
+ ]
352
+ }, yt = {
353
+ allowsTextContent: !1,
354
+ allowsChildren: !0,
355
+ allowedAttributes: [],
356
+ childTags: [
357
+ "tr"
358
+ ]
359
+ }, pt = {
360
+ allowsTextContent: !1,
361
+ allowsChildren: !0,
362
+ allowedAttributes: [],
363
+ childTags: [
364
+ "tr"
365
+ ]
366
+ }, Tt = {
367
+ allowsTextContent: !1,
368
+ allowsChildren: !0,
369
+ allowedAttributes: [],
370
+ childTags: [
371
+ "tr"
372
+ ]
373
+ }, Ct = {
374
+ allowsTextContent: !1,
375
+ allowsChildren: !0,
376
+ allowedAttributes: [],
377
+ childTags: [
378
+ "td",
379
+ "th"
380
+ ]
381
+ }, At = {
382
+ allowsTextContent: !0,
383
+ allowsChildren: !0,
384
+ allowedAttributes: [
385
+ "scope",
386
+ "colspan",
387
+ "rowspan"
388
+ ],
389
+ childTags: []
390
+ }, xt = {
391
+ allowsTextContent: !0,
392
+ allowsChildren: !0,
393
+ allowedAttributes: [
394
+ "colspan",
395
+ "rowspan"
396
+ ],
397
+ childTags: []
398
+ }, vt = {
399
+ allowsTextContent: !1,
400
+ allowsChildren: !0,
401
+ allowedAttributes: [],
402
+ childTags: [
403
+ "option"
404
+ ]
405
+ }, jt = {
406
+ allowsTextContent: !0,
407
+ allowsChildren: !1,
408
+ allowedAttributes: [
409
+ "value",
410
+ "label",
411
+ "selected",
412
+ "disabled"
413
+ ]
414
+ }, Nt = {
415
+ allowsTextContent: !1,
416
+ allowsChildren: !0,
417
+ allowedAttributes: [
418
+ "role"
419
+ ],
420
+ childTags: []
421
+ }, kt = {
422
+ allowsTextContent: !0,
423
+ allowsChildren: !0,
424
+ allowedAttributes: [
425
+ "href",
426
+ "target",
427
+ "rel",
428
+ "title",
429
+ "download"
430
+ ],
431
+ childTags: []
432
+ }, $t = {
433
+ allowsTextContent: !0,
434
+ allowsChildren: !0,
435
+ allowedAttributes: [
436
+ "aria-hidden"
437
+ ],
438
+ childTags: []
439
+ }, Et = {
440
+ allowsTextContent: !0,
441
+ allowsChildren: !0,
442
+ allowedAttributes: [],
443
+ childTags: []
444
+ }, Ot = {
445
+ allowsTextContent: !1,
446
+ allowsChildren: !0,
447
+ allowedAttributes: [
448
+ "type"
449
+ ],
450
+ childTags: [
451
+ "li"
452
+ ]
453
+ }, Ft = {
454
+ allowsTextContent: !0,
455
+ allowsChildren: !0,
456
+ allowedAttributes: [
457
+ "value"
458
+ ],
459
+ childTags: []
460
+ }, St = {
461
+ allowsTextContent: !1,
462
+ allowsChildren: !1,
463
+ allowedAttributes: []
464
+ }, Dt = {
465
+ $schema: lt,
466
+ div: rt,
467
+ input: ot,
468
+ checkbox: nt,
469
+ colgroup: at,
470
+ col: st,
471
+ label: it,
472
+ form: ut,
473
+ select: ct,
474
+ p: dt,
475
+ h1: ft,
476
+ h2: ht,
477
+ span: gt,
478
+ img: wt,
479
+ button: bt,
480
+ table: mt,
481
+ thead: yt,
482
+ tbody: pt,
483
+ tfoot: Tt,
484
+ tr: Ct,
485
+ th: At,
486
+ td: xt,
487
+ datalist: vt,
488
+ option: jt,
489
+ header: Nt,
490
+ a: kt,
491
+ i: $t,
492
+ small: Et,
493
+ ul: Ot,
494
+ li: Ft,
495
+ hr: St
496
+ }, h = ({ inSpec: t }) => {
497
+ const e = t;
498
+ if (!e) return [];
499
+ if (Array.isArray(e))
500
+ return e.flatMap((o) => h({ inSpec: o }));
501
+ if (typeof e != "object") return [];
502
+ const l = [];
503
+ 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) => {
504
+ const n = h({ inSpec: o });
505
+ l.push(...n);
506
+ }), l;
507
+ }, Gt = ({ inTagsFound: t, inAllowedTags: e }) => {
508
+ const l = t ?? [], o = e ?? {}, n = new Set(
509
+ Object.keys(o).filter((i) => i !== "$schema").map((i) => i.toLowerCase())
510
+ ), r = {}, a = [], s = [];
511
+ l.forEach((i) => {
512
+ r[i] = (r[i] || 0) + 1, n.has(i) ? a.includes(i) || a.push(i) : s.includes(i) || s.push(i);
513
+ });
514
+ const u = l.length, c = s.length === 0;
515
+ return {
516
+ totalTags: u,
517
+ tagCounts: r,
518
+ uniqueTags: Object.keys(r),
519
+ recognizedTags: a,
520
+ unrecognizedTags: s,
521
+ areAllTagsPresent: c
522
+ };
523
+ }, zt = ({ inSpec: t, inTags: e = Dt } = {}) => {
524
+ const l = t, o = e, n = h({ inSpec: l }), r = Gt({
525
+ inTagsFound: n,
526
+ inAllowedTags: o
527
+ });
528
+ return {
529
+ areAllTagsPresent: r.areAllTagsPresent,
530
+ totalTags: r.totalTags,
531
+ tagCounts: r.tagCounts,
532
+ uniqueTags: r.uniqueTags,
533
+ recognizedTags: r.recognizedTags,
534
+ unrecognizedTags: r.unrecognizedTags
535
+ };
536
+ }, C = (t = {}) => {
537
+ const e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
538
+ return T(e);
539
+ };
540
+ B({
541
+ inFuncDefinition: C,
542
+ inReviewSpec: zt
543
+ });
544
+ const It = {
545
+ default: {
546
+ tagName: "table",
547
+ attributes: {
548
+ class: "table table-hover table-striped mb-0"
549
+ },
550
+ children: [
551
+ {
552
+ tagName: "thead",
553
+ children: [
554
+ {
555
+ tagName: "tr",
556
+ jsonToSpec: {
557
+ operation: "loopCollection",
558
+ source: "columns",
559
+ template: {
560
+ tagName: "th",
561
+ textContent: "${title}"
562
+ }
563
+ },
564
+ children: []
565
+ }
566
+ ]
567
+ },
568
+ {
569
+ tagName: "tbody",
570
+ jsonToSpec: {
571
+ operation: "loopCollection",
572
+ source: "data",
573
+ template: {
574
+ tagName: "tr",
575
+ jsonToSpec: {
576
+ operation: "loopObject",
577
+ source: "data",
578
+ template: {
579
+ tagName: "td",
580
+ textContent: "${value}"
581
+ }
582
+ },
583
+ children: []
584
+ }
585
+ },
586
+ children: []
587
+ }
588
+ ]
589
+ }
590
+ }, Lt = ({
591
+ targetHtmlId: t,
592
+ inTargetHtmlId: e,
593
+ inColumns: l,
594
+ inData: o
595
+ } = {}) => {
596
+ const n = e ?? t, r = o ?? [], a = l;
597
+ let s = y(It.default, {
598
+ columns: a,
599
+ data: r
600
+ });
601
+ "tagName" in s || (s = s.children);
602
+ const u = document.getElementById(n);
603
+ u && (u.innerHTML = "");
604
+ const c = C(s);
605
+ u.append(c);
606
+ }, w = {
607
+ table: Lt
608
+ }, Rt = ({
609
+ type: t = "table",
610
+ targetHtmlId: e,
611
+ data: l,
612
+ classToApply: o,
613
+ inTargetHtmlId: n,
614
+ inData: r,
615
+ columns: a,
616
+ inColumns: s,
617
+ colGroup: u,
618
+ inColGroup: c,
619
+ footerData: i,
620
+ inFooterData: A,
621
+ config: x,
622
+ inConfig: v,
623
+ variant: j,
624
+ skeletonType: N,
625
+ inSkeletonType: k,
626
+ showLog: $ = !1,
627
+ inShowLog: E
628
+ } = {}) => {
629
+ const f = t, O = typeof f == "string" ? f.toLowerCase() : "table", g = w[O];
630
+ return g ? g({
631
+ targetHtmlId: n ?? e,
632
+ inColumns: s ?? a,
633
+ inData: r ?? l,
634
+ inColGroup: c ?? u,
635
+ inFooterData: A ?? i ?? [],
636
+ inConfig: v ?? x ?? {},
637
+ inSkeletonType: k ?? N ?? j ?? "default",
638
+ inShowLog: E ?? $ ?? !1
639
+ }) : (console.error(
640
+ `[Renderer] Unknown renderer type "${f}". Available types: ${Object.keys(w).join(", ")}`
641
+ ), null);
642
+ };
643
+ S(Rt);
644
+ export {
645
+ Rt as default
646
+ };