@inseefr/lunatic 2.6.12 → 2.6.14
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.
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"response": { "name": "NB" }
|
|
18
18
|
}
|
|
19
19
|
],
|
|
20
|
+
"resizing": { "NB": { "size": "NB", "variables": ["NAMES"] } },
|
|
20
21
|
"variables": [
|
|
21
22
|
{
|
|
22
23
|
"variableType": "COLLECTED",
|
|
@@ -28,6 +29,17 @@
|
|
|
28
29
|
"EDITED": null,
|
|
29
30
|
"INPUTED": null
|
|
30
31
|
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"variableType": "COLLECTED",
|
|
35
|
+
"name": "NAMES",
|
|
36
|
+
"values": {
|
|
37
|
+
"PREVIOUS": null,
|
|
38
|
+
"COLLECTED": [null],
|
|
39
|
+
"FORCED": null,
|
|
40
|
+
"EDITED": null,
|
|
41
|
+
"INPUTED": null
|
|
42
|
+
}
|
|
31
43
|
}
|
|
32
44
|
]
|
|
33
45
|
}
|
|
@@ -42,7 +42,7 @@ function getNextPager(pager, parent) {
|
|
|
42
42
|
|
|
43
43
|
// We reached the end of the sequence
|
|
44
44
|
var isEndSequence = subPage && pager.nbSubPages ? subPage >= pager.nbSubPages : false;
|
|
45
|
-
var moveUpOnEnd = parent === 'Roundabout' && pager.nbIterations
|
|
45
|
+
var moveUpOnEnd = parent === 'Roundabout' && pager.nbIterations;
|
|
46
46
|
// Move up at the end of a sequence (instead of going to the next Iteration)
|
|
47
47
|
if (isEndSequence && moveUpOnEnd) {
|
|
48
48
|
return _objectSpread(_objectSpread({}, pager), {}, {
|
|
@@ -37,14 +37,6 @@ function autoExploreLoop(state) {
|
|
|
37
37
|
goInsideSubpage(page.subPages, state.executeExpression(page.iterations));
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
// The page contains a roundabout, go to the first iteration if it only has one iteration
|
|
41
|
-
if (page.components[0].componentType === 'Roundabout' && page.subPages && page.subPages.length > 0) {
|
|
42
|
-
var nbIterations = state.executeExpression(page.iterations);
|
|
43
|
-
if (nbIterations === 1) {
|
|
44
|
-
goInsideSubpage(page.subPages, 1);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
40
|
// No loop were explored, don't mutate the state
|
|
49
41
|
if (!hasExploredLoop) {
|
|
50
42
|
return state;
|
|
@@ -14,10 +14,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
14
14
|
* Cast the variable into an array and adjust the length if necessary
|
|
15
15
|
*/
|
|
16
16
|
function resizeArrayVariable(array, length, defaultValue) {
|
|
17
|
+
if (length < 0) {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
17
20
|
if (!Array.isArray(array)) {
|
|
18
21
|
// create the array
|
|
19
22
|
return new Array(length).fill(defaultValue);
|
|
20
|
-
}
|
|
23
|
+
}
|
|
24
|
+
if (array.length !== length) {
|
|
21
25
|
// renew array end keep previous values
|
|
22
26
|
return new Array(length).fill(defaultValue).reduce(function (step, current, index) {
|
|
23
27
|
if (index < array.length) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inseefr/lunatic",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.14",
|
|
4
4
|
"workersVersion": "0.3.0-experimental",
|
|
5
5
|
"description": "Library of questionnaire components",
|
|
6
6
|
"repository": {
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"@inseefr/vtl-2.0-antlr-tools": "^0.1.0-bundle",
|
|
67
67
|
"antlr4": "4.11.0",
|
|
68
68
|
"classnames": "^2.3.1",
|
|
69
|
-
"date-fns": "^
|
|
69
|
+
"date-fns": "^3.0.0",
|
|
70
70
|
"lodash.camelcase": "^4.3.0",
|
|
71
71
|
"lodash.debounce": "^4.0.8",
|
|
72
72
|
"lodash.isequal": "^4.5.0",
|
|
73
|
-
"object-hash": "^
|
|
73
|
+
"object-hash": "^3.0.0",
|
|
74
74
|
"prop-types": "^15.7.2",
|
|
75
75
|
"react-keyboard-event-handler": "^1.5.4",
|
|
76
76
|
"react-markdown": "^8.0.3",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"string-tokenizer": "^0.0.8"
|
|
83
83
|
},
|
|
84
84
|
"resolutions": {
|
|
85
|
-
"@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.
|
|
85
|
+
"@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.f9c48c0.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@babel/cli": "^7.18.6",
|
|
@@ -115,26 +115,26 @@
|
|
|
115
115
|
"@testing-library/jest-dom": "^5.16.5",
|
|
116
116
|
"@testing-library/react": "^14.0.0",
|
|
117
117
|
"@testing-library/react-hooks": "^8.0.1",
|
|
118
|
-
"@types/object-hash": "^
|
|
118
|
+
"@types/object-hash": "^3.0.0",
|
|
119
119
|
"@types/react": "^18.0.26",
|
|
120
120
|
"@types/react-dom": "^18.0.9",
|
|
121
121
|
"@types/react-keyboard-event-handler": "^1.5.2",
|
|
122
122
|
"@typescript-eslint/eslint-plugin": "^5.57.0",
|
|
123
123
|
"@typescript-eslint/parser": "^5.48.2",
|
|
124
|
-
"@vitejs/plugin-react": "^
|
|
124
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
125
125
|
"@vitest/coverage-c8": "^0.27.2",
|
|
126
126
|
"babel-eslint": "^10.0.3",
|
|
127
|
-
"babel-loader": "^
|
|
128
|
-
"concurrently": "^
|
|
127
|
+
"babel-loader": "^9.0.0",
|
|
128
|
+
"concurrently": "^8.0.0",
|
|
129
129
|
"core-js": "^3.17.3",
|
|
130
130
|
"cors": "^2.8.5",
|
|
131
131
|
"cross-env": "^7.0.2",
|
|
132
|
-
"css-loader": "^
|
|
132
|
+
"css-loader": "^7.0.0",
|
|
133
133
|
"damerau-levenshtein": "^1.0.7",
|
|
134
134
|
"eslint": "7.30.0",
|
|
135
|
-
"eslint-config-prettier": "^
|
|
135
|
+
"eslint-config-prettier": "^9.0.0",
|
|
136
136
|
"eslint-config-react-app": "^6.0.0",
|
|
137
|
-
"eslint-plugin-flowtype": "^
|
|
137
|
+
"eslint-plugin-flowtype": "^8.0.0",
|
|
138
138
|
"eslint-plugin-import": "^2.19.1",
|
|
139
139
|
"eslint-plugin-jsx-a11y": "^6.1.1",
|
|
140
140
|
"eslint-plugin-react": "^7.17.0",
|
|
@@ -148,18 +148,18 @@
|
|
|
148
148
|
"jsdom-global": "^3.0.2",
|
|
149
149
|
"path-match": "^1.2.4",
|
|
150
150
|
"postcss": "^8.2.6",
|
|
151
|
-
"postcss-scss": "^
|
|
151
|
+
"postcss-scss": "^4.0.0",
|
|
152
152
|
"prettier": "^2.0.5",
|
|
153
153
|
"react": "^18.0.0",
|
|
154
154
|
"react-dom": "^18.0.0",
|
|
155
155
|
"regenerator-runtime": "^0.13.7",
|
|
156
156
|
"remove-accents": "^0.4.2",
|
|
157
|
-
"rxjs-marbles": "^
|
|
158
|
-
"sass-loader": "^
|
|
157
|
+
"rxjs-marbles": "^7.0.0",
|
|
158
|
+
"sass-loader": "^16.0.0",
|
|
159
159
|
"source-map-explorer": "^2.4.2",
|
|
160
160
|
"ts-loader": "^9.4.2",
|
|
161
161
|
"typescript": "^5.1.6",
|
|
162
|
-
"vite": "^
|
|
162
|
+
"vite": "^5.0.0",
|
|
163
163
|
"vitest": "^0.27.2",
|
|
164
164
|
"wait-on": "^7.0.1",
|
|
165
165
|
"webpack": "^5.75.0",
|