@inseefr/lunatic 0.3.1-experimental → 0.3.2-experimental

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 (51) hide show
  1. package/lib/index.js +192 -189
  2. package/lib/index.js.map +1 -1
  3. package/package.json +2 -2
  4. package/src/components/component-wrapper/controls/validators/datepicker.js +25 -14
  5. package/src/components/component-wrapper/missing/component.js +37 -17
  6. package/src/components/datepicker/component.js +8 -12
  7. package/src/components/declarations/wrappers/input-declarations-wrapper.js +3 -2
  8. package/src/components/loop-constructor/block/index.js +1 -1
  9. package/src/components/loop-constructor/index.js +1 -1
  10. package/src/components/loop-constructor/roster/index.js +1 -1
  11. package/src/components/loop-constructor/wrapper/body-component.js +3 -0
  12. package/src/components/loop-constructor/wrapper/build-components.js +33 -33
  13. package/src/components/loop-constructor/wrapper/index.js +1 -1
  14. package/src/components/suggester/components/panel/option-container.js +1 -1
  15. package/src/components/suggester/suggester-wrapper.js +3 -3
  16. package/src/components/table/table.js +3 -1
  17. package/src/stories/loop-constructor/README.md +27 -27
  18. package/src/stories/loop-constructor/data-input-forced.json +64 -64
  19. package/src/stories/loop-constructor/data-input.json +100 -100
  20. package/src/stories/loop-constructor/data-loop-forced.json +66 -66
  21. package/src/stories/loop-constructor/data-loop-static-forced.json +66 -66
  22. package/src/stories/loop-constructor/data-loop-static.json +81 -81
  23. package/src/stories/loop-constructor/data-loop.json +81 -81
  24. package/src/stories/loop-constructor/data-roster-forced.json +68 -68
  25. package/src/stories/loop-constructor/data-roster.json +83 -83
  26. package/src/stories/loop-constructor/loop-constructor.stories.js +180 -180
  27. package/src/stories/questionnaire/arithmetic-management.json +47 -0
  28. package/src/stories/questionnaire/logement-queen.json +23390 -22706
  29. package/src/stories/questionnaire/questionnaire.stories.js +14 -14
  30. package/src/stories/suggester/data.json +4 -1
  31. package/src/stories/suggester/suggester-workers.stories.js +4 -1
  32. package/src/stories/utils/orchestrator-split.js +117 -0
  33. package/src/tests/utils/to-expose/handler/results/res-input-edited.json +1 -1
  34. package/src/tests/utils/to-expose/state/state.spec.js +59 -59
  35. package/src/utils/lib/index.js +1 -0
  36. package/src/utils/lib/pagination/navigation/shared.js +5 -5
  37. package/src/utils/lib/splitting.js +110 -0
  38. package/src/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +4 -2
  39. package/src/utils/suggester-workers/commons-tokenizer/filters/{filter-accents-to-lower.js → filter-accents.js} +2 -2
  40. package/src/utils/suggester-workers/commons-tokenizer/filters/{filter-accents-to-lower.spec.js → filter-accents.spec.js} +1 -1
  41. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +27 -1
  42. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +10 -0
  43. package/src/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +12 -0
  44. package/src/utils/suggester-workers/commons-tokenizer/index.js +1 -1
  45. package/src/utils/to-expose/handler.js +47 -28
  46. package/src/utils/to-expose/hooks/filter-components.js +106 -106
  47. package/src/utils/to-expose/hooks/index.js +2 -1
  48. package/src/utils/to-expose/hooks/lunatic-split.js +407 -0
  49. package/src/utils/to-expose/hooks/lunatic.js +16 -2
  50. package/src/utils/to-expose/index.js +11 -11
  51. package/src/utils/to-expose/state.js +23 -15
@@ -1,81 +1,81 @@
1
- {
2
- "components": [
3
- {
4
- "id": "k3ylzyo4",
5
- "componentType": "Loop",
6
- "mandatory": true,
7
- "positioning": "HORIZONTAL",
8
- "label": "\"Ajouter un individu\"",
9
- "conditionFilter": { "value": "true" },
10
- "bindingDependencies": ["PRENOM", "AGE"],
11
- "lines": { "min": 1, "max": 3 },
12
- "missingResponse": {
13
- "name": "ROSTER_MISSING"
14
- },
15
- "components": [
16
- {
17
- "componentType": "Input",
18
- "label": "Prénom",
19
- "conditionFilter": { "value": "true" },
20
- "maxLength": 30,
21
- "bindingDependencies": ["PRENOM"],
22
- "id": "k3yn2qmr",
23
- "response": {
24
- "name": "PRENOM"
25
- }
26
- },
27
- {
28
- "componentType": "InputNumber",
29
- "label": "Age",
30
- "conditionFilter": { "value": "true" },
31
- "min": 0,
32
- "max": 120,
33
- "decimals": 0,
34
- "bindingDependencies": ["AGE"],
35
- "id": "k3ymundt",
36
- "response": {
37
- "name": "AGE"
38
- }
39
- }
40
- ]
41
- }
42
- ],
43
- "variables": [
44
- {
45
- "variableType": "COLLECTED",
46
- "name": "PRENOM",
47
- "componentRef": "k3ylzyo4",
48
- "values": {
49
- "PREVIOUS": [null],
50
- "COLLECTED": [null],
51
- "FORCED": [null],
52
- "EDITED": [null],
53
- "INPUTED": [null]
54
- }
55
- },
56
- {
57
- "variableType": "COLLECTED",
58
- "name": "AGE",
59
- "componentRef": "k3ylzyo4",
60
- "values": {
61
- "PREVIOUS": [null],
62
- "COLLECTED": [null],
63
- "FORCED": [null],
64
- "EDITED": [null],
65
- "INPUTED": [null]
66
- }
67
- },
68
- {
69
- "variableType": "COLLECTED",
70
- "name": "ROSTER_MISSING",
71
- "componentRef": "k3ylzyo4",
72
- "values": {
73
- "PREVIOUS": null,
74
- "COLLECTED": null,
75
- "FORCED": null,
76
- "EDITED": null,
77
- "INPUTED": null
78
- }
79
- }
80
- ]
81
- }
1
+ {
2
+ "components": [
3
+ {
4
+ "id": "k3ylzyo4",
5
+ "componentType": "Loop",
6
+ "mandatory": true,
7
+ "positioning": "HORIZONTAL",
8
+ "label": "\"Ajouter un individu\"",
9
+ "conditionFilter": { "value": "true" },
10
+ "bindingDependencies": ["PRENOM", "AGE"],
11
+ "lines": { "min": 1, "max": 3 },
12
+ "missingResponse": {
13
+ "name": "ROSTER_MISSING"
14
+ },
15
+ "components": [
16
+ {
17
+ "componentType": "Input",
18
+ "label": "Prénom",
19
+ "conditionFilter": { "value": "true" },
20
+ "maxLength": 30,
21
+ "bindingDependencies": ["PRENOM"],
22
+ "id": "k3yn2qmr",
23
+ "response": {
24
+ "name": "PRENOM"
25
+ }
26
+ },
27
+ {
28
+ "componentType": "InputNumber",
29
+ "label": "Age",
30
+ "conditionFilter": { "value": "true" },
31
+ "min": 0,
32
+ "max": 120,
33
+ "decimals": 0,
34
+ "bindingDependencies": ["AGE"],
35
+ "id": "k3ymundt",
36
+ "response": {
37
+ "name": "AGE"
38
+ }
39
+ }
40
+ ]
41
+ }
42
+ ],
43
+ "variables": [
44
+ {
45
+ "variableType": "COLLECTED",
46
+ "name": "PRENOM",
47
+ "componentRef": "k3ylzyo4",
48
+ "values": {
49
+ "PREVIOUS": [null],
50
+ "COLLECTED": [null],
51
+ "FORCED": [null],
52
+ "EDITED": [null],
53
+ "INPUTED": [null]
54
+ }
55
+ },
56
+ {
57
+ "variableType": "COLLECTED",
58
+ "name": "AGE",
59
+ "componentRef": "k3ylzyo4",
60
+ "values": {
61
+ "PREVIOUS": [null],
62
+ "COLLECTED": [null],
63
+ "FORCED": [null],
64
+ "EDITED": [null],
65
+ "INPUTED": [null]
66
+ }
67
+ },
68
+ {
69
+ "variableType": "COLLECTED",
70
+ "name": "ROSTER_MISSING",
71
+ "componentRef": "k3ylzyo4",
72
+ "values": {
73
+ "PREVIOUS": null,
74
+ "COLLECTED": null,
75
+ "FORCED": null,
76
+ "EDITED": null,
77
+ "INPUTED": null
78
+ }
79
+ }
80
+ ]
81
+ }
@@ -1,68 +1,68 @@
1
- {
2
- "components": [
3
- {
4
- "id": "k3ylzyo4",
5
- "componentType": "RosterForLoop",
6
- "mandatory": true,
7
- "positioning": "HORIZONTAL",
8
- "label": "\"Qui sont les personnes qui habitent dans votre logement ?\"",
9
- "conditionFilter": { "value": "true" },
10
- "bindingDependencies": ["PRENOM", "AGE"],
11
- "lines": { "min": 1, "max": 3 },
12
- "headers": [
13
- { "headerCell": true, "label": "Prénom" },
14
- { "headerCell": true, "label": "Age" }
15
- ],
16
- "components": [
17
- {
18
- "componentType": "Input",
19
- "conditionFilter": { "value": "true" },
20
- "maxLength": 30,
21
- "bindingDependencies": ["PRENOM"],
22
- "id": "k3yn2qmr",
23
- "response": {
24
- "name": "PRENOM"
25
- }
26
- },
27
- {
28
- "componentType": "InputNumber",
29
- "conditionFilter": { "value": "true" },
30
- "min": 0,
31
- "max": 120,
32
- "decimals": 0,
33
- "bindingDependencies": ["AGE"],
34
- "id": "k3ymundt",
35
- "response": {
36
- "name": "AGE"
37
- }
38
- }
39
- ]
40
- }
41
- ],
42
- "variables": [
43
- {
44
- "variableType": "COLLECTED",
45
- "name": "PRENOM",
46
- "componentRef": "k3ylzyo4",
47
- "values": {
48
- "PREVIOUS": [null],
49
- "COLLECTED": ["Marco", "Mauro"],
50
- "FORCED": [null],
51
- "EDITED": [null],
52
- "INPUTED": [null]
53
- }
54
- },
55
- {
56
- "variableType": "COLLECTED",
57
- "name": "AGE",
58
- "componentRef": "k3ylzyo4",
59
- "values": {
60
- "PREVIOUS": [null],
61
- "COLLECTED": ["28", ""],
62
- "FORCED": [null],
63
- "EDITED": [null],
64
- "INPUTED": [null]
65
- }
66
- }
67
- ]
68
- }
1
+ {
2
+ "components": [
3
+ {
4
+ "id": "k3ylzyo4",
5
+ "componentType": "RosterForLoop",
6
+ "mandatory": true,
7
+ "positioning": "HORIZONTAL",
8
+ "label": "\"Qui sont les personnes qui habitent dans votre logement ?\"",
9
+ "conditionFilter": { "value": "true" },
10
+ "bindingDependencies": ["PRENOM", "AGE"],
11
+ "lines": { "min": 1, "max": 3 },
12
+ "headers": [
13
+ { "headerCell": true, "label": "Prénom" },
14
+ { "headerCell": true, "label": "Age" }
15
+ ],
16
+ "components": [
17
+ {
18
+ "componentType": "Input",
19
+ "conditionFilter": { "value": "true" },
20
+ "maxLength": 30,
21
+ "bindingDependencies": ["PRENOM"],
22
+ "id": "k3yn2qmr",
23
+ "response": {
24
+ "name": "PRENOM"
25
+ }
26
+ },
27
+ {
28
+ "componentType": "InputNumber",
29
+ "conditionFilter": { "value": "true" },
30
+ "min": 0,
31
+ "max": 120,
32
+ "decimals": 0,
33
+ "bindingDependencies": ["AGE"],
34
+ "id": "k3ymundt",
35
+ "response": {
36
+ "name": "AGE"
37
+ }
38
+ }
39
+ ]
40
+ }
41
+ ],
42
+ "variables": [
43
+ {
44
+ "variableType": "COLLECTED",
45
+ "name": "PRENOM",
46
+ "componentRef": "k3ylzyo4",
47
+ "values": {
48
+ "PREVIOUS": [null],
49
+ "COLLECTED": ["Marco", "Mauro"],
50
+ "FORCED": [null],
51
+ "EDITED": [null],
52
+ "INPUTED": [null]
53
+ }
54
+ },
55
+ {
56
+ "variableType": "COLLECTED",
57
+ "name": "AGE",
58
+ "componentRef": "k3ylzyo4",
59
+ "values": {
60
+ "PREVIOUS": [null],
61
+ "COLLECTED": ["28", ""],
62
+ "FORCED": [null],
63
+ "EDITED": [null],
64
+ "INPUTED": [null]
65
+ }
66
+ }
67
+ ]
68
+ }
@@ -1,83 +1,83 @@
1
- {
2
- "components": [
3
- {
4
- "id": "k3ylzyo4",
5
- "componentType": "RosterForLoop",
6
- "mandatory": true,
7
- "positioning": "HORIZONTAL",
8
- "label": "\"Qui sont les personnes qui habitent dans votre logement ?\"",
9
- "conditionFilter": { "value": "true" },
10
- "bindingDependencies": ["PRENOM", "AGE"],
11
- "lines": { "min": 1, "max": 3 },
12
- "headers": [
13
- { "headerCell": true, "label": "Prénom" },
14
- { "headerCell": true, "label": "Age" }
15
- ],
16
- "missingResponse": {
17
- "name": "ROSTER_MISSING"
18
- },
19
- "components": [
20
- {
21
- "componentType": "Input",
22
- "conditionFilter": { "value": "true" },
23
- "maxLength": 30,
24
- "bindingDependencies": ["PRENOM"],
25
- "id": "k3yn2qmr",
26
- "response": {
27
- "name": "PRENOM"
28
- }
29
- },
30
- {
31
- "componentType": "InputNumber",
32
- "conditionFilter": { "value": "true" },
33
- "min": 0,
34
- "max": 120,
35
- "decimals": 0,
36
- "bindingDependencies": ["AGE"],
37
- "id": "k3ymundt",
38
- "response": {
39
- "name": "AGE"
40
- }
41
- }
42
- ]
43
- }
44
- ],
45
- "variables": [
46
- {
47
- "variableType": "COLLECTED",
48
- "name": "PRENOM",
49
- "componentRef": "k3ylzyo4",
50
- "values": {
51
- "PREVIOUS": [null],
52
- "COLLECTED": [null],
53
- "FORCED": [null],
54
- "EDITED": [null],
55
- "INPUTED": [null]
56
- }
57
- },
58
- {
59
- "variableType": "COLLECTED",
60
- "name": "AGE",
61
- "componentRef": "k3ylzyo4",
62
- "values": {
63
- "PREVIOUS": [null],
64
- "COLLECTED": [null],
65
- "FORCED": [null],
66
- "EDITED": [null],
67
- "INPUTED": [null]
68
- }
69
- },
70
- {
71
- "variableType": "COLLECTED",
72
- "name": "ROSTER_MISSING",
73
- "componentRef": "k3ylzyo4",
74
- "values": {
75
- "PREVIOUS": null,
76
- "COLLECTED": null,
77
- "FORCED": null,
78
- "EDITED": null,
79
- "INPUTED": null
80
- }
81
- }
82
- ]
83
- }
1
+ {
2
+ "components": [
3
+ {
4
+ "id": "k3ylzyo4",
5
+ "componentType": "RosterForLoop",
6
+ "mandatory": true,
7
+ "positioning": "HORIZONTAL",
8
+ "label": "\"Qui sont les personnes qui habitent dans votre logement ?\"",
9
+ "conditionFilter": { "value": "true" },
10
+ "bindingDependencies": ["PRENOM", "AGE"],
11
+ "lines": { "min": 1, "max": 3 },
12
+ "headers": [
13
+ { "headerCell": true, "label": "Prénom" },
14
+ { "headerCell": true, "label": "Age" }
15
+ ],
16
+ "missingResponse": {
17
+ "name": "ROSTER_MISSING"
18
+ },
19
+ "components": [
20
+ {
21
+ "componentType": "Input",
22
+ "conditionFilter": { "value": "true" },
23
+ "maxLength": 30,
24
+ "bindingDependencies": ["PRENOM"],
25
+ "id": "k3yn2qmr",
26
+ "response": {
27
+ "name": "PRENOM"
28
+ }
29
+ },
30
+ {
31
+ "componentType": "InputNumber",
32
+ "conditionFilter": { "value": "true" },
33
+ "min": 0,
34
+ "max": 120,
35
+ "decimals": 0,
36
+ "bindingDependencies": ["AGE"],
37
+ "id": "k3ymundt",
38
+ "response": {
39
+ "name": "AGE"
40
+ }
41
+ }
42
+ ]
43
+ }
44
+ ],
45
+ "variables": [
46
+ {
47
+ "variableType": "COLLECTED",
48
+ "name": "PRENOM",
49
+ "componentRef": "k3ylzyo4",
50
+ "values": {
51
+ "PREVIOUS": [null],
52
+ "COLLECTED": [null],
53
+ "FORCED": [null],
54
+ "EDITED": [null],
55
+ "INPUTED": [null]
56
+ }
57
+ },
58
+ {
59
+ "variableType": "COLLECTED",
60
+ "name": "AGE",
61
+ "componentRef": "k3ylzyo4",
62
+ "values": {
63
+ "PREVIOUS": [null],
64
+ "COLLECTED": [null],
65
+ "FORCED": [null],
66
+ "EDITED": [null],
67
+ "INPUTED": [null]
68
+ }
69
+ },
70
+ {
71
+ "variableType": "COLLECTED",
72
+ "name": "ROSTER_MISSING",
73
+ "componentRef": "k3ylzyo4",
74
+ "values": {
75
+ "PREVIOUS": null,
76
+ "COLLECTED": null,
77
+ "FORCED": null,
78
+ "EDITED": null,
79
+ "INPUTED": null
80
+ }
81
+ }
82
+ ]
83
+ }