@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
package/type.source.d.ts
CHANGED
|
@@ -124,7 +124,9 @@ export type ComponentCheckboxBooleanDefinition = ComponentDefinitionBaseWithResp
|
|
|
124
124
|
export type ComponentRadioDefinition = ComponentDefinitionBaseWithResponse & {
|
|
125
125
|
componentType: 'Radio';
|
|
126
126
|
orientation?: 'horizontal' | 'vertical';
|
|
127
|
-
options
|
|
127
|
+
options?: OptionsWithDetail;
|
|
128
|
+
optionSource?: string;
|
|
129
|
+
optionFilter?: VTLExpression;
|
|
128
130
|
};
|
|
129
131
|
export type OptionsWithDetail = {
|
|
130
132
|
value: string | boolean;
|
|
@@ -140,7 +142,9 @@ export type OptionsWithDetail = {
|
|
|
140
142
|
}[];
|
|
141
143
|
export type ComponentDropdownDefinition = ComponentDefinitionBaseWithResponse & {
|
|
142
144
|
componentType: 'Dropdown';
|
|
143
|
-
options
|
|
145
|
+
options?: Options;
|
|
146
|
+
optionSource?: string;
|
|
147
|
+
optionFilter?: VTLExpression;
|
|
144
148
|
};
|
|
145
149
|
export type ComponentQuestionDefinition = ComponentDefinitionBase & {
|
|
146
150
|
componentType: 'Question';
|
|
@@ -148,7 +152,9 @@ export type ComponentQuestionDefinition = ComponentDefinitionBase & {
|
|
|
148
152
|
};
|
|
149
153
|
export type ComponentCheckboxOneDefinition = ComponentDefinitionBaseWithResponse & {
|
|
150
154
|
componentType: 'CheckboxOne';
|
|
151
|
-
options
|
|
155
|
+
options?: OptionsWithDetail;
|
|
156
|
+
optionSource?: string;
|
|
157
|
+
optionFilter?: VTLExpression;
|
|
152
158
|
};
|
|
153
159
|
export type ComponentSuggesterDefinition = ComponentDefinitionBaseWithResponse & {
|
|
154
160
|
componentType: 'Suggester';
|
|
@@ -185,6 +191,15 @@ export type ComponentPairWiseLinksDefinition = ComponentDefinitionBase & {
|
|
|
185
191
|
[k: string]: string | null;
|
|
186
192
|
};
|
|
187
193
|
};
|
|
194
|
+
sourceVariables?: {
|
|
195
|
+
/** Name of the variable containing the name of the respondent */
|
|
196
|
+
name?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Name of the variable containing the gender of the respondent
|
|
199
|
+
* (value of variable -> 1:male, 2: female)
|
|
200
|
+
*/
|
|
201
|
+
gender?: string;
|
|
202
|
+
};
|
|
188
203
|
components: ComponentDefinition[];
|
|
189
204
|
};
|
|
190
205
|
export type ComponentSummaryDefinition = ComponentDefinitionBase & {
|
|
@@ -5,21 +5,7 @@ const fill_component_expressions_1 = require("./fill-components/fill-component-e
|
|
|
5
5
|
const check_roundabout_control_1 = require("../reducer/controls/check-roundabout-control");
|
|
6
6
|
const check_base_control_1 = require("../reducer/controls/check-base-control");
|
|
7
7
|
const get_components_from_state_1 = require("./get-components-from-state");
|
|
8
|
-
|
|
9
|
-
* Check if the component is a Loop or a RosterForLoop
|
|
10
|
-
*/
|
|
11
|
-
const isLoopComponent = (component) => {
|
|
12
|
-
return ['Loop', 'RosterForLoop'].includes(component.componentType);
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Check if the component is a Roundabout
|
|
16
|
-
*/
|
|
17
|
-
const isRoundaboutComponent = (component) => {
|
|
18
|
-
return component.componentType === 'Roundabout';
|
|
19
|
-
};
|
|
20
|
-
const isQuestionComponent = (component) => {
|
|
21
|
-
return 'Question' === component.componentType;
|
|
22
|
-
};
|
|
8
|
+
const component_1 = require("./component");
|
|
23
9
|
/**
|
|
24
10
|
* Check if components of the current page have errors, and return a map of
|
|
25
11
|
* errors (indexed by component ID).
|
|
@@ -35,13 +21,13 @@ function checkComponents(state, components, currentErrors) {
|
|
|
35
21
|
}
|
|
36
22
|
}
|
|
37
23
|
// For Loop and RosterForLoop, inspect iterations for row controls
|
|
38
|
-
if (isRoundaboutComponent(component))
|
|
24
|
+
if ((0, component_1.isRoundaboutComponent)(component))
|
|
39
25
|
errors = checkRoundabout(state, component, errors);
|
|
40
26
|
// For Loop and RosterForLoop, inspect children
|
|
41
|
-
if (isLoopComponent(component))
|
|
27
|
+
if ((0, component_1.isLoopComponent)(component))
|
|
42
28
|
errors = checkLoop(state, component, errors);
|
|
43
29
|
// For Question, loop over children
|
|
44
|
-
if (isQuestionComponent(component))
|
|
30
|
+
if ((0, component_1.isQuestionComponent)(component))
|
|
45
31
|
errors = checkComponents(state, component.components, errors);
|
|
46
32
|
}
|
|
47
33
|
return errors;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-controls.js","sourceRoot":"","sources":["../../src/use-lunatic/commons/compile-controls.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"compile-controls.js","sourceRoot":"","sources":["../../src/use-lunatic/commons/compile-controls.ts"],"names":[],"mappings":";;AA0PA,0CAgBC;AArQD,6FAAwF;AACxF,2FAAsF;AACtF,+EAA0E;AAC1E,2EAAqE;AACrE,2CAQqB;AAOrB;;;GAGG;AACH,SAAS,eAAe,CACvB,KAAuB,EACvB,UAA0D,EAC1D,aAA8C;IAE9C,IAAI,MAAM,GAAG,aAAa,IAAK,EAAqC,CAAC;IAErE,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACpC,0CAA0C;QAC1C,IAAI,UAAU,IAAI,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClE,MAAM,eAAe,GAAG,aAAa,CACpC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,EAClD,KAAK,CAAC,iBAAiB,EACvB,KAAK,CAAC,KAAK,CACX,CAAC;YACF,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAChC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC;YACxC,CAAC;QACF,CAAC;QAED,kEAAkE;QAClE,IAAI,IAAA,iCAAqB,EAAC,SAAS,CAAC;YACnC,MAAM,GAAG,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAEpD,+CAA+C;QAC/C,IAAI,IAAA,2BAAe,EAAC,SAAS,CAAC;YAC7B,MAAM,GAAG,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAE9C,mCAAmC;QACnC,IAAI,IAAA,+BAAmB,EAAC,SAAS,CAAC;YACjC,MAAM,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C,CAAC,SAAS,EAAE,EAAE;QACrB,IAAI,iBAAiB,IAAI,SAAS,EAAE,CAAC;YACpC,OAAO,SAAS,CAAC,eAAe,IAAI,IAAI,CAAC;QAC1C,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC,CAAC,CAAC;IACJ,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;IACzD,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1E,OAAO;QACN,aAAa;QACb,UAAU,EAAE,gBAAgB,CAAC,aAAa,CAAC;KAC3C,CAAC;AACH,CAAC"}
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { LunaticComponentDefinition } from '../type';
|
|
3
|
+
import { type DeepTranslateExpression } from './fill-components/fill-component-expressions';
|
|
4
|
+
export type ComponentDefinition = LunaticComponentDefinition;
|
|
5
|
+
export type InterpretedComponent = DeepTranslateExpression<LunaticComponentDefinition>;
|
|
6
|
+
export type InterpretedLoopComponent = DeepTranslateExpression<ComponentDefinition & {
|
|
7
|
+
componentType: 'Loop' | 'RosterForLoop';
|
|
8
|
+
}>;
|
|
9
|
+
export type InterpretedRoundaboutComponent = DeepTranslateExpression<ComponentDefinition & {
|
|
10
|
+
componentType: 'Roundabout';
|
|
11
|
+
}>;
|
|
12
|
+
export type InterpretedQuestionComponent = DeepTranslateExpression<ComponentDefinition & {
|
|
13
|
+
componentType: 'Question';
|
|
14
|
+
}>;
|
|
15
|
+
export type InterpretedPairwiseLinksComponent = DeepTranslateExpression<ComponentDefinition & {
|
|
16
|
+
componentType: 'PairwiseLinks';
|
|
17
|
+
}>;
|
|
18
|
+
/** Whether the component has a response attribute. */
|
|
3
19
|
export declare function hasResponse(component: unknown): component is {
|
|
4
20
|
response: {
|
|
5
21
|
name: string;
|
|
6
22
|
};
|
|
7
23
|
};
|
|
24
|
+
/** Whether the component has a responses attribute. */
|
|
8
25
|
export declare function hasResponses(component: unknown): component is {
|
|
9
26
|
responses?: Array<{
|
|
10
27
|
label: ReactNode;
|
|
@@ -14,9 +31,25 @@ export declare function hasResponses(component: unknown): component is {
|
|
|
14
31
|
};
|
|
15
32
|
}>;
|
|
16
33
|
};
|
|
34
|
+
/** Whether the component has a body attribute. */
|
|
17
35
|
export declare function hasBody(component: unknown): component is {
|
|
18
36
|
body: LunaticComponentDefinition<'Table'>['body'];
|
|
19
37
|
};
|
|
38
|
+
/** Whether the component has a componentType attribute. */
|
|
20
39
|
export declare function hasComponentType(component: unknown): component is {
|
|
21
40
|
componentType: string;
|
|
22
41
|
};
|
|
42
|
+
/** Whether the component is a Loop or a RosterForLoop. */
|
|
43
|
+
export declare function isLoopComponent(component: ComponentDefinition | InterpretedComponent): component is InterpretedLoopComponent;
|
|
44
|
+
/** Whether the component is a Roundabout. */
|
|
45
|
+
export declare function isRoundaboutComponent(component: ComponentDefinition | InterpretedComponent): component is InterpretedRoundaboutComponent;
|
|
46
|
+
/** Whether the component is a Question. */
|
|
47
|
+
export declare function isQuestionComponent(component: ComponentDefinition | InterpretedComponent): component is InterpretedQuestionComponent;
|
|
48
|
+
/** Whether the component is a PairwiseLinks. */
|
|
49
|
+
export declare function isPairwiseLinksComponent(component: ComponentDefinition | InterpretedComponent): component is InterpretedPairwiseLinksComponent;
|
|
50
|
+
/**
|
|
51
|
+
* Get the pairwise component if it exists.
|
|
52
|
+
*
|
|
53
|
+
* There should only be one so we return the first one we find.
|
|
54
|
+
*/
|
|
55
|
+
export declare function getPairwiseComponent(components: ComponentDefinition[]): InterpretedPairwiseLinksComponent | undefined;
|
|
@@ -4,25 +4,67 @@ exports.hasResponse = hasResponse;
|
|
|
4
4
|
exports.hasResponses = hasResponses;
|
|
5
5
|
exports.hasBody = hasBody;
|
|
6
6
|
exports.hasComponentType = hasComponentType;
|
|
7
|
+
exports.isLoopComponent = isLoopComponent;
|
|
8
|
+
exports.isRoundaboutComponent = isRoundaboutComponent;
|
|
9
|
+
exports.isQuestionComponent = isQuestionComponent;
|
|
10
|
+
exports.isPairwiseLinksComponent = isPairwiseLinksComponent;
|
|
11
|
+
exports.getPairwiseComponent = getPairwiseComponent;
|
|
12
|
+
/** Whether the component has a response attribute. */
|
|
7
13
|
function hasResponse(component) {
|
|
8
14
|
return (!!component &&
|
|
9
15
|
typeof component === 'object' &&
|
|
10
16
|
'response' in component &&
|
|
11
17
|
'name' in component.response);
|
|
12
18
|
}
|
|
19
|
+
/** Whether the component has a responses attribute. */
|
|
13
20
|
function hasResponses(component) {
|
|
14
21
|
return (!!component && typeof component === 'object' && 'responses' in component);
|
|
15
22
|
}
|
|
23
|
+
/** Whether the component has a body attribute. */
|
|
16
24
|
function hasBody(component) {
|
|
17
25
|
return (!!component &&
|
|
18
26
|
typeof component === 'object' &&
|
|
19
27
|
'body' in component &&
|
|
20
28
|
Array.isArray(component.body));
|
|
21
29
|
}
|
|
30
|
+
/** Whether the component has a componentType attribute. */
|
|
22
31
|
function hasComponentType(component) {
|
|
23
32
|
return (!!component &&
|
|
24
33
|
typeof component === 'object' &&
|
|
25
34
|
'componentType' in component &&
|
|
26
35
|
typeof component.componentType === 'string');
|
|
27
36
|
}
|
|
37
|
+
/** Whether the component is a Loop or a RosterForLoop. */
|
|
38
|
+
function isLoopComponent(component) {
|
|
39
|
+
return ['Loop', 'RosterForLoop'].includes(component.componentType);
|
|
40
|
+
}
|
|
41
|
+
/** Whether the component is a Roundabout. */
|
|
42
|
+
function isRoundaboutComponent(component) {
|
|
43
|
+
return component.componentType === 'Roundabout';
|
|
44
|
+
}
|
|
45
|
+
/** Whether the component is a Question. */
|
|
46
|
+
function isQuestionComponent(component) {
|
|
47
|
+
return component.componentType === 'Question';
|
|
48
|
+
}
|
|
49
|
+
/** Whether the component is a PairwiseLinks. */
|
|
50
|
+
function isPairwiseLinksComponent(component) {
|
|
51
|
+
return component.componentType === 'PairwiseLinks';
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get the pairwise component if it exists.
|
|
55
|
+
*
|
|
56
|
+
* There should only be one so we return the first one we find.
|
|
57
|
+
*/
|
|
58
|
+
function getPairwiseComponent(components) {
|
|
59
|
+
for (const component of components) {
|
|
60
|
+
if (isPairwiseLinksComponent(component))
|
|
61
|
+
return component;
|
|
62
|
+
if (isQuestionComponent(component)) {
|
|
63
|
+
const childComponent = getPairwiseComponent(component.components);
|
|
64
|
+
if (childComponent)
|
|
65
|
+
return childComponent;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
28
70
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/use-lunatic/commons/component.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/use-lunatic/commons/component.ts"],"names":[],"mappings":";;AAgCA,kCASC;AAGD,oCAUC;AAGD,0BASC;AAGD,4CASC;AAGD,0CAIC;AAGD,sDAIC;AAGD,kDAIC;AAGD,4DAIC;AAOD,oDAYC;AA9FD,sDAAsD;AACtD,SAAgB,WAAW,CAC1B,SAAkB;IAElB,OAAO,CACN,CAAC,CAAC,SAAS;QACX,OAAO,SAAS,KAAK,QAAQ;QAC7B,UAAU,IAAI,SAAS;QACvB,MAAM,IAAK,SAAS,CAAC,QAAmB,CACxC,CAAC;AACH,CAAC;AAED,uDAAuD;AACvD,SAAgB,YAAY,CAAC,SAAkB;IAO9C,OAAO,CACN,CAAC,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,WAAW,IAAI,SAAS,CACxE,CAAC;AACH,CAAC;AAED,kDAAkD;AAClD,SAAgB,OAAO,CAAC,SAAkB;IAGzC,OAAO,CACN,CAAC,CAAC,SAAS;QACX,OAAO,SAAS,KAA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actNode } from 'react';
|
|
2
2
|
import type { LunaticComponentDefinition, LunaticExpression, LunaticReducerState } from '../../type';
|
|
3
|
-
type UntranslatedProperties = 'expressions' | 'sections' | 'body' | 'item' | 'controls' | 'conditionFilter' | 'conditionReadOnly' | 'components';
|
|
3
|
+
type UntranslatedProperties = 'expressions' | 'sections' | 'body' | 'item' | 'controls' | 'conditionFilter' | 'conditionReadOnly' | 'components' | 'optionFilter';
|
|
4
4
|
export type DeepTranslateExpression<T> = T extends LunaticExpression ? ReactNode : T extends (infer ElementType)[] ? DeepTranslateExpression<ElementType>[] : T extends {
|
|
5
5
|
[k: string | number]: unknown;
|
|
6
6
|
} ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill-component-expressions.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/fill-components/fill-component-expressions.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"fill-component-expressions.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/fill-components/fill-component-expressions.ts"],"names":[],"mappings":";;AAgIA,4DAyCC;AAnKD,kDAAiD;AAEjD,MAAM,cAAc,GAAG;IACtB,CAAC,OAAO,EAAE,IAAI,CAAC;IACf,CAAC,MAAM,EAAE,IAAI,CAAC;IACd,CAAC,eAAe,EAAE,IAAI,CAAC;IACvB,CAAC,oBAAoB,EAAE,IAAI,CAAC;IAC5B,CAAC,aAAa,EAAE,IAAI,CAAC;IACrB,CAAC,YAAY,EAAE,UAAU,CAAC;IAC1B,CAAC,iBAAiB,EAAE,IAAI,CAAC;IACzB,CAAC,uBAAuB,EAAE,IAAI,CAAC;IAC/B,CAAC,wBAAwB,EAAE,IAAI,CAAC;IAChC,CAAC,qBAAqB,EAAE,IAAI,CAAC;IAC7B,CAAC,sBAAsB,EAAE,IAAI,CAAC;IAC9B,CAAC,qBAAqB,EAAE,UAAU,CAAC;IACnC,CAAC,aAAa,EAAE,IAAI,CAAC;IACrB,CAAC,YAAY,EAAE,IAAI,CAAC;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IAC5E,CAAC;IAED,+CAA+C;IAC/C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IACD,MAAM,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACjC,IAAI,CAAC,IAAA,iBAAQ,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,GAAG,CAAC,EAAE,CAAC;QAC1C,OAAO,GAAG,CAAC;IACZ,CAAC;IACD,OAAO;QACN,GAAG,GAAG;QACN,CAAC,QAAQ,CAAC,EAAE,uBAAuB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC;KACrE,CAAC;AACH,CAAC"}
|
|
@@ -47,7 +47,15 @@ parentReadOnly) => {
|
|
|
47
47
|
missingResponse: (0, propMissingResponse_1.getMissingResponseProp)(component, state),
|
|
48
48
|
management: state.management,
|
|
49
49
|
iterations: (0, propIterations_1.getIterationsProp)(component, state),
|
|
50
|
-
options: (0, propOptions_1.
|
|
50
|
+
options: (0, propOptions_1.computeOptionsFromComponent)(interpretedProps, {
|
|
51
|
+
variables: state.variables,
|
|
52
|
+
handleChanges: state.handleChanges,
|
|
53
|
+
pagerIteration: state.pager.iteration,
|
|
54
|
+
value,
|
|
55
|
+
logger: state.logger,
|
|
56
|
+
disableFilters: state.disableFilters,
|
|
57
|
+
shouldParentBeFiltered: shouldBeFiltered,
|
|
58
|
+
}),
|
|
51
59
|
...(0, getComponentTypeProps_1.getComponentTypeProps)(interpretedProps, state),
|
|
52
60
|
// This is too dynamic to be typed correctly, so we allow any here
|
|
53
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill-components.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/fill-components/fill-components.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fill-components.js","sourceRoot":"","sources":["../../../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1B,OAAO,gBAAgB,CAAC;IACzB,CAAC;IAED,sEAAsE;IACtE,IAAI,UAAU,KAAK,eAAe,EAAE,CAAC;QACpC,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,eAAe,EAAE,EAAE,CAC/C,CAAC,eAAe,CAAC,eAAe,IAAI,IAAI,CAAC;YACxC,CAAC,CAAC,eAAe;YACjB,CAAC,CAAC,mDAAmD;gBACnD;oBACA,GAAG,eAAe;oBAClB,KAAK,EAAE,EAAE;oBACT,aAAa,EAAE,MAAM;iBACK,CAC7B,CAAC;IACH,CAAC;IAED,+EAA+E;IAC/E,OAAO,gBAAgB,CAAC,MAAM,CAC7B,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,eAAe,IAAI,IAAI,CAChD,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleaning-behaviour.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/variables/behaviours/cleaning-behaviour.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"cleaning-behaviour.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/variables/behaviours/cleaning-behaviour.ts"],"names":[],"mappings":";;AAeA,8CAwEC;AArFD,mDAA4D;AAC5D,iDAAkD;AAGlD;;;;;;;;GAQG;AACH,SAAgB,iBAAiB,CAChC,KAA4B,EAC5B,QAAmC,EACnC,eAAwC,EAAE;IAE1C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO;IACR,CAAC;IAED,wDAAwD;IACxD,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC/B,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACvC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBAC7C,KAAK,MAAM,YAAY,IAAI,QAAQ,CAAC,MAAM,CAAC,CA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,CAAC,YAAY,CAAC,CAAC;IAE9C,8CAA8C;IAC9C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC;IACd,CAAC;IACD,MAAM,aAAa,GAAG,IAAA,aAAK,EAAC,aAAa,CAAC,CAAC;IAC3C,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACd,CAAC;IAED,0DAA0D;IAC1D,KAAK,CAAC,GAAG,CACR,YAAY,EACZ,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QAC9B,kFAAkF;QAClF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,KAAK,CAAC;QACd,CAAC;QACD,yDAAyD;QACzD,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;QACD,uEAAuE;QACvE,OAAO,IAAA,kBAAU,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC,CAAC,CACF,CAAC;IACF,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IterationLevel } from './models';
|
|
2
|
+
/** Special variable that will take the current iteration value. */
|
|
3
|
+
export declare const GLOBAL_ITERATION_INDEX = "GLOBAL_ITERATION_INDEX";
|
|
4
|
+
/** Manually compute the global iteration index from current iteration level. */
|
|
5
|
+
export declare function computeGlobalIterationIndexValue(iteration: IterationLevel): (string | number)[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GLOBAL_ITERATION_INDEX = void 0;
|
|
4
|
+
exports.computeGlobalIterationIndexValue = computeGlobalIterationIndexValue;
|
|
5
|
+
/** Special variable that will take the current iteration value. */
|
|
6
|
+
exports.GLOBAL_ITERATION_INDEX = 'GLOBAL_ITERATION_INDEX';
|
|
7
|
+
/** Manually compute the global iteration index from current iteration level. */
|
|
8
|
+
function computeGlobalIterationIndexValue(iteration) {
|
|
9
|
+
return [exports.GLOBAL_ITERATION_INDEX, iteration[0] + 1];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=global-variables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-variables.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/variables/global-variables.ts"],"names":[],"mappings":";;;AAMA,4EAEC;AAND,mEAAmE;AACtD,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D,gFAAgF;AAChF,SAAgB,gCAAgC,CAAC,SAAyB;IACzE,OAAO,CAAC,8BAAsB,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LunaticData, LunaticOptions, LunaticSource } from '../../type';
|
|
2
2
|
import type { RefObject } from 'react';
|
|
3
|
-
|
|
3
|
+
import { IterationLevel } from './models';
|
|
4
4
|
export type EventArgs = {
|
|
5
5
|
change: {
|
|
6
6
|
/** Name of the changed variable. */
|
|
@@ -35,7 +35,11 @@ export declare class LunaticVariablesStore {
|
|
|
35
35
|
autoCommit: boolean;
|
|
36
36
|
updatedAt: Timekey;
|
|
37
37
|
constructor();
|
|
38
|
-
static makeFromSource(source: LunaticSource, data: LunaticData,
|
|
38
|
+
static makeFromSource(source: LunaticSource, data: LunaticData, options?: {
|
|
39
|
+
changeHandler?: RefObject<LunaticOptions['onVariableChange']>;
|
|
40
|
+
disableCleaning?: boolean;
|
|
41
|
+
autoCommit?: boolean;
|
|
42
|
+
}): LunaticVariablesStore;
|
|
39
43
|
/**
|
|
40
44
|
* Create a new store from an object (useful for testing)
|
|
41
45
|
*/
|
|
@@ -65,6 +69,14 @@ export declare class LunaticVariablesStore {
|
|
|
65
69
|
shapeFrom?: string | string[];
|
|
66
70
|
dimension?: number;
|
|
67
71
|
}): LunaticVariable;
|
|
72
|
+
/**
|
|
73
|
+
* Register global variable
|
|
74
|
+
*/
|
|
75
|
+
setGlobal(name: string, { dependencies, globalDependencies, shapeFrom, }: {
|
|
76
|
+
dependencies?: string[];
|
|
77
|
+
globalDependencies?: Map<unknown, string>;
|
|
78
|
+
shapeFrom?: string | string[];
|
|
79
|
+
}): LunaticVariable;
|
|
68
80
|
/**
|
|
69
81
|
* Run a VTL expression
|
|
70
82
|
*/
|
|
@@ -84,7 +96,7 @@ export declare class LunaticVariablesStore {
|
|
|
84
96
|
get interpretCount(): number;
|
|
85
97
|
debug(): void;
|
|
86
98
|
}
|
|
87
|
-
declare class LunaticVariable {
|
|
99
|
+
export declare class LunaticVariable {
|
|
88
100
|
/** Last time the value was updated (changed). */
|
|
89
101
|
updatedAt: Map<string | undefined, number>;
|
|
90
102
|
/** Last time the store was updated (changed). */
|
|
@@ -95,8 +107,6 @@ declare class LunaticVariable {
|
|
|
95
107
|
private value;
|
|
96
108
|
/** List of direct dependencies, ex: ['FULLNAME', 'FIRSTNAME', 'LASTNAME']. */
|
|
97
109
|
private dependencies?;
|
|
98
|
-
/** List of deep dependencies, exploring the variables used in calculated variables, ex: ['FIRSTNAME', 'LASTNAME']. */
|
|
99
|
-
private baseDependencies?;
|
|
100
110
|
/** Expression for calculated variable. */
|
|
101
111
|
readonly expression?: string;
|
|
102
112
|
/** Dictionary holding all the available variables. */
|
|
@@ -105,6 +115,10 @@ declare class LunaticVariable {
|
|
|
105
115
|
private readonly iterationDepth?;
|
|
106
116
|
/** For calculated variable, shape is copied from another variable. */
|
|
107
117
|
private readonly shapeFrom?;
|
|
118
|
+
/** Whether this is a global variable with custom computation rules. */
|
|
119
|
+
private readonly isGlobal?;
|
|
120
|
+
/** Name of variables needed for global variables computation rules. */
|
|
121
|
+
private readonly globalDependencies?;
|
|
108
122
|
/** Keep a record of variable name (optional, used for debug). */
|
|
109
123
|
readonly name?: string;
|
|
110
124
|
/** Count the number of calculation. */
|
|
@@ -120,6 +134,8 @@ declare class LunaticVariable {
|
|
|
120
134
|
name?: string;
|
|
121
135
|
dimension?: number;
|
|
122
136
|
storeUpdatedAt: Timekey;
|
|
137
|
+
isGlobal?: boolean;
|
|
138
|
+
globalDependencies?: Map<unknown, string>;
|
|
123
139
|
});
|
|
124
140
|
getValue(iteration?: IterationLevel): unknown;
|
|
125
141
|
/**
|
|
@@ -132,10 +148,6 @@ declare class LunaticVariable {
|
|
|
132
148
|
private updateTimestamps;
|
|
133
149
|
private setValueForArray;
|
|
134
150
|
private getSavedValue;
|
|
135
|
-
/**
|
|
136
|
-
* Get a list of transitive dependencies (leaf of the dependency tree)
|
|
137
|
-
*/
|
|
138
|
-
private getBaseDependencies;
|
|
139
151
|
private getDependencies;
|
|
140
152
|
private getDependenciesValues;
|
|
141
153
|
/**
|