json-renderers-build-table 1.28.1 → 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 (176) hide show
  1. package/package.json +2 -1
  2. package/src/index.js +2 -2
  3. package/src/{v28 → v29}/actions/index.js +1 -0
  4. package/src/v29/builders/simple/index.js +45 -0
  5. package/src/{v27 → v30}/actions/index.js +1 -0
  6. package/src/v30/builders/simple/index.js +45 -0
  7. package/src/v31/actions/index.js +30 -0
  8. package/src/v31/actions/insertSearch/index.js +7 -0
  9. package/src/v31/actions/insertSearch/instructions/template.json +20 -0
  10. package/src/v31/actions/instructionsForOptions.json +44 -0
  11. package/src/v31/actions/instructionsForSerial.json +44 -0
  12. package/src/v31/builders/simple/index.js +41 -0
  13. package/src/v31/builders/simpleSearch/instructions/single.json +38 -0
  14. package/src/v31/builders/withFooter/base.json +53 -0
  15. package/src/v31/builders/withFooter/instructions/double.json +19 -0
  16. package/src/v32/actions/index.js +28 -0
  17. package/src/v32/actions/insertSearch/index.js +7 -0
  18. package/src/v32/actions/insertSearch/instructions/template.json +20 -0
  19. package/src/{v28/actions/insertOptions/instructions/single.json → v32/actions/instructionsForOptions.json} +21 -25
  20. package/src/{v28/actions/insertSerial/instructions/single.json → v32/actions/instructionsForSerial.json} +22 -26
  21. package/src/v32/builders/bodyOnly/base.json +1 -0
  22. package/src/v32/builders/bodyOnly/index.js +18 -0
  23. package/src/v32/builders/bodyOnly/instructions/double.json +18 -0
  24. package/src/v32/builders/footerOnly/base.json +3 -0
  25. package/src/v32/builders/footerOnly/index.js +21 -0
  26. package/src/v32/builders/footerOnly/instructions/single.json +19 -0
  27. package/src/v32/builders/headerOnly/base.json +53 -0
  28. package/src/v32/builders/headerOnly/index.js +18 -0
  29. package/src/v32/builders/headerOnly/instructions/single.json +38 -0
  30. package/src/v32/builders/simple/base.json +53 -0
  31. package/src/v32/builders/simple/index.js +41 -0
  32. package/src/v32/builders/simple/instructions/double.json +19 -0
  33. package/src/v32/builders/simple/instructions/single.json +38 -0
  34. package/src/v32/builders/simpleSearch/base.json +53 -0
  35. package/src/v32/builders/simpleSearch/instructions/double.json +19 -0
  36. package/src/v32/builders/simpleSearch/instructions/single.json +38 -0
  37. package/src/v32/builders/spec.json +107 -0
  38. package/src/v32/builders/withFooter/base.json +53 -0
  39. package/src/v32/builders/withFooter/index.js +40 -0
  40. package/src/v32/builders/withFooter/instructions/double.json +19 -0
  41. package/src/v32/builders/withFooter/instructions/single.json +56 -0
  42. package/src/v32/doubleInstruction/index.js +21 -0
  43. package/src/v32/guards/index.js +10 -0
  44. package/src/v32/guards/references/func/index.js +8 -0
  45. package/src/v32/guards/references/index.js +9 -0
  46. package/src/v32/guards/references/templateKey/index.js +8 -0
  47. package/src/v32/guards/structure/destinationPath/index.js +8 -0
  48. package/src/v32/guards/structure/func/index.js +8 -0
  49. package/src/v32/guards/structure/index.js +15 -0
  50. package/src/v32/guards/structure/sourcePath/index.js +8 -0
  51. package/src/v32/guards/structure/templateKey/index.js +9 -0
  52. package/src/v32/index.js +21 -0
  53. package/src/v32/singleInstruction/index.js +32 -0
  54. package/src/v32/writePath/index.js +62 -0
  55. package/src/v26/actions/index.js +0 -20
  56. package/src/v28/actions/insertOptions/index.js +0 -47
  57. package/src/v28/actions/insertOptions/instructions/footer.json +0 -22
  58. package/src/v28/actions/insertSerial/index.js +0 -47
  59. package/src/v28/actions/insertSerial/instructions/footer.json +0 -22
  60. package/src/v28/builders/simpleSearch/index.js +0 -40
  61. /package/src/{v26 → v29}/actions/insertOptions/index.js +0 -0
  62. /package/src/{v26 → v29}/actions/insertOptions/instructions/footer.json +0 -0
  63. /package/src/{v26 → v29}/actions/insertOptions/instructions/single.json +0 -0
  64. /package/src/{v27 → v29}/actions/insertSearch/index.js +0 -0
  65. /package/src/{v27 → v29}/actions/insertSearch/instructions/template.json +0 -0
  66. /package/src/{v26 → v29}/actions/insertSerial/index.js +0 -0
  67. /package/src/{v26 → v29}/actions/insertSerial/instructions/footer.json +0 -0
  68. /package/src/{v26 → v29}/actions/insertSerial/instructions/single.json +0 -0
  69. /package/src/{v26 → v29}/builders/bodyOnly/base.json +0 -0
  70. /package/src/{v26 → v29}/builders/bodyOnly/index.js +0 -0
  71. /package/src/{v26 → v29}/builders/bodyOnly/instructions/double.json +0 -0
  72. /package/src/{v26 → v29}/builders/footerOnly/base.json +0 -0
  73. /package/src/{v26 → v29}/builders/footerOnly/index.js +0 -0
  74. /package/src/{v26 → v29}/builders/footerOnly/instructions/single.json +0 -0
  75. /package/src/{v26 → v29}/builders/headerOnly/base.json +0 -0
  76. /package/src/{v26 → v29}/builders/headerOnly/index.js +0 -0
  77. /package/src/{v26 → v29}/builders/headerOnly/instructions/single.json +0 -0
  78. /package/src/{v26 → v29}/builders/simple/base.json +0 -0
  79. /package/src/{v26 → v29}/builders/simple/instructions/double.json +0 -0
  80. /package/src/{v26 → v29}/builders/simple/instructions/single.json +0 -0
  81. /package/src/{v26/builders/withFooter → v29/builders/simpleSearch}/base.json +0 -0
  82. /package/src/{v26/builders/simple → v29/builders/simpleSearch}/index.js +0 -0
  83. /package/src/{v26/builders/withFooter → v29/builders/simpleSearch}/instructions/double.json +0 -0
  84. /package/src/{v27/builders/headerOnly → v29/builders/simpleSearch}/instructions/single.json +0 -0
  85. /package/src/{v26 → v29}/builders/spec.json +0 -0
  86. /package/src/{v27/builders/headerOnly → v29/builders/withFooter}/base.json +0 -0
  87. /package/src/{v26 → v29}/builders/withFooter/index.js +0 -0
  88. /package/src/{v27/builders/simple → v29/builders/withFooter}/instructions/double.json +0 -0
  89. /package/src/{v26 → v29}/builders/withFooter/instructions/single.json +0 -0
  90. /package/src/{v26 → v29}/doubleInstruction/index.js +0 -0
  91. /package/src/{v26 → v29}/guards/index.js +0 -0
  92. /package/src/{v26 → v29}/guards/references/func/index.js +0 -0
  93. /package/src/{v26 → v29}/guards/references/index.js +0 -0
  94. /package/src/{v26 → v29}/guards/references/templateKey/index.js +0 -0
  95. /package/src/{v26 → v29}/guards/structure/destinationPath/index.js +0 -0
  96. /package/src/{v26 → v29}/guards/structure/func/index.js +0 -0
  97. /package/src/{v26 → v29}/guards/structure/index.js +0 -0
  98. /package/src/{v26 → v29}/guards/structure/sourcePath/index.js +0 -0
  99. /package/src/{v26 → v29}/guards/structure/templateKey/index.js +0 -0
  100. /package/src/{v26 → v29}/index.js +0 -0
  101. /package/src/{v26 → v29}/singleInstruction/index.js +0 -0
  102. /package/src/{v26 → v29}/writePath/index.js +0 -0
  103. /package/src/{v27 → v30}/actions/insertOptions/index.js +0 -0
  104. /package/src/{v27 → v30}/actions/insertOptions/instructions/footer.json +0 -0
  105. /package/src/{v27 → v30}/actions/insertOptions/instructions/single.json +0 -0
  106. /package/src/{v28 → v30}/actions/insertSearch/index.js +0 -0
  107. /package/src/{v28 → v30}/actions/insertSearch/instructions/template.json +0 -0
  108. /package/src/{v27 → v30}/actions/insertSerial/index.js +0 -0
  109. /package/src/{v27 → v30}/actions/insertSerial/instructions/footer.json +0 -0
  110. /package/src/{v27 → v30}/actions/insertSerial/instructions/single.json +0 -0
  111. /package/src/{v27 → v30}/builders/bodyOnly/base.json +0 -0
  112. /package/src/{v27 → v30}/builders/bodyOnly/index.js +0 -0
  113. /package/src/{v27 → v30}/builders/bodyOnly/instructions/double.json +0 -0
  114. /package/src/{v27 → v30}/builders/footerOnly/base.json +0 -0
  115. /package/src/{v27 → v30}/builders/footerOnly/index.js +0 -0
  116. /package/src/{v27 → v30}/builders/footerOnly/instructions/single.json +0 -0
  117. /package/src/{v27/builders/simple → v30/builders/headerOnly}/base.json +0 -0
  118. /package/src/{v27 → v30}/builders/headerOnly/index.js +0 -0
  119. /package/src/{v27/builders/simple → v30/builders/headerOnly}/instructions/single.json +0 -0
  120. /package/src/{v27/builders/simpleSearch → v30/builders/simple}/base.json +0 -0
  121. /package/src/{v27/builders/simpleSearch → v30/builders/simple}/instructions/double.json +0 -0
  122. /package/src/{v27/builders/simpleSearch → v30/builders/simple}/instructions/single.json +0 -0
  123. /package/src/{v27/builders/withFooter → v30/builders/simpleSearch}/base.json +0 -0
  124. /package/src/{v27/builders/simple → v30/builders/simpleSearch}/index.js +0 -0
  125. /package/src/{v27/builders/withFooter → v30/builders/simpleSearch}/instructions/double.json +0 -0
  126. /package/src/{v28/builders/headerOnly → v30/builders/simpleSearch}/instructions/single.json +0 -0
  127. /package/src/{v27 → v30}/builders/spec.json +0 -0
  128. /package/src/{v28/builders/headerOnly → v30/builders/withFooter}/base.json +0 -0
  129. /package/src/{v27 → v30}/builders/withFooter/index.js +0 -0
  130. /package/src/{v28/builders/simple → v30/builders/withFooter}/instructions/double.json +0 -0
  131. /package/src/{v27 → v30}/builders/withFooter/instructions/single.json +0 -0
  132. /package/src/{v27 → v30}/doubleInstruction/index.js +0 -0
  133. /package/src/{v27 → v30}/guards/index.js +0 -0
  134. /package/src/{v27 → v30}/guards/references/func/index.js +0 -0
  135. /package/src/{v27 → v30}/guards/references/index.js +0 -0
  136. /package/src/{v27 → v30}/guards/references/templateKey/index.js +0 -0
  137. /package/src/{v27 → v30}/guards/structure/destinationPath/index.js +0 -0
  138. /package/src/{v27 → v30}/guards/structure/func/index.js +0 -0
  139. /package/src/{v27 → v30}/guards/structure/index.js +0 -0
  140. /package/src/{v27 → v30}/guards/structure/sourcePath/index.js +0 -0
  141. /package/src/{v27 → v30}/guards/structure/templateKey/index.js +0 -0
  142. /package/src/{v27 → v30}/index.js +0 -0
  143. /package/src/{v27 → v30}/singleInstruction/index.js +0 -0
  144. /package/src/{v27 → v30}/writePath/index.js +0 -0
  145. /package/src/{v28 → v31}/builders/bodyOnly/base.json +0 -0
  146. /package/src/{v28 → v31}/builders/bodyOnly/index.js +0 -0
  147. /package/src/{v28 → v31}/builders/bodyOnly/instructions/double.json +0 -0
  148. /package/src/{v28 → v31}/builders/footerOnly/base.json +0 -0
  149. /package/src/{v28 → v31}/builders/footerOnly/index.js +0 -0
  150. /package/src/{v28 → v31}/builders/footerOnly/instructions/single.json +0 -0
  151. /package/src/{v28/builders/simple → v31/builders/headerOnly}/base.json +0 -0
  152. /package/src/{v28 → v31}/builders/headerOnly/index.js +0 -0
  153. /package/src/{v28/builders/simple → v31/builders/headerOnly}/instructions/single.json +0 -0
  154. /package/src/{v28/builders/simpleSearch → v31/builders/simple}/base.json +0 -0
  155. /package/src/{v28/builders/simpleSearch → v31/builders/simple}/instructions/double.json +0 -0
  156. /package/src/{v28/builders/simpleSearch → v31/builders/simple}/instructions/single.json +0 -0
  157. /package/src/{v28/builders/withFooter → v31/builders/simpleSearch}/base.json +0 -0
  158. /package/src/{v27 → v31}/builders/simpleSearch/index.js +0 -0
  159. /package/src/{v28/builders/withFooter → v31/builders/simpleSearch}/instructions/double.json +0 -0
  160. /package/src/{v28 → v31}/builders/spec.json +0 -0
  161. /package/src/{v28 → v31}/builders/withFooter/index.js +0 -0
  162. /package/src/{v28 → v31}/builders/withFooter/instructions/single.json +0 -0
  163. /package/src/{v28 → v31}/doubleInstruction/index.js +0 -0
  164. /package/src/{v28 → v31}/guards/index.js +0 -0
  165. /package/src/{v28 → v31}/guards/references/func/index.js +0 -0
  166. /package/src/{v28 → v31}/guards/references/index.js +0 -0
  167. /package/src/{v28 → v31}/guards/references/templateKey/index.js +0 -0
  168. /package/src/{v28 → v31}/guards/structure/destinationPath/index.js +0 -0
  169. /package/src/{v28 → v31}/guards/structure/func/index.js +0 -0
  170. /package/src/{v28 → v31}/guards/structure/index.js +0 -0
  171. /package/src/{v28 → v31}/guards/structure/sourcePath/index.js +0 -0
  172. /package/src/{v28 → v31}/guards/structure/templateKey/index.js +0 -0
  173. /package/src/{v28 → v31}/index.js +0 -0
  174. /package/src/{v28 → v31}/singleInstruction/index.js +0 -0
  175. /package/src/{v28 → v31}/writePath/index.js +0 -0
  176. /package/src/{v28/builders/simple → v32/builders/simpleSearch}/index.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-renderers-build-table",
3
- "version": "1.28.1",
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,6 +18,7 @@
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
23
  "json-transformer-funcs-one-dimension": "^1.6.1",
23
24
  "json-transformer-funcs-primitive": "^1.9.3",
package/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./v28/index.js";
2
- export { default } from "./v28/index.js";
1
+ export * from "./v32/index.js";
2
+ export { default } from "./v32/index.js";
@@ -7,6 +7,7 @@ const startFunc = ({ inOptions = {}, inBase, showLog = false, returnLog = [] })
7
7
 
8
8
  const localBase = inBase;
9
9
 
10
+ console.log(localOptions)
10
11
  if (localOptions.showSerial || localOptions.serial) {
11
12
  insertSerial(localBase, localOptions.serial || {}, showLog, returnLog);
12
13
  }
@@ -0,0 +1,45 @@
1
+ import fromCollection from "json-transformer-funcs-one-dimension";
2
+ import twoDimensional from "json-transformer-funcs-two-dimensions";
3
+ import { runSingleInstructions, runDoubleInstructions } from "json-instructions";
4
+
5
+ import spec from "../spec.json" with { type: "json" };
6
+ import base from "./base.json" with { type: "json" };
7
+ import singleInstructions from "./instructions/single.json" with { type: "json" };
8
+ import doubleInstructions from "./instructions/double.json" with { type: "json" };
9
+
10
+ import actions from "../../actions/index.js";
11
+
12
+ const functions = { fromCollection, twoDimensional };
13
+
14
+ const startFunc = (inConfig = {}, showLog = false, returnLog = []) => {
15
+ const localConfig = inConfig;
16
+
17
+ const localColumns = localConfig.columns || [];
18
+ const localData = localConfig.data || [];
19
+ const localOptions = localConfig.options
20
+
21
+ const localBase = structuredClone(base);
22
+ const registry = {
23
+ data: {
24
+ columns: localColumns,
25
+ data: localData
26
+ },
27
+ base: localBase,
28
+ spec,
29
+ ...localOptions
30
+ };
31
+
32
+ console.log(" localOptions ", localOptions, registry)
33
+
34
+ runSingleInstructions(singleInstructions, registry, showLog, returnLog);
35
+ runDoubleInstructions(doubleInstructions, registry, showLog, returnLog);
36
+
37
+ // runDoubleInstructions(doubleInstructions, registry, functions, spec, showLog, returnLog);
38
+
39
+
40
+ actions({ inOptions: localOptions, inBase: localBase });
41
+
42
+ return localBase;
43
+ };
44
+
45
+ export default startFunc;
@@ -7,6 +7,7 @@ const startFunc = ({ inOptions = {}, inBase, showLog = false, returnLog = [] })
7
7
 
8
8
  const localBase = inBase;
9
9
 
10
+ console.log(localOptions)
10
11
  if (localOptions.showSerial || localOptions.serial) {
11
12
  insertSerial(localBase, localOptions.serial || {}, showLog, returnLog);
12
13
  }
@@ -0,0 +1,45 @@
1
+ import fromCollection from "json-transformer-funcs-one-dimension";
2
+ import twoDimensional from "json-transformer-funcs-two-dimensions";
3
+ import { runSingleInstructions, runDoubleInstructions } from "json-instructions";
4
+
5
+ import spec from "../spec.json" with { type: "json" };
6
+ import base from "./base.json" with { type: "json" };
7
+ import singleInstructions from "./instructions/single.json" with { type: "json" };
8
+ import doubleInstructions from "./instructions/double.json" with { type: "json" };
9
+
10
+ import actions from "../../actions/index.js";
11
+
12
+ const functions = { fromCollection, twoDimensional };
13
+
14
+ const startFunc = (inConfig = {}, showLog = false, returnLog = []) => {
15
+ const localConfig = inConfig;
16
+
17
+ const localColumns = localConfig.columns || [];
18
+ const localData = localConfig.data || [];
19
+ const localOptions = localConfig.options
20
+
21
+ const localBase = structuredClone(base);
22
+ const registry = {
23
+ data: {
24
+ columns: localColumns,
25
+ data: localData
26
+ },
27
+ base: localBase,
28
+ spec,
29
+ ...localOptions
30
+ };
31
+
32
+ console.log(" localOptions ", localOptions, registry)
33
+
34
+ runSingleInstructions(singleInstructions, registry, showLog, returnLog);
35
+ runDoubleInstructions(doubleInstructions, registry, showLog, returnLog);
36
+
37
+ // runDoubleInstructions(doubleInstructions, registry, functions, spec, showLog, returnLog);
38
+
39
+
40
+ actions({ inOptions: localOptions, inBase: localBase });
41
+
42
+ return localBase;
43
+ };
44
+
45
+ export default startFunc;
@@ -0,0 +1,30 @@
1
+ import { runSingleInstructions } from "json-instructions";
2
+
3
+ import insertSerial from "./insertSerial/index.js";
4
+ import insertOptions from "./insertOptions/index.js";
5
+ import insertSearch from "./insertSearch/index.js";
6
+
7
+ import serialInstructions from "./instructionsForSerial.json" with { type: "json" };
8
+ import optionInstructions from "./instructionsForOptions.json" with { type: "json" };
9
+
10
+ const startFunc = ({ inOptions = {}, inBase, showLog = false, returnLog = [] }) => {
11
+ const localOptions = inOptions;
12
+
13
+ const localBase = inBase;
14
+
15
+ if (localOptions.showSerial || localOptions.serial) {
16
+ runSingleInstructions(serialInstructions, { base: localBase }, showLog, returnLog);
17
+ };
18
+
19
+ if (localOptions.showOptions || localOptions.options) {
20
+ runSingleInstructions(optionInstructions, { base: localBase }, showLog, returnLog);
21
+ };
22
+
23
+ if (localOptions.showSearch) {
24
+ insertSearch();
25
+ };
26
+
27
+ return localBase;
28
+ };
29
+
30
+ export default startFunc;
@@ -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
+ }
@@ -0,0 +1,44 @@
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": null,
13
+ "templateKey": "colGroupForOption",
14
+ "func": null
15
+ },
16
+ {
17
+ "narration": "Append the options header cell to the table header row.",
18
+ "destinationPath": {
19
+ "fileName": "base",
20
+ "dataRole": "table-header-row",
21
+ "filePath": [
22
+ "children"
23
+ ],
24
+ "action": "push"
25
+ },
26
+ "sourcePath": null,
27
+ "templateKey": "headerForOption",
28
+ "func": null
29
+ },
30
+ {
31
+ "narration": "Append the options button cell into each table body row.",
32
+ "destinationPath": {
33
+ "fileName": "base",
34
+ "dataRole": "table-body",
35
+ "filePath": [
36
+ "children"
37
+ ],
38
+ "action": "pushToRows"
39
+ },
40
+ "sourcePath": null,
41
+ "templateKey": "optionsButtonCell",
42
+ "func": null
43
+ }
44
+ ]
@@ -0,0 +1,44 @@
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": null,
13
+ "templateKey": "colGroupForSerial",
14
+ "func": null
15
+ },
16
+ {
17
+ "narration": "Prepend the serial header cell to the table header row.",
18
+ "destinationPath": {
19
+ "fileName": "base",
20
+ "dataRole": "table-header-row",
21
+ "filePath": [
22
+ "children"
23
+ ],
24
+ "action": "unshift"
25
+ },
26
+ "sourcePath": null,
27
+ "templateKey": "headerSerialCell",
28
+ "func": null
29
+ },
30
+ {
31
+ "narration": "Prepend the serial number cell into each table body row.",
32
+ "destinationPath": {
33
+ "fileName": "base",
34
+ "dataRole": "table-body",
35
+ "filePath": [
36
+ "children"
37
+ ],
38
+ "action": "unshiftSerialToRows"
39
+ },
40
+ "sourcePath": null,
41
+ "templateKey": "buildBodyCell",
42
+ "func": null
43
+ }
44
+ ]
@@ -0,0 +1,41 @@
1
+ import fromCollection from "json-transformer-funcs-one-dimension";
2
+ import twoDimensional from "json-transformer-funcs-two-dimensions";
3
+
4
+ import spec from "../spec.json" with { type: "json" };
5
+ import base from "./base.json" with { type: "json" };
6
+ import singleInstructions from "./instructions/single.json" with { type: "json" };
7
+ import doubleInstructions from "./instructions/double.json" with { type: "json" };
8
+
9
+ import runSingleInstructions from "../../singleInstruction/index.js";
10
+ import runDoubleInstructions from "../../doubleInstruction/index.js";
11
+ import actions from "../../actions/index.js";
12
+
13
+ const functions = { fromCollection, twoDimensional };
14
+
15
+ const startFunc = (inConfig = {}, showLog = false, returnLog = []) => {
16
+ const localConfig = inConfig;
17
+
18
+ const localColumns = localConfig.columns || [];
19
+ const localData = localConfig.data || [];
20
+ const localOptions = localConfig.options || {};
21
+
22
+ const localBase = structuredClone(base);
23
+ const registry = {
24
+ data: {
25
+ columns: localColumns,
26
+ data: localData
27
+ },
28
+ base: localBase,
29
+ spec,
30
+ ...localOptions
31
+ };
32
+
33
+ runSingleInstructions(singleInstructions, registry, functions, spec, showLog, returnLog);
34
+ runDoubleInstructions(doubleInstructions, registry, functions, spec, showLog, returnLog);
35
+
36
+ actions({ inOptions: localOptions, inBase: localBase });
37
+
38
+ return localBase;
39
+ };
40
+
41
+ export default startFunc;
@@ -0,0 +1,38 @@
1
+ [
2
+ {
3
+ "narration": "Build the column widths for the table using the configured columns.",
4
+ "destinationPath": {
5
+ "fileName": "base",
6
+ "dataRole": "table-colgroup",
7
+ "filePath": [
8
+ "children"
9
+ ]
10
+ },
11
+ "sourcePath": {
12
+ "fileName": "data",
13
+ "filePath": [
14
+ "columns"
15
+ ]
16
+ },
17
+ "templateKey": "buildColGroup",
18
+ "func": "fromCollection"
19
+ },
20
+ {
21
+ "narration": "Build the header row for the table using the configured columns.",
22
+ "destinationPath": {
23
+ "fileName": "base",
24
+ "dataRole": "table-header-row",
25
+ "filePath": [
26
+ "children"
27
+ ]
28
+ },
29
+ "sourcePath": {
30
+ "fileName": "data",
31
+ "filePath": [
32
+ "columns"
33
+ ]
34
+ },
35
+ "templateKey": "buildHeader",
36
+ "func": "fromCollection"
37
+ }
38
+ ]
@@ -0,0 +1,53 @@
1
+ {
2
+ "tagName": "table",
3
+ "attributes": {
4
+ "class": "table table-hover table-striped align-middle border mb-0"
5
+ },
6
+ "children": [
7
+ {
8
+ "tagName": "colgroup",
9
+ "attributes": {
10
+ "data-role": "table-colgroup"
11
+ },
12
+ "children": []
13
+ },
14
+ {
15
+ "tagName": "thead",
16
+ "attributes": {
17
+ "class": "table-dark",
18
+ "data-role": "table-header"
19
+ },
20
+ "children": [
21
+ {
22
+ "tagName": "tr",
23
+ "attributes": {
24
+ "data-role": "table-header-row"
25
+ },
26
+ "children": []
27
+ }
28
+ ]
29
+ },
30
+ {
31
+ "tagName": "tbody",
32
+ "attributes": {
33
+ "data-role": "table-body"
34
+ },
35
+ "children": []
36
+ },
37
+ {
38
+ "tagName": "tfoot",
39
+ "attributes": {
40
+ "data-role": "table-footer"
41
+ },
42
+ "children": [
43
+ {
44
+ "tagName": "tr",
45
+ "attributes": {
46
+ "data-role": "table-footer-row"
47
+ },
48
+ "children": []
49
+ }
50
+ ]
51
+ }
52
+ ]
53
+ }
@@ -0,0 +1,19 @@
1
+ [
2
+ {
3
+ "narration": "Build the table body rows for the table using the configured columns and data.",
4
+ "destinationPath": {
5
+ "fileName": "base",
6
+ "dataRole": "table-body",
7
+ "filePath": [
8
+ "children"
9
+ ]
10
+ },
11
+ "sourcePath": {
12
+ "fileName": "data",
13
+ "filePath": [
14
+ "columns"
15
+ ]
16
+ },
17
+ "func": "twoDimensional"
18
+ }
19
+ ]
@@ -0,0 +1,28 @@
1
+ import { runSingleInstructions } from "json-instructions";
2
+
3
+ import insertSearch from "./insertSearch/index.js";
4
+
5
+ import serialInstructions from "./instructionsForSerial.json" with { type: "json" };
6
+ import optionInstructions from "./instructionsForOptions.json" with { type: "json" };
7
+
8
+ const startFunc = ({ inOptions = {}, inBase, showLog = false, returnLog = [] }) => {
9
+ const localOptions = inOptions;
10
+
11
+ const localBase = inBase;
12
+
13
+ if (localOptions.showSerial || localOptions.serial) {
14
+ runSingleInstructions(serialInstructions, { base: localBase }, showLog, returnLog);
15
+ };
16
+
17
+ if (localOptions.showOptions || localOptions.options) {
18
+ runSingleInstructions(optionInstructions, { base: localBase }, showLog, returnLog);
19
+ };
20
+
21
+ if (localOptions.showSearch) {
22
+ insertSearch();
23
+ };
24
+
25
+ return localBase;
26
+ };
27
+
28
+ export default startFunc;
@@ -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
+ }
@@ -9,15 +9,9 @@
9
9
  ],
10
10
  "action": "push"
11
11
  },
12
- "sourcePath": {
13
- "fileName": "data",
14
- "filePath": [
15
- "options",
16
- "col"
17
- ]
18
- },
19
- "templateKey": "buildColGroup",
20
- "func": "applyTemplate"
12
+ "sourcePath": null,
13
+ "templateKey": "colGroupForOption",
14
+ "func": null
21
15
  },
22
16
  {
23
17
  "narration": "Append the options header cell to the table header row.",
@@ -29,15 +23,9 @@
29
23
  ],
30
24
  "action": "push"
31
25
  },
32
- "sourcePath": {
33
- "fileName": "data",
34
- "filePath": [
35
- "options",
36
- "header"
37
- ]
38
- },
39
- "templateKey": "buildHeader",
40
- "func": "applyTemplate"
26
+ "sourcePath": null,
27
+ "templateKey": "headerForOption",
28
+ "func": null
41
29
  },
42
30
  {
43
31
  "narration": "Append the options button cell into each table body row.",
@@ -49,14 +37,22 @@
49
37
  ],
50
38
  "action": "pushToRows"
51
39
  },
52
- "sourcePath": {
53
- "fileName": "data",
40
+ "sourcePath": null,
41
+ "templateKey": "optionsButtonCell",
42
+ "func": null
43
+ },
44
+ {
45
+ "narration": "Append the options footer cell to the table footer row.",
46
+ "destinationPath": {
47
+ "fileName": "base",
48
+ "dataRole": "table-footer-row",
54
49
  "filePath": [
55
- "options",
56
- "body"
57
- ]
50
+ "children"
51
+ ],
52
+ "action": "push"
58
53
  },
54
+ "sourcePath": null,
59
55
  "templateKey": "optionsButtonCell",
60
- "func": "applyTemplate"
56
+ "func": null
61
57
  }
62
- ]
58
+ ]
@@ -9,15 +9,9 @@
9
9
  ],
10
10
  "action": "unshift"
11
11
  },
12
- "sourcePath": {
13
- "fileName": "data",
14
- "filePath": [
15
- "serial",
16
- "col"
17
- ]
18
- },
19
- "templateKey": "buildColGroup",
20
- "func": "applyTemplate"
12
+ "sourcePath": null,
13
+ "templateKey": "colGroupForSerial",
14
+ "func": null
21
15
  },
22
16
  {
23
17
  "narration": "Prepend the serial header cell to the table header row.",
@@ -29,15 +23,9 @@
29
23
  ],
30
24
  "action": "unshift"
31
25
  },
32
- "sourcePath": {
33
- "fileName": "data",
34
- "filePath": [
35
- "serial",
36
- "header"
37
- ]
38
- },
39
- "templateKey": "buildHeader",
40
- "func": "applyTemplate"
26
+ "sourcePath": null,
27
+ "templateKey": "headerSerialCell",
28
+ "func": null
41
29
  },
42
30
  {
43
31
  "narration": "Prepend the serial number cell into each table body row.",
@@ -49,14 +37,22 @@
49
37
  ],
50
38
  "action": "unshiftSerialToRows"
51
39
  },
52
- "sourcePath": {
53
- "fileName": "data",
40
+ "sourcePath": null,
41
+ "templateKey": "buildBodyCell",
42
+ "func": null
43
+ },
44
+ {
45
+ "narration": "Prepend the serial footer cell to the table footer row.",
46
+ "destinationPath": {
47
+ "fileName": "base",
48
+ "dataRole": "table-footer-row",
54
49
  "filePath": [
55
- "serial",
56
- "body"
57
- ]
50
+ "children"
51
+ ],
52
+ "action": "unshift"
58
53
  },
59
- "templateKey": "buildBodyCell",
60
- "func": "applyTemplate"
54
+ "sourcePath": null,
55
+ "templateKey": "headerSerialCell",
56
+ "func": null
61
57
  }
62
- ]
58
+ ]
@@ -0,0 +1 @@
1
+ { "children": [] }
@@ -0,0 +1,18 @@
1
+ import twoDimensional from "json-transformer-funcs-two-dimensions";
2
+
3
+ import spec from "../spec.json" with { type: "json" };
4
+ import base from "./base.json" with { type: "json" };
5
+ import doubleInstructions from "./instructions/double.json" with { type: "json" };
6
+
7
+ import runDoubleInstructions from "../../doubleInstruction/index.js";
8
+
9
+ const registry = { data: {}, base, spec };
10
+ const functions = { twoDimensional };
11
+
12
+ const startFunc = (data, showLog = false, returnLog = []) => {
13
+ registry.data = data;
14
+ runDoubleInstructions(doubleInstructions, registry, functions, spec, showLog, returnLog);
15
+ return base.children;
16
+ };
17
+
18
+ export default startFunc;