@inseefr/lunatic 3.5.0-rc.0 → 3.5.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Datepicker/Datepicker.js +1 -1
- package/components/Datepicker/Datepicker.js.map +1 -1
- package/components/Duration/Duration.js +3 -2
- package/components/Duration/Duration.js.map +1 -1
- package/components/Input/Input.js +6 -3
- package/components/Input/Input.js.map +1 -1
- package/components/Input/Input.spec.js +25 -0
- package/components/Input/Input.spec.js.map +1 -1
- package/components/InputNumber/InputNumber.js +1 -1
- package/components/InputNumber/InputNumber.js.map +1 -1
- package/components/InputNumber/InputNumber.spec.js +9 -1
- package/components/InputNumber/InputNumber.spec.js.map +1 -1
- package/components/InputNumber/InputNumberThousand.d.ts +2 -1
- package/components/InputNumber/InputNumberThousand.js +8 -2
- package/components/InputNumber/InputNumberThousand.js.map +1 -1
- package/components/Loop/Loop.js +1 -1
- package/components/Loop/Loop.js.map +1 -1
- package/components/Loop/Loop.spec.d.ts +1 -0
- package/components/Loop/Loop.spec.js +39 -0
- package/components/Loop/Loop.spec.js.map +1 -0
- package/components/Roundabout/CustomRoundabout.d.ts +1 -1
- package/components/Roundabout/CustomRoundabout.js +4 -3
- package/components/Roundabout/CustomRoundabout.js.map +1 -1
- package/components/Roundabout/roundabout.spec.js +3 -1
- package/components/Roundabout/roundabout.spec.js.map +1 -1
- package/components/Textarea/Textarea.js +4 -1
- package/components/Textarea/Textarea.js.map +1 -1
- package/components/Textarea/Textarea.spec.js +13 -0
- package/components/Textarea/Textarea.spec.js.map +1 -1
- package/components/shared/CharactersCount/CharactersCount.d.ts +7 -0
- package/components/shared/CharactersCount/CharactersCount.js +20 -0
- package/components/shared/CharactersCount/CharactersCount.js.map +1 -0
- package/components/shared/CharactersCount/CharactersCount.spec.d.ts +1 -0
- package/components/shared/CharactersCount/CharactersCount.spec.js +28 -0
- package/components/shared/CharactersCount/CharactersCount.spec.js.map +1 -0
- package/components/shared/Label/Label.js +1 -1
- package/components/shared/Label/Label.js.map +1 -1
- package/components/shared/Label/Label.spec.js +11 -3
- package/components/shared/Label/Label.spec.js.map +1 -1
- package/components/shared/utils/getCharactersCountId.d.ts +4 -0
- package/components/shared/utils/getCharactersCountId.js +10 -0
- package/components/shared/utils/getCharactersCountId.js.map +1 -0
- package/components/type.d.ts +1 -0
- package/esm/components/Datepicker/Datepicker.js +1 -1
- package/esm/components/Datepicker/Datepicker.js.map +1 -1
- package/esm/components/Duration/Duration.js +3 -2
- package/esm/components/Duration/Duration.js.map +1 -1
- package/esm/components/Input/Input.js +6 -3
- package/esm/components/Input/Input.js.map +1 -1
- package/esm/components/Input/Input.spec.js +25 -0
- package/esm/components/Input/Input.spec.js.map +1 -1
- package/esm/components/InputNumber/InputNumber.js +1 -1
- package/esm/components/InputNumber/InputNumber.js.map +1 -1
- package/esm/components/InputNumber/InputNumber.spec.js +9 -1
- package/esm/components/InputNumber/InputNumber.spec.js.map +1 -1
- package/esm/components/InputNumber/InputNumberThousand.d.ts +2 -1
- package/esm/components/InputNumber/InputNumberThousand.js +8 -2
- package/esm/components/InputNumber/InputNumberThousand.js.map +1 -1
- package/esm/components/Loop/Loop.js +1 -1
- package/esm/components/Loop/Loop.js.map +1 -1
- package/esm/components/Loop/Loop.spec.d.ts +1 -0
- package/esm/components/Loop/Loop.spec.js +37 -0
- package/esm/components/Loop/Loop.spec.js.map +1 -0
- package/esm/components/Roundabout/CustomRoundabout.d.ts +1 -1
- package/esm/components/Roundabout/CustomRoundabout.js +4 -3
- package/esm/components/Roundabout/CustomRoundabout.js.map +1 -1
- package/esm/components/Roundabout/roundabout.spec.js +3 -1
- package/esm/components/Roundabout/roundabout.spec.js.map +1 -1
- package/esm/components/Textarea/Textarea.js +4 -1
- package/esm/components/Textarea/Textarea.js.map +1 -1
- package/esm/components/Textarea/Textarea.spec.js +13 -0
- package/esm/components/Textarea/Textarea.spec.js.map +1 -1
- package/esm/components/shared/CharactersCount/CharactersCount.d.ts +7 -0
- package/esm/components/shared/CharactersCount/CharactersCount.js +15 -0
- package/esm/components/shared/CharactersCount/CharactersCount.js.map +1 -0
- package/esm/components/shared/CharactersCount/CharactersCount.spec.d.ts +1 -0
- package/esm/components/shared/CharactersCount/CharactersCount.spec.js +26 -0
- package/esm/components/shared/CharactersCount/CharactersCount.spec.js.map +1 -0
- package/esm/components/shared/Label/Label.js +1 -1
- package/esm/components/shared/Label/Label.js.map +1 -1
- package/esm/components/shared/Label/Label.spec.js +11 -3
- package/esm/components/shared/Label/Label.spec.js.map +1 -1
- package/esm/components/shared/utils/getCharactersCountId.d.ts +4 -0
- package/esm/components/shared/utils/getCharactersCountId.js +7 -0
- package/esm/components/shared/utils/getCharactersCountId.js.map +1 -0
- package/esm/components/type.d.ts +1 -0
- package/esm/main.css +20 -0
- package/esm/main.css.map +1 -1
- package/esm/stories/overview/sourceWithHierarchy.json +5151 -0
- package/esm/tests/utils/lunatic.d.ts +0 -4
- package/esm/tests/utils/lunatic.js +0 -4
- package/esm/tests/utils/lunatic.js.map +1 -1
- package/esm/type.source.d.ts +6 -6
- package/esm/type.source.js +0 -1
- package/esm/type.source.js.map +1 -1
- package/esm/use-lunatic/commons/page.js +8 -0
- package/esm/use-lunatic/commons/page.js.map +1 -1
- package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.d.ts +1 -1
- package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +111 -14
- package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js.map +1 -1
- package/esm/use-lunatic/commons/variables/get-questionnaire-data.js +0 -8
- package/esm/use-lunatic/commons/variables/get-questionnaire-data.js.map +1 -1
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.d.ts +2 -2
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.js +5 -3
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -1
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js +164 -8
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -1
- package/esm/use-lunatic/hooks/use-page-has-response.js +50 -35
- package/esm/use-lunatic/hooks/use-page-has-response.js.map +1 -1
- package/esm/use-lunatic/hooks/useOverview.d.ts +1 -1
- package/esm/use-lunatic/hooks/useOverview.js +19 -14
- package/esm/use-lunatic/hooks/useOverview.js.map +1 -1
- package/esm/use-lunatic/hooks/useOverview.spec.d.ts +1 -0
- package/esm/use-lunatic/hooks/useOverview.spec.js +38 -0
- package/esm/use-lunatic/hooks/useOverview.spec.js.map +1 -0
- package/esm/use-lunatic/props/getComponentTypeProps.d.ts +1 -0
- package/esm/use-lunatic/props/propValue.js +18 -6
- package/esm/use-lunatic/props/propValue.js.map +1 -1
- package/esm/use-lunatic/props/propValue.spec.js +97 -2
- package/esm/use-lunatic/props/propValue.spec.js.map +1 -1
- package/esm/use-lunatic/reducer/reducerInitializer.d.ts +2 -2
- package/esm/use-lunatic/reducer/reducerInitializer.js +25 -32
- package/esm/use-lunatic/reducer/reducerInitializer.js.map +1 -1
- package/esm/use-lunatic/test.utils.d.ts +2 -0
- package/esm/use-lunatic/test.utils.js +13 -0
- package/esm/use-lunatic/test.utils.js.map +1 -0
- package/esm/use-lunatic/type.d.ts +0 -4
- package/esm/use-lunatic/use-lunatic.d.ts +1 -2
- package/esm/use-lunatic/use-lunatic.js.map +1 -1
- package/esm/utils/cast.d.ts +19 -0
- package/esm/utils/cast.js +63 -0
- package/esm/utils/cast.js.map +1 -0
- package/esm/utils/constants/variable-status.d.ts +0 -4
- package/esm/utils/constants/variable-status.js +0 -4
- package/esm/utils/constants/variable-status.js.map +1 -1
- package/esm/utils/variables.spec.js +0 -8
- package/esm/utils/variables.spec.js.map +1 -1
- package/main.css +20 -0
- package/main.css.map +1 -1
- package/package.json +61 -69
- package/src/components/Datepicker/Datepicker.tsx +1 -1
- package/src/components/Datepicker/__snapshots__/Datepicker.spec.tsx.snap +2 -2
- package/src/components/Duration/Duration.test.tsx +52 -0
- package/src/components/Duration/Duration.tsx +17 -4
- package/src/components/Input/Input.spec.tsx +34 -0
- package/src/components/Input/Input.tsx +26 -18
- package/src/components/Input/__snapshots__/Input.spec.tsx.snap +38 -19
- package/src/components/InputNumber/InputNumber.spec.tsx +15 -1
- package/src/components/InputNumber/InputNumber.tsx +1 -0
- package/src/components/InputNumber/InputNumberThousand.tsx +11 -1
- package/src/components/Loop/Loop.spec.tsx +77 -0
- package/src/components/Loop/Loop.tsx +1 -1
- package/src/components/RosterForLoop/__snapshots__/RosterForLoop.spec.tsx.snap +42 -20
- package/src/components/Roundabout/CustomRoundabout.tsx +13 -4
- package/src/components/Roundabout/roundabout.spec.tsx +3 -0
- package/src/components/Textarea/Textarea.spec.tsx +18 -0
- package/src/components/Textarea/Textarea.tsx +21 -13
- package/src/components/Textarea/__snapshots__/Textarea.spec.tsx.snap +21 -11
- package/src/components/shared/CharactersCount/CharactersCount.spec.tsx +31 -0
- package/src/components/shared/CharactersCount/CharactersCount.tsx +27 -0
- package/src/components/shared/Label/Label.spec.tsx +15 -3
- package/src/components/shared/Label/Label.tsx +1 -1
- package/src/components/shared/utils/getCharactersCountId.test.ts +14 -0
- package/src/components/shared/utils/getCharactersCountId.ts +6 -0
- package/src/components/type.ts +1 -0
- package/src/css/components/Input.scss +10 -0
- package/src/css/components/Roundabout.scss +10 -0
- package/src/stories/accordion/source.json +1 -5
- package/src/stories/behaviour/cleaning/cleaning.stories.jsx +11 -0
- package/src/stories/behaviour/cleaning/loop.json +246 -0
- package/src/stories/behaviour/cleaning/source-loop.json +3 -15
- package/src/stories/behaviour/cleaning/source.json +2 -10
- package/src/stories/behaviour/controls/boucles-n.json +2 -10
- package/src/stories/behaviour/controls/loop.json +2 -10
- package/src/stories/behaviour/controls/roundabout.json +3 -15
- package/src/stories/behaviour/controls/simple-numeric.json +19 -95
- package/src/stories/behaviour/controls/simple.json +7 -35
- package/src/stories/behaviour/filter/dataLoop.json +0 -8
- package/src/stories/behaviour/filter/source.json +0 -12
- package/src/stories/behaviour/filter/sourceLoop.json +0 -12
- package/src/stories/behaviour/missing/source.json +12 -60
- package/src/stories/behaviour/others/V2_DeclarationsSimples.json +14 -70
- package/src/stories/behaviour/others/V2_MinMaxSum_Boucles.json +5 -25
- package/src/stories/behaviour/others/V2_QuestSimple_Boucles.json +107 -535
- package/src/stories/behaviour/others/V2_TCMRallyeGames.json +33 -165
- package/src/stories/behaviour/others/test-dylan.json +5 -25
- package/src/stories/behaviour/paste/source.json +1 -5
- package/src/stories/behaviour/performance/performance.stories.jsx +9 -1
- package/src/stories/behaviour/performance/source.json +4 -20
- package/src/stories/behaviour/performance/srcv.json +44747 -0
- package/src/stories/behaviour/resizing/source-resizing-cleaning.json +2 -10
- package/src/stories/behaviour/resizing/source.json +5 -25
- package/src/stories/checkbox-boolean/source.json +1 -5
- package/src/stories/checkbox-group/source.json +16 -80
- package/src/stories/checkbox-group/sourceCondition.json +3 -15
- package/src/stories/checkbox-group/sourceDetail.json +18 -90
- package/src/stories/checkbox-group/sourceLoop.json +2 -10
- package/src/stories/checkbox-one/source.json +1 -5
- package/src/stories/checkbox-one/sourceDetail.json +2 -10
- package/src/stories/date-picker/source.json +1 -5
- package/src/stories/declaration/source.json +2 -10
- package/src/stories/disabled/data.json +0 -16
- package/src/stories/disabled/source.json +7 -35
- package/src/stories/dropdown/data.json +2 -10
- package/src/stories/dropdown/source.json +2 -10
- package/src/stories/duration/mois.json +1 -5
- package/src/stories/duration/time.json +1 -5
- package/src/stories/filter-description/source-options.json +3 -15
- package/src/stories/input/source.json +1 -5
- package/src/stories/input-number/input-number.stories.jsx +5 -0
- package/src/stories/input-number/source-big-number.json +27 -0
- package/src/stories/input-number/source-euro.json +2 -6
- package/src/stories/input-number/source.json +1 -5
- package/src/stories/loop/source-bloc.json +2 -10
- package/src/stories/loop/source-paginated.json +2 -10
- package/src/stories/loop/source-roster.json +2 -10
- package/src/stories/loop/source-with-header.json +2 -10
- package/src/stories/overview/dataLoop.json +24 -120
- package/src/stories/overview/overview.stories.jsx +9 -0
- package/src/stories/overview/source.json +1 -5
- package/src/stories/overview/sourceLoop.json +24 -120
- package/src/stories/overview/sourceWithHierarchy.json +164 -820
- package/src/stories/pairwise/source.json +5 -25
- package/src/stories/question/source.json +2 -10
- package/src/stories/questionnaires/logement/data.json +0 -1288
- package/src/stories/questionnaires/logement/source-sequence.json +564 -2820
- package/src/stories/questionnaires/logement/source-sum.json +280 -1400
- package/src/stories/questionnaires/logement/source.json +564 -2820
- package/src/stories/questionnaires/recensement/source.json +106 -530
- package/src/stories/questionnaires/rp/source.json +8 -40
- package/src/stories/questionnaires/simpsons/source.json +104 -520
- package/src/stories/radio/source.json +1 -5
- package/src/stories/radio/sourceCondition.json +2 -10
- package/src/stories/radio/sourceDetail.json +2 -10
- package/src/stories/radio/sourceHorizontal.json +1 -5
- package/src/stories/roundabout/data1.json +0 -12
- package/src/stories/roundabout/data2.json +0 -16
- package/src/stories/roundabout/source.json +11 -35
- package/src/stories/suggester/source-arbitrary-response.json +6 -30
- package/src/stories/suggester/source-error.json +6 -30
- package/src/stories/suggester/source-multiline.json +0 -16
- package/src/stories/suggester/source-option-responses.json +5 -25
- package/src/stories/suggester/source.json +7 -35
- package/src/stories/summary/data.json +0 -16
- package/src/stories/summary/source.json +7 -35
- package/src/stories/switch/data-forced.json +2 -10
- package/src/stories/switch/source.json +4 -20
- package/src/stories/table/source-colspan.json +8 -40
- package/src/stories/table/table-dynamique.json +1 -5
- package/src/stories/text/source-roster.json +3 -15
- package/src/stories/text/source-table.json +9 -45
- package/src/stories/textarea/source.json +1 -5
- package/src/stories/utils/{SchemaValidator.tsx → SchemaValidator.jsx} +1 -1
- package/src/stories/utils/{orchestrator.tsx → orchestrator.jsx} +9 -13
- package/src/stories/utils/{overview.tsx → overview.jsx} +0 -2
- package/src/tests/utils/lunatic.ts +0 -4
- package/src/type.source.ts +8 -7
- package/src/use-lunatic/__snapshots__/use-lunatic.test.ts.snap +0 -1159
- package/src/use-lunatic/commons/page.ts +10 -0
- package/src/use-lunatic/commons/variables/behaviours/cleaning-behaviour.ts +182 -24
- package/src/use-lunatic/commons/variables/get-questionnaire-data.ts +0 -12
- package/src/use-lunatic/commons/variables/lunatic-variables-store.spec.ts +190 -8
- package/src/use-lunatic/commons/variables/lunatic-variables-store.ts +7 -4
- package/src/use-lunatic/hooks/use-page-has-response.test.ts +200 -0
- package/src/use-lunatic/hooks/use-page-has-response.ts +67 -44
- package/src/use-lunatic/hooks/useOverview.spec.ts +42 -0
- package/src/use-lunatic/hooks/useOverview.ts +41 -18
- package/src/use-lunatic/props/propValue.spec.ts +105 -2
- package/src/use-lunatic/props/propValue.ts +26 -8
- package/src/use-lunatic/reducer/reducerInitializer.tsx +31 -41
- package/src/use-lunatic/test.utils.ts +17 -0
- package/src/use-lunatic/type.ts +0 -4
- package/src/use-lunatic/use-lunatic.test.ts +2 -21
- package/src/use-lunatic/use-lunatic.ts +5 -4
- package/src/utils/cast.ts +67 -0
- package/src/utils/constants/variable-status.ts +0 -4
- package/src/utils/variables.spec.ts +0 -8
- package/stories/overview/sourceWithHierarchy.json +5151 -0
- package/tests/utils/lunatic.d.ts +0 -4
- package/tests/utils/lunatic.js +0 -4
- package/tests/utils/lunatic.js.map +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/type.source.d.ts +6 -6
- package/type.source.js +0 -1
- package/type.source.js.map +1 -1
- package/use-lunatic/commons/page.js +8 -0
- package/use-lunatic/commons/page.js.map +1 -1
- package/use-lunatic/commons/variables/behaviours/cleaning-behaviour.d.ts +1 -1
- package/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +111 -14
- package/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js.map +1 -1
- package/use-lunatic/commons/variables/get-questionnaire-data.js +0 -8
- package/use-lunatic/commons/variables/get-questionnaire-data.js.map +1 -1
- package/use-lunatic/commons/variables/lunatic-variables-store.d.ts +2 -2
- package/use-lunatic/commons/variables/lunatic-variables-store.js +5 -3
- package/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -1
- package/use-lunatic/commons/variables/lunatic-variables-store.spec.js +187 -8
- package/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -1
- package/use-lunatic/hooks/use-page-has-response.js +49 -34
- package/use-lunatic/hooks/use-page-has-response.js.map +1 -1
- package/use-lunatic/hooks/useOverview.d.ts +1 -1
- package/use-lunatic/hooks/useOverview.js +19 -14
- package/use-lunatic/hooks/useOverview.js.map +1 -1
- package/use-lunatic/hooks/useOverview.spec.d.ts +1 -0
- package/use-lunatic/hooks/useOverview.spec.js +43 -0
- package/use-lunatic/hooks/useOverview.spec.js.map +1 -0
- package/use-lunatic/props/getComponentTypeProps.d.ts +1 -0
- package/use-lunatic/props/propValue.js +18 -6
- package/use-lunatic/props/propValue.js.map +1 -1
- package/use-lunatic/props/propValue.spec.js +97 -2
- package/use-lunatic/props/propValue.spec.js.map +1 -1
- package/use-lunatic/reducer/reducerInitializer.d.ts +2 -2
- package/use-lunatic/reducer/reducerInitializer.js +25 -32
- package/use-lunatic/reducer/reducerInitializer.js.map +1 -1
- package/use-lunatic/test.utils.d.ts +2 -0
- package/use-lunatic/test.utils.js +17 -0
- package/use-lunatic/test.utils.js.map +1 -0
- package/use-lunatic/type.d.ts +0 -4
- package/use-lunatic/use-lunatic.d.ts +1 -2
- package/use-lunatic/use-lunatic.js.map +1 -1
- package/utils/cast.d.ts +19 -0
- package/utils/cast.js +70 -0
- package/utils/cast.js.map +1 -0
- package/utils/constants/variable-status.d.ts +0 -4
- package/utils/constants/variable-status.js +1 -5
- package/utils/constants/variable-status.js.map +1 -1
- package/utils/variables.spec.js +0 -8
- package/utils/variables.spec.js.map +1 -1
- package/constants/component-types.d.ts +0 -1
- package/constants/component-types.js +0 -5
- package/constants/component-types.js.map +0 -1
- package/constants/declarations.d.ts +0 -9
- package/constants/declarations.js +0 -15
- package/constants/declarations.js.map +0 -1
- package/constants/event-types.d.ts +0 -10
- package/constants/event-types.js +0 -16
- package/constants/event-types.js.map +0 -1
- package/constants/index.d.ts +0 -5
- package/constants/index.js +0 -22
- package/constants/index.js.map +0 -1
- package/constants/indexedDBStore.d.ts +0 -21
- package/constants/indexedDBStore.js +0 -22
- package/constants/indexedDBStore.js.map +0 -1
- package/constants/supported-preferences.d.ts +0 -1
- package/constants/supported-preferences.js +0 -36
- package/constants/supported-preferences.js.map +0 -1
- package/constants/value-types.d.ts +0 -5
- package/constants/value-types.js +0 -9
- package/constants/value-types.js.map +0 -1
- package/constants/variable-types.d.ts +0 -2
- package/constants/variable-types.js +0 -8
- package/constants/variable-types.js.map +0 -1
- package/esm/constants/component-types.d.ts +0 -1
- package/esm/constants/component-types.js +0 -2
- package/esm/constants/component-types.js.map +0 -1
- package/esm/constants/declarations.d.ts +0 -9
- package/esm/constants/declarations.js +0 -12
- package/esm/constants/declarations.js.map +0 -1
- package/esm/constants/event-types.d.ts +0 -10
- package/esm/constants/event-types.js +0 -13
- package/esm/constants/event-types.js.map +0 -1
- package/esm/constants/index.d.ts +0 -5
- package/esm/constants/index.js +0 -6
- package/esm/constants/index.js.map +0 -1
- package/esm/constants/indexedDBStore.d.ts +0 -21
- package/esm/constants/indexedDBStore.js +0 -19
- package/esm/constants/indexedDBStore.js.map +0 -1
- package/esm/constants/supported-preferences.d.ts +0 -1
- package/esm/constants/supported-preferences.js +0 -10
- package/esm/constants/supported-preferences.js.map +0 -1
- package/esm/constants/value-types.d.ts +0 -5
- package/esm/constants/value-types.js +0 -6
- package/esm/constants/value-types.js.map +0 -1
- package/esm/constants/variable-types.d.ts +0 -2
- package/esm/constants/variable-types.js +0 -5
- package/esm/constants/variable-types.js.map +0 -1
- package/esm/hooks/useArticulation.d.ts +0 -58
- package/esm/hooks/useArticulation.js +0 -81
- package/esm/hooks/useArticulation.js.map +0 -1
- package/hooks/useArticulation.d.ts +0 -58
- package/hooks/useArticulation.js +0 -81
- package/hooks/useArticulation.js.map +0 -1
- package/src/constants/component-types.ts +0 -1
- package/src/constants/declarations.ts +0 -14
- package/src/constants/event-types.ts +0 -13
- package/src/constants/index.ts +0 -5
- package/src/constants/indexedDBStore.ts +0 -20
- package/src/constants/supported-preferences.ts +0 -10
- package/src/constants/value-types.ts +0 -5
- package/src/constants/variable-types.ts +0 -4
- package/src/hooks/useArticulation.ts +0 -124
- package/src/stories/behaviour/articulation/articulation.stories.tsx +0 -105
- package/src/stories/behaviour/articulation/roundabout.json +0 -348
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import Orchestrator from '../../utils/orchestrator';
|
|
2
|
-
import source from './roundabout.json';
|
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
import { useArticulation } from '../../../hooks/useArticulation';
|
|
6
|
-
|
|
7
|
-
type Source = Parameters<typeof useArticulation>[0];
|
|
8
|
-
type Data = Parameters<typeof useArticulation>[1];
|
|
9
|
-
|
|
10
|
-
type Props = {
|
|
11
|
-
source: Source;
|
|
12
|
-
data: Data;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
function StoryComponent({ source, data }: Props) {
|
|
16
|
-
const [page, setPage] = useState(null as null | string);
|
|
17
|
-
const gotoNav = () => setPage(null);
|
|
18
|
-
const { items } = useArticulation(source, data);
|
|
19
|
-
|
|
20
|
-
if (page) {
|
|
21
|
-
return (
|
|
22
|
-
<div>
|
|
23
|
-
{page}
|
|
24
|
-
<button onClick={gotoNav}>< Revenir à l'articulation</button>
|
|
25
|
-
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
|
|
26
|
-
{/*/ @ts-ignore */}
|
|
27
|
-
<Orchestrator source={source} data={data} initialPage={page} />
|
|
28
|
-
</div>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const progressLabel = (n: number) => {
|
|
33
|
-
if (n === -1) {
|
|
34
|
-
return 'Commencer';
|
|
35
|
-
}
|
|
36
|
-
if (n === 0) {
|
|
37
|
-
return 'Continuer';
|
|
38
|
-
}
|
|
39
|
-
return 'Complété';
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div>
|
|
44
|
-
<h2>Articulation</h2>
|
|
45
|
-
<table style={{ borderCollapse: 'collapse' }}>
|
|
46
|
-
<thead>
|
|
47
|
-
<tr>
|
|
48
|
-
{items[0].cells.map((cell, k) => (
|
|
49
|
-
<th
|
|
50
|
-
style={{ border: 'solid 1px #00000024', padding: '.5rem 1rem' }}
|
|
51
|
-
key={k}
|
|
52
|
-
>
|
|
53
|
-
{cell.label}
|
|
54
|
-
</th>
|
|
55
|
-
))}
|
|
56
|
-
<th>Actions</th>
|
|
57
|
-
</tr>
|
|
58
|
-
</thead>
|
|
59
|
-
<tbody>
|
|
60
|
-
{items.map((item, k) => (
|
|
61
|
-
<tr key={k}>
|
|
62
|
-
{item.cells.map((cell, kk) => (
|
|
63
|
-
<td
|
|
64
|
-
key={kk}
|
|
65
|
-
style={{
|
|
66
|
-
border: 'solid 1px #00000024',
|
|
67
|
-
padding: '.5rem 1rem',
|
|
68
|
-
}}
|
|
69
|
-
>
|
|
70
|
-
{cell.value}
|
|
71
|
-
</td>
|
|
72
|
-
))}
|
|
73
|
-
<td
|
|
74
|
-
style={{
|
|
75
|
-
border: 'solid 1px #00000024',
|
|
76
|
-
padding: '.5rem 1rem',
|
|
77
|
-
}}
|
|
78
|
-
>
|
|
79
|
-
<button onClick={() => console.log('ToDo')}>
|
|
80
|
-
{progressLabel(item.progress)}
|
|
81
|
-
</button>
|
|
82
|
-
</td>
|
|
83
|
-
</tr>
|
|
84
|
-
))}
|
|
85
|
-
</tbody>
|
|
86
|
-
</table>
|
|
87
|
-
</div>
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const meta: Meta<typeof StoryComponent> = {
|
|
92
|
-
title: 'Behaviour/Articulation',
|
|
93
|
-
component: StoryComponent,
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export default meta;
|
|
97
|
-
|
|
98
|
-
type Story = StoryObj<typeof StoryComponent>;
|
|
99
|
-
|
|
100
|
-
export const Basic: Story = {
|
|
101
|
-
args: {
|
|
102
|
-
source: source as Source,
|
|
103
|
-
data: {},
|
|
104
|
-
},
|
|
105
|
-
};
|
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../../../lunatic-schema.json",
|
|
3
|
-
"maxPage": "4",
|
|
4
|
-
"articulation": {
|
|
5
|
-
"source": "roundabout",
|
|
6
|
-
"items": [
|
|
7
|
-
{
|
|
8
|
-
"label": "Prénom",
|
|
9
|
-
"value": "PRENOMS"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"label": "Sexe",
|
|
13
|
-
"value": "if SEXE = \"H\" then \"Homme\" else \"Femme\""
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"label": "Age",
|
|
17
|
-
"value": "cast(AGE, string) || \" ans\""
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
"components": [
|
|
22
|
-
{
|
|
23
|
-
"id": "how",
|
|
24
|
-
"componentType": "InputNumber",
|
|
25
|
-
"mandatory": false,
|
|
26
|
-
"page": "1",
|
|
27
|
-
"min": 1,
|
|
28
|
-
"max": 10,
|
|
29
|
-
"decimals": 0,
|
|
30
|
-
"label": {
|
|
31
|
-
"value": "\"Combien de personnes vivent habituellement à votre adresse ?\"",
|
|
32
|
-
"type": "VTL|MD"
|
|
33
|
-
},
|
|
34
|
-
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
35
|
-
"response": { "name": "NB_HAB" }
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"id": "loop",
|
|
39
|
-
"componentType": "Loop",
|
|
40
|
-
"page": "2",
|
|
41
|
-
"depth": 1,
|
|
42
|
-
"paginatedLoop": false,
|
|
43
|
-
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
44
|
-
"loopDependencies": ["NHAB"],
|
|
45
|
-
"lines": {
|
|
46
|
-
"min": { "value": "NB_HAB", "type": "VTL" },
|
|
47
|
-
"max": { "value": "NB_HAB", "type": "VTL" }
|
|
48
|
-
},
|
|
49
|
-
"components": [
|
|
50
|
-
{
|
|
51
|
-
"id": "prenom",
|
|
52
|
-
"componentType": "Input",
|
|
53
|
-
"mandatory": false,
|
|
54
|
-
"maxLength": 20,
|
|
55
|
-
"label": {
|
|
56
|
-
"value": "\"Prénom\"))",
|
|
57
|
-
"type": "VTL|MD"
|
|
58
|
-
},
|
|
59
|
-
"conditionFilter": {
|
|
60
|
-
"value": "true",
|
|
61
|
-
"type": "VTL"
|
|
62
|
-
},
|
|
63
|
-
"response": { "name": "PRENOMS" }
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"id": "sexe",
|
|
67
|
-
"componentType": "CheckboxOne",
|
|
68
|
-
"mandatory": false,
|
|
69
|
-
"maxLength": 20,
|
|
70
|
-
"label": {
|
|
71
|
-
"value": "\"Sexe\"",
|
|
72
|
-
"type": "VTL|MD"
|
|
73
|
-
},
|
|
74
|
-
"conditionFilter": {
|
|
75
|
-
"value": "true",
|
|
76
|
-
"type": "VTL"
|
|
77
|
-
},
|
|
78
|
-
"options": [
|
|
79
|
-
{
|
|
80
|
-
"value": "H",
|
|
81
|
-
"label": { "value": "\"Homme\"", "type": "VTL|MD" }
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
"value": "F",
|
|
86
|
-
"label": { "value": "\"Femme\"", "type": "VTL|MD" }
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
"response": { "name": "SEXE" }
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"id": "age",
|
|
93
|
-
"componentType": "InputNumber",
|
|
94
|
-
"maxLength": 3,
|
|
95
|
-
"label": {
|
|
96
|
-
"value": "\"Age\"",
|
|
97
|
-
"type": "VTL|MD"
|
|
98
|
-
},
|
|
99
|
-
"conditionFilter": {
|
|
100
|
-
"value": "true",
|
|
101
|
-
"type": "VTL"
|
|
102
|
-
},
|
|
103
|
-
"response": { "name": "AGE" }
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"id": "roundabout",
|
|
109
|
-
"componentType": "Roundabout",
|
|
110
|
-
"page": "3",
|
|
111
|
-
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
112
|
-
"iterations": { "value": "NB_HAB", "type": "VTL" },
|
|
113
|
-
"label": { "value": "\"Libellé du rondpoint\"", "type": "VTL" },
|
|
114
|
-
"locked": true,
|
|
115
|
-
"progressVariable": "PROGRESS",
|
|
116
|
-
"item": {
|
|
117
|
-
"label": {
|
|
118
|
-
"value": "\"Questions de \" || PRENOMS",
|
|
119
|
-
"type": "VTL"
|
|
120
|
-
},
|
|
121
|
-
"description": {
|
|
122
|
-
"value": "if AGE > 18 then \"Aller aux question destinées à \" || PRENOMS else PRENOMS || \" n'est pas majeur, il/elle n'a pas à répondre aux questions\"",
|
|
123
|
-
"type": "VTL"
|
|
124
|
-
},
|
|
125
|
-
"disabled": {
|
|
126
|
-
"value": "AGE < 18",
|
|
127
|
-
"type": "VTL"
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
"controls": [],
|
|
131
|
-
"components": [
|
|
132
|
-
{
|
|
133
|
-
"id": "radio",
|
|
134
|
-
"componentType": "Radio",
|
|
135
|
-
"mandatory": false,
|
|
136
|
-
"page": "3.1",
|
|
137
|
-
"label": {
|
|
138
|
-
"value": "\"Connaissez-vous le recensement de la population ?\"",
|
|
139
|
-
"type": "VTL|MD"
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
143
|
-
|
|
144
|
-
"options": [
|
|
145
|
-
{ "value": "1", "label": { "value": "\"oui\"", "type": "VTL|MD" } },
|
|
146
|
-
|
|
147
|
-
{ "value": "2", "label": { "value": "\"non\"", "type": "VTL|MD" } }
|
|
148
|
-
],
|
|
149
|
-
"response": { "name": "KNOWREC" }
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"id": "jsygk7m7",
|
|
153
|
-
"componentType": "Subsequence",
|
|
154
|
-
"page": "3.2",
|
|
155
|
-
"label": {
|
|
156
|
-
"value": "\"Deuxième page de questions pour \"|| PRENOMS",
|
|
157
|
-
"type": "VTL|MD"
|
|
158
|
-
},
|
|
159
|
-
"conditionFilter": { "value": "true", "type": "VTL" }
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"id": "sexe",
|
|
163
|
-
"componentType": "Radio",
|
|
164
|
-
"page": "3.2",
|
|
165
|
-
"label": {
|
|
166
|
-
"value": "\"Sexe\"",
|
|
167
|
-
"type": "VTL"
|
|
168
|
-
},
|
|
169
|
-
"conditionFilter": {
|
|
170
|
-
"value": "true",
|
|
171
|
-
"type": "VTL"
|
|
172
|
-
},
|
|
173
|
-
"options": [
|
|
174
|
-
{
|
|
175
|
-
"value": "1",
|
|
176
|
-
"label": { "value": "\"Homme\"", "type": "VTL|MD" }
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"value": "2",
|
|
180
|
-
"label": { "value": "\"Femme\"", "type": "VTL|MD" }
|
|
181
|
-
}
|
|
182
|
-
],
|
|
183
|
-
"response": { "name": "SEXE" }
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"id": "jsygk7m7",
|
|
187
|
-
"componentType": "Subsequence",
|
|
188
|
-
"page": "3.3",
|
|
189
|
-
"label": {
|
|
190
|
-
"value": "\"Troisième page de questions \" || PRENOMS",
|
|
191
|
-
"type": "VTL|MD"
|
|
192
|
-
},
|
|
193
|
-
"conditionFilter": { "value": "true", "type": "VTL" }
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
"id": "kmno1n7m",
|
|
197
|
-
"componentType": "Input",
|
|
198
|
-
"maxLength": 30,
|
|
199
|
-
"page": "3.3",
|
|
200
|
-
"label": {
|
|
201
|
-
"value": "\"Dites quelque chose.\"))",
|
|
202
|
-
"type": "VTL|MD"
|
|
203
|
-
},
|
|
204
|
-
"conditionFilter": {
|
|
205
|
-
"value": "true",
|
|
206
|
-
"type": "VTL"
|
|
207
|
-
},
|
|
208
|
-
"response": { "name": "SOMETHING" }
|
|
209
|
-
}
|
|
210
|
-
]
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
"id": "seq",
|
|
214
|
-
"componentType": "Sequence",
|
|
215
|
-
"label": {
|
|
216
|
-
"value": "\"Merci !\"",
|
|
217
|
-
"type": "VTL|MD"
|
|
218
|
-
},
|
|
219
|
-
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
220
|
-
"page": "4"
|
|
221
|
-
}
|
|
222
|
-
],
|
|
223
|
-
"variables": [
|
|
224
|
-
{
|
|
225
|
-
"variableType": "COLLECTED",
|
|
226
|
-
"name": "NB_HAB",
|
|
227
|
-
"values": {
|
|
228
|
-
"PREVIOUS": null,
|
|
229
|
-
"COLLECTED": 2,
|
|
230
|
-
"FORCED": null,
|
|
231
|
-
"EDITED": null,
|
|
232
|
-
"INPUTTED": null
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
"variableType": "COLLECTED",
|
|
237
|
-
"name": "SOMETHING",
|
|
238
|
-
"values": {
|
|
239
|
-
"PREVIOUS": [],
|
|
240
|
-
"COLLECTED": [],
|
|
241
|
-
"FORCED": [],
|
|
242
|
-
"EDITED": [],
|
|
243
|
-
"INPUTTED": []
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
"variableType": "COLLECTED",
|
|
248
|
-
"name": "SEXE",
|
|
249
|
-
"values": {
|
|
250
|
-
"PREVIOUS": null,
|
|
251
|
-
"COLLECTED": ["H", "F"],
|
|
252
|
-
"FORCED": null,
|
|
253
|
-
"EDITED": null,
|
|
254
|
-
"INPUTTED": null
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
"variableType": "COLLECTED",
|
|
259
|
-
"name": "AGE",
|
|
260
|
-
"values": {
|
|
261
|
-
"PREVIOUS": null,
|
|
262
|
-
"COLLECTED": [24, 24],
|
|
263
|
-
"FORCED": null,
|
|
264
|
-
"EDITED": null,
|
|
265
|
-
"INPUTTED": null
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
"variableType": "COLLECTED",
|
|
270
|
-
"name": "SEXE",
|
|
271
|
-
"values": {
|
|
272
|
-
"PREVIOUS": [],
|
|
273
|
-
"COLLECTED": [],
|
|
274
|
-
"FORCED": [],
|
|
275
|
-
"EDITED": [],
|
|
276
|
-
"INPUTTED": []
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
"variableType": "COLLECTED",
|
|
281
|
-
"name": "PRENOMS",
|
|
282
|
-
"values": {
|
|
283
|
-
"PREVIOUS": null,
|
|
284
|
-
"COLLECTED": ["Fanny", "Ines"],
|
|
285
|
-
"FORCED": null,
|
|
286
|
-
"EDITED": null,
|
|
287
|
-
"INPUTTED": null
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
"variableType": "COLLECTED",
|
|
292
|
-
"name": "KNOWREC",
|
|
293
|
-
"values": {
|
|
294
|
-
"PREVIOUS": [],
|
|
295
|
-
"COLLECTED": [],
|
|
296
|
-
"FORCED": [],
|
|
297
|
-
"EDITED": [],
|
|
298
|
-
"INPUTTED": []
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
"variableType": "COLLECTED",
|
|
303
|
-
"name": "PROGRESS",
|
|
304
|
-
"values": {
|
|
305
|
-
"PREVIOUS": [],
|
|
306
|
-
"COLLECTED": [0, -1],
|
|
307
|
-
"FORCED": [],
|
|
308
|
-
"EDITED": [],
|
|
309
|
-
"INPUTTED": []
|
|
310
|
-
}
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
"variableType": "CALCULATED",
|
|
314
|
-
"name": "PRENOMREF",
|
|
315
|
-
"expression": { "value": "first_value(PRENOMS over())", "type": "VTL" },
|
|
316
|
-
"bindingDependencies": ["PRENOMS"],
|
|
317
|
-
"inFilter": "true"
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
"variableType": "CALCULATED",
|
|
321
|
-
"name": "COMPLETE",
|
|
322
|
-
"expression": {
|
|
323
|
-
"value": "not(isnull(KNOWREC)) and not(isnull(SEXE)) and not(isnull(SOMETHING))",
|
|
324
|
-
"type": "VTL"
|
|
325
|
-
},
|
|
326
|
-
"bindingDependencies": ["KNOWREC", "SEXE", "SOMETHING"],
|
|
327
|
-
"shapeFrom": "PRENOMS",
|
|
328
|
-
"inFilter": "true"
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
"variableType": "CALCULATED",
|
|
332
|
-
"name": "PARTIAL",
|
|
333
|
-
"expression": {
|
|
334
|
-
"value": "not(isnull(KNOWREC)) or not(isnull(SEXE)) or not(isnull(SOMETHING))",
|
|
335
|
-
"type": "VTL"
|
|
336
|
-
},
|
|
337
|
-
"bindingDependencies": ["KNOWREC", "SEXE", "SOMETHING"],
|
|
338
|
-
"shapeFrom": "PRENOMS",
|
|
339
|
-
"inFilter": "true"
|
|
340
|
-
}
|
|
341
|
-
],
|
|
342
|
-
"resizing": {
|
|
343
|
-
"NB_HAB": {
|
|
344
|
-
"size": "NB_HAB",
|
|
345
|
-
"variables": ["PRENOMS", "AGE", "SEXE", "SOMETHING", "DATNAIS"]
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
}
|