@inseefr/lunatic 2.4.2-beta → 2.4.2
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/lunatic-component-with-label.js +5 -6
- package/lib/components/component-set/html/component-set-component-container.js +20 -0
- package/lib/components/component-set/html/component-set-components.js +59 -0
- package/lib/components/component-set/html/component-set.js +32 -0
- package/lib/components/component-set/html/legend/index.js +13 -0
- package/lib/components/component-set/html/legend/legend.js +31 -0
- package/lib/components/component-set/index.js +20 -0
- package/lib/components/component-set/lunatic-component-set.js +69 -0
- package/lib/components/components.js +9 -1
- package/lib/components/declarations/declarations.scss +8 -2
- package/lib/components/input/html/input.scss +1 -1
- package/lib/components/radio/html/radio-group-content.js +4 -2
- package/lib/components/radio/html/radio-group-content.spec.js +14 -0
- package/lib/components/radio/html/radio-group.js +8 -4
- package/lib/components/radio/html/radio-option.js +14 -10
- package/lib/components/radio/lunatic-radio-group.js +6 -3
- package/lib/components/radio/radio-group.js +5 -2
- package/lib/components/suggester/html/suggester.js +2 -1
- package/lib/i18n/dictionary.js +4 -0
- package/lib/src/i18n/dictionary.d.ts +4 -0
- package/lib/src/i18n/index.d.ts +1 -1
- package/lib/src/use-lunatic/commons/execute-expression/create-refresh-calculated.d.ts +2 -2
- package/lib/src/use-lunatic/commons/execute-expression/create-refresh-calculated.spec.d.ts +1 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +1 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +39 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +30 -0
- package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
- package/lib/src/use-lunatic/reducer/commons/is-loop-component.d.ts +2 -2
- package/lib/src/use-lunatic/reducer/resolve-component-controls/index.d.ts +1 -0
- package/lib/src/use-lunatic/reducer/resolve-component-controls/resolve-roundabout-control.d.ts +10 -0
- package/lib/src/use-lunatic/reducer/resolve-component-controls/resolve-simple-control.d.ts +3 -0
- package/lib/src/use-lunatic/replace-component-sequence.d.ts +9 -0
- package/lib/src/use-lunatic/type-source.d.ts +14 -3
- package/lib/src/use-lunatic/use-lunatic.d.ts +1 -1
- package/lib/src/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.d.ts +2 -0
- package/lib/src/utils/suggester-workers/searching/compute-score.d.ts +3 -0
- package/lib/src/utils/suggester-workers/searching/meloto-order.d.ts +24 -0
- package/lib/stories/Introduction.stories.mdx +4 -4
- package/lib/stories/checkboxGroup/source.json +4 -5
- package/lib/stories/component-set/component-set.stories.js +56 -0
- package/lib/stories/component-set/data.json +18 -0
- package/lib/stories/component-set/data1.json +18 -0
- package/lib/stories/component-set/data2.json +18 -0
- package/lib/stories/component-set/source.json +99 -0
- package/lib/stories/component-set/source1.json +287 -0
- package/lib/stories/component-set/source2.json +413 -0
- package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +1 -2
- package/lib/stories/declaration/source.json +24 -0
- package/lib/stories/loop/paginated-loop.stories.js +34 -0
- package/lib/stories/loop/source-paginated.json +126 -0
- package/lib/stories/paste-questionnaire/test.stories.js +1 -1
- package/lib/stories/questionnaires-test/controls/controls-externes.json +75 -0
- package/lib/stories/questionnaires-test/controls/controls-externes.stories.js +62 -0
- package/lib/stories/questionnaires-test/controls/controls.stories.js +1 -1
- package/lib/stories/questionnaires-test/test.stories.js +1 -1
- package/lib/stories/questionnaires2023/bySequence/source.json +5054 -0
- package/lib/stories/questionnaires2023/bySequence/ticWeb.stories.js +64 -0
- package/lib/stories/questionnaires2023/famille/famille.stories.js +64 -0
- package/lib/stories/questionnaires2023/famille/source.json +50344 -0
- package/lib/stories/questionnaires2023/simpsons/simpsons.stories.js +64 -0
- package/lib/stories/questionnaires2023/simpsons/source.json +5176 -0
- package/lib/stories/questionnaires2023/ticTel/source.json +12888 -0
- package/lib/stories/questionnaires2023/ticTel/ticWeb.stories.js +64 -0
- package/lib/stories/questionnaires2023/ticWeb/source.json +11331 -0
- package/lib/stories/questionnaires2023/ticWeb/ticWeb.stories.js +64 -0
- package/lib/stories/resizing-questionnaire/source.json +789 -0
- package/lib/stories/resizing-questionnaire/test.stories.js +84 -0
- package/lib/stories/roundabout/source.json +16 -0
- package/lib/stories/suggester/SuggesterNotification.js +26 -0
- package/lib/stories/suggester/suggester-workers.stories.js +8 -5
- package/lib/stories/suggester/suggester.stories.js +1 -0
- package/lib/use-lunatic/actions.js +4 -4
- package/lib/use-lunatic/commons/calculated-variables.js +1 -1
- package/lib/use-lunatic/commons/compile-controls.js +4 -3
- package/lib/use-lunatic/commons/execute-expression/create-execute-expression.spec.js +155 -0
- package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +3 -2
- package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.spec.js +128 -0
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +4 -1
- package/lib/use-lunatic/reducer/reduce-on-init.js +1 -2
- package/lib/use-lunatic/reducer/resolve-component-controls/index.js +12 -0
- package/lib/use-lunatic/reducer/{validate-controls/validation-utils.js → resolve-component-controls/resolve-component-control.js} +10 -34
- package/lib/use-lunatic/reducer/resolve-component-controls/resolve-roundabout-control.js +54 -0
- package/lib/use-lunatic/reducer/resolve-component-controls/resolve-simple-control.js +44 -0
- package/lib/use-lunatic/replace-component-sequence.js +28 -0
- package/lib/use-lunatic/type-source.js +15 -9
- package/lib/use-lunatic/use-lunatic.js +1 -1
- package/lib/use-lunatic/use-suggesters.js +5 -5
- package/lib/utils/suggester-workers/append-to-index/create-append-task.js +4 -2
- package/lib/utils/suggester-workers/append-to-index/dist/create-append-task.js +4 -2
- package/lib/utils/suggester-workers/commons-tokenizer/get-stemmer.spec.js +11 -0
- package/lib/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.spec.js +10 -0
- package/lib/utils/suggester-workers/searching/compute-score.js +7 -12
- package/lib/utils/suggester-workers/searching/meloto-order.js +53 -0
- package/lib/utils/suggester-workers/searching/meloto-order.spec.js +67 -0
- package/lib/utils/suggester-workers/searching/searching.js +3 -3
- package/lib/utils/suggester-workers/searching/searching.worker.js +4 -2
- package/package.json +1 -1
- /package/lib/src/use-lunatic/reducer/{validate-controls/validation-utils.d.ts → resolve-component-controls/resolve-component-control.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LunaticState } from '../type';
|
|
2
2
|
import { LunaticComponentProps } from './fill-components/fill-components';
|
|
3
|
-
declare function useComponentsFromState(state: LunaticState): LunaticComponentProps<"CheckboxGroup" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Roundabout">[];
|
|
3
|
+
declare function useComponentsFromState(state: LunaticState): LunaticComponentProps<"CheckboxGroup" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "ComponentSet" | "Roundabout">[];
|
|
4
4
|
export default useComponentsFromState;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { LunaticComponentDefinition } from '../../type';
|
|
2
2
|
export declare const isLoopComponent: (component: LunaticComponentDefinition) => component is (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentRosterForLoopType & {
|
|
3
|
-
componentType: "CheckboxGroup" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Roundabout";
|
|
3
|
+
componentType: "CheckboxGroup" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "ComponentSet" | "Roundabout";
|
|
4
4
|
errors?: Record<string, import("../../type").LunaticError[]> | undefined;
|
|
5
5
|
} & {
|
|
6
6
|
componentType: 'Loop' | 'RosterForLoop';
|
|
7
7
|
}) | (import("../../type-source").ComponentTypeBase & import("../../type-source").ComponentLoopType & {
|
|
8
|
-
componentType: "CheckboxGroup" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Roundabout";
|
|
8
|
+
componentType: "CheckboxGroup" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "ComponentSet" | "Roundabout";
|
|
9
9
|
errors?: Record<string, import("../../type").LunaticError[]> | undefined;
|
|
10
10
|
} & {
|
|
11
11
|
componentType: 'Loop' | 'RosterForLoop';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { resolveComponentControls } from './resolve-component-control';
|
package/lib/src/use-lunatic/reducer/resolve-component-controls/resolve-roundabout-control.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StateForControls } from '../../commons/compile-controls';
|
|
2
|
+
import { LunaticControl, LunaticError } from '../../type';
|
|
3
|
+
/**
|
|
4
|
+
* Pour le Roundabout, le controle doit être validé pour chaque itération
|
|
5
|
+
* composants l'unité enquêtée.
|
|
6
|
+
* Itération prend pour valeur le rang de l'unité stat au sein de l'unité enquêté.
|
|
7
|
+
* Le rondpoint ne peut pas être placé dans une boucle car l'itération est effacée.
|
|
8
|
+
* TODO intégrer cela dans le cadre de boucle de bloucle.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveRoundaboutControl(state: StateForControls, control: LunaticControl): LunaticError | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LunaticComponentDefinition } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* Pour le ComponentSet : les composants du fieldset n'existe pas dans pages.
|
|
4
|
+
* Ils échappent donc aux controls. On les substitue ici au ComponentSet.
|
|
5
|
+
* On ne peut pas les ajouter directement dans pages (en spécifiant un page), car ils s'afficheraient 2 fois : dans le fieldset et en dessus, comme
|
|
6
|
+
* des composant à part entière.
|
|
7
|
+
* D'autres composant pourraient un jour figurer ici.
|
|
8
|
+
*/
|
|
9
|
+
export declare function replaceComponentSequence(components: Array<LunaticComponentDefinition>): LunaticComponentDefinition<"CheckboxGroup" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "ComponentSet" | "Roundabout">[];
|
|
@@ -7,7 +7,7 @@ export type LabelType = {
|
|
|
7
7
|
value: string;
|
|
8
8
|
type: 'VTL' | 'VTL|MD';
|
|
9
9
|
};
|
|
10
|
-
export type ComponentTypeEnum = 'Sequence' | 'Subsequence' | 'RosterForLoop' | 'Loop' | 'Table' | 'Input' | 'InputNumber' | 'Datepicker' | 'CheckboxGroup' | 'CheckboxOne' | 'CheckboxBoolean' | 'Radio' | 'Dropdown' | 'Textarea' | 'FilterDescription' | 'PairwiseLinks' | 'Suggester';
|
|
10
|
+
export type ComponentTypeEnum = 'Sequence' | 'Subsequence' | 'RosterForLoop' | 'Loop' | 'Table' | 'Input' | 'InputNumber' | 'Datepicker' | 'CheckboxGroup' | 'CheckboxOne' | 'CheckboxBoolean' | 'Radio' | 'Dropdown' | 'Textarea' | 'FilterDescription' | 'PairwiseLinks' | 'Suggester' | 'ComponentSet';
|
|
11
11
|
export type ValuesType<T = unknown> = {
|
|
12
12
|
PREVIOUS: T | null;
|
|
13
13
|
COLLECTED: T | null;
|
|
@@ -40,6 +40,10 @@ export declare enum TypeOfControl {
|
|
|
40
40
|
FORMAT = "FORMAT",
|
|
41
41
|
CONSISTENCY = "CONSISTENCY"
|
|
42
42
|
}
|
|
43
|
+
export declare enum ControlTypeEnum {
|
|
44
|
+
roundabout = "roundabout",
|
|
45
|
+
simple = "simple"
|
|
46
|
+
}
|
|
43
47
|
export type ControlType = {
|
|
44
48
|
id: string;
|
|
45
49
|
criticality: Criticality;
|
|
@@ -47,6 +51,8 @@ export type ControlType = {
|
|
|
47
51
|
control: LabelType;
|
|
48
52
|
errorMessage: LabelType;
|
|
49
53
|
bindingDependencies: string[];
|
|
54
|
+
type: ControlTypeEnum;
|
|
55
|
+
iterations?: number;
|
|
50
56
|
};
|
|
51
57
|
export type ResponseType = {
|
|
52
58
|
name: string;
|
|
@@ -75,7 +81,7 @@ export type ComponentTypeBase = {
|
|
|
75
81
|
};
|
|
76
82
|
export type ComponentType = (ComponentTypeBase & ComponentSequenceType) | (ComponentTypeBase & ComponentSubSequenceType) | (ComponentTypeBase & ComponentRosterForLoopType) | (ComponentTypeBase & ComponentLoopType) | (ComponentTypeBase & ComponentTableType) | (ComponentTypeBase & ComponentNumberType) | (ComponentTypeBase & ComponentDatePickerType) | (ComponentTypeBase & ComponentCheckboxGroupType) | (ComponentTypeBase & ComponentCheckboxBooleanType) | (ComponentTypeBase & ComponentRadioType) | (ComponentTypeBase & ComponentFilterDescriptionType) | (ComponentTypeBase & ComponentDropdownType) | (ComponentTypeBase & ComponentPairWiseLinksType) | (ComponentTypeBase & ComponentRoundaboutType) | (ComponentTypeBase & {
|
|
77
83
|
componentType: 'Input' | 'CheckboxOne' | 'Textarea';
|
|
78
|
-
});
|
|
84
|
+
}) | (ComponentTypeBase & ComponentComponentSet);
|
|
79
85
|
export type ComponentSequenceType = {
|
|
80
86
|
componentType: 'Sequence';
|
|
81
87
|
};
|
|
@@ -205,6 +211,10 @@ export type ComponentPairWiseLinksType = {
|
|
|
205
211
|
[variableName: string]: Record<string, string>;
|
|
206
212
|
};
|
|
207
213
|
};
|
|
214
|
+
export type ComponentComponentSet = {
|
|
215
|
+
componentType: 'ComponentSet';
|
|
216
|
+
components: ComponentType[];
|
|
217
|
+
};
|
|
208
218
|
export type SuggesterType = {
|
|
209
219
|
name: string;
|
|
210
220
|
fields: {
|
|
@@ -234,6 +244,7 @@ export type SuggesterType = {
|
|
|
234
244
|
};
|
|
235
245
|
url?: string;
|
|
236
246
|
version: number;
|
|
247
|
+
meloto?: boolean;
|
|
237
248
|
};
|
|
238
249
|
export type Variable = {
|
|
239
250
|
variableType: 'EXTERNAL';
|
|
@@ -249,7 +260,7 @@ export type Variable = {
|
|
|
249
260
|
expression: LabelType;
|
|
250
261
|
bindingDependencies: string[];
|
|
251
262
|
inFilter: string;
|
|
252
|
-
shapeFrom
|
|
263
|
+
shapeFrom?: string;
|
|
253
264
|
};
|
|
254
265
|
export type LunaticSource = {
|
|
255
266
|
id: string;
|
|
@@ -24,7 +24,7 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
24
24
|
dontKnowButton?: string;
|
|
25
25
|
refusedButton?: string;
|
|
26
26
|
}): {
|
|
27
|
-
getComponents: () => import("./commons/fill-components/fill-components").LunaticComponentProps<"CheckboxGroup" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "Roundabout">[];
|
|
27
|
+
getComponents: () => import("./commons/fill-components/fill-components").LunaticComponentProps<"CheckboxGroup" | "Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "Input" | "InputNumber" | "Datepicker" | "CheckboxOne" | "CheckboxBoolean" | "Radio" | "Dropdown" | "Textarea" | "FilterDescription" | "PairwiseLinks" | "ComponentSet" | "Roundabout">[];
|
|
28
28
|
goPreviousPage: () => void;
|
|
29
29
|
goNextPage: (payload?: {}) => void;
|
|
30
30
|
goToPage: (payload?: {}) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type Entity = Record<string, unknown> & {
|
|
2
|
+
id: string | number;
|
|
3
|
+
suggestion: {
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
tokensSearch: {};
|
|
7
|
+
};
|
|
8
|
+
export type Entities = Array<Entity>;
|
|
9
|
+
export declare function value(entity: Entity, tokens?: Array<string>): number;
|
|
10
|
+
/**
|
|
11
|
+
* Applique une fonction de score supplémentaire pour approcher au mieux
|
|
12
|
+
* la classification obtenue avec l'outil Meloto, developpé par un prestataire
|
|
13
|
+
* pour le compte de l'Insee.
|
|
14
|
+
* Le nouveau classement favorise l'ordre d'apparation des token de recherche
|
|
15
|
+
* dans la chaine label des entités indéxées. Si la recherche contient électricien,
|
|
16
|
+
* la suggestion avec un label électricien sera mieux classée que celle avec chef électricien.
|
|
17
|
+
* S'il y a plusieur tokens de recherche, un poid dégréssif leur est appliqué lors du tri.
|
|
18
|
+
*
|
|
19
|
+
* @param {*} entities
|
|
20
|
+
* @param {*} tokens
|
|
21
|
+
* @param {*} active
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare function melotoOrder(entities: Entities, tokens: Array<string>, active?: boolean): Entities;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Meta } from '@storybook/addon-docs';
|
|
2
2
|
import Lunatic from '../../docs/img/lunatic-logo.png';
|
|
3
|
+
import { version } from '../../package.json';
|
|
3
4
|
|
|
4
5
|
<Meta title="Introduction" />
|
|
5
6
|
|
|
@@ -107,8 +108,7 @@ import Lunatic from '../../docs/img/lunatic-logo.png';
|
|
|
107
108
|
`}
|
|
108
109
|
</style>
|
|
109
110
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
<p>
|
|
111
|
+
<>
|
|
112
|
+
<h1>Welcome to Lunatic storybook version: {version} </h1>
|
|
113
113
|
<img src={Lunatic} alt="Lunatic logo" />
|
|
114
|
-
|
|
114
|
+
</>
|
|
@@ -28,13 +28,12 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"missingResponse": { "name": "SITUMATRI_MISSING" },
|
|
31
|
-
"bindingDependencies": ["NATIO1N1", "NATIO1N2", "NATIO1N3", "NATIO1N4"],
|
|
32
31
|
"responses": [
|
|
33
32
|
{
|
|
34
33
|
"id": "kmort6x9-QOP-kmosa98y",
|
|
35
34
|
"label": {
|
|
36
35
|
"value": "Française de naissance ou par réintégration",
|
|
37
|
-
"type": "VTL
|
|
36
|
+
"type": "VTL"
|
|
38
37
|
},
|
|
39
38
|
"response": { "name": "NATIO1N1" }
|
|
40
39
|
},
|
|
@@ -43,14 +42,14 @@
|
|
|
43
42
|
"id": "kmort6x9-QOP-kmos360k",
|
|
44
43
|
"label": {
|
|
45
44
|
"value": "\"Française par déclaration, naturalisation, option à la majorité\"",
|
|
46
|
-
"type": "VTL
|
|
45
|
+
"type": "VTL"
|
|
47
46
|
},
|
|
48
47
|
"response": { "name": "NATIO1N2" }
|
|
49
48
|
},
|
|
50
49
|
|
|
51
50
|
{
|
|
52
51
|
"id": "kmort6x9-QOP-kmos37e1",
|
|
53
|
-
"label": { "value": "Étrangère", "type": "VTL
|
|
52
|
+
"label": { "value": "Étrangère", "type": "VTL" },
|
|
54
53
|
"response": { "name": "NATIO1N3" }
|
|
55
54
|
},
|
|
56
55
|
|
|
@@ -58,7 +57,7 @@
|
|
|
58
57
|
"id": "kmort6x9-QOP-kmorue9c",
|
|
59
58
|
"label": {
|
|
60
59
|
"value": "Apatride (pas de nationalité)",
|
|
61
|
-
"type": "VTL
|
|
60
|
+
"type": "VTL"
|
|
62
61
|
},
|
|
63
62
|
"response": { "name": "NATIO1N4" }
|
|
64
63
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.InRoundabout = exports.InLoop = exports.Default = void 0;
|
|
7
|
+
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
8
|
+
var _source = _interopRequireDefault(require("./source"));
|
|
9
|
+
var _data = _interopRequireDefault(require("./data"));
|
|
10
|
+
var _source2 = _interopRequireDefault(require("./source1"));
|
|
11
|
+
var _data2 = _interopRequireDefault(require("./data1"));
|
|
12
|
+
var _source3 = _interopRequireDefault(require("./source2"));
|
|
13
|
+
var _data3 = _interopRequireDefault(require("./data2"));
|
|
14
|
+
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
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); }
|
|
23
|
+
var stories = {
|
|
24
|
+
title: 'Components/ComponentSet',
|
|
25
|
+
component: _orchestrator["default"],
|
|
26
|
+
argTypes: _defaultArgTypes["default"]
|
|
27
|
+
};
|
|
28
|
+
var _default = stories;
|
|
29
|
+
exports["default"] = _default;
|
|
30
|
+
var Template = function Template(args) {
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_orchestrator["default"], _objectSpread({}, args));
|
|
32
|
+
};
|
|
33
|
+
var Default = Template.bind({});
|
|
34
|
+
exports.Default = Default;
|
|
35
|
+
Default.args = {
|
|
36
|
+
id: 'component-set',
|
|
37
|
+
source: _source["default"],
|
|
38
|
+
pagination: true,
|
|
39
|
+
data: _data["default"]
|
|
40
|
+
};
|
|
41
|
+
var InRoundabout = Template.bind({});
|
|
42
|
+
exports.InRoundabout = InRoundabout;
|
|
43
|
+
InRoundabout.args = {
|
|
44
|
+
id: 'component-set-roundabout',
|
|
45
|
+
source: _source3["default"],
|
|
46
|
+
pagination: true,
|
|
47
|
+
data: _data3["default"]
|
|
48
|
+
};
|
|
49
|
+
var InLoop = Template.bind({});
|
|
50
|
+
exports.InLoop = InLoop;
|
|
51
|
+
InLoop.args = {
|
|
52
|
+
id: 'component-set-loop',
|
|
53
|
+
source: _source2["default"],
|
|
54
|
+
pagination: true,
|
|
55
|
+
data: _data2["default"]
|
|
56
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"COLLECTED": {
|
|
3
|
+
"PRENOMS": {
|
|
4
|
+
"EDITED": null,
|
|
5
|
+
"FORCED": null,
|
|
6
|
+
"INPUTED": null,
|
|
7
|
+
"PREVIOUS": null,
|
|
8
|
+
"COLLECTED": "Fanny"
|
|
9
|
+
},
|
|
10
|
+
"AGE": {
|
|
11
|
+
"EDITED": null,
|
|
12
|
+
"FORCED": null,
|
|
13
|
+
"INPUTED": null,
|
|
14
|
+
"PREVIOUS": null,
|
|
15
|
+
"COLLECTED": 15
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"COLLECTED": {
|
|
3
|
+
"PRENOMS": {
|
|
4
|
+
"EDITED": [null],
|
|
5
|
+
"FORCED": [null],
|
|
6
|
+
"INPUTED": [null],
|
|
7
|
+
"PREVIOUS": [null],
|
|
8
|
+
"COLLECTED": ["Fanny", "Renaud"]
|
|
9
|
+
},
|
|
10
|
+
"AGE": {
|
|
11
|
+
"EDITED": [null],
|
|
12
|
+
"FORCED": [null],
|
|
13
|
+
"INPUTED": [null],
|
|
14
|
+
"PREVIOUS": [null],
|
|
15
|
+
"COLLECTED": [15, 4]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"COLLECTED": {
|
|
3
|
+
"PRENOM": {
|
|
4
|
+
"EDITED": [null],
|
|
5
|
+
"FORCED": [null],
|
|
6
|
+
"INPUTED": [null],
|
|
7
|
+
"PREVIOUS": [null],
|
|
8
|
+
"COLLECTED": ["Fanny", "Renaud"]
|
|
9
|
+
},
|
|
10
|
+
"AGELOOP": {
|
|
11
|
+
"EDITED": [null],
|
|
12
|
+
"FORCED": [null],
|
|
13
|
+
"INPUTED": [null],
|
|
14
|
+
"PREVIOUS": [null],
|
|
15
|
+
"COLLECTED": [15, 4]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"maxPage": "5",
|
|
3
|
+
"components": [
|
|
4
|
+
{
|
|
5
|
+
"id": "component-set",
|
|
6
|
+
"componentType": "ComponentSet",
|
|
7
|
+
"page": "1",
|
|
8
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
9
|
+
"label": {
|
|
10
|
+
"value": "\"## Who are you?\"",
|
|
11
|
+
"type": "VTL|MD"
|
|
12
|
+
},
|
|
13
|
+
"description": {
|
|
14
|
+
"value": "\"This is your opportunity to tell me about yourself!\"",
|
|
15
|
+
"type": "VTL|MD"
|
|
16
|
+
},
|
|
17
|
+
"components": [
|
|
18
|
+
{
|
|
19
|
+
"id": "prenom",
|
|
20
|
+
"componentType": "Input",
|
|
21
|
+
"mandatory": false,
|
|
22
|
+
"maxLength": 20,
|
|
23
|
+
"label": {
|
|
24
|
+
"value": "\"Prénom\"))",
|
|
25
|
+
"type": "VTL|MD"
|
|
26
|
+
},
|
|
27
|
+
"conditionFilter": {
|
|
28
|
+
"value": "true",
|
|
29
|
+
"type": "VTL"
|
|
30
|
+
},
|
|
31
|
+
"response": { "name": "PRENOMS" },
|
|
32
|
+
"controls": [
|
|
33
|
+
{
|
|
34
|
+
"criticality": "WARN",
|
|
35
|
+
"errorMessage": {
|
|
36
|
+
"type": "VTL",
|
|
37
|
+
"value": "\"booleen pas coché et on affiche un message un peu long histoire de tester le truc \""
|
|
38
|
+
},
|
|
39
|
+
"typeOfControl": "CONSISTENCY",
|
|
40
|
+
"control": {
|
|
41
|
+
"type": "VTL",
|
|
42
|
+
"value": "false"
|
|
43
|
+
},
|
|
44
|
+
"id": "kfxmjupm-CI-0"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "age",
|
|
50
|
+
"componentType": "InputNumber",
|
|
51
|
+
"maxLength": 3,
|
|
52
|
+
"label": {
|
|
53
|
+
"value": "\"Age\"))",
|
|
54
|
+
"type": "VTL|MD"
|
|
55
|
+
},
|
|
56
|
+
"conditionFilter": {
|
|
57
|
+
"value": "true",
|
|
58
|
+
"type": "VTL"
|
|
59
|
+
},
|
|
60
|
+
"response": { "name": "AGE" }
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "seq",
|
|
66
|
+
"componentType": "Sequence",
|
|
67
|
+
"label": {
|
|
68
|
+
"value": "\"Merci !\"",
|
|
69
|
+
"type": "VTL|MD"
|
|
70
|
+
},
|
|
71
|
+
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
72
|
+
"page": "2"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"variables": [
|
|
76
|
+
{
|
|
77
|
+
"variableType": "COLLECTED",
|
|
78
|
+
"name": "AGE",
|
|
79
|
+
"values": {
|
|
80
|
+
"PREVIOUS": null,
|
|
81
|
+
"COLLECTED": null,
|
|
82
|
+
"FORCED": null,
|
|
83
|
+
"EDITED": null,
|
|
84
|
+
"INPUTED": null
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"variableType": "COLLECTED",
|
|
89
|
+
"name": "PRENOMS",
|
|
90
|
+
"values": {
|
|
91
|
+
"PREVIOUS": null,
|
|
92
|
+
"COLLECTED": null,
|
|
93
|
+
"FORCED": null,
|
|
94
|
+
"EDITED": null,
|
|
95
|
+
"INPUTED": null
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|