@inseefr/lunatic 3.0.0-rc.26 → 3.0.0-rc.28
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/lib/components/LunaticComponents.d.ts +7 -11
- package/lib/components/LunaticComponents.js +4 -1
- package/lib/components/LunaticComponents.js.map +1 -1
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/library.d.ts +1 -1
- package/lib/components/shared/HOC/slottableComponent.d.ts +2 -2
- package/lib/components/shared/MDLabel/MDLabel.js +4 -1
- package/lib/components/shared/MDLabel/MDLabel.js.map +1 -1
- package/lib/components/shared/MDLabel/MDLabel.spec.js +4 -1
- package/lib/components/shared/MDLabel/MDLabel.spec.js.map +1 -1
- package/lib/components/shared/Table/Tbody.spec.js +0 -1
- package/lib/components/shared/Table/Tbody.spec.js.map +1 -1
- package/lib/components/shared/Table/Td.spec.js +0 -1
- package/lib/components/shared/Table/Td.spec.js.map +1 -1
- package/lib/components/type.d.ts +12 -12
- package/lib/hooks/useKeyboardKey.js +1 -0
- package/lib/hooks/useKeyboardKey.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/use-lunatic/actions.d.ts +4 -53
- package/lib/use-lunatic/actions.js +0 -7
- package/lib/use-lunatic/actions.js.map +1 -1
- package/lib/use-lunatic/commons/check-loops.d.ts +2 -2
- package/lib/use-lunatic/commons/check-loops.js.map +1 -1
- package/lib/use-lunatic/commons/check-pager.d.ts +2 -2
- package/lib/use-lunatic/commons/check-pager.js.map +1 -1
- package/lib/use-lunatic/commons/compile-controls.d.ts +2 -2
- package/lib/use-lunatic/commons/compile-controls.js +5 -3
- package/lib/use-lunatic/commons/compile-controls.js.map +1 -1
- package/lib/use-lunatic/commons/create-map-pages.d.ts +2 -2
- package/lib/use-lunatic/commons/create-map-pages.js.map +1 -1
- package/lib/use-lunatic/commons/execute-condition-filter.d.ts +2 -2
- package/lib/use-lunatic/commons/execute-condition-filter.js +3 -4
- package/lib/use-lunatic/commons/execute-condition-filter.js.map +1 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +614 -6
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +6 -13
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.spec.js +1 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.spec.js.map +1 -1
- package/lib/use-lunatic/commons/fill-components/fill-components.d.ts +19 -17
- package/lib/use-lunatic/commons/fill-components/fill-components.js +29 -29
- package/lib/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
- package/lib/use-lunatic/commons/get-components-from-state.d.ts +2 -3
- package/lib/use-lunatic/commons/get-components-from-state.js +1 -2
- package/lib/use-lunatic/commons/get-components-from-state.js.map +1 -1
- package/lib/use-lunatic/commons/index.d.ts +0 -3
- package/lib/use-lunatic/commons/index.js +0 -3
- package/lib/use-lunatic/commons/index.js.map +1 -1
- package/lib/use-lunatic/commons/is-First-last-page.d.ts +2 -2
- package/lib/use-lunatic/commons/is-First-last-page.js.map +1 -1
- package/lib/use-lunatic/commons/page-navigation.d.ts +3 -3
- package/lib/use-lunatic/commons/page-navigation.js.map +1 -1
- package/lib/use-lunatic/commons/page-navigation.spec.js.map +1 -1
- package/lib/use-lunatic/commons/page-tag.d.ts +4 -4
- package/lib/use-lunatic/commons/page-tag.js.map +1 -1
- package/lib/use-lunatic/commons/page.d.ts +3 -3
- package/lib/use-lunatic/commons/page.js +2 -1
- package/lib/use-lunatic/commons/page.js.map +1 -1
- package/lib/use-lunatic/hooks/use-loop-variables.d.ts +2 -2
- package/lib/use-lunatic/hooks/use-loop-variables.js.map +1 -1
- package/lib/use-lunatic/hooks/use-page-has-response.d.ts +2 -2
- package/lib/use-lunatic/hooks/use-page-has-response.js.map +1 -1
- package/lib/use-lunatic/hooks/useOverview.d.ts +2 -2
- package/lib/use-lunatic/hooks/useOverview.js.map +1 -1
- package/lib/use-lunatic/props/propComponentType.d.ts +9 -0
- package/lib/use-lunatic/{commons/fill-components/fill-specific-expression.js → props/propComponentType.js} +21 -27
- package/lib/use-lunatic/props/propComponentType.js.map +1 -0
- package/lib/use-lunatic/props/propIterations.d.ts +7 -0
- package/lib/use-lunatic/props/propIterations.js +26 -0
- package/lib/use-lunatic/props/propIterations.js.map +1 -0
- package/lib/use-lunatic/props/propMissingResponse.d.ts +9 -0
- package/lib/use-lunatic/props/propMissingResponse.js +13 -0
- package/lib/use-lunatic/props/propMissingResponse.js.map +1 -0
- package/lib/use-lunatic/props/propValue.d.ts +6 -0
- package/lib/use-lunatic/props/propValue.js +28 -0
- package/lib/use-lunatic/props/propValue.js.map +1 -0
- package/lib/use-lunatic/{commons/fill-components/fill-component-value.spec.js → props/propValue.spec.js} +6 -6
- package/lib/use-lunatic/props/propValue.spec.js.map +1 -0
- package/lib/use-lunatic/reducer/commons/auto-explore-loop.d.ts +2 -2
- package/lib/use-lunatic/reducer/commons/auto-explore-loop.js.map +1 -1
- package/lib/use-lunatic/reducer/commons/validate-condition-filter.d.ts +2 -2
- package/lib/use-lunatic/reducer/commons/validate-condition-filter.js.map +1 -1
- package/lib/use-lunatic/reducer/controls/check-base-control.d.ts +2 -2
- package/lib/use-lunatic/reducer/controls/check-base-control.js.map +1 -1
- package/lib/use-lunatic/reducer/controls/check-roundabout-control.d.ts +2 -2
- package/lib/use-lunatic/reducer/controls/check-roundabout-control.js.map +1 -1
- package/lib/use-lunatic/reducer/overview/overviewOnInit.d.ts +4 -105
- package/lib/use-lunatic/reducer/overview/overviewOnInit.js +1 -12
- package/lib/use-lunatic/reducer/overview/overviewOnInit.js.map +1 -1
- package/lib/use-lunatic/reducer/reduce-go-next-page.d.ts +2 -2
- package/lib/use-lunatic/reducer/reduce-go-next-page.js.map +1 -1
- package/lib/use-lunatic/reducer/reduce-go-previous-page.d.ts +2 -3
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js +1 -2
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js.map +1 -1
- package/lib/use-lunatic/reducer/reduce-go-to-page.d.ts +2 -3
- package/lib/use-lunatic/reducer/reduce-go-to-page.js +1 -2
- package/lib/use-lunatic/reducer/reduce-go-to-page.js.map +1 -1
- package/lib/use-lunatic/reducer/reduce-handle-change.d.ts +2 -2
- package/lib/use-lunatic/reducer/reduce-handle-change.js.map +1 -1
- package/lib/use-lunatic/reducer/reducer.d.ts +2 -3
- package/lib/use-lunatic/reducer/reducer.js +3 -10
- package/lib/use-lunatic/reducer/reducer.js.map +1 -1
- package/lib/use-lunatic/reducer/reducerInitializer.d.ts +10 -0
- package/lib/use-lunatic/reducer/{reduce-on-init.js → reducerInitializer.js} +70 -72
- package/lib/use-lunatic/reducer/reducerInitializer.js.map +1 -0
- package/lib/use-lunatic/type.d.ts +80 -49
- package/lib/use-lunatic/use-lunatic.d.ts +22 -65
- package/lib/use-lunatic/use-lunatic.js +69 -74
- package/lib/use-lunatic/use-lunatic.js.map +1 -1
- package/lib/utils/object.d.ts +1 -0
- package/lib/utils/object.js +6 -0
- package/lib/utils/object.js.map +1 -1
- package/package.json +2 -1
- package/lib/stories/behaviour/cleaning/source-loop.json +0 -130
- package/lib/stories/behaviour/resizing/source-resizing-cleaning.json +0 -171
- package/lib/stories/overview/dataLoop.json +0 -189
- package/lib/stories/overview/source.json +0 -28
- package/lib/stories/overview/sourceLoop.json +0 -1423
- package/lib/stories/questionnaires/logement/source.json +0 -31762
- package/lib/stories/questionnaires2023/simpsons/source.json +0 -4728
- package/lib/use-lunatic/commons/fill-components/fill-component-required.d.ts +0 -442
- package/lib/use-lunatic/commons/fill-components/fill-component-required.js +0 -13
- package/lib/use-lunatic/commons/fill-components/fill-component-required.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-value.d.ts +0 -5
- package/lib/use-lunatic/commons/fill-components/fill-component-value.js +0 -34
- package/lib/use-lunatic/commons/fill-components/fill-component-value.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-value.spec.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-from-state.d.ts +0 -770
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js +0 -18
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-iterations.d.ts +0 -124
- package/lib/use-lunatic/commons/fill-components/fill-iterations.js +0 -36
- package/lib/use-lunatic/commons/fill-components/fill-iterations.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-management.d.ts +0 -6
- package/lib/use-lunatic/commons/fill-components/fill-management.js +0 -9
- package/lib/use-lunatic/commons/fill-components/fill-management.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.d.ts +0 -12
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +0 -20
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-pagination.d.ts +0 -9
- package/lib/use-lunatic/commons/fill-components/fill-pagination.js +0 -10
- package/lib/use-lunatic/commons/fill-components/fill-pagination.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +0 -1268
- package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/index.d.ts +0 -1
- package/lib/use-lunatic/commons/fill-components/index.js +0 -2
- package/lib/use-lunatic/commons/fill-components/index.js.map +0 -1
- package/lib/use-lunatic/commons/use-components-from-state.d.ts +0 -4
- package/lib/use-lunatic/commons/use-components-from-state.js +0 -15
- package/lib/use-lunatic/commons/use-components-from-state.js.map +0 -1
- package/lib/use-lunatic/initial-state.d.ts +0 -3
- package/lib/use-lunatic/initial-state.js +0 -39
- package/lib/use-lunatic/initial-state.js.map +0 -1
- package/lib/use-lunatic/reducer/index.d.ts +0 -1
- package/lib/use-lunatic/reducer/index.js +0 -2
- package/lib/use-lunatic/reducer/index.js.map +0 -1
- package/lib/use-lunatic/reducer/reduce-on-init.d.ts +0 -4
- package/lib/use-lunatic/reducer/reduce-on-init.js.map +0 -1
- package/lib/use-lunatic/reducer/reduce-on-set-waiting.d.ts +0 -4
- package/lib/use-lunatic/reducer/reduce-on-set-waiting.js +0 -8
- package/lib/use-lunatic/reducer/reduce-on-set-waiting.js.map +0 -1
- package/lib/use-lunatic/use-lunatic.test.d.ts +0 -1
- package/lib/use-lunatic/use-lunatic.test.js +0 -280
- package/lib/use-lunatic/use-lunatic.test.js.map +0 -1
- /package/lib/use-lunatic/{commons/fill-components/fill-component-value.spec.d.ts → props/propValue.spec.d.ts} +0 -0
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Add state data as component props
|
|
3
|
-
*/
|
|
4
|
-
function fillFromState(component, state) {
|
|
5
|
-
const { handleChange, executeExpression, preferences, goToPage, shortcut, goNextPage, goPreviousPage, } = state;
|
|
6
|
-
return {
|
|
7
|
-
...component,
|
|
8
|
-
handleChange,
|
|
9
|
-
executeExpression,
|
|
10
|
-
preferences,
|
|
11
|
-
goToPage,
|
|
12
|
-
shortcut,
|
|
13
|
-
goNextPage,
|
|
14
|
-
goPreviousPage,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export default fillFromState;
|
|
18
|
-
//# sourceMappingURL=fill-from-state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fill-from-state.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/fill-components/fill-from-state.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,SAAS,aAAa,CACrB,SAAqC,EACrC,KAAmB;IAEnB,MAAM,EACL,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,cAAc,GACd,GAAG,KAAK,CAAC;IACV,OAAO;QACN,GAAG,SAAS;QACZ,YAAY;QACZ,iBAAiB;QACjB,WAAW;QACX,QAAQ;QACR,QAAQ;QACR,UAAU;QACV,cAAc;KACd,CAAC;AACH,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import type { LunaticComponentDefinition, LunaticState } from '../../type';
|
|
2
|
-
/**
|
|
3
|
-
* Fill the number of iterations for loop components without "iterations" expression
|
|
4
|
-
*/
|
|
5
|
-
export declare function fillIterations(component: LunaticComponentDefinition, state: LunaticState): (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentSequenceType & {
|
|
6
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
7
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentSubSequenceType & {
|
|
8
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
9
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentTableType & {
|
|
10
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
11
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentNumberType & {
|
|
12
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
13
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentDatePickerType & {
|
|
14
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
15
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentDurationType & {
|
|
16
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
17
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentCheckboxGroupType & {
|
|
18
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
19
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentCheckboxBooleanType & {
|
|
20
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
21
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentRadioType & {
|
|
22
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
23
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentFilterDescriptionType & {
|
|
24
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
25
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentDropdownType & {
|
|
26
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
27
|
-
}) | (Omit<import("../../type-source").ComponentTypeBase, "label"> & import("../../type-source").ComponentPairWiseLinksType & {
|
|
28
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
29
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentRoundaboutType & {
|
|
30
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
31
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentSuggesterType & {
|
|
32
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
33
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentInputOrTextareaType & {
|
|
34
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
35
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentCheckboxOneType & {
|
|
36
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
37
|
-
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentQuestionType & {
|
|
38
|
-
componentType: "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "Duration" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question";
|
|
39
|
-
}) | {
|
|
40
|
-
iterations: number;
|
|
41
|
-
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
42
|
-
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
43
|
-
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
44
|
-
conditionFilter?: import("../../type-source").ConditionFilterType | undefined;
|
|
45
|
-
controls?: import("../../type-source").ControlType[] | undefined;
|
|
46
|
-
id: string;
|
|
47
|
-
bindingDependencies?: string[] | undefined;
|
|
48
|
-
hierarchy?: import("../../type-source").Hierarchy | undefined;
|
|
49
|
-
mandatory?: boolean | undefined;
|
|
50
|
-
page: string;
|
|
51
|
-
componentType: "Loop";
|
|
52
|
-
loopDependencies: string[];
|
|
53
|
-
components: import("../../type-source").ComponentType[];
|
|
54
|
-
depth: number;
|
|
55
|
-
paginatedLoop: true;
|
|
56
|
-
maxPage: string;
|
|
57
|
-
} | {
|
|
58
|
-
iterations: number;
|
|
59
|
-
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
60
|
-
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
61
|
-
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
62
|
-
conditionFilter?: import("../../type-source").ConditionFilterType | undefined;
|
|
63
|
-
controls?: import("../../type-source").ControlType[] | undefined;
|
|
64
|
-
id: string;
|
|
65
|
-
bindingDependencies?: string[] | undefined;
|
|
66
|
-
hierarchy?: import("../../type-source").Hierarchy | undefined;
|
|
67
|
-
mandatory?: boolean | undefined;
|
|
68
|
-
page: string;
|
|
69
|
-
componentType: "Roundabout";
|
|
70
|
-
components: import("../../type-source").ComponentType[];
|
|
71
|
-
locked: boolean;
|
|
72
|
-
expressions: Record<string, import("../../type-source").LabelType<"VTL" | "VTL|MD">>;
|
|
73
|
-
} | {
|
|
74
|
-
iterations: number;
|
|
75
|
-
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
76
|
-
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
77
|
-
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
78
|
-
conditionFilter?: import("../../type-source").ConditionFilterType | undefined;
|
|
79
|
-
controls?: import("../../type-source").ControlType[] | undefined;
|
|
80
|
-
id: string;
|
|
81
|
-
bindingDependencies?: string[] | undefined;
|
|
82
|
-
hierarchy?: import("../../type-source").Hierarchy | undefined;
|
|
83
|
-
mandatory?: boolean | undefined;
|
|
84
|
-
page: string;
|
|
85
|
-
componentType: "RosterForLoop";
|
|
86
|
-
components: import("../../type-source").ComponentType[];
|
|
87
|
-
lines: {
|
|
88
|
-
min: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
89
|
-
max: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
90
|
-
};
|
|
91
|
-
header?: {
|
|
92
|
-
value: string;
|
|
93
|
-
label: string | import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
94
|
-
options: {
|
|
95
|
-
value: string;
|
|
96
|
-
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
97
|
-
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
98
|
-
}[];
|
|
99
|
-
colspan?: number | undefined;
|
|
100
|
-
rowspan?: number | undefined;
|
|
101
|
-
}[] | undefined;
|
|
102
|
-
positioning: "HORIZONTAL";
|
|
103
|
-
} | {
|
|
104
|
-
iterations: number;
|
|
105
|
-
label: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
106
|
-
description?: import("../../type-source").LabelType<"VTL" | "VTL|MD"> | undefined;
|
|
107
|
-
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
108
|
-
conditionFilter?: import("../../type-source").ConditionFilterType | undefined;
|
|
109
|
-
controls?: import("../../type-source").ControlType[] | undefined;
|
|
110
|
-
id: string;
|
|
111
|
-
bindingDependencies?: string[] | undefined;
|
|
112
|
-
hierarchy?: import("../../type-source").Hierarchy | undefined;
|
|
113
|
-
mandatory?: boolean | undefined;
|
|
114
|
-
page: string;
|
|
115
|
-
componentType: "Loop";
|
|
116
|
-
loopDependencies: string[];
|
|
117
|
-
components: import("../../type-source").ComponentType[];
|
|
118
|
-
depth: number;
|
|
119
|
-
paginatedLoop: false;
|
|
120
|
-
lines: {
|
|
121
|
-
min: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
122
|
-
max: import("../../type-source").LabelType<"VTL" | "VTL|MD">;
|
|
123
|
-
};
|
|
124
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { hasResponse } from '../component';
|
|
2
|
-
import { forceInt, isNumber } from '../../../utils/number';
|
|
3
|
-
/**
|
|
4
|
-
* Fill the number of iterations for loop components without "iterations" expression
|
|
5
|
-
*/
|
|
6
|
-
export function fillIterations(component, state) {
|
|
7
|
-
if ('iterations' in component && component.iterations) {
|
|
8
|
-
return {
|
|
9
|
-
...component,
|
|
10
|
-
iterations: forceInt(state.executeExpression(component.iterations, {
|
|
11
|
-
iteration: state.pager.iteration,
|
|
12
|
-
})),
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
if (component.componentType !== 'RosterForLoop' &&
|
|
16
|
-
component.componentType !== 'Loop') {
|
|
17
|
-
return component;
|
|
18
|
-
}
|
|
19
|
-
// Iterations expression is not present on the component definition
|
|
20
|
-
// infer it from the value of child components
|
|
21
|
-
const iterations = component.components.reduce((acc, component) => {
|
|
22
|
-
if (!hasResponse(component)) {
|
|
23
|
-
return acc;
|
|
24
|
-
}
|
|
25
|
-
const value = state.variables.get(component.response.name, isNumber(state.pager.iteration) ? [state.pager.iteration] : undefined);
|
|
26
|
-
if (Array.isArray(value) && value.length > acc) {
|
|
27
|
-
return value.length;
|
|
28
|
-
}
|
|
29
|
-
return acc;
|
|
30
|
-
}, 0);
|
|
31
|
-
return {
|
|
32
|
-
...component,
|
|
33
|
-
iterations,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=fill-iterations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fill-iterations.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/fill-components/fill-iterations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;GAEG;AACH,MAAM,UAAU,cAAc,CAC7B,SAAqC,EACrC,KAAmB;IAEnB,IAAI,YAAY,IAAI,SAAS,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC;QACvD,OAAO;YACN,GAAG,SAAS;YACZ,UAAU,EAAE,QAAQ,CACnB,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,UAAU,EAAE;gBAC7C,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS;aAChC,CAAC,CACF;SACD,CAAC;IACH,CAAC;IAED,IACC,SAAS,CAAC,aAAa,KAAK,eAAe;QAC3C,SAAS,CAAC,aAAa,KAAK,MAAM,EACjC,CAAC;QACF,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,mEAAmE;IACnE,8CAA8C;IAC9C,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE;QACjE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,OAAO,GAAG,CAAC;QACZ,CAAC;QACD,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAChC,SAAS,CAAC,QAAQ,CAAC,IAAI,EACvB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CACrE,CAAC;QACF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC,MAAM,CAAC;QACrB,CAAC;QACD,OAAO,GAAG,CAAC;IACZ,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,OAAO;QACN,GAAG,SAAS;QACZ,UAAU;KACV,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { LunaticComponentDefinition, LunaticState } from '../../type';
|
|
2
|
-
export type FilledProps = {
|
|
3
|
-
management?: boolean;
|
|
4
|
-
};
|
|
5
|
-
declare function fillManagement(component: LunaticComponentDefinition, state: LunaticState): LunaticComponentDefinition & FilledProps;
|
|
6
|
-
export default fillManagement;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fill-management.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/fill-components/fill-management.ts"],"names":[],"mappings":"AAIA,SAAS,cAAc,CACtB,SAAqC,EACrC,KAAmB;IAEnB,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC7B,IAAI,UAAU,EAAE,CAAC;QAChB,OAAO,EAAE,GAAG,SAAS,EAAE,UAAU,EAAE,CAAC;IACrC,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { LunaticComponentDefinition, LunaticState } from '../../type';
|
|
2
|
-
export type FilledProps = {
|
|
3
|
-
missingResponse?: {
|
|
4
|
-
name: string;
|
|
5
|
-
value?: unknown;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Inject the value for the missingResponse variable
|
|
10
|
-
*/
|
|
11
|
-
declare function fillMissingResponse(component: LunaticComponentDefinition, state: LunaticState): LunaticComponentDefinition & FilledProps;
|
|
12
|
-
export default fillMissingResponse;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { isNumber } from '../../../utils/number';
|
|
2
|
-
/**
|
|
3
|
-
* Inject the value for the missingResponse variable
|
|
4
|
-
*/
|
|
5
|
-
function fillMissingResponse(component, state) {
|
|
6
|
-
// Component does not have a missing response
|
|
7
|
-
if (!('missingResponse' in component) || !component.missingResponse) {
|
|
8
|
-
return component;
|
|
9
|
-
}
|
|
10
|
-
const missingResponse = component.missingResponse;
|
|
11
|
-
return {
|
|
12
|
-
...component,
|
|
13
|
-
missingResponse: {
|
|
14
|
-
...missingResponse,
|
|
15
|
-
value: state.variables.get(missingResponse.name, isNumber(state.pager.iteration) ? [state.pager.iteration] : undefined),
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export default fillMissingResponse;
|
|
20
|
-
//# sourceMappingURL=fill-missing-response.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fill-missing-response.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/fill-components/fill-missing-response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AASjD;;GAEG;AACH,SAAS,mBAAmB,CAC3B,SAAqC,EACrC,KAAmB;IAEnB,6CAA6C;IAC7C,IAAI,CAAC,CAAC,iBAAiB,IAAI,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC;QACrE,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;IAClD,OAAO;QACN,GAAG,SAAS;QACZ,eAAe,EAAE;YAChB,GAAG,eAAe;YAClB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CACzB,eAAe,CAAC,IAAI,EACpB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CACrE;SACD;KACD,CAAC;AACH,CAAC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { LunaticComponentDefinition, LunaticState } from '../../type';
|
|
2
|
-
export type FilledProps = {
|
|
3
|
-
iteration?: number;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Inject the iteration index in the component props
|
|
7
|
-
*/
|
|
8
|
-
declare function fillPagination<T extends LunaticComponentDefinition>(component: T, state: LunaticState): LunaticComponentDefinition & FilledProps;
|
|
9
|
-
export default fillPagination;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inject the iteration index in the component props
|
|
3
|
-
*/
|
|
4
|
-
function fillPagination(component, state) {
|
|
5
|
-
const { pager } = state;
|
|
6
|
-
const { iteration } = pager;
|
|
7
|
-
return { ...component, iteration };
|
|
8
|
-
}
|
|
9
|
-
export default fillPagination;
|
|
10
|
-
//# sourceMappingURL=fill-pagination.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fill-pagination.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/fill-components/fill-pagination.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,SAAS,cAAc,CACtB,SAAY,EACZ,KAAmB;IAEnB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAE5B,OAAO,EAAE,GAAG,SAAS,EAAE,SAAS,EAAE,CAAC;AACpC,CAAC;AAED,eAAe,cAAc,CAAC"}
|