@inseefr/lunatic 2.6.3-rc.1 → 2.6.3
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/README.md +49 -3
- package/lib/components/checkbox/checkbox-boolean/html/checkbox-boolean.js +3 -3
- package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +7 -1
- package/lib/components/checkbox/checkbox-group/checkbox-group-content.js +0 -2
- package/lib/components/checkbox/checkbox-group/html/checkbox-group-content.js +4 -2
- package/lib/components/checkbox/checkbox-group/html/checkbox-group.js +3 -3
- package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +2 -1
- package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +2 -1
- package/lib/components/checkbox/commons/checkbox-option.js +3 -1
- package/lib/components/commons/components/combo-box/combo-box-container.js +1 -2
- package/lib/components/commons/components/combo-box/combo-box.js +2 -2
- package/lib/components/commons/components/combo-box/selection/LabelOrInput.js +3 -1
- package/lib/components/commons/components/combo-box/selection/input.js +3 -1
- package/lib/components/commons/components/combo-box/selection/selection.js +3 -1
- package/lib/components/commons/components/errors/errors.js +12 -10
- package/lib/components/commons/components/errors/errors.spec.js +6 -6
- package/lib/components/component-set/html/__snapshots__/component-set.spec.tsx.snap +2 -0
- package/lib/components/component-set/html/component-set.js +2 -2
- package/lib/components/datepicker/html/__snapshots__/datepicker.spec.tsx.snap +2 -0
- package/lib/components/datepicker/html/datepicker-input.js +4 -2
- package/lib/components/datepicker/html/datepicker.js +3 -3
- package/lib/components/datepicker/lunatic-datepicker.js +2 -1
- package/lib/components/dropdown/lunatic-dropdown.js +2 -1
- package/lib/components/index.js +4 -4
- package/lib/components/input/html/__snapshots__/input.spec.tsx.snap +2 -0
- package/lib/components/input/html/input.js +3 -3
- package/lib/components/input/lunatic-input.js +2 -1
- package/lib/components/input-number/html/__snapshots__/input-number.spec.tsx.snap +2 -2
- package/lib/components/input-number/html/input-number-thousand.js +4 -17
- package/lib/components/input-number/html/input-number.js +3 -5
- package/lib/components/input-number/lunatic-input-number.js +2 -3
- package/lib/components/loop/block-for-loop.js +10 -6
- package/lib/components/loop/roster-for-loop/roster-for-loop.js +35 -27
- package/lib/components/loop/utils/get-initial-nb-rows.js +17 -0
- package/lib/components/lunatic-components.js +7 -27
- package/lib/components/pairwise-links/index.js +13 -0
- package/lib/components/pairwise-links/orchestrator.js +71 -0
- package/lib/components/pairwise-links/pairwise-links.js +30 -27
- package/lib/components/pairwise-links/row.js +74 -0
- package/lib/components/radio/html/radio-group-content.js +4 -2
- package/lib/components/radio/html/radio-group.js +3 -3
- package/lib/components/radio/html/radio-option.js +3 -1
- package/lib/components/radio/lunatic-radio-group.js +2 -1
- package/lib/components/suggester/find-best-label/find-best-label.js +6 -6
- package/lib/components/suggester/idb-suggester/idb-suggester.js +4 -3
- package/lib/components/suggester/lunatic-suggester.js +7 -4
- package/lib/components/suggester/searching/create-searching.js +20 -39
- package/lib/components/switch/html/switch.js +2 -2
- package/lib/components/switch/lunatic-switch.js +2 -1
- package/lib/components/table/cell.js +89 -0
- package/lib/components/table/{table-header.js → header.js} +5 -3
- package/lib/components/table/index.js +13 -0
- package/lib/components/table/lunatic-table.js +15 -24
- package/lib/components/table/row.js +40 -0
- package/lib/components/table/table-orchestrator.js +35 -0
- package/lib/components/textarea/html/__snapshots__/textarea.spec.tsx.snap +2 -0
- package/lib/components/textarea/html/textarea.js +6 -4
- package/lib/components/textarea/lunatic-textarea.js +6 -3
- package/lib/hooks/use-auto-focus.js +26 -0
- package/lib/src/components/checkbox/checkbox-boolean/html/checkbox-boolean.d.ts +1 -1
- package/lib/src/components/checkbox/checkbox-group/html/checkbox-group-content.d.ts +2 -1
- package/lib/src/components/checkbox/checkbox-group/html/checkbox-group.d.ts +1 -1
- package/lib/src/components/checkbox/commons/checkbox-option.d.ts +1 -0
- package/lib/src/components/commons/components/combo-box/combo-box-container.d.ts +2 -2
- package/lib/src/components/commons/components/combo-box/combo-box.d.ts +2 -2
- package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +4 -6
- package/lib/src/components/commons/components/combo-box/selection/LabelOrInput.d.ts +1 -0
- package/lib/src/components/commons/components/combo-box/selection/input.d.ts +1 -0
- package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +2 -1
- package/lib/src/components/commons/components/errors/errors.d.ts +6 -3
- package/lib/src/components/datepicker/html/datepicker-input.d.ts +2 -1
- package/lib/src/components/datepicker/html/datepicker.d.ts +1 -1
- package/lib/src/components/dropdown/html/dropdown-writable/dropdown-writable.d.ts +1 -1
- package/lib/src/components/dropdown/html/dropdown.d.ts +3 -1
- package/lib/src/components/index.d.ts +2 -2
- package/lib/src/components/input/html/input.d.ts +2 -2
- package/lib/src/components/input-number/html/input-number-thousand.d.ts +2 -2
- package/lib/src/components/input-number/html/input-number.d.ts +2 -3
- package/lib/src/components/loop/block-for-loop.d.ts +4 -3
- package/lib/src/components/loop/roster-for-loop/roster-for-loop.d.ts +4 -3
- package/lib/src/components/loop/utils/get-initial-nb-rows.d.ts +4 -0
- package/lib/src/components/lunatic-components.d.ts +3 -5
- package/lib/src/components/pairwise-links/index.d.ts +1 -0
- package/lib/src/components/pairwise-links/orchestrator.d.ts +6 -0
- package/lib/src/components/pairwise-links/pairwise-links.d.ts +2 -1
- package/lib/src/components/pairwise-links/row.d.ts +7 -0
- package/lib/src/components/radio/html/radio-group-content.d.ts +2 -1
- package/lib/src/components/radio/html/radio-group.d.ts +1 -1
- package/lib/src/components/radio/html/radio-option.d.ts +1 -0
- package/lib/src/components/suggester/find-best-label/find-best-label.d.ts +1 -1
- package/lib/src/components/suggester/html/suggester.d.ts +1 -1
- package/lib/src/components/suggester/idb-suggester/idb-suggester.d.ts +5 -2
- package/lib/src/components/suggester/lunatic-suggester.d.ts +1 -1
- package/lib/src/components/suggester/searching/create-searching.d.ts +1 -1
- package/lib/src/components/switch/html/switch.d.ts +1 -1
- package/lib/src/components/table/cell.d.ts +19 -0
- package/lib/src/components/table/{table-header.d.ts → header.d.ts} +2 -2
- package/lib/src/components/table/index.d.ts +1 -0
- package/lib/src/components/table/lunatic-table.d.ts +1 -1
- package/lib/src/components/table/row.d.ts +18 -0
- package/lib/src/components/table/table-orchestrator.d.ts +4 -0
- package/lib/src/components/textarea/html/textarea.d.ts +3 -2
- package/lib/src/components/type.d.ts +9 -7
- package/lib/src/hooks/use-auto-focus.d.ts +6 -0
- package/lib/src/use-lunatic/actions.d.ts +19 -3
- package/lib/src/use-lunatic/commons/calculated-variables.d.ts +8 -0
- package/lib/src/use-lunatic/commons/compile-controls.d.ts +2 -3
- package/lib/src/use-lunatic/commons/execute-expression/create-execute-expression.d.ts +9 -0
- package/lib/src/use-lunatic/commons/execute-expression/create-memoizer.d.ts +8 -0
- package/lib/src/use-lunatic/commons/execute-expression/create-refresh-calculated.d.ts +24 -0
- package/lib/src/use-lunatic/commons/execute-expression/execute-expression.d.ts +11 -0
- package/lib/src/use-lunatic/commons/execute-expression/get-expressions-variables.d.ts +7 -0
- package/lib/src/use-lunatic/commons/execute-expression/get-expressions-variables.spec.d.ts +1 -0
- package/lib/src/use-lunatic/commons/execute-expression/get-safety-expression.d.ts +6 -0
- package/lib/src/use-lunatic/commons/execute-expression/index.d.ts +1 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +418 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-component-value.d.ts +3 -2
- package/lib/src/use-lunatic/commons/fill-components/fill-components.d.ts +0 -6
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +142 -107
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +89 -53
- package/lib/src/use-lunatic/commons/get-compatible-vtl-expression.d.ts +0 -1
- package/lib/src/use-lunatic/commons/get-component-value/get-component-value.d.ts +6 -0
- package/lib/src/use-lunatic/commons/get-component-value/index.d.ts +1 -0
- package/lib/src/use-lunatic/commons/get-data.d.ts +26 -0
- package/lib/src/use-lunatic/commons/index.d.ts +3 -0
- package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +9 -10
- package/lib/src/use-lunatic/reducer/reduce-handle-change/index.d.ts +1 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.d.ts +7 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.spec.d.ts +1 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.d.ts +4 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.d.ts +15 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-missing.d.ts +7 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-resizing.d.ts +4 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-array.d.ts +14 -0
- package/lib/src/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.d.ts +9 -0
- package/lib/src/use-lunatic/reducer/reduce-on-init.d.ts +12 -1
- package/lib/src/use-lunatic/reducer/reduce-on-init.spec.d.ts +1 -0
- package/lib/src/use-lunatic/type-source.d.ts +21 -7
- package/lib/src/use-lunatic/type.d.ts +12 -13
- package/lib/src/use-lunatic/use-lunatic.d.ts +62 -36
- package/lib/src/use-lunatic/use-suggesters.d.ts +2 -1
- package/lib/src/utils/array.d.ts +1 -6
- package/lib/src/utils/number.d.ts +0 -4
- package/lib/src/utils/suggester-workers/append-to-index/create-append-task.d.ts +1 -1
- package/lib/src/utils/suggester-workers/worker-path.d.ts +6 -0
- package/lib/src/utils/vtl/dataset-builder.d.ts +5 -0
- package/lib/src/utils/vtl/index.d.ts +1 -0
- package/lib/stories/behaviour/cleaning/source.json +151 -0
- package/lib/stories/behaviour/cleaning/test.stories.js +84 -0
- package/lib/stories/{questionnaires-test → behaviour}/controls/controls.stories.js +5 -5
- package/lib/stories/{questionnaires-test → behaviour/others}/test.stories.js +7 -7
- package/lib/stories/{paste-questionnaire → behaviour/paste}/test.stories.js +3 -3
- package/lib/stories/{resizing-questionnaire → behaviour/resizing}/test.stories.js +3 -3
- package/lib/use-lunatic/actions.js +3 -3
- package/lib/use-lunatic/commons/calculated-variables.js +104 -0
- package/lib/use-lunatic/commons/compile-controls.js +5 -3
- package/lib/use-lunatic/commons/execute-condition-filter.js +9 -1
- package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +233 -0
- package/lib/use-lunatic/commons/execute-expression/create-execute-expression.spec.js +155 -0
- package/lib/use-lunatic/commons/execute-expression/create-memoizer.js +63 -0
- package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +149 -0
- package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.spec.js +130 -0
- package/lib/use-lunatic/commons/execute-expression/execute-expression.js +90 -0
- package/lib/use-lunatic/commons/execute-expression/execute-expression.spec.js +38 -0
- package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.js +40 -0
- package/lib/use-lunatic/commons/execute-expression/get-expressions-variables.spec.js +31 -0
- package/lib/use-lunatic/commons/{fill-components/fill-iterations.js → execute-expression/get-safety-expression.js} +20 -30
- package/lib/use-lunatic/commons/execute-expression/index.js +13 -0
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +3 -2
- package/lib/use-lunatic/{reducer/reduce-handle-change.js → commons/fill-components/fill-component-required.js} +8 -14
- package/lib/use-lunatic/commons/fill-components/fill-component-value.js +7 -21
- package/lib/use-lunatic/commons/fill-components/fill-components.js +4 -5
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js +2 -0
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +13 -6
- package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +5 -58
- package/lib/use-lunatic/commons/get-compatible-vtl-expression.js +0 -1
- package/lib/use-lunatic/commons/get-component-value/get-component-value.js +174 -0
- package/lib/use-lunatic/commons/get-component-value/index.js +13 -0
- package/lib/use-lunatic/commons/get-data.js +80 -0
- package/lib/use-lunatic/commons/index.js +21 -0
- package/lib/use-lunatic/initial-state.js +4 -6
- package/lib/use-lunatic/reducer/overview/overview-on-change.js +1 -1
- package/lib/use-lunatic/reducer/reduce-handle-change/__mocks__/source-cleaning-loop.json +792 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/index.js +13 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +78 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.spec.js +46 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +115 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-links-variable.js +89 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-missing.js +88 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +119 -0
- package/lib/use-lunatic/{commons/variables/get-questionnaire-data.js → reducer/reduce-handle-change/reduce-variables-array.js} +32 -53
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-variables-simple.js +28 -0
- package/lib/use-lunatic/reducer/reduce-on-init.js +184 -90
- package/lib/use-lunatic/reducer/reduce-on-init.spec.js +17 -0
- package/lib/use-lunatic/reducer/reducer.js +2 -2
- package/lib/use-lunatic/reducer/resolve-component-controls/resolve-simple-control.js +4 -2
- package/lib/use-lunatic/use-lunatic.js +29 -22
- package/lib/use-lunatic/use-lunatic.test.js +36 -133
- package/lib/use-lunatic/use-suggesters.js +4 -3
- package/lib/utils/array.js +6 -57
- package/lib/utils/get-component-value.js +9 -3
- package/lib/utils/number.js +1 -13
- package/lib/utils/suggester-workers/append-to-index/create-append-task.js +4 -3
- package/lib/utils/suggester-workers/worker-path.js +29 -0
- package/lib/utils/vtl/dataset-builder.js +27 -0
- package/lib/utils/vtl/index.js +13 -0
- package/package.json +15 -10
- package/scripts/build/add-workers-to-public.js +44 -0
- package/scripts/build/workers-paths.js +44 -0
- package/workers-release/lunatic-append-worker-0.3.0-experimental.js +2 -0
- package/workers-release/lunatic-append-worker-0.3.0-experimental.js.LICENSE.txt +34 -0
- package/workers-release/lunatic-label-worker-0.3.0-experimental.js +2 -0
- package/workers-release/lunatic-label-worker-0.3.0-experimental.js.LICENSE.txt +13 -0
- package/workers-release/lunatic-searching-worker-0.3.0-experimental.js +2 -0
- package/workers-release/lunatic-searching-worker-0.3.0-experimental.js.LICENSE.txt +34 -0
- package/lib/hooks/use-track-changes.js +0 -50
- package/lib/src/hooks/use-track-changes.d.ts +0 -9
- package/lib/src/use-lunatic/commons/component.d.ts +0 -22
- package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +0 -112
- package/lib/src/use-lunatic/commons/variables/behaviours/cleaning-behaviour.d.ts +0 -7
- package/lib/src/use-lunatic/commons/variables/behaviours/missing-behaviour.d.ts +0 -7
- package/lib/src/use-lunatic/commons/variables/behaviours/resizing-behaviour.d.ts +0 -7
- package/lib/src/use-lunatic/commons/variables/get-questionnaire-data.d.ts +0 -4
- package/lib/src/use-lunatic/commons/variables/lunatic-variables-store.d.ts +0 -77
- package/lib/src/use-lunatic/reducer/reduce-handle-change.d.ts +0 -6
- package/lib/src/utils/env.d.ts +0 -1
- package/lib/src/utils/store-tools/worker-path.d.ts +0 -1
- package/lib/src/utils/variables.d.ts +0 -5
- package/lib/src/utils/vtl.d.ts +0 -14
- package/lib/use-lunatic/commons/component.js +0 -22
- package/lib/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +0 -39
- package/lib/use-lunatic/commons/variables/behaviours/missing-behaviour.js +0 -47
- package/lib/use-lunatic/commons/variables/behaviours/resizing-behaviour.js +0 -78
- package/lib/use-lunatic/commons/variables/lunatic-variables-store.js +0 -330
- package/lib/use-lunatic/commons/variables/lunatic-variables-store.spec.js +0 -216
- package/lib/utils/array.spec.js +0 -30
- package/lib/utils/env.js +0 -10
- package/lib/utils/store-tools/worker-path.js +0 -13
- package/lib/utils/suggester-workers/create-worker.js +0 -55
- package/lib/utils/variables.js +0 -37
- package/lib/utils/vtl.js +0 -100
- /package/lib/src/use-lunatic/commons/{variables/lunatic-variables-store.spec.d.ts → execute-expression/create-refresh-calculated.spec.d.ts} +0 -0
- /package/lib/src/{utils/array.spec.d.ts → use-lunatic/commons/execute-expression/execute-expression.spec.d.ts} +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_Controles_BouclesLiees2_PasPageFin.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_Controles_BouclesLiees_PasPageFin.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/boucles-n.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/controls-externes.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/controls-externes.stories.js +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/V2_DeclarationsSimples.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/V2_MinMaxSum_Boucles.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/V2_QuestSimple_Boucles.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/V2_TCMRallyeGames.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/test-dylan.json +0 -0
- /package/lib/stories/{paste-questionnaire → behaviour/paste}/source.json +0 -0
- /package/lib/stories/{resizing-questionnaire → behaviour/resizing}/source.json +0 -0
|
@@ -91,9 +91,27 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
91
91
|
colspan?: number | undefined;
|
|
92
92
|
rowspan?: number | undefined;
|
|
93
93
|
}[];
|
|
94
|
-
body:
|
|
95
|
-
label
|
|
96
|
-
|
|
94
|
+
body: {
|
|
95
|
+
label?: import("../../type-source").LabelType | undefined;
|
|
96
|
+
value?: string | undefined;
|
|
97
|
+
format?: string | undefined;
|
|
98
|
+
dateFormat?: string | undefined;
|
|
99
|
+
unit?: string | undefined;
|
|
100
|
+
options: {
|
|
101
|
+
value: string;
|
|
102
|
+
label: import("../../type-source").LabelType;
|
|
103
|
+
}[];
|
|
104
|
+
response: import("../../type-source").ResponseType;
|
|
105
|
+
bindingDependencies: string[];
|
|
106
|
+
componentType?: import("../../type-source").ComponentTypeEnum | undefined;
|
|
107
|
+
maxLength?: number | undefined;
|
|
108
|
+
min?: number | undefined;
|
|
109
|
+
max?: number | undefined;
|
|
110
|
+
decimals?: number | undefined;
|
|
111
|
+
colspan?: number | undefined;
|
|
112
|
+
rowspan?: number | undefined;
|
|
113
|
+
id?: string | undefined;
|
|
114
|
+
}[];
|
|
97
115
|
positioning: "HORIZONTAL";
|
|
98
116
|
value?: Record<string, unknown[]> | undefined;
|
|
99
117
|
} | {
|
|
@@ -131,7 +149,6 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
131
149
|
paginatedLoop: boolean;
|
|
132
150
|
value?: Record<string, unknown[]> | undefined;
|
|
133
151
|
} | {
|
|
134
|
-
getComponents: (x: number, y: number) => import("./fill-components").FilledLunaticComponentProps<"Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ConfirmationModal" | "ComponentSet" | "Roundabout" | "QuestionExplication">[];
|
|
135
152
|
label: import("react").ReactNode;
|
|
136
153
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
137
154
|
conditionFilter: import("react").ReactNode;
|
|
@@ -152,17 +169,8 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
152
169
|
};
|
|
153
170
|
mandatory?: boolean | undefined;
|
|
154
171
|
page: string;
|
|
155
|
-
componentType: "
|
|
156
|
-
xAxisIterations: import("react").ReactNode;
|
|
157
|
-
yAxisIterations: import("react").ReactNode;
|
|
158
|
-
symLinks: {
|
|
159
|
-
[x: string]: {
|
|
160
|
-
[x: string]: string;
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
components: import("../../type-source").ComponentType[];
|
|
172
|
+
componentType: "Sequence";
|
|
164
173
|
} | {
|
|
165
|
-
body: unknown[][];
|
|
166
174
|
label: import("react").ReactNode;
|
|
167
175
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
168
176
|
conditionFilter: import("react").ReactNode;
|
|
@@ -183,22 +191,8 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
183
191
|
};
|
|
184
192
|
mandatory?: boolean | undefined;
|
|
185
193
|
page: string;
|
|
186
|
-
componentType: "
|
|
187
|
-
|
|
188
|
-
min: import("react").ReactNode;
|
|
189
|
-
max: import("react").ReactNode;
|
|
190
|
-
};
|
|
191
|
-
header: {
|
|
192
|
-
value: string;
|
|
193
|
-
label: string | import("../../type-source").LabelType;
|
|
194
|
-
options: {
|
|
195
|
-
value: string;
|
|
196
|
-
label: import("../../type-source").LabelType;
|
|
197
|
-
}[];
|
|
198
|
-
colspan?: number | undefined;
|
|
199
|
-
rowspan?: number | undefined;
|
|
200
|
-
}[];
|
|
201
|
-
positioning: "HORIZONTAL";
|
|
194
|
+
componentType: "Subsequence";
|
|
195
|
+
gotoPage: string;
|
|
202
196
|
} | {
|
|
203
197
|
label: import("react").ReactNode;
|
|
204
198
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
@@ -220,30 +214,43 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
220
214
|
};
|
|
221
215
|
mandatory?: boolean | undefined;
|
|
222
216
|
page: string;
|
|
223
|
-
componentType: "
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
conditionFilter: import("react").ReactNode;
|
|
228
|
-
controls?: import("../../type-source").ControlType[] | undefined;
|
|
229
|
-
id: string;
|
|
230
|
-
bindingDependencies?: string[] | undefined;
|
|
231
|
-
hierarchy: {
|
|
232
|
-
sequence: {
|
|
233
|
-
label: import("react").ReactNode;
|
|
234
|
-
id: string;
|
|
235
|
-
page: string;
|
|
236
|
-
};
|
|
237
|
-
subSequence?: {
|
|
238
|
-
label: import("react").ReactNode;
|
|
239
|
-
id: string;
|
|
240
|
-
page: string;
|
|
241
|
-
} | undefined;
|
|
217
|
+
componentType: "Table";
|
|
218
|
+
lines: {
|
|
219
|
+
min: import("react").ReactNode;
|
|
220
|
+
max: import("react").ReactNode;
|
|
242
221
|
};
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
222
|
+
header: {
|
|
223
|
+
value: string;
|
|
224
|
+
label: string | import("../../type-source").LabelType;
|
|
225
|
+
options: {
|
|
226
|
+
value: string;
|
|
227
|
+
label: import("../../type-source").LabelType;
|
|
228
|
+
}[];
|
|
229
|
+
colspan?: number | undefined;
|
|
230
|
+
rowspan?: number | undefined;
|
|
231
|
+
}[];
|
|
232
|
+
body: {
|
|
233
|
+
label?: import("../../type-source").LabelType | undefined;
|
|
234
|
+
value?: string | undefined;
|
|
235
|
+
format?: string | undefined;
|
|
236
|
+
dateFormat?: string | undefined;
|
|
237
|
+
unit?: string | undefined;
|
|
238
|
+
options: {
|
|
239
|
+
value: string;
|
|
240
|
+
label: import("../../type-source").LabelType;
|
|
241
|
+
}[];
|
|
242
|
+
response: import("../../type-source").ResponseType;
|
|
243
|
+
bindingDependencies: string[];
|
|
244
|
+
componentType?: import("../../type-source").ComponentTypeEnum | undefined;
|
|
245
|
+
maxLength?: number | undefined;
|
|
246
|
+
min?: number | undefined;
|
|
247
|
+
max?: number | undefined;
|
|
248
|
+
decimals?: number | undefined;
|
|
249
|
+
colspan?: number | undefined;
|
|
250
|
+
rowspan?: number | undefined;
|
|
251
|
+
id?: string | undefined;
|
|
252
|
+
}[];
|
|
253
|
+
positioning: "HORIZONTAL";
|
|
247
254
|
} | {
|
|
248
255
|
label: import("react").ReactNode;
|
|
249
256
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
@@ -443,6 +450,35 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
443
450
|
missingResponse?: {
|
|
444
451
|
name: string;
|
|
445
452
|
} | undefined;
|
|
453
|
+
} | {
|
|
454
|
+
label: import("react").ReactNode;
|
|
455
|
+
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
456
|
+
conditionFilter: import("react").ReactNode;
|
|
457
|
+
controls?: import("../../type-source").ControlType[] | undefined;
|
|
458
|
+
id: string;
|
|
459
|
+
bindingDependencies?: string[] | undefined;
|
|
460
|
+
hierarchy: {
|
|
461
|
+
sequence: {
|
|
462
|
+
label: import("react").ReactNode;
|
|
463
|
+
id: string;
|
|
464
|
+
page: string;
|
|
465
|
+
};
|
|
466
|
+
subSequence?: {
|
|
467
|
+
label: import("react").ReactNode;
|
|
468
|
+
id: string;
|
|
469
|
+
page: string;
|
|
470
|
+
} | undefined;
|
|
471
|
+
};
|
|
472
|
+
mandatory?: boolean | undefined;
|
|
473
|
+
page: string;
|
|
474
|
+
componentType: "PairwiseLinks";
|
|
475
|
+
xAxisIterations: import("react").ReactNode;
|
|
476
|
+
yAxisIterations: import("react").ReactNode;
|
|
477
|
+
symLinks: {
|
|
478
|
+
[x: string]: {
|
|
479
|
+
[x: string]: string;
|
|
480
|
+
};
|
|
481
|
+
};
|
|
446
482
|
} | {
|
|
447
483
|
label: import("react").ReactNode;
|
|
448
484
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { LunaticExpression } from '../type';
|
|
2
2
|
/**
|
|
3
3
|
* Ensure that an expression is compatible with VTL (convert if necessary)
|
|
4
|
-
* @deprecated use getExpressionAsString() instead
|
|
5
4
|
*/
|
|
6
5
|
declare function getCompatibleVTLExpression(expression: LunaticExpression | string): LunaticExpression | undefined;
|
|
7
6
|
export default getCompatibleVTLExpression;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './get-component-value';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { LunaticState } from '../type';
|
|
2
|
+
/**
|
|
3
|
+
* Extract the value from a questionnaire
|
|
4
|
+
*
|
|
5
|
+
* used by the "getData" method from the state at the end of a form
|
|
6
|
+
*/
|
|
7
|
+
export declare const getQuestionnaireData: ({ variables, withRefreshedCalculated, }: {
|
|
8
|
+
variables: LunaticState['variables'];
|
|
9
|
+
withRefreshedCalculated: boolean;
|
|
10
|
+
}) => {
|
|
11
|
+
CALCULATED: {};
|
|
12
|
+
EXTERNAL: ({
|
|
13
|
+
variableType: "EXTERNAL";
|
|
14
|
+
name: string;
|
|
15
|
+
value: unknown;
|
|
16
|
+
} & {
|
|
17
|
+
variableType: "EXTERNAL";
|
|
18
|
+
})[];
|
|
19
|
+
COLLECTED: ({
|
|
20
|
+
variableType: "COLLECTED";
|
|
21
|
+
name: string;
|
|
22
|
+
values: import("../type-source").ValuesType<unknown> | import("../type-source").ValuesTypeArray<unknown>;
|
|
23
|
+
} & {
|
|
24
|
+
variableType: "COLLECTED";
|
|
25
|
+
})[];
|
|
26
|
+
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export { default as checkLoops } from './check-loops';
|
|
2
2
|
export { default as createMapPages } from './create-map-pages';
|
|
3
3
|
export { default as executeConditionFilter } from './execute-condition-filter';
|
|
4
|
+
export { default as createExecuteExpression } from './execute-expression';
|
|
4
5
|
export { default as fillComponentExpressions } from './fill-components/fill-component-expressions';
|
|
5
6
|
export { default as getCompatibleVTLExpression } from './get-compatible-vtl-expression';
|
|
6
7
|
export { default as getComponentsFromState } from './get-components-from-state';
|
|
8
|
+
export { default as getErrorsWithoutEmptyValue } from './get-errors-without-empty-value';
|
|
7
9
|
export { default as isFirstLastPage } from './is-First-last-page';
|
|
10
|
+
export { default as isPaginatedLoop } from './is-paginated-loop';
|
|
8
11
|
export { getNewReachedPage, getPageTag, isNewReachedPage } from './page-tag';
|
|
9
12
|
export { default as useComponentsFromState } from './use-components-from-state';
|
|
@@ -2,8 +2,9 @@ import type { LunaticOverviewItem, LunaticState } from '../../type';
|
|
|
2
2
|
import { type ActionInit } from '../../actions';
|
|
3
3
|
export declare function reduceOverviewOnInit(state: LunaticState, action: ActionInit): {
|
|
4
4
|
overview: LunaticOverviewItem[];
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
variables: {
|
|
6
|
+
[variableName: string]: import("../../type").LunaticStateVariable;
|
|
7
|
+
};
|
|
7
8
|
pages: {
|
|
8
9
|
[key: string]: {
|
|
9
10
|
components: import("../../type-source").ComponentType[];
|
|
@@ -77,17 +78,14 @@ export declare function reduceOverviewOnInit(state: LunaticState, action: Action
|
|
|
77
78
|
modalErrors?: Record<string, import("../../type").LunaticError[]> | undefined;
|
|
78
79
|
handleChange: (response: {
|
|
79
80
|
name: string;
|
|
80
|
-
}, value: any, args?:
|
|
81
|
-
iteration?: number[] | undefined;
|
|
82
|
-
} | undefined) => void;
|
|
81
|
+
}, value: any, args?: Record<string, unknown> | undefined) => void;
|
|
83
82
|
executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
|
|
84
|
-
iteration?: number |
|
|
83
|
+
iteration?: number | undefined;
|
|
84
|
+
linksIterations?: number[] | undefined;
|
|
85
|
+
logging?: import("../../commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
|
|
85
86
|
bindingDependencies?: string[] | undefined;
|
|
86
|
-
deps?: string[] | undefined;
|
|
87
87
|
} | undefined) => T;
|
|
88
|
-
updateBindings: (variableName: string, value: unknown
|
|
89
|
-
iteration?: number[] | undefined;
|
|
90
|
-
}) => unknown;
|
|
88
|
+
updateBindings: (variableName: string, value: unknown) => unknown;
|
|
91
89
|
activeControls: boolean;
|
|
92
90
|
shortcut?: boolean | undefined;
|
|
93
91
|
management?: boolean | undefined;
|
|
@@ -103,4 +101,5 @@ export declare function reduceOverviewOnInit(state: LunaticState, action: Action
|
|
|
103
101
|
status: import("../../use-suggesters").SuggesterStatus;
|
|
104
102
|
timestamp: number;
|
|
105
103
|
};
|
|
104
|
+
workersBasePath?: string | undefined;
|
|
106
105
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './reduce-handle-change';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LunaticState } from '../../type';
|
|
2
|
+
import { type ActionHandleChange } from '../../actions';
|
|
3
|
+
/**
|
|
4
|
+
* Reset variables to null using the cleaning definition in the source.json
|
|
5
|
+
*/
|
|
6
|
+
declare function reduceCleaning(state: LunaticState, action: ActionHandleChange): LunaticState;
|
|
7
|
+
export default reduceCleaning;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LunaticState } from '../../type';
|
|
2
|
+
import { type ActionHandleChange } from '../../actions';
|
|
3
|
+
type Payload = ActionHandleChange['payload']['args'] & {
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Update the link variable in pair wise situation
|
|
9
|
+
*
|
|
10
|
+
* If person1 is "parent" of person2 we have to update person2 as a "child" of person1
|
|
11
|
+
*/
|
|
12
|
+
declare function reduceLinksVariable(variables: LunaticState['variables'], { name, value, linksIterations, symLinks, lengths }: Payload): {
|
|
13
|
+
[variableName: string]: import("../../type").LunaticStateVariable;
|
|
14
|
+
};
|
|
15
|
+
export default reduceLinksVariable;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LunaticState } from '../../type';
|
|
2
|
+
import { type ActionHandleChange } from '../../actions';
|
|
3
|
+
/**
|
|
4
|
+
* Update value for missing variables
|
|
5
|
+
*/
|
|
6
|
+
declare function reduceMissing(state: LunaticState, action: ActionHandleChange): LunaticState;
|
|
7
|
+
export default reduceMissing;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { LunaticState } from '../../type';
|
|
2
|
+
type Args = {
|
|
3
|
+
name: string;
|
|
4
|
+
value: unknown;
|
|
5
|
+
index: number;
|
|
6
|
+
length: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Inject the value at a specific index (and resize the value if necessary)
|
|
10
|
+
*/
|
|
11
|
+
declare function reduceVariablesArray(variables: LunaticState['variables'], args: Args): {
|
|
12
|
+
[variableName: string]: import("../../type").LunaticStateVariable;
|
|
13
|
+
};
|
|
14
|
+
export default reduceVariablesArray;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LunaticState } from '../../type';
|
|
2
|
+
/**
|
|
3
|
+
* Add the value for the variable in the corresponding variable object
|
|
4
|
+
*/
|
|
5
|
+
declare function reduceVariablesSimple(variables: LunaticState['variables'], { name, value }: {
|
|
6
|
+
name: string;
|
|
7
|
+
value: unknown;
|
|
8
|
+
}): LunaticState['variables'];
|
|
9
|
+
export default reduceVariablesSimple;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { type ActionInit } from '../actions';
|
|
2
|
-
import type { LunaticState } from '../type';
|
|
2
|
+
import type { LunaticState, LunaticVariable } from '../type';
|
|
3
|
+
export type VariablesByType = {
|
|
4
|
+
EXTERNAL: (LunaticVariable & {
|
|
5
|
+
variableType: 'EXTERNAL';
|
|
6
|
+
})[];
|
|
7
|
+
COLLECTED: (LunaticVariable & {
|
|
8
|
+
variableType: 'COLLECTED';
|
|
9
|
+
})[];
|
|
10
|
+
CALCULATED: (LunaticVariable & {
|
|
11
|
+
variableType: 'CALCULATED';
|
|
12
|
+
})[];
|
|
13
|
+
};
|
|
3
14
|
declare const reducers: (acc: LunaticState, action: ActionInit) => LunaticState;
|
|
4
15
|
export default reducers;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -117,9 +117,27 @@ export type ComponentRosterForLoopType = {
|
|
|
117
117
|
colspan?: number;
|
|
118
118
|
rowspan?: number;
|
|
119
119
|
}[];
|
|
120
|
-
body:
|
|
121
|
-
label
|
|
122
|
-
|
|
120
|
+
body: {
|
|
121
|
+
label?: LabelType;
|
|
122
|
+
value?: string;
|
|
123
|
+
format?: string;
|
|
124
|
+
dateFormat?: string;
|
|
125
|
+
unit?: string;
|
|
126
|
+
options: {
|
|
127
|
+
value: string;
|
|
128
|
+
label: LabelType;
|
|
129
|
+
}[];
|
|
130
|
+
response: ResponseType;
|
|
131
|
+
bindingDependencies: string[];
|
|
132
|
+
componentType?: ComponentTypeEnum;
|
|
133
|
+
maxLength?: number;
|
|
134
|
+
min?: number;
|
|
135
|
+
max?: number;
|
|
136
|
+
decimals?: number;
|
|
137
|
+
colspan?: number;
|
|
138
|
+
rowspan?: number;
|
|
139
|
+
id?: string;
|
|
140
|
+
}[];
|
|
123
141
|
positioning: 'HORIZONTAL';
|
|
124
142
|
};
|
|
125
143
|
export type ComponentLoopType = {
|
|
@@ -199,7 +217,6 @@ export type ComponentPairWiseLinksType = {
|
|
|
199
217
|
symLinks: {
|
|
200
218
|
[variableName: string]: Record<string, string>;
|
|
201
219
|
};
|
|
202
|
-
components: ComponentType[];
|
|
203
220
|
};
|
|
204
221
|
export type ComponentComponentSetType = {
|
|
205
222
|
componentType: 'ComponentSet';
|
|
@@ -281,9 +298,6 @@ export type LunaticSource = {
|
|
|
281
298
|
[variableName: string]: {
|
|
282
299
|
size: string;
|
|
283
300
|
variables: string[];
|
|
284
|
-
} | {
|
|
285
|
-
sizeForLinksVariables: string[];
|
|
286
|
-
linksVariables: string[];
|
|
287
301
|
};
|
|
288
302
|
};
|
|
289
303
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import { type ExpressionLogger } from './commons/execute-expression/create-execute-expression';
|
|
2
3
|
import type { ComponentType, ControlType, LunaticSource, Variable } from './type-source';
|
|
3
4
|
import { SuggesterStatus } from './use-suggesters';
|
|
4
|
-
import type { LunaticVariablesStore } from './commons/variables/lunatic-variables-store';
|
|
5
5
|
export type LunaticComponentDefinition<T extends ComponentType['componentType'] = ComponentType['componentType']> = ComponentType & {
|
|
6
6
|
componentType: T;
|
|
7
7
|
};
|
|
@@ -9,9 +9,9 @@ export type LunaticControl = ControlType;
|
|
|
9
9
|
export type VTLBindings = {
|
|
10
10
|
[variableName: string]: unknown;
|
|
11
11
|
};
|
|
12
|
-
export type LunaticData = Record<Exclude<VariableType, 'COLLECTED'>, Record<string, unknown>> & {
|
|
12
|
+
export type LunaticData = Partial<Record<Exclude<VariableType, 'COLLECTED'>, Record<string, unknown>> & {
|
|
13
13
|
COLLECTED: Record<string, LunaticCollectedValue>;
|
|
14
|
-
}
|
|
14
|
+
}>;
|
|
15
15
|
export type LunaticValues = {
|
|
16
16
|
[variableName: string]: unknown;
|
|
17
17
|
};
|
|
@@ -59,8 +59,9 @@ export type LunaticStateVariable = {
|
|
|
59
59
|
};
|
|
60
60
|
}[LunaticVariable['variableType']];
|
|
61
61
|
export type LunaticState = {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
variables: {
|
|
63
|
+
[variableName: string]: LunaticStateVariable;
|
|
64
|
+
};
|
|
64
65
|
pages: {
|
|
65
66
|
[key: number | string]: {
|
|
66
67
|
components: ComponentType[];
|
|
@@ -118,17 +119,14 @@ export type LunaticState = {
|
|
|
118
119
|
modalErrors?: Record<string, LunaticError[]>;
|
|
119
120
|
handleChange: (response: {
|
|
120
121
|
name: string;
|
|
121
|
-
}, value: any, args?:
|
|
122
|
-
iteration?: number[];
|
|
123
|
-
}) => void;
|
|
122
|
+
}, value: any, args?: Record<string, unknown>) => void;
|
|
124
123
|
executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
|
|
125
|
-
iteration?: number
|
|
124
|
+
iteration?: number;
|
|
125
|
+
linksIterations?: number[];
|
|
126
|
+
logging?: ExpressionLogger;
|
|
126
127
|
bindingDependencies?: string[];
|
|
127
|
-
deps?: string[];
|
|
128
128
|
}) => T;
|
|
129
|
-
updateBindings: (variableName: string, value: unknown
|
|
130
|
-
iteration?: number[];
|
|
131
|
-
}) => unknown;
|
|
129
|
+
updateBindings: (variableName: string, value: unknown) => unknown;
|
|
132
130
|
activeControls: boolean;
|
|
133
131
|
shortcut?: boolean;
|
|
134
132
|
management?: boolean;
|
|
@@ -144,4 +142,5 @@ export type LunaticState = {
|
|
|
144
142
|
status: SuggesterStatus;
|
|
145
143
|
timestamp: number;
|
|
146
144
|
};
|
|
145
|
+
workersBasePath?: string;
|
|
147
146
|
};
|