@inseefr/lunatic 3.7.7 → 3.8.0-rc.ucq-options-variable.0
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/esm/type.source.d.ts +18 -3
- package/esm/use-lunatic/commons/compile-controls.js +2 -16
- package/esm/use-lunatic/commons/compile-controls.js.map +1 -1
- package/esm/use-lunatic/commons/component.d.ts +33 -0
- package/esm/use-lunatic/commons/component.js +37 -0
- package/esm/use-lunatic/commons/component.js.map +1 -1
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +1 -1
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
- package/esm/use-lunatic/commons/fill-components/fill-components.js +10 -2
- package/esm/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
- package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js.map +1 -1
- package/esm/use-lunatic/commons/variables/global-variables.d.ts +5 -0
- package/esm/use-lunatic/commons/variables/global-variables.js +7 -0
- package/esm/use-lunatic/commons/variables/global-variables.js.map +1 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.d.ts +21 -9
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.js +67 -49
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -1
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js +137 -6
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -1
- package/esm/use-lunatic/commons/variables/models.d.ts +1 -0
- package/esm/use-lunatic/commons/variables/models.js +2 -0
- package/esm/use-lunatic/commons/variables/models.js.map +1 -0
- package/esm/use-lunatic/commons/variables/pairwise-variables.d.ts +29 -0
- package/esm/use-lunatic/commons/variables/pairwise-variables.js +196 -0
- package/esm/use-lunatic/commons/variables/pairwise-variables.js.map +1 -0
- package/esm/use-lunatic/props/getComponentTypeProps.d.ts +1 -1
- package/esm/use-lunatic/props/propOptions.d.ts +9 -1
- package/esm/use-lunatic/props/propOptions.js +56 -1
- package/esm/use-lunatic/props/propOptions.js.map +1 -1
- package/esm/use-lunatic/props/propOptions.spec.js +220 -56
- package/esm/use-lunatic/props/propOptions.spec.js.map +1 -1
- package/esm/use-lunatic/reducer/reducerInitializer.js +5 -1
- package/esm/use-lunatic/reducer/reducerInitializer.js.map +1 -1
- package/package.json +26 -1
- package/src/stories/checkbox/checkbox.stories.tsx +13 -0
- package/src/stories/checkbox/sourceOneDynamicOptions.json +496 -0
- package/src/stories/dropdown/dropdown.stories.tsx +12 -0
- package/src/stories/dropdown/sourceDynamicOptions.json +496 -0
- package/src/stories/pairwise/pairwise.stories.tsx +7 -0
- package/src/stories/pairwise/sourceGlobalVariables.json +337 -0
- package/src/stories/radio/radio.stories.tsx +13 -0
- package/src/stories/radio/sourceDynamicOptions.json +496 -0
- package/src/type.source.ts +18 -3
- package/src/use-lunatic/commons/compile-controls.ts +10 -42
- package/src/use-lunatic/commons/component.ts +79 -0
- package/src/use-lunatic/commons/fill-components/fill-component-expressions.ts +2 -1
- package/src/use-lunatic/commons/fill-components/fill-components.ts +9 -10
- package/src/use-lunatic/commons/variables/behaviours/cleaning-behaviour.ts +2 -4
- package/src/use-lunatic/commons/variables/global-variables.ts +9 -0
- package/src/use-lunatic/commons/variables/lunatic-variables-store.spec.ts +149 -6
- package/src/use-lunatic/commons/variables/lunatic-variables-store.ts +113 -50
- package/src/use-lunatic/commons/variables/models.ts +1 -0
- package/src/use-lunatic/commons/variables/pairwise-variables.ts +251 -0
- package/src/use-lunatic/props/propOptions.spec.ts +217 -147
- package/src/use-lunatic/props/propOptions.ts +97 -8
- package/src/use-lunatic/reducer/reducerInitializer.tsx +5 -7
- package/tsconfig.build.tsbuildinfo +1 -1
- package/type.source.d.ts +18 -3
- package/use-lunatic/commons/compile-controls.js +4 -18
- package/use-lunatic/commons/compile-controls.js.map +1 -1
- package/use-lunatic/commons/component.d.ts +33 -0
- package/use-lunatic/commons/component.js +42 -0
- package/use-lunatic/commons/component.js.map +1 -1
- package/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +1 -1
- package/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
- package/use-lunatic/commons/fill-components/fill-components.js +9 -1
- package/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
- package/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js.map +1 -1
- package/use-lunatic/commons/variables/global-variables.d.ts +5 -0
- package/use-lunatic/commons/variables/global-variables.js +11 -0
- package/use-lunatic/commons/variables/global-variables.js.map +1 -0
- package/use-lunatic/commons/variables/lunatic-variables-store.d.ts +21 -9
- package/use-lunatic/commons/variables/lunatic-variables-store.js +72 -50
- package/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -1
- package/use-lunatic/commons/variables/lunatic-variables-store.spec.js +137 -6
- package/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -1
- package/use-lunatic/commons/variables/models.d.ts +1 -0
- package/use-lunatic/commons/variables/models.js +3 -0
- package/use-lunatic/commons/variables/models.js.map +1 -0
- package/use-lunatic/commons/variables/pairwise-variables.d.ts +29 -0
- package/use-lunatic/commons/variables/pairwise-variables.js +199 -0
- package/use-lunatic/commons/variables/pairwise-variables.js.map +1 -0
- package/use-lunatic/props/getComponentTypeProps.d.ts +1 -1
- package/use-lunatic/props/propOptions.d.ts +9 -1
- package/use-lunatic/props/propOptions.js +57 -2
- package/use-lunatic/props/propOptions.js.map +1 -1
- package/use-lunatic/props/propOptions.spec.js +217 -55
- package/use-lunatic/props/propOptions.spec.js.map +1 -1
- package/use-lunatic/reducer/reducerInitializer.js +5 -1
- package/use-lunatic/reducer/reducerInitializer.js.map +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LunaticSource } from '../../type';
|
|
2
|
+
import { LunaticVariable } from './lunatic-variables-store';
|
|
3
|
+
import { IterationLevel } from './models';
|
|
4
|
+
/** Key used by the global dependencies map to store specific dependency. */
|
|
5
|
+
export declare enum PairwiseGlobalDependency {
|
|
6
|
+
Links = 0,
|
|
7
|
+
Name = 1,
|
|
8
|
+
Gender = 2
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Manually setup the available pairwise global variables thanks to known
|
|
12
|
+
* business rules.
|
|
13
|
+
*
|
|
14
|
+
* The variables information (necessary for the setup) are only returned if
|
|
15
|
+
* there is a pairwise component in the provided source.
|
|
16
|
+
*/
|
|
17
|
+
export declare function computePairwiseGlobalVariables(source: LunaticSource): {
|
|
18
|
+
name: string;
|
|
19
|
+
dependencies: string[];
|
|
20
|
+
globalDependencies: Map<PairwiseGlobalDependency, string>;
|
|
21
|
+
shapeFrom?: string;
|
|
22
|
+
}[];
|
|
23
|
+
/**
|
|
24
|
+
* Compute the value of the pairwise global variable.
|
|
25
|
+
*
|
|
26
|
+
* It the variable name does not exist or if the value does not exist, it will
|
|
27
|
+
* return undefined.
|
|
28
|
+
*/
|
|
29
|
+
export declare function computePairwiseGlobalVariableValue(variableName: string, iteration: IterationLevel, globalDependencies: Map<PairwiseGlobalDependency, string>, dictionary: Map<string, LunaticVariable>): string | undefined;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Global variables that are created when a pairwise component is present.
|
|
4
|
+
|
|
5
|
+
They can be used when creating the survey, so that filters can be made without
|
|
6
|
+
needing to make complex formula.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PairwiseGlobalDependency = void 0;
|
|
10
|
+
exports.computePairwiseGlobalVariables = computePairwiseGlobalVariables;
|
|
11
|
+
exports.computePairwiseGlobalVariableValue = computePairwiseGlobalVariableValue;
|
|
12
|
+
const component_1 = require("../component");
|
|
13
|
+
/** Name of the first parent defined in the pairwise component. */
|
|
14
|
+
const GLOBAL_PARENT1_NAME = 'GLOBAL_PARENT1_PRENOM';
|
|
15
|
+
/**
|
|
16
|
+
* Gender of the first parent defined in the pairwise component:
|
|
17
|
+
* `"1"` = man, `"2"` = woman.
|
|
18
|
+
*/
|
|
19
|
+
const GLOBAL_PARENT1_GENDER = 'GLOBAL_PARENT1_SEXE';
|
|
20
|
+
/** Name of the second parent defined in the pairwise component. */
|
|
21
|
+
const GLOBAL_PARENT2_NAME = 'GLOBAL_PARENT2_PRENOM';
|
|
22
|
+
/**
|
|
23
|
+
* Gender of the second parent defined in the pairwise component:
|
|
24
|
+
* `"1"` = man, `"2"` = woman.
|
|
25
|
+
*/
|
|
26
|
+
const GLOBAL_PARENT2_GENDER = 'GLOBAL_PARENT2_SEXE';
|
|
27
|
+
/** Name of the partner defined in the pairwise component. */
|
|
28
|
+
const GLOBAL_PARTNER_NAME = 'GLOBAL_CONJOINT_PRENOM';
|
|
29
|
+
/**
|
|
30
|
+
* Names of the children defined in the pairwise component: the format is a
|
|
31
|
+
* string with ";" separating them.
|
|
32
|
+
*/
|
|
33
|
+
const GLOBAL_CHILDREN_NAMES = 'GLOBAL_ENFANTS_PRENOMS';
|
|
34
|
+
/**
|
|
35
|
+
* Pairwise links are defined by fixed values which represent a specific
|
|
36
|
+
* relationship type.
|
|
37
|
+
*/
|
|
38
|
+
var LinkType;
|
|
39
|
+
(function (LinkType) {
|
|
40
|
+
LinkType["Partner"] = "1";
|
|
41
|
+
LinkType["Parent"] = "2";
|
|
42
|
+
LinkType["Child"] = "3";
|
|
43
|
+
})(LinkType || (LinkType = {}));
|
|
44
|
+
/** Key used by the global dependencies map to store specific dependency. */
|
|
45
|
+
var PairwiseGlobalDependency;
|
|
46
|
+
(function (PairwiseGlobalDependency) {
|
|
47
|
+
PairwiseGlobalDependency[PairwiseGlobalDependency["Links"] = 0] = "Links";
|
|
48
|
+
PairwiseGlobalDependency[PairwiseGlobalDependency["Name"] = 1] = "Name";
|
|
49
|
+
PairwiseGlobalDependency[PairwiseGlobalDependency["Gender"] = 2] = "Gender";
|
|
50
|
+
})(PairwiseGlobalDependency || (exports.PairwiseGlobalDependency = PairwiseGlobalDependency = {}));
|
|
51
|
+
/**
|
|
52
|
+
* Manually setup the available pairwise global variables thanks to known
|
|
53
|
+
* business rules.
|
|
54
|
+
*
|
|
55
|
+
* The variables information (necessary for the setup) are only returned if
|
|
56
|
+
* there is a pairwise component in the provided source.
|
|
57
|
+
*/
|
|
58
|
+
function computePairwiseGlobalVariables(source) {
|
|
59
|
+
const component = (0, component_1.getPairwiseComponent)(source.components);
|
|
60
|
+
// There is not pairwise component, no need to initialize the variables.
|
|
61
|
+
if (!component)
|
|
62
|
+
return [];
|
|
63
|
+
const variables = [];
|
|
64
|
+
const pairwiseVariable = component.components[0].response.name;
|
|
65
|
+
const nameSourceVariable = component.sourceVariables?.name;
|
|
66
|
+
const genderSourceVariable = component.sourceVariables?.gender;
|
|
67
|
+
// Setup variables associated to the name.
|
|
68
|
+
if (nameSourceVariable) {
|
|
69
|
+
const globalDependencies = new Map();
|
|
70
|
+
globalDependencies.set(PairwiseGlobalDependency.Links, pairwiseVariable);
|
|
71
|
+
globalDependencies.set(PairwiseGlobalDependency.Name, nameSourceVariable);
|
|
72
|
+
const dependencies = [pairwiseVariable, nameSourceVariable];
|
|
73
|
+
variables.push({
|
|
74
|
+
name: GLOBAL_PARENT1_NAME,
|
|
75
|
+
dependencies,
|
|
76
|
+
globalDependencies,
|
|
77
|
+
shapeFrom: nameSourceVariable,
|
|
78
|
+
}, {
|
|
79
|
+
name: GLOBAL_PARENT2_NAME,
|
|
80
|
+
dependencies,
|
|
81
|
+
globalDependencies,
|
|
82
|
+
shapeFrom: nameSourceVariable,
|
|
83
|
+
}, {
|
|
84
|
+
name: GLOBAL_PARTNER_NAME,
|
|
85
|
+
dependencies,
|
|
86
|
+
globalDependencies,
|
|
87
|
+
shapeFrom: nameSourceVariable,
|
|
88
|
+
}, {
|
|
89
|
+
name: GLOBAL_CHILDREN_NAMES,
|
|
90
|
+
dependencies,
|
|
91
|
+
globalDependencies,
|
|
92
|
+
shapeFrom: nameSourceVariable,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// Setup variables associated to the gender.
|
|
96
|
+
if (genderSourceVariable) {
|
|
97
|
+
const globalDependencies = new Map();
|
|
98
|
+
globalDependencies.set(PairwiseGlobalDependency.Links, pairwiseVariable);
|
|
99
|
+
globalDependencies.set(PairwiseGlobalDependency.Gender, genderSourceVariable);
|
|
100
|
+
const dependencies = [pairwiseVariable, genderSourceVariable];
|
|
101
|
+
variables.push({
|
|
102
|
+
name: GLOBAL_PARENT1_GENDER,
|
|
103
|
+
dependencies,
|
|
104
|
+
globalDependencies,
|
|
105
|
+
shapeFrom: nameSourceVariable,
|
|
106
|
+
}, {
|
|
107
|
+
name: GLOBAL_PARENT2_GENDER,
|
|
108
|
+
dependencies,
|
|
109
|
+
globalDependencies,
|
|
110
|
+
shapeFrom: nameSourceVariable,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return variables;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Compute the value of the pairwise global variable.
|
|
117
|
+
*
|
|
118
|
+
* It the variable name does not exist or if the value does not exist, it will
|
|
119
|
+
* return undefined.
|
|
120
|
+
*/
|
|
121
|
+
function computePairwiseGlobalVariableValue(variableName, iteration, globalDependencies, dictionary) {
|
|
122
|
+
// Get the values of the global dependencies we need
|
|
123
|
+
// (i.e. they exist in the map)
|
|
124
|
+
const linksVar = globalDependencies.get(PairwiseGlobalDependency.Links);
|
|
125
|
+
const links = linksVar ? dictionary?.get(linksVar)?.getValue() : [[]];
|
|
126
|
+
const namesVar = globalDependencies.get(PairwiseGlobalDependency.Name);
|
|
127
|
+
const names = namesVar ? dictionary?.get(namesVar)?.getValue() : [];
|
|
128
|
+
const gendersVar = globalDependencies.get(PairwiseGlobalDependency.Gender);
|
|
129
|
+
const genders = gendersVar ? dictionary?.get(gendersVar)?.getValue() : [];
|
|
130
|
+
return computeVariableValue(variableName, iteration, {
|
|
131
|
+
genders: genders,
|
|
132
|
+
links: links,
|
|
133
|
+
names: names,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/** Compute the value of the pairwise global variable. */
|
|
137
|
+
function computeVariableValue(variableName, iteration, { genders = [], links = [[]], names = [], }) {
|
|
138
|
+
const idx = Array.isArray(iteration) ? iteration[0] : iteration;
|
|
139
|
+
const currentLinks = links[idx];
|
|
140
|
+
switch (variableName) {
|
|
141
|
+
case GLOBAL_PARENT1_NAME:
|
|
142
|
+
return computeParent1NameValue(currentLinks, names);
|
|
143
|
+
case GLOBAL_PARENT1_GENDER:
|
|
144
|
+
return computeParent1GenderValue(currentLinks, genders);
|
|
145
|
+
case GLOBAL_PARENT2_NAME:
|
|
146
|
+
return computeParent2NameValue(currentLinks, names);
|
|
147
|
+
case GLOBAL_PARENT2_GENDER:
|
|
148
|
+
return computeParent2GenderValue(currentLinks, genders);
|
|
149
|
+
case GLOBAL_PARTNER_NAME:
|
|
150
|
+
return computePartnerNameValue(currentLinks, names);
|
|
151
|
+
case GLOBAL_CHILDREN_NAMES:
|
|
152
|
+
return computeChildrenNamesValue(currentLinks, names);
|
|
153
|
+
default:
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/** Get the index of the first parent found in pairwise links. */
|
|
158
|
+
function getFirstParentIndex(links) {
|
|
159
|
+
return links.indexOf(LinkType.Parent);
|
|
160
|
+
}
|
|
161
|
+
/** Get the index of the second parent found in pairwise links. */
|
|
162
|
+
function getSecondParentIndex(links) {
|
|
163
|
+
const firstParentIdx = links.indexOf(LinkType.Parent);
|
|
164
|
+
return links.indexOf(LinkType.Parent, firstParentIdx + 1);
|
|
165
|
+
}
|
|
166
|
+
/** Get the index of the first partner found in pairwise links. */
|
|
167
|
+
function getPartnerIndex(links) {
|
|
168
|
+
return links.indexOf(LinkType.Partner);
|
|
169
|
+
}
|
|
170
|
+
function computeParent1NameValue(links, names) {
|
|
171
|
+
const idx = getFirstParentIndex(links);
|
|
172
|
+
return idx === -1 ? undefined : names[idx];
|
|
173
|
+
}
|
|
174
|
+
function computeParent1GenderValue(links, genders) {
|
|
175
|
+
const idx = getFirstParentIndex(links);
|
|
176
|
+
return idx === -1 ? undefined : genders[idx];
|
|
177
|
+
}
|
|
178
|
+
function computeParent2NameValue(links, names) {
|
|
179
|
+
const idx = getSecondParentIndex(links);
|
|
180
|
+
return idx === -1 ? undefined : names[idx];
|
|
181
|
+
}
|
|
182
|
+
function computeParent2GenderValue(links, genders) {
|
|
183
|
+
const idx = getSecondParentIndex(links);
|
|
184
|
+
return idx === -1 ? undefined : genders[idx];
|
|
185
|
+
}
|
|
186
|
+
function computePartnerNameValue(links, names) {
|
|
187
|
+
const idx = getPartnerIndex(links);
|
|
188
|
+
return idx === -1 ? undefined : names[idx];
|
|
189
|
+
}
|
|
190
|
+
function computeChildrenNamesValue(links, names) {
|
|
191
|
+
const res = [];
|
|
192
|
+
for (let i = 0; i < links.length; i++) {
|
|
193
|
+
if (links[i] === LinkType.Child) {
|
|
194
|
+
res.push(names[i]);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return res.length > 0 ? res.join(';') : undefined;
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=pairwise-variables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pairwise-variables.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/variables/pairwise-variables.ts"],"names":[],"mappings":";AAAA;;;;;EAKE;;;AAsDF,wEA+EC;AAQD,gFAsBC;AA/JD,4CAAoD;AAIpD,kEAAkE;AAClE,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AACpD;;;GAGG;AACH,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AACpD,mEAAmE;AACnE,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AACpD;;;GAGG;AACH,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AACpD,6DAA6D;AAC7D,MAAM,mBAAmB,GAAG,wBAAwB,CAAC;AACrD;;;GAGG;AACH,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAEvD;;;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CAAC,CAAC;IACxC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,yBAAyB,CAAC,KAAe,EAAE,OAAiB;IACpE,MAAM,GAAG,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAe,EAAE,KAAe;IAChE,MAAM,GAAG,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,yBAAyB,CAAC,KAAe,EAAE,KAAe;IAClE,MAAM,GAAG,GAAG,EAAE,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,KAAK,EAAE,CAAC;YACjC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACnD,CAAC"}
|
|
@@ -187,7 +187,7 @@ export declare function getComponentTypeProps(component: DeepTranslateExpression
|
|
|
187
187
|
componentType?: "Dropdown";
|
|
188
188
|
} & {
|
|
189
189
|
conditionFilter?: boolean;
|
|
190
|
-
}) | (Pick<import("../../components/type").LunaticBaseProps<unknown>, "label" | "description" | "declarations" | "id" | "
|
|
190
|
+
}) | (Pick<import("../../components/type").LunaticBaseProps<unknown>, "label" | "description" | "declarations" | "id" | "disabled" | "shouldBeFiltered" | "propsTransformer" | "errors" | "readOnly"> & import("../..").LunaticExtraProps & {
|
|
191
191
|
components: import("../..").LunaticComponentProps[];
|
|
192
192
|
componentType?: "Question";
|
|
193
193
|
iteration?: number;
|
|
@@ -19,7 +19,15 @@ export type InterpretedOption = {
|
|
|
19
19
|
/**
|
|
20
20
|
* Compute options for checkboxes / radios / dropdown
|
|
21
21
|
*/
|
|
22
|
-
export declare function
|
|
22
|
+
export declare function computeOptionsFromComponent(definition: DeepTranslateExpression<LunaticComponentDefinition>, { variables, handleChanges, pagerIteration, value, logger, disableFilters, shouldParentBeFiltered, }: {
|
|
23
|
+
variables: LunaticVariablesStore;
|
|
24
|
+
handleChanges: LunaticChangesHandler;
|
|
25
|
+
pagerIteration: LunaticState['pager']['iteration'];
|
|
26
|
+
value: unknown;
|
|
27
|
+
logger: LunaticLogger;
|
|
28
|
+
disableFilters?: boolean;
|
|
29
|
+
shouldParentBeFiltered?: boolean;
|
|
30
|
+
}): InterpretedOption[] | {
|
|
23
31
|
label: ReactNode;
|
|
24
32
|
name: string;
|
|
25
33
|
id: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.computeOptionsFromComponent = computeOptionsFromComponent;
|
|
4
4
|
const number_1 = require("../../utils/number");
|
|
5
5
|
/**
|
|
6
6
|
* Compute options for checkboxes / radios / dropdown
|
|
7
7
|
*/
|
|
8
|
-
function
|
|
8
|
+
function computeOptionsFromComponent(definition, { variables, handleChanges, pagerIteration, value, logger, disableFilters, shouldParentBeFiltered, }) {
|
|
9
9
|
const iteration = (0, number_1.isNumber)(pagerIteration) ? [pagerIteration] : undefined;
|
|
10
10
|
if (definition.componentType === 'CheckboxGroup') {
|
|
11
11
|
return definition.responses
|
|
@@ -40,9 +40,24 @@ function getOptionsProp(definition, variables, handleChanges, pagerIteration, va
|
|
|
40
40
|
isFilteredOutOption(variables, iteration, logger, response.conditionFilter),
|
|
41
41
|
}));
|
|
42
42
|
}
|
|
43
|
+
// options based on another variable
|
|
44
|
+
if ('optionSource' in definition && definition.optionSource) {
|
|
45
|
+
return computeOptionsFromSource(definition.optionSource, {
|
|
46
|
+
variables,
|
|
47
|
+
value,
|
|
48
|
+
handleChanges,
|
|
49
|
+
responseName: definition.response.name,
|
|
50
|
+
logger,
|
|
51
|
+
shouldParentBeFiltered,
|
|
52
|
+
optionFilter: definition.optionFilter,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
43
55
|
if (!('options' in definition)) {
|
|
44
56
|
return [];
|
|
45
57
|
}
|
|
58
|
+
if (!definition.options) {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
46
61
|
return definition.options
|
|
47
62
|
.filter((option) => {
|
|
48
63
|
if (disableFilters ||
|
|
@@ -81,6 +96,46 @@ function getOptionsProp(definition, variables, handleChanges, pagerIteration, va
|
|
|
81
96
|
isFilteredOutOption(variables, iteration, logger, option.conditionFilter)),
|
|
82
97
|
}));
|
|
83
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Get all options from a source variable, applying filters.
|
|
101
|
+
*/
|
|
102
|
+
function computeOptionsFromSource(optionSource, { variables, value, handleChanges, responseName, logger, shouldParentBeFiltered, optionFilter, }) {
|
|
103
|
+
// we don't know the type of the optionSource values (string, numbers, boolean)
|
|
104
|
+
const optionValues = variables.get(optionSource);
|
|
105
|
+
if (!optionValues) {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
const normalizedValues = Array.isArray(optionValues)
|
|
109
|
+
? optionValues
|
|
110
|
+
: [optionValues];
|
|
111
|
+
return normalizedValues
|
|
112
|
+
.filter((option, index) => {
|
|
113
|
+
// option is an empty value, we remove it from the options list
|
|
114
|
+
if (option === null || option === undefined) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
// no filter expression, we keep the option
|
|
118
|
+
if (!optionFilter) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
// apply filter expression on option (applied to its iteration)
|
|
122
|
+
return !isFilteredOutOption(variables, [index], logger, optionFilter);
|
|
123
|
+
})
|
|
124
|
+
.map((option) => {
|
|
125
|
+
return {
|
|
126
|
+
label: String(option),
|
|
127
|
+
value: option,
|
|
128
|
+
checked: value === option,
|
|
129
|
+
onCheck: () => {
|
|
130
|
+
handleChanges([{ name: responseName, value: option }]);
|
|
131
|
+
},
|
|
132
|
+
onUncheck: () => {
|
|
133
|
+
handleChanges([{ name: responseName, value: null }]);
|
|
134
|
+
},
|
|
135
|
+
shouldBeFiltered: shouldParentBeFiltered,
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
}
|
|
84
139
|
/**
|
|
85
140
|
* Check if an option should be filtered, depending on its conditionFilter.
|
|
86
141
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propOptions.js","sourceRoot":"","sources":["../../src/use-lunatic/props/propOptions.ts"],"names":[],"mappings":";;AA8BA,
|
|
1
|
+
{"version":3,"file":"propOptions.js","sourceRoot":"","sources":["../../src/use-lunatic/props/propOptions.ts"],"names":[],"mappings":";;AA8BA,kEA6IC;AApKD,+CAA8C;AAoB9C;;GAEG;AACH,SAAgB,2BAA2B,CAC1C,UAA+D,EAC/D,EACC,SAAS,EACT,aAAa,EACb,cAAc,EACd,KAAK,EACL,MAAM,EACN,cAAc,EACd,sBAAsB,GAStB;IAED,MAAM,SAAS,GAAG,IAAA,iBAAQ,EAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE1E,IAAI,UAAU,CAAC,aAAa,KAAK,eAAe,EAAE,CAAC;QAClD,OAAO,UAAU,CAAC,SAAS;aACzB,MAAM,CAAC,CAAC,QAA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