@inseefr/lunatic 2.4.10 → 2.5.0-beta

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