json-renderers-build 1.6.1 → 1.9.1
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 +8 -4
- package/docs/dist/min.js +541 -266
- package/docs/dist/v4/min.js +320 -320
- package/docs/dist/v5/min.js +312 -312
- package/docs/dist/v7/min.js +272 -0
- package/docs/dist/v8/min.js +268 -0
- package/docs/dist/v9/min.js +587 -0
- package/docs/index.html +2 -2
- package/package.json +2 -2
- package/src/index.js +2 -2
- package/src/v7/common/deriveColumnsFromData.js +20 -0
- package/src/v7/index.js +47 -0
- package/src/v7/meta.js +6 -0
- package/src/v7/registerGlobal.js +14 -0
- package/src/v7/select/index.js +21 -0
- package/src/v7/select/options/index.js +17 -0
- package/src/v7/select/options/skeleton.json +17 -0
- package/src/v7/select/skeleton.json +7 -0
- package/src/v7/table/body/cells/index.js +23 -0
- package/src/v7/table/body/cells/skeleton.json +17 -0
- package/src/v7/table/body/index.js +15 -0
- package/src/v7/table/body/rows/index.js +36 -0
- package/src/v7/table/body/rows/skeleton.json +4 -0
- package/src/v7/table/body/skeleton.json +4 -0
- package/src/v7/table/head/cells/index.js +23 -0
- package/src/v7/table/head/cells/skeleton.json +17 -0
- package/src/v7/table/head/index.js +15 -0
- package/src/v7/table/head/row/index.js +15 -0
- package/src/v7/table/head/row/skeleton.json +4 -0
- package/src/v7/table/head/skeleton.json +4 -0
- package/src/v7/table/index.js +26 -0
- package/src/v7/table/skeleton.json +7 -0
- package/src/v8/common/deriveColumnsFromData.js +20 -0
- package/src/v8/index.js +40 -0
- package/src/v8/meta.js +6 -0
- package/src/v8/registerGlobal.js +14 -0
- package/src/v8/select/index.js +21 -0
- package/src/v8/select/options/index.js +17 -0
- package/src/v8/select/options/skeleton.json +17 -0
- package/src/v8/select/skeleton.json +7 -0
- package/src/v8/table/body/cells/index.js +17 -0
- package/src/v8/table/body/cells/skeleton.json +17 -0
- package/src/v8/table/body/index.js +20 -0
- package/src/v8/table/body/rows/index.js +23 -0
- package/src/v8/table/body/rows/skeleton.json +4 -0
- package/src/v8/table/body/skeleton.json +4 -0
- package/src/v8/table/head/cells/index.js +17 -0
- package/src/v8/table/head/cells/skeleton.json +17 -0
- package/src/v8/table/head/index.js +15 -0
- package/src/v8/table/head/row/index.js +15 -0
- package/src/v8/table/head/row/skeleton.json +4 -0
- package/src/v8/table/head/skeleton.json +4 -0
- package/src/v8/table/index.js +26 -0
- package/src/v8/table/skeleton.json +7 -0
- package/src/v9/common/deriveColumnsFromData.js +20 -0
- package/src/v9/index.js +36 -0
- package/src/v9/meta.js +6 -0
- package/src/v9/registerGlobal.js +14 -0
- package/src/v9/select/index.js +21 -0
- package/src/v9/select/options/index.js +17 -0
- package/src/v9/select/options/skeleton.json +17 -0
- package/src/v9/select/skeleton.json +7 -0
- package/src/v9/table/footer/empty/cell/index.js +5 -0
- package/src/v9/table/footer/empty/cell/tag.json +6 -0
- package/src/v9/table/footer/empty/index.js +6 -0
- package/src/v9/table/footer/empty/row/index.js +10 -0
- package/src/v9/table/footer/empty/row/tag.json +7 -0
- package/src/v9/table/footer/index.js +28 -0
- package/src/v9/table/footer/inputs/cell/index.js +15 -0
- package/src/v9/table/footer/inputs/cell/tag.json +7 -0
- package/src/v9/table/footer/inputs/index.js +6 -0
- package/src/v9/table/footer/inputs/input/tag.json +9 -0
- package/src/v9/table/footer/inputs/row/index.js +10 -0
- package/src/v9/table/footer/inputs/row/tag.json +7 -0
- package/src/v9/table/footer/inputsWithSave/button/tag.json +8 -0
- package/src/v9/table/footer/inputsWithSave/cell/index.js +20 -0
- package/src/v9/table/footer/inputsWithSave/cell/tag.json +7 -0
- package/src/v9/table/footer/inputsWithSave/index.js +6 -0
- package/src/v9/table/footer/inputsWithSave/input/tag.json +9 -0
- package/src/v9/table/footer/inputsWithSave/row/index.js +13 -0
- package/src/v9/table/footer/inputsWithSave/row/tag.json +7 -0
- package/src/v9/table/footer/tag.json +7 -0
- package/src/v9/table/footer/totals/cell/index.js +21 -0
- package/src/v9/table/footer/totals/cell/tag.json +7 -0
- package/src/v9/table/footer/totals/index.js +6 -0
- package/src/v9/table/footer/totals/row/index.js +12 -0
- package/src/v9/table/footer/totals/row/tag.json +7 -0
- package/src/v9/table/index.js +33 -0
- package/src/v9/table/options/index.js +18 -0
- package/src/v9/table/options/showOptions/index.js +39 -0
- package/src/v9/table/options/showSerial/index.js +19 -0
- package/src/v9/table/render-requests.json +107 -0
- package/src/v9/table/table/body/cell/index.js +12 -0
- package/src/v9/table/table/body/cell/tag.json +7 -0
- package/src/v9/table/table/body/index.js +17 -0
- package/src/v9/table/table/body/row/index.js +18 -0
- package/src/v9/table/table/body/row/tag.json +4 -0
- package/src/v9/table/table/body/tag.json +4 -0
- package/src/v9/table/table/head/cell/index.js +12 -0
- package/src/v9/table/table/head/cell/tag.json +7 -0
- package/src/v9/table/table/head/index.js +16 -0
- package/src/v9/table/table/head/row/index.js +14 -0
- package/src/v9/table/table/head/row/tag.json +4 -0
- package/src/v9/table/table/head/tag.json +4 -0
- package/src/v9/table/table/index.js +36 -0
- package/src/v9/table/table/tag.json +7 -0
- package/src/v9/table_10oct/body/cells/index.js +17 -0
- package/src/v9/table_10oct/body/cells/skeleton.json +17 -0
- package/src/v9/table_10oct/body/index.js +20 -0
- package/src/v9/table_10oct/body/rows/index.js +23 -0
- package/src/v9/table_10oct/body/rows/skeleton.json +4 -0
- package/src/v9/table_10oct/body/skeleton.json +4 -0
- package/src/v9/table_10oct/head/cells/index.js +17 -0
- package/src/v9/table_10oct/head/cells/skeleton.json +17 -0
- package/src/v9/table_10oct/head/index.js +15 -0
- package/src/v9/table_10oct/head/row/index.js +15 -0
- package/src/v9/table_10oct/head/row/skeleton.json +4 -0
- package/src/v9/table_10oct/head/skeleton.json +4 -0
- package/src/v9/table_10oct/index.js +26 -0
- package/src/v9/table_10oct/skeleton.json +7 -0
package/docs/dist/min.js
CHANGED
|
@@ -1,264 +1,534 @@
|
|
|
1
|
-
const
|
|
2
|
-
version: "
|
|
1
|
+
const $ = {
|
|
2
|
+
version: "v9.0.0",
|
|
3
3
|
description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
|
|
4
4
|
}, N = (t) => {
|
|
5
|
-
var
|
|
6
|
-
typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (
|
|
7
|
-
meta:
|
|
5
|
+
var e;
|
|
6
|
+
typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderersBuild ?? (e.jsonRenderersBuild = {
|
|
7
|
+
meta: $,
|
|
8
8
|
renderToDom: t
|
|
9
9
|
}));
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, D = (t
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
10
|
+
}, C = "table", S = {
|
|
11
|
+
class: "table table-hover table-striped mb-0"
|
|
12
|
+
}, x = [], A = {
|
|
13
|
+
tagName: C,
|
|
14
|
+
attributes: S,
|
|
15
|
+
children: x
|
|
16
|
+
}, E = "thead", w = [], U = {
|
|
17
|
+
tagName: E,
|
|
18
|
+
children: w
|
|
19
|
+
}, v = "tr", T = [], J = {
|
|
20
|
+
tagName: v,
|
|
21
|
+
children: T
|
|
22
|
+
}, W = "th", R = {
|
|
23
|
+
value: ""
|
|
24
|
+
}, k = "", F = {
|
|
25
|
+
tagName: W,
|
|
26
|
+
attributes: R,
|
|
27
|
+
textContent: k
|
|
28
|
+
}, O = ({ inColumn: t } = {}) => {
|
|
29
|
+
const e = structuredClone(F);
|
|
30
|
+
return e.attributes.value = t, e.textContent = t, e;
|
|
31
|
+
}, D = ({ inColumns: t = [] } = {}) => {
|
|
32
|
+
const e = structuredClone(J), n = t.map((o) => O({ inColumn: o }));
|
|
33
|
+
return e.children = n, e;
|
|
34
|
+
}, B = ({ inColumns: t = [] } = {}) => {
|
|
35
|
+
const e = structuredClone(U), n = [
|
|
36
|
+
D({ inColumns: t })
|
|
37
|
+
];
|
|
38
|
+
return e.children = n, e;
|
|
39
|
+
}, j = "tbody", V = [], I = {
|
|
40
|
+
tagName: j,
|
|
41
|
+
children: V
|
|
42
|
+
}, H = "tr", K = [], M = {
|
|
43
|
+
tagName: H,
|
|
44
|
+
children: K
|
|
45
|
+
}, q = "td", G = {
|
|
46
|
+
value: ""
|
|
47
|
+
}, L = "", P = {
|
|
48
|
+
tagName: q,
|
|
49
|
+
attributes: G,
|
|
50
|
+
textContent: L
|
|
51
|
+
}, _ = ({ inValue: t } = {}) => {
|
|
52
|
+
const e = structuredClone(P);
|
|
53
|
+
return e.attributes.value = t, e.textContent = t, e;
|
|
54
|
+
}, z = ({ inRow: t, inColumns: e = [] } = {}) => {
|
|
55
|
+
const n = structuredClone(M), o = e.map((a) => {
|
|
56
|
+
const s = Array.isArray(t) ? t[a] : t == null ? void 0 : t[a];
|
|
57
|
+
return _({ inValue: s });
|
|
58
|
+
});
|
|
59
|
+
return n.children = o, n;
|
|
60
|
+
}, Q = ({ inData: t = [], inColumns: e = [] } = {}) => {
|
|
61
|
+
const n = structuredClone(I), o = t.map((a) => z({
|
|
62
|
+
inRow: a,
|
|
63
|
+
inColumns: e
|
|
64
|
+
}));
|
|
65
|
+
return n.children = o, n;
|
|
66
|
+
}, X = "tfoot", Y = {
|
|
67
|
+
class: "table-light"
|
|
68
|
+
}, Z = [], tt = {
|
|
69
|
+
tagName: X,
|
|
70
|
+
attributes: Y,
|
|
71
|
+
children: Z
|
|
72
|
+
}, et = "tr", nt = {
|
|
73
|
+
class: "align-middle"
|
|
74
|
+
}, ot = [], at = {
|
|
75
|
+
tagName: et,
|
|
76
|
+
attributes: nt,
|
|
77
|
+
children: ot
|
|
78
|
+
}, st = "td", rt = {
|
|
79
|
+
class: "align-middle py-2"
|
|
80
|
+
}, ct = [], lt = {
|
|
81
|
+
tagName: st,
|
|
82
|
+
attributes: rt,
|
|
83
|
+
children: ct
|
|
84
|
+
}, it = "input", ut = {
|
|
85
|
+
type: "text",
|
|
86
|
+
name: "",
|
|
87
|
+
placeholder: "",
|
|
88
|
+
class: "form-control form-control-sm"
|
|
89
|
+
}, dt = {
|
|
90
|
+
tagName: it,
|
|
91
|
+
attributes: ut
|
|
92
|
+
}, mt = ({ inColumn: t } = {}) => {
|
|
93
|
+
const e = structuredClone(lt), n = structuredClone(dt);
|
|
94
|
+
return n.attributes.name = t, n.attributes.placeholder = t, e.children.push(n), e;
|
|
95
|
+
}, bt = ({ inColumns: t = [] } = {}) => {
|
|
96
|
+
const e = structuredClone(at);
|
|
97
|
+
return e.children = t.map((n) => mt({ inColumn: n })), e;
|
|
98
|
+
}, pt = ({ inColumns: t = [] } = {}) => bt({ inColumns: t }), ht = "tr", gt = {
|
|
99
|
+
class: "align-middle"
|
|
100
|
+
}, yt = [], ft = {
|
|
101
|
+
tagName: ht,
|
|
102
|
+
attributes: gt,
|
|
103
|
+
children: yt
|
|
104
|
+
}, $t = "td", Nt = {
|
|
105
|
+
class: "align-middle py-2"
|
|
106
|
+
}, Ct = [], St = {
|
|
107
|
+
tagName: $t,
|
|
108
|
+
attributes: Nt,
|
|
109
|
+
children: Ct
|
|
110
|
+
}, xt = "input", At = {
|
|
111
|
+
type: "text",
|
|
112
|
+
name: "",
|
|
113
|
+
placeholder: "",
|
|
114
|
+
class: "form-control form-control-sm"
|
|
115
|
+
}, Et = {
|
|
116
|
+
tagName: xt,
|
|
117
|
+
attributes: At
|
|
118
|
+
}, wt = "button", Ut = {
|
|
119
|
+
type: "button",
|
|
120
|
+
class: "btn btn-primary btn-sm ms-2"
|
|
121
|
+
}, vt = "Save", Tt = {
|
|
122
|
+
tagName: wt,
|
|
123
|
+
attributes: Ut,
|
|
124
|
+
textContent: vt
|
|
125
|
+
}, Jt = ({ inColumn: t, inSave: e = !1 } = {}) => {
|
|
126
|
+
const n = structuredClone(St), o = structuredClone(Et);
|
|
127
|
+
return o.attributes.name = t, o.attributes.placeholder = t, n.children.push(o), e && n.children.push(structuredClone(Tt)), n;
|
|
128
|
+
}, Wt = ({ inColumns: t = [] } = {}) => {
|
|
129
|
+
const e = structuredClone(ft);
|
|
130
|
+
return e.children = t.map((n, o) => Jt({
|
|
131
|
+
inColumn: n,
|
|
132
|
+
inSave: o === t.length - 1
|
|
133
|
+
})), e;
|
|
134
|
+
}, Rt = ({ inColumns: t = [] } = {}) => Wt({ inColumns: t }), kt = "tr", Ft = {
|
|
135
|
+
class: "fw-semibold align-middle"
|
|
136
|
+
}, Ot = [], Dt = {
|
|
137
|
+
tagName: kt,
|
|
138
|
+
attributes: Ft,
|
|
139
|
+
children: Ot
|
|
140
|
+
}, Bt = "td", jt = {
|
|
141
|
+
class: "align-middle py-2"
|
|
142
|
+
}, Vt = "", It = {
|
|
143
|
+
tagName: Bt,
|
|
144
|
+
attributes: jt,
|
|
145
|
+
textContent: Vt
|
|
146
|
+
}, Ht = (t, e) => Array.isArray(t) ? t[e] : t == null ? void 0 : t[e], Kt = ({ inColumn: t, inIndex: e, inData: n = [] } = {}) => {
|
|
147
|
+
const o = structuredClone(It), a = n.map((s) => Ht(s, t)).filter((s) => s != null && String(s).trim() !== "").map(Number).filter(Number.isFinite);
|
|
148
|
+
return o.textContent = a.length ? String(a.reduce((s, r) => s + r, 0)) : e === 0 ? "Total" : "", o;
|
|
149
|
+
}, Mt = ({ inColumns: t = [], inData: e = [] } = {}) => {
|
|
150
|
+
const n = structuredClone(Dt);
|
|
151
|
+
return n.children = t.map(
|
|
152
|
+
(o, a) => Kt({ inColumn: o, inIndex: a, inData: e })
|
|
153
|
+
), n;
|
|
154
|
+
}, qt = ({ inColumns: t = [], inData: e = [] } = {}) => Mt({ inColumns: t, inData: e }), Gt = "tr", Lt = {
|
|
155
|
+
class: "align-middle"
|
|
156
|
+
}, Pt = [], _t = {
|
|
157
|
+
tagName: Gt,
|
|
158
|
+
attributes: Lt,
|
|
159
|
+
children: Pt
|
|
160
|
+
}, zt = "td", Qt = {
|
|
161
|
+
class: "align-middle py-2"
|
|
162
|
+
}, Xt = {
|
|
163
|
+
tagName: zt,
|
|
164
|
+
attributes: Qt
|
|
165
|
+
}, Yt = () => structuredClone(Xt), Zt = ({ inColumns: t = [] } = {}) => {
|
|
166
|
+
const e = structuredClone(_t);
|
|
167
|
+
return e.children = t.map(() => Yt()), e;
|
|
168
|
+
}, te = ({ inColumns: t = [] } = {}) => Zt({ inColumns: t }), b = {
|
|
169
|
+
inputs: pt,
|
|
170
|
+
inputsWithSave: Rt,
|
|
171
|
+
totals: qt,
|
|
172
|
+
empty: te
|
|
173
|
+
}, ee = ({ inFooter: t = [], inColumns: e = [], inData: n = [] } = {}) => {
|
|
174
|
+
const o = structuredClone(tt);
|
|
175
|
+
return o.children = t.map((a) => {
|
|
176
|
+
if (!Object.hasOwn(b, a))
|
|
177
|
+
throw new Error(`Unknown footer "${a}".`);
|
|
178
|
+
return b[a]({ inColumns: e, inData: n });
|
|
179
|
+
}), o;
|
|
180
|
+
}, ne = ({
|
|
181
|
+
inColumns: t = [],
|
|
182
|
+
inData: e = [],
|
|
183
|
+
inFooter: n = []
|
|
184
|
+
} = {}) => {
|
|
185
|
+
const o = structuredClone(A), a = [
|
|
186
|
+
B({ inColumns: t }),
|
|
187
|
+
Q({ inData: e, inColumns: t })
|
|
188
|
+
];
|
|
189
|
+
if (!Array.isArray(n))
|
|
190
|
+
throw new TypeError("The footer property must be an array of footer names.");
|
|
191
|
+
return n.length > 0 && a.push(ee({
|
|
192
|
+
inFooter: n,
|
|
193
|
+
inColumns: t,
|
|
194
|
+
inData: e
|
|
195
|
+
})), o.children = a, o;
|
|
196
|
+
}, oe = (t) => {
|
|
197
|
+
const [e, n] = t.children;
|
|
198
|
+
e.children[0].children.unshift({
|
|
199
|
+
tagName: "th",
|
|
200
|
+
textContent: "#"
|
|
201
|
+
}), n.children.forEach((o, a) => {
|
|
202
|
+
o.children.unshift({
|
|
203
|
+
tagName: "td",
|
|
204
|
+
textContent: String(a + 1)
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
}, ae = (t) => t === !0 ? [{ label: "Apply", type: "button" }] : Array.isArray(t) ? t : [], se = (t, e) => {
|
|
208
|
+
const n = ae(e);
|
|
209
|
+
if (n.length === 0) return;
|
|
210
|
+
const [o, a] = t.children;
|
|
211
|
+
o.children[0].children.push({
|
|
212
|
+
tagName: "th",
|
|
213
|
+
textContent: "Actions"
|
|
214
|
+
}), a.children.forEach((s) => {
|
|
215
|
+
s.children.push({
|
|
216
|
+
tagName: "td",
|
|
217
|
+
children: n.map((r) => ({
|
|
218
|
+
tagName: "button",
|
|
219
|
+
attributes: { type: r.type || "button" },
|
|
220
|
+
textContent: r.label
|
|
221
|
+
}))
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
}, re = (t, e = {}) => (e.showSerial && oe(t), e.showOptions && se(t, e.showOptions), t), ce = {
|
|
225
|
+
type: "table",
|
|
226
|
+
data: [
|
|
227
|
+
{
|
|
228
|
+
itemName: "0.09/30mm",
|
|
229
|
+
baseUnit: "kgs"
|
|
86
230
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
231
|
+
],
|
|
232
|
+
columns: [
|
|
233
|
+
"itemName",
|
|
234
|
+
"baseUnit"
|
|
235
|
+
],
|
|
236
|
+
options: {}
|
|
237
|
+
}, le = {
|
|
238
|
+
type: "table",
|
|
239
|
+
data: [
|
|
240
|
+
{
|
|
241
|
+
itemName: "0.09/30mm",
|
|
242
|
+
baseUnit: "kgs"
|
|
90
243
|
}
|
|
244
|
+
],
|
|
245
|
+
columns: [
|
|
246
|
+
"itemName",
|
|
247
|
+
"baseUnit"
|
|
248
|
+
],
|
|
249
|
+
options: {
|
|
250
|
+
showSerial: !0
|
|
91
251
|
}
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
252
|
+
}, ie = {
|
|
253
|
+
type: "table",
|
|
254
|
+
data: [
|
|
255
|
+
{
|
|
256
|
+
itemName: "0.09/30mm",
|
|
257
|
+
baseUnit: "kgs"
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
columns: [
|
|
261
|
+
"itemName",
|
|
262
|
+
"baseUnit"
|
|
263
|
+
],
|
|
264
|
+
options: {
|
|
265
|
+
showOptions: !0
|
|
103
266
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
267
|
+
}, ue = {
|
|
268
|
+
type: "table",
|
|
269
|
+
data: [
|
|
270
|
+
{
|
|
271
|
+
itemName: "0.09/30mm",
|
|
272
|
+
baseUnit: "kgs"
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
columns: [
|
|
276
|
+
"itemName",
|
|
277
|
+
"baseUnit"
|
|
278
|
+
],
|
|
279
|
+
options: {
|
|
280
|
+
showOptions: [
|
|
116
281
|
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
{
|
|
120
|
-
tagName: "tr",
|
|
121
|
-
jsonToSpec: {
|
|
122
|
-
operation: "loopCollection",
|
|
123
|
-
source: "columns",
|
|
124
|
-
template: {
|
|
125
|
-
tagName: "th",
|
|
126
|
-
textContent: "${title}"
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
children: []
|
|
130
|
-
}
|
|
131
|
-
]
|
|
282
|
+
label: "Show",
|
|
283
|
+
type: "button"
|
|
132
284
|
},
|
|
133
285
|
{
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
operation: "loopCollection",
|
|
137
|
-
source: "data",
|
|
138
|
-
template: {
|
|
139
|
-
tagName: "tr",
|
|
140
|
-
jsonToSpec: {
|
|
141
|
-
operation: "loopObject",
|
|
142
|
-
source: "data",
|
|
143
|
-
template: {
|
|
144
|
-
tagName: "td",
|
|
145
|
-
textContent: "${value}"
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
children: []
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
children: []
|
|
286
|
+
label: "Edit",
|
|
287
|
+
type: "button"
|
|
152
288
|
}
|
|
153
289
|
]
|
|
154
290
|
}
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
|
|
291
|
+
}, de = {
|
|
292
|
+
type: "table",
|
|
293
|
+
data: [
|
|
294
|
+
{
|
|
295
|
+
itemName: "0.09/30mm",
|
|
296
|
+
baseUnit: "kgs"
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
columns: [
|
|
300
|
+
"itemName",
|
|
301
|
+
"baseUnit"
|
|
302
|
+
],
|
|
303
|
+
options: {
|
|
304
|
+
showSerial: !0,
|
|
305
|
+
showOptions: [
|
|
306
|
+
{
|
|
307
|
+
label: "Show",
|
|
308
|
+
type: "button"
|
|
309
|
+
}
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
}, me = {
|
|
313
|
+
type: "table",
|
|
314
|
+
data: [
|
|
315
|
+
{
|
|
316
|
+
itemName: "0.09/30mm",
|
|
317
|
+
baseUnit: "kgs"
|
|
318
|
+
}
|
|
319
|
+
],
|
|
320
|
+
columns: [
|
|
321
|
+
"itemName",
|
|
322
|
+
"baseUnit"
|
|
323
|
+
],
|
|
324
|
+
footer: [
|
|
325
|
+
"inputs"
|
|
326
|
+
],
|
|
327
|
+
options: {}
|
|
328
|
+
}, be = {
|
|
329
|
+
type: "table",
|
|
330
|
+
data: [
|
|
331
|
+
{
|
|
332
|
+
itemName: "0.09/30mm",
|
|
333
|
+
baseUnit: "kgs"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
columns: [
|
|
337
|
+
"itemName",
|
|
338
|
+
"baseUnit"
|
|
339
|
+
],
|
|
340
|
+
footer: [
|
|
341
|
+
"inputsWithSave"
|
|
342
|
+
],
|
|
343
|
+
options: {}
|
|
344
|
+
}, pe = {
|
|
345
|
+
type: "table",
|
|
346
|
+
data: [
|
|
347
|
+
{
|
|
348
|
+
itemName: "0.09/30mm",
|
|
349
|
+
baseUnit: "2"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
itemName: "0.11-25",
|
|
353
|
+
baseUnit: "3"
|
|
354
|
+
}
|
|
355
|
+
],
|
|
356
|
+
columns: [
|
|
357
|
+
"itemName",
|
|
358
|
+
"baseUnit"
|
|
359
|
+
],
|
|
360
|
+
footer: [
|
|
361
|
+
"totals"
|
|
362
|
+
],
|
|
363
|
+
options: {}
|
|
364
|
+
}, he = {
|
|
365
|
+
type: "table",
|
|
366
|
+
data: [
|
|
367
|
+
{
|
|
368
|
+
itemName: "0.09/30mm",
|
|
369
|
+
baseUnit: "2"
|
|
370
|
+
}
|
|
371
|
+
],
|
|
372
|
+
columns: [
|
|
373
|
+
"itemName",
|
|
374
|
+
"baseUnit"
|
|
375
|
+
],
|
|
376
|
+
footer: [
|
|
377
|
+
"inputs",
|
|
378
|
+
"totals",
|
|
379
|
+
"inputsWithSave",
|
|
380
|
+
"empty"
|
|
381
|
+
],
|
|
382
|
+
options: {}
|
|
383
|
+
}, ge = {
|
|
384
|
+
type: "tableHead",
|
|
385
|
+
data: [],
|
|
386
|
+
columns: [
|
|
387
|
+
"itemName",
|
|
388
|
+
"baseUnit"
|
|
389
|
+
],
|
|
390
|
+
options: {}
|
|
391
|
+
}, ye = {
|
|
392
|
+
type: "tableBody",
|
|
393
|
+
data: [
|
|
394
|
+
{
|
|
395
|
+
itemName: "0.09/30mm",
|
|
396
|
+
baseUnit: "kgs"
|
|
397
|
+
}
|
|
398
|
+
],
|
|
399
|
+
columns: [
|
|
400
|
+
"itemName",
|
|
401
|
+
"baseUnit"
|
|
402
|
+
],
|
|
403
|
+
options: {}
|
|
404
|
+
}, fe = {
|
|
405
|
+
table: ce,
|
|
406
|
+
tableWithSerial: le,
|
|
407
|
+
tableWithDefaultAction: ie,
|
|
408
|
+
tableWithCustomActions: ue,
|
|
409
|
+
tableWithSerialAndActions: de,
|
|
410
|
+
tableWithFooter: me,
|
|
411
|
+
tableWithFooterSave: be,
|
|
412
|
+
tableWithTotals: pe,
|
|
413
|
+
tableWithMultipleFooters: he,
|
|
414
|
+
tableHead: ge,
|
|
415
|
+
tableBody: ye
|
|
416
|
+
}, p = ({
|
|
417
|
+
type: t = "table",
|
|
418
|
+
inData: e,
|
|
419
|
+
inColumns: n,
|
|
420
|
+
footer: o = [],
|
|
421
|
+
options: a = {}
|
|
158
422
|
} = {}) => {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
423
|
+
if (t === "table") {
|
|
424
|
+
const s = ne({
|
|
425
|
+
inColumns: n,
|
|
426
|
+
inData: e,
|
|
427
|
+
inFooter: o
|
|
428
|
+
});
|
|
429
|
+
return re(s, a);
|
|
430
|
+
}
|
|
431
|
+
throw new Error(`Unknown table renderer type "${t}".`);
|
|
432
|
+
};
|
|
433
|
+
p.requests = fe;
|
|
434
|
+
const h = ({ inItems: t, inRecipe: e, inExecute: n }) => {
|
|
435
|
+
const o = t, a = e, s = n;
|
|
436
|
+
return o.map((r) => m({
|
|
437
|
+
inSource: r,
|
|
438
|
+
inRecipe: a,
|
|
439
|
+
inExecute: s
|
|
170
440
|
})).flat(1 / 0).filter(Boolean);
|
|
171
|
-
},
|
|
172
|
-
const
|
|
173
|
-
let
|
|
174
|
-
typeof
|
|
175
|
-
inSource:
|
|
176
|
-
inRecipe:
|
|
441
|
+
}, $e = ({ inSource: t, inRecipe: e, inExecute: n }) => {
|
|
442
|
+
const o = t, a = e, s = n;
|
|
443
|
+
let r = o;
|
|
444
|
+
typeof s == "function" && (r = s({
|
|
445
|
+
inSource: o,
|
|
446
|
+
inRecipe: a
|
|
177
447
|
}));
|
|
178
|
-
for (const [
|
|
179
|
-
Array.isArray(u) &&
|
|
448
|
+
for (const [c, u] of Object.entries(r))
|
|
449
|
+
Array.isArray(u) && a && c in a && (r[c] = h({
|
|
180
450
|
inItems: u,
|
|
181
|
-
inRecipe:
|
|
182
|
-
inExecute:
|
|
451
|
+
inRecipe: a[c],
|
|
452
|
+
inExecute: s
|
|
183
453
|
}));
|
|
184
|
-
return
|
|
185
|
-
},
|
|
186
|
-
const
|
|
187
|
-
return Array.isArray(
|
|
188
|
-
inItems:
|
|
189
|
-
inRecipe:
|
|
190
|
-
inExecute:
|
|
191
|
-
}) : typeof
|
|
192
|
-
inSource:
|
|
193
|
-
inRecipe:
|
|
194
|
-
inExecute:
|
|
195
|
-
}) :
|
|
196
|
-
},
|
|
197
|
-
const
|
|
198
|
-
return (
|
|
199
|
-
},
|
|
200
|
-
const
|
|
201
|
-
return
|
|
202
|
-
inSource:
|
|
203
|
-
inRecipe:
|
|
204
|
-
inExecute:
|
|
205
|
-
}) :
|
|
206
|
-
},
|
|
207
|
-
const
|
|
208
|
-
return (
|
|
209
|
-
},
|
|
210
|
-
const
|
|
211
|
-
return
|
|
212
|
-
},
|
|
213
|
-
const
|
|
214
|
-
for (const [
|
|
215
|
-
if (!(
|
|
454
|
+
return r;
|
|
455
|
+
}, m = ({ inSource: t, inRecipe: e, inExecute: n }) => {
|
|
456
|
+
const o = t, a = e, s = n;
|
|
457
|
+
return Array.isArray(o) ? h({
|
|
458
|
+
inItems: o,
|
|
459
|
+
inRecipe: a,
|
|
460
|
+
inExecute: s
|
|
461
|
+
}) : typeof o == "object" && o !== null ? $e({
|
|
462
|
+
inSource: o,
|
|
463
|
+
inRecipe: a,
|
|
464
|
+
inExecute: s
|
|
465
|
+
}) : o;
|
|
466
|
+
}, Ne = ({ inKey: t, inDirective: e }) => {
|
|
467
|
+
const n = t, o = e;
|
|
468
|
+
return (o == null ? void 0 : o.alterKey) || n;
|
|
469
|
+
}, Ce = ({ inValue: t, inDirective: e, inExecute: n }) => {
|
|
470
|
+
const o = t, a = e, s = n;
|
|
471
|
+
return a && "transform" in a ? m({
|
|
472
|
+
inSource: o,
|
|
473
|
+
inRecipe: a,
|
|
474
|
+
inExecute: s
|
|
475
|
+
}) : o;
|
|
476
|
+
}, Se = ({ inValue: t, inDirective: e }) => {
|
|
477
|
+
const n = t, o = e;
|
|
478
|
+
return (o == null ? void 0 : o.valueType) === "array" && !Array.isArray(n) ? [n] : n;
|
|
479
|
+
}, xe = ({ inValue: t, inDirective: e }) => {
|
|
480
|
+
const n = t, o = e;
|
|
481
|
+
return o != null && o.valueKey && n && typeof n == "object" ? n[o.valueKey] : n;
|
|
482
|
+
}, Ae = ({ inSource: t, inTransform: e, inExecute: n }) => {
|
|
483
|
+
const o = t, a = e, s = n, r = {};
|
|
484
|
+
for (const [c, u] of Object.entries(o)) {
|
|
485
|
+
if (!(c in a))
|
|
216
486
|
continue;
|
|
217
|
-
const
|
|
218
|
-
let
|
|
219
|
-
|
|
220
|
-
inValue:
|
|
221
|
-
inDirective:
|
|
222
|
-
inExecute:
|
|
223
|
-
}),
|
|
487
|
+
const l = a[c], f = Ne({ inKey: c, inDirective: l });
|
|
488
|
+
let i = u;
|
|
489
|
+
i = Ce({
|
|
490
|
+
inValue: i,
|
|
491
|
+
inDirective: l,
|
|
492
|
+
inExecute: s
|
|
493
|
+
}), i = Se({ inValue: i, inDirective: l }), i = xe({ inValue: i, inDirective: l }), r[f] = i;
|
|
224
494
|
}
|
|
225
|
-
return
|
|
495
|
+
return r;
|
|
226
496
|
};
|
|
227
|
-
function
|
|
228
|
-
for (const
|
|
229
|
-
typeof t[
|
|
497
|
+
function g(t, e) {
|
|
498
|
+
for (const n in t)
|
|
499
|
+
typeof t[n] == "object" && t[n] !== null ? g(t[n], e) : typeof t[n] == "string" && t[n] === "${}" && (t[n] = e);
|
|
230
500
|
return t;
|
|
231
501
|
}
|
|
232
|
-
const
|
|
233
|
-
const
|
|
234
|
-
for (const [
|
|
235
|
-
if ("operationType" in
|
|
236
|
-
const
|
|
237
|
-
const
|
|
238
|
-
return
|
|
502
|
+
const Ee = ({ inSource: t, inOperation: e, inExecute: n }) => {
|
|
503
|
+
const o = t, a = e;
|
|
504
|
+
for (const [s, r] of Object.entries(a))
|
|
505
|
+
if ("operationType" in r && r.operationType === "loopArray" && s in o) {
|
|
506
|
+
const c = o[s].map((u) => {
|
|
507
|
+
const l = structuredClone(r == null ? void 0 : r.template);
|
|
508
|
+
return g(l, u), l;
|
|
239
509
|
});
|
|
240
|
-
|
|
510
|
+
o[s] = c;
|
|
241
511
|
}
|
|
242
|
-
return
|
|
243
|
-
},
|
|
244
|
-
let
|
|
245
|
-
const
|
|
246
|
-
return
|
|
247
|
-
inSource:
|
|
248
|
-
inTransform:
|
|
249
|
-
inExecute:
|
|
250
|
-
})),
|
|
251
|
-
inSource:
|
|
252
|
-
inOperation:
|
|
253
|
-
inExecute:
|
|
254
|
-
})),
|
|
255
|
-
},
|
|
512
|
+
return o;
|
|
513
|
+
}, d = ({ inSource: t, inRecipe: e }) => {
|
|
514
|
+
let n = t;
|
|
515
|
+
const o = e;
|
|
516
|
+
return o && typeof o == "object" && "transform" in o && (n = Ae({
|
|
517
|
+
inSource: n,
|
|
518
|
+
inTransform: o.transform,
|
|
519
|
+
inExecute: d
|
|
520
|
+
})), o && typeof o == "object" && "operation" in o && (n = Ee({
|
|
521
|
+
inSource: n,
|
|
522
|
+
inOperation: o.operation,
|
|
523
|
+
inExecute: d
|
|
524
|
+
})), n;
|
|
525
|
+
}, we = (t, e) => m({
|
|
256
526
|
inSource: t,
|
|
257
|
-
inRecipe:
|
|
258
|
-
inExecute:
|
|
259
|
-
}),
|
|
527
|
+
inRecipe: e,
|
|
528
|
+
inExecute: d
|
|
529
|
+
}), Ue = {
|
|
260
530
|
children: ""
|
|
261
|
-
},
|
|
531
|
+
}, ve = {
|
|
262
532
|
children: {
|
|
263
533
|
operationType: "loopArray",
|
|
264
534
|
template: {
|
|
@@ -269,44 +539,49 @@ const _ = ({ inSource: t, inOperation: r, inExecute: e }) => {
|
|
|
269
539
|
textContent: "${}"
|
|
270
540
|
}
|
|
271
541
|
}
|
|
272
|
-
},
|
|
273
|
-
transform:
|
|
274
|
-
operation:
|
|
275
|
-
},
|
|
542
|
+
}, Te = {
|
|
543
|
+
transform: Ue,
|
|
544
|
+
operation: ve
|
|
545
|
+
}, y = ({
|
|
276
546
|
inData: t
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
547
|
+
}) => {
|
|
548
|
+
let n = we({
|
|
549
|
+
children: t
|
|
550
|
+
}, Te);
|
|
551
|
+
return n == null ? void 0 : n.children;
|
|
552
|
+
}, Je = "select", We = {
|
|
280
553
|
id: "LedgerName"
|
|
281
|
-
},
|
|
282
|
-
tagName:
|
|
283
|
-
attributes:
|
|
284
|
-
children:
|
|
285
|
-
},
|
|
554
|
+
}, Re = [], ke = {
|
|
555
|
+
tagName: Je,
|
|
556
|
+
attributes: We,
|
|
557
|
+
children: Re
|
|
558
|
+
}, Fe = ({
|
|
286
559
|
inData: t
|
|
287
|
-
}
|
|
288
|
-
let
|
|
289
|
-
inData: t
|
|
560
|
+
}) => {
|
|
561
|
+
let n = y({
|
|
562
|
+
inData: t
|
|
290
563
|
});
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
564
|
+
const o = structuredClone(ke);
|
|
565
|
+
return o.children = n, o;
|
|
566
|
+
}, Oe = {
|
|
567
|
+
table: p,
|
|
568
|
+
select: Fe,
|
|
569
|
+
selectOptionsOnly: y
|
|
570
|
+
}, De = ({
|
|
297
571
|
type: t = "table",
|
|
298
|
-
data:
|
|
299
|
-
columns:
|
|
300
|
-
}
|
|
301
|
-
const
|
|
302
|
-
return
|
|
303
|
-
inColumns:
|
|
304
|
-
inData:
|
|
305
|
-
})
|
|
306
|
-
`[Renderer] Unknown renderer type "${n}". Available types: ${Object.keys(p).join(", ")}`
|
|
307
|
-
), null);
|
|
572
|
+
data: e,
|
|
573
|
+
columns: n
|
|
574
|
+
}) => {
|
|
575
|
+
const a = Oe[t];
|
|
576
|
+
return a({
|
|
577
|
+
inColumns: n,
|
|
578
|
+
inData: e
|
|
579
|
+
});
|
|
308
580
|
};
|
|
309
|
-
N(
|
|
581
|
+
N(De);
|
|
310
582
|
export {
|
|
311
|
-
|
|
583
|
+
De as default,
|
|
584
|
+
Fe as renderSelect,
|
|
585
|
+
y as renderSelectOptions,
|
|
586
|
+
p as renderTable
|
|
312
587
|
};
|