@inseefr/lunatic 2.5.1-testRoundaboutFix → 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.
- package/lib/components/commons/components/combo-box/combo-box-container.js +16 -7
- package/lib/components/commons/components/combo-box/combo-box-container.spec.js +5 -5
- package/lib/components/commons/components/combo-box/combo-box-content-box.js +25 -0
- package/lib/components/commons/components/combo-box/combo-box-content.js +11 -11
- package/lib/components/commons/components/combo-box/combo-box.js +26 -11
- package/lib/components/commons/components/combo-box/panel/panel-container.js +5 -2
- package/lib/components/commons/components/combo-box/panel/panel-container.spec.js +7 -6
- package/lib/components/commons/components/combo-box/panel/panel.js +2 -2
- package/lib/components/commons/components/combo-box/selection/selection-container.js +3 -2
- package/lib/components/commons/components/combo-box/selection/selection.js +3 -1
- package/lib/components/dropdown/lunatic-dropdown.js +3 -1
- package/lib/components/index.js +7 -0
- package/lib/components/modal/html/modal.js +88 -0
- package/lib/components/modal/html/modal.scss +43 -0
- package/lib/components/modal/index.js +13 -0
- package/lib/components/modal/lunatic-modal.js +38 -0
- package/lib/components/pairwise-links/orchestrator.js +2 -0
- package/lib/components/pairwise-links/pairwise-links.js +1 -1
- package/lib/components/pairwise-links/row.js +2 -0
- package/lib/components/suggester/html/suggester.js +10 -6
- package/lib/components/suggester/lunatic-suggester.js +3 -1
- package/lib/src/components/commons/components/combo-box/combo-box-container.d.ts +5 -2
- package/lib/src/components/commons/components/combo-box/combo-box-content-box.d.ts +8 -0
- package/lib/src/components/commons/components/combo-box/combo-box-content.d.ts +2 -1
- package/lib/src/components/commons/components/combo-box/combo-box.d.ts +1 -0
- package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +2 -0
- package/lib/src/components/commons/components/combo-box/panel/panel-container.d.ts +2 -2
- package/lib/src/components/commons/components/combo-box/selection/selection-container.d.ts +2 -1
- package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +2 -1
- package/lib/src/components/dropdown/lunatic-dropdown.d.ts +1 -1
- package/lib/src/components/index.d.ts +1 -0
- package/lib/src/components/modal/html/modal.d.ts +14 -0
- package/lib/src/components/modal/index.d.ts +1 -0
- package/lib/src/components/modal/lunatic-modal.d.ts +3 -0
- package/lib/src/components/pairwise-links/row.d.ts +1 -1
- package/lib/src/components/suggester/html/suggester.d.ts +1 -0
- package/lib/src/components/suggester/lunatic-suggester.d.ts +1 -1
- package/lib/src/components/type.d.ts +8 -0
- package/lib/src/use-lunatic/actions.d.ts +4 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +40 -0
- package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +2 -0
- package/lib/src/use-lunatic/type.d.ts +2 -0
- package/lib/src/use-lunatic/use-lunatic.d.ts +22 -0
- package/lib/stories/modal/modal.stories.js +34 -0
- package/lib/stories/modal/source.json +97 -0
- package/lib/stories/questionnaires/simpsons/simpsons.stories.js +33 -36
- package/lib/stories/suggester/simple.json +15 -0
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js +6 -2
- package/lib/use-lunatic/commons/page-navigation.js +2 -2
- package/lib/use-lunatic/commons/page.js +0 -6
- package/lib/use-lunatic/initial-state.js +2 -0
- package/lib/use-lunatic/reducer/commons/auto-explore-loop.js +9 -3
- package/lib/use-lunatic/reducer/reduce-go-next-page.js +11 -4
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js +13 -5
- package/lib/use-lunatic/reducer/reduce-go-to-page.js +7 -6
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +0 -3
- package/lib/use-lunatic/reducer/reduce-on-init.js +11 -7
- package/lib/use-lunatic/use-lunatic.js +3 -1
- package/package.json +1 -1
|
@@ -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
|
|
28
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
|
75
|
+
case 10:
|
|
73
76
|
setOptions([]);
|
|
74
77
|
onSelect(null);
|
|
75
78
|
setSearch('');
|
|
76
|
-
case
|
|
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
|
-
|
|
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;
|
|
@@ -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
|
-
|
|
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;
|
|
@@ -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';
|
|
@@ -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;
|
|
@@ -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,34 @@
|
|
|
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 _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
9
|
+
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
10
|
+
var _source = _interopRequireDefault(require("./source"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
|
+
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); }
|
|
19
|
+
var stories = {
|
|
20
|
+
title: 'Components/Modal',
|
|
21
|
+
component: _orchestrator["default"],
|
|
22
|
+
argTypes: _defaultArgTypes["default"]
|
|
23
|
+
};
|
|
24
|
+
var _default = stories;
|
|
25
|
+
exports["default"] = _default;
|
|
26
|
+
var Template = function Template(args) {
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_orchestrator["default"], _objectSpread({}, args));
|
|
28
|
+
};
|
|
29
|
+
var Default = Template.bind({});
|
|
30
|
+
exports.Default = Default;
|
|
31
|
+
Default.args = {
|
|
32
|
+
id: 'modal',
|
|
33
|
+
source: _source["default"]
|
|
34
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"maxPage": "4",
|
|
3
|
+
"components": [
|
|
4
|
+
{
|
|
5
|
+
"id": "kze792d8",
|
|
6
|
+
"componentType": "InputNumber",
|
|
7
|
+
"mandatory": false,
|
|
8
|
+
"page": "1",
|
|
9
|
+
"min": 0,
|
|
10
|
+
"max": 10,
|
|
11
|
+
"decimals": 0,
|
|
12
|
+
"label": {
|
|
13
|
+
"value": "\"➡ 1. \" || \"In put for Number \"",
|
|
14
|
+
"type": "VTL|MD"
|
|
15
|
+
},
|
|
16
|
+
"description": { "value": "\"Description\"", "type": "VTL|MD" },
|
|
17
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
18
|
+
"response": { "name": "NB" }
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "modaltoto",
|
|
22
|
+
"componentType": "ConfirmationModal",
|
|
23
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
24
|
+
"page": "2",
|
|
25
|
+
"label": {
|
|
26
|
+
"value": "\"### Est-ce correcte ? \"",
|
|
27
|
+
"type": "VTL|MD"
|
|
28
|
+
},
|
|
29
|
+
"description": {
|
|
30
|
+
"value": "\"Vous avez renseigné : \" || cast(NB, string) || \".\"",
|
|
31
|
+
"type": "VTL|MD"
|
|
32
|
+
},
|
|
33
|
+
"declarations": [
|
|
34
|
+
{
|
|
35
|
+
"id": "kb9hi4j0-krnoclfe",
|
|
36
|
+
"declarationType": "INSTRUCTION",
|
|
37
|
+
"position": "BEFORE_QUESTION_TEXT",
|
|
38
|
+
"label": {
|
|
39
|
+
"value": "\"Déclaration Before\"",
|
|
40
|
+
"type": "VTL|MD"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "kb9hi4j0-krnoclfe",
|
|
45
|
+
"declarationType": "INSTRUCTION",
|
|
46
|
+
"position": "AFTER_QUESTION_TEXT",
|
|
47
|
+
"label": {
|
|
48
|
+
"value": "\"Déclaration AFTER\"",
|
|
49
|
+
"type": "VTL|MD"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "kb9hi4j0-krnoclfe",
|
|
54
|
+
"declarationType": "HELP",
|
|
55
|
+
"position": "DETACHABLE",
|
|
56
|
+
"label": {
|
|
57
|
+
"value": "\"Declaration Detachable\"",
|
|
58
|
+
"type": "VTL|MD"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "modaltoto",
|
|
65
|
+
"componentType": "Sequence",
|
|
66
|
+
"conditionFilter": { "value": "false", "type": "VTL" },
|
|
67
|
+
"page": "3",
|
|
68
|
+
"label": {
|
|
69
|
+
"value": "toto to skip",
|
|
70
|
+
"type": "VTL"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "modaltoto",
|
|
75
|
+
"componentType": "Sequence",
|
|
76
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
77
|
+
"page": "4",
|
|
78
|
+
"label": {
|
|
79
|
+
"value": "toto to not skip",
|
|
80
|
+
"type": "VTL"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"variables": [
|
|
85
|
+
{
|
|
86
|
+
"variableType": "COLLECTED",
|
|
87
|
+
"name": "NB",
|
|
88
|
+
"values": {
|
|
89
|
+
"PREVIOUS": null,
|
|
90
|
+
"COLLECTED": null,
|
|
91
|
+
"FORCED": null,
|
|
92
|
+
"EDITED": null,
|
|
93
|
+
"INPUTED": null
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|