@inseefr/lunatic 3.11.2 → 3.12.0
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/components/Accordion/Accordion.d.ts +1 -1
- package/components/Datepicker/DatepickerFields.js +4 -2
- package/components/Datepicker/DatepickerFields.js.map +1 -1
- package/components/Duration/getDurationFromValue.js +3 -3
- package/components/Duration/getDurationFromValue.js.map +1 -1
- package/components/FilterDescription/FilterDescription.d.ts +1 -1
- package/components/LunaticComponents.d.ts +1 -1
- package/components/LunaticComponents.js +9 -7
- package/components/LunaticComponents.js.map +1 -1
- package/components/PairwiseLinks/PairwiseLinks.d.ts +1 -1
- package/components/PairwiseLinks/PairwiseLinks.js +15 -30
- package/components/PairwiseLinks/PairwiseLinks.js.map +1 -1
- package/components/PairwiseLinks/PairwiseMirror.d.ts +2 -0
- package/components/PairwiseLinks/PairwiseMirror.js +14 -0
- package/components/PairwiseLinks/PairwiseMirror.js.map +1 -0
- package/components/PairwiseLinks/combinations.d.ts +18 -0
- package/components/PairwiseLinks/combinations.js +29 -0
- package/components/PairwiseLinks/combinations.js.map +1 -0
- package/components/Radio/Radio.d.ts +1 -1
- package/components/Sequence/Sequence.d.ts +1 -1
- package/components/Subsequence/Subsequence.d.ts +1 -1
- package/components/Switch/Switch.d.ts +1 -1
- package/components/library.d.ts +6 -6
- package/components/type.d.ts +25 -28
- package/esm/components/Accordion/Accordion.d.ts +1 -1
- package/esm/components/Datepicker/DatepickerFields.js +4 -2
- package/esm/components/Datepicker/DatepickerFields.js.map +1 -1
- package/esm/components/Duration/getDurationFromValue.js +3 -3
- package/esm/components/Duration/getDurationFromValue.js.map +1 -1
- package/esm/components/FilterDescription/FilterDescription.d.ts +1 -1
- package/esm/components/LunaticComponents.d.ts +1 -1
- package/esm/components/LunaticComponents.js +9 -7
- package/esm/components/LunaticComponents.js.map +1 -1
- package/esm/components/PairwiseLinks/PairwiseLinks.d.ts +1 -1
- package/esm/components/PairwiseLinks/PairwiseLinks.js +16 -31
- package/esm/components/PairwiseLinks/PairwiseLinks.js.map +1 -1
- package/esm/components/PairwiseLinks/PairwiseMirror.d.ts +2 -0
- package/esm/components/PairwiseLinks/PairwiseMirror.js +10 -0
- package/esm/components/PairwiseLinks/PairwiseMirror.js.map +1 -0
- package/esm/components/PairwiseLinks/combinations.d.ts +18 -0
- package/esm/components/PairwiseLinks/combinations.js +24 -0
- package/esm/components/PairwiseLinks/combinations.js.map +1 -0
- package/esm/components/Radio/Radio.d.ts +1 -1
- package/esm/components/Sequence/Sequence.d.ts +1 -1
- package/esm/components/Subsequence/Subsequence.d.ts +1 -1
- package/esm/components/Switch/Switch.d.ts +1 -1
- package/esm/components/library.d.ts +6 -6
- package/esm/components/type.d.ts +25 -28
- package/esm/index.d.ts +1 -1
- package/esm/index.js.map +1 -1
- package/esm/type.source.d.ts +43 -13
- package/esm/type.source.js +0 -1
- package/esm/type.source.js.map +1 -1
- package/esm/use-lunatic/commons/compile-controls.js +1 -1
- package/esm/use-lunatic/commons/compile-controls.js.map +1 -1
- package/esm/use-lunatic/commons/component.d.ts +3 -2
- package/esm/use-lunatic/commons/component.js +5 -0
- package/esm/use-lunatic/commons/component.js.map +1 -1
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +1 -1
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js +1 -42
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
- package/esm/use-lunatic/commons/fill-components/fill-components.js +10 -2
- package/esm/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
- package/esm/use-lunatic/commons/index.d.ts +4 -4
- package/esm/use-lunatic/commons/index.js +4 -4
- package/esm/use-lunatic/commons/index.js.map +1 -1
- package/esm/use-lunatic/commons/{check-loops.d.ts → pagination/check-loops.d.ts} +7 -7
- package/esm/use-lunatic/commons/{check-loops.js → pagination/check-loops.js} +3 -5
- package/esm/use-lunatic/commons/pagination/check-loops.js.map +1 -0
- package/{use-lunatic/commons → esm/use-lunatic/commons/pagination}/check-pager.d.ts +1 -1
- package/esm/use-lunatic/commons/pagination/check-pager.js.map +1 -0
- package/{use-lunatic/commons → esm/use-lunatic/commons/pagination}/create-map-pages.d.ts +1 -1
- package/esm/use-lunatic/commons/pagination/create-map-pages.js.map +1 -0
- package/esm/use-lunatic/commons/{is-First-last-page.d.ts → pagination/is-First-last-page.d.ts} +1 -1
- package/esm/use-lunatic/commons/pagination/is-First-last-page.js.map +1 -0
- package/{use-lunatic/commons → esm/use-lunatic/commons/pagination}/is-paginated-loop.d.ts +1 -1
- package/esm/use-lunatic/commons/pagination/is-paginated-loop.js.map +1 -0
- package/esm/use-lunatic/commons/{is-roundabout.d.ts → pagination/is-roundabout.d.ts} +1 -1
- package/esm/use-lunatic/commons/pagination/is-roundabout.js.map +1 -0
- package/esm/use-lunatic/commons/{page-navigation.d.ts → pagination/page-navigation.d.ts} +2 -2
- package/esm/use-lunatic/commons/{page-navigation.js → pagination/page-navigation.js} +6 -6
- package/esm/use-lunatic/commons/pagination/page-navigation.js.map +1 -0
- package/esm/use-lunatic/commons/pagination/page-navigation.spec.js.map +1 -0
- package/esm/use-lunatic/commons/{page-tag.d.ts → pagination/page-tag.d.ts} +8 -1
- package/esm/use-lunatic/commons/{page-tag.js → pagination/page-tag.js} +17 -6
- package/esm/use-lunatic/commons/pagination/page-tag.js.map +1 -0
- package/esm/use-lunatic/commons/{page-tag.spec.js → pagination/page-tag.spec.js} +9 -1
- package/esm/use-lunatic/commons/pagination/page-tag.spec.js.map +1 -0
- package/{use-lunatic/commons → esm/use-lunatic/commons/pagination}/page.d.ts +1 -1
- package/esm/use-lunatic/commons/{page.js → pagination/page.js} +2 -2
- package/esm/use-lunatic/commons/pagination/page.js.map +1 -0
- package/esm/use-lunatic/hooks/use-page-has-response.js +37 -21
- package/esm/use-lunatic/hooks/use-page-has-response.js.map +1 -1
- package/esm/use-lunatic/hooks/useOverview.js +2 -2
- package/esm/use-lunatic/hooks/useOverview.js.map +1 -1
- package/esm/use-lunatic/props/getComponentTypeProps.d.ts +28 -26
- package/esm/use-lunatic/props/getComponentTypeProps.js +3 -1
- package/esm/use-lunatic/props/getComponentTypeProps.js.map +1 -1
- package/esm/use-lunatic/props/propOptions.d.ts +9 -1
- package/esm/use-lunatic/props/propOptions.js +56 -1
- package/esm/use-lunatic/props/propOptions.js.map +1 -1
- package/esm/use-lunatic/props/propOptions.spec.js +220 -56
- package/esm/use-lunatic/props/propOptions.spec.js.map +1 -1
- package/esm/use-lunatic/reducer/commons/auto-explore-loop.js +3 -2
- package/esm/use-lunatic/reducer/commons/auto-explore-loop.js.map +1 -1
- package/esm/use-lunatic/reducer/overview/overviewOnInit.d.ts +1 -2
- package/esm/use-lunatic/reducer/overview/overviewOnInit.js +1 -1
- package/esm/use-lunatic/reducer/overview/overviewOnInit.js.map +1 -1
- package/esm/use-lunatic/reducer/reduce-go-next-page.js +4 -3
- package/esm/use-lunatic/reducer/reduce-go-next-page.js.map +1 -1
- package/esm/use-lunatic/reducer/reduce-go-previous-page.js +2 -2
- package/esm/use-lunatic/reducer/reduce-go-previous-page.js.map +1 -1
- package/esm/use-lunatic/reducer/reduce-go-to-page.js +2 -2
- package/esm/use-lunatic/reducer/reduce-go-to-page.js.map +1 -1
- package/esm/use-lunatic/reducer/reducerInitializer.js +2 -2
- package/esm/use-lunatic/reducer/reducerInitializer.js.map +1 -1
- package/esm/use-lunatic/type.d.ts +1 -1
- package/esm/utils/cast.js +5 -2
- package/esm/utils/cast.js.map +1 -1
- package/esm/utils/getArticulationState.js +2 -1
- package/esm/utils/getArticulationState.js.map +1 -1
- package/esm/utils/number.js +4 -4
- package/esm/utils/number.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/package.json +98 -79
- package/src/components/Datepicker/DatepickerFields.tsx +4 -2
- package/src/components/Duration/getDurationFromValue.ts +3 -3
- package/src/components/LunaticComponents.tsx +32 -25
- package/src/components/PairwiseLinks/PairwiseLinks.tsx +18 -57
- package/src/components/PairwiseLinks/PairwiseMirror.tsx +19 -0
- package/src/components/PairwiseLinks/combinations.test.ts +103 -0
- package/src/components/PairwiseLinks/combinations.ts +34 -0
- package/src/components/type.ts +204 -231
- package/src/index.ts +1 -4
- package/src/stories/checkbox/checkbox.stories.tsx +13 -0
- package/src/stories/checkbox/sourceOneDynamicOptions.json +496 -0
- package/src/stories/dropdown/dropdown.stories.tsx +12 -0
- package/src/stories/dropdown/sourceDynamicOptions.json +496 -0
- package/src/stories/pairwise/pairwise.stories.tsx +17 -1
- package/src/stories/pairwise/sourcePairwiseLoop.json +356 -0
- package/src/stories/radio/radio.stories.tsx +13 -0
- package/src/stories/radio/sourceDynamicOptions.json +496 -0
- package/src/type.source.ts +45 -14
- package/src/use-lunatic/commons/compile-controls.ts +1 -1
- package/src/use-lunatic/commons/component.ts +7 -2
- package/src/use-lunatic/commons/fill-components/fill-component-expressions.ts +3 -46
- package/src/use-lunatic/commons/fill-components/fill-components.ts +9 -10
- package/src/use-lunatic/commons/index.ts +8 -4
- package/src/use-lunatic/commons/{check-loops.ts → pagination/check-loops.ts} +4 -10
- package/src/use-lunatic/commons/{check-pager.ts → pagination/check-pager.ts} +1 -1
- package/src/use-lunatic/commons/{create-map-pages.ts → pagination/create-map-pages.ts} +2 -2
- package/src/use-lunatic/commons/{is-First-last-page.ts → pagination/is-First-last-page.ts} +1 -1
- package/src/use-lunatic/commons/{is-paginated-loop.ts → pagination/is-paginated-loop.ts} +1 -1
- package/src/use-lunatic/commons/{is-roundabout.ts → pagination/is-roundabout.ts} +1 -1
- package/src/use-lunatic/commons/{page-navigation.spec.ts → pagination/page-navigation.spec.ts} +1 -1
- package/src/use-lunatic/commons/{page-navigation.ts → pagination/page-navigation.ts} +8 -8
- package/src/use-lunatic/commons/{page-tag.spec.ts → pagination/page-tag.spec.ts} +15 -2
- package/src/use-lunatic/commons/{page-tag.ts → pagination/page-tag.ts} +18 -7
- package/src/use-lunatic/commons/{page.ts → pagination/page.ts} +6 -3
- package/src/use-lunatic/hooks/use-page-has-response.ts +59 -28
- package/src/use-lunatic/hooks/useOverview.ts +6 -3
- package/src/use-lunatic/props/getComponentTypeProps.ts +2 -1
- package/src/use-lunatic/props/propOptions.spec.ts +217 -147
- package/src/use-lunatic/props/propOptions.ts +99 -10
- package/src/use-lunatic/reducer/commons/auto-explore-loop.ts +3 -2
- package/src/use-lunatic/reducer/overview/overviewOnInit.ts +2 -2
- package/src/use-lunatic/reducer/reduce-go-next-page.ts +4 -3
- package/src/use-lunatic/reducer/reduce-go-previous-page.ts +2 -2
- package/src/use-lunatic/reducer/reduce-go-to-page.ts +2 -2
- package/src/use-lunatic/reducer/reducerInitializer.tsx +2 -2
- package/src/use-lunatic/type.ts +1 -1
- package/src/utils/cast.ts +5 -2
- package/src/utils/getArticulationState.ts +2 -1
- package/src/utils/number.ts +4 -4
- package/tsconfig.build.tsbuildinfo +1 -1
- package/type.source.d.ts +43 -13
- package/type.source.js +0 -1
- package/type.source.js.map +1 -1
- package/use-lunatic/commons/compile-controls.js +1 -1
- package/use-lunatic/commons/compile-controls.js.map +1 -1
- package/use-lunatic/commons/component.d.ts +3 -2
- package/use-lunatic/commons/component.js +5 -0
- package/use-lunatic/commons/component.js.map +1 -1
- package/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +1 -1
- package/use-lunatic/commons/fill-components/fill-component-expressions.js +12 -53
- package/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
- package/use-lunatic/commons/fill-components/fill-components.js +9 -1
- package/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
- package/use-lunatic/commons/index.d.ts +4 -4
- package/use-lunatic/commons/index.js +4 -4
- package/use-lunatic/commons/index.js.map +1 -1
- package/use-lunatic/commons/{check-loops.d.ts → pagination/check-loops.d.ts} +7 -7
- package/use-lunatic/commons/{check-loops.js → pagination/check-loops.js} +3 -5
- package/use-lunatic/commons/pagination/check-loops.js.map +1 -0
- package/{esm/use-lunatic/commons → use-lunatic/commons/pagination}/check-pager.d.ts +1 -1
- package/use-lunatic/commons/pagination/check-pager.js.map +1 -0
- package/{esm/use-lunatic/commons → use-lunatic/commons/pagination}/create-map-pages.d.ts +1 -1
- package/use-lunatic/commons/pagination/create-map-pages.js.map +1 -0
- package/use-lunatic/commons/{is-First-last-page.d.ts → pagination/is-First-last-page.d.ts} +1 -1
- package/use-lunatic/commons/pagination/is-First-last-page.js.map +1 -0
- package/{esm/use-lunatic/commons → use-lunatic/commons/pagination}/is-paginated-loop.d.ts +1 -1
- package/use-lunatic/commons/pagination/is-paginated-loop.js.map +1 -0
- package/use-lunatic/commons/{is-roundabout.d.ts → pagination/is-roundabout.d.ts} +1 -1
- package/use-lunatic/commons/pagination/is-roundabout.js.map +1 -0
- package/use-lunatic/commons/{page-navigation.d.ts → pagination/page-navigation.d.ts} +2 -2
- package/use-lunatic/commons/{page-navigation.js → pagination/page-navigation.js} +6 -6
- package/use-lunatic/commons/pagination/page-navigation.js.map +1 -0
- package/use-lunatic/commons/pagination/page-navigation.spec.js.map +1 -0
- package/use-lunatic/commons/{page-tag.d.ts → pagination/page-tag.d.ts} +8 -1
- package/use-lunatic/commons/{page-tag.js → pagination/page-tag.js} +18 -6
- package/use-lunatic/commons/pagination/page-tag.js.map +1 -0
- package/use-lunatic/commons/{page-tag.spec.js → pagination/page-tag.spec.js} +8 -0
- package/use-lunatic/commons/pagination/page-tag.spec.js.map +1 -0
- package/{esm/use-lunatic/commons → use-lunatic/commons/pagination}/page.d.ts +1 -1
- package/use-lunatic/commons/{page.js → pagination/page.js} +2 -2
- package/use-lunatic/commons/pagination/page.js.map +1 -0
- package/use-lunatic/hooks/use-page-has-response.js +36 -21
- package/use-lunatic/hooks/use-page-has-response.js.map +1 -1
- package/use-lunatic/hooks/useOverview.js +2 -2
- package/use-lunatic/hooks/useOverview.js.map +1 -1
- package/use-lunatic/props/getComponentTypeProps.d.ts +28 -26
- package/use-lunatic/props/getComponentTypeProps.js +2 -1
- package/use-lunatic/props/getComponentTypeProps.js.map +1 -1
- package/use-lunatic/props/propOptions.d.ts +9 -1
- package/use-lunatic/props/propOptions.js +57 -2
- package/use-lunatic/props/propOptions.js.map +1 -1
- package/use-lunatic/props/propOptions.spec.js +217 -55
- package/use-lunatic/props/propOptions.spec.js.map +1 -1
- package/use-lunatic/reducer/commons/auto-explore-loop.js +6 -2
- package/use-lunatic/reducer/commons/auto-explore-loop.js.map +1 -1
- package/use-lunatic/reducer/overview/overviewOnInit.d.ts +1 -2
- package/use-lunatic/reducer/overview/overviewOnInit.js +1 -1
- package/use-lunatic/reducer/overview/overviewOnInit.js.map +1 -1
- package/use-lunatic/reducer/reduce-go-next-page.js +4 -3
- package/use-lunatic/reducer/reduce-go-next-page.js.map +1 -1
- package/use-lunatic/reducer/reduce-go-previous-page.js +2 -2
- package/use-lunatic/reducer/reduce-go-previous-page.js.map +1 -1
- package/use-lunatic/reducer/reduce-go-to-page.js +2 -2
- package/use-lunatic/reducer/reduce-go-to-page.js.map +1 -1
- package/use-lunatic/reducer/reducerInitializer.js +2 -2
- package/use-lunatic/reducer/reducerInitializer.js.map +1 -1
- package/use-lunatic/type.d.ts +1 -1
- package/utils/cast.js +5 -2
- package/utils/cast.js.map +1 -1
- package/utils/getArticulationState.js +2 -1
- package/utils/getArticulationState.js.map +1 -1
- package/utils/number.js +4 -4
- package/utils/number.js.map +1 -1
- package/esm/use-lunatic/commons/check-loops.js.map +0 -1
- package/esm/use-lunatic/commons/check-pager.js.map +0 -1
- package/esm/use-lunatic/commons/create-map-pages.js.map +0 -1
- package/esm/use-lunatic/commons/is-First-last-page.js.map +0 -1
- package/esm/use-lunatic/commons/is-paginated-loop.js.map +0 -1
- package/esm/use-lunatic/commons/is-roundabout.js.map +0 -1
- package/esm/use-lunatic/commons/page-navigation.js.map +0 -1
- package/esm/use-lunatic/commons/page-navigation.spec.js.map +0 -1
- package/esm/use-lunatic/commons/page-tag.js.map +0 -1
- package/esm/use-lunatic/commons/page-tag.spec.js.map +0 -1
- package/esm/use-lunatic/commons/page.js.map +0 -1
- package/use-lunatic/commons/check-loops.js.map +0 -1
- package/use-lunatic/commons/check-pager.js.map +0 -1
- package/use-lunatic/commons/create-map-pages.js.map +0 -1
- package/use-lunatic/commons/is-First-last-page.js.map +0 -1
- package/use-lunatic/commons/is-paginated-loop.js.map +0 -1
- package/use-lunatic/commons/is-roundabout.js.map +0 -1
- package/use-lunatic/commons/page-navigation.js.map +0 -1
- package/use-lunatic/commons/page-navigation.spec.js.map +0 -1
- package/use-lunatic/commons/page-tag.js.map +0 -1
- package/use-lunatic/commons/page-tag.spec.js.map +0 -1
- package/use-lunatic/commons/page.js.map +0 -1
- /package/esm/use-lunatic/commons/{check-pager.js → pagination/check-pager.js} +0 -0
- /package/esm/use-lunatic/commons/{create-map-pages.js → pagination/create-map-pages.js} +0 -0
- /package/esm/use-lunatic/commons/{is-First-last-page.js → pagination/is-First-last-page.js} +0 -0
- /package/esm/use-lunatic/commons/{is-paginated-loop.js → pagination/is-paginated-loop.js} +0 -0
- /package/esm/use-lunatic/commons/{is-roundabout.js → pagination/is-roundabout.js} +0 -0
- /package/esm/use-lunatic/commons/{page-navigation.spec.d.ts → pagination/page-navigation.spec.d.ts} +0 -0
- /package/esm/use-lunatic/commons/{page-navigation.spec.js → pagination/page-navigation.spec.js} +0 -0
- /package/esm/use-lunatic/commons/{page-tag.spec.d.ts → pagination/page-tag.spec.d.ts} +0 -0
- /package/use-lunatic/commons/{check-pager.js → pagination/check-pager.js} +0 -0
- /package/use-lunatic/commons/{create-map-pages.js → pagination/create-map-pages.js} +0 -0
- /package/use-lunatic/commons/{is-First-last-page.js → pagination/is-First-last-page.js} +0 -0
- /package/use-lunatic/commons/{is-paginated-loop.js → pagination/is-paginated-loop.js} +0 -0
- /package/use-lunatic/commons/{is-roundabout.js → pagination/is-roundabout.js} +0 -0
- /package/use-lunatic/commons/{page-navigation.spec.d.ts → pagination/page-navigation.spec.d.ts} +0 -0
- /package/use-lunatic/commons/{page-navigation.spec.js → pagination/page-navigation.spec.js} +0 -0
- /package/use-lunatic/commons/{page-tag.spec.d.ts → pagination/page-tag.spec.d.ts} +0 -0
package/src/components/type.ts
CHANGED
|
@@ -15,8 +15,6 @@ export type VtlExpression = {
|
|
|
15
15
|
type: 'VTL' | 'VTL|MD' | 'TXT';
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
export interface LunaticExtraProps {}
|
|
19
|
-
|
|
20
18
|
export type LunaticBaseProps<ValueType = unknown> = {
|
|
21
19
|
id: string;
|
|
22
20
|
handleChanges: LunaticChangesHandler;
|
|
@@ -68,40 +66,35 @@ export type SuggesterOption = {
|
|
|
68
66
|
};
|
|
69
67
|
|
|
70
68
|
export type ComponentPropsByType = {
|
|
71
|
-
InputNumber: LunaticBaseProps<number | null> &
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
items: {
|
|
101
|
-
label: ReactNode;
|
|
102
|
-
body: ReactNode;
|
|
103
|
-
}[];
|
|
104
|
-
};
|
|
69
|
+
InputNumber: LunaticBaseProps<number | null> & {
|
|
70
|
+
min?: number;
|
|
71
|
+
max?: number;
|
|
72
|
+
decimals?: number;
|
|
73
|
+
unit?: string;
|
|
74
|
+
response: { name: string };
|
|
75
|
+
componentType?: 'InputNumber';
|
|
76
|
+
};
|
|
77
|
+
Duration: LunaticBaseProps<string | null> & {
|
|
78
|
+
format: DurationFormat;
|
|
79
|
+
response: { name: string };
|
|
80
|
+
componentType?: 'Duration';
|
|
81
|
+
};
|
|
82
|
+
Text: LunaticBaseProps<string> & {
|
|
83
|
+
componentType?: 'Text';
|
|
84
|
+
};
|
|
85
|
+
Input: LunaticBaseProps<string> & {
|
|
86
|
+
maxLength?: number;
|
|
87
|
+
value: null | string;
|
|
88
|
+
response: { name: string };
|
|
89
|
+
componentType?: 'Input';
|
|
90
|
+
};
|
|
91
|
+
Accordion: LunaticBaseProps<string> & {
|
|
92
|
+
componentType?: 'Accordion';
|
|
93
|
+
items: {
|
|
94
|
+
label: ReactNode;
|
|
95
|
+
body: ReactNode;
|
|
96
|
+
}[];
|
|
97
|
+
};
|
|
105
98
|
Sequence: Pick<
|
|
106
99
|
LunaticBaseProps<string>,
|
|
107
100
|
| 'id'
|
|
@@ -110,13 +103,11 @@ export type ComponentPropsByType = {
|
|
|
110
103
|
| 'declarations'
|
|
111
104
|
| 'description'
|
|
112
105
|
| 'shouldBeFiltered'
|
|
113
|
-
> &
|
|
114
|
-
LunaticExtraProps & { componentType?: 'Sequence' };
|
|
106
|
+
> & { componentType?: 'Sequence' };
|
|
115
107
|
Subsequence: Pick<
|
|
116
108
|
LunaticBaseProps<string>,
|
|
117
109
|
'id' | 'label' | 'declarations' | 'description' | 'shouldBeFiltered'
|
|
118
|
-
> &
|
|
119
|
-
LunaticExtraProps & { componentType?: 'Subsequence' };
|
|
110
|
+
> & { componentType?: 'Subsequence' };
|
|
120
111
|
Question: Pick<
|
|
121
112
|
LunaticBaseProps<unknown>,
|
|
122
113
|
| 'propsTransformer'
|
|
@@ -128,201 +119,183 @@ export type ComponentPropsByType = {
|
|
|
128
119
|
| 'disabled'
|
|
129
120
|
| 'readOnly'
|
|
130
121
|
| 'shouldBeFiltered'
|
|
131
|
-
> &
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
122
|
+
> & {
|
|
123
|
+
components: LunaticComponentProps[];
|
|
124
|
+
componentType?: 'Question';
|
|
125
|
+
iteration?: number;
|
|
126
|
+
value: Record<string, unknown>;
|
|
127
|
+
};
|
|
128
|
+
RosterForLoop: LunaticBaseProps<unknown> & {
|
|
129
|
+
lines: { min: number; max: number };
|
|
130
|
+
iterations: number;
|
|
131
|
+
getComponents: (n: number) => LunaticComponentProps[];
|
|
132
|
+
executeExpression: LunaticReducerState['executeExpression'];
|
|
133
|
+
value: Record<string, unknown[]>;
|
|
134
|
+
header?: Array<{
|
|
135
|
+
label: ReactNode;
|
|
136
|
+
rowspan?: number;
|
|
137
|
+
colspan?: number;
|
|
138
|
+
}>;
|
|
139
|
+
paginatedLoop?: boolean;
|
|
140
|
+
componentType?: 'RosterForLoop';
|
|
141
|
+
};
|
|
142
|
+
Loop: LunaticBaseProps<unknown> & {
|
|
143
|
+
lines: { min: number; max: number };
|
|
144
|
+
iterations: number;
|
|
145
|
+
getComponents: (n: number) => LunaticComponentProps[];
|
|
146
|
+
executeExpression: LunaticReducerState['executeExpression'];
|
|
147
|
+
value: Record<string, unknown[]>;
|
|
148
|
+
header?: Array<{ label: ReactNode }>;
|
|
149
|
+
paginatedLoop?: boolean;
|
|
150
|
+
componentType?: 'Loop';
|
|
151
|
+
};
|
|
152
|
+
Table: LunaticBaseProps<unknown> & {
|
|
153
|
+
value: Record<string, unknown>;
|
|
154
|
+
header: Array<{
|
|
155
|
+
label: ReactNode;
|
|
156
|
+
rowspan?: number;
|
|
157
|
+
colspan?: number;
|
|
158
|
+
}>;
|
|
159
|
+
body: (LunaticComponentProps & {
|
|
160
|
+
colspan?: number;
|
|
161
|
+
rowspan?: number;
|
|
162
|
+
})[][];
|
|
163
|
+
executeExpression: LunaticReducerState['executeExpression'];
|
|
164
|
+
iteration: LunaticReducerState['pager']['iteration'];
|
|
165
|
+
componentType?: 'Table';
|
|
166
|
+
};
|
|
167
|
+
Datepicker: LunaticBaseProps<string | null> & {
|
|
168
|
+
dateFormat: 'YYYY-MM-DD' | 'YYYY-MM' | 'YYYY';
|
|
169
|
+
min?: string;
|
|
170
|
+
max?: string;
|
|
171
|
+
response: { name: string };
|
|
172
|
+
componentType?: 'Datepicker';
|
|
173
|
+
};
|
|
174
|
+
CheckboxGroup: LunaticBaseProps<Record<string, boolean | null>> & {
|
|
175
|
+
options: {
|
|
176
|
+
id: string;
|
|
177
|
+
label: ReactNode;
|
|
178
|
+
name: string;
|
|
179
|
+
checked: boolean;
|
|
180
|
+
description?: ReactNode;
|
|
181
|
+
onCheck: (b: boolean) => void;
|
|
182
|
+
onDetailChange?: (v: string) => void;
|
|
183
|
+
detailLabel?: ReactNode;
|
|
184
|
+
detailMaxLength?: number;
|
|
185
|
+
detailValue?: string | null;
|
|
186
|
+
shouldBeFiltered?: boolean;
|
|
187
|
+
}[];
|
|
188
|
+
orientation?: 'horizontal' | 'vertical';
|
|
189
|
+
detailAlwaysDisplayed?: boolean;
|
|
190
|
+
componentType?: 'CheckboxGroup';
|
|
191
|
+
};
|
|
192
|
+
CheckboxOne: LunaticBaseProps<string | null> & {
|
|
193
|
+
options: Array<InterpretedOption>;
|
|
194
|
+
response: { name: string };
|
|
195
|
+
componentType?: 'CheckboxOne';
|
|
196
|
+
orientation?: 'horizontal' | 'vertical';
|
|
197
|
+
detailAlwaysDisplayed?: boolean;
|
|
198
|
+
};
|
|
199
|
+
Switch: LunaticBaseProps<boolean> & {
|
|
200
|
+
response: { name: string };
|
|
201
|
+
statusLabel?: { true: string; false: string };
|
|
202
|
+
componentType?: 'Switch';
|
|
203
|
+
};
|
|
204
|
+
CheckboxBoolean: LunaticBaseProps<boolean> & {
|
|
205
|
+
response: { name: string };
|
|
206
|
+
componentType?: 'CheckboxBoolean';
|
|
207
|
+
};
|
|
208
|
+
Radio: LunaticBaseProps<string | null> & {
|
|
209
|
+
options: Array<InterpretedOption>;
|
|
210
|
+
checkboxStyle?: boolean;
|
|
211
|
+
response: { name: string };
|
|
212
|
+
componentType?: 'Radio';
|
|
213
|
+
orientation?: 'horizontal' | 'vertical';
|
|
214
|
+
detailAlwaysDisplayed?: boolean;
|
|
215
|
+
};
|
|
216
|
+
Roundabout: LunaticBaseProps<string> & {
|
|
217
|
+
iterations: number;
|
|
218
|
+
goToPage: ReturnType<typeof useLunatic>['goToPage'];
|
|
219
|
+
page: number;
|
|
220
|
+
progressVariable: string;
|
|
221
|
+
locked: boolean;
|
|
222
|
+
items: {
|
|
223
|
+
label?: ReactNode;
|
|
224
|
+
progress: number; // -1: not completed, 0: started, 1: finished
|
|
225
|
+
description?: ReactNode;
|
|
226
|
+
disabled?: boolean;
|
|
227
|
+
}[];
|
|
228
|
+
componentType?: 'Roundabout';
|
|
229
|
+
};
|
|
230
|
+
Dropdown: LunaticBaseProps<string | null> & {
|
|
231
|
+
options: Array<{
|
|
232
|
+
description?: ReactNode;
|
|
233
|
+
label: ReactNode;
|
|
234
|
+
value: string;
|
|
235
|
+
shouldBeFiltered?: boolean;
|
|
236
|
+
}>;
|
|
237
|
+
response: { name: string };
|
|
238
|
+
componentType?: 'Dropdown';
|
|
239
|
+
};
|
|
240
|
+
Textarea: LunaticBaseProps<string> & {
|
|
241
|
+
cols?: number;
|
|
242
|
+
placeHolder?: string;
|
|
243
|
+
maxLength?: number;
|
|
244
|
+
rows?: number;
|
|
245
|
+
response: { name: string };
|
|
246
|
+
componentType?: 'Textarea';
|
|
247
|
+
};
|
|
248
|
+
FilterDescription: Pick<LunaticBaseProps<string>, 'id' | 'label'> & {
|
|
249
|
+
componentType?: 'FilterDescription';
|
|
250
|
+
};
|
|
251
|
+
PairwiseLinks: Omit<LunaticBaseProps, 'value'> & {
|
|
252
|
+
components: LunaticComponentDefinition[];
|
|
253
|
+
features?: LunaticOptions['features'];
|
|
254
|
+
executeExpression: LunaticReducerState['executeExpression'];
|
|
255
|
+
size: number;
|
|
256
|
+
symLinks: Record<string, Record<string, string>>;
|
|
257
|
+
value: Record<string, unknown[]>;
|
|
258
|
+
getComponents: (x: number, y: number) => LunaticComponentProps[];
|
|
259
|
+
componentType?: 'PairwiseLinks';
|
|
260
|
+
};
|
|
261
|
+
Suggester: LunaticBaseProps<string | null> & {
|
|
262
|
+
componentType?: 'Suggester';
|
|
263
|
+
storeName: string;
|
|
264
|
+
optionRenderer: FunctionComponent<{
|
|
265
|
+
option: SuggesterOption;
|
|
266
|
+
placeholder?: string;
|
|
267
|
+
search?: string;
|
|
268
|
+
}>;
|
|
269
|
+
labelRenderer: FunctionComponent<{
|
|
270
|
+
option?: SuggesterOption;
|
|
271
|
+
selected?: boolean;
|
|
272
|
+
search?: string;
|
|
273
|
+
}>;
|
|
274
|
+
focused: boolean;
|
|
275
|
+
response: { name: string };
|
|
276
|
+
optionResponses?: { name: string; attribute: string }[];
|
|
277
|
+
arbitrary?: {
|
|
210
278
|
response: { name: string };
|
|
211
|
-
componentType?: 'CheckboxOne';
|
|
212
|
-
orientation?: 'horizontal' | 'vertical';
|
|
213
|
-
detailAlwaysDisplayed?: boolean;
|
|
214
279
|
};
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
Radio: LunaticBaseProps<string | null> &
|
|
227
|
-
LunaticExtraProps & {
|
|
228
|
-
options: Array<InterpretedOption>;
|
|
229
|
-
checkboxStyle?: boolean;
|
|
230
|
-
response: { name: string };
|
|
231
|
-
componentType?: 'Radio';
|
|
232
|
-
orientation?: 'horizontal' | 'vertical';
|
|
233
|
-
detailAlwaysDisplayed?: boolean;
|
|
234
|
-
};
|
|
235
|
-
Roundabout: LunaticBaseProps<string> &
|
|
236
|
-
LunaticExtraProps & {
|
|
237
|
-
iterations: number;
|
|
238
|
-
goToPage: ReturnType<typeof useLunatic>['goToPage'];
|
|
239
|
-
page: number;
|
|
240
|
-
progressVariable: string;
|
|
241
|
-
locked: boolean;
|
|
242
|
-
items: {
|
|
243
|
-
label?: ReactNode;
|
|
244
|
-
progress: number; // -1: not completed, 0: started, 1: finished
|
|
245
|
-
description?: ReactNode;
|
|
246
|
-
disabled?: boolean;
|
|
247
|
-
}[];
|
|
248
|
-
componentType?: 'Roundabout';
|
|
249
|
-
};
|
|
250
|
-
Dropdown: LunaticBaseProps<string | null> &
|
|
251
|
-
LunaticExtraProps & {
|
|
252
|
-
options: Array<{
|
|
253
|
-
description?: ReactNode;
|
|
254
|
-
label: ReactNode;
|
|
255
|
-
value: string;
|
|
256
|
-
shouldBeFiltered?: boolean;
|
|
257
|
-
}>;
|
|
258
|
-
response: { name: string };
|
|
259
|
-
componentType?: 'Dropdown';
|
|
260
|
-
};
|
|
261
|
-
Textarea: LunaticBaseProps<string> &
|
|
262
|
-
LunaticExtraProps & {
|
|
263
|
-
cols?: number;
|
|
264
|
-
placeHolder?: string;
|
|
265
|
-
maxLength?: number;
|
|
266
|
-
rows?: number;
|
|
267
|
-
response: { name: string };
|
|
268
|
-
componentType?: 'Textarea';
|
|
269
|
-
};
|
|
270
|
-
FilterDescription: Pick<LunaticBaseProps<string>, 'id' | 'label'> &
|
|
271
|
-
LunaticExtraProps & {
|
|
272
|
-
componentType?: 'FilterDescription';
|
|
273
|
-
};
|
|
274
|
-
PairwiseLinks: Omit<LunaticBaseProps, 'value'> &
|
|
275
|
-
LunaticExtraProps & {
|
|
276
|
-
components: LunaticComponentDefinition[];
|
|
277
|
-
features?: LunaticOptions['features'];
|
|
278
|
-
executeExpression: LunaticReducerState['executeExpression'];
|
|
279
|
-
xAxisIterations: number;
|
|
280
|
-
yAxisIterations: number;
|
|
281
|
-
symLinks: Record<string, Record<string, string>>;
|
|
282
|
-
value: Record<string, unknown[]>;
|
|
283
|
-
getComponents: (x: number, y: number) => LunaticComponentProps[];
|
|
284
|
-
componentType?: 'PairwiseLinks';
|
|
285
|
-
};
|
|
286
|
-
Suggester: LunaticBaseProps<string | null> &
|
|
287
|
-
LunaticExtraProps & {
|
|
288
|
-
componentType?: 'Suggester';
|
|
289
|
-
storeName: string;
|
|
290
|
-
optionRenderer: FunctionComponent<{
|
|
291
|
-
option: SuggesterOption;
|
|
292
|
-
placeholder?: string;
|
|
293
|
-
search?: string;
|
|
294
|
-
}>;
|
|
295
|
-
labelRenderer: FunctionComponent<{
|
|
296
|
-
option?: SuggesterOption;
|
|
297
|
-
selected?: boolean;
|
|
298
|
-
search?: string;
|
|
299
|
-
}>;
|
|
300
|
-
focused: boolean;
|
|
301
|
-
response: { name: string };
|
|
302
|
-
optionResponses?: { name: string; attribute: string }[];
|
|
303
|
-
arbitrary?: {
|
|
304
|
-
response: { name: string };
|
|
305
|
-
};
|
|
306
|
-
arbitraryValue?: string;
|
|
307
|
-
allowArbitrary?: boolean;
|
|
308
|
-
executeExpression: LunaticReducerState['executeExpression'];
|
|
309
|
-
iteration: LunaticReducerState['pager']['iteration'];
|
|
310
|
-
};
|
|
311
|
-
Summary: LunaticBaseProps<string | null> &
|
|
312
|
-
LunaticExtraProps & {
|
|
313
|
-
componentType?: 'Summary';
|
|
314
|
-
executeExpression: LunaticReducerState['executeExpression'];
|
|
315
|
-
sections: Array<{
|
|
280
|
+
arbitraryValue?: string;
|
|
281
|
+
allowArbitrary?: boolean;
|
|
282
|
+
executeExpression: LunaticReducerState['executeExpression'];
|
|
283
|
+
iteration: LunaticReducerState['pager']['iteration'];
|
|
284
|
+
};
|
|
285
|
+
Summary: LunaticBaseProps<string | null> & {
|
|
286
|
+
componentType?: 'Summary';
|
|
287
|
+
executeExpression: LunaticReducerState['executeExpression'];
|
|
288
|
+
sections: Array<{
|
|
289
|
+
id: string;
|
|
290
|
+
responses?: Array<{
|
|
316
291
|
id: string;
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
label: VtlExpression;
|
|
320
|
-
value: VtlExpression;
|
|
321
|
-
}>;
|
|
322
|
-
title?: VtlExpression;
|
|
323
|
-
iterations?: VtlExpression;
|
|
292
|
+
label: VtlExpression;
|
|
293
|
+
value: VtlExpression;
|
|
324
294
|
}>;
|
|
325
|
-
|
|
295
|
+
title?: VtlExpression;
|
|
296
|
+
iterations?: VtlExpression;
|
|
297
|
+
}>;
|
|
298
|
+
};
|
|
326
299
|
};
|
|
327
300
|
|
|
328
301
|
export type LunaticComponentType = keyof ComponentPropsByType;
|
package/src/index.ts
CHANGED
|
@@ -29,10 +29,7 @@ export type {
|
|
|
29
29
|
LunaticChangesHandler,
|
|
30
30
|
} from './use-lunatic/type';
|
|
31
31
|
|
|
32
|
-
export type {
|
|
33
|
-
LunaticComponentProps,
|
|
34
|
-
LunaticExtraProps,
|
|
35
|
-
} from './components/type';
|
|
32
|
+
export type { LunaticComponentProps } from './components/type';
|
|
36
33
|
export type { LunaticSlotComponents } from './components/shared/HOC/slottableComponent';
|
|
37
34
|
export type { LunaticSource } from './use-lunatic/type';
|
|
38
35
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { dataFromObject } from '../../utils/object';
|
|
1
2
|
import {
|
|
2
3
|
type Orchestrator,
|
|
3
4
|
OrchestratorMeta,
|
|
@@ -10,6 +11,7 @@ import sourceGroupDetail from './sourceGroupDetail.json';
|
|
|
10
11
|
import sourceGroupLoop from './sourceGroupLoop.json';
|
|
11
12
|
import sourceOne from './sourceOne.json';
|
|
12
13
|
import sourceOneDetail from './sourceOneDetail.json';
|
|
14
|
+
import sourceOneDynamicOptions from './sourceOneDynamicOptions.json';
|
|
13
15
|
|
|
14
16
|
import { Meta } from '@storybook/react';
|
|
15
17
|
|
|
@@ -73,3 +75,14 @@ export const CheckboxOneWithDetail: OrchestratorStory = {
|
|
|
73
75
|
source: sourceOneDetail,
|
|
74
76
|
},
|
|
75
77
|
};
|
|
78
|
+
|
|
79
|
+
export const CheckboxOneDynamicOptions: OrchestratorStory = {
|
|
80
|
+
args: {
|
|
81
|
+
source: sourceOneDynamicOptions,
|
|
82
|
+
data: dataFromObject({
|
|
83
|
+
NBHAB: 3,
|
|
84
|
+
PRENOM: ['Verso', 'Maëlle', 'Aline'],
|
|
85
|
+
AGE: [30, 16, 50],
|
|
86
|
+
}),
|
|
87
|
+
},
|
|
88
|
+
};
|