@inseefr/lunatic 3.0.0-rc.1 → 3.0.0-rc.11
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/CheckboxBoolean/CheckboxBoolean.js +39 -19
- package/lib/components/CheckboxGroup/CheckboxGroup.js +3 -2
- package/lib/components/CheckboxGroup/CustomCheckboxGroup.js +4 -5
- package/lib/components/CheckboxGroup/CustomCheckboxGroup.spec.js +3 -0
- package/lib/components/CheckboxOne/CheckboxOne.js +6 -7
- package/lib/components/Datepicker/Datepicker.js +43 -29
- package/lib/components/Dropdown/Dropdown.js +37 -37
- package/lib/components/Duration/Duration.js +41 -17
- package/lib/components/FilterDescription/FilterDescription.js +2 -3
- package/lib/components/Input/Input.js +39 -22
- package/lib/components/InputNumber/InputNumber.js +45 -35
- package/lib/components/InputNumber/__snapshots__/InputNumber.spec.tsx.snap +0 -2
- package/lib/components/Loop/Loop.js +52 -29
- package/lib/components/LunaticComponents.js +60 -51
- package/lib/components/Question/Question.js +23 -14
- package/lib/components/Radio/Radio.js +2 -2
- package/lib/components/RosterForLoop/RosterForLoop.js +13 -36
- package/lib/components/Roundabout/CustomRoundabout.js +2 -2
- package/lib/components/Roundabout/Roundabout.js +0 -1
- package/lib/components/Roundabout/RoundaboutItButton.js +2 -2
- package/lib/components/Roundabout/extra.js +6 -6
- package/lib/components/Sequence/Sequence.js +2 -3
- package/lib/components/Subsequence/Subsequence.js +2 -2
- package/lib/components/Subsequence/Subsequence.spec.js +1 -1
- package/lib/components/Suggester/CustomSuggester.js +9 -6
- package/lib/components/Suggester/Suggester.js +67 -4
- package/lib/components/Suggester/SuggesterNotification.js +2 -2
- package/lib/components/Summary/Summary.js +3 -3
- package/lib/components/Switch/Switch.js +42 -22
- package/lib/components/Textarea/Textarea.js +43 -24
- package/lib/components/library.js +0 -2
- package/lib/components/shared/Button/Button.js +2 -3
- package/lib/components/shared/Button/IconButton.js +0 -1
- package/lib/components/shared/Checkbox/CheckboxOption.js +2 -3
- package/lib/components/shared/Combobox/Combobox.js +5 -4
- package/lib/components/shared/Combobox/ComboboxContainer.js +2 -2
- package/lib/components/shared/Combobox/ComboboxContentBox.js +2 -2
- package/lib/components/shared/Combobox/Panel/ComboboxOption.js +2 -2
- package/lib/components/shared/Combobox/Panel/ComboboxPanelContainer.js +2 -2
- package/lib/components/shared/Combobox/Selection/ComboboxClearButton.js +2 -2
- package/lib/components/shared/Combobox/Selection/ComboboxInput.js +2 -2
- package/lib/components/shared/Combobox/Selection/ComboboxLabelSelection.js +2 -2
- package/lib/components/shared/ComponentErrors/ComponentErrors.js +0 -1
- package/lib/components/shared/Declarations/Declarations.js +6 -7
- package/lib/components/shared/Declarations/Declarations.spec.js +5 -5
- package/lib/components/shared/Fieldset/Fieldset.js +2 -3
- package/lib/components/shared/HOC/{customizedComponent.js → slottableComponent.js} +35 -13
- package/lib/components/shared/Icons/lunatic-icon.js +0 -1
- package/lib/components/shared/Label/Label.js +2 -3
- package/lib/components/shared/MDLabel/RouterLink.js +2 -2
- package/lib/components/shared/Missing/Missing.js +0 -1
- package/lib/components/shared/ModalControls/ModalControls.js +0 -1
- package/lib/components/shared/Notification.js +2 -2
- package/lib/components/shared/Radio/RadioGroup.js +4 -4
- package/lib/components/shared/Radio/RadioOption.js +2 -2
- package/lib/components/shared/Table/Table.js +2 -3
- package/lib/components/shared/Table/Tbody.js +2 -2
- package/lib/components/shared/Table/Td.js +2 -2
- package/lib/components/shared/Table/Th.js +2 -2
- package/lib/components/shared/Table/Thead.js +2 -2
- package/lib/components/shared/Table/Tr.js +2 -2
- package/lib/components/shared/VariableStatus/VariableStatus.js +0 -1
- package/lib/components/shared/suggester-loader-widget/dragger/dragger.js +0 -1
- package/lib/components/shared/suggester-loader-widget/widget.js +0 -1
- package/lib/css/components/Button.scss +24 -0
- package/lib/css/components/CheckboxGroup.scss +13 -0
- package/lib/css/components/CheckboxOne.scss +19 -0
- package/lib/css/components/CheckboxOption.scss +19 -0
- package/lib/css/components/Combobox.scss +206 -0
- package/lib/css/components/ComponentErrors.scss +5 -0
- package/lib/css/components/Datepicker.scss +19 -0
- package/lib/css/components/Declarations.scss +42 -0
- package/lib/css/components/Dragger.scss +8 -0
- package/lib/css/components/Dropdown.scss +38 -0
- package/lib/css/components/Duration.scss +9 -0
- package/lib/css/components/Fieldset.scss +5 -0
- package/lib/css/components/IconButton.scss +38 -0
- package/lib/css/components/Input.scss +42 -0
- package/lib/css/components/InputNumber.scss +11 -0
- package/lib/css/components/Label.scss +6 -0
- package/lib/css/components/Missing.scss +27 -0
- package/lib/css/components/ModalControls.scss +48 -0
- package/lib/css/components/RadioGroup.scss +21 -0
- package/lib/css/components/RosterForLoop.scss +39 -0
- package/lib/css/components/Roundabout.scss +13 -0
- package/lib/css/components/Sequence.scss +10 -0
- package/lib/css/components/Suggester.scss +170 -0
- package/lib/css/components/SuggesterWidget.scss +176 -0
- package/lib/css/components/Table.scss +27 -0
- package/lib/css/components/Textarea.scss +8 -0
- package/lib/css/components/VariableStatus.scss +36 -0
- package/lib/css/main.scss +181 -0
- package/lib/hooks/useSuggesterInfo.js +14 -12
- package/lib/main.css +1063 -0
- package/lib/main.css.map +1 -0
- package/lib/src/components/CheckboxBoolean/CheckboxBoolean.d.ts +10 -5
- package/lib/src/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/lib/src/components/CheckboxOne/CheckboxOne.d.ts +5 -12
- package/lib/src/components/Datepicker/Datepicker.d.ts +8 -10
- package/lib/src/components/Dropdown/Dropdown.d.ts +9 -12
- package/lib/src/components/Duration/Duration.d.ts +9 -7
- package/lib/src/components/FilterDescription/FilterDescription.d.ts +1 -1
- package/lib/src/components/Input/Input.d.ts +9 -8
- package/lib/src/components/InputNumber/InputNumber.d.ts +9 -10
- package/lib/src/components/Loop/Loop.d.ts +11 -18
- package/lib/src/components/LunaticComponents.d.ts +4 -2
- package/lib/src/components/Question/Question.d.ts +6 -4
- package/lib/src/components/RosterForLoop/RosterForLoop.d.ts +2 -22
- package/lib/src/components/Roundabout/Roundabout.d.ts +0 -1
- package/lib/src/components/Sequence/Sequence.d.ts +1 -2
- package/lib/src/components/Subsequence/Subsequence.d.ts +1 -1
- package/lib/src/components/Suggester/CustomSuggester.d.ts +7 -3
- package/lib/src/components/Suggester/Suggester.d.ts +1 -2
- package/lib/src/components/Suggester/SuggesterType.d.ts +6 -0
- package/lib/src/components/Suggester/helpers.d.ts +2 -2
- package/lib/src/components/Switch/Switch.d.ts +9 -0
- package/lib/src/components/Textarea/Textarea.d.ts +9 -10
- package/lib/src/components/library.d.ts +26 -93
- package/lib/src/components/shared/Button/Button.d.ts +0 -1
- package/lib/src/components/shared/Button/IconButton.d.ts +0 -1
- package/lib/src/components/shared/Checkbox/CheckboxOption.d.ts +0 -1
- package/lib/src/components/shared/Combobox/Combobox.d.ts +1 -1
- package/lib/src/components/shared/ComponentErrors/ComponentErrors.d.ts +0 -1
- package/lib/src/components/shared/Declarations/Declarations.d.ts +2 -3
- package/lib/src/components/shared/Fieldset/Fieldset.d.ts +0 -1
- package/lib/src/components/shared/HOC/slottableComponent.d.ts +105 -0
- package/lib/src/components/shared/Icons/lunatic-icon.d.ts +0 -1
- package/lib/src/components/shared/Label/Label.d.ts +0 -1
- package/lib/src/components/shared/Missing/Missing.d.ts +0 -1
- package/lib/src/components/shared/ModalControls/ModalControls.d.ts +0 -1
- package/lib/src/components/shared/Radio/RadioGroup.d.ts +1 -1
- package/lib/src/components/shared/Table/Table.d.ts +0 -1
- package/lib/src/components/shared/VariableStatus/VariableStatus.d.ts +0 -1
- package/lib/src/components/shared/suggester-loader-widget/dragger/dragger.d.ts +0 -1
- package/lib/src/components/shared/suggester-loader-widget/widget.d.ts +0 -1
- package/lib/src/components/type.d.ts +7 -7
- package/lib/src/hooks/use-track-changes.d.ts +9 -1
- package/lib/src/hooks/useSuggesterInfo.d.ts +1 -1
- package/lib/src/index.d.ts +1 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +106 -59
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +87 -58
- package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +47 -38
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +159 -87
- package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
- package/lib/src/use-lunatic/lunatic-context.d.ts +1 -4
- package/lib/src/use-lunatic/replace-component-sequence.d.ts +23 -5
- package/lib/src/use-lunatic/type-source.d.ts +55 -46
- package/lib/src/use-lunatic/type.d.ts +4 -4
- package/lib/src/use-lunatic/use-lunatic.d.ts +63 -32
- package/lib/src/utils/variables.d.ts +10 -2
- package/lib/stories/{component-set/component-set.stories.js → behaviour/slots.stories.js} +36 -25
- package/lib/stories/checkbox-group/checkbox-group.stories.js +1 -6
- package/lib/stories/disabled/source.json +1 -1
- package/lib/stories/loop/source-roster.json +2 -2
- package/lib/stories/pairwise/pairwise-links.stories.js +1 -9
- package/lib/stories/suggester/fakeReferentiel.json +12 -0
- package/lib/stories/suggester/source-option-responses.json +145 -0
- package/lib/stories/suggester/suggester.stories.js +45 -7
- package/lib/stories/utils/orchestrator.js +4 -4
- package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +0 -1
- package/lib/use-lunatic/lunatic-context.js +2 -10
- package/lib/use-lunatic/replace-component-sequence.js +2 -3
- package/lib/use-lunatic/use-lunatic.js +1 -4
- package/lib/use-lunatic/use-lunatic.test.js +12 -37
- package/lib/use-lunatic/use-suggesters.js +23 -24
- package/package.json +2 -2
- package/lib/components/ComponentSet/ComponentSet.js +0 -68
- package/lib/components/Dropdown/DropdownWritable.js +0 -58
- package/lib/components/Dropdown/renderer/WritableLabelRenderer.js +0 -38
- package/lib/components/Dropdown/renderer/WritableOptionRenderer.js +0 -140
- package/lib/src/components/ComponentSet/ComponentSet.d.ts +0 -7
- package/lib/src/components/Dropdown/DropdownWritable.d.ts +0 -17
- package/lib/src/components/Dropdown/renderer/WritableLabelRenderer.d.ts +0 -8
- package/lib/src/components/Dropdown/renderer/WritableOptionRenderer.d.ts +0 -8
- package/lib/src/components/shared/HOC/customizedComponent.d.ts +0 -5
- package/lib/src/components/type-custom.d.ts +0 -101
- package/lib/stories/checkbox-group/sourceComponentset.json +0 -424
- package/lib/stories/component-set/data-loop.json +0 -18
- package/lib/stories/component-set/data-roundabout.json +0 -25
- package/lib/stories/component-set/data.json +0 -25
- package/lib/stories/component-set/source-loop.json +0 -308
- package/lib/stories/component-set/source-roundabout.json +0 -434
- package/lib/stories/component-set/source.json +0 -113
- package/lib/stories/pairwise/source-componentset.json +0 -292
- package/lib/stories/suggester/source-component-set.json +0 -113
- /package/lib/components/{type-custom.js → Suggester/SuggesterType.js} +0 -0
|
@@ -12,12 +12,9 @@ export declare const useLunaticMissing: () => {
|
|
|
12
12
|
dontKnowButton: string;
|
|
13
13
|
refusedButton: string;
|
|
14
14
|
};
|
|
15
|
-
/** Return custom elements list to override native components */
|
|
16
|
-
export declare const useLunaticCustom: () => Record<string, FunctionComponent<unknown>>;
|
|
17
15
|
/** Provide `management` to display data states [COLLECTED,EDITED,FORCED] */
|
|
18
16
|
export declare const useLunaticManagement: () => boolean;
|
|
19
|
-
export declare function createLunaticProvider({
|
|
20
|
-
custom: Record<string, FunctionComponent<unknown>>;
|
|
17
|
+
export declare function createLunaticProvider({ management, missing, missingStrategy, shortcut, missingShortcut, dontKnowButton, refusedButton, }: {
|
|
21
18
|
management: boolean;
|
|
22
19
|
missing: boolean;
|
|
23
20
|
missingStrategy: () => void;
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import type { LunaticComponentDefinition } from './type';
|
|
2
2
|
/**
|
|
3
|
-
* Pour le
|
|
4
|
-
* Ils échappent donc aux controls. On les substitue ici au
|
|
3
|
+
* Pour le Question : les composants du fieldset n'existe pas dans pages.
|
|
4
|
+
* Ils échappent donc aux controls. On les substitue ici au Question.
|
|
5
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
6
|
* des composant à part entière.
|
|
7
7
|
* D'autres composant pourraient un jour figurer ici.
|
|
8
8
|
*/
|
|
9
|
-
export declare function replaceComponentSequence(components: Array<LunaticComponentDefinition>): ((import("./type-source").ComponentTypeBase & import("./type-source").ComponentSequenceType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentSubSequenceType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentRosterForLoopType) | (import("./type-source").ComponentTypeBase &
|
|
10
|
-
componentType: "
|
|
11
|
-
|
|
9
|
+
export declare function replaceComponentSequence(components: Array<LunaticComponentDefinition>): ((import("./type-source").ComponentTypeBase & import("./type-source").ComponentSequenceType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentSubSequenceType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentRosterForLoopType) | (import("./type-source").ComponentTypeBase & {
|
|
10
|
+
componentType: "Loop";
|
|
11
|
+
loopDependencies: string[];
|
|
12
|
+
components: import("./type-source").ComponentType[];
|
|
13
|
+
depth: number;
|
|
14
|
+
} & {
|
|
15
|
+
paginatedLoop: true;
|
|
16
|
+
maxPage: string;
|
|
17
|
+
iterations: import("./type-source").LabelType;
|
|
18
|
+
}) | (import("./type-source").ComponentTypeBase & {
|
|
19
|
+
componentType: "Loop";
|
|
20
|
+
loopDependencies: string[];
|
|
21
|
+
components: import("./type-source").ComponentType[];
|
|
22
|
+
depth: number;
|
|
23
|
+
} & {
|
|
24
|
+
paginatedLoop: false;
|
|
25
|
+
lines: {
|
|
26
|
+
min: import("./type-source").LabelType;
|
|
27
|
+
max: import("./type-source").LabelType;
|
|
28
|
+
};
|
|
29
|
+
}) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentTableType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentNumberType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentDatePickerType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentCheckboxGroupType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentCheckboxBooleanType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentRadioType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentFilterDescriptionType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentDropdownType) | (Omit<import("./type-source").ComponentTypeBase, "label"> & import("./type-source").ComponentPairWiseLinksType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentRoundaboutType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentSuggesterType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentInputOrTextareaType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentCheckboxOneType) | (import("./type-source").ComponentTypeBase & import("./type-source").ComponentQuestionType))[];
|
|
@@ -34,8 +34,8 @@ export type ControlType = {
|
|
|
34
34
|
typeOfControl: 'FORMAT' | 'CONSISTENCY';
|
|
35
35
|
control: LabelType;
|
|
36
36
|
errorMessage: LabelType;
|
|
37
|
-
bindingDependencies
|
|
38
|
-
type
|
|
37
|
+
bindingDependencies?: string[];
|
|
38
|
+
type?: 'roundabout' | 'ROW' | 'simple';
|
|
39
39
|
iterations?: number;
|
|
40
40
|
};
|
|
41
41
|
export type ResponseType = {
|
|
@@ -52,6 +52,7 @@ export type Hierarchy = {
|
|
|
52
52
|
};
|
|
53
53
|
export type ComponentTypeBase = {
|
|
54
54
|
label: LabelType;
|
|
55
|
+
description?: LabelType;
|
|
55
56
|
declarations?: DeclarationType[];
|
|
56
57
|
conditionFilter?: ConditionFilterType;
|
|
57
58
|
controls?: ControlType[];
|
|
@@ -61,9 +62,7 @@ export type ComponentTypeBase = {
|
|
|
61
62
|
mandatory?: boolean;
|
|
62
63
|
page: string;
|
|
63
64
|
};
|
|
64
|
-
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 & ComponentSuggesterType) | (ComponentTypeBase & ComponentInputOrTextareaType) | (ComponentTypeBase &
|
|
65
|
-
componentType: 'CheckboxOne';
|
|
66
|
-
}) | (ComponentTypeBase & ComponentComponentSetType) | (ComponentTypeBase & ComponentQuestionType);
|
|
65
|
+
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) | (Omit<ComponentTypeBase, 'label'> & ComponentPairWiseLinksType) | (ComponentTypeBase & ComponentRoundaboutType) | (ComponentTypeBase & ComponentSuggesterType) | (ComponentTypeBase & ComponentInputOrTextareaType) | (ComponentTypeBase & ComponentCheckboxOneType) | (ComponentTypeBase & ComponentQuestionType);
|
|
67
66
|
export type ComponentTypeEnum = ComponentType['componentType'];
|
|
68
67
|
export type ComponentInputOrTextareaType = {
|
|
69
68
|
componentType: 'Input' | 'Textarea';
|
|
@@ -73,10 +72,10 @@ export type ComponentInputOrTextareaType = {
|
|
|
73
72
|
};
|
|
74
73
|
export type ComponentSequenceType = {
|
|
75
74
|
componentType: 'Sequence';
|
|
75
|
+
gotoPage?: string;
|
|
76
76
|
};
|
|
77
77
|
export type ComponentSubSequenceType = {
|
|
78
78
|
componentType: 'Subsequence';
|
|
79
|
-
gotoPage: string;
|
|
80
79
|
};
|
|
81
80
|
export type ComponentRoundaboutType = {
|
|
82
81
|
componentType: 'Roundabout';
|
|
@@ -92,47 +91,48 @@ export type ComponentRosterForLoopType = {
|
|
|
92
91
|
min: LabelType;
|
|
93
92
|
max: LabelType;
|
|
94
93
|
};
|
|
95
|
-
header
|
|
94
|
+
header?: {
|
|
96
95
|
value: string;
|
|
97
96
|
label: LabelType | string;
|
|
98
|
-
options:
|
|
99
|
-
value: string;
|
|
100
|
-
label: LabelType;
|
|
101
|
-
}[];
|
|
97
|
+
options: Options;
|
|
102
98
|
colspan?: number;
|
|
103
99
|
rowspan?: number;
|
|
104
100
|
}[];
|
|
105
|
-
body: ({
|
|
106
|
-
label: LabelType;
|
|
107
|
-
colspan?: number;
|
|
108
|
-
rowspan?: number;
|
|
109
|
-
} | (ComponentType & {
|
|
110
|
-
colspan?: number;
|
|
111
|
-
rowspan?: number;
|
|
112
|
-
}))[][];
|
|
113
101
|
positioning: 'HORIZONTAL';
|
|
114
102
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
103
|
+
type PaginatedLoop = {
|
|
104
|
+
paginatedLoop: true;
|
|
105
|
+
maxPage: string;
|
|
106
|
+
iterations: LabelType;
|
|
107
|
+
};
|
|
108
|
+
type BlockLoop = {
|
|
109
|
+
paginatedLoop: false;
|
|
118
110
|
lines: {
|
|
119
111
|
min: LabelType;
|
|
120
112
|
max: LabelType;
|
|
121
113
|
};
|
|
114
|
+
};
|
|
115
|
+
export type ComponentLoopType = {
|
|
116
|
+
componentType: 'Loop';
|
|
117
|
+
loopDependencies: string[];
|
|
122
118
|
components: ComponentType[];
|
|
123
|
-
iterations: LabelType;
|
|
124
|
-
maxPage: string;
|
|
125
119
|
depth: number;
|
|
126
|
-
|
|
127
|
-
};
|
|
120
|
+
} & (PaginatedLoop | BlockLoop);
|
|
128
121
|
export type ComponentTableType = {
|
|
129
122
|
componentType: 'Table';
|
|
130
123
|
header: ComponentRosterForLoopType['header'];
|
|
131
|
-
body:
|
|
124
|
+
body: ({
|
|
125
|
+
label: LabelType;
|
|
126
|
+
colspan?: number;
|
|
127
|
+
rowspan?: number;
|
|
128
|
+
} | (ComponentType & {
|
|
129
|
+
colspan?: number;
|
|
130
|
+
rowspan?: number;
|
|
131
|
+
}))[][];
|
|
132
132
|
};
|
|
133
133
|
export type ComponentNumberType = {
|
|
134
134
|
componentType: 'InputNumber';
|
|
135
|
-
unit
|
|
135
|
+
unit?: string;
|
|
136
136
|
response: ResponseType;
|
|
137
137
|
min?: number;
|
|
138
138
|
max?: number;
|
|
@@ -147,8 +147,10 @@ export type ComponentDatePickerType = {
|
|
|
147
147
|
};
|
|
148
148
|
export type ComponentCheckboxGroupType = {
|
|
149
149
|
componentType: 'CheckboxGroup';
|
|
150
|
+
description?: LabelType;
|
|
150
151
|
responses: Array<{
|
|
151
152
|
label: LabelType;
|
|
153
|
+
description?: LabelType;
|
|
152
154
|
response: ResponseType;
|
|
153
155
|
id: string;
|
|
154
156
|
}>;
|
|
@@ -158,21 +160,26 @@ export type ComponentCheckboxBooleanType = {
|
|
|
158
160
|
response: ResponseType;
|
|
159
161
|
missingResponse?: ResponseType;
|
|
160
162
|
};
|
|
163
|
+
type Options = {
|
|
164
|
+
value: string;
|
|
165
|
+
label: LabelType;
|
|
166
|
+
description?: LabelType;
|
|
167
|
+
}[];
|
|
168
|
+
export type ComponentCheckboxOneType = {
|
|
169
|
+
componentType: 'CheckboxOne';
|
|
170
|
+
response: ResponseType;
|
|
171
|
+
missingResponse?: ResponseType;
|
|
172
|
+
options: Options;
|
|
173
|
+
};
|
|
161
174
|
export type ComponentRadioType = {
|
|
162
175
|
componentType: 'Radio';
|
|
163
|
-
options:
|
|
164
|
-
value: string;
|
|
165
|
-
label: LabelType;
|
|
166
|
-
}[];
|
|
176
|
+
options: Options;
|
|
167
177
|
response: ResponseType;
|
|
168
178
|
missingResponse?: ResponseType;
|
|
169
179
|
};
|
|
170
180
|
export type ComponentDropdownType = {
|
|
171
181
|
componentType: 'Dropdown';
|
|
172
|
-
options:
|
|
173
|
-
value: string;
|
|
174
|
-
label: LabelType;
|
|
175
|
-
}[];
|
|
182
|
+
options: Options;
|
|
176
183
|
response: ResponseType;
|
|
177
184
|
missingResponse?: ResponseType;
|
|
178
185
|
};
|
|
@@ -185,7 +192,7 @@ export type ComponentPairWiseLinksType = {
|
|
|
185
192
|
xAxisIterations: LabelType;
|
|
186
193
|
yAxisIterations: LabelType;
|
|
187
194
|
symLinks: {
|
|
188
|
-
[variableName: string]: Record<string, string>;
|
|
195
|
+
[variableName: string]: Record<string, string | null>;
|
|
189
196
|
};
|
|
190
197
|
components: ComponentType[];
|
|
191
198
|
};
|
|
@@ -194,28 +201,29 @@ export type ComponentQuestionType = {
|
|
|
194
201
|
components: ComponentType[];
|
|
195
202
|
description: LabelType;
|
|
196
203
|
};
|
|
197
|
-
export type ComponentComponentSetType = {
|
|
198
|
-
componentType: 'ComponentSet';
|
|
199
|
-
components: ComponentType[];
|
|
200
|
-
};
|
|
201
204
|
export type ComponentSuggesterType = {
|
|
202
205
|
componentType: 'Suggester';
|
|
203
206
|
storeName: string;
|
|
207
|
+
response: ResponseType;
|
|
208
|
+
optionResponses: {
|
|
209
|
+
name: string;
|
|
210
|
+
attribute: string;
|
|
211
|
+
}[];
|
|
204
212
|
};
|
|
205
213
|
export type SuggesterType = {
|
|
206
214
|
name: string;
|
|
207
215
|
fields: {
|
|
208
216
|
name: string;
|
|
209
217
|
min?: number;
|
|
210
|
-
rules?: string[];
|
|
218
|
+
rules?: 'soft' | string[];
|
|
211
219
|
language?: 'French' | 'English';
|
|
212
220
|
stemmer?: boolean;
|
|
213
|
-
synonyms
|
|
221
|
+
synonyms?: {
|
|
214
222
|
source: string;
|
|
215
223
|
target: string[];
|
|
216
224
|
}[];
|
|
217
225
|
}[];
|
|
218
|
-
max
|
|
226
|
+
max?: number;
|
|
219
227
|
stopWords?: string;
|
|
220
228
|
order?: {
|
|
221
229
|
field: string;
|
|
@@ -247,7 +255,7 @@ export type Variable = {
|
|
|
247
255
|
variableType: 'CALCULATED';
|
|
248
256
|
name: string;
|
|
249
257
|
expression: LabelType;
|
|
250
|
-
bindingDependencies
|
|
258
|
+
bindingDependencies?: string[];
|
|
251
259
|
inFilter: string;
|
|
252
260
|
shapeFrom?: string;
|
|
253
261
|
};
|
|
@@ -269,7 +277,7 @@ export type LunaticSource = {
|
|
|
269
277
|
[variableName: string]: string;
|
|
270
278
|
};
|
|
271
279
|
};
|
|
272
|
-
missingBlock
|
|
280
|
+
missingBlock?: {
|
|
273
281
|
[variableName: string]: string[];
|
|
274
282
|
};
|
|
275
283
|
resizing: {
|
|
@@ -293,3 +301,4 @@ export type LunaticSource = {
|
|
|
293
301
|
};
|
|
294
302
|
};
|
|
295
303
|
};
|
|
304
|
+
export {};
|
|
@@ -9,9 +9,9 @@ export type LunaticControl = ControlType;
|
|
|
9
9
|
export type VTLBindings = {
|
|
10
10
|
[variableName: string]: unknown;
|
|
11
11
|
};
|
|
12
|
-
export type LunaticData = Record<Exclude<VariableType, 'COLLECTED'>, Record<string, unknown>> & {
|
|
12
|
+
export type LunaticData = Partial<Record<Exclude<VariableType, 'COLLECTED'>, Record<string, unknown>> & {
|
|
13
13
|
COLLECTED: Record<string, LunaticCollectedValue>;
|
|
14
|
-
}
|
|
14
|
+
}>;
|
|
15
15
|
export type LunaticValues = {
|
|
16
16
|
[variableName: string]: unknown;
|
|
17
17
|
};
|
|
@@ -27,13 +27,13 @@ export type LunaticExpression = {
|
|
|
27
27
|
};
|
|
28
28
|
export type TODO = unknown;
|
|
29
29
|
export type LunaticVariable = Variable;
|
|
30
|
-
export type LunaticCollectedValue = {
|
|
30
|
+
export type LunaticCollectedValue = Partial<{
|
|
31
31
|
COLLECTED: unknown;
|
|
32
32
|
EDITED: unknown;
|
|
33
33
|
FORCED: unknown;
|
|
34
34
|
INPUTED: unknown;
|
|
35
35
|
PREVIOUS: unknown;
|
|
36
|
-
}
|
|
36
|
+
}>;
|
|
37
37
|
export type LunaticOverviewItem = {
|
|
38
38
|
id: string;
|
|
39
39
|
page: string;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { LunaticState } from './type';
|
|
3
3
|
import type { LunaticSource } from './type-source';
|
|
4
4
|
import type { LunaticComponentType } from '../components/type';
|
|
5
|
-
declare function useLunatic(source: LunaticSource, data:
|
|
5
|
+
declare function useLunatic(source: LunaticSource, data: Partial<Record<"EXTERNAL" | "CALCULATED", Record<string, unknown>> & {
|
|
6
|
+
COLLECTED: Record<string, Partial<{
|
|
7
|
+
COLLECTED: unknown;
|
|
8
|
+
EDITED: unknown;
|
|
9
|
+
FORCED: unknown;
|
|
10
|
+
INPUTED: unknown;
|
|
11
|
+
PREVIOUS: unknown;
|
|
12
|
+
}>>;
|
|
13
|
+
}> | undefined, { features, preferences, savingType, onChange, management, shortcut, initialPage, lastReachedPage, autoSuggesterLoading, activeControls, getReferentiel, withOverview, missing, missingStrategy, missingShortcut, dontKnowButton, refusedButton, workersBasePath, trackChanges, }: {
|
|
6
14
|
features?: LunaticState['features'];
|
|
7
15
|
preferences?: LunaticState['preferences'];
|
|
8
16
|
savingType?: LunaticState['savingType'];
|
|
@@ -14,7 +22,6 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
14
22
|
autoSuggesterLoading?: boolean;
|
|
15
23
|
getReferentiel?: (name: string) => Promise<Array<unknown>>;
|
|
16
24
|
activeControls?: boolean;
|
|
17
|
-
custom?: Record<string, FunctionComponent<unknown>>;
|
|
18
25
|
withOverview?: boolean;
|
|
19
26
|
missing?: boolean;
|
|
20
27
|
missingStrategy?: () => void;
|
|
@@ -51,16 +58,11 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
51
58
|
name: string;
|
|
52
59
|
};
|
|
53
60
|
};
|
|
54
|
-
Sequence: Pick<import("../components/type").LunaticBaseProps<string>, "
|
|
55
|
-
Subsequence: Pick<import("../components/type").LunaticBaseProps<string>, "
|
|
56
|
-
Question: Pick<import("../components/type").LunaticBaseProps<unknown>, "
|
|
61
|
+
Sequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "description" | "declarations" | "id" | "style">;
|
|
62
|
+
Subsequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "declarations" | "id">;
|
|
63
|
+
Question: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "description" | "declarations" | "id"> & {
|
|
57
64
|
components: import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
|
|
58
65
|
};
|
|
59
|
-
ComponentSet: import("../components/type").LunaticBaseProps<unknown> & {
|
|
60
|
-
components: import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
|
|
61
|
-
value: Record<string, unknown>;
|
|
62
|
-
response: undefined;
|
|
63
|
-
};
|
|
64
66
|
RosterForLoop: import("../components/type").LunaticBaseProps<unknown> & {
|
|
65
67
|
lines: {
|
|
66
68
|
min: number;
|
|
@@ -199,7 +201,6 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
199
201
|
response: {
|
|
200
202
|
name: string;
|
|
201
203
|
};
|
|
202
|
-
writable?: boolean | undefined;
|
|
203
204
|
};
|
|
204
205
|
Textarea: import("../components/type").LunaticBaseProps<string> & {
|
|
205
206
|
cols?: number | undefined;
|
|
@@ -210,7 +211,7 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
210
211
|
name: string;
|
|
211
212
|
};
|
|
212
213
|
};
|
|
213
|
-
FilterDescription: Pick<import("../components/type").LunaticBaseProps<string>, "
|
|
214
|
+
FilterDescription: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "id">;
|
|
214
215
|
PairwiseLinks: Omit<import("../components/type").LunaticBaseProps<unknown>, "value"> & {
|
|
215
216
|
components: import("./type").LunaticComponentDefinition[];
|
|
216
217
|
features?: ["VTL"] | ["VTL", "MD"] | undefined;
|
|
@@ -232,12 +233,12 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
232
233
|
status: import("./use-suggesters").SuggesterStatus;
|
|
233
234
|
timestamp: number;
|
|
234
235
|
};
|
|
235
|
-
optionRenderer: FunctionComponent<{
|
|
236
|
+
optionRenderer: import("react").FunctionComponent<{
|
|
236
237
|
option: import("../components/type").SuggesterOption;
|
|
237
238
|
placeholder?: string | undefined;
|
|
238
239
|
search?: string | undefined;
|
|
239
240
|
}>;
|
|
240
|
-
labelRenderer: FunctionComponent<{
|
|
241
|
+
labelRenderer: import("react").FunctionComponent<{
|
|
241
242
|
option?: import("../components/type").SuggesterOption | undefined;
|
|
242
243
|
selected?: boolean | undefined;
|
|
243
244
|
search?: string | undefined;
|
|
@@ -247,6 +248,16 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
247
248
|
response: {
|
|
248
249
|
name: string;
|
|
249
250
|
};
|
|
251
|
+
optionResponses?: {
|
|
252
|
+
name: string;
|
|
253
|
+
attribute: string;
|
|
254
|
+
}[] | undefined;
|
|
255
|
+
executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
|
|
256
|
+
iteration?: number | number[] | undefined;
|
|
257
|
+
bindingDependencies?: string[] | undefined;
|
|
258
|
+
deps?: string[] | undefined;
|
|
259
|
+
} | undefined) => T;
|
|
260
|
+
iteration: number | undefined;
|
|
250
261
|
};
|
|
251
262
|
Summary: import("../components/type").LunaticBaseProps<string | null> & {
|
|
252
263
|
executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
|
|
@@ -289,15 +300,10 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
289
300
|
name: string;
|
|
290
301
|
};
|
|
291
302
|
};
|
|
292
|
-
Sequence: Pick<import("../components/type").LunaticBaseProps<string>, "
|
|
293
|
-
Subsequence: Pick<import("../components/type").LunaticBaseProps<string>, "
|
|
294
|
-
Question: Pick<import("../components/type").LunaticBaseProps<unknown>, "
|
|
295
|
-
components: import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
|
|
296
|
-
};
|
|
297
|
-
ComponentSet: import("../components/type").LunaticBaseProps<unknown> & {
|
|
303
|
+
Sequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "description" | "declarations" | "id" | "style">;
|
|
304
|
+
Subsequence: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "declarations" | "id">;
|
|
305
|
+
Question: Pick<import("../components/type").LunaticBaseProps<unknown>, "label" | "description" | "declarations" | "id"> & {
|
|
298
306
|
components: import("./commons/fill-components/fill-components").FilledLunaticComponentProps[];
|
|
299
|
-
value: Record<string, unknown>;
|
|
300
|
-
response: undefined;
|
|
301
307
|
};
|
|
302
308
|
RosterForLoop: import("../components/type").LunaticBaseProps<unknown> & {
|
|
303
309
|
lines: {
|
|
@@ -437,7 +443,6 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
437
443
|
response: {
|
|
438
444
|
name: string;
|
|
439
445
|
};
|
|
440
|
-
writable?: boolean | undefined;
|
|
441
446
|
};
|
|
442
447
|
Textarea: import("../components/type").LunaticBaseProps<string> & {
|
|
443
448
|
cols?: number | undefined;
|
|
@@ -448,7 +453,7 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
448
453
|
name: string;
|
|
449
454
|
};
|
|
450
455
|
};
|
|
451
|
-
FilterDescription: Pick<import("../components/type").LunaticBaseProps<string>, "
|
|
456
|
+
FilterDescription: Pick<import("../components/type").LunaticBaseProps<string>, "label" | "id">;
|
|
452
457
|
PairwiseLinks: Omit<import("../components/type").LunaticBaseProps<unknown>, "value"> & {
|
|
453
458
|
components: import("./type").LunaticComponentDefinition[];
|
|
454
459
|
features?: ["VTL"] | ["VTL", "MD"] | undefined;
|
|
@@ -470,12 +475,12 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
470
475
|
status: import("./use-suggesters").SuggesterStatus;
|
|
471
476
|
timestamp: number;
|
|
472
477
|
};
|
|
473
|
-
optionRenderer: FunctionComponent<{
|
|
478
|
+
optionRenderer: import("react").FunctionComponent<{
|
|
474
479
|
option: import("../components/type").SuggesterOption;
|
|
475
480
|
placeholder?: string | undefined;
|
|
476
481
|
search?: string | undefined;
|
|
477
482
|
}>;
|
|
478
|
-
labelRenderer: FunctionComponent<{
|
|
483
|
+
labelRenderer: import("react").FunctionComponent<{
|
|
479
484
|
option?: import("../components/type").SuggesterOption | undefined;
|
|
480
485
|
selected?: boolean | undefined;
|
|
481
486
|
search?: string | undefined;
|
|
@@ -485,6 +490,16 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
485
490
|
response: {
|
|
486
491
|
name: string;
|
|
487
492
|
};
|
|
493
|
+
optionResponses?: {
|
|
494
|
+
name: string;
|
|
495
|
+
attribute: string;
|
|
496
|
+
}[] | undefined;
|
|
497
|
+
executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
|
|
498
|
+
iteration?: number | number[] | undefined;
|
|
499
|
+
bindingDependencies?: string[] | undefined;
|
|
500
|
+
deps?: string[] | undefined;
|
|
501
|
+
} | undefined) => T;
|
|
502
|
+
iteration: number | undefined;
|
|
488
503
|
};
|
|
489
504
|
Summary: import("../components/type").LunaticBaseProps<string | null> & {
|
|
490
505
|
executeExpression: <T extends unknown = unknown>(expression: unknown, args?: {
|
|
@@ -504,7 +519,7 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
504
519
|
}[];
|
|
505
520
|
};
|
|
506
521
|
})[] | undefined;
|
|
507
|
-
}) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps<"
|
|
522
|
+
}) => import("./commons/fill-components/fill-components").FilledLunaticComponentProps<"Sequence" | "Subsequence" | "RosterForLoop" | "Loop" | "Table" | "InputNumber" | "Datepicker" | "CheckboxGroup" | "CheckboxBoolean" | "Radio" | "FilterDescription" | "Dropdown" | "PairwiseLinks" | "Roundabout" | "Suggester" | "Input" | "Textarea" | "CheckboxOne" | "Question">[];
|
|
508
523
|
goPreviousPage: () => void;
|
|
509
524
|
goNextPage: (payload?: {}) => void;
|
|
510
525
|
goToPage: (page: {
|
|
@@ -532,8 +547,16 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
532
547
|
linksIterations?: number[] | undefined;
|
|
533
548
|
};
|
|
534
549
|
waiting: boolean;
|
|
535
|
-
getData: (withRefreshedCalculated: boolean, variableNames?: string[]) =>
|
|
536
|
-
|
|
550
|
+
getData: (withRefreshedCalculated: boolean, variableNames?: string[]) => Partial<Record<"EXTERNAL" | "CALCULATED", Record<string, unknown>> & {
|
|
551
|
+
COLLECTED: Record<string, Partial<{
|
|
552
|
+
COLLECTED: unknown;
|
|
553
|
+
EDITED: unknown;
|
|
554
|
+
FORCED: unknown;
|
|
555
|
+
INPUTED: unknown;
|
|
556
|
+
PREVIOUS: unknown;
|
|
557
|
+
}>>;
|
|
558
|
+
}>;
|
|
559
|
+
Provider: import("react").FunctionComponent<{
|
|
537
560
|
children?: import("react").ReactNode;
|
|
538
561
|
}>;
|
|
539
562
|
onChange: (response: {
|
|
@@ -551,7 +574,15 @@ declare function useLunatic(source: LunaticSource, data: LunaticData | undefined
|
|
|
551
574
|
children: import("./commons/getOverview").OverviewItem[];
|
|
552
575
|
}[];
|
|
553
576
|
loopVariables: string[];
|
|
554
|
-
getChangedData: (reset?: boolean) =>
|
|
577
|
+
getChangedData: (reset?: boolean) => Partial<Record<"EXTERNAL" | "CALCULATED", Record<string, unknown>> & {
|
|
578
|
+
COLLECTED: Record<string, Partial<{
|
|
579
|
+
COLLECTED: unknown;
|
|
580
|
+
EDITED: unknown;
|
|
581
|
+
FORCED: unknown;
|
|
582
|
+
INPUTED: unknown;
|
|
583
|
+
PREVIOUS: unknown;
|
|
584
|
+
}>>;
|
|
585
|
+
}>;
|
|
555
586
|
resetChangedData: () => void;
|
|
556
587
|
hasPageResponse: () => boolean;
|
|
557
588
|
};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LunaticVariable } from '../use-lunatic/type';
|
|
2
2
|
/**
|
|
3
3
|
* Extract the initial value from the source.json and data.json
|
|
4
4
|
*/
|
|
5
|
-
export declare function getInitialVariableValue(variable: LunaticVariable, data?:
|
|
5
|
+
export declare function getInitialVariableValue(variable: LunaticVariable, data?: Partial<Record<"EXTERNAL" | "CALCULATED", Record<string, unknown>> & {
|
|
6
|
+
COLLECTED: Record<string, Partial<{
|
|
7
|
+
COLLECTED: unknown;
|
|
8
|
+
EDITED: unknown;
|
|
9
|
+
FORCED: unknown;
|
|
10
|
+
INPUTED: unknown;
|
|
11
|
+
PREVIOUS: unknown;
|
|
12
|
+
}>>;
|
|
13
|
+
}>): unknown;
|
|
@@ -3,14 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.
|
|
6
|
+
exports["default"] = exports.Default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
8
|
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
8
|
-
var _source = _interopRequireDefault(require("
|
|
9
|
-
var _data = _interopRequireDefault(require("
|
|
10
|
-
var _sourceLoop = _interopRequireDefault(require("./source-loop.json"));
|
|
11
|
-
var _dataLoop = _interopRequireDefault(require("./data-loop.json"));
|
|
12
|
-
var _sourceRoundabout = _interopRequireDefault(require("./source-roundabout.json"));
|
|
13
|
-
var _dataRoundabout = _interopRequireDefault(require("./data-roundabout.json"));
|
|
9
|
+
var _source = _interopRequireDefault(require("../input/source"));
|
|
10
|
+
var _data = _interopRequireDefault(require("../input/data"));
|
|
14
11
|
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
15
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -21,7 +18,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
21
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
19
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
20
|
var stories = {
|
|
24
|
-
title: '
|
|
21
|
+
title: 'Behaviour/Slots',
|
|
25
22
|
component: _orchestrator["default"],
|
|
26
23
|
argTypes: _defaultArgTypes["default"]
|
|
27
24
|
};
|
|
@@ -30,24 +27,38 @@ var Template = function Template(args) {
|
|
|
30
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_orchestrator["default"], _objectSpread({}, args));
|
|
31
28
|
};
|
|
32
29
|
var Default = exports.Default = Template.bind({});
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @var
|
|
33
|
+
*/
|
|
34
|
+
var CustomInput = function CustomInput(_ref) {
|
|
35
|
+
var _onChange = _ref.onChange,
|
|
36
|
+
value = _ref.value,
|
|
37
|
+
label = _ref.label;
|
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("fieldset", {
|
|
39
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("legend", {
|
|
40
|
+
style: {
|
|
41
|
+
color: 'gray',
|
|
42
|
+
fontSize: '1rem'
|
|
43
|
+
},
|
|
44
|
+
children: label
|
|
45
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
46
|
+
style: {
|
|
47
|
+
border: 'solid 3px gray',
|
|
48
|
+
padding: '.5rem 1rem'
|
|
49
|
+
},
|
|
50
|
+
value: value,
|
|
51
|
+
onChange: function onChange(e) {
|
|
52
|
+
return _onChange(e.target.value);
|
|
53
|
+
}
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
56
|
+
};
|
|
33
57
|
Default.args = {
|
|
34
|
-
id: '
|
|
58
|
+
id: 'input',
|
|
35
59
|
source: _source["default"],
|
|
36
|
-
pagination: true,
|
|
37
60
|
data: _data["default"],
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
InRoundabout.args = {
|
|
42
|
-
id: 'component-set-roundabout',
|
|
43
|
-
source: _sourceRoundabout["default"],
|
|
44
|
-
pagination: true,
|
|
45
|
-
data: _dataRoundabout["default"]
|
|
46
|
-
};
|
|
47
|
-
var InLoop = exports.InLoop = Template.bind({});
|
|
48
|
-
InLoop.args = {
|
|
49
|
-
id: 'component-set-loop',
|
|
50
|
-
source: _sourceLoop["default"],
|
|
51
|
-
pagination: true,
|
|
52
|
-
data: _dataLoop["default"]
|
|
61
|
+
slots: {
|
|
62
|
+
Input: CustomInput
|
|
63
|
+
}
|
|
53
64
|
};
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.Loop = exports.Default =
|
|
6
|
+
exports["default"] = exports.Loop = exports.Default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
9
9
|
var _source = _interopRequireDefault(require("./source"));
|
|
10
|
-
var _sourceComponentset = _interopRequireDefault(require("./sourceComponentset"));
|
|
11
10
|
var _sourceLoop = _interopRequireDefault(require("./sourceLoop"));
|
|
12
11
|
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
13
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -41,10 +40,6 @@ Default.args = {
|
|
|
41
40
|
source: _source["default"],
|
|
42
41
|
shortcut: true
|
|
43
42
|
};
|
|
44
|
-
var ComponentSet = exports.ComponentSet = Template.bind({});
|
|
45
|
-
ComponentSet.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
46
|
-
source: _sourceComponentset["default"]
|
|
47
|
-
});
|
|
48
43
|
var Loop = exports.Loop = Template.bind({});
|
|
49
44
|
Loop.args = _objectSpread(_objectSpread({}, Default.args), {}, {
|
|
50
45
|
source: _sourceLoop["default"]
|