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.
- package/docs/dist/v12/min.js +646 -646
- package/docs/dist/v13/min.js +225 -238
- package/package.json +2 -2
- package/src/v13/{table → buildSpec}/index.js +3 -14
- package/src/v13/index.js +18 -23
- package/src/v13/select/index.js +0 -32
- package/src/v13/select/skeleton.json +0 -18
- package/src/v13/table/skeleton.json +0 -47
package/docs/dist/v13/min.js
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
const
|
|
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
|
-
},
|
|
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:
|
|
7
|
+
meta: A,
|
|
8
8
|
renderToDom: t
|
|
9
9
|
}));
|
|
10
|
-
},
|
|
11
|
-
version: "
|
|
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
|
-
},
|
|
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:
|
|
16
|
+
meta: v,
|
|
17
17
|
renderToDom: t
|
|
18
18
|
}));
|
|
19
|
-
},
|
|
19
|
+
}, N = {
|
|
20
20
|
version: "v32",
|
|
21
21
|
description: "JSON-to-DOM engine with centralized traversal and responsibility-focused construction"
|
|
22
|
-
},
|
|
22
|
+
}, $ = ({ inFuncDefinition: t } = {}) => {
|
|
23
23
|
if (typeof globalThis > "u" || !t) return;
|
|
24
24
|
globalThis.ks ?? (globalThis.ks = {});
|
|
25
25
|
const e = {
|
|
26
|
-
meta:
|
|
26
|
+
meta: N,
|
|
27
27
|
buildSpecElement: t
|
|
28
28
|
};
|
|
29
29
|
globalThis.ks.jsonToSpec = e;
|
|
30
|
-
},
|
|
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
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
35
|
+
const o = t == null ? void 0 : t.template;
|
|
36
|
+
if (o)
|
|
37
|
+
return c(o, n);
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
},
|
|
40
|
+
}, E = (t, e) => {
|
|
41
41
|
let l = [];
|
|
42
|
-
for (const [
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const a =
|
|
46
|
-
key:
|
|
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
|
-
},
|
|
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
|
|
59
|
-
if (
|
|
60
|
-
return
|
|
58
|
+
const o = t == null ? void 0 : t.template;
|
|
59
|
+
if (o)
|
|
60
|
+
return c(o, n);
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
},
|
|
63
|
+
}, F = (t, e) => {
|
|
64
64
|
if ("operation" in t) {
|
|
65
65
|
if (t.operation === "loopArray")
|
|
66
|
-
return
|
|
66
|
+
return D(t, e);
|
|
67
67
|
if (t.operation === "loopObject")
|
|
68
|
-
return
|
|
68
|
+
return E(t, e);
|
|
69
69
|
if (t.operation === "loopCollection")
|
|
70
|
-
return
|
|
70
|
+
return O(t, e);
|
|
71
71
|
}
|
|
72
|
-
},
|
|
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
|
|
80
|
-
return (e == null ? void 0 : e[
|
|
79
|
+
const r = l[1];
|
|
80
|
+
return (e == null ? void 0 : e[r]) ?? "";
|
|
81
81
|
}
|
|
82
82
|
return t;
|
|
83
|
-
},
|
|
83
|
+
}, G = (t, e) => {
|
|
84
84
|
let l = {};
|
|
85
|
-
for (const [
|
|
86
|
-
const
|
|
87
|
-
l[
|
|
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
|
-
},
|
|
90
|
+
}, R = (t, e) => {
|
|
91
91
|
if ("tagName" in t) {
|
|
92
92
|
if ("textContent" in t) {
|
|
93
|
-
const l =
|
|
93
|
+
const l = m(t.textContent, e);
|
|
94
94
|
t.textContent = l;
|
|
95
95
|
}
|
|
96
96
|
if ("attributes" in t) {
|
|
97
|
-
const l =
|
|
97
|
+
const l = G(t.attributes, e);
|
|
98
98
|
t.attributes = l;
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
},
|
|
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 &&
|
|
106
|
-
const
|
|
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
|
|
111
|
-
l.children =
|
|
110
|
+
const r = w(l == null ? void 0 : l.children, e);
|
|
111
|
+
l.children = r;
|
|
112
112
|
}
|
|
113
113
|
return l;
|
|
114
|
-
},
|
|
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) ?
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
inFuncDefinition:
|
|
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
|
|
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
|
-
},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
inColumns: l,
|
|
172
|
-
inData: o
|
|
168
|
+
}, S = ({
|
|
169
|
+
inColumns: t,
|
|
170
|
+
inData: e
|
|
173
171
|
} = {}) => {
|
|
174
|
-
const
|
|
175
|
-
return
|
|
172
|
+
const l = e ?? [], r = t;
|
|
173
|
+
return g(M.default, {
|
|
176
174
|
columns: r,
|
|
177
|
-
data:
|
|
175
|
+
data: l
|
|
178
176
|
});
|
|
179
|
-
},
|
|
180
|
-
|
|
181
|
-
},
|
|
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
|
-
|
|
184
|
-
|
|
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
|
|
203
|
-
return
|
|
204
|
-
|
|
205
|
-
|
|
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 "${
|
|
211
|
+
`[Renderer] Unknown renderer type "${r}". Available types: ${Object.keys(b).join(", ")}`
|
|
214
212
|
), null);
|
|
215
213
|
};
|
|
216
|
-
|
|
217
|
-
const
|
|
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
|
-
},
|
|
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:
|
|
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
|
-
},
|
|
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
|
-
]),
|
|
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
|
|
264
|
-
},
|
|
265
|
-
const l = t,
|
|
266
|
-
if (!l || !
|
|
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(
|
|
270
|
-
if (
|
|
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 (
|
|
272
|
+
if (o === "xlink:href" || o === "href") {
|
|
275
273
|
if (a != null) {
|
|
276
|
-
const
|
|
274
|
+
const i = String(a);
|
|
277
275
|
if (n)
|
|
278
276
|
try {
|
|
279
|
-
l.setAttributeNS(
|
|
277
|
+
l.setAttributeNS(J, "href", i);
|
|
280
278
|
} catch {
|
|
281
279
|
}
|
|
282
|
-
l.setAttribute("href",
|
|
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(
|
|
285
|
+
a ? l.setAttribute(o, "") : l.removeAttribute(o);
|
|
288
286
|
return;
|
|
289
287
|
}
|
|
290
|
-
a != null && l.setAttribute(
|
|
288
|
+
a != null && l.setAttribute(o, String(a));
|
|
291
289
|
}), l;
|
|
292
|
-
},
|
|
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((
|
|
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
|
-
},
|
|
294
|
+
}, lt = (t) => {
|
|
297
295
|
if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
|
|
298
|
-
const e =
|
|
296
|
+
const e = W({ inTagName: t.tagName });
|
|
299
297
|
if (!e) return null;
|
|
300
|
-
if (
|
|
298
|
+
if (Y({
|
|
301
299
|
inElement: e,
|
|
302
|
-
inTextContent:
|
|
300
|
+
inTextContent: K(t.textContent),
|
|
303
301
|
inTagName: t.tagName
|
|
304
|
-
}),
|
|
302
|
+
}), Z({
|
|
305
303
|
inElement: e,
|
|
306
304
|
inProperties: t.properties
|
|
307
|
-
}),
|
|
305
|
+
}), tt({
|
|
308
306
|
inElement: e,
|
|
309
307
|
inAttributes: t.attributes
|
|
310
|
-
}),
|
|
308
|
+
}), et({
|
|
311
309
|
inElement: e,
|
|
312
310
|
inClassList: t.classList
|
|
313
311
|
}), Array.isArray(t.children)) {
|
|
314
|
-
const l =
|
|
312
|
+
const l = y(t.children);
|
|
315
313
|
l.length && e.append(...l);
|
|
316
314
|
}
|
|
317
315
|
return e;
|
|
318
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
365
|
+
}, ut = {
|
|
368
366
|
allowsTextContent: !0,
|
|
369
367
|
allowsChildren: !0,
|
|
370
368
|
allowedAttributes: [
|
|
371
369
|
"for"
|
|
372
370
|
],
|
|
373
371
|
childTags: []
|
|
374
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
398
|
+
}, ft = {
|
|
401
399
|
allowsTextContent: !0,
|
|
402
400
|
allowsChildren: !0,
|
|
403
401
|
allowedAttributes: [],
|
|
404
402
|
childTags: []
|
|
405
|
-
},
|
|
403
|
+
}, gt = {
|
|
406
404
|
allowsTextContent: !0,
|
|
407
405
|
allowsChildren: !0,
|
|
408
406
|
allowedAttributes: [],
|
|
409
407
|
childTags: []
|
|
410
|
-
},
|
|
408
|
+
}, ht = {
|
|
411
409
|
allowsTextContent: !0,
|
|
412
410
|
allowsChildren: !0,
|
|
413
411
|
allowedAttributes: [],
|
|
414
412
|
childTags: []
|
|
415
|
-
},
|
|
413
|
+
}, bt = {
|
|
416
414
|
allowsTextContent: !0,
|
|
417
415
|
allowsChildren: !0,
|
|
418
416
|
allowedAttributes: [],
|
|
419
417
|
childTags: []
|
|
420
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
454
|
+
}, yt = {
|
|
457
455
|
allowsTextContent: !1,
|
|
458
456
|
allowsChildren: !0,
|
|
459
457
|
allowedAttributes: [],
|
|
460
458
|
childTags: [
|
|
461
459
|
"tr"
|
|
462
460
|
]
|
|
463
|
-
},
|
|
461
|
+
}, Tt = {
|
|
464
462
|
allowsTextContent: !1,
|
|
465
463
|
allowsChildren: !0,
|
|
466
464
|
allowedAttributes: [],
|
|
467
465
|
childTags: [
|
|
468
466
|
"tr"
|
|
469
467
|
]
|
|
470
|
-
},
|
|
468
|
+
}, Ct = {
|
|
471
469
|
allowsTextContent: !1,
|
|
472
470
|
allowsChildren: !0,
|
|
473
471
|
allowedAttributes: [],
|
|
474
472
|
childTags: [
|
|
475
473
|
"tr"
|
|
476
474
|
]
|
|
477
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
500
|
+
}, jt = {
|
|
503
501
|
allowsTextContent: !1,
|
|
504
502
|
allowsChildren: !0,
|
|
505
503
|
allowedAttributes: [],
|
|
506
504
|
childTags: [
|
|
507
505
|
"option"
|
|
508
506
|
]
|
|
509
|
-
},
|
|
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
|
-
},
|
|
516
|
+
}, $t = {
|
|
519
517
|
allowsTextContent: !1,
|
|
520
518
|
allowsChildren: !0,
|
|
521
519
|
allowedAttributes: [
|
|
522
520
|
"role"
|
|
523
521
|
],
|
|
524
522
|
childTags: []
|
|
525
|
-
},
|
|
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
|
-
},
|
|
534
|
+
}, Dt = {
|
|
537
535
|
allowsTextContent: !0,
|
|
538
536
|
allowsChildren: !0,
|
|
539
537
|
allowedAttributes: [
|
|
540
538
|
"aria-hidden"
|
|
541
539
|
],
|
|
542
540
|
childTags: []
|
|
543
|
-
},
|
|
541
|
+
}, Et = {
|
|
544
542
|
allowsTextContent: !0,
|
|
545
543
|
allowsChildren: !0,
|
|
546
544
|
allowedAttributes: [],
|
|
547
545
|
childTags: []
|
|
548
|
-
},
|
|
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
|
-
},
|
|
555
|
+
}, Ft = {
|
|
558
556
|
allowsTextContent: !0,
|
|
559
557
|
allowsChildren: !0,
|
|
560
558
|
allowedAttributes: [
|
|
561
559
|
"value"
|
|
562
560
|
],
|
|
563
561
|
childTags: []
|
|
564
|
-
},
|
|
562
|
+
}, Gt = {
|
|
565
563
|
allowsTextContent: !1,
|
|
566
564
|
allowsChildren: !1,
|
|
567
565
|
allowedAttributes: []
|
|
568
|
-
},
|
|
569
|
-
$schema:
|
|
570
|
-
div:
|
|
571
|
-
input:
|
|
572
|
-
checkbox:
|
|
573
|
-
colgroup:
|
|
574
|
-
col:
|
|
575
|
-
label:
|
|
576
|
-
form:
|
|
577
|
-
select:
|
|
578
|
-
p:
|
|
579
|
-
h1:
|
|
580
|
-
h2:
|
|
581
|
-
span:
|
|
582
|
-
img:
|
|
583
|
-
button:
|
|
584
|
-
table:
|
|
585
|
-
thead:
|
|
586
|
-
tbody:
|
|
587
|
-
tfoot:
|
|
588
|
-
tr:
|
|
589
|
-
th:
|
|
590
|
-
td:
|
|
591
|
-
datalist:
|
|
592
|
-
option:
|
|
593
|
-
header:
|
|
594
|
-
a:
|
|
595
|
-
i:
|
|
596
|
-
small:
|
|
597
|
-
ul:
|
|
598
|
-
li:
|
|
599
|
-
hr:
|
|
600
|
-
},
|
|
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((
|
|
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((
|
|
608
|
-
const n =
|
|
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 ?? [],
|
|
613
|
-
Object.keys(
|
|
614
|
-
),
|
|
615
|
-
l.forEach((
|
|
616
|
-
|
|
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
|
|
616
|
+
const d = l.length, h = i.length === 0;
|
|
619
617
|
return {
|
|
620
|
-
totalTags:
|
|
621
|
-
tagCounts:
|
|
622
|
-
uniqueTags: Object.keys(
|
|
618
|
+
totalTags: d,
|
|
619
|
+
tagCounts: o,
|
|
620
|
+
uniqueTags: Object.keys(o),
|
|
623
621
|
recognizedTags: a,
|
|
624
|
-
unrecognizedTags:
|
|
625
|
-
areAllTagsPresent:
|
|
622
|
+
unrecognizedTags: i,
|
|
623
|
+
areAllTagsPresent: h
|
|
626
624
|
};
|
|
627
|
-
},
|
|
628
|
-
const l = t,
|
|
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:
|
|
628
|
+
inAllowedTags: r
|
|
631
629
|
});
|
|
632
630
|
return {
|
|
633
|
-
areAllTagsPresent:
|
|
634
|
-
totalTags:
|
|
635
|
-
tagCounts:
|
|
636
|
-
uniqueTags:
|
|
637
|
-
recognizedTags:
|
|
638
|
-
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
|
-
},
|
|
638
|
+
}, C = (t = {}) => {
|
|
641
639
|
const e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
|
|
642
|
-
return
|
|
640
|
+
return T(e);
|
|
643
641
|
};
|
|
644
|
-
|
|
645
|
-
inFuncDefinition:
|
|
646
|
-
inReviewSpec:
|
|
642
|
+
_({
|
|
643
|
+
inFuncDefinition: C,
|
|
644
|
+
inReviewSpec: Mt
|
|
647
645
|
});
|
|
648
|
-
const
|
|
646
|
+
const St = ({
|
|
649
647
|
inTargetHtmlId: t,
|
|
650
648
|
inColumns: e,
|
|
651
|
-
|
|
652
|
-
|
|
649
|
+
type: l,
|
|
650
|
+
inData: r
|
|
653
651
|
} = {}) => {
|
|
654
652
|
debugger;
|
|
655
|
-
|
|
656
|
-
let s = v({
|
|
653
|
+
let a = p({
|
|
657
654
|
type: "table",
|
|
658
|
-
|
|
659
|
-
data: l ?? [],
|
|
655
|
+
data: r ?? [],
|
|
660
656
|
columns: e
|
|
661
657
|
});
|
|
662
|
-
|
|
663
|
-
|
|
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:
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
columns: a,
|
|
675
|
-
inColumns: s,
|
|
676
|
-
appendPosition: u
|
|
663
|
+
classToApply: r,
|
|
664
|
+
columns: n,
|
|
665
|
+
appendPosition: o
|
|
677
666
|
} = {}) => {
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
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
|
-
|
|
675
|
+
x(It);
|
|
689
676
|
export {
|
|
690
|
-
|
|
677
|
+
It as default
|
|
691
678
|
};
|