@inseefr/lunatic 0.3.4-experimental → 0.3.7-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 (85) hide show
  1. package/lib/index.js +2 -2
  2. package/lib/index.js.map +1 -1
  3. package/package.json +2 -1
  4. package/src/components/breadcrumb/component.js +29 -29
  5. package/src/components/button/component.js +53 -53
  6. package/src/components/button/index.js +1 -1
  7. package/src/components/checkbox/index.js +3 -3
  8. package/src/components/datepicker/index.js +1 -1
  9. package/src/components/declarations/index.js +1 -1
  10. package/src/components/declarations/wrappers/list-declarations-wrapper.js +232 -232
  11. package/src/components/filter-description/component.js +42 -42
  12. package/src/components/icon/component.js +33 -33
  13. package/src/components/index.js +2 -0
  14. package/src/components/input/index.js +2 -2
  15. package/src/components/loop/index.js +1 -1
  16. package/src/components/loop-constructor/wrapper/body-component.js +13 -1
  17. package/src/components/radio/index.js +1 -1
  18. package/src/components/sequence/index.js +1 -1
  19. package/src/components/subsequence/index.js +1 -1
  20. package/src/components/suggester/check-store.js +70 -70
  21. package/src/components/suggester/components/create-on-keydown-callback.js +28 -28
  22. package/src/components/tooltip/response.js +52 -52
  23. package/src/stories/checkbox-boolean/data-forced.json +48 -48
  24. package/src/stories/checkbox-group/data-vtl.json +102 -102
  25. package/src/stories/icons/icons.stories.js +16 -16
  26. package/src/stories/questionnaire/kish.json +275 -0
  27. package/src/stories/questionnaire/questionnaire.stories.js +12 -0
  28. package/src/stories/utils/custom-lunatic.scss +23 -23
  29. package/src/tests/components/breadcrumb.spec.js +13 -13
  30. package/src/tests/components/button.spec.js +11 -11
  31. package/src/tests/components/checkbox-boolean.spec.js +45 -45
  32. package/src/tests/components/checkbox-group.spec.js +53 -53
  33. package/src/tests/components/checkbox-one.spec.js +32 -32
  34. package/src/tests/components/datepicker.spec.js +22 -22
  35. package/src/tests/components/declarations-wrappers/input-declarations-wrapper.spec.js +67 -67
  36. package/src/tests/components/declarations-wrappers/list-declarations-wrapper.spec.js +52 -52
  37. package/src/tests/components/declarations-wrappers/simple-declarations-wrapper.spec.js +21 -21
  38. package/src/tests/components/declarations.spec.js +46 -46
  39. package/src/tests/components/input.spec.js +18 -18
  40. package/src/tests/components/loops/loop-static.json +66 -66
  41. package/src/tests/components/loops/loop.json +258 -258
  42. package/src/tests/components/loops/loop.spec.js +30 -30
  43. package/src/tests/components/loops/roster-for-loop.spec.js +18 -18
  44. package/src/tests/components/progress-bar.spec.js +15 -15
  45. package/src/tests/components/radio.spec.js +27 -27
  46. package/src/tests/components/sequence.spec.js +9 -9
  47. package/src/tests/components/subsequence.spec.js +9 -9
  48. package/src/tests/components/table.spec.js +11 -11
  49. package/src/tests/components/textarea.spec.js +18 -18
  50. package/src/tests/components/tooltip.spec.js +25 -25
  51. package/src/tests/setup/setupTests.js +4 -4
  52. package/src/tests/utils/lib/alphabet.spec.js +36 -36
  53. package/src/tests/utils/lib/array.spec.js +22 -22
  54. package/src/tests/utils/lib/checkbox/group.spec.js +72 -72
  55. package/src/tests/utils/lib/decorator/title-decorator.spec.js +12 -12
  56. package/src/tests/utils/lib/input-number.spec.js +18 -18
  57. package/src/tests/utils/lib/items-positioning.spec.js +17 -17
  58. package/src/tests/utils/lib/label-position.spec.js +22 -22
  59. package/src/tests/utils/lib/loops/bindings.spec.js +75 -75
  60. package/src/tests/utils/lib/loops/shared.spec.js +82 -82
  61. package/src/tests/utils/lib/missing/missing.spec.js +74 -74
  62. package/src/tests/utils/lib/missing/mock.js +137 -137
  63. package/src/tests/utils/lib/pagination/shared.spec.js +42 -42
  64. package/src/tests/utils/lib/responses.spec.js +64 -64
  65. package/src/tests/utils/lib/style.spec.js +26 -26
  66. package/src/tests/utils/lib/tooltip/build-response.spec.js +95 -95
  67. package/src/tests/utils/lib/tooltip/content.spec.js +109 -109
  68. package/src/tests/utils/to-expose/handler/handler.spec.js +94 -94
  69. package/src/tests/utils/to-expose/handler/questionnaire.json +158 -158
  70. package/src/tests/utils/to-expose/handler/results/index.js +6 -6
  71. package/src/tests/utils/to-expose/handler/results/res-double.json +158 -158
  72. package/src/tests/utils/to-expose/handler/results/res-input-collected.json +158 -158
  73. package/src/tests/utils/to-expose/handler/results/res-loop.json +158 -158
  74. package/src/tests/utils/to-expose/handler/results/res-matrix.json +158 -158
  75. package/src/tests/utils/to-expose/handler/results/res-responses.json +158 -158
  76. package/src/tests/utils/to-expose/hooks/use-lunatic.spec.js +46 -46
  77. package/src/tests/utils/to-expose/init-questionnaire/data.json +12 -12
  78. package/src/tests/utils/to-expose/init-questionnaire/init-questionnaire.spec.js +19 -19
  79. package/src/tests/utils/to-expose/interpret/interpret.spec.js +48 -48
  80. package/src/tests/utils/to-expose/state/questionnaire.json +61 -61
  81. package/src/tests/utils/to-expose/state/results.js +78 -78
  82. package/src/utils/lib/tooltip/build-response.js +41 -41
  83. package/src/utils/store-tools/create/index.js +1 -1
  84. package/src/utils/store-tools/create/update-store-info.js +26 -26
  85. package/src/utils/store-tools/index.js +5 -5
@@ -1,158 +1,158 @@
1
- {
2
- "components": [
3
- { "id": "1", "componentType": "Sequence", "depth": 1 },
4
- {
5
- "id": "2",
6
- "componentType": "Input",
7
- "response": {
8
- "name": "inputOk",
9
- "values": {
10
- "PREVIOUS": null,
11
- "COLLECTED": "My new input",
12
- "FORCED": null,
13
- "EDITED": null,
14
- "INPUTED": null
15
- }
16
- },
17
- "depth": 1
18
- },
19
- {
20
- "id": "3",
21
- "componentType": "CheckboxGroup",
22
- "responses": [
23
- {
24
- "response": {
25
- "name": "check1",
26
- "values": {
27
- "PREVIOUS": null,
28
- "COLLECTED": true,
29
- "FORCED": null,
30
- "EDITED": null,
31
- "INPUTED": null
32
- }
33
- }
34
- },
35
- {
36
- "response": {
37
- "name": "check2",
38
- "values": {
39
- "PREVIOUS": null,
40
- "COLLECTED": false,
41
- "FORCED": true,
42
- "EDITED": null,
43
- "INPUTED": null
44
- }
45
- }
46
- }
47
- ],
48
- "depth": 1
49
- },
50
- {
51
- "id": "4",
52
- "componentType": "Table",
53
- "cells": [
54
- [
55
- { "label": "label", "depth": 1 },
56
- {
57
- "componentType": "Radio",
58
- "response": {
59
- "name": "table11",
60
- "values": {
61
- "PREVIOUS": null,
62
- "COLLECTED": "1",
63
- "FORCED": null,
64
- "EDITED": null,
65
- "INPUTED": null
66
- }
67
- },
68
- "depth": 1
69
- }
70
- ]
71
- ],
72
- "depth": 1
73
- },
74
- {
75
- "id": "5",
76
- "componentType": "RosterForLoop",
77
- "components": [
78
- {
79
- "componentType": "Input",
80
- "response": {
81
- "name": "Roster",
82
- "values": {
83
- "PREVIOUS": [null],
84
- "COLLECTED": ["ok"],
85
- "FORCED": [null],
86
- "EDITED": [null],
87
- "INPUTED": [null]
88
- }
89
- },
90
- "depth": 2
91
- }
92
- ],
93
- "depth": 1
94
- }
95
- ],
96
- "variables": {
97
- "EXTERNAL": { "VAR_EXTERNAL": "Value VAR_EXTERNAL" },
98
- "CALCULATED": {
99
- "Test": {
100
- "expression": "inputOk || \" ok\"",
101
- "value": "My new input ok",
102
- "bindingDependencies": ["inputOk"]
103
- }
104
- },
105
- "COLLECTED": {
106
- "inputOk": {
107
- "componentRef": "2",
108
- "values": {
109
- "PREVIOUS": null,
110
- "COLLECTED": "My new input",
111
- "FORCED": null,
112
- "EDITED": null,
113
- "INPUTED": null
114
- }
115
- },
116
- "check1": {
117
- "componentRef": "3",
118
- "values": {
119
- "PREVIOUS": null,
120
- "COLLECTED": true,
121
- "FORCED": null,
122
- "EDITED": null,
123
- "INPUTED": null
124
- }
125
- },
126
- "check2": {
127
- "componentRef": "3",
128
- "values": {
129
- "PREVIOUS": null,
130
- "COLLECTED": false,
131
- "FORCED": true,
132
- "EDITED": null,
133
- "INPUTED": null
134
- }
135
- },
136
- "table11": {
137
- "componentRef": "4",
138
- "values": {
139
- "PREVIOUS": null,
140
- "COLLECTED": "1",
141
- "FORCED": null,
142
- "EDITED": null,
143
- "INPUTED": null
144
- }
145
- },
146
- "Roster": {
147
- "componentRef": "5",
148
- "values": {
149
- "PREVIOUS": [null],
150
- "COLLECTED": ["ok"],
151
- "FORCED": [null],
152
- "EDITED": [null],
153
- "INPUTED": [null]
154
- }
155
- }
156
- }
157
- }
158
- }
1
+ {
2
+ "components": [
3
+ { "id": "1", "componentType": "Sequence", "depth": 1 },
4
+ {
5
+ "id": "2",
6
+ "componentType": "Input",
7
+ "response": {
8
+ "name": "inputOk",
9
+ "values": {
10
+ "PREVIOUS": null,
11
+ "COLLECTED": "My new input",
12
+ "FORCED": null,
13
+ "EDITED": null,
14
+ "INPUTED": null
15
+ }
16
+ },
17
+ "depth": 1
18
+ },
19
+ {
20
+ "id": "3",
21
+ "componentType": "CheckboxGroup",
22
+ "responses": [
23
+ {
24
+ "response": {
25
+ "name": "check1",
26
+ "values": {
27
+ "PREVIOUS": null,
28
+ "COLLECTED": true,
29
+ "FORCED": null,
30
+ "EDITED": null,
31
+ "INPUTED": null
32
+ }
33
+ }
34
+ },
35
+ {
36
+ "response": {
37
+ "name": "check2",
38
+ "values": {
39
+ "PREVIOUS": null,
40
+ "COLLECTED": false,
41
+ "FORCED": true,
42
+ "EDITED": null,
43
+ "INPUTED": null
44
+ }
45
+ }
46
+ }
47
+ ],
48
+ "depth": 1
49
+ },
50
+ {
51
+ "id": "4",
52
+ "componentType": "Table",
53
+ "cells": [
54
+ [
55
+ { "label": "label", "depth": 1 },
56
+ {
57
+ "componentType": "Radio",
58
+ "response": {
59
+ "name": "table11",
60
+ "values": {
61
+ "PREVIOUS": null,
62
+ "COLLECTED": "1",
63
+ "FORCED": null,
64
+ "EDITED": null,
65
+ "INPUTED": null
66
+ }
67
+ },
68
+ "depth": 1
69
+ }
70
+ ]
71
+ ],
72
+ "depth": 1
73
+ },
74
+ {
75
+ "id": "5",
76
+ "componentType": "RosterForLoop",
77
+ "components": [
78
+ {
79
+ "componentType": "Input",
80
+ "response": {
81
+ "name": "Roster",
82
+ "values": {
83
+ "PREVIOUS": [null],
84
+ "COLLECTED": ["ok"],
85
+ "FORCED": [null],
86
+ "EDITED": [null],
87
+ "INPUTED": [null]
88
+ }
89
+ },
90
+ "depth": 2
91
+ }
92
+ ],
93
+ "depth": 1
94
+ }
95
+ ],
96
+ "variables": {
97
+ "EXTERNAL": { "VAR_EXTERNAL": "Value VAR_EXTERNAL" },
98
+ "CALCULATED": {
99
+ "Test": {
100
+ "expression": "inputOk || \" ok\"",
101
+ "value": "My new input ok",
102
+ "bindingDependencies": ["inputOk"]
103
+ }
104
+ },
105
+ "COLLECTED": {
106
+ "inputOk": {
107
+ "componentRef": "2",
108
+ "values": {
109
+ "PREVIOUS": null,
110
+ "COLLECTED": "My new input",
111
+ "FORCED": null,
112
+ "EDITED": null,
113
+ "INPUTED": null
114
+ }
115
+ },
116
+ "check1": {
117
+ "componentRef": "3",
118
+ "values": {
119
+ "PREVIOUS": null,
120
+ "COLLECTED": true,
121
+ "FORCED": null,
122
+ "EDITED": null,
123
+ "INPUTED": null
124
+ }
125
+ },
126
+ "check2": {
127
+ "componentRef": "3",
128
+ "values": {
129
+ "PREVIOUS": null,
130
+ "COLLECTED": false,
131
+ "FORCED": true,
132
+ "EDITED": null,
133
+ "INPUTED": null
134
+ }
135
+ },
136
+ "table11": {
137
+ "componentRef": "4",
138
+ "values": {
139
+ "PREVIOUS": null,
140
+ "COLLECTED": "1",
141
+ "FORCED": null,
142
+ "EDITED": null,
143
+ "INPUTED": null
144
+ }
145
+ },
146
+ "Roster": {
147
+ "componentRef": "5",
148
+ "values": {
149
+ "PREVIOUS": [null],
150
+ "COLLECTED": ["ok"],
151
+ "FORCED": [null],
152
+ "EDITED": [null],
153
+ "INPUTED": [null]
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
@@ -1,158 +1,158 @@
1
- {
2
- "components": [
3
- { "id": "1", "componentType": "Sequence", "depth": 1 },
4
- {
5
- "id": "2",
6
- "componentType": "Input",
7
- "response": {
8
- "name": "inputOk",
9
- "values": {
10
- "PREVIOUS": null,
11
- "COLLECTED": "My input",
12
- "FORCED": null,
13
- "EDITED": null,
14
- "INPUTED": null
15
- }
16
- },
17
- "depth": 1
18
- },
19
- {
20
- "id": "3",
21
- "componentType": "CheckboxGroup",
22
- "responses": [
23
- {
24
- "response": {
25
- "name": "check1",
26
- "values": {
27
- "PREVIOUS": null,
28
- "COLLECTED": true,
29
- "FORCED": null,
30
- "EDITED": null,
31
- "INPUTED": null
32
- }
33
- }
34
- },
35
- {
36
- "response": {
37
- "name": "check2",
38
- "values": {
39
- "PREVIOUS": null,
40
- "COLLECTED": false,
41
- "FORCED": true,
42
- "EDITED": null,
43
- "INPUTED": null
44
- }
45
- }
46
- }
47
- ],
48
- "depth": 1
49
- },
50
- {
51
- "id": "4",
52
- "componentType": "Table",
53
- "cells": [
54
- [
55
- { "label": "label", "depth": 1 },
56
- {
57
- "componentType": "Radio",
58
- "response": {
59
- "name": "table11",
60
- "values": {
61
- "PREVIOUS": null,
62
- "COLLECTED": "1",
63
- "FORCED": null,
64
- "EDITED": null,
65
- "INPUTED": null
66
- }
67
- },
68
- "depth": 1
69
- }
70
- ]
71
- ],
72
- "depth": 1
73
- },
74
- {
75
- "id": "5",
76
- "componentType": "RosterForLoop",
77
- "components": [
78
- {
79
- "componentType": "Input",
80
- "response": {
81
- "name": "Roster",
82
- "values": {
83
- "PREVIOUS": [null],
84
- "COLLECTED": ["ko"],
85
- "FORCED": [null],
86
- "EDITED": [null],
87
- "INPUTED": [null]
88
- }
89
- },
90
- "depth": 2
91
- }
92
- ],
93
- "depth": 1
94
- }
95
- ],
96
- "variables": {
97
- "EXTERNAL": { "VAR_EXTERNAL": "Value VAR_EXTERNAL" },
98
- "CALCULATED": {
99
- "Test": {
100
- "expression": "inputOk || \" ok\"",
101
- "value": "My input ok",
102
- "bindingDependencies": ["inputOk"]
103
- }
104
- },
105
- "COLLECTED": {
106
- "inputOk": {
107
- "componentRef": "2",
108
- "values": {
109
- "PREVIOUS": null,
110
- "COLLECTED": "My input",
111
- "FORCED": null,
112
- "EDITED": null,
113
- "INPUTED": null
114
- }
115
- },
116
- "check1": {
117
- "componentRef": "3",
118
- "values": {
119
- "PREVIOUS": null,
120
- "COLLECTED": true,
121
- "FORCED": null,
122
- "EDITED": null,
123
- "INPUTED": null
124
- }
125
- },
126
- "check2": {
127
- "componentRef": "3",
128
- "values": {
129
- "PREVIOUS": null,
130
- "COLLECTED": false,
131
- "FORCED": true,
132
- "EDITED": null,
133
- "INPUTED": null
134
- }
135
- },
136
- "table11": {
137
- "componentRef": "4",
138
- "values": {
139
- "PREVIOUS": null,
140
- "COLLECTED": "1",
141
- "FORCED": null,
142
- "EDITED": null,
143
- "INPUTED": null
144
- }
145
- },
146
- "Roster": {
147
- "componentRef": "5",
148
- "values": {
149
- "PREVIOUS": [null],
150
- "COLLECTED": ["ko"],
151
- "FORCED": [null],
152
- "EDITED": [null],
153
- "INPUTED": [null]
154
- }
155
- }
156
- }
157
- }
158
- }
1
+ {
2
+ "components": [
3
+ { "id": "1", "componentType": "Sequence", "depth": 1 },
4
+ {
5
+ "id": "2",
6
+ "componentType": "Input",
7
+ "response": {
8
+ "name": "inputOk",
9
+ "values": {
10
+ "PREVIOUS": null,
11
+ "COLLECTED": "My input",
12
+ "FORCED": null,
13
+ "EDITED": null,
14
+ "INPUTED": null
15
+ }
16
+ },
17
+ "depth": 1
18
+ },
19
+ {
20
+ "id": "3",
21
+ "componentType": "CheckboxGroup",
22
+ "responses": [
23
+ {
24
+ "response": {
25
+ "name": "check1",
26
+ "values": {
27
+ "PREVIOUS": null,
28
+ "COLLECTED": true,
29
+ "FORCED": null,
30
+ "EDITED": null,
31
+ "INPUTED": null
32
+ }
33
+ }
34
+ },
35
+ {
36
+ "response": {
37
+ "name": "check2",
38
+ "values": {
39
+ "PREVIOUS": null,
40
+ "COLLECTED": false,
41
+ "FORCED": true,
42
+ "EDITED": null,
43
+ "INPUTED": null
44
+ }
45
+ }
46
+ }
47
+ ],
48
+ "depth": 1
49
+ },
50
+ {
51
+ "id": "4",
52
+ "componentType": "Table",
53
+ "cells": [
54
+ [
55
+ { "label": "label", "depth": 1 },
56
+ {
57
+ "componentType": "Radio",
58
+ "response": {
59
+ "name": "table11",
60
+ "values": {
61
+ "PREVIOUS": null,
62
+ "COLLECTED": "1",
63
+ "FORCED": null,
64
+ "EDITED": null,
65
+ "INPUTED": null
66
+ }
67
+ },
68
+ "depth": 1
69
+ }
70
+ ]
71
+ ],
72
+ "depth": 1
73
+ },
74
+ {
75
+ "id": "5",
76
+ "componentType": "RosterForLoop",
77
+ "components": [
78
+ {
79
+ "componentType": "Input",
80
+ "response": {
81
+ "name": "Roster",
82
+ "values": {
83
+ "PREVIOUS": [null],
84
+ "COLLECTED": ["ko"],
85
+ "FORCED": [null],
86
+ "EDITED": [null],
87
+ "INPUTED": [null]
88
+ }
89
+ },
90
+ "depth": 2
91
+ }
92
+ ],
93
+ "depth": 1
94
+ }
95
+ ],
96
+ "variables": {
97
+ "EXTERNAL": { "VAR_EXTERNAL": "Value VAR_EXTERNAL" },
98
+ "CALCULATED": {
99
+ "Test": {
100
+ "expression": "inputOk || \" ok\"",
101
+ "value": "My input ok",
102
+ "bindingDependencies": ["inputOk"]
103
+ }
104
+ },
105
+ "COLLECTED": {
106
+ "inputOk": {
107
+ "componentRef": "2",
108
+ "values": {
109
+ "PREVIOUS": null,
110
+ "COLLECTED": "My input",
111
+ "FORCED": null,
112
+ "EDITED": null,
113
+ "INPUTED": null
114
+ }
115
+ },
116
+ "check1": {
117
+ "componentRef": "3",
118
+ "values": {
119
+ "PREVIOUS": null,
120
+ "COLLECTED": true,
121
+ "FORCED": null,
122
+ "EDITED": null,
123
+ "INPUTED": null
124
+ }
125
+ },
126
+ "check2": {
127
+ "componentRef": "3",
128
+ "values": {
129
+ "PREVIOUS": null,
130
+ "COLLECTED": false,
131
+ "FORCED": true,
132
+ "EDITED": null,
133
+ "INPUTED": null
134
+ }
135
+ },
136
+ "table11": {
137
+ "componentRef": "4",
138
+ "values": {
139
+ "PREVIOUS": null,
140
+ "COLLECTED": "1",
141
+ "FORCED": null,
142
+ "EDITED": null,
143
+ "INPUTED": null
144
+ }
145
+ },
146
+ "Roster": {
147
+ "componentRef": "5",
148
+ "values": {
149
+ "PREVIOUS": [null],
150
+ "COLLECTED": ["ko"],
151
+ "FORCED": [null],
152
+ "EDITED": [null],
153
+ "INPUTED": [null]
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }