json-renderers-build 1.7.1 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +8 -4
  2. package/docs/dist/min.js +541 -266
  3. package/docs/dist/v4/min.js +320 -320
  4. package/docs/dist/v5/min.js +312 -312
  5. package/docs/dist/v7/min.js +272 -0
  6. package/docs/dist/v8/min.js +268 -0
  7. package/docs/dist/v9/min.js +587 -0
  8. package/docs/index.html +2 -2
  9. package/package.json +1 -1
  10. package/src/index.js +2 -2
  11. package/src/v7/index.js +47 -47
  12. package/src/v7/select/index.js +20 -20
  13. package/src/v7/select/options/index.js +17 -17
  14. package/src/v7/select/options/skeleton.json +17 -17
  15. package/src/v7/table/body/cells/index.js +23 -23
  16. package/src/v7/table/body/cells/skeleton.json +17 -17
  17. package/src/v7/table/body/index.js +15 -15
  18. package/src/v7/table/body/rows/index.js +36 -36
  19. package/src/v7/table/body/rows/skeleton.json +4 -4
  20. package/src/v7/table/body/skeleton.json +4 -4
  21. package/src/v7/table/head/cells/index.js +23 -23
  22. package/src/v7/table/head/cells/skeleton.json +17 -17
  23. package/src/v7/table/head/index.js +15 -15
  24. package/src/v7/table/head/row/index.js +15 -15
  25. package/src/v7/table/head/row/skeleton.json +4 -4
  26. package/src/v7/table/head/skeleton.json +4 -4
  27. package/src/v7/table/index.js +26 -26
  28. package/src/v7/table/skeleton.json +6 -6
  29. package/src/v8/common/deriveColumnsFromData.js +20 -0
  30. package/src/v8/index.js +40 -0
  31. package/src/v8/meta.js +6 -0
  32. package/src/v8/registerGlobal.js +14 -0
  33. package/src/v8/select/index.js +21 -0
  34. package/src/v8/select/options/index.js +17 -0
  35. package/src/v8/select/options/skeleton.json +17 -0
  36. package/src/v8/select/skeleton.json +7 -0
  37. package/src/v8/table/body/cells/index.js +17 -0
  38. package/src/v8/table/body/cells/skeleton.json +17 -0
  39. package/src/v8/table/body/index.js +20 -0
  40. package/src/v8/table/body/rows/index.js +23 -0
  41. package/src/v8/table/body/rows/skeleton.json +4 -0
  42. package/src/v8/table/body/skeleton.json +4 -0
  43. package/src/v8/table/head/cells/index.js +17 -0
  44. package/src/v8/table/head/cells/skeleton.json +17 -0
  45. package/src/v8/table/head/index.js +15 -0
  46. package/src/v8/table/head/row/index.js +15 -0
  47. package/src/v8/table/head/row/skeleton.json +4 -0
  48. package/src/v8/table/head/skeleton.json +4 -0
  49. package/src/v8/table/index.js +26 -0
  50. package/src/v8/table/skeleton.json +7 -0
  51. package/src/v9/common/deriveColumnsFromData.js +20 -0
  52. package/src/v9/index.js +36 -0
  53. package/src/v9/meta.js +6 -0
  54. package/src/v9/registerGlobal.js +14 -0
  55. package/src/v9/select/index.js +21 -0
  56. package/src/v9/select/options/index.js +17 -0
  57. package/src/v9/select/options/skeleton.json +17 -0
  58. package/src/v9/select/skeleton.json +7 -0
  59. package/src/v9/table/footer/empty/cell/index.js +5 -0
  60. package/src/v9/table/footer/empty/cell/tag.json +6 -0
  61. package/src/v9/table/footer/empty/index.js +6 -0
  62. package/src/v9/table/footer/empty/row/index.js +10 -0
  63. package/src/v9/table/footer/empty/row/tag.json +7 -0
  64. package/src/v9/table/footer/index.js +28 -0
  65. package/src/v9/table/footer/inputs/cell/index.js +15 -0
  66. package/src/v9/table/footer/inputs/cell/tag.json +7 -0
  67. package/src/v9/table/footer/inputs/index.js +6 -0
  68. package/src/v9/table/footer/inputs/input/tag.json +9 -0
  69. package/src/v9/table/footer/inputs/row/index.js +10 -0
  70. package/src/v9/table/footer/inputs/row/tag.json +7 -0
  71. package/src/v9/table/footer/inputsWithSave/button/tag.json +8 -0
  72. package/src/v9/table/footer/inputsWithSave/cell/index.js +20 -0
  73. package/src/v9/table/footer/inputsWithSave/cell/tag.json +7 -0
  74. package/src/v9/table/footer/inputsWithSave/index.js +6 -0
  75. package/src/v9/table/footer/inputsWithSave/input/tag.json +9 -0
  76. package/src/v9/table/footer/inputsWithSave/row/index.js +13 -0
  77. package/src/v9/table/footer/inputsWithSave/row/tag.json +7 -0
  78. package/src/v9/table/footer/tag.json +7 -0
  79. package/src/v9/table/footer/totals/cell/index.js +21 -0
  80. package/src/v9/table/footer/totals/cell/tag.json +7 -0
  81. package/src/v9/table/footer/totals/index.js +6 -0
  82. package/src/v9/table/footer/totals/row/index.js +12 -0
  83. package/src/v9/table/footer/totals/row/tag.json +7 -0
  84. package/src/v9/table/index.js +33 -0
  85. package/src/v9/table/options/index.js +18 -0
  86. package/src/v9/table/options/showOptions/index.js +39 -0
  87. package/src/v9/table/options/showSerial/index.js +19 -0
  88. package/src/v9/table/render-requests.json +107 -0
  89. package/src/v9/table/table/body/cell/index.js +12 -0
  90. package/src/v9/table/table/body/cell/tag.json +7 -0
  91. package/src/v9/table/table/body/index.js +17 -0
  92. package/src/v9/table/table/body/row/index.js +18 -0
  93. package/src/v9/table/table/body/row/tag.json +4 -0
  94. package/src/v9/table/table/body/tag.json +4 -0
  95. package/src/v9/table/table/head/cell/index.js +12 -0
  96. package/src/v9/table/table/head/cell/tag.json +7 -0
  97. package/src/v9/table/table/head/index.js +16 -0
  98. package/src/v9/table/table/head/row/index.js +14 -0
  99. package/src/v9/table/table/head/row/tag.json +4 -0
  100. package/src/v9/table/table/head/tag.json +4 -0
  101. package/src/v9/table/table/index.js +36 -0
  102. package/src/v9/table/table/tag.json +7 -0
  103. package/src/v9/table_10oct/body/cells/index.js +17 -0
  104. package/src/v9/table_10oct/body/cells/skeleton.json +17 -0
  105. package/src/v9/table_10oct/body/index.js +20 -0
  106. package/src/v9/table_10oct/body/rows/index.js +23 -0
  107. package/src/v9/table_10oct/body/rows/skeleton.json +4 -0
  108. package/src/v9/table_10oct/body/skeleton.json +4 -0
  109. package/src/v9/table_10oct/head/cells/index.js +17 -0
  110. package/src/v9/table_10oct/head/cells/skeleton.json +17 -0
  111. package/src/v9/table_10oct/head/index.js +15 -0
  112. package/src/v9/table_10oct/head/row/index.js +15 -0
  113. package/src/v9/table_10oct/head/row/skeleton.json +4 -0
  114. package/src/v9/table_10oct/head/skeleton.json +4 -0
  115. package/src/v9/table_10oct/index.js +26 -0
  116. package/src/v9/table_10oct/skeleton.json +7 -0
@@ -1,312 +1,312 @@
1
- const E = {
2
- version: "v4.0.0",
3
- description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
4
- }, N = (t) => {
5
- var r;
6
- typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (r = globalThis.ks).jsonRenderersBuild ?? (r.jsonRenderersBuild = {
7
- meta: E,
8
- renderToDom: t
9
- }));
10
- }, x = {
11
- version: "v32",
12
- description: "JSON-to-DOM engine with centralized traversal and responsibility-focused construction"
13
- }, F = ({ inFuncDefinition: t } = {}) => {
14
- if (typeof globalThis > "u" || !t) return;
15
- globalThis.ks ?? (globalThis.ks = {});
16
- const r = {
17
- meta: x,
18
- buildSpecElement: t
19
- };
20
- globalThis.ks.jsonToSpec = r;
21
- }, O = (t, r) => f(t, r), b = (t, r) => Array.isArray(t) ? t.map((e) => O(e, r)).flat(1 / 0).filter(Boolean) : [], R = (t, r) => {
22
- if ("source" in t && (t == null ? void 0 : t.source) in r) {
23
- const e = r[t == null ? void 0 : t.source];
24
- if (Array.isArray(e))
25
- return e.map((o) => {
26
- const c = t == null ? void 0 : t.template;
27
- if (c)
28
- return f(c, o);
29
- });
30
- }
31
- }, D = (t, r) => {
32
- let e = [];
33
- for (const [n, o] of Object.entries(r)) {
34
- const c = t == null ? void 0 : t.template;
35
- if (c) {
36
- const l = f(c, {
37
- key: n,
38
- value: o
39
- });
40
- e.push(l);
41
- }
42
- }
43
- return e;
44
- }, k = (t, r) => {
45
- if ("source" in t && (t == null ? void 0 : t.source) in r) {
46
- const e = r[t == null ? void 0 : t.source];
47
- if (Array.isArray(e))
48
- return e.map((o) => {
49
- const c = t == null ? void 0 : t.template;
50
- if (c)
51
- return f(c, o);
52
- });
53
- }
54
- }, C = (t, r) => {
55
- if ("operation" in t) {
56
- if (t.operation === "loopArray")
57
- return R(t, r);
58
- if (t.operation === "loopObject")
59
- return D(t, r);
60
- if (t.operation === "loopCollection")
61
- return k(t, r);
62
- }
63
- }, A = (t, r) => {
64
- if (typeof r == "string") return r;
65
- if (typeof t != "string") return t;
66
- if (t === "${value}")
67
- return r.value;
68
- const e = t.match(/^\$\{(.+?)\}$/);
69
- if (e) {
70
- const n = e[1];
71
- return (r == null ? void 0 : r[n]) ?? "";
72
- }
73
- return t;
74
- }, w = (t, r) => {
75
- let e = {};
76
- for (const [n, o] of Object.entries(t)) {
77
- const c = A(o, r);
78
- e[n] = c;
79
- }
80
- return e;
81
- }, V = (t, r) => {
82
- if ("tagName" in t) {
83
- if ("textContent" in t) {
84
- const e = A(t.textContent, r);
85
- t.textContent = e;
86
- }
87
- if ("attributes" in t) {
88
- const e = w(t.attributes, r);
89
- t.attributes = e;
90
- }
91
- }
92
- }, I = (t, r) => {
93
- if (!t || typeof t != "object" || Array.isArray(t)) return null;
94
- const e = structuredClone(t);
95
- if (!e) return null;
96
- if ("tagName" in e && V(e, r), "jsonToSpec" in e) {
97
- const n = e == null ? void 0 : e.jsonToSpec, o = C(n, r);
98
- Array.isArray(o) ? e.children = o : e.children = [o], delete e.jsonToSpec;
99
- }
100
- if (Array.isArray(e == null ? void 0 : e.children)) {
101
- const n = b(e == null ? void 0 : e.children, r);
102
- e.children = n;
103
- }
104
- return e;
105
- }, f = (t, r) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? b(t, r) : typeof t == "object" ? I(t, r) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : t, $ = (t, r) => f(t, r);
106
- F({
107
- inFuncDefinition: $
108
- });
109
- const K = {
110
- default: {
111
- tagName: "table",
112
- attributes: {
113
- class: "table table-hover table-striped mb-0"
114
- },
115
- children: [
116
- {
117
- tagName: "thead",
118
- children: [
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
- ]
132
- },
133
- {
134
- tagName: "tbody",
135
- jsonToSpec: {
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: []
152
- }
153
- ]
154
- }
155
- }, B = ({
156
- inColumns: t,
157
- inData: r
158
- } = {}) => {
159
- const e = r ?? [], n = t;
160
- return $(K.default, {
161
- columns: n,
162
- data: e
163
- });
164
- }, h = ({ inItems: t, inRecipe: r, inExecute: e }) => {
165
- const n = t, o = r, c = e;
166
- return n.map((l) => y({
167
- inSource: l,
168
- inRecipe: o,
169
- inExecute: c
170
- })).flat(1 / 0).filter(Boolean);
171
- }, M = ({ inSource: t, inRecipe: r, inExecute: e }) => {
172
- const n = t, o = r, c = e;
173
- let l = n;
174
- typeof c == "function" && (l = c({
175
- inSource: n,
176
- inRecipe: o
177
- }));
178
- for (const [a, u] of Object.entries(l))
179
- Array.isArray(u) && o && a in o && (l[a] = h({
180
- inItems: u,
181
- inRecipe: o[a],
182
- inExecute: c
183
- }));
184
- return l;
185
- }, y = ({ inSource: t, inRecipe: r, inExecute: e }) => {
186
- const n = t, o = r, c = e;
187
- return Array.isArray(n) ? h({
188
- inItems: n,
189
- inRecipe: o,
190
- inExecute: c
191
- }) : typeof n == "object" && n !== null ? M({
192
- inSource: n,
193
- inRecipe: o,
194
- inExecute: c
195
- }) : n;
196
- }, G = ({ inKey: t, inDirective: r }) => {
197
- const e = t, n = r;
198
- return (n == null ? void 0 : n.alterKey) || e;
199
- }, z = ({ inValue: t, inDirective: r, inExecute: e }) => {
200
- const n = t, o = r, c = e;
201
- return o && "transform" in o ? y({
202
- inSource: n,
203
- inRecipe: o,
204
- inExecute: c
205
- }) : n;
206
- }, L = ({ inValue: t, inDirective: r }) => {
207
- const e = t, n = r;
208
- return (n == null ? void 0 : n.valueType) === "array" && !Array.isArray(e) ? [e] : e;
209
- }, P = ({ inValue: t, inDirective: r }) => {
210
- const e = t, n = r;
211
- return n != null && n.valueKey && e && typeof e == "object" ? e[n.valueKey] : e;
212
- }, U = ({ inSource: t, inTransform: r, inExecute: e }) => {
213
- const n = t, o = r, c = e, l = {};
214
- for (const [a, u] of Object.entries(n)) {
215
- if (!(a in o))
216
- continue;
217
- const i = o[a], j = G({ inKey: a, inDirective: i });
218
- let s = u;
219
- s = z({
220
- inValue: s,
221
- inDirective: i,
222
- inExecute: c
223
- }), s = L({ inValue: s, inDirective: i }), s = P({ inValue: s, inDirective: i }), l[j] = s;
224
- }
225
- return l;
226
- };
227
- function v(t, r) {
228
- for (const e in t)
229
- typeof t[e] == "object" && t[e] !== null ? v(t[e], r) : typeof t[e] == "string" && t[e] === "${}" && (t[e] = r);
230
- return t;
231
- }
232
- const _ = ({ inSource: t, inOperation: r, inExecute: e }) => {
233
- const n = t, o = r;
234
- for (const [c, l] of Object.entries(o))
235
- if ("operationType" in l && l.operationType === "loopArray" && c in n) {
236
- const a = n[c].map((u) => {
237
- const i = { ...l == null ? void 0 : l.template };
238
- return v(i, u), i;
239
- });
240
- n[c] = a;
241
- }
242
- return n;
243
- }, m = ({ inSource: t, inRecipe: r }) => {
244
- let e = t;
245
- const n = r;
246
- return n && typeof n == "object" && "transform" in n && (e = U({
247
- inSource: e,
248
- inTransform: n.transform,
249
- inExecute: m
250
- })), n && typeof n == "object" && "operation" in n && (e = _({
251
- inSource: e,
252
- inOperation: n.operation,
253
- inExecute: m
254
- })), e;
255
- }, q = (t, r) => y({
256
- inSource: t,
257
- inRecipe: r,
258
- inExecute: m
259
- }), H = {
260
- children: ""
261
- }, Q = {
262
- children: {
263
- operationType: "loopArray",
264
- template: {
265
- tagName: "option",
266
- attributes: {
267
- value: "${}"
268
- },
269
- textContent: "${}"
270
- }
271
- }
272
- }, W = {
273
- transform: H,
274
- operation: Q
275
- }, g = ({
276
- inData: t
277
- } = {}) => q({
278
- children: t ?? []
279
- }, W), X = "select", Y = {
280
- id: "LedgerName"
281
- }, Z = [], d = {
282
- tagName: X,
283
- attributes: Y,
284
- children: Z
285
- }, T = ({
286
- inData: t
287
- } = {}) => {
288
- let e = g({
289
- inData: t ?? []
290
- });
291
- return d.children = e == null ? void 0 : e.children, d;
292
- }, p = {
293
- table: B,
294
- select: T,
295
- selectOptionsOnly: g
296
- }, S = ({
297
- type: t = "table",
298
- data: r,
299
- columns: e
300
- } = {}) => {
301
- const n = t, o = p[n];
302
- return o ? o({
303
- inColumns: e,
304
- inData: r
305
- }) : (console.error(
306
- `[Renderer] Unknown renderer type "${n}". Available types: ${Object.keys(p).join(", ")}`
307
- ), null);
308
- };
309
- N(S);
310
- export {
311
- S as default
312
- };
1
+ const E = {
2
+ version: "v4.0.0",
3
+ description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
4
+ }, N = (t) => {
5
+ var r;
6
+ typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (r = globalThis.ks).jsonRenderersBuild ?? (r.jsonRenderersBuild = {
7
+ meta: E,
8
+ renderToDom: t
9
+ }));
10
+ }, x = {
11
+ version: "v32",
12
+ description: "JSON-to-DOM engine with centralized traversal and responsibility-focused construction"
13
+ }, F = ({ inFuncDefinition: t } = {}) => {
14
+ if (typeof globalThis > "u" || !t) return;
15
+ globalThis.ks ?? (globalThis.ks = {});
16
+ const r = {
17
+ meta: x,
18
+ buildSpecElement: t
19
+ };
20
+ globalThis.ks.jsonToSpec = r;
21
+ }, O = (t, r) => f(t, r), b = (t, r) => Array.isArray(t) ? t.map((e) => O(e, r)).flat(1 / 0).filter(Boolean) : [], R = (t, r) => {
22
+ if ("source" in t && (t == null ? void 0 : t.source) in r) {
23
+ const e = r[t == null ? void 0 : t.source];
24
+ if (Array.isArray(e))
25
+ return e.map((o) => {
26
+ const c = t == null ? void 0 : t.template;
27
+ if (c)
28
+ return f(c, o);
29
+ });
30
+ }
31
+ }, D = (t, r) => {
32
+ let e = [];
33
+ for (const [n, o] of Object.entries(r)) {
34
+ const c = t == null ? void 0 : t.template;
35
+ if (c) {
36
+ const l = f(c, {
37
+ key: n,
38
+ value: o
39
+ });
40
+ e.push(l);
41
+ }
42
+ }
43
+ return e;
44
+ }, k = (t, r) => {
45
+ if ("source" in t && (t == null ? void 0 : t.source) in r) {
46
+ const e = r[t == null ? void 0 : t.source];
47
+ if (Array.isArray(e))
48
+ return e.map((o) => {
49
+ const c = t == null ? void 0 : t.template;
50
+ if (c)
51
+ return f(c, o);
52
+ });
53
+ }
54
+ }, C = (t, r) => {
55
+ if ("operation" in t) {
56
+ if (t.operation === "loopArray")
57
+ return R(t, r);
58
+ if (t.operation === "loopObject")
59
+ return D(t, r);
60
+ if (t.operation === "loopCollection")
61
+ return k(t, r);
62
+ }
63
+ }, A = (t, r) => {
64
+ if (typeof r == "string") return r;
65
+ if (typeof t != "string") return t;
66
+ if (t === "${value}")
67
+ return r.value;
68
+ const e = t.match(/^\$\{(.+?)\}$/);
69
+ if (e) {
70
+ const n = e[1];
71
+ return (r == null ? void 0 : r[n]) ?? "";
72
+ }
73
+ return t;
74
+ }, w = (t, r) => {
75
+ let e = {};
76
+ for (const [n, o] of Object.entries(t)) {
77
+ const c = A(o, r);
78
+ e[n] = c;
79
+ }
80
+ return e;
81
+ }, V = (t, r) => {
82
+ if ("tagName" in t) {
83
+ if ("textContent" in t) {
84
+ const e = A(t.textContent, r);
85
+ t.textContent = e;
86
+ }
87
+ if ("attributes" in t) {
88
+ const e = w(t.attributes, r);
89
+ t.attributes = e;
90
+ }
91
+ }
92
+ }, I = (t, r) => {
93
+ if (!t || typeof t != "object" || Array.isArray(t)) return null;
94
+ const e = structuredClone(t);
95
+ if (!e) return null;
96
+ if ("tagName" in e && V(e, r), "jsonToSpec" in e) {
97
+ const n = e == null ? void 0 : e.jsonToSpec, o = C(n, r);
98
+ Array.isArray(o) ? e.children = o : e.children = [o], delete e.jsonToSpec;
99
+ }
100
+ if (Array.isArray(e == null ? void 0 : e.children)) {
101
+ const n = b(e == null ? void 0 : e.children, r);
102
+ e.children = n;
103
+ }
104
+ return e;
105
+ }, f = (t, r) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? b(t, r) : typeof t == "object" ? I(t, r) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : t, $ = (t, r) => f(t, r);
106
+ F({
107
+ inFuncDefinition: $
108
+ });
109
+ const K = {
110
+ default: {
111
+ tagName: "table",
112
+ attributes: {
113
+ class: "table table-hover table-striped mb-0"
114
+ },
115
+ children: [
116
+ {
117
+ tagName: "thead",
118
+ children: [
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
+ ]
132
+ },
133
+ {
134
+ tagName: "tbody",
135
+ jsonToSpec: {
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: []
152
+ }
153
+ ]
154
+ }
155
+ }, B = ({
156
+ inColumns: t,
157
+ inData: r
158
+ } = {}) => {
159
+ const e = r ?? [], n = t;
160
+ return $(K.default, {
161
+ columns: n,
162
+ data: e
163
+ });
164
+ }, h = ({ inItems: t, inRecipe: r, inExecute: e }) => {
165
+ const n = t, o = r, c = e;
166
+ return n.map((l) => y({
167
+ inSource: l,
168
+ inRecipe: o,
169
+ inExecute: c
170
+ })).flat(1 / 0).filter(Boolean);
171
+ }, M = ({ inSource: t, inRecipe: r, inExecute: e }) => {
172
+ const n = t, o = r, c = e;
173
+ let l = n;
174
+ typeof c == "function" && (l = c({
175
+ inSource: n,
176
+ inRecipe: o
177
+ }));
178
+ for (const [a, u] of Object.entries(l))
179
+ Array.isArray(u) && o && a in o && (l[a] = h({
180
+ inItems: u,
181
+ inRecipe: o[a],
182
+ inExecute: c
183
+ }));
184
+ return l;
185
+ }, y = ({ inSource: t, inRecipe: r, inExecute: e }) => {
186
+ const n = t, o = r, c = e;
187
+ return Array.isArray(n) ? h({
188
+ inItems: n,
189
+ inRecipe: o,
190
+ inExecute: c
191
+ }) : typeof n == "object" && n !== null ? M({
192
+ inSource: n,
193
+ inRecipe: o,
194
+ inExecute: c
195
+ }) : n;
196
+ }, G = ({ inKey: t, inDirective: r }) => {
197
+ const e = t, n = r;
198
+ return (n == null ? void 0 : n.alterKey) || e;
199
+ }, z = ({ inValue: t, inDirective: r, inExecute: e }) => {
200
+ const n = t, o = r, c = e;
201
+ return o && "transform" in o ? y({
202
+ inSource: n,
203
+ inRecipe: o,
204
+ inExecute: c
205
+ }) : n;
206
+ }, L = ({ inValue: t, inDirective: r }) => {
207
+ const e = t, n = r;
208
+ return (n == null ? void 0 : n.valueType) === "array" && !Array.isArray(e) ? [e] : e;
209
+ }, P = ({ inValue: t, inDirective: r }) => {
210
+ const e = t, n = r;
211
+ return n != null && n.valueKey && e && typeof e == "object" ? e[n.valueKey] : e;
212
+ }, U = ({ inSource: t, inTransform: r, inExecute: e }) => {
213
+ const n = t, o = r, c = e, l = {};
214
+ for (const [a, u] of Object.entries(n)) {
215
+ if (!(a in o))
216
+ continue;
217
+ const i = o[a], j = G({ inKey: a, inDirective: i });
218
+ let s = u;
219
+ s = z({
220
+ inValue: s,
221
+ inDirective: i,
222
+ inExecute: c
223
+ }), s = L({ inValue: s, inDirective: i }), s = P({ inValue: s, inDirective: i }), l[j] = s;
224
+ }
225
+ return l;
226
+ };
227
+ function v(t, r) {
228
+ for (const e in t)
229
+ typeof t[e] == "object" && t[e] !== null ? v(t[e], r) : typeof t[e] == "string" && t[e] === "${}" && (t[e] = r);
230
+ return t;
231
+ }
232
+ const _ = ({ inSource: t, inOperation: r, inExecute: e }) => {
233
+ const n = t, o = r;
234
+ for (const [c, l] of Object.entries(o))
235
+ if ("operationType" in l && l.operationType === "loopArray" && c in n) {
236
+ const a = n[c].map((u) => {
237
+ const i = { ...l == null ? void 0 : l.template };
238
+ return v(i, u), i;
239
+ });
240
+ n[c] = a;
241
+ }
242
+ return n;
243
+ }, m = ({ inSource: t, inRecipe: r }) => {
244
+ let e = t;
245
+ const n = r;
246
+ return n && typeof n == "object" && "transform" in n && (e = U({
247
+ inSource: e,
248
+ inTransform: n.transform,
249
+ inExecute: m
250
+ })), n && typeof n == "object" && "operation" in n && (e = _({
251
+ inSource: e,
252
+ inOperation: n.operation,
253
+ inExecute: m
254
+ })), e;
255
+ }, q = (t, r) => y({
256
+ inSource: t,
257
+ inRecipe: r,
258
+ inExecute: m
259
+ }), H = {
260
+ children: ""
261
+ }, Q = {
262
+ children: {
263
+ operationType: "loopArray",
264
+ template: {
265
+ tagName: "option",
266
+ attributes: {
267
+ value: "${}"
268
+ },
269
+ textContent: "${}"
270
+ }
271
+ }
272
+ }, W = {
273
+ transform: H,
274
+ operation: Q
275
+ }, g = ({
276
+ inData: t
277
+ } = {}) => q({
278
+ children: t ?? []
279
+ }, W), X = "select", Y = {
280
+ id: "LedgerName"
281
+ }, Z = [], d = {
282
+ tagName: X,
283
+ attributes: Y,
284
+ children: Z
285
+ }, T = ({
286
+ inData: t
287
+ } = {}) => {
288
+ let e = g({
289
+ inData: t ?? []
290
+ });
291
+ return d.children = e == null ? void 0 : e.children, d;
292
+ }, p = {
293
+ table: B,
294
+ select: T,
295
+ selectOptionsOnly: g
296
+ }, S = ({
297
+ type: t = "table",
298
+ data: r,
299
+ columns: e
300
+ } = {}) => {
301
+ const n = t, o = p[n];
302
+ return o ? o({
303
+ inColumns: e,
304
+ inData: r
305
+ }) : (console.error(
306
+ `[Renderer] Unknown renderer type "${n}". Available types: ${Object.keys(p).join(", ")}`
307
+ ), null);
308
+ };
309
+ N(S);
310
+ export {
311
+ S as default
312
+ };