@inseefr/lunatic 2.4.10 → 2.5.0-fast-forward

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.
Files changed (103) hide show
  1. package/lib/components/commons/components/orchestrated-component.js +10 -30
  2. package/lib/components/commons/create-row-orchestrator.js +7 -2
  3. package/lib/components/component-set/html/component-set-components.js +16 -25
  4. package/lib/components/component-set/lunatic-component-set.js +23 -37
  5. package/lib/components/index.js +14 -0
  6. package/lib/components/loop/block-for-loop/block-for-loop.js +4 -2
  7. package/lib/components/loop/block-for-loop/row.js +4 -2
  8. package/lib/components/loop/loop.js +6 -3
  9. package/lib/components/loop/roster-for-loop/body.js +4 -2
  10. package/lib/components/loop/roster-for-loop/roster-for-loop.js +2 -0
  11. package/lib/components/loop/roster-for-loop/roster-table.js +4 -2
  12. package/lib/components/loop/roster-for-loop/row.js +3 -1
  13. package/lib/components/question-explication/html/question-explication.js +53 -0
  14. package/lib/components/question-explication/html/question-explication.scss +35 -0
  15. package/lib/components/question-explication/index.js +13 -0
  16. package/lib/components/question-explication/lunatic-question-explication.js +32 -0
  17. package/lib/components/question-explication/question-explication.spec.js +49 -0
  18. package/lib/components/roundabout/lunatic-roundabout.js +2 -4
  19. package/lib/components/subsequence/subsequence.js +0 -2
  20. package/lib/components/subsequence/subsequence.spec.js +2 -2
  21. package/lib/components/summary/html/summary-container.js +14 -0
  22. package/lib/components/summary/html/summary-responses.js +53 -0
  23. package/lib/components/summary/html/summary-title.js +20 -0
  24. package/lib/components/summary/index.js +12 -0
  25. package/lib/components/summary/lunatic-summary.js +99 -0
  26. package/lib/src/components/commons/components/orchestrated-component.d.ts +4 -5
  27. package/lib/src/components/commons/create-row-orchestrator.d.ts +3 -2
  28. package/lib/src/components/component-set/html/component-set-components.d.ts +2 -2
  29. package/lib/src/components/component-set/lunatic-component-set.d.ts +2 -1
  30. package/lib/src/components/index.d.ts +2 -0
  31. package/lib/src/components/loop/block-for-loop/block-for-loop-ochestrator.d.ts +3 -2
  32. package/lib/src/components/loop/block-for-loop/row.d.ts +2 -1
  33. package/lib/src/components/loop/roster-for-loop/body.d.ts +2 -2
  34. package/lib/src/components/loop/roster-for-loop/roster-for-loop-orchestrator.d.ts +3 -2
  35. package/lib/src/components/loop/roster-for-loop/roster-table.d.ts +2 -2
  36. package/lib/src/components/loop/roster-for-loop/row.d.ts +2 -1
  37. package/lib/src/components/question-explication/html/question-explication.d.ts +7 -0
  38. package/lib/src/components/question-explication/index.d.ts +1 -0
  39. package/lib/src/components/question-explication/lunatic-question-explication.d.ts +3 -0
  40. package/lib/src/components/question-explication/question-explication.spec.d.ts +1 -0
  41. package/lib/src/components/subsequence/subsequence.d.ts +2 -2
  42. package/lib/src/components/summary/html/summary-container.d.ts +2 -0
  43. package/lib/src/components/summary/html/summary-responses.d.ts +12 -0
  44. package/lib/src/components/summary/html/summary-title.d.ts +5 -0
  45. package/lib/src/components/summary/index.d.ts +1 -0
  46. package/lib/src/components/summary/lunatic-summary.d.ts +7 -0
  47. package/lib/src/components/type.d.ts +18 -0
  48. package/lib/src/index.d.ts +1 -0
  49. package/lib/src/use-lunatic/actions.d.ts +8 -169
  50. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +137 -112
  51. package/lib/src/use-lunatic/commons/fill-components/fill-missing-response.d.ts +2 -1
  52. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +115 -94
  53. package/lib/src/use-lunatic/commons/page-navigation.d.ts +7 -0
  54. package/lib/src/use-lunatic/commons/page-navigation.spec.d.ts +1 -0
  55. package/lib/src/use-lunatic/commons/page.d.ts +11 -0
  56. package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
  57. package/lib/src/use-lunatic/reducer/commons/auto-explore-loop.d.ts +5 -0
  58. package/lib/src/use-lunatic/reducer/commons/index.d.ts +0 -1
  59. package/lib/src/use-lunatic/reducer/commons/is-loop-component.d.ts +2 -2
  60. package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +1 -7
  61. package/lib/src/use-lunatic/reducer/reduce-on-init.d.ts +1 -1
  62. package/lib/src/use-lunatic/replace-component-sequence.d.ts +3 -3
  63. package/lib/src/use-lunatic/type-source.d.ts +27 -13
  64. package/lib/src/use-lunatic/type.d.ts +4 -12
  65. package/lib/src/use-lunatic/use-lunatic.d.ts +475 -10
  66. package/lib/src/utils/store-tools/worker-path.d.ts +1 -0
  67. package/lib/stories/component-set/component-set.stories.js +2 -1
  68. package/lib/stories/loop/block-for-loop.stories.js +8 -1
  69. package/lib/stories/loop/roster-for-loop.stories.js +92 -2
  70. package/lib/{use-lunatic/reducer/reduce-roundabout.js → stories/question-explication/question-explication.stories.js} +21 -17
  71. package/lib/stories/question-explication/source.json +17 -0
  72. package/lib/stories/roundabout/roundabout.stories.js +2 -1
  73. package/lib/stories/suggester/source-component-set.json +67 -0
  74. package/lib/stories/suggester/suggester.stories.js +9 -1
  75. package/lib/stories/summary/data.json +32 -0
  76. package/lib/stories/summary/source.json +353 -0
  77. package/lib/stories/summary/summary.stories.js +37 -0
  78. package/lib/stories/utils/orchestrator.js +21 -6
  79. package/lib/use-lunatic/commons/check-pager.js +1 -2
  80. package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +14 -12
  81. package/lib/use-lunatic/commons/page-navigation.js +109 -0
  82. package/lib/use-lunatic/commons/page-navigation.spec.js +129 -0
  83. package/lib/use-lunatic/commons/page.js +44 -0
  84. package/lib/use-lunatic/reducer/commons/auto-explore-loop.js +37 -0
  85. package/lib/use-lunatic/reducer/commons/index.js +0 -8
  86. package/lib/use-lunatic/reducer/reduce-go-next-page.js +25 -159
  87. package/lib/use-lunatic/reducer/reduce-go-previous-page.js +21 -127
  88. package/lib/use-lunatic/reducer/reduce-go-to-page.js +51 -55
  89. package/lib/use-lunatic/reducer/reduce-on-init.js +8 -10
  90. package/lib/use-lunatic/reducer/resolve-component-controls/resolve-roundabout-control.js +1 -1
  91. package/lib/use-lunatic/reducer/resolve-component-controls/resolve-simple-control.js +1 -1
  92. package/lib/use-lunatic/type-source.js +0 -2
  93. package/lib/use-lunatic/use-lunatic.js +22 -4
  94. package/lib/use-lunatic/use-lunatic.test.js +9 -7
  95. package/lib/utils/store-tools/auto-load.js +2 -2
  96. package/lib/utils/store-tools/worker-path.js +13 -0
  97. package/lib/utils/suggester-workers/append-to-index/create-append-task.js +2 -2
  98. package/package.json +3 -4
  99. package/lib/components/button/__snapshots__/lunatic-button.spec.jsx.snap +0 -80
  100. package/lib/components/commons/components/combo-box/selection/__snapshots__/selection.spec.jsx.snap +0 -81
  101. package/lib/src/use-lunatic/reducer/commons/is-empty-on-empty-page.d.ts +0 -3
  102. package/lib/src/use-lunatic/reducer/reduce-roundabout.d.ts +0 -2
  103. package/lib/use-lunatic/reducer/commons/is-empty-on-empty-page.js +0 -32
@@ -1,7 +1,5 @@
1
1
  /**
2
2
  * Types used for source data (lunatic models and data.json)
3
- *
4
- * These types should not be used outside of use-lunatic
5
3
  */
6
4
  export type LabelType = {
7
5
  value: string;
@@ -29,7 +27,7 @@ export type DeclarationType = {
29
27
  label: LabelType;
30
28
  };
31
29
  export type ConditionFilterType = LabelType & {
32
- bindingDependencies: string[];
30
+ bindingDependencies?: string[];
33
31
  };
34
32
  export declare enum Criticality {
35
33
  INFO = "INFO",
@@ -68,20 +66,24 @@ export type Hierarchy = {
68
66
  };
69
67
  export type ComponentTypeBase = {
70
68
  label: LabelType;
71
- declarations: DeclarationType[];
69
+ declarations?: DeclarationType[];
72
70
  conditionFilter: ConditionFilterType;
73
71
  controls?: ControlType[];
74
72
  id: string;
75
- storeName: string;
76
- bindingDependencies: string[];
73
+ bindingDependencies?: string[];
77
74
  hierarchy: Hierarchy;
78
- missingResponse: ResponseType;
79
75
  mandatory?: boolean;
80
76
  page: string;
81
77
  };
82
- export type ComponentType = (ComponentTypeBase & ComponentSequenceType) | (ComponentTypeBase & ComponentSubSequenceType) | (ComponentTypeBase & ComponentRosterForLoopType) | (ComponentTypeBase & ComponentLoopType) | (ComponentTypeBase & ComponentTableType) | (ComponentTypeBase & ComponentNumberType) | (ComponentTypeBase & ComponentDatePickerType) | (ComponentTypeBase & ComponentCheckboxGroupType) | (ComponentTypeBase & ComponentCheckboxBooleanType) | (ComponentTypeBase & ComponentRadioType) | (ComponentTypeBase & ComponentFilterDescriptionType) | (ComponentTypeBase & ComponentDropdownType) | (ComponentTypeBase & ComponentPairWiseLinksType) | (ComponentTypeBase & ComponentRoundaboutType) | (ComponentTypeBase & {
83
- componentType: 'Input' | 'CheckboxOne' | 'Textarea';
84
- }) | (ComponentTypeBase & ComponentComponentSet);
78
+ export type ComponentType = (ComponentTypeBase & ComponentSequenceType) | (ComponentTypeBase & ComponentSubSequenceType) | (ComponentTypeBase & ComponentRosterForLoopType) | (ComponentTypeBase & ComponentLoopType) | (ComponentTypeBase & ComponentTableType) | (ComponentTypeBase & ComponentNumberType) | (ComponentTypeBase & ComponentDatePickerType) | (ComponentTypeBase & ComponentCheckboxGroupType) | (ComponentTypeBase & ComponentCheckboxBooleanType) | (ComponentTypeBase & ComponentRadioType) | (ComponentTypeBase & ComponentFilterDescriptionType) | (ComponentTypeBase & ComponentDropdownType) | (ComponentTypeBase & ComponentPairWiseLinksType) | (ComponentTypeBase & ComponentRoundaboutType) | (ComponentTypeBase & ComponentSuggesterType) | (ComponentTypeBase & ComponentInputOrTextareaType) | (ComponentTypeBase & {
79
+ componentType: 'CheckboxOne';
80
+ }) | (ComponentTypeBase & ComponentComponentSetType) | (ComponentTypeBase & ComponentQuestionExplicationType);
81
+ export type ComponentInputOrTextareaType = {
82
+ componentType: 'Input' | 'Textarea';
83
+ maxLength: number;
84
+ missingResponse?: ResponseType;
85
+ response: ResponseType;
86
+ };
85
87
  export type ComponentSequenceType = {
86
88
  componentType: 'Sequence';
87
89
  };
@@ -182,6 +184,7 @@ export type ComponentCheckboxGroupType = {
182
184
  export type ComponentCheckboxBooleanType = {
183
185
  componentType: 'CheckboxBoolean';
184
186
  response: ResponseType;
187
+ missingResponse?: ResponseType;
185
188
  };
186
189
  export type ComponentRadioType = {
187
190
  componentType: 'Radio';
@@ -190,6 +193,7 @@ export type ComponentRadioType = {
190
193
  label: LabelType;
191
194
  }[];
192
195
  response: ResponseType;
196
+ missingResponse?: ResponseType;
193
197
  };
194
198
  export type ComponentDropdownType = {
195
199
  componentType: 'Dropdown';
@@ -198,6 +202,7 @@ export type ComponentDropdownType = {
198
202
  label: LabelType;
199
203
  }[];
200
204
  response: ResponseType;
205
+ missingResponse?: ResponseType;
201
206
  };
202
207
  export type ComponentFilterDescriptionType = {
203
208
  componentType: 'FilterDescription';
@@ -211,10 +216,14 @@ export type ComponentPairWiseLinksType = {
211
216
  [variableName: string]: Record<string, string>;
212
217
  };
213
218
  };
214
- export type ComponentComponentSet = {
219
+ export type ComponentComponentSetType = {
215
220
  componentType: 'ComponentSet';
216
221
  components: ComponentType[];
217
222
  };
223
+ export type ComponentSuggesterType = {
224
+ componentType: 'Suggester';
225
+ storeName: string;
226
+ };
218
227
  export type SuggesterType = {
219
228
  name: string;
220
229
  fields: {
@@ -269,12 +278,12 @@ export type LunaticSource = {
269
278
  lunaticModelVersion?: string;
270
279
  generatingDate?: string;
271
280
  missing?: boolean;
272
- pagination?: boolean;
281
+ pagination?: 'question' | 'sequence' | 'subsequence';
273
282
  maxPage: string;
274
283
  label: LabelType;
275
284
  components: ComponentType[];
276
285
  variables: Variable[];
277
- suggesters: SuggesterType[];
286
+ suggesters?: SuggesterType[];
278
287
  cleaning: {
279
288
  [variableName: string]: {
280
289
  [variableName: string]: string;
@@ -290,3 +299,8 @@ export type LunaticSource = {
290
299
  };
291
300
  };
292
301
  };
302
+ export type ComponentQuestionExplicationType = {
303
+ componentType: 'QuestionExplication';
304
+ description: string;
305
+ bgColor?: string;
306
+ };
@@ -9,11 +9,9 @@ export type LunaticControl = ControlType;
9
9
  export type VTLBindings = {
10
10
  [variableName: string]: unknown;
11
11
  };
12
- export type LunaticData = {
13
- CALCULATED: Record<string, unknown>;
14
- EXTERNAL: Record<string, unknown>;
12
+ export type LunaticData = Partial<Record<Exclude<VariableType, 'COLLECTED'>, Record<string, unknown>> & {
15
13
  COLLECTED: Record<string, LunaticCollectedValue>;
16
- };
14
+ }>;
17
15
  export type LunaticValues = {
18
16
  [variableName: string]: unknown;
19
17
  };
@@ -46,7 +44,7 @@ export type LunaticOverviewItem = {
46
44
  parent?: unknown;
47
45
  label: LunaticExpression;
48
46
  conditionFilter?: {
49
- bindingDependencies: string[];
47
+ bindingDependencies?: string[];
50
48
  };
51
49
  children: LunaticOverviewItem[];
52
50
  };
@@ -82,7 +80,7 @@ export type LunaticState = {
82
80
  isInLoop: boolean;
83
81
  isFirstPage: boolean;
84
82
  isLastPage: boolean;
85
- features: 'VTL'[];
83
+ features: ['VTL'] | ['VTL', 'MD'];
86
84
  preferences: ['COLLECTED'];
87
85
  savingType: 'COLLECTED';
88
86
  cleaning: LunaticSource['cleaning'];
@@ -108,9 +106,6 @@ export type LunaticState = {
108
106
  nbIterations?: number;
109
107
  shallowIteration?: number;
110
108
  linksIterations?: number[];
111
- roundabout?: {
112
- page: string;
113
- };
114
109
  };
115
110
  waiting: boolean;
116
111
  errors?: {
@@ -140,9 +135,6 @@ export type LunaticState = {
140
135
  iteration?: number;
141
136
  nbIterations?: number;
142
137
  subPage?: number;
143
- roundabout?: {
144
- page: string;
145
- };
146
138
  }) => void;
147
139
  getSuggesterStatus: (name: string) => {
148
140
  status: SuggesterStatus;
@@ -1,15 +1,19 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { LunaticData, LunaticState } from './type';
2
+ import { LunaticState } from './type';
3
3
  import { LunaticSource } from './type-source';
4
+ import { LunaticComponentType } from '../components/type';
4
5
  declare const nothing: LunaticState['handleChange'];
5
- declare function useLunatic(source: LunaticSource, data: LunaticData | undefined, { features, preferences, savingType, onChange, management, shortcut, initialPage, autoSuggesterLoading, activeControls, getReferentiel, custom, withOverview, missing, missingStrategy, missingShortcut, dontKnowButton, refusedButton, }: {
6
- features?: string[];
7
- preferences?: string[];
8
- savingType?: string;
6
+ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNAL" | "CALCULATED", Record<string, unknown>> & {
7
+ COLLECTED: Record<string, import("./type").LunaticCollectedValue>;
8
+ }> | undefined, { features, preferences, savingType, onChange, management, shortcut, initialPage, lastReachedPage, autoSuggesterLoading, activeControls, getReferentiel, custom, withOverview, missing, missingStrategy, missingShortcut, dontKnowButton, refusedButton, }: {
9
+ features?: LunaticState['features'];
10
+ preferences?: LunaticState['preferences'];
11
+ savingType?: LunaticState['savingType'];
9
12
  onChange?: typeof nothing;
10
13
  management?: boolean;
11
14
  shortcut?: boolean;
12
15
  initialPage?: string;
16
+ lastReachedPage?: string;
13
17
  autoSuggesterLoading?: boolean;
14
18
  getReferentiel?: (name: string) => Promise<Array<unknown>>;
15
19
  activeControls?: boolean;
@@ -24,10 +28,474 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
24
28
  dontKnowButton?: string;
25
29
  refusedButton?: string;
26
30
  }): {
27
- getComponents: () => import("./commons/fill-components/fill-components").LunaticComponentProps<"Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "ComponentSet" | "Roundabout">[];
31
+ getComponents: ({ only, except, }?: {
32
+ only?: (keyof {
33
+ InputNumber: import("../components/type").LunaticBaseProps<number | null> & {
34
+ min: number;
35
+ max: number;
36
+ decimals: number;
37
+ unit?: string | undefined;
38
+ response: {
39
+ name: string;
40
+ };
41
+ };
42
+ Input: import("../components/type").LunaticBaseProps<string> & {
43
+ maxLength?: number | undefined;
44
+ value: string | null;
45
+ response: {
46
+ name: string;
47
+ };
48
+ };
49
+ Sequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "style" | "id" | "declarations">;
50
+ Subsequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "id" | "declarations">;
51
+ Question: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "description">;
52
+ ComponentSet: import("../components/type").LunaticBaseProps<unknown> & {
53
+ components: import("./type").LunaticComponentDefinition[];
54
+ value: Record<string, unknown>;
55
+ response: undefined;
56
+ };
57
+ RosterForLoop: import("../components/type").LunaticBaseProps<unknown> & {
58
+ lines: {
59
+ min: number;
60
+ max: number;
61
+ };
62
+ iterations?: number | undefined;
63
+ components: import("./type").LunaticComponentDefinition[];
64
+ executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
65
+ iteration?: number | undefined;
66
+ linksIterations?: number[] | undefined;
67
+ logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
68
+ bindingDependencies?: string[] | undefined;
69
+ } | undefined) => T;
70
+ value: Record<string, unknown[]>;
71
+ headers?: {
72
+ label: import("react").ReactNode;
73
+ }[] | undefined;
74
+ paginatedLoop?: boolean | undefined;
75
+ };
76
+ Loop: import("../components/type").LunaticBaseProps<unknown> & {
77
+ lines: {
78
+ min: number;
79
+ max: number;
80
+ };
81
+ iterations?: number | undefined;
82
+ components: import("./type").LunaticComponentDefinition[];
83
+ executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
84
+ iteration?: number | undefined;
85
+ linksIterations?: number[] | undefined;
86
+ logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
87
+ bindingDependencies?: string[] | undefined;
88
+ } | undefined) => T;
89
+ value: Record<string, unknown[]>;
90
+ headers?: {
91
+ label: import("react").ReactNode;
92
+ }[] | undefined;
93
+ paginatedLoop?: boolean | undefined;
94
+ };
95
+ Table: import("../components/type").LunaticBaseProps<unknown> & {
96
+ value: Record<string, unknown>;
97
+ header: {
98
+ label: import("react").ReactNode;
99
+ rowspan?: number | undefined;
100
+ colspan?: number | undefined;
101
+ }[];
102
+ body: {
103
+ label: import("./type").LunaticExpression;
104
+ }[][];
105
+ executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
106
+ iteration?: number | undefined;
107
+ linksIterations?: number[] | undefined;
108
+ logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
109
+ bindingDependencies?: string[] | undefined;
110
+ } | undefined) => T;
111
+ iteration: number | undefined;
112
+ };
113
+ Datepicker: import("../components/type").LunaticBaseProps<string | null> & {
114
+ min?: string | undefined;
115
+ max?: string | undefined;
116
+ response: {
117
+ name: string;
118
+ };
119
+ };
120
+ CheckboxGroup: import("../components/type").LunaticBaseProps<Record<string, boolean | null>> & {
121
+ responses: {
122
+ id: string;
123
+ label: import("react").ReactNode;
124
+ description?: import("react").ReactNode;
125
+ response: {
126
+ name: string;
127
+ };
128
+ }[];
129
+ handleChange: (response: {
130
+ name: string;
131
+ }, value: boolean, args?: Record<string, unknown> | undefined) => void;
132
+ };
133
+ CheckboxOne: import("../components/type").LunaticBaseProps<string | null> & {
134
+ options: {
135
+ description: import("react").ReactNode;
136
+ label: import("react").ReactNode;
137
+ value: string;
138
+ }[];
139
+ response: {
140
+ name: string;
141
+ };
142
+ };
143
+ Switch: import("../components/type").LunaticBaseProps<boolean> & {
144
+ response: {
145
+ name: string;
146
+ };
147
+ statusLabel?: {
148
+ true: string;
149
+ false: string;
150
+ } | undefined;
151
+ };
152
+ CheckboxBoolean: import("../components/type").LunaticBaseProps<boolean> & {
153
+ options: {
154
+ description: import("react").ReactNode;
155
+ label: import("react").ReactNode;
156
+ value: string;
157
+ }[];
158
+ response: {
159
+ name: string;
160
+ };
161
+ };
162
+ Radio: import("../components/type").LunaticBaseProps<string | null> & {
163
+ options: {
164
+ description: import("react").ReactNode;
165
+ label: import("react").ReactNode;
166
+ value: string;
167
+ }[];
168
+ checkboxStyle?: boolean | undefined;
169
+ response: {
170
+ name: string;
171
+ };
172
+ };
173
+ Roundabout: import("../components/type").LunaticBaseProps<string> & {
174
+ iterations: number;
175
+ goToPage: (page: {
176
+ page: string;
177
+ iteration?: number | undefined;
178
+ nbIterations?: number | undefined;
179
+ subPage?: number | undefined;
180
+ }) => void;
181
+ page: string;
182
+ locked?: boolean | undefined;
183
+ expressions: {
184
+ unnecessary?: boolean[] | undefined;
185
+ complete?: boolean[] | undefined;
186
+ partial?: boolean[] | undefined;
187
+ label?: string[] | undefined;
188
+ };
189
+ };
190
+ Dropdown: import("../components/type").LunaticBaseProps<string | null> & {
191
+ options: {
192
+ description: import("react").ReactNode;
193
+ label: import("react").ReactNode;
194
+ value: string;
195
+ }[];
196
+ response: {
197
+ name: string;
198
+ };
199
+ writable?: boolean | undefined;
200
+ };
201
+ Textarea: import("../components/type").LunaticBaseProps<string> & {
202
+ cols?: number | undefined;
203
+ placeHolder?: string | undefined;
204
+ maxLength?: number | undefined;
205
+ rows?: number | undefined;
206
+ response: {
207
+ name: string;
208
+ };
209
+ };
210
+ FilterDescription: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "id">;
211
+ QuestionExplication: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "id" | "description"> & {
212
+ bgColor?: string | undefined;
213
+ };
214
+ PairwiseLinks: Omit<import("../components/type").LunaticBaseProps<unknown>, "value"> & {
215
+ components: import("./type").LunaticComponentDefinition[];
216
+ features?: ["VTL"] | ["VTL", "MD"] | undefined;
217
+ executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
218
+ iteration?: number | undefined;
219
+ linksIterations?: number[] | undefined;
220
+ logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
221
+ bindingDependencies?: string[] | undefined;
222
+ } | undefined) => T;
223
+ xAxisIterations: number;
224
+ yAxisIterations: number;
225
+ symLinks: Record<string, Record<string, string>>;
226
+ value: Record<string, unknown[]>;
227
+ };
228
+ Suggester: import("../components/type").LunaticBaseProps<string | null> & {
229
+ storeName: string;
230
+ getSuggesterStatus: (name: string) => {
231
+ status: import("./use-suggesters").SuggesterStatus;
232
+ timestamp: number;
233
+ };
234
+ optionRenderer: FunctionComponent<{
235
+ option: import("../components/type").SuggesterOption;
236
+ placeholder?: string | undefined;
237
+ search?: string | undefined;
238
+ }>;
239
+ labelRenderer: FunctionComponent<{
240
+ option?: import("../components/type").SuggesterOption | undefined;
241
+ selected?: boolean | undefined;
242
+ search?: string | undefined;
243
+ }>;
244
+ idbVersion?: string | undefined;
245
+ focused: boolean;
246
+ response: {
247
+ name: string;
248
+ };
249
+ };
250
+ Summary: import("../components/type").LunaticBaseProps<string | null> & {
251
+ sections: {
252
+ responses?: {
253
+ label: import("../components/type").VtlExpression;
254
+ value: import("../components/type").VtlExpression;
255
+ }[] | undefined;
256
+ title?: import("../components/type").VtlExpression | undefined;
257
+ iterations?: number | undefined;
258
+ }[];
259
+ };
260
+ })[] | undefined;
261
+ except?: (keyof {
262
+ InputNumber: import("../components/type").LunaticBaseProps<number | null> & {
263
+ min: number;
264
+ max: number;
265
+ decimals: number;
266
+ unit?: string | undefined;
267
+ response: {
268
+ name: string;
269
+ };
270
+ };
271
+ Input: import("../components/type").LunaticBaseProps<string> & {
272
+ maxLength?: number | undefined;
273
+ value: string | null;
274
+ response: {
275
+ name: string;
276
+ };
277
+ };
278
+ Sequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "style" | "id" | "declarations">;
279
+ Subsequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "id" | "declarations">;
280
+ Question: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "description">;
281
+ ComponentSet: import("../components/type").LunaticBaseProps<unknown> & {
282
+ components: import("./type").LunaticComponentDefinition[];
283
+ value: Record<string, unknown>;
284
+ response: undefined;
285
+ };
286
+ RosterForLoop: import("../components/type").LunaticBaseProps<unknown> & {
287
+ lines: {
288
+ min: number;
289
+ max: number;
290
+ };
291
+ iterations?: number | undefined;
292
+ components: import("./type").LunaticComponentDefinition[];
293
+ executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
294
+ iteration?: number | undefined;
295
+ linksIterations?: number[] | undefined;
296
+ logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
297
+ bindingDependencies?: string[] | undefined;
298
+ } | undefined) => T;
299
+ value: Record<string, unknown[]>;
300
+ headers?: {
301
+ label: import("react").ReactNode;
302
+ }[] | undefined;
303
+ paginatedLoop?: boolean | undefined;
304
+ };
305
+ Loop: import("../components/type").LunaticBaseProps<unknown> & {
306
+ lines: {
307
+ min: number;
308
+ max: number;
309
+ };
310
+ iterations?: number | undefined;
311
+ components: import("./type").LunaticComponentDefinition[];
312
+ executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
313
+ iteration?: number | undefined;
314
+ linksIterations?: number[] | undefined;
315
+ logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
316
+ bindingDependencies?: string[] | undefined;
317
+ } | undefined) => T;
318
+ value: Record<string, unknown[]>;
319
+ headers?: {
320
+ label: import("react").ReactNode;
321
+ }[] | undefined;
322
+ paginatedLoop?: boolean | undefined;
323
+ };
324
+ Table: import("../components/type").LunaticBaseProps<unknown> & {
325
+ value: Record<string, unknown>;
326
+ header: {
327
+ label: import("react").ReactNode;
328
+ rowspan?: number | undefined;
329
+ colspan?: number | undefined;
330
+ }[];
331
+ body: {
332
+ label: import("./type").LunaticExpression;
333
+ }[][];
334
+ executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
335
+ iteration?: number | undefined;
336
+ linksIterations?: number[] | undefined;
337
+ logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
338
+ bindingDependencies?: string[] | undefined;
339
+ } | undefined) => T;
340
+ iteration: number | undefined;
341
+ };
342
+ Datepicker: import("../components/type").LunaticBaseProps<string | null> & {
343
+ min?: string | undefined;
344
+ max?: string | undefined;
345
+ response: {
346
+ name: string;
347
+ };
348
+ };
349
+ CheckboxGroup: import("../components/type").LunaticBaseProps<Record<string, boolean | null>> & {
350
+ responses: {
351
+ id: string;
352
+ label: import("react").ReactNode;
353
+ description?: import("react").ReactNode;
354
+ response: {
355
+ name: string;
356
+ };
357
+ }[];
358
+ handleChange: (response: {
359
+ name: string;
360
+ }, value: boolean, args?: Record<string, unknown> | undefined) => void;
361
+ };
362
+ CheckboxOne: import("../components/type").LunaticBaseProps<string | null> & {
363
+ options: {
364
+ description: import("react").ReactNode;
365
+ label: import("react").ReactNode;
366
+ value: string;
367
+ }[];
368
+ response: {
369
+ name: string;
370
+ };
371
+ };
372
+ Switch: import("../components/type").LunaticBaseProps<boolean> & {
373
+ response: {
374
+ name: string;
375
+ };
376
+ statusLabel?: {
377
+ true: string;
378
+ false: string;
379
+ } | undefined;
380
+ };
381
+ CheckboxBoolean: import("../components/type").LunaticBaseProps<boolean> & {
382
+ options: {
383
+ description: import("react").ReactNode;
384
+ label: import("react").ReactNode;
385
+ value: string;
386
+ }[];
387
+ response: {
388
+ name: string;
389
+ };
390
+ };
391
+ Radio: import("../components/type").LunaticBaseProps<string | null> & {
392
+ options: {
393
+ description: import("react").ReactNode;
394
+ label: import("react").ReactNode;
395
+ value: string;
396
+ }[];
397
+ checkboxStyle?: boolean | undefined;
398
+ response: {
399
+ name: string;
400
+ };
401
+ };
402
+ Roundabout: import("../components/type").LunaticBaseProps<string> & {
403
+ iterations: number;
404
+ goToPage: (page: {
405
+ page: string;
406
+ iteration?: number | undefined;
407
+ nbIterations?: number | undefined;
408
+ subPage?: number | undefined;
409
+ }) => void;
410
+ page: string;
411
+ locked?: boolean | undefined;
412
+ expressions: {
413
+ unnecessary?: boolean[] | undefined;
414
+ complete?: boolean[] | undefined;
415
+ partial?: boolean[] | undefined;
416
+ label?: string[] | undefined;
417
+ };
418
+ };
419
+ Dropdown: import("../components/type").LunaticBaseProps<string | null> & {
420
+ options: {
421
+ description: import("react").ReactNode;
422
+ label: import("react").ReactNode;
423
+ value: string;
424
+ }[];
425
+ response: {
426
+ name: string;
427
+ };
428
+ writable?: boolean | undefined;
429
+ };
430
+ Textarea: import("../components/type").LunaticBaseProps<string> & {
431
+ cols?: number | undefined;
432
+ placeHolder?: string | undefined;
433
+ maxLength?: number | undefined;
434
+ rows?: number | undefined;
435
+ response: {
436
+ name: string;
437
+ };
438
+ };
439
+ FilterDescription: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "id">;
440
+ QuestionExplication: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "id" | "description"> & {
441
+ bgColor?: string | undefined;
442
+ };
443
+ PairwiseLinks: Omit<import("../components/type").LunaticBaseProps<unknown>, "value"> & {
444
+ components: import("./type").LunaticComponentDefinition[];
445
+ features?: ["VTL"] | ["VTL", "MD"] | undefined;
446
+ executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
447
+ iteration?: number | undefined;
448
+ linksIterations?: number[] | undefined;
449
+ logging?: import("./commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
450
+ bindingDependencies?: string[] | undefined;
451
+ } | undefined) => T;
452
+ xAxisIterations: number;
453
+ yAxisIterations: number;
454
+ symLinks: Record<string, Record<string, string>>;
455
+ value: Record<string, unknown[]>;
456
+ };
457
+ Suggester: import("../components/type").LunaticBaseProps<string | null> & {
458
+ storeName: string;
459
+ getSuggesterStatus: (name: string) => {
460
+ status: import("./use-suggesters").SuggesterStatus;
461
+ timestamp: number;
462
+ };
463
+ optionRenderer: FunctionComponent<{
464
+ option: import("../components/type").SuggesterOption;
465
+ placeholder?: string | undefined;
466
+ search?: string | undefined;
467
+ }>;
468
+ labelRenderer: FunctionComponent<{
469
+ option?: import("../components/type").SuggesterOption | undefined;
470
+ selected?: boolean | undefined;
471
+ search?: string | undefined;
472
+ }>;
473
+ idbVersion?: string | undefined;
474
+ focused: boolean;
475
+ response: {
476
+ name: string;
477
+ };
478
+ };
479
+ Summary: import("../components/type").LunaticBaseProps<string | null> & {
480
+ sections: {
481
+ responses?: {
482
+ label: import("../components/type").VtlExpression;
483
+ value: import("../components/type").VtlExpression;
484
+ }[] | undefined;
485
+ title?: import("../components/type").VtlExpression | undefined;
486
+ iterations?: number | undefined;
487
+ }[];
488
+ };
489
+ })[] | undefined;
490
+ }) => import("./commons/fill-components/fill-components").LunaticComponentProps<"Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ComponentSet" | "Roundabout" | "QuestionExplication">[];
28
491
  goPreviousPage: () => void;
29
492
  goNextPage: (payload?: {}) => void;
30
- goToPage: (payload?: {}) => void;
493
+ goToPage: (page: {
494
+ page: string;
495
+ iteration?: number | undefined;
496
+ nbIterations?: number | undefined;
497
+ subPage?: number | undefined;
498
+ }) => void;
31
499
  compileControls: () => {
32
500
  currentErrors: Record<string, import("./type").LunaticError[]> | undefined;
33
501
  isCritical: boolean;
@@ -45,9 +513,6 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
45
513
  nbIterations?: number | undefined;
46
514
  shallowIteration?: number | undefined;
47
515
  linksIterations?: number[] | undefined;
48
- roundabout?: {
49
- page: string;
50
- } | undefined;
51
516
  };
52
517
  waiting: boolean;
53
518
  getData: (withRefreshedCalculated: boolean) => {
@@ -0,0 +1 @@
1
+ export declare function getWorkerPath(): string;