@legalplace/prerenderx 3.9.5 → 3.9.8
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/CHANGELOG.md +27 -0
- package/dist/libs/OptionRender.js +5 -3
- package/dist/libs/SectionRender.js +1 -1
- package/dist/libs/misc/FillPdfFormBase.js +7 -5
- package/package.json +6 -6
- package/src/libs/OptionRender.ts +4 -3
- package/src/libs/SectionRender.ts +2 -1
- package/src/libs/misc/FillPdfFormBase.ts +13 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.9.8](https://git.legalplace.eu/legalplace/prerenderx/compare/@legalplace/prerenderx@3.9.7...@legalplace/prerenderx@3.9.8) (2026-09-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @legalplace/prerenderx
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.9.7](https://git.legalplace.eu/legalplace/prerenderx/compare/@legalplace/prerenderx@3.9.6...@legalplace/prerenderx@3.9.7) (2026-09-21)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @legalplace/prerenderx
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [3.9.6](https://git.legalplace.eu/legalplace/prerenderx/compare/@legalplace/prerenderx@3.9.5...@legalplace/prerenderx@3.9.6) (2026-09-10)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* fix section handling across multiple documents ([6ff17f7](https://git.legalplace.eu/legalplace/prerenderx/commits/6ff17f7374ce746b304839566d1ef1222e6f9033))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [3.9.5](https://git.legalplace.eu/legalplace/prerenderx/compare/@legalplace/prerenderx@3.9.4...@legalplace/prerenderx@3.9.5) (2026-09-10)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @legalplace/prerenderx
|
|
@@ -29,7 +29,9 @@ var OptionRender = (function () {
|
|
|
29
29
|
OptionRender.prototype.isDisplayed = function (optionId) {
|
|
30
30
|
var _this = this;
|
|
31
31
|
if (optionId === void 0) { optionId = this.id; }
|
|
32
|
-
return (0, referencesparser_1.isOptionDisplayed)(this.references, this.ovc, function (type, entityId, entityIndex) {
|
|
32
|
+
return (0, referencesparser_1.isOptionDisplayed)(this.references, this.ovc, function (type, entityId, entityIndex, documentSlug) {
|
|
33
|
+
var _a;
|
|
34
|
+
if (documentSlug === void 0) { documentSlug = "main"; }
|
|
33
35
|
if (type === "options") {
|
|
34
36
|
var conditionObject = _this.references.conditions.options[entityId];
|
|
35
37
|
return conditionObject === undefined
|
|
@@ -37,10 +39,10 @@ var OptionRender = (function () {
|
|
|
37
39
|
: _this.conditions.executeCondition(conditionObject, entityId, entityIndex, "options");
|
|
38
40
|
}
|
|
39
41
|
if (type === "sections") {
|
|
40
|
-
var conditionObject = _this.references.conditions.sections
|
|
42
|
+
var conditionObject = (_a = _this.references.conditions.sections[documentSlug]) === null || _a === void 0 ? void 0 : _a[entityId];
|
|
41
43
|
return conditionObject === undefined
|
|
42
44
|
? true
|
|
43
|
-
: _this.conditions.executeCondition(conditionObject, entityId, entityIndex, "sections");
|
|
45
|
+
: _this.conditions.executeCondition(conditionObject, entityId, entityIndex, "sections", documentSlug);
|
|
44
46
|
}
|
|
45
47
|
return true;
|
|
46
48
|
}, optionId, this.index);
|
|
@@ -44,7 +44,7 @@ var SectionRender = (function () {
|
|
|
44
44
|
var conditionObject = this.references.conditions.sections[this.documentName][this.currentSection];
|
|
45
45
|
var condition = conditionObject === undefined
|
|
46
46
|
? true
|
|
47
|
-
: this.conditions.executeCondition(conditionObject, 0, this.baseIndex, "sections");
|
|
47
|
+
: this.conditions.executeCondition(conditionObject, 0, this.baseIndex, "sections", this.documentName);
|
|
48
48
|
if (condition !== true)
|
|
49
49
|
return;
|
|
50
50
|
var documentMultipleSource = this.getDocumentMultipleSource();
|
|
@@ -4,12 +4,12 @@ var referencesparser_1 = require("@legalplace/referencesparser");
|
|
|
4
4
|
var FillPdfFormBase = (function () {
|
|
5
5
|
function FillPdfFormBase(references, conditions, ovc) {
|
|
6
6
|
var _this = this;
|
|
7
|
-
this.conditionEvaluator = function (type, id, index) {
|
|
7
|
+
this.conditionEvaluator = function (type, id, index, documentSlug) {
|
|
8
8
|
if (type === "options")
|
|
9
9
|
return _this.getOptionCondition(id, index);
|
|
10
10
|
if (type === "variables")
|
|
11
11
|
return _this.getVariableCondition(id, index);
|
|
12
|
-
return _this.getSectionCondition(id);
|
|
12
|
+
return _this.getSectionCondition(id, documentSlug);
|
|
13
13
|
};
|
|
14
14
|
this.references = references;
|
|
15
15
|
this.conditions = conditions;
|
|
@@ -33,11 +33,13 @@ var FillPdfFormBase = (function () {
|
|
|
33
33
|
? true
|
|
34
34
|
: this.conditions.executeCondition(conditionObject, id, index, "options");
|
|
35
35
|
};
|
|
36
|
-
FillPdfFormBase.prototype.getSectionCondition = function (id) {
|
|
37
|
-
var
|
|
36
|
+
FillPdfFormBase.prototype.getSectionCondition = function (id, documentSlug) {
|
|
37
|
+
var _a;
|
|
38
|
+
if (documentSlug === void 0) { documentSlug = "main"; }
|
|
39
|
+
var conditionObject = (_a = this.references.conditions.sections[documentSlug]) === null || _a === void 0 ? void 0 : _a[id];
|
|
38
40
|
return conditionObject === undefined
|
|
39
41
|
? true
|
|
40
|
-
: this.conditions.executeCondition(conditionObject, id, 0, "sections");
|
|
42
|
+
: this.conditions.executeCondition(conditionObject, id, 0, "sections", documentSlug);
|
|
41
43
|
};
|
|
42
44
|
return FillPdfFormBase;
|
|
43
45
|
}());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/prerenderx",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.8",
|
|
4
4
|
"description": "PrerenderX",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": "https://git.legalplace.eu/legalplace/prerenderx",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"release": "standard-version -a --no-verify"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@legalplace/conditions-runner": "^2.4.
|
|
19
|
+
"@legalplace/conditions-runner": "^2.4.4",
|
|
20
20
|
"@legalplace/lplogic": "2.4.1",
|
|
21
21
|
"@legalplace/models-v3-types": "^5.20.0",
|
|
22
|
-
"@legalplace/ovc-converter": "^2.2.
|
|
23
|
-
"@legalplace/referencesparser": "^3.4.
|
|
22
|
+
"@legalplace/ovc-converter": "^2.2.29",
|
|
23
|
+
"@legalplace/referencesparser": "^3.4.4",
|
|
24
24
|
"@legalplace/yousign": "^0.9.23",
|
|
25
25
|
"crypto": "^1.0.1"
|
|
26
26
|
},
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@babel/preset-typescript": "^7.7.2",
|
|
30
30
|
"@legalplace/eslint-config-base": "^1.2.0",
|
|
31
31
|
"@legalplace/prettier-config": "^2.1.3",
|
|
32
|
-
"@legalplace/types": "^2.
|
|
32
|
+
"@legalplace/types": "^2.23.1",
|
|
33
33
|
"@types/jest": "^24.0.15",
|
|
34
34
|
"jest": "^24.8.0",
|
|
35
35
|
"redux-mock-store": "^1.5.3",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"ts-jest": "^24.0.2"
|
|
38
38
|
},
|
|
39
39
|
"prettier": "@legalplace/prettier-config",
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "b1a5d5ed7602852faf16dd89d276f67457da951c"
|
|
41
41
|
}
|
package/src/libs/OptionRender.ts
CHANGED
|
@@ -67,7 +67,7 @@ class OptionRender {
|
|
|
67
67
|
return isOptionDisplayed(
|
|
68
68
|
this.references,
|
|
69
69
|
this.ovc,
|
|
70
|
-
(type, entityId, entityIndex) => {
|
|
70
|
+
(type, entityId, entityIndex, documentSlug = "main") => {
|
|
71
71
|
if (type === "options") {
|
|
72
72
|
const conditionObject = this.references.conditions.options[entityId];
|
|
73
73
|
return conditionObject === undefined
|
|
@@ -81,14 +81,15 @@ class OptionRender {
|
|
|
81
81
|
}
|
|
82
82
|
if (type === "sections") {
|
|
83
83
|
const conditionObject =
|
|
84
|
-
this.references.conditions.sections
|
|
84
|
+
this.references.conditions.sections[documentSlug]?.[entityId];
|
|
85
85
|
return conditionObject === undefined
|
|
86
86
|
? true
|
|
87
87
|
: this.conditions.executeCondition(
|
|
88
88
|
conditionObject,
|
|
89
89
|
entityId,
|
|
90
90
|
entityIndex,
|
|
91
|
-
"sections"
|
|
91
|
+
"sections",
|
|
92
|
+
documentSlug
|
|
92
93
|
);
|
|
93
94
|
}
|
|
94
95
|
return true;
|
|
@@ -29,11 +29,12 @@ class FillPdfFormBase {
|
|
|
29
29
|
private readonly conditionEvaluator: ConditionEvaluator = (
|
|
30
30
|
type,
|
|
31
31
|
id,
|
|
32
|
-
index
|
|
32
|
+
index,
|
|
33
|
+
documentSlug
|
|
33
34
|
) => {
|
|
34
35
|
if (type === "options") return this.getOptionCondition(id, index);
|
|
35
36
|
if (type === "variables") return this.getVariableCondition(id, index);
|
|
36
|
-
return this.getSectionCondition(id);
|
|
37
|
+
return this.getSectionCondition(id, documentSlug);
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
/**
|
|
@@ -90,11 +91,18 @@ class FillPdfFormBase {
|
|
|
90
91
|
/**
|
|
91
92
|
* Returns a section's conditions.
|
|
92
93
|
*/
|
|
93
|
-
private getSectionCondition(id: number) {
|
|
94
|
-
const conditionObject =
|
|
94
|
+
private getSectionCondition(id: number, documentSlug = "main") {
|
|
95
|
+
const conditionObject =
|
|
96
|
+
this.references.conditions.sections[documentSlug]?.[id];
|
|
95
97
|
return conditionObject === undefined
|
|
96
98
|
? true
|
|
97
|
-
: this.conditions.executeCondition(
|
|
99
|
+
: this.conditions.executeCondition(
|
|
100
|
+
conditionObject,
|
|
101
|
+
id,
|
|
102
|
+
0,
|
|
103
|
+
"sections",
|
|
104
|
+
documentSlug
|
|
105
|
+
);
|
|
98
106
|
}
|
|
99
107
|
}
|
|
100
108
|
|