@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,308 +0,0 @@
1
- {
2
- "maxPage": "3",
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": "Loop",
17
- "label": { "value": "\"Ajouter un individu\"", "type": "VTL|MD" },
18
- "conditionFilter": { "value": "true", "type": "VTL" },
19
- "bindingDependencies": ["PRENOM"],
20
- "lines": {
21
- "min": { "value": 1, "type": "VTL" },
22
- "max": { "value": 10, "type": "VTL" }
23
- },
24
- "page": "1",
25
- "components": [
26
- {
27
- "componentType": "Input",
28
- "label": { "value": "\"Prénom\"", "type": "VTL|MD" },
29
- "conditionFilter": { "value": "true", "type": "VTL" },
30
- "maxLength": 30,
31
- "bindingDependencies": ["PRENOM"],
32
- "id": "prenom",
33
- "response": {
34
- "name": "PRENOM"
35
- }
36
- }
37
- ]
38
- },
39
- {
40
- "id": "loop",
41
- "componentType": "Loop",
42
-
43
- "loopDependencies": ["PRENOM"],
44
- "iterations": { "value": "count(PRENOM)", "type": "VTL" },
45
- "page": "2",
46
- "maxPage": "1",
47
- "depth": 1,
48
- "paginatedLoop": true,
49
- "conditionFilter": {
50
- "value": "true",
51
- "type": "VTL"
52
- },
53
- "components": [
54
- {
55
- "id": "age1",
56
- "label": {
57
- "value": "PRENOM || \", quel est vôtre âge ?\"",
58
- "type": "VTL"
59
- },
60
- "conditionFilter": {
61
- "value": "true",
62
- "type": "VTL"
63
- },
64
- "page": "2.1",
65
- "componentType": "InputNumber",
66
- "min": 0,
67
- "max": 120,
68
- "decimals": 0,
69
- "response": { "name": "AGE1" }
70
- },
71
- {
72
- "id": "component-set",
73
- "componentType": "ComponentSet",
74
- "page": "2.1",
75
- "depth": 1,
76
- "conditionFilter": { "value": "true", "type": "VTL" },
77
- "label": {
78
- "value": "\"## Who are you?\"",
79
- "type": "VTL|MD"
80
- },
81
- "description": {
82
- "value": "\"This is your opportunity to tell me about yourself!\"",
83
- "type": "VTL|MD"
84
- },
85
- "components": [
86
- {
87
- "id": "prenom",
88
- "componentType": "Input",
89
- "mandatory": false,
90
- "maxLength": 20,
91
- "label": {
92
- "value": "\"Prénom\"))",
93
- "type": "VTL|MD"
94
- },
95
- "conditionFilter": {
96
- "value": "true",
97
- "type": "VTL"
98
- },
99
- "response": { "name": "PRENOMS" }
100
- },
101
- {
102
- "id": "age",
103
- "componentType": "InputNumber",
104
- "maxLength": 3,
105
- "label": {
106
- "value": "\"Age\"))",
107
- "type": "VTL|MD"
108
- },
109
- "conditionFilter": {
110
- "value": "true",
111
- "type": "VTL"
112
- },
113
- "response": { "name": "AGE" },
114
- "controls": [
115
- {
116
- "criticality": "WARN",
117
- "errorMessage": {
118
- "type": "VTL",
119
- "value": "\"booleen pas coché et on affiche un message un peu long histoire de tester le truc \""
120
- },
121
- "typeOfControl": "CONSISTENCY",
122
- "control": {
123
- "type": "VTL",
124
- "value": "false"
125
- },
126
- "id": "kfxmjupm-CI-0"
127
- }
128
- ]
129
- },
130
- {
131
- "id": "j4nw5cqz",
132
- "componentType": "Dropdown",
133
- "mandatory": false,
134
- "label": {
135
- "value": "\"In which state do The Simpsons reside?\"",
136
- "type": "VTL|MD"
137
- },
138
- "description": "\"This is a test description\"",
139
- "response": {
140
- "name": "STATE"
141
- },
142
- "controls": [
143
- {
144
- "id": "j4nw5cqz",
145
- "typeOfControl": "CONSISTENCY",
146
- "criticality": "WARN",
147
- "control": {
148
- "value": "not(nvl(STATE,\"\") = \"13\")",
149
- "type": "VTL"
150
- },
151
- "errorMessage": {
152
- "value": "\"Please choose a state!\"",
153
- "type": "VTL|MD"
154
- },
155
- "bindingDependencies": ["STATE"]
156
- },
157
- {
158
- "id": "j4nw5cqz",
159
- "typeOfControl": "CONSISTENCY",
160
- "criticality": "INFO",
161
- "control": {
162
- "value": "not(nvl(STATE,\"\") = \"4\")",
163
- "type": "VTL"
164
- },
165
- "errorMessage": {
166
- "value": "\"Idk if this is right, I'm just testing error messages!!\"",
167
- "type": "VTL|MD"
168
- },
169
- "bindingDependencies": ["STATE"]
170
- }
171
- ],
172
- "options": [
173
- {
174
- "value": "1",
175
- "label": { "value": "\"Washington\"", "type": "VTL" }
176
- },
177
- {
178
- "value": "2",
179
- "label": { "value": "\"Kentucky\"", "type": "VTL" }
180
- },
181
- {
182
- "value": "3",
183
- "label": { "value": "\"Ohio\"", "type": "VTL" }
184
- },
185
- {
186
- "value": "4",
187
- "label": { "value": "\"Maine\"", "type": "VTL" }
188
- },
189
- {
190
- "value": "5",
191
- "label": { "value": "\"North Dakota\"", "type": "VTL" }
192
- },
193
- {
194
- "value": "6",
195
- "label": { "value": "\"Florida\"", "type": "VTL" }
196
- },
197
- {
198
- "value": "7",
199
- "label": { "value": "\"North Takoma\"", "type": "VTL" }
200
- },
201
- {
202
- "value": "8",
203
- "label": { "value": "\"California\"", "type": "VTL" }
204
- },
205
- {
206
- "value": "9",
207
- "label": { "value": "\"Texas\"", "type": "VTL" }
208
- },
209
- {
210
- "value": "10",
211
- "label": { "value": "\"Massachusetts\"", "type": "VTL" }
212
- },
213
- {
214
- "value": "11",
215
- "label": { "value": "\"Nevada\"", "type": "VTL" }
216
- },
217
- {
218
- "value": "12",
219
- "label": { "value": "\"Illinois\"", "type": "VTL" }
220
- },
221
- {
222
- "value": "13",
223
- "label": {
224
- "value": "\"Not in any state, you fool!\"",
225
- "type": "VTL"
226
- }
227
- }
228
- ]
229
- }
230
- ]
231
- }
232
- ]
233
- },
234
- {
235
- "id": "seq-end",
236
- "componentType": "Sequence",
237
- "label": {
238
- "value": "\"End\"",
239
- "type": "VTL|MD"
240
- },
241
- "conditionFilter": { "value": "true", "type": "VTL" },
242
- "page": "3"
243
- }
244
- ],
245
- "resizing": {
246
- "PRENOM": {
247
- "size": "count(PRENOM)",
248
- "variables": ["AGE"]
249
- }
250
- },
251
- "variables": [
252
- {
253
- "variableType": "COLLECTED",
254
- "name": "PRENOM",
255
- "values": {
256
- "PREVIOUS": [null],
257
- "COLLECTED": [null],
258
- "FORCED": [null],
259
- "EDITED": [null],
260
- "INPUTED": [null]
261
- }
262
- },
263
- {
264
- "variableType": "COLLECTED",
265
- "name": "AGE1",
266
- "values": {
267
- "PREVIOUS": [null],
268
- "COLLECTED": [null],
269
- "FORCED": [null],
270
- "EDITED": [null],
271
- "INPUTED": [null]
272
- }
273
- },
274
- {
275
- "variableType": "COLLECTED",
276
- "name": "PRENOMS",
277
- "values": {
278
- "PREVIOUS": [null],
279
- "COLLECTED": [null],
280
- "FORCED": [null],
281
- "EDITED": [null],
282
- "INPUTED": [null]
283
- }
284
- },
285
- {
286
- "variableType": "COLLECTED",
287
- "name": "AGE",
288
- "values": {
289
- "PREVIOUS": [null],
290
- "COLLECTED": [null],
291
- "FORCED": [null],
292
- "EDITED": [null],
293
- "INPUTED": [null]
294
- }
295
- },
296
- {
297
- "variableType": "COLLECTED",
298
- "name": "STATE",
299
- "values": {
300
- "PREVIOUS": [null],
301
- "COLLECTED": [null],
302
- "FORCED": [null],
303
- "EDITED": [null],
304
- "INPUTED": [null]
305
- }
306
- }
307
- ]
308
- }