json-renderers-build-table 1.32.2 → 1.36.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 +6 -3
- package/src/index.js +2 -2
- package/src/v32/actions/instructionsForOptions.json +1 -1
- package/src/v33/actions/index.js +12 -0
- package/src/v34/actions/index.js +12 -0
- package/src/{v30 → v34}/builders/simple/index.js +9 -4
- package/src/v35/builders/bodyOnly/base.json +1 -0
- package/src/v35/builders/bodyOnly/double.json +1 -0
- package/src/v35/builders/bodyOnly/index.js +37 -0
- package/src/v35/builders/bodyOnly/single.json +1 -0
- package/src/v35/builders/footerOnly/base.json +1 -0
- package/src/v35/builders/footerOnly/double.json +1 -0
- package/src/v35/builders/footerOnly/index.js +37 -0
- package/src/v35/builders/footerOnly/single.json +1 -0
- package/src/v35/builders/headerOnly/base.json +1 -0
- package/src/v35/builders/headerOnly/double.json +1 -0
- package/src/v35/builders/headerOnly/index.js +37 -0
- package/src/v35/builders/headerOnly/single.json +1 -0
- package/src/v35/builders/simple/base.json +1 -0
- package/src/v35/builders/simple/double.json +1 -0
- package/src/v35/builders/simple/index.js +30 -0
- package/src/v35/builders/simple/single.json +1 -0
- package/src/v35/builders/withFooter/base.json +1 -0
- package/src/v35/builders/withFooter/double.json +1 -0
- package/src/v35/builders/withFooter/index.js +30 -0
- package/src/v35/builders/withFooter/single.json +56 -0
- package/src/v35/index.js +11 -0
- package/src/v35/public.js +2 -0
- package/src/v36/builders/bodyOnly/base.json +1 -0
- package/src/v36/builders/bodyOnly/double.json +1 -0
- package/src/v36/builders/bodyOnly/index.js +37 -0
- package/src/v36/builders/bodyOnly/single.json +1 -0
- package/src/v36/builders/footerOnly/base.json +1 -0
- package/src/v36/builders/footerOnly/double.json +1 -0
- package/src/v36/builders/footerOnly/index.js +37 -0
- package/src/v36/builders/footerOnly/single.json +1 -0
- package/src/v36/builders/headerOnly/base.json +1 -0
- package/src/v36/builders/headerOnly/double.json +1 -0
- package/src/v36/builders/headerOnly/index.js +37 -0
- package/src/v36/builders/headerOnly/single.json +1 -0
- package/src/v36/builders/simple/base.json +1 -0
- package/src/v36/builders/simple/double.json +1 -0
- package/src/v36/builders/simple/index.js +30 -0
- package/src/v36/builders/simple/single.json +1 -0
- package/src/v36/builders/spec.json +107 -0
- package/src/v36/builders/withFooter/base.json +1 -0
- package/src/v36/builders/withFooter/double.json +1 -0
- package/src/v36/builders/withFooter/index.js +33 -0
- package/src/v36/builders/withFooter/single.json +56 -0
- package/src/v36/index.js +11 -0
- package/src/v36/public.js +2 -0
- package/src/v29/actions/index.js +0 -26
- package/src/v29/actions/insertOptions/index.js +0 -47
- package/src/v29/actions/insertOptions/instructions/footer.json +0 -22
- package/src/v29/actions/insertOptions/instructions/single.json +0 -62
- package/src/v29/actions/insertSearch/index.js +0 -7
- package/src/v29/actions/insertSearch/instructions/template.json +0 -20
- package/src/v29/actions/insertSerial/index.js +0 -47
- package/src/v29/actions/insertSerial/instructions/footer.json +0 -22
- package/src/v29/actions/insertSerial/instructions/single.json +0 -62
- package/src/v29/builders/simple/index.js +0 -45
- package/src/v30/actions/index.js +0 -26
- package/src/v30/actions/insertOptions/index.js +0 -47
- package/src/v30/actions/insertOptions/instructions/footer.json +0 -22
- package/src/v30/actions/insertOptions/instructions/single.json +0 -62
- package/src/v30/actions/insertSearch/index.js +0 -7
- package/src/v30/actions/insertSearch/instructions/template.json +0 -20
- package/src/v30/actions/insertSerial/index.js +0 -47
- package/src/v30/actions/insertSerial/instructions/footer.json +0 -22
- package/src/v30/actions/insertSerial/instructions/single.json +0 -62
- package/src/v31/actions/index.js +0 -30
- package/src/v31/actions/insertSearch/index.js +0 -7
- package/src/v31/actions/insertSearch/instructions/template.json +0 -20
- package/src/v31/actions/instructionsForOptions.json +0 -44
- package/src/v31/actions/instructionsForSerial.json +0 -44
- package/src/v31/builders/bodyOnly/base.json +0 -1
- package/src/v31/builders/bodyOnly/index.js +0 -18
- package/src/v31/builders/bodyOnly/instructions/double.json +0 -18
- package/src/v31/builders/footerOnly/base.json +0 -3
- package/src/v31/builders/footerOnly/index.js +0 -21
- package/src/v31/builders/footerOnly/instructions/single.json +0 -19
- package/src/v31/builders/headerOnly/base.json +0 -53
- package/src/v31/builders/headerOnly/index.js +0 -18
- package/src/v31/builders/headerOnly/instructions/single.json +0 -38
- package/src/v31/builders/simple/base.json +0 -53
- package/src/v31/builders/simple/instructions/double.json +0 -19
- package/src/v31/builders/simple/instructions/single.json +0 -38
- package/src/v31/builders/simpleSearch/base.json +0 -53
- package/src/v31/builders/simpleSearch/index.js +0 -40
- package/src/v31/builders/simpleSearch/instructions/double.json +0 -19
- package/src/v31/builders/simpleSearch/instructions/single.json +0 -38
- package/src/v31/builders/withFooter/base.json +0 -53
- package/src/v31/builders/withFooter/index.js +0 -40
- package/src/v31/builders/withFooter/instructions/double.json +0 -19
- package/src/v31/builders/withFooter/instructions/single.json +0 -56
- package/src/v31/doubleInstruction/index.js +0 -21
- package/src/v31/guards/index.js +0 -10
- package/src/v31/guards/references/func/index.js +0 -8
- package/src/v31/guards/references/index.js +0 -9
- package/src/v31/guards/references/templateKey/index.js +0 -8
- package/src/v31/guards/structure/destinationPath/index.js +0 -8
- package/src/v31/guards/structure/func/index.js +0 -8
- package/src/v31/guards/structure/index.js +0 -15
- package/src/v31/guards/structure/sourcePath/index.js +0 -8
- package/src/v31/guards/structure/templateKey/index.js +0 -9
- package/src/v31/index.js +0 -21
- package/src/v31/singleInstruction/index.js +0 -32
- package/src/v31/writePath/index.js +0 -62
- /package/src/{v29 → v33}/builders/bodyOnly/base.json +0 -0
- /package/src/{v29 → v33}/builders/bodyOnly/index.js +0 -0
- /package/src/{v29 → v33}/builders/bodyOnly/instructions/double.json +0 -0
- /package/src/{v29 → v33}/builders/footerOnly/base.json +0 -0
- /package/src/{v29 → v33}/builders/footerOnly/index.js +0 -0
- /package/src/{v29 → v33}/builders/footerOnly/instructions/single.json +0 -0
- /package/src/{v29 → v33}/builders/headerOnly/base.json +0 -0
- /package/src/{v29 → v33}/builders/headerOnly/index.js +0 -0
- /package/src/{v29 → v33}/builders/headerOnly/instructions/single.json +0 -0
- /package/src/{v29 → v33}/builders/simple/base.json +0 -0
- /package/src/{v31 → v33}/builders/simple/index.js +0 -0
- /package/src/{v29 → v33}/builders/simple/instructions/double.json +0 -0
- /package/src/{v29 → v33}/builders/simple/instructions/single.json +0 -0
- /package/src/{v29 → v33}/builders/simpleSearch/base.json +0 -0
- /package/src/{v29 → v33}/builders/simpleSearch/index.js +0 -0
- /package/src/{v29 → v33}/builders/simpleSearch/instructions/double.json +0 -0
- /package/src/{v29 → v33}/builders/simpleSearch/instructions/single.json +0 -0
- /package/src/{v29 → v33}/builders/spec.json +0 -0
- /package/src/{v29 → v33}/builders/withFooter/base.json +0 -0
- /package/src/{v29 → v33}/builders/withFooter/index.js +0 -0
- /package/src/{v29 → v33}/builders/withFooter/instructions/double.json +0 -0
- /package/src/{v29 → v33}/builders/withFooter/instructions/single.json +0 -0
- /package/src/{v29 → v33}/doubleInstruction/index.js +0 -0
- /package/src/{v29 → v33}/guards/index.js +0 -0
- /package/src/{v29 → v33}/guards/references/func/index.js +0 -0
- /package/src/{v29 → v33}/guards/references/index.js +0 -0
- /package/src/{v29 → v33}/guards/references/templateKey/index.js +0 -0
- /package/src/{v29 → v33}/guards/structure/destinationPath/index.js +0 -0
- /package/src/{v29 → v33}/guards/structure/func/index.js +0 -0
- /package/src/{v29 → v33}/guards/structure/index.js +0 -0
- /package/src/{v29 → v33}/guards/structure/sourcePath/index.js +0 -0
- /package/src/{v29 → v33}/guards/structure/templateKey/index.js +0 -0
- /package/src/{v29 → v33}/index.js +0 -0
- /package/src/{v29 → v33}/singleInstruction/index.js +0 -0
- /package/src/{v29 → v33}/writePath/index.js +0 -0
- /package/src/{v30 → v34}/builders/bodyOnly/base.json +0 -0
- /package/src/{v30 → v34}/builders/bodyOnly/index.js +0 -0
- /package/src/{v30 → v34}/builders/bodyOnly/instructions/double.json +0 -0
- /package/src/{v30 → v34}/builders/footerOnly/base.json +0 -0
- /package/src/{v30 → v34}/builders/footerOnly/index.js +0 -0
- /package/src/{v30 → v34}/builders/footerOnly/instructions/single.json +0 -0
- /package/src/{v30 → v34}/builders/headerOnly/base.json +0 -0
- /package/src/{v30 → v34}/builders/headerOnly/index.js +0 -0
- /package/src/{v30 → v34}/builders/headerOnly/instructions/single.json +0 -0
- /package/src/{v30 → v34}/builders/simple/base.json +0 -0
- /package/src/{v30 → v34}/builders/simple/instructions/double.json +0 -0
- /package/src/{v30 → v34}/builders/simple/instructions/single.json +0 -0
- /package/src/{v30 → v34}/builders/simpleSearch/base.json +0 -0
- /package/src/{v30 → v34}/builders/simpleSearch/index.js +0 -0
- /package/src/{v30 → v34}/builders/simpleSearch/instructions/double.json +0 -0
- /package/src/{v30 → v34}/builders/simpleSearch/instructions/single.json +0 -0
- /package/src/{v30 → v34}/builders/spec.json +0 -0
- /package/src/{v30 → v34}/builders/withFooter/base.json +0 -0
- /package/src/{v30 → v34}/builders/withFooter/index.js +0 -0
- /package/src/{v30 → v34}/builders/withFooter/instructions/double.json +0 -0
- /package/src/{v30 → v34}/builders/withFooter/instructions/single.json +0 -0
- /package/src/{v30 → v34}/doubleInstruction/index.js +0 -0
- /package/src/{v30 → v34}/guards/index.js +0 -0
- /package/src/{v30 → v34}/guards/references/func/index.js +0 -0
- /package/src/{v30 → v34}/guards/references/index.js +0 -0
- /package/src/{v30 → v34}/guards/references/templateKey/index.js +0 -0
- /package/src/{v30 → v34}/guards/structure/destinationPath/index.js +0 -0
- /package/src/{v30 → v34}/guards/structure/func/index.js +0 -0
- /package/src/{v30 → v34}/guards/structure/index.js +0 -0
- /package/src/{v30 → v34}/guards/structure/sourcePath/index.js +0 -0
- /package/src/{v30 → v34}/guards/structure/templateKey/index.js +0 -0
- /package/src/{v30 → v34}/index.js +0 -0
- /package/src/{v30 → v34}/singleInstruction/index.js +0 -0
- /package/src/{v30 → v34}/writePath/index.js +0 -0
- /package/src/{v31 → v35}/builders/spec.json +0 -0
|
@@ -1,38 +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
|
-
]
|
|
@@ -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,40 +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 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
|
-
};
|
|
31
|
-
|
|
32
|
-
runSingleInstructions(singleInstructions, registry, functions, spec, showLog, returnLog);
|
|
33
|
-
runDoubleInstructions(doubleInstructions, registry, functions, spec, showLog, returnLog);
|
|
34
|
-
|
|
35
|
-
actions({ inOptions: localOptions, inBase: localBase });
|
|
36
|
-
|
|
37
|
-
return localBase;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
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,38 +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
|
-
]
|
|
@@ -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,40 +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 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.inColumns || localConfig.columns || [];
|
|
19
|
-
const localData = localConfig.inData || localConfig.data || [];
|
|
20
|
-
const localOptions = localConfig.inOptions || 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
|
-
};
|
|
31
|
-
|
|
32
|
-
runSingleInstructions(singleInstructions, registry, functions, spec, showLog, returnLog);
|
|
33
|
-
runDoubleInstructions(doubleInstructions, registry, functions, spec, showLog, returnLog);
|
|
34
|
-
|
|
35
|
-
actions({ inOptions: localOptions, inBase: localBase });
|
|
36
|
-
|
|
37
|
-
return localBase;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
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,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/v31/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;
|
package/src/v31/index.js
DELETED
|
@@ -1,21 +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
|
-
export {
|
|
8
|
-
simple,
|
|
9
|
-
headerOnly,
|
|
10
|
-
bodyOnly,
|
|
11
|
-
withFooter,
|
|
12
|
-
footerOnly
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
simple,
|
|
17
|
-
headerOnly,
|
|
18
|
-
bodyOnly,
|
|
19
|
-
withFooter,
|
|
20
|
-
footerOnly
|
|
21
|
-
};
|
|
@@ -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 localShowLog = showLog;
|
|
9
|
-
const localSpec = spec;
|
|
10
|
-
const templateKey = instruction.templateKey;
|
|
11
|
-
const localSpecKey = localSpec[templateKey];
|
|
12
|
-
|
|
13
|
-
if (localShowLog) console.log("singleInstruction ; ", templateKey, 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;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { findByRole } from "json-transformer-funcs";
|
|
2
|
-
|
|
3
|
-
const toArray = value => Array.isArray(value) ? value : [value];
|
|
4
|
-
|
|
5
|
-
const set = (parent, key, value) => {
|
|
6
|
-
parent[key] = value;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const push = (parent, key, value) => {
|
|
10
|
-
parent[key].push(...toArray(value));
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const unshift = (parent, key, value) => {
|
|
14
|
-
parent[key].unshift(...toArray(value));
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const pushToRows = (parent, key, value) => {
|
|
18
|
-
parent[key].forEach(row => {
|
|
19
|
-
row.children.push(...structuredClone(toArray(value)));
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const unshiftToRows = (parent, key, value) => {
|
|
24
|
-
parent[key].forEach(row => {
|
|
25
|
-
row.children.unshift(...structuredClone(toArray(value)));
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const unshiftSerialToRows = (parent, key, value) => {
|
|
30
|
-
parent[key].forEach((row, rowIndex) => {
|
|
31
|
-
const item = structuredClone(value);
|
|
32
|
-
item.textContent = rowIndex + 1;
|
|
33
|
-
row.children.unshift(item);
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const actions = {
|
|
38
|
-
set,
|
|
39
|
-
push,
|
|
40
|
-
unshift,
|
|
41
|
-
pushToRows,
|
|
42
|
-
unshiftToRows,
|
|
43
|
-
unshiftSerialToRows
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const resolveParent = (registry, path) => {
|
|
47
|
-
const root = path.dataRole
|
|
48
|
-
? findByRole(registry[path.fileName], path.dataRole)
|
|
49
|
-
: registry[path.fileName];
|
|
50
|
-
const keys = [...(path.filePath ?? [])];
|
|
51
|
-
const key = keys.pop();
|
|
52
|
-
const parent = keys.reduce((current, nextKey) => current[nextKey], root);
|
|
53
|
-
return { parent, key };
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const writePath = (registry, path, value) => {
|
|
57
|
-
const { parent, key } = resolveParent(registry, path);
|
|
58
|
-
const action = actions[path.action] || set;
|
|
59
|
-
action(parent, key, value);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default writePath;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|