@inseefr/lunatic 2.4.9 → 2.5.0-beta
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/commons/components/orchestrated-component.js +10 -30
- package/lib/components/commons/create-row-orchestrator.js +7 -2
- package/lib/components/component-set/html/component-set-components.js +16 -25
- package/lib/components/component-set/lunatic-component-set.js +23 -37
- package/lib/components/index.js +14 -0
- package/lib/components/loop/block-for-loop/block-for-loop.js +4 -2
- package/lib/components/loop/block-for-loop/row.js +4 -2
- package/lib/components/loop/loop.js +6 -3
- package/lib/components/loop/roster-for-loop/body.js +4 -2
- package/lib/components/loop/roster-for-loop/roster-for-loop.js +2 -0
- package/lib/components/loop/roster-for-loop/roster-table.js +4 -2
- package/lib/components/loop/roster-for-loop/row.js +3 -1
- package/lib/components/question-explication/html/question-explication.js +53 -0
- package/lib/components/question-explication/html/question-explication.scss +35 -0
- package/lib/components/question-explication/index.js +13 -0
- package/lib/components/question-explication/lunatic-question-explication.js +32 -0
- package/lib/components/question-explication/question-explication.spec.js +49 -0
- package/lib/components/roundabout/lunatic-roundabout.js +2 -4
- package/lib/components/subsequence/subsequence.js +0 -2
- package/lib/components/subsequence/subsequence.spec.js +2 -2
- package/lib/components/summary/html/summary-container.js +14 -0
- package/lib/components/summary/html/summary-responses.js +53 -0
- package/lib/components/summary/html/summary-title.js +20 -0
- package/lib/components/summary/index.js +12 -0
- package/lib/components/summary/lunatic-summary.js +99 -0
- package/lib/src/components/commons/components/orchestrated-component.d.ts +4 -5
- package/lib/src/components/commons/create-row-orchestrator.d.ts +3 -2
- package/lib/src/components/component-set/html/component-set-components.d.ts +2 -2
- package/lib/src/components/component-set/lunatic-component-set.d.ts +2 -1
- package/lib/src/components/index.d.ts +2 -0
- package/lib/src/components/loop/block-for-loop/block-for-loop-ochestrator.d.ts +3 -2
- package/lib/src/components/loop/block-for-loop/row.d.ts +2 -1
- package/lib/src/components/loop/roster-for-loop/body.d.ts +2 -2
- package/lib/src/components/loop/roster-for-loop/roster-for-loop-orchestrator.d.ts +3 -2
- package/lib/src/components/loop/roster-for-loop/roster-table.d.ts +2 -2
- package/lib/src/components/loop/roster-for-loop/row.d.ts +2 -1
- package/lib/src/components/question-explication/html/question-explication.d.ts +7 -0
- package/lib/src/components/question-explication/index.d.ts +1 -0
- package/lib/src/components/question-explication/lunatic-question-explication.d.ts +3 -0
- package/lib/src/components/question-explication/question-explication.spec.d.ts +1 -0
- package/lib/src/components/subsequence/subsequence.d.ts +2 -2
- package/lib/src/components/summary/html/summary-container.d.ts +2 -0
- package/lib/src/components/summary/html/summary-responses.d.ts +12 -0
- package/lib/src/components/summary/html/summary-title.d.ts +5 -0
- package/lib/src/components/summary/index.d.ts +1 -0
- package/lib/src/components/summary/lunatic-summary.d.ts +7 -0
- package/lib/src/components/type.d.ts +18 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/use-lunatic/actions.d.ts +6 -169
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +137 -112
- package/lib/src/use-lunatic/commons/fill-components/fill-missing-response.d.ts +2 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +115 -94
- package/lib/src/use-lunatic/commons/page-navigation.d.ts +7 -0
- package/lib/src/use-lunatic/commons/page-navigation.spec.d.ts +1 -0
- package/lib/src/use-lunatic/commons/page.d.ts +11 -0
- package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
- package/lib/src/use-lunatic/reducer/commons/auto-explore-loop.d.ts +5 -0
- package/lib/src/use-lunatic/reducer/commons/index.d.ts +0 -1
- package/lib/src/use-lunatic/reducer/commons/is-loop-component.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +1 -7
- package/lib/src/use-lunatic/replace-component-sequence.d.ts +3 -3
- package/lib/src/use-lunatic/type-source.d.ts +27 -13
- package/lib/src/use-lunatic/type.d.ts +4 -12
- package/lib/src/use-lunatic/use-lunatic.d.ts +474 -10
- package/lib/src/utils/store-tools/worker-path.d.ts +1 -0
- package/lib/stories/component-set/component-set.stories.js +2 -1
- package/lib/stories/loop/block-for-loop.stories.js +8 -1
- package/lib/stories/loop/roster-for-loop.stories.js +8 -1
- package/lib/{use-lunatic/reducer/reduce-roundabout.js → stories/question-explication/question-explication.stories.js} +21 -17
- package/lib/stories/question-explication/source.json +17 -0
- package/lib/stories/roundabout/roundabout.stories.js +2 -1
- package/lib/stories/suggester/source-component-set.json +67 -0
- package/lib/stories/suggester/suggester.stories.js +9 -1
- package/lib/stories/summary/data.json +32 -0
- package/lib/stories/summary/source.json +353 -0
- package/lib/stories/summary/summary.stories.js +37 -0
- package/lib/stories/utils/orchestrator.js +5 -3
- package/lib/use-lunatic/commons/check-pager.js +1 -2
- package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +14 -12
- package/lib/use-lunatic/commons/page-navigation.js +109 -0
- package/lib/use-lunatic/commons/page-navigation.spec.js +129 -0
- package/lib/use-lunatic/commons/page.js +44 -0
- package/lib/use-lunatic/reducer/commons/auto-explore-loop.js +39 -0
- package/lib/use-lunatic/reducer/commons/index.js +0 -8
- package/lib/use-lunatic/reducer/reduce-go-next-page.js +25 -159
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js +21 -127
- package/lib/use-lunatic/reducer/reduce-go-to-page.js +53 -55
- package/lib/use-lunatic/reducer/reduce-on-init.js +5 -8
- package/lib/use-lunatic/reducer/resolve-component-controls/resolve-roundabout-control.js +1 -1
- package/lib/use-lunatic/reducer/resolve-component-controls/resolve-simple-control.js +1 -1
- package/lib/use-lunatic/type-source.js +0 -2
- package/lib/use-lunatic/use-lunatic.js +17 -3
- package/lib/utils/store-tools/auto-load.js +2 -2
- package/lib/utils/store-tools/worker-path.js +13 -0
- package/lib/utils/suggester-workers/append-to-index/create-append-task.js +2 -2
- package/package.json +3 -3
- package/lib/components/button/__snapshots__/lunatic-button.spec.jsx.snap +0 -80
- package/lib/components/commons/components/combo-box/selection/__snapshots__/selection.spec.jsx.snap +0 -81
- package/lib/src/use-lunatic/reducer/commons/is-empty-on-empty-page.d.ts +0 -3
- package/lib/src/use-lunatic/reducer/reduce-roundabout.d.ts +0 -2
- package/lib/use-lunatic/reducer/commons/is-empty-on-empty-page.js +0 -32
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.WithHeader = exports.Default = void 0;
|
|
6
|
+
exports["default"] = exports.WithHeader = exports.ReadOnly = exports.Default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
9
9
|
var _sourceBloc = _interopRequireDefault(require("./source-bloc.json"));
|
|
@@ -38,4 +38,11 @@ exports.WithHeader = WithHeader;
|
|
|
38
38
|
WithHeader.args = {
|
|
39
39
|
id: 'bloc-for-loop-headers',
|
|
40
40
|
source: _sourceWithHeader["default"]
|
|
41
|
+
};
|
|
42
|
+
var ReadOnly = Template.bind({});
|
|
43
|
+
exports.ReadOnly = ReadOnly;
|
|
44
|
+
ReadOnly.args = {
|
|
45
|
+
id: 'bloc-for-loop',
|
|
46
|
+
source: _sourceBloc["default"],
|
|
47
|
+
readOnly: true
|
|
41
48
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.Default = void 0;
|
|
6
|
+
exports["default"] = exports.ReadOnly = exports.Default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
9
9
|
var _sourceRoster = _interopRequireDefault(require("./source-roster"));
|
|
@@ -28,7 +28,14 @@ var Template = function Template(args) {
|
|
|
28
28
|
};
|
|
29
29
|
var Default = Template.bind({});
|
|
30
30
|
exports.Default = Default;
|
|
31
|
+
var ReadOnly = Template.bind({});
|
|
32
|
+
exports.ReadOnly = ReadOnly;
|
|
31
33
|
Default.args = {
|
|
32
34
|
id: 'roster-for-loop',
|
|
33
35
|
source: _sourceRoster["default"]
|
|
36
|
+
};
|
|
37
|
+
ReadOnly.args = {
|
|
38
|
+
id: 'roster-for-loop',
|
|
39
|
+
source: _sourceRoster["default"],
|
|
40
|
+
readOnly: true
|
|
34
41
|
};
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
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");
|
|
8
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
12
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
10
13
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -12,18 +15,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
12
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; }
|
|
13
16
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
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); }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
var stories = {
|
|
19
|
+
title: 'Components/QuestionExplication',
|
|
20
|
+
component: _orchestrator["default"],
|
|
21
|
+
argTypes: _defaultArgTypes["default"]
|
|
22
|
+
};
|
|
23
|
+
var _default = stories;
|
|
24
|
+
exports["default"] = _default;
|
|
25
|
+
var Template = function Template(args) {
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_orchestrator["default"], _objectSpread({}, args));
|
|
27
|
+
};
|
|
28
|
+
var Default = Template.bind({});
|
|
29
|
+
exports.Default = Default;
|
|
30
|
+
Default.args = {
|
|
31
|
+
id: 'questionExplication',
|
|
32
|
+
source: _source["default"]
|
|
33
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": [
|
|
3
|
+
{
|
|
4
|
+
"id": "questionExplication",
|
|
5
|
+
"componentType": "QuestionExplication",
|
|
6
|
+
"label": {
|
|
7
|
+
"value": "\"Accordion label\"",
|
|
8
|
+
"type": "VTL"
|
|
9
|
+
},
|
|
10
|
+
"description": {
|
|
11
|
+
"value": "\"Accordion content\"",
|
|
12
|
+
"type": "VTL"
|
|
13
|
+
},
|
|
14
|
+
"bgColor": "red"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"maxPage": "1",
|
|
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
|
+
"components": [
|
|
23
|
+
{
|
|
24
|
+
"id": "lfwg2ny2",
|
|
25
|
+
"componentType": "ComponentSet",
|
|
26
|
+
"page": "1",
|
|
27
|
+
"className": "ComponentSet",
|
|
28
|
+
"conditionFilter": {
|
|
29
|
+
"value": "true",
|
|
30
|
+
"type": "VTL"
|
|
31
|
+
},
|
|
32
|
+
"label": {
|
|
33
|
+
"value": "\"Chercher votre activité principale.\"",
|
|
34
|
+
"type": "VTL"
|
|
35
|
+
},
|
|
36
|
+
"components": [
|
|
37
|
+
{
|
|
38
|
+
"id": "communes-2023",
|
|
39
|
+
"componentType": "Suggester",
|
|
40
|
+
"label": { "value": "\"NAF\"", "type": "VTL" },
|
|
41
|
+
"description": "\"industrie\"",
|
|
42
|
+
"storeName": "naf-rev2",
|
|
43
|
+
"conditionFilter": {
|
|
44
|
+
"value": "true",
|
|
45
|
+
"type": "VTL"
|
|
46
|
+
},
|
|
47
|
+
"response": {
|
|
48
|
+
"name": "ACT"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"variables": [
|
|
55
|
+
{
|
|
56
|
+
"variableType": "COLLECTED",
|
|
57
|
+
"name": "ACT",
|
|
58
|
+
"values": {
|
|
59
|
+
"PREVIOUS": null,
|
|
60
|
+
"COLLECTED": null,
|
|
61
|
+
"FORCED": null,
|
|
62
|
+
"EDITED": null,
|
|
63
|
+
"INPUTED": null
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.Simple = exports.Default = void 0;
|
|
6
|
+
exports["default"] = exports.Simple = exports.Default = exports.ComponentSet = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
9
9
|
var _source = _interopRequireDefault(require("./source"));
|
|
10
10
|
var _simple = _interopRequireDefault(require("./simple"));
|
|
11
|
+
var _sourceComponentSet = _interopRequireDefault(require("./source-component-set"));
|
|
11
12
|
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -81,4 +82,11 @@ Simple.args = {
|
|
|
81
82
|
control: 'boolean',
|
|
82
83
|
defaultValue: true
|
|
83
84
|
}
|
|
85
|
+
};
|
|
86
|
+
var ComponentSet = Template.bind({});
|
|
87
|
+
exports.ComponentSet = ComponentSet;
|
|
88
|
+
ComponentSet.args = {
|
|
89
|
+
source: _sourceComponentSet["default"],
|
|
90
|
+
getReferentiel: getReferentiel,
|
|
91
|
+
autoSuggesterLoading: true
|
|
84
92
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"COLLECTED": {
|
|
3
|
+
"NB_HAB": {
|
|
4
|
+
"EDITED": null,
|
|
5
|
+
"FORCED": null,
|
|
6
|
+
"INPUTED": null,
|
|
7
|
+
"PREVIOUS": null,
|
|
8
|
+
"COLLECTED": 2
|
|
9
|
+
},
|
|
10
|
+
"PRENOMS": {
|
|
11
|
+
"EDITED": [null],
|
|
12
|
+
"FORCED": [null],
|
|
13
|
+
"INPUTED": [null],
|
|
14
|
+
"PREVIOUS": [null],
|
|
15
|
+
"COLLECTED": ["Matt", "Julia"]
|
|
16
|
+
},
|
|
17
|
+
"AGE": {
|
|
18
|
+
"EDITED": [null],
|
|
19
|
+
"FORCED": [null],
|
|
20
|
+
"INPUTED": [null],
|
|
21
|
+
"PREVIOUS": [null],
|
|
22
|
+
"COLLECTED": [26, 31]
|
|
23
|
+
},
|
|
24
|
+
"SEXE": {
|
|
25
|
+
"EDITED": [null],
|
|
26
|
+
"FORCED": [null],
|
|
27
|
+
"INPUTED": [null],
|
|
28
|
+
"PREVIOUS": [null],
|
|
29
|
+
"COLLECTED": ["1", "2"]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
{
|
|
2
|
+
"maxPage": "5",
|
|
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
|
+
{
|
|
15
|
+
"id": "how",
|
|
16
|
+
"componentType": "InputNumber",
|
|
17
|
+
"mandatory": false,
|
|
18
|
+
"page": "2",
|
|
19
|
+
"min": 1,
|
|
20
|
+
"max": 10,
|
|
21
|
+
"decimals": 0,
|
|
22
|
+
"label": {
|
|
23
|
+
"value": "\"Combien de personnes vivent habituellement à votre adresse ?\"",
|
|
24
|
+
"type": "VTL|MD"
|
|
25
|
+
},
|
|
26
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
27
|
+
"response": { "name": "NB_HAB" }
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "hoew",
|
|
31
|
+
"componentType": "InputNumber",
|
|
32
|
+
"mandatory": false,
|
|
33
|
+
"page": "2",
|
|
34
|
+
"min": 42,
|
|
35
|
+
"max": 42,
|
|
36
|
+
"decimals": 0,
|
|
37
|
+
"label": {
|
|
38
|
+
"value": "\"Qu'est-ce que zéro divisé par zéro ?\"",
|
|
39
|
+
"type": "VTL|MD"
|
|
40
|
+
},
|
|
41
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
42
|
+
"response": { "name": "ZERO" }
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "loop",
|
|
46
|
+
"componentType": "Loop",
|
|
47
|
+
"page": "3",
|
|
48
|
+
"depth": 1,
|
|
49
|
+
"paginatedLoop": false,
|
|
50
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
51
|
+
"loopDependencies": ["NHAB"],
|
|
52
|
+
"lines": {
|
|
53
|
+
"min": { "value": "NB_HAB", "type": "VTL" },
|
|
54
|
+
"max": { "value": "NB_HAB", "type": "VTL" }
|
|
55
|
+
},
|
|
56
|
+
"components": [
|
|
57
|
+
{
|
|
58
|
+
"id": "prenom",
|
|
59
|
+
"componentType": "Input",
|
|
60
|
+
"mandatory": false,
|
|
61
|
+
"maxLength": 20,
|
|
62
|
+
"label": {
|
|
63
|
+
"value": "\"Prénom\"))",
|
|
64
|
+
"type": "VTL|MD"
|
|
65
|
+
},
|
|
66
|
+
"conditionFilter": {
|
|
67
|
+
"value": "true",
|
|
68
|
+
"type": "VTL"
|
|
69
|
+
},
|
|
70
|
+
"response": { "name": "PRENOMS" }
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "age",
|
|
74
|
+
"componentType": "InputNumber",
|
|
75
|
+
"maxLength": 3,
|
|
76
|
+
"label": {
|
|
77
|
+
"value": "\"Age\"))",
|
|
78
|
+
"type": "VTL|MD"
|
|
79
|
+
},
|
|
80
|
+
"conditionFilter": {
|
|
81
|
+
"value": "true",
|
|
82
|
+
"type": "VTL"
|
|
83
|
+
},
|
|
84
|
+
"response": { "name": "AGE" }
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "roundabout",
|
|
90
|
+
"componentType": "Roundabout",
|
|
91
|
+
"page": "4",
|
|
92
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
93
|
+
"iterations": { "value": "NB_HAB", "type": "VTL" },
|
|
94
|
+
"label": { "value": "\"Libellé du rondpoint\"", "type": "VTL" },
|
|
95
|
+
"locked": true,
|
|
96
|
+
"expressions": {
|
|
97
|
+
"unnecessary": {
|
|
98
|
+
"value": "AGE < 13",
|
|
99
|
+
"type": "VTL"
|
|
100
|
+
},
|
|
101
|
+
"complete": {
|
|
102
|
+
"value": "not(isnull(KNOWREC)) and not(isnull(SEXE)) and not(isnull(SOMETHING))",
|
|
103
|
+
"type": "VTL"
|
|
104
|
+
},
|
|
105
|
+
"partial": {
|
|
106
|
+
"value": "not(isnull(KNOWREC)) or not(isnull(SEXE)) or not(isnull(SOMETHING))",
|
|
107
|
+
"type": "VTL"
|
|
108
|
+
},
|
|
109
|
+
"label": {
|
|
110
|
+
"value": "\"Série de question pour \" || PRENOMS",
|
|
111
|
+
"type": "VTL"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"controls": [
|
|
115
|
+
{
|
|
116
|
+
"id": "roundabout-Carefull",
|
|
117
|
+
"criticality": "WARN",
|
|
118
|
+
"control": {
|
|
119
|
+
"value": "not(isnull(KNOWREC)) and not(isnull(SEXE)) and not(isnull(SOMETHING))",
|
|
120
|
+
"type": "VTL"
|
|
121
|
+
},
|
|
122
|
+
"type": "roundabout",
|
|
123
|
+
"iterations": { "value": "NB_HAB", "type": "VTL" },
|
|
124
|
+
"errorMessage": {
|
|
125
|
+
"value": "\"Le formulaire n'est pas complet pour \" || PRENOMS",
|
|
126
|
+
"type": "VTL|MD"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"components": [
|
|
131
|
+
{
|
|
132
|
+
"id": "radio",
|
|
133
|
+
"componentType": "Radio",
|
|
134
|
+
"mandatory": false,
|
|
135
|
+
"page": "4.1",
|
|
136
|
+
"label": {
|
|
137
|
+
"value": "\"Connaissez-vous le recensement de la population ?\"",
|
|
138
|
+
"type": "VTL|MD"
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
142
|
+
|
|
143
|
+
"options": [
|
|
144
|
+
{ "value": "1", "label": { "value": "\"oui\"", "type": "VTL|MD" } },
|
|
145
|
+
|
|
146
|
+
{ "value": "2", "label": { "value": "\"non\"", "type": "VTL|MD" } }
|
|
147
|
+
],
|
|
148
|
+
"response": { "name": "KNOWREC" }
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"id": "jsygk7m7",
|
|
152
|
+
"componentType": "Subsequence",
|
|
153
|
+
"page": "4.2",
|
|
154
|
+
"label": {
|
|
155
|
+
"value": "\"Deuxième page de questions pour \"|| PRENOMS",
|
|
156
|
+
"type": "VTL|MD"
|
|
157
|
+
},
|
|
158
|
+
"conditionFilter": { "value": "true", "type": "VTL" }
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "sexe",
|
|
162
|
+
"componentType": "Radio",
|
|
163
|
+
"page": "4.2",
|
|
164
|
+
"label": {
|
|
165
|
+
"value": "\"Sexe\"",
|
|
166
|
+
"type": "VTL"
|
|
167
|
+
},
|
|
168
|
+
"conditionFilter": {
|
|
169
|
+
"value": "true",
|
|
170
|
+
"type": "VTL"
|
|
171
|
+
},
|
|
172
|
+
"options": [
|
|
173
|
+
{
|
|
174
|
+
"value": "1",
|
|
175
|
+
"label": { "value": "\"Homme\"", "type": "VTL|MD" }
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"value": "2",
|
|
179
|
+
"label": { "value": "\"Femme\"", "type": "VTL|MD" }
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"response": { "name": "SEXE" }
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"id": "jsygk7m7",
|
|
186
|
+
"componentType": "Subsequence",
|
|
187
|
+
"page": "4.3",
|
|
188
|
+
"label": {
|
|
189
|
+
"value": "\"Troisième page de questions \" || PRENOMS",
|
|
190
|
+
"type": "VTL|MD"
|
|
191
|
+
},
|
|
192
|
+
"conditionFilter": { "value": "true", "type": "VTL" }
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"id": "kmno1n7m",
|
|
196
|
+
"componentType": "Input",
|
|
197
|
+
"maxLength": 30,
|
|
198
|
+
"page": "4.3",
|
|
199
|
+
"label": {
|
|
200
|
+
"value": "\"Dites quelque chose.\"))",
|
|
201
|
+
"type": "VTL|MD"
|
|
202
|
+
},
|
|
203
|
+
"conditionFilter": {
|
|
204
|
+
"value": "true",
|
|
205
|
+
"type": "VTL"
|
|
206
|
+
},
|
|
207
|
+
"response": { "name": "SOMETHING" }
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
{
|
|
213
|
+
"id": "Summary",
|
|
214
|
+
"componentType": "Summary",
|
|
215
|
+
"label": {
|
|
216
|
+
"value": "\"## Vos réponses.\"",
|
|
217
|
+
"type": "VTL|MD"
|
|
218
|
+
},
|
|
219
|
+
"sections": [
|
|
220
|
+
{
|
|
221
|
+
"iterations": { "value": "NB_HAB", "type": "VTL" },
|
|
222
|
+
"title": {
|
|
223
|
+
"value": "\"### Le bulletin individuel de \" || PRENOMS",
|
|
224
|
+
"type": "VTL|MD"
|
|
225
|
+
},
|
|
226
|
+
"responses": [
|
|
227
|
+
{
|
|
228
|
+
"label": { "value": "\"L'age de \" || PRENOMS", "type": "VTL" },
|
|
229
|
+
"value": { "value": "cast(AGE,string) || \" ans\"", "type": "VTL" }
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"label": { "value": "\"Le sexe de \" || PRENOMS", "type": "VTL" },
|
|
233
|
+
"value": {
|
|
234
|
+
"value": "if(SEXE = \"1\") then \"Masculin\" else \"Féminin\"",
|
|
235
|
+
"type": "VTL"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"title": {
|
|
242
|
+
"value": "\"### La feuille logement\"",
|
|
243
|
+
"type": "VTL|MD"
|
|
244
|
+
},
|
|
245
|
+
"responses": [
|
|
246
|
+
{
|
|
247
|
+
"label": { "value": "\"Zéro divisé par zéro \"", "type": "VTL" },
|
|
248
|
+
"value": { "value": "cast(ZERO,string) || \", mais ça tu savais déjà !\"", "type": "VTL" }
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"label": { "value": "\"Nombre d'habitants \"", "type": "VTL" },
|
|
252
|
+
"value": { "value": "cast(NB_HAB,string) || \" personnes\"", "type": "VTL" }
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
258
|
+
"page": "5"
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
"variables": [
|
|
262
|
+
{
|
|
263
|
+
"variableType": "COLLECTED",
|
|
264
|
+
"name": "NB_HAB",
|
|
265
|
+
"values": {
|
|
266
|
+
"PREVIOUS": null,
|
|
267
|
+
"COLLECTED": 2,
|
|
268
|
+
"FORCED": null,
|
|
269
|
+
"EDITED": null,
|
|
270
|
+
"INPUTED": null
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"variableType": "COLLECTED",
|
|
275
|
+
"name": "ZERO",
|
|
276
|
+
"values": {
|
|
277
|
+
"PREVIOUS": null,
|
|
278
|
+
"COLLECTED": null,
|
|
279
|
+
"FORCED": null,
|
|
280
|
+
"EDITED": null,
|
|
281
|
+
"INPUTED": null
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"variableType": "COLLECTED",
|
|
286
|
+
"name": "SOMETHING",
|
|
287
|
+
"values": {
|
|
288
|
+
"PREVIOUS": [null],
|
|
289
|
+
"COLLECTED": [null],
|
|
290
|
+
"FORCED": [null],
|
|
291
|
+
"EDITED": [null],
|
|
292
|
+
"INPUTED": [null]
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"variableType": "COLLECTED",
|
|
297
|
+
"name": "AGE",
|
|
298
|
+
"values": {
|
|
299
|
+
"PREVIOUS": [null],
|
|
300
|
+
"COLLECTED": [null],
|
|
301
|
+
"FORCED": [null],
|
|
302
|
+
"EDITED": [null],
|
|
303
|
+
"INPUTED": [null]
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"variableType": "COLLECTED",
|
|
308
|
+
"name": "SEXE",
|
|
309
|
+
"values": {
|
|
310
|
+
"PREVIOUS": [null],
|
|
311
|
+
"COLLECTED": [null],
|
|
312
|
+
"FORCED": [null],
|
|
313
|
+
"EDITED": [null],
|
|
314
|
+
"INPUTED": [null]
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"variableType": "COLLECTED",
|
|
319
|
+
"name": "PRENOMS",
|
|
320
|
+
"values": {
|
|
321
|
+
"PREVIOUS": [null],
|
|
322
|
+
"COLLECTED": [null],
|
|
323
|
+
"FORCED": [null],
|
|
324
|
+
"EDITED": [null],
|
|
325
|
+
"INPUTED": [null]
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"variableType": "COLLECTED",
|
|
330
|
+
"name": "KNOWREC",
|
|
331
|
+
"values": {
|
|
332
|
+
"PREVIOUS": [null],
|
|
333
|
+
"COLLECTED": [null],
|
|
334
|
+
"FORCED": [null],
|
|
335
|
+
"EDITED": [null],
|
|
336
|
+
"INPUTED": [null]
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"variableType": "CALCULATED",
|
|
341
|
+
"name": "PRENOMREF",
|
|
342
|
+
"expression": { "value": "first_value(PRENOMS over())", "type": "VTL" },
|
|
343
|
+
"bindingDependencies": ["PRENOMS"],
|
|
344
|
+
"inFilter": "true"
|
|
345
|
+
}
|
|
346
|
+
],
|
|
347
|
+
"resizing": {
|
|
348
|
+
"NB_HAB": {
|
|
349
|
+
"size": "NB_HAB",
|
|
350
|
+
"variables": ["PRENOMS", "AGE", "SEXE", "SOMETHING", "DATNAIS"]
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.Default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
9
|
+
var _source = _interopRequireDefault(require("./source"));
|
|
10
|
+
var _data = _interopRequireDefault(require("./data.json"));
|
|
11
|
+
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
15
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
+
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; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
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
|
+
var stories = {
|
|
21
|
+
title: 'Components/Summary',
|
|
22
|
+
component: _orchestrator["default"],
|
|
23
|
+
argTypes: _defaultArgTypes["default"]
|
|
24
|
+
};
|
|
25
|
+
var _default = stories;
|
|
26
|
+
exports["default"] = _default;
|
|
27
|
+
var Template = function Template(args) {
|
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_orchestrator["default"], _objectSpread({}, args));
|
|
29
|
+
};
|
|
30
|
+
var Default = Template.bind({});
|
|
31
|
+
exports.Default = Default;
|
|
32
|
+
Default.args = {
|
|
33
|
+
id: 'Summary',
|
|
34
|
+
source: _source["default"],
|
|
35
|
+
data: _data["default"],
|
|
36
|
+
pagination: true
|
|
37
|
+
};
|