@inseefr/lunatic 2.5.1-testRoundaboutFix → 2.5.2-rc1-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 (67) hide show
  1. package/lib/components/commons/components/combo-box/combo-box-container.js +16 -7
  2. package/lib/components/commons/components/combo-box/combo-box-container.spec.js +5 -5
  3. package/lib/components/commons/components/combo-box/combo-box-content-box.js +25 -0
  4. package/lib/components/commons/components/combo-box/combo-box-content.js +11 -11
  5. package/lib/components/commons/components/combo-box/combo-box.js +26 -11
  6. package/lib/components/commons/components/combo-box/panel/panel-container.js +5 -2
  7. package/lib/components/commons/components/combo-box/panel/panel-container.spec.js +7 -6
  8. package/lib/components/commons/components/combo-box/panel/panel.js +2 -2
  9. package/lib/components/commons/components/combo-box/selection/selection-container.js +3 -2
  10. package/lib/components/commons/components/combo-box/selection/selection.js +3 -1
  11. package/lib/components/component-set/html/component-set-components.js +5 -23
  12. package/lib/components/dropdown/lunatic-dropdown.js +3 -1
  13. package/lib/components/index.js +7 -0
  14. package/lib/components/loop/block-for-loop/row.js +6 -16
  15. package/lib/components/modal/html/modal.js +88 -0
  16. package/lib/components/modal/html/modal.scss +43 -0
  17. package/lib/components/modal/index.js +13 -0
  18. package/lib/components/modal/lunatic-modal.js +38 -0
  19. package/lib/components/pairwise-links/orchestrator.js +2 -0
  20. package/lib/components/pairwise-links/pairwise-links.js +1 -1
  21. package/lib/components/pairwise-links/row.js +2 -0
  22. package/lib/components/suggester/html/suggester.js +10 -6
  23. package/lib/components/suggester/lunatic-suggester.js +3 -1
  24. package/lib/src/components/commons/components/combo-box/combo-box-container.d.ts +5 -2
  25. package/lib/src/components/commons/components/combo-box/combo-box-content-box.d.ts +8 -0
  26. package/lib/src/components/commons/components/combo-box/combo-box-content.d.ts +2 -1
  27. package/lib/src/components/commons/components/combo-box/combo-box.d.ts +1 -0
  28. package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +2 -0
  29. package/lib/src/components/commons/components/combo-box/panel/panel-container.d.ts +2 -2
  30. package/lib/src/components/commons/components/combo-box/selection/selection-container.d.ts +2 -1
  31. package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +2 -1
  32. package/lib/src/components/component-set/html/component-set-components.d.ts +1 -1
  33. package/lib/src/components/dropdown/lunatic-dropdown.d.ts +1 -1
  34. package/lib/src/components/index.d.ts +1 -0
  35. package/lib/src/components/modal/html/modal.d.ts +14 -0
  36. package/lib/src/components/modal/index.d.ts +1 -0
  37. package/lib/src/components/modal/lunatic-modal.d.ts +3 -0
  38. package/lib/src/components/pairwise-links/row.d.ts +1 -1
  39. package/lib/src/components/suggester/html/suggester.d.ts +1 -0
  40. package/lib/src/components/suggester/lunatic-suggester.d.ts +1 -1
  41. package/lib/src/components/type.d.ts +8 -0
  42. package/lib/src/use-lunatic/actions.d.ts +4 -0
  43. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +40 -0
  44. package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +2 -0
  45. package/lib/src/use-lunatic/type.d.ts +2 -0
  46. package/lib/src/use-lunatic/use-lunatic.d.ts +22 -0
  47. package/lib/src/utils/get-component-value.d.ts +5 -0
  48. package/lib/stories/checkboxGroup/checkboxGroup.stories.js +17 -1
  49. package/lib/stories/checkboxGroup/sourceComponentset.json +424 -0
  50. package/lib/stories/checkboxGroup/sourceLoop.json +83 -0
  51. package/lib/stories/modal/modal.stories.js +34 -0
  52. package/lib/stories/modal/source.json +97 -0
  53. package/lib/stories/questionnaires/simpsons/simpsons.stories.js +33 -36
  54. package/lib/stories/suggester/simple.json +15 -0
  55. package/lib/use-lunatic/commons/fill-components/fill-from-state.js +6 -2
  56. package/lib/use-lunatic/commons/page-navigation.js +2 -2
  57. package/lib/use-lunatic/commons/page.js +0 -6
  58. package/lib/use-lunatic/initial-state.js +2 -0
  59. package/lib/use-lunatic/reducer/commons/auto-explore-loop.js +9 -3
  60. package/lib/use-lunatic/reducer/reduce-go-next-page.js +11 -4
  61. package/lib/use-lunatic/reducer/reduce-go-previous-page.js +13 -5
  62. package/lib/use-lunatic/reducer/reduce-go-to-page.js +7 -6
  63. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +0 -3
  64. package/lib/use-lunatic/reducer/reduce-on-init.js +11 -7
  65. package/lib/use-lunatic/use-lunatic.js +3 -1
  66. package/lib/utils/get-component-value.js +38 -0
  67. package/package.json +1 -1
@@ -0,0 +1,43 @@
1
+ .lunatic-modal {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ background-color: rgba(50, 50, 50, 0.5);
8
+ z-index: 101;
9
+
10
+ .modal-content {
11
+ background-color: snow;
12
+ height: fit-content;
13
+ width: 50%;
14
+ margin: auto;
15
+ padding: 0.5rem;
16
+ margin-top: 38vh;
17
+ display: flex;
18
+ flex-direction: column;
19
+ border-radius: 8px;
20
+ overflow-wrap: break-word;
21
+ .lunatic-modal-container {
22
+ .close-button {
23
+ color: blue;
24
+ display: flex;
25
+ justify-content: right;
26
+ }
27
+ }
28
+ .body {
29
+ color: black;
30
+ font-size: 16px;
31
+ font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
32
+ }
33
+
34
+ .modal-buttons {
35
+ align-self: end;
36
+ margin: 0 0.2em 0.2em 0;
37
+ :first-child {
38
+ margin-right: 0.5em;
39
+ }
40
+ }
41
+ }
42
+ }
43
+
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _lunaticModal["default"];
10
+ }
11
+ });
12
+ var _lunaticModal = _interopRequireDefault(require("./lunatic-modal"));
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _modal = _interopRequireDefault(require("./html/modal"));
8
+ var _lunaticComponentWithoutLabel = _interopRequireDefault(require("../commons/components/lunatic-component-without-label"));
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+ function empty() {}
12
+ function LunaticModal(props) {
13
+ var id = props.id,
14
+ label = props.label,
15
+ description = props.description,
16
+ goToPage = props.goToPage,
17
+ page = props.page,
18
+ goNextPage = props.goNextPage,
19
+ goPreviousPage = props.goPreviousPage;
20
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_lunaticComponentWithoutLabel["default"], {
21
+ id: id,
22
+ label: label,
23
+ handleChange: empty,
24
+ value: undefined,
25
+ description: description,
26
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_modal["default"], {
27
+ id: id,
28
+ label: label,
29
+ page: page,
30
+ description: description,
31
+ goToPage: goToPage,
32
+ goNextPage: goNextPage,
33
+ goPreviousPage: goPreviousPage
34
+ })
35
+ });
36
+ }
37
+ var _default = LunaticModal;
38
+ exports["default"] = _default;
@@ -25,6 +25,7 @@ function LinksOrchestrator(props) {
25
25
  handleChange = props.handleChange,
26
26
  features = props.features,
27
27
  missing = props.missing,
28
+ className = props.className,
28
29
  shortcut = props.shortcut,
29
30
  preferences = props.preferences,
30
31
  executeExpression = props.executeExpression,
@@ -60,6 +61,7 @@ function LinksOrchestrator(props) {
60
61
  /** */,
61
62
  features: features,
62
63
  shortcut: shortcut,
64
+ className: className,
63
65
  preferences: preferences,
64
66
  missing: missing,
65
67
  errors: errors,
@@ -4,7 +4,6 @@ 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 _orchestrator = _interopRequireDefault(require("./orchestrator"));
9
8
  var _declarations = require("../declarations");
10
9
  var _nothingToDisplay = _interopRequireDefault(require("../commons/components/nothing-to-display"));
@@ -42,6 +41,7 @@ var PairwiseLinks = function PairwiseLinks(_ref) {
42
41
  handleChange: handleChange,
43
42
  nbRows: nbRows,
44
43
  value: value,
44
+ className: "pairwise-link",
45
45
  management: management,
46
46
  missing: missing,
47
47
  shortcut: shortcut,
@@ -26,6 +26,7 @@ function Row(_ref) {
26
26
  missing = _ref.missing,
27
27
  shortcut = _ref.shortcut,
28
28
  management = _ref.management,
29
+ className = _ref.className,
29
30
  preferences = _ref.preferences,
30
31
  executeExpression = _ref.executeExpression,
31
32
  linksIterations = _ref.linksIterations,
@@ -61,6 +62,7 @@ function Row(_ref) {
61
62
  features: features,
62
63
  missing: missing,
63
64
  shortcut: shortcut,
65
+ className: className,
64
66
  management: management,
65
67
  value: value,
66
68
  id: idComponent,
@@ -24,8 +24,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
24
24
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
25
25
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
26
  function Suggester(_ref) {
27
- var _ref$className = _ref.className,
28
- className = _ref$className === void 0 ? 'lunatic-suggester-default-style' : _ref$className,
27
+ var className = _ref.className,
28
+ _ref$classNamePrefix = _ref.classNamePrefix,
29
+ classNamePrefix = _ref$classNamePrefix === void 0 ? 'lunatic' : _ref$classNamePrefix,
29
30
  _ref$placeholder = _ref.placeholder,
30
31
  placeholder = _ref$placeholder === void 0 ? _i18n["default"].PLACEHOLDER : _ref$placeholder,
31
32
  _ref$onSelect = _ref.onSelect,
@@ -57,7 +58,7 @@ function Suggester(_ref) {
57
58
  while (1) switch (_context.prev = _context.next) {
58
59
  case 0:
59
60
  if (!(search && typeof searching === 'function')) {
60
- _context.next = 9;
61
+ _context.next = 10;
61
62
  break;
62
63
  }
63
64
  _context.next = 3;
@@ -67,13 +68,15 @@ function Suggester(_ref) {
67
68
  results = _yield$searching.results;
68
69
  setOptions(results);
69
70
  setSearch(search);
70
- _context.next = 12;
71
+ // if a user does not select an option in the list, their search term is saved
72
+ onSelect(search);
73
+ _context.next = 13;
71
74
  break;
72
- case 9:
75
+ case 10:
73
76
  setOptions([]);
74
77
  onSelect(null);
75
78
  setSearch('');
76
- case 12:
79
+ case 13:
77
80
  case "end":
78
81
  return _context.stop();
79
82
  }
@@ -87,6 +90,7 @@ function Suggester(_ref) {
87
90
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_commons.ComboBox, {
88
91
  id: id,
89
92
  className: className,
93
+ classNamePrefix: classNamePrefix,
90
94
  onChange: handleChange,
91
95
  disabled: disabled,
92
96
  options: options,
@@ -28,6 +28,7 @@ function LunaticSuggester(_ref) {
28
28
  missingResponse = _ref.missingResponse,
29
29
  management = _ref.management,
30
30
  response = _ref.response,
31
+ className = _ref.className,
31
32
  getSuggesterStatus = _ref.getSuggesterStatus;
32
33
  var onChange = (0, _useOnHandleChange["default"])({
33
34
  handleChange: handleChange,
@@ -55,7 +56,8 @@ function LunaticSuggester(_ref) {
55
56
  value: value,
56
57
  errors: errors,
57
58
  label: label,
58
- getSuggesterStatus: getSuggesterStatus
59
+ getSuggesterStatus: getSuggesterStatus,
60
+ className: className
59
61
  })
60
62
  });
61
63
  }
@@ -1,8 +1,11 @@
1
1
  import type { PropsWithChildren } from 'react';
2
+ import { LunaticBaseProps } from '../../../type';
2
3
  type Props = PropsWithChildren<{
4
+ classNamePrefix?: string;
3
5
  className?: string;
4
6
  id?: string;
5
7
  classStyle?: string;
8
+ errors?: LunaticBaseProps['errors'];
6
9
  }>;
7
- export declare function ComboBoxContainer({ children, className, id, classStyle, }: Props): import("react/jsx-runtime").JSX.Element;
8
- export {};
10
+ declare const _default: import("react").ComponentType<Props>;
11
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ type Props = PropsWithChildren<{
3
+ focused?: boolean;
4
+ classNamePrefix?: string;
5
+ }>;
6
+ export declare function ComboBoxContentBox({ children, classNamePrefix, focused, }: Props): import("react/jsx-runtime").JSX.Element;
7
+ declare const _default: React.ComponentType<Props>;
8
+ export default _default;
@@ -4,6 +4,7 @@ type Props = PropsWithChildren<{
4
4
  onBlur: () => void;
5
5
  onFocus: () => void;
6
6
  onKeyDown: (key: string) => void;
7
+ classNamePrefix?: string;
7
8
  }>;
8
- export declare function ComboBoxContent({ children, focused, onFocus, onBlur, onKeyDown, }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export declare function ComboBoxContent({ children, focused, onFocus, onBlur, onKeyDown, classNamePrefix, }: Props): import("react/jsx-runtime").JSX.Element;
9
10
  export default ComboBoxContent;
@@ -6,6 +6,7 @@ import { PanelProps } from './panel/panel';
6
6
  import { LunaticBaseProps } from '../../../type';
7
7
  type Props = SelectionProps & PanelProps & {
8
8
  className?: string;
9
+ classNamePrefix?: string;
9
10
  classStyle?: string;
10
11
  value: string | null;
11
12
  messageError?: string;
@@ -10,8 +10,10 @@ export declare const Default: Story<{
10
10
  editable?: boolean | undefined;
11
11
  labelId?: string | undefined;
12
12
  id?: string | undefined;
13
+ classNamePrefix?: string | undefined;
13
14
  } & import("./selection/label-selection").LabelSelectionProps & import("./panel/panel").PanelProps & {
14
15
  className?: string | undefined;
16
+ classNamePrefix?: string | undefined;
15
17
  classStyle?: string | undefined;
16
18
  value: string | null;
17
19
  messageError?: string | undefined;
@@ -4,5 +4,5 @@ type Props = PropsWithChildren<{
4
4
  expanded?: boolean;
5
5
  id?: string;
6
6
  }>;
7
- export declare function PanelContainer({ children, focused, expanded, id }: Props): import("react/jsx-runtime").JSX.Element;
8
- export {};
7
+ declare const _default: import("react").ComponentType<Props>;
8
+ export default _default;
@@ -5,6 +5,7 @@ type Props = PropsWithChildren<{
5
5
  disabled?: boolean;
6
6
  labelId?: string;
7
7
  id?: string;
8
+ classNamePrefix?: string;
8
9
  }>;
9
- declare function SelectionContainer({ children, id, expanded, focused, disabled, labelId, }: Props): import("react/jsx-runtime").JSX.Element;
10
+ declare function SelectionContainer({ children, id, expanded, focused, disabled, labelId, classNamePrefix, }: Props): import("react/jsx-runtime").JSX.Element;
10
11
  export default SelectionContainer;
@@ -6,5 +6,6 @@ export type SelectionProps = {
6
6
  editable?: boolean;
7
7
  labelId?: string;
8
8
  id?: string;
9
+ classNamePrefix?: string;
9
10
  } & LabelSelectionProps;
10
- export declare function Selection({ labelRenderer, placeholder, search, expanded, disabled, focused, onChange, selectedIndex, options, editable, labelId, id, }: SelectionProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Selection({ labelRenderer, placeholder, search, expanded, disabled, focused, onChange, selectedIndex, options, editable, labelId, id, classNamePrefix, }: SelectionProps): import("react/jsx-runtime").JSX.Element;
@@ -3,5 +3,5 @@ type Props = {
3
3
  className?: string;
4
4
  componentClassName?: string;
5
5
  } & Omit<LunaticComponentProps<'ComponentSet'>, 'id' | 'response'>;
6
- declare function ComponentSetComponents({ components, componentClassName, className, value, ...props }: Props): import("react/jsx-runtime").JSX.Element | null;
6
+ declare function ComponentSetComponents({ components, componentClassName, className, value: valueMap, ...props }: Props): import("react/jsx-runtime").JSX.Element | null;
7
7
  export default ComponentSetComponents;
@@ -1,3 +1,3 @@
1
1
  import { LunaticComponentProps } from '../type';
2
- declare function LunaticDropdown({ id, handleChange, options, writable, disabled, value, response, errors, label, preferences, declarations, missing, missingResponse, management, description, }: LunaticComponentProps<'Dropdown'>): import("react/jsx-runtime").JSX.Element;
2
+ declare function LunaticDropdown({ id, handleChange, options, writable, disabled, className, value, response, errors, label, preferences, declarations, missing, missingResponse, management, description, }: LunaticComponentProps<'Dropdown'>): import("react/jsx-runtime").JSX.Element;
3
3
  export default LunaticDropdown;
@@ -27,3 +27,4 @@ export { Summary } from './summary';
27
27
  export { default as QuestionInformation } from './questions/question-information';
28
28
  export { default as QuestionContext } from './questions/question-context';
29
29
  export { default as QuestionExplication } from './question-explication';
30
+ export { default as ConfirmationModal } from './modal';
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import './modal.scss';
3
+ declare const _default: import("react").ComponentType<Pick<import("../../type").LunaticBaseProps<string | null> & {
4
+ goToPage: (page: {
5
+ page: string;
6
+ iteration?: number | undefined;
7
+ nbIterations?: number | undefined;
8
+ subPage?: number | undefined;
9
+ }) => void;
10
+ page: string;
11
+ goNextPage: () => void;
12
+ goPreviousPage: () => void;
13
+ }, "label" | "id" | "description" | "goToPage" | "page" | "goNextPage" | "goPreviousPage">>;
14
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default } from './lunatic-modal';
@@ -0,0 +1,3 @@
1
+ import { LunaticComponentProps } from '../type';
2
+ declare function LunaticModal(props: LunaticComponentProps<'Modal'>): import("react/jsx-runtime").JSX.Element;
3
+ export default LunaticModal;
@@ -3,5 +3,5 @@ type Props = {
3
3
  linksIterations: [number, number];
4
4
  lengths: number[];
5
5
  } & Omit<LunaticComponentProps<'PairwiseLinks'>, 'declarations' | 'xAxisIterations' | 'yAxisIterations'>;
6
- declare function Row({ components, value: valueMap, handleChange, features, missing, shortcut, management, preferences, executeExpression, linksIterations, symLinks, lengths, }: Props): import("react/jsx-runtime").JSX.Element | null;
6
+ declare function Row({ components, value: valueMap, handleChange, features, missing, shortcut, management, className, preferences, executeExpression, linksIterations, symLinks, lengths, }: Props): import("react/jsx-runtime").JSX.Element | null;
7
7
  export default Row;
@@ -5,6 +5,7 @@ import { ComboBoxOptionType } from '../../commons/components/combo-box/combo-box
5
5
  import { LunaticComponentProps } from '../../type';
6
6
  type Props = {
7
7
  className?: string;
8
+ classNamePrefix?: string;
8
9
  placeholder?: string;
9
10
  onSelect?: (s: string | null) => void;
10
11
  value: string | null;
@@ -1,3 +1,3 @@
1
1
  import { LunaticComponentProps } from '../type';
2
- declare function LunaticSuggester({ id, storeName, optionRenderer, labelRenderer, idbVersion, focused, value, handleChange, disabled, errors, label, description, preferences, declarations, missing, missingResponse, management, response, getSuggesterStatus, }: LunaticComponentProps<'Suggester'>): import("react/jsx-runtime").JSX.Element;
2
+ declare function LunaticSuggester({ id, storeName, optionRenderer, labelRenderer, idbVersion, focused, value, handleChange, disabled, errors, label, description, preferences, declarations, missing, missingResponse, management, response, className, getSuggesterStatus, }: LunaticComponentProps<'Suggester'>): import("react/jsx-runtime").JSX.Element;
3
3
  export default LunaticSuggester;
@@ -41,6 +41,8 @@ export type LunaticBaseProps<ValueType = unknown> = {
41
41
  executeExpression: LunaticState['executeExpression'];
42
42
  features?: string[];
43
43
  componentType?: string;
44
+ goNextPage?: () => void;
45
+ goPreviousPage?: () => void;
44
46
  };
45
47
  export type SuggesterOption = {
46
48
  children?: string[];
@@ -264,6 +266,12 @@ type ComponentPropsByType = {
264
266
  iterations?: number;
265
267
  }>;
266
268
  };
269
+ Modal: LunaticBaseProps<string | null> & {
270
+ goToPage: ReturnType<typeof useLunatic>['goToPage'];
271
+ page: string;
272
+ goNextPage: () => void;
273
+ goPreviousPage: () => void;
274
+ };
267
275
  };
268
276
  export type LunaticComponentType = keyof ComponentPropsByType;
269
277
  export type LunaticComponentProps<T extends LunaticComponentType = LunaticComponentType> = ComponentPropsByType[T];
@@ -50,6 +50,8 @@ export type ActionInit = {
50
50
  handleChange: LunaticState['handleChange'];
51
51
  activeControls: boolean;
52
52
  goToPage: (params: ActionGoToPage['payload']) => void;
53
+ goNextPage: () => void;
54
+ goPreviousPage: () => void;
53
55
  withOverview: boolean;
54
56
  };
55
57
  };
@@ -112,6 +114,8 @@ export declare const onInit: (payload: {
112
114
  handleChange: LunaticState['handleChange'];
113
115
  activeControls: boolean;
114
116
  goToPage: (params: ActionGoToPage['payload']) => void;
117
+ goNextPage: () => void;
118
+ goPreviousPage: () => void;
115
119
  withOverview: boolean;
116
120
  }) => ActionInit & {
117
121
  type: ActionKind.ON_INIT;
@@ -5,6 +5,8 @@ export type FilledProps = {
5
5
  preferences: LunaticState['preferences'];
6
6
  goToPage: LunaticState['goToPage'];
7
7
  shortcut: LunaticState['shortcut'];
8
+ goNextPage: LunaticState['goNextPage'];
9
+ goPreviousPage: LunaticState['goPreviousPage'];
8
10
  };
9
11
  declare function fillFromState(component: LunaticComponentDefinition, state: LunaticState): {
10
12
  handleChange: (response: {
@@ -28,6 +30,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
28
30
  status: import("../../use-suggesters").SuggesterStatus;
29
31
  timestamp: number;
30
32
  };
33
+ goNextPage: () => void;
34
+ goPreviousPage: () => void;
31
35
  label: import("../../type-source").LabelType;
32
36
  declarations?: import("../../type-source").DeclarationType[] | undefined;
33
37
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -60,6 +64,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
60
64
  status: import("../../use-suggesters").SuggesterStatus;
61
65
  timestamp: number;
62
66
  };
67
+ goNextPage: () => void;
68
+ goPreviousPage: () => void;
63
69
  label: import("../../type-source").LabelType;
64
70
  declarations?: import("../../type-source").DeclarationType[] | undefined;
65
71
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -93,6 +99,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
93
99
  status: import("../../use-suggesters").SuggesterStatus;
94
100
  timestamp: number;
95
101
  };
102
+ goNextPage: () => void;
103
+ goPreviousPage: () => void;
96
104
  label: import("../../type-source").LabelType;
97
105
  declarations?: import("../../type-source").DeclarationType[] | undefined;
98
106
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -162,6 +170,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
162
170
  status: import("../../use-suggesters").SuggesterStatus;
163
171
  timestamp: number;
164
172
  };
173
+ goNextPage: () => void;
174
+ goPreviousPage: () => void;
165
175
  label: import("../../type-source").LabelType;
166
176
  declarations?: import("../../type-source").DeclarationType[] | undefined;
167
177
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -204,6 +214,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
204
214
  status: import("../../use-suggesters").SuggesterStatus;
205
215
  timestamp: number;
206
216
  };
217
+ goNextPage: () => void;
218
+ goPreviousPage: () => void;
207
219
  label: import("../../type-source").LabelType;
208
220
  declarations?: import("../../type-source").DeclarationType[] | undefined;
209
221
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -272,6 +284,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
272
284
  status: import("../../use-suggesters").SuggesterStatus;
273
285
  timestamp: number;
274
286
  };
287
+ goNextPage: () => void;
288
+ goPreviousPage: () => void;
275
289
  label: import("../../type-source").LabelType;
276
290
  declarations?: import("../../type-source").DeclarationType[] | undefined;
277
291
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -309,6 +323,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
309
323
  status: import("../../use-suggesters").SuggesterStatus;
310
324
  timestamp: number;
311
325
  };
326
+ goNextPage: () => void;
327
+ goPreviousPage: () => void;
312
328
  label: import("../../type-source").LabelType;
313
329
  declarations?: import("../../type-source").DeclarationType[] | undefined;
314
330
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -345,6 +361,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
345
361
  status: import("../../use-suggesters").SuggesterStatus;
346
362
  timestamp: number;
347
363
  };
364
+ goNextPage: () => void;
365
+ goPreviousPage: () => void;
348
366
  label: import("../../type-source").LabelType;
349
367
  declarations?: import("../../type-source").DeclarationType[] | undefined;
350
368
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -382,6 +400,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
382
400
  status: import("../../use-suggesters").SuggesterStatus;
383
401
  timestamp: number;
384
402
  };
403
+ goNextPage: () => void;
404
+ goPreviousPage: () => void;
385
405
  label: import("../../type-source").LabelType;
386
406
  declarations?: import("../../type-source").DeclarationType[] | undefined;
387
407
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -416,6 +436,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
416
436
  status: import("../../use-suggesters").SuggesterStatus;
417
437
  timestamp: number;
418
438
  };
439
+ goNextPage: () => void;
440
+ goPreviousPage: () => void;
419
441
  label: import("../../type-source").LabelType;
420
442
  declarations?: import("../../type-source").DeclarationType[] | undefined;
421
443
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -454,6 +476,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
454
476
  status: import("../../use-suggesters").SuggesterStatus;
455
477
  timestamp: number;
456
478
  };
479
+ goNextPage: () => void;
480
+ goPreviousPage: () => void;
457
481
  label: import("../../type-source").LabelType;
458
482
  declarations?: import("../../type-source").DeclarationType[] | undefined;
459
483
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -487,6 +511,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
487
511
  status: import("../../use-suggesters").SuggesterStatus;
488
512
  timestamp: number;
489
513
  };
514
+ goNextPage: () => void;
515
+ goPreviousPage: () => void;
490
516
  label: import("../../type-source").LabelType;
491
517
  declarations?: import("../../type-source").DeclarationType[] | undefined;
492
518
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -525,6 +551,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
525
551
  status: import("../../use-suggesters").SuggesterStatus;
526
552
  timestamp: number;
527
553
  };
554
+ goNextPage: () => void;
555
+ goPreviousPage: () => void;
528
556
  label: import("../../type-source").LabelType;
529
557
  declarations?: import("../../type-source").DeclarationType[] | undefined;
530
558
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -562,6 +590,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
562
590
  status: import("../../use-suggesters").SuggesterStatus;
563
591
  timestamp: number;
564
592
  };
593
+ goNextPage: () => void;
594
+ goPreviousPage: () => void;
565
595
  label: import("../../type-source").LabelType;
566
596
  declarations?: import("../../type-source").DeclarationType[] | undefined;
567
597
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -598,6 +628,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
598
628
  status: import("../../use-suggesters").SuggesterStatus;
599
629
  timestamp: number;
600
630
  };
631
+ goNextPage: () => void;
632
+ goPreviousPage: () => void;
601
633
  label: import("../../type-source").LabelType;
602
634
  declarations?: import("../../type-source").DeclarationType[] | undefined;
603
635
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -631,6 +663,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
631
663
  status: import("../../use-suggesters").SuggesterStatus;
632
664
  timestamp: number;
633
665
  };
666
+ goNextPage: () => void;
667
+ goPreviousPage: () => void;
634
668
  label: import("../../type-source").LabelType;
635
669
  declarations?: import("../../type-source").DeclarationType[] | undefined;
636
670
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -666,6 +700,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
666
700
  status: import("../../use-suggesters").SuggesterStatus;
667
701
  timestamp: number;
668
702
  };
703
+ goNextPage: () => void;
704
+ goPreviousPage: () => void;
669
705
  label: import("../../type-source").LabelType;
670
706
  declarations?: import("../../type-source").DeclarationType[] | undefined;
671
707
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -698,6 +734,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
698
734
  status: import("../../use-suggesters").SuggesterStatus;
699
735
  timestamp: number;
700
736
  };
737
+ goNextPage: () => void;
738
+ goPreviousPage: () => void;
701
739
  label: import("../../type-source").LabelType;
702
740
  declarations?: import("../../type-source").DeclarationType[] | undefined;
703
741
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -731,6 +769,8 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
731
769
  status: import("../../use-suggesters").SuggesterStatus;
732
770
  timestamp: number;
733
771
  };
772
+ goNextPage: () => void;
773
+ goPreviousPage: () => void;
734
774
  label: import("../../type-source").LabelType;
735
775
  declarations?: import("../../type-source").DeclarationType[] | undefined;
736
776
  conditionFilter: import("../../type-source").ConditionFilterType;
@@ -95,6 +95,8 @@ export declare function reduceOverviewOnInit(state: LunaticState, action: Action
95
95
  nbIterations?: number | undefined;
96
96
  subPage?: number | undefined;
97
97
  }) => void;
98
+ goNextPage: () => void;
99
+ goPreviousPage: () => void;
98
100
  getSuggesterStatus: (name: string) => {
99
101
  status: import("../../use-suggesters").SuggesterStatus;
100
102
  timestamp: number;
@@ -136,6 +136,8 @@ export type LunaticState = {
136
136
  nbIterations?: number;
137
137
  subPage?: number;
138
138
  }) => void;
139
+ goNextPage: () => void;
140
+ goPreviousPage: () => void;
139
141
  getSuggesterStatus: (name: string) => {
140
142
  status: SuggesterStatus;
141
143
  timestamp: number;
@@ -263,6 +263,17 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
263
263
  iterations?: number | undefined;
264
264
  }[];
265
265
  };
266
+ Modal: import("../components/type").LunaticBaseProps<string | null> & {
267
+ goToPage: (page: {
268
+ page: string;
269
+ iteration?: number | undefined;
270
+ nbIterations?: number | undefined;
271
+ subPage?: number | undefined;
272
+ }) => void;
273
+ page: string;
274
+ goNextPage: () => void;
275
+ goPreviousPage: () => void;
276
+ };
266
277
  })[] | undefined;
267
278
  except?: (keyof {
268
279
  InputNumber: import("../components/type").LunaticBaseProps<number | null> & {
@@ -498,6 +509,17 @@ declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNA
498
509
  iterations?: number | undefined;
499
510
  }[];
500
511
  };
512
+ Modal: import("../components/type").LunaticBaseProps<string | null> & {
513
+ goToPage: (page: {
514
+ page: string;
515
+ iteration?: number | undefined;
516
+ nbIterations?: number | undefined;
517
+ subPage?: number | undefined;
518
+ }) => void;
519
+ page: string;
520
+ goNextPage: () => void;
521
+ goPreviousPage: () => void;
522
+ };
501
523
  })[] | undefined;
502
524
  }) => import("./commons/fill-components/fill-components").LunaticComponentProps<"Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Suggester" | "ComponentSet" | "Roundabout" | "QuestionExplication">[];
503
525
  goPreviousPage: () => void;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Extract the value associated with a component
3
+ * If the component expect multiple values (it has a responses property) then extract a map of values
4
+ */
5
+ export declare function getComponentValue<T = unknown>(component: unknown, valueMap: Record<string, unknown>, rowIndex?: number): T;