@inseefr/lunatic 2.7.20 → 2.7.22
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.
- package/lib/components/duration/durationUtils.js +1 -1
- package/lib/components/suggester/html/suggester.js +5 -4
- package/lib/components/suggester/idb-suggester/idb-suggester.js +4 -1
- package/lib/components/suggester/lunatic-suggester.js +2 -0
- package/lib/src/components/suggester/html/suggester.d.ts +1 -0
- package/lib/src/components/suggester/idb-suggester/idb-suggester.d.ts +2 -2
- package/lib/src/components/suggester/lunatic-suggester.d.ts +1 -1
- package/lib/src/components/type.d.ts +1 -0
- package/lib/src/use-lunatic/commons/variables/lunatic-variables-store.d.ts +4 -2
- package/lib/src/use-lunatic/use-lunatic.d.ts +2 -0
- package/lib/stories/questionnaires/recensement/source.json +2 -2
- package/lib/stories/suggester/source-component-set.json +54 -8
- package/lib/stories/suggester/source.json +327 -182
- package/lib/stories/suggester/suggester.stories.js +1 -15
- package/lib/stories/utils/orchestrator.js +1 -0
- package/lib/stories/utils/referentiel.js +5 -14
- package/lib/use-lunatic/commons/variables/lunatic-variables-store.js +40 -3
- package/package.json +1 -4
- package/lib/stories/suggester/simple.json +0 -168
|
@@ -38,7 +38,8 @@ function Suggester(_ref) {
|
|
|
38
38
|
searching = _ref.searching,
|
|
39
39
|
label = _ref.label,
|
|
40
40
|
description = _ref.description,
|
|
41
|
-
errors = _ref.errors
|
|
41
|
+
errors = _ref.errors,
|
|
42
|
+
allowArbitraryOption = _ref.allowArbitraryOption;
|
|
42
43
|
var _useState = (0, _react.useState)(''),
|
|
43
44
|
_useState2 = _slicedToArray(_useState, 2),
|
|
44
45
|
search = _useState2[0],
|
|
@@ -49,7 +50,7 @@ function Suggester(_ref) {
|
|
|
49
50
|
setOptions = _useState4[1];
|
|
50
51
|
var lastSearch = (0, _react.useRef)('');
|
|
51
52
|
var handleSelect = (0, _react.useCallback)(function (id) {
|
|
52
|
-
onSelect(id ? id : null);
|
|
53
|
+
onSelect(id !== null && id !== void 0 ? id : null);
|
|
53
54
|
}, [onSelect]);
|
|
54
55
|
var handleChange = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
55
56
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(search) {
|
|
@@ -72,7 +73,7 @@ function Suggester(_ref) {
|
|
|
72
73
|
setOptions(results);
|
|
73
74
|
setSearch(search);
|
|
74
75
|
// if a user does not select an option in the list, their search term is saved
|
|
75
|
-
onSelect(search);
|
|
76
|
+
allowArbitraryOption && onSelect(search);
|
|
76
77
|
}
|
|
77
78
|
_context.next = 13;
|
|
78
79
|
break;
|
|
@@ -89,7 +90,7 @@ function Suggester(_ref) {
|
|
|
89
90
|
return function (_x) {
|
|
90
91
|
return _ref2.apply(this, arguments);
|
|
91
92
|
};
|
|
92
|
-
}(), [searching, onSelect]);
|
|
93
|
+
}(), [searching, allowArbitraryOption, onSelect]);
|
|
93
94
|
var defaultSearch = getSearch(search, value);
|
|
94
95
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_commons.ComboBox, {
|
|
95
96
|
id: id,
|
|
@@ -26,6 +26,8 @@ function IDBSuggester(_ref) {
|
|
|
26
26
|
optionRenderer = _ref.optionRenderer,
|
|
27
27
|
labelRenderer = _ref.labelRenderer,
|
|
28
28
|
onSelect = _ref.onSelect,
|
|
29
|
+
_ref$allowArbitraryOp = _ref.allowArbitraryOption,
|
|
30
|
+
allowArbitraryOption = _ref$allowArbitraryOp === void 0 ? false : _ref$allowArbitraryOp,
|
|
29
31
|
disabled = _ref.disabled,
|
|
30
32
|
value = _ref.value,
|
|
31
33
|
label = _ref.label,
|
|
@@ -65,7 +67,8 @@ function IDBSuggester(_ref) {
|
|
|
65
67
|
value: value,
|
|
66
68
|
label: label,
|
|
67
69
|
description: description,
|
|
68
|
-
errors: errors
|
|
70
|
+
errors: errors,
|
|
71
|
+
allowArbitraryOption: allowArbitraryOption
|
|
69
72
|
})
|
|
70
73
|
})
|
|
71
74
|
});
|
|
@@ -17,6 +17,7 @@ function LunaticSuggester(_ref) {
|
|
|
17
17
|
labelRenderer = _ref.labelRenderer,
|
|
18
18
|
idbVersion = _ref.idbVersion,
|
|
19
19
|
focused = _ref.focused,
|
|
20
|
+
allowArbitraryOption = _ref.allowArbitraryOption,
|
|
20
21
|
value = _ref.value,
|
|
21
22
|
handleChange = _ref.handleChange,
|
|
22
23
|
disabled = _ref.disabled,
|
|
@@ -57,6 +58,7 @@ function LunaticSuggester(_ref) {
|
|
|
57
58
|
onSelect: onChange,
|
|
58
59
|
disabled: disabled,
|
|
59
60
|
id: id,
|
|
61
|
+
allowArbitraryOption: allowArbitraryOption,
|
|
60
62
|
value: value,
|
|
61
63
|
errors: (0, _errors.getComponentErrors)(errors, id),
|
|
62
64
|
label: label,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { LunaticError } from '../../../use-lunatic/type';
|
|
2
2
|
import type { LunaticComponentProps } from '../../type';
|
|
3
|
-
type Props = Pick<LunaticComponentProps<'Suggester'>, 'storeName' | 'idbVersion' | 'id' | 'className' | 'optionRenderer' | 'labelRenderer' | 'disabled' | 'readOnly' | 'value' | 'label' | 'description' | 'getSuggesterStatus'> & {
|
|
3
|
+
type Props = Pick<LunaticComponentProps<'Suggester'>, 'storeName' | 'idbVersion' | 'id' | 'className' | 'optionRenderer' | 'labelRenderer' | 'disabled' | 'readOnly' | 'value' | 'label' | 'description' | 'getSuggesterStatus' | 'allowArbitraryOption'> & {
|
|
4
4
|
errors?: LunaticError[];
|
|
5
5
|
onSelect: (v: string | null) => void;
|
|
6
6
|
workersBasePath?: string;
|
|
7
7
|
};
|
|
8
|
-
export declare function IDBSuggester({ storeName, idbVersion, id, className, optionRenderer, labelRenderer, onSelect, disabled, value, label, description, getSuggesterStatus, errors, readOnly, workersBasePath, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function IDBSuggester({ storeName, idbVersion, id, className, optionRenderer, labelRenderer, onSelect, allowArbitraryOption, disabled, value, label, description, getSuggesterStatus, errors, readOnly, workersBasePath, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LunaticComponentProps } from '../type';
|
|
2
|
-
declare function LunaticSuggester({ id, storeName, optionRenderer, labelRenderer, idbVersion, focused, value, handleChange, disabled, readOnly, errors, label, description, preferences, declarations, missing, missingResponse, management, response, className, getSuggesterStatus, workersBasePath, }: LunaticComponentProps<'Suggester'>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function LunaticSuggester({ id, storeName, optionRenderer, labelRenderer, idbVersion, focused, allowArbitraryOption, value, handleChange, disabled, readOnly, errors, label, description, preferences, declarations, missing, missingResponse, management, response, className, getSuggesterStatus, workersBasePath, }: LunaticComponentProps<'Suggester'>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default LunaticSuggester;
|
|
@@ -52,17 +52,19 @@ export declare class LunaticVariablesStore {
|
|
|
52
52
|
*/
|
|
53
53
|
off<T extends keyof EventArgs>(eventName: T, cb: (e: CustomEvent<EventArgs[T]>) => void): void;
|
|
54
54
|
get interpretCount(): number;
|
|
55
|
+
debug(): void;
|
|
55
56
|
}
|
|
56
57
|
declare class LunaticVariable {
|
|
57
58
|
updatedAt: Map<string | undefined, number>;
|
|
58
59
|
private calculatedAt;
|
|
59
60
|
private value;
|
|
60
61
|
private dependencies?;
|
|
61
|
-
|
|
62
|
+
readonly expression?: string;
|
|
62
63
|
private readonly dictionary?;
|
|
63
64
|
private readonly iterationDepth?;
|
|
64
65
|
private readonly shapeFrom?;
|
|
65
|
-
|
|
66
|
+
readonly name?: string;
|
|
67
|
+
calculatedCount: number;
|
|
66
68
|
constructor(args?: {
|
|
67
69
|
expression?: string;
|
|
68
70
|
dependencies?: string[];
|
|
@@ -255,6 +255,7 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
255
255
|
response: {
|
|
256
256
|
name: string;
|
|
257
257
|
};
|
|
258
|
+
allowArbitraryOption: boolean;
|
|
258
259
|
};
|
|
259
260
|
Summary: import("../components/type").LunaticBaseProps<string | null> & {
|
|
260
261
|
sections: {
|
|
@@ -507,6 +508,7 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
507
508
|
response: {
|
|
508
509
|
name: string;
|
|
509
510
|
};
|
|
511
|
+
allowArbitraryOption: boolean;
|
|
510
512
|
};
|
|
511
513
|
Summary: import("../components/type").LunaticBaseProps<string | null> & {
|
|
512
514
|
sections: {
|
|
@@ -2697,7 +2697,7 @@
|
|
|
2697
2697
|
}
|
|
2698
2698
|
}
|
|
2699
2699
|
},
|
|
2700
|
-
"storeName": "L_DEPNAIS-1-
|
|
2700
|
+
"storeName": "L_DEPNAIS-1-1-0",
|
|
2701
2701
|
"bindingDependencies": [
|
|
2702
2702
|
"DPNAI_FRANCE",
|
|
2703
2703
|
"NOM",
|
|
@@ -12739,7 +12739,7 @@
|
|
|
12739
12739
|
],
|
|
12740
12740
|
"suggesters": [
|
|
12741
12741
|
{
|
|
12742
|
-
"name": "L_DEPNAIS-1-
|
|
12742
|
+
"name": "L_DEPNAIS-1-1-0",
|
|
12743
12743
|
"fields": [
|
|
12744
12744
|
{ "name": "label", "rules": "soft" },
|
|
12745
12745
|
|
|
@@ -2,21 +2,67 @@
|
|
|
2
2
|
"maxPage": "1",
|
|
3
3
|
"suggesters": [
|
|
4
4
|
{
|
|
5
|
-
"
|
|
5
|
+
"responseNames": ["VARIABLE_ACTIVITE"],
|
|
6
|
+
"name": "L_ACTIVITES-1-0-0",
|
|
6
7
|
"fields": [
|
|
7
8
|
{
|
|
8
9
|
"name": "label",
|
|
9
10
|
"rules": ["[\\w]+"],
|
|
10
11
|
"language": "French",
|
|
11
|
-
"min":
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
"min": 3,
|
|
13
|
+
"stemmer": false,
|
|
14
|
+
"synonyms": {
|
|
15
|
+
"EHPAD": ["EPHAD", "HEPAD", "EPAD", "EPAHD", "EPADH"],
|
|
16
|
+
"plaquisterie": ["PLACO", "PLACOPLATRE"],
|
|
17
|
+
"pneumatiques": ["PNEUS"],
|
|
18
|
+
"prestations": ["PRESTATAIRE"],
|
|
19
|
+
"echafaudages": ["ECHAFFAUDAGE", "ECHAFFAUDEUR"],
|
|
20
|
+
"URSSAF": ["URSAF", "URSAFF"],
|
|
21
|
+
"ascenseurs": ["ASCENCEUR", "ASSENCEUR", "ACSENCEUR"],
|
|
22
|
+
"briqueterie": ["BRIQUETTERIE"],
|
|
23
|
+
"joaillerie": ["JOAILLIER"],
|
|
24
|
+
"agroalimentaire": ["AGGROALIMANTAIRE", "AGROALIMANTAIRE"],
|
|
25
|
+
"alimentaire": ["ALIMANTAIRE"],
|
|
26
|
+
"alimentaires": ["ALIMANTAIRES"],
|
|
27
|
+
"agroalimentaires": ["AGGROALIMANTAIRES", "AGROALIMENTAIRES"]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
14
30
|
],
|
|
15
31
|
"queryParser": {
|
|
16
32
|
"type": "tokenized",
|
|
17
|
-
"params": {
|
|
33
|
+
"params": {
|
|
34
|
+
"language": "French",
|
|
35
|
+
"pattern": "[\\w.]+",
|
|
36
|
+
"min": 3,
|
|
37
|
+
"stemmer": false
|
|
38
|
+
}
|
|
18
39
|
},
|
|
19
|
-
"version": "1"
|
|
40
|
+
"version": "1",
|
|
41
|
+
"stopWords": [
|
|
42
|
+
"a",
|
|
43
|
+
"au",
|
|
44
|
+
"dans",
|
|
45
|
+
"de",
|
|
46
|
+
"des",
|
|
47
|
+
"du",
|
|
48
|
+
"en",
|
|
49
|
+
"er",
|
|
50
|
+
"la",
|
|
51
|
+
"le",
|
|
52
|
+
"ou",
|
|
53
|
+
"sur",
|
|
54
|
+
"d",
|
|
55
|
+
"l",
|
|
56
|
+
"aux",
|
|
57
|
+
"dans",
|
|
58
|
+
"un",
|
|
59
|
+
"une",
|
|
60
|
+
"pour",
|
|
61
|
+
"avec",
|
|
62
|
+
"chez",
|
|
63
|
+
"par",
|
|
64
|
+
"les"
|
|
65
|
+
]
|
|
20
66
|
}
|
|
21
67
|
],
|
|
22
68
|
"components": [
|
|
@@ -37,9 +83,9 @@
|
|
|
37
83
|
{
|
|
38
84
|
"id": "communes-2023",
|
|
39
85
|
"componentType": "Suggester",
|
|
40
|
-
"label": { "value": "\"
|
|
86
|
+
"label": { "value": "\"Activité\"", "type": "VTL" },
|
|
41
87
|
"description": "\"industrie\"",
|
|
42
|
-
"storeName": "
|
|
88
|
+
"storeName": "L_ACTIVITES-1-0-0",
|
|
43
89
|
"conditionFilter": {
|
|
44
90
|
"value": "true",
|
|
45
91
|
"type": "VTL"
|
|
@@ -1,254 +1,399 @@
|
|
|
1
1
|
{
|
|
2
|
-
"maxPage": "4",
|
|
3
2
|
"suggesters": [
|
|
4
3
|
{
|
|
5
|
-
"
|
|
4
|
+
"responseNames": ["VARIABLE_COMMUNE"],
|
|
5
|
+
"name": "L_COMMUNEPASSEE-1-2-0",
|
|
6
6
|
"fields": [
|
|
7
7
|
{
|
|
8
8
|
"name": "label",
|
|
9
9
|
"rules": ["[\\w]+"],
|
|
10
10
|
"language": "French",
|
|
11
|
-
"min":
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
"min": 3,
|
|
12
|
+
"stemmer": false
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"queryParser": {
|
|
16
|
+
"type": "tokenized",
|
|
17
|
+
"params": {
|
|
18
|
+
"language": "French",
|
|
19
|
+
"pattern": "[\\w.]+",
|
|
20
|
+
"min": 3,
|
|
21
|
+
"stemmer": false
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"version": "1"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"responseNames": ["VARIABLE_PAYS"],
|
|
28
|
+
"name": "L_PAYS-1-2-0",
|
|
29
|
+
"fields": [
|
|
30
|
+
{
|
|
31
|
+
"name": "label",
|
|
32
|
+
"rules": ["[\\w]+"],
|
|
33
|
+
"language": "French",
|
|
34
|
+
"min": 3,
|
|
35
|
+
"stemmer": false
|
|
36
|
+
}
|
|
14
37
|
],
|
|
15
38
|
"queryParser": {
|
|
16
39
|
"type": "tokenized",
|
|
17
|
-
"params": {
|
|
40
|
+
"params": {
|
|
41
|
+
"language": "French",
|
|
42
|
+
"pattern": "[\\w.]+",
|
|
43
|
+
"min": 3,
|
|
44
|
+
"stemmer": false
|
|
45
|
+
}
|
|
18
46
|
},
|
|
19
47
|
"version": "1"
|
|
20
48
|
},
|
|
21
49
|
{
|
|
22
|
-
"
|
|
50
|
+
"responseNames": ["VARIABLE_NATIONALITE"],
|
|
51
|
+
"name": "L_NATIONALITE-1-2-0",
|
|
23
52
|
"fields": [
|
|
24
53
|
{
|
|
25
54
|
"name": "label",
|
|
26
55
|
"rules": ["[\\w]+"],
|
|
27
56
|
"language": "French",
|
|
28
|
-
"min":
|
|
29
|
-
|
|
30
|
-
|
|
57
|
+
"min": 3,
|
|
58
|
+
"stemmer": false
|
|
59
|
+
}
|
|
31
60
|
],
|
|
32
61
|
"queryParser": {
|
|
33
62
|
"type": "tokenized",
|
|
34
|
-
"params": {
|
|
63
|
+
"params": {
|
|
64
|
+
"language": "French",
|
|
65
|
+
"pattern": "[\\w.]+",
|
|
66
|
+
"min": 3,
|
|
67
|
+
"stemmer": false
|
|
68
|
+
}
|
|
35
69
|
},
|
|
36
70
|
"version": "1"
|
|
37
71
|
},
|
|
38
72
|
{
|
|
39
|
-
"
|
|
73
|
+
"responseNames": ["VARIABLE_PCS"],
|
|
74
|
+
"name": "L_PCS_HOMMES-1-5-0",
|
|
75
|
+
"fields": [
|
|
76
|
+
{
|
|
77
|
+
"name": "label",
|
|
78
|
+
"rules": ["[\\w]+"],
|
|
79
|
+
"language": "French",
|
|
80
|
+
"min": 3,
|
|
81
|
+
"stemmer": false,
|
|
82
|
+
"synonyms": {
|
|
83
|
+
"accueil": ["ACCEUIL"],
|
|
84
|
+
"échafaudage": ["ECHAFFAUDAGE"],
|
|
85
|
+
"URSSAF": ["URSAF", "URSAFF"],
|
|
86
|
+
"ingénierie": ["INGENIEURIE", "INGENERIE", "INGIENERIE"],
|
|
87
|
+
"construction": ["CONSTRUCTEUR"],
|
|
88
|
+
"distribution": ["DISTRIBUTEUR"],
|
|
89
|
+
"fabrication": ["FABRICANT"],
|
|
90
|
+
"abattoir": ["ABATOIR", "ABBATOIR", "ABATOIRE", "ABATTOIRE"],
|
|
91
|
+
"ascenseur": ["ASCENCEUR"],
|
|
92
|
+
"ascenseurs": ["ASCENCEURS"],
|
|
93
|
+
"assenseur": ["ASSENCEUR"],
|
|
94
|
+
"assenseurs": ["ASSENCEURS"],
|
|
95
|
+
"joaillerie": ["JOAILLIER"],
|
|
96
|
+
"agroalimentaire": ["AGGROALIMANTAIRE", "AGROALIMANTAIRE"],
|
|
97
|
+
"alimentaires": ["ALIMANTAIRE"],
|
|
98
|
+
"alimentaires": ["ALIMANTAIRES"],
|
|
99
|
+
"agroalimentaires": ["AGGROALIMANTAIRES", "AGROALIMENTAIRES"]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"queryParser": {
|
|
104
|
+
"type": "tokenized",
|
|
105
|
+
"params": {
|
|
106
|
+
"language": "French",
|
|
107
|
+
"pattern": "[\\w.]+",
|
|
108
|
+
"min": 3,
|
|
109
|
+
"stemmer": false
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"version": "1",
|
|
113
|
+
"meloto": true,
|
|
114
|
+
"stopWords": [
|
|
115
|
+
"a",
|
|
116
|
+
"au",
|
|
117
|
+
"dans",
|
|
118
|
+
"de",
|
|
119
|
+
"des",
|
|
120
|
+
"du",
|
|
121
|
+
"en",
|
|
122
|
+
"er",
|
|
123
|
+
"la",
|
|
124
|
+
"le",
|
|
125
|
+
"ou",
|
|
126
|
+
"sur",
|
|
127
|
+
"d",
|
|
128
|
+
"l",
|
|
129
|
+
"aux",
|
|
130
|
+
"dans",
|
|
131
|
+
"un",
|
|
132
|
+
"une",
|
|
133
|
+
"pour",
|
|
134
|
+
"avec",
|
|
135
|
+
"chez",
|
|
136
|
+
"par",
|
|
137
|
+
"les"
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"responseNames": ["VARIABLE_BAILLEURS_SOCIAUX"],
|
|
142
|
+
"name": "bailleurs_sociaux-1-5-0",
|
|
40
143
|
"fields": [
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
144
|
+
{
|
|
145
|
+
"name": "label",
|
|
146
|
+
"rules": ["[\\w]+"],
|
|
147
|
+
"language": "French",
|
|
148
|
+
"min": 3,
|
|
149
|
+
"stemmer": false
|
|
150
|
+
}
|
|
44
151
|
],
|
|
45
|
-
"queryParser": {
|
|
152
|
+
"queryParser": {
|
|
153
|
+
"type": "tokenized",
|
|
154
|
+
"params": {
|
|
155
|
+
"language": "French",
|
|
156
|
+
"pattern": "[\\w.]+",
|
|
157
|
+
"min": 3,
|
|
158
|
+
"stemmer": false
|
|
159
|
+
}
|
|
160
|
+
},
|
|
46
161
|
"version": "1"
|
|
47
162
|
}
|
|
48
163
|
],
|
|
49
164
|
"components": [
|
|
50
165
|
{
|
|
51
|
-
"
|
|
52
|
-
"componentType": "InputNumber",
|
|
53
|
-
"mandatory": false,
|
|
54
|
-
"min": 1,
|
|
55
|
-
"max": 4,
|
|
56
|
-
"decimals": 0,
|
|
57
|
-
"label": { "value": "\"Number of inhabitants\"", "type": "VTL|MD" },
|
|
58
|
-
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
166
|
+
"componentType": "Suggester",
|
|
59
167
|
"response": {
|
|
60
|
-
"name": "
|
|
168
|
+
"name": "VARIABLECO"
|
|
169
|
+
},
|
|
170
|
+
"storeName": "L_COMMUNEPASSEE-1-2-0",
|
|
171
|
+
"hierarchy": {
|
|
172
|
+
"sequence": {
|
|
173
|
+
"id": "lt4fhgd6",
|
|
174
|
+
"page": "1",
|
|
175
|
+
"label": {
|
|
176
|
+
"type": "VTL|MD",
|
|
177
|
+
"value": "\"I - \" || \"Sequence\""
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"conditionFilter": {
|
|
182
|
+
"type": "VTL",
|
|
183
|
+
"value": "true"
|
|
184
|
+
},
|
|
185
|
+
"id": "lt4ezymk",
|
|
186
|
+
"page": "1",
|
|
187
|
+
"label": {
|
|
188
|
+
"type": "VTL|MD",
|
|
189
|
+
"value": "\"➡ 1. \" || \"Variable Commune\""
|
|
61
190
|
},
|
|
62
|
-
"
|
|
191
|
+
"mandatory": false,
|
|
192
|
+
"maxLength": 249
|
|
63
193
|
},
|
|
64
194
|
{
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
"conditionFilter": {
|
|
71
|
-
|
|
195
|
+
"componentType": "Suggester",
|
|
196
|
+
"response": {
|
|
197
|
+
"name": "VARIABLEPA"
|
|
198
|
+
},
|
|
199
|
+
"storeName": "L_PAYS-1-2-0",
|
|
200
|
+
"conditionFilter": {
|
|
201
|
+
"type": "VTL",
|
|
202
|
+
"value": "true"
|
|
203
|
+
},
|
|
204
|
+
"id": "lt4fjoev",
|
|
72
205
|
"page": "2",
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"mandatory": false,
|
|
80
|
-
"response": {
|
|
81
|
-
"name": "PRENOM"
|
|
82
|
-
},
|
|
83
|
-
"page": "2"
|
|
84
|
-
}
|
|
85
|
-
]
|
|
206
|
+
"label": {
|
|
207
|
+
"type": "VTL|MD",
|
|
208
|
+
"value": "\"➡ 2. \" || \"Variable Pays\""
|
|
209
|
+
},
|
|
210
|
+
"mandatory": false,
|
|
211
|
+
"maxLength": 249
|
|
86
212
|
},
|
|
87
213
|
{
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"conditionFilter": {
|
|
94
|
-
|
|
214
|
+
"componentType": "Suggester",
|
|
215
|
+
"storeName": "L_NATIONALITE-1-2-0",
|
|
216
|
+
"response": {
|
|
217
|
+
"name": "VARIABLENA"
|
|
218
|
+
},
|
|
219
|
+
"conditionFilter": {
|
|
220
|
+
"type": "VTL",
|
|
221
|
+
"value": "true"
|
|
222
|
+
},
|
|
223
|
+
"id": "lt4f6i2y",
|
|
95
224
|
"page": "3",
|
|
96
|
-
"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
"response": {
|
|
125
|
-
"name": "NAF"
|
|
126
|
-
},
|
|
127
|
-
"page": "3.2"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
"id": "sugg2",
|
|
131
|
-
"componentType": "Suggester",
|
|
132
|
-
"mandatory": false,
|
|
133
|
-
"label": "PRENOM || \" what's your favorite NAF code? (without stop words)\"",
|
|
134
|
-
"storeName": "naf-rev2-stop",
|
|
135
|
-
"conditionFilter": {
|
|
136
|
-
"value": "not(isnull(PRENOM))",
|
|
137
|
-
"type": "VTL"
|
|
138
|
-
},
|
|
139
|
-
"response": {
|
|
140
|
-
"name": "NAF_STOP"
|
|
141
|
-
},
|
|
142
|
-
"page": "3.2",
|
|
143
|
-
"declarations": [
|
|
144
|
-
{
|
|
145
|
-
"id": "kb9hi4j0-krnoclfe",
|
|
146
|
-
"declarationType": "INSTRUCTION",
|
|
147
|
-
"position": "BEFORE_QUESTION_TEXT",
|
|
148
|
-
"label": {
|
|
149
|
-
"value": "\"Test declaration before\"",
|
|
150
|
-
"type": "VTL|MD"
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"id": "kb9hi4j0-krnoclfe",
|
|
155
|
-
"declarationType": "HELP",
|
|
156
|
-
"position": "AFTER_QUESTION_TEXT",
|
|
157
|
-
"label": {
|
|
158
|
-
"value": "\"Test description from declaration\"",
|
|
159
|
-
"type": "VTL|MD"
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
]
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"id": "sugg-communes",
|
|
166
|
-
"componentType": "Suggester",
|
|
167
|
-
"mandatory": false,
|
|
168
|
-
"label": {
|
|
169
|
-
"value": "PRENOM || \" what's your favorite city?\"",
|
|
170
|
-
"type": "VTL|MD"
|
|
171
|
-
},
|
|
172
|
-
"storeName": "cog-communes",
|
|
173
|
-
"conditionFilter": {
|
|
174
|
-
"value": "not(isnull(PRENOM))",
|
|
175
|
-
"type": "VTL"
|
|
176
|
-
},
|
|
177
|
-
"response": {
|
|
178
|
-
"name": "CITY"
|
|
179
|
-
},
|
|
180
|
-
"page": "3.3"
|
|
181
|
-
}
|
|
182
|
-
]
|
|
225
|
+
"label": {
|
|
226
|
+
"type": "VTL|MD",
|
|
227
|
+
"value": "\"➡ 3. \" || \"Variable Nationalité\""
|
|
228
|
+
},
|
|
229
|
+
"mandatory": false,
|
|
230
|
+
"maxLength": 249
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"componentType": "Suggester",
|
|
234
|
+
"storeName": "L_PCS_HOMMES-1-5-0",
|
|
235
|
+
"response": {
|
|
236
|
+
"name": "VARIABLE_P"
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
"conditionFilter": {
|
|
240
|
+
"type": "VTL",
|
|
241
|
+
"value": "true"
|
|
242
|
+
},
|
|
243
|
+
"id": "lt4f9q1o",
|
|
244
|
+
"page": "4",
|
|
245
|
+
"label": {
|
|
246
|
+
"type": "VTL|MD",
|
|
247
|
+
"value": "\"➡ 4. \" || \"VARIABLE_PCS\""
|
|
248
|
+
},
|
|
249
|
+
"allowArbitraryOption": true,
|
|
250
|
+
"mandatory": false,
|
|
251
|
+
"maxLength": 249
|
|
183
252
|
},
|
|
184
253
|
{
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
|
|
189
|
-
|
|
254
|
+
"componentType": "Suggester",
|
|
255
|
+
"storeName": "bailleurs_sociaux-1-5-0",
|
|
256
|
+
"response": {
|
|
257
|
+
"name": "VARIABLE_B"
|
|
258
|
+
},
|
|
259
|
+
"conditionFilter": {
|
|
260
|
+
"type": "VTL",
|
|
261
|
+
"value": "true"
|
|
262
|
+
},
|
|
263
|
+
"id": "lt4f8uba",
|
|
264
|
+
"page": "5",
|
|
265
|
+
"label": {
|
|
266
|
+
"type": "VTL|MD",
|
|
267
|
+
"value": "\"➡ 5. \" || \"VARIABLE_BAILLEURS_SOCIAUX\""
|
|
268
|
+
},
|
|
269
|
+
"mandatory": false,
|
|
270
|
+
"maxLength": 249
|
|
190
271
|
}
|
|
191
272
|
],
|
|
273
|
+
"pagination": "question",
|
|
274
|
+
"resizing": {},
|
|
275
|
+
"label": {
|
|
276
|
+
"type": "VTL|MD",
|
|
277
|
+
"value": "Suggester"
|
|
278
|
+
},
|
|
279
|
+
"lunaticModelVersion": "2.5.0",
|
|
280
|
+
"modele": "SUGGESTER",
|
|
281
|
+
"enoCoreVersion": "2.7.1",
|
|
282
|
+
"generatingDate": "27-02-2024 13:43:43",
|
|
283
|
+
"missing": false,
|
|
284
|
+
"id": "lt4f6mib",
|
|
285
|
+
"maxPage": "5",
|
|
192
286
|
"variables": [
|
|
193
287
|
{
|
|
194
288
|
"variableType": "COLLECTED",
|
|
195
|
-
"name": "NUM",
|
|
196
|
-
"componentRef": "nn",
|
|
197
289
|
"values": {
|
|
198
|
-
"PREVIOUS": null,
|
|
199
290
|
"COLLECTED": null,
|
|
291
|
+
"EDITED": null,
|
|
292
|
+
"INPUTED": null,
|
|
200
293
|
"FORCED": null,
|
|
294
|
+
"PREVIOUS": null
|
|
295
|
+
},
|
|
296
|
+
"name": "COMMENT_QE"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"variableType": "COLLECTED",
|
|
300
|
+
"values": {
|
|
301
|
+
"COLLECTED": null,
|
|
201
302
|
"EDITED": null,
|
|
202
|
-
"INPUTED": null
|
|
203
|
-
|
|
303
|
+
"INPUTED": null,
|
|
304
|
+
"FORCED": null,
|
|
305
|
+
"PREVIOUS": null
|
|
306
|
+
},
|
|
307
|
+
"name": "VARIABLECO"
|
|
204
308
|
},
|
|
205
309
|
{
|
|
206
310
|
"variableType": "COLLECTED",
|
|
207
|
-
"name": "PRENOM",
|
|
208
|
-
"componentRef": "idLoop",
|
|
209
311
|
"values": {
|
|
210
|
-
"
|
|
211
|
-
"
|
|
212
|
-
"
|
|
213
|
-
"
|
|
214
|
-
"
|
|
215
|
-
}
|
|
312
|
+
"COLLECTED": null,
|
|
313
|
+
"EDITED": null,
|
|
314
|
+
"INPUTED": null,
|
|
315
|
+
"FORCED": null,
|
|
316
|
+
"PREVIOUS": null
|
|
317
|
+
},
|
|
318
|
+
"name": "VARIABLEPA"
|
|
216
319
|
},
|
|
217
320
|
{
|
|
218
321
|
"variableType": "COLLECTED",
|
|
219
|
-
"name": "NAF",
|
|
220
|
-
"componentRef": "idLoopInd",
|
|
221
322
|
"values": {
|
|
222
|
-
"
|
|
223
|
-
"
|
|
224
|
-
"
|
|
225
|
-
"
|
|
226
|
-
"
|
|
227
|
-
}
|
|
323
|
+
"COLLECTED": null,
|
|
324
|
+
"EDITED": null,
|
|
325
|
+
"INPUTED": null,
|
|
326
|
+
"FORCED": null,
|
|
327
|
+
"PREVIOUS": null
|
|
328
|
+
},
|
|
329
|
+
"name": "VARIABLENA"
|
|
228
330
|
},
|
|
229
331
|
{
|
|
230
332
|
"variableType": "COLLECTED",
|
|
231
|
-
"name": "NAF_STOP",
|
|
232
|
-
"componentRef": "idLoopInd",
|
|
233
333
|
"values": {
|
|
234
|
-
"
|
|
235
|
-
"
|
|
236
|
-
"
|
|
237
|
-
"
|
|
238
|
-
"
|
|
239
|
-
}
|
|
334
|
+
"COLLECTED": null,
|
|
335
|
+
"EDITED": null,
|
|
336
|
+
"INPUTED": null,
|
|
337
|
+
"FORCED": null,
|
|
338
|
+
"PREVIOUS": null
|
|
339
|
+
},
|
|
340
|
+
"name": "VARIABLE_P"
|
|
240
341
|
},
|
|
241
342
|
{
|
|
242
343
|
"variableType": "COLLECTED",
|
|
243
|
-
"name": "CITY",
|
|
244
|
-
"componentRef": "idLoopInd",
|
|
245
344
|
"values": {
|
|
246
|
-
"
|
|
247
|
-
"
|
|
248
|
-
"
|
|
249
|
-
"
|
|
250
|
-
"
|
|
251
|
-
}
|
|
345
|
+
"COLLECTED": null,
|
|
346
|
+
"EDITED": null,
|
|
347
|
+
"INPUTED": null,
|
|
348
|
+
"FORCED": null,
|
|
349
|
+
"PREVIOUS": null
|
|
350
|
+
},
|
|
351
|
+
"name": "VARIABLE_B"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"variableType": "CALCULATED",
|
|
355
|
+
"expression": {
|
|
356
|
+
"type": "VTL",
|
|
357
|
+
"value": "true"
|
|
358
|
+
},
|
|
359
|
+
"name": "FILTER_RESULT_VARIABLECO",
|
|
360
|
+
"inFilter": "false"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"variableType": "CALCULATED",
|
|
364
|
+
"expression": {
|
|
365
|
+
"type": "VTL",
|
|
366
|
+
"value": "true"
|
|
367
|
+
},
|
|
368
|
+
"name": "FILTER_RESULT_VARIABLEPA",
|
|
369
|
+
"inFilter": "false"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"variableType": "CALCULATED",
|
|
373
|
+
"expression": {
|
|
374
|
+
"type": "VTL",
|
|
375
|
+
"value": "true"
|
|
376
|
+
},
|
|
377
|
+
"name": "FILTER_RESULT_VARIABLENA",
|
|
378
|
+
"inFilter": "false"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"variableType": "CALCULATED",
|
|
382
|
+
"expression": {
|
|
383
|
+
"type": "VTL",
|
|
384
|
+
"value": "true"
|
|
385
|
+
},
|
|
386
|
+
"name": "FILTER_RESULT_VARIABLE_P",
|
|
387
|
+
"inFilter": "false"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"variableType": "CALCULATED",
|
|
391
|
+
"expression": {
|
|
392
|
+
"type": "VTL",
|
|
393
|
+
"value": "true"
|
|
394
|
+
},
|
|
395
|
+
"name": "FILTER_RESULT_VARIABLE_B",
|
|
396
|
+
"inFilter": "false"
|
|
252
397
|
}
|
|
253
398
|
]
|
|
254
399
|
}
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.
|
|
6
|
+
exports["default"] = exports.Default = exports.ComponentSet = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
9
9
|
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
10
10
|
var _referentiel = require("../utils/referentiel");
|
|
11
|
-
var _simple = _interopRequireDefault(require("./simple"));
|
|
12
11
|
var _source = _interopRequireDefault(require("./source"));
|
|
13
12
|
var _sourceComponentSet = _interopRequireDefault(require("./source-component-set"));
|
|
14
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -36,19 +35,6 @@ Default.args = {
|
|
|
36
35
|
getReferentiel: _referentiel.getReferentiel,
|
|
37
36
|
pagination: true
|
|
38
37
|
};
|
|
39
|
-
var Simple = exports.Simple = Template.bind({});
|
|
40
|
-
Simple.args = {
|
|
41
|
-
source: _simple["default"],
|
|
42
|
-
getReferentiel: _referentiel.getReferentiel,
|
|
43
|
-
autoSuggesterLoading: true,
|
|
44
|
-
missing: {
|
|
45
|
-
table: {
|
|
46
|
-
disable: false
|
|
47
|
-
},
|
|
48
|
-
control: 'boolean',
|
|
49
|
-
defaultValue: true
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
38
|
var ComponentSet = exports.ComponentSet = Template.bind({});
|
|
53
39
|
ComponentSet.args = {
|
|
54
40
|
source: _sourceComponentSet["default"],
|
|
@@ -182,6 +182,7 @@ function OrchestratorForStories(_ref3) {
|
|
|
182
182
|
custom: custom,
|
|
183
183
|
autoSuggesterLoading: autoSuggesterLoading,
|
|
184
184
|
getReferentiel: getReferentiel,
|
|
185
|
+
workersBasePath: "./workers",
|
|
185
186
|
management: management,
|
|
186
187
|
missing: missing,
|
|
187
188
|
missingStrategy: missingStrategy,
|
|
@@ -13,28 +13,19 @@ var getReferentiel = exports.getReferentiel = /*#__PURE__*/function () {
|
|
|
13
13
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
14
14
|
while (1) switch (_context.prev = _context.next) {
|
|
15
15
|
case 0:
|
|
16
|
-
_context.
|
|
17
|
-
|
|
18
|
-
break;
|
|
19
|
-
case 3:
|
|
20
|
-
return _context.abrupt("return", fetch('./libelles-pcs-2020.json').then(function (r) {
|
|
16
|
+
_context.prev = 0;
|
|
17
|
+
return _context.abrupt("return", fetch("./".concat(name, ".json")).then(function (r) {
|
|
21
18
|
return r.json();
|
|
22
19
|
}));
|
|
23
20
|
case 4:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}));
|
|
27
|
-
case 5:
|
|
28
|
-
return _context.abrupt("return", fetch('./communes-2019.json').then(function (r) {
|
|
29
|
-
return r.json();
|
|
30
|
-
}));
|
|
31
|
-
case 6:
|
|
21
|
+
_context.prev = 4;
|
|
22
|
+
_context.t0 = _context["catch"](0);
|
|
32
23
|
throw new Error("Unknown r\xE9f\xE9rentiel ".concat(name));
|
|
33
24
|
case 7:
|
|
34
25
|
case "end":
|
|
35
26
|
return _context.stop();
|
|
36
27
|
}
|
|
37
|
-
}, _callee);
|
|
28
|
+
}, _callee, null, [[0, 4]]);
|
|
38
29
|
}));
|
|
39
30
|
return function getReferentiel(_x) {
|
|
40
31
|
return _ref.apply(this, arguments);
|
|
@@ -137,10 +137,31 @@ var LunaticVariablesStore = exports.LunaticVariablesStore = /*#__PURE__*/functio
|
|
|
137
137
|
get: function get() {
|
|
138
138
|
return interpretCount;
|
|
139
139
|
}
|
|
140
|
+
|
|
141
|
+
// Displays a table of the most calculated variable (useful for debug)
|
|
142
|
+
}, {
|
|
143
|
+
key: "debug",
|
|
144
|
+
value: function debug() {
|
|
145
|
+
console.table(Array.from(this.dictionary.values()).sort(function (a, b) {
|
|
146
|
+
return b.calculatedCount - a.calculatedCount;
|
|
147
|
+
}).slice(0, 25).map(function (v) {
|
|
148
|
+
return {
|
|
149
|
+
name: v.name,
|
|
150
|
+
calculations: v.calculatedCount,
|
|
151
|
+
expression: v.expression
|
|
152
|
+
};
|
|
153
|
+
}));
|
|
154
|
+
console.log('Total calculations : ' + Array.from(this.dictionary.values()).reduce(function (acc, v) {
|
|
155
|
+
return acc + v.calculatedCount;
|
|
156
|
+
}, 0));
|
|
157
|
+
Array.from(this.dictionary.values()).map(function (v) {
|
|
158
|
+
return v.calculatedCount = 0;
|
|
159
|
+
});
|
|
160
|
+
}
|
|
140
161
|
}], [{
|
|
141
162
|
key: "makeFromSource",
|
|
142
163
|
value: function makeFromSource(source, data) {
|
|
143
|
-
var _variable$name;
|
|
164
|
+
var _variable$shapeFrom, _variable$name;
|
|
144
165
|
var store = new LunaticVariablesStore();
|
|
145
166
|
if (!source.variables) {
|
|
146
167
|
return store;
|
|
@@ -153,6 +174,7 @@ var LunaticVariablesStore = exports.LunaticVariablesStore = /*#__PURE__*/functio
|
|
|
153
174
|
if (name === 'yAxis') return 1;
|
|
154
175
|
return undefined;
|
|
155
176
|
};
|
|
177
|
+
store.set('1', 1); // Fake variable to use on the shapeFrom, we will use "variableDimension" in the future
|
|
156
178
|
var _iterator = _createForOfIteratorHelper(source.variables),
|
|
157
179
|
_step;
|
|
158
180
|
try {
|
|
@@ -163,7 +185,7 @@ var LunaticVariablesStore = exports.LunaticVariablesStore = /*#__PURE__*/functio
|
|
|
163
185
|
store.setCalculated(variable.name, variable.expression.value, {
|
|
164
186
|
dependencies: variable.bindingDependencies,
|
|
165
187
|
iterationDepth: getIterationDepth(variable.name),
|
|
166
|
-
shapeFrom: variable.shapeFrom
|
|
188
|
+
shapeFrom: (_variable$shapeFrom = variable.shapeFrom) !== null && _variable$shapeFrom !== void 0 ? _variable$shapeFrom : '1'
|
|
167
189
|
});
|
|
168
190
|
break;
|
|
169
191
|
case 'COLLECTED':
|
|
@@ -223,6 +245,8 @@ var LunaticVariable = /*#__PURE__*/function () {
|
|
|
223
245
|
this.shapeFrom = void 0;
|
|
224
246
|
// Keep a record of variable name (optional, used for debug)
|
|
225
247
|
this.name = void 0;
|
|
248
|
+
// Count the number of calculation
|
|
249
|
+
this.calculatedCount = 0;
|
|
226
250
|
if (args.expression && !args.dictionary) {
|
|
227
251
|
throw new Error("A calculated variable needs a dictionary to retrieve his deps");
|
|
228
252
|
}
|
|
@@ -270,6 +294,13 @@ var LunaticVariable = /*#__PURE__*/function () {
|
|
|
270
294
|
if ((0, _env.isTestEnv)()) {
|
|
271
295
|
interpretCount++;
|
|
272
296
|
}
|
|
297
|
+
// Scale down iteration if its dimension > shapeFrom dimension
|
|
298
|
+
var shapeDimension = arrayDimension(shapeFromValue);
|
|
299
|
+
if (Array.isArray(iteration) && Array.isArray(shapeFromValue) && shapeDimension < iteration.length) {
|
|
300
|
+
iteration = iteration.slice(0, shapeDimension);
|
|
301
|
+
}
|
|
302
|
+
// Uncomment this if you want to track the number of calculation
|
|
303
|
+
// this.calculatedCount++;
|
|
273
304
|
// Remember the value
|
|
274
305
|
try {
|
|
275
306
|
this.setValue((0, _vtl.interpretVTL)(this.expression, bindings), iteration);
|
|
@@ -415,4 +446,10 @@ var LunaticVariable = /*#__PURE__*/function () {
|
|
|
415
446
|
}
|
|
416
447
|
}]);
|
|
417
448
|
return LunaticVariable;
|
|
418
|
-
}();
|
|
449
|
+
}();
|
|
450
|
+
function arrayDimension(arr) {
|
|
451
|
+
if (!Array.isArray(arr)) {
|
|
452
|
+
return 0;
|
|
453
|
+
}
|
|
454
|
+
return 1 + arrayDimension(arr[0]);
|
|
455
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inseefr/lunatic",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.22",
|
|
4
4
|
"workersVersion": "0.3.0",
|
|
5
5
|
"description": "Library of questionnaire components",
|
|
6
6
|
"repository": {
|
|
@@ -75,9 +75,6 @@
|
|
|
75
75
|
"antlr4": "4.11.0",
|
|
76
76
|
"classnames": "^2.3.1",
|
|
77
77
|
"date-fns": "^2.25.0",
|
|
78
|
-
"lodash.camelcase": "^4.3.0",
|
|
79
|
-
"lodash.debounce": "^4.0.8",
|
|
80
|
-
"lodash.isequal": "^4.5.0",
|
|
81
78
|
"object-hash": "^2.2.0",
|
|
82
79
|
"prop-types": "^15.7.2",
|
|
83
80
|
"react-keyboard-event-handler": "^1.5.4",
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"maxPage": "5",
|
|
3
|
-
"suggesters": [
|
|
4
|
-
{
|
|
5
|
-
"name": "naf-rev2",
|
|
6
|
-
"fields": [
|
|
7
|
-
{
|
|
8
|
-
"name": "label",
|
|
9
|
-
"rules": ["[\\w]+"],
|
|
10
|
-
"language": "French",
|
|
11
|
-
"min": 2
|
|
12
|
-
},
|
|
13
|
-
{ "name": "id" }
|
|
14
|
-
],
|
|
15
|
-
"queryParser": {
|
|
16
|
-
"type": "tokenized",
|
|
17
|
-
"params": { "language": "French", "pattern": "[\\w.]+" }
|
|
18
|
-
},
|
|
19
|
-
"version": "1"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"name": "cog-communes",
|
|
23
|
-
"fields": [
|
|
24
|
-
{ "name": "id", "rules": "soft" },
|
|
25
|
-
{ "name": "label", "rules": "soft" }
|
|
26
|
-
],
|
|
27
|
-
"queryParser": { "type": "soft" },
|
|
28
|
-
"version": "1"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"name": "in-error",
|
|
32
|
-
"fields": [{ "name": "id", "rules": "soft" }],
|
|
33
|
-
"queryParser": { "type": "soft" },
|
|
34
|
-
"version": "1"
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"components": [
|
|
38
|
-
{
|
|
39
|
-
"id": "suggestions-naf",
|
|
40
|
-
"componentType": "Suggester",
|
|
41
|
-
"mandatory": false,
|
|
42
|
-
"label": {
|
|
43
|
-
"value": "\"Code ou terme des libellés de la Naf-rev2\"",
|
|
44
|
-
"type": "VTL|MD"
|
|
45
|
-
},
|
|
46
|
-
"description": { "value": "\"Exemple: 01 ou tabac\"", "type": "VTL|MD" },
|
|
47
|
-
"storeName": "naf-rev2",
|
|
48
|
-
"conditionFilter": {
|
|
49
|
-
"value": "true",
|
|
50
|
-
"type": "VTL"
|
|
51
|
-
},
|
|
52
|
-
"readOnly": {
|
|
53
|
-
"value": "true",
|
|
54
|
-
"type": "VTL"
|
|
55
|
-
},
|
|
56
|
-
"controls": [
|
|
57
|
-
{
|
|
58
|
-
"id": "age-controls",
|
|
59
|
-
"criticality": "ERROR",
|
|
60
|
-
"typeOfControl": "FORMAT",
|
|
61
|
-
"control": {
|
|
62
|
-
"value": "not(isnull(HELLO))",
|
|
63
|
-
"type": "VTL"
|
|
64
|
-
},
|
|
65
|
-
"errorMessage": {
|
|
66
|
-
"value": "\"Veuillez selectionner quelquechose\"",
|
|
67
|
-
"type": "VTL"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
"response": {
|
|
72
|
-
"name": "HELLO"
|
|
73
|
-
},
|
|
74
|
-
"missingResponse": { "name": "HELLO_MISSING" },
|
|
75
|
-
"page": "1"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"id": "suggestions-cog",
|
|
79
|
-
"componentType": "Suggester",
|
|
80
|
-
"mandatory": false,
|
|
81
|
-
"label": "\"Hello!\"",
|
|
82
|
-
"storeName": "cog-communes",
|
|
83
|
-
"conditionFilter": {
|
|
84
|
-
"value": "true",
|
|
85
|
-
"type": "VTL"
|
|
86
|
-
},
|
|
87
|
-
"response": {
|
|
88
|
-
"name": "HELLO"
|
|
89
|
-
},
|
|
90
|
-
"missingResponse": { "name": "HELLO_MISSING" },
|
|
91
|
-
"page": "1"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"id": "suggestions-inconnu",
|
|
95
|
-
"componentType": "Suggester",
|
|
96
|
-
"mandatory": false,
|
|
97
|
-
"label": "\"Hello!\"",
|
|
98
|
-
"storeName": "inconnu-au-bataillon",
|
|
99
|
-
"conditionFilter": {
|
|
100
|
-
"value": "true",
|
|
101
|
-
"type": "VTL"
|
|
102
|
-
},
|
|
103
|
-
"response": {
|
|
104
|
-
"name": "HELLO"
|
|
105
|
-
},
|
|
106
|
-
"missingResponse": { "name": "HELLO_MISSING" },
|
|
107
|
-
"page": "3"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"id": "suggestions-in-error",
|
|
111
|
-
"componentType": "Suggester",
|
|
112
|
-
"mandatory": false,
|
|
113
|
-
"label": "\"Hello!\"",
|
|
114
|
-
"storeName": "in-error",
|
|
115
|
-
"conditionFilter": {
|
|
116
|
-
"value": "true",
|
|
117
|
-
"type": "VTL"
|
|
118
|
-
},
|
|
119
|
-
"missingResponse": { "name": "HELLO_MISSING" },
|
|
120
|
-
"response": {
|
|
121
|
-
"name": "HELLO"
|
|
122
|
-
},
|
|
123
|
-
"page": "4"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"id": "bye!",
|
|
127
|
-
"componentType": "Sequence",
|
|
128
|
-
"page": "5",
|
|
129
|
-
"declarations": [
|
|
130
|
-
{
|
|
131
|
-
"id": "kb9hi4j0-krnoclfe",
|
|
132
|
-
"declarationType": "INSTRUCTION",
|
|
133
|
-
"position": "BEFORE_QUESTION_TEXT",
|
|
134
|
-
"label": {
|
|
135
|
-
"value": "\"Merci beaucoup.\"",
|
|
136
|
-
"type": "VTL|MD"
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
]
|
|
140
|
-
}
|
|
141
|
-
],
|
|
142
|
-
"variables": [
|
|
143
|
-
{
|
|
144
|
-
"variableType": "COLLECTED",
|
|
145
|
-
"name": "HELLO",
|
|
146
|
-
"componentRef": "nn",
|
|
147
|
-
"values": {
|
|
148
|
-
"PREVIOUS": null,
|
|
149
|
-
"COLLECTED": null,
|
|
150
|
-
"FORCED": null,
|
|
151
|
-
"EDITED": null,
|
|
152
|
-
"INPUTED": null
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"variableType": "COLLECTED",
|
|
157
|
-
"name": "HELLO_MISSING",
|
|
158
|
-
"componentRef": "nn",
|
|
159
|
-
"values": {
|
|
160
|
-
"PREVIOUS": null,
|
|
161
|
-
"COLLECTED": null,
|
|
162
|
-
"FORCED": null,
|
|
163
|
-
"EDITED": null,
|
|
164
|
-
"INPUTED": null
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
]
|
|
168
|
-
}
|