json-renderers 1.18.5 → 1.18.8
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 +2 -3
- package/docs/dist/min.js +1097 -550
- package/docs/dist/v18/min.js +1097 -550
- package/docs/index.html +271 -845
- package/docs/indexV1.html +1091 -0
- package/docs/samples/datalist/cdn.html +505 -0
- package/docs/samples/datalist/index.html +311 -0
- package/docs/samples/datalist/windowks.html +350 -0
- package/docs/samples/index.html +326 -0
- package/docs/samples/select/cdn.html +520 -0
- package/docs/samples/select/index.html +311 -0
- package/docs/samples/select/windowks.html +358 -0
- package/docs/{table → samples/table}/cdn.html +7 -6
- package/docs/samples/table/index.html +314 -0
- package/docs/{table → samples/table}/windowKs.html +11 -6
- package/package.json +4 -4
- package/docs/table/index.html +0 -607
- package/docs/table/windowKsV1.html +0 -647
package/docs/dist/min.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
const
|
|
1
|
+
const it = {
|
|
2
2
|
version: "v18.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
|
-
const
|
|
6
|
-
typeof globalThis > "u" || !
|
|
7
|
-
meta:
|
|
8
|
-
render:
|
|
4
|
+
}, ct = (t) => {
|
|
5
|
+
const a = t;
|
|
6
|
+
typeof globalThis > "u" || !a || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderers = {
|
|
7
|
+
meta: it,
|
|
8
|
+
render: a
|
|
9
9
|
});
|
|
10
|
-
},
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
10
|
+
}, ut = (t) => {
|
|
11
|
+
const a = (t == null ? void 0 : t.inConfig) ?? t;
|
|
12
|
+
if (!a || typeof a != "object")
|
|
13
13
|
throw new TypeError("Config must be an object");
|
|
14
|
-
const e =
|
|
14
|
+
const e = a.type;
|
|
15
15
|
if (e === void 0)
|
|
16
16
|
throw new Error('Missing compulsory key: "type"');
|
|
17
17
|
if (typeof e != "string")
|
|
18
18
|
throw new TypeError("type must be a string");
|
|
19
19
|
return !0;
|
|
20
|
-
},
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
20
|
+
}, dt = (t) => {
|
|
21
|
+
const a = (t == null ? void 0 : t.inConfig) ?? t;
|
|
22
|
+
if (!a || typeof a != "object")
|
|
23
23
|
throw new TypeError("Config must be an object");
|
|
24
|
-
const e =
|
|
24
|
+
const e = a.data;
|
|
25
25
|
if (e === void 0)
|
|
26
26
|
throw new Error('Missing compulsory key: "data"');
|
|
27
27
|
if (!Array.isArray(e))
|
|
28
28
|
throw new TypeError("data must be an Array");
|
|
29
29
|
return !0;
|
|
30
|
-
},
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
30
|
+
}, bt = (t) => {
|
|
31
|
+
const a = (t == null ? void 0 : t.inConfig) ?? t;
|
|
32
|
+
if (!a || typeof a != "object")
|
|
33
33
|
throw new TypeError("Config must be an object");
|
|
34
|
-
const e =
|
|
34
|
+
const e = a.columns;
|
|
35
35
|
if (e === void 0)
|
|
36
36
|
throw new Error('Missing compulsory key: "columns"');
|
|
37
37
|
if (!Array.isArray(e))
|
|
38
38
|
throw new TypeError("columns must be an Array");
|
|
39
39
|
return !0;
|
|
40
|
-
},
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
40
|
+
}, pt = (t) => {
|
|
41
|
+
const a = (t == null ? void 0 : t.inConfig) ?? t;
|
|
42
|
+
if (!a || typeof a != "object")
|
|
43
43
|
throw new TypeError("Config must be an object");
|
|
44
|
-
const e =
|
|
44
|
+
const e = a.showLog;
|
|
45
45
|
if (e !== void 0 && typeof e != "boolean")
|
|
46
46
|
throw new TypeError("showLog must be a boolean");
|
|
47
47
|
return !0;
|
|
48
|
-
},
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
48
|
+
}, P = (t) => {
|
|
49
|
+
const a = (t == null ? void 0 : t.inConfig) ?? t;
|
|
50
|
+
if (!a || typeof a != "object" || Array.isArray(a))
|
|
51
51
|
throw new TypeError("Config must be an object");
|
|
52
|
-
return
|
|
53
|
-
},
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
52
|
+
return ut(a), dt(a), bt(a), pt(a), !0;
|
|
53
|
+
}, mt = (t) => {
|
|
54
|
+
const a = (t == null ? void 0 : t.inConfig) ?? t;
|
|
55
|
+
if (!a || typeof a != "object")
|
|
56
56
|
throw new TypeError("Config must be an object");
|
|
57
|
-
const e =
|
|
57
|
+
const e = a.targetHtmlId;
|
|
58
58
|
if (e === void 0)
|
|
59
59
|
throw new Error('Missing compulsory key: "targetHtmlId"');
|
|
60
60
|
if (typeof e != "string")
|
|
@@ -62,102 +62,102 @@ const Q = {
|
|
|
62
62
|
if (e.trim().length === 0)
|
|
63
63
|
throw new Error("targetHtmlId must be a non-empty string");
|
|
64
64
|
return !0;
|
|
65
|
-
},
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
65
|
+
}, ht = (t) => {
|
|
66
|
+
const a = (t == null ? void 0 : t.inConfig) ?? t;
|
|
67
|
+
if (!a || typeof a != "object")
|
|
68
68
|
throw new TypeError("Config must be an object");
|
|
69
|
-
const e =
|
|
69
|
+
const e = a.appendPosition;
|
|
70
70
|
if (e === void 0)
|
|
71
71
|
throw new Error('Missing compulsory key: "appendPosition"');
|
|
72
72
|
if (typeof e != "string")
|
|
73
73
|
throw new TypeError("appendPosition must be a string");
|
|
74
74
|
return !0;
|
|
75
|
-
},
|
|
76
|
-
const
|
|
77
|
-
if (!
|
|
75
|
+
}, ft = (t) => {
|
|
76
|
+
const a = (t == null ? void 0 : t.inConfig) ?? t;
|
|
77
|
+
if (!a || typeof a != "object")
|
|
78
78
|
throw new TypeError("Config must be an object");
|
|
79
|
-
const e =
|
|
79
|
+
const e = a.classToApply;
|
|
80
80
|
if (e === void 0)
|
|
81
81
|
throw new Error('Missing compulsory key: "classToApply"');
|
|
82
82
|
if (typeof e != "string")
|
|
83
83
|
throw new TypeError("classToApply must be a string");
|
|
84
84
|
return !0;
|
|
85
|
-
},
|
|
86
|
-
const
|
|
87
|
-
if (!
|
|
85
|
+
}, q = (t) => {
|
|
86
|
+
const a = (t == null ? void 0 : t.inConfig) ?? t;
|
|
87
|
+
if (!a || typeof a != "object" || Array.isArray(a))
|
|
88
88
|
throw new TypeError("Config must be an object");
|
|
89
|
-
return
|
|
90
|
-
},
|
|
91
|
-
type:
|
|
92
|
-
targetHtmlId:
|
|
93
|
-
data:
|
|
94
|
-
columns:
|
|
95
|
-
classToApply:
|
|
96
|
-
appendPosition:
|
|
97
|
-
showLog:
|
|
98
|
-
},
|
|
99
|
-
const
|
|
100
|
-
return
|
|
89
|
+
return mt(a), ht(a), ft(a), !0;
|
|
90
|
+
}, yt = "table", Ct = "", wt = [], gt = [], $t = "", Nt = "replace", Tt = !1, g = {
|
|
91
|
+
type: yt,
|
|
92
|
+
targetHtmlId: Ct,
|
|
93
|
+
data: wt,
|
|
94
|
+
columns: gt,
|
|
95
|
+
classToApply: $t,
|
|
96
|
+
appendPosition: Nt,
|
|
97
|
+
showLog: Tt
|
|
98
|
+
}, G = (t) => {
|
|
99
|
+
const a = typeof t == "object" && t !== null ? t.inKey ?? t.key : t;
|
|
100
|
+
return a && a in g ? g[a] : { ...g };
|
|
101
101
|
};
|
|
102
|
-
Object.assign(
|
|
102
|
+
Object.assign(G, g);
|
|
103
103
|
const $ = (t) => {
|
|
104
|
-
const
|
|
105
|
-
if (!
|
|
104
|
+
const a = (t == null ? void 0 : t.inConfig) ?? t;
|
|
105
|
+
if (!a || typeof a != "object" || Array.isArray(a))
|
|
106
106
|
throw new TypeError("Config must be an object");
|
|
107
|
-
return
|
|
107
|
+
return P(a), q(a), !0;
|
|
108
108
|
};
|
|
109
|
-
$.getSpec =
|
|
110
|
-
$.configSpec =
|
|
111
|
-
$.guardSpec =
|
|
112
|
-
$.guardMount =
|
|
113
|
-
const
|
|
109
|
+
$.getSpec = G;
|
|
110
|
+
$.configSpec = g;
|
|
111
|
+
$.guardSpec = P;
|
|
112
|
+
$.guardMount = q;
|
|
113
|
+
const xt = {
|
|
114
114
|
version: "1.22.0",
|
|
115
115
|
name: "json-renderers-build"
|
|
116
|
-
},
|
|
116
|
+
}, Pt = (t) => {
|
|
117
117
|
t && (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuild = {
|
|
118
|
-
meta:
|
|
118
|
+
meta: xt,
|
|
119
119
|
render: t
|
|
120
120
|
});
|
|
121
|
-
},
|
|
122
|
-
if (!
|
|
121
|
+
}, At = (t) => typeof t == "object" && t !== null && !Array.isArray(t), It = (t, a) => {
|
|
122
|
+
if (!At(t)) return;
|
|
123
123
|
let e = {};
|
|
124
|
-
for (const [
|
|
125
|
-
e[
|
|
124
|
+
for (const [o, n] of Object.entries(t))
|
|
125
|
+
e[o] = p(a, n);
|
|
126
126
|
return e;
|
|
127
|
-
},
|
|
127
|
+
}, kt = (t, a) => {
|
|
128
128
|
const e = structuredClone(t);
|
|
129
|
-
return Array.isArray(e) ? e.map((
|
|
130
|
-
},
|
|
131
|
-
if (t === "${agg:count}" && "rowData" in
|
|
132
|
-
if (Array.isArray(
|
|
133
|
-
return
|
|
129
|
+
return Array.isArray(e) ? e.map((n) => p(a, n)) : void 0;
|
|
130
|
+
}, z = (t, a, e) => {
|
|
131
|
+
if (t === "${agg:count}" && "rowData" in a) {
|
|
132
|
+
if (Array.isArray(a == null ? void 0 : a.rowData))
|
|
133
|
+
return a == null ? void 0 : a.rowData.length;
|
|
134
134
|
} else
|
|
135
|
-
return t === "${rowValue}" && "rowData" in
|
|
136
|
-
},
|
|
137
|
-
if (e && console.log("inElement : ", t), e && console.log("inTemplate : ",
|
|
135
|
+
return t === "${rowValue}" && "rowData" in a ? a == null ? void 0 : a.rowData : t.replace(/\$\{(\w+)\}/g, (o, n) => a[n] !== void 0 ? a[n] : o);
|
|
136
|
+
}, Bt = (t, a) => z(t, a), Ft = (t, a, e) => {
|
|
137
|
+
if (e && console.log("inElement : ", t), e && console.log("inTemplate : ", a), a == null)
|
|
138
138
|
throw new TypeError("inTemplate is required");
|
|
139
|
-
if (typeof
|
|
139
|
+
if (typeof a != "object" && typeof a != "string")
|
|
140
140
|
throw new TypeError("inTemplate must be an object or string");
|
|
141
141
|
if (!t || typeof t != "object" || Array.isArray(t))
|
|
142
142
|
throw new TypeError("inElement must be an object");
|
|
143
143
|
return !0;
|
|
144
|
-
},
|
|
144
|
+
}, St = {
|
|
145
145
|
name: "json-transformer-funcs-primitive",
|
|
146
146
|
version: "1.9.0"
|
|
147
|
-
},
|
|
148
|
-
var
|
|
149
|
-
typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (
|
|
150
|
-
meta:
|
|
147
|
+
}, jt = (t) => {
|
|
148
|
+
var a, e;
|
|
149
|
+
typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (a = globalThis.ks).applyTemplate ?? (a.applyTemplate = t), (e = globalThis.ks).transformerFuncs ?? (e.transformerFuncs = {}), globalThis.ks.transformerFuncs.primitive = {
|
|
150
|
+
meta: St,
|
|
151
151
|
applyTemplate: t
|
|
152
152
|
});
|
|
153
|
-
},
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
return typeof
|
|
153
|
+
}, p = (t, a, e) => {
|
|
154
|
+
const o = t, n = a;
|
|
155
|
+
Ft(o, n, e);
|
|
156
|
+
const s = structuredClone(n);
|
|
157
|
+
return typeof s == "string" ? z(s, o) : (s === null || typeof s != "object" || ("textContent" in s && (s.textContent = Bt(s == null ? void 0 : s.textContent, o)), "attributes" in s && (s.attributes = It(s == null ? void 0 : s.attributes, o)), "children" in s && (s.children = kt(s == null ? void 0 : s.children, o))), s);
|
|
158
158
|
};
|
|
159
|
-
|
|
160
|
-
const
|
|
159
|
+
jt(p);
|
|
160
|
+
const Rt = (t, a) => {
|
|
161
161
|
if (!Array.isArray(t))
|
|
162
162
|
throw new TypeError("inSource must be an Array");
|
|
163
163
|
if (t.length === 0)
|
|
@@ -165,17 +165,17 @@ const Nt = (t, o) => {
|
|
|
165
165
|
for (let e = 0; e < t.length; e++)
|
|
166
166
|
if (!t[e] || typeof t[e] != "object")
|
|
167
167
|
throw new TypeError(`inSource[${e}] must be an object`);
|
|
168
|
-
if (!
|
|
168
|
+
if (!a || typeof a != "object" && typeof a != "string")
|
|
169
169
|
throw new TypeError("inTemplate must be an object or string");
|
|
170
170
|
return !0;
|
|
171
|
-
},
|
|
172
|
-
const e = t,
|
|
173
|
-
return
|
|
174
|
-
},
|
|
175
|
-
...
|
|
176
|
-
rowData: o
|
|
177
|
-
})),
|
|
178
|
-
var
|
|
171
|
+
}, m = (t, a) => {
|
|
172
|
+
const e = t, o = a;
|
|
173
|
+
return Rt(e, o), e.map((n) => p(n, o));
|
|
174
|
+
}, vt = (t, a) => t.map((o) => ({
|
|
175
|
+
...o,
|
|
176
|
+
rowData: a[o.columnName]
|
|
177
|
+
})), Et = (t, a, e) => {
|
|
178
|
+
var n, s, r, i, l, c;
|
|
179
179
|
if (!Array.isArray(t))
|
|
180
180
|
throw new TypeError("inColumns must be an Array");
|
|
181
181
|
if (t.length === 0)
|
|
@@ -187,65 +187,54 @@ const Nt = (t, o) => {
|
|
|
187
187
|
if (typeof d.columnName != "string" || !d.columnName.trim())
|
|
188
188
|
throw new TypeError(`inColumns[${u}].columnName must be a non-empty string`);
|
|
189
189
|
}
|
|
190
|
-
if (!Array.isArray(
|
|
190
|
+
if (!Array.isArray(a))
|
|
191
191
|
throw new TypeError("inData must be an Array");
|
|
192
|
-
for (let u = 0; u <
|
|
193
|
-
const d =
|
|
192
|
+
for (let u = 0; u < a.length; u++) {
|
|
193
|
+
const d = a[u];
|
|
194
194
|
if (!d || typeof d != "object")
|
|
195
195
|
throw new TypeError(`inData[${u}] must be an object`);
|
|
196
196
|
}
|
|
197
197
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
198
198
|
throw new TypeError("inSpec must be an object");
|
|
199
|
-
const
|
|
200
|
-
if (!(
|
|
201
|
-
throw new Error(`Row template "${
|
|
199
|
+
const o = ((r = (s = (n = t[0]) == null ? void 0 : n.template) == null ? void 0 : s.body) == null ? void 0 : r.tr) || "buildBodyTr";
|
|
200
|
+
if (!(o in e))
|
|
201
|
+
throw new Error(`Row template "${o}" not found in inSpec`);
|
|
202
202
|
for (let u = 0; u < t.length; u++) {
|
|
203
|
-
const d = t[u],
|
|
204
|
-
if (!(
|
|
205
|
-
throw new Error(`Cell template "${
|
|
203
|
+
const d = t[u], h = ((l = (i = d.template) == null ? void 0 : i.body) == null ? void 0 : l.cell) || ((c = d.template) == null ? void 0 : c.bodyCell) || "buildBodyCell";
|
|
204
|
+
if (!(h in e))
|
|
205
|
+
throw new Error(`Cell template "${h}" for column "${d.columnName}" not found in inSpec`);
|
|
206
206
|
}
|
|
207
207
|
return !0;
|
|
208
|
-
},
|
|
208
|
+
}, Ot = (t, a) => t.map((o) => {
|
|
209
209
|
var i, l, c;
|
|
210
|
-
const
|
|
211
|
-
return
|
|
212
|
-
}),
|
|
210
|
+
const n = ((l = (i = o.template) == null ? void 0 : i.body) == null ? void 0 : l.cell) || ((c = o.template) == null ? void 0 : c.bodyCell) || "buildBodyCell", s = a[n];
|
|
211
|
+
return p(o, s);
|
|
212
|
+
}), N = (t, a, e) => {
|
|
213
213
|
var c, u, d;
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
return
|
|
217
|
-
const
|
|
218
|
-
return
|
|
214
|
+
Et(t, a, e);
|
|
215
|
+
const o = t, n = a, s = e, r = ((d = (u = (c = o[0]) == null ? void 0 : c.template) == null ? void 0 : u.body) == null ? void 0 : d.tr) || "buildBodyTr", i = s[r];
|
|
216
|
+
return n.map((h) => {
|
|
217
|
+
const w = p(h, i), rt = vt(o, h), lt = Ot(rt, s);
|
|
218
|
+
return w.children = lt, w;
|
|
219
219
|
});
|
|
220
|
-
},
|
|
221
|
-
var e;
|
|
222
|
-
if (((e = t == null ? void 0 : t.attributes) == null ? void 0 : e["data-role"]) === o) return t;
|
|
223
|
-
for (const r of (t == null ? void 0 : t.children) ?? []) {
|
|
224
|
-
const a = y(r, o);
|
|
225
|
-
if (a) return a;
|
|
226
|
-
}
|
|
227
|
-
return null;
|
|
228
|
-
}, It = (t, o) => {
|
|
229
|
-
const e = t[o.fileName], r = o.dataRole ? y(e, o.dataRole) : e;
|
|
230
|
-
return (o.filePath ?? []).reduce((a, n) => a[n], r);
|
|
231
|
-
}, kt = {
|
|
220
|
+
}, Dt = {
|
|
232
221
|
tagName: "tr",
|
|
233
222
|
attributes: {
|
|
234
223
|
class: "align-middle"
|
|
235
224
|
},
|
|
236
225
|
children: []
|
|
237
|
-
},
|
|
226
|
+
}, Lt = {
|
|
238
227
|
tagName: "col",
|
|
239
228
|
attributes: {
|
|
240
229
|
width: "${width}"
|
|
241
230
|
}
|
|
242
|
-
},
|
|
231
|
+
}, Kt = {
|
|
243
232
|
tagName: "th",
|
|
244
233
|
textContent: "${columnName}",
|
|
245
234
|
attributes: {
|
|
246
235
|
class: "py-3 px-3 fw-semibold text-uppercase small"
|
|
247
236
|
}
|
|
248
|
-
},
|
|
237
|
+
}, Vt = {
|
|
249
238
|
tagName: "td",
|
|
250
239
|
children: [
|
|
251
240
|
{
|
|
@@ -254,23 +243,25 @@ const Nt = (t, o) => {
|
|
|
254
243
|
type: "text",
|
|
255
244
|
placeholder: "enter ${columnName}",
|
|
256
245
|
name: "${columnName}",
|
|
246
|
+
id: "${columnName}",
|
|
247
|
+
list: "${columnName}",
|
|
257
248
|
class: "form-control"
|
|
258
249
|
}
|
|
259
250
|
}
|
|
260
251
|
]
|
|
261
|
-
},
|
|
252
|
+
}, Ht = {
|
|
262
253
|
tagName: "td",
|
|
263
254
|
textContent: "${rowValue}",
|
|
264
255
|
attributes: {
|
|
265
256
|
class: "py-3 px-3 text-secondary"
|
|
266
257
|
}
|
|
267
|
-
},
|
|
258
|
+
}, Mt = {
|
|
268
259
|
tagName: "button",
|
|
269
260
|
textContent: "${columnName}",
|
|
270
261
|
attributes: {
|
|
271
262
|
class: "btn btn-primary btn-sm"
|
|
272
263
|
}
|
|
273
|
-
},
|
|
264
|
+
}, Wt = {
|
|
274
265
|
tagName: "td",
|
|
275
266
|
attributes: {
|
|
276
267
|
class: "py-2 px-3 text-center"
|
|
@@ -284,38 +275,57 @@ const Nt = (t, o) => {
|
|
|
284
275
|
}
|
|
285
276
|
}
|
|
286
277
|
]
|
|
287
|
-
},
|
|
278
|
+
}, qt = {
|
|
279
|
+
tagName: "td",
|
|
280
|
+
attributes: {
|
|
281
|
+
class: "py-2 px-3 text-center"
|
|
282
|
+
},
|
|
283
|
+
children: [
|
|
284
|
+
{
|
|
285
|
+
tagName: "button",
|
|
286
|
+
textContent: "${columnName}",
|
|
287
|
+
attributes: {
|
|
288
|
+
class: "btn btn-primary btn-sm"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
}, Gt = {
|
|
288
293
|
tagName: "option",
|
|
289
294
|
textContent: "${rowValue}",
|
|
290
295
|
attributes: {
|
|
291
296
|
value: "${rowValue}"
|
|
292
297
|
}
|
|
293
|
-
},
|
|
298
|
+
}, zt = {
|
|
294
299
|
tagName: "select",
|
|
295
300
|
attributes: {
|
|
296
301
|
id: "LedgerName"
|
|
297
302
|
},
|
|
298
303
|
children: []
|
|
299
|
-
},
|
|
304
|
+
}, Ut = {
|
|
300
305
|
tagName: "datalist",
|
|
301
306
|
attributes: {
|
|
302
307
|
"data-name": "${columnName}"
|
|
303
308
|
},
|
|
304
309
|
children: []
|
|
305
|
-
},
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
310
|
+
}, Jt = {
|
|
311
|
+
tagName: "td",
|
|
312
|
+
children: []
|
|
313
|
+
}, b = {
|
|
314
|
+
buildBodyTr: Dt,
|
|
315
|
+
buildColGroup: Lt,
|
|
316
|
+
buildHeader: Kt,
|
|
317
|
+
buildFooter: Vt,
|
|
318
|
+
buildBodyCell: Ht,
|
|
319
|
+
button: Mt,
|
|
320
|
+
buttonCell: Wt,
|
|
321
|
+
optionsButtonCell: qt,
|
|
322
|
+
buildOption: Gt,
|
|
323
|
+
buildSelect: zt,
|
|
324
|
+
buildDataList: Ut,
|
|
325
|
+
emptyCell: Jt
|
|
326
|
+
}, _t = "table", Xt = {
|
|
317
327
|
class: "table table-hover table-striped align-middle border mb-0"
|
|
318
|
-
},
|
|
328
|
+
}, Qt = [
|
|
319
329
|
{
|
|
320
330
|
tagName: "colgroup",
|
|
321
331
|
attributes: {
|
|
@@ -361,11 +371,11 @@ const Nt = (t, o) => {
|
|
|
361
371
|
}
|
|
362
372
|
]
|
|
363
373
|
}
|
|
364
|
-
],
|
|
365
|
-
tagName:
|
|
366
|
-
attributes:
|
|
367
|
-
children:
|
|
368
|
-
},
|
|
374
|
+
], Yt = {
|
|
375
|
+
tagName: _t,
|
|
376
|
+
attributes: Xt,
|
|
377
|
+
children: Qt
|
|
378
|
+
}, Zt = [
|
|
369
379
|
{
|
|
370
380
|
narration: "Build the column widths for the table using the configured columns.",
|
|
371
381
|
destinationPath: {
|
|
@@ -402,7 +412,7 @@ const Nt = (t, o) => {
|
|
|
402
412
|
templateKey: "buildHeader",
|
|
403
413
|
func: "fromCollection"
|
|
404
414
|
}
|
|
405
|
-
],
|
|
415
|
+
], te = [
|
|
406
416
|
{
|
|
407
417
|
narration: "Build the table body rows for the table using the configured columns and data.",
|
|
408
418
|
destinationPath: {
|
|
@@ -420,154 +430,687 @@ const Nt = (t, o) => {
|
|
|
420
430
|
},
|
|
421
431
|
func: "twoDimensional"
|
|
422
432
|
}
|
|
423
|
-
],
|
|
424
|
-
|
|
425
|
-
|
|
433
|
+
], C = (t, a) => {
|
|
434
|
+
var e;
|
|
435
|
+
if (((e = t == null ? void 0 : t.attributes) == null ? void 0 : e["data-role"]) === a) return t;
|
|
436
|
+
for (const o of (t == null ? void 0 : t.children) ?? []) {
|
|
437
|
+
const n = C(o, a);
|
|
438
|
+
if (n) return n;
|
|
439
|
+
}
|
|
440
|
+
return null;
|
|
441
|
+
}, ee = (t, a) => {
|
|
442
|
+
const e = t[a.fileName], o = a.dataRole ? C(e, a.dataRole) : e;
|
|
443
|
+
return (a.filePath ?? []).reduce((n, s) => n[s], o);
|
|
444
|
+
}, A = (t) => Array.isArray(t) ? t : [t], U = (t, a, e) => {
|
|
445
|
+
t[a] = e;
|
|
446
|
+
}, ae = (t, a, e) => {
|
|
447
|
+
t[a].push(...A(e));
|
|
448
|
+
}, oe = (t, a, e) => {
|
|
449
|
+
t[a].unshift(...A(e));
|
|
450
|
+
}, ne = (t, a, e) => {
|
|
451
|
+
t[a].forEach((o) => {
|
|
452
|
+
o.children.push(...structuredClone(A(e)));
|
|
453
|
+
});
|
|
454
|
+
}, se = (t, a, e) => {
|
|
455
|
+
t[a].forEach((o) => {
|
|
456
|
+
o.children.unshift(...structuredClone(A(e)));
|
|
457
|
+
});
|
|
458
|
+
}, re = (t, a, e) => {
|
|
459
|
+
t[a].forEach((o, n) => {
|
|
460
|
+
const s = structuredClone(e);
|
|
461
|
+
s.textContent = n + 1, o.children.unshift(s);
|
|
462
|
+
});
|
|
463
|
+
}, le = {
|
|
464
|
+
set: U,
|
|
465
|
+
push: ae,
|
|
466
|
+
unshift: oe,
|
|
467
|
+
pushToRows: ne,
|
|
468
|
+
unshiftToRows: se,
|
|
469
|
+
unshiftSerialToRows: re
|
|
470
|
+
}, ie = (t, a) => {
|
|
471
|
+
const e = a.dataRole ? C(t[a.fileName], a.dataRole) : t[a.fileName], o = [...a.filePath ?? []], n = o.pop();
|
|
472
|
+
return { parent: o.reduce((r, i) => r[i], e), key: n };
|
|
473
|
+
}, J = (t, a, e) => {
|
|
474
|
+
const { parent: o, key: n } = ie(t, a);
|
|
475
|
+
(le[a.action] || U)(o, n, e);
|
|
476
|
+
}, ce = (t, a, e) => {
|
|
477
|
+
var s, r;
|
|
478
|
+
const o = !!((s = t.sourcePath) != null && s.fileName && Array.isArray((r = t.sourcePath) == null ? void 0 : r.filePath)), n = `structure/sourcePath: ${o ? "passed" : "failed"}`;
|
|
479
|
+
return e.push(n), a && console.log(n), o;
|
|
480
|
+
}, ue = (t, a, e) => {
|
|
481
|
+
var s, r;
|
|
482
|
+
const o = !!((s = t.destinationPath) != null && s.fileName && Array.isArray((r = t.destinationPath) == null ? void 0 : r.filePath)), n = `structure/destinationPath: ${o ? "passed" : "failed"}`;
|
|
483
|
+
return e.push(n), a && console.log(n), o;
|
|
484
|
+
}, de = (t, a, e) => {
|
|
485
|
+
const o = t.templateKey === void 0 || typeof t.templateKey == "string" && t.templateKey.length > 0, n = `structure/templateKey: ${o ? "passed" : "failed"}`;
|
|
486
|
+
return e.push(n), a && console.log(n), o;
|
|
487
|
+
}, be = (t, a, e) => {
|
|
488
|
+
const o = typeof t.func == "string" && t.func.length > 0, n = `structure/func: ${o ? "passed" : "failed"}`;
|
|
489
|
+
return e.push(n), a && console.log(n), o;
|
|
490
|
+
}, pe = (t, a, e) => [
|
|
491
|
+
ce(t, a, e),
|
|
492
|
+
ue(t, a, e),
|
|
493
|
+
de(t, a, e),
|
|
494
|
+
be(t, a, e)
|
|
495
|
+
].every(Boolean), me = (t, a, e, o) => {
|
|
496
|
+
const n = typeof a[t.func] == "function", s = `references/func (${t.func}): ${n ? "passed" : "failed"}`;
|
|
497
|
+
return o.push(s), e && console.log(s), n;
|
|
498
|
+
}, he = (t, a, e, o) => {
|
|
499
|
+
const n = t.templateKey === void 0 || Object.hasOwn(a, t.templateKey), s = `references/templateKey${t.templateKey === void 0 ? " (not used)" : ` (${t.templateKey})`}: ${n ? "passed" : "failed"}`;
|
|
500
|
+
return o.push(s), e && console.log(s), n;
|
|
501
|
+
}, fe = (t, a, e, o, n) => {
|
|
502
|
+
const s = me(t, a, o, n), r = he(t, e, o, n);
|
|
503
|
+
return s && r;
|
|
504
|
+
}, _ = (t, a, e, o, n) => pe(t, o, n) ? fe(t, a, e, o, n) : !1, ye = (t, a, e, o, n, s) => {
|
|
505
|
+
if (!_(t, e, o, n, s)) return;
|
|
506
|
+
const r = n, i = o, l = t.templateKey, c = i[l];
|
|
507
|
+
r && console.log("singleInstruction ; ", l, c);
|
|
508
|
+
const u = ee(a, t.sourcePath), d = e[t.func](u, c);
|
|
509
|
+
J(a, t.destinationPath, d);
|
|
510
|
+
}, f = (t, a, e, o, n, s) => {
|
|
511
|
+
t.forEach((r) => {
|
|
512
|
+
ye(r, a, e, o, n, s);
|
|
513
|
+
});
|
|
514
|
+
}, Ce = (t, a, e, o, n, s) => {
|
|
515
|
+
if (!_(t, e, o, n, s)) return;
|
|
516
|
+
const r = e[t.func](
|
|
517
|
+
a.data.columns,
|
|
518
|
+
a.data.data,
|
|
519
|
+
o
|
|
520
|
+
);
|
|
521
|
+
J(a, t.destinationPath, r);
|
|
522
|
+
}, S = (t, a, e, o, n, s) => {
|
|
523
|
+
t.forEach((r) => {
|
|
524
|
+
Ce(r, a, e, o, n, s);
|
|
525
|
+
});
|
|
526
|
+
}, we = [
|
|
527
|
+
{
|
|
528
|
+
narration: "Prepend the serial column width to the table colgroup.",
|
|
529
|
+
destinationPath: {
|
|
530
|
+
fileName: "base",
|
|
531
|
+
dataRole: "table-colgroup",
|
|
532
|
+
filePath: [
|
|
533
|
+
"children"
|
|
534
|
+
],
|
|
535
|
+
action: "unshift"
|
|
536
|
+
},
|
|
537
|
+
sourcePath: {
|
|
538
|
+
fileName: "data",
|
|
539
|
+
filePath: [
|
|
540
|
+
"serial",
|
|
541
|
+
"col"
|
|
542
|
+
]
|
|
543
|
+
},
|
|
544
|
+
templateKey: "buildColGroup",
|
|
545
|
+
func: "applyTemplate"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
narration: "Prepend the serial header cell to the table header row.",
|
|
549
|
+
destinationPath: {
|
|
550
|
+
fileName: "base",
|
|
551
|
+
dataRole: "table-header-row",
|
|
552
|
+
filePath: [
|
|
553
|
+
"children"
|
|
554
|
+
],
|
|
555
|
+
action: "unshift"
|
|
556
|
+
},
|
|
557
|
+
sourcePath: {
|
|
558
|
+
fileName: "data",
|
|
559
|
+
filePath: [
|
|
560
|
+
"serial",
|
|
561
|
+
"header"
|
|
562
|
+
]
|
|
563
|
+
},
|
|
564
|
+
templateKey: "buildHeader",
|
|
565
|
+
func: "applyTemplate"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
narration: "Prepend the serial number cell into each table body row.",
|
|
569
|
+
destinationPath: {
|
|
570
|
+
fileName: "base",
|
|
571
|
+
dataRole: "table-body",
|
|
572
|
+
filePath: [
|
|
573
|
+
"children"
|
|
574
|
+
],
|
|
575
|
+
action: "unshiftSerialToRows"
|
|
576
|
+
},
|
|
577
|
+
sourcePath: {
|
|
578
|
+
fileName: "data",
|
|
579
|
+
filePath: [
|
|
580
|
+
"serial",
|
|
581
|
+
"body"
|
|
582
|
+
]
|
|
583
|
+
},
|
|
584
|
+
templateKey: "buildBodyCell",
|
|
585
|
+
func: "applyTemplate"
|
|
586
|
+
}
|
|
587
|
+
], ge = [
|
|
588
|
+
{
|
|
589
|
+
narration: "Prepend an empty cell into the table footer row if footer row is present.",
|
|
590
|
+
destinationPath: {
|
|
591
|
+
fileName: "base",
|
|
592
|
+
dataRole: "table-footer-row",
|
|
593
|
+
filePath: [
|
|
594
|
+
"children"
|
|
595
|
+
],
|
|
596
|
+
action: "unshift"
|
|
597
|
+
},
|
|
598
|
+
sourcePath: {
|
|
599
|
+
fileName: "data",
|
|
600
|
+
filePath: [
|
|
601
|
+
"serial",
|
|
602
|
+
"footer"
|
|
603
|
+
]
|
|
604
|
+
},
|
|
605
|
+
templateKey: "emptyCell",
|
|
606
|
+
func: "applyTemplate"
|
|
607
|
+
}
|
|
608
|
+
], R = { applyTemplate: p }, $e = (t = {}, a = {}, e = !1, o = []) => {
|
|
609
|
+
let n = t, s = a;
|
|
610
|
+
t && typeof t == "object" && "inTableSpec" in t && (n = t.inTableSpec, s = t.inSerial || a);
|
|
611
|
+
const i = {
|
|
612
|
+
data: {
|
|
613
|
+
serial: {
|
|
614
|
+
col: { width: "50px" },
|
|
615
|
+
header: { columnName: "#" },
|
|
616
|
+
body: {},
|
|
617
|
+
footer: {},
|
|
618
|
+
...s
|
|
619
|
+
}
|
|
620
|
+
},
|
|
621
|
+
base: n,
|
|
622
|
+
spec: b
|
|
623
|
+
};
|
|
624
|
+
f(we, i, R, b, e, o);
|
|
625
|
+
const l = C(n, "table-footer-row");
|
|
626
|
+
return l && Array.isArray(l.children) && l.children.length > 0 && f(ge, i, R, b, e, o), n;
|
|
627
|
+
}, Ne = [
|
|
628
|
+
{
|
|
629
|
+
narration: "Append the options column width to the table colgroup.",
|
|
630
|
+
destinationPath: {
|
|
631
|
+
fileName: "base",
|
|
632
|
+
dataRole: "table-colgroup",
|
|
633
|
+
filePath: [
|
|
634
|
+
"children"
|
|
635
|
+
],
|
|
636
|
+
action: "push"
|
|
637
|
+
},
|
|
638
|
+
sourcePath: {
|
|
639
|
+
fileName: "data",
|
|
640
|
+
filePath: [
|
|
641
|
+
"options",
|
|
642
|
+
"col"
|
|
643
|
+
]
|
|
644
|
+
},
|
|
645
|
+
templateKey: "buildColGroup",
|
|
646
|
+
func: "applyTemplate"
|
|
426
647
|
},
|
|
427
|
-
|
|
428
|
-
|
|
648
|
+
{
|
|
649
|
+
narration: "Append the options header cell to the table header row.",
|
|
650
|
+
destinationPath: {
|
|
651
|
+
fileName: "base",
|
|
652
|
+
dataRole: "table-header-row",
|
|
653
|
+
filePath: [
|
|
654
|
+
"children"
|
|
655
|
+
],
|
|
656
|
+
action: "push"
|
|
657
|
+
},
|
|
658
|
+
sourcePath: {
|
|
659
|
+
fileName: "data",
|
|
660
|
+
filePath: [
|
|
661
|
+
"options",
|
|
662
|
+
"header"
|
|
663
|
+
]
|
|
664
|
+
},
|
|
665
|
+
templateKey: "buildHeader",
|
|
666
|
+
func: "applyTemplate"
|
|
429
667
|
},
|
|
430
|
-
|
|
431
|
-
|
|
668
|
+
{
|
|
669
|
+
narration: "Append the options button cell into each table body row.",
|
|
670
|
+
destinationPath: {
|
|
671
|
+
fileName: "base",
|
|
672
|
+
dataRole: "table-body",
|
|
673
|
+
filePath: [
|
|
674
|
+
"children"
|
|
675
|
+
],
|
|
676
|
+
action: "pushToRows"
|
|
677
|
+
},
|
|
678
|
+
sourcePath: {
|
|
679
|
+
fileName: "data",
|
|
680
|
+
filePath: [
|
|
681
|
+
"options",
|
|
682
|
+
"body"
|
|
683
|
+
]
|
|
684
|
+
},
|
|
685
|
+
templateKey: "optionsButtonCell",
|
|
686
|
+
func: "applyTemplate"
|
|
687
|
+
}
|
|
688
|
+
], Te = [
|
|
689
|
+
{
|
|
690
|
+
narration: "Append an empty cell into the table footer row if footer row is present.",
|
|
691
|
+
destinationPath: {
|
|
692
|
+
fileName: "base",
|
|
693
|
+
dataRole: "table-footer-row",
|
|
694
|
+
filePath: [
|
|
695
|
+
"children"
|
|
696
|
+
],
|
|
697
|
+
action: "push"
|
|
698
|
+
},
|
|
699
|
+
sourcePath: {
|
|
700
|
+
fileName: "data",
|
|
701
|
+
filePath: [
|
|
702
|
+
"options",
|
|
703
|
+
"footer"
|
|
704
|
+
]
|
|
705
|
+
},
|
|
706
|
+
templateKey: "emptyCell",
|
|
707
|
+
func: "applyTemplate"
|
|
708
|
+
}
|
|
709
|
+
], v = { applyTemplate: p }, xe = (t = {}, a = {}, e = !1, o = []) => {
|
|
710
|
+
let n = t, s = a;
|
|
711
|
+
t && typeof t == "object" && "inTableSpec" in t && (n = t.inTableSpec, s = t.inOptions || a);
|
|
712
|
+
const i = {
|
|
713
|
+
data: {
|
|
714
|
+
options: {
|
|
715
|
+
col: { width: "100px" },
|
|
716
|
+
header: { columnName: "options" },
|
|
717
|
+
body: { columnName: "show" },
|
|
718
|
+
footer: {},
|
|
719
|
+
...s
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
base: n,
|
|
723
|
+
spec: b
|
|
724
|
+
};
|
|
725
|
+
f(Ne, i, v, b, e, o);
|
|
726
|
+
const l = C(n, "table-footer-row");
|
|
727
|
+
return l && Array.isArray(l.children) && l.children.length > 0 && f(Te, i, v, b, e, o), n;
|
|
728
|
+
}, X = ({ inOptions: t = {}, inBase: a, showLog: e = !1, returnLog: o = [] }) => {
|
|
729
|
+
const n = t, s = a;
|
|
730
|
+
return (n.showSerial || n.serial) && $e(s, n.serial || {}, e, o), (n.showOptions || n.options) && xe(s, n.options || {}, e, o), s;
|
|
731
|
+
}, E = { fromCollection: m, twoDimensional: N }, Pe = (t = {}, a = !1, e = []) => {
|
|
732
|
+
const o = t, n = o.columns || [], s = o.data || [], r = o.options, i = structuredClone(Yt), l = {
|
|
733
|
+
data: {
|
|
734
|
+
columns: n,
|
|
735
|
+
data: s
|
|
736
|
+
},
|
|
737
|
+
base: i,
|
|
738
|
+
spec: b
|
|
739
|
+
};
|
|
740
|
+
return f(Zt, l, E, b, a, e), S(te, l, E, b, a, e), X({ inOptions: r, inBase: i }), i;
|
|
741
|
+
}, Ae = "table", Ie = {
|
|
742
|
+
class: "table table-hover table-striped align-middle border mb-0"
|
|
743
|
+
}, ke = [
|
|
744
|
+
{
|
|
745
|
+
tagName: "colgroup",
|
|
746
|
+
attributes: {
|
|
747
|
+
"data-role": "table-colgroup"
|
|
748
|
+
},
|
|
749
|
+
children: []
|
|
432
750
|
},
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
751
|
+
{
|
|
752
|
+
tagName: "thead",
|
|
753
|
+
attributes: {
|
|
754
|
+
class: "table-dark",
|
|
755
|
+
"data-role": "table-header"
|
|
756
|
+
},
|
|
757
|
+
children: [
|
|
758
|
+
{
|
|
759
|
+
tagName: "tr",
|
|
760
|
+
attributes: {
|
|
761
|
+
"data-role": "table-header-row"
|
|
762
|
+
},
|
|
763
|
+
children: []
|
|
764
|
+
}
|
|
765
|
+
]
|
|
437
766
|
},
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
767
|
+
{
|
|
768
|
+
tagName: "tbody",
|
|
769
|
+
attributes: {
|
|
770
|
+
"data-role": "table-body"
|
|
771
|
+
},
|
|
772
|
+
children: []
|
|
442
773
|
},
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
774
|
+
{
|
|
775
|
+
tagName: "tfoot",
|
|
776
|
+
attributes: {
|
|
777
|
+
"data-role": "table-footer"
|
|
778
|
+
},
|
|
779
|
+
children: [
|
|
780
|
+
{
|
|
781
|
+
tagName: "tr",
|
|
782
|
+
attributes: {
|
|
783
|
+
"data-role": "table-footer-row"
|
|
784
|
+
},
|
|
785
|
+
children: []
|
|
786
|
+
}
|
|
787
|
+
]
|
|
448
788
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
789
|
+
], Q = {
|
|
790
|
+
tagName: Ae,
|
|
791
|
+
attributes: Ie,
|
|
792
|
+
children: ke
|
|
793
|
+
}, Be = [
|
|
794
|
+
{
|
|
795
|
+
narration: "Build the column widths for the table using the configured columns.",
|
|
796
|
+
destinationPath: {
|
|
797
|
+
fileName: "base",
|
|
798
|
+
dataRole: "table-colgroup",
|
|
799
|
+
filePath: [
|
|
800
|
+
"children"
|
|
801
|
+
]
|
|
802
|
+
},
|
|
803
|
+
sourcePath: {
|
|
804
|
+
fileName: "data",
|
|
805
|
+
filePath: [
|
|
806
|
+
"columns"
|
|
807
|
+
]
|
|
808
|
+
},
|
|
809
|
+
templateKey: "buildColGroup",
|
|
810
|
+
func: "fromCollection"
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
narration: "Build the header row for the table using the configured columns.",
|
|
814
|
+
destinationPath: {
|
|
815
|
+
fileName: "base",
|
|
816
|
+
dataRole: "table-header-row",
|
|
817
|
+
filePath: [
|
|
818
|
+
"children"
|
|
819
|
+
]
|
|
820
|
+
},
|
|
821
|
+
sourcePath: {
|
|
822
|
+
fileName: "data",
|
|
823
|
+
filePath: [
|
|
824
|
+
"columns"
|
|
825
|
+
]
|
|
826
|
+
},
|
|
827
|
+
templateKey: "buildHeader",
|
|
828
|
+
func: "fromCollection"
|
|
829
|
+
}
|
|
830
|
+
], O = { data: {}, base: Q, spec: b }, Fe = { fromCollection: m }, Se = (t, a = !1, e = []) => (O.data = t, f(Be, O, Fe, b, a, e), Q), je = [], Y = {
|
|
831
|
+
children: je
|
|
832
|
+
}, Re = [
|
|
833
|
+
{
|
|
834
|
+
narration: "Build the table body rows for the table using the configured columns and data.",
|
|
835
|
+
destinationPath: {
|
|
836
|
+
fileName: "base",
|
|
837
|
+
filePath: [
|
|
838
|
+
"children"
|
|
839
|
+
]
|
|
840
|
+
},
|
|
841
|
+
sourcePath: {
|
|
842
|
+
fileName: "data",
|
|
843
|
+
filePath: [
|
|
844
|
+
"columns"
|
|
845
|
+
]
|
|
846
|
+
},
|
|
847
|
+
func: "twoDimensional"
|
|
848
|
+
}
|
|
849
|
+
], D = { data: {}, base: Y, spec: b }, ve = { twoDimensional: N }, Ee = (t, a = !1, e = []) => (D.data = t, S(Re, D, ve, b, a, e), Y.children), Oe = "table", De = {
|
|
850
|
+
class: "table table-hover table-striped align-middle border mb-0"
|
|
851
|
+
}, Le = [
|
|
852
|
+
{
|
|
853
|
+
tagName: "colgroup",
|
|
854
|
+
attributes: {
|
|
855
|
+
"data-role": "table-colgroup"
|
|
856
|
+
},
|
|
857
|
+
children: []
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
tagName: "thead",
|
|
861
|
+
attributes: {
|
|
862
|
+
class: "table-dark",
|
|
863
|
+
"data-role": "table-header"
|
|
864
|
+
},
|
|
865
|
+
children: [
|
|
866
|
+
{
|
|
867
|
+
tagName: "tr",
|
|
868
|
+
attributes: {
|
|
869
|
+
"data-role": "table-header-row"
|
|
870
|
+
},
|
|
871
|
+
children: []
|
|
872
|
+
}
|
|
873
|
+
]
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
tagName: "tbody",
|
|
877
|
+
attributes: {
|
|
878
|
+
"data-role": "table-body"
|
|
879
|
+
},
|
|
880
|
+
children: []
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
tagName: "tfoot",
|
|
884
|
+
attributes: {
|
|
885
|
+
"data-role": "table-footer"
|
|
886
|
+
},
|
|
887
|
+
children: [
|
|
888
|
+
{
|
|
889
|
+
tagName: "tr",
|
|
890
|
+
attributes: {
|
|
891
|
+
"data-role": "table-footer-row"
|
|
892
|
+
},
|
|
893
|
+
children: []
|
|
894
|
+
}
|
|
895
|
+
]
|
|
896
|
+
}
|
|
897
|
+
], Ke = {
|
|
898
|
+
tagName: Oe,
|
|
899
|
+
attributes: De,
|
|
900
|
+
children: Le
|
|
901
|
+
}, Ve = [
|
|
902
|
+
{
|
|
903
|
+
narration: "Build the column widths for the table using the configured columns.",
|
|
904
|
+
destinationPath: {
|
|
905
|
+
fileName: "base",
|
|
906
|
+
dataRole: "table-colgroup",
|
|
907
|
+
filePath: [
|
|
908
|
+
"children"
|
|
909
|
+
]
|
|
910
|
+
},
|
|
911
|
+
sourcePath: {
|
|
912
|
+
fileName: "data",
|
|
913
|
+
filePath: [
|
|
914
|
+
"columns"
|
|
915
|
+
]
|
|
916
|
+
},
|
|
917
|
+
templateKey: "buildColGroup",
|
|
918
|
+
func: "fromCollection"
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
narration: "Build the header row for the table using the configured columns.",
|
|
922
|
+
destinationPath: {
|
|
923
|
+
fileName: "base",
|
|
924
|
+
dataRole: "table-header-row",
|
|
925
|
+
filePath: [
|
|
926
|
+
"children"
|
|
927
|
+
]
|
|
928
|
+
},
|
|
929
|
+
sourcePath: {
|
|
930
|
+
fileName: "data",
|
|
931
|
+
filePath: [
|
|
932
|
+
"columns"
|
|
933
|
+
]
|
|
934
|
+
},
|
|
935
|
+
templateKey: "buildHeader",
|
|
936
|
+
func: "fromCollection"
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
narration: "Build the footer row for the table using the configured columns.",
|
|
940
|
+
destinationPath: {
|
|
941
|
+
fileName: "base",
|
|
942
|
+
dataRole: "table-footer-row",
|
|
943
|
+
filePath: [
|
|
944
|
+
"children"
|
|
945
|
+
]
|
|
946
|
+
},
|
|
947
|
+
sourcePath: {
|
|
948
|
+
fileName: "data",
|
|
949
|
+
filePath: [
|
|
950
|
+
"columns"
|
|
951
|
+
]
|
|
952
|
+
},
|
|
953
|
+
templateKey: "buildFooter",
|
|
954
|
+
func: "fromCollection"
|
|
955
|
+
}
|
|
956
|
+
], He = [
|
|
957
|
+
{
|
|
958
|
+
narration: "Build the table body rows for the table using the configured columns and data.",
|
|
959
|
+
destinationPath: {
|
|
960
|
+
fileName: "base",
|
|
961
|
+
dataRole: "table-body",
|
|
962
|
+
filePath: [
|
|
963
|
+
"children"
|
|
964
|
+
]
|
|
965
|
+
},
|
|
966
|
+
sourcePath: {
|
|
967
|
+
fileName: "data",
|
|
968
|
+
filePath: [
|
|
969
|
+
"columns"
|
|
970
|
+
]
|
|
971
|
+
},
|
|
972
|
+
func: "twoDimensional"
|
|
973
|
+
}
|
|
974
|
+
], L = { fromCollection: m, twoDimensional: N }, Me = (t = {}, a = !1, e = []) => {
|
|
975
|
+
const o = t, n = o.inColumns || o.columns || [], s = o.inData || o.data || [], r = o.inOptions || o.options || {}, i = structuredClone(Ke), l = {
|
|
976
|
+
data: {
|
|
977
|
+
columns: n,
|
|
978
|
+
data: s
|
|
979
|
+
},
|
|
980
|
+
base: i,
|
|
981
|
+
spec: b
|
|
982
|
+
};
|
|
983
|
+
return f(Ve, l, L, b, a, e), S(He, l, L, b, a, e), X({ inOptions: r, inBase: i }), i;
|
|
984
|
+
}, We = [], T = {
|
|
985
|
+
children: We
|
|
986
|
+
}, qe = [
|
|
987
|
+
{
|
|
988
|
+
narration: "Build the footer row for the table using the configured columns.",
|
|
989
|
+
destinationPath: {
|
|
990
|
+
fileName: "base",
|
|
991
|
+
filePath: [
|
|
992
|
+
"children"
|
|
993
|
+
]
|
|
994
|
+
},
|
|
995
|
+
sourcePath: {
|
|
996
|
+
fileName: "data",
|
|
997
|
+
filePath: [
|
|
998
|
+
"columns"
|
|
999
|
+
]
|
|
1000
|
+
},
|
|
1001
|
+
templateKey: "buildFooter",
|
|
1002
|
+
func: "fromCollection"
|
|
1003
|
+
}
|
|
1004
|
+
], K = { data: {}, base: T, spec: b }, Ge = { fromCollection: m, twoDimensional: N }, ze = (t, a = !1, e = []) => (K.data = t, f(qe, K, Ge, b, a, e), T == null ? void 0 : T.children), Ue = {
|
|
1005
|
+
simple: Pe,
|
|
1006
|
+
headerOnly: Se,
|
|
1007
|
+
bodyOnly: Ee,
|
|
1008
|
+
withFooter: Me,
|
|
1009
|
+
footerOnly: ze
|
|
1010
|
+
}, V = ({
|
|
474
1011
|
inData: t,
|
|
475
|
-
inColumns:
|
|
1012
|
+
inColumns: a,
|
|
476
1013
|
inType: e,
|
|
477
|
-
footer:
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
1014
|
+
footer: o = [],
|
|
1015
|
+
inOptions: n,
|
|
1016
|
+
inShowLog: s
|
|
1017
|
+
} = {}) => {
|
|
1018
|
+
const r = e, i = Ue[r], l = n, c = s;
|
|
1019
|
+
return c && console.log("table : ", r, l), i({
|
|
1020
|
+
columns: a,
|
|
1021
|
+
data: t,
|
|
1022
|
+
options: l,
|
|
1023
|
+
showLog: c
|
|
1024
|
+
});
|
|
1025
|
+
}, Je = ({ inData: t = [], inColumns: a = [] } = {}) => ({
|
|
483
1026
|
data: t,
|
|
484
|
-
columns:
|
|
485
|
-
}),
|
|
1027
|
+
columns: a
|
|
1028
|
+
}), _e = {
|
|
486
1029
|
tagName: "option",
|
|
487
1030
|
textContent: "${rowValue}",
|
|
488
1031
|
attributes: {
|
|
489
1032
|
value: "${rowValue}"
|
|
490
1033
|
}
|
|
491
|
-
},
|
|
1034
|
+
}, Xe = {
|
|
492
1035
|
tagName: "select",
|
|
493
1036
|
attributes: {
|
|
494
1037
|
id: "LedgerName"
|
|
495
1038
|
},
|
|
496
1039
|
children: []
|
|
497
|
-
},
|
|
1040
|
+
}, Qe = {
|
|
498
1041
|
tagName: "datalist",
|
|
499
1042
|
attributes: {
|
|
500
1043
|
"data-name": "${columnName}"
|
|
501
1044
|
},
|
|
502
1045
|
children: []
|
|
503
|
-
},
|
|
504
|
-
buildOption:
|
|
505
|
-
buildSelect:
|
|
506
|
-
buildDataList:
|
|
507
|
-
},
|
|
508
|
-
const e = structuredClone(
|
|
1046
|
+
}, y = {
|
|
1047
|
+
buildOption: _e,
|
|
1048
|
+
buildSelect: Xe,
|
|
1049
|
+
buildDataList: Qe
|
|
1050
|
+
}, Ye = (t, a = y.buildOption) => {
|
|
1051
|
+
const e = structuredClone(a);
|
|
509
1052
|
return e.textContent = e.textContent.replace("rowValue", t), e.attributes.value = e.attributes.value.replace("rowValue", t), e;
|
|
510
|
-
},
|
|
511
|
-
const e =
|
|
512
|
-
|
|
513
|
-
const
|
|
514
|
-
return
|
|
515
|
-
},
|
|
516
|
-
const { data:
|
|
517
|
-
return
|
|
518
|
-
},
|
|
1053
|
+
}, Ze = (t, a) => {
|
|
1054
|
+
const e = a == null ? void 0 : a.columnName, o = structuredClone(y.buildSelect);
|
|
1055
|
+
o.attributes.id = e, o.attributes["data-name"] = e;
|
|
1056
|
+
const n = Ye(e, y.buildOption);
|
|
1057
|
+
return o.children = m(t, n), o;
|
|
1058
|
+
}, ta = ({ data: t, columns: a }) => a.map((e) => Ze(t, e)), ea = (t = {}) => {
|
|
1059
|
+
const { data: a, columns: e } = Je(t);
|
|
1060
|
+
return ta({ data: a, columns: e });
|
|
1061
|
+
}, aa = ({ inData: t = [], inColumns: a = [] } = {}) => ({
|
|
519
1062
|
data: t,
|
|
520
|
-
columns:
|
|
521
|
-
}),
|
|
522
|
-
const e = structuredClone(
|
|
1063
|
+
columns: a
|
|
1064
|
+
}), oa = (t, a = y.buildOption) => {
|
|
1065
|
+
const e = structuredClone(a);
|
|
523
1066
|
return e.textContent = e.textContent.replace("rowValue", t), e.attributes.value = e.attributes.value.replace("rowValue", t), e;
|
|
524
|
-
},
|
|
525
|
-
const e =
|
|
526
|
-
return
|
|
527
|
-
},
|
|
528
|
-
const { data:
|
|
529
|
-
return
|
|
530
|
-
},
|
|
1067
|
+
}, na = (t, a) => {
|
|
1068
|
+
const e = a == null ? void 0 : a.columnName, o = oa(e, y.buildOption);
|
|
1069
|
+
return m(t, o);
|
|
1070
|
+
}, sa = ({ data: t, columns: a }) => a.map((e) => na(t, e)), ra = (t = {}) => {
|
|
1071
|
+
const { data: a, columns: e } = aa(t);
|
|
1072
|
+
return sa({ data: a, columns: e });
|
|
1073
|
+
}, la = ({ inData: t = [], inColumns: a = [] } = {}) => ({
|
|
531
1074
|
data: t,
|
|
532
|
-
columns:
|
|
533
|
-
}),
|
|
534
|
-
const e = structuredClone(
|
|
1075
|
+
columns: a
|
|
1076
|
+
}), ia = (t, a = y.buildOption) => {
|
|
1077
|
+
const e = structuredClone(a);
|
|
535
1078
|
return e.textContent = e.textContent.replace("rowValue", t), e.attributes.value = e.attributes.value.replace("rowValue", t), e;
|
|
536
|
-
},
|
|
537
|
-
const e =
|
|
538
|
-
|
|
539
|
-
const
|
|
540
|
-
return
|
|
541
|
-
},
|
|
542
|
-
const { data:
|
|
543
|
-
return
|
|
544
|
-
},
|
|
1079
|
+
}, ca = (t, a) => {
|
|
1080
|
+
const e = a == null ? void 0 : a.columnName, o = structuredClone(y.buildDataList);
|
|
1081
|
+
o.attributes.id = e, o.attributes["data-name"] = e;
|
|
1082
|
+
const n = ia(e, y.buildOption);
|
|
1083
|
+
return o.children = m(t, n), o;
|
|
1084
|
+
}, ua = ({ data: t, columns: a }) => a.map((e) => ca(t, e)), H = (t = {}) => {
|
|
1085
|
+
const { data: a, columns: e } = la(t);
|
|
1086
|
+
return ua({ data: a, columns: e });
|
|
1087
|
+
}, da = {
|
|
545
1088
|
version: "1.2.0",
|
|
546
1089
|
name: "json-renderers-build-input-row"
|
|
547
|
-
},
|
|
548
|
-
const
|
|
549
|
-
if (typeof globalThis > "u" || !
|
|
1090
|
+
}, ba = (t) => {
|
|
1091
|
+
const a = t;
|
|
1092
|
+
if (typeof globalThis > "u" || !a) return;
|
|
550
1093
|
globalThis.ks ?? (globalThis.ks = {});
|
|
551
|
-
const e = typeof
|
|
1094
|
+
const e = typeof a == "function" ? a : a.render;
|
|
552
1095
|
globalThis.ks.jsonRenderersBuildInputRow = {
|
|
553
|
-
meta:
|
|
1096
|
+
meta: da,
|
|
554
1097
|
render: e,
|
|
555
|
-
...typeof
|
|
1098
|
+
...typeof a == "object" ? a : {}
|
|
556
1099
|
};
|
|
557
|
-
},
|
|
1100
|
+
}, pa = "input", ma = {
|
|
558
1101
|
type: "search",
|
|
559
1102
|
placeholder: "Search...",
|
|
560
1103
|
class: "form-control",
|
|
561
1104
|
id: "searchInputId"
|
|
562
|
-
},
|
|
563
|
-
tagName:
|
|
564
|
-
attributes:
|
|
565
|
-
},
|
|
566
|
-
const e = t && Object.keys(t).length > 0 ? t :
|
|
567
|
-
return e.placeholder && (
|
|
568
|
-
},
|
|
1105
|
+
}, ha = {
|
|
1106
|
+
tagName: pa,
|
|
1107
|
+
attributes: ma
|
|
1108
|
+
}, x = ({ inOptions: t = {}, options: a = {} } = {}) => {
|
|
1109
|
+
const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(ha);
|
|
1110
|
+
return e.placeholder && (o.attributes.placeholder = e.placeholder), e.class && (o.attributes.class = e.class), e.id && (o.attributes.id = e.id), e.name && (o.attributes.name = e.name), e.type && (o.attributes.type = e.type), e.value && (o.attributes.value = e.value), o;
|
|
1111
|
+
}, fa = "div", ya = {
|
|
569
1112
|
class: "d-flex align-items-center gap-2"
|
|
570
|
-
},
|
|
1113
|
+
}, Ca = [
|
|
571
1114
|
{
|
|
572
1115
|
tagName: "label",
|
|
573
1116
|
textContent: "Search:",
|
|
@@ -585,16 +1128,16 @@ const Nt = (t, o) => {
|
|
|
585
1128
|
id: "searchInputId"
|
|
586
1129
|
}
|
|
587
1130
|
}
|
|
588
|
-
],
|
|
589
|
-
tagName:
|
|
590
|
-
attributes:
|
|
591
|
-
children:
|
|
592
|
-
},
|
|
593
|
-
const e = t && Object.keys(t).length > 0 ? t :
|
|
594
|
-
return e.label && (
|
|
595
|
-
},
|
|
1131
|
+
], wa = {
|
|
1132
|
+
tagName: fa,
|
|
1133
|
+
attributes: ya,
|
|
1134
|
+
children: Ca
|
|
1135
|
+
}, I = ({ inOptions: t = {}, options: a = {} } = {}) => {
|
|
1136
|
+
const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(wa), n = o.children[0], s = o.children[1];
|
|
1137
|
+
return e.label && (n.textContent = e.label), e.id && (n.attributes.for = e.id, s.attributes.id = e.id), e.placeholder && (s.attributes.placeholder = e.placeholder), e.class && (s.attributes.class = e.class), e.name && (s.attributes.name = e.name), e.type && (s.attributes.type = e.type), e.wrapperClass && (o.attributes.class = e.wrapperClass), e.labelClass && (n.attributes.class = e.labelClass), o;
|
|
1138
|
+
}, ga = "div", $a = {
|
|
596
1139
|
class: "d-flex align-items-center gap-2"
|
|
597
|
-
},
|
|
1140
|
+
}, Na = [
|
|
598
1141
|
{
|
|
599
1142
|
tagName: "label",
|
|
600
1143
|
textContent: "Search:",
|
|
@@ -621,45 +1164,45 @@ const Nt = (t, o) => {
|
|
|
621
1164
|
id: "searchButtonId"
|
|
622
1165
|
}
|
|
623
1166
|
}
|
|
624
|
-
],
|
|
625
|
-
tagName:
|
|
626
|
-
attributes:
|
|
627
|
-
children:
|
|
628
|
-
},
|
|
629
|
-
const e = t && Object.keys(t).length > 0 ? t :
|
|
630
|
-
return e.label && (
|
|
631
|
-
},
|
|
632
|
-
input:
|
|
633
|
-
inputOnly:
|
|
634
|
-
inputWithLabel:
|
|
635
|
-
inputWithLabelButton:
|
|
636
|
-
},
|
|
1167
|
+
], Ta = {
|
|
1168
|
+
tagName: ga,
|
|
1169
|
+
attributes: $a,
|
|
1170
|
+
children: Na
|
|
1171
|
+
}, j = ({ inOptions: t = {}, options: a = {} } = {}) => {
|
|
1172
|
+
const e = t && Object.keys(t).length > 0 ? t : a, o = structuredClone(Ta), n = o.children[0], s = o.children[1], r = o.children[2];
|
|
1173
|
+
return e.label && (n.textContent = e.label), e.id && (n.attributes.for = e.id, s.attributes.id = e.id), e.placeholder && (s.attributes.placeholder = e.placeholder), e.class && (s.attributes.class = e.class), e.name && (s.attributes.name = e.name), e.type && (s.attributes.type = e.type), e.buttonText && (r.textContent = e.buttonText), e.buttonClass && (r.attributes.class = e.buttonClass), e.buttonId && (r.attributes.id = e.buttonId), e.wrapperClass && (o.attributes.class = e.wrapperClass), e.labelClass && (n.attributes.class = e.labelClass), o;
|
|
1174
|
+
}, xa = {
|
|
1175
|
+
input: x,
|
|
1176
|
+
inputOnly: x,
|
|
1177
|
+
inputWithLabel: I,
|
|
1178
|
+
inputWithLabelButton: j
|
|
1179
|
+
}, Pa = ({
|
|
637
1180
|
type: t = "inputWithLabel",
|
|
638
|
-
options:
|
|
1181
|
+
options: a = {},
|
|
639
1182
|
inType: e,
|
|
640
|
-
inOptions:
|
|
1183
|
+
inOptions: o
|
|
641
1184
|
} = {}) => {
|
|
642
|
-
const
|
|
643
|
-
return (
|
|
1185
|
+
const n = e ?? t, s = o ?? a;
|
|
1186
|
+
return (xa[n] || I)({ inOptions: s, options: s });
|
|
644
1187
|
};
|
|
645
|
-
|
|
646
|
-
render:
|
|
647
|
-
inputOnly:
|
|
648
|
-
inputWithLabel:
|
|
649
|
-
inputWithLabelButton:
|
|
1188
|
+
ba({
|
|
1189
|
+
render: Pa,
|
|
1190
|
+
inputOnly: x,
|
|
1191
|
+
inputWithLabel: I,
|
|
1192
|
+
inputWithLabelButton: j
|
|
650
1193
|
});
|
|
651
|
-
const
|
|
652
|
-
const e = t && Object.keys(t).length > 0 ? t :
|
|
653
|
-
return (e == null ? void 0 : e.label) === !1 || (e == null ? void 0 : e.flavour) === "inputOnly" ?
|
|
654
|
-
},
|
|
1194
|
+
const k = ({ inOptions: t = {}, options: a = {} } = {}) => {
|
|
1195
|
+
const e = t && Object.keys(t).length > 0 ? t : a;
|
|
1196
|
+
return (e == null ? void 0 : e.label) === !1 || (e == null ? void 0 : e.flavour) === "inputOnly" ? x({ inOptions: e }) : (e == null ? void 0 : e.flavour) === "inputWithLabelButton" || e != null && e.button || e != null && e.buttonText ? j({ inOptions: e }) : I({ inOptions: e });
|
|
1197
|
+
}, Aa = {
|
|
655
1198
|
version: "1.2.0",
|
|
656
1199
|
name: "json-renderers-build-form"
|
|
657
|
-
},
|
|
658
|
-
typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuildForm = { meta:
|
|
659
|
-
},
|
|
1200
|
+
}, Ia = (t) => {
|
|
1201
|
+
typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks.jsonRenderersBuildForm = { meta: Aa, render: t });
|
|
1202
|
+
}, ka = "div", Ba = {
|
|
660
1203
|
class: "${cardClass}",
|
|
661
1204
|
"data-role": "form-card"
|
|
662
|
-
},
|
|
1205
|
+
}, Fa = [
|
|
663
1206
|
{
|
|
664
1207
|
tagName: "header",
|
|
665
1208
|
attributes: {
|
|
@@ -740,14 +1283,14 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
740
1283
|
}
|
|
741
1284
|
]
|
|
742
1285
|
}
|
|
743
|
-
],
|
|
744
|
-
tagName:
|
|
745
|
-
attributes:
|
|
746
|
-
children:
|
|
747
|
-
},
|
|
748
|
-
destinationRole:
|
|
749
|
-
template:
|
|
750
|
-
},
|
|
1286
|
+
], Sa = {
|
|
1287
|
+
tagName: ka,
|
|
1288
|
+
attributes: Ba,
|
|
1289
|
+
children: Fa
|
|
1290
|
+
}, ja = () => structuredClone(Sa), Ra = "header-actions", va = "button", M = {
|
|
1291
|
+
destinationRole: Ra,
|
|
1292
|
+
template: va
|
|
1293
|
+
}, Ea = {
|
|
751
1294
|
tagName: "button",
|
|
752
1295
|
textContent: "${label}",
|
|
753
1296
|
attributes: {
|
|
@@ -755,20 +1298,20 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
755
1298
|
form: "${formId}",
|
|
756
1299
|
class: "${buttonClass} ${buttonSizeClass} ${buttonPaddingClass}"
|
|
757
1300
|
}
|
|
758
|
-
},
|
|
759
|
-
button:
|
|
760
|
-
},
|
|
761
|
-
const e = structuredClone(t),
|
|
762
|
-
return
|
|
763
|
-
},
|
|
764
|
-
destinationRole:
|
|
765
|
-
},
|
|
1301
|
+
}, Oa = {
|
|
1302
|
+
button: Ea
|
|
1303
|
+
}, Da = (t, a) => {
|
|
1304
|
+
const e = structuredClone(t), o = m(a.header.actions, Oa[M.template]);
|
|
1305
|
+
return C(e, M.destinationRole).children.push(...o), e;
|
|
1306
|
+
}, La = "form-body", Ka = {
|
|
1307
|
+
destinationRole: La
|
|
1308
|
+
}, Va = {
|
|
766
1309
|
tagName: "div",
|
|
767
1310
|
attributes: {
|
|
768
1311
|
class: "${rowClass}"
|
|
769
1312
|
},
|
|
770
1313
|
children: []
|
|
771
|
-
},
|
|
1314
|
+
}, Ha = {
|
|
772
1315
|
tagName: "div",
|
|
773
1316
|
attributes: {
|
|
774
1317
|
class: "${fieldClass}"
|
|
@@ -794,7 +1337,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
794
1337
|
}
|
|
795
1338
|
}
|
|
796
1339
|
]
|
|
797
|
-
},
|
|
1340
|
+
}, Ma = {
|
|
798
1341
|
tagName: "div",
|
|
799
1342
|
attributes: {
|
|
800
1343
|
class: "${fieldClass}"
|
|
@@ -821,7 +1364,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
821
1364
|
}
|
|
822
1365
|
}
|
|
823
1366
|
]
|
|
824
|
-
},
|
|
1367
|
+
}, Wa = {
|
|
825
1368
|
tagName: "div",
|
|
826
1369
|
attributes: {
|
|
827
1370
|
class: "${fieldClass}"
|
|
@@ -847,7 +1390,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
847
1390
|
}
|
|
848
1391
|
}
|
|
849
1392
|
]
|
|
850
|
-
},
|
|
1393
|
+
}, qa = {
|
|
851
1394
|
tagName: "div",
|
|
852
1395
|
attributes: {
|
|
853
1396
|
class: "${checkboxWrapperClass} ${fieldClass}"
|
|
@@ -872,7 +1415,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
872
1415
|
}
|
|
873
1416
|
}
|
|
874
1417
|
]
|
|
875
|
-
},
|
|
1418
|
+
}, Ga = {
|
|
876
1419
|
tagName: "div",
|
|
877
1420
|
attributes: {
|
|
878
1421
|
class: "${fieldClass}"
|
|
@@ -898,7 +1441,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
898
1441
|
}
|
|
899
1442
|
}
|
|
900
1443
|
]
|
|
901
|
-
},
|
|
1444
|
+
}, za = {
|
|
902
1445
|
tagName: "div",
|
|
903
1446
|
attributes: {
|
|
904
1447
|
class: "${fieldClass}"
|
|
@@ -925,7 +1468,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
925
1468
|
}
|
|
926
1469
|
}
|
|
927
1470
|
]
|
|
928
|
-
},
|
|
1471
|
+
}, Ua = {
|
|
929
1472
|
tagName: "div",
|
|
930
1473
|
attributes: {
|
|
931
1474
|
class: "${fieldClass}"
|
|
@@ -959,7 +1502,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
959
1502
|
}
|
|
960
1503
|
}
|
|
961
1504
|
]
|
|
962
|
-
},
|
|
1505
|
+
}, Ja = {
|
|
963
1506
|
tagName: "div",
|
|
964
1507
|
attributes: {
|
|
965
1508
|
class: "${fieldClass}"
|
|
@@ -994,7 +1537,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
994
1537
|
}
|
|
995
1538
|
}
|
|
996
1539
|
]
|
|
997
|
-
},
|
|
1540
|
+
}, _a = {
|
|
998
1541
|
tagName: "div",
|
|
999
1542
|
attributes: {
|
|
1000
1543
|
class: "${fieldClass}"
|
|
@@ -1020,7 +1563,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
1020
1563
|
}
|
|
1021
1564
|
}
|
|
1022
1565
|
]
|
|
1023
|
-
},
|
|
1566
|
+
}, Xa = {
|
|
1024
1567
|
tagName: "div",
|
|
1025
1568
|
attributes: {
|
|
1026
1569
|
class: "${inlineCheckboxWrapperClass}"
|
|
@@ -1045,43 +1588,43 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
1045
1588
|
}
|
|
1046
1589
|
}
|
|
1047
1590
|
]
|
|
1048
|
-
},
|
|
1049
|
-
buildBodyTr:
|
|
1050
|
-
buildBodyCell:
|
|
1051
|
-
buildRequiredField:
|
|
1052
|
-
buildTextareaField:
|
|
1053
|
-
buildCheckboxField:
|
|
1054
|
-
buildInlineField:
|
|
1055
|
-
buildInlineRequiredField:
|
|
1056
|
-
buildInlineFieldWithButton:
|
|
1057
|
-
buildInlineRequiredFieldWithButton:
|
|
1058
|
-
buildInlineTextareaField:
|
|
1059
|
-
buildInlineCheckboxField:
|
|
1060
|
-
},
|
|
1061
|
-
const
|
|
1062
|
-
var c, u, d,
|
|
1063
|
-
const i = ((u = (c =
|
|
1591
|
+
}, Qa = {
|
|
1592
|
+
buildBodyTr: Va,
|
|
1593
|
+
buildBodyCell: Ha,
|
|
1594
|
+
buildRequiredField: Ma,
|
|
1595
|
+
buildTextareaField: Wa,
|
|
1596
|
+
buildCheckboxField: qa,
|
|
1597
|
+
buildInlineField: Ga,
|
|
1598
|
+
buildInlineRequiredField: za,
|
|
1599
|
+
buildInlineFieldWithButton: Ua,
|
|
1600
|
+
buildInlineRequiredFieldWithButton: Ja,
|
|
1601
|
+
buildInlineTextareaField: _a,
|
|
1602
|
+
buildInlineCheckboxField: Xa
|
|
1603
|
+
}, Ya = (t, a, e) => {
|
|
1604
|
+
const o = t.map((r) => {
|
|
1605
|
+
var c, u, d, h, w;
|
|
1606
|
+
const i = ((u = (c = r.template) == null ? void 0 : c.body) == null ? void 0 : u.cell) ?? (r.required ? "buildRequiredField" : "buildBodyCell");
|
|
1064
1607
|
let l = ((d = e.fieldTemplates) == null ? void 0 : d[i]) ?? i;
|
|
1065
|
-
return
|
|
1066
|
-
...
|
|
1067
|
-
label:
|
|
1068
|
-
type:
|
|
1069
|
-
placeholder:
|
|
1070
|
-
buttonType:
|
|
1071
|
-
template: { ...
|
|
1608
|
+
return r.buttonText && (l = ((h = e.buttonFieldTemplates) == null ? void 0 : h[l]) ?? l), {
|
|
1609
|
+
...r,
|
|
1610
|
+
label: r.label ?? r.title ?? r.columnName,
|
|
1611
|
+
type: r.type ?? "text",
|
|
1612
|
+
placeholder: r.placeholder ?? "",
|
|
1613
|
+
buttonType: r.buttonType ?? "button",
|
|
1614
|
+
template: { ...r.template, body: { ...(w = r.template) == null ? void 0 : w.body, cell: l } }
|
|
1072
1615
|
};
|
|
1073
|
-
}),
|
|
1074
|
-
|
|
1075
|
-
|
|
1616
|
+
}), n = a[0] ?? {}, s = Object.fromEntries(o.map((r) => [
|
|
1617
|
+
r.columnName,
|
|
1618
|
+
n[r.columnName] ?? r.value ?? ""
|
|
1076
1619
|
]));
|
|
1077
|
-
return { columns:
|
|
1078
|
-
},
|
|
1079
|
-
const
|
|
1080
|
-
return
|
|
1081
|
-
},
|
|
1082
|
-
destinationRole:
|
|
1083
|
-
template:
|
|
1084
|
-
},
|
|
1620
|
+
return { columns: o, rows: [s] };
|
|
1621
|
+
}, Za = (t, a, e) => {
|
|
1622
|
+
const o = Ya(a.columns, a.records, e.body), n = N(o.columns, o.rows, Qa), s = structuredClone(t);
|
|
1623
|
+
return C(s, Ka.destinationRole).children.push(...Array.isArray(n) ? n : [n]), s;
|
|
1624
|
+
}, to = "footer-actions", eo = "button", W = {
|
|
1625
|
+
destinationRole: to,
|
|
1626
|
+
template: eo
|
|
1627
|
+
}, ao = {
|
|
1085
1628
|
tagName: "button",
|
|
1086
1629
|
textContent: "${label}",
|
|
1087
1630
|
attributes: {
|
|
@@ -1089,28 +1632,28 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
1089
1632
|
form: "${formId}",
|
|
1090
1633
|
class: "${buttonClass} ${buttonSizeClass} ${buttonPaddingClass}"
|
|
1091
1634
|
}
|
|
1092
|
-
},
|
|
1093
|
-
button:
|
|
1094
|
-
},
|
|
1095
|
-
const e = structuredClone(t),
|
|
1096
|
-
return
|
|
1097
|
-
},
|
|
1098
|
-
columns: Array.isArray(t) && t.length > 0 ? t : Array.isArray(
|
|
1099
|
-
records: Array.isArray(
|
|
1100
|
-
options: e && Object.keys(e).length > 0 ? e :
|
|
1101
|
-
}),
|
|
1102
|
-
formId:
|
|
1635
|
+
}, oo = {
|
|
1636
|
+
button: ao
|
|
1637
|
+
}, no = (t, a) => {
|
|
1638
|
+
const e = structuredClone(t), o = m(a.footer.actions, oo[W.template]);
|
|
1639
|
+
return C(e, W.destinationRole).children.push(...o), e;
|
|
1640
|
+
}, Z = ({ inColumns: t, inData: a, inOptions: e, columns: o, data: n, options: s } = {}) => ({
|
|
1641
|
+
columns: Array.isArray(t) && t.length > 0 ? t : Array.isArray(o) ? o : [],
|
|
1642
|
+
records: Array.isArray(a) && a.length > 0 ? a : Array.isArray(n) ? n : [],
|
|
1643
|
+
options: e && Object.keys(e).length > 0 ? e : s ?? {}
|
|
1644
|
+
}), so = "bigButtonsForm", ro = "Account details", lo = "Update your profile information.", io = "", co = "label", uo = "stacked", bo = "saveCancel", po = {
|
|
1645
|
+
formId: so,
|
|
1103
1646
|
title: ro,
|
|
1104
|
-
description:
|
|
1105
|
-
recordId:
|
|
1106
|
-
header:
|
|
1107
|
-
body:
|
|
1108
|
-
footer:
|
|
1109
|
-
},
|
|
1647
|
+
description: lo,
|
|
1648
|
+
recordId: io,
|
|
1649
|
+
header: co,
|
|
1650
|
+
body: uo,
|
|
1651
|
+
footer: bo
|
|
1652
|
+
}, mo = {
|
|
1110
1653
|
actions: []
|
|
1111
|
-
},
|
|
1654
|
+
}, ho = {
|
|
1112
1655
|
actions: []
|
|
1113
|
-
},
|
|
1656
|
+
}, fo = {
|
|
1114
1657
|
actions: [
|
|
1115
1658
|
{
|
|
1116
1659
|
label: "Refresh",
|
|
@@ -1118,14 +1661,14 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
1118
1661
|
buttonClass: "${headerButtonClass}"
|
|
1119
1662
|
}
|
|
1120
1663
|
]
|
|
1121
|
-
},
|
|
1664
|
+
}, yo = {
|
|
1122
1665
|
actions: []
|
|
1123
|
-
},
|
|
1124
|
-
none:
|
|
1125
|
-
label:
|
|
1126
|
-
labelWithRefresh:
|
|
1127
|
-
labelWithId:
|
|
1128
|
-
},
|
|
1666
|
+
}, Co = {
|
|
1667
|
+
none: mo,
|
|
1668
|
+
label: ho,
|
|
1669
|
+
labelWithRefresh: fo,
|
|
1670
|
+
labelWithId: yo
|
|
1671
|
+
}, wo = {
|
|
1129
1672
|
fieldTemplates: {
|
|
1130
1673
|
buildBodyCell: "buildInlineField",
|
|
1131
1674
|
buildRequiredField: "buildInlineRequiredField",
|
|
@@ -1136,19 +1679,19 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
1136
1679
|
buildInlineField: "buildInlineFieldWithButton",
|
|
1137
1680
|
buildInlineRequiredField: "buildInlineRequiredFieldWithButton"
|
|
1138
1681
|
}
|
|
1139
|
-
},
|
|
1682
|
+
}, go = {
|
|
1140
1683
|
fieldTemplates: {},
|
|
1141
1684
|
buttonFieldTemplates: {}
|
|
1142
|
-
},
|
|
1685
|
+
}, $o = {
|
|
1143
1686
|
fieldTemplates: {},
|
|
1144
1687
|
buttonFieldTemplates: {}
|
|
1145
|
-
},
|
|
1146
|
-
inline:
|
|
1147
|
-
stacked:
|
|
1148
|
-
threeColumns:
|
|
1149
|
-
},
|
|
1688
|
+
}, No = {
|
|
1689
|
+
inline: wo,
|
|
1690
|
+
stacked: go,
|
|
1691
|
+
threeColumns: $o
|
|
1692
|
+
}, To = {
|
|
1150
1693
|
actions: []
|
|
1151
|
-
},
|
|
1694
|
+
}, xo = {
|
|
1152
1695
|
actions: [
|
|
1153
1696
|
{
|
|
1154
1697
|
label: "Save",
|
|
@@ -1161,7 +1704,7 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
1161
1704
|
buttonClass: "${secondaryButtonClass}"
|
|
1162
1705
|
}
|
|
1163
1706
|
]
|
|
1164
|
-
},
|
|
1707
|
+
}, Po = {
|
|
1165
1708
|
actions: [
|
|
1166
1709
|
{
|
|
1167
1710
|
label: "Edit",
|
|
@@ -1169,31 +1712,31 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
1169
1712
|
buttonClass: "${infoButtonClass}"
|
|
1170
1713
|
}
|
|
1171
1714
|
]
|
|
1172
|
-
},
|
|
1173
|
-
none:
|
|
1174
|
-
saveCancel:
|
|
1175
|
-
edit:
|
|
1176
|
-
},
|
|
1177
|
-
const
|
|
1178
|
-
if (!
|
|
1179
|
-
return
|
|
1180
|
-
},
|
|
1715
|
+
}, Ao = {
|
|
1716
|
+
none: To,
|
|
1717
|
+
saveCancel: xo,
|
|
1718
|
+
edit: Po
|
|
1719
|
+
}, B = (t, a, e) => {
|
|
1720
|
+
const o = t[a];
|
|
1721
|
+
if (!o) throw new RangeError("Unknown bigButtons " + e + ": " + a);
|
|
1722
|
+
return o;
|
|
1723
|
+
}, tt = (t) => {
|
|
1181
1724
|
if (typeof t != "object" || t === null || Array.isArray(t))
|
|
1182
1725
|
throw new TypeError("bigButtons options must be an object keyed by renderer type");
|
|
1183
|
-
const
|
|
1184
|
-
if (typeof
|
|
1726
|
+
const a = t["form.bigButtons"] ?? {};
|
|
1727
|
+
if (typeof a != "object" || a === null || Array.isArray(a))
|
|
1185
1728
|
throw new TypeError('options["form.bigButtons"] must be an object');
|
|
1186
|
-
const e = { ...
|
|
1729
|
+
const e = { ...po, ...a };
|
|
1187
1730
|
return {
|
|
1188
1731
|
options: e,
|
|
1189
|
-
header:
|
|
1190
|
-
body:
|
|
1191
|
-
footer:
|
|
1732
|
+
header: B(Co, e.header, "header"),
|
|
1733
|
+
body: B(No, e.body, "body"),
|
|
1734
|
+
footer: B(Ao, e.footer, "footer")
|
|
1192
1735
|
};
|
|
1193
|
-
},
|
|
1194
|
-
const e =
|
|
1195
|
-
return
|
|
1196
|
-
},
|
|
1736
|
+
}, Io = (t, a = {}) => {
|
|
1737
|
+
const e = Z(a), o = tt(e.options), n = Da(t, o), s = Za(n, e, o);
|
|
1738
|
+
return no(s, o);
|
|
1739
|
+
}, ko = {
|
|
1197
1740
|
none: {
|
|
1198
1741
|
headerClass: "d-none",
|
|
1199
1742
|
headerActionsClass: "d-none"
|
|
@@ -1225,14 +1768,14 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
1225
1768
|
headerActionsClass: "d-none",
|
|
1226
1769
|
headerButtonClass: "btn btn-outline-secondary text-nowrap"
|
|
1227
1770
|
}
|
|
1228
|
-
},
|
|
1229
|
-
bootstrap:
|
|
1230
|
-
},
|
|
1231
|
-
var
|
|
1232
|
-
const e = (
|
|
1771
|
+
}, Bo = {
|
|
1772
|
+
bootstrap: ko
|
|
1773
|
+
}, Fo = (t, a) => {
|
|
1774
|
+
var o;
|
|
1775
|
+
const e = (o = Bo[a]) == null ? void 0 : o[t.header];
|
|
1233
1776
|
if (!e) throw new RangeError("Unknown bigButtons header: " + t.header);
|
|
1234
1777
|
return e;
|
|
1235
|
-
},
|
|
1778
|
+
}, So = "bootstrap", jo = {
|
|
1236
1779
|
bootstrap: {
|
|
1237
1780
|
base: {
|
|
1238
1781
|
cardClass: "card border-0 shadow-sm w-100",
|
|
@@ -1262,15 +1805,15 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
1262
1805
|
}
|
|
1263
1806
|
}
|
|
1264
1807
|
}
|
|
1265
|
-
},
|
|
1266
|
-
defaultFramework:
|
|
1267
|
-
frameworks:
|
|
1268
|
-
},
|
|
1269
|
-
const e =
|
|
1270
|
-
if (!e) throw new RangeError("Unknown bigButtons framework: " +
|
|
1271
|
-
const
|
|
1272
|
-
if (!
|
|
1273
|
-
return { ...e.base, ...
|
|
1808
|
+
}, F = {
|
|
1809
|
+
defaultFramework: So,
|
|
1810
|
+
frameworks: jo
|
|
1811
|
+
}, Ro = (t, a) => {
|
|
1812
|
+
const e = F.frameworks[a];
|
|
1813
|
+
if (!e) throw new RangeError("Unknown bigButtons framework: " + a);
|
|
1814
|
+
const o = e.bodies[t.body];
|
|
1815
|
+
if (!o) throw new RangeError("Unknown bigButtons body: " + t.body);
|
|
1816
|
+
return { ...e.base, ...o };
|
|
1274
1817
|
}, vo = {
|
|
1275
1818
|
base: {
|
|
1276
1819
|
footerClass: "card-footer bg-transparent",
|
|
@@ -1289,94 +1832,98 @@ const A = ({ inOptions: t = {}, options: o = {} } = {}) => {
|
|
|
1289
1832
|
saveCancel: {},
|
|
1290
1833
|
edit: {}
|
|
1291
1834
|
}
|
|
1292
|
-
},
|
|
1835
|
+
}, Eo = {
|
|
1293
1836
|
bootstrap: vo
|
|
1294
|
-
},
|
|
1295
|
-
const e =
|
|
1296
|
-
if (!e) throw new RangeError("Unknown bigButtons framework: " +
|
|
1297
|
-
if (!
|
|
1298
|
-
return { ...e.base, ...
|
|
1299
|
-
},
|
|
1300
|
-
const e =
|
|
1301
|
-
if (!
|
|
1302
|
-
const
|
|
1837
|
+
}, Oo = (t, a) => {
|
|
1838
|
+
const e = Eo[a], o = e == null ? void 0 : e.footers[t.footer];
|
|
1839
|
+
if (!e) throw new RangeError("Unknown bigButtons framework: " + a);
|
|
1840
|
+
if (!o) throw new RangeError("Unknown bigButtons footer: " + t.footer);
|
|
1841
|
+
return { ...e.base, ...o };
|
|
1842
|
+
}, Do = (t, a = {}) => {
|
|
1843
|
+
const e = tt(Z(a).options), { options: o } = e, n = o.framework ?? F.defaultFramework;
|
|
1844
|
+
if (!F.frameworks[n]) throw new RangeError("Unknown bigButtons framework: " + n);
|
|
1845
|
+
const r = Object.assign(
|
|
1303
1846
|
{},
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1847
|
+
o,
|
|
1848
|
+
Ro(o, n),
|
|
1849
|
+
Fo(o, n),
|
|
1850
|
+
Oo(o, n)
|
|
1308
1851
|
);
|
|
1309
|
-
return
|
|
1852
|
+
return p(r, structuredClone(t));
|
|
1310
1853
|
}, Lo = (t = {}) => {
|
|
1311
|
-
const
|
|
1312
|
-
return
|
|
1313
|
-
},
|
|
1314
|
-
const
|
|
1315
|
-
return
|
|
1854
|
+
const a = ja(), e = Io(a, t);
|
|
1855
|
+
return Do(e, t);
|
|
1856
|
+
}, et = (t = {}) => {
|
|
1857
|
+
const a = { ...t, type: t.type ?? "form.bigButtons" };
|
|
1858
|
+
return P(a), Lo(a);
|
|
1316
1859
|
};
|
|
1317
|
-
|
|
1318
|
-
const
|
|
1860
|
+
Ia(et);
|
|
1861
|
+
const Ko = ({
|
|
1319
1862
|
inType: t = "stacked",
|
|
1320
|
-
inData:
|
|
1863
|
+
inData: a,
|
|
1321
1864
|
inColumns: e
|
|
1322
|
-
} = {}) =>
|
|
1865
|
+
} = {}) => et({
|
|
1323
1866
|
type: t,
|
|
1324
1867
|
columns: e,
|
|
1325
|
-
data:
|
|
1326
|
-
}),
|
|
1327
|
-
table:
|
|
1328
|
-
tableFromSpec:
|
|
1329
|
-
select:
|
|
1330
|
-
selectOptionsOnly:
|
|
1331
|
-
dataList:
|
|
1332
|
-
datalist:
|
|
1333
|
-
searchInput:
|
|
1334
|
-
search:
|
|
1335
|
-
inputRow:
|
|
1336
|
-
form:
|
|
1337
|
-
},
|
|
1338
|
-
|
|
1339
|
-
const
|
|
1340
|
-
|
|
1868
|
+
data: a
|
|
1869
|
+
}), Vo = {
|
|
1870
|
+
table: V,
|
|
1871
|
+
tableFromSpec: V,
|
|
1872
|
+
select: ea,
|
|
1873
|
+
selectOptionsOnly: ra,
|
|
1874
|
+
dataList: H,
|
|
1875
|
+
datalist: H,
|
|
1876
|
+
searchInput: k,
|
|
1877
|
+
search: k,
|
|
1878
|
+
inputRow: k,
|
|
1879
|
+
form: Ko
|
|
1880
|
+
}, at = (t = {}) => {
|
|
1881
|
+
P(t);
|
|
1882
|
+
const a = t == null ? void 0 : t.showLog;
|
|
1883
|
+
console.log("localShowLog : ", a);
|
|
1884
|
+
const e = t.type, o = t == null ? void 0 : t.options;
|
|
1885
|
+
let n = e, s = e;
|
|
1341
1886
|
if (e.includes(".")) {
|
|
1342
|
-
const
|
|
1343
|
-
|
|
1887
|
+
const l = e.split(".");
|
|
1888
|
+
n = l[0], s = l[1];
|
|
1344
1889
|
}
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1890
|
+
a && console.log("localMainType : ", n, s);
|
|
1891
|
+
const r = Vo[n];
|
|
1892
|
+
if (!r)
|
|
1893
|
+
throw new Error(`Renderer for type "${n}" not found.`);
|
|
1894
|
+
const i = r({
|
|
1895
|
+
inType: s,
|
|
1350
1896
|
inColumns: t.columns,
|
|
1351
1897
|
inData: t.data,
|
|
1352
|
-
inOptions:
|
|
1353
|
-
options: t.options
|
|
1898
|
+
inOptions: o,
|
|
1899
|
+
options: t.options,
|
|
1900
|
+
inShowLog: a
|
|
1354
1901
|
});
|
|
1355
|
-
return
|
|
1902
|
+
return a && console.log("json-renderers-build output:", i), i;
|
|
1356
1903
|
};
|
|
1357
|
-
|
|
1358
|
-
const
|
|
1904
|
+
Pt(at);
|
|
1905
|
+
const Ho = ({
|
|
1359
1906
|
inColumns: t,
|
|
1360
|
-
inType:
|
|
1907
|
+
inType: a = "table",
|
|
1361
1908
|
inData: e,
|
|
1362
|
-
inShowLog:
|
|
1363
|
-
} = {}) =>
|
|
1364
|
-
type:
|
|
1909
|
+
inShowLog: o = !1
|
|
1910
|
+
} = {}) => at({
|
|
1911
|
+
type: a,
|
|
1365
1912
|
data: e ?? [],
|
|
1366
1913
|
columns: t,
|
|
1367
|
-
showLog:
|
|
1368
|
-
}),
|
|
1369
|
-
version: "
|
|
1914
|
+
showLog: o
|
|
1915
|
+
}), Mo = {
|
|
1916
|
+
version: "v10",
|
|
1370
1917
|
description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
|
|
1371
1918
|
}, Wo = (t) => {
|
|
1372
1919
|
if (typeof globalThis > "u" || !t) return;
|
|
1373
1920
|
globalThis.ks ?? (globalThis.ks = {});
|
|
1374
|
-
const
|
|
1375
|
-
meta:
|
|
1921
|
+
const a = {
|
|
1922
|
+
meta: Mo,
|
|
1376
1923
|
buildSpecElement: t
|
|
1377
1924
|
};
|
|
1378
|
-
globalThis.ks["json-to-tag"] =
|
|
1379
|
-
}, qo = (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 ?? "") :
|
|
1925
|
+
globalThis.ks["json-to-tag"] = a, globalThis.ks.jsonToTag = a;
|
|
1926
|
+
}, qo = (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 ?? "") : nt(t), ot = (t) => Array.isArray(t) ? t.map(qo).flat(1 / 0).filter(Boolean) : [], Go = (t) => (t == null, t), zo = "http://www.w3.org/2000/svg", Uo = /* @__PURE__ */ new Set([
|
|
1380
1927
|
"svg",
|
|
1381
1928
|
"path",
|
|
1382
1929
|
"symbol",
|
|
@@ -1403,100 +1950,100 @@ const Oo = ({
|
|
|
1403
1950
|
"fegaussianblur",
|
|
1404
1951
|
"femerge",
|
|
1405
1952
|
"femergenode"
|
|
1406
|
-
]),
|
|
1407
|
-
const
|
|
1408
|
-
if (!
|
|
1409
|
-
if (
|
|
1953
|
+
]), Jo = ({ inTagName: t }) => {
|
|
1954
|
+
const a = t == null ? void 0 : t.toLowerCase();
|
|
1955
|
+
if (!a) return null;
|
|
1956
|
+
if (a === "checkbox") {
|
|
1410
1957
|
const e = document.createElement("input");
|
|
1411
1958
|
return e.type = "checkbox", e;
|
|
1412
1959
|
}
|
|
1413
|
-
return
|
|
1414
|
-
},
|
|
1415
|
-
const e = t,
|
|
1416
|
-
if (!e || !
|
|
1960
|
+
return Uo.has(a) ? document.createElementNS(zo, a) : document.createElement(a);
|
|
1961
|
+
}, _o = ({ inElement: t, inTextContent: a }) => (!t || a === void 0 || a === null || (t.textContent = a), t), Xo = ({ inElement: t, inProperties: a }) => (t && a && typeof a == "object" && Object.assign(t, a), t), Qo = "http://www.w3.org/1999/xlink", Yo = ({ inElement: t, inAttributes: a }) => {
|
|
1962
|
+
const e = t, o = a;
|
|
1963
|
+
if (!e || !o || typeof o != "object")
|
|
1417
1964
|
return e;
|
|
1418
|
-
const
|
|
1419
|
-
return Object.entries(
|
|
1420
|
-
if (
|
|
1421
|
-
|
|
1965
|
+
const n = typeof SVGElement < "u" ? e instanceof SVGElement : e.namespaceURI === "http://www.w3.org/2000/svg";
|
|
1966
|
+
return Object.entries(o).forEach(([s, r]) => {
|
|
1967
|
+
if (s === "class") {
|
|
1968
|
+
n ? e.setAttribute("class", String(r)) : e.className = r;
|
|
1422
1969
|
return;
|
|
1423
1970
|
}
|
|
1424
|
-
if (
|
|
1425
|
-
if (
|
|
1426
|
-
const i = String(
|
|
1427
|
-
if (
|
|
1971
|
+
if (s === "xlink:href" || s === "href") {
|
|
1972
|
+
if (r != null) {
|
|
1973
|
+
const i = String(r);
|
|
1974
|
+
if (n)
|
|
1428
1975
|
try {
|
|
1429
|
-
e.setAttributeNS(
|
|
1976
|
+
e.setAttributeNS(Qo, "href", i);
|
|
1430
1977
|
} catch {
|
|
1431
1978
|
}
|
|
1432
1979
|
e.setAttribute("href", i), e.setAttribute("xlink:href", i);
|
|
1433
1980
|
}
|
|
1434
1981
|
return;
|
|
1435
1982
|
}
|
|
1436
|
-
if (typeof
|
|
1437
|
-
|
|
1983
|
+
if (typeof r == "boolean") {
|
|
1984
|
+
r ? e.setAttribute(s, "") : e.removeAttribute(s);
|
|
1438
1985
|
return;
|
|
1439
1986
|
}
|
|
1440
|
-
|
|
1987
|
+
r != null && e.setAttribute(s, String(r));
|
|
1441
1988
|
}), e;
|
|
1442
|
-
},
|
|
1443
|
-
if (!t || !
|
|
1444
|
-
const e = typeof
|
|
1989
|
+
}, Zo = ({ inElement: t, inClassList: a }) => {
|
|
1990
|
+
if (!t || !a) return t;
|
|
1991
|
+
const e = typeof a == "string" ? a.split(/\s+/).filter(Boolean) : Array.isArray(a) ? a.filter((o) => typeof o == "string" && o.trim()) : [];
|
|
1445
1992
|
return e.length && t.classList.add(...e), t;
|
|
1446
|
-
},
|
|
1993
|
+
}, tn = (t) => {
|
|
1447
1994
|
if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
|
|
1448
|
-
const
|
|
1449
|
-
if (!
|
|
1450
|
-
if (
|
|
1451
|
-
inElement:
|
|
1452
|
-
inTextContent:
|
|
1995
|
+
const a = Jo({ inTagName: t.tagName });
|
|
1996
|
+
if (!a) return null;
|
|
1997
|
+
if (_o({
|
|
1998
|
+
inElement: a,
|
|
1999
|
+
inTextContent: Go(t.textContent),
|
|
1453
2000
|
inTagName: t.tagName
|
|
1454
|
-
}),
|
|
1455
|
-
inElement:
|
|
2001
|
+
}), Xo({
|
|
2002
|
+
inElement: a,
|
|
1456
2003
|
inProperties: t.properties
|
|
1457
|
-
}),
|
|
1458
|
-
inElement:
|
|
2004
|
+
}), Yo({
|
|
2005
|
+
inElement: a,
|
|
1459
2006
|
inAttributes: t.attributes
|
|
1460
|
-
}),
|
|
1461
|
-
inElement:
|
|
2007
|
+
}), Zo({
|
|
2008
|
+
inElement: a,
|
|
1462
2009
|
inClassList: t.classList
|
|
1463
2010
|
}), Array.isArray(t.children)) {
|
|
1464
|
-
const e =
|
|
1465
|
-
e.length &&
|
|
2011
|
+
const e = ot(t.children);
|
|
2012
|
+
e.length && a.append(...e);
|
|
1466
2013
|
}
|
|
1467
|
-
return
|
|
1468
|
-
},
|
|
1469
|
-
const
|
|
1470
|
-
return
|
|
2014
|
+
return a;
|
|
2015
|
+
}, nt = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? ot(t) : typeof t == "object" ? tn(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, st = (t = {}) => {
|
|
2016
|
+
const a = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
|
|
2017
|
+
return nt(a);
|
|
1471
2018
|
};
|
|
1472
|
-
Wo(
|
|
1473
|
-
const
|
|
2019
|
+
Wo(st);
|
|
2020
|
+
const en = ({
|
|
1474
2021
|
inSpec: t,
|
|
1475
|
-
inTargetHtmlId:
|
|
2022
|
+
inTargetHtmlId: a,
|
|
1476
2023
|
inAppendPosition: e,
|
|
1477
|
-
inShowLog:
|
|
2024
|
+
inShowLog: o = !1
|
|
1478
2025
|
} = {}) => {
|
|
1479
|
-
const
|
|
2026
|
+
const n = t, s = a, r = e, i = o, l = st(n);
|
|
1480
2027
|
i && console.log("renderToDom 1 (content):", l);
|
|
1481
|
-
const c = document.getElementById(
|
|
1482
|
-
return c ? (Array.isArray(l) || l instanceof NodeList || l instanceof HTMLCollection ?
|
|
1483
|
-
},
|
|
2028
|
+
const c = document.getElementById(s);
|
|
2029
|
+
return c ? (Array.isArray(l) || l instanceof NodeList || l instanceof HTMLCollection ? r === "prepend" ? c.prepend(...l) : c.append(...l) : r === "prepend" ? c.prepend(l) : (c.innerHTML = "", c.append(l)), i && console.log("renderToDom 2 (mounted):", c), c) : null;
|
|
2030
|
+
}, an = (t = {}) => {
|
|
1484
2031
|
$(t), (t == null ? void 0 : t.showLog) && console.log("first : ", t == null ? void 0 : t.columns, t == null ? void 0 : t.data, t == null ? void 0 : t.appendPosition);
|
|
1485
|
-
const e =
|
|
2032
|
+
const e = Ho({
|
|
1486
2033
|
inColumns: t.columns,
|
|
1487
2034
|
inData: t.data,
|
|
1488
2035
|
inType: t.type,
|
|
1489
2036
|
inShowLog: t.showLog
|
|
1490
2037
|
});
|
|
1491
|
-
return
|
|
2038
|
+
return en({
|
|
1492
2039
|
inSpec: e,
|
|
1493
2040
|
inTargetHtmlId: t.targetHtmlId,
|
|
1494
2041
|
inAppendPosition: t.appendPosition,
|
|
1495
2042
|
inShowLog: t.showLog
|
|
1496
2043
|
});
|
|
1497
2044
|
};
|
|
1498
|
-
|
|
2045
|
+
ct(an);
|
|
1499
2046
|
export {
|
|
1500
|
-
|
|
1501
|
-
|
|
2047
|
+
an as default,
|
|
2048
|
+
an as render
|
|
1502
2049
|
};
|