@legalplace/wizardx-core 4.43.0 → 4.43.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.
|
@@ -56,10 +56,10 @@ const stateToProps = (selectors) => (state, ownProps) => {
|
|
|
56
56
|
const mandatoryIgnore = selectors.selectMandatoryIgnore();
|
|
57
57
|
const { meta, options: childOptions, variables: childVariables } = option;
|
|
58
58
|
const helper = meta.helper
|
|
59
|
-
? parseRawWithVariables(meta.helper, undefined, "________________")
|
|
59
|
+
? parseRawWithVariables(meta.helper, undefined, "________________", index)
|
|
60
60
|
: undefined;
|
|
61
61
|
const warning = meta.warning
|
|
62
|
-
? parseRawWithVariables(meta.warning, undefined, "________________")
|
|
62
|
+
? parseRawWithVariables(meta.warning, undefined, "________________", index)
|
|
63
63
|
: undefined;
|
|
64
64
|
const { type } = meta;
|
|
65
65
|
return {
|
|
@@ -11,7 +11,7 @@ export declare type parseVariableLabelT = (id: number, index: number) => string;
|
|
|
11
11
|
export declare const parseVariableLabel: parseVariableLabelT;
|
|
12
12
|
export declare type parseOptionLabelT = (id: number, index: number) => string;
|
|
13
13
|
export declare const parseOptionLabel: parseOptionLabelT;
|
|
14
|
-
export declare type parseRawT = (text: string, inputs?: OptionsVariablesType, placeholder?: string) => string;
|
|
14
|
+
export declare type parseRawT = (text: string, inputs?: OptionsVariablesType, placeholder?: string, index?: number) => string;
|
|
15
15
|
export declare const parseRawWithVariables: parseRawT;
|
|
16
16
|
export declare type parseRawWithRelatedVariablesT = (text: string, optionId: number, index: number, inputs?: OptionsVariablesType, placeholder?: string) => string;
|
|
17
17
|
export declare const parseRawWithRelatedVariables: parseRawWithRelatedVariablesT;
|
|
@@ -145,7 +145,7 @@ export const parseOptionLabel = (id, index = 0) => {
|
|
|
145
145
|
});
|
|
146
146
|
return parsedLabel;
|
|
147
147
|
};
|
|
148
|
-
export const parseRawWithVariables = (text, inputs, placeholder) => {
|
|
148
|
+
export const parseRawWithVariables = (text, inputs, placeholder, index = 0) => {
|
|
149
149
|
const tagsMatch = text.match(/\[var:([0-9]+)\]/gi);
|
|
150
150
|
let variables = [];
|
|
151
151
|
if (tagsMatch !== null) {
|
|
@@ -163,8 +163,8 @@ export const parseRawWithVariables = (text, inputs, placeholder) => {
|
|
|
163
163
|
variables.forEach((variableId) => {
|
|
164
164
|
var _a;
|
|
165
165
|
const value = inputs
|
|
166
|
-
? (_a = inputs.variables[variableId]) === null || _a === void 0 ? void 0 : _a[
|
|
167
|
-
: selectVariableInputByIndex(variableId,
|
|
166
|
+
? (_a = inputs.variables[variableId]) === null || _a === void 0 ? void 0 : _a[index]
|
|
167
|
+
: selectVariableInputByIndex(variableId, index);
|
|
168
168
|
if (value === undefined ||
|
|
169
169
|
value === null ||
|
|
170
170
|
(typeof value === "string" && value.trim().length === 0)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/wizardx-core",
|
|
3
|
-
"version": "4.43.
|
|
3
|
+
"version": "4.43.2",
|
|
4
4
|
"author": "Moncef Hammou (moncef@legalplace.fr)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@appnest/masonry-layout": "^2.0.8",
|
|
23
23
|
"@cryptography/sha1": "^0.2.0",
|
|
24
|
-
"@legalplace/data-gouv": "^1.6.
|
|
24
|
+
"@legalplace/data-gouv": "^1.6.98",
|
|
25
25
|
"@legalplace/lp-events": "1.14.0",
|
|
26
26
|
"@legalplace/lplogic": "2.3.1",
|
|
27
27
|
"@legalplace/model-healthcheck": "^1.1.5",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@legalplace/eslint-config": "^2.3.0",
|
|
63
63
|
"@legalplace/models-v3-types": "^5.15.0",
|
|
64
64
|
"@legalplace/prettier-config": "^2.1.3",
|
|
65
|
-
"@legalplace/typeorm-entities": "^5.67.
|
|
65
|
+
"@legalplace/typeorm-entities": "^5.67.5",
|
|
66
66
|
"@swc-node/jest": "^1.3.2",
|
|
67
67
|
"@swc/core": "^1.2.93",
|
|
68
68
|
"@swc/jest": "^0.2.4",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"*.test.ts",
|
|
101
101
|
"*.test.tsx"
|
|
102
102
|
],
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "44b921d2c3ef2ebaead50603b405bd330c73032f"
|
|
104
104
|
}
|