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.
- package/package.json +5 -4
- package/src/index.js +2 -2
- package/src/{v26 → v29}/actions/index.js +25 -19
- package/src/{v26 → v29}/actions/insertOptions/index.js +47 -47
- package/src/{v24 → v29}/actions/insertOptions/instructions/footer.json +22 -22
- package/src/{v26 → v29}/actions/insertOptions/instructions/single.json +62 -62
- package/src/v29/actions/insertSearch/index.js +7 -0
- package/src/v29/actions/insertSearch/instructions/template.json +20 -0
- package/src/{v26 → v29}/actions/insertSerial/index.js +47 -47
- package/src/{v26 → v29}/actions/insertSerial/instructions/footer.json +22 -22
- package/src/{v24 → v29}/actions/insertSerial/instructions/single.json +62 -62
- package/src/v29/builders/simple/index.js +45 -0
- package/src/{v26/builders/simple → v29/builders/simpleSearch}/index.js +40 -40
- package/src/{v25 → v29}/builders/withFooter/index.js +40 -40
- package/src/{v25 → v29}/index.js +21 -21
- package/src/{v25 → v30}/actions/index.js +25 -19
- package/src/{v24 → v30}/actions/insertOptions/index.js +47 -47
- package/src/{v26 → v30}/actions/insertOptions/instructions/footer.json +22 -22
- package/src/{v25 → v30}/actions/insertOptions/instructions/single.json +62 -62
- package/src/v30/actions/insertSearch/index.js +7 -0
- package/src/v30/actions/insertSearch/instructions/template.json +20 -0
- package/src/{v24 → v30}/actions/insertSerial/index.js +47 -47
- package/src/{v24 → v30}/actions/insertSerial/instructions/footer.json +22 -22
- package/src/{v26 → v30}/actions/insertSerial/instructions/single.json +62 -62
- package/src/v30/builders/simple/index.js +45 -0
- package/src/{v25/builders/simple → v30/builders/simpleSearch}/index.js +40 -40
- package/src/{v26 → v30}/builders/withFooter/index.js +40 -40
- package/src/{v26 → v30}/index.js +21 -21
- package/src/{v24 → v30}/singleInstruction/index.js +5 -5
- package/src/v31/actions/index.js +30 -0
- package/src/v31/actions/insertSearch/index.js +7 -0
- package/src/v31/actions/insertSearch/instructions/template.json +20 -0
- package/src/v31/actions/instructionsForOptions.json +44 -0
- package/src/v31/actions/instructionsForSerial.json +44 -0
- package/src/v31/builders/simple/index.js +41 -0
- package/src/v31/builders/simpleSearch/index.js +40 -0
- package/src/v31/builders/withFooter/index.js +40 -0
- package/src/{v22 → v31}/index.js +7 -1
- package/src/{v25 → v31}/singleInstruction/index.js +5 -5
- package/src/v32/actions/index.js +28 -0
- package/src/v32/actions/insertSearch/index.js +7 -0
- package/src/v32/actions/insertSearch/instructions/template.json +20 -0
- package/src/{v24/actions/insertOptions/instructions/single.json → v32/actions/instructionsForOptions.json} +58 -62
- package/src/{v25/actions/insertSerial/instructions/single.json → v32/actions/instructionsForSerial.json} +58 -62
- package/src/v32/builders/simple/index.js +41 -0
- package/src/v32/builders/simple/instructions/single.json +38 -0
- package/src/v32/builders/simpleSearch/index.js +40 -0
- package/src/v32/builders/simpleSearch/instructions/double.json +19 -0
- package/src/v32/builders/simpleSearch/instructions/single.json +38 -0
- package/src/{v23 → v32}/builders/spec.json +4 -0
- package/src/v32/builders/withFooter/index.js +40 -0
- package/src/v32/builders/withFooter/instructions/double.json +19 -0
- package/src/{v23 → v32}/index.js +21 -34
- package/src/{v22 → v32}/singleInstruction/index.js +5 -5
- package/src/v22/builders/simple/index.js +0 -22
- package/src/v22/builders/spec.json +0 -88
- package/src/v22/builders/withFooter/index.js +0 -24
- package/src/v23/builders/simple/index.js +0 -22
- package/src/v23/builders/withFooter/index.js +0 -24
- package/src/v23/builders/withOptions/index.js +0 -51
- package/src/v23/builders/withOptions/instructions/double.json +0 -19
- package/src/v23/builders/withOptions/instructions/postSingle.json +0 -22
- package/src/v23/builders/withOptions/instructions/single.json +0 -78
- package/src/v23/builders/withSerial/index.js +0 -51
- package/src/v23/builders/withSerial/instructions/double.json +0 -19
- package/src/v23/builders/withSerial/instructions/postSingle.json +0 -22
- package/src/v23/builders/withSerial/instructions/single.json +0 -78
- package/src/v23/singleInstruction/index.js +0 -32
- package/src/v24/actions/index.js +0 -5
- package/src/v24/builders/simple/index.js +0 -49
- package/src/v24/builders/withFooter/index.js +0 -49
- package/src/v24/index.js +0 -71
- package/src/v25/actions/insertOptions/index.js +0 -47
- package/src/v25/actions/insertOptions/instructions/footer.json +0 -22
- package/src/v25/actions/insertSerial/index.js +0 -47
- package/src/v25/actions/insertSerial/instructions/footer.json +0 -22
- package/src/v26/builders/bodyOnly/base.json +0 -1
- package/src/v26/builders/bodyOnly/index.js +0 -18
- package/src/v26/builders/bodyOnly/instructions/double.json +0 -18
- package/src/v26/builders/footerOnly/base.json +0 -3
- package/src/v26/builders/footerOnly/index.js +0 -21
- package/src/v26/builders/footerOnly/instructions/single.json +0 -19
- package/src/v26/builders/headerOnly/index.js +0 -18
- package/src/v26/builders/withFooter/base.json +0 -53
- package/src/v26/builders/withFooter/instructions/single.json +0 -56
- package/src/v26/doubleInstruction/index.js +0 -21
- package/src/v26/guards/index.js +0 -10
- package/src/v26/guards/references/func/index.js +0 -8
- package/src/v26/guards/references/index.js +0 -9
- package/src/v26/guards/references/templateKey/index.js +0 -8
- package/src/v26/guards/structure/destinationPath/index.js +0 -8
- package/src/v26/guards/structure/func/index.js +0 -8
- package/src/v26/guards/structure/index.js +0 -15
- package/src/v26/guards/structure/sourcePath/index.js +0 -8
- package/src/v26/guards/structure/templateKey/index.js +0 -9
- package/src/v26/writePath/index.js +0 -62
- /package/src/{v22 → v29}/builders/bodyOnly/base.json +0 -0
- /package/src/{v22 → v29}/builders/bodyOnly/index.js +0 -0
- /package/src/{v22 → v29}/builders/bodyOnly/instructions/double.json +0 -0
- /package/src/{v22 → v29}/builders/footerOnly/base.json +0 -0
- /package/src/{v22 → v29}/builders/footerOnly/index.js +0 -0
- /package/src/{v22 → v29}/builders/footerOnly/instructions/single.json +0 -0
- /package/src/{v22 → v29}/builders/headerOnly/base.json +0 -0
- /package/src/{v22 → v29}/builders/headerOnly/index.js +0 -0
- /package/src/{v22 → v29}/builders/headerOnly/instructions/single.json +0 -0
- /package/src/{v22 → v29}/builders/simple/base.json +0 -0
- /package/src/{v22 → v29}/builders/simple/instructions/double.json +0 -0
- /package/src/{v22 → v29}/builders/simple/instructions/single.json +0 -0
- /package/src/{v22/builders/withFooter → v29/builders/simpleSearch}/base.json +0 -0
- /package/src/{v22/builders/withFooter → v29/builders/simpleSearch}/instructions/double.json +0 -0
- /package/src/{v23/builders/headerOnly → v29/builders/simpleSearch}/instructions/single.json +0 -0
- /package/src/{v24 → v29}/builders/spec.json +0 -0
- /package/src/{v23/builders/headerOnly → v29/builders/withFooter}/base.json +0 -0
- /package/src/{v23/builders/simple → v29/builders/withFooter}/instructions/double.json +0 -0
- /package/src/{v22 → v29}/builders/withFooter/instructions/single.json +0 -0
- /package/src/{v22 → v29}/doubleInstruction/index.js +0 -0
- /package/src/{v22 → v29}/guards/index.js +0 -0
- /package/src/{v22 → v29}/guards/references/func/index.js +0 -0
- /package/src/{v22 → v29}/guards/references/index.js +0 -0
- /package/src/{v22 → v29}/guards/references/templateKey/index.js +0 -0
- /package/src/{v22 → v29}/guards/structure/destinationPath/index.js +0 -0
- /package/src/{v22 → v29}/guards/structure/func/index.js +0 -0
- /package/src/{v22 → v29}/guards/structure/index.js +0 -0
- /package/src/{v22 → v29}/guards/structure/sourcePath/index.js +0 -0
- /package/src/{v22 → v29}/guards/structure/templateKey/index.js +0 -0
- /package/src/{v26 → v29}/singleInstruction/index.js +0 -0
- /package/src/{v22 → v29}/writePath/index.js +0 -0
- /package/src/{v23 → v30}/builders/bodyOnly/base.json +0 -0
- /package/src/{v23 → v30}/builders/bodyOnly/index.js +0 -0
- /package/src/{v23 → v30}/builders/bodyOnly/instructions/double.json +0 -0
- /package/src/{v23 → v30}/builders/footerOnly/base.json +0 -0
- /package/src/{v23 → v30}/builders/footerOnly/index.js +0 -0
- /package/src/{v23 → v30}/builders/footerOnly/instructions/single.json +0 -0
- /package/src/{v23/builders/simple → v30/builders/headerOnly}/base.json +0 -0
- /package/src/{v23 → v30}/builders/headerOnly/index.js +0 -0
- /package/src/{v23/builders/simple → v30/builders/headerOnly}/instructions/single.json +0 -0
- /package/src/{v23/builders/withFooter → v30/builders/simple}/base.json +0 -0
- /package/src/{v23/builders/withFooter → v30/builders/simple}/instructions/double.json +0 -0
- /package/src/{v24/builders/headerOnly → v30/builders/simple}/instructions/single.json +0 -0
- /package/src/{v23/builders/withOptions → v30/builders/simpleSearch}/base.json +0 -0
- /package/src/{v24/builders/simple → v30/builders/simpleSearch}/instructions/double.json +0 -0
- /package/src/{v24/builders/simple → v30/builders/simpleSearch}/instructions/single.json +0 -0
- /package/src/{v25 → v30}/builders/spec.json +0 -0
- /package/src/{v23/builders/withSerial → v30/builders/withFooter}/base.json +0 -0
- /package/src/{v24 → v30}/builders/withFooter/instructions/double.json +0 -0
- /package/src/{v23 → v30}/builders/withFooter/instructions/single.json +0 -0
- /package/src/{v23 → v30}/doubleInstruction/index.js +0 -0
- /package/src/{v23 → v30}/guards/index.js +0 -0
- /package/src/{v23 → v30}/guards/references/func/index.js +0 -0
- /package/src/{v23 → v30}/guards/references/index.js +0 -0
- /package/src/{v23 → v30}/guards/references/templateKey/index.js +0 -0
- /package/src/{v23 → v30}/guards/structure/destinationPath/index.js +0 -0
- /package/src/{v23 → v30}/guards/structure/func/index.js +0 -0
- /package/src/{v23 → v30}/guards/structure/index.js +0 -0
- /package/src/{v23 → v30}/guards/structure/sourcePath/index.js +0 -0
- /package/src/{v23 → v30}/guards/structure/templateKey/index.js +0 -0
- /package/src/{v23 → v30}/writePath/index.js +0 -0
- /package/src/{v24 → v31}/builders/bodyOnly/base.json +0 -0
- /package/src/{v24 → v31}/builders/bodyOnly/index.js +0 -0
- /package/src/{v24 → v31}/builders/bodyOnly/instructions/double.json +0 -0
- /package/src/{v24 → v31}/builders/footerOnly/base.json +0 -0
- /package/src/{v24 → v31}/builders/footerOnly/index.js +0 -0
- /package/src/{v24 → v31}/builders/footerOnly/instructions/single.json +0 -0
- /package/src/{v24 → v31}/builders/headerOnly/base.json +0 -0
- /package/src/{v24 → v31}/builders/headerOnly/index.js +0 -0
- /package/src/{v25 → v31}/builders/headerOnly/instructions/single.json +0 -0
- /package/src/{v24 → v31}/builders/simple/base.json +0 -0
- /package/src/{v25 → v31}/builders/simple/instructions/double.json +0 -0
- /package/src/{v25 → v31}/builders/simple/instructions/single.json +0 -0
- /package/src/{v24/builders/withFooter → v31/builders/simpleSearch}/base.json +0 -0
- /package/src/{v25/builders/withFooter → v31/builders/simpleSearch}/instructions/double.json +0 -0
- /package/src/{v26/builders/headerOnly → v31/builders/simpleSearch}/instructions/single.json +0 -0
- /package/src/{v26 → v31}/builders/spec.json +0 -0
- /package/src/{v25/builders/headerOnly → v31/builders/withFooter}/base.json +0 -0
- /package/src/{v26/builders/simple → v31/builders/withFooter}/instructions/double.json +0 -0
- /package/src/{v24 → v31}/builders/withFooter/instructions/single.json +0 -0
- /package/src/{v24 → v31}/doubleInstruction/index.js +0 -0
- /package/src/{v24 → v31}/guards/index.js +0 -0
- /package/src/{v24 → v31}/guards/references/func/index.js +0 -0
- /package/src/{v24 → v31}/guards/references/index.js +0 -0
- /package/src/{v24 → v31}/guards/references/templateKey/index.js +0 -0
- /package/src/{v24 → v31}/guards/structure/destinationPath/index.js +0 -0
- /package/src/{v24 → v31}/guards/structure/func/index.js +0 -0
- /package/src/{v24 → v31}/guards/structure/index.js +0 -0
- /package/src/{v24 → v31}/guards/structure/sourcePath/index.js +0 -0
- /package/src/{v24 → v31}/guards/structure/templateKey/index.js +0 -0
- /package/src/{v24 → v31}/writePath/index.js +0 -0
- /package/src/{v25 → v32}/builders/bodyOnly/base.json +0 -0
- /package/src/{v25 → v32}/builders/bodyOnly/index.js +0 -0
- /package/src/{v25 → v32}/builders/bodyOnly/instructions/double.json +0 -0
- /package/src/{v25 → v32}/builders/footerOnly/base.json +0 -0
- /package/src/{v25 → v32}/builders/footerOnly/index.js +0 -0
- /package/src/{v25 → v32}/builders/footerOnly/instructions/single.json +0 -0
- /package/src/{v25/builders/simple → v32/builders/headerOnly}/base.json +0 -0
- /package/src/{v25 → v32}/builders/headerOnly/index.js +0 -0
- /package/src/{v26/builders/simple → v32/builders/headerOnly}/instructions/single.json +0 -0
- /package/src/{v25/builders/withFooter → v32/builders/simple}/base.json +0 -0
- /package/src/{v26/builders/withFooter → v32/builders/simple}/instructions/double.json +0 -0
- /package/src/{v26/builders/headerOnly → v32/builders/simpleSearch}/base.json +0 -0
- /package/src/{v26/builders/simple → v32/builders/withFooter}/base.json +0 -0
- /package/src/{v25 → v32}/builders/withFooter/instructions/single.json +0 -0
- /package/src/{v25 → v32}/doubleInstruction/index.js +0 -0
- /package/src/{v25 → v32}/guards/index.js +0 -0
- /package/src/{v25 → v32}/guards/references/func/index.js +0 -0
- /package/src/{v25 → v32}/guards/references/index.js +0 -0
- /package/src/{v25 → v32}/guards/references/templateKey/index.js +0 -0
- /package/src/{v25 → v32}/guards/structure/destinationPath/index.js +0 -0
- /package/src/{v25 → v32}/guards/structure/func/index.js +0 -0
- /package/src/{v25 → v32}/guards/structure/index.js +0 -0
- /package/src/{v25 → v32}/guards/structure/sourcePath/index.js +0 -0
- /package/src/{v25 → v32}/guards/structure/templateKey/index.js +0 -0
- /package/src/{v25 → v32}/writePath/index.js +0 -0
|
@@ -1,78 +0,0 @@
|
|
|
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
|
-
{
|
|
39
|
-
"narration": "Prepend the serial column width to the table colgroup.",
|
|
40
|
-
"destinationPath": {
|
|
41
|
-
"fileName": "base",
|
|
42
|
-
"dataRole": "table-colgroup",
|
|
43
|
-
"filePath": [
|
|
44
|
-
"children"
|
|
45
|
-
],
|
|
46
|
-
"action": "unshift"
|
|
47
|
-
},
|
|
48
|
-
"sourcePath": {
|
|
49
|
-
"fileName": "data",
|
|
50
|
-
"filePath": [
|
|
51
|
-
"serial",
|
|
52
|
-
"col"
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
"templateKey": "buildColGroup",
|
|
56
|
-
"func": "applyTemplate"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"narration": "Prepend the serial header cell to the table header row.",
|
|
60
|
-
"destinationPath": {
|
|
61
|
-
"fileName": "base",
|
|
62
|
-
"dataRole": "table-header-row",
|
|
63
|
-
"filePath": [
|
|
64
|
-
"children"
|
|
65
|
-
],
|
|
66
|
-
"action": "unshift"
|
|
67
|
-
},
|
|
68
|
-
"sourcePath": {
|
|
69
|
-
"fileName": "data",
|
|
70
|
-
"filePath": [
|
|
71
|
-
"serial",
|
|
72
|
-
"header"
|
|
73
|
-
]
|
|
74
|
-
},
|
|
75
|
-
"templateKey": "buildHeader",
|
|
76
|
-
"func": "applyTemplate"
|
|
77
|
-
}
|
|
78
|
-
]
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { resolvePath } from "json-transformer-funcs";
|
|
2
|
-
import writePath from "../writePath/index.js";
|
|
3
|
-
import checkInstruction from "../guards/index.js";
|
|
4
|
-
|
|
5
|
-
const runSingleInstruction = (instruction, registry, functions, spec, showLog, returnLog) => {
|
|
6
|
-
if (!checkInstruction(instruction, functions, spec, showLog, returnLog)) return;
|
|
7
|
-
|
|
8
|
-
const localSpec = spec;
|
|
9
|
-
const templateKey = instruction.templateKey;
|
|
10
|
-
const localSpecKey = localSpec[templateKey];
|
|
11
|
-
|
|
12
|
-
console.log("templateKey ; ", templateKey);
|
|
13
|
-
console.log("localSpecKey ; ", localSpecKey);
|
|
14
|
-
|
|
15
|
-
const source = resolvePath(registry, instruction.sourcePath);
|
|
16
|
-
const result = functions[instruction.func](source, localSpecKey);
|
|
17
|
-
|
|
18
|
-
if (templateKey === "buildFooter") {
|
|
19
|
-
console.log("result ; ", result);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
writePath(registry, instruction.destinationPath, result);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const runSingleInstructions = (instructions, registry, functions, spec, showLog, returnLog) => {
|
|
26
|
-
instructions.forEach(instruction => {
|
|
27
|
-
runSingleInstruction(instruction, registry, functions, spec, showLog, returnLog);
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { runSingleInstruction, runSingleInstructions };
|
|
32
|
-
export default runSingleInstructions;
|
package/src/v24/actions/index.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
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 insertSerial from "../../actions/insertSerial/index.js";
|
|
12
|
-
import insertOptions from "../../actions/insertOptions/index.js";
|
|
13
|
-
|
|
14
|
-
const functions = { fromCollection, twoDimensional };
|
|
15
|
-
|
|
16
|
-
const startFunc = (inConfig = {}, showLog = false, returnLog = []) => {
|
|
17
|
-
const localConfig = (inConfig && typeof inConfig === "object" && "inConfig" in inConfig)
|
|
18
|
-
? inConfig.inConfig
|
|
19
|
-
: inConfig;
|
|
20
|
-
|
|
21
|
-
const localColumns = localConfig.inColumns || localConfig.columns || [];
|
|
22
|
-
const localData = localConfig.inData || localConfig.data || [];
|
|
23
|
-
const localOptions = localConfig.inOptions || localConfig.options || {};
|
|
24
|
-
|
|
25
|
-
const localBase = structuredClone(base);
|
|
26
|
-
const registry = {
|
|
27
|
-
data: {
|
|
28
|
-
columns: localColumns,
|
|
29
|
-
data: localData
|
|
30
|
-
},
|
|
31
|
-
base: localBase,
|
|
32
|
-
spec
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
runSingleInstructions(singleInstructions, registry, functions, spec, showLog, returnLog);
|
|
36
|
-
runDoubleInstructions(doubleInstructions, registry, functions, spec, showLog, returnLog);
|
|
37
|
-
|
|
38
|
-
if (localOptions.showSerial || localOptions.serial) {
|
|
39
|
-
insertSerial(localBase, localOptions.serial || {}, showLog, returnLog);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (localOptions.showOptions || localOptions.options) {
|
|
43
|
-
insertOptions(localBase, localOptions.options || {}, showLog, returnLog);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return localBase;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default startFunc;
|
|
@@ -1,49 +0,0 @@
|
|
|
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 insertSerial from "../../actions/insertSerial/index.js";
|
|
12
|
-
import insertOptions from "../../actions/insertOptions/index.js";
|
|
13
|
-
|
|
14
|
-
const functions = { fromCollection, twoDimensional };
|
|
15
|
-
|
|
16
|
-
const startFunc = (inConfig = {}, showLog = false, returnLog = []) => {
|
|
17
|
-
const localConfig = (inConfig && typeof inConfig === "object" && "inConfig" in inConfig)
|
|
18
|
-
? inConfig.inConfig
|
|
19
|
-
: inConfig;
|
|
20
|
-
|
|
21
|
-
const localColumns = localConfig.inColumns || localConfig.columns || [];
|
|
22
|
-
const localData = localConfig.inData || localConfig.data || [];
|
|
23
|
-
const localOptions = localConfig.inOptions || localConfig.options || {};
|
|
24
|
-
|
|
25
|
-
const localBase = structuredClone(base);
|
|
26
|
-
const registry = {
|
|
27
|
-
data: {
|
|
28
|
-
columns: localColumns,
|
|
29
|
-
data: localData
|
|
30
|
-
},
|
|
31
|
-
base: localBase,
|
|
32
|
-
spec
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
runSingleInstructions(singleInstructions, registry, functions, spec, showLog, returnLog);
|
|
36
|
-
runDoubleInstructions(doubleInstructions, registry, functions, spec, showLog, returnLog);
|
|
37
|
-
|
|
38
|
-
if (localOptions.showSerial || localOptions.serial) {
|
|
39
|
-
insertSerial(localBase, localOptions.serial || {}, showLog, returnLog);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (localOptions.showOptions || localOptions.options) {
|
|
43
|
-
insertOptions(localBase, localOptions.options || {}, showLog, returnLog);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return localBase;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default startFunc;
|
package/src/v24/index.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import simple from "./builders/simple/index.js";
|
|
2
|
-
import headerOnly from "./builders/headerOnly/index.js";
|
|
3
|
-
import bodyOnly from "./builders/bodyOnly/index.js";
|
|
4
|
-
import withFooter from "./builders/withFooter/index.js";
|
|
5
|
-
import footerOnly from "./builders/footerOnly/index.js";
|
|
6
|
-
|
|
7
|
-
import insertSerial from "./actions/insertSerial/index.js";
|
|
8
|
-
import insertOptions from "./actions/insertOptions/index.js";
|
|
9
|
-
import actions from "./actions/index.js";
|
|
10
|
-
|
|
11
|
-
const withSerial = (inConfig = {}, showLog = false, returnLog = []) => {
|
|
12
|
-
const localConfig = (inConfig && typeof inConfig === "object" && "inConfig" in inConfig)
|
|
13
|
-
? inConfig.inConfig
|
|
14
|
-
: inConfig;
|
|
15
|
-
|
|
16
|
-
return simple({
|
|
17
|
-
...localConfig,
|
|
18
|
-
options: {
|
|
19
|
-
showSerial: true,
|
|
20
|
-
serial: localConfig.serial || localConfig.inSerial,
|
|
21
|
-
...(localConfig.options || localConfig.inOptions)
|
|
22
|
-
}
|
|
23
|
-
}, showLog, returnLog);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const withOptions = (inConfig = {}, showLog = false, returnLog = []) => {
|
|
27
|
-
const localConfig = (inConfig && typeof inConfig === "object" && "inConfig" in inConfig)
|
|
28
|
-
? inConfig.inConfig
|
|
29
|
-
: inConfig;
|
|
30
|
-
|
|
31
|
-
return simple({
|
|
32
|
-
...localConfig,
|
|
33
|
-
options: {
|
|
34
|
-
showOptions: true,
|
|
35
|
-
options: localConfig.options || localConfig.inOptions
|
|
36
|
-
}
|
|
37
|
-
}, showLog, returnLog);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const tableWithSerial = withSerial;
|
|
41
|
-
const tableWithOptions = withOptions;
|
|
42
|
-
|
|
43
|
-
export {
|
|
44
|
-
simple,
|
|
45
|
-
headerOnly,
|
|
46
|
-
bodyOnly,
|
|
47
|
-
withFooter,
|
|
48
|
-
footerOnly,
|
|
49
|
-
insertSerial,
|
|
50
|
-
insertOptions,
|
|
51
|
-
actions,
|
|
52
|
-
withSerial,
|
|
53
|
-
withOptions,
|
|
54
|
-
tableWithSerial,
|
|
55
|
-
tableWithOptions
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default {
|
|
59
|
-
simple,
|
|
60
|
-
headerOnly,
|
|
61
|
-
bodyOnly,
|
|
62
|
-
withFooter,
|
|
63
|
-
footerOnly,
|
|
64
|
-
insertSerial,
|
|
65
|
-
insertOptions,
|
|
66
|
-
actions,
|
|
67
|
-
withSerial,
|
|
68
|
-
withOptions,
|
|
69
|
-
tableWithSerial,
|
|
70
|
-
tableWithOptions
|
|
71
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,47 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
{ "children": [] }
|
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"narration": "Build the table body rows for the table using the configured columns and data.",
|
|
4
|
-
"destinationPath": {
|
|
5
|
-
"fileName": "base",
|
|
6
|
-
"filePath": [
|
|
7
|
-
"children"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"sourcePath": {
|
|
11
|
-
"fileName": "data",
|
|
12
|
-
"filePath": [
|
|
13
|
-
"columns"
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
"func": "twoDimensional"
|
|
17
|
-
}
|
|
18
|
-
]
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
|
|
8
|
-
import runSingleInstructions from "../../singleInstruction/index.js";
|
|
9
|
-
|
|
10
|
-
const registry = { data: {}, base, spec };
|
|
11
|
-
const functions = { fromCollection, twoDimensional };
|
|
12
|
-
|
|
13
|
-
const startFunc = (data, showLog = false, returnLog = []) => {
|
|
14
|
-
registry.data = data;
|
|
15
|
-
|
|
16
|
-
runSingleInstructions(singleInstructions, registry, functions, spec, showLog, returnLog);
|
|
17
|
-
|
|
18
|
-
return base?.children;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default startFunc;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"narration": "Build the footer row for the table using the configured columns.",
|
|
4
|
-
"destinationPath": {
|
|
5
|
-
"fileName": "base",
|
|
6
|
-
"filePath": [
|
|
7
|
-
"children"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"sourcePath": {
|
|
11
|
-
"fileName": "data",
|
|
12
|
-
"filePath": [
|
|
13
|
-
"columns"
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
"templateKey": "buildFooter",
|
|
17
|
-
"func": "fromCollection"
|
|
18
|
-
}
|
|
19
|
-
]
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import fromCollection from "json-transformer-funcs-one-dimension";
|
|
2
|
-
|
|
3
|
-
import spec from "../spec.json" with { type: "json" };
|
|
4
|
-
import base from "./base.json" with { type: "json" };
|
|
5
|
-
import singleInstructions from "./instructions/single.json" with { type: "json" };
|
|
6
|
-
|
|
7
|
-
import runSingleInstructions from "../../singleInstruction/index.js";
|
|
8
|
-
|
|
9
|
-
const registry = { data: {}, base, spec };
|
|
10
|
-
const functions = { fromCollection };
|
|
11
|
-
|
|
12
|
-
const startFunc = (data, showLog = false, returnLog = []) => {
|
|
13
|
-
registry.data = data;
|
|
14
|
-
runSingleInstructions(singleInstructions, registry, functions, spec, showLog, returnLog);
|
|
15
|
-
return base;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default startFunc;
|
|
@@ -1,53 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
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
|
-
{
|
|
39
|
-
"narration": "Build the footer row for the table using the configured columns.",
|
|
40
|
-
"destinationPath": {
|
|
41
|
-
"fileName": "base",
|
|
42
|
-
"dataRole": "table-footer-row",
|
|
43
|
-
"filePath": [
|
|
44
|
-
"children"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"sourcePath": {
|
|
48
|
-
"fileName": "data",
|
|
49
|
-
"filePath": [
|
|
50
|
-
"columns"
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
"templateKey": "buildFooter",
|
|
54
|
-
"func": "fromCollection"
|
|
55
|
-
}
|
|
56
|
-
]
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import writePath from "../writePath/index.js";
|
|
2
|
-
import checkInstruction from "../guards/index.js";
|
|
3
|
-
|
|
4
|
-
const runDoubleInstruction = (instruction, registry, functions, spec, showLog, returnLog) => {
|
|
5
|
-
if (!checkInstruction(instruction, functions, spec, showLog, returnLog)) return;
|
|
6
|
-
const result = functions[instruction.func](
|
|
7
|
-
registry.data.columns,
|
|
8
|
-
registry.data.data,
|
|
9
|
-
spec
|
|
10
|
-
);
|
|
11
|
-
writePath(registry, instruction.destinationPath, result);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const runDoubleInstructions = (instructions, registry, functions, spec, showLog, returnLog) => {
|
|
15
|
-
instructions.forEach(instruction => {
|
|
16
|
-
runDoubleInstruction(instruction, registry, functions, spec, showLog, returnLog);
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { runDoubleInstruction, runDoubleInstructions };
|
|
21
|
-
export default runDoubleInstructions;
|