json-renderers 1.16.1 → 1.17.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/README.md +6 -1
- package/docs/dist/min.js +899 -832
- package/docs/dist/v16/min.js +1576 -0
- package/docs/dist/v17/min.js +1577 -0
- package/package.json +2 -2
- package/src/index.js +2 -2
- package/src/v16/buildSpec/index.js +40 -40
- package/src/v16/common/deriveColumnsFromData.js +20 -20
- package/src/v16/guard.js +38 -38
- package/src/v16/index.js +106 -110
- package/src/v16/meta.js +6 -6
- package/src/v16/registerGlobal.js +27 -27
- package/src/v17/buildSpec/index.js +25 -0
- package/src/v17/getSpec.js +12 -0
- package/src/v17/guard.js +41 -0
- package/src/v17/index.js +29 -0
- package/src/{v11 → v17}/meta.js +1 -1
- package/src/v17/registerGlobal.js +28 -0
- package/src/v17/renderToDom/index.js +47 -0
- package/src/v17/spec.json +9 -0
- package/src/v17/validateConfig.js +37 -0
- package/src/v11/dataLists/fragments.json +0 -1
- package/src/v11/dataLists/index.js +0 -32
- package/src/v11/dataLists/skeleton.json +0 -38
- package/src/v11/index.js +0 -62
- package/src/v11/registerGlobal.js +0 -14
- package/src/v11/select/fragments.json +0 -1
- package/src/v11/select/index.js +0 -34
- package/src/v11/select/skeleton.json +0 -23
- package/src/v11/table/index.js +0 -35
- package/src/v11/table/skeleton.json +0 -47
- package/src/v12/common/deriveColumnsFromData.js +0 -20
- package/src/v12/index.js +0 -62
- package/src/v12/meta.js +0 -6
- package/src/v12/registerGlobal.js +0 -14
- package/src/v12/table/index.js +0 -35
- package/src/v12/table/skeleton.json +0 -47
- package/src/v13/buildSpec/index.js +0 -39
- package/src/v13/common/deriveColumnsFromData.js +0 -20
- package/src/v13/index.js +0 -81
- package/src/v13/meta.js +0 -6
- package/src/v13/registerGlobal.js +0 -14
- /package/src/{v11 → v17}/common/deriveColumnsFromData.js +0 -0
package/docs/dist/min.js
CHANGED
|
@@ -1,250 +1,307 @@
|
|
|
1
|
-
const
|
|
2
|
-
version: "
|
|
1
|
+
const V = {
|
|
2
|
+
version: "v17.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
|
-
},
|
|
5
|
-
|
|
6
|
-
typeof globalThis > "u" || !
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
}, D = (t) => {
|
|
5
|
+
const e = t;
|
|
6
|
+
if (typeof globalThis > "u" || !e) return;
|
|
7
|
+
globalThis.ks ?? (globalThis.ks = {});
|
|
8
|
+
const o = typeof e == "function" ? e : e.render, n = typeof e == "object" ? e.getSpec : void 0;
|
|
9
|
+
globalThis.ks.jsonRenderers = {
|
|
10
|
+
meta: V,
|
|
11
|
+
...typeof e == "object" ? e : {},
|
|
12
|
+
render: o,
|
|
13
|
+
renderToDom: o,
|
|
14
|
+
domMount: e == null ? void 0 : e.renderToDom,
|
|
15
|
+
...n ? { getSpec: n } : {}
|
|
16
|
+
};
|
|
17
|
+
}, W = "table", G = "", K = [], M = [], q = "", z = "replace", _ = !1, f = {
|
|
18
|
+
type: W,
|
|
19
|
+
targetHtmlId: G,
|
|
20
|
+
data: K,
|
|
21
|
+
columns: M,
|
|
22
|
+
classToApply: q,
|
|
23
|
+
appendPosition: z,
|
|
24
|
+
showLog: _
|
|
25
|
+
}, X = ({ inConfig: t } = {}) => {
|
|
26
|
+
const e = t;
|
|
27
|
+
if (!e || typeof e != "object")
|
|
28
|
+
throw console.error("Config must be an object"), new TypeError("Config must be an object");
|
|
29
|
+
for (const o of Object.keys(f)) {
|
|
30
|
+
if (!(o in e) || e[o] === void 0)
|
|
31
|
+
throw console.error(`Missing compulsory key: "${o}"`), new Error(`Missing compulsory key: "${o}"`);
|
|
32
|
+
if (Array.isArray(f[o])) {
|
|
33
|
+
if (!Array.isArray(e[o]))
|
|
34
|
+
throw console.error(`${o} must be an Array`), new TypeError(`${o} must be an Array`);
|
|
35
|
+
} else if (typeof e[o] != typeof f[o])
|
|
36
|
+
throw console.error(`${o} must be of type ${typeof f[o]}`), new TypeError(`${o} must be of type ${typeof f[o]}`);
|
|
37
|
+
}
|
|
38
|
+
if (typeof e.targetHtmlId == "string" && !e.targetHtmlId.trim())
|
|
16
39
|
throw console.error("targetHtmlId must be a non-empty string"), new TypeError("targetHtmlId must be a non-empty string");
|
|
17
|
-
|
|
40
|
+
return !0;
|
|
41
|
+
}, T = ({
|
|
42
|
+
type: t = "table",
|
|
43
|
+
targetHtmlId: e,
|
|
44
|
+
data: o,
|
|
45
|
+
columns: n,
|
|
46
|
+
classToApply: r = "",
|
|
47
|
+
appendPosition: s = "replace",
|
|
48
|
+
showLog: l = !1
|
|
49
|
+
} = {}) => {
|
|
50
|
+
const A = {
|
|
51
|
+
type: t,
|
|
52
|
+
targetHtmlId: e,
|
|
53
|
+
data: o,
|
|
54
|
+
columns: n,
|
|
55
|
+
classToApply: r,
|
|
56
|
+
appendPosition: s,
|
|
57
|
+
showLog: l
|
|
58
|
+
};
|
|
59
|
+
return X({ inConfig: A }), A;
|
|
60
|
+
}, S = () => ({ ...f });
|
|
61
|
+
Object.assign(S, f);
|
|
62
|
+
const Y = {
|
|
63
|
+
version: "v11.0.0",
|
|
64
|
+
description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
|
|
65
|
+
}, Q = (t) => {
|
|
66
|
+
const e = t;
|
|
67
|
+
if (typeof globalThis > "u" || !e) return;
|
|
68
|
+
globalThis.ks ?? (globalThis.ks = {});
|
|
69
|
+
const o = typeof e == "function" ? e : e.render, n = typeof e == "object" ? e.getSpec : void 0;
|
|
70
|
+
globalThis.ks.jsonRenderersBuild = {
|
|
71
|
+
meta: Y,
|
|
72
|
+
renderToDom: o,
|
|
73
|
+
render: o,
|
|
74
|
+
...n ? { getSpec: n } : {},
|
|
75
|
+
...typeof e == "object" ? e : {}
|
|
76
|
+
};
|
|
77
|
+
}, g = ["table", "select", "selectOptionsOnly", "tableFromSpec"], Z = ({ inConfig: t } = {}) => {
|
|
78
|
+
const e = t;
|
|
79
|
+
if (!e || typeof e != "object")
|
|
80
|
+
throw console.error("Config must be an object"), new TypeError("Config must be an object");
|
|
81
|
+
if (typeof e.type != "string" || !g.includes(e.type))
|
|
82
|
+
throw console.error(`type must be one of: ${g.join(", ")}`), new Error(`type must be one of: ${g.join(", ")}`);
|
|
83
|
+
if (!Array.isArray(e.data))
|
|
84
|
+
throw console.error("data must be an Array"), new TypeError("data must be an Array");
|
|
85
|
+
if (!Array.isArray(e.columns))
|
|
18
86
|
throw console.error("columns must be an array"), new TypeError("columns must be an array");
|
|
19
|
-
if (typeof
|
|
87
|
+
if (e.showLog !== void 0 && typeof e.showLog != "boolean")
|
|
20
88
|
throw console.error("showLog must be a boolean"), new TypeError("showLog must be a boolean");
|
|
21
|
-
if (r !== !0)
|
|
22
|
-
throw console.error("showLog must be true"), new TypeError("showLog must be true");
|
|
23
89
|
return !0;
|
|
24
|
-
},
|
|
25
|
-
version: "v10.0.0",
|
|
26
|
-
description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
|
|
27
|
-
}, v = (t) => {
|
|
28
|
-
var e;
|
|
29
|
-
typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderersBuild ?? (e.jsonRenderersBuild = {
|
|
30
|
-
meta: j,
|
|
31
|
-
renderToDom: t
|
|
32
|
-
}));
|
|
33
|
-
}, O = "table", I = {
|
|
90
|
+
}, tt = "table", et = {
|
|
34
91
|
class: "table table-hover table-striped mb-0"
|
|
35
|
-
},
|
|
36
|
-
tagName:
|
|
37
|
-
attributes:
|
|
38
|
-
children:
|
|
39
|
-
},
|
|
40
|
-
tagName:
|
|
41
|
-
children:
|
|
42
|
-
},
|
|
43
|
-
tagName:
|
|
44
|
-
children:
|
|
45
|
-
},
|
|
92
|
+
}, ot = [], nt = {
|
|
93
|
+
tagName: tt,
|
|
94
|
+
attributes: et,
|
|
95
|
+
children: ot
|
|
96
|
+
}, rt = "thead", st = [], lt = {
|
|
97
|
+
tagName: rt,
|
|
98
|
+
children: st
|
|
99
|
+
}, at = "tr", ct = [], it = {
|
|
100
|
+
tagName: at,
|
|
101
|
+
children: ct
|
|
102
|
+
}, ut = "th", dt = {
|
|
46
103
|
value: ""
|
|
47
|
-
},
|
|
48
|
-
tagName:
|
|
49
|
-
attributes:
|
|
50
|
-
textContent:
|
|
51
|
-
},
|
|
52
|
-
const e = structuredClone(
|
|
104
|
+
}, bt = "", ft = {
|
|
105
|
+
tagName: ut,
|
|
106
|
+
attributes: dt,
|
|
107
|
+
textContent: bt
|
|
108
|
+
}, ht = ({ inColumn: t } = {}) => {
|
|
109
|
+
const e = structuredClone(ft);
|
|
53
110
|
return e.attributes.value = t, e.textContent = t, e;
|
|
54
|
-
},
|
|
55
|
-
const e = structuredClone(
|
|
56
|
-
return e.children =
|
|
57
|
-
},
|
|
58
|
-
const e = structuredClone(
|
|
59
|
-
|
|
111
|
+
}, mt = ({ inColumns: t = [] } = {}) => {
|
|
112
|
+
const e = structuredClone(it), o = t.map((n) => ht({ inColumn: n }));
|
|
113
|
+
return e.children = o, e;
|
|
114
|
+
}, pt = ({ inColumns: t = [] } = {}) => {
|
|
115
|
+
const e = structuredClone(lt), o = [
|
|
116
|
+
mt({ inColumns: t })
|
|
60
117
|
];
|
|
61
|
-
return e.children =
|
|
62
|
-
},
|
|
63
|
-
tagName:
|
|
64
|
-
children:
|
|
65
|
-
},
|
|
66
|
-
tagName:
|
|
67
|
-
children:
|
|
68
|
-
},
|
|
118
|
+
return e.children = o, e;
|
|
119
|
+
}, yt = "tbody", gt = [], wt = {
|
|
120
|
+
tagName: yt,
|
|
121
|
+
children: gt
|
|
122
|
+
}, Ct = "tr", $t = [], At = {
|
|
123
|
+
tagName: Ct,
|
|
124
|
+
children: $t
|
|
125
|
+
}, Nt = "td", xt = {
|
|
69
126
|
value: ""
|
|
70
|
-
},
|
|
71
|
-
tagName:
|
|
72
|
-
attributes:
|
|
73
|
-
textContent:
|
|
74
|
-
},
|
|
75
|
-
const e = structuredClone(
|
|
127
|
+
}, Tt = "", St = {
|
|
128
|
+
tagName: Nt,
|
|
129
|
+
attributes: xt,
|
|
130
|
+
textContent: Tt
|
|
131
|
+
}, Et = ({ inValue: t } = {}) => {
|
|
132
|
+
const e = structuredClone(St);
|
|
76
133
|
return e.attributes.value = t, e.textContent = t, e;
|
|
77
|
-
},
|
|
78
|
-
const
|
|
134
|
+
}, jt = ({ inRow: t, inColumns: e = [] } = {}) => {
|
|
135
|
+
const o = structuredClone(At), n = e.map((r) => {
|
|
79
136
|
const s = Array.isArray(t) ? t[r] : t == null ? void 0 : t[r];
|
|
80
|
-
return
|
|
137
|
+
return Et({ inValue: s });
|
|
81
138
|
});
|
|
82
|
-
return
|
|
83
|
-
},
|
|
84
|
-
const
|
|
139
|
+
return o.children = n, o;
|
|
140
|
+
}, Ft = ({ inData: t = [], inColumns: e = [] } = {}) => {
|
|
141
|
+
const o = structuredClone(wt), n = t.map((r) => jt({
|
|
85
142
|
inRow: r,
|
|
86
143
|
inColumns: e
|
|
87
144
|
}));
|
|
88
|
-
return
|
|
89
|
-
},
|
|
145
|
+
return o.children = n, o;
|
|
146
|
+
}, Bt = "tfoot", It = {
|
|
90
147
|
class: "table-light"
|
|
91
|
-
},
|
|
92
|
-
tagName:
|
|
93
|
-
attributes:
|
|
94
|
-
children:
|
|
95
|
-
},
|
|
148
|
+
}, kt = [], Ot = {
|
|
149
|
+
tagName: Bt,
|
|
150
|
+
attributes: It,
|
|
151
|
+
children: kt
|
|
152
|
+
}, vt = "tr", Pt = {
|
|
96
153
|
class: "align-middle"
|
|
97
|
-
},
|
|
98
|
-
tagName:
|
|
99
|
-
attributes:
|
|
100
|
-
children:
|
|
101
|
-
},
|
|
154
|
+
}, Lt = [], Ht = {
|
|
155
|
+
tagName: vt,
|
|
156
|
+
attributes: Pt,
|
|
157
|
+
children: Lt
|
|
158
|
+
}, Rt = "td", Jt = {
|
|
102
159
|
class: "align-middle py-2"
|
|
103
|
-
},
|
|
104
|
-
tagName:
|
|
105
|
-
attributes:
|
|
106
|
-
children:
|
|
107
|
-
},
|
|
160
|
+
}, Ut = [], Vt = {
|
|
161
|
+
tagName: Rt,
|
|
162
|
+
attributes: Jt,
|
|
163
|
+
children: Ut
|
|
164
|
+
}, Dt = "input", Wt = {
|
|
108
165
|
type: "text",
|
|
109
166
|
name: "",
|
|
110
167
|
placeholder: "",
|
|
111
168
|
class: "form-control form-control-sm"
|
|
112
|
-
},
|
|
113
|
-
tagName:
|
|
114
|
-
attributes:
|
|
115
|
-
},
|
|
116
|
-
const e = structuredClone(
|
|
117
|
-
return
|
|
118
|
-
},
|
|
119
|
-
const e = structuredClone(
|
|
120
|
-
return e.children = t.map((
|
|
121
|
-
},
|
|
169
|
+
}, Gt = {
|
|
170
|
+
tagName: Dt,
|
|
171
|
+
attributes: Wt
|
|
172
|
+
}, Kt = ({ inColumn: t } = {}) => {
|
|
173
|
+
const e = structuredClone(Vt), o = structuredClone(Gt);
|
|
174
|
+
return o.attributes.name = t, o.attributes.placeholder = t, e.children.push(o), e;
|
|
175
|
+
}, Mt = ({ inColumns: t = [] } = {}) => {
|
|
176
|
+
const e = structuredClone(Ht);
|
|
177
|
+
return e.children = t.map((o) => Kt({ inColumn: o })), e;
|
|
178
|
+
}, qt = ({ inColumns: t = [] } = {}) => Mt({ inColumns: t }), zt = "tr", _t = {
|
|
122
179
|
class: "align-middle"
|
|
123
|
-
},
|
|
124
|
-
tagName:
|
|
125
|
-
attributes:
|
|
126
|
-
children:
|
|
127
|
-
},
|
|
180
|
+
}, Xt = [], Yt = {
|
|
181
|
+
tagName: zt,
|
|
182
|
+
attributes: _t,
|
|
183
|
+
children: Xt
|
|
184
|
+
}, Qt = "td", Zt = {
|
|
128
185
|
class: "align-middle py-2"
|
|
129
|
-
},
|
|
130
|
-
tagName:
|
|
131
|
-
attributes:
|
|
132
|
-
children:
|
|
133
|
-
},
|
|
186
|
+
}, te = [], ee = {
|
|
187
|
+
tagName: Qt,
|
|
188
|
+
attributes: Zt,
|
|
189
|
+
children: te
|
|
190
|
+
}, oe = "input", ne = {
|
|
134
191
|
type: "text",
|
|
135
192
|
name: "",
|
|
136
193
|
placeholder: "",
|
|
137
194
|
class: "form-control form-control-sm"
|
|
138
|
-
},
|
|
139
|
-
tagName:
|
|
140
|
-
attributes:
|
|
141
|
-
},
|
|
195
|
+
}, re = {
|
|
196
|
+
tagName: oe,
|
|
197
|
+
attributes: ne
|
|
198
|
+
}, se = "button", le = {
|
|
142
199
|
type: "button",
|
|
143
200
|
class: "btn btn-primary btn-sm ms-2"
|
|
144
|
-
},
|
|
145
|
-
tagName:
|
|
146
|
-
attributes:
|
|
147
|
-
textContent:
|
|
148
|
-
},
|
|
149
|
-
const
|
|
150
|
-
return
|
|
151
|
-
},
|
|
152
|
-
const e = structuredClone(
|
|
153
|
-
return e.children = t.map((
|
|
154
|
-
inColumn:
|
|
155
|
-
inSave:
|
|
201
|
+
}, ae = "Save", ce = {
|
|
202
|
+
tagName: se,
|
|
203
|
+
attributes: le,
|
|
204
|
+
textContent: ae
|
|
205
|
+
}, ie = ({ inColumn: t, inSave: e = !1 } = {}) => {
|
|
206
|
+
const o = structuredClone(ee), n = structuredClone(re);
|
|
207
|
+
return n.attributes.name = t, n.attributes.placeholder = t, o.children.push(n), e && o.children.push(structuredClone(ce)), o;
|
|
208
|
+
}, ue = ({ inColumns: t = [] } = {}) => {
|
|
209
|
+
const e = structuredClone(Yt);
|
|
210
|
+
return e.children = t.map((o, n) => ie({
|
|
211
|
+
inColumn: o,
|
|
212
|
+
inSave: n === t.length - 1
|
|
156
213
|
})), e;
|
|
157
|
-
},
|
|
214
|
+
}, de = ({ inColumns: t = [] } = {}) => ue({ inColumns: t }), be = "tr", fe = {
|
|
158
215
|
class: "fw-semibold align-middle"
|
|
159
|
-
},
|
|
160
|
-
tagName:
|
|
161
|
-
attributes:
|
|
162
|
-
children:
|
|
163
|
-
},
|
|
216
|
+
}, he = [], me = {
|
|
217
|
+
tagName: be,
|
|
218
|
+
attributes: fe,
|
|
219
|
+
children: he
|
|
220
|
+
}, pe = "td", ye = {
|
|
164
221
|
class: "align-middle py-2"
|
|
165
|
-
},
|
|
166
|
-
tagName:
|
|
167
|
-
attributes:
|
|
168
|
-
textContent:
|
|
169
|
-
},
|
|
170
|
-
const
|
|
171
|
-
return
|
|
172
|
-
},
|
|
173
|
-
const
|
|
174
|
-
return
|
|
175
|
-
(
|
|
176
|
-
),
|
|
177
|
-
},
|
|
222
|
+
}, ge = "", we = {
|
|
223
|
+
tagName: pe,
|
|
224
|
+
attributes: ye,
|
|
225
|
+
textContent: ge
|
|
226
|
+
}, Ce = (t, e) => Array.isArray(t) ? t[e] : t == null ? void 0 : t[e], $e = ({ inColumn: t, inIndex: e, inData: o = [] } = {}) => {
|
|
227
|
+
const n = structuredClone(we), r = o.map((s) => Ce(s, t)).filter((s) => s != null && String(s).trim() !== "").map(Number).filter(Number.isFinite);
|
|
228
|
+
return n.textContent = r.length ? String(r.reduce((s, l) => s + l, 0)) : e === 0 ? "Total" : "", n;
|
|
229
|
+
}, Ae = ({ inColumns: t = [], inData: e = [] } = {}) => {
|
|
230
|
+
const o = structuredClone(me);
|
|
231
|
+
return o.children = t.map(
|
|
232
|
+
(n, r) => $e({ inColumn: n, inIndex: r, inData: e })
|
|
233
|
+
), o;
|
|
234
|
+
}, Ne = ({ inColumns: t = [], inData: e = [] } = {}) => Ae({ inColumns: t, inData: e }), xe = "tr", Te = {
|
|
178
235
|
class: "align-middle"
|
|
179
|
-
},
|
|
180
|
-
tagName:
|
|
181
|
-
attributes:
|
|
182
|
-
children:
|
|
183
|
-
},
|
|
236
|
+
}, Se = [], Ee = {
|
|
237
|
+
tagName: xe,
|
|
238
|
+
attributes: Te,
|
|
239
|
+
children: Se
|
|
240
|
+
}, je = "td", Fe = {
|
|
184
241
|
class: "align-middle py-2"
|
|
185
|
-
},
|
|
186
|
-
tagName:
|
|
187
|
-
attributes:
|
|
188
|
-
},
|
|
189
|
-
const e = structuredClone(
|
|
190
|
-
return e.children = t.map(() =>
|
|
191
|
-
},
|
|
192
|
-
inputs:
|
|
193
|
-
inputsWithSave:
|
|
194
|
-
totals:
|
|
195
|
-
empty:
|
|
196
|
-
},
|
|
197
|
-
const
|
|
198
|
-
return
|
|
199
|
-
if (!Object.hasOwn(
|
|
242
|
+
}, Be = {
|
|
243
|
+
tagName: je,
|
|
244
|
+
attributes: Fe
|
|
245
|
+
}, Ie = () => structuredClone(Be), ke = ({ inColumns: t = [] } = {}) => {
|
|
246
|
+
const e = structuredClone(Ee);
|
|
247
|
+
return e.children = t.map(() => Ie()), e;
|
|
248
|
+
}, Oe = ({ inColumns: t = [] } = {}) => ke({ inColumns: t }), N = {
|
|
249
|
+
inputs: qt,
|
|
250
|
+
inputsWithSave: de,
|
|
251
|
+
totals: Ne,
|
|
252
|
+
empty: Oe
|
|
253
|
+
}, ve = ({ inFooter: t = [], inColumns: e = [], inData: o = [] } = {}) => {
|
|
254
|
+
const n = structuredClone(Ot);
|
|
255
|
+
return n.children = t.map((r) => {
|
|
256
|
+
if (!Object.hasOwn(N, r))
|
|
200
257
|
throw new Error(`Unknown footer "${r}".`);
|
|
201
|
-
return
|
|
202
|
-
}),
|
|
203
|
-
},
|
|
258
|
+
return N[r]({ inColumns: e, inData: o });
|
|
259
|
+
}), n;
|
|
260
|
+
}, Pe = ({
|
|
204
261
|
inColumns: t = [],
|
|
205
262
|
inData: e = [],
|
|
206
|
-
inFooter:
|
|
263
|
+
inFooter: o = []
|
|
207
264
|
} = {}) => {
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
265
|
+
const n = structuredClone(nt), r = [
|
|
266
|
+
pt({ inColumns: t }),
|
|
267
|
+
Ft({ inData: e, inColumns: t })
|
|
211
268
|
];
|
|
212
|
-
if (!Array.isArray(
|
|
269
|
+
if (!Array.isArray(o))
|
|
213
270
|
throw new TypeError("The footer property must be an array of footer names.");
|
|
214
|
-
return
|
|
215
|
-
inFooter:
|
|
271
|
+
return o.length > 0 && r.push(ve({
|
|
272
|
+
inFooter: o,
|
|
216
273
|
inColumns: t,
|
|
217
274
|
inData: e
|
|
218
|
-
})),
|
|
219
|
-
},
|
|
220
|
-
const [e,
|
|
275
|
+
})), n.children = r, n;
|
|
276
|
+
}, Le = (t) => {
|
|
277
|
+
const [e, o] = t.children;
|
|
221
278
|
e.children[0].children.unshift({
|
|
222
279
|
tagName: "th",
|
|
223
280
|
textContent: "#"
|
|
224
|
-
}),
|
|
225
|
-
|
|
281
|
+
}), o.children.forEach((n, r) => {
|
|
282
|
+
n.children.unshift({
|
|
226
283
|
tagName: "td",
|
|
227
284
|
textContent: String(r + 1)
|
|
228
285
|
});
|
|
229
286
|
});
|
|
230
|
-
},
|
|
231
|
-
const
|
|
232
|
-
if (
|
|
233
|
-
const [
|
|
234
|
-
|
|
287
|
+
}, He = (t) => t === !0 ? [{ label: "Apply", type: "button" }] : Array.isArray(t) ? t : [], Re = (t, e) => {
|
|
288
|
+
const o = He(e);
|
|
289
|
+
if (o.length === 0) return;
|
|
290
|
+
const [n, r] = t.children;
|
|
291
|
+
n.children[0].children.push({
|
|
235
292
|
tagName: "th",
|
|
236
293
|
textContent: "Actions"
|
|
237
294
|
}), r.children.forEach((s) => {
|
|
238
295
|
s.children.push({
|
|
239
296
|
tagName: "td",
|
|
240
|
-
children:
|
|
297
|
+
children: o.map((l) => ({
|
|
241
298
|
tagName: "button",
|
|
242
299
|
attributes: { type: l.type || "button" },
|
|
243
300
|
textContent: l.label
|
|
244
301
|
}))
|
|
245
302
|
});
|
|
246
303
|
});
|
|
247
|
-
},
|
|
304
|
+
}, Je = (t, e = {}) => (e.showSerial && Le(t), e.showOptions && Re(t, e.showOptions), t), Ue = {
|
|
248
305
|
type: "table",
|
|
249
306
|
data: [
|
|
250
307
|
{
|
|
@@ -257,7 +314,7 @@ const k = {
|
|
|
257
314
|
"baseUnit"
|
|
258
315
|
],
|
|
259
316
|
options: {}
|
|
260
|
-
},
|
|
317
|
+
}, Ve = {
|
|
261
318
|
type: "table",
|
|
262
319
|
data: [
|
|
263
320
|
{
|
|
@@ -272,7 +329,7 @@ const k = {
|
|
|
272
329
|
options: {
|
|
273
330
|
showSerial: !0
|
|
274
331
|
}
|
|
275
|
-
},
|
|
332
|
+
}, De = {
|
|
276
333
|
type: "table",
|
|
277
334
|
data: [
|
|
278
335
|
{
|
|
@@ -287,7 +344,7 @@ const k = {
|
|
|
287
344
|
options: {
|
|
288
345
|
showOptions: !0
|
|
289
346
|
}
|
|
290
|
-
},
|
|
347
|
+
}, We = {
|
|
291
348
|
type: "table",
|
|
292
349
|
data: [
|
|
293
350
|
{
|
|
@@ -311,7 +368,7 @@ const k = {
|
|
|
311
368
|
}
|
|
312
369
|
]
|
|
313
370
|
}
|
|
314
|
-
},
|
|
371
|
+
}, Ge = {
|
|
315
372
|
type: "table",
|
|
316
373
|
data: [
|
|
317
374
|
{
|
|
@@ -332,7 +389,7 @@ const k = {
|
|
|
332
389
|
}
|
|
333
390
|
]
|
|
334
391
|
}
|
|
335
|
-
},
|
|
392
|
+
}, Ke = {
|
|
336
393
|
type: "table",
|
|
337
394
|
data: [
|
|
338
395
|
{
|
|
@@ -348,7 +405,7 @@ const k = {
|
|
|
348
405
|
"inputs"
|
|
349
406
|
],
|
|
350
407
|
options: {}
|
|
351
|
-
},
|
|
408
|
+
}, Me = {
|
|
352
409
|
type: "table",
|
|
353
410
|
data: [
|
|
354
411
|
{
|
|
@@ -364,7 +421,7 @@ const k = {
|
|
|
364
421
|
"inputsWithSave"
|
|
365
422
|
],
|
|
366
423
|
options: {}
|
|
367
|
-
},
|
|
424
|
+
}, qe = {
|
|
368
425
|
type: "table",
|
|
369
426
|
data: [
|
|
370
427
|
{
|
|
@@ -384,7 +441,7 @@ const k = {
|
|
|
384
441
|
"totals"
|
|
385
442
|
],
|
|
386
443
|
options: {}
|
|
387
|
-
},
|
|
444
|
+
}, ze = {
|
|
388
445
|
type: "table",
|
|
389
446
|
data: [
|
|
390
447
|
{
|
|
@@ -403,7 +460,7 @@ const k = {
|
|
|
403
460
|
"empty"
|
|
404
461
|
],
|
|
405
462
|
options: {}
|
|
406
|
-
},
|
|
463
|
+
}, _e = {
|
|
407
464
|
type: "tableHead",
|
|
408
465
|
data: [],
|
|
409
466
|
columns: [
|
|
@@ -411,7 +468,7 @@ const k = {
|
|
|
411
468
|
"baseUnit"
|
|
412
469
|
],
|
|
413
470
|
options: {}
|
|
414
|
-
},
|
|
471
|
+
}, Xe = {
|
|
415
472
|
type: "tableBody",
|
|
416
473
|
data: [
|
|
417
474
|
{
|
|
@@ -424,266 +481,266 @@ const k = {
|
|
|
424
481
|
"baseUnit"
|
|
425
482
|
],
|
|
426
483
|
options: {}
|
|
427
|
-
},
|
|
428
|
-
table:
|
|
429
|
-
tableWithSerial:
|
|
430
|
-
tableWithDefaultAction:
|
|
431
|
-
tableWithCustomActions:
|
|
432
|
-
tableWithSerialAndActions:
|
|
433
|
-
tableWithFooter:
|
|
434
|
-
tableWithFooterSave:
|
|
435
|
-
tableWithTotals:
|
|
436
|
-
tableWithMultipleFooters:
|
|
437
|
-
tableHead:
|
|
438
|
-
tableBody:
|
|
439
|
-
},
|
|
484
|
+
}, Ye = {
|
|
485
|
+
table: Ue,
|
|
486
|
+
tableWithSerial: Ve,
|
|
487
|
+
tableWithDefaultAction: De,
|
|
488
|
+
tableWithCustomActions: We,
|
|
489
|
+
tableWithSerialAndActions: Ge,
|
|
490
|
+
tableWithFooter: Ke,
|
|
491
|
+
tableWithFooterSave: Me,
|
|
492
|
+
tableWithTotals: qe,
|
|
493
|
+
tableWithMultipleFooters: ze,
|
|
494
|
+
tableHead: _e,
|
|
495
|
+
tableBody: Xe
|
|
496
|
+
}, E = ({
|
|
440
497
|
type: t = "table",
|
|
441
498
|
inData: e,
|
|
442
|
-
inColumns:
|
|
443
|
-
footer:
|
|
499
|
+
inColumns: o,
|
|
500
|
+
footer: n = [],
|
|
444
501
|
options: r = {}
|
|
445
502
|
} = {}) => {
|
|
446
503
|
if (t === "table") {
|
|
447
|
-
const s =
|
|
448
|
-
inColumns:
|
|
504
|
+
const s = Pe({
|
|
505
|
+
inColumns: o,
|
|
449
506
|
inData: e,
|
|
450
|
-
inFooter:
|
|
507
|
+
inFooter: n
|
|
451
508
|
});
|
|
452
|
-
return
|
|
509
|
+
return Je(s, r);
|
|
453
510
|
}
|
|
454
511
|
throw new Error(`Unknown table renderer type "${t}".`);
|
|
455
512
|
};
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
const
|
|
459
|
-
return
|
|
513
|
+
E.requests = Ye;
|
|
514
|
+
const j = ({ inItems: t, inRecipe: e, inExecute: o }) => {
|
|
515
|
+
const n = t, r = e, s = o;
|
|
516
|
+
return n.map((l) => C({
|
|
460
517
|
inSource: l,
|
|
461
518
|
inRecipe: r,
|
|
462
519
|
inExecute: s
|
|
463
520
|
})).flat(1 / 0).filter(Boolean);
|
|
464
|
-
},
|
|
465
|
-
const
|
|
466
|
-
let l =
|
|
521
|
+
}, Qe = ({ inSource: t, inRecipe: e, inExecute: o }) => {
|
|
522
|
+
const n = t, r = e, s = o;
|
|
523
|
+
let l = n;
|
|
467
524
|
typeof s == "function" && (l = s({
|
|
468
|
-
inSource:
|
|
525
|
+
inSource: n,
|
|
469
526
|
inRecipe: r
|
|
470
527
|
}));
|
|
471
|
-
for (const [a,
|
|
472
|
-
Array.isArray(
|
|
473
|
-
inItems:
|
|
528
|
+
for (const [a, c] of Object.entries(l))
|
|
529
|
+
Array.isArray(c) && r && a in r && (l[a] = j({
|
|
530
|
+
inItems: c,
|
|
474
531
|
inRecipe: r[a],
|
|
475
532
|
inExecute: s
|
|
476
533
|
}));
|
|
477
534
|
return l;
|
|
478
|
-
},
|
|
479
|
-
const
|
|
480
|
-
return Array.isArray(
|
|
481
|
-
inItems:
|
|
535
|
+
}, C = ({ inSource: t, inRecipe: e, inExecute: o }) => {
|
|
536
|
+
const n = t, r = e, s = o;
|
|
537
|
+
return Array.isArray(n) ? j({
|
|
538
|
+
inItems: n,
|
|
482
539
|
inRecipe: r,
|
|
483
540
|
inExecute: s
|
|
484
|
-
}) : typeof
|
|
485
|
-
inSource:
|
|
541
|
+
}) : typeof n == "object" && n !== null ? Qe({
|
|
542
|
+
inSource: n,
|
|
486
543
|
inRecipe: r,
|
|
487
544
|
inExecute: s
|
|
488
|
-
}) :
|
|
489
|
-
},
|
|
490
|
-
const
|
|
491
|
-
return (
|
|
492
|
-
},
|
|
493
|
-
const
|
|
494
|
-
return r && "transform" in r ?
|
|
495
|
-
inSource:
|
|
545
|
+
}) : n;
|
|
546
|
+
}, Ze = ({ inKey: t, inDirective: e }) => {
|
|
547
|
+
const o = t, n = e;
|
|
548
|
+
return (n == null ? void 0 : n.alterKey) || o;
|
|
549
|
+
}, to = ({ inValue: t, inDirective: e, inExecute: o }) => {
|
|
550
|
+
const n = t, r = e, s = o;
|
|
551
|
+
return r && "transform" in r ? C({
|
|
552
|
+
inSource: n,
|
|
496
553
|
inRecipe: r,
|
|
497
554
|
inExecute: s
|
|
498
|
-
}) :
|
|
499
|
-
},
|
|
500
|
-
const
|
|
501
|
-
return (
|
|
502
|
-
},
|
|
503
|
-
const
|
|
504
|
-
return
|
|
505
|
-
},
|
|
506
|
-
const
|
|
507
|
-
for (const [a,
|
|
555
|
+
}) : n;
|
|
556
|
+
}, eo = ({ inValue: t, inDirective: e }) => {
|
|
557
|
+
const o = t, n = e;
|
|
558
|
+
return (n == null ? void 0 : n.valueType) === "array" && !Array.isArray(o) ? [o] : o;
|
|
559
|
+
}, oo = ({ inValue: t, inDirective: e }) => {
|
|
560
|
+
const o = t, n = e;
|
|
561
|
+
return n != null && n.valueKey && o && typeof o == "object" ? o[n.valueKey] : o;
|
|
562
|
+
}, no = ({ inSource: t, inTransform: e, inExecute: o }) => {
|
|
563
|
+
const n = t, r = e, s = o, l = {};
|
|
564
|
+
for (const [a, c] of Object.entries(n)) {
|
|
508
565
|
if (!(a in r))
|
|
509
566
|
continue;
|
|
510
|
-
const
|
|
511
|
-
let
|
|
512
|
-
|
|
513
|
-
inValue:
|
|
514
|
-
inDirective:
|
|
567
|
+
const i = r[a], u = Ze({ inKey: a, inDirective: i });
|
|
568
|
+
let b = c;
|
|
569
|
+
b = to({
|
|
570
|
+
inValue: b,
|
|
571
|
+
inDirective: i,
|
|
515
572
|
inExecute: s
|
|
516
|
-
}),
|
|
573
|
+
}), b = eo({ inValue: b, inDirective: i }), b = oo({ inValue: b, inDirective: i }), l[u] = b;
|
|
517
574
|
}
|
|
518
575
|
return l;
|
|
519
576
|
};
|
|
520
|
-
function
|
|
521
|
-
for (const
|
|
522
|
-
typeof t[
|
|
577
|
+
function F(t, e) {
|
|
578
|
+
for (const o in t)
|
|
579
|
+
typeof t[o] == "object" && t[o] !== null ? F(t[o], e) : typeof t[o] == "string" && t[o] === "${}" && (t[o] = e);
|
|
523
580
|
return t;
|
|
524
581
|
}
|
|
525
|
-
const
|
|
526
|
-
const
|
|
582
|
+
const ro = ({ inSource: t, inOperation: e, inExecute: o }) => {
|
|
583
|
+
const n = t, r = e;
|
|
527
584
|
for (const [s, l] of Object.entries(r))
|
|
528
|
-
if ("operationType" in l && l.operationType === "loopArray" && s in
|
|
529
|
-
const a =
|
|
530
|
-
const
|
|
531
|
-
return
|
|
585
|
+
if ("operationType" in l && l.operationType === "loopArray" && s in n) {
|
|
586
|
+
const a = n[s].map((c) => {
|
|
587
|
+
const i = structuredClone(l == null ? void 0 : l.template);
|
|
588
|
+
return F(i, c), i;
|
|
532
589
|
});
|
|
533
|
-
|
|
590
|
+
n[s] = a;
|
|
534
591
|
}
|
|
535
|
-
return
|
|
536
|
-
},
|
|
537
|
-
const
|
|
538
|
-
let
|
|
539
|
-
for (const [r, s] of Object.entries(
|
|
592
|
+
return n;
|
|
593
|
+
}, so = ({ inSource: t, inTemplate: e }) => {
|
|
594
|
+
const o = t;
|
|
595
|
+
let n = [];
|
|
596
|
+
for (const [r, s] of Object.entries(o)) {
|
|
540
597
|
const l = structuredClone(e);
|
|
541
|
-
l.textContent = s,
|
|
598
|
+
l.textContent = s, n.push(l);
|
|
542
599
|
}
|
|
543
|
-
return
|
|
544
|
-
},
|
|
545
|
-
const
|
|
600
|
+
return n;
|
|
601
|
+
}, lo = ({ inSource: t, inBuild: e, inExecute: o }) => {
|
|
602
|
+
const n = structuredClone(t), r = structuredClone(e);
|
|
546
603
|
for (const [s, l] of Object.entries(r)) {
|
|
547
|
-
const a =
|
|
548
|
-
inSource:
|
|
604
|
+
const a = so({
|
|
605
|
+
inSource: n[s],
|
|
549
606
|
inTemplate: l
|
|
550
607
|
});
|
|
551
|
-
|
|
608
|
+
n[s] = a;
|
|
552
609
|
}
|
|
553
|
-
return
|
|
554
|
-
},
|
|
555
|
-
const r = structuredClone(e == null ? void 0 : e.row), s =
|
|
556
|
-
inSource:
|
|
610
|
+
return n;
|
|
611
|
+
}, ao = ({ inSource: t, inTemplate: e }) => t.map((n) => {
|
|
612
|
+
const r = structuredClone(e == null ? void 0 : e.row), s = co({
|
|
613
|
+
inSource: n,
|
|
557
614
|
inTemplate: e == null ? void 0 : e.cell
|
|
558
615
|
});
|
|
559
616
|
return r.children = s, r;
|
|
560
|
-
}),
|
|
561
|
-
const
|
|
562
|
-
let
|
|
563
|
-
for (const [r, s] of Object.entries(
|
|
617
|
+
}), co = ({ inSource: t, inTemplate: e }) => {
|
|
618
|
+
const o = t;
|
|
619
|
+
let n = [];
|
|
620
|
+
for (const [r, s] of Object.entries(o)) {
|
|
564
621
|
const l = structuredClone(e);
|
|
565
|
-
l.textContent = s,
|
|
622
|
+
l.textContent = s, n.push(l);
|
|
566
623
|
}
|
|
567
|
-
return
|
|
568
|
-
},
|
|
569
|
-
const
|
|
624
|
+
return n;
|
|
625
|
+
}, io = ({ inSource: t, inBuild: e, inExecute: o }) => {
|
|
626
|
+
const n = structuredClone(t), r = structuredClone(e);
|
|
570
627
|
for (const [s, l] of Object.entries(r)) {
|
|
571
|
-
const a =
|
|
572
|
-
inSource:
|
|
628
|
+
const a = ao({
|
|
629
|
+
inSource: n[s],
|
|
573
630
|
inTemplate: l
|
|
574
631
|
});
|
|
575
|
-
|
|
632
|
+
n[s] = a;
|
|
576
633
|
}
|
|
577
|
-
return
|
|
578
|
-
},
|
|
634
|
+
return n;
|
|
635
|
+
}, uo = ({ inSource: t, inTemplate: e }) => t.map((r) => {
|
|
579
636
|
const s = structuredClone(e);
|
|
580
637
|
return s.textContent = r == null ? void 0 : r.columnName, s;
|
|
581
|
-
}),
|
|
582
|
-
const
|
|
638
|
+
}), bo = ({ inSource: t, inBuild: e, inExecute: o }) => {
|
|
639
|
+
const n = structuredClone(t), r = structuredClone(e);
|
|
583
640
|
for (const [s, l] of Object.entries(r)) {
|
|
584
|
-
const a =
|
|
585
|
-
inSource:
|
|
641
|
+
const a = uo({
|
|
642
|
+
inSource: n[s],
|
|
586
643
|
inTemplate: l == null ? void 0 : l.cell
|
|
587
644
|
});
|
|
588
|
-
|
|
645
|
+
n[s] = l == null ? void 0 : l.row, n[s].children = a;
|
|
589
646
|
}
|
|
590
|
-
return
|
|
591
|
-
},
|
|
592
|
-
const r = structuredClone(e == null ? void 0 : e.row), s =
|
|
593
|
-
inSource:
|
|
647
|
+
return n;
|
|
648
|
+
}, fo = ({ inSource: t, inTemplate: e }) => t.map((n) => {
|
|
649
|
+
const r = structuredClone(e == null ? void 0 : e.row), s = ho({
|
|
650
|
+
inSource: n,
|
|
594
651
|
inTemplate: e == null ? void 0 : e.cell
|
|
595
652
|
});
|
|
596
653
|
return r.children = s, r;
|
|
597
|
-
}),
|
|
598
|
-
const
|
|
599
|
-
let
|
|
600
|
-
for (const [r, s] of Object.entries(
|
|
654
|
+
}), ho = ({ inSource: t, inTemplate: e }) => {
|
|
655
|
+
const o = t;
|
|
656
|
+
let n = [];
|
|
657
|
+
for (const [r, s] of Object.entries(o)) {
|
|
601
658
|
const l = structuredClone(e);
|
|
602
|
-
l.textContent = s,
|
|
659
|
+
l.textContent = s, n.push(l);
|
|
603
660
|
}
|
|
604
|
-
return
|
|
605
|
-
},
|
|
606
|
-
const
|
|
661
|
+
return n;
|
|
662
|
+
}, mo = ({ inSource: t, inBuild: e, inExecute: o }) => {
|
|
663
|
+
const n = structuredClone(t), r = structuredClone(e);
|
|
607
664
|
for (const [s, l] of Object.entries(r)) {
|
|
608
|
-
const a =
|
|
609
|
-
inSource:
|
|
665
|
+
const a = fo({
|
|
666
|
+
inSource: n[s],
|
|
610
667
|
inTemplate: l
|
|
611
668
|
});
|
|
612
|
-
|
|
669
|
+
n[s] = l == null ? void 0 : l.body, n[s].children = a;
|
|
613
670
|
}
|
|
614
|
-
return
|
|
615
|
-
},
|
|
616
|
-
const r = structuredClone(e == null ? void 0 : e.row), s =
|
|
617
|
-
inSource:
|
|
671
|
+
return n;
|
|
672
|
+
}, po = ({ inSource: t, inTemplate: e }) => t.map((n) => {
|
|
673
|
+
const r = structuredClone(e == null ? void 0 : e.row), s = yo({
|
|
674
|
+
inSource: n,
|
|
618
675
|
inTemplate: e == null ? void 0 : e.cell
|
|
619
676
|
});
|
|
620
677
|
return r.children = s, r;
|
|
621
|
-
}),
|
|
622
|
-
const
|
|
623
|
-
let
|
|
624
|
-
for (const [r, s] of Object.entries(
|
|
678
|
+
}), yo = ({ inSource: t, inTemplate: e }) => {
|
|
679
|
+
const o = t;
|
|
680
|
+
let n = [];
|
|
681
|
+
for (const [r, s] of Object.entries(o)) {
|
|
625
682
|
const l = structuredClone(e);
|
|
626
|
-
l.textContent = s,
|
|
683
|
+
l.textContent = s, n.push(l);
|
|
627
684
|
}
|
|
628
|
-
return
|
|
629
|
-
},
|
|
630
|
-
const
|
|
685
|
+
return n;
|
|
686
|
+
}, go = ({ inSource: t, inBuild: e, inExecute: o }) => {
|
|
687
|
+
const n = structuredClone(t), r = structuredClone(e);
|
|
631
688
|
for (const [s, l] of Object.entries(r)) {
|
|
632
|
-
const a =
|
|
633
|
-
inSource:
|
|
689
|
+
const a = po({
|
|
690
|
+
inSource: n[s],
|
|
634
691
|
inTemplate: l
|
|
635
692
|
});
|
|
636
|
-
|
|
693
|
+
n[s] = l == null ? void 0 : l.body, n[s].children = a;
|
|
637
694
|
}
|
|
638
|
-
return
|
|
639
|
-
},
|
|
640
|
-
const
|
|
641
|
-
for (let [s, l] of Object.entries(
|
|
695
|
+
return n;
|
|
696
|
+
}, wo = ({ inSource: t, inTransform: e, inExecute: o }) => {
|
|
697
|
+
const n = e, r = {};
|
|
698
|
+
for (let [s, l] of Object.entries(n))
|
|
642
699
|
console.log("aaaaaaaaa : ", s);
|
|
643
700
|
return r;
|
|
644
|
-
},
|
|
645
|
-
let
|
|
646
|
-
const
|
|
647
|
-
return
|
|
648
|
-
inSource:
|
|
649
|
-
inTransform:
|
|
650
|
-
inExecute:
|
|
651
|
-
})),
|
|
652
|
-
inSource:
|
|
653
|
-
inOperation:
|
|
654
|
-
inExecute:
|
|
655
|
-
})),
|
|
656
|
-
inSource:
|
|
657
|
-
inBuild:
|
|
658
|
-
inExecute:
|
|
659
|
-
})),
|
|
660
|
-
inSource:
|
|
661
|
-
inBuild:
|
|
662
|
-
inExecute:
|
|
663
|
-
})),
|
|
664
|
-
inSource:
|
|
665
|
-
inBuild:
|
|
666
|
-
inExecute:
|
|
667
|
-
})),
|
|
668
|
-
inSource:
|
|
669
|
-
inBuild:
|
|
670
|
-
inExecute:
|
|
671
|
-
})),
|
|
672
|
-
inSource:
|
|
673
|
-
inBuild:
|
|
674
|
-
inExecute:
|
|
675
|
-
})),
|
|
676
|
-
inSource:
|
|
677
|
-
inTransform:
|
|
678
|
-
inExecute:
|
|
679
|
-
})),
|
|
680
|
-
},
|
|
701
|
+
}, d = ({ inSource: t, inRecipe: e }) => {
|
|
702
|
+
let o = t;
|
|
703
|
+
const n = e;
|
|
704
|
+
return n && typeof n == "object" && "transform" in n && (o = no({
|
|
705
|
+
inSource: o,
|
|
706
|
+
inTransform: n.transform,
|
|
707
|
+
inExecute: d
|
|
708
|
+
})), n && typeof n == "object" && "operation" in n && (o = ro({
|
|
709
|
+
inSource: o,
|
|
710
|
+
inOperation: n.operation,
|
|
711
|
+
inExecute: d
|
|
712
|
+
})), n && typeof n == "object" && "build" in n && (o = lo({
|
|
713
|
+
inSource: o,
|
|
714
|
+
inBuild: n == null ? void 0 : n.build,
|
|
715
|
+
inExecute: d
|
|
716
|
+
})), n && typeof n == "object" && "buildCollection" in n && (o = io({
|
|
717
|
+
inSource: o,
|
|
718
|
+
inBuild: n == null ? void 0 : n.buildCollection,
|
|
719
|
+
inExecute: d
|
|
720
|
+
})), n && typeof n == "object" && "buildArray" in n && (o = bo({
|
|
721
|
+
inSource: o,
|
|
722
|
+
inBuild: n == null ? void 0 : n.buildArray,
|
|
723
|
+
inExecute: d
|
|
724
|
+
})), n && typeof n == "object" && "buildBody" in n && (o = mo({
|
|
725
|
+
inSource: o,
|
|
726
|
+
inBuild: n == null ? void 0 : n.buildBody,
|
|
727
|
+
inExecute: d
|
|
728
|
+
})), n && typeof n == "object" && "objectToArray" in n && (o = go({
|
|
729
|
+
inSource: o,
|
|
730
|
+
inBuild: n == null ? void 0 : n.objectToArray,
|
|
731
|
+
inExecute: d
|
|
732
|
+
})), n && typeof n == "object" && "spec" in n && (o = wo({
|
|
733
|
+
inSource: o,
|
|
734
|
+
inTransform: n == null ? void 0 : n.spec,
|
|
735
|
+
inExecute: d
|
|
736
|
+
})), o;
|
|
737
|
+
}, Co = (t, e) => C({
|
|
681
738
|
inSource: t,
|
|
682
739
|
inRecipe: e,
|
|
683
|
-
inExecute:
|
|
684
|
-
}),
|
|
740
|
+
inExecute: d
|
|
741
|
+
}), $o = {
|
|
685
742
|
children: ""
|
|
686
|
-
},
|
|
743
|
+
}, Ao = {
|
|
687
744
|
children: {
|
|
688
745
|
operationType: "loopArray",
|
|
689
746
|
template: {
|
|
@@ -694,354 +751,379 @@ const Je = ({ inSource: t, inOperation: e, inExecute: n }) => {
|
|
|
694
751
|
textContent: "${}"
|
|
695
752
|
}
|
|
696
753
|
}
|
|
697
|
-
},
|
|
698
|
-
transform:
|
|
699
|
-
operation:
|
|
700
|
-
},
|
|
754
|
+
}, No = {
|
|
755
|
+
transform: $o,
|
|
756
|
+
operation: Ao
|
|
757
|
+
}, B = ({
|
|
701
758
|
inData: t
|
|
702
759
|
}) => {
|
|
703
|
-
let
|
|
760
|
+
let o = Co({
|
|
704
761
|
children: t
|
|
705
|
-
},
|
|
706
|
-
return
|
|
707
|
-
},
|
|
762
|
+
}, No);
|
|
763
|
+
return o == null ? void 0 : o.children;
|
|
764
|
+
}, xo = "select", To = {
|
|
708
765
|
id: "LedgerName"
|
|
709
|
-
},
|
|
710
|
-
tagName:
|
|
711
|
-
attributes:
|
|
712
|
-
children:
|
|
713
|
-
},
|
|
766
|
+
}, So = [], Eo = {
|
|
767
|
+
tagName: xo,
|
|
768
|
+
attributes: To,
|
|
769
|
+
children: So
|
|
770
|
+
}, jo = ({
|
|
714
771
|
inData: t
|
|
715
772
|
}) => {
|
|
716
|
-
let
|
|
773
|
+
let o = B({
|
|
717
774
|
inData: t
|
|
718
775
|
});
|
|
719
|
-
const
|
|
720
|
-
return
|
|
721
|
-
},
|
|
776
|
+
const n = structuredClone(Eo);
|
|
777
|
+
return n.children = o, n;
|
|
778
|
+
}, Fo = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Bo = (t, e) => {
|
|
779
|
+
if (!Fo(t)) return;
|
|
780
|
+
let o = {};
|
|
781
|
+
for (const [n, r] of Object.entries(t))
|
|
782
|
+
o[n] = $(r, e);
|
|
783
|
+
return o;
|
|
784
|
+
}, Io = (t, e) => {
|
|
785
|
+
const o = structuredClone(t);
|
|
786
|
+
return Array.isArray(o) ? o.map((r) => $(r, e)) : void 0;
|
|
787
|
+
}, I = (t, e) => t.replace(/\$\{(\w+)\}/g, (o, n) => e[n] !== void 0 ? e[n] : o), ko = (t, e) => I(t, e), $ = (t, e) => {
|
|
788
|
+
const o = structuredClone(t);
|
|
789
|
+
return typeof o == "string" ? I(o, e) : (o === null || typeof o != "object" || ("textContent" in o && (o.textContent = ko(o == null ? void 0 : o.textContent, e)), "attributes" in o && (o.attributes = Bo(o == null ? void 0 : o.attributes, e)), "children" in o && (o.children = Io(o == null ? void 0 : o.children, e))), o);
|
|
790
|
+
}, Oo = (t, e) => {
|
|
791
|
+
const o = t, n = e;
|
|
792
|
+
return o.map((r) => $(n, r));
|
|
793
|
+
}, k = (t, e, o) => {
|
|
794
|
+
const n = o, r = e;
|
|
795
|
+
let s = [];
|
|
796
|
+
return n.map((l) => {
|
|
797
|
+
let a = structuredClone(t);
|
|
798
|
+
a.textContent = r[l.columnName], s.push(a);
|
|
799
|
+
}), s;
|
|
800
|
+
}, O = (t, e, o) => {
|
|
801
|
+
t.forEach((n, r) => {
|
|
802
|
+
const s = e == null ? void 0 : e.data[r], l = k(o, s, e == null ? void 0 : e.columns);
|
|
803
|
+
n.children = l;
|
|
804
|
+
});
|
|
805
|
+
}, vo = (t, e) => {
|
|
806
|
+
const o = structuredClone(e);
|
|
807
|
+
o.attributes.width = "50px", t.unshift(o);
|
|
808
|
+
}, Po = (t, e) => {
|
|
809
|
+
const o = structuredClone(e);
|
|
810
|
+
o.textContent = "#", t.unshift(o);
|
|
811
|
+
}, Lo = (t, e) => {
|
|
812
|
+
t.forEach((o, n) => {
|
|
813
|
+
const r = structuredClone(e);
|
|
814
|
+
r.textContent = n + 1, o.children.unshift(r);
|
|
815
|
+
});
|
|
816
|
+
}, Ho = (t, e) => {
|
|
817
|
+
const o = structuredClone(e);
|
|
818
|
+
delete o.children, t.unshift(o);
|
|
819
|
+
}, Ro = (t, e) => {
|
|
820
|
+
vo(t == null ? void 0 : t.children[0].children, e == null ? void 0 : e.buildColGroup), Po(t == null ? void 0 : t.children[1].children[0].children, e == null ? void 0 : e.buildHeader), Lo(t == null ? void 0 : t.children[2].children, e == null ? void 0 : e.buildBodyCell), Ho(t == null ? void 0 : t.children[3].children[0].children, e == null ? void 0 : e.buildFooter);
|
|
821
|
+
}, Jo = (t, e) => {
|
|
822
|
+
const o = structuredClone(e);
|
|
823
|
+
o.attributes.width = "100px", t.push(o);
|
|
824
|
+
}, Uo = (t, e) => {
|
|
825
|
+
const o = structuredClone(e);
|
|
826
|
+
o.textContent = "options", t.push(o);
|
|
827
|
+
}, Vo = (t, e) => {
|
|
828
|
+
t.forEach((o, n) => {
|
|
829
|
+
const r = structuredClone(e);
|
|
830
|
+
r.textContent = "show", o.children.push(r);
|
|
831
|
+
});
|
|
832
|
+
}, Do = (t, e) => {
|
|
833
|
+
const o = structuredClone(e);
|
|
834
|
+
o.textContent = "save", t.push(o);
|
|
835
|
+
}, Wo = (t, e) => {
|
|
836
|
+
Jo(t == null ? void 0 : t.children[0].children, e == null ? void 0 : e.buildColGroup), Uo(t == null ? void 0 : t.children[1].children[0].children, e == null ? void 0 : e.buildHeader), Vo(t == null ? void 0 : t.children[2].children, e == null ? void 0 : e.button), Do(t == null ? void 0 : t.children[3].children[0].children, e == null ? void 0 : e.button);
|
|
837
|
+
}, y = (t, e) => {
|
|
838
|
+
var o;
|
|
839
|
+
if (((o = t == null ? void 0 : t.attributes) == null ? void 0 : o["data-role"]) === e) return t;
|
|
840
|
+
for (const n of (t == null ? void 0 : t.children) ?? []) {
|
|
841
|
+
const r = y(n, e);
|
|
842
|
+
if (r) return r;
|
|
843
|
+
}
|
|
844
|
+
return null;
|
|
845
|
+
}, Go = (t, e) => {
|
|
846
|
+
const o = t[e.fileName], n = e.dataRole ? y(o, e.dataRole) : o;
|
|
847
|
+
return (e.filePath ?? []).reduce((r, s) => r[s], n);
|
|
848
|
+
}, Ko = {
|
|
849
|
+
tagName: "tr",
|
|
850
|
+
attributes: {
|
|
851
|
+
class: "align-middle"
|
|
852
|
+
},
|
|
853
|
+
children: []
|
|
854
|
+
}, Mo = {
|
|
855
|
+
tagName: "col",
|
|
856
|
+
attributes: {
|
|
857
|
+
width: "${width}"
|
|
858
|
+
}
|
|
859
|
+
}, qo = {
|
|
860
|
+
tagName: "th",
|
|
861
|
+
textContent: "${columnName}",
|
|
862
|
+
attributes: {
|
|
863
|
+
class: "py-3 px-3 fw-semibold text-uppercase small"
|
|
864
|
+
}
|
|
865
|
+
}, zo = {
|
|
866
|
+
tagName: "td",
|
|
867
|
+
children: [
|
|
868
|
+
{
|
|
869
|
+
tagName: "input",
|
|
870
|
+
attributes: {
|
|
871
|
+
type: "text",
|
|
872
|
+
placeholder: "enter ${columnName}",
|
|
873
|
+
name: "${columnName}",
|
|
874
|
+
class: "form-control"
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
]
|
|
878
|
+
}, _o = {
|
|
879
|
+
tagName: "td",
|
|
880
|
+
textContent: "${rowValue}",
|
|
881
|
+
attributes: {
|
|
882
|
+
class: "py-3 px-3 text-secondary"
|
|
883
|
+
}
|
|
884
|
+
}, Xo = {
|
|
885
|
+
tagName: "button",
|
|
886
|
+
textContent: "${columnName}",
|
|
887
|
+
attributes: {
|
|
888
|
+
class: "btn btn-primary btn-sm"
|
|
889
|
+
}
|
|
890
|
+
}, Yo = {
|
|
891
|
+
tagName: "option",
|
|
892
|
+
textContent: "${rowValue}",
|
|
893
|
+
attributes: {
|
|
894
|
+
value: "${rowValue}"
|
|
895
|
+
}
|
|
896
|
+
}, Qo = {
|
|
897
|
+
tagName: "select",
|
|
898
|
+
attributes: {
|
|
899
|
+
"data-name": "${columnName}"
|
|
900
|
+
},
|
|
901
|
+
children: []
|
|
902
|
+
}, Zo = {
|
|
903
|
+
tagName: "datalist",
|
|
904
|
+
attributes: {
|
|
905
|
+
"data-name": "${columnName}"
|
|
906
|
+
},
|
|
907
|
+
children: []
|
|
908
|
+
}, m = {
|
|
909
|
+
buildBodyTr: Ko,
|
|
910
|
+
buildColGroup: Mo,
|
|
911
|
+
buildHeader: qo,
|
|
912
|
+
buildFooter: zo,
|
|
913
|
+
buildBodyCell: _o,
|
|
914
|
+
button: Xo,
|
|
915
|
+
buildOption: Yo,
|
|
916
|
+
buildSelect: Qo,
|
|
917
|
+
buildDataList: Zo
|
|
918
|
+
}, tn = "table", en = {
|
|
722
919
|
class: "table table-hover table-striped align-middle border mb-0"
|
|
723
|
-
},
|
|
920
|
+
}, on = [
|
|
921
|
+
{
|
|
922
|
+
tagName: "colgroup",
|
|
923
|
+
attributes: {
|
|
924
|
+
"data-role": "table-colgroup"
|
|
925
|
+
},
|
|
926
|
+
children: []
|
|
927
|
+
},
|
|
724
928
|
{
|
|
725
929
|
tagName: "thead",
|
|
726
930
|
attributes: {
|
|
727
|
-
class: "table-dark"
|
|
931
|
+
class: "table-dark",
|
|
932
|
+
"data-role": "table-header"
|
|
728
933
|
},
|
|
729
934
|
children: [
|
|
730
935
|
{
|
|
731
936
|
tagName: "tr",
|
|
937
|
+
attributes: {
|
|
938
|
+
"data-role": "table-header-row"
|
|
939
|
+
},
|
|
732
940
|
children: []
|
|
733
941
|
}
|
|
734
942
|
]
|
|
735
943
|
},
|
|
736
944
|
{
|
|
737
945
|
tagName: "tbody",
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
], io = {
|
|
741
|
-
tagName: lo,
|
|
742
|
-
attributes: ao,
|
|
743
|
-
children: co
|
|
744
|
-
}, uo = {
|
|
745
|
-
columns: {
|
|
746
|
-
row: {
|
|
747
|
-
tagName: "tr"
|
|
748
|
-
},
|
|
749
|
-
cell: {
|
|
750
|
-
tagName: "th",
|
|
751
|
-
textContent: "${}"
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
}, bo = {
|
|
755
|
-
rows: {
|
|
756
|
-
body: {
|
|
757
|
-
tagName: "tbody"
|
|
946
|
+
attributes: {
|
|
947
|
+
"data-role": "table-body"
|
|
758
948
|
},
|
|
759
|
-
|
|
760
|
-
|
|
949
|
+
children: []
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
tagName: "tfoot",
|
|
953
|
+
attributes: {
|
|
954
|
+
"data-role": "table-footer"
|
|
761
955
|
},
|
|
762
|
-
|
|
763
|
-
tagName: "td",
|
|
764
|
-
textContent: "${}"
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
}, mo = {
|
|
768
|
-
buildArray: uo,
|
|
769
|
-
buildBody: bo
|
|
770
|
-
}, ho = ({
|
|
771
|
-
inColumns: t = [],
|
|
772
|
-
inData: e = [],
|
|
773
|
-
inFooter: n = []
|
|
774
|
-
} = {}) => {
|
|
775
|
-
const o = structuredClone(io), r = t.map((l) => ({
|
|
776
|
-
columnName: l
|
|
777
|
-
})), s = $({ columns: r, rows: e }, mo);
|
|
778
|
-
return o.children[0].children = [s == null ? void 0 : s.columns], o.children[1] = s == null ? void 0 : s.rows, o;
|
|
779
|
-
}, po = (t) => {
|
|
780
|
-
const [e, n] = t.children;
|
|
781
|
-
console.log("aaaaaaa--", e.children[0]), e.children[0].children.unshift({
|
|
782
|
-
tagName: "th",
|
|
783
|
-
textContent: "#"
|
|
784
|
-
}), n.children.forEach((o, r) => {
|
|
785
|
-
o.children.unshift({
|
|
786
|
-
tagName: "td",
|
|
787
|
-
textContent: String(r + 1)
|
|
788
|
-
});
|
|
789
|
-
});
|
|
790
|
-
}, fo = (t) => t === !0 ? [{ label: "Apply", type: "button" }] : Array.isArray(t) ? t : [], go = (t, e) => {
|
|
791
|
-
const n = fo(e);
|
|
792
|
-
if (n.length === 0) return;
|
|
793
|
-
const [o, r] = t.children;
|
|
794
|
-
o.children[0].children.push({
|
|
795
|
-
tagName: "th",
|
|
796
|
-
textContent: "Actions"
|
|
797
|
-
}), r.children.forEach((s) => {
|
|
798
|
-
s.children.push({
|
|
799
|
-
tagName: "td",
|
|
800
|
-
children: n.map((l) => ({
|
|
801
|
-
tagName: "button",
|
|
802
|
-
attributes: { type: l.type || "button" },
|
|
803
|
-
textContent: l.label
|
|
804
|
-
}))
|
|
805
|
-
});
|
|
806
|
-
});
|
|
807
|
-
}, yo = (t, e = {}) => (e.showSerial && po(t), e.showOptions && go(t, e.showOptions), t), wo = {
|
|
808
|
-
type: "table",
|
|
809
|
-
data: [
|
|
810
|
-
{
|
|
811
|
-
itemName: "0.09/30mm",
|
|
812
|
-
baseUnit: "kgs"
|
|
813
|
-
}
|
|
814
|
-
],
|
|
815
|
-
columns: [
|
|
816
|
-
"itemName",
|
|
817
|
-
"baseUnit"
|
|
818
|
-
],
|
|
819
|
-
options: {}
|
|
820
|
-
}, Co = {
|
|
821
|
-
type: "table",
|
|
822
|
-
data: [
|
|
823
|
-
{
|
|
824
|
-
itemName: "0.09/30mm",
|
|
825
|
-
baseUnit: "kgs"
|
|
826
|
-
}
|
|
827
|
-
],
|
|
828
|
-
columns: [
|
|
829
|
-
"itemName",
|
|
830
|
-
"baseUnit"
|
|
831
|
-
],
|
|
832
|
-
options: {
|
|
833
|
-
showSerial: !0
|
|
834
|
-
}
|
|
835
|
-
}, $o = {
|
|
836
|
-
type: "table",
|
|
837
|
-
data: [
|
|
838
|
-
{
|
|
839
|
-
itemName: "0.09/30mm",
|
|
840
|
-
baseUnit: "kgs"
|
|
841
|
-
}
|
|
842
|
-
],
|
|
843
|
-
columns: [
|
|
844
|
-
"itemName",
|
|
845
|
-
"baseUnit"
|
|
846
|
-
],
|
|
847
|
-
options: {
|
|
848
|
-
showOptions: !0
|
|
849
|
-
}
|
|
850
|
-
}, No = {
|
|
851
|
-
type: "table",
|
|
852
|
-
data: [
|
|
853
|
-
{
|
|
854
|
-
itemName: "0.09/30mm",
|
|
855
|
-
baseUnit: "kgs"
|
|
856
|
-
}
|
|
857
|
-
],
|
|
858
|
-
columns: [
|
|
859
|
-
"itemName",
|
|
860
|
-
"baseUnit"
|
|
861
|
-
],
|
|
862
|
-
options: {
|
|
863
|
-
showOptions: [
|
|
864
|
-
{
|
|
865
|
-
label: "Show",
|
|
866
|
-
type: "button"
|
|
867
|
-
},
|
|
956
|
+
children: [
|
|
868
957
|
{
|
|
869
|
-
|
|
870
|
-
|
|
958
|
+
tagName: "tr",
|
|
959
|
+
attributes: {
|
|
960
|
+
"data-role": "table-footer-row"
|
|
961
|
+
},
|
|
962
|
+
children: []
|
|
871
963
|
}
|
|
872
964
|
]
|
|
873
965
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
966
|
+
], h = {
|
|
967
|
+
tagName: tn,
|
|
968
|
+
attributes: en,
|
|
969
|
+
children: on
|
|
970
|
+
}, nn = [
|
|
971
|
+
{
|
|
972
|
+
destinationPath: {
|
|
973
|
+
fileName: "base",
|
|
974
|
+
dataRole: "table-colgroup",
|
|
975
|
+
filePath: [
|
|
976
|
+
"children"
|
|
977
|
+
]
|
|
978
|
+
},
|
|
979
|
+
sourcePath: {
|
|
980
|
+
fileName: "data",
|
|
981
|
+
filePath: [
|
|
982
|
+
"colGroup"
|
|
983
|
+
]
|
|
984
|
+
},
|
|
985
|
+
templateKey: "buildColGroup",
|
|
986
|
+
func: "fromCollection"
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
destinationPath: {
|
|
990
|
+
fileName: "base",
|
|
991
|
+
dataRole: "table-header-row",
|
|
992
|
+
filePath: [
|
|
993
|
+
"children"
|
|
994
|
+
]
|
|
995
|
+
},
|
|
996
|
+
sourcePath: {
|
|
997
|
+
fileName: "data",
|
|
998
|
+
filePath: [
|
|
999
|
+
"columns"
|
|
1000
|
+
]
|
|
1001
|
+
},
|
|
1002
|
+
templateKey: "buildHeader",
|
|
1003
|
+
func: "fromCollection"
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
destinationPath: {
|
|
1007
|
+
fileName: "base",
|
|
1008
|
+
dataRole: "table-footer-row",
|
|
1009
|
+
filePath: [
|
|
1010
|
+
"children"
|
|
1011
|
+
]
|
|
1012
|
+
},
|
|
1013
|
+
sourcePath: {
|
|
1014
|
+
fileName: "data",
|
|
1015
|
+
filePath: [
|
|
1016
|
+
"columns"
|
|
1017
|
+
]
|
|
1018
|
+
},
|
|
1019
|
+
templateKey: "buildFooter",
|
|
1020
|
+
func: "fromCollection"
|
|
894
1021
|
}
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
columns: [
|
|
904
|
-
"itemName",
|
|
905
|
-
"baseUnit"
|
|
906
|
-
],
|
|
907
|
-
footer: [
|
|
908
|
-
"inputs"
|
|
909
|
-
],
|
|
910
|
-
options: {}
|
|
911
|
-
}, So = {
|
|
912
|
-
type: "table",
|
|
913
|
-
data: [
|
|
914
|
-
{
|
|
915
|
-
itemName: "0.09/30mm",
|
|
916
|
-
baseUnit: "kgs"
|
|
917
|
-
}
|
|
918
|
-
],
|
|
919
|
-
columns: [
|
|
920
|
-
"itemName",
|
|
921
|
-
"baseUnit"
|
|
922
|
-
],
|
|
923
|
-
footer: [
|
|
924
|
-
"inputsWithSave"
|
|
925
|
-
],
|
|
926
|
-
options: {}
|
|
927
|
-
}, xo = {
|
|
928
|
-
type: "table",
|
|
929
|
-
data: [
|
|
930
|
-
{
|
|
931
|
-
itemName: "0.09/30mm",
|
|
932
|
-
baseUnit: "2"
|
|
1022
|
+
], rn = [
|
|
1023
|
+
{
|
|
1024
|
+
destinationPath: {
|
|
1025
|
+
fileName: "base",
|
|
1026
|
+
dataRole: "table-body",
|
|
1027
|
+
filePath: [
|
|
1028
|
+
"children"
|
|
1029
|
+
]
|
|
933
1030
|
},
|
|
934
|
-
{
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
"
|
|
941
|
-
"
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
]
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
"itemName",
|
|
957
|
-
"baseUnit"
|
|
958
|
-
],
|
|
959
|
-
footer: [
|
|
960
|
-
"inputs",
|
|
961
|
-
"totals",
|
|
962
|
-
"inputsWithSave",
|
|
963
|
-
"empty"
|
|
964
|
-
],
|
|
965
|
-
options: {}
|
|
966
|
-
}, ko = {
|
|
967
|
-
type: "tableHead",
|
|
968
|
-
data: [],
|
|
969
|
-
columns: [
|
|
970
|
-
"itemName",
|
|
971
|
-
"baseUnit"
|
|
972
|
-
],
|
|
973
|
-
options: {}
|
|
974
|
-
}, Bo = {
|
|
975
|
-
type: "tableBody",
|
|
976
|
-
data: [
|
|
977
|
-
{
|
|
978
|
-
itemName: "0.09/30mm",
|
|
979
|
-
baseUnit: "kgs"
|
|
980
|
-
}
|
|
981
|
-
],
|
|
982
|
-
columns: [
|
|
983
|
-
"itemName",
|
|
984
|
-
"baseUnit"
|
|
985
|
-
],
|
|
986
|
-
options: {}
|
|
987
|
-
}, Uo = {
|
|
988
|
-
table: wo,
|
|
989
|
-
tableWithSerial: Co,
|
|
990
|
-
tableWithDefaultAction: $o,
|
|
991
|
-
tableWithCustomActions: No,
|
|
992
|
-
tableWithSerialAndActions: Ao,
|
|
993
|
-
tableWithFooter: To,
|
|
994
|
-
tableWithFooterSave: So,
|
|
995
|
-
tableWithTotals: xo,
|
|
996
|
-
tableWithMultipleFooters: Eo,
|
|
997
|
-
tableHead: ko,
|
|
998
|
-
tableBody: Bo
|
|
999
|
-
}, A = ({
|
|
1031
|
+
sourcePath: {
|
|
1032
|
+
fileName: "data",
|
|
1033
|
+
filePath: [
|
|
1034
|
+
"data"
|
|
1035
|
+
]
|
|
1036
|
+
},
|
|
1037
|
+
templateKey: "buildBodyTr",
|
|
1038
|
+
func: "fromCollection"
|
|
1039
|
+
}
|
|
1040
|
+
], p = { data: {}, base: h, spec: m }, sn = { fromCollection: Oo, tableBody: k, buildBody: O }, ln = (t, e) => {
|
|
1041
|
+
const o = t.dataRole ? y(p[t.fileName], t.dataRole) : p[t.fileName], n = [...t.filePath ?? []], r = n.pop(), s = n.reduce((l, a) => l[a], o);
|
|
1042
|
+
s[r] = e;
|
|
1043
|
+
}, x = (t) => {
|
|
1044
|
+
t.forEach((e) => {
|
|
1045
|
+
const o = Go(p, e.sourcePath);
|
|
1046
|
+
if (o) {
|
|
1047
|
+
const n = sn[e.func](o, m[e.templateKey]);
|
|
1048
|
+
ln(e.destinationPath, n);
|
|
1049
|
+
} else
|
|
1050
|
+
console.log(" !instruction : ", e), console.log(" !source : ", o);
|
|
1051
|
+
});
|
|
1052
|
+
}, an = (t) => (p.data = t, x(rn), x(nn), O(y(h, "table-body").children, t, m.buildBodyCell), Ro(h, m), Wo(h, m), h), cn = ({
|
|
1000
1053
|
inData: t,
|
|
1001
1054
|
inColumns: e,
|
|
1002
|
-
footer:
|
|
1003
|
-
options:
|
|
1055
|
+
footer: o = [],
|
|
1056
|
+
options: n
|
|
1057
|
+
} = {}) => an({
|
|
1058
|
+
columns: e,
|
|
1059
|
+
data: t
|
|
1060
|
+
}), un = {
|
|
1061
|
+
table: E,
|
|
1062
|
+
select: jo,
|
|
1063
|
+
selectOptionsOnly: B,
|
|
1064
|
+
tableFromSpec: cn
|
|
1065
|
+
}, v = ({
|
|
1066
|
+
type: t = "table",
|
|
1067
|
+
data: e,
|
|
1068
|
+
columns: o,
|
|
1069
|
+
options: n,
|
|
1070
|
+
showLog: r = !1
|
|
1004
1071
|
} = {}) => {
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
};
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
table: y,
|
|
1015
|
-
select: so,
|
|
1016
|
-
selectOptionsOnly: N,
|
|
1017
|
-
tableFromSpec: A
|
|
1018
|
-
}, T = ({
|
|
1072
|
+
const u = {
|
|
1073
|
+
type: t,
|
|
1074
|
+
data: e,
|
|
1075
|
+
columns: o,
|
|
1076
|
+
options: n,
|
|
1077
|
+
showLog: r
|
|
1078
|
+
};
|
|
1079
|
+
return Z({ inConfig: u }), u;
|
|
1080
|
+
}, P = ({
|
|
1019
1081
|
type: t = "table",
|
|
1020
1082
|
data: e,
|
|
1021
|
-
columns:
|
|
1022
|
-
options:
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1083
|
+
columns: o,
|
|
1084
|
+
options: n,
|
|
1085
|
+
showLog: r = !1
|
|
1086
|
+
} = {}) => {
|
|
1087
|
+
const s = v({
|
|
1088
|
+
type: t,
|
|
1089
|
+
data: e,
|
|
1090
|
+
columns: o,
|
|
1091
|
+
options: n,
|
|
1092
|
+
showLog: r
|
|
1093
|
+
}), l = un[s.type];
|
|
1094
|
+
if (!l)
|
|
1095
|
+
throw new Error(`Renderer for type "${s.type}" not found.`);
|
|
1096
|
+
const a = l({
|
|
1097
|
+
inColumns: s.columns,
|
|
1098
|
+
inData: s.data,
|
|
1099
|
+
options: s.options
|
|
1029
1100
|
});
|
|
1101
|
+
return s.showLog && console.log("json-renderers-build output:", a), a;
|
|
1030
1102
|
};
|
|
1031
|
-
v
|
|
1032
|
-
const
|
|
1103
|
+
Q({ render: P, getSpec: v });
|
|
1104
|
+
const L = ({
|
|
1105
|
+
inColumns: t,
|
|
1106
|
+
inType: e = "table",
|
|
1107
|
+
inData: o,
|
|
1108
|
+
inShowLog: n = !1
|
|
1109
|
+
} = {}) => P({
|
|
1110
|
+
type: e,
|
|
1111
|
+
data: o ?? [],
|
|
1112
|
+
columns: t,
|
|
1113
|
+
showLog: n
|
|
1114
|
+
}), dn = {
|
|
1033
1115
|
version: "v9",
|
|
1034
1116
|
description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
|
|
1035
|
-
},
|
|
1117
|
+
}, bn = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
|
|
1036
1118
|
if (typeof globalThis > "u" || !t) return;
|
|
1037
1119
|
globalThis.ks ?? (globalThis.ks = {});
|
|
1038
|
-
const
|
|
1039
|
-
meta:
|
|
1120
|
+
const o = {
|
|
1121
|
+
meta: dn,
|
|
1040
1122
|
buildSpecElement: t,
|
|
1041
1123
|
reviewSpec: e
|
|
1042
1124
|
};
|
|
1043
|
-
globalThis.ks["json-to-tag"] =
|
|
1044
|
-
},
|
|
1125
|
+
globalThis.ks["json-to-tag"] = o, globalThis.ks.jsonToTag = o;
|
|
1126
|
+
}, fn = (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 ?? "") : R(t), H = (t) => Array.isArray(t) ? t.map(fn).flat(1 / 0).filter(Boolean) : [], hn = (t) => (t == null, t), mn = "http://www.w3.org/2000/svg", pn = /* @__PURE__ */ new Set([
|
|
1045
1127
|
"svg",
|
|
1046
1128
|
"path",
|
|
1047
1129
|
"symbol",
|
|
@@ -1068,22 +1150,22 @@ const vo = {
|
|
|
1068
1150
|
"fegaussianblur",
|
|
1069
1151
|
"femerge",
|
|
1070
1152
|
"femergenode"
|
|
1071
|
-
]),
|
|
1153
|
+
]), yn = ({ inTagName: t }) => {
|
|
1072
1154
|
const e = t == null ? void 0 : t.toLowerCase();
|
|
1073
1155
|
if (!e) return null;
|
|
1074
1156
|
if (e === "checkbox") {
|
|
1075
|
-
const
|
|
1076
|
-
return
|
|
1157
|
+
const o = document.createElement("input");
|
|
1158
|
+
return o.type = "checkbox", o;
|
|
1077
1159
|
}
|
|
1078
|
-
return
|
|
1079
|
-
},
|
|
1080
|
-
const
|
|
1081
|
-
if (!
|
|
1082
|
-
return
|
|
1083
|
-
const r = typeof SVGElement < "u" ?
|
|
1084
|
-
return Object.entries(
|
|
1160
|
+
return pn.has(e) ? document.createElementNS(mn, e) : document.createElement(e);
|
|
1161
|
+
}, gn = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), wn = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), Cn = "http://www.w3.org/1999/xlink", $n = ({ inElement: t, inAttributes: e }) => {
|
|
1162
|
+
const o = t, n = e;
|
|
1163
|
+
if (!o || !n || typeof n != "object")
|
|
1164
|
+
return o;
|
|
1165
|
+
const r = typeof SVGElement < "u" ? o instanceof SVGElement : o.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1166
|
+
return Object.entries(n).forEach(([s, l]) => {
|
|
1085
1167
|
if (s === "class") {
|
|
1086
|
-
r ?
|
|
1168
|
+
r ? o.setAttribute("class", String(l)) : o.className = l;
|
|
1087
1169
|
return;
|
|
1088
1170
|
}
|
|
1089
1171
|
if (s === "xlink:href" || s === "href") {
|
|
@@ -1091,46 +1173,46 @@ const vo = {
|
|
|
1091
1173
|
const a = String(l);
|
|
1092
1174
|
if (r)
|
|
1093
1175
|
try {
|
|
1094
|
-
|
|
1176
|
+
o.setAttributeNS(Cn, "href", a);
|
|
1095
1177
|
} catch {
|
|
1096
1178
|
}
|
|
1097
|
-
|
|
1179
|
+
o.setAttribute("href", a), o.setAttribute("xlink:href", a);
|
|
1098
1180
|
}
|
|
1099
1181
|
return;
|
|
1100
1182
|
}
|
|
1101
1183
|
if (typeof l == "boolean") {
|
|
1102
|
-
l ?
|
|
1184
|
+
l ? o.setAttribute(s, "") : o.removeAttribute(s);
|
|
1103
1185
|
return;
|
|
1104
1186
|
}
|
|
1105
|
-
l != null &&
|
|
1106
|
-
}),
|
|
1107
|
-
},
|
|
1187
|
+
l != null && o.setAttribute(s, String(l));
|
|
1188
|
+
}), o;
|
|
1189
|
+
}, An = ({ inElement: t, inClassList: e }) => {
|
|
1108
1190
|
if (!t || !e) return t;
|
|
1109
|
-
const
|
|
1110
|
-
return
|
|
1111
|
-
},
|
|
1191
|
+
const o = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((n) => typeof n == "string" && n.trim()) : [];
|
|
1192
|
+
return o.length && t.classList.add(...o), t;
|
|
1193
|
+
}, Nn = (t) => {
|
|
1112
1194
|
if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
|
|
1113
|
-
const e =
|
|
1195
|
+
const e = yn({ inTagName: t.tagName });
|
|
1114
1196
|
if (!e) return null;
|
|
1115
|
-
if (
|
|
1197
|
+
if (gn({
|
|
1116
1198
|
inElement: e,
|
|
1117
|
-
inTextContent:
|
|
1199
|
+
inTextContent: hn(t.textContent),
|
|
1118
1200
|
inTagName: t.tagName
|
|
1119
|
-
}),
|
|
1201
|
+
}), wn({
|
|
1120
1202
|
inElement: e,
|
|
1121
1203
|
inProperties: t.properties
|
|
1122
|
-
}),
|
|
1204
|
+
}), $n({
|
|
1123
1205
|
inElement: e,
|
|
1124
1206
|
inAttributes: t.attributes
|
|
1125
|
-
}),
|
|
1207
|
+
}), An({
|
|
1126
1208
|
inElement: e,
|
|
1127
1209
|
inClassList: t.classList
|
|
1128
1210
|
}), Array.isArray(t.children)) {
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1211
|
+
const o = H(t.children);
|
|
1212
|
+
o.length && e.append(...o);
|
|
1131
1213
|
}
|
|
1132
1214
|
return e;
|
|
1133
|
-
},
|
|
1215
|
+
}, R = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? H(t) : typeof t == "object" ? Nn(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, xn = "./tags.schema.json", Tn = {
|
|
1134
1216
|
allowsTextContent: !1,
|
|
1135
1217
|
allowsChildren: !0,
|
|
1136
1218
|
allowedAttributes: [
|
|
@@ -1138,7 +1220,7 @@ const vo = {
|
|
|
1138
1220
|
"role"
|
|
1139
1221
|
],
|
|
1140
1222
|
childTags: []
|
|
1141
|
-
},
|
|
1223
|
+
}, Sn = {
|
|
1142
1224
|
allowsTextContent: !1,
|
|
1143
1225
|
allowsChildren: !1,
|
|
1144
1226
|
allowedAttributes: [
|
|
@@ -1151,7 +1233,7 @@ const vo = {
|
|
|
1151
1233
|
"required",
|
|
1152
1234
|
"list"
|
|
1153
1235
|
]
|
|
1154
|
-
},
|
|
1236
|
+
}, En = {
|
|
1155
1237
|
allowsTextContent: !1,
|
|
1156
1238
|
allowsChildren: !1,
|
|
1157
1239
|
allowedAttributes: [
|
|
@@ -1162,7 +1244,7 @@ const vo = {
|
|
|
1162
1244
|
"disabled",
|
|
1163
1245
|
"required"
|
|
1164
1246
|
]
|
|
1165
|
-
},
|
|
1247
|
+
}, jn = {
|
|
1166
1248
|
allowsTextContent: !1,
|
|
1167
1249
|
allowsChildren: !0,
|
|
1168
1250
|
allowedAttributes: [
|
|
@@ -1171,7 +1253,7 @@ const vo = {
|
|
|
1171
1253
|
childTags: [
|
|
1172
1254
|
"col"
|
|
1173
1255
|
]
|
|
1174
|
-
},
|
|
1256
|
+
}, Fn = {
|
|
1175
1257
|
allowsTextContent: !1,
|
|
1176
1258
|
allowsChildren: !1,
|
|
1177
1259
|
allowedAttributes: [
|
|
@@ -1179,14 +1261,14 @@ const vo = {
|
|
|
1179
1261
|
"style",
|
|
1180
1262
|
"width"
|
|
1181
1263
|
]
|
|
1182
|
-
},
|
|
1264
|
+
}, Bn = {
|
|
1183
1265
|
allowsTextContent: !0,
|
|
1184
1266
|
allowsChildren: !0,
|
|
1185
1267
|
allowedAttributes: [
|
|
1186
1268
|
"for"
|
|
1187
1269
|
],
|
|
1188
1270
|
childTags: []
|
|
1189
|
-
},
|
|
1271
|
+
}, In = {
|
|
1190
1272
|
allowsTextContent: !1,
|
|
1191
1273
|
allowsChildren: !0,
|
|
1192
1274
|
allowedAttributes: [
|
|
@@ -1199,7 +1281,7 @@ const vo = {
|
|
|
1199
1281
|
"target"
|
|
1200
1282
|
],
|
|
1201
1283
|
childTags: []
|
|
1202
|
-
},
|
|
1284
|
+
}, kn = {
|
|
1203
1285
|
allowsTextContent: !1,
|
|
1204
1286
|
allowsChildren: !0,
|
|
1205
1287
|
allowedAttributes: [
|
|
@@ -1212,27 +1294,27 @@ const vo = {
|
|
|
1212
1294
|
childTags: [
|
|
1213
1295
|
"option"
|
|
1214
1296
|
]
|
|
1215
|
-
},
|
|
1297
|
+
}, On = {
|
|
1216
1298
|
allowsTextContent: !0,
|
|
1217
1299
|
allowsChildren: !0,
|
|
1218
1300
|
allowedAttributes: [],
|
|
1219
1301
|
childTags: []
|
|
1220
|
-
},
|
|
1302
|
+
}, vn = {
|
|
1221
1303
|
allowsTextContent: !0,
|
|
1222
1304
|
allowsChildren: !0,
|
|
1223
1305
|
allowedAttributes: [],
|
|
1224
1306
|
childTags: []
|
|
1225
|
-
},
|
|
1307
|
+
}, Pn = {
|
|
1226
1308
|
allowsTextContent: !0,
|
|
1227
1309
|
allowsChildren: !0,
|
|
1228
1310
|
allowedAttributes: [],
|
|
1229
1311
|
childTags: []
|
|
1230
|
-
},
|
|
1312
|
+
}, Ln = {
|
|
1231
1313
|
allowsTextContent: !0,
|
|
1232
1314
|
allowsChildren: !0,
|
|
1233
1315
|
allowedAttributes: [],
|
|
1234
1316
|
childTags: []
|
|
1235
|
-
},
|
|
1317
|
+
}, Hn = {
|
|
1236
1318
|
allowsTextContent: !1,
|
|
1237
1319
|
allowsChildren: !1,
|
|
1238
1320
|
allowedAttributes: [
|
|
@@ -1242,7 +1324,7 @@ const vo = {
|
|
|
1242
1324
|
"height",
|
|
1243
1325
|
"loading"
|
|
1244
1326
|
]
|
|
1245
|
-
},
|
|
1327
|
+
}, Rn = {
|
|
1246
1328
|
allowsTextContent: !0,
|
|
1247
1329
|
allowsChildren: !0,
|
|
1248
1330
|
allowedAttributes: [
|
|
@@ -1252,7 +1334,7 @@ const vo = {
|
|
|
1252
1334
|
"value"
|
|
1253
1335
|
],
|
|
1254
1336
|
childTags: []
|
|
1255
|
-
},
|
|
1337
|
+
}, Jn = {
|
|
1256
1338
|
allowsTextContent: !1,
|
|
1257
1339
|
allowsChildren: !0,
|
|
1258
1340
|
allowedAttributes: [
|
|
@@ -1268,28 +1350,28 @@ const vo = {
|
|
|
1268
1350
|
"tfoot",
|
|
1269
1351
|
"tr"
|
|
1270
1352
|
]
|
|
1271
|
-
},
|
|
1353
|
+
}, Un = {
|
|
1272
1354
|
allowsTextContent: !1,
|
|
1273
1355
|
allowsChildren: !0,
|
|
1274
1356
|
allowedAttributes: [],
|
|
1275
1357
|
childTags: [
|
|
1276
1358
|
"tr"
|
|
1277
1359
|
]
|
|
1278
|
-
},
|
|
1360
|
+
}, Vn = {
|
|
1279
1361
|
allowsTextContent: !1,
|
|
1280
1362
|
allowsChildren: !0,
|
|
1281
1363
|
allowedAttributes: [],
|
|
1282
1364
|
childTags: [
|
|
1283
1365
|
"tr"
|
|
1284
1366
|
]
|
|
1285
|
-
},
|
|
1367
|
+
}, Dn = {
|
|
1286
1368
|
allowsTextContent: !1,
|
|
1287
1369
|
allowsChildren: !0,
|
|
1288
1370
|
allowedAttributes: [],
|
|
1289
1371
|
childTags: [
|
|
1290
1372
|
"tr"
|
|
1291
1373
|
]
|
|
1292
|
-
},
|
|
1374
|
+
}, Wn = {
|
|
1293
1375
|
allowsTextContent: !1,
|
|
1294
1376
|
allowsChildren: !0,
|
|
1295
1377
|
allowedAttributes: [],
|
|
@@ -1297,7 +1379,7 @@ const vo = {
|
|
|
1297
1379
|
"td",
|
|
1298
1380
|
"th"
|
|
1299
1381
|
]
|
|
1300
|
-
},
|
|
1382
|
+
}, Gn = {
|
|
1301
1383
|
allowsTextContent: !0,
|
|
1302
1384
|
allowsChildren: !0,
|
|
1303
1385
|
allowedAttributes: [
|
|
@@ -1306,7 +1388,7 @@ const vo = {
|
|
|
1306
1388
|
"rowspan"
|
|
1307
1389
|
],
|
|
1308
1390
|
childTags: []
|
|
1309
|
-
},
|
|
1391
|
+
}, Kn = {
|
|
1310
1392
|
allowsTextContent: !0,
|
|
1311
1393
|
allowsChildren: !0,
|
|
1312
1394
|
allowedAttributes: [
|
|
@@ -1314,14 +1396,14 @@ const vo = {
|
|
|
1314
1396
|
"rowspan"
|
|
1315
1397
|
],
|
|
1316
1398
|
childTags: []
|
|
1317
|
-
},
|
|
1399
|
+
}, Mn = {
|
|
1318
1400
|
allowsTextContent: !1,
|
|
1319
1401
|
allowsChildren: !0,
|
|
1320
1402
|
allowedAttributes: [],
|
|
1321
1403
|
childTags: [
|
|
1322
1404
|
"option"
|
|
1323
1405
|
]
|
|
1324
|
-
},
|
|
1406
|
+
}, qn = {
|
|
1325
1407
|
allowsTextContent: !0,
|
|
1326
1408
|
allowsChildren: !1,
|
|
1327
1409
|
allowedAttributes: [
|
|
@@ -1330,14 +1412,14 @@ const vo = {
|
|
|
1330
1412
|
"selected",
|
|
1331
1413
|
"disabled"
|
|
1332
1414
|
]
|
|
1333
|
-
},
|
|
1415
|
+
}, zn = {
|
|
1334
1416
|
allowsTextContent: !1,
|
|
1335
1417
|
allowsChildren: !0,
|
|
1336
1418
|
allowedAttributes: [
|
|
1337
1419
|
"role"
|
|
1338
1420
|
],
|
|
1339
1421
|
childTags: []
|
|
1340
|
-
},
|
|
1422
|
+
}, _n = {
|
|
1341
1423
|
allowsTextContent: !0,
|
|
1342
1424
|
allowsChildren: !0,
|
|
1343
1425
|
allowedAttributes: [
|
|
@@ -1348,19 +1430,19 @@ const vo = {
|
|
|
1348
1430
|
"download"
|
|
1349
1431
|
],
|
|
1350
1432
|
childTags: []
|
|
1351
|
-
},
|
|
1433
|
+
}, Xn = {
|
|
1352
1434
|
allowsTextContent: !0,
|
|
1353
1435
|
allowsChildren: !0,
|
|
1354
1436
|
allowedAttributes: [
|
|
1355
1437
|
"aria-hidden"
|
|
1356
1438
|
],
|
|
1357
1439
|
childTags: []
|
|
1358
|
-
},
|
|
1440
|
+
}, Yn = {
|
|
1359
1441
|
allowsTextContent: !0,
|
|
1360
1442
|
allowsChildren: !0,
|
|
1361
1443
|
allowedAttributes: [],
|
|
1362
1444
|
childTags: []
|
|
1363
|
-
},
|
|
1445
|
+
}, Qn = {
|
|
1364
1446
|
allowsTextContent: !1,
|
|
1365
1447
|
allowsChildren: !0,
|
|
1366
1448
|
allowedAttributes: [
|
|
@@ -1369,80 +1451,80 @@ const vo = {
|
|
|
1369
1451
|
childTags: [
|
|
1370
1452
|
"li"
|
|
1371
1453
|
]
|
|
1372
|
-
},
|
|
1454
|
+
}, Zn = {
|
|
1373
1455
|
allowsTextContent: !0,
|
|
1374
1456
|
allowsChildren: !0,
|
|
1375
1457
|
allowedAttributes: [
|
|
1376
1458
|
"value"
|
|
1377
1459
|
],
|
|
1378
1460
|
childTags: []
|
|
1379
|
-
},
|
|
1461
|
+
}, tr = {
|
|
1380
1462
|
allowsTextContent: !1,
|
|
1381
1463
|
allowsChildren: !1,
|
|
1382
1464
|
allowedAttributes: []
|
|
1383
|
-
},
|
|
1384
|
-
$schema:
|
|
1385
|
-
div:
|
|
1386
|
-
input:
|
|
1387
|
-
checkbox:
|
|
1388
|
-
colgroup:
|
|
1389
|
-
col:
|
|
1390
|
-
label:
|
|
1391
|
-
form:
|
|
1392
|
-
select:
|
|
1393
|
-
p:
|
|
1394
|
-
h1:
|
|
1395
|
-
h2:
|
|
1396
|
-
span:
|
|
1397
|
-
img:
|
|
1398
|
-
button:
|
|
1399
|
-
table:
|
|
1400
|
-
thead:
|
|
1401
|
-
tbody:
|
|
1402
|
-
tfoot:
|
|
1403
|
-
tr:
|
|
1404
|
-
th:
|
|
1405
|
-
td:
|
|
1406
|
-
datalist:
|
|
1407
|
-
option:
|
|
1408
|
-
header:
|
|
1409
|
-
a:
|
|
1410
|
-
i:
|
|
1411
|
-
small:
|
|
1412
|
-
ul:
|
|
1413
|
-
li:
|
|
1414
|
-
hr:
|
|
1415
|
-
},
|
|
1465
|
+
}, er = {
|
|
1466
|
+
$schema: xn,
|
|
1467
|
+
div: Tn,
|
|
1468
|
+
input: Sn,
|
|
1469
|
+
checkbox: En,
|
|
1470
|
+
colgroup: jn,
|
|
1471
|
+
col: Fn,
|
|
1472
|
+
label: Bn,
|
|
1473
|
+
form: In,
|
|
1474
|
+
select: kn,
|
|
1475
|
+
p: On,
|
|
1476
|
+
h1: vn,
|
|
1477
|
+
h2: Pn,
|
|
1478
|
+
span: Ln,
|
|
1479
|
+
img: Hn,
|
|
1480
|
+
button: Rn,
|
|
1481
|
+
table: Jn,
|
|
1482
|
+
thead: Un,
|
|
1483
|
+
tbody: Vn,
|
|
1484
|
+
tfoot: Dn,
|
|
1485
|
+
tr: Wn,
|
|
1486
|
+
th: Gn,
|
|
1487
|
+
td: Kn,
|
|
1488
|
+
datalist: Mn,
|
|
1489
|
+
option: qn,
|
|
1490
|
+
header: zn,
|
|
1491
|
+
a: _n,
|
|
1492
|
+
i: Xn,
|
|
1493
|
+
small: Yn,
|
|
1494
|
+
ul: Qn,
|
|
1495
|
+
li: Zn,
|
|
1496
|
+
hr: tr
|
|
1497
|
+
}, w = ({ inSpec: t }) => {
|
|
1416
1498
|
const e = t;
|
|
1417
1499
|
if (!e) return [];
|
|
1418
1500
|
if (Array.isArray(e))
|
|
1419
|
-
return e.flatMap((
|
|
1501
|
+
return e.flatMap((n) => w({ inSpec: n }));
|
|
1420
1502
|
if (typeof e != "object") return [];
|
|
1421
|
-
const
|
|
1422
|
-
return typeof e.tagName == "string" && e.tagName.trim().length > 0 &&
|
|
1423
|
-
const r =
|
|
1424
|
-
|
|
1425
|
-
}),
|
|
1426
|
-
},
|
|
1427
|
-
const
|
|
1428
|
-
Object.keys(
|
|
1503
|
+
const o = [];
|
|
1504
|
+
return typeof e.tagName == "string" && e.tagName.trim().length > 0 && o.push(e.tagName.toLowerCase()), Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((n) => {
|
|
1505
|
+
const r = w({ inSpec: n });
|
|
1506
|
+
o.push(...r);
|
|
1507
|
+
}), o;
|
|
1508
|
+
}, or = ({ inTagsFound: t, inAllowedTags: e }) => {
|
|
1509
|
+
const o = t ?? [], n = e ?? {}, r = new Set(
|
|
1510
|
+
Object.keys(n).filter((u) => u !== "$schema").map((u) => u.toLowerCase())
|
|
1429
1511
|
), s = {}, l = [], a = [];
|
|
1430
|
-
|
|
1431
|
-
s[
|
|
1512
|
+
o.forEach((u) => {
|
|
1513
|
+
s[u] = (s[u] || 0) + 1, r.has(u) ? l.includes(u) || l.push(u) : a.includes(u) || a.push(u);
|
|
1432
1514
|
});
|
|
1433
|
-
const
|
|
1515
|
+
const c = o.length, i = a.length === 0;
|
|
1434
1516
|
return {
|
|
1435
|
-
totalTags:
|
|
1517
|
+
totalTags: c,
|
|
1436
1518
|
tagCounts: s,
|
|
1437
1519
|
uniqueTags: Object.keys(s),
|
|
1438
1520
|
recognizedTags: l,
|
|
1439
1521
|
unrecognizedTags: a,
|
|
1440
|
-
areAllTagsPresent:
|
|
1522
|
+
areAllTagsPresent: i
|
|
1441
1523
|
};
|
|
1442
|
-
},
|
|
1443
|
-
const
|
|
1524
|
+
}, nr = ({ inSpec: t, inTags: e = er } = {}) => {
|
|
1525
|
+
const o = t, n = e, r = w({ inSpec: o }), s = or({
|
|
1444
1526
|
inTagsFound: r,
|
|
1445
|
-
inAllowedTags:
|
|
1527
|
+
inAllowedTags: n
|
|
1446
1528
|
});
|
|
1447
1529
|
return {
|
|
1448
1530
|
areAllTagsPresent: s.areAllTagsPresent,
|
|
@@ -1452,59 +1534,44 @@ const vo = {
|
|
|
1452
1534
|
recognizedTags: s.recognizedTags,
|
|
1453
1535
|
unrecognizedTags: s.unrecognizedTags
|
|
1454
1536
|
};
|
|
1455
|
-
},
|
|
1537
|
+
}, J = (t = {}) => {
|
|
1456
1538
|
const e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
|
|
1457
|
-
return
|
|
1539
|
+
return R(e);
|
|
1458
1540
|
};
|
|
1459
|
-
|
|
1460
|
-
inFuncDefinition:
|
|
1461
|
-
inReviewSpec:
|
|
1541
|
+
bn({
|
|
1542
|
+
inFuncDefinition: J,
|
|
1543
|
+
inReviewSpec: nr
|
|
1462
1544
|
});
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
showLog: r
|
|
1469
|
-
} = {}) => {
|
|
1470
|
-
const s = t, l = o ?? [], a = e;
|
|
1471
|
-
r && console.log("buildSpec 1 :", s, l.localColumns);
|
|
1472
|
-
let u = T({
|
|
1473
|
-
type: n,
|
|
1474
|
-
data: l,
|
|
1475
|
-
columns: a
|
|
1476
|
-
});
|
|
1477
|
-
const c = E(u);
|
|
1478
|
-
return console.log("buildSpec 2 :", u, c), r && console.log("buildSpec 3 :", c), c;
|
|
1479
|
-
}, En = ({
|
|
1480
|
-
type: t = "table",
|
|
1481
|
-
targetHtmlId: e,
|
|
1482
|
-
data: n,
|
|
1483
|
-
classToApply: o,
|
|
1484
|
-
columns: r,
|
|
1485
|
-
appendPosition: s,
|
|
1486
|
-
showLog: l = !1
|
|
1545
|
+
const U = ({
|
|
1546
|
+
inSpec: t,
|
|
1547
|
+
inTargetHtmlId: e,
|
|
1548
|
+
inAppendPosition: o,
|
|
1549
|
+
inShowLog: n = !1
|
|
1487
1550
|
} = {}) => {
|
|
1488
|
-
const
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1551
|
+
const r = t, s = e, l = o, a = n, c = J(r);
|
|
1552
|
+
a && console.log("renderToDom 1 (content):", c);
|
|
1553
|
+
const i = document.getElementById(s);
|
|
1554
|
+
return i ? (Array.isArray(c) || c instanceof NodeList || c instanceof HTMLCollection ? l === "prepend" ? i.prepend(...c) : i.append(...c) : l === "prepend" ? i.prepend(c) : (i.innerHTML = "", i.append(c)), a && console.log("renderToDom 2 (mounted):", i), i) : null;
|
|
1555
|
+
}, rr = (t = {}) => {
|
|
1556
|
+
const e = T(t), o = L({
|
|
1557
|
+
inColumns: e.columns,
|
|
1558
|
+
inData: e.data,
|
|
1559
|
+
inType: e.type,
|
|
1560
|
+
inShowLog: e.showLog
|
|
1495
1561
|
});
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
type: a
|
|
1562
|
+
return U({
|
|
1563
|
+
inSpec: o,
|
|
1564
|
+
inTargetHtmlId: e.targetHtmlId,
|
|
1565
|
+
inAppendPosition: e.appendPosition,
|
|
1566
|
+
inShowLog: e.showLog
|
|
1502
1567
|
});
|
|
1503
|
-
l && console.log("showLog 2 :", h);
|
|
1504
|
-
const d = document.getElementById(i);
|
|
1505
|
-
return l && console.log("showLog 3 :", d), Array.isArray(h) || h instanceof NodeList || h instanceof HTMLCollection ? s === "prepend" ? d.prepend(...h) : d.append(...h) : s === "prepend" ? d.prepend(h) : (d && (d.innerHTML = ""), d.append(h)), l && console.log("showLog 5 :", d), d;
|
|
1506
1568
|
};
|
|
1507
|
-
|
|
1569
|
+
D({ render: rr, getSpec: S, validateConfig: T, buildSpec: L, renderToDom: U });
|
|
1508
1570
|
export {
|
|
1509
|
-
|
|
1571
|
+
L as buildSpec,
|
|
1572
|
+
rr as default,
|
|
1573
|
+
S as getSpec,
|
|
1574
|
+
rr as render,
|
|
1575
|
+
U as renderToDom,
|
|
1576
|
+
T as validateConfig
|
|
1510
1577
|
};
|