json-renderers-build-table 1.26.2 → 1.32.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 (212) hide show
  1. package/package.json +5 -4
  2. package/src/index.js +2 -2
  3. package/src/{v26 → v29}/actions/index.js +25 -19
  4. package/src/{v26 → v29}/actions/insertOptions/index.js +47 -47
  5. package/src/{v24 → v29}/actions/insertOptions/instructions/footer.json +22 -22
  6. package/src/{v26 → v29}/actions/insertOptions/instructions/single.json +62 -62
  7. package/src/v29/actions/insertSearch/index.js +7 -0
  8. package/src/v29/actions/insertSearch/instructions/template.json +20 -0
  9. package/src/{v26 → v29}/actions/insertSerial/index.js +47 -47
  10. package/src/{v26 → v29}/actions/insertSerial/instructions/footer.json +22 -22
  11. package/src/{v24 → v29}/actions/insertSerial/instructions/single.json +62 -62
  12. package/src/v29/builders/simple/index.js +45 -0
  13. package/src/{v26/builders/simple → v29/builders/simpleSearch}/index.js +40 -40
  14. package/src/{v25 → v29}/builders/withFooter/index.js +40 -40
  15. package/src/{v25 → v29}/index.js +21 -21
  16. package/src/{v25 → v30}/actions/index.js +25 -19
  17. package/src/{v24 → v30}/actions/insertOptions/index.js +47 -47
  18. package/src/{v26 → v30}/actions/insertOptions/instructions/footer.json +22 -22
  19. package/src/{v25 → v30}/actions/insertOptions/instructions/single.json +62 -62
  20. package/src/v30/actions/insertSearch/index.js +7 -0
  21. package/src/v30/actions/insertSearch/instructions/template.json +20 -0
  22. package/src/{v24 → v30}/actions/insertSerial/index.js +47 -47
  23. package/src/{v24 → v30}/actions/insertSerial/instructions/footer.json +22 -22
  24. package/src/{v26 → v30}/actions/insertSerial/instructions/single.json +62 -62
  25. package/src/v30/builders/simple/index.js +45 -0
  26. package/src/{v25/builders/simple → v30/builders/simpleSearch}/index.js +40 -40
  27. package/src/{v26 → v30}/builders/withFooter/index.js +40 -40
  28. package/src/{v26 → v30}/index.js +21 -21
  29. package/src/{v24 → v30}/singleInstruction/index.js +5 -5
  30. package/src/v31/actions/index.js +30 -0
  31. package/src/v31/actions/insertSearch/index.js +7 -0
  32. package/src/v31/actions/insertSearch/instructions/template.json +20 -0
  33. package/src/v31/actions/instructionsForOptions.json +44 -0
  34. package/src/v31/actions/instructionsForSerial.json +44 -0
  35. package/src/v31/builders/simple/index.js +41 -0
  36. package/src/v31/builders/simpleSearch/index.js +40 -0
  37. package/src/v31/builders/withFooter/index.js +40 -0
  38. package/src/{v22 → v31}/index.js +7 -1
  39. package/src/{v25 → v31}/singleInstruction/index.js +5 -5
  40. package/src/v32/actions/index.js +28 -0
  41. package/src/v32/actions/insertSearch/index.js +7 -0
  42. package/src/v32/actions/insertSearch/instructions/template.json +20 -0
  43. package/src/{v24/actions/insertOptions/instructions/single.json → v32/actions/instructionsForOptions.json} +58 -62
  44. package/src/{v25/actions/insertSerial/instructions/single.json → v32/actions/instructionsForSerial.json} +58 -62
  45. package/src/v32/builders/simple/index.js +41 -0
  46. package/src/v32/builders/simple/instructions/single.json +38 -0
  47. package/src/v32/builders/simpleSearch/index.js +40 -0
  48. package/src/v32/builders/simpleSearch/instructions/double.json +19 -0
  49. package/src/v32/builders/simpleSearch/instructions/single.json +38 -0
  50. package/src/{v23 → v32}/builders/spec.json +4 -0
  51. package/src/v32/builders/withFooter/index.js +40 -0
  52. package/src/v32/builders/withFooter/instructions/double.json +19 -0
  53. package/src/{v23 → v32}/index.js +21 -34
  54. package/src/{v22 → v32}/singleInstruction/index.js +5 -5
  55. package/src/v22/builders/simple/index.js +0 -22
  56. package/src/v22/builders/spec.json +0 -88
  57. package/src/v22/builders/withFooter/index.js +0 -24
  58. package/src/v23/builders/simple/index.js +0 -22
  59. package/src/v23/builders/withFooter/index.js +0 -24
  60. package/src/v23/builders/withOptions/index.js +0 -51
  61. package/src/v23/builders/withOptions/instructions/double.json +0 -19
  62. package/src/v23/builders/withOptions/instructions/postSingle.json +0 -22
  63. package/src/v23/builders/withOptions/instructions/single.json +0 -78
  64. package/src/v23/builders/withSerial/index.js +0 -51
  65. package/src/v23/builders/withSerial/instructions/double.json +0 -19
  66. package/src/v23/builders/withSerial/instructions/postSingle.json +0 -22
  67. package/src/v23/builders/withSerial/instructions/single.json +0 -78
  68. package/src/v23/singleInstruction/index.js +0 -32
  69. package/src/v24/actions/index.js +0 -5
  70. package/src/v24/builders/simple/index.js +0 -49
  71. package/src/v24/builders/withFooter/index.js +0 -49
  72. package/src/v24/index.js +0 -71
  73. package/src/v25/actions/insertOptions/index.js +0 -47
  74. package/src/v25/actions/insertOptions/instructions/footer.json +0 -22
  75. package/src/v25/actions/insertSerial/index.js +0 -47
  76. package/src/v25/actions/insertSerial/instructions/footer.json +0 -22
  77. package/src/v26/builders/bodyOnly/base.json +0 -1
  78. package/src/v26/builders/bodyOnly/index.js +0 -18
  79. package/src/v26/builders/bodyOnly/instructions/double.json +0 -18
  80. package/src/v26/builders/footerOnly/base.json +0 -3
  81. package/src/v26/builders/footerOnly/index.js +0 -21
  82. package/src/v26/builders/footerOnly/instructions/single.json +0 -19
  83. package/src/v26/builders/headerOnly/index.js +0 -18
  84. package/src/v26/builders/withFooter/base.json +0 -53
  85. package/src/v26/builders/withFooter/instructions/single.json +0 -56
  86. package/src/v26/doubleInstruction/index.js +0 -21
  87. package/src/v26/guards/index.js +0 -10
  88. package/src/v26/guards/references/func/index.js +0 -8
  89. package/src/v26/guards/references/index.js +0 -9
  90. package/src/v26/guards/references/templateKey/index.js +0 -8
  91. package/src/v26/guards/structure/destinationPath/index.js +0 -8
  92. package/src/v26/guards/structure/func/index.js +0 -8
  93. package/src/v26/guards/structure/index.js +0 -15
  94. package/src/v26/guards/structure/sourcePath/index.js +0 -8
  95. package/src/v26/guards/structure/templateKey/index.js +0 -9
  96. package/src/v26/writePath/index.js +0 -62
  97. /package/src/{v22 → v29}/builders/bodyOnly/base.json +0 -0
  98. /package/src/{v22 → v29}/builders/bodyOnly/index.js +0 -0
  99. /package/src/{v22 → v29}/builders/bodyOnly/instructions/double.json +0 -0
  100. /package/src/{v22 → v29}/builders/footerOnly/base.json +0 -0
  101. /package/src/{v22 → v29}/builders/footerOnly/index.js +0 -0
  102. /package/src/{v22 → v29}/builders/footerOnly/instructions/single.json +0 -0
  103. /package/src/{v22 → v29}/builders/headerOnly/base.json +0 -0
  104. /package/src/{v22 → v29}/builders/headerOnly/index.js +0 -0
  105. /package/src/{v22 → v29}/builders/headerOnly/instructions/single.json +0 -0
  106. /package/src/{v22 → v29}/builders/simple/base.json +0 -0
  107. /package/src/{v22 → v29}/builders/simple/instructions/double.json +0 -0
  108. /package/src/{v22 → v29}/builders/simple/instructions/single.json +0 -0
  109. /package/src/{v22/builders/withFooter → v29/builders/simpleSearch}/base.json +0 -0
  110. /package/src/{v22/builders/withFooter → v29/builders/simpleSearch}/instructions/double.json +0 -0
  111. /package/src/{v23/builders/headerOnly → v29/builders/simpleSearch}/instructions/single.json +0 -0
  112. /package/src/{v24 → v29}/builders/spec.json +0 -0
  113. /package/src/{v23/builders/headerOnly → v29/builders/withFooter}/base.json +0 -0
  114. /package/src/{v23/builders/simple → v29/builders/withFooter}/instructions/double.json +0 -0
  115. /package/src/{v22 → v29}/builders/withFooter/instructions/single.json +0 -0
  116. /package/src/{v22 → v29}/doubleInstruction/index.js +0 -0
  117. /package/src/{v22 → v29}/guards/index.js +0 -0
  118. /package/src/{v22 → v29}/guards/references/func/index.js +0 -0
  119. /package/src/{v22 → v29}/guards/references/index.js +0 -0
  120. /package/src/{v22 → v29}/guards/references/templateKey/index.js +0 -0
  121. /package/src/{v22 → v29}/guards/structure/destinationPath/index.js +0 -0
  122. /package/src/{v22 → v29}/guards/structure/func/index.js +0 -0
  123. /package/src/{v22 → v29}/guards/structure/index.js +0 -0
  124. /package/src/{v22 → v29}/guards/structure/sourcePath/index.js +0 -0
  125. /package/src/{v22 → v29}/guards/structure/templateKey/index.js +0 -0
  126. /package/src/{v26 → v29}/singleInstruction/index.js +0 -0
  127. /package/src/{v22 → v29}/writePath/index.js +0 -0
  128. /package/src/{v23 → v30}/builders/bodyOnly/base.json +0 -0
  129. /package/src/{v23 → v30}/builders/bodyOnly/index.js +0 -0
  130. /package/src/{v23 → v30}/builders/bodyOnly/instructions/double.json +0 -0
  131. /package/src/{v23 → v30}/builders/footerOnly/base.json +0 -0
  132. /package/src/{v23 → v30}/builders/footerOnly/index.js +0 -0
  133. /package/src/{v23 → v30}/builders/footerOnly/instructions/single.json +0 -0
  134. /package/src/{v23/builders/simple → v30/builders/headerOnly}/base.json +0 -0
  135. /package/src/{v23 → v30}/builders/headerOnly/index.js +0 -0
  136. /package/src/{v23/builders/simple → v30/builders/headerOnly}/instructions/single.json +0 -0
  137. /package/src/{v23/builders/withFooter → v30/builders/simple}/base.json +0 -0
  138. /package/src/{v23/builders/withFooter → v30/builders/simple}/instructions/double.json +0 -0
  139. /package/src/{v24/builders/headerOnly → v30/builders/simple}/instructions/single.json +0 -0
  140. /package/src/{v23/builders/withOptions → v30/builders/simpleSearch}/base.json +0 -0
  141. /package/src/{v24/builders/simple → v30/builders/simpleSearch}/instructions/double.json +0 -0
  142. /package/src/{v24/builders/simple → v30/builders/simpleSearch}/instructions/single.json +0 -0
  143. /package/src/{v25 → v30}/builders/spec.json +0 -0
  144. /package/src/{v23/builders/withSerial → v30/builders/withFooter}/base.json +0 -0
  145. /package/src/{v24 → v30}/builders/withFooter/instructions/double.json +0 -0
  146. /package/src/{v23 → v30}/builders/withFooter/instructions/single.json +0 -0
  147. /package/src/{v23 → v30}/doubleInstruction/index.js +0 -0
  148. /package/src/{v23 → v30}/guards/index.js +0 -0
  149. /package/src/{v23 → v30}/guards/references/func/index.js +0 -0
  150. /package/src/{v23 → v30}/guards/references/index.js +0 -0
  151. /package/src/{v23 → v30}/guards/references/templateKey/index.js +0 -0
  152. /package/src/{v23 → v30}/guards/structure/destinationPath/index.js +0 -0
  153. /package/src/{v23 → v30}/guards/structure/func/index.js +0 -0
  154. /package/src/{v23 → v30}/guards/structure/index.js +0 -0
  155. /package/src/{v23 → v30}/guards/structure/sourcePath/index.js +0 -0
  156. /package/src/{v23 → v30}/guards/structure/templateKey/index.js +0 -0
  157. /package/src/{v23 → v30}/writePath/index.js +0 -0
  158. /package/src/{v24 → v31}/builders/bodyOnly/base.json +0 -0
  159. /package/src/{v24 → v31}/builders/bodyOnly/index.js +0 -0
  160. /package/src/{v24 → v31}/builders/bodyOnly/instructions/double.json +0 -0
  161. /package/src/{v24 → v31}/builders/footerOnly/base.json +0 -0
  162. /package/src/{v24 → v31}/builders/footerOnly/index.js +0 -0
  163. /package/src/{v24 → v31}/builders/footerOnly/instructions/single.json +0 -0
  164. /package/src/{v24 → v31}/builders/headerOnly/base.json +0 -0
  165. /package/src/{v24 → v31}/builders/headerOnly/index.js +0 -0
  166. /package/src/{v25 → v31}/builders/headerOnly/instructions/single.json +0 -0
  167. /package/src/{v24 → v31}/builders/simple/base.json +0 -0
  168. /package/src/{v25 → v31}/builders/simple/instructions/double.json +0 -0
  169. /package/src/{v25 → v31}/builders/simple/instructions/single.json +0 -0
  170. /package/src/{v24/builders/withFooter → v31/builders/simpleSearch}/base.json +0 -0
  171. /package/src/{v25/builders/withFooter → v31/builders/simpleSearch}/instructions/double.json +0 -0
  172. /package/src/{v26/builders/headerOnly → v31/builders/simpleSearch}/instructions/single.json +0 -0
  173. /package/src/{v26 → v31}/builders/spec.json +0 -0
  174. /package/src/{v25/builders/headerOnly → v31/builders/withFooter}/base.json +0 -0
  175. /package/src/{v26/builders/simple → v31/builders/withFooter}/instructions/double.json +0 -0
  176. /package/src/{v24 → v31}/builders/withFooter/instructions/single.json +0 -0
  177. /package/src/{v24 → v31}/doubleInstruction/index.js +0 -0
  178. /package/src/{v24 → v31}/guards/index.js +0 -0
  179. /package/src/{v24 → v31}/guards/references/func/index.js +0 -0
  180. /package/src/{v24 → v31}/guards/references/index.js +0 -0
  181. /package/src/{v24 → v31}/guards/references/templateKey/index.js +0 -0
  182. /package/src/{v24 → v31}/guards/structure/destinationPath/index.js +0 -0
  183. /package/src/{v24 → v31}/guards/structure/func/index.js +0 -0
  184. /package/src/{v24 → v31}/guards/structure/index.js +0 -0
  185. /package/src/{v24 → v31}/guards/structure/sourcePath/index.js +0 -0
  186. /package/src/{v24 → v31}/guards/structure/templateKey/index.js +0 -0
  187. /package/src/{v24 → v31}/writePath/index.js +0 -0
  188. /package/src/{v25 → v32}/builders/bodyOnly/base.json +0 -0
  189. /package/src/{v25 → v32}/builders/bodyOnly/index.js +0 -0
  190. /package/src/{v25 → v32}/builders/bodyOnly/instructions/double.json +0 -0
  191. /package/src/{v25 → v32}/builders/footerOnly/base.json +0 -0
  192. /package/src/{v25 → v32}/builders/footerOnly/index.js +0 -0
  193. /package/src/{v25 → v32}/builders/footerOnly/instructions/single.json +0 -0
  194. /package/src/{v25/builders/simple → v32/builders/headerOnly}/base.json +0 -0
  195. /package/src/{v25 → v32}/builders/headerOnly/index.js +0 -0
  196. /package/src/{v26/builders/simple → v32/builders/headerOnly}/instructions/single.json +0 -0
  197. /package/src/{v25/builders/withFooter → v32/builders/simple}/base.json +0 -0
  198. /package/src/{v26/builders/withFooter → v32/builders/simple}/instructions/double.json +0 -0
  199. /package/src/{v26/builders/headerOnly → v32/builders/simpleSearch}/base.json +0 -0
  200. /package/src/{v26/builders/simple → v32/builders/withFooter}/base.json +0 -0
  201. /package/src/{v25 → v32}/builders/withFooter/instructions/single.json +0 -0
  202. /package/src/{v25 → v32}/doubleInstruction/index.js +0 -0
  203. /package/src/{v25 → v32}/guards/index.js +0 -0
  204. /package/src/{v25 → v32}/guards/references/func/index.js +0 -0
  205. /package/src/{v25 → v32}/guards/references/index.js +0 -0
  206. /package/src/{v25 → v32}/guards/references/templateKey/index.js +0 -0
  207. /package/src/{v25 → v32}/guards/structure/destinationPath/index.js +0 -0
  208. /package/src/{v25 → v32}/guards/structure/func/index.js +0 -0
  209. /package/src/{v25 → v32}/guards/structure/index.js +0 -0
  210. /package/src/{v25 → v32}/guards/structure/sourcePath/index.js +0 -0
  211. /package/src/{v25 → v32}/guards/structure/templateKey/index.js +0 -0
  212. /package/src/{v25 → v32}/writePath/index.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-renderers-build-table",
3
- "version": "1.26.2",
3
+ "version": "1.32.2",
4
4
  "description": "Focused table specification builder with configurable rows and cells",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -18,10 +18,11 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@keshavsoft/json-to-tag": "^1.9.3",
21
+ "json-instructions": "^1.8.3",
21
22
  "json-transformer-funcs": "^1.24.7",
22
- "json-transformer-funcs-one-dimension": "^1.5.2",
23
- "json-transformer-funcs-primitive": "^1.9.2",
24
- "json-transformer-funcs-two-dimensions": "^1.6.1"
23
+ "json-transformer-funcs-one-dimension": "^1.6.1",
24
+ "json-transformer-funcs-primitive": "^1.9.3",
25
+ "json-transformer-funcs-two-dimensions": "^1.5.2"
25
26
  },
26
27
  "devDependencies": {
27
28
  "vite": "^8.3.4"
package/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./v26/index.js";
2
- export { default } from "./v26/index.js";
1
+ export * from "./v32/index.js";
2
+ export { default } from "./v32/index.js";
@@ -1,20 +1,26 @@
1
- import insertSerial from "./insertSerial/index.js";
2
- import insertOptions from "./insertOptions/index.js";
3
-
4
- const startFunc = ({ inOptions = {}, inBase, showLog = false, returnLog = [] }) => {
5
- const localOptions = inOptions;
6
-
7
- const localBase = inBase;
8
-
9
- if (localOptions.showSerial || localOptions.serial) {
10
- insertSerial(localBase, localOptions.serial || {}, showLog, returnLog);
11
- }
12
-
13
- if (localOptions.showOptions || localOptions.options) {
14
- insertOptions(localBase, localOptions.options || {}, showLog, returnLog);
15
- };
16
-
17
- return localBase;
18
- };
19
-
1
+ import insertSerial from "./insertSerial/index.js";
2
+ import insertOptions from "./insertOptions/index.js";
3
+ import insertSearch from "./insertSearch/index.js";
4
+
5
+ const startFunc = ({ inOptions = {}, inBase, showLog = false, returnLog = [] }) => {
6
+ const localOptions = inOptions;
7
+
8
+ const localBase = inBase;
9
+
10
+ console.log(localOptions)
11
+ if (localOptions.showSerial || localOptions.serial) {
12
+ insertSerial(localBase, localOptions.serial || {}, showLog, returnLog);
13
+ }
14
+
15
+ if (localOptions.showOptions || localOptions.options) {
16
+ insertOptions(localBase, localOptions.options || {}, showLog, returnLog);
17
+ };
18
+
19
+ if (localOptions.showSearch) {
20
+ insertSearch();
21
+ };
22
+
23
+ return localBase;
24
+ };
25
+
20
26
  export default startFunc;
@@ -1,47 +1,47 @@
1
- import applyTemplate from "json-transformer-funcs-primitive";
2
- import { findByRole } from "json-transformer-funcs";
3
-
4
- import spec from "../../builders/spec.json" with { type: "json" };
5
- import singleInstructions from "./instructions/single.json" with { type: "json" };
6
- import footerInstructions from "./instructions/footer.json" with { type: "json" };
7
-
8
- import runSingleInstructions from "../../singleInstruction/index.js";
9
-
10
- const functions = { applyTemplate };
11
-
12
- const insertOptions = (input = {}, config = {}, showLog = false, returnLog = []) => {
13
- let localTableSpec = input;
14
- let localOptions = config;
15
-
16
- if (input && typeof input === "object" && "inTableSpec" in input) {
17
- localTableSpec = input.inTableSpec;
18
- localOptions = input.inOptions || config;
19
- }
20
-
21
- const localOptionsMerged = {
22
- col: { width: "100px" },
23
- header: { columnName: "options" },
24
- body: { columnName: "show" },
25
- footer: {},
26
- ...localOptions
27
- };
28
-
29
- const registry = {
30
- data: {
31
- options: localOptionsMerged
32
- },
33
- base: localTableSpec,
34
- spec
35
- };
36
-
37
- runSingleInstructions(singleInstructions, registry, functions, spec, showLog, returnLog);
38
-
39
- const footerRow = findByRole(localTableSpec, "table-footer-row");
40
- if (footerRow && Array.isArray(footerRow.children) && footerRow.children.length > 0) {
41
- runSingleInstructions(footerInstructions, registry, functions, spec, showLog, returnLog);
42
- }
43
-
44
- return localTableSpec;
45
- };
46
-
47
- export default insertOptions;
1
+ import applyTemplate from "json-transformer-funcs-primitive";
2
+ import { findByRole } from "json-transformer-funcs";
3
+
4
+ import spec from "../../builders/spec.json" with { type: "json" };
5
+ import singleInstructions from "./instructions/single.json" with { type: "json" };
6
+ import footerInstructions from "./instructions/footer.json" with { type: "json" };
7
+
8
+ import runSingleInstructions from "../../singleInstruction/index.js";
9
+
10
+ const functions = { applyTemplate };
11
+
12
+ const insertOptions = (input = {}, config = {}, showLog = false, returnLog = []) => {
13
+ let localTableSpec = input;
14
+ let localOptions = config;
15
+
16
+ if (input && typeof input === "object" && "inTableSpec" in input) {
17
+ localTableSpec = input.inTableSpec;
18
+ localOptions = input.inOptions || config;
19
+ }
20
+
21
+ const localOptionsMerged = {
22
+ col: { width: "100px" },
23
+ header: { columnName: "options" },
24
+ body: { columnName: "show" },
25
+ footer: {},
26
+ ...localOptions
27
+ };
28
+
29
+ const registry = {
30
+ data: {
31
+ options: localOptionsMerged
32
+ },
33
+ base: localTableSpec,
34
+ spec
35
+ };
36
+
37
+ runSingleInstructions(singleInstructions, registry, functions, spec, showLog, returnLog);
38
+
39
+ const footerRow = findByRole(localTableSpec, "table-footer-row");
40
+ if (footerRow && Array.isArray(footerRow.children) && footerRow.children.length > 0) {
41
+ runSingleInstructions(footerInstructions, registry, functions, spec, showLog, returnLog);
42
+ }
43
+
44
+ return localTableSpec;
45
+ };
46
+
47
+ export default insertOptions;
@@ -1,22 +1,22 @@
1
- [
2
- {
3
- "narration": "Append an empty cell into the table footer row if footer row is present.",
4
- "destinationPath": {
5
- "fileName": "base",
6
- "dataRole": "table-footer-row",
7
- "filePath": [
8
- "children"
9
- ],
10
- "action": "push"
11
- },
12
- "sourcePath": {
13
- "fileName": "data",
14
- "filePath": [
15
- "options",
16
- "footer"
17
- ]
18
- },
19
- "templateKey": "emptyCell",
20
- "func": "applyTemplate"
21
- }
22
- ]
1
+ [
2
+ {
3
+ "narration": "Append an empty cell into the table footer row if footer row is present.",
4
+ "destinationPath": {
5
+ "fileName": "base",
6
+ "dataRole": "table-footer-row",
7
+ "filePath": [
8
+ "children"
9
+ ],
10
+ "action": "push"
11
+ },
12
+ "sourcePath": {
13
+ "fileName": "data",
14
+ "filePath": [
15
+ "options",
16
+ "footer"
17
+ ]
18
+ },
19
+ "templateKey": "emptyCell",
20
+ "func": "applyTemplate"
21
+ }
22
+ ]
@@ -1,62 +1,62 @@
1
- [
2
- {
3
- "narration": "Append the options column width to the table colgroup.",
4
- "destinationPath": {
5
- "fileName": "base",
6
- "dataRole": "table-colgroup",
7
- "filePath": [
8
- "children"
9
- ],
10
- "action": "push"
11
- },
12
- "sourcePath": {
13
- "fileName": "data",
14
- "filePath": [
15
- "options",
16
- "col"
17
- ]
18
- },
19
- "templateKey": "buildColGroup",
20
- "func": "applyTemplate"
21
- },
22
- {
23
- "narration": "Append the options header cell to the table header row.",
24
- "destinationPath": {
25
- "fileName": "base",
26
- "dataRole": "table-header-row",
27
- "filePath": [
28
- "children"
29
- ],
30
- "action": "push"
31
- },
32
- "sourcePath": {
33
- "fileName": "data",
34
- "filePath": [
35
- "options",
36
- "header"
37
- ]
38
- },
39
- "templateKey": "buildHeader",
40
- "func": "applyTemplate"
41
- },
42
- {
43
- "narration": "Append the options button cell into each table body row.",
44
- "destinationPath": {
45
- "fileName": "base",
46
- "dataRole": "table-body",
47
- "filePath": [
48
- "children"
49
- ],
50
- "action": "pushToRows"
51
- },
52
- "sourcePath": {
53
- "fileName": "data",
54
- "filePath": [
55
- "options",
56
- "body"
57
- ]
58
- },
59
- "templateKey": "optionsButtonCell",
60
- "func": "applyTemplate"
61
- }
62
- ]
1
+ [
2
+ {
3
+ "narration": "Append the options column width to the table colgroup.",
4
+ "destinationPath": {
5
+ "fileName": "base",
6
+ "dataRole": "table-colgroup",
7
+ "filePath": [
8
+ "children"
9
+ ],
10
+ "action": "push"
11
+ },
12
+ "sourcePath": {
13
+ "fileName": "data",
14
+ "filePath": [
15
+ "options",
16
+ "col"
17
+ ]
18
+ },
19
+ "templateKey": "buildColGroup",
20
+ "func": "applyTemplate"
21
+ },
22
+ {
23
+ "narration": "Append the options header cell to the table header row.",
24
+ "destinationPath": {
25
+ "fileName": "base",
26
+ "dataRole": "table-header-row",
27
+ "filePath": [
28
+ "children"
29
+ ],
30
+ "action": "push"
31
+ },
32
+ "sourcePath": {
33
+ "fileName": "data",
34
+ "filePath": [
35
+ "options",
36
+ "header"
37
+ ]
38
+ },
39
+ "templateKey": "buildHeader",
40
+ "func": "applyTemplate"
41
+ },
42
+ {
43
+ "narration": "Append the options button cell into each table body row.",
44
+ "destinationPath": {
45
+ "fileName": "base",
46
+ "dataRole": "table-body",
47
+ "filePath": [
48
+ "children"
49
+ ],
50
+ "action": "pushToRows"
51
+ },
52
+ "sourcePath": {
53
+ "fileName": "data",
54
+ "filePath": [
55
+ "options",
56
+ "body"
57
+ ]
58
+ },
59
+ "templateKey": "optionsButtonCell",
60
+ "func": "applyTemplate"
61
+ }
62
+ ]
@@ -0,0 +1,7 @@
1
+ import template from "./instructions/template.json" with { type: "json" };
2
+
3
+ const startFunc = (input = {}, config = {}, showLog = false, returnLog = []) => {
4
+ return template;
5
+ };
6
+
7
+ export default startFunc;
@@ -0,0 +1,20 @@
1
+ {
2
+ "tagName": "div",
3
+ "children": [
4
+ {
5
+ "tagName": "label",
6
+ "textContent": "KeshavSoft"
7
+ },
8
+ {
9
+ "tagName": "input",
10
+ "attributes": {
11
+ "value": "KeshavSoft",
12
+ "placeholder": "KeshavSoft"
13
+ }
14
+ },
15
+ {
16
+ "tagName": "button",
17
+ "textContent": "show"
18
+ }
19
+ ]
20
+ }
@@ -1,47 +1,47 @@
1
- import applyTemplate from "json-transformer-funcs-primitive";
2
- import { findByRole } from "json-transformer-funcs";
3
-
4
- import spec from "../../builders/spec.json" with { type: "json" };
5
- import singleInstructions from "./instructions/single.json" with { type: "json" };
6
- import footerInstructions from "./instructions/footer.json" with { type: "json" };
7
-
8
- import runSingleInstructions from "../../singleInstruction/index.js";
9
-
10
- const functions = { applyTemplate };
11
-
12
- const insertSerial = (input = {}, config = {}, showLog = false, returnLog = []) => {
13
- let localTableSpec = input;
14
- let localSerial = config;
15
-
16
- if (input && typeof input === "object" && "inTableSpec" in input) {
17
- localTableSpec = input.inTableSpec;
18
- localSerial = input.inSerial || config;
19
- }
20
-
21
- const localSerialMerged = {
22
- col: { width: "50px" },
23
- header: { columnName: "#" },
24
- body: {},
25
- footer: {},
26
- ...localSerial
27
- };
28
-
29
- const registry = {
30
- data: {
31
- serial: localSerialMerged
32
- },
33
- base: localTableSpec,
34
- spec
35
- };
36
-
37
- runSingleInstructions(singleInstructions, registry, functions, spec, showLog, returnLog);
38
-
39
- const footerRow = findByRole(localTableSpec, "table-footer-row");
40
- if (footerRow && Array.isArray(footerRow.children) && footerRow.children.length > 0) {
41
- runSingleInstructions(footerInstructions, registry, functions, spec, showLog, returnLog);
42
- }
43
-
44
- return localTableSpec;
45
- };
46
-
47
- export default insertSerial;
1
+ import applyTemplate from "json-transformer-funcs-primitive";
2
+ import { findByRole } from "json-transformer-funcs";
3
+
4
+ import spec from "../../builders/spec.json" with { type: "json" };
5
+ import singleInstructions from "./instructions/single.json" with { type: "json" };
6
+ import footerInstructions from "./instructions/footer.json" with { type: "json" };
7
+
8
+ import runSingleInstructions from "../../singleInstruction/index.js";
9
+
10
+ const functions = { applyTemplate };
11
+
12
+ const insertSerial = (input = {}, config = {}, showLog = false, returnLog = []) => {
13
+ let localTableSpec = input;
14
+ let localSerial = config;
15
+
16
+ if (input && typeof input === "object" && "inTableSpec" in input) {
17
+ localTableSpec = input.inTableSpec;
18
+ localSerial = input.inSerial || config;
19
+ }
20
+
21
+ const localSerialMerged = {
22
+ col: { width: "50px" },
23
+ header: { columnName: "#" },
24
+ body: {},
25
+ footer: {},
26
+ ...localSerial
27
+ };
28
+
29
+ const registry = {
30
+ data: {
31
+ serial: localSerialMerged
32
+ },
33
+ base: localTableSpec,
34
+ spec
35
+ };
36
+
37
+ runSingleInstructions(singleInstructions, registry, functions, spec, showLog, returnLog);
38
+
39
+ const footerRow = findByRole(localTableSpec, "table-footer-row");
40
+ if (footerRow && Array.isArray(footerRow.children) && footerRow.children.length > 0) {
41
+ runSingleInstructions(footerInstructions, registry, functions, spec, showLog, returnLog);
42
+ }
43
+
44
+ return localTableSpec;
45
+ };
46
+
47
+ export default insertSerial;
@@ -1,22 +1,22 @@
1
- [
2
- {
3
- "narration": "Prepend an empty cell into the table footer row if footer row is present.",
4
- "destinationPath": {
5
- "fileName": "base",
6
- "dataRole": "table-footer-row",
7
- "filePath": [
8
- "children"
9
- ],
10
- "action": "unshift"
11
- },
12
- "sourcePath": {
13
- "fileName": "data",
14
- "filePath": [
15
- "serial",
16
- "footer"
17
- ]
18
- },
19
- "templateKey": "emptyCell",
20
- "func": "applyTemplate"
21
- }
22
- ]
1
+ [
2
+ {
3
+ "narration": "Prepend an empty cell into the table footer row if footer row is present.",
4
+ "destinationPath": {
5
+ "fileName": "base",
6
+ "dataRole": "table-footer-row",
7
+ "filePath": [
8
+ "children"
9
+ ],
10
+ "action": "unshift"
11
+ },
12
+ "sourcePath": {
13
+ "fileName": "data",
14
+ "filePath": [
15
+ "serial",
16
+ "footer"
17
+ ]
18
+ },
19
+ "templateKey": "emptyCell",
20
+ "func": "applyTemplate"
21
+ }
22
+ ]
@@ -1,62 +1,62 @@
1
- [
2
- {
3
- "narration": "Prepend the serial column width to the table colgroup.",
4
- "destinationPath": {
5
- "fileName": "base",
6
- "dataRole": "table-colgroup",
7
- "filePath": [
8
- "children"
9
- ],
10
- "action": "unshift"
11
- },
12
- "sourcePath": {
13
- "fileName": "data",
14
- "filePath": [
15
- "serial",
16
- "col"
17
- ]
18
- },
19
- "templateKey": "buildColGroup",
20
- "func": "applyTemplate"
21
- },
22
- {
23
- "narration": "Prepend the serial header cell to the table header row.",
24
- "destinationPath": {
25
- "fileName": "base",
26
- "dataRole": "table-header-row",
27
- "filePath": [
28
- "children"
29
- ],
30
- "action": "unshift"
31
- },
32
- "sourcePath": {
33
- "fileName": "data",
34
- "filePath": [
35
- "serial",
36
- "header"
37
- ]
38
- },
39
- "templateKey": "buildHeader",
40
- "func": "applyTemplate"
41
- },
42
- {
43
- "narration": "Prepend the serial number cell into each table body row.",
44
- "destinationPath": {
45
- "fileName": "base",
46
- "dataRole": "table-body",
47
- "filePath": [
48
- "children"
49
- ],
50
- "action": "unshiftSerialToRows"
51
- },
52
- "sourcePath": {
53
- "fileName": "data",
54
- "filePath": [
55
- "serial",
56
- "body"
57
- ]
58
- },
59
- "templateKey": "buildBodyCell",
60
- "func": "applyTemplate"
61
- }
62
- ]
1
+ [
2
+ {
3
+ "narration": "Prepend the serial column width to the table colgroup.",
4
+ "destinationPath": {
5
+ "fileName": "base",
6
+ "dataRole": "table-colgroup",
7
+ "filePath": [
8
+ "children"
9
+ ],
10
+ "action": "unshift"
11
+ },
12
+ "sourcePath": {
13
+ "fileName": "data",
14
+ "filePath": [
15
+ "serial",
16
+ "col"
17
+ ]
18
+ },
19
+ "templateKey": "buildColGroup",
20
+ "func": "applyTemplate"
21
+ },
22
+ {
23
+ "narration": "Prepend the serial header cell to the table header row.",
24
+ "destinationPath": {
25
+ "fileName": "base",
26
+ "dataRole": "table-header-row",
27
+ "filePath": [
28
+ "children"
29
+ ],
30
+ "action": "unshift"
31
+ },
32
+ "sourcePath": {
33
+ "fileName": "data",
34
+ "filePath": [
35
+ "serial",
36
+ "header"
37
+ ]
38
+ },
39
+ "templateKey": "buildHeader",
40
+ "func": "applyTemplate"
41
+ },
42
+ {
43
+ "narration": "Prepend the serial number cell into each table body row.",
44
+ "destinationPath": {
45
+ "fileName": "base",
46
+ "dataRole": "table-body",
47
+ "filePath": [
48
+ "children"
49
+ ],
50
+ "action": "unshiftSerialToRows"
51
+ },
52
+ "sourcePath": {
53
+ "fileName": "data",
54
+ "filePath": [
55
+ "serial",
56
+ "body"
57
+ ]
58
+ },
59
+ "templateKey": "buildBodyCell",
60
+ "func": "applyTemplate"
61
+ }
62
+ ]