@inseefr/lunatic 2.4.8-fixDatePicker → 2.4.9-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.
@@ -141,6 +141,12 @@ Object.defineProperty(exports, "SuggesterLoaderWidget", {
141
141
  return _suggesterLoaderWidget["default"];
142
142
  }
143
143
  });
144
+ Object.defineProperty(exports, "Summary", {
145
+ enumerable: true,
146
+ get: function get() {
147
+ return _summary.Summary;
148
+ }
149
+ });
144
150
  Object.defineProperty(exports, "Switch", {
145
151
  enumerable: true,
146
152
  get: function get() {
@@ -182,6 +188,7 @@ var _suggesterLoaderWidget = _interopRequireDefault(require("./suggester-loader-
182
188
  var _roundabout = _interopRequireDefault(require("./roundabout"));
183
189
  var _table = _interopRequireDefault(require("./table"));
184
190
  var _componentSet = _interopRequireDefault(require("./component-set"));
191
+ var _summary = require("./summary");
185
192
  var _questionInformation = _interopRequireDefault(require("./questions/question-information"));
186
193
  var _questionContext = _interopRequireDefault(require("./questions/question-context"));
187
194
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -4,11 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
7
  var _declarations = require("../declarations");
9
8
  var _commons = require("../commons");
10
9
  var _jsxRuntime = require("react/jsx-runtime");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
10
  function Subsequence(_ref) {
13
11
  var id = _ref.id,
14
12
  declarations = _ref.declarations,
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SummaryContainer = SummaryContainer;
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ function SummaryContainer(_ref) {
9
+ var children = _ref.children;
10
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
11
+ className: "lunatic-summary-container",
12
+ children: children
13
+ });
14
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _commons = require("../../commons");
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
+ function ListResponses(_ref) {
10
+ var title = _ref.title,
11
+ children = _ref.children;
12
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
13
+ className: "lunatic-summary-responses-iteration",
14
+ children: [title, /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
15
+ children: children
16
+ })]
17
+ });
18
+ }
19
+ function Responses(_ref2) {
20
+ var values = _ref2.values;
21
+ if (!values) {
22
+ return null;
23
+ }
24
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
25
+ children: values.map(function (_ref3, index) {
26
+ var label = _ref3.label,
27
+ value = _ref3.value;
28
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
29
+ children: [label, " : ", value]
30
+ }, index);
31
+ })
32
+ });
33
+ }
34
+ function SummaryResponses(_ref4) {
35
+ var sections = _ref4.sections;
36
+ var visibleSections = sections.filter(function (s) {
37
+ return s;
38
+ });
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
40
+ children: visibleSections.map(function (section, index) {
41
+ var title = section.title,
42
+ values = section.values;
43
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ListResponses, {
44
+ title: title,
45
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Responses, {
46
+ values: values
47
+ })
48
+ }, index);
49
+ })
50
+ });
51
+ }
52
+ var _default = (0, _commons.createCustomizableLunaticField)(SummaryResponses, 'SummaryResponses');
53
+ exports["default"] = _default;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _commons = require("../../commons");
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
+ function SummaryTitle(props) {
10
+ var label = props.label;
11
+ if (label) {
12
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
13
+ className: "lunatic-summary-label",
14
+ children: label
15
+ });
16
+ }
17
+ return null;
18
+ }
19
+ var _default = (0, _commons.createCustomizableLunaticField)(SummaryTitle, 'SummaryTitle');
20
+ exports["default"] = _default;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Summary", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _lunaticSummary.LunaticSummary;
10
+ }
11
+ });
12
+ var _lunaticSummary = require("./lunatic-summary");
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LunaticSummary = LunaticSummary;
7
+ var _summaryTitle = _interopRequireDefault(require("./html/summary-title"));
8
+ var _summaryContainer = require("./html/summary-container");
9
+ var _summaryResponses = _interopRequireDefault(require("./html/summary-responses"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
13
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
16
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
17
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
18
+ function compileResponses(responses, executeExpression, iteration) {
19
+ if (!responses) {
20
+ return [];
21
+ }
22
+ var option = iteration || iteration === 0 ? iteration : undefined;
23
+ return responses.map(function (r) {
24
+ return {
25
+ label: executeExpression(r.label, {
26
+ iteration: option
27
+ }),
28
+ value: executeExpression(r.value, {
29
+ iteration: option
30
+ })
31
+ };
32
+ });
33
+ }
34
+ function CompiledTitle(_ref) {
35
+ var executeExpression = _ref.executeExpression,
36
+ iteration = _ref.iteration,
37
+ title = _ref.title;
38
+ if (!title && iteration) {
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
40
+ children: "Valeur pour ".concat(iteration + 1)
41
+ });
42
+ }
43
+ if (!title) {
44
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
45
+ children: "Valeurs renseign\xE9s :"
46
+ });
47
+ }
48
+ var hasIteration = iteration || iteration === 0;
49
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
50
+ children: executeExpression(title, hasIteration ? {
51
+ iteration: iteration
52
+ } : {})
53
+ });
54
+ }
55
+ function LunaticSummary(props) {
56
+ var executeExpression = props.executeExpression,
57
+ label = props.label,
58
+ sections = props.sections;
59
+ var compiledSections = sections.reduce(function (acc, section) {
60
+ var iterations = section.iterations,
61
+ title = section.title,
62
+ responses = section.responses;
63
+ if (iterations) {
64
+ var compiledIterations = executeExpression(iterations);
65
+ if (responses) {
66
+ var elements = Array(compiledIterations).fill(null).map(function (_, iteration) {
67
+ return {
68
+ values: compileResponses(responses, executeExpression, iteration),
69
+ title: /*#__PURE__*/(0, _jsxRuntime.jsx)(CompiledTitle, {
70
+ executeExpression: executeExpression,
71
+ iteration: iteration,
72
+ title: title
73
+ })
74
+ };
75
+ });
76
+ return [].concat(_toConsumableArray(acc), _toConsumableArray(elements));
77
+ }
78
+ }
79
+ if (responses) {
80
+ var element = {
81
+ title: /*#__PURE__*/(0, _jsxRuntime.jsx)(CompiledTitle, {
82
+ executeExpression: executeExpression,
83
+ iteration: undefined,
84
+ title: title
85
+ }),
86
+ values: compileResponses(responses, executeExpression, undefined)
87
+ };
88
+ return [].concat(_toConsumableArray(acc), [element]);
89
+ }
90
+ return acc;
91
+ }, []);
92
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_summaryContainer.SummaryContainer, {
93
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_summaryTitle["default"], {
94
+ label: label
95
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_summaryResponses["default"], {
96
+ sections: compiledSections
97
+ })]
98
+ });
99
+ }
@@ -22,5 +22,6 @@ export { default as SuggesterLoaderWidget } from './suggester-loader-widget';
22
22
  export { default as Roundabout } from './roundabout';
23
23
  export { default as Table } from './table';
24
24
  export { default as ComponentSet } from './component-set';
25
+ export { Summary } from './summary';
25
26
  export { default as QuestionInformation } from './questions/question-information';
26
27
  export { default as QuestionContext } from './questions/question-context';
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- declare const _default: React.ComponentType<Pick<import("../type").LunaticBaseProps<string>, "label" | "id" | "declarations">>;
1
+ /// <reference types="react" />
2
+ declare const _default: import("react").ComponentType<Pick<import("../type").LunaticBaseProps<string>, "label" | "id" | "declarations">>;
3
3
  export default _default;
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export declare function SummaryContainer({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ type ResponsesValue = Array<{
3
+ label: ReactNode;
4
+ value: ReactNode;
5
+ }>;
6
+ declare const _default: import("react").ComponentType<{
7
+ sections: {
8
+ title?: ReactNode;
9
+ values?: ResponsesValue | undefined;
10
+ }[];
11
+ }>;
12
+ export default _default;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { LunaticBaseProps } from '../../type';
3
+ type SummaryTitleProps = Pick<LunaticBaseProps<string>, 'label'>;
4
+ declare const _default: import("react").ComponentType<SummaryTitleProps>;
5
+ export default _default;
@@ -0,0 +1 @@
1
+ export { LunaticSummary as Summary } from './lunatic-summary';
@@ -0,0 +1,7 @@
1
+ import { LunaticComponentProps } from '../type';
2
+ import { ReactNode } from 'react';
3
+ export type SummaryResponsesEntry = {
4
+ label: ReactNode;
5
+ value: ReactNode;
6
+ };
7
+ export declare function LunaticSummary(props: LunaticComponentProps<'Summary'>): import("react/jsx-runtime").JSX.Element;
@@ -2,6 +2,10 @@ import { LunaticComponentDefinition, LunaticError, LunaticExpression, LunaticSta
2
2
  import { CSSProperties, FunctionComponent, ReactNode } from 'react';
3
3
  import { SuggesterStatus } from '../use-lunatic/use-suggesters';
4
4
  import useLunatic from '../use-lunatic';
5
+ export type VtlExpression = {
6
+ value: string;
7
+ type: 'VTL' | 'VTL|MD';
8
+ };
5
9
  export type LunaticBaseProps<ValueType = unknown> = {
6
10
  id: string;
7
11
  handleChange: (response: {
@@ -239,6 +243,16 @@ type ComponentPropsByType = {
239
243
  name: string;
240
244
  };
241
245
  };
246
+ Summary: LunaticBaseProps<string | null> & {
247
+ sections: Array<{
248
+ responses?: Array<{
249
+ label: VtlExpression;
250
+ value: VtlExpression;
251
+ }>;
252
+ title?: VtlExpression;
253
+ iterations?: number;
254
+ }>;
255
+ };
242
256
  };
243
257
  export type LunaticComponentType = keyof ComponentPropsByType;
244
258
  export type LunaticComponentProps<T extends LunaticComponentType = LunaticComponentType> = ComponentPropsByType[T];
@@ -412,7 +412,7 @@ Filled.play = /*#__PURE__*/function () {
412
412
  _context.next = 134;
413
413
  return page.getByRole('row', {
414
414
  name: /Leave with pay/
415
- }).getByRole('spinbutton').fill('12');
415
+ }).fill('12');
416
416
  case 134:
417
417
  _context.next = 136;
418
418
  return page.getByRole('button', {
@@ -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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inseefr/lunatic",
3
- "version": "2.4.8-fixDatePicker",
3
+ "version": "2.4.9-beta",
4
4
  "workersVersion": "0.2.5-experimental",
5
5
  "description": "Library of questionnaire components",
6
6
  "repository": {
@@ -52,7 +52,7 @@
52
52
  "library"
53
53
  ],
54
54
  "dependencies": {
55
- "@inseefr/trevas": "^0.1.17",
55
+ "@inseefr/trevas": "^0.1.18",
56
56
  "@inseefr/vtl-2.0-antlr-tools": "^0.1.0-bundle",
57
57
  "antlr4": "4.11.0",
58
58
  "classnames": "^2.3.1",