@inseefr/lunatic 3.0.0-rc.1 → 3.0.0-rc.6

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 (104) hide show
  1. package/lib/components/CheckboxBoolean/CheckboxBoolean.js +39 -19
  2. package/lib/components/CheckboxGroup/CustomCheckboxGroup.js +2 -2
  3. package/lib/components/CheckboxOne/CheckboxOne.js +6 -6
  4. package/lib/components/Datepicker/Datepicker.js +43 -28
  5. package/lib/components/Dropdown/Dropdown.js +40 -23
  6. package/lib/components/Duration/Duration.js +41 -16
  7. package/lib/components/FilterDescription/FilterDescription.js +2 -3
  8. package/lib/components/Input/Input.js +39 -21
  9. package/lib/components/InputNumber/InputNumber.js +45 -34
  10. package/lib/components/InputNumber/__snapshots__/InputNumber.spec.tsx.snap +0 -2
  11. package/lib/components/Loop/Loop.js +52 -29
  12. package/lib/components/LunaticComponents.js +42 -37
  13. package/lib/components/Question/Question.js +23 -14
  14. package/lib/components/Radio/Radio.js +2 -2
  15. package/lib/components/RosterForLoop/RosterForLoop.js +13 -35
  16. package/lib/components/Roundabout/CustomRoundabout.js +2 -2
  17. package/lib/components/Roundabout/RoundaboutItButton.js +2 -2
  18. package/lib/components/Roundabout/extra.js +6 -6
  19. package/lib/components/Sequence/Sequence.js +2 -2
  20. package/lib/components/Subsequence/Subsequence.js +2 -2
  21. package/lib/components/Suggester/CustomSuggester.js +2 -2
  22. package/lib/components/Suggester/SuggesterNotification.js +2 -2
  23. package/lib/components/Summary/Summary.js +3 -3
  24. package/lib/components/Switch/Switch.js +42 -22
  25. package/lib/components/Textarea/Textarea.js +43 -23
  26. package/lib/components/library.js +0 -2
  27. package/lib/components/shared/Button/Button.js +2 -2
  28. package/lib/components/shared/Checkbox/CheckboxOption.js +2 -2
  29. package/lib/components/shared/Combobox/Combobox.js +2 -2
  30. package/lib/components/shared/Combobox/ComboboxContainer.js +2 -2
  31. package/lib/components/shared/Combobox/ComboboxContentBox.js +2 -2
  32. package/lib/components/shared/Combobox/Panel/ComboboxOption.js +2 -2
  33. package/lib/components/shared/Combobox/Panel/ComboboxPanelContainer.js +2 -2
  34. package/lib/components/shared/Combobox/Selection/ComboboxClearButton.js +2 -2
  35. package/lib/components/shared/Combobox/Selection/ComboboxInput.js +2 -2
  36. package/lib/components/shared/Combobox/Selection/ComboboxLabelSelection.js +2 -2
  37. package/lib/components/shared/Declarations/Declarations.js +3 -3
  38. package/lib/components/shared/Fieldset/Fieldset.js +2 -2
  39. package/lib/components/shared/HOC/{customizedComponent.js → slottableComponent.js} +35 -13
  40. package/lib/components/shared/Label/Label.js +2 -2
  41. package/lib/components/shared/MDLabel/RouterLink.js +2 -2
  42. package/lib/components/shared/Notification.js +2 -2
  43. package/lib/components/shared/Radio/RadioGroup.js +4 -3
  44. package/lib/components/shared/Radio/RadioOption.js +2 -2
  45. package/lib/components/shared/Table/Table.js +2 -2
  46. package/lib/components/shared/Table/Tbody.js +2 -2
  47. package/lib/components/shared/Table/Td.js +2 -2
  48. package/lib/components/shared/Table/Th.js +2 -2
  49. package/lib/components/shared/Table/Thead.js +2 -2
  50. package/lib/components/shared/Table/Tr.js +2 -2
  51. package/lib/src/components/CheckboxBoolean/CheckboxBoolean.d.ts +10 -5
  52. package/lib/src/components/CheckboxOne/CheckboxOne.d.ts +5 -11
  53. package/lib/src/components/Datepicker/Datepicker.d.ts +8 -9
  54. package/lib/src/components/Dropdown/Dropdown.d.ts +9 -11
  55. package/lib/src/components/Duration/Duration.d.ts +9 -6
  56. package/lib/src/components/FilterDescription/FilterDescription.d.ts +1 -1
  57. package/lib/src/components/Input/Input.d.ts +9 -7
  58. package/lib/src/components/InputNumber/InputNumber.d.ts +9 -9
  59. package/lib/src/components/Loop/Loop.d.ts +11 -18
  60. package/lib/src/components/LunaticComponents.d.ts +4 -2
  61. package/lib/src/components/Question/Question.d.ts +6 -4
  62. package/lib/src/components/RosterForLoop/RosterForLoop.d.ts +2 -21
  63. package/lib/src/components/Switch/Switch.d.ts +9 -0
  64. package/lib/src/components/Textarea/Textarea.d.ts +9 -9
  65. package/lib/src/components/library.d.ts +24 -91
  66. package/lib/src/components/shared/HOC/slottableComponent.d.ts +101 -0
  67. package/lib/src/components/shared/Radio/RadioGroup.d.ts +1 -0
  68. package/lib/src/components/type.d.ts +0 -5
  69. package/lib/src/index.d.ts +1 -1
  70. package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +18 -33
  71. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +0 -37
  72. package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +16 -18
  73. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +4 -52
  74. package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
  75. package/lib/src/use-lunatic/lunatic-context.d.ts +1 -4
  76. package/lib/src/use-lunatic/replace-component-sequence.d.ts +3 -3
  77. package/lib/src/use-lunatic/type-source.d.ts +1 -5
  78. package/lib/src/use-lunatic/use-lunatic.d.ts +8 -19
  79. package/lib/stories/{component-set/component-set.stories.js → behaviour/slots.stories.js} +36 -25
  80. package/lib/stories/checkbox-group/checkbox-group.stories.js +1 -6
  81. package/lib/stories/disabled/source.json +1 -1
  82. package/lib/stories/pairwise/pairwise-links.stories.js +1 -9
  83. package/lib/stories/suggester/suggester.stories.js +1 -8
  84. package/lib/stories/utils/orchestrator.js +4 -4
  85. package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +0 -1
  86. package/lib/use-lunatic/lunatic-context.js +2 -10
  87. package/lib/use-lunatic/replace-component-sequence.js +2 -3
  88. package/lib/use-lunatic/use-lunatic.js +1 -4
  89. package/lib/use-lunatic/use-lunatic.test.js +4 -30
  90. package/package.json +1 -1
  91. package/lib/components/ComponentSet/ComponentSet.js +0 -68
  92. package/lib/components/type-custom.js +0 -5
  93. package/lib/src/components/ComponentSet/ComponentSet.d.ts +0 -7
  94. package/lib/src/components/shared/HOC/customizedComponent.d.ts +0 -5
  95. package/lib/src/components/type-custom.d.ts +0 -101
  96. package/lib/stories/checkbox-group/sourceComponentset.json +0 -424
  97. package/lib/stories/component-set/data-loop.json +0 -18
  98. package/lib/stories/component-set/data-roundabout.json +0 -25
  99. package/lib/stories/component-set/data.json +0 -25
  100. package/lib/stories/component-set/source-loop.json +0 -308
  101. package/lib/stories/component-set/source-roundabout.json +0 -434
  102. package/lib/stories/component-set/source.json +0 -113
  103. package/lib/stories/pairwise/source-componentset.json +0 -292
  104. package/lib/stories/suggester/source-component-set.json +0 -113
@@ -1,292 +0,0 @@
1
- {
2
- "maxPage": "5",
3
- "components": [
4
- {
5
- "id": "seq",
6
- "componentType": "Sequence",
7
- "label": {
8
- "value": "\"Description des individus de votre logement\"",
9
- "type": "VTL|MD"
10
- },
11
- "conditionFilter": { "value": "true", "type": "VTL" },
12
- "page": "1"
13
- },
14
- {
15
- "id": "loop-prenom",
16
- "componentType": "RosterForLoop",
17
- "label": { "value": "\"Ajouter un individu\"", "type": "VTL|MD" },
18
- "conditionFilter": { "value": "true", "type": "VTL" },
19
- "bindingDependencies": ["PRENOM"],
20
-
21
- "lines": {
22
- "min": { "value": 1, "type": "VTL" },
23
- "max": { "value": "10", "type": "VTL" }
24
- },
25
- "page": "1",
26
- "components": [
27
- {
28
- "componentType": "Input",
29
- "label": { "value": "\"Prénom\"", "type": "VTL|MD" },
30
- "conditionFilter": { "value": "true", "type": "VTL" },
31
- "maxLength": 30,
32
- "bindingDependencies": ["PRENOM"],
33
- "id": "prenom",
34
- "response": {
35
- "name": "PRENOM"
36
- }
37
- }
38
- ]
39
- },
40
- {
41
- "id": "age-loop",
42
- "componentType": "Loop",
43
- "paginatedLoop": true,
44
- "iterations": { "value": "count(PRENOM)", "type": "VTL" },
45
- "page": "2",
46
- "maxPage": "1",
47
- "conditionFilter": { "value": "true", "type": "VTL" },
48
- "loopDependencies": ["PRENOM"],
49
- "components": [
50
- {
51
- "id": "age-quest",
52
- "label": { "value": "\"Âge de \" || PRENOM", "type": "VTL|MD" },
53
- "conditionFilter": { "type": "VTL", "value": "true" },
54
- "componentType": "InputNumber",
55
- "page": "2.1",
56
- "response": { "name": "AGE" }
57
- }
58
- ]
59
- },
60
-
61
- {
62
- "id": "component-set",
63
- "componentType": "ComponentSet",
64
- "page": "3",
65
- "conditionFilter": { "value": "true", "type": "VTL" },
66
- "label": {
67
- "value": "\"## Who are you?\"",
68
- "type": "VTL|MD"
69
- },
70
- "description": {
71
- "value": "\"This is your opportunity to tell me about yourself!\"",
72
- "type": "VTL|MD"
73
- },
74
- "components": [
75
- {
76
- "id": "pairwise-links",
77
- "componentType": "PairwiseLinks",
78
- "conditionFilter": { "value": "true" },
79
- "xAxisIterations": { "value": "count(PRENOM)", "type": "VTL" },
80
- "yAxisIterations": { "value": "count(PRENOM)", "type": "VTL" },
81
- "symLinks": {
82
- "LINKS": {
83
- "1": "1",
84
- "2": "3",
85
- "3": "2",
86
- "4": "4",
87
- "5": "6",
88
- "6": "5",
89
- "7": "8",
90
- "8": "7",
91
- "9": "10",
92
- "10": "9",
93
- "11": "13",
94
- "12": "12",
95
- "13": "11",
96
- "14": null,
97
- "15": "15",
98
- "16": "16",
99
- "17": "17",
100
- "18": "18"
101
- }
102
- },
103
- "components": [
104
- {
105
- "componentType": "Dropdown",
106
- "id": "dropdown-1",
107
- "conditionFilter": { "value": "xAxis <> yAxis", "type": "VTL" },
108
- "label": {
109
- "value": "\"Qui est \" || yAxis || \" pour \" || xAxis || \" ?\"",
110
- "type": "VTL|MD"
111
- },
112
- "response": {
113
- "name": "LINKS"
114
- },
115
- "options": [
116
- { "value": "1", "label": "\"Son conjoint, sa conjointe\"" },
117
- { "value": "2", "label": "\"Sa mère, son père\"" },
118
- { "value": "3", "label": "\"Sa fille, son fils\"" },
119
- {
120
- "value": "4",
121
- "label": "\"Sa soeur, son frère (y compris demi et quasi)\""
122
- },
123
- {
124
- "value": "5",
125
- "label": "\"Sa belle-mère, son beau-père (conjoint.e d'un des parents)\""
126
- },
127
- {
128
- "value": "6",
129
- "label": "\"L'enfant du conjoint (belle-fille, beau-fils)\""
130
- },
131
- {
132
- "value": "7",
133
- "label": "\"Sa belle-mère, son beau-père (parent du conjoint)\""
134
- },
135
- {
136
- "value": "8",
137
- "label": "\"Sa belle-fille, son beau-fils (conjoint.e d'un enfant)\""
138
- },
139
- { "value": "9", "label": "\"Sa grand-mère, son grand-père\"" },
140
- { "value": "10", "label": "\"Sa petite-fille, petit-fils\"" },
141
- { "value": "11", "label": "\"Sa tante, son oncle\"" },
142
- { "value": "12", "label": "\"Sa cousine, son cousin\"" },
143
- { "value": "13", "label": "\"Sa nièce, son neveu\"" },
144
- {
145
- "value": "14",
146
- "label": "\"Un enfant placé en famille d'accueil\""
147
- },
148
- {
149
- "value": "15",
150
- "label": "\"Sa belle-soeur, son beau-frère\""
151
- },
152
- { "value": "16", "label": "\"Un autre lien familial\"" },
153
- {
154
- "value": "17",
155
- "label": "\"Un colocataire, sous-locataire\""
156
- },
157
- {
158
- "value": "18",
159
- "label": "\"Autre lien (employé de maison, salarié logé, jeune au pair …)\""
160
- }
161
- ]
162
- },
163
- {
164
- "componentType": "Textarea",
165
- "label": {
166
- "value": "\"Pouvez-vous décrire le lien entre \" || xAxis || \" et \" || yAxis || \" ?\"",
167
- "type": "VTL|MD"
168
- },
169
- "conditionFilter": {
170
- "value": "not(nvl(cast(LINKS, string), \"\") = \"\") and cast(LINKS, string) = \"17\"",
171
- "type": "VTL"
172
- },
173
- "id": "other",
174
- "response": {
175
- "name": "OTHER"
176
- }
177
- }
178
- ]
179
- }
180
- ]
181
- },
182
-
183
- {
184
- "id": "pariwise-block",
185
- "componentType": "Loop",
186
- "paginatedLoop": true,
187
- "iterations": { "value": "count(PRENOM)", "type": "VTL" },
188
- "page": "4",
189
- "maxPage": "1",
190
- "conditionFilter": { "value": "true", "type": "VTL" },
191
- "loopDependencies": ["PRENOM"],
192
- "components": [
193
- {
194
- "componentType": "Textarea",
195
- "page": "4.1",
196
- "label": {
197
- "value": "PRENOM || \", why do you live without your parents?\"",
198
- "type": "VTL|MD"
199
- },
200
- "conditionFilter": {
201
- "value": "\"3\" not_in LINKS and AGE < 18",
202
- "type": "VTL"
203
- },
204
- "id": "why",
205
- "response": {
206
- "name": "WHY"
207
- }
208
- }
209
- ]
210
- },
211
- { "componentType": "Sequence", "label": "\"END\"", "page": 5 }
212
- ],
213
- "variables": [
214
- {
215
- "variableType": "COLLECTED",
216
- "name": "PRENOM",
217
- "values": {
218
- "PREVIOUS": [null],
219
- "COLLECTED": [null],
220
- "FORCED": [null],
221
- "EDITED": [null],
222
- "INPUTED": [null]
223
- }
224
- },
225
- {
226
- "variableType": "COLLECTED",
227
- "name": "AGE",
228
- "values": {
229
- "PREVIOUS": [null],
230
- "COLLECTED": [null],
231
- "FORCED": [null],
232
- "EDITED": [null],
233
- "INPUTED": [null]
234
- }
235
- },
236
- {
237
- "variableType": "COLLECTED",
238
- "name": "LINKS",
239
- "values": {
240
- "PREVIOUS": [[null]],
241
- "COLLECTED": [[null]],
242
- "FORCED": [[null]],
243
- "EDITED": [[null]],
244
- "INPUTED": [[null]]
245
- }
246
- },
247
- {
248
- "variableType": "COLLECTED",
249
- "name": "OTHER",
250
- "values": {
251
- "PREVIOUS": [[null]],
252
- "COLLECTED": [[null]],
253
- "FORCED": [[null]],
254
- "EDITED": [[null]],
255
- "INPUTED": [[null]]
256
- }
257
- },
258
- {
259
- "variableType": "COLLECTED",
260
- "name": "WHY",
261
- "values": {
262
- "PREVIOUS": [null],
263
- "COLLECTED": [null],
264
- "FORCED": [null],
265
- "EDITED": [null],
266
- "INPUTED": [null]
267
- }
268
- },
269
- {
270
- "variableType": "CALCULATED",
271
- "name": "xAxis",
272
- "expression": { "value": "PRENOM", "type": "VTL" },
273
- "bindingDependencies": ["PRENOM"],
274
- "shapeFrom": "PRENOM",
275
- "inFilter": "false"
276
- },
277
- {
278
- "variableType": "CALCULATED",
279
- "name": "yAxis",
280
- "expression": { "value": "PRENOM", "type": "VTL" },
281
- "bindingDependencies": ["PRENOM"],
282
- "shapeFrom": "PRENOM",
283
- "inFilter": "false"
284
- }
285
- ],
286
- "resizing": {
287
- "PRENOM": {
288
- "sizeForLinksVariables": ["count(PRENOM)", "count(PRENOM)"],
289
- "linksVariables": ["LINKS"]
290
- }
291
- }
292
- }
@@ -1,113 +0,0 @@
1
- {
2
- "maxPage": "1",
3
- "suggesters": [
4
- {
5
- "responseNames": ["VARIABLE_ACTIVITE"],
6
- "name": "L_ACTIVITES-1-0-0",
7
- "fields": [
8
- {
9
- "name": "label",
10
- "rules": ["[\\w]+"],
11
- "language": "French",
12
- "min": 3,
13
- "stemmer": false,
14
- "synonyms": {
15
- "EHPAD": ["EPHAD", "HEPAD", "EPAD", "EPAHD", "EPADH"],
16
- "plaquisterie": ["PLACO", "PLACOPLATRE"],
17
- "pneumatiques": ["PNEUS"],
18
- "prestations": ["PRESTATAIRE"],
19
- "echafaudages": ["ECHAFFAUDAGE", "ECHAFFAUDEUR"],
20
- "URSSAF": ["URSAF", "URSAFF"],
21
- "ascenseurs": ["ASCENCEUR", "ASSENCEUR", "ACSENCEUR"],
22
- "briqueterie": ["BRIQUETTERIE"],
23
- "joaillerie": ["JOAILLIER"],
24
- "agroalimentaire": ["AGGROALIMANTAIRE", "AGROALIMANTAIRE"],
25
- "alimentaire": ["ALIMANTAIRE"],
26
- "alimentaires": ["ALIMANTAIRES"],
27
- "agroalimentaires": ["AGGROALIMANTAIRES", "AGROALIMENTAIRES"]
28
- }
29
- }
30
- ],
31
- "queryParser": {
32
- "type": "tokenized",
33
- "params": {
34
- "language": "French",
35
- "pattern": "[\\w.]+",
36
- "min": 3,
37
- "stemmer": false
38
- }
39
- },
40
- "version": "1",
41
- "stopWords": [
42
- "a",
43
- "au",
44
- "dans",
45
- "de",
46
- "des",
47
- "du",
48
- "en",
49
- "er",
50
- "la",
51
- "le",
52
- "ou",
53
- "sur",
54
- "d",
55
- "l",
56
- "aux",
57
- "dans",
58
- "un",
59
- "une",
60
- "pour",
61
- "avec",
62
- "chez",
63
- "par",
64
- "les"
65
- ]
66
- }
67
- ],
68
- "components": [
69
- {
70
- "id": "lfwg2ny2",
71
- "componentType": "ComponentSet",
72
- "page": "1",
73
- "className": "ComponentSet",
74
- "conditionFilter": {
75
- "value": "true",
76
- "type": "VTL"
77
- },
78
- "label": {
79
- "value": "\"Chercher votre activité principale.\"",
80
- "type": "VTL"
81
- },
82
- "components": [
83
- {
84
- "id": "communes-2023",
85
- "componentType": "Suggester",
86
- "label": { "value": "\"Activité\"", "type": "VTL" },
87
- "description": "\"industrie\"",
88
- "storeName": "L_ACTIVITES-1-0-0",
89
- "conditionFilter": {
90
- "value": "true",
91
- "type": "VTL"
92
- },
93
- "response": {
94
- "name": "ACT"
95
- }
96
- }
97
- ]
98
- }
99
- ],
100
- "variables": [
101
- {
102
- "variableType": "COLLECTED",
103
- "name": "ACT",
104
- "values": {
105
- "PREVIOUS": null,
106
- "COLLECTED": null,
107
- "FORCED": null,
108
- "EDITED": null,
109
- "INPUTED": null
110
- }
111
- }
112
- ]
113
- }