@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,100 +1,100 @@
1
- {
2
- "components": [
3
- {
4
- "id": "nn",
5
- "componentType": "InputNumber",
6
- "mandatory": false,
7
- "min": 1,
8
- "max": 4,
9
- "decimals": 0,
10
- "label": "Loop Num (affichera le nombre saisi + 1)",
11
- "response": {
12
- "name": "NUM"
13
- },
14
- "missingResponse": {
15
- "name": "NUM_MISSING"
16
- }
17
- },
18
- {
19
- "id": "idLoop",
20
- "label": "boucle individu",
21
- "componentType": "Loop",
22
- "iterations": "NUM_ONE",
23
- "conditionFilter": { "value": "true" },
24
- "loopDependencies": ["NUM_ONE"],
25
- "bindingDependencies": ["PRENOM", "NUM_ONE"],
26
- "missingResponse": {
27
- "name": "ROSTER_MISSING"
28
- },
29
- "components": [
30
- {
31
- "id": "k3ym6x16",
32
- "label": "Prénom :",
33
- "componentType": "Input",
34
- "conditionFilter": { "value": "true" },
35
- "mandatory": false,
36
- "bindingDependencies": ["PRENOM"],
37
- "response": {
38
- "name": "PRENOM"
39
- }
40
- }
41
- ]
42
- }
43
- ],
44
- "variables": [
45
- {
46
- "variableType": "COLLECTED",
47
- "name": "NUM",
48
- "componentRef": "nn",
49
- "values": {
50
- "PREVIOUS": null,
51
- "COLLECTED": null,
52
- "FORCED": null,
53
- "EDITED": null,
54
- "INPUTED": null
55
- }
56
- },
57
- {
58
- "variableType": "COLLECTED",
59
- "name": "NUM_MISSING",
60
- "componentRef": "nn",
61
- "values": {
62
- "PREVIOUS": null,
63
- "COLLECTED": null,
64
- "FORCED": null,
65
- "EDITED": null,
66
- "INPUTED": null
67
- }
68
- },
69
- {
70
- "variableType": "COLLECTED",
71
- "name": "PRENOM",
72
- "componentRef": "idLoop",
73
- "values": {
74
- "PREVIOUS": [null],
75
- "COLLECTED": [null],
76
- "FORCED": [null],
77
- "EDITED": [null],
78
- "INPUTED": [null]
79
- }
80
- },
81
- {
82
- "variableType": "COLLECTED",
83
- "name": "ROSTER_MISSING",
84
- "componentRef": "idLoop",
85
- "values": {
86
- "PREVIOUS": [null],
87
- "COLLECTED": [null],
88
- "FORCED": [null],
89
- "EDITED": [null],
90
- "INPUTED": [null]
91
- }
92
- },
93
- {
94
- "variableType": "CALCULATED",
95
- "expression": "cast(NUM, integer) + 1",
96
- "name": "NUM_ONE",
97
- "bindingDependencies": ["NUM"]
98
- }
99
- ]
100
- }
1
+ {
2
+ "components": [
3
+ {
4
+ "id": "nn",
5
+ "componentType": "InputNumber",
6
+ "mandatory": false,
7
+ "min": 1,
8
+ "max": 4,
9
+ "decimals": 0,
10
+ "label": "Loop Num (affichera le nombre saisi + 1)",
11
+ "response": {
12
+ "name": "NUM"
13
+ },
14
+ "missingResponse": {
15
+ "name": "NUM_MISSING"
16
+ }
17
+ },
18
+ {
19
+ "id": "idLoop",
20
+ "label": "boucle individu",
21
+ "componentType": "Loop",
22
+ "iterations": "NUM_ONE",
23
+ "conditionFilter": { "value": "true" },
24
+ "loopDependencies": ["NUM_ONE"],
25
+ "bindingDependencies": ["PRENOM", "NUM_ONE"],
26
+ "missingResponse": {
27
+ "name": "ROSTER_MISSING"
28
+ },
29
+ "components": [
30
+ {
31
+ "id": "k3ym6x16",
32
+ "label": "Prénom :",
33
+ "componentType": "Input",
34
+ "conditionFilter": { "value": "true" },
35
+ "mandatory": false,
36
+ "bindingDependencies": ["PRENOM"],
37
+ "response": {
38
+ "name": "PRENOM"
39
+ }
40
+ }
41
+ ]
42
+ }
43
+ ],
44
+ "variables": [
45
+ {
46
+ "variableType": "COLLECTED",
47
+ "name": "NUM",
48
+ "componentRef": "nn",
49
+ "values": {
50
+ "PREVIOUS": null,
51
+ "COLLECTED": null,
52
+ "FORCED": null,
53
+ "EDITED": null,
54
+ "INPUTED": null
55
+ }
56
+ },
57
+ {
58
+ "variableType": "COLLECTED",
59
+ "name": "NUM_MISSING",
60
+ "componentRef": "nn",
61
+ "values": {
62
+ "PREVIOUS": null,
63
+ "COLLECTED": null,
64
+ "FORCED": null,
65
+ "EDITED": null,
66
+ "INPUTED": null
67
+ }
68
+ },
69
+ {
70
+ "variableType": "COLLECTED",
71
+ "name": "PRENOM",
72
+ "componentRef": "idLoop",
73
+ "values": {
74
+ "PREVIOUS": [null],
75
+ "COLLECTED": [null],
76
+ "FORCED": [null],
77
+ "EDITED": [null],
78
+ "INPUTED": [null]
79
+ }
80
+ },
81
+ {
82
+ "variableType": "COLLECTED",
83
+ "name": "ROSTER_MISSING",
84
+ "componentRef": "idLoop",
85
+ "values": {
86
+ "PREVIOUS": [null],
87
+ "COLLECTED": [null],
88
+ "FORCED": [null],
89
+ "EDITED": [null],
90
+ "INPUTED": [null]
91
+ }
92
+ },
93
+ {
94
+ "variableType": "CALCULATED",
95
+ "expression": "cast(NUM, integer) + 1",
96
+ "name": "NUM_ONE",
97
+ "bindingDependencies": ["NUM"]
98
+ }
99
+ ]
100
+ }
@@ -1,66 +1,66 @@
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
- "components": [
13
- {
14
- "componentType": "Input",
15
- "label": "Prénom",
16
- "conditionFilter": { "value": "true" },
17
- "maxLength": 30,
18
- "bindingDependencies": ["PRENOM"],
19
- "id": "k3yn2qmr",
20
- "response": {
21
- "name": "PRENOM"
22
- }
23
- },
24
- {
25
- "componentType": "InputNumber",
26
- "label": "Age",
27
- "conditionFilter": { "value": "true" },
28
- "min": 0,
29
- "max": 120,
30
- "decimals": 0,
31
- "bindingDependencies": ["AGE"],
32
- "id": "k3ymundt",
33
- "response": {
34
- "name": "AGE"
35
- }
36
- }
37
- ]
38
- }
39
- ],
40
- "variables": [
41
- {
42
- "variableType": "COLLECTED",
43
- "name": "PRENOM",
44
- "componentRef": "k3ylzyo4",
45
- "values": {
46
- "PREVIOUS": [null],
47
- "COLLECTED": ["Mauro", "Marco"],
48
- "FORCED": [null],
49
- "EDITED": [null],
50
- "INPUTED": [null]
51
- }
52
- },
53
- {
54
- "variableType": "COLLECTED",
55
- "name": "AGE",
56
- "componentRef": "k3ylzyo4",
57
- "values": {
58
- "PREVIOUS": [null],
59
- "COLLECTED": [null],
60
- "FORCED": [null],
61
- "EDITED": [null],
62
- "INPUTED": [null]
63
- }
64
- }
65
- ]
66
- }
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
+ "components": [
13
+ {
14
+ "componentType": "Input",
15
+ "label": "Prénom",
16
+ "conditionFilter": { "value": "true" },
17
+ "maxLength": 30,
18
+ "bindingDependencies": ["PRENOM"],
19
+ "id": "k3yn2qmr",
20
+ "response": {
21
+ "name": "PRENOM"
22
+ }
23
+ },
24
+ {
25
+ "componentType": "InputNumber",
26
+ "label": "Age",
27
+ "conditionFilter": { "value": "true" },
28
+ "min": 0,
29
+ "max": 120,
30
+ "decimals": 0,
31
+ "bindingDependencies": ["AGE"],
32
+ "id": "k3ymundt",
33
+ "response": {
34
+ "name": "AGE"
35
+ }
36
+ }
37
+ ]
38
+ }
39
+ ],
40
+ "variables": [
41
+ {
42
+ "variableType": "COLLECTED",
43
+ "name": "PRENOM",
44
+ "componentRef": "k3ylzyo4",
45
+ "values": {
46
+ "PREVIOUS": [null],
47
+ "COLLECTED": ["Mauro", "Marco"],
48
+ "FORCED": [null],
49
+ "EDITED": [null],
50
+ "INPUTED": [null]
51
+ }
52
+ },
53
+ {
54
+ "variableType": "COLLECTED",
55
+ "name": "AGE",
56
+ "componentRef": "k3ylzyo4",
57
+ "values": {
58
+ "PREVIOUS": [null],
59
+ "COLLECTED": [null],
60
+ "FORCED": [null],
61
+ "EDITED": [null],
62
+ "INPUTED": [null]
63
+ }
64
+ }
65
+ ]
66
+ }
@@ -1,66 +1,66 @@
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": "3", "max": "3" },
12
- "components": [
13
- {
14
- "componentType": "Input",
15
- "label": "Prénom",
16
- "conditionFilter": { "value": "true" },
17
- "maxLength": 30,
18
- "bindingDependencies": ["PRENOM"],
19
- "id": "k3yn2qmr",
20
- "response": {
21
- "name": "PRENOM"
22
- }
23
- },
24
- {
25
- "componentType": "InputNumber",
26
- "label": "Age",
27
- "conditionFilter": { "value": "true" },
28
- "min": 0,
29
- "max": 120,
30
- "decimals": 0,
31
- "bindingDependencies": ["AGE"],
32
- "id": "k3ymundt",
33
- "response": {
34
- "name": "AGE"
35
- }
36
- }
37
- ]
38
- }
39
- ],
40
- "variables": [
41
- {
42
- "variableType": "COLLECTED",
43
- "name": "PRENOM",
44
- "componentRef": "k3ylzyo4",
45
- "values": {
46
- "PREVIOUS": [null],
47
- "COLLECTED": ["Marco"],
48
- "FORCED": [null],
49
- "EDITED": [null],
50
- "INPUTED": [null]
51
- }
52
- },
53
- {
54
- "variableType": "COLLECTED",
55
- "name": "AGE",
56
- "componentRef": "k3ylzyo4",
57
- "values": {
58
- "PREVIOUS": [null],
59
- "COLLECTED": ["28"],
60
- "FORCED": [null],
61
- "EDITED": [null],
62
- "INPUTED": [null]
63
- }
64
- }
65
- ]
66
- }
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": "3", "max": "3" },
12
+ "components": [
13
+ {
14
+ "componentType": "Input",
15
+ "label": "Prénom",
16
+ "conditionFilter": { "value": "true" },
17
+ "maxLength": 30,
18
+ "bindingDependencies": ["PRENOM"],
19
+ "id": "k3yn2qmr",
20
+ "response": {
21
+ "name": "PRENOM"
22
+ }
23
+ },
24
+ {
25
+ "componentType": "InputNumber",
26
+ "label": "Age",
27
+ "conditionFilter": { "value": "true" },
28
+ "min": 0,
29
+ "max": 120,
30
+ "decimals": 0,
31
+ "bindingDependencies": ["AGE"],
32
+ "id": "k3ymundt",
33
+ "response": {
34
+ "name": "AGE"
35
+ }
36
+ }
37
+ ]
38
+ }
39
+ ],
40
+ "variables": [
41
+ {
42
+ "variableType": "COLLECTED",
43
+ "name": "PRENOM",
44
+ "componentRef": "k3ylzyo4",
45
+ "values": {
46
+ "PREVIOUS": [null],
47
+ "COLLECTED": ["Marco"],
48
+ "FORCED": [null],
49
+ "EDITED": [null],
50
+ "INPUTED": [null]
51
+ }
52
+ },
53
+ {
54
+ "variableType": "COLLECTED",
55
+ "name": "AGE",
56
+ "componentRef": "k3ylzyo4",
57
+ "values": {
58
+ "PREVIOUS": [null],
59
+ "COLLECTED": ["28"],
60
+ "FORCED": [null],
61
+ "EDITED": [null],
62
+ "INPUTED": [null]
63
+ }
64
+ }
65
+ ]
66
+ }
@@ -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": "3", "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": "3", "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
+ }