@inseefr/lunatic 2.7.18 → 2.7.20-rc.1
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/README.md +2 -1
- package/lib/components/declarations/declarations-after-text.js +2 -1
- package/lib/components/declarations/declarations-before-text.js +2 -1
- package/lib/components/declarations/declarations-detachable.js +2 -1
- package/lib/components/index.js +7 -0
- package/lib/components/question/Question.js +49 -0
- package/lib/components/question/index.js +16 -0
- package/lib/src/components/declarations/declarations-after-text.d.ts +3 -2
- package/lib/src/components/declarations/declarations-before-text.d.ts +3 -2
- package/lib/src/components/declarations/declarations-detachable.d.ts +3 -2
- package/lib/src/components/index.d.ts +1 -0
- package/lib/src/components/question/Question.d.ts +7 -0
- package/lib/src/components/question/index.d.ts +1 -0
- package/lib/src/components/type.d.ts +5 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +40 -20
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +38 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +24 -18
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +54 -4
- package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
- package/lib/src/use-lunatic/replace-component-sequence.d.ts +5 -1
- package/lib/src/use-lunatic/type-source.d.ts +21 -2
- package/lib/src/use-lunatic/use-lunatic.d.ts +11 -3
- package/lib/stories/question/question.stories.js +32 -0
- package/lib/stories/question/source.json +220 -0
- package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +1 -0
- package/lib/use-lunatic/commons/variables/behaviours/resizing-behaviour.js +10 -5
- package/lib/use-lunatic/commons/variables/lunatic-variables-store.spec.js +43 -0
- package/lib/use-lunatic/replace-component-sequence.js +6 -3
- package/lib/use-lunatic/type-source.js +1 -1
- package/lib/utils/suggester-workers/worker-path.js +1 -1
- package/package.json +1 -1
- package/scripts/build/workers-paths.js +9 -1
package/README.md
CHANGED
|
@@ -124,7 +124,8 @@ Lunatic uses webWorkers to take the load off the main execution frame (e.g. list
|
|
|
124
124
|
|
|
125
125
|
Workers are normally installed when the library is installed (postinstall scripts). If this is not the case, you can always manually run the command `npx @inseefr/lunatic workers` at the root of your project to add Lunatic workers to your project.
|
|
126
126
|
|
|
127
|
-
Lunatic workers are added to the `public/workers` folder of the current project when the library is installed.
|
|
127
|
+
By default: Lunatic workers are added to the `public/workers` folder of the current project when the library is installed.
|
|
128
|
+
If you want to install inside another folder, just run `npx @inseefr/lunatic workers my-custom-folder`. Workers will be available to the `my-custom-folder/workers` folder of the current project.
|
|
128
129
|
|
|
129
130
|
If a new version of Lunatic offers new workers, they will be automatically updated.
|
|
130
131
|
This ensures that you always have the right version of workers for the version of Lunatic you're using.
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
var _commons = require("../commons");
|
|
7
8
|
var _declarations = _interopRequireWildcard(require("./declarations"));
|
|
8
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -19,4 +20,4 @@ function DeclarationsAfterText(props) {
|
|
|
19
20
|
type: _declarations.DECLARATION_POSITIONS.after
|
|
20
21
|
}, props));
|
|
21
22
|
}
|
|
22
|
-
var _default = exports["default"] = DeclarationsAfterText;
|
|
23
|
+
var _default = exports["default"] = (0, _commons.createCustomizableLunaticField)(DeclarationsAfterText, 'DeclarationsAfterText');
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _declarations = _interopRequireWildcard(require("./declarations"));
|
|
9
|
+
var _commons = require("../commons");
|
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
@@ -21,4 +22,4 @@ function DeclarationsBeforeText(props) {
|
|
|
21
22
|
type: _declarations.DECLARATION_POSITIONS.before
|
|
22
23
|
}, props));
|
|
23
24
|
}
|
|
24
|
-
var _default = exports["default"] = DeclarationsBeforeText;
|
|
25
|
+
var _default = exports["default"] = (0, _commons.createCustomizableLunaticField)(DeclarationsBeforeText, ' DeclarationsBeforeText');
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _declarations = _interopRequireWildcard(require("./declarations"));
|
|
9
|
+
var _commons = require("../commons");
|
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
@@ -21,4 +22,4 @@ function DeclarationsDetachable(props) {
|
|
|
21
22
|
type: _declarations.DECLARATION_POSITIONS.detachable
|
|
22
23
|
}, props));
|
|
23
24
|
}
|
|
24
|
-
var _default = exports["default"] = DeclarationsDetachable;
|
|
25
|
+
var _default = exports["default"] = (0, _commons.createCustomizableLunaticField)(DeclarationsDetachable, 'DeclarationsDetachable');
|
package/lib/components/index.js
CHANGED
|
@@ -99,6 +99,12 @@ Object.defineProperty(exports, "PairwiseLinks", {
|
|
|
99
99
|
return _pairwiseLinks.PairwiseLinks;
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
|
+
Object.defineProperty(exports, "Question", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function get() {
|
|
105
|
+
return _question.Question;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
102
108
|
Object.defineProperty(exports, "QuestionContext", {
|
|
103
109
|
enumerable: true,
|
|
104
110
|
get: function get() {
|
|
@@ -213,4 +219,5 @@ var _questionInformation = _interopRequireDefault(require("./questions/question-
|
|
|
213
219
|
var _questionContext = _interopRequireDefault(require("./questions/question-context"));
|
|
214
220
|
var _questionExplication = _interopRequireDefault(require("./question-explication"));
|
|
215
221
|
var _modal = _interopRequireDefault(require("./modal"));
|
|
222
|
+
var _question = require("./question");
|
|
216
223
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Question = void 0;
|
|
7
|
+
var _commons = require("../commons");
|
|
8
|
+
var _declarations = require("../declarations");
|
|
9
|
+
var _lunaticComponents = require("../lunatic-components");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
/**
|
|
12
|
+
* Question that must represent the Don dilman's definition of it.
|
|
13
|
+
*/
|
|
14
|
+
var Question = exports.Question = (0, _commons.createCustomizableLunaticField)(function (props) {
|
|
15
|
+
var id = props.id,
|
|
16
|
+
description = props.description,
|
|
17
|
+
declarations = props.declarations,
|
|
18
|
+
label = props.label,
|
|
19
|
+
components = props.components;
|
|
20
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
21
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_declarations.DeclarationsBeforeText, {
|
|
22
|
+
declarations: declarations,
|
|
23
|
+
id: id
|
|
24
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("fieldset", {
|
|
25
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("legend", {
|
|
26
|
+
id: "question-legend-".concat(id),
|
|
27
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h3", {
|
|
28
|
+
children: label
|
|
29
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
30
|
+
className: "description-lunatic",
|
|
31
|
+
id: "question-description-".concat(id),
|
|
32
|
+
children: description
|
|
33
|
+
})]
|
|
34
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_declarations.DeclarationsAfterText, {
|
|
35
|
+
declarations: declarations,
|
|
36
|
+
id: id
|
|
37
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_lunaticComponents.LunaticComponents, {
|
|
38
|
+
components: components,
|
|
39
|
+
wrapper: function wrapper(_ref) {
|
|
40
|
+
var children = _ref.children;
|
|
41
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
42
|
+
className: "question-components",
|
|
43
|
+
children: children
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
})]
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
49
|
+
}, 'Question');
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Question = require("./Question");
|
|
7
|
+
Object.keys(_Question).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Question[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _Question[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { type DeclarationsProps } from './declarations';
|
|
2
|
-
declare
|
|
3
|
-
export default
|
|
3
|
+
declare const _default: import("react").ComponentType<Omit<DeclarationsProps, "type">>;
|
|
4
|
+
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type DeclarationsProps } from './declarations';
|
|
2
|
-
declare
|
|
3
|
-
export default
|
|
3
|
+
declare const _default: React.ComponentType<Omit<DeclarationsProps, "type">>;
|
|
4
|
+
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type DeclarationsProps } from './declarations';
|
|
2
|
-
declare
|
|
3
|
-
export default
|
|
3
|
+
declare const _default: React.ComponentType<Omit<DeclarationsProps, "type">>;
|
|
4
|
+
export default _default;
|
|
@@ -28,3 +28,4 @@ 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
30
|
export { default as ConfirmationModal } from './modal';
|
|
31
|
+
export { Question } from './question';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Question that must represent the Don dilman's definition of it.
|
|
4
|
+
*/
|
|
5
|
+
export declare const Question: import("react").ComponentType<Pick<import("../type").LunaticBaseProps<unknown>, "label" | "id" | "description" | "declarations"> & {
|
|
6
|
+
components: import("../../use-lunatic/commons/fill-components/fill-components").FilledLunaticComponentProps[];
|
|
7
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Question';
|
|
@@ -83,7 +83,11 @@ type ComponentPropsByType = {
|
|
|
83
83
|
};
|
|
84
84
|
Sequence: Pick<LunaticBaseProps<string>, 'id' | 'declarations' | 'label' | 'style'>;
|
|
85
85
|
Subsequence: Pick<LunaticBaseProps<string>, 'id' | 'declarations' | 'label'>;
|
|
86
|
-
Question: Pick<LunaticBaseProps<unknown>, 'label' | 'description'
|
|
86
|
+
Question: Pick<LunaticBaseProps<unknown>, 'declarations' | 'label' | 'id' | 'description'> & {
|
|
87
|
+
components: FilledLunaticComponentProps[];
|
|
88
|
+
};
|
|
89
|
+
QuestionContext: Pick<LunaticBaseProps<unknown>, 'label' | 'description'>;
|
|
90
|
+
QuestionInformation: Pick<LunaticBaseProps<unknown>, 'label' | 'description'>;
|
|
87
91
|
ComponentSet: LunaticBaseProps<unknown> & {
|
|
88
92
|
components: FilledLunaticComponentProps[];
|
|
89
93
|
value: Record<string, unknown>;
|
|
@@ -3,49 +3,55 @@ import type { LunaticComponentDefinition } from '../../type';
|
|
|
3
3
|
* Add required attribute on component that are mandatory
|
|
4
4
|
*/
|
|
5
5
|
export declare function fillComponentRequired(component: LunaticComponentDefinition): (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentSequenceType & {
|
|
6
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
6
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
7
7
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentSubSequenceType & {
|
|
8
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
8
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
9
9
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentRosterForLoopType & {
|
|
10
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
10
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
11
11
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentLoopType & {
|
|
12
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
12
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
13
13
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentTableType & {
|
|
14
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
14
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
15
15
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentNumberType & {
|
|
16
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
16
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
17
17
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentDatePickerType & {
|
|
18
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
18
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
19
19
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentCheckboxGroupType & {
|
|
20
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
20
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
21
21
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentCheckboxBooleanType & {
|
|
22
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
22
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
23
23
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentRadioType & {
|
|
24
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
24
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
25
25
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentFilterDescriptionType & {
|
|
26
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
26
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
27
27
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentDropdownType & {
|
|
28
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
28
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
29
29
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentPairWiseLinksType & {
|
|
30
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
30
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
31
31
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentRoundaboutType & {
|
|
32
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
32
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
33
33
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentSuggesterType & {
|
|
34
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
34
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
35
35
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentInputOrTextareaType & {
|
|
36
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
36
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
37
37
|
}) | (import("../../type-source").ComponentTypeBase & {
|
|
38
38
|
componentType: "CheckboxOne";
|
|
39
39
|
} & {
|
|
40
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
40
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
41
41
|
}) | (import("../../type-source").ComponentTypeBase & {
|
|
42
42
|
componentType: "ConfirmationModal";
|
|
43
43
|
} & {
|
|
44
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
44
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
45
45
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentComponentSetType & {
|
|
46
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
46
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
47
47
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentQuestionExplicationType & {
|
|
48
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
48
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
49
|
+
}) | (import("../../type-source").ComponentTypeBase & {
|
|
50
|
+
componentType: "Question";
|
|
51
|
+
components: import("../../type-source").ComponentType[];
|
|
52
|
+
description: import("../../type-source").LabelType;
|
|
53
|
+
} & {
|
|
54
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
49
55
|
}) | {
|
|
50
56
|
required: boolean;
|
|
51
57
|
label: import("../../type-source").LabelType;
|
|
@@ -385,4 +391,18 @@ export declare function fillComponentRequired(component: LunaticComponentDefinit
|
|
|
385
391
|
componentType: "QuestionExplication";
|
|
386
392
|
description: string;
|
|
387
393
|
bgColor?: string | undefined;
|
|
394
|
+
} | {
|
|
395
|
+
required: boolean;
|
|
396
|
+
label: import("../../type-source").LabelType;
|
|
397
|
+
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
398
|
+
conditionFilter?: import("../../type-source").ConditionFilterType | undefined;
|
|
399
|
+
controls?: import("../../type-source").ControlType[] | undefined;
|
|
400
|
+
id: string;
|
|
401
|
+
bindingDependencies?: string[] | undefined;
|
|
402
|
+
hierarchy?: import("../../type-source").Hierarchy | undefined;
|
|
403
|
+
mandatory?: boolean | undefined;
|
|
404
|
+
page: string;
|
|
405
|
+
componentType: "Question";
|
|
406
|
+
components: import("../../type-source").ComponentType[];
|
|
407
|
+
description: import("../../type-source").LabelType;
|
|
388
408
|
};
|
|
@@ -830,5 +830,43 @@ declare function fillFromState(component: LunaticComponentDefinition, state: Lun
|
|
|
830
830
|
componentType: "QuestionExplication";
|
|
831
831
|
description: string;
|
|
832
832
|
bgColor?: string | undefined;
|
|
833
|
+
} | {
|
|
834
|
+
handleChange: (response: {
|
|
835
|
+
name: string;
|
|
836
|
+
}, value: any, args?: {
|
|
837
|
+
iteration?: number[] | undefined;
|
|
838
|
+
} | undefined) => void;
|
|
839
|
+
executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
|
|
840
|
+
iteration?: number | number[] | undefined;
|
|
841
|
+
bindingDependencies?: string[] | undefined;
|
|
842
|
+
deps?: string[] | undefined;
|
|
843
|
+
} | undefined) => T;
|
|
844
|
+
preferences: ["COLLECTED"];
|
|
845
|
+
goToPage: (page: {
|
|
846
|
+
page: string;
|
|
847
|
+
iteration?: number | undefined;
|
|
848
|
+
nbIterations?: number | undefined;
|
|
849
|
+
subPage?: number | undefined;
|
|
850
|
+
}) => void;
|
|
851
|
+
shortcut: boolean | undefined;
|
|
852
|
+
getSuggesterStatus: (name: string) => {
|
|
853
|
+
status: import("../../use-suggesters").SuggesterStatus;
|
|
854
|
+
timestamp: number;
|
|
855
|
+
};
|
|
856
|
+
workersBasePath: string | undefined;
|
|
857
|
+
goNextPage: () => void;
|
|
858
|
+
goPreviousPage: () => void;
|
|
859
|
+
label: import("../../type-source").LabelType;
|
|
860
|
+
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
861
|
+
conditionFilter?: import("../../type-source").ConditionFilterType | undefined;
|
|
862
|
+
controls?: import("../../type-source").ControlType[] | undefined;
|
|
863
|
+
id: string;
|
|
864
|
+
bindingDependencies?: string[] | undefined;
|
|
865
|
+
hierarchy?: import("../../type-source").Hierarchy | undefined;
|
|
866
|
+
mandatory?: boolean | undefined;
|
|
867
|
+
page: string;
|
|
868
|
+
componentType: "Question";
|
|
869
|
+
components: import("../../type-source").ComponentType[];
|
|
870
|
+
description: import("../../type-source").LabelType;
|
|
833
871
|
};
|
|
834
872
|
export default fillFromState;
|
|
@@ -3,45 +3,51 @@ import type { LunaticComponentDefinition, LunaticState } from '../../type';
|
|
|
3
3
|
* Fill the number of iterations for loop components without "iterations" expression
|
|
4
4
|
*/
|
|
5
5
|
export declare function fillIterations(component: LunaticComponentDefinition, state: LunaticState): (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentSequenceType & {
|
|
6
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
6
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
7
7
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentSubSequenceType & {
|
|
8
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
8
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
9
9
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentTableType & {
|
|
10
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
10
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
11
11
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentNumberType & {
|
|
12
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
12
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
13
13
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentDatePickerType & {
|
|
14
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
14
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
15
15
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentCheckboxGroupType & {
|
|
16
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
16
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
17
17
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentCheckboxBooleanType & {
|
|
18
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
18
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
19
19
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentRadioType & {
|
|
20
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
20
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
21
21
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentFilterDescriptionType & {
|
|
22
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
22
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
23
23
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentDropdownType & {
|
|
24
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
24
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
25
25
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentPairWiseLinksType & {
|
|
26
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
26
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
27
27
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentRoundaboutType & {
|
|
28
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
28
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
29
29
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentSuggesterType & {
|
|
30
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
30
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
31
31
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentInputOrTextareaType & {
|
|
32
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
32
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
33
33
|
}) | (import("../../type-source").ComponentTypeBase & {
|
|
34
34
|
componentType: "CheckboxOne";
|
|
35
35
|
} & {
|
|
36
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
36
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
37
37
|
}) | (import("../../type-source").ComponentTypeBase & {
|
|
38
38
|
componentType: "ConfirmationModal";
|
|
39
39
|
} & {
|
|
40
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
40
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
41
41
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentComponentSetType & {
|
|
42
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
42
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
43
43
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentQuestionExplicationType & {
|
|
44
|
-
componentType: "CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
44
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
45
|
+
}) | (import("../../type-source").ComponentTypeBase & {
|
|
46
|
+
componentType: "Question";
|
|
47
|
+
components: import("../../type-source").ComponentType[];
|
|
48
|
+
description: import("../../type-source").LabelType;
|
|
49
|
+
} & {
|
|
50
|
+
componentType: "CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication";
|
|
45
51
|
}) | {
|
|
46
52
|
iterations: number;
|
|
47
53
|
label: import("../../type-source").LabelType;
|
|
@@ -31,7 +31,7 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
31
31
|
iterations: import("react").ReactNode;
|
|
32
32
|
locked: boolean;
|
|
33
33
|
} | {
|
|
34
|
-
components: import("./fill-components").FilledLunaticComponentProps<"CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication">[];
|
|
34
|
+
components: import("./fill-components").FilledLunaticComponentProps<"CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication">[];
|
|
35
35
|
label: import("react").ReactNode;
|
|
36
36
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
37
37
|
conditionFilter?: import("react").ReactNode;
|
|
@@ -54,7 +54,31 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
54
54
|
page: string;
|
|
55
55
|
componentType: "ComponentSet";
|
|
56
56
|
} | {
|
|
57
|
-
|
|
57
|
+
components: import("./fill-components").FilledLunaticComponentProps<"CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication">[];
|
|
58
|
+
label: import("react").ReactNode;
|
|
59
|
+
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
60
|
+
conditionFilter?: import("react").ReactNode;
|
|
61
|
+
controls?: import("../../type-source").ControlType[] | undefined;
|
|
62
|
+
id: string;
|
|
63
|
+
bindingDependencies?: string[] | undefined;
|
|
64
|
+
hierarchy?: {
|
|
65
|
+
sequence: {
|
|
66
|
+
label: import("react").ReactNode;
|
|
67
|
+
id: string;
|
|
68
|
+
page: string;
|
|
69
|
+
};
|
|
70
|
+
subSequence?: {
|
|
71
|
+
label: import("react").ReactNode;
|
|
72
|
+
id: string;
|
|
73
|
+
page: string;
|
|
74
|
+
} | undefined;
|
|
75
|
+
} | undefined;
|
|
76
|
+
mandatory?: boolean | undefined;
|
|
77
|
+
page: string;
|
|
78
|
+
componentType: "Question";
|
|
79
|
+
description: import("react").ReactNode;
|
|
80
|
+
} | {
|
|
81
|
+
getComponents: (iteration: number) => import("./fill-components").FilledLunaticComponentProps<"CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication">[];
|
|
58
82
|
label: import("react").ReactNode;
|
|
59
83
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
60
84
|
conditionFilter?: import("react").ReactNode;
|
|
@@ -102,7 +126,7 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
102
126
|
positioning: "HORIZONTAL";
|
|
103
127
|
value?: Record<string, unknown[]> | undefined;
|
|
104
128
|
} | {
|
|
105
|
-
getComponents: (iteration: number) => import("./fill-components").FilledLunaticComponentProps<"CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication">[];
|
|
129
|
+
getComponents: (iteration: number) => import("./fill-components").FilledLunaticComponentProps<"CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication">[];
|
|
106
130
|
label: import("react").ReactNode;
|
|
107
131
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
108
132
|
conditionFilter?: import("react").ReactNode;
|
|
@@ -136,7 +160,7 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
136
160
|
paginatedLoop: boolean;
|
|
137
161
|
value?: Record<string, unknown[]> | undefined;
|
|
138
162
|
} | {
|
|
139
|
-
getComponents: (x: number, y: number) => import("./fill-components").FilledLunaticComponentProps<"CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication">[];
|
|
163
|
+
getComponents: (x: number, y: number) => import("./fill-components").FilledLunaticComponentProps<"CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication">[];
|
|
140
164
|
label: import("react").ReactNode;
|
|
141
165
|
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
142
166
|
conditionFilter?: import("react").ReactNode;
|
|
@@ -770,6 +794,32 @@ declare function fillSpecificExpressions(component: DeepTranslateExpression<Luna
|
|
|
770
794
|
bgColor?: string | undefined;
|
|
771
795
|
} & import("./fill-management").FilledProps & import("./fill-component-value").FilledProps & import("./fill-missing-response").FilledProps & import("./fill-from-state").FilledProps & import("./fill-pagination").FilledProps & {
|
|
772
796
|
conditionFilter?: boolean | undefined;
|
|
797
|
+
}) | ({
|
|
798
|
+
label: import("react").ReactNode;
|
|
799
|
+
declarations?: import("../../type-source").DeclarationType[] | undefined;
|
|
800
|
+
conditionFilter?: import("react").ReactNode;
|
|
801
|
+
controls?: import("../../type-source").ControlType[] | undefined;
|
|
802
|
+
id: string;
|
|
803
|
+
bindingDependencies?: string[] | undefined;
|
|
804
|
+
hierarchy?: {
|
|
805
|
+
sequence: {
|
|
806
|
+
label: import("react").ReactNode;
|
|
807
|
+
id: string;
|
|
808
|
+
page: string;
|
|
809
|
+
};
|
|
810
|
+
subSequence?: {
|
|
811
|
+
label: import("react").ReactNode;
|
|
812
|
+
id: string;
|
|
813
|
+
page: string;
|
|
814
|
+
} | undefined;
|
|
815
|
+
} | undefined;
|
|
816
|
+
mandatory?: boolean | undefined;
|
|
817
|
+
page: string;
|
|
818
|
+
componentType: "Question";
|
|
819
|
+
components: import("../../type-source").ComponentType[];
|
|
820
|
+
description: import("react").ReactNode;
|
|
821
|
+
} & import("./fill-management").FilledProps & import("./fill-component-value").FilledProps & import("./fill-missing-response").FilledProps & import("./fill-from-state").FilledProps & import("./fill-pagination").FilledProps & {
|
|
822
|
+
conditionFilter?: boolean | undefined;
|
|
773
823
|
}) | {
|
|
774
824
|
label: unknown;
|
|
775
825
|
colspan?: number | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LunaticState } from '../type';
|
|
2
|
-
declare function useComponentsFromState(state: LunaticState): import("./fill-components/fill-components").FilledLunaticComponentProps<"CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication">[];
|
|
2
|
+
declare function useComponentsFromState(state: LunaticState): import("./fill-components/fill-components").FilledLunaticComponentProps<"CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication">[];
|
|
3
3
|
export default useComponentsFromState;
|
|
@@ -10,4 +10,8 @@ export declare function replaceComponentSequence(components: Array<LunaticCompon
|
|
|
10
10
|
componentType: "CheckboxOne";
|
|
11
11
|
}) | (import("./type-source").ComponentTypeBase & {
|
|
12
12
|
componentType: "ConfirmationModal";
|
|
13
|
-
}) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentComponentSetType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentQuestionExplicationType))
|
|
13
|
+
}) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentComponentSetType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentQuestionExplicationType) | (import("./type-source").ComponentTypeBase & {
|
|
14
|
+
componentType: "Question";
|
|
15
|
+
components: import("./type-source").ComponentType[];
|
|
16
|
+
description: import("./type-source").LabelType;
|
|
17
|
+
}))[];
|
|
@@ -79,7 +79,11 @@ export type ComponentType = (ComponentTypeBase & ComponentSequenceType) | (Compo
|
|
|
79
79
|
componentType: 'CheckboxOne';
|
|
80
80
|
}) | (ComponentTypeBase & {
|
|
81
81
|
componentType: 'ConfirmationModal';
|
|
82
|
-
}) | (ComponentTypeBase & ComponentComponentSetType) | (ComponentTypeBase & ComponentQuestionExplicationType)
|
|
82
|
+
}) | (ComponentTypeBase & ComponentComponentSetType) | (ComponentTypeBase & ComponentQuestionExplicationType) | (ComponentTypeBase & {
|
|
83
|
+
componentType: 'Question';
|
|
84
|
+
components: ComponentType[];
|
|
85
|
+
description: LabelType;
|
|
86
|
+
});
|
|
83
87
|
export type ComponentTypeEnum = ComponentType['componentType'];
|
|
84
88
|
export type ComponentInputOrTextareaType = {
|
|
85
89
|
componentType: 'Input' | 'Textarea';
|
|
@@ -205,6 +209,10 @@ export type ComponentPairWiseLinksType = {
|
|
|
205
209
|
};
|
|
206
210
|
components: ComponentType[];
|
|
207
211
|
};
|
|
212
|
+
export type ComponentQuestionType = {
|
|
213
|
+
componentType: 'Question';
|
|
214
|
+
components: ComponentType[];
|
|
215
|
+
};
|
|
208
216
|
export type ComponentComponentSetType = {
|
|
209
217
|
componentType: 'ComponentSet';
|
|
210
218
|
components: ComponentType[];
|
|
@@ -288,7 +296,18 @@ export type LunaticSource = {
|
|
|
288
296
|
size: string;
|
|
289
297
|
variables: string[];
|
|
290
298
|
} | {
|
|
291
|
-
sizeForLinksVariables: string
|
|
299
|
+
sizeForLinksVariables: [string, string] | {
|
|
300
|
+
xAxisSize: string;
|
|
301
|
+
yAxisSize: string;
|
|
302
|
+
};
|
|
303
|
+
linksVariables: string[];
|
|
304
|
+
} | {
|
|
305
|
+
size: string;
|
|
306
|
+
variables: string[];
|
|
307
|
+
sizeForLinksVariables: [string, string] | {
|
|
308
|
+
xAxisSize: string;
|
|
309
|
+
yAxisSize: string;
|
|
310
|
+
};
|
|
292
311
|
linksVariables: string[];
|
|
293
312
|
};
|
|
294
313
|
};
|
|
@@ -53,7 +53,11 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
53
53
|
};
|
|
54
54
|
Sequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "style" | "id" | "declarations">;
|
|
55
55
|
Subsequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "id" | "declarations">;
|
|
56
|
-
Question: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "description"
|
|
56
|
+
Question: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "id" | "description" | "declarations"> & {
|
|
57
|
+
components: import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
|
|
58
|
+
};
|
|
59
|
+
QuestionContext: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "description">;
|
|
60
|
+
QuestionInformation: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "description">;
|
|
57
61
|
ComponentSet: import("../components/type").LunaticBaseProps<unknown> & {
|
|
58
62
|
components: import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
|
|
59
63
|
value: Record<string, unknown>;
|
|
@@ -301,7 +305,11 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
301
305
|
};
|
|
302
306
|
Sequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "style" | "id" | "declarations">;
|
|
303
307
|
Subsequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "id" | "declarations">;
|
|
304
|
-
Question: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "description"
|
|
308
|
+
Question: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "id" | "description" | "declarations"> & {
|
|
309
|
+
components: import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
|
|
310
|
+
};
|
|
311
|
+
QuestionContext: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "description">;
|
|
312
|
+
QuestionInformation: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "description">;
|
|
305
313
|
ComponentSet: import("../components/type").LunaticBaseProps<unknown> & {
|
|
306
314
|
components: import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
|
|
307
315
|
value: Record<string, unknown>;
|
|
@@ -524,7 +532,7 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
524
532
|
goPreviousPage: () => void;
|
|
525
533
|
};
|
|
526
534
|
})[] | undefined;
|
|
527
|
-
}) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps<"CheckboxOne" | "ConfirmationModal" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication">[];
|
|
535
|
+
}) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps<"CheckboxOne" | "ConfirmationModal" | "Question" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "ComponentSet" | "QuestionExplication">[];
|
|
528
536
|
goPreviousPage: () => void;
|
|
529
537
|
goNextPage: (payload?: {}) => void;
|
|
530
538
|
goToPage: (page: {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.Default = void 0;
|
|
7
|
+
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
8
|
+
var _source = _interopRequireDefault(require("./source.json"));
|
|
9
|
+
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
+
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); }
|
|
17
|
+
//import type { Meta, StoryObj } from '@storybook/react';
|
|
18
|
+
|
|
19
|
+
var meta = {
|
|
20
|
+
title: 'Components/Question',
|
|
21
|
+
component: _orchestrator["default"],
|
|
22
|
+
argTypes: _objectSpread({}, _defaultArgTypes["default"])
|
|
23
|
+
};
|
|
24
|
+
// } satisfies Meta<typeof Orchestrator>;
|
|
25
|
+
var _default = exports["default"] = meta; //type Story = StoryObj<typeof Orchestrator>
|
|
26
|
+
var Default = exports.Default = {
|
|
27
|
+
args: {
|
|
28
|
+
id: 'sequence-simple',
|
|
29
|
+
source: _source["default"]
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
// satisfies Story
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pagination": "question",
|
|
3
|
+
"maxPage": "2",
|
|
4
|
+
|
|
5
|
+
"variables": [
|
|
6
|
+
{
|
|
7
|
+
"variableType": "COLLECTED",
|
|
8
|
+
"name": "TESTTEXTE",
|
|
9
|
+
"values": {
|
|
10
|
+
"PREVIOUS": null,
|
|
11
|
+
"COLLECTED": null,
|
|
12
|
+
"FORCED": null,
|
|
13
|
+
"EDITED": null,
|
|
14
|
+
"INPUTED": null
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"variableType": "COLLECTED",
|
|
19
|
+
"name": "QNUM",
|
|
20
|
+
"values": {
|
|
21
|
+
"PREVIOUS": null,
|
|
22
|
+
"COLLECTED": null,
|
|
23
|
+
"FORCED": null,
|
|
24
|
+
"EDITED": null,
|
|
25
|
+
"INPUTED": null
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"components": [
|
|
30
|
+
{
|
|
31
|
+
"componentType": "Question",
|
|
32
|
+
"id": "idQuestion",
|
|
33
|
+
"page": "1",
|
|
34
|
+
"label": {
|
|
35
|
+
"type": "VTL|MD",
|
|
36
|
+
"value": "\"Question\""
|
|
37
|
+
},
|
|
38
|
+
"description": {
|
|
39
|
+
"type": "VTL|MD",
|
|
40
|
+
"value": "\"Description de la question\""
|
|
41
|
+
},
|
|
42
|
+
"declarations": [
|
|
43
|
+
{
|
|
44
|
+
"declarationType": "HELP",
|
|
45
|
+
"id": "idQuestion-help1",
|
|
46
|
+
"label": {
|
|
47
|
+
"type": "VTL|MD",
|
|
48
|
+
"value": "\"Contenu de la première déclaration avant (contexte)\""
|
|
49
|
+
},
|
|
50
|
+
"position": "BEFORE_QUESTION_TEXT"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"declarationType": "HELP",
|
|
54
|
+
"id": "idQuestion-help2",
|
|
55
|
+
"label": {
|
|
56
|
+
"type": "VTL|MD",
|
|
57
|
+
"value": "\"Contenu de la deuxième déclaration avant (contexte)\""
|
|
58
|
+
},
|
|
59
|
+
"position": "BEFORE_QUESTION_TEXT"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"declarationType": "HELP",
|
|
63
|
+
"id": "idQuestion-help3",
|
|
64
|
+
"label": {
|
|
65
|
+
"type": "VTL|MD",
|
|
66
|
+
"value": "\"Contenu de la première déclaration après (Information)\""
|
|
67
|
+
},
|
|
68
|
+
"position": "AFTER_QUESTION_TEXT"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"declarationType": "HELP",
|
|
72
|
+
"id": "idQuestion-help4",
|
|
73
|
+
"label": {
|
|
74
|
+
"type": "VTL|MD",
|
|
75
|
+
"value": "\"Contenu de la deuxième déclaration après (Information)\""
|
|
76
|
+
},
|
|
77
|
+
"position": "AFTER_QUESTION_TEXT"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"components": [
|
|
81
|
+
{
|
|
82
|
+
"componentType": "Input",
|
|
83
|
+
"bindingDependencies": ["TESTTEXTE"],
|
|
84
|
+
"controls": [
|
|
85
|
+
{
|
|
86
|
+
"bindingDependencies": ["TESTTEXTE"],
|
|
87
|
+
"criticality": "WARN",
|
|
88
|
+
"errorMessage": {
|
|
89
|
+
"type": "VTL|MD",
|
|
90
|
+
"value": "\"a ne peut pas valoir BLABLA\""
|
|
91
|
+
},
|
|
92
|
+
"typeOfControl": "CONSISTENCY",
|
|
93
|
+
"control": {
|
|
94
|
+
"type": "VTL",
|
|
95
|
+
"value": "not(nvl(TESTTEXTE,\"\") = \"BLABLA\")"
|
|
96
|
+
},
|
|
97
|
+
"id": "kfxn6f16-CI-0"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"bindingDependencies": ["TESTTEXTE"],
|
|
101
|
+
"criticality": "WARN",
|
|
102
|
+
"errorMessage": {
|
|
103
|
+
"type": "VTL|MD",
|
|
104
|
+
"value": "\"Cette phrase un peu longue s\u2019affiche si on a du vide pour la variable sur le texte inférieur à 255 caractères et voilà\""
|
|
105
|
+
},
|
|
106
|
+
"typeOfControl": "CONSISTENCY",
|
|
107
|
+
"control": {
|
|
108
|
+
"type": "VTL",
|
|
109
|
+
"value": "not(isnull(TESTTEXTE))"
|
|
110
|
+
},
|
|
111
|
+
"id": "kfxn6f16-CI-1"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"response": { "name": "TESTTEXTE" },
|
|
115
|
+
"hierarchy": {
|
|
116
|
+
"sequence": {
|
|
117
|
+
"id": "kfxmfvwj",
|
|
118
|
+
"page": "1",
|
|
119
|
+
"label": {
|
|
120
|
+
"type": "VTL|MD",
|
|
121
|
+
"value": "\"I - \" || \"TEST SUR BOOLEEN CODE DATE ET TEXTE\""
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"conditionFilter": {
|
|
126
|
+
"type": "VTL",
|
|
127
|
+
"value": "true"
|
|
128
|
+
},
|
|
129
|
+
"id": "kfxn6f16",
|
|
130
|
+
"page": "1",
|
|
131
|
+
"label": {
|
|
132
|
+
"type": "VTL|MD",
|
|
133
|
+
"value": "\"➡ 2. \" || \"Controle sur du texte < 255\""
|
|
134
|
+
},
|
|
135
|
+
"mandatory": false,
|
|
136
|
+
"maxLength": 15,
|
|
137
|
+
"declarations": [
|
|
138
|
+
{
|
|
139
|
+
"declarationType": "INSTRUCTION",
|
|
140
|
+
"id": "kfxn6f16-kfxn36ru",
|
|
141
|
+
"label": {
|
|
142
|
+
"type": "VTL|MD",
|
|
143
|
+
"value": "\"Tester la saisie de BLABLA\""
|
|
144
|
+
},
|
|
145
|
+
"position": "AFTER_QUESTION_TEXT"
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"componentType": "Question",
|
|
153
|
+
"id": "idQuestion2",
|
|
154
|
+
"page": "2",
|
|
155
|
+
"label": {
|
|
156
|
+
"type": "VTL|MD",
|
|
157
|
+
"value": "\"Question 2\""
|
|
158
|
+
},
|
|
159
|
+
"description": {
|
|
160
|
+
"type": "VTL|MD",
|
|
161
|
+
"value": "\"Description de la question 2\""
|
|
162
|
+
},
|
|
163
|
+
"components": [
|
|
164
|
+
{
|
|
165
|
+
"id": "k0dzbfek",
|
|
166
|
+
"componentType": "InputNumber",
|
|
167
|
+
"mandatory": false,
|
|
168
|
+
"page": "2",
|
|
169
|
+
"min": 0,
|
|
170
|
+
"max": 100,
|
|
171
|
+
"decimals": 0,
|
|
172
|
+
"label": {
|
|
173
|
+
"value": "\"➡ 1. \" || \"Test de supériorité stricte - Saisie d’un nombre compris entre 0 et 100 - Si valeur supérieure à 5 message d’info. si superieur à 6,5 autre message \"",
|
|
174
|
+
"type": "VTL|MD"
|
|
175
|
+
},
|
|
176
|
+
"declarations": [
|
|
177
|
+
{
|
|
178
|
+
"id": "k0dzbfek-kzgzg0bk",
|
|
179
|
+
"declarationType": "HELP",
|
|
180
|
+
"position": "AFTER_QUESTION_TEXT",
|
|
181
|
+
"label": {
|
|
182
|
+
"value": "\"Tester 2 et 20 (pour vérifier ordre numérique et lexico)\"",
|
|
183
|
+
"type": "VTL|MD"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
188
|
+
"controls": [
|
|
189
|
+
{
|
|
190
|
+
"id": "k0dzbfek-CI-0",
|
|
191
|
+
"criticality": "WARN",
|
|
192
|
+
"control": {
|
|
193
|
+
"value": "not(cast(nvl(QNUM,0),integer) > 5)",
|
|
194
|
+
"type": "VTL"
|
|
195
|
+
},
|
|
196
|
+
"errorMessage": { "value": "\"sup à 5\"", "type": "VTL|MD" },
|
|
197
|
+
"bindingDependencies": ["QNUM"]
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
{
|
|
201
|
+
"id": "k0dzbfek-CI-1",
|
|
202
|
+
"criticality": "WARN",
|
|
203
|
+
"control": {
|
|
204
|
+
"value": "not(cast(nvl(QNUM,0),integer) > 6.5)",
|
|
205
|
+
"type": "VTL"
|
|
206
|
+
},
|
|
207
|
+
"errorMessage": {
|
|
208
|
+
"value": "\"superieur à 6.5\"",
|
|
209
|
+
"type": "VTL|MD"
|
|
210
|
+
},
|
|
211
|
+
"bindingDependencies": ["QNUM"]
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
"bindingDependencies": ["QNUM"],
|
|
215
|
+
"response": { "name": "QNUM" }
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
}
|
|
@@ -147,6 +147,7 @@ function fillSpecificExpressions(component, state) {
|
|
|
147
147
|
case 'Roundabout':
|
|
148
148
|
return fillRoundaboutProps(component, state);
|
|
149
149
|
case 'ComponentSet':
|
|
150
|
+
case 'Question':
|
|
150
151
|
return fillChildComponents(component, state);
|
|
151
152
|
case 'Loop':
|
|
152
153
|
case 'RosterForLoop':
|
|
@@ -36,7 +36,9 @@ function resizingBehaviour(store, resizing) {
|
|
|
36
36
|
// Pairwise resizing
|
|
37
37
|
if ('sizeForLinksVariables' in resizingInfo) {
|
|
38
38
|
resizePairwise(store, resizingInfo, e.detail);
|
|
39
|
-
|
|
39
|
+
if (!('size' in resizingInfo)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
40
42
|
}
|
|
41
43
|
if (!resizingInfo.size) {
|
|
42
44
|
throw new Error("Cannot resize ".concat(e.detail.name, " missing \"size\" property"));
|
|
@@ -60,12 +62,15 @@ function resizingBehaviour(store, resizing) {
|
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
64
|
function resizePairwise(store, resizingInfo, args) {
|
|
63
|
-
|
|
65
|
+
// Handle expression being sent as an array or an object (ensure backward compatibility)
|
|
66
|
+
// Issue : https://github.com/InseeFr/Lunatic/issues/883
|
|
67
|
+
var sizeExpressions = Array.isArray(resizingInfo.sizeForLinksVariables) ? resizingInfo.sizeForLinksVariables : [resizingInfo.sizeForLinksVariables.xAxisSize, resizingInfo.sizeForLinksVariables.yAxisSize];
|
|
68
|
+
var _sizeExpressions$map = sizeExpressions.map(function (expression) {
|
|
64
69
|
return (0, _number.forceInt)(store.run((0, _vtl.getExpressionAsString)(expression)));
|
|
65
70
|
}),
|
|
66
|
-
|
|
67
|
-
xSize =
|
|
68
|
-
ySize =
|
|
71
|
+
_sizeExpressions$map2 = _slicedToArray(_sizeExpressions$map, 2),
|
|
72
|
+
xSize = _sizeExpressions$map2[0],
|
|
73
|
+
ySize = _sizeExpressions$map2[1];
|
|
69
74
|
resizingInfo.linksVariables.forEach(function (variable) {
|
|
70
75
|
var value = store.get(variable, args.iteration);
|
|
71
76
|
var resizedValue = (0, _array.resizeArray)(
|
|
@@ -252,6 +252,49 @@ var _lunaticVariablesStore = require("./lunatic-variables-store");
|
|
|
252
252
|
(0, _vitest.expect)(variables.get('PRENOM').length).toEqual(3);
|
|
253
253
|
(0, _vitest.expect)(variables.get('NOM').length).toEqual(3);
|
|
254
254
|
});
|
|
255
|
+
(0, _vitest.it)('should resize pairwise with the array syntax', function () {
|
|
256
|
+
variables.set('PRENOM', []);
|
|
257
|
+
variables.set('LINKS', [[]]);
|
|
258
|
+
(0, _resizingBehaviour.resizingBehaviour)(variables, {
|
|
259
|
+
PRENOM: {
|
|
260
|
+
sizeForLinksVariables: ['count(PRENOM)', 'count(PRENOM)'],
|
|
261
|
+
linksVariables: ['LINKS']
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
variables.set('PRENOM', ['John', 'Jane', 'Marc']);
|
|
265
|
+
(0, _vitest.expect)(variables.get('LINKS')).toEqual([[null, null, null], [null, null, null], [null, null, null]]);
|
|
266
|
+
});
|
|
267
|
+
(0, _vitest.it)('should resize pairwise with the object syntax', function () {
|
|
268
|
+
variables.set('PRENOM', []);
|
|
269
|
+
variables.set('LINKS', [[]]);
|
|
270
|
+
(0, _resizingBehaviour.resizingBehaviour)(variables, {
|
|
271
|
+
PRENOM: {
|
|
272
|
+
sizeForLinksVariables: {
|
|
273
|
+
xAxisSize: 'count(PRENOM)',
|
|
274
|
+
yAxisSize: 'count(PRENOM)'
|
|
275
|
+
},
|
|
276
|
+
linksVariables: ['LINKS']
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
variables.set('PRENOM', ['John', 'Jane', 'Marc']);
|
|
280
|
+
(0, _vitest.expect)(variables.get('LINKS')).toEqual([[null, null, null], [null, null, null], [null, null, null]]);
|
|
281
|
+
});
|
|
282
|
+
(0, _vitest.it)('should handle both pairwise and normal resize', function () {
|
|
283
|
+
variables.set('PRENOM', []);
|
|
284
|
+
variables.set('NOM', []);
|
|
285
|
+
variables.set('LINKS', [[]]);
|
|
286
|
+
(0, _resizingBehaviour.resizingBehaviour)(variables, {
|
|
287
|
+
PRENOM: {
|
|
288
|
+
sizeForLinksVariables: ['count(PRENOM)', 'count(PRENOM)'],
|
|
289
|
+
linksVariables: ['LINKS'],
|
|
290
|
+
size: 'count(PRENOM)',
|
|
291
|
+
variables: ['NOM']
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
variables.set('PRENOM', ['John', 'Jane', 'Marc']);
|
|
295
|
+
(0, _vitest.expect)(variables.get('LINKS')).toEqual([[null, null, null], [null, null, null], [null, null, null]]);
|
|
296
|
+
(0, _vitest.expect)(variables.get('NOM')).toEqual([null, null, null]);
|
|
297
|
+
});
|
|
255
298
|
});
|
|
256
299
|
(0, _vitest.describe)('cleaning', function () {
|
|
257
300
|
(0, _vitest.it)('should clean variables', function () {
|
|
@@ -20,9 +20,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
20
20
|
function replaceComponentSequence(components) {
|
|
21
21
|
return components.reduce(function (acc, component) {
|
|
22
22
|
var componentType = component.componentType;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
switch (componentType) {
|
|
24
|
+
case 'Question':
|
|
25
|
+
case 'ComponentSet':
|
|
26
|
+
return [].concat(_toConsumableArray(acc), _toConsumableArray(component.components));
|
|
27
|
+
default:
|
|
28
|
+
return [].concat(_toConsumableArray(acc), [component]);
|
|
25
29
|
}
|
|
26
|
-
return [].concat(_toConsumableArray(acc), [component]);
|
|
27
30
|
}, []);
|
|
28
31
|
}
|
|
@@ -14,7 +14,7 @@ var WorkerEnum = exports.WorkerEnum = /*#__PURE__*/function (WorkerEnum) {
|
|
|
14
14
|
return WorkerEnum;
|
|
15
15
|
}({});
|
|
16
16
|
var version = _package["default"].workersVersion;
|
|
17
|
-
var DEFAULT_BASE_PATH =
|
|
17
|
+
var DEFAULT_BASE_PATH = "".concat(window.location.origin, "/workers");
|
|
18
18
|
var WORKER_PATH = {
|
|
19
19
|
APPEND: "lunatic-append-worker-".concat(version, ".js"),
|
|
20
20
|
SEARCH: "lunatic-search-worker-".concat(version, ".js"),
|
package/package.json
CHANGED
|
@@ -3,7 +3,15 @@ const path = require('path');
|
|
|
3
3
|
|
|
4
4
|
const version = lunaticPackageJson.workersVersion;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* process.argv return an array, for example, for this command "node ./my-script.js hello"
|
|
8
|
+
* process.argv = ["node", "./my-script.js", "hello"], process.argv[2] = "hello" (or undefined if no argument)
|
|
9
|
+
*/
|
|
10
|
+
const getPublicFolder = () => process.argv[2] || 'public';
|
|
11
|
+
|
|
12
|
+
const currentPublicFolder = path.resolve(
|
|
13
|
+
`${process.cwd()}/${getPublicFolder()}/workers`
|
|
14
|
+
);
|
|
7
15
|
const workersReleaseFolder = path.resolve(__dirname, '../../workers-release');
|
|
8
16
|
|
|
9
17
|
const workersPath = {
|