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
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"buildBodyTr": {
|
|
3
|
+
"tagName": "tr",
|
|
4
|
+
"attributes": {
|
|
5
|
+
"class": "align-middle"
|
|
6
|
+
},
|
|
7
|
+
"children": []
|
|
8
|
+
},
|
|
9
|
+
"buildColGroup": {
|
|
10
|
+
"tagName": "col",
|
|
11
|
+
"attributes": {
|
|
12
|
+
"width": "${width}"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"buildHeader": {
|
|
16
|
+
"tagName": "th",
|
|
17
|
+
"textContent": "${columnName}",
|
|
18
|
+
"attributes": {
|
|
19
|
+
"class": "py-3 px-3 fw-semibold text-uppercase small"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"buildFooter": {
|
|
23
|
+
"tagName": "td",
|
|
24
|
+
"children": [
|
|
25
|
+
{
|
|
26
|
+
"tagName": "input",
|
|
27
|
+
"attributes": {
|
|
28
|
+
"type": "text",
|
|
29
|
+
"placeholder": "enter ${columnName}",
|
|
30
|
+
"name": "${columnName}",
|
|
31
|
+
"id": "${columnName}",
|
|
32
|
+
"list": "${columnName}",
|
|
33
|
+
"class": "form-control"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"buildBodyCell": {
|
|
39
|
+
"tagName": "td",
|
|
40
|
+
"textContent": "${rowValue}",
|
|
41
|
+
"attributes": {
|
|
42
|
+
"class": "py-3 px-3 text-secondary"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"button": {
|
|
46
|
+
"tagName": "button",
|
|
47
|
+
"textContent": "${columnName}",
|
|
48
|
+
"attributes": {
|
|
49
|
+
"class": "btn btn-primary btn-sm"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"buttonCell": {
|
|
53
|
+
"tagName": "td",
|
|
54
|
+
"attributes": {
|
|
55
|
+
"class": "py-2 px-3 text-center"
|
|
56
|
+
},
|
|
57
|
+
"children": [
|
|
58
|
+
{
|
|
59
|
+
"tagName": "button",
|
|
60
|
+
"textContent": "${agg:count}",
|
|
61
|
+
"attributes": {
|
|
62
|
+
"class": "btn btn-primary btn-sm"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"optionsButtonCell": {
|
|
68
|
+
"tagName": "td",
|
|
69
|
+
"attributes": {
|
|
70
|
+
"class": "py-2 px-3 text-center"
|
|
71
|
+
},
|
|
72
|
+
"children": [
|
|
73
|
+
{
|
|
74
|
+
"tagName": "button",
|
|
75
|
+
"textContent": "${columnName}",
|
|
76
|
+
"attributes": {
|
|
77
|
+
"class": "btn btn-primary btn-sm"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"buildOption": {
|
|
83
|
+
"tagName": "option",
|
|
84
|
+
"textContent": "${rowValue}",
|
|
85
|
+
"attributes": {
|
|
86
|
+
"value": "${rowValue}"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"buildSelect": {
|
|
90
|
+
"tagName": "select",
|
|
91
|
+
"attributes": {
|
|
92
|
+
"id": "LedgerName"
|
|
93
|
+
},
|
|
94
|
+
"children": []
|
|
95
|
+
},
|
|
96
|
+
"buildDataList": {
|
|
97
|
+
"tagName": "datalist",
|
|
98
|
+
"attributes": {
|
|
99
|
+
"data-name": "${columnName}"
|
|
100
|
+
},
|
|
101
|
+
"children": []
|
|
102
|
+
},
|
|
103
|
+
"emptyCell": {
|
|
104
|
+
"tagName": "td",
|
|
105
|
+
"children": []
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"tagName":"table","attributes":{"class":"table table-hover table-striped align-middle border mb-0"},"children":[{"tagName":"colgroup","attributes":{"data-role":"table-colgroup"},"children":[]},{"tagName":"thead","attributes":{"class":"table-dark","data-role":"table-header"},"children":[{"tagName":"tr","attributes":{"data-role":"table-header-row"},"children":[]}]},{"tagName":"tbody","attributes":{"data-role":"table-body"},"children":[]},{"tagName":"tfoot","attributes":{"data-role":"table-footer"},"children":[{"tagName":"tr","attributes":{"data-role":"table-footer-row"},"children":[]}]}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"narration":"Build table body","destinationPath":{"fileName":"base","dataRole":"table-body","filePath":["children"]},"sourcePath":{"fileName":"data","filePath":["columns"]},"func":"twoDimensional"}]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import fromCollection from "json-transformer-funcs-one-dimension";
|
|
2
|
+
import twoDimensional from "json-transformer-funcs-two-dimensions";
|
|
3
|
+
import optionsFunc from "json-renderers-build-table-options";
|
|
4
|
+
|
|
5
|
+
import runSingleInstructions from "json-instruction-single";
|
|
6
|
+
import runDoubleInstructions from "json-instruction-double";
|
|
7
|
+
|
|
8
|
+
import spec from "../spec.json" with { type: "json" };
|
|
9
|
+
import base from "./base.json" with { type: "json" };
|
|
10
|
+
|
|
11
|
+
import singleInstructions from "./single.json" with { type: "json" };
|
|
12
|
+
import doubleInstructions from "./double.json" with { type: "json" };
|
|
13
|
+
|
|
14
|
+
const startFunc = ({ data, columns, options }) => {
|
|
15
|
+
|
|
16
|
+
const localBase = structuredClone(base);
|
|
17
|
+
|
|
18
|
+
const registry = {
|
|
19
|
+
data: { columns, data },
|
|
20
|
+
base: localBase,
|
|
21
|
+
spec,
|
|
22
|
+
...options
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
runSingleInstructions(singleInstructions, registry);
|
|
26
|
+
runDoubleInstructions(doubleInstructions, registry);
|
|
27
|
+
|
|
28
|
+
optionsFunc({ options, base: localBase, showLog: false, returnLog: [] });
|
|
29
|
+
|
|
30
|
+
return localBase;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default startFunc;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"narration": "Build column widths",
|
|
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 table header",
|
|
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 footer input cells",
|
|
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
|
+
]
|
package/src/v36/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import simple from "./builders/simple/index.js";
|
|
2
|
+
import withFooter from "./builders/withFooter/index.js";
|
|
3
|
+
|
|
4
|
+
// import headerOnly from "./builders/headerOnly/index.js";
|
|
5
|
+
// import bodyOnly from "./builders/bodyOnly/index.js";
|
|
6
|
+
|
|
7
|
+
// import footerOnly from "./builders/footerOnly/index.js";
|
|
8
|
+
|
|
9
|
+
export { simple, withFooter };
|
|
10
|
+
|
|
11
|
+
export default { simple, withFooter };
|
package/src/v29/actions/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import insertSerial from "./insertSerial/index.js";
|
|
2
|
-
import insertOptions from "./insertOptions/index.js";
|
|
3
|
-
import insertSearch from "./insertSearch/index.js";
|
|
4
|
-
|
|
5
|
-
const startFunc = ({ inOptions = {}, inBase, showLog = false, returnLog = [] }) => {
|
|
6
|
-
const localOptions = inOptions;
|
|
7
|
-
|
|
8
|
-
const localBase = inBase;
|
|
9
|
-
|
|
10
|
-
console.log(localOptions)
|
|
11
|
-
if (localOptions.showSerial || localOptions.serial) {
|
|
12
|
-
insertSerial(localBase, localOptions.serial || {}, showLog, returnLog);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (localOptions.showOptions || localOptions.options) {
|
|
16
|
-
insertOptions(localBase, localOptions.options || {}, showLog, returnLog);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
if (localOptions.showSearch) {
|
|
20
|
-
insertSearch();
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return localBase;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default startFunc;
|
|
@@ -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,62 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"narration": "Append the options column width to the table colgroup.",
|
|
4
|
-
"destinationPath": {
|
|
5
|
-
"fileName": "base",
|
|
6
|
-
"dataRole": "table-colgroup",
|
|
7
|
-
"filePath": [
|
|
8
|
-
"children"
|
|
9
|
-
],
|
|
10
|
-
"action": "push"
|
|
11
|
-
},
|
|
12
|
-
"sourcePath": {
|
|
13
|
-
"fileName": "data",
|
|
14
|
-
"filePath": [
|
|
15
|
-
"options",
|
|
16
|
-
"col"
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
"templateKey": "buildColGroup",
|
|
20
|
-
"func": "applyTemplate"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"narration": "Append the options header cell to the table header row.",
|
|
24
|
-
"destinationPath": {
|
|
25
|
-
"fileName": "base",
|
|
26
|
-
"dataRole": "table-header-row",
|
|
27
|
-
"filePath": [
|
|
28
|
-
"children"
|
|
29
|
-
],
|
|
30
|
-
"action": "push"
|
|
31
|
-
},
|
|
32
|
-
"sourcePath": {
|
|
33
|
-
"fileName": "data",
|
|
34
|
-
"filePath": [
|
|
35
|
-
"options",
|
|
36
|
-
"header"
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
"templateKey": "buildHeader",
|
|
40
|
-
"func": "applyTemplate"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"narration": "Append the options button cell into each table body row.",
|
|
44
|
-
"destinationPath": {
|
|
45
|
-
"fileName": "base",
|
|
46
|
-
"dataRole": "table-body",
|
|
47
|
-
"filePath": [
|
|
48
|
-
"children"
|
|
49
|
-
],
|
|
50
|
-
"action": "pushToRows"
|
|
51
|
-
},
|
|
52
|
-
"sourcePath": {
|
|
53
|
-
"fileName": "data",
|
|
54
|
-
"filePath": [
|
|
55
|
-
"options",
|
|
56
|
-
"body"
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
"templateKey": "optionsButtonCell",
|
|
60
|
-
"func": "applyTemplate"
|
|
61
|
-
}
|
|
62
|
-
]
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"tagName": "div",
|
|
3
|
-
"children": [
|
|
4
|
-
{
|
|
5
|
-
"tagName": "label",
|
|
6
|
-
"textContent": "KeshavSoft"
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"tagName": "input",
|
|
10
|
-
"attributes": {
|
|
11
|
-
"value": "KeshavSoft",
|
|
12
|
-
"placeholder": "KeshavSoft"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"tagName": "button",
|
|
17
|
-
"textContent": "show"
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
}
|
|
@@ -1,47 +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,62 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"narration": "Prepend the serial column width to the table colgroup.",
|
|
4
|
-
"destinationPath": {
|
|
5
|
-
"fileName": "base",
|
|
6
|
-
"dataRole": "table-colgroup",
|
|
7
|
-
"filePath": [
|
|
8
|
-
"children"
|
|
9
|
-
],
|
|
10
|
-
"action": "unshift"
|
|
11
|
-
},
|
|
12
|
-
"sourcePath": {
|
|
13
|
-
"fileName": "data",
|
|
14
|
-
"filePath": [
|
|
15
|
-
"serial",
|
|
16
|
-
"col"
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
"templateKey": "buildColGroup",
|
|
20
|
-
"func": "applyTemplate"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"narration": "Prepend the serial header cell to the table header row.",
|
|
24
|
-
"destinationPath": {
|
|
25
|
-
"fileName": "base",
|
|
26
|
-
"dataRole": "table-header-row",
|
|
27
|
-
"filePath": [
|
|
28
|
-
"children"
|
|
29
|
-
],
|
|
30
|
-
"action": "unshift"
|
|
31
|
-
},
|
|
32
|
-
"sourcePath": {
|
|
33
|
-
"fileName": "data",
|
|
34
|
-
"filePath": [
|
|
35
|
-
"serial",
|
|
36
|
-
"header"
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
"templateKey": "buildHeader",
|
|
40
|
-
"func": "applyTemplate"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"narration": "Prepend the serial number cell into each table body row.",
|
|
44
|
-
"destinationPath": {
|
|
45
|
-
"fileName": "base",
|
|
46
|
-
"dataRole": "table-body",
|
|
47
|
-
"filePath": [
|
|
48
|
-
"children"
|
|
49
|
-
],
|
|
50
|
-
"action": "unshiftSerialToRows"
|
|
51
|
-
},
|
|
52
|
-
"sourcePath": {
|
|
53
|
-
"fileName": "data",
|
|
54
|
-
"filePath": [
|
|
55
|
-
"serial",
|
|
56
|
-
"body"
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
"templateKey": "buildBodyCell",
|
|
60
|
-
"func": "applyTemplate"
|
|
61
|
-
}
|
|
62
|
-
]
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import fromCollection from "json-transformer-funcs-one-dimension";
|
|
2
|
-
import twoDimensional from "json-transformer-funcs-two-dimensions";
|
|
3
|
-
import { runSingleInstructions, runDoubleInstructions } from "json-instructions";
|
|
4
|
-
|
|
5
|
-
import spec from "../spec.json" with { type: "json" };
|
|
6
|
-
import base from "./base.json" with { type: "json" };
|
|
7
|
-
import singleInstructions from "./instructions/single.json" with { type: "json" };
|
|
8
|
-
import doubleInstructions from "./instructions/double.json" with { type: "json" };
|
|
9
|
-
|
|
10
|
-
import actions from "../../actions/index.js";
|
|
11
|
-
|
|
12
|
-
const functions = { fromCollection, twoDimensional };
|
|
13
|
-
|
|
14
|
-
const startFunc = (inConfig = {}, showLog = false, returnLog = []) => {
|
|
15
|
-
const localConfig = inConfig;
|
|
16
|
-
|
|
17
|
-
const localColumns = localConfig.columns || [];
|
|
18
|
-
const localData = localConfig.data || [];
|
|
19
|
-
const localOptions = localConfig.options
|
|
20
|
-
|
|
21
|
-
const localBase = structuredClone(base);
|
|
22
|
-
const registry = {
|
|
23
|
-
data: {
|
|
24
|
-
columns: localColumns,
|
|
25
|
-
data: localData
|
|
26
|
-
},
|
|
27
|
-
base: localBase,
|
|
28
|
-
spec,
|
|
29
|
-
...localOptions
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
console.log(" localOptions ", localOptions, registry)
|
|
33
|
-
|
|
34
|
-
runSingleInstructions(singleInstructions, registry, showLog, returnLog);
|
|
35
|
-
runDoubleInstructions(doubleInstructions, registry, showLog, returnLog);
|
|
36
|
-
|
|
37
|
-
// runDoubleInstructions(doubleInstructions, registry, functions, spec, showLog, returnLog);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
actions({ inOptions: localOptions, inBase: localBase });
|
|
41
|
-
|
|
42
|
-
return localBase;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default startFunc;
|
package/src/v30/actions/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import insertSerial from "./insertSerial/index.js";
|
|
2
|
-
import insertOptions from "./insertOptions/index.js";
|
|
3
|
-
import insertSearch from "./insertSearch/index.js";
|
|
4
|
-
|
|
5
|
-
const startFunc = ({ inOptions = {}, inBase, showLog = false, returnLog = [] }) => {
|
|
6
|
-
const localOptions = inOptions;
|
|
7
|
-
|
|
8
|
-
const localBase = inBase;
|
|
9
|
-
|
|
10
|
-
console.log(localOptions)
|
|
11
|
-
if (localOptions.showSerial || localOptions.serial) {
|
|
12
|
-
insertSerial(localBase, localOptions.serial || {}, showLog, returnLog);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (localOptions.showOptions || localOptions.options) {
|
|
16
|
-
insertOptions(localBase, localOptions.options || {}, showLog, returnLog);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
if (localOptions.showSearch) {
|
|
20
|
-
insertSearch();
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return localBase;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default startFunc;
|
|
@@ -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;
|