@inseefr/lunatic 2.4.10 → 2.5.0-fast-forward

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 (103) hide show
  1. package/lib/components/commons/components/orchestrated-component.js +10 -30
  2. package/lib/components/commons/create-row-orchestrator.js +7 -2
  3. package/lib/components/component-set/html/component-set-components.js +16 -25
  4. package/lib/components/component-set/lunatic-component-set.js +23 -37
  5. package/lib/components/index.js +14 -0
  6. package/lib/components/loop/block-for-loop/block-for-loop.js +4 -2
  7. package/lib/components/loop/block-for-loop/row.js +4 -2
  8. package/lib/components/loop/loop.js +6 -3
  9. package/lib/components/loop/roster-for-loop/body.js +4 -2
  10. package/lib/components/loop/roster-for-loop/roster-for-loop.js +2 -0
  11. package/lib/components/loop/roster-for-loop/roster-table.js +4 -2
  12. package/lib/components/loop/roster-for-loop/row.js +3 -1
  13. package/lib/components/question-explication/html/question-explication.js +53 -0
  14. package/lib/components/question-explication/html/question-explication.scss +35 -0
  15. package/lib/components/question-explication/index.js +13 -0
  16. package/lib/components/question-explication/lunatic-question-explication.js +32 -0
  17. package/lib/components/question-explication/question-explication.spec.js +49 -0
  18. package/lib/components/roundabout/lunatic-roundabout.js +2 -4
  19. package/lib/components/subsequence/subsequence.js +0 -2
  20. package/lib/components/subsequence/subsequence.spec.js +2 -2
  21. package/lib/components/summary/html/summary-container.js +14 -0
  22. package/lib/components/summary/html/summary-responses.js +53 -0
  23. package/lib/components/summary/html/summary-title.js +20 -0
  24. package/lib/components/summary/index.js +12 -0
  25. package/lib/components/summary/lunatic-summary.js +99 -0
  26. package/lib/src/components/commons/components/orchestrated-component.d.ts +4 -5
  27. package/lib/src/components/commons/create-row-orchestrator.d.ts +3 -2
  28. package/lib/src/components/component-set/html/component-set-components.d.ts +2 -2
  29. package/lib/src/components/component-set/lunatic-component-set.d.ts +2 -1
  30. package/lib/src/components/index.d.ts +2 -0
  31. package/lib/src/components/loop/block-for-loop/block-for-loop-ochestrator.d.ts +3 -2
  32. package/lib/src/components/loop/block-for-loop/row.d.ts +2 -1
  33. package/lib/src/components/loop/roster-for-loop/body.d.ts +2 -2
  34. package/lib/src/components/loop/roster-for-loop/roster-for-loop-orchestrator.d.ts +3 -2
  35. package/lib/src/components/loop/roster-for-loop/roster-table.d.ts +2 -2
  36. package/lib/src/components/loop/roster-for-loop/row.d.ts +2 -1
  37. package/lib/src/components/question-explication/html/question-explication.d.ts +7 -0
  38. package/lib/src/components/question-explication/index.d.ts +1 -0
  39. package/lib/src/components/question-explication/lunatic-question-explication.d.ts +3 -0
  40. package/lib/src/components/question-explication/question-explication.spec.d.ts +1 -0
  41. package/lib/src/components/subsequence/subsequence.d.ts +2 -2
  42. package/lib/src/components/summary/html/summary-container.d.ts +2 -0
  43. package/lib/src/components/summary/html/summary-responses.d.ts +12 -0
  44. package/lib/src/components/summary/html/summary-title.d.ts +5 -0
  45. package/lib/src/components/summary/index.d.ts +1 -0
  46. package/lib/src/components/summary/lunatic-summary.d.ts +7 -0
  47. package/lib/src/components/type.d.ts +18 -0
  48. package/lib/src/index.d.ts +1 -0
  49. package/lib/src/use-lunatic/actions.d.ts +8 -169
  50. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +137 -112
  51. package/lib/src/use-lunatic/commons/fill-components/fill-missing-response.d.ts +2 -1
  52. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +115 -94
  53. package/lib/src/use-lunatic/commons/page-navigation.d.ts +7 -0
  54. package/lib/src/use-lunatic/commons/page-navigation.spec.d.ts +1 -0
  55. package/lib/src/use-lunatic/commons/page.d.ts +11 -0
  56. package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
  57. package/lib/src/use-lunatic/reducer/commons/auto-explore-loop.d.ts +5 -0
  58. package/lib/src/use-lunatic/reducer/commons/index.d.ts +0 -1
  59. package/lib/src/use-lunatic/reducer/commons/is-loop-component.d.ts +2 -2
  60. package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +1 -7
  61. package/lib/src/use-lunatic/reducer/reduce-on-init.d.ts +1 -1
  62. package/lib/src/use-lunatic/replace-component-sequence.d.ts +3 -3
  63. package/lib/src/use-lunatic/type-source.d.ts +27 -13
  64. package/lib/src/use-lunatic/type.d.ts +4 -12
  65. package/lib/src/use-lunatic/use-lunatic.d.ts +475 -10
  66. package/lib/src/utils/store-tools/worker-path.d.ts +1 -0
  67. package/lib/stories/component-set/component-set.stories.js +2 -1
  68. package/lib/stories/loop/block-for-loop.stories.js +8 -1
  69. package/lib/stories/loop/roster-for-loop.stories.js +92 -2
  70. package/lib/{use-lunatic/reducer/reduce-roundabout.js → stories/question-explication/question-explication.stories.js} +21 -17
  71. package/lib/stories/question-explication/source.json +17 -0
  72. package/lib/stories/roundabout/roundabout.stories.js +2 -1
  73. package/lib/stories/suggester/source-component-set.json +67 -0
  74. package/lib/stories/suggester/suggester.stories.js +9 -1
  75. package/lib/stories/summary/data.json +32 -0
  76. package/lib/stories/summary/source.json +353 -0
  77. package/lib/stories/summary/summary.stories.js +37 -0
  78. package/lib/stories/utils/orchestrator.js +21 -6
  79. package/lib/use-lunatic/commons/check-pager.js +1 -2
  80. package/lib/use-lunatic/commons/fill-components/fill-missing-response.js +14 -12
  81. package/lib/use-lunatic/commons/page-navigation.js +109 -0
  82. package/lib/use-lunatic/commons/page-navigation.spec.js +129 -0
  83. package/lib/use-lunatic/commons/page.js +44 -0
  84. package/lib/use-lunatic/reducer/commons/auto-explore-loop.js +37 -0
  85. package/lib/use-lunatic/reducer/commons/index.js +0 -8
  86. package/lib/use-lunatic/reducer/reduce-go-next-page.js +25 -159
  87. package/lib/use-lunatic/reducer/reduce-go-previous-page.js +21 -127
  88. package/lib/use-lunatic/reducer/reduce-go-to-page.js +51 -55
  89. package/lib/use-lunatic/reducer/reduce-on-init.js +8 -10
  90. package/lib/use-lunatic/reducer/resolve-component-controls/resolve-roundabout-control.js +1 -1
  91. package/lib/use-lunatic/reducer/resolve-component-controls/resolve-simple-control.js +1 -1
  92. package/lib/use-lunatic/type-source.js +0 -2
  93. package/lib/use-lunatic/use-lunatic.js +22 -4
  94. package/lib/use-lunatic/use-lunatic.test.js +9 -7
  95. package/lib/utils/store-tools/auto-load.js +2 -2
  96. package/lib/utils/store-tools/worker-path.js +13 -0
  97. package/lib/utils/suggester-workers/append-to-index/create-append-task.js +2 -2
  98. package/package.json +3 -4
  99. package/lib/components/button/__snapshots__/lunatic-button.spec.jsx.snap +0 -80
  100. package/lib/components/commons/components/combo-box/selection/__snapshots__/selection.spec.jsx.snap +0 -81
  101. package/lib/src/use-lunatic/reducer/commons/is-empty-on-empty-page.d.ts +0 -3
  102. package/lib/src/use-lunatic/reducer/reduce-roundabout.d.ts +0 -2
  103. package/lib/use-lunatic/reducer/commons/is-empty-on-empty-page.js +0 -32
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var _commons = require("../../commons");
8
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
9
- 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."); }
10
- 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); }
11
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
12
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
13
- 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; }
14
- function isOnEmptyPage(state) {
15
- var executeExpression = state.executeExpression,
16
- pager = state.pager;
17
- var iteration = pager.iteration;
18
- var components = (0, _commons.getComponentsFromState)(state);
19
- var rest = components.reduce(function (rest, component) {
20
- var conditionFilter = component.conditionFilter;
21
- if (conditionFilter) {
22
- var result = (0, _commons.executeConditionFilter)(conditionFilter, executeExpression, iteration);
23
- if (result === true) {
24
- return [].concat(_toConsumableArray(rest), [component]);
25
- }
26
- }
27
- return rest;
28
- }, []);
29
- return !rest.length;
30
- }
31
- var _default = isOnEmptyPage;
32
- exports["default"] = _default;