@inseefr/lunatic 3.4.21 → 3.5.0-rc.1

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 (36) hide show
  1. package/esm/type.source.d.ts +5 -1
  2. package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.d.ts +1 -1
  3. package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +111 -14
  4. package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js.map +1 -1
  5. package/esm/use-lunatic/commons/variables/lunatic-variables-store.d.ts +1 -1
  6. package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js +93 -0
  7. package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -1
  8. package/esm/use-lunatic/use-lunatic.d.ts +1 -2
  9. package/esm/use-lunatic/use-lunatic.js.map +1 -1
  10. package/esm/utils/cast.d.ts +19 -0
  11. package/esm/utils/cast.js +63 -0
  12. package/esm/utils/cast.js.map +1 -0
  13. package/package.json +10 -1
  14. package/src/stories/behaviour/cleaning/cleaning.stories.jsx +11 -0
  15. package/src/stories/behaviour/cleaning/loop.json +246 -0
  16. package/src/stories/behaviour/performance/performance.stories.jsx +8 -0
  17. package/src/stories/behaviour/performance/srcv.json +44747 -0
  18. package/src/type.source.ts +7 -1
  19. package/src/use-lunatic/commons/variables/behaviours/cleaning-behaviour.ts +182 -24
  20. package/src/use-lunatic/commons/variables/lunatic-variables-store.spec.ts +111 -0
  21. package/src/use-lunatic/commons/variables/lunatic-variables-store.ts +1 -1
  22. package/src/use-lunatic/use-lunatic.ts +5 -4
  23. package/src/utils/cast.ts +67 -0
  24. package/tsconfig.build.tsbuildinfo +1 -1
  25. package/type.source.d.ts +5 -1
  26. package/use-lunatic/commons/variables/behaviours/cleaning-behaviour.d.ts +1 -1
  27. package/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +111 -14
  28. package/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js.map +1 -1
  29. package/use-lunatic/commons/variables/lunatic-variables-store.d.ts +1 -1
  30. package/use-lunatic/commons/variables/lunatic-variables-store.spec.js +93 -0
  31. package/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -1
  32. package/use-lunatic/use-lunatic.d.ts +1 -2
  33. package/use-lunatic/use-lunatic.js.map +1 -1
  34. package/utils/cast.d.ts +19 -0
  35. package/utils/cast.js +70 -0
  36. package/utils/cast.js.map +1 -0
@@ -0,0 +1,246 @@
1
+ {
2
+ "id": "m8ilargw",
3
+ "componentType": "Questionnaire",
4
+ "modele": "LCCLEANING",
5
+ "generatingDate": "21-03-2025 13:49:55",
6
+ "pagination": "question",
7
+ "maxPage": "4",
8
+ "label": { "value": "[LC]: cleaning mixe de scope", "type": "VTL|MD" },
9
+ "components": [
10
+ {
11
+ "id": "m8illrg8",
12
+ "componentType": "Sequence",
13
+ "page": "1",
14
+ "label": { "value": "\"I - \" || \"S1\"", "type": "VTL" },
15
+ "conditionFilter": { "value": "true", "type": "VTL" }
16
+ },
17
+ {
18
+ "id": "question-m8ilsr46",
19
+ "componentType": "Question",
20
+ "page": "2",
21
+ "label": { "value": "\"1\\. \" || \"Prénoms ?\"", "type": "VTL|MD" },
22
+ "conditionFilter": { "value": "true", "type": "VTL" },
23
+ "components": [
24
+ {
25
+ "id": "m8ilsr46",
26
+ "componentType": "RosterForLoop",
27
+ "mandatory": false,
28
+ "page": "2",
29
+ "lines": {
30
+ "min": { "value": "1", "type": "VTL" },
31
+ "max": { "value": "10", "type": "VTL" }
32
+ },
33
+ "header": [
34
+ { "label": { "value": "\"Prenoms ?\"", "type": "VTL|MD" } }
35
+ ],
36
+ "components": [
37
+ {
38
+ "componentType": "Input",
39
+ "maxLength": 249,
40
+ "id": "m8ilsr46-RDOP-m8im0j91",
41
+ "response": { "name": "PRENOM" }
42
+ }
43
+ ],
44
+ "positioning": "HORIZONTAL"
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "id": "m8iltdbt",
50
+ "componentType": "Loop",
51
+ "page": "3",
52
+ "maxPage": "4",
53
+ "depth": 1,
54
+ "paginatedLoop": true,
55
+ "conditionFilter": { "value": "true", "type": "VTL" },
56
+ "loopDependencies": ["PRENOM"],
57
+ "components": [
58
+ {
59
+ "id": "m8ilmimd",
60
+ "componentType": "Sequence",
61
+ "page": "3.1",
62
+ "label": {
63
+ "value": "\"II - \" || \"Sequence de \" || PRENOM ",
64
+ "type": "VTL"
65
+ },
66
+ "conditionFilter": { "value": "true", "type": "VTL" }
67
+ },
68
+ {
69
+ "id": "question-m8ilvkbt",
70
+ "componentType": "Question",
71
+ "page": "3.2",
72
+ "label": {
73
+ "value": "\"2\\. \" || \"Cette question est pour tout le monde\"",
74
+ "type": "VTL|MD"
75
+ },
76
+ "conditionFilter": { "value": "true", "type": "VTL" },
77
+ "components": [
78
+ {
79
+ "id": "m8ilvkbt",
80
+ "componentType": "Input",
81
+ "mandatory": false,
82
+ "page": "3.2",
83
+ "maxLength": 249,
84
+ "response": { "name": "CETTEQUEST" }
85
+ }
86
+ ]
87
+ },
88
+ {
89
+ "id": "question-m8iljjiu",
90
+ "componentType": "Question",
91
+ "page": "3.3",
92
+ "label": {
93
+ "value": "\"3\\. \" || \"Cette question est pour Laurent uniquement\"",
94
+ "type": "VTL|MD"
95
+ },
96
+ "conditionFilter": {
97
+ "value": "(nvl(PRENOM,\"\") = \"Laurent\")",
98
+ "type": "VTL"
99
+ },
100
+ "components": [
101
+ {
102
+ "id": "m8iljjiu",
103
+ "componentType": "Input",
104
+ "mandatory": false,
105
+ "page": "3.3",
106
+ "maxLength": 249,
107
+ "response": { "name": "ONLY_LAURENT" }
108
+ }
109
+ ]
110
+ },
111
+ {
112
+ "id": "question-m8ili0k6",
113
+ "componentType": "Question",
114
+ "page": "3.4",
115
+ "label": {
116
+ "value": "\"4\\. \" || \"Cette question est pour Laurent uniquement et s'il y a au moins 3 personnes dans le tableau\"",
117
+ "type": "VTL|MD"
118
+ },
119
+ "conditionFilter": {
120
+ "value": "(NB_PERS >= 3 and PRENOM = \"Laurent\")",
121
+ "type": "VTL"
122
+ },
123
+ "components": [
124
+ {
125
+ "id": "m8ili0k6",
126
+ "componentType": "Input",
127
+ "mandatory": false,
128
+ "page": "3.4",
129
+ "maxLength": 249,
130
+ "response": { "name": "ONLY_TROIS_LAURENT" }
131
+ }
132
+ ]
133
+ }
134
+ ],
135
+ "iterations": { "value": "count(PRENOM)", "type": "VTL" }
136
+ },
137
+ {
138
+ "id": "m8iluttj",
139
+ "componentType": "Sequence",
140
+ "page": "4",
141
+ "label": { "value": "\"III - \" || \"Fin\"", "type": "VTL" },
142
+ "conditionFilter": { "value": "true", "type": "VTL" }
143
+ }
144
+ ],
145
+ "variables": [
146
+ {
147
+ "name": "NB_PERS",
148
+ "variableType": "CALCULATED",
149
+ "expression": { "value": "count(PRENOM)", "type": "VTL" },
150
+ "bindingDependencies": ["PRENOM"],
151
+ "dimension": 0
152
+ },
153
+ {
154
+ "name": "PRENOM",
155
+ "variableType": "COLLECTED",
156
+ "values": { "COLLECTED": [] },
157
+ "iterationReference": "m8ilsr46",
158
+ "dimension": 1
159
+ },
160
+ {
161
+ "name": "CETTEQUEST",
162
+ "variableType": "COLLECTED",
163
+ "values": { "COLLECTED": [] },
164
+ "iterationReference": "m8ilsr46",
165
+ "dimension": 1
166
+ },
167
+ {
168
+ "name": "ONLY_LAURENT",
169
+ "variableType": "COLLECTED",
170
+ "values": { "COLLECTED": [] },
171
+ "iterationReference": "m8ilsr46",
172
+ "dimension": 1
173
+ },
174
+ {
175
+ "name": "ONLY_TROIS_LAURENT",
176
+ "variableType": "COLLECTED",
177
+ "values": { "COLLECTED": [] },
178
+ "iterationReference": "m8ilsr46",
179
+ "dimension": 1
180
+ },
181
+ {
182
+ "name": "FILTER_RESULT_PRENOM",
183
+ "variableType": "CALCULATED",
184
+ "expression": { "value": "true", "type": "VTL" },
185
+ "shapeFrom": ["PRENOM"],
186
+ "iterationReference": "m8ilsr46",
187
+ "dimension": 1
188
+ },
189
+ {
190
+ "name": "FILTER_RESULT_CETTEQUEST",
191
+ "variableType": "CALCULATED",
192
+ "expression": { "value": "true", "type": "VTL" },
193
+ "shapeFrom": ["PRENOM"],
194
+ "iterationReference": "m8ilsr46",
195
+ "dimension": 1
196
+ },
197
+ {
198
+ "name": "FILTER_RESULT_ONLY_LAURENT",
199
+ "variableType": "CALCULATED",
200
+ "expression": {
201
+ "value": "(nvl(PRENOM,\"\") = \"Laurent\")",
202
+ "type": "VTL"
203
+ },
204
+ "bindingDependencies": ["PRENOM"],
205
+ "shapeFrom": ["PRENOM"],
206
+ "iterationReference": "m8ilsr46",
207
+ "dimension": 1
208
+ },
209
+ {
210
+ "name": "FILTER_RESULT_ONLY_TROIS_LAURENT",
211
+ "variableType": "CALCULATED",
212
+ "expression": {
213
+ "value": "(NB_PERS >= 3 and PRENOM = \"Laurent\")",
214
+ "type": "VTL"
215
+ },
216
+ "bindingDependencies": ["NB_PERS", "PRENOM"],
217
+ "shapeFrom": ["PRENOM"],
218
+ "iterationReference": "m8ilsr46",
219
+ "dimension": 1
220
+ }
221
+ ],
222
+ "cleaning": {
223
+ "PRENOM": {
224
+ "ONLY_LAURENT": [
225
+ {
226
+ "expression": "nvl(PRENOM,\"\") = \"Laurent\"",
227
+ "shapeFrom": "PRENOM",
228
+ "isAggregatorUsed": false
229
+ }
230
+ ],
231
+ "ONLY_TROIS_LAURENT": [
232
+ {
233
+ "expression": "NB_PERS >= 3 and PRENOM = \"Laurent\"",
234
+ "shapeFrom": "PRENOM",
235
+ "isAggregatorUsed": true
236
+ }
237
+ ]
238
+ }
239
+ },
240
+ "resizing": {
241
+ "PRENOM": {
242
+ "size": "count(PRENOM)",
243
+ "variables": ["CETTEQUEST", "ONLY_LAURENT", "ONLY_TROIS_LAURENT"]
244
+ }
245
+ }
246
+ }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import Orchestrator from '../../utils/orchestrator';
3
3
  import source from './source.json';
4
+ import sourceSrcv from './srcv.json';
4
5
  import { generateData } from '../../../tests/utils/lunatic';
5
6
  import { times } from '../../../utils/array';
6
7
 
@@ -24,3 +25,10 @@ Default.args = {
24
25
  BIRTHDAY: times(200, (k) => `2${k.toString().padStart(3, '0')}-01-01`),
25
26
  }),
26
27
  };
28
+
29
+ export const Srcv = Template.bind({});
30
+ Srcv.args = {
31
+ id: 'performance-srcv',
32
+ pagination: true,
33
+ source: sourceSrcv,
34
+ };