@inseefr/lunatic 2.7.4 → 2.7.6
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/README.fr.md +1 -1
- package/README.md +6 -1
- package/lib/components/commons/components/md-label/link.js +39 -34
- package/lib/components/commons/components/md-label/md-label.js +2 -2
- package/lib/components/commons/components/md-label/md-label.spec.js +71 -0
- package/lib/components/commons/components/md-label/router-link.js +29 -0
- package/lib/components/commons/components/variable-status/variable-status.js +2 -2
- package/lib/components/index.scss +19 -1
- package/lib/components/loop/block-for-loop.js +2 -0
- package/lib/components/loop/constant.js +10 -0
- package/lib/components/loop/roster-for-loop/roster-for-loop.js +42 -20
- package/lib/components/lunatic-components.js +45 -7
- package/lib/components/table/lunatic-table.js +5 -1
- package/lib/hooks/use-auto-focus.js +1 -1
- package/lib/src/components/commons/components/md-label/router-link.d.ts +6 -0
- package/lib/src/components/datepicker/lunatic-datepicker.d.ts +1 -1
- package/lib/src/components/loop/constant.d.ts +4 -0
- package/lib/src/components/loop/roster-for-loop/roster-for-loop.d.ts +1 -0
- package/lib/src/components/lunatic-components.d.ts +12 -5
- package/lib/src/components/type.d.ts +4 -1
- package/lib/src/use-lunatic/commons/compile-controls.d.ts +4 -3
- package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +75 -70
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +55 -50
- package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +31 -26
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +680 -73
- package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
- package/lib/src/use-lunatic/commons/variables/lunatic-variables-store.d.ts +1 -0
- package/lib/src/use-lunatic/hooks/use-page-has-response.d.ts +6 -0
- package/lib/src/use-lunatic/reducer/commons/is-loop-component.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/controls/check-base-control.d.ts +2 -0
- package/lib/src/use-lunatic/reducer/{resolve-component-controls/resolve-roundabout-control.d.ts → controls/check-roundabout-control.d.ts} +2 -2
- package/lib/src/use-lunatic/type-source.d.ts +16 -10
- package/lib/src/use-lunatic/use-lunatic.d.ts +12 -5
- package/lib/src/utils/suggester-workers/searching/meloto-order.d.ts +2 -1
- package/lib/stories/behaviour/controls/controls.stories.js +14 -7
- package/lib/stories/behaviour/controls/loop.json +130 -0
- package/lib/stories/behaviour/controls/{V2_ControlesNonNum_horsBoucle_PasPageFin.json → simple.json} +2 -2
- package/lib/stories/date-picker/source.json +22 -67
- package/lib/stories/declaration/source.json +14 -28
- package/lib/stories/dropdown/source.json +11 -28
- package/lib/stories/filter-description/source.json +3 -2
- package/lib/stories/input/input.stories.js +1 -8
- package/lib/stories/input/source.json +1 -63
- package/lib/stories/input-number/input-number.stories.js +2 -22
- package/lib/stories/input-number/source.json +4 -6
- package/lib/stories/loop/{block-for-loop.stories.js → loop.stories.js} +10 -8
- package/lib/stories/loop/roster-for-loop.stories.js +8 -2
- package/lib/stories/loop/source-bloc.json +10 -39
- package/lib/stories/loop/source-paginated.json +65 -78
- package/lib/stories/{loop/paginated-loop.stories.js → markdown/markdown.stories.js} +4 -4
- package/lib/stories/markdown/source.json +40 -0
- package/lib/stories/overview/overview.stories.js +1 -1
- package/lib/stories/pairwise/pairwise-links.stories.js +4 -4
- package/lib/stories/pairwise/{links.json → source.json} +2 -6
- package/lib/stories/question-context/question-context.stories.js +31 -0
- package/lib/stories/question-context/source.json +13 -0
- package/lib/stories/question-explication/source.json +1 -1
- package/lib/stories/{loop/not-paginated-loop.stories.js → question-information/question-information.stories.js} +5 -8
- package/lib/stories/question-information/source.json +14 -0
- package/lib/stories/roundabout/source.json +21 -31
- package/lib/stories/sequence/sequence.stories.js +7 -1
- package/lib/stories/sequence/source.json +17 -0
- package/lib/stories/suggester/simple.json +1 -1
- package/lib/stories/suggester/suggester-workers.stories.js +36 -1
- package/lib/stories/table/source-colspan.json +314 -0
- package/lib/stories/table/table.stories.js +7 -1
- package/lib/stories/textarea/source.json +6 -22
- package/lib/stories/utils/orchestrator.js +89 -49
- package/lib/stories/utils/orchestrator.scss +49 -0
- package/lib/stories/utils/referentiel.js +8 -4
- package/lib/use-lunatic/commons/compile-controls.js +135 -34
- package/lib/use-lunatic/commons/fill-components/fill-component-value.js +10 -0
- package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +4 -1
- package/lib/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +14 -9
- package/lib/use-lunatic/commons/variables/get-questionnaire-data.js +6 -1
- package/lib/use-lunatic/commons/variables/lunatic-variables-store.js +25 -7
- package/lib/use-lunatic/commons/variables/lunatic-variables-store.spec.js +39 -0
- package/lib/use-lunatic/hooks/use-page-has-response.js +104 -0
- package/lib/use-lunatic/reducer/{resolve-component-controls/resolve-simple-control.js → controls/check-base-control.js} +5 -7
- package/lib/use-lunatic/reducer/{resolve-component-controls/resolve-roundabout-control.js → controls/check-roundabout-control.js} +2 -3
- package/lib/use-lunatic/reducer/overview/overview-on-init.js +6 -4
- package/lib/use-lunatic/type-source.js +1 -0
- package/lib/use-lunatic/use-lunatic.js +3 -1
- package/lib/utils/env.js +1 -1
- package/lib/utils/suggester-workers/searching/meloto-order.js +6 -5
- package/package.json +2 -2
- package/workers-release/lunatic-search-worker-0.3.0.js +1 -1
- package/lib/src/use-lunatic/commons/get-errors-without-empty-value.d.ts +0 -6
- package/lib/src/use-lunatic/reducer/resolve-component-controls/index.d.ts +0 -1
- package/lib/src/use-lunatic/reducer/resolve-component-controls/resolve-component-control.d.ts +0 -6
- package/lib/src/use-lunatic/reducer/resolve-component-controls/resolve-simple-control.d.ts +0 -3
- package/lib/stories/Introduction.stories.mdx +0 -112
- package/lib/stories/behaviour/controls/V2_Controles_BouclesLiees_PasPageFin.json +0 -533
- package/lib/stories/input/source-with-question.json +0 -80
- package/lib/stories/input-number/source-euros.json +0 -37
- package/lib/stories/input-number/source-thansand.json +0 -34
- package/lib/stories/loop/source-not-paginated.json +0 -138
- package/lib/use-lunatic/commons/get-errors-without-empty-value.js +0 -24
- package/lib/use-lunatic/reducer/resolve-component-controls/index.js +0 -12
- package/lib/use-lunatic/reducer/resolve-component-controls/resolve-component-control.js +0 -38
- /package/lib/stories/behaviour/controls/{V2_ControlesNum_horsBoucle_PasPageFin.json → simple-numeric.json} +0 -0
- /package/lib/stories/pairwise/{links-componentset.json → source-componentset.json} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.Default = void 0;
|
|
7
|
+
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
8
|
+
var _source = _interopRequireDefault(require("./source"));
|
|
9
|
+
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
|
+
var stories = {
|
|
19
|
+
title: 'Components/QuestionContext',
|
|
20
|
+
component: _orchestrator["default"],
|
|
21
|
+
argTypes: _defaultArgTypes["default"]
|
|
22
|
+
};
|
|
23
|
+
var _default = exports["default"] = stories;
|
|
24
|
+
var Template = function Template(args) {
|
|
25
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_orchestrator["default"], _objectSpread({}, args));
|
|
26
|
+
};
|
|
27
|
+
var Default = exports.Default = Template.bind({});
|
|
28
|
+
Default.args = {
|
|
29
|
+
id: 'questionExplication',
|
|
30
|
+
source: _source["default"]
|
|
31
|
+
};
|
|
@@ -5,10 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.Default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
9
8
|
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var _source = _interopRequireDefault(require("./source"));
|
|
10
|
+
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
12
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
13
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
@@ -18,7 +17,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
18
17
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
18
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
19
|
var stories = {
|
|
21
|
-
title: 'Components/
|
|
20
|
+
title: 'Components/QuestionInformation',
|
|
22
21
|
component: _orchestrator["default"],
|
|
23
22
|
argTypes: _defaultArgTypes["default"]
|
|
24
23
|
};
|
|
@@ -28,8 +27,6 @@ var Template = function Template(args) {
|
|
|
28
27
|
};
|
|
29
28
|
var Default = exports.Default = Template.bind({});
|
|
30
29
|
Default.args = {
|
|
31
|
-
id: '
|
|
32
|
-
source:
|
|
33
|
-
getReferentiel: _referentiel.getReferentiel,
|
|
34
|
-
autoSuggesterLoading: true
|
|
30
|
+
id: 'input',
|
|
31
|
+
source: _source["default"]
|
|
35
32
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": [
|
|
3
|
+
{
|
|
4
|
+
"componentType": "QuestionInformation",
|
|
5
|
+
"label": { "value": "\"Question Information\"", "type": "VTL|MD" },
|
|
6
|
+
"description": {
|
|
7
|
+
"value": "\"Question Information description\"",
|
|
8
|
+
"type": "VTL|MD"
|
|
9
|
+
},
|
|
10
|
+
"page": "1"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"variables": []
|
|
14
|
+
}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"maxPage": "
|
|
2
|
+
"maxPage": "4",
|
|
3
3
|
"components": [
|
|
4
|
-
{
|
|
5
|
-
"id": "seq",
|
|
6
|
-
"componentType": "Sequence",
|
|
7
|
-
"label": {
|
|
8
|
-
"value": "\"Description des individus de votre logement\"",
|
|
9
|
-
"type": "VTL|MD"
|
|
10
|
-
},
|
|
11
|
-
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
12
|
-
"page": "1"
|
|
13
|
-
},
|
|
14
4
|
{
|
|
15
5
|
"id": "how",
|
|
16
6
|
"componentType": "InputNumber",
|
|
17
7
|
"mandatory": false,
|
|
18
|
-
"page": "
|
|
8
|
+
"page": "1",
|
|
19
9
|
"min": 1,
|
|
20
10
|
"max": 10,
|
|
21
11
|
"decimals": 0,
|
|
@@ -29,7 +19,7 @@
|
|
|
29
19
|
{
|
|
30
20
|
"id": "loop",
|
|
31
21
|
"componentType": "Loop",
|
|
32
|
-
"page": "
|
|
22
|
+
"page": "2",
|
|
33
23
|
"depth": 1,
|
|
34
24
|
"paginatedLoop": false,
|
|
35
25
|
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
@@ -73,7 +63,7 @@
|
|
|
73
63
|
{
|
|
74
64
|
"id": "roundabout",
|
|
75
65
|
"componentType": "Roundabout",
|
|
76
|
-
"page": "
|
|
66
|
+
"page": "3",
|
|
77
67
|
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
78
68
|
"iterations": { "value": "NB_HAB", "type": "VTL" },
|
|
79
69
|
"label": { "value": "\"Libellé du rondpoint\"", "type": "VTL" },
|
|
@@ -117,7 +107,7 @@
|
|
|
117
107
|
"id": "radio",
|
|
118
108
|
"componentType": "Radio",
|
|
119
109
|
"mandatory": false,
|
|
120
|
-
"page": "
|
|
110
|
+
"page": "3.1",
|
|
121
111
|
"label": {
|
|
122
112
|
"value": "\"Connaissez-vous le recensement de la population ?\"",
|
|
123
113
|
"type": "VTL|MD"
|
|
@@ -135,7 +125,7 @@
|
|
|
135
125
|
{
|
|
136
126
|
"id": "jsygk7m7",
|
|
137
127
|
"componentType": "Subsequence",
|
|
138
|
-
"page": "
|
|
128
|
+
"page": "3.2",
|
|
139
129
|
"label": {
|
|
140
130
|
"value": "\"Deuxième page de questions pour \"|| PRENOMS",
|
|
141
131
|
"type": "VTL|MD"
|
|
@@ -145,7 +135,7 @@
|
|
|
145
135
|
{
|
|
146
136
|
"id": "sexe",
|
|
147
137
|
"componentType": "Radio",
|
|
148
|
-
"page": "
|
|
138
|
+
"page": "3.2",
|
|
149
139
|
"label": {
|
|
150
140
|
"value": "\"Sexe\"",
|
|
151
141
|
"type": "VTL"
|
|
@@ -169,7 +159,7 @@
|
|
|
169
159
|
{
|
|
170
160
|
"id": "jsygk7m7",
|
|
171
161
|
"componentType": "Subsequence",
|
|
172
|
-
"page": "
|
|
162
|
+
"page": "3.3",
|
|
173
163
|
"label": {
|
|
174
164
|
"value": "\"Troisième page de questions \" || PRENOMS",
|
|
175
165
|
"type": "VTL|MD"
|
|
@@ -180,7 +170,7 @@
|
|
|
180
170
|
"id": "kmno1n7m",
|
|
181
171
|
"componentType": "Input",
|
|
182
172
|
"maxLength": 30,
|
|
183
|
-
"page": "
|
|
173
|
+
"page": "3.3",
|
|
184
174
|
"label": {
|
|
185
175
|
"value": "\"Dites quelque chose.\"))",
|
|
186
176
|
"type": "VTL|MD"
|
|
@@ -202,7 +192,7 @@
|
|
|
202
192
|
"type": "VTL|MD"
|
|
203
193
|
},
|
|
204
194
|
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
205
|
-
"page": "
|
|
195
|
+
"page": "4"
|
|
206
196
|
}
|
|
207
197
|
],
|
|
208
198
|
"variables": [
|
|
@@ -211,7 +201,7 @@
|
|
|
211
201
|
"name": "NB_HAB",
|
|
212
202
|
"values": {
|
|
213
203
|
"PREVIOUS": null,
|
|
214
|
-
"COLLECTED":
|
|
204
|
+
"COLLECTED": 2,
|
|
215
205
|
"FORCED": null,
|
|
216
206
|
"EDITED": null,
|
|
217
207
|
"INPUTED": null
|
|
@@ -232,11 +222,11 @@
|
|
|
232
222
|
"variableType": "COLLECTED",
|
|
233
223
|
"name": "AGE",
|
|
234
224
|
"values": {
|
|
235
|
-
"PREVIOUS":
|
|
236
|
-
"COLLECTED": [
|
|
237
|
-
"FORCED":
|
|
238
|
-
"EDITED":
|
|
239
|
-
"INPUTED":
|
|
225
|
+
"PREVIOUS": null,
|
|
226
|
+
"COLLECTED": [15, 15],
|
|
227
|
+
"FORCED": null,
|
|
228
|
+
"EDITED": null,
|
|
229
|
+
"INPUTED": null
|
|
240
230
|
}
|
|
241
231
|
},
|
|
242
232
|
{
|
|
@@ -254,11 +244,11 @@
|
|
|
254
244
|
"variableType": "COLLECTED",
|
|
255
245
|
"name": "PRENOMS",
|
|
256
246
|
"values": {
|
|
257
|
-
"PREVIOUS":
|
|
258
|
-
"COLLECTED": [
|
|
259
|
-
"FORCED":
|
|
260
|
-
"EDITED":
|
|
261
|
-
"INPUTED":
|
|
247
|
+
"PREVIOUS": null,
|
|
248
|
+
"COLLECTED": ["Fanny", "Ines"],
|
|
249
|
+
"FORCED": null,
|
|
250
|
+
"EDITED": null,
|
|
251
|
+
"INPUTED": null
|
|
262
252
|
}
|
|
263
253
|
},
|
|
264
254
|
{
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.WithDeclarations = void 0;
|
|
6
|
+
exports["default"] = exports.WithDeclarations = exports.Default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
9
9
|
var _sourceDeclarations = _interopRequireDefault(require("./source-declarations.json"));
|
|
10
|
+
var _source = _interopRequireDefault(require("./source.json"));
|
|
10
11
|
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -25,6 +26,11 @@ var _default = exports["default"] = stories;
|
|
|
25
26
|
var Template = function Template(args) {
|
|
26
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_orchestrator["default"], _objectSpread({}, args));
|
|
27
28
|
};
|
|
29
|
+
var Default = exports.Default = Template.bind({});
|
|
30
|
+
Default.args = {
|
|
31
|
+
id: 'sequence-simple',
|
|
32
|
+
source: _source["default"]
|
|
33
|
+
};
|
|
28
34
|
var WithDeclarations = exports.WithDeclarations = Template.bind({});
|
|
29
35
|
WithDeclarations.args = {
|
|
30
36
|
id: 'sequence-declarations',
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"maxPage": "1",
|
|
3
|
+
"components": [
|
|
4
|
+
{
|
|
5
|
+
"componentType": "Sequence",
|
|
6
|
+
"page": "1",
|
|
7
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
8
|
+
"label": { "value": "\"Sequence example\"", "type": "VTL|MD" }
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"componentType": "Subsequence",
|
|
12
|
+
"page": "1",
|
|
13
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
14
|
+
"label": { "value": "\"Subsequence example\"", "type": "VTL|MD" }
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"value": "\"Code ou terme des libellés de la Naf-rev2\"",
|
|
41
41
|
"type": "VTL|MD"
|
|
42
42
|
},
|
|
43
|
-
"description": { "value": "Exemple: 01 ou tabac", "type": "VTL|MD" },
|
|
43
|
+
"description": { "value": "\"Exemple: 01 ou tabac\"", "type": "VTL|MD" },
|
|
44
44
|
"storeName": "naf-rev2",
|
|
45
45
|
"conditionFilter": {
|
|
46
46
|
"value": "true",
|
|
@@ -42,6 +42,30 @@ function fetchFake() {
|
|
|
42
42
|
return r.json();
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
+
function fetchPCS2020() {
|
|
46
|
+
return fetch('/libelles-pcs-2020.json').then(function (r) {
|
|
47
|
+
return r.json();
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
var infoPCS2020 = {
|
|
51
|
+
name: 'libelle-pcs2020',
|
|
52
|
+
fields: [{
|
|
53
|
+
name: 'id',
|
|
54
|
+
rules: ['[\\w]+'],
|
|
55
|
+
language: 'French',
|
|
56
|
+
min: 2
|
|
57
|
+
}],
|
|
58
|
+
queryParser: {
|
|
59
|
+
type: 'tokenized',
|
|
60
|
+
params: {
|
|
61
|
+
language: 'French',
|
|
62
|
+
pattern: '[\\w]+'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
meloto: true,
|
|
66
|
+
version: '1',
|
|
67
|
+
stopWords: ['a', 'au', 'dans', 'de', 'des', 'du', 'en', 'er', 'la', 'le', 'ou', 'sur', 'd', 'l', 'aux', 'dans', 'un', 'une', 'pour', 'avec', 'chez', 'par', 'les']
|
|
68
|
+
};
|
|
45
69
|
var infoFake = {
|
|
46
70
|
name: 'fake',
|
|
47
71
|
fields: [{
|
|
@@ -77,7 +101,7 @@ var infoNaf = {
|
|
|
77
101
|
}
|
|
78
102
|
},
|
|
79
103
|
version: '1',
|
|
80
|
-
meloto:
|
|
104
|
+
meloto: true
|
|
81
105
|
};
|
|
82
106
|
function loadOne(_x, _x2) {
|
|
83
107
|
return _loadOne.apply(this, arguments);
|
|
@@ -186,6 +210,17 @@ var Template = function Template(args) {
|
|
|
186
210
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
187
211
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("ul", {
|
|
188
212
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
|
|
213
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
214
|
+
type: "button",
|
|
215
|
+
value: "load PCS2020",
|
|
216
|
+
onClick: function onClick() {
|
|
217
|
+
return loadOne(infoPCS2020, fetchPCS2020);
|
|
218
|
+
}
|
|
219
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Search, {
|
|
220
|
+
storeInfo: infoPCS2020,
|
|
221
|
+
defaultValue: "st"
|
|
222
|
+
})]
|
|
223
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
|
|
189
224
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
190
225
|
type: "button",
|
|
191
226
|
value: "load NAF",
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": [
|
|
3
|
+
{
|
|
4
|
+
"id": "j4nwc63q",
|
|
5
|
+
"componentType": "Table",
|
|
6
|
+
"mandatory": false,
|
|
7
|
+
"positioning": "HORIZONTAL",
|
|
8
|
+
"label": {
|
|
9
|
+
"value": "\"➡ \" || \"Please, specify the percentage of Jay’s expenses in the Kwik-E-Mart for each product?\"",
|
|
10
|
+
"type": "VTL|MD"
|
|
11
|
+
},
|
|
12
|
+
"conditionFilter": {
|
|
13
|
+
"value": "true",
|
|
14
|
+
"type": "VTL"
|
|
15
|
+
},
|
|
16
|
+
"missingResponse": { "name": "PERCENTAGE_EXPENSES_MISSING" },
|
|
17
|
+
"bindingDependencies": [
|
|
18
|
+
"PERCENTAGE_EXPENSES_MISSING",
|
|
19
|
+
"PERCENTAGE_EXPENSES11",
|
|
20
|
+
"PERCENTAGE_EXPENSES21",
|
|
21
|
+
"PERCENTAGE_EXPENSES31",
|
|
22
|
+
"PERCENTAGE_EXPENSES41",
|
|
23
|
+
"PERCENTAGE_EXPENSES51",
|
|
24
|
+
"PERCENTAGE_EXPENSES61",
|
|
25
|
+
"PERCENTAGE_EXPENSES71"
|
|
26
|
+
],
|
|
27
|
+
"header": [
|
|
28
|
+
{ "colspan": 2, "label": { "value": "", "type": "VTL|MD" } },
|
|
29
|
+
|
|
30
|
+
{ "label": { "value": "\"Percentage\"", "type": "VTL|MD" } }
|
|
31
|
+
],
|
|
32
|
+
"body": [
|
|
33
|
+
[
|
|
34
|
+
{
|
|
35
|
+
"rowspan": 2,
|
|
36
|
+
"value": "A",
|
|
37
|
+
"label": { "value": "\"Frozen products\"", "type": "VTL|MD" }
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
{
|
|
41
|
+
"value": "A1",
|
|
42
|
+
"label": { "value": "\"Ice creams\"", "type": "VTL|MD" }
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
{
|
|
46
|
+
"componentType": "InputNumber",
|
|
47
|
+
"min": 0,
|
|
48
|
+
"max": 100,
|
|
49
|
+
"decimals": 1,
|
|
50
|
+
"id": "j4nwc63q-QOP-kewv2h3o",
|
|
51
|
+
"unit": "%",
|
|
52
|
+
"response": { "name": "PERCENTAGE_EXPENSES11" },
|
|
53
|
+
"bindingDependencies": ["PERCENTAGE_EXPENSES11"]
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
|
|
57
|
+
[
|
|
58
|
+
{
|
|
59
|
+
"value": "A2",
|
|
60
|
+
"label": { "value": "\"Jasper Beardly\"", "type": "VTL|MD" }
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
{
|
|
64
|
+
"componentType": "InputNumber",
|
|
65
|
+
"min": 0,
|
|
66
|
+
"max": 100,
|
|
67
|
+
"decimals": 1,
|
|
68
|
+
"id": "j4nwc63q-QOP-kewvka2j",
|
|
69
|
+
"unit": "%",
|
|
70
|
+
"response": { "name": "PERCENTAGE_EXPENSES21" },
|
|
71
|
+
"bindingDependencies": ["PERCENTAGE_EXPENSES21"]
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
|
|
75
|
+
[
|
|
76
|
+
{
|
|
77
|
+
"rowspan": 3,
|
|
78
|
+
"value": "B",
|
|
79
|
+
"label": { "value": "\"Meat\"", "type": "VTL|MD" }
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
{
|
|
83
|
+
"value": "B1",
|
|
84
|
+
"label": { "value": "\"Bacon\"", "type": "VTL|MD" }
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
{
|
|
88
|
+
"componentType": "InputNumber",
|
|
89
|
+
"min": 0,
|
|
90
|
+
"max": 100,
|
|
91
|
+
"decimals": 1,
|
|
92
|
+
"id": "j4nwc63q-QOP-kewv1f2a",
|
|
93
|
+
"unit": "%",
|
|
94
|
+
"response": { "name": "PERCENTAGE_EXPENSES31" },
|
|
95
|
+
"bindingDependencies": ["PERCENTAGE_EXPENSES31"]
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
|
|
99
|
+
[
|
|
100
|
+
{
|
|
101
|
+
"value": "B2",
|
|
102
|
+
"label": { "value": "\"Pork chop\"", "type": "VTL|MD" }
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
{
|
|
106
|
+
"componentType": "InputNumber",
|
|
107
|
+
"min": 0,
|
|
108
|
+
"max": 100,
|
|
109
|
+
"decimals": 1,
|
|
110
|
+
"id": "j4nwc63q-QOP-kewvb2ql",
|
|
111
|
+
"unit": "%",
|
|
112
|
+
"response": { "name": "PERCENTAGE_EXPENSES41" },
|
|
113
|
+
"bindingDependencies": ["PERCENTAGE_EXPENSES41"]
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
|
|
117
|
+
[
|
|
118
|
+
{
|
|
119
|
+
"value": "B3",
|
|
120
|
+
"label": { "value": "\"Chicken\"", "type": "VTL|MD" }
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
{
|
|
124
|
+
"componentType": "InputNumber",
|
|
125
|
+
"min": 0,
|
|
126
|
+
"max": 100,
|
|
127
|
+
"decimals": 1,
|
|
128
|
+
"id": "j4nwc63q-QOP-kewvbxla",
|
|
129
|
+
"unit": "%",
|
|
130
|
+
"response": { "name": "PERCENTAGE_EXPENSES51" },
|
|
131
|
+
"bindingDependencies": ["PERCENTAGE_EXPENSES51"]
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
|
|
135
|
+
[
|
|
136
|
+
{
|
|
137
|
+
"value": "C",
|
|
138
|
+
"label": { "value": "\"Compote\"", "type": "VTL|MD" }
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
{
|
|
142
|
+
"value": "C1",
|
|
143
|
+
"label": { "value": "\"Powersauce\"", "type": "VTL|MD" }
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
{
|
|
147
|
+
"componentType": "InputNumber",
|
|
148
|
+
"min": 0,
|
|
149
|
+
"max": 100,
|
|
150
|
+
"decimals": 1,
|
|
151
|
+
"id": "j4nwc63q-QOP-kewvkjp0",
|
|
152
|
+
"unit": "%",
|
|
153
|
+
"response": { "name": "PERCENTAGE_EXPENSES61" },
|
|
154
|
+
"bindingDependencies": ["PERCENTAGE_EXPENSES61"]
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
|
|
158
|
+
[
|
|
159
|
+
{
|
|
160
|
+
"colspan": 2,
|
|
161
|
+
"value": "D",
|
|
162
|
+
"label": { "value": "\"Other\"", "type": "VTL|MD" }
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
{
|
|
166
|
+
"componentType": "InputNumber",
|
|
167
|
+
"min": 0,
|
|
168
|
+
"max": 100,
|
|
169
|
+
"decimals": 1,
|
|
170
|
+
"id": "j4nwc63q-QOP-kewv2cyx",
|
|
171
|
+
"unit": "%",
|
|
172
|
+
"response": { "name": "PERCENTAGE_EXPENSES71" },
|
|
173
|
+
"bindingDependencies": ["PERCENTAGE_EXPENSES71"]
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
|
|
177
|
+
[
|
|
178
|
+
{
|
|
179
|
+
"colspan": 2,
|
|
180
|
+
"value": "E",
|
|
181
|
+
"label": { "value": "\"Total\"", "type": "VTL|MD" }
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
{ "label": { "value": "SUM_EXPENSES", "type": "VTL|MD" } }
|
|
185
|
+
]
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"variables": [
|
|
190
|
+
{
|
|
191
|
+
"variableType": "COLLECTED",
|
|
192
|
+
"name": "PERCENTAGE_EXPENSES11",
|
|
193
|
+
"values": {
|
|
194
|
+
"PREVIOUS": null,
|
|
195
|
+
"COLLECTED": null,
|
|
196
|
+
"FORCED": null,
|
|
197
|
+
"EDITED": null,
|
|
198
|
+
"INPUTED": null
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
{
|
|
203
|
+
"variableType": "COLLECTED",
|
|
204
|
+
"name": "PERCENTAGE_EXPENSES21",
|
|
205
|
+
"values": {
|
|
206
|
+
"PREVIOUS": null,
|
|
207
|
+
"COLLECTED": null,
|
|
208
|
+
"FORCED": null,
|
|
209
|
+
"EDITED": null,
|
|
210
|
+
"INPUTED": null
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
{
|
|
215
|
+
"variableType": "COLLECTED",
|
|
216
|
+
"name": "PERCENTAGE_EXPENSES31",
|
|
217
|
+
"values": {
|
|
218
|
+
"PREVIOUS": null,
|
|
219
|
+
"COLLECTED": null,
|
|
220
|
+
"FORCED": null,
|
|
221
|
+
"EDITED": null,
|
|
222
|
+
"INPUTED": null
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
{
|
|
227
|
+
"variableType": "COLLECTED",
|
|
228
|
+
"name": "PERCENTAGE_EXPENSES41",
|
|
229
|
+
"values": {
|
|
230
|
+
"PREVIOUS": null,
|
|
231
|
+
"COLLECTED": null,
|
|
232
|
+
"FORCED": null,
|
|
233
|
+
"EDITED": null,
|
|
234
|
+
"INPUTED": null
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
{
|
|
239
|
+
"variableType": "COLLECTED",
|
|
240
|
+
"name": "PERCENTAGE_EXPENSES51",
|
|
241
|
+
"values": {
|
|
242
|
+
"PREVIOUS": null,
|
|
243
|
+
"COLLECTED": null,
|
|
244
|
+
"FORCED": null,
|
|
245
|
+
"EDITED": null,
|
|
246
|
+
"INPUTED": null
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
|
|
250
|
+
{
|
|
251
|
+
"variableType": "COLLECTED",
|
|
252
|
+
"name": "PERCENTAGE_EXPENSES61",
|
|
253
|
+
"values": {
|
|
254
|
+
"PREVIOUS": null,
|
|
255
|
+
"COLLECTED": null,
|
|
256
|
+
"FORCED": null,
|
|
257
|
+
"EDITED": null,
|
|
258
|
+
"INPUTED": null
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
{
|
|
263
|
+
"variableType": "COLLECTED",
|
|
264
|
+
"name": "PERCENTAGE_EXPENSES71",
|
|
265
|
+
"values": {
|
|
266
|
+
"PREVIOUS": null,
|
|
267
|
+
"COLLECTED": null,
|
|
268
|
+
"FORCED": null,
|
|
269
|
+
"EDITED": null,
|
|
270
|
+
"INPUTED": null
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
|
|
274
|
+
{
|
|
275
|
+
"variableType": "COLLECTED",
|
|
276
|
+
"name": "PERCENTAGE_EXPENSES81",
|
|
277
|
+
"values": {
|
|
278
|
+
"PREVIOUS": null,
|
|
279
|
+
"COLLECTED": null,
|
|
280
|
+
"FORCED": null,
|
|
281
|
+
"EDITED": null,
|
|
282
|
+
"INPUTED": null
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
{
|
|
287
|
+
"variableType": "CALCULATED",
|
|
288
|
+
"name": "FILTER_RESULT_PERCENTAGE_EXPENSES",
|
|
289
|
+
"expression": { "value": "true", "type": "VTL" },
|
|
290
|
+
"inFilter": "false"
|
|
291
|
+
},
|
|
292
|
+
|
|
293
|
+
{
|
|
294
|
+
"variableType": "CALCULATED",
|
|
295
|
+
"name": "SUM_EXPENSES",
|
|
296
|
+
"expression": {
|
|
297
|
+
"value": "nvl(PERCENTAGE_EXPENSES11,0) + nvl(PERCENTAGE_EXPENSES21,0) + nvl(PERCENTAGE_EXPENSES31,0) + nvl(PERCENTAGE_EXPENSES41,0) + nvl(PERCENTAGE_EXPENSES51,0) + nvl(PERCENTAGE_EXPENSES61,0), + nvl(PERCENTAGE_EXPENSES71,0)",
|
|
298
|
+
"type": "VTL"
|
|
299
|
+
},
|
|
300
|
+
"bindingDependencies": [
|
|
301
|
+
"PERCENTAGE_EXPENSES11",
|
|
302
|
+
"PERCENTAGE_EXPENSES21",
|
|
303
|
+
"PERCENTAGE_EXPENSES31",
|
|
304
|
+
"PERCENTAGE_EXPENSES41",
|
|
305
|
+
"PERCENTAGE_EXPENSES51",
|
|
306
|
+
"PERCENTAGE_EXPENSES61",
|
|
307
|
+
"PERCENTAGE_EXPENSES71"
|
|
308
|
+
],
|
|
309
|
+
"inFilter": "false"
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
"cleaning": {},
|
|
313
|
+
"resizing": {}
|
|
314
|
+
}
|