@inseefr/lunatic 3.4.8 → 3.4.9

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 (160) hide show
  1. package/components/CheckboxGroup/CheckboxGroup.js +3 -1
  2. package/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
  3. package/components/CheckboxGroup/CustomCheckboxGroup.d.ts +1 -1
  4. package/components/CheckboxGroup/CustomCheckboxGroup.js +2 -5
  5. package/components/CheckboxGroup/CustomCheckboxGroup.js.map +1 -1
  6. package/components/CheckboxOne/CheckboxOne.js +3 -1
  7. package/components/CheckboxOne/CheckboxOne.js.map +1 -1
  8. package/components/Datepicker/Datepicker.js +7 -1
  9. package/components/Datepicker/Datepicker.js.map +1 -1
  10. package/components/Input/Input.js +3 -1
  11. package/components/Input/Input.js.map +1 -1
  12. package/components/InputNumber/InputNumber.spec.js +12 -0
  13. package/components/InputNumber/InputNumber.spec.js.map +1 -1
  14. package/components/InputNumber/InputNumberThousand.js +3 -1
  15. package/components/InputNumber/InputNumberThousand.js.map +1 -1
  16. package/components/Radio/Radio.d.ts +1 -0
  17. package/components/Radio/Radio.js +3 -1
  18. package/components/Radio/Radio.js.map +1 -1
  19. package/components/library.d.ts +1 -0
  20. package/components/shared/Checkbox/CheckboxOption.d.ts +4 -0
  21. package/components/shared/Checkbox/CheckboxOption.js +4 -2
  22. package/components/shared/Checkbox/CheckboxOption.js.map +1 -1
  23. package/components/shared/Checkbox/CheckboxOption.spec.js +14 -0
  24. package/components/shared/Checkbox/CheckboxOption.spec.js.map +1 -1
  25. package/components/shared/Radio/RadioGroup.d.ts +1 -1
  26. package/components/shared/Radio/RadioGroup.js +2 -2
  27. package/components/shared/Radio/RadioGroup.js.map +1 -1
  28. package/components/shared/Radio/RadioOption.d.ts +1 -0
  29. package/components/shared/Radio/RadioOption.js +2 -2
  30. package/components/shared/Radio/RadioOption.js.map +1 -1
  31. package/components/shared/Radio/RadioOption.spec.js +12 -0
  32. package/components/shared/Radio/RadioOption.spec.js.map +1 -1
  33. package/components/type.d.ts +3 -0
  34. package/esm/components/CheckboxGroup/CheckboxGroup.js +3 -1
  35. package/esm/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
  36. package/esm/components/CheckboxGroup/CustomCheckboxGroup.d.ts +1 -1
  37. package/esm/components/CheckboxGroup/CustomCheckboxGroup.js +2 -6
  38. package/esm/components/CheckboxGroup/CustomCheckboxGroup.js.map +1 -1
  39. package/esm/components/CheckboxOne/CheckboxOne.js +3 -1
  40. package/esm/components/CheckboxOne/CheckboxOne.js.map +1 -1
  41. package/esm/components/Datepicker/Datepicker.js +7 -1
  42. package/esm/components/Datepicker/Datepicker.js.map +1 -1
  43. package/esm/components/Input/Input.js +3 -1
  44. package/esm/components/Input/Input.js.map +1 -1
  45. package/esm/components/InputNumber/InputNumber.spec.js +12 -0
  46. package/esm/components/InputNumber/InputNumber.spec.js.map +1 -1
  47. package/esm/components/InputNumber/InputNumberThousand.js +3 -1
  48. package/esm/components/InputNumber/InputNumberThousand.js.map +1 -1
  49. package/esm/components/Radio/Radio.d.ts +1 -0
  50. package/esm/components/Radio/Radio.js +3 -1
  51. package/esm/components/Radio/Radio.js.map +1 -1
  52. package/esm/components/library.d.ts +1 -0
  53. package/esm/components/shared/Checkbox/CheckboxOption.d.ts +4 -0
  54. package/esm/components/shared/Checkbox/CheckboxOption.js +4 -2
  55. package/esm/components/shared/Checkbox/CheckboxOption.js.map +1 -1
  56. package/esm/components/shared/Checkbox/CheckboxOption.spec.js +14 -0
  57. package/esm/components/shared/Checkbox/CheckboxOption.spec.js.map +1 -1
  58. package/esm/components/shared/Radio/RadioGroup.d.ts +1 -1
  59. package/esm/components/shared/Radio/RadioGroup.js +2 -2
  60. package/esm/components/shared/Radio/RadioGroup.js.map +1 -1
  61. package/esm/components/shared/Radio/RadioOption.d.ts +1 -0
  62. package/esm/components/shared/Radio/RadioOption.js +2 -2
  63. package/esm/components/shared/Radio/RadioOption.js.map +1 -1
  64. package/esm/components/shared/Radio/RadioOption.spec.js +12 -0
  65. package/esm/components/shared/Radio/RadioOption.spec.js.map +1 -1
  66. package/esm/components/type.d.ts +3 -0
  67. package/esm/main.css +5 -2
  68. package/esm/main.css.map +1 -1
  69. package/esm/use-lunatic/commons/fill-components/fill-components.d.ts +1 -0
  70. package/esm/use-lunatic/commons/fill-components/fill-components.js +1 -1
  71. package/esm/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
  72. package/esm/use-lunatic/commons/page.js +4 -1
  73. package/esm/use-lunatic/commons/page.js.map +1 -1
  74. package/esm/use-lunatic/lunatic-context.d.ts +7 -1
  75. package/esm/use-lunatic/lunatic-context.js +7 -1
  76. package/esm/use-lunatic/lunatic-context.js.map +1 -1
  77. package/esm/use-lunatic/props/getComponentTypeProps.d.ts +3 -0
  78. package/esm/use-lunatic/props/propOptions.d.ts +1 -1
  79. package/esm/use-lunatic/props/propOptions.js.map +1 -1
  80. package/esm/use-lunatic/reducer/reducerInitializer.d.ts +2 -1
  81. package/esm/use-lunatic/reducer/reducerInitializer.js +3 -1
  82. package/esm/use-lunatic/reducer/reducerInitializer.js.map +1 -1
  83. package/esm/use-lunatic/type.d.ts +7 -0
  84. package/esm/use-lunatic/use-lunatic.js +6 -1
  85. package/esm/use-lunatic/use-lunatic.js.map +1 -1
  86. package/main.css +5 -2
  87. package/main.css.map +1 -1
  88. package/package.json +6 -1
  89. package/src/components/CheckboxGroup/CheckboxGroup.tsx +3 -0
  90. package/src/components/CheckboxGroup/CustomCheckboxGroup.tsx +3 -14
  91. package/src/components/CheckboxOne/CheckboxOne.tsx +3 -0
  92. package/src/components/Datepicker/Datepicker.tsx +8 -1
  93. package/src/components/Input/Input.tsx +4 -0
  94. package/src/components/Input/__snapshots__/Input.spec.tsx.snap +2 -0
  95. package/src/components/InputNumber/InputNumber.spec.tsx +20 -0
  96. package/src/components/InputNumber/InputNumberThousand.tsx +4 -0
  97. package/src/components/InputNumber/__snapshots__/InputNumber.spec.tsx.snap +2 -0
  98. package/src/components/Radio/Radio.tsx +3 -0
  99. package/src/components/RosterForLoop/__snapshots__/RosterForLoop.spec.tsx.snap +2 -0
  100. package/src/components/shared/Checkbox/CheckboxOption.spec.tsx +21 -0
  101. package/src/components/shared/Checkbox/CheckboxOption.tsx +19 -0
  102. package/src/components/shared/Radio/RadioGroup.tsx +3 -0
  103. package/src/components/shared/Radio/RadioOption.spec.tsx +36 -0
  104. package/src/components/shared/Radio/RadioOption.tsx +5 -1
  105. package/src/components/type.ts +3 -0
  106. package/src/css/components/CheckboxOne.scss +1 -1
  107. package/src/css/components/CheckboxOption.scss +14 -18
  108. package/src/css/components/Combobox.scss +3 -2
  109. package/src/css/components/Datepicker.scss +8 -8
  110. package/src/css/components/Declarations.scss +1 -1
  111. package/src/css/components/Dragger.scss +6 -6
  112. package/src/css/components/Duration.scss +4 -4
  113. package/src/css/components/IconButton.scss +4 -2
  114. package/src/css/components/Input.scss +3 -0
  115. package/src/css/components/Missing.scss +1 -1
  116. package/src/css/components/Roundabout.scss +3 -3
  117. package/src/css/components/Suggester.scss +2 -2
  118. package/src/css/components/Table.scss +9 -7
  119. package/src/css/main.scss +167 -167
  120. package/src/stories/behaviour/filter/dataLoop.json +22 -0
  121. package/src/stories/behaviour/filter/filter.stories.jsx +36 -0
  122. package/src/stories/behaviour/filter/source.json +238 -0
  123. package/src/stories/behaviour/filter/sourceLoop.json +372 -0
  124. package/src/stories/behaviour/missing/missing.stories.jsx +9 -0
  125. package/src/stories/behaviour/paste/test.stories.jsx +5 -0
  126. package/src/stories/checkbox-group/checkbox-group.stories.jsx +25 -6
  127. package/src/stories/checkbox-one/checkboxOne.stories.jsx +24 -2
  128. package/src/stories/overview/overview.stories.jsx +8 -1
  129. package/src/stories/radio/radio.stories.jsx +46 -6
  130. package/src/stories/utils/default-arg-types.js +12 -1
  131. package/src/stories/utils/default-args.js +3 -0
  132. package/src/stories/utils/orchestrator.jsx +11 -1
  133. package/src/stories/utils/orchestrator.scss +9 -7
  134. package/src/stories/utils/overview.scss +0 -1
  135. package/src/use-lunatic/commons/fill-components/fill-components.ts +4 -1
  136. package/src/use-lunatic/commons/page.ts +4 -1
  137. package/src/use-lunatic/lunatic-context.tsx +9 -0
  138. package/src/use-lunatic/props/propOptions.ts +2 -1
  139. package/src/use-lunatic/reducer/reducerInitializer.tsx +4 -0
  140. package/src/use-lunatic/type.ts +5 -0
  141. package/src/use-lunatic/use-lunatic.test.ts +52 -0
  142. package/src/use-lunatic/use-lunatic.ts +7 -0
  143. package/tsconfig.build.tsbuildinfo +1 -1
  144. package/use-lunatic/commons/fill-components/fill-components.d.ts +1 -0
  145. package/use-lunatic/commons/fill-components/fill-components.js +1 -1
  146. package/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
  147. package/use-lunatic/commons/page.js +4 -1
  148. package/use-lunatic/commons/page.js.map +1 -1
  149. package/use-lunatic/lunatic-context.d.ts +7 -1
  150. package/use-lunatic/lunatic-context.js +9 -2
  151. package/use-lunatic/lunatic-context.js.map +1 -1
  152. package/use-lunatic/props/getComponentTypeProps.d.ts +3 -0
  153. package/use-lunatic/props/propOptions.d.ts +1 -1
  154. package/use-lunatic/props/propOptions.js.map +1 -1
  155. package/use-lunatic/reducer/reducerInitializer.d.ts +2 -1
  156. package/use-lunatic/reducer/reducerInitializer.js +3 -1
  157. package/use-lunatic/reducer/reducerInitializer.js.map +1 -1
  158. package/use-lunatic/type.d.ts +7 -0
  159. package/use-lunatic/use-lunatic.js +6 -1
  160. package/use-lunatic/use-lunatic.js.map +1 -1
@@ -0,0 +1,372 @@
1
+ {
2
+ "id": "m48p2tcw",
3
+ "label": {
4
+ "type": "VTL|MD",
5
+ "value": "Story disable filter with loop"
6
+ },
7
+ "modele": "DISABLEFILTERLOOP",
8
+ "maxPage": "5",
9
+ "cleaning": {
10
+ "NAME": {
11
+ "AGE": "(not(nvl(NAME, \"\") <> \"Paul\"))"
12
+ }
13
+ },
14
+ "resizing": {
15
+ "NAME": {
16
+ "size": "count(NAME)",
17
+ "variables": ["AGE"]
18
+ },
19
+ "NBHAB": {
20
+ "size": "NHAB",
21
+ "variables": ["NAME"]
22
+ }
23
+ },
24
+ "variables": [
25
+ {
26
+ "name": "NHAB",
27
+ "dimension": 0,
28
+ "expression": {
29
+ "type": "VTL",
30
+ "value": "nvl(NBHAB,1)"
31
+ },
32
+ "variableType": "CALCULATED",
33
+ "bindingDependencies": ["NBHAB"]
34
+ },
35
+ {
36
+ "name": "NBHAB",
37
+ "values": {
38
+ "EDITED": null,
39
+ "FORCED": null,
40
+ "INPUTTED": null,
41
+ "PREVIOUS": null,
42
+ "COLLECTED": null
43
+ },
44
+ "dimension": 0,
45
+ "variableType": "COLLECTED"
46
+ },
47
+ {
48
+ "name": "NAME",
49
+ "values": {
50
+ "EDITED": [],
51
+ "FORCED": [],
52
+ "INPUTTED": [],
53
+ "PREVIOUS": [],
54
+ "COLLECTED": []
55
+ },
56
+ "dimension": 1,
57
+ "variableType": "COLLECTED",
58
+ "iterationReference": "m48p32jq"
59
+ },
60
+ {
61
+ "name": "AGE",
62
+ "values": {
63
+ "EDITED": [],
64
+ "FORCED": [],
65
+ "INPUTTED": [],
66
+ "PREVIOUS": [],
67
+ "COLLECTED": []
68
+ },
69
+ "dimension": 1,
70
+ "variableType": "COLLECTED",
71
+ "iterationReference": "m48p32jq"
72
+ },
73
+ {
74
+ "name": "FILTER_RESULT_NBHAB",
75
+ "dimension": 0,
76
+ "expression": {
77
+ "type": "VTL",
78
+ "value": "true"
79
+ },
80
+ "variableType": "CALCULATED"
81
+ },
82
+ {
83
+ "name": "FILTER_RESULT_NAME",
84
+ "dimension": 1,
85
+ "shapeFrom": ["NAME"],
86
+ "expression": {
87
+ "type": "VTL",
88
+ "value": "true"
89
+ },
90
+ "variableType": "CALCULATED",
91
+ "iterationReference": "m48p32jq"
92
+ },
93
+ {
94
+ "name": "FILTER_RESULT_AGE",
95
+ "dimension": 1,
96
+ "shapeFrom": ["NAME"],
97
+ "expression": {
98
+ "type": "VTL",
99
+ "value": "(not(nvl(NAME, \"\") <> \"Paul\"))"
100
+ },
101
+ "variableType": "CALCULATED",
102
+ "iterationReference": "m48p32jq",
103
+ "bindingDependencies": ["NAME"]
104
+ }
105
+ ],
106
+ "components": [
107
+ {
108
+ "id": "m48o486x",
109
+ "page": "1",
110
+ "label": {
111
+ "type": "VTL",
112
+ "value": "\"I - \" || \"First sequence\""
113
+ },
114
+ "componentType": "Sequence",
115
+ "conditionFilter": {
116
+ "type": "VTL",
117
+ "value": "true"
118
+ }
119
+ },
120
+ {
121
+ "id": "question-m48p4i65",
122
+ "page": "2",
123
+ "label": {
124
+ "type": "VTL|MD",
125
+ "value": "\"1\\. \" || \"How many inhabitants ?\""
126
+ },
127
+ "components": [
128
+ {
129
+ "id": "m48p4i65",
130
+ "max": 10,
131
+ "min": 1,
132
+ "page": "2",
133
+ "controls": [
134
+ {
135
+ "id": "m48p4i65-format-borne-inf-sup",
136
+ "type": "SIMPLE",
137
+ "control": {
138
+ "type": "VTL",
139
+ "value": "not(not(isnull(NBHAB)) and (1>NBHAB or 10<NBHAB))"
140
+ },
141
+ "criticality": "ERROR",
142
+ "errorMessage": {
143
+ "type": "VTL|MD",
144
+ "value": "\" La valeur doit être comprise entre 1 et 10.\""
145
+ },
146
+ "typeOfControl": "FORMAT"
147
+ },
148
+ {
149
+ "id": "m48p4i65-format-decimal",
150
+ "type": "SIMPLE",
151
+ "control": {
152
+ "type": "VTL",
153
+ "value": "not(not(isnull(NBHAB)) and round(NBHAB,0)<>NBHAB)"
154
+ },
155
+ "criticality": "ERROR",
156
+ "errorMessage": {
157
+ "type": "VTL|MD",
158
+ "value": "\"Le nombre doit comporter au maximum 0 chiffre(s) après la virgule.\""
159
+ },
160
+ "typeOfControl": "FORMAT"
161
+ }
162
+ ],
163
+ "decimals": 0,
164
+ "response": {
165
+ "name": "NBHAB"
166
+ },
167
+ "mandatory": false,
168
+ "description": {
169
+ "type": "TXT",
170
+ "value": "Format attendu : un nombre entre 1 et 10"
171
+ },
172
+ "componentType": "InputNumber"
173
+ }
174
+ ],
175
+ "componentType": "Question",
176
+ "conditionFilter": {
177
+ "type": "VTL",
178
+ "value": "true"
179
+ }
180
+ },
181
+ {
182
+ "id": "m48p32jq",
183
+ "page": "3",
184
+ "depth": 1,
185
+ "lines": {
186
+ "max": {
187
+ "type": "VTL",
188
+ "value": "NHAB"
189
+ },
190
+ "min": {
191
+ "type": "VTL",
192
+ "value": "NHAB"
193
+ }
194
+ },
195
+ "components": [
196
+ {
197
+ "id": "m48p7i3p",
198
+ "page": "3",
199
+ "label": {
200
+ "type": "VTL|MD",
201
+ "value": "\"People names\""
202
+ },
203
+ "goToPage": "3",
204
+ "componentType": "Subsequence",
205
+ "conditionFilter": {
206
+ "type": "VTL",
207
+ "value": "true"
208
+ }
209
+ },
210
+ {
211
+ "id": "question-m48ph1pw",
212
+ "page": "3",
213
+ "label": {
214
+ "type": "VTL|MD",
215
+ "value": "\"2\\. \" || \"name\""
216
+ },
217
+ "components": [
218
+ {
219
+ "id": "m48ph1pw",
220
+ "page": "3",
221
+ "response": {
222
+ "name": "NAME"
223
+ },
224
+ "mandatory": false,
225
+ "maxLength": 249,
226
+ "componentType": "Input"
227
+ }
228
+ ],
229
+ "declarations": [
230
+ {
231
+ "id": "m48q03bn",
232
+ "label": {
233
+ "type": "VTL|MD",
234
+ "value": "\"The iteration for the next loop will be filtered if name is not Paul\""
235
+ },
236
+ "position": "AFTER_QUESTION_TEXT",
237
+ "declarationType": "HELP"
238
+ }
239
+ ],
240
+ "componentType": "Question",
241
+ "conditionFilter": {
242
+ "type": "VTL",
243
+ "value": "true"
244
+ }
245
+ }
246
+ ],
247
+ "componentType": "Loop",
248
+ "paginatedLoop": false,
249
+ "conditionFilter": {
250
+ "type": "VTL",
251
+ "value": "true"
252
+ },
253
+ "loopDependencies": ["NHAB", "NBHAB"]
254
+ },
255
+ {
256
+ "id": "m48pf7u1",
257
+ "page": "4",
258
+ "depth": 1,
259
+ "maxPage": "2",
260
+ "components": [
261
+ {
262
+ "id": "m48p2sfr",
263
+ "page": "4.1",
264
+ "label": {
265
+ "type": "VTL|MD",
266
+ "value": "\"Informations of \" || NAME "
267
+ },
268
+ "goToPage": "4.1",
269
+ "description": {
270
+ "type": "VTL|MD",
271
+ "value": "\"This loop iteration is filtered if name is not Paul\""
272
+ },
273
+ "componentType": "Subsequence",
274
+ "conditionFilter": {
275
+ "type": "VTL",
276
+ "value": "(not(nvl(NAME, \"\") <> \"Paul\"))"
277
+ }
278
+ },
279
+ {
280
+ "id": "question-m48p00x1",
281
+ "page": "4.2",
282
+ "label": {
283
+ "type": "VTL|MD",
284
+ "value": "\"3\\. \" || \"How hold is \" || NAME || \" ?\" "
285
+ },
286
+ "components": [
287
+ {
288
+ "id": "m48p00x1",
289
+ "max": 200,
290
+ "min": 1,
291
+ "page": "4.2",
292
+ "controls": [
293
+ {
294
+ "id": "m48p00x1-format-borne-inf-sup",
295
+ "type": "SIMPLE",
296
+ "control": {
297
+ "type": "VTL",
298
+ "value": "not(not(isnull(AGE)) and (1>AGE or 200<AGE))"
299
+ },
300
+ "criticality": "ERROR",
301
+ "errorMessage": {
302
+ "type": "VTL|MD",
303
+ "value": "\" La valeur doit être comprise entre 1 et 200.\""
304
+ },
305
+ "typeOfControl": "FORMAT"
306
+ },
307
+ {
308
+ "id": "m48p00x1-format-decimal",
309
+ "type": "SIMPLE",
310
+ "control": {
311
+ "type": "VTL",
312
+ "value": "not(not(isnull(AGE)) and round(AGE,0)<>AGE)"
313
+ },
314
+ "criticality": "ERROR",
315
+ "errorMessage": {
316
+ "type": "VTL|MD",
317
+ "value": "\"Le nombre doit comporter au maximum 0 chiffre(s) après la virgule.\""
318
+ },
319
+ "typeOfControl": "FORMAT"
320
+ }
321
+ ],
322
+ "decimals": 0,
323
+ "response": {
324
+ "name": "AGE"
325
+ },
326
+ "mandatory": false,
327
+ "description": {
328
+ "type": "TXT",
329
+ "value": "Format attendu : un nombre entre 1 et 200"
330
+ },
331
+ "componentType": "InputNumber"
332
+ }
333
+ ],
334
+ "componentType": "Question",
335
+ "conditionFilter": {
336
+ "type": "VTL",
337
+ "value": "(not(nvl(NAME, \"\") <> \"Paul\"))"
338
+ }
339
+ }
340
+ ],
341
+ "iterations": {
342
+ "type": "VTL",
343
+ "value": "count(NAME)"
344
+ },
345
+ "componentType": "Loop",
346
+ "paginatedLoop": true,
347
+ "conditionFilter": {
348
+ "type": "VTL",
349
+ "value": "(not(nvl(NAME, \"\") <> \"Paul\"))"
350
+ },
351
+ "loopDependencies": ["NAME"]
352
+ },
353
+ {
354
+ "id": "m48pk7c4",
355
+ "page": "5",
356
+ "label": {
357
+ "type": "VTL",
358
+ "value": "\"II - \" || \"empty sequence\""
359
+ },
360
+ "componentType": "Sequence",
361
+ "conditionFilter": {
362
+ "type": "VTL",
363
+ "value": "true"
364
+ }
365
+ }
366
+ ],
367
+ "pagination": "question",
368
+ "componentType": "Questionnaire",
369
+ "enoCoreVersion": "3.29.3-SNAPSHOT",
370
+ "generatingDate": "03-12-2024 17:09:11",
371
+ "lunaticModelVersion": "3.15.1"
372
+ }
@@ -8,11 +8,20 @@ const stories = {
8
8
  component: Orchestrator,
9
9
  argTypes: {
10
10
  ...defaultArgTypes,
11
+ shortcut: {
12
+ table: { disable: false },
13
+ control: 'boolean',
14
+ defaultValue: true,
15
+ },
11
16
  missing: {
12
17
  table: { disable: false },
13
18
  control: 'boolean',
14
19
  defaultValue: true,
15
20
  },
21
+ missingStrategy: {
22
+ table: { disable: false },
23
+ control: 'object',
24
+ },
16
25
  activeGoNextForMissing: {
17
26
  table: { disable: false },
18
27
  control: 'boolean',
@@ -18,6 +18,11 @@ const stories = {
18
18
  control: 'boolean',
19
19
  defaultValue: true,
20
20
  },
21
+ disableFilters: {
22
+ table: { disable: false },
23
+ control: 'boolean',
24
+ defaultValue: false,
25
+ },
21
26
  management: {
22
27
  table: { disable: false },
23
28
  control: 'boolean',
@@ -4,11 +4,16 @@ import source from './source';
4
4
  import sourceLoop from './sourceLoop';
5
5
  import sourceDetail from './sourceDetail';
6
6
  import sourceCondition from './sourceCondition';
7
+ import defaultArgs from '../utils/default-args';
7
8
  import defaultArgTypes from '../utils/default-arg-types';
8
9
 
9
10
  const stories = {
10
11
  title: 'Components/CheckboxGroup',
11
12
  component: Orchestrator,
13
+ args: {
14
+ ...defaultArgs,
15
+ shortcut: true,
16
+ },
12
17
  argTypes: {
13
18
  ...defaultArgTypes,
14
19
  shortcut: {
@@ -25,29 +30,43 @@ const Template = (args) => <Orchestrator {...args} />;
25
30
  export const Default = Template.bind({});
26
31
 
27
32
  Default.args = {
28
- id: 'checkboxGroup',
33
+ ...stories.args,
29
34
  source,
30
- shortcut: true,
31
35
  };
32
36
 
33
37
  export const Condition = Template.bind({});
34
38
 
35
39
  Condition.args = {
40
+ ...Default.args,
36
41
  source: sourceCondition,
37
42
  };
38
43
 
39
44
  export const ReadOnly = Template.bind({});
40
45
 
41
46
  ReadOnly.args = {
47
+ ...Default.args,
42
48
  source,
43
49
  readOnly: true,
44
- shortcut: true,
45
50
  };
46
51
 
47
- export const Arbitrary = Template.bind({});
48
- Arbitrary.args = {
52
+ export const WithDetail = Template.bind({});
53
+ WithDetail.args = {
54
+ ...Default.args,
49
55
  source: sourceDetail,
50
- shortcut: true,
56
+ detailAlwaysDisplayed: false,
57
+ };
58
+
59
+ WithDetail.argTypes = {
60
+ ...Default.argTypes,
61
+ detailAlwaysDisplayed: {
62
+ control: 'boolean',
63
+ defaultValue: false,
64
+ description: 'Always display detail options',
65
+ table: {
66
+ disable: false,
67
+ category: 'Components Options',
68
+ },
69
+ },
51
70
  };
52
71
 
53
72
  export const Loop = Template.bind({});
@@ -2,11 +2,16 @@ import React from 'react';
2
2
  import Orchestrator from '../utils/orchestrator';
3
3
  import source from './source';
4
4
  import sourceWithDetail from './sourceDetail';
5
+ import defaultArgs from '../utils/default-args';
5
6
  import defaultArgTypes from '../utils/default-arg-types';
6
7
 
7
8
  const stories = {
8
9
  title: 'Components/CheckboxOne',
9
10
  component: Orchestrator,
11
+ args: {
12
+ ...defaultArgs,
13
+ shortcut: true,
14
+ },
10
15
  argTypes: {
11
16
  ...defaultArgTypes,
12
17
  shortcut: {
@@ -22,10 +27,27 @@ export default stories;
22
27
  const Template = (args) => <Orchestrator {...args} />;
23
28
  export const Default = Template.bind({});
24
29
 
25
- Default.args = { source, shortcut: false };
30
+ Default.args = {
31
+ ...stories.args,
32
+ source,
33
+ };
26
34
 
27
35
  export const WithDetail = Template.bind({});
28
36
  WithDetail.args = {
37
+ ...Default.args,
29
38
  source: sourceWithDetail,
30
- shortcut: false,
39
+ detailAlwaysDisplayed: false,
40
+ };
41
+
42
+ WithDetail.argTypes = {
43
+ ...Default.argTypes,
44
+ detailAlwaysDisplayed: {
45
+ control: 'boolean',
46
+ defaultValue: false,
47
+ description: 'Always display detail options',
48
+ table: {
49
+ disable: false,
50
+ category: 'Components Options',
51
+ },
52
+ },
31
53
  };
@@ -9,7 +9,14 @@ import dataLoop from './dataLoop.json';
9
9
  const stories = {
10
10
  title: 'Behaviour/Overview',
11
11
  component: Orchestrator,
12
- argTypes: defaultArgTypes,
12
+ argTypes: {
13
+ ...defaultArgTypes,
14
+ showOverview: {
15
+ table: { disable: false },
16
+ control: 'boolean',
17
+ defaultValue: true,
18
+ },
19
+ },
13
20
  };
14
21
 
15
22
  export default stories;
@@ -4,11 +4,16 @@ import source from './source';
4
4
  import sourceHorizontal from './sourceHorizontal';
5
5
  import sourceDetail from './sourceDetail';
6
6
  import sourceCondition from './sourceCondition';
7
+ import defaultArgs from '../utils/default-args';
7
8
  import defaultArgTypes from '../utils/default-arg-types';
8
9
 
9
10
  const stories = {
10
11
  title: 'Components/Radio',
11
12
  component: Orchestrator,
13
+ args: {
14
+ ...defaultArgs,
15
+ shortcut: true,
16
+ },
12
17
  argTypes: {
13
18
  ...defaultArgTypes,
14
19
  shortcut: {
@@ -23,16 +28,51 @@ export default stories;
23
28
 
24
29
  const Template = (args) => <Orchestrator {...args} />;
25
30
  export const Default = Template.bind({});
26
- Default.args = { source, shortcut: true };
31
+
32
+ Default.args = {
33
+ ...stories.args,
34
+ source,
35
+ };
27
36
 
28
37
  export const Condition = Template.bind({});
29
- Condition.args = { source: sourceCondition };
38
+
39
+ Condition.args = {
40
+ ...Default.args,
41
+ source: sourceCondition,
42
+ };
30
43
 
31
44
  export const Horizontal = Template.bind({});
32
- Horizontal.args = { source: sourceHorizontal, shortcut: true };
45
+
46
+ Horizontal.args = {
47
+ ...Default.args,
48
+ source: sourceHorizontal,
49
+ };
33
50
 
34
51
  export const ReadOnly = Template.bind({});
35
- ReadOnly.args = { source, shortcut: true, readOnly: true };
36
52
 
37
- export const Detail = Template.bind({});
38
- Detail.args = { source: sourceDetail, shortcut: true };
53
+ ReadOnly.args = {
54
+ ...Default.args,
55
+ source,
56
+ readOnly: true,
57
+ };
58
+
59
+ export const WithDetail = Template.bind({});
60
+
61
+ WithDetail.args = {
62
+ ...Default.argTypes,
63
+ source: sourceDetail,
64
+ detailAlwaysDisplayed: false,
65
+ };
66
+
67
+ WithDetail.argTypes = {
68
+ ...Default.argTypes,
69
+ detailAlwaysDisplayed: {
70
+ control: 'boolean',
71
+ defaultValue: false,
72
+ description: 'Always display detail options',
73
+ table: {
74
+ disable: false,
75
+ category: 'Components Options',
76
+ },
77
+ },
78
+ };
@@ -1,6 +1,7 @@
1
1
  const fields = [
2
2
  'source',
3
3
  'id',
4
+ 'disableFilters',
4
5
  'pagination',
5
6
  'data',
6
7
  'management',
@@ -11,6 +12,10 @@ const fields = [
11
12
  'missing',
12
13
  'shortcut',
13
14
  'filterDescription',
15
+ 'disabled',
16
+ 'showOverview',
17
+ 'missingStrategy',
18
+ 'detailAlwaysDisplayed',
14
19
  ];
15
20
 
16
21
  const defaultArgTypes = fields.reduce(
@@ -22,7 +27,13 @@ const defaultArgTypes = fields.reduce(
22
27
  },
23
28
  },
24
29
  }),
25
- {}
30
+ {
31
+ readOnly: {
32
+ table: { disable: false },
33
+ control: 'boolean',
34
+ defaultValue: false,
35
+ },
36
+ }
26
37
  );
27
38
 
28
39
  export default defaultArgTypes;
@@ -0,0 +1,3 @@
1
+ const defaultArgs = { readOnly: false };
2
+
3
+ export default defaultArgs;
@@ -8,7 +8,7 @@ import {
8
8
  ModalControls,
9
9
  useLunatic,
10
10
  } from '../..';
11
- import React, { memo, useCallback, useEffect, useState } from 'react';
11
+ import React, { memo, useCallback, useEffect, useMemo, useState } from 'react';
12
12
 
13
13
  import { Logger } from '../../utils/logger';
14
14
  import { Overview } from './overview';
@@ -100,6 +100,7 @@ function logMissingStrategy() {
100
100
  function OrchestratorForStories({
101
101
  source,
102
102
  data,
103
+ disableFilters = false,
103
104
  management = false,
104
105
  shortcut = false,
105
106
  activeControls = false,
@@ -119,9 +120,16 @@ function OrchestratorForStories({
119
120
  refusedButton,
120
121
  readOnly = false,
121
122
  disabled = false,
123
+ detailAlwaysDisplayed = false,
122
124
  ...rest
123
125
  }) {
124
126
  const { maxPage } = source;
127
+
128
+ const componentsOptions = useMemo(
129
+ () => ({ detailAlwaysDisplayed }),
130
+ [detailAlwaysDisplayed]
131
+ );
132
+
125
133
  const {
126
134
  getComponents,
127
135
  goPreviousPage,
@@ -141,6 +149,7 @@ function OrchestratorForStories({
141
149
  initialPage,
142
150
  features,
143
151
  preferences,
152
+ disableFilters,
144
153
  onChange: onLogChange,
145
154
  autoSuggesterLoading,
146
155
  getReferentiel,
@@ -154,6 +163,7 @@ function OrchestratorForStories({
154
163
  withOverview: showOverview,
155
164
  dontKnowButton,
156
165
  refusedButton,
166
+ componentsOptions,
157
167
  });
158
168
 
159
169
  const components = getComponents();