@inseefr/lunatic 2.5.1-suggesterCustomisationStyle → 2.5.2-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.
Files changed (59) hide show
  1. package/lib/components/commons/components/combo-box/combo-box-container.js +3 -2
  2. package/lib/components/commons/components/combo-box/combo-box-content-box.js +2 -7
  3. package/lib/components/commons/components/combo-box/combo-box-content.js +6 -5
  4. package/lib/components/commons/components/combo-box/combo-box.js +22 -6
  5. package/lib/components/commons/components/combo-box/panel/panel-container.js +5 -2
  6. package/lib/components/commons/components/combo-box/panel/panel-container.spec.js +7 -6
  7. package/lib/components/commons/components/combo-box/panel/panel.js +2 -2
  8. package/lib/components/commons/components/combo-box/selection/selection-container.js +2 -2
  9. package/lib/components/commons/components/combo-box/selection/selection.js +2 -2
  10. package/lib/components/dropdown/lunatic-dropdown.js +3 -1
  11. package/lib/components/index.js +7 -0
  12. package/lib/components/modal/html/modal.js +88 -0
  13. package/lib/components/modal/html/modal.scss +43 -0
  14. package/lib/components/modal/index.js +13 -0
  15. package/lib/components/modal/lunatic-modal.js +38 -0
  16. package/lib/components/pairwise-links/orchestrator.js +2 -0
  17. package/lib/components/pairwise-links/pairwise-links.js +1 -1
  18. package/lib/components/pairwise-links/row.js +2 -0
  19. package/lib/components/roundabout/lunatic-roundabout.js +0 -7
  20. package/lib/components/suggester/html/suggester.js +10 -6
  21. package/lib/src/components/commons/components/combo-box/combo-box-container.d.ts +1 -0
  22. package/lib/src/components/commons/components/combo-box/combo-box-content-box.d.ts +2 -5
  23. package/lib/src/components/commons/components/combo-box/combo-box-content.d.ts +2 -2
  24. package/lib/src/components/commons/components/combo-box/combo-box.d.ts +1 -0
  25. package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +2 -1
  26. package/lib/src/components/commons/components/combo-box/panel/panel-container.d.ts +2 -2
  27. package/lib/src/components/commons/components/combo-box/selection/selection-container.d.ts +2 -2
  28. package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +2 -2
  29. package/lib/src/components/dropdown/lunatic-dropdown.d.ts +1 -1
  30. package/lib/src/components/index.d.ts +1 -0
  31. package/lib/src/components/modal/html/modal.d.ts +14 -0
  32. package/lib/src/components/modal/index.d.ts +1 -0
  33. package/lib/src/components/modal/lunatic-modal.d.ts +3 -0
  34. package/lib/src/components/pairwise-links/row.d.ts +1 -1
  35. package/lib/src/components/suggester/html/suggester.d.ts +1 -0
  36. package/lib/src/components/type.d.ts +8 -0
  37. package/lib/src/use-lunatic/actions.d.ts +4 -0
  38. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +40 -0
  39. package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +2 -0
  40. package/lib/src/use-lunatic/type.d.ts +2 -0
  41. package/lib/src/use-lunatic/use-lunatic.d.ts +22 -0
  42. package/lib/stories/modal/modal.stories.js +34 -0
  43. package/lib/stories/modal/source.json +97 -0
  44. package/lib/stories/questionnaires/simpsons/simpsons.stories.js +33 -36
  45. package/lib/stories/roundabout/data1.json +25 -0
  46. package/lib/stories/roundabout/roundabout.stories.js +12 -4
  47. package/lib/use-lunatic/commons/fill-components/fill-from-state.js +6 -2
  48. package/lib/use-lunatic/commons/page-navigation.js +2 -2
  49. package/lib/use-lunatic/commons/page.js +8 -2
  50. package/lib/use-lunatic/initial-state.js +2 -0
  51. package/lib/use-lunatic/reducer/commons/auto-explore-loop.js +24 -5
  52. package/lib/use-lunatic/reducer/reduce-go-next-page.js +11 -4
  53. package/lib/use-lunatic/reducer/reduce-go-previous-page.js +13 -5
  54. package/lib/use-lunatic/reducer/reduce-go-to-page.js +7 -6
  55. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +0 -3
  56. package/lib/use-lunatic/reducer/reduce-on-init.js +11 -7
  57. package/lib/use-lunatic/use-lunatic.js +3 -1
  58. package/package.json +1 -1
  59. /package/lib/stories/roundabout/{data.json → data2.json} +0 -0
@@ -196,7 +196,9 @@ Filled.play = /*#__PURE__*/function () {
196
196
  _context.next = 54;
197
197
  return page.getByRole('combobox', {
198
198
  name: '➡ In which state do The Simpsons reside?'
199
- }).locator('div').click();
199
+ })
200
+ // .locator('div')
201
+ .click();
200
202
  case 54:
201
203
  _context.next = 56;
202
204
  return page.getByText('Not in any state, you fool!').click();
@@ -410,9 +412,9 @@ Filled.play = /*#__PURE__*/function () {
410
412
  return page.getByText('Calendar days').click();
411
413
  case 132:
412
414
  _context.next = 134;
413
- return page.getByRole('row', {
414
- name: /Leave with pay/
415
- }).fill('12');
415
+ return page.getByRole('button', {
416
+ name: 'Next'
417
+ }).click();
416
418
  case 134:
417
419
  _context.next = 136;
418
420
  return page.getByRole('button', {
@@ -420,35 +422,35 @@ Filled.play = /*#__PURE__*/function () {
420
422
  }).click();
421
423
  case 136:
422
424
  _context.next = 138;
423
- return page.getByRole('button', {
424
- name: 'Next'
425
- }).click();
425
+ return page.getByLabel('➡ How many characters from the Simpsons family could you precisely describe?').click();
426
426
  case 138:
427
427
  _context.next = 140;
428
- return page.getByLabel('➡ How many characters from the Simpsons family could you precisely describe?').click();
428
+ return page.getByLabel('➡ How many characters from the Simpsons family could you precisely describe?').fill('2');
429
429
  case 140:
430
430
  _context.next = 142;
431
- return page.getByLabel('➡ How many characters from the Simpsons family could you precisely describe?').fill('2');
432
- case 142:
433
- _context.next = 144;
434
431
  return page.getByRole('button', {
435
432
  name: 'Next'
436
433
  }).click();
437
- case 144:
438
- _context.next = 146;
434
+ case 142:
435
+ _context.next = 144;
439
436
  return page.getByLabel('➡ What is the first name of this character?', {
440
437
  index: 0
441
438
  }).fill('Bart');
442
- case 146:
443
- _context.next = 148;
439
+ case 144:
440
+ _context.next = 146;
444
441
  return page.getByLabel('➡ How old is this character in the first episode of the Simpsons family?', {
445
442
  index: 0
446
443
  }).fill('14');
447
- case 148:
448
- _context.next = 150;
444
+ case 146:
445
+ _context.next = 148;
449
446
  return page.getByLabel('➡ What is the first name of this character?', {
450
447
  index: 1
451
448
  }).fill('Bart');
449
+ case 148:
450
+ _context.next = 150;
451
+ return page.getByRole('button', {
452
+ name: 'Next'
453
+ }).click();
452
454
  case 150:
453
455
  _context.next = 152;
454
456
  return page.getByRole('button', {
@@ -456,13 +458,13 @@ Filled.play = /*#__PURE__*/function () {
456
458
  }).click();
457
459
  case 152:
458
460
  _context.next = 154;
459
- return page.getByRole('button', {
460
- name: 'Next'
461
+ return page.getByRole('radio', {
462
+ name: '1 Yes'
461
463
  }).click();
462
464
  case 154:
463
465
  _context.next = 156;
464
- return page.getByRole('radio', {
465
- name: '1 Yes'
466
+ return page.getByRole('button', {
467
+ name: 'Next'
466
468
  }).click();
467
469
  case 156:
468
470
  _context.next = 158;
@@ -476,13 +478,13 @@ Filled.play = /*#__PURE__*/function () {
476
478
  }).click();
477
479
  case 160:
478
480
  _context.next = 162;
479
- return page.getByRole('button', {
480
- name: 'Next'
481
+ return page.getByRole('radio', {
482
+ name: '1 Yes'
481
483
  }).click();
482
484
  case 162:
483
485
  _context.next = 164;
484
- return page.getByRole('radio', {
485
- name: '1 Yes'
486
+ return page.getByRole('button', {
487
+ name: 'Next'
486
488
  }).click();
487
489
  case 164:
488
490
  _context.next = 166;
@@ -496,15 +498,15 @@ Filled.play = /*#__PURE__*/function () {
496
498
  }).click();
497
499
  case 168:
498
500
  _context.next = 170;
499
- return page.getByRole('button', {
500
- name: 'Next'
501
- }).click();
501
+ return page.getByLabel('➡ Do you have any comment about the survey?').click();
502
502
  case 170:
503
503
  _context.next = 172;
504
- return page.getByLabel('➡ Do you have any comment about the survey?').click();
504
+ return page.keyPress('x');
505
505
  case 172:
506
506
  _context.next = 174;
507
- return page.keyPress('x');
507
+ return page.getByRole('button', {
508
+ name: 'Next'
509
+ }).click();
508
510
  case 174:
509
511
  _context.next = 176;
510
512
  return page.getByRole('button', {
@@ -512,13 +514,8 @@ Filled.play = /*#__PURE__*/function () {
512
514
  }).click();
513
515
  case 176:
514
516
  _context.next = 178;
515
- return page.getByRole('button', {
516
- name: 'Next'
517
- }).click();
518
- case 178:
519
- _context.next = 180;
520
517
  return page.getByText('PAGE: 39').shouldBeVisible();
521
- case 180:
518
+ case 178:
522
519
  case "end":
523
520
  return _context.stop();
524
521
  }
@@ -0,0 +1,25 @@
1
+ {
2
+ "COLLECTED": {
3
+ "NB_HAB": {
4
+ "EDITED": null,
5
+ "FORCED": null,
6
+ "INPUTED": null,
7
+ "PREVIOUS": null,
8
+ "COLLECTED": 1
9
+ },
10
+ "PRENOMS": {
11
+ "EDITED": [null],
12
+ "FORCED": [null],
13
+ "INPUTED": [null],
14
+ "PREVIOUS": [null],
15
+ "COLLECTED": ["Fanny"]
16
+ },
17
+ "AGE": {
18
+ "EDITED": [null],
19
+ "FORCED": [null],
20
+ "INPUTED": [null],
21
+ "PREVIOUS": [null],
22
+ "COLLECTED": [15]
23
+ }
24
+ }
25
+ }
@@ -3,10 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = exports.Default = void 0;
6
+ exports["default"] = exports.OneIteration = exports.Default = void 0;
7
7
  var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
8
8
  var _source = _interopRequireDefault(require("./source"));
9
- var _data = _interopRequireDefault(require("./data"));
9
+ var _data = _interopRequireDefault(require("./data1"));
10
+ var _data2 = _interopRequireDefault(require("./data2"));
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 }; }
@@ -32,6 +33,13 @@ Default.args = {
32
33
  id: 'roundabout',
33
34
  source: _source["default"],
34
35
  pagination: true,
35
- data: _data["default"],
36
- readOnly: true
36
+ data: _data2["default"]
37
+ };
38
+ var OneIteration = Template.bind({});
39
+ exports.OneIteration = OneIteration;
40
+ OneIteration.args = {
41
+ id: 'roundabout-one-iteration',
42
+ source: _source["default"],
43
+ pagination: true,
44
+ data: _data["default"]
37
45
  };
@@ -16,14 +16,18 @@ function fillFromState(component, state) {
16
16
  preferences = state.preferences,
17
17
  goToPage = state.goToPage,
18
18
  shortcut = state.shortcut,
19
- getSuggesterStatus = state.getSuggesterStatus;
19
+ getSuggesterStatus = state.getSuggesterStatus,
20
+ goNextPage = state.goNextPage,
21
+ goPreviousPage = state.goPreviousPage;
20
22
  return _objectSpread(_objectSpread({}, component), {}, {
21
23
  handleChange: handleChange,
22
24
  executeExpression: executeExpression,
23
25
  preferences: preferences,
24
26
  goToPage: goToPage,
25
27
  shortcut: shortcut,
26
- getSuggesterStatus: getSuggesterStatus
28
+ getSuggesterStatus: getSuggesterStatus,
29
+ goNextPage: goNextPage,
30
+ goPreviousPage: goPreviousPage
27
31
  });
28
32
  }
29
33
  var _default = fillFromState;
@@ -42,7 +42,7 @@ function getNextPager(pager, parent) {
42
42
 
43
43
  // We reached the end of the sequence
44
44
  var isEndSequence = subPage && pager.nbSubPages ? subPage >= pager.nbSubPages : false;
45
- var moveUpOnEnd = parent === 'Roundabout';
45
+ var moveUpOnEnd = parent === 'Roundabout' && pager.nbIterations && pager.nbIterations > 1;
46
46
  // Move up at the end of a sequence (instead of going to the next Iteration)
47
47
  if (isEndSequence && moveUpOnEnd) {
48
48
  return _objectSpread(_objectSpread({}, pager), {}, {
@@ -74,7 +74,7 @@ function getPrevPager(pager, parent) {
74
74
  page = _ref4[0],
75
75
  subPage = _ref4[1];
76
76
  var iteration = pager.iteration;
77
- var moveUpOnStart = parent === 'Roundabout';
77
+ var moveUpOnStart = parent === 'Roundabout' && pager.nbIterations && pager.nbIterations > 1;
78
78
 
79
79
  // We reached the start of the questionnaire
80
80
  if (page <= 0) {
@@ -34,11 +34,17 @@ function isPageEmpty(state) {
34
34
  pager = state.pager;
35
35
  var iteration = pager.iteration;
36
36
  var components = (0, _index.getComponentsFromState)(state);
37
- return components.filter(function (component) {
37
+ var visibleComponents = components.filter(function (component) {
38
38
  var conditionFilter = component.conditionFilter;
39
39
  if (conditionFilter) {
40
40
  return (0, _index.executeConditionFilter)(conditionFilter, executeExpression, iteration);
41
41
  }
42
42
  return true;
43
- }).length === 0;
43
+ });
44
+
45
+ // No components are displayable on this page
46
+ if (visibleComponents.length === 0) {
47
+ return true;
48
+ }
49
+ return false;
44
50
  }
@@ -37,6 +37,8 @@ var INITIAL_STATE = {
37
37
  goToPage: function goToPage() {
38
38
  return undefined;
39
39
  },
40
+ goNextPage: function goNextPage() {},
41
+ goPreviousPage: function goPreviousPage() {},
40
42
  activeControls: false,
41
43
  getSuggesterStatus: function getSuggesterStatus(name) {
42
44
  return {
@@ -19,16 +19,35 @@ function autoExploreLoop(state) {
19
19
  var newPager = _objectSpread({}, state.pager);
20
20
  var pageId = (0, _page.getPageId)(newPager);
21
21
  var page = state.pages[pageId];
22
+ var hasExploredLoop = false;
22
23
  var isForward = direction === 'forward';
23
- // The page is a loop
24
- if (page.isLoop && page.subPages && page.subPages.length > 0) {
25
- var maxSubPage = page.subPages.length;
26
- var firstSubPage = (0, _page.pageStringToNumbers)(page.subPages[isForward ? 0 : maxSubPage - 1]);
24
+ var goInsideSubpage = function goInsideSubpage(subPages, nbIteration) {
25
+ var maxSubPage = subPages.length;
26
+ var firstSubPage = (0, _page.pageStringToNumbers)(subPages[isForward ? 0 : maxSubPage - 1]);
27
27
  newPager.page = firstSubPage[0].toString();
28
28
  newPager.subPage = firstSubPage[1] - 1; // Subpage starts at 0
29
29
  newPager.nbSubPages = maxSubPage;
30
- newPager.nbIterations = state.executeExpression(page.iterations);
30
+ newPager.nbIterations = nbIteration;
31
31
  newPager.iteration = isForward ? 0 : newPager.nbIterations - 1;
32
+ hasExploredLoop = true;
33
+ };
34
+
35
+ // The page is a loop
36
+ if (page.isLoop && page.subPages && page.subPages.length > 0) {
37
+ goInsideSubpage(page.subPages, state.executeExpression(page.iterations));
38
+ }
39
+
40
+ // The page contains a roundabout, go to the first iteration if it only has one iteration
41
+ if (page.components[0].componentType === 'Roundabout' && page.subPages && page.subPages.length > 0) {
42
+ var nbIterations = state.executeExpression(page.iterations);
43
+ if (nbIterations === 1) {
44
+ goInsideSubpage(page.subPages, 1);
45
+ }
46
+ }
47
+
48
+ // No loop were explored, don't mutate the state
49
+ if (!hasExploredLoop) {
50
+ return state;
32
51
  }
33
52
  return _objectSpread(_objectSpread({}, state), {}, {
34
53
  isInLoop: newPager.nbIterations !== undefined,
@@ -27,17 +27,24 @@ function reduceGoNextPage(state) {
27
27
  if (!pages[pageId]) {
28
28
  throw new Error("Cannot reach next page ".concat(pageId));
29
29
  }
30
-
31
- // If we reached a loop, go inside
32
- var newState = (0, _autoExploreLoop.autoExploreLoop)(_objectSpread(_objectSpread({}, state), {}, {
30
+ var newState = _objectSpread(_objectSpread({}, state), {}, {
33
31
  pager: nextPager
34
- }), 'forward');
32
+ });
35
33
 
36
34
  // We reached an empty page, move forward
37
35
  if ((0, _page.isPageEmpty)(newState)) {
38
36
  return reduceGoNextPage(newState);
39
37
  }
38
+
39
+ // If we reached a loop, go inside
40
+ newState = (0, _autoExploreLoop.autoExploreLoop)(newState, 'forward');
41
+
42
+ // We explored a loop, check if we reached an empty page, move forward
43
+ if (newState.pager !== nextPager && (0, _page.isPageEmpty)(newState)) {
44
+ return reduceGoNextPage(newState);
45
+ }
40
46
  return _objectSpread(_objectSpread({}, newState), {}, {
47
+ isInLoop: newState.pager.iteration !== undefined,
41
48
  pager: _objectSpread(_objectSpread({}, newState.pager), {}, {
42
49
  lastReachedPage: (0, _commons.getNewReachedPage)(newState.pager)
43
50
  })
@@ -24,17 +24,25 @@ function reduceGoPreviousPage(state) {
24
24
  if (!prevPage) {
25
25
  throw new Error("Cannot reach previous page ".concat(pageId));
26
26
  }
27
-
28
- // If we reached a loop, go to the last iteration / sequence
29
- var newState = (0, _autoExploreLoop.autoExploreLoop)(_objectSpread(_objectSpread({}, state), {}, {
27
+ var newState = _objectSpread(_objectSpread({}, state), {}, {
30
28
  pager: prevPager
31
- }), 'backward');
29
+ });
32
30
 
33
31
  // We reached an empty page, keep going backward
34
32
  if ((0, _page.isPageEmpty)(newState)) {
35
33
  return reduceGoPreviousPage(newState);
36
34
  }
37
- return newState;
35
+
36
+ // If we reached a loop, go to the last iteration / sequence
37
+ newState = (0, _autoExploreLoop.autoExploreLoop)(newState, 'backward');
38
+
39
+ // We explored a loop, check if we reached an empty page, move forward
40
+ if (newState.pager !== prevPager && (0, _page.isPageEmpty)(newState)) {
41
+ return reduceGoPreviousPage(newState);
42
+ }
43
+ return _objectSpread(_objectSpread({}, newState), {}, {
44
+ isInLoop: newState.pager.iteration !== undefined
45
+ });
38
46
  }
39
47
  var _default = reduceGoPreviousPage;
40
48
  exports["default"] = _default;
@@ -60,16 +60,17 @@ function reduceGoToPage(state, action) {
60
60
  }
61
61
 
62
62
  // Move forward if the page is empty
63
- if ((0, _page.isPageEmpty)(state)) {
64
- return (0, _reduceGoNextPage["default"])(state, {
63
+ var newState = _objectSpread(_objectSpread({}, state), {}, {
64
+ isInLoop: newPager.nbIterations !== undefined,
65
+ pager: newPager
66
+ });
67
+ if ((0, _page.isPageEmpty)(newState)) {
68
+ return (0, _reduceGoNextPage["default"])(newState, {
65
69
  type: _actions.ActionKind.GO_NEXT_PAGE,
66
70
  payload: {}
67
71
  });
68
72
  }
69
- return _objectSpread(_objectSpread({}, state), {}, {
70
- isInLoop: newPager.nbIterations !== undefined,
71
- pager: newPager
72
- });
73
+ return newState;
73
74
  }
74
75
  var _default = reduceGoToPage;
75
76
  exports["default"] = _default;
@@ -19,9 +19,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
19
19
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
20
20
  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); }
21
21
  function refillValue(size, precSize, value) {
22
- if (precSize > size) {
23
- return new Array(size).fill(null);
24
- }
25
22
  return (0, _commons2.resizeArrayVariable)(value, size, null);
26
23
  }
27
24
  function reduceResizingVariables(_ref) {
@@ -38,11 +38,11 @@ function getInitalValueFromCollected(variable, data) {
38
38
  fromData = COLLECTED !== null && COLLECTED !== void 0 ? COLLECTED : FORCED;
39
39
  }
40
40
  if ('values' in variable && variable.values) {
41
- var _fromData;
41
+ var _ref, _fromData;
42
42
  var _variable$values = variable.values,
43
43
  _COLLECTED = _variable$values.COLLECTED,
44
44
  _FORCED = _variable$values.FORCED;
45
- return (_fromData = fromData) !== null && _fromData !== void 0 ? _fromData : _FORCED !== null && _FORCED !== void 0 ? _FORCED : _COLLECTED;
45
+ return (_ref = (_fromData = fromData) !== null && _fromData !== void 0 ? _fromData : _FORCED) !== null && _ref !== void 0 ? _ref : _COLLECTED;
46
46
  }
47
47
  return undefined;
48
48
  }
@@ -100,10 +100,10 @@ function appendToObjectMap(map, variable, value) {
100
100
  function createVariables(source, data) {
101
101
  var _source$variables = source.variables,
102
102
  variables = _source$variables === void 0 ? [] : _source$variables;
103
- var _variables$reduce = variables.reduce(function (_ref, variable) {
104
- var _ref2 = _slicedToArray(_ref, 2),
105
- mapType = _ref2[0],
106
- mapVar = _ref2[1];
103
+ var _variables$reduce = variables.reduce(function (_ref2, variable) {
104
+ var _ref3 = _slicedToArray(_ref2, 2),
105
+ mapType = _ref3[0],
106
+ mapVar = _ref3[1];
107
107
  var type = variable.variableType;
108
108
  return [appendToArrayMap(mapType, type, variable), appendToObjectMap(mapVar, variable, getInitialValue(variable, data))];
109
109
  }, [{
@@ -179,7 +179,9 @@ function reduceOnInit(state, action) {
179
179
  management = payload.management,
180
180
  shortcut = payload.shortcut,
181
181
  activeControls = payload.activeControls,
182
- goToPage = payload.goToPage;
182
+ goToPage = payload.goToPage,
183
+ goNextPage = payload.goNextPage,
184
+ goPreviousPage = payload.goPreviousPage;
183
185
  if (source && data) {
184
186
  var _initialPager$page;
185
187
  var variables = createVariables(source, data); // map des variables
@@ -225,6 +227,8 @@ function reduceOnInit(state, action) {
225
227
  savingType: savingType,
226
228
  activeControls: activeControls,
227
229
  goToPage: goToPage,
230
+ goNextPage: goNextPage,
231
+ goPreviousPage: goPreviousPage,
228
232
  shortcut: shortcut
229
233
  }), initialPager);
230
234
  }
@@ -177,9 +177,11 @@ function useLunatic(source) {
177
177
  handleChange: handleChange,
178
178
  activeControls: activeControls,
179
179
  goToPage: goToPage,
180
+ goNextPage: goNextPage,
181
+ goPreviousPage: goPreviousPage,
180
182
  withOverview: withOverview
181
183
  }));
182
- }, [source, data, initialPage, features, preferences, savingType, management, shortcut, handleChange, activeControls, withOverview, goToPage, lastReachedPage]);
184
+ }, [source, data, initialPage, features, preferences, savingType, management, shortcut, handleChange, activeControls, withOverview, goToPage, goNextPage, goPreviousPage, lastReachedPage]);
183
185
  (0, _react.useEffect)(function () {
184
186
  dispatch(actions.updateState({
185
187
  getSuggesterStatus: getSuggesterStatus
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inseefr/lunatic",
3
- "version": "2.5.1-suggesterCustomisationStyle",
3
+ "version": "2.5.2-beta",
4
4
  "workersVersion": "0.2.5-experimental",
5
5
  "description": "Library of questionnaire components",
6
6
  "repository": {