json-renderers-build-table 1.26.1 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/index.js +2 -2
- package/src/v26/actions/index.js +19 -19
- package/src/v26/actions/insertOptions/index.js +47 -47
- package/src/v26/actions/insertOptions/instructions/footer.json +22 -22
- package/src/v26/actions/insertOptions/instructions/single.json +62 -62
- package/src/v26/actions/insertSerial/index.js +47 -47
- package/src/v26/actions/insertSerial/instructions/footer.json +22 -22
- package/src/v26/actions/insertSerial/instructions/single.json +62 -62
- package/src/v26/builders/simple/index.js +40 -40
- package/src/v26/builders/withFooter/index.js +40 -40
- package/src/v26/index.js +21 -21
- package/src/v26/singleInstruction/index.js +5 -5
- package/src/{v25 → v27}/actions/index.js +24 -19
- package/src/{v24 → v27}/actions/insertOptions/index.js +47 -47
- package/src/{v24 → v27}/actions/insertOptions/instructions/footer.json +22 -22
- package/src/{v25 → v27}/actions/insertOptions/instructions/single.json +62 -62
- package/src/v27/actions/insertSearch/index.js +7 -0
- package/src/v27/actions/insertSearch/instructions/template.json +20 -0
- package/src/{v24 → v27}/actions/insertSerial/index.js +47 -47
- package/src/{v24 → v27}/actions/insertSerial/instructions/footer.json +22 -22
- package/src/{v24 → v27}/actions/insertSerial/instructions/single.json +62 -62
- package/src/{v25 → v27}/builders/simple/index.js +40 -40
- package/src/{v24/builders/withFooter → v27/builders/simpleSearch}/index.js +40 -49
- package/src/{v25 → v27}/builders/withFooter/index.js +40 -40
- package/src/{v25 → v27}/index.js +21 -21
- package/src/{v23 → v27}/singleInstruction/index.js +5 -5
- package/src/v28/actions/index.js +25 -0
- package/src/{v25 → v28}/actions/insertOptions/index.js +47 -47
- package/src/{v25 → v28}/actions/insertOptions/instructions/footer.json +22 -22
- package/src/{v24 → v28}/actions/insertOptions/instructions/single.json +62 -62
- package/src/v28/actions/insertSearch/index.js +7 -0
- package/src/v28/actions/insertSearch/instructions/template.json +20 -0
- package/src/{v25 → v28}/actions/insertSerial/index.js +47 -47
- package/src/{v25 → v28}/actions/insertSerial/instructions/footer.json +22 -22
- package/src/{v25 → v28}/actions/insertSerial/instructions/single.json +62 -62
- package/src/v28/builders/simple/index.js +40 -0
- package/src/v28/builders/simpleSearch/index.js +40 -0
- package/src/{v24/builders/simple → v28/builders/withFooter}/index.js +40 -49
- package/src/{v22 → v28}/index.js +7 -1
- package/src/{v24 → v28}/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/v22/singleInstruction/index.js +0 -32
- package/src/v23/builders/simple/index.js +0 -22
- package/src/v23/builders/spec.json +0 -103
- 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/index.js +0 -34
- package/src/v24/actions/index.js +0 -5
- package/src/v24/builders/bodyOnly/base.json +0 -1
- package/src/v24/builders/bodyOnly/index.js +0 -18
- package/src/v24/builders/bodyOnly/instructions/double.json +0 -18
- package/src/v24/builders/footerOnly/base.json +0 -3
- package/src/v24/builders/footerOnly/index.js +0 -21
- package/src/v24/builders/footerOnly/instructions/single.json +0 -19
- package/src/v24/builders/headerOnly/base.json +0 -53
- package/src/v24/builders/headerOnly/index.js +0 -18
- package/src/v24/builders/simple/base.json +0 -53
- package/src/v24/builders/withFooter/base.json +0 -53
- package/src/v24/builders/withFooter/instructions/single.json +0 -56
- package/src/v24/doubleInstruction/index.js +0 -21
- package/src/v24/guards/index.js +0 -10
- package/src/v24/guards/references/func/index.js +0 -8
- package/src/v24/guards/references/index.js +0 -9
- package/src/v24/guards/references/templateKey/index.js +0 -8
- package/src/v24/guards/structure/destinationPath/index.js +0 -8
- package/src/v24/guards/structure/func/index.js +0 -8
- package/src/v24/guards/structure/index.js +0 -15
- package/src/v24/guards/structure/sourcePath/index.js +0 -8
- package/src/v24/guards/structure/templateKey/index.js +0 -9
- package/src/v24/index.js +0 -71
- package/src/v24/writePath/index.js +0 -62
- package/src/v25/builders/bodyOnly/base.json +0 -1
- package/src/v25/builders/bodyOnly/index.js +0 -18
- package/src/v25/builders/bodyOnly/instructions/double.json +0 -18
- package/src/v25/builders/footerOnly/base.json +0 -3
- package/src/v25/builders/footerOnly/index.js +0 -21
- package/src/v25/builders/footerOnly/instructions/single.json +0 -19
- package/src/v25/builders/headerOnly/base.json +0 -53
- package/src/v25/builders/headerOnly/index.js +0 -18
- package/src/v25/builders/headerOnly/instructions/single.json +0 -38
- package/src/v25/builders/simple/base.json +0 -53
- package/src/v25/builders/simple/instructions/double.json +0 -19
- package/src/v25/builders/simple/instructions/single.json +0 -38
- package/src/v25/builders/withFooter/base.json +0 -53
- package/src/v25/builders/withFooter/instructions/double.json +0 -19
- package/src/v25/builders/withFooter/instructions/single.json +0 -56
- package/src/v25/doubleInstruction/index.js +0 -21
- package/src/v25/guards/index.js +0 -10
- package/src/v25/guards/references/func/index.js +0 -8
- package/src/v25/guards/references/index.js +0 -9
- package/src/v25/guards/references/templateKey/index.js +0 -8
- package/src/v25/guards/structure/destinationPath/index.js +0 -8
- package/src/v25/guards/structure/func/index.js +0 -8
- package/src/v25/guards/structure/index.js +0 -15
- package/src/v25/guards/structure/sourcePath/index.js +0 -8
- package/src/v25/guards/structure/templateKey/index.js +0 -9
- package/src/v25/singleInstruction/index.js +0 -32
- package/src/v25/writePath/index.js +0 -62
- /package/src/{v22 → v27}/builders/bodyOnly/base.json +0 -0
- /package/src/{v22 → v27}/builders/bodyOnly/index.js +0 -0
- /package/src/{v22 → v27}/builders/bodyOnly/instructions/double.json +0 -0
- /package/src/{v22 → v27}/builders/footerOnly/base.json +0 -0
- /package/src/{v22 → v27}/builders/footerOnly/index.js +0 -0
- /package/src/{v22 → v27}/builders/footerOnly/instructions/single.json +0 -0
- /package/src/{v22 → v27}/builders/headerOnly/base.json +0 -0
- /package/src/{v22 → v27}/builders/headerOnly/index.js +0 -0
- /package/src/{v22 → v27}/builders/headerOnly/instructions/single.json +0 -0
- /package/src/{v22 → v27}/builders/simple/base.json +0 -0
- /package/src/{v22 → v27}/builders/simple/instructions/double.json +0 -0
- /package/src/{v22 → v27}/builders/simple/instructions/single.json +0 -0
- /package/src/{v22/builders/withFooter → v27/builders/simpleSearch}/base.json +0 -0
- /package/src/{v22/builders/withFooter → v27/builders/simpleSearch}/instructions/double.json +0 -0
- /package/src/{v23/builders/headerOnly → v27/builders/simpleSearch}/instructions/single.json +0 -0
- /package/src/{v24 → v27}/builders/spec.json +0 -0
- /package/src/{v23/builders/headerOnly → v27/builders/withFooter}/base.json +0 -0
- /package/src/{v23/builders/simple → v27/builders/withFooter}/instructions/double.json +0 -0
- /package/src/{v22 → v27}/builders/withFooter/instructions/single.json +0 -0
- /package/src/{v22 → v27}/doubleInstruction/index.js +0 -0
- /package/src/{v22 → v27}/guards/index.js +0 -0
- /package/src/{v22 → v27}/guards/references/func/index.js +0 -0
- /package/src/{v22 → v27}/guards/references/index.js +0 -0
- /package/src/{v22 → v27}/guards/references/templateKey/index.js +0 -0
- /package/src/{v22 → v27}/guards/structure/destinationPath/index.js +0 -0
- /package/src/{v22 → v27}/guards/structure/func/index.js +0 -0
- /package/src/{v22 → v27}/guards/structure/index.js +0 -0
- /package/src/{v22 → v27}/guards/structure/sourcePath/index.js +0 -0
- /package/src/{v22 → v27}/guards/structure/templateKey/index.js +0 -0
- /package/src/{v22 → v27}/writePath/index.js +0 -0
- /package/src/{v23 → v28}/builders/bodyOnly/base.json +0 -0
- /package/src/{v23 → v28}/builders/bodyOnly/index.js +0 -0
- /package/src/{v23 → v28}/builders/bodyOnly/instructions/double.json +0 -0
- /package/src/{v23 → v28}/builders/footerOnly/base.json +0 -0
- /package/src/{v23 → v28}/builders/footerOnly/index.js +0 -0
- /package/src/{v23 → v28}/builders/footerOnly/instructions/single.json +0 -0
- /package/src/{v23/builders/simple → v28/builders/headerOnly}/base.json +0 -0
- /package/src/{v23 → v28}/builders/headerOnly/index.js +0 -0
- /package/src/{v23/builders/simple → v28/builders/headerOnly}/instructions/single.json +0 -0
- /package/src/{v23/builders/withFooter → v28/builders/simple}/base.json +0 -0
- /package/src/{v23/builders/withFooter → v28/builders/simple}/instructions/double.json +0 -0
- /package/src/{v24/builders/headerOnly → v28/builders/simple}/instructions/single.json +0 -0
- /package/src/{v23/builders/withOptions → v28/builders/simpleSearch}/base.json +0 -0
- /package/src/{v24/builders/simple → v28/builders/simpleSearch}/instructions/double.json +0 -0
- /package/src/{v24/builders/simple → v28/builders/simpleSearch}/instructions/single.json +0 -0
- /package/src/{v25 → v28}/builders/spec.json +0 -0
- /package/src/{v23/builders/withSerial → v28/builders/withFooter}/base.json +0 -0
- /package/src/{v24 → v28}/builders/withFooter/instructions/double.json +0 -0
- /package/src/{v23 → v28}/builders/withFooter/instructions/single.json +0 -0
- /package/src/{v23 → v28}/doubleInstruction/index.js +0 -0
- /package/src/{v23 → v28}/guards/index.js +0 -0
- /package/src/{v23 → v28}/guards/references/func/index.js +0 -0
- /package/src/{v23 → v28}/guards/references/index.js +0 -0
- /package/src/{v23 → v28}/guards/references/templateKey/index.js +0 -0
- /package/src/{v23 → v28}/guards/structure/destinationPath/index.js +0 -0
- /package/src/{v23 → v28}/guards/structure/func/index.js +0 -0
- /package/src/{v23 → v28}/guards/structure/index.js +0 -0
- /package/src/{v23 → v28}/guards/structure/sourcePath/index.js +0 -0
- /package/src/{v23 → v28}/guards/structure/templateKey/index.js +0 -0
- /package/src/{v23 → v28}/writePath/index.js +0 -0
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import applyTemplate from "json-transformer-funcs-primitive";
|
|
2
|
-
import fromCollection from "json-transformer-funcs-one-dimension";
|
|
3
|
-
import twoDimensional from "json-transformer-funcs-two-dimensions";
|
|
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
|
-
import postSingleInstructions from "./instructions/postSingle.json" with { type: "json" };
|
|
10
|
-
|
|
11
|
-
import runSingleInstructions from "../../singleInstruction/index.js";
|
|
12
|
-
import runDoubleInstructions from "../../doubleInstruction/index.js";
|
|
13
|
-
|
|
14
|
-
const functions = { fromCollection, twoDimensional, applyTemplate };
|
|
15
|
-
|
|
16
|
-
const startFunc = (data = {}, showLog = false, returnLog = []) => {
|
|
17
|
-
const localInput = (data && typeof data === "object" && "inConfig" in data)
|
|
18
|
-
? data.inConfig
|
|
19
|
-
: data;
|
|
20
|
-
|
|
21
|
-
const columns = localInput.inColumns || localInput.columns || [];
|
|
22
|
-
const tableData = localInput.inData || localInput.data || [];
|
|
23
|
-
const serialInput = localInput.inSerial || localInput.serial || {};
|
|
24
|
-
|
|
25
|
-
const localSerial = {
|
|
26
|
-
col: { width: "50px" },
|
|
27
|
-
header: { columnName: "#" },
|
|
28
|
-
body: {},
|
|
29
|
-
...serialInput
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const localBase = structuredClone(base);
|
|
33
|
-
|
|
34
|
-
const registry = {
|
|
35
|
-
data: {
|
|
36
|
-
columns,
|
|
37
|
-
data: tableData,
|
|
38
|
-
serial: localSerial
|
|
39
|
-
},
|
|
40
|
-
base: localBase,
|
|
41
|
-
spec
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
runSingleInstructions(singleInstructions, registry, functions, spec, showLog, returnLog);
|
|
45
|
-
runDoubleInstructions(doubleInstructions, registry, functions, spec, showLog, returnLog);
|
|
46
|
-
runSingleInstructions(postSingleInstructions, registry, functions, spec, showLog, returnLog);
|
|
47
|
-
|
|
48
|
-
return localBase;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export default startFunc;
|
|
@@ -1,19 +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
|
-
"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
|
-
]
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"narration": "Prepend the serial number cell into each table body row.",
|
|
4
|
-
"destinationPath": {
|
|
5
|
-
"fileName": "base",
|
|
6
|
-
"dataRole": "table-body",
|
|
7
|
-
"filePath": [
|
|
8
|
-
"children"
|
|
9
|
-
],
|
|
10
|
-
"action": "unshiftSerialToRows"
|
|
11
|
-
},
|
|
12
|
-
"sourcePath": {
|
|
13
|
-
"fileName": "data",
|
|
14
|
-
"filePath": [
|
|
15
|
-
"serial",
|
|
16
|
-
"body"
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
"templateKey": "buildBodyCell",
|
|
20
|
-
"func": "applyTemplate"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
@@ -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
|
-
]
|
package/src/v23/index.js
DELETED
|
@@ -1,34 +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
|
-
import withSerial from "./builders/withSerial/index.js";
|
|
7
|
-
import withOptions from "./builders/withOptions/index.js";
|
|
8
|
-
|
|
9
|
-
const tableWithSerial = withSerial;
|
|
10
|
-
const tableWithOptions = withOptions;
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
simple,
|
|
14
|
-
headerOnly,
|
|
15
|
-
bodyOnly,
|
|
16
|
-
withFooter,
|
|
17
|
-
footerOnly,
|
|
18
|
-
withSerial,
|
|
19
|
-
withOptions,
|
|
20
|
-
tableWithSerial,
|
|
21
|
-
tableWithOptions
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default {
|
|
25
|
-
simple,
|
|
26
|
-
headerOnly,
|
|
27
|
-
bodyOnly,
|
|
28
|
-
withFooter,
|
|
29
|
-
footerOnly,
|
|
30
|
-
withSerial,
|
|
31
|
-
withOptions,
|
|
32
|
-
tableWithSerial,
|
|
33
|
-
tableWithOptions
|
|
34
|
-
};
|
package/src/v24/actions/index.js
DELETED
|
@@ -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,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,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,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;
|
package/src/v24/guards/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import checkStructure from "./structure/index.js";
|
|
2
|
-
import checkReferences from "./references/index.js";
|
|
3
|
-
|
|
4
|
-
const checkInstruction = (instruction, functions, spec, showLog, returnLog) => {
|
|
5
|
-
const structurePassed = checkStructure(instruction, showLog, returnLog);
|
|
6
|
-
if (!structurePassed) return false;
|
|
7
|
-
return checkReferences(instruction, functions, spec, showLog, returnLog);
|
|
8
|
-
};
|
|
9
|
-
export { checkStructure, checkReferences, checkInstruction };
|
|
10
|
-
export default checkInstruction;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const checkFunctionReference = (instruction, functions, showLog, returnLog) => {
|
|
2
|
-
const passed = typeof functions[instruction.func] === "function";
|
|
3
|
-
const message = `references/func (${instruction.func}): ${passed ? "passed" : "failed"}`;
|
|
4
|
-
returnLog.push(message);
|
|
5
|
-
if (showLog) console.log(message);
|
|
6
|
-
return passed;
|
|
7
|
-
};
|
|
8
|
-
export default checkFunctionReference;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import checkFunctionReference from "./func/index.js";
|
|
2
|
-
import checkSpecReference from "./templateKey/index.js";
|
|
3
|
-
|
|
4
|
-
const checkReferences = (instruction, functions, spec, showLog, returnLog) => {
|
|
5
|
-
const functionPassed = checkFunctionReference(instruction, functions, showLog, returnLog);
|
|
6
|
-
const specPassed = checkSpecReference(instruction, spec, showLog, returnLog);
|
|
7
|
-
return functionPassed && specPassed;
|
|
8
|
-
};
|
|
9
|
-
export default checkReferences;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const checkSpecReference = (instruction, spec, showLog, returnLog) => {
|
|
2
|
-
const passed = instruction.templateKey === undefined || Object.hasOwn(spec, instruction.templateKey);
|
|
3
|
-
const message = `references/templateKey${instruction.templateKey === undefined ? " (not used)" : ` (${instruction.templateKey})`}: ${passed ? "passed" : "failed"}`;
|
|
4
|
-
returnLog.push(message);
|
|
5
|
-
if (showLog) console.log(message);
|
|
6
|
-
return passed;
|
|
7
|
-
};
|
|
8
|
-
export default checkSpecReference;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const checkDestinationPath = (instruction, showLog, returnLog) => {
|
|
2
|
-
const passed = Boolean(instruction.destinationPath?.fileName && Array.isArray(instruction.destinationPath?.filePath));
|
|
3
|
-
const message = `structure/destinationPath: ${passed ? "passed" : "failed"}`;
|
|
4
|
-
returnLog.push(message);
|
|
5
|
-
if (showLog) console.log(message);
|
|
6
|
-
return passed;
|
|
7
|
-
};
|
|
8
|
-
export default checkDestinationPath;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const checkFunc = (instruction, showLog, returnLog) => {
|
|
2
|
-
const passed = typeof instruction.func === "string" && instruction.func.length > 0;
|
|
3
|
-
const message = `structure/func: ${passed ? "passed" : "failed"}`;
|
|
4
|
-
returnLog.push(message);
|
|
5
|
-
if (showLog) console.log(message);
|
|
6
|
-
return passed;
|
|
7
|
-
};
|
|
8
|
-
export default checkFunc;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import checkSourcePath from "./sourcePath/index.js";
|
|
2
|
-
import checkDestinationPath from "./destinationPath/index.js";
|
|
3
|
-
import checkTemplateKey from "./templateKey/index.js";
|
|
4
|
-
import checkFunc from "./func/index.js";
|
|
5
|
-
|
|
6
|
-
const checkStructure = (instruction, showLog, returnLog) => {
|
|
7
|
-
const results = [
|
|
8
|
-
checkSourcePath(instruction, showLog, returnLog),
|
|
9
|
-
checkDestinationPath(instruction, showLog, returnLog),
|
|
10
|
-
checkTemplateKey(instruction, showLog, returnLog),
|
|
11
|
-
checkFunc(instruction, showLog, returnLog)
|
|
12
|
-
];
|
|
13
|
-
return results.every(Boolean);
|
|
14
|
-
};
|
|
15
|
-
export default checkStructure;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const checkSourcePath = (instruction, showLog, returnLog) => {
|
|
2
|
-
const passed = Boolean(instruction.sourcePath?.fileName && Array.isArray(instruction.sourcePath?.filePath));
|
|
3
|
-
const message = `structure/sourcePath: ${passed ? "passed" : "failed"}`;
|
|
4
|
-
returnLog.push(message);
|
|
5
|
-
if (showLog) console.log(message);
|
|
6
|
-
return passed;
|
|
7
|
-
};
|
|
8
|
-
export default checkSourcePath;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const checkTemplateKey = (instruction, showLog, returnLog) => {
|
|
2
|
-
const passed = instruction.templateKey === undefined ||
|
|
3
|
-
(typeof instruction.templateKey === "string" && instruction.templateKey.length > 0);
|
|
4
|
-
const message = `structure/templateKey: ${passed ? "passed" : "failed"}`;
|
|
5
|
-
returnLog.push(message);
|
|
6
|
-
if (showLog) console.log(message);
|
|
7
|
-
return passed;
|
|
8
|
-
};
|
|
9
|
-
export default checkTemplateKey;
|