@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inseefr/lunatic",
|
|
3
|
-
"version": "3.5.0-rc.
|
|
3
|
+
"version": "3.5.0-rc.1",
|
|
4
4
|
"description": "Library of questionnaire components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"src/components/Dropdown/__snapshots__/Dropdown.spec.tsx.snap",
|
|
52
52
|
"src/components/Dropdown/renderer/SimpleLabelRenderer.tsx",
|
|
53
53
|
"src/components/Dropdown/renderer/SimpleOptionRenderer.tsx",
|
|
54
|
+
"src/components/Duration/Duration.test.tsx",
|
|
54
55
|
"src/components/Duration/Duration.tsx",
|
|
55
56
|
"src/components/Duration/durationUtils.ts",
|
|
56
57
|
"src/components/Duration/formatDuration.spec.ts",
|
|
@@ -65,6 +66,7 @@
|
|
|
65
66
|
"src/components/InputNumber/InputNumber.tsx",
|
|
66
67
|
"src/components/InputNumber/InputNumberThousand.tsx",
|
|
67
68
|
"src/components/InputNumber/__snapshots__/InputNumber.spec.tsx.snap",
|
|
69
|
+
"src/components/Loop/Loop.spec.tsx",
|
|
68
70
|
"src/components/Loop/Loop.tsx",
|
|
69
71
|
"src/components/Loop/constant.ts",
|
|
70
72
|
"src/components/LunaticComponents.tsx",
|
|
@@ -98,6 +100,8 @@
|
|
|
98
100
|
"src/components/shared/Button/IconButton.spec.tsx",
|
|
99
101
|
"src/components/shared/Button/IconButton.tsx",
|
|
100
102
|
"src/components/shared/Button/__snapshots__/Button.spec.tsx.snap",
|
|
103
|
+
"src/components/shared/CharactersCount/CharactersCount.spec.tsx",
|
|
104
|
+
"src/components/shared/CharactersCount/CharactersCount.tsx",
|
|
101
105
|
"src/components/shared/Checkbox/CheckboxOption.spec.tsx",
|
|
102
106
|
"src/components/shared/Checkbox/CheckboxOption.tsx",
|
|
103
107
|
"src/components/shared/Checkbox/getShortcutKey.ts",
|
|
@@ -177,15 +181,9 @@
|
|
|
177
181
|
"src/components/shared/Table/Tr.spec.tsx",
|
|
178
182
|
"src/components/shared/Table/Tr.tsx",
|
|
179
183
|
"src/components/shared/Table/index.ts",
|
|
184
|
+
"src/components/shared/utils/getCharactersCountId.test.ts",
|
|
185
|
+
"src/components/shared/utils/getCharactersCountId.ts",
|
|
180
186
|
"src/components/type.ts",
|
|
181
|
-
"src/constants/component-types.ts",
|
|
182
|
-
"src/constants/declarations.ts",
|
|
183
|
-
"src/constants/event-types.ts",
|
|
184
|
-
"src/constants/index.ts",
|
|
185
|
-
"src/constants/indexedDBStore.ts",
|
|
186
|
-
"src/constants/supported-preferences.ts",
|
|
187
|
-
"src/constants/value-types.ts",
|
|
188
|
-
"src/constants/variable-types.ts",
|
|
189
187
|
"src/css/components/Button.scss",
|
|
190
188
|
"src/css/components/CheckboxGroup.scss",
|
|
191
189
|
"src/css/components/CheckboxOne.scss",
|
|
@@ -219,7 +217,6 @@
|
|
|
219
217
|
"src/hooks/use-auto-focus.ts",
|
|
220
218
|
"src/hooks/use-track-changes.ts",
|
|
221
219
|
"src/hooks/use-why-render.ts",
|
|
222
|
-
"src/hooks/useArticulation.ts",
|
|
223
220
|
"src/hooks/useDebounce.ts",
|
|
224
221
|
"src/hooks/useDocumentEvent.ts",
|
|
225
222
|
"src/hooks/useKeyboardKey.ts",
|
|
@@ -233,9 +230,8 @@
|
|
|
233
230
|
"src/insee.d.ts",
|
|
234
231
|
"src/stories/accordion/accordion.stories.jsx",
|
|
235
232
|
"src/stories/accordion/source.json",
|
|
236
|
-
"src/stories/behaviour/articulation/articulation.stories.tsx",
|
|
237
|
-
"src/stories/behaviour/articulation/roundabout.json",
|
|
238
233
|
"src/stories/behaviour/cleaning/cleaning.stories.jsx",
|
|
234
|
+
"src/stories/behaviour/cleaning/loop.json",
|
|
239
235
|
"src/stories/behaviour/cleaning/source-loop.json",
|
|
240
236
|
"src/stories/behaviour/cleaning/source.json",
|
|
241
237
|
"src/stories/behaviour/controls/boucles-n.json",
|
|
@@ -260,6 +256,7 @@
|
|
|
260
256
|
"src/stories/behaviour/paste/test.stories.jsx",
|
|
261
257
|
"src/stories/behaviour/performance/performance.stories.jsx",
|
|
262
258
|
"src/stories/behaviour/performance/source.json",
|
|
259
|
+
"src/stories/behaviour/performance/srcv.json",
|
|
263
260
|
"src/stories/behaviour/resizing/resizing.stories.jsx",
|
|
264
261
|
"src/stories/behaviour/resizing/source-resizing-cleaning.json",
|
|
265
262
|
"src/stories/behaviour/resizing/source.json",
|
|
@@ -296,6 +293,7 @@
|
|
|
296
293
|
"src/stories/input/input.stories.jsx",
|
|
297
294
|
"src/stories/input/source.json",
|
|
298
295
|
"src/stories/input-number/input-number.stories.jsx",
|
|
296
|
+
"src/stories/input-number/source-big-number.json",
|
|
299
297
|
"src/stories/input-number/source-euro.json",
|
|
300
298
|
"src/stories/input-number/source.json",
|
|
301
299
|
"src/stories/loop/loop.stories.jsx",
|
|
@@ -369,15 +367,15 @@
|
|
|
369
367
|
"src/stories/textarea/data.json",
|
|
370
368
|
"src/stories/textarea/source.json",
|
|
371
369
|
"src/stories/textarea/textarea.stories.jsx",
|
|
372
|
-
"src/stories/utils/SchemaValidator.
|
|
370
|
+
"src/stories/utils/SchemaValidator.jsx",
|
|
373
371
|
"src/stories/utils/custom-lunatic.scss",
|
|
374
372
|
"src/stories/utils/default-arg-types.js",
|
|
375
373
|
"src/stories/utils/default-args.js",
|
|
376
374
|
"src/stories/utils/options.js",
|
|
375
|
+
"src/stories/utils/orchestrator.jsx",
|
|
377
376
|
"src/stories/utils/orchestrator.scss",
|
|
378
|
-
"src/stories/utils/
|
|
377
|
+
"src/stories/utils/overview.jsx",
|
|
379
378
|
"src/stories/utils/overview.scss",
|
|
380
|
-
"src/stories/utils/overview.tsx",
|
|
381
379
|
"src/stories/utils/referentiel.js",
|
|
382
380
|
"src/test.d.ts",
|
|
383
381
|
"src/tests/setup.ts",
|
|
@@ -416,7 +414,9 @@
|
|
|
416
414
|
"src/use-lunatic/commons/variables/lunatic-variables-store.spec.ts",
|
|
417
415
|
"src/use-lunatic/commons/variables/lunatic-variables-store.ts",
|
|
418
416
|
"src/use-lunatic/hooks/use-loop-variables.ts",
|
|
417
|
+
"src/use-lunatic/hooks/use-page-has-response.test.ts",
|
|
419
418
|
"src/use-lunatic/hooks/use-page-has-response.ts",
|
|
419
|
+
"src/use-lunatic/hooks/useOverview.spec.ts",
|
|
420
420
|
"src/use-lunatic/hooks/useOverview.ts",
|
|
421
421
|
"src/use-lunatic/hooks/useWarnDepChange.ts",
|
|
422
422
|
"src/use-lunatic/logger/ConsoleLogger.ts",
|
|
@@ -443,11 +443,13 @@
|
|
|
443
443
|
"src/use-lunatic/reducer/reducer.ts",
|
|
444
444
|
"src/use-lunatic/reducer/reducerInitializer.tsx",
|
|
445
445
|
"src/use-lunatic/replace-component-sequence.ts",
|
|
446
|
+
"src/use-lunatic/test.utils.ts",
|
|
446
447
|
"src/use-lunatic/type.ts",
|
|
447
448
|
"src/use-lunatic/use-lunatic.test.ts",
|
|
448
449
|
"src/use-lunatic/use-lunatic.ts",
|
|
449
450
|
"src/utils/array.spec.ts",
|
|
450
451
|
"src/utils/array.ts",
|
|
452
|
+
"src/utils/cast.ts",
|
|
451
453
|
"src/utils/constants/alphabet.ts",
|
|
452
454
|
"src/utils/constants/features.ts",
|
|
453
455
|
"src/utils/constants/index.ts",
|
|
@@ -560,6 +562,9 @@
|
|
|
560
562
|
"components/Loop/Loop.d.ts",
|
|
561
563
|
"components/Loop/Loop.js",
|
|
562
564
|
"components/Loop/Loop.js.map",
|
|
565
|
+
"components/Loop/Loop.spec.d.ts",
|
|
566
|
+
"components/Loop/Loop.spec.js",
|
|
567
|
+
"components/Loop/Loop.spec.js.map",
|
|
563
568
|
"components/Loop/constant.d.ts",
|
|
564
569
|
"components/Loop/constant.js",
|
|
565
570
|
"components/Loop/constant.js.map",
|
|
@@ -647,6 +652,12 @@
|
|
|
647
652
|
"components/shared/Button/IconButton.spec.d.ts",
|
|
648
653
|
"components/shared/Button/IconButton.spec.js",
|
|
649
654
|
"components/shared/Button/IconButton.spec.js.map",
|
|
655
|
+
"components/shared/CharactersCount/CharactersCount.d.ts",
|
|
656
|
+
"components/shared/CharactersCount/CharactersCount.js",
|
|
657
|
+
"components/shared/CharactersCount/CharactersCount.js.map",
|
|
658
|
+
"components/shared/CharactersCount/CharactersCount.spec.d.ts",
|
|
659
|
+
"components/shared/CharactersCount/CharactersCount.spec.js",
|
|
660
|
+
"components/shared/CharactersCount/CharactersCount.spec.js.map",
|
|
650
661
|
"components/shared/Checkbox/CheckboxOption.d.ts",
|
|
651
662
|
"components/shared/Checkbox/CheckboxOption.js",
|
|
652
663
|
"components/shared/Checkbox/CheckboxOption.js.map",
|
|
@@ -881,33 +892,12 @@
|
|
|
881
892
|
"components/shared/Table/index.d.ts",
|
|
882
893
|
"components/shared/Table/index.js",
|
|
883
894
|
"components/shared/Table/index.js.map",
|
|
895
|
+
"components/shared/utils/getCharactersCountId.d.ts",
|
|
896
|
+
"components/shared/utils/getCharactersCountId.js",
|
|
897
|
+
"components/shared/utils/getCharactersCountId.js.map",
|
|
884
898
|
"components/type.d.ts",
|
|
885
899
|
"components/type.js",
|
|
886
900
|
"components/type.js.map",
|
|
887
|
-
"constants/component-types.d.ts",
|
|
888
|
-
"constants/component-types.js",
|
|
889
|
-
"constants/component-types.js.map",
|
|
890
|
-
"constants/declarations.d.ts",
|
|
891
|
-
"constants/declarations.js",
|
|
892
|
-
"constants/declarations.js.map",
|
|
893
|
-
"constants/event-types.d.ts",
|
|
894
|
-
"constants/event-types.js",
|
|
895
|
-
"constants/event-types.js.map",
|
|
896
|
-
"constants/index.d.ts",
|
|
897
|
-
"constants/index.js",
|
|
898
|
-
"constants/index.js.map",
|
|
899
|
-
"constants/indexedDBStore.d.ts",
|
|
900
|
-
"constants/indexedDBStore.js",
|
|
901
|
-
"constants/indexedDBStore.js.map",
|
|
902
|
-
"constants/supported-preferences.d.ts",
|
|
903
|
-
"constants/supported-preferences.js",
|
|
904
|
-
"constants/supported-preferences.js.map",
|
|
905
|
-
"constants/value-types.d.ts",
|
|
906
|
-
"constants/value-types.js",
|
|
907
|
-
"constants/value-types.js.map",
|
|
908
|
-
"constants/variable-types.d.ts",
|
|
909
|
-
"constants/variable-types.js",
|
|
910
|
-
"constants/variable-types.js.map",
|
|
911
901
|
"esm/components/Accordion/Accordion.d.ts",
|
|
912
902
|
"esm/components/Accordion/Accordion.js",
|
|
913
903
|
"esm/components/Accordion/Accordion.js.map",
|
|
@@ -992,6 +982,9 @@
|
|
|
992
982
|
"esm/components/Loop/Loop.d.ts",
|
|
993
983
|
"esm/components/Loop/Loop.js",
|
|
994
984
|
"esm/components/Loop/Loop.js.map",
|
|
985
|
+
"esm/components/Loop/Loop.spec.d.ts",
|
|
986
|
+
"esm/components/Loop/Loop.spec.js",
|
|
987
|
+
"esm/components/Loop/Loop.spec.js.map",
|
|
995
988
|
"esm/components/Loop/constant.d.ts",
|
|
996
989
|
"esm/components/Loop/constant.js",
|
|
997
990
|
"esm/components/Loop/constant.js.map",
|
|
@@ -1079,6 +1072,12 @@
|
|
|
1079
1072
|
"esm/components/shared/Button/IconButton.spec.d.ts",
|
|
1080
1073
|
"esm/components/shared/Button/IconButton.spec.js",
|
|
1081
1074
|
"esm/components/shared/Button/IconButton.spec.js.map",
|
|
1075
|
+
"esm/components/shared/CharactersCount/CharactersCount.d.ts",
|
|
1076
|
+
"esm/components/shared/CharactersCount/CharactersCount.js",
|
|
1077
|
+
"esm/components/shared/CharactersCount/CharactersCount.js.map",
|
|
1078
|
+
"esm/components/shared/CharactersCount/CharactersCount.spec.d.ts",
|
|
1079
|
+
"esm/components/shared/CharactersCount/CharactersCount.spec.js",
|
|
1080
|
+
"esm/components/shared/CharactersCount/CharactersCount.spec.js.map",
|
|
1082
1081
|
"esm/components/shared/Checkbox/CheckboxOption.d.ts",
|
|
1083
1082
|
"esm/components/shared/Checkbox/CheckboxOption.js",
|
|
1084
1083
|
"esm/components/shared/Checkbox/CheckboxOption.js.map",
|
|
@@ -1313,33 +1312,12 @@
|
|
|
1313
1312
|
"esm/components/shared/Table/index.d.ts",
|
|
1314
1313
|
"esm/components/shared/Table/index.js",
|
|
1315
1314
|
"esm/components/shared/Table/index.js.map",
|
|
1315
|
+
"esm/components/shared/utils/getCharactersCountId.d.ts",
|
|
1316
|
+
"esm/components/shared/utils/getCharactersCountId.js",
|
|
1317
|
+
"esm/components/shared/utils/getCharactersCountId.js.map",
|
|
1316
1318
|
"esm/components/type.d.ts",
|
|
1317
1319
|
"esm/components/type.js",
|
|
1318
1320
|
"esm/components/type.js.map",
|
|
1319
|
-
"esm/constants/component-types.d.ts",
|
|
1320
|
-
"esm/constants/component-types.js",
|
|
1321
|
-
"esm/constants/component-types.js.map",
|
|
1322
|
-
"esm/constants/declarations.d.ts",
|
|
1323
|
-
"esm/constants/declarations.js",
|
|
1324
|
-
"esm/constants/declarations.js.map",
|
|
1325
|
-
"esm/constants/event-types.d.ts",
|
|
1326
|
-
"esm/constants/event-types.js",
|
|
1327
|
-
"esm/constants/event-types.js.map",
|
|
1328
|
-
"esm/constants/index.d.ts",
|
|
1329
|
-
"esm/constants/index.js",
|
|
1330
|
-
"esm/constants/index.js.map",
|
|
1331
|
-
"esm/constants/indexedDBStore.d.ts",
|
|
1332
|
-
"esm/constants/indexedDBStore.js",
|
|
1333
|
-
"esm/constants/indexedDBStore.js.map",
|
|
1334
|
-
"esm/constants/supported-preferences.d.ts",
|
|
1335
|
-
"esm/constants/supported-preferences.js",
|
|
1336
|
-
"esm/constants/supported-preferences.js.map",
|
|
1337
|
-
"esm/constants/value-types.d.ts",
|
|
1338
|
-
"esm/constants/value-types.js",
|
|
1339
|
-
"esm/constants/value-types.js.map",
|
|
1340
|
-
"esm/constants/variable-types.d.ts",
|
|
1341
|
-
"esm/constants/variable-types.js",
|
|
1342
|
-
"esm/constants/variable-types.js.map",
|
|
1343
1321
|
"esm/hooks/use-auto-focus.d.ts",
|
|
1344
1322
|
"esm/hooks/use-auto-focus.js",
|
|
1345
1323
|
"esm/hooks/use-auto-focus.js.map",
|
|
@@ -1349,9 +1327,6 @@
|
|
|
1349
1327
|
"esm/hooks/use-why-render.d.ts",
|
|
1350
1328
|
"esm/hooks/use-why-render.js",
|
|
1351
1329
|
"esm/hooks/use-why-render.js.map",
|
|
1352
|
-
"esm/hooks/useArticulation.d.ts",
|
|
1353
|
-
"esm/hooks/useArticulation.js",
|
|
1354
|
-
"esm/hooks/useArticulation.js.map",
|
|
1355
1330
|
"esm/hooks/useDebounce.d.ts",
|
|
1356
1331
|
"esm/hooks/useDebounce.js",
|
|
1357
1332
|
"esm/hooks/useDebounce.js.map",
|
|
@@ -1387,6 +1362,7 @@
|
|
|
1387
1362
|
"esm/index.js.map",
|
|
1388
1363
|
"esm/main.css",
|
|
1389
1364
|
"esm/main.css.map",
|
|
1365
|
+
"esm/stories/overview/sourceWithHierarchy.json",
|
|
1390
1366
|
"esm/tests/setup.d.ts",
|
|
1391
1367
|
"esm/tests/setup.js",
|
|
1392
1368
|
"esm/tests/setup.js.map",
|
|
@@ -1495,6 +1471,9 @@
|
|
|
1495
1471
|
"esm/use-lunatic/hooks/useOverview.d.ts",
|
|
1496
1472
|
"esm/use-lunatic/hooks/useOverview.js",
|
|
1497
1473
|
"esm/use-lunatic/hooks/useOverview.js.map",
|
|
1474
|
+
"esm/use-lunatic/hooks/useOverview.spec.d.ts",
|
|
1475
|
+
"esm/use-lunatic/hooks/useOverview.spec.js",
|
|
1476
|
+
"esm/use-lunatic/hooks/useOverview.spec.js.map",
|
|
1498
1477
|
"esm/use-lunatic/hooks/useWarnDepChange.d.ts",
|
|
1499
1478
|
"esm/use-lunatic/hooks/useWarnDepChange.js",
|
|
1500
1479
|
"esm/use-lunatic/hooks/useWarnDepChange.js.map",
|
|
@@ -1570,6 +1549,9 @@
|
|
|
1570
1549
|
"esm/use-lunatic/replace-component-sequence.d.ts",
|
|
1571
1550
|
"esm/use-lunatic/replace-component-sequence.js",
|
|
1572
1551
|
"esm/use-lunatic/replace-component-sequence.js.map",
|
|
1552
|
+
"esm/use-lunatic/test.utils.d.ts",
|
|
1553
|
+
"esm/use-lunatic/test.utils.js",
|
|
1554
|
+
"esm/use-lunatic/test.utils.js.map",
|
|
1573
1555
|
"esm/use-lunatic/type.d.ts",
|
|
1574
1556
|
"esm/use-lunatic/type.js",
|
|
1575
1557
|
"esm/use-lunatic/type.js.map",
|
|
@@ -1582,6 +1564,9 @@
|
|
|
1582
1564
|
"esm/utils/array.spec.d.ts",
|
|
1583
1565
|
"esm/utils/array.spec.js",
|
|
1584
1566
|
"esm/utils/array.spec.js.map",
|
|
1567
|
+
"esm/utils/cast.d.ts",
|
|
1568
|
+
"esm/utils/cast.js",
|
|
1569
|
+
"esm/utils/cast.js.map",
|
|
1585
1570
|
"esm/utils/constants/alphabet.d.ts",
|
|
1586
1571
|
"esm/utils/constants/alphabet.js",
|
|
1587
1572
|
"esm/utils/constants/alphabet.js.map",
|
|
@@ -1675,9 +1660,6 @@
|
|
|
1675
1660
|
"hooks/use-why-render.d.ts",
|
|
1676
1661
|
"hooks/use-why-render.js",
|
|
1677
1662
|
"hooks/use-why-render.js.map",
|
|
1678
|
-
"hooks/useArticulation.d.ts",
|
|
1679
|
-
"hooks/useArticulation.js",
|
|
1680
|
-
"hooks/useArticulation.js.map",
|
|
1681
1663
|
"hooks/useDebounce.d.ts",
|
|
1682
1664
|
"hooks/useDebounce.js",
|
|
1683
1665
|
"hooks/useDebounce.js.map",
|
|
@@ -1713,6 +1695,7 @@
|
|
|
1713
1695
|
"index.js.map",
|
|
1714
1696
|
"main.css",
|
|
1715
1697
|
"main.css.map",
|
|
1698
|
+
"stories/overview/sourceWithHierarchy.json",
|
|
1716
1699
|
"tests/setup.d.ts",
|
|
1717
1700
|
"tests/setup.js",
|
|
1718
1701
|
"tests/setup.js.map",
|
|
@@ -1822,6 +1805,9 @@
|
|
|
1822
1805
|
"use-lunatic/hooks/useOverview.d.ts",
|
|
1823
1806
|
"use-lunatic/hooks/useOverview.js",
|
|
1824
1807
|
"use-lunatic/hooks/useOverview.js.map",
|
|
1808
|
+
"use-lunatic/hooks/useOverview.spec.d.ts",
|
|
1809
|
+
"use-lunatic/hooks/useOverview.spec.js",
|
|
1810
|
+
"use-lunatic/hooks/useOverview.spec.js.map",
|
|
1825
1811
|
"use-lunatic/hooks/useWarnDepChange.d.ts",
|
|
1826
1812
|
"use-lunatic/hooks/useWarnDepChange.js",
|
|
1827
1813
|
"use-lunatic/hooks/useWarnDepChange.js.map",
|
|
@@ -1897,6 +1883,9 @@
|
|
|
1897
1883
|
"use-lunatic/replace-component-sequence.d.ts",
|
|
1898
1884
|
"use-lunatic/replace-component-sequence.js",
|
|
1899
1885
|
"use-lunatic/replace-component-sequence.js.map",
|
|
1886
|
+
"use-lunatic/test.utils.d.ts",
|
|
1887
|
+
"use-lunatic/test.utils.js",
|
|
1888
|
+
"use-lunatic/test.utils.js.map",
|
|
1900
1889
|
"use-lunatic/type.d.ts",
|
|
1901
1890
|
"use-lunatic/type.js",
|
|
1902
1891
|
"use-lunatic/type.js.map",
|
|
@@ -1909,6 +1898,9 @@
|
|
|
1909
1898
|
"utils/array.spec.d.ts",
|
|
1910
1899
|
"utils/array.spec.js",
|
|
1911
1900
|
"utils/array.spec.js.map",
|
|
1901
|
+
"utils/cast.d.ts",
|
|
1902
|
+
"utils/cast.js",
|
|
1903
|
+
"utils/cast.js.map",
|
|
1912
1904
|
"utils/constants/alphabet.d.ts",
|
|
1913
1905
|
"utils/constants/alphabet.js",
|
|
1914
1906
|
"utils/constants/alphabet.js.map",
|
|
@@ -52,7 +52,7 @@ exports[`Datepicker > should render properly with format YYYY-MM 1`] = `
|
|
|
52
52
|
<span
|
|
53
53
|
class="lunaticDatepickerHint"
|
|
54
54
|
>
|
|
55
|
-
Exemple:
|
|
55
|
+
Exemple: 7
|
|
56
56
|
</span>
|
|
57
57
|
</label>
|
|
58
58
|
<input
|
|
@@ -128,7 +128,7 @@ exports[`Datepicker > should render properly with format YYYY-MM-DD 1`] = `
|
|
|
128
128
|
<span
|
|
129
129
|
class="lunaticDatepickerHint"
|
|
130
130
|
>
|
|
131
|
-
Exemple:
|
|
131
|
+
Exemple: 7
|
|
132
132
|
</span>
|
|
133
133
|
</label>
|
|
134
134
|
<input
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { Duration } from './Duration';
|
|
3
|
+
import { render } from '@testing-library/react';
|
|
4
|
+
import { Formats } from './durationUtils';
|
|
5
|
+
|
|
6
|
+
describe('Duration', () => {
|
|
7
|
+
const mockOnChange = vi.fn();
|
|
8
|
+
|
|
9
|
+
const baseDeclarations = [
|
|
10
|
+
{
|
|
11
|
+
id: '1',
|
|
12
|
+
label: 'Declaration 1',
|
|
13
|
+
declarationType: 'COMMENT' as const,
|
|
14
|
+
position: 'AFTER_QUESTION_TEXT',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: '2',
|
|
18
|
+
label: 'Declaration 2',
|
|
19
|
+
declarationType: 'COMMENT' as const,
|
|
20
|
+
position: 'AFTER_QUESTION_TEXT',
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const baseProps = {
|
|
25
|
+
handleChanges: mockOnChange,
|
|
26
|
+
response: { name: 'demo' },
|
|
27
|
+
format: 'PTnHnM' as Formats,
|
|
28
|
+
value: 'PT5H1M',
|
|
29
|
+
id: 'duration',
|
|
30
|
+
label: 'label',
|
|
31
|
+
description: 'description',
|
|
32
|
+
declarations: baseDeclarations,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
afterEach(() => {
|
|
36
|
+
vi.clearAllMocks();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('renders label, declarations and description', () => {
|
|
40
|
+
const { getByText } = render(<Duration {...baseProps} />);
|
|
41
|
+
|
|
42
|
+
// label is displayed
|
|
43
|
+
expect(getByText(baseProps.label)).toBeInTheDocument();
|
|
44
|
+
|
|
45
|
+
// all declarations are displayed
|
|
46
|
+
expect(getByText('Declaration 1')).toBeInTheDocument();
|
|
47
|
+
expect(getByText('Declaration 2')).toBeInTheDocument();
|
|
48
|
+
|
|
49
|
+
// description is displayed
|
|
50
|
+
expect(getByText(baseProps.description)).toBeInTheDocument();
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
getComponentErrors,
|
|
13
13
|
} from '../shared/ComponentErrors/ComponentErrors';
|
|
14
14
|
import { Declarations } from '../shared/Declarations/Declarations';
|
|
15
|
+
import { Fieldset } from '../shared/Fieldset/Fieldset';
|
|
15
16
|
|
|
16
17
|
export function Duration({
|
|
17
18
|
handleChanges,
|
|
@@ -39,7 +40,16 @@ type CustomProps = Omit<
|
|
|
39
40
|
export const CustomDuration = slottableComponent<CustomProps>(
|
|
40
41
|
'Duration',
|
|
41
42
|
(props) => {
|
|
42
|
-
const {
|
|
43
|
+
const {
|
|
44
|
+
errors,
|
|
45
|
+
value,
|
|
46
|
+
label,
|
|
47
|
+
format,
|
|
48
|
+
onChange,
|
|
49
|
+
declarations,
|
|
50
|
+
id,
|
|
51
|
+
description,
|
|
52
|
+
} = props;
|
|
43
53
|
// We need to keep an internal state since one field can be empty (null value in duration)
|
|
44
54
|
// but we still send "0" and we don't want the field to display "0"
|
|
45
55
|
const [duration, setDuration] = useState(
|
|
@@ -66,8 +76,11 @@ export const CustomDuration = slottableComponent<CustomProps>(
|
|
|
66
76
|
};
|
|
67
77
|
|
|
68
78
|
return (
|
|
69
|
-
<
|
|
70
|
-
{
|
|
79
|
+
<Fieldset
|
|
80
|
+
className={classnames('lunatic-input')}
|
|
81
|
+
legend={label}
|
|
82
|
+
description={description}
|
|
83
|
+
>
|
|
71
84
|
<Declarations
|
|
72
85
|
type="AFTER_QUESTION_TEXT"
|
|
73
86
|
declarations={declarations}
|
|
@@ -91,7 +104,7 @@ export const CustomDuration = slottableComponent<CustomProps>(
|
|
|
91
104
|
))}
|
|
92
105
|
</div>
|
|
93
106
|
<ComponentErrors errors={errors} />
|
|
94
|
-
</
|
|
107
|
+
</Fieldset>
|
|
95
108
|
);
|
|
96
109
|
}
|
|
97
110
|
);
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { fireEvent, render, screen } from '@testing-library/react';
|
|
2
2
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
3
|
import { Input } from './Input';
|
|
4
|
+
import { CharactersCount } from '../shared/CharactersCount/CharactersCount';
|
|
5
|
+
|
|
6
|
+
vi.mock('../shared/CharactersCount/CharactersCount', () => ({
|
|
7
|
+
CharactersCount: vi.fn(),
|
|
8
|
+
}));
|
|
9
|
+
|
|
4
10
|
describe('Input', () => {
|
|
5
11
|
const mockOnChange = vi.fn();
|
|
6
12
|
const baseProps = {
|
|
@@ -34,6 +40,19 @@ describe('Input', () => {
|
|
|
34
40
|
expect(input).toBeInTheDocument();
|
|
35
41
|
});
|
|
36
42
|
|
|
43
|
+
it('calls CharactersCount component with correct props', () => {
|
|
44
|
+
const props = { ...baseProps, maxLength: 30 };
|
|
45
|
+
render(<Input {...props} />);
|
|
46
|
+
expect(CharactersCount).toHaveBeenCalledWith(
|
|
47
|
+
{
|
|
48
|
+
id: props.id,
|
|
49
|
+
maxLength: props.maxLength,
|
|
50
|
+
value: props.value,
|
|
51
|
+
},
|
|
52
|
+
{}
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
|
|
37
56
|
it('calls onChange with parsed value', () => {
|
|
38
57
|
const { container } = render(<Input {...baseProps} errors={undefined} />);
|
|
39
58
|
|
|
@@ -73,4 +92,19 @@ describe('Input', () => {
|
|
|
73
92
|
expect(input).toHaveFocus();
|
|
74
93
|
expect(input).toHaveValue('toto');
|
|
75
94
|
});
|
|
95
|
+
|
|
96
|
+
it('should display input value from the start when user leave input', () => {
|
|
97
|
+
const setSelectionRangeMock = vi.fn();
|
|
98
|
+
const { container } = render(<Input {...baseProps} />);
|
|
99
|
+
|
|
100
|
+
const input = container.querySelector('input[type="text"]');
|
|
101
|
+
|
|
102
|
+
fireEvent.blur(input!, {
|
|
103
|
+
target: {
|
|
104
|
+
...input,
|
|
105
|
+
setSelectionRange: setSelectionRangeMock,
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
expect(setSelectionRangeMock).toHaveBeenCalledWith(0, 0);
|
|
109
|
+
});
|
|
76
110
|
});
|
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
} from '../shared/ComponentErrors/ComponentErrors';
|
|
9
9
|
import { Declarations } from '../shared/Declarations/Declarations';
|
|
10
10
|
import type { LunaticError } from '../../use-lunatic/type';
|
|
11
|
+
import { CharactersCount } from '../shared/CharactersCount/CharactersCount';
|
|
12
|
+
import { getCharactersCountId } from '../shared/utils/getCharactersCountId';
|
|
11
13
|
|
|
12
14
|
export function Input({
|
|
13
15
|
handleChanges,
|
|
@@ -47,6 +49,8 @@ export const CustomInput = slottableComponent<CustomProps>('Input', (props) => {
|
|
|
47
49
|
declarations,
|
|
48
50
|
} = props;
|
|
49
51
|
const labelId = `label-${id}`;
|
|
52
|
+
const charactersCountId = getCharactersCountId(id, maxLength);
|
|
53
|
+
|
|
50
54
|
return (
|
|
51
55
|
<div className={classnames('lunatic-input')}>
|
|
52
56
|
<Label htmlFor={id} id={labelId} description={description}>
|
|
@@ -57,24 +61,28 @@ export const CustomInput = slottableComponent<CustomProps>('Input', (props) => {
|
|
|
57
61
|
declarations={declarations}
|
|
58
62
|
id={id}
|
|
59
63
|
/>
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
64
|
+
<div className="field-with-count">
|
|
65
|
+
<input
|
|
66
|
+
id={id}
|
|
67
|
+
aria-labelledby={labelId}
|
|
68
|
+
aria-describedby={maxLength ? charactersCountId : undefined}
|
|
69
|
+
autoComplete="off"
|
|
70
|
+
type="text"
|
|
71
|
+
disabled={disabled}
|
|
72
|
+
readOnly={readOnly}
|
|
73
|
+
value={(value ?? '').toString()}
|
|
74
|
+
title={value ?? ''}
|
|
75
|
+
onChange={(e) => onChange(e.target.value)}
|
|
76
|
+
aria-required={required}
|
|
77
|
+
required={required}
|
|
78
|
+
maxLength={maxLength}
|
|
79
|
+
aria-invalid={!!errors}
|
|
80
|
+
onBlur={(e) => {
|
|
81
|
+
e.target.setSelectionRange(0, 0);
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
<CharactersCount id={id} maxLength={maxLength} value={value} />
|
|
85
|
+
</div>
|
|
78
86
|
<ComponentErrors errors={errors} />
|
|
79
87
|
</div>
|
|
80
88
|
);
|
|
@@ -5,15 +5,30 @@ exports[`Input > renders without crashing 1`] = `
|
|
|
5
5
|
<div
|
|
6
6
|
class="lunatic-input"
|
|
7
7
|
>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
<label
|
|
9
|
+
class="lunatic-label"
|
|
10
|
+
for="input"
|
|
11
|
+
id="label-input"
|
|
12
|
+
>
|
|
13
|
+
<span
|
|
14
|
+
class="label-description"
|
|
15
|
+
>
|
|
16
|
+
description
|
|
17
|
+
</span>
|
|
18
|
+
</label>
|
|
19
|
+
<div
|
|
20
|
+
class="field-with-count"
|
|
21
|
+
>
|
|
22
|
+
<input
|
|
23
|
+
aria-invalid="false"
|
|
24
|
+
aria-labelledby="label-input"
|
|
25
|
+
autocomplete="off"
|
|
26
|
+
id="input"
|
|
27
|
+
title="input"
|
|
28
|
+
type="text"
|
|
29
|
+
value="input"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
17
32
|
</div>
|
|
18
33
|
</div>
|
|
19
34
|
`;
|
|
@@ -23,16 +38,20 @@ exports[`Input > should handle readOnly 1`] = `
|
|
|
23
38
|
<div
|
|
24
39
|
class="lunatic-input"
|
|
25
40
|
>
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
<div
|
|
42
|
+
class="field-with-count"
|
|
43
|
+
>
|
|
44
|
+
<input
|
|
45
|
+
aria-invalid="false"
|
|
46
|
+
aria-labelledby="label-number"
|
|
47
|
+
autocomplete="off"
|
|
48
|
+
id="number"
|
|
49
|
+
readonly=""
|
|
50
|
+
title="toto"
|
|
51
|
+
type="text"
|
|
52
|
+
value="toto"
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
36
55
|
</div>
|
|
37
56
|
</div>
|
|
38
57
|
`;
|