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,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;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { resolvePath } from "json-transformer-funcs";
|
|
2
|
-
import writePath from "../writePath/index.js";
|
|
3
|
-
import checkInstruction from "../guards/index.js";
|
|
4
|
-
|
|
5
|
-
const runSingleInstruction = (instruction, registry, functions, spec, showLog, returnLog) => {
|
|
6
|
-
if (!checkInstruction(instruction, functions, spec, showLog, returnLog)) return;
|
|
7
|
-
|
|
8
|
-
const localSpec = spec;
|
|
9
|
-
const templateKey = instruction.templateKey;
|
|
10
|
-
const localSpecKey = localSpec[templateKey];
|
|
11
|
-
|
|
12
|
-
console.log("templateKey ; ", templateKey);
|
|
13
|
-
console.log("localSpecKey ; ", localSpecKey);
|
|
14
|
-
|
|
15
|
-
const source = resolvePath(registry, instruction.sourcePath);
|
|
16
|
-
const result = functions[instruction.func](source, localSpecKey);
|
|
17
|
-
|
|
18
|
-
if (templateKey === "buildFooter") {
|
|
19
|
-
console.log("result ; ", result);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
writePath(registry, instruction.destinationPath, result);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const runSingleInstructions = (instructions, registry, functions, spec, showLog, returnLog) => {
|
|
26
|
-
instructions.forEach(instruction => {
|
|
27
|
-
runSingleInstruction(instruction, registry, functions, spec, showLog, returnLog);
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { runSingleInstruction, runSingleInstructions };
|
|
32
|
-
export default runSingleInstructions;
|
|
@@ -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
|
|
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
|
|
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
|