json-renderers 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.
Files changed (168) hide show
  1. package/README.md +128 -0
  2. package/docs/dist/v4/min.js +791 -0
  3. package/docs/dist/v5/min.js +800 -0
  4. package/docs/dist/v6/min.js +854 -0
  5. package/docs/dist/v8/min.js +1787 -0
  6. package/docs/dist/v9/min.js +1032 -0
  7. package/package.json +36 -0
  8. package/src/index.js +2 -0
  9. package/src/v5/dataLists/fragments.json +1 -0
  10. package/src/v5/dataLists/index.js +26 -0
  11. package/src/v5/dataLists/skeleton.json +20 -0
  12. package/src/v5/form/attachFormClickEventListener.js +27 -0
  13. package/src/v5/form/clickFunc/extractFormData.js +27 -0
  14. package/src/v5/form/clickFunc/handleNew.js +24 -0
  15. package/src/v5/form/clickFunc/handleSave.js +33 -0
  16. package/src/v5/form/clickFunc/index.js +32 -0
  17. package/src/v5/form/index.js +87 -0
  18. package/src/v5/form/structure.json +410 -0
  19. package/src/v5/index.js +150 -0
  20. package/src/v5/meta.js +6 -0
  21. package/src/v5/navTabs/fragments.json +59 -0
  22. package/src/v5/navTabs/index.js +82 -0
  23. package/src/v5/navTabs/skeleton.json +18 -0
  24. package/src/v5/registerGlobal.js +14 -0
  25. package/src/v5/select/fragments.json +1 -0
  26. package/src/v5/select/index.js +31 -0
  27. package/src/v5/select/skeleton.json +21 -0
  28. package/src/v5/table/attachTableClickEventListener.js +22 -0
  29. package/src/v5/table/buildTableDataAsJson.js +19 -0
  30. package/src/v5/table/buildTableDomElement.js +21 -0
  31. package/src/v5/table/buildTableStructureSpec.js +28 -0
  32. package/src/v5/table/clickFunc/v3/createTable.js +16 -0
  33. package/src/v5/table/clickFunc/v3/getContainer/extractClickedRowDetails.js +23 -0
  34. package/src/v5/table/clickFunc/v3/getContainer/getOrCreateChildTableContainer.js +21 -0
  35. package/src/v5/table/clickFunc/v3/getContainer/index.js +39 -0
  36. package/src/v5/table/clickFunc/v3/getContainer/isSameRowClickedToToggleOff.js +14 -0
  37. package/src/v5/table/clickFunc/v3/getContainer/resetAndShowChildTableContainer.js +12 -0
  38. package/src/v5/table/clickFunc/v3/index.js +21 -0
  39. package/src/v5/table/fragments.json +112 -0
  40. package/src/v5/table/index.js +72 -0
  41. package/src/v5/table/resolveTargetContainer.js +9 -0
  42. package/src/v5/table/skeleton.json +371 -0
  43. package/src/v6/dataLists/fragments.json +1 -0
  44. package/src/v6/dataLists/index.js +32 -0
  45. package/src/v6/dataLists/skeleton.json +38 -0
  46. package/src/v6/form/attachFormClickEventListener.js +27 -0
  47. package/src/v6/form/clickFunc/extractFormData.js +27 -0
  48. package/src/v6/form/clickFunc/handleNew.js +24 -0
  49. package/src/v6/form/clickFunc/handleSave.js +33 -0
  50. package/src/v6/form/clickFunc/index.js +32 -0
  51. package/src/v6/form/index.js +87 -0
  52. package/src/v6/form/structure.json +410 -0
  53. package/src/v6/index.js +150 -0
  54. package/src/v6/meta.js +6 -0
  55. package/src/v6/navTabs/fragments.json +59 -0
  56. package/src/v6/navTabs/index.js +82 -0
  57. package/src/v6/navTabs/skeleton.json +18 -0
  58. package/src/v6/registerGlobal.js +14 -0
  59. package/src/v6/select/fragments.json +1 -0
  60. package/src/v6/select/index.js +34 -0
  61. package/src/v6/select/skeleton.json +23 -0
  62. package/src/v6/table/attachTableClickEventListener.js +22 -0
  63. package/src/v6/table/buildTableDataAsJson.js +19 -0
  64. package/src/v6/table/buildTableDomElement.js +21 -0
  65. package/src/v6/table/buildTableStructureSpec.js +28 -0
  66. package/src/v6/table/clickFunc/v3/createTable.js +16 -0
  67. package/src/v6/table/clickFunc/v3/getContainer/extractClickedRowDetails.js +23 -0
  68. package/src/v6/table/clickFunc/v3/getContainer/getOrCreateChildTableContainer.js +21 -0
  69. package/src/v6/table/clickFunc/v3/getContainer/index.js +39 -0
  70. package/src/v6/table/clickFunc/v3/getContainer/isSameRowClickedToToggleOff.js +14 -0
  71. package/src/v6/table/clickFunc/v3/getContainer/resetAndShowChildTableContainer.js +12 -0
  72. package/src/v6/table/clickFunc/v3/index.js +21 -0
  73. package/src/v6/table/fragments.json +112 -0
  74. package/src/v6/table/index.js +72 -0
  75. package/src/v6/table/resolveTargetContainer.js +9 -0
  76. package/src/v6/table/skeleton.json +371 -0
  77. package/src/v7/common/deriveColumnsFromData.js +20 -0
  78. package/src/v7/dataLists/fragments.json +1 -0
  79. package/src/v7/dataLists/index.js +32 -0
  80. package/src/v7/dataLists/skeleton.json +38 -0
  81. package/src/v7/form/attachFormClickEventListener.js +27 -0
  82. package/src/v7/form/clickFunc/extractFormData.js +27 -0
  83. package/src/v7/form/clickFunc/handleNew.js +24 -0
  84. package/src/v7/form/clickFunc/handleSave.js +33 -0
  85. package/src/v7/form/clickFunc/index.js +32 -0
  86. package/src/v7/form/index.js +87 -0
  87. package/src/v7/form/structure.json +410 -0
  88. package/src/v7/index.js +141 -0
  89. package/src/v7/meta.js +6 -0
  90. package/src/v7/navTabs/fragments.json +59 -0
  91. package/src/v7/navTabs/index.js +82 -0
  92. package/src/v7/navTabs/skeleton.json +18 -0
  93. package/src/v7/registerGlobal.js +14 -0
  94. package/src/v7/select/fragments.json +1 -0
  95. package/src/v7/select/index.js +34 -0
  96. package/src/v7/select/skeleton.json +23 -0
  97. package/src/v7/table/attachTableClickEventListener.js +28 -0
  98. package/src/v7/table/buildTableDataAsJson.js +25 -0
  99. package/src/v7/table/buildTableDomElement.js +25 -0
  100. package/src/v7/table/buildTableStructureSpec.js +33 -0
  101. package/src/v7/table/clickFunc/v3/createTable.js +20 -0
  102. package/src/v7/table/clickFunc/v3/getContainer/extractClickedRowDetails.js +27 -0
  103. package/src/v7/table/clickFunc/v3/getContainer/getOrCreateChildTableContainer.js +24 -0
  104. package/src/v7/table/clickFunc/v3/getContainer/index.js +44 -0
  105. package/src/v7/table/clickFunc/v3/getContainer/isSameRowClickedToToggleOff.js +17 -0
  106. package/src/v7/table/clickFunc/v3/getContainer/resetAndShowChildTableContainer.js +15 -0
  107. package/src/v7/table/clickFunc/v3/index.js +35 -0
  108. package/src/v7/table/fragments.json +112 -0
  109. package/src/v7/table/index.js +82 -0
  110. package/src/v7/table/resolveTargetContainer.js +11 -0
  111. package/src/v7/table/skeleton.json +371 -0
  112. package/src/v8/common/deriveColumnsFromData.js +20 -0
  113. package/src/v8/dataLists/fragments.json +1 -0
  114. package/src/v8/dataLists/index.js +32 -0
  115. package/src/v8/dataLists/skeleton.json +38 -0
  116. package/src/v8/form/attachFormClickEventListener.js +27 -0
  117. package/src/v8/form/clickFunc/extractFormData.js +27 -0
  118. package/src/v8/form/clickFunc/handleNew.js +24 -0
  119. package/src/v8/form/clickFunc/handleSave.js +33 -0
  120. package/src/v8/form/clickFunc/index.js +32 -0
  121. package/src/v8/form/index.js +87 -0
  122. package/src/v8/form/structure.json +410 -0
  123. package/src/v8/index.js +141 -0
  124. package/src/v8/meta.js +6 -0
  125. package/src/v8/navTabs/fragments.json +59 -0
  126. package/src/v8/navTabs/index.js +82 -0
  127. package/src/v8/navTabs/skeleton.json +18 -0
  128. package/src/v8/registerGlobal.js +14 -0
  129. package/src/v8/select/fragments.json +1 -0
  130. package/src/v8/select/index.js +34 -0
  131. package/src/v8/select/skeleton.json +23 -0
  132. package/src/v8/table/attachTableClickEventListener.js +28 -0
  133. package/src/v8/table/buildTableDataAsJson.js +25 -0
  134. package/src/v8/table/buildTableDomElement.js +25 -0
  135. package/src/v8/table/buildTableStructureSpec.js +33 -0
  136. package/src/v8/table/clickFunc/v3/createTable.js +20 -0
  137. package/src/v8/table/clickFunc/v3/getContainer/extractClickedRowDetails.js +27 -0
  138. package/src/v8/table/clickFunc/v3/getContainer/getOrCreateChildTableContainer.js +24 -0
  139. package/src/v8/table/clickFunc/v3/getContainer/index.js +44 -0
  140. package/src/v8/table/clickFunc/v3/getContainer/isSameRowClickedToToggleOff.js +17 -0
  141. package/src/v8/table/clickFunc/v3/getContainer/resetAndShowChildTableContainer.js +15 -0
  142. package/src/v8/table/clickFunc/v3/index.js +35 -0
  143. package/src/v8/table/fragments.json +112 -0
  144. package/src/v8/table/index.js +82 -0
  145. package/src/v8/table/resolveTargetContainer.js +11 -0
  146. package/src/v8/table/skeleton.json +371 -0
  147. package/src/v9/common/deriveColumnsFromData.js +20 -0
  148. package/src/v9/dataLists/fragments.json +1 -0
  149. package/src/v9/dataLists/index.js +32 -0
  150. package/src/v9/dataLists/skeleton.json +38 -0
  151. package/src/v9/form/attachFormClickEventListener.js +27 -0
  152. package/src/v9/form/clickFunc/extractFormData.js +27 -0
  153. package/src/v9/form/clickFunc/handleNew.js +24 -0
  154. package/src/v9/form/clickFunc/handleSave.js +33 -0
  155. package/src/v9/form/clickFunc/index.js +32 -0
  156. package/src/v9/form/index.js +87 -0
  157. package/src/v9/form/structure.json +410 -0
  158. package/src/v9/index.js +141 -0
  159. package/src/v9/meta.js +6 -0
  160. package/src/v9/navTabs/fragments.json +59 -0
  161. package/src/v9/navTabs/index.js +82 -0
  162. package/src/v9/navTabs/skeleton.json +18 -0
  163. package/src/v9/registerGlobal.js +14 -0
  164. package/src/v9/select/fragments.json +1 -0
  165. package/src/v9/select/index.js +34 -0
  166. package/src/v9/select/skeleton.json +23 -0
  167. package/src/v9/table/index.js +35 -0
  168. package/src/v9/table/skeleton.json +47 -0
@@ -0,0 +1,791 @@
1
+ const _ = {
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
+ }, K = (n) => {
5
+ var t;
6
+ typeof globalThis > "u" || !n || (globalThis.ks ?? (globalThis.ks = {}), (t = globalThis.ks).jsonRenderers ?? (t.jsonRenderers = {
7
+ meta: _,
8
+ renderToDom: n
9
+ }));
10
+ }, D = {
11
+ version: "v24.0",
12
+ description: "Pure spec engine no document at all"
13
+ }, W = (n) => {
14
+ typeof globalThis > "u" || !n || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks["json-to-spec"] = {
15
+ meta: D,
16
+ buildSpecElement: n
17
+ }, globalThis.ks.jsonToSpec = {
18
+ meta: D,
19
+ buildSpecElement: n
20
+ });
21
+ }, Q = ({ inSpec: n }) => {
22
+ const t = n;
23
+ return t == null;
24
+ }, X = ({ inSpec: n }) => typeof Node < "u" && n instanceof Node, N = ({ inSpecJson: n }) => {
25
+ const t = n;
26
+ return Array.isArray(t);
27
+ }, Y = ({ inArray: n = [], inShowLog: t = !1, inDataJson: e }) => {
28
+ const o = n, a = t, l = e;
29
+ return Array.isArray(o) ? o.map((s) => T({
30
+ inSpecJson: s,
31
+ inShowLog: a,
32
+ inDataJson: l
33
+ })).flat().filter(Boolean) : [];
34
+ }, w = ({ inTemplate: n, inData: t, inRowIndex: e }) => {
35
+ if (Number.isFinite(e)) {
36
+ debugger;
37
+ console.log("vvvvvvvvvvvvvv : ", e);
38
+ let o = Z({ inTemplate: n, inRowIndex: e });
39
+ return E({ inTemplate: o, inData: t });
40
+ } else
41
+ return E({ inTemplate: n, inData: t });
42
+ }, E = ({ inTemplate: n, inData: t }) => {
43
+ const e = n, o = t;
44
+ return typeof e != "string" ? e : e.replace(/\$\{([^}]+)\}/g, (a, l) => {
45
+ const s = l.trim().split(".");
46
+ let r = o;
47
+ for (const c of s) {
48
+ if (r == null) return "";
49
+ r = r[c];
50
+ }
51
+ return r == null ? "" : typeof r == "string" || typeof r == "number" || typeof r == "boolean" ? String(r ?? "") : r;
52
+ });
53
+ }, Z = ({ inTemplate: n, inRowIndex: t }) => {
54
+ const e = n, o = t;
55
+ return e.replace(/\#\{([^}]+)\}/g, (a, l) => {
56
+ const s = l.trim().split(".");
57
+ let r = o;
58
+ console.log("aaaaaaa : ", t, n, s);
59
+ for (const c of s) {
60
+ if (r == null) return "";
61
+ r = r[c];
62
+ }
63
+ return r === null || typeof r == "string" || typeof r == "number" || typeof r == "boolean" ? String(r ?? "") : r;
64
+ });
65
+ }, P = ({ inSpec: n, inData: t, inShowLog: e }) => {
66
+ const o = n, a = t, l = e;
67
+ return "textContent" in o && (o.textContent = w({ inTemplate: o.textContent, inData: a })), "attributes" in o && typeof o.attributes == "object" && o.attributes && (o.attributes = Object.fromEntries(
68
+ Object.entries(o.attributes).map(([s, r]) => [
69
+ s,
70
+ w({ inTemplate: r, inData: a })
71
+ ])
72
+ )), Array.isArray(o.children) && (o.children = o.children.map(
73
+ (s) => T({
74
+ inSpecJson: s,
75
+ inShowLog: l,
76
+ inDataJson: a
77
+ })
78
+ )), o;
79
+ }, ee = ({ inSpec: n, inData: t }) => {
80
+ const e = n, o = t, a = o.value;
81
+ return N({ inSpecJson: a }) ? (e.children = [{
82
+ tagName: "button",
83
+ attributes: {
84
+ class: "btn btn-primary btn-sm"
85
+ },
86
+ textContent: a.length
87
+ }], delete e.textContent, e) : typeof a == "object" && a !== null && a.tagName ? (e.children = [a], delete e.textContent, e) : ("textContent" in e && (e.textContent = w({ inTemplate: e.textContent, inData: o })), "attributes" in e && typeof e.attributes == "object" && e.attributes && (e.attributes = Object.fromEntries(
88
+ Object.entries(e.attributes).map(([l, s]) => [
89
+ l,
90
+ w({ inTemplate: s, inData: o })
91
+ ])
92
+ )), e);
93
+ }, te = ({ inSpec: n, inData: t }) => {
94
+ const e = n, o = t;
95
+ return "textContent" in e && (e.textContent === "${}" ? e.textContent = o : typeof e.textContent == "string" && (e.textContent = e.textContent.replaceAll("${}", () => o))), "attributes" in e && typeof e.attributes == "object" && e.attributes && (e.attributes = Object.fromEntries(
96
+ Object.entries(e.attributes).map(([a, l]) => [
97
+ a,
98
+ l === "${}" ? o : typeof l == "string" ? l.replaceAll("${}", () => o) : l
99
+ ])
100
+ )), e;
101
+ }, C = ({ inSpecJson: n, inData: t, inRowIndex: e, inShowLog: o = !1 } = {}) => {
102
+ const a = n, l = t, s = o, r = structuredClone(a);
103
+ return s && console.log("buildSingleElement start : ", a, l), typeof l == "string" ? te({ inSpec: r, inData: l }) : typeof l == "object" && l !== null && "key" in l && "value" in l && !("children" in r && Array.isArray(r.children) && r.children.length > 0) ? ee({ inSpec: r, inData: l }) : P({
104
+ inSpec: r,
105
+ inData: l,
106
+ inShowLog: s
107
+ });
108
+ }, ne = ({ inTemplate: n, inDataAsArray: t }) => {
109
+ const e = t, o = n;
110
+ return Array.isArray(e) ? e.map((l, s) => {
111
+ const r = structuredClone(o);
112
+ return T({
113
+ inSpecJson: r,
114
+ inDataJson: l,
115
+ inRowIndex: s
116
+ });
117
+ }) : [];
118
+ }, oe = ({ inTemplate: n, inDataAsObject: t }) => {
119
+ const e = t, o = n;
120
+ if (e === null || typeof e != "object")
121
+ return [];
122
+ const a = [];
123
+ for (const [l, s] of Object.entries(e)) {
124
+ const r = structuredClone(o), c = T({
125
+ inSpecJson: r,
126
+ inDataJson: {
127
+ key: l,
128
+ value: s
129
+ }
130
+ });
131
+ a.push(c);
132
+ }
133
+ return a;
134
+ }, le = ({
135
+ inSpecJson: n,
136
+ inShowLog: t = !1,
137
+ inDataJson: e,
138
+ inRowIndex: o
139
+ } = {}) => {
140
+ if (Number.isFinite(o) && ("attributes" in n ? n.attributes.rowIndex = o : n.attributes = {
141
+ rowIndex: o
142
+ }), !["loopArray", "loopObject"].includes(n.jsonToSpec.operation)) {
143
+ console.log(`inSpecJson.jsonToSpec.operation : can be loopArray or loopObject : ${n.jsonToSpec.operation}`);
144
+ return;
145
+ }
146
+ if (n.jsonToSpec.operation === "loopArray") {
147
+ const a = ne({
148
+ inTemplate: n.jsonToSpec.template,
149
+ inDataAsArray: e[n.jsonToSpec.source]
150
+ }), {
151
+ jsonToSpec: l,
152
+ ...s
153
+ } = n, r = {
154
+ ...s,
155
+ children: a
156
+ };
157
+ return C({
158
+ inSpecJson: r,
159
+ inShowLog: t,
160
+ inData: e
161
+ });
162
+ }
163
+ if (n.jsonToSpec.operation === "loopObject") {
164
+ const a = oe({
165
+ inTemplate: n.jsonToSpec.template,
166
+ inDataAsObject: e
167
+ }), {
168
+ jsonToSpec: l,
169
+ ...s
170
+ } = n, r = {
171
+ ...s,
172
+ children: a
173
+ };
174
+ return C({
175
+ inSpecJson: r,
176
+ inShowLog: t,
177
+ inData: e
178
+ });
179
+ }
180
+ }, T = ({
181
+ inSpecJson: n,
182
+ inShowLog: t = !0,
183
+ inDataJson: e,
184
+ inRowIndex: o
185
+ } = {}) => Q({ inSpec: n }) ? null : X({ inSpec: n }) ? n : (t && console.log("dispatchSpec 3 : ", n, e), N({ inSpecJson: n }) ? Y({
186
+ inArray: n,
187
+ inShowLog: t,
188
+ inDataJson: e
189
+ }) : "jsonToSpec" in n ? le({
190
+ inSpecJson: n,
191
+ inShowLog: t,
192
+ inDataJson: e,
193
+ inRowIndex: o
194
+ }) : C({
195
+ inSpecJson: n,
196
+ inShowLog: t,
197
+ inRowIndex: o,
198
+ inData: e
199
+ })), A = ({
200
+ specJson: n,
201
+ showLog: t = !1,
202
+ dataJson: e
203
+ }) => {
204
+ try {
205
+ return t && console.log("jsonToSpec 1 : ", n), T({
206
+ inSpecJson: n,
207
+ inShowLog: t,
208
+ inDataJson: e
209
+ });
210
+ } catch (o) {
211
+ console.log("error : ", o);
212
+ }
213
+ };
214
+ W(A);
215
+ const L = {
216
+ version: "v3.0",
217
+ description: "Pure DOM engine with JSON review and tags.json catalog verification"
218
+ }, ae = (n) => {
219
+ const t = n, e = typeof t == "function" ? t : t == null ? void 0 : t.inFuncDefinition, o = t == null ? void 0 : t.inReviewSpec;
220
+ typeof globalThis > "u" || !e || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks["json-to-tag"] = {
221
+ meta: L,
222
+ buildSpecElement: e,
223
+ reviewSpec: o
224
+ }, globalThis.ks.jsonToTag = {
225
+ meta: L,
226
+ buildSpecElement: e,
227
+ reviewSpec: o
228
+ });
229
+ }, re = ({ inSpec: n }) => {
230
+ const t = n;
231
+ return t == null;
232
+ }, se = ({ inSpec: n }) => typeof Node < "u" && n instanceof Node, ie = ({ inSpec: n }) => {
233
+ const t = n;
234
+ return Array.isArray(t);
235
+ }, ce = ({ inSpec: n, inShowLog: t = !1 }) => {
236
+ const e = n, o = t;
237
+ return Array.isArray(e) ? e.map((a) => x({
238
+ inSpec: a,
239
+ inShowLog: o
240
+ })).flat().filter(Boolean) : [];
241
+ }, ue = ({ inTagName: n }) => {
242
+ const t = n == null ? void 0 : n.toLowerCase();
243
+ if (!t) return null;
244
+ if (t === "checkbox") {
245
+ const e = document.createElement("input");
246
+ return e.type = "checkbox", e;
247
+ }
248
+ return document.createElement(t);
249
+ }, de = ({ inElement: n, inTextContent: t, inAllowsTextContent: e = !0, inTagName: o, inShowLog: a = !1 }) => {
250
+ const l = n, s = t, r = e, c = o, p = a;
251
+ return !l || s === void 0 || s === null ? l : r ? (l.textContent = s, l) : (p && console.warn(`[json-to-tag v3] textContent is not allowed on <${c}>; discarded "${s}"`), l);
252
+ }, pe = ({ inElement: n, inProperties: t }) => {
253
+ const e = n, o = t;
254
+ return e && o && typeof o == "object" && Object.assign(e, o), e;
255
+ }, fe = ({ inElement: n, inAttributes: t }) => {
256
+ const e = n, o = t;
257
+ return !e || !o || typeof o != "object" || Object.entries(o).forEach(([a, l]) => {
258
+ a === "class" ? e.className = l : typeof l == "boolean" ? l ? e.setAttribute(a, "") : e.removeAttribute(a) : l != null && e.setAttribute(a, String(l));
259
+ }), e;
260
+ }, he = ({ inElement: n, inClassList: t }) => {
261
+ const e = n, o = t;
262
+ if (!e || !o) return e;
263
+ let a = [];
264
+ return typeof o == "string" ? a = o.split(/\s+/).filter(Boolean) : Array.isArray(o) && (a = o.filter((l) => typeof l == "string" && l.trim().length > 0)), a.length > 0 && e.classList.add(...a), e;
265
+ }, ge = ({ inElement: n, inChildren: t, inAllowsChildren: e = !0, inTagName: o, inShowLog: a = !1 }) => {
266
+ const l = n, s = t, r = e, c = o, p = a;
267
+ return !l || !Array.isArray(s) || s.length === 0 ? l : r ? (s.forEach((i) => {
268
+ typeof Node < "u" && i instanceof Node ? l.appendChild(i) : (typeof i == "string" || typeof i == "number") && l.appendChild(document.createTextNode(String(i)));
269
+ }), l) : (p && console.warn(`[json-to-tag v3] Children are not allowed on void tag <${c}>; discarded ${s.length} child nodes.`), l);
270
+ }, be = ({ inSpec: n, inClassList: t }) => {
271
+ const e = n, o = t || (e == null ? void 0 : e.classList);
272
+ if (!e || !e.tagName) return null;
273
+ const a = ue({ inTagName: e.tagName });
274
+ return a ? (de({
275
+ inElement: a,
276
+ inTextContent: e.textContent,
277
+ inTagName: e.tagName
278
+ }), pe({
279
+ inElement: a,
280
+ inProperties: e.properties
281
+ }), fe({
282
+ inElement: a,
283
+ inAttributes: e.attributes
284
+ }), he({
285
+ inElement: a,
286
+ inClassList: o
287
+ }), ge({
288
+ inElement: a,
289
+ inChildren: e.children,
290
+ inTagName: e.tagName
291
+ }), a) : null;
292
+ }, me = ({ inChildren: n, inShowLog: t = !1 }) => {
293
+ const e = n, o = t;
294
+ return Array.isArray(e) ? e.map((l) => x({
295
+ inSpec: l,
296
+ inShowLog: o
297
+ })).flat().filter(Boolean) : [];
298
+ }, Te = ({ inSpec: n, inShowLog: t = !1 }) => {
299
+ const e = n, o = t, a = be({ inSpec: e });
300
+ let l = [];
301
+ return "children" in e && (l = Array.isArray(e.children) && e.children.length > 0 ? me({
302
+ inChildren: e.children,
303
+ inShowLog: o
304
+ }) : [], a.append(...l)), a;
305
+ }, x = ({ inSpec: n, inShowLog: t = !1 } = {}) => {
306
+ const e = n, o = t;
307
+ return re({ inSpec: e }) ? null : se({ inSpec: e }) ? e : ie({ inSpec: e }) ? ce({
308
+ inSpec: e,
309
+ inShowLog: o
310
+ }) : Te({
311
+ inSpec: e,
312
+ inShowLog: o
313
+ });
314
+ }, we = "./tags.schema.json", ye = {
315
+ allowsTextContent: !1,
316
+ allowsChildren: !0,
317
+ allowedAttributes: [
318
+ "title",
319
+ "role"
320
+ ],
321
+ childTags: []
322
+ }, Ce = {
323
+ allowsTextContent: !1,
324
+ allowsChildren: !1,
325
+ allowedAttributes: [
326
+ "type",
327
+ "placeholder",
328
+ "value",
329
+ "name",
330
+ "disabled",
331
+ "readonly",
332
+ "required",
333
+ "list"
334
+ ]
335
+ }, Se = {
336
+ allowsTextContent: !1,
337
+ allowsChildren: !1,
338
+ allowedAttributes: [
339
+ "type",
340
+ "checked",
341
+ "name",
342
+ "value",
343
+ "disabled",
344
+ "required"
345
+ ]
346
+ }, Ae = {
347
+ allowsTextContent: !1,
348
+ allowsChildren: !0,
349
+ allowedAttributes: [
350
+ "span"
351
+ ],
352
+ childTags: [
353
+ "col"
354
+ ]
355
+ }, xe = {
356
+ allowsTextContent: !1,
357
+ allowsChildren: !1,
358
+ allowedAttributes: [
359
+ "span",
360
+ "style",
361
+ "width"
362
+ ]
363
+ }, je = {
364
+ allowsTextContent: !0,
365
+ allowsChildren: !0,
366
+ allowedAttributes: [
367
+ "for"
368
+ ],
369
+ childTags: []
370
+ }, ve = {
371
+ allowsTextContent: !1,
372
+ allowsChildren: !0,
373
+ allowedAttributes: [
374
+ "action",
375
+ "method",
376
+ "autocomplete",
377
+ "enctype",
378
+ "name",
379
+ "novalidate",
380
+ "target"
381
+ ],
382
+ childTags: []
383
+ }, De = {
384
+ allowsTextContent: !1,
385
+ allowsChildren: !0,
386
+ allowedAttributes: [
387
+ "name",
388
+ "disabled",
389
+ "required",
390
+ "multiple",
391
+ "size"
392
+ ],
393
+ childTags: [
394
+ "option"
395
+ ]
396
+ }, Ee = {
397
+ allowsTextContent: !0,
398
+ allowsChildren: !0,
399
+ allowedAttributes: [],
400
+ childTags: []
401
+ }, Le = {
402
+ allowsTextContent: !0,
403
+ allowsChildren: !0,
404
+ allowedAttributes: [],
405
+ childTags: []
406
+ }, $e = {
407
+ allowsTextContent: !0,
408
+ allowsChildren: !0,
409
+ allowedAttributes: [],
410
+ childTags: []
411
+ }, Ne = {
412
+ allowsTextContent: !0,
413
+ allowsChildren: !0,
414
+ allowedAttributes: [],
415
+ childTags: []
416
+ }, ke = {
417
+ allowsTextContent: !1,
418
+ allowsChildren: !1,
419
+ allowedAttributes: [
420
+ "src",
421
+ "alt",
422
+ "width",
423
+ "height",
424
+ "loading"
425
+ ]
426
+ }, Oe = {
427
+ allowsTextContent: !0,
428
+ allowsChildren: !0,
429
+ allowedAttributes: [
430
+ "type",
431
+ "disabled",
432
+ "name",
433
+ "value"
434
+ ],
435
+ childTags: []
436
+ }, Fe = {
437
+ allowsTextContent: !1,
438
+ allowsChildren: !0,
439
+ allowedAttributes: [
440
+ "border",
441
+ "cellpadding",
442
+ "cellspacing"
443
+ ],
444
+ childTags: [
445
+ "caption",
446
+ "colgroup",
447
+ "thead",
448
+ "tbody",
449
+ "tfoot",
450
+ "tr"
451
+ ]
452
+ }, Ie = {
453
+ allowsTextContent: !1,
454
+ allowsChildren: !0,
455
+ allowedAttributes: [],
456
+ childTags: [
457
+ "tr"
458
+ ]
459
+ }, He = {
460
+ allowsTextContent: !1,
461
+ allowsChildren: !0,
462
+ allowedAttributes: [],
463
+ childTags: [
464
+ "tr"
465
+ ]
466
+ }, Re = {
467
+ allowsTextContent: !1,
468
+ allowsChildren: !0,
469
+ allowedAttributes: [],
470
+ childTags: [
471
+ "tr"
472
+ ]
473
+ }, Be = {
474
+ allowsTextContent: !1,
475
+ allowsChildren: !0,
476
+ allowedAttributes: [],
477
+ childTags: [
478
+ "td",
479
+ "th"
480
+ ]
481
+ }, ze = {
482
+ allowsTextContent: !0,
483
+ allowsChildren: !0,
484
+ allowedAttributes: [
485
+ "scope",
486
+ "colspan",
487
+ "rowspan"
488
+ ],
489
+ childTags: []
490
+ }, qe = {
491
+ allowsTextContent: !0,
492
+ allowsChildren: !0,
493
+ allowedAttributes: [
494
+ "colspan",
495
+ "rowspan"
496
+ ],
497
+ childTags: []
498
+ }, Me = {
499
+ allowsTextContent: !1,
500
+ allowsChildren: !0,
501
+ allowedAttributes: [],
502
+ childTags: [
503
+ "option"
504
+ ]
505
+ }, Ve = {
506
+ allowsTextContent: !0,
507
+ allowsChildren: !1,
508
+ allowedAttributes: [
509
+ "value",
510
+ "label",
511
+ "selected",
512
+ "disabled"
513
+ ]
514
+ }, Ge = {
515
+ allowsTextContent: !1,
516
+ allowsChildren: !0,
517
+ allowedAttributes: [
518
+ "role"
519
+ ],
520
+ childTags: []
521
+ }, Je = {
522
+ allowsTextContent: !0,
523
+ allowsChildren: !0,
524
+ allowedAttributes: [
525
+ "href",
526
+ "target",
527
+ "rel",
528
+ "title",
529
+ "download"
530
+ ],
531
+ childTags: []
532
+ }, Ue = {
533
+ allowsTextContent: !0,
534
+ allowsChildren: !0,
535
+ allowedAttributes: [
536
+ "aria-hidden"
537
+ ],
538
+ childTags: []
539
+ }, _e = {
540
+ allowsTextContent: !0,
541
+ allowsChildren: !0,
542
+ allowedAttributes: [],
543
+ childTags: []
544
+ }, Ke = {
545
+ allowsTextContent: !1,
546
+ allowsChildren: !0,
547
+ allowedAttributes: [
548
+ "type"
549
+ ],
550
+ childTags: [
551
+ "li"
552
+ ]
553
+ }, We = {
554
+ allowsTextContent: !0,
555
+ allowsChildren: !0,
556
+ allowedAttributes: [
557
+ "value"
558
+ ],
559
+ childTags: []
560
+ }, Qe = {
561
+ allowsTextContent: !1,
562
+ allowsChildren: !1,
563
+ allowedAttributes: []
564
+ }, Xe = {
565
+ $schema: we,
566
+ div: ye,
567
+ input: Ce,
568
+ checkbox: Se,
569
+ colgroup: Ae,
570
+ col: xe,
571
+ label: je,
572
+ form: ve,
573
+ select: De,
574
+ p: Ee,
575
+ h1: Le,
576
+ h2: $e,
577
+ span: Ne,
578
+ img: ke,
579
+ button: Oe,
580
+ table: Fe,
581
+ thead: Ie,
582
+ tbody: He,
583
+ tfoot: Re,
584
+ tr: Be,
585
+ th: ze,
586
+ td: qe,
587
+ datalist: Me,
588
+ option: Ve,
589
+ header: Ge,
590
+ a: Je,
591
+ i: Ue,
592
+ small: _e,
593
+ ul: Ke,
594
+ li: We,
595
+ hr: Qe
596
+ }, S = ({ inSpec: n }) => {
597
+ const t = n;
598
+ if (!t) return [];
599
+ if (Array.isArray(t))
600
+ return t.flatMap((o) => S({ inSpec: o }));
601
+ if (typeof t != "object") return [];
602
+ const e = [];
603
+ return typeof t.tagName == "string" && t.tagName.trim().length > 0 && e.push(t.tagName.toLowerCase()), Array.isArray(t.children) && t.children.length > 0 && t.children.forEach((o) => {
604
+ const a = S({ inSpec: o });
605
+ e.push(...a);
606
+ }), e;
607
+ }, Ye = ({ inTagsFound: n, inAllowedTags: t }) => {
608
+ const e = n ?? [], o = t ?? {}, a = new Set(
609
+ Object.keys(o).filter((i) => i !== "$schema").map((i) => i.toLowerCase())
610
+ ), l = {}, s = [], r = [];
611
+ e.forEach((i) => {
612
+ l[i] = (l[i] || 0) + 1, a.has(i) ? s.includes(i) || s.push(i) : r.includes(i) || r.push(i);
613
+ });
614
+ const c = e.length, p = r.length === 0;
615
+ return {
616
+ totalTags: c,
617
+ tagCounts: l,
618
+ uniqueTags: Object.keys(l),
619
+ recognizedTags: s,
620
+ unrecognizedTags: r,
621
+ areAllTagsPresent: p
622
+ };
623
+ }, Ze = ({ inSpec: n, inTags: t = Xe } = {}) => {
624
+ const e = n, o = t, a = S({ inSpec: e }), l = Ye({
625
+ inTagsFound: a,
626
+ inAllowedTags: o
627
+ });
628
+ return {
629
+ areAllTagsPresent: l.areAllTagsPresent,
630
+ totalTags: l.totalTags,
631
+ tagCounts: l.tagCounts,
632
+ uniqueTags: l.uniqueTags,
633
+ recognizedTags: l.recognizedTags,
634
+ unrecognizedTags: l.unrecognizedTags
635
+ };
636
+ }, j = (n = {}) => {
637
+ try {
638
+ const t = n, e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
639
+ return x({
640
+ inSpec: e
641
+ });
642
+ } catch (t) {
643
+ throw console.error("error : ", t), t;
644
+ }
645
+ };
646
+ ae({
647
+ inFuncDefinition: j,
648
+ inReviewSpec: Ze
649
+ });
650
+ const Pe = {
651
+ default: {
652
+ tagName: "datalist",
653
+ attributes: {
654
+ id: "LedgerName"
655
+ },
656
+ jsonToSpec: {
657
+ operation: "loopArray",
658
+ source: "LedgerName",
659
+ template: {
660
+ tagName: "option",
661
+ attributes: {
662
+ value: "${}"
663
+ },
664
+ textContent: "${}"
665
+ }
666
+ },
667
+ children: []
668
+ }
669
+ }, et = ({ targetHtmlId: n, inData: t, inSkeletonType: e = "default" } = {}) => {
670
+ const o = A({
671
+ specJson: Pe[e],
672
+ dataJson: t
673
+ }), a = document.getElementById(n);
674
+ a && (a.innerHTML = "");
675
+ const l = j(o);
676
+ Array.isArray(l) ? l.forEach((s) => a.append(s)) : a.append(l);
677
+ }, tt = {
678
+ default: {
679
+ tagName: "select",
680
+ attributes: {
681
+ id: "LedgerName"
682
+ },
683
+ jsonToSpec: {
684
+ operation: "loopArray",
685
+ source: "LedgerName",
686
+ template: {
687
+ tagName: "option",
688
+ attributes: {
689
+ value: "${}"
690
+ },
691
+ textContent: "${}"
692
+ }
693
+ },
694
+ children: []
695
+ }
696
+ }, nt = ({ targetHtmlId: n, inData: t, inSkeletonType: e = "default" } = {}) => {
697
+ const o = A({
698
+ specJson: tt[e],
699
+ dataJson: t
700
+ }), a = document.getElementById(n);
701
+ a && (a.innerHTML = "");
702
+ const l = j(o);
703
+ Array.isArray(l) ? l.forEach((s) => a.append(s)) : a.append(l);
704
+ }, $ = {
705
+ datalist: et,
706
+ select: nt
707
+ }, ot = ({
708
+ type: n = "table",
709
+ inType: t,
710
+ targetHtmlId: e,
711
+ inTargetHtmlId: o,
712
+ data: a,
713
+ inData: l,
714
+ columns: s,
715
+ inColumns: r,
716
+ fields: c,
717
+ inFields: p,
718
+ tabs: i,
719
+ inTabs: k,
720
+ options: lt,
721
+ inOptions: at,
722
+ datalistId: rt,
723
+ inDatalistId: st,
724
+ listId: it,
725
+ inListId: ct,
726
+ id: ut,
727
+ valueField: dt,
728
+ inValueField: pt,
729
+ labelField: ft,
730
+ inLabelField: ht,
731
+ colGroup: O,
732
+ inColGroup: F,
733
+ footerData: I,
734
+ inFooterData: H,
735
+ config: R,
736
+ inConfig: B,
737
+ variant: z,
738
+ skeletonType: q,
739
+ inSkeletonType: M,
740
+ showLog: V = !1,
741
+ inShowLog: G,
742
+ ...u
743
+ } = {}) => {
744
+ const y = t ?? n, d = typeof y == "string" ? y.toLowerCase() : "table", f = $[d];
745
+ if (!f)
746
+ return console.error(
747
+ `[Renderer] Unknown renderer type "${y}". Available types: ${Object.keys($).join(", ")}`
748
+ ), null;
749
+ const g = o ?? e, b = l ?? a, v = r ?? s, J = p ?? c, U = k ?? i, h = M ?? q ?? z ?? "default", m = G ?? V ?? !1;
750
+ return f(d === "form" ? {
751
+ targetHtmlId: g,
752
+ inFields: J,
753
+ inData: b,
754
+ inColumns: v,
755
+ inVariant: h,
756
+ inSkeletonType: h,
757
+ inShowLog: m,
758
+ onSave: u == null ? void 0 : u.onSave,
759
+ afterSave: u == null ? void 0 : u.afterSave,
760
+ onNew: u == null ? void 0 : u.onNew
761
+ } : d === "navtabs" || d === "nav" || d === "tabs" ? {
762
+ targetHtmlId: g,
763
+ inTabs: U,
764
+ inData: b,
765
+ inSkeletonType: h,
766
+ inShowLog: m
767
+ } : d === "datalist" || d === "data-list" ? {
768
+ targetHtmlId: g,
769
+ inData: b,
770
+ inSkeletonType: h,
771
+ inShowLog: m
772
+ } : d === "select" ? {
773
+ targetHtmlId: g,
774
+ inData: b,
775
+ inSkeletonType: h,
776
+ inShowLog: m
777
+ } : {
778
+ targetHtmlId: g,
779
+ inColumns: v,
780
+ inData: b,
781
+ inColGroup: F ?? O,
782
+ inFooterData: H ?? I ?? [],
783
+ inConfig: B ?? R ?? {},
784
+ inSkeletonType: h,
785
+ inShowLog: m
786
+ });
787
+ };
788
+ K(ot);
789
+ export {
790
+ ot as default
791
+ };