@inseefr/lunatic 3.4.3 → 3.4.5-rc.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/README.md +60 -13
- package/components/Accordion/Accordion.js +9 -0
- package/components/Accordion/Accordion.js.map +1 -0
- package/components/CheckboxBoolean/CheckboxBoolean.js +23 -0
- package/components/CheckboxBoolean/CheckboxBoolean.js.map +1 -0
- package/components/CheckboxBoolean/CheckboxBoolean.spec.js +39 -0
- package/components/CheckboxBoolean/CheckboxBoolean.spec.js.map +1 -0
- package/components/CheckboxGroup/CheckboxGroup.js +10 -0
- package/components/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/components/CheckboxGroup/CustomCheckboxGroup.js +19 -0
- package/components/CheckboxGroup/CustomCheckboxGroup.js.map +1 -0
- package/components/CheckboxGroup/CustomCheckboxGroup.spec.js +47 -0
- package/components/CheckboxGroup/CustomCheckboxGroup.spec.js.map +1 -0
- package/components/CheckboxOne/CheckboxOne.js +13 -0
- package/components/CheckboxOne/CheckboxOne.js.map +1 -0
- package/components/CheckboxOne/CheckboxOne.spec.js +26 -0
- package/components/CheckboxOne/CheckboxOne.spec.js.map +1 -0
- package/components/Datepicker/Datepicker.js +70 -0
- package/components/Datepicker/Datepicker.js.map +1 -0
- package/components/Datepicker/Datepicker.spec.js +77 -0
- package/components/Datepicker/Datepicker.spec.js.map +1 -0
- package/components/Datepicker/DatepickerField.js +19 -0
- package/components/Datepicker/DatepickerField.js.map +1 -0
- package/components/Dropdown/Dropdown.js +22 -0
- package/components/Dropdown/Dropdown.js.map +1 -0
- package/components/Dropdown/Dropdown.spec.js +40 -0
- package/components/Dropdown/Dropdown.spec.js.map +1 -0
- package/components/Dropdown/renderer/SimpleLabelRenderer.js +22 -0
- package/components/Dropdown/renderer/SimpleLabelRenderer.js.map +1 -0
- package/components/Dropdown/renderer/SimpleOptionRenderer.js +16 -0
- package/components/Dropdown/renderer/SimpleOptionRenderer.js.map +1 -0
- package/components/Duration/Duration.js +38 -0
- package/components/Duration/Duration.js.map +1 -0
- package/components/Duration/durationUtils.js +30 -0
- package/components/Duration/durationUtils.js.map +1 -0
- package/components/Duration/formatDuration.js +21 -0
- package/components/Duration/formatDuration.js.map +1 -0
- package/components/Duration/formatDuration.spec.js +18 -0
- package/components/Duration/formatDuration.spec.js.map +1 -0
- package/components/Duration/getDurationFromValue.js +40 -0
- package/components/Duration/getDurationFromValue.js.map +1 -0
- package/components/FilterDescription/FilterDescription.js +7 -0
- package/components/FilterDescription/FilterDescription.js.map +1 -0
- package/components/FilterDescription/FilterDescription.spec.js +18 -0
- package/components/FilterDescription/FilterDescription.spec.js.map +1 -0
- package/components/Input/Input.js +22 -0
- package/components/Input/Input.js.map +1 -0
- package/components/Input/Input.spec.js +54 -0
- package/components/Input/Input.spec.js.map +1 -0
- package/components/InputNumber/InputNumber.js +19 -0
- package/components/InputNumber/InputNumber.js.map +1 -0
- package/components/InputNumber/InputNumber.spec.js +78 -0
- package/components/InputNumber/InputNumber.spec.js.map +1 -0
- package/components/InputNumber/InputNumberThousand.js +26 -0
- package/components/InputNumber/InputNumberThousand.js.map +1 -0
- package/components/Loop/Loop.js +62 -0
- package/components/Loop/Loop.js.map +1 -0
- package/components/Loop/constant.js +13 -0
- package/components/Loop/constant.js.map +1 -0
- package/components/LunaticComponents.js +87 -0
- package/components/LunaticComponents.js.map +1 -0
- package/components/PairwiseLinks/PairwiseLinks.js +46 -0
- package/components/PairwiseLinks/PairwiseLinks.js.map +1 -0
- package/components/Question/Question.js +20 -0
- package/components/Question/Question.js.map +1 -0
- package/components/Radio/Radio.js +13 -0
- package/components/Radio/Radio.js.map +1 -0
- package/components/RosterForLoop/RosterForLoop.js +66 -0
- package/components/RosterForLoop/RosterForLoop.js.map +1 -0
- package/components/RosterForLoop/RosterForLoop.spec.js +30 -0
- package/components/RosterForLoop/RosterForLoop.spec.js.map +1 -0
- package/components/Roundabout/CustomRoundabout.js +37 -0
- package/components/Roundabout/CustomRoundabout.js.map +1 -0
- package/components/Roundabout/Roundabout.js +31 -0
- package/components/Roundabout/Roundabout.js.map +1 -0
- package/components/Roundabout/roundabout.spec.js +49 -0
- package/components/Roundabout/roundabout.spec.js.map +1 -0
- package/components/Sequence/Sequence.js +12 -0
- package/components/Sequence/Sequence.js.map +1 -0
- package/components/Subsequence/Subsequence.js +12 -0
- package/components/Subsequence/Subsequence.js.map +1 -0
- package/components/Subsequence/Subsequence.spec.js +44 -0
- package/components/Subsequence/Subsequence.spec.js.map +1 -0
- package/components/Suggester/CustomSuggester.js +23 -0
- package/components/Suggester/CustomSuggester.js.map +1 -0
- package/components/Suggester/Suggester.js +109 -0
- package/components/Suggester/Suggester.js.map +1 -0
- package/components/Suggester/SuggesterNotification.js +18 -0
- package/components/Suggester/SuggesterNotification.js.map +1 -0
- package/components/Suggester/SuggesterType.js +3 -0
- package/components/Suggester/SuggesterType.js.map +1 -0
- package/components/Suggester/useSuggestions.js +90 -0
- package/components/Suggester/useSuggestions.js.map +1 -0
- package/components/Summary/Summary.js +69 -0
- package/components/Summary/Summary.js.map +1 -0
- package/components/Switch/Switch.js +36 -0
- package/components/Switch/Switch.js.map +1 -0
- package/components/Table/Table.js +12 -0
- package/components/Table/Table.js.map +1 -0
- package/components/Text/Text.js +7 -0
- package/components/Text/Text.js.map +1 -0
- package/components/Textarea/Textarea.js +18 -0
- package/components/Textarea/Textarea.js.map +1 -0
- package/components/Textarea/Textarea.spec.js +33 -0
- package/components/Textarea/Textarea.spec.js.map +1 -0
- package/components/library.js +55 -0
- package/components/library.js.map +1 -0
- package/components/shared/Button/Button.js +19 -0
- package/components/shared/Button/Button.js.map +1 -0
- package/components/shared/Button/Button.spec.js +53 -0
- package/components/shared/Button/Button.spec.js.map +1 -0
- package/components/shared/Button/IconButton.js +13 -0
- package/components/shared/Button/IconButton.js.map +1 -0
- package/components/shared/Button/IconButton.spec.js +58 -0
- package/components/shared/Button/IconButton.spec.js.map +1 -0
- package/components/shared/Checkbox/CheckboxOption.js +29 -0
- package/components/shared/Checkbox/CheckboxOption.js.map +1 -0
- package/components/shared/Checkbox/CheckboxOption.spec.js +54 -0
- package/components/shared/Checkbox/CheckboxOption.spec.js.map +1 -0
- package/components/shared/Checkbox/getShortcutKey.js +7 -0
- package/components/shared/Checkbox/getShortcutKey.js.map +1 -0
- package/components/shared/Combobox/Combobox.js +103 -0
- package/components/shared/Combobox/Combobox.js.map +1 -0
- package/components/shared/Combobox/Combobox.stories.js +48 -0
- package/components/shared/Combobox/Combobox.stories.js.map +1 -0
- package/components/shared/Combobox/ComboboxContainer.js +12 -0
- package/components/shared/Combobox/ComboboxContainer.js.map +1 -0
- package/components/shared/Combobox/ComboboxContainer.spec.js +26 -0
- package/components/shared/Combobox/ComboboxContainer.spec.js.map +1 -0
- package/components/shared/Combobox/ComboboxContent.js +39 -0
- package/components/shared/Combobox/ComboboxContent.js.map +1 -0
- package/components/shared/Combobox/ComboboxContentBox.js +13 -0
- package/components/shared/Combobox/ComboboxContentBox.js.map +1 -0
- package/components/shared/Combobox/ComboboxType.js +3 -0
- package/components/shared/Combobox/ComboboxType.js.map +1 -0
- package/components/shared/Combobox/Panel/ComboboxOption.js +21 -0
- package/components/shared/Combobox/Panel/ComboboxOption.js.map +1 -0
- package/components/shared/Combobox/Panel/ComboboxOption.spec.js +35 -0
- package/components/shared/Combobox/Panel/ComboboxOption.spec.js.map +1 -0
- package/components/shared/Combobox/Panel/ComboboxOptionContainer.js +42 -0
- package/components/shared/Combobox/Panel/ComboboxOptionContainer.js.map +1 -0
- package/components/shared/Combobox/Panel/ComboboxOptionContainer.spec.js +20 -0
- package/components/shared/Combobox/Panel/ComboboxOptionContainer.spec.js.map +1 -0
- package/components/shared/Combobox/Panel/ComboboxPanel.js +33 -0
- package/components/shared/Combobox/Panel/ComboboxPanel.js.map +1 -0
- package/components/shared/Combobox/Panel/ComboboxPanel.spec.js +62 -0
- package/components/shared/Combobox/Panel/ComboboxPanel.spec.js.map +1 -0
- package/components/shared/Combobox/Panel/ComboboxPanelContainer.js +14 -0
- package/components/shared/Combobox/Panel/ComboboxPanelContainer.js.map +1 -0
- package/components/shared/Combobox/Panel/ComboboxPanelContainer.spec.js +33 -0
- package/components/shared/Combobox/Panel/ComboboxPanelContainer.spec.js.map +1 -0
- package/components/shared/Combobox/Selection/ComboboxClearButton.js +34 -0
- package/components/shared/Combobox/Selection/ComboboxClearButton.js.map +1 -0
- package/components/shared/Combobox/Selection/ComboboxClearButton.spec.js +58 -0
- package/components/shared/Combobox/Selection/ComboboxClearButton.spec.js.map +1 -0
- package/components/shared/Combobox/Selection/ComboboxInput.js +27 -0
- package/components/shared/Combobox/Selection/ComboboxInput.js.map +1 -0
- package/components/shared/Combobox/Selection/ComboboxLabelSelection.js +37 -0
- package/components/shared/Combobox/Selection/ComboboxLabelSelection.js.map +1 -0
- package/components/shared/Combobox/Selection/ComboboxLabelSelection.spec.js +29 -0
- package/components/shared/Combobox/Selection/ComboboxLabelSelection.spec.js.map +1 -0
- package/components/shared/Combobox/Selection/ComboboxSelection.js +24 -0
- package/components/shared/Combobox/Selection/ComboboxSelection.js.map +1 -0
- package/components/shared/Combobox/Selection/ComboboxSelection.spec.js +38 -0
- package/components/shared/Combobox/Selection/ComboboxSelection.spec.js.map +1 -0
- package/components/shared/Combobox/constants.js +13 -0
- package/components/shared/Combobox/constants.js.map +1 -0
- package/components/shared/Combobox/index.js.map +1 -0
- package/components/shared/ComponentErrors/ComponentErrors.js +28 -0
- package/components/shared/ComponentErrors/ComponentErrors.js.map +1 -0
- package/components/shared/ComponentErrors/ComponentErrors.spec.js +42 -0
- package/components/shared/ComponentErrors/ComponentErrors.spec.js.map +1 -0
- package/components/shared/ComponentWrapper.js +34 -0
- package/components/shared/ComponentWrapper.js.map +1 -0
- package/components/shared/Declarations/Declarations.js +19 -0
- package/components/shared/Declarations/Declarations.js.map +1 -0
- package/components/shared/Declarations/Declarations.spec.js +68 -0
- package/components/shared/Declarations/Declarations.spec.js.map +1 -0
- package/components/shared/Fieldset/Fieldset.js +34 -0
- package/components/shared/Fieldset/Fieldset.js.map +1 -0
- package/components/shared/Fieldset/Fieldset.spec.js +27 -0
- package/components/shared/Fieldset/Fieldset.spec.js.map +1 -0
- package/components/shared/HOC/slottableComponent.js +35 -0
- package/components/shared/HOC/slottableComponent.js.map +1 -0
- package/components/shared/Icons/checkbox-checked-icon.js +9 -0
- package/components/shared/Icons/checkbox-checked-icon.js.map +1 -0
- package/components/shared/Icons/checkbox-disabled-icon.js +9 -0
- package/components/shared/Icons/checkbox-disabled-icon.js.map +1 -0
- package/components/shared/Icons/checkbox-unchecked-icon.js +9 -0
- package/components/shared/Icons/checkbox-unchecked-icon.js.map +1 -0
- package/components/shared/Icons/closed-icon.js +9 -0
- package/components/shared/Icons/closed-icon.js.map +1 -0
- package/components/shared/Icons/cross-icon.js +9 -0
- package/components/shared/Icons/cross-icon.js.map +1 -0
- package/components/shared/Icons/icon-props.js +3 -0
- package/components/shared/Icons/icon-props.js.map +1 -0
- package/components/shared/Icons/index.js +24 -0
- package/components/shared/Icons/index.js.map +1 -0
- package/components/shared/Icons/load-icon.js +9 -0
- package/components/shared/Icons/load-icon.js.map +1 -0
- package/components/shared/Icons/lunatic-icon.js +12 -0
- package/components/shared/Icons/lunatic-icon.js.map +1 -0
- package/components/shared/Icons/network-icon.js +9 -0
- package/components/shared/Icons/network-icon.js.map +1 -0
- package/components/shared/Icons/on-drag-icon.js +9 -0
- package/components/shared/Icons/on-drag-icon.js.map +1 -0
- package/components/shared/Icons/opened-icon.js +9 -0
- package/components/shared/Icons/opened-icon.js.map +1 -0
- package/components/shared/Icons/radio-checked-icon.js +10 -0
- package/components/shared/Icons/radio-checked-icon.js.map +1 -0
- package/components/shared/Icons/radio-unchecked-icon.js +9 -0
- package/components/shared/Icons/radio-unchecked-icon.js.map +1 -0
- package/components/shared/Label/Label.js +21 -0
- package/components/shared/Label/Label.js.map +1 -0
- package/components/shared/Label/Label.spec.js +21 -0
- package/components/shared/Label/Label.spec.js.map +1 -0
- package/components/shared/LabelDescription.js +17 -0
- package/components/shared/LabelDescription.js.map +1 -0
- package/components/shared/MDLabel/MDLabel.js +26 -0
- package/components/shared/MDLabel/MDLabel.js.map +1 -0
- package/components/shared/MDLabel/MDLabel.spec.js +112 -0
- package/components/shared/MDLabel/MDLabel.spec.js.map +1 -0
- package/components/shared/MDLabel/MarkdownLink.js +17 -0
- package/components/shared/MDLabel/MarkdownLink.js.map +1 -0
- package/components/shared/MDLabel/RouterLink.js +10 -0
- package/components/shared/MDLabel/RouterLink.js.map +1 -0
- package/components/shared/Missing/Missing.js +56 -0
- package/components/shared/Missing/Missing.js.map +1 -0
- package/components/shared/Missing/Missing.spec.js +47 -0
- package/components/shared/Missing/Missing.spec.js.map +1 -0
- package/components/shared/ModalControls/ModalControls.js +35 -0
- package/components/shared/ModalControls/ModalControls.js.map +1 -0
- package/components/shared/ModalControls/ModalControls.spec.js +63 -0
- package/components/shared/ModalControls/ModalControls.spec.js.map +1 -0
- package/components/shared/Notification.js +14 -0
- package/components/shared/Notification.js.map +1 -0
- package/components/shared/Radio/RadioGroup.js +26 -0
- package/components/shared/Radio/RadioGroup.js.map +1 -0
- package/components/shared/Radio/RadioOption.js +43 -0
- package/components/shared/Radio/RadioOption.js.map +1 -0
- package/components/shared/Radio/RadioOption.spec.js +48 -0
- package/components/shared/Radio/RadioOption.spec.js.map +1 -0
- package/components/shared/Table/Table.js +19 -0
- package/components/shared/Table/Table.js.map +1 -0
- package/components/shared/Table/Table.spec.js +17 -0
- package/components/shared/Table/Table.spec.js.map +1 -0
- package/components/shared/Table/TableHeader.js +17 -0
- package/components/shared/Table/TableHeader.js.map +1 -0
- package/components/shared/Table/Tbody.js +14 -0
- package/components/shared/Table/Tbody.js.map +1 -0
- package/components/shared/Table/Tbody.spec.js +24 -0
- package/components/shared/Table/Tbody.spec.js.map +1 -0
- package/components/shared/Table/Td.js +14 -0
- package/components/shared/Table/Td.js.map +1 -0
- package/components/shared/Table/Td.spec.js +23 -0
- package/components/shared/Table/Td.spec.js.map +1 -0
- package/components/shared/Table/Th.js +14 -0
- package/components/shared/Table/Th.js.map +1 -0
- package/components/shared/Table/Th.spec.js +27 -0
- package/components/shared/Table/Th.spec.js.map +1 -0
- package/components/shared/Table/Thead.js +14 -0
- package/components/shared/Table/Thead.js.map +1 -0
- package/components/shared/Table/Thead.spec.js +14 -0
- package/components/shared/Table/Thead.spec.js.map +1 -0
- package/components/shared/Table/Tr.js +14 -0
- package/components/shared/Table/Tr.js.map +1 -0
- package/components/shared/Table/Tr.spec.js +21 -0
- package/components/shared/Table/Tr.spec.js.map +1 -0
- package/components/shared/Table/index.js +18 -0
- package/components/shared/Table/index.js.map +1 -0
- package/components/type.d.ts +305 -0
- package/components/type.js +3 -0
- package/components/type.js.map +1 -0
- package/constants/component-types.js +5 -0
- package/constants/component-types.js.map +1 -0
- package/constants/declarations.js +15 -0
- package/constants/declarations.js.map +1 -0
- package/constants/event-types.js +16 -0
- package/constants/event-types.js.map +1 -0
- package/constants/index.js +22 -0
- package/constants/index.js.map +1 -0
- package/constants/indexedDBStore.js +22 -0
- package/constants/indexedDBStore.js.map +1 -0
- package/constants/supported-preferences.js +36 -0
- package/constants/supported-preferences.js.map +1 -0
- package/constants/value-types.js +9 -0
- package/constants/value-types.js.map +1 -0
- package/constants/variable-types.js +8 -0
- package/constants/variable-types.js.map +1 -0
- package/hooks/use-auto-focus.js +22 -0
- package/hooks/use-auto-focus.js.map +1 -0
- package/hooks/use-track-changes.js +44 -0
- package/hooks/use-track-changes.js.map +1 -0
- package/hooks/use-why-render.js +17 -0
- package/hooks/use-why-render.js.map +1 -0
- package/hooks/useDebounce.js +30 -0
- package/hooks/useDebounce.js.map +1 -0
- package/hooks/useDocumentEvent.js +20 -0
- package/hooks/useDocumentEvent.js.map +1 -0
- package/hooks/useKeyboardKey.js +28 -0
- package/hooks/useKeyboardKey.js.map +1 -0
- package/hooks/useListKeyboardHandler.js +31 -0
- package/hooks/useListKeyboardHandler.js.map +1 -0
- package/hooks/useRefSync.js +13 -0
- package/hooks/useRefSync.js.map +1 -0
- package/i18n/build-dictionary.js +41 -0
- package/i18n/build-dictionary.js.map +1 -0
- package/i18n/dictionary.js +29 -0
- package/i18n/dictionary.js.map +1 -0
- package/i18n/index.js +42 -0
- package/i18n/index.js.map +1 -0
- package/i18n/inputNumberProps.js +10 -0
- package/i18n/inputNumberProps.js.map +1 -0
- package/index.js +24 -0
- package/index.js.map +1 -0
- package/package.json +1279 -122
- package/src/components/Accordion/Accordion.tsx +18 -0
- package/src/components/CheckboxBoolean/CheckboxBoolean.spec.tsx +84 -0
- package/src/components/CheckboxBoolean/CheckboxBoolean.tsx +81 -0
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +31 -0
- package/src/components/CheckboxGroup/CustomCheckboxGroup.spec.tsx +51 -0
- package/src/components/CheckboxGroup/CustomCheckboxGroup.tsx +84 -0
- package/src/components/CheckboxOne/CheckboxOne.spec.tsx +44 -0
- package/src/components/CheckboxOne/CheckboxOne.tsx +39 -0
- package/src/components/Datepicker/Datepicker.spec.tsx +105 -0
- package/src/components/Datepicker/Datepicker.tsx +165 -0
- package/src/components/Datepicker/DatepickerField.tsx +58 -0
- package/src/components/Datepicker/__snapshots__/Datepicker.spec.tsx.snap +166 -0
- package/src/components/Dropdown/Dropdown.spec.tsx +42 -0
- package/src/components/Dropdown/Dropdown.tsx +69 -0
- package/src/components/Dropdown/__snapshots__/Dropdown.spec.tsx.snap +73 -0
- package/src/components/Dropdown/renderer/SimpleLabelRenderer.tsx +26 -0
- package/src/components/Dropdown/renderer/SimpleOptionRenderer.tsx +26 -0
- package/src/components/Duration/Duration.tsx +97 -0
- package/src/components/Duration/durationUtils.ts +39 -0
- package/src/components/Duration/formatDuration.spec.ts +15 -0
- package/src/components/Duration/formatDuration.ts +19 -0
- package/src/components/Duration/getDurationFromValue.ts +43 -0
- package/src/components/FilterDescription/FilterDescription.spec.tsx +20 -0
- package/src/components/FilterDescription/FilterDescription.tsx +16 -0
- package/src/components/Input/Input.spec.tsx +76 -0
- package/src/components/Input/Input.tsx +77 -0
- package/src/components/Input/__snapshots__/Input.spec.tsx.snap +36 -0
- package/src/components/InputNumber/InputNumber.spec.tsx +115 -0
- package/src/components/InputNumber/InputNumber.tsx +83 -0
- package/src/components/InputNumber/InputNumberThousand.tsx +73 -0
- package/src/components/InputNumber/__snapshots__/InputNumber.spec.tsx.snap +40 -0
- package/src/components/Loop/Loop.tsx +137 -0
- package/src/components/Loop/constant.ts +9 -0
- package/src/components/LunaticComponents.tsx +187 -0
- package/src/components/PairwiseLinks/PairwiseLinks.tsx +93 -0
- package/src/components/Question/Question.tsx +45 -0
- package/src/components/Radio/Radio.tsx +41 -0
- package/src/components/RosterForLoop/RosterForLoop.spec.tsx +42 -0
- package/src/components/RosterForLoop/RosterForLoop.tsx +123 -0
- package/src/components/RosterForLoop/__snapshots__/RosterForLoop.spec.tsx.snap +90 -0
- package/src/components/Roundabout/CustomRoundabout.tsx +117 -0
- package/src/components/Roundabout/Roundabout.tsx +39 -0
- package/src/components/Roundabout/roundabout.spec.tsx +77 -0
- package/src/components/Sequence/Sequence.tsx +28 -0
- package/src/components/Subsequence/Subsequence.spec.tsx +50 -0
- package/src/components/Subsequence/Subsequence.tsx +34 -0
- package/src/components/Suggester/CustomSuggester.tsx +93 -0
- package/src/components/Suggester/Suggester.tsx +160 -0
- package/src/components/Suggester/SuggesterNotification.tsx +58 -0
- package/src/components/Suggester/SuggesterType.ts +5 -0
- package/src/components/Suggester/useSuggestions.ts +113 -0
- package/src/components/Summary/Summary.tsx +121 -0
- package/src/components/Switch/Switch.tsx +108 -0
- package/src/components/Table/Table.tsx +48 -0
- package/src/components/Text/Text.tsx +5 -0
- package/src/components/Textarea/Textarea.spec.tsx +46 -0
- package/src/components/Textarea/Textarea.tsx +82 -0
- package/src/components/Textarea/__snapshots__/Textarea.spec.tsx.snap +32 -0
- package/src/components/library.ts +58 -0
- package/src/components/shared/Button/Button.spec.tsx +75 -0
- package/src/components/shared/Button/Button.tsx +61 -0
- package/src/components/shared/Button/IconButton.spec.tsx +59 -0
- package/src/components/shared/Button/IconButton.tsx +32 -0
- package/src/components/shared/Button/__snapshots__/Button.spec.tsx.snap +80 -0
- package/src/components/shared/Checkbox/CheckboxOption.spec.tsx +58 -0
- package/src/components/shared/Checkbox/CheckboxOption.tsx +98 -0
- package/src/components/shared/Checkbox/getShortcutKey.ts +6 -0
- package/src/components/shared/Combobox/Combobox.stories.tsx +74 -0
- package/src/components/shared/Combobox/Combobox.tsx +225 -0
- package/src/components/shared/Combobox/ComboboxContainer.spec.tsx +37 -0
- package/src/components/shared/Combobox/ComboboxContainer.tsx +40 -0
- package/src/components/shared/Combobox/ComboboxContent.tsx +74 -0
- package/src/components/shared/Combobox/ComboboxContentBox.tsx +21 -0
- package/src/components/shared/Combobox/ComboboxType.ts +54 -0
- package/src/components/shared/Combobox/Panel/ComboboxOption.spec.tsx +37 -0
- package/src/components/shared/Combobox/Panel/ComboboxOption.tsx +41 -0
- package/src/components/shared/Combobox/Panel/ComboboxOptionContainer.spec.tsx +18 -0
- package/src/components/shared/Combobox/Panel/ComboboxOptionContainer.tsx +67 -0
- package/src/components/shared/Combobox/Panel/ComboboxPanel.spec.tsx +97 -0
- package/src/components/shared/Combobox/Panel/ComboboxPanel.tsx +94 -0
- package/src/components/shared/Combobox/Panel/ComboboxPanelContainer.spec.tsx +61 -0
- package/src/components/shared/Combobox/Panel/ComboboxPanelContainer.tsx +26 -0
- package/src/components/shared/Combobox/Selection/ComboboxClearButton.spec.tsx +74 -0
- package/src/components/shared/Combobox/Selection/ComboboxClearButton.tsx +55 -0
- package/src/components/shared/Combobox/Selection/ComboboxInput.tsx +71 -0
- package/src/components/shared/Combobox/Selection/ComboboxLabelSelection.spec.tsx +44 -0
- package/src/components/shared/Combobox/Selection/ComboboxLabelSelection.tsx +70 -0
- package/src/components/shared/Combobox/Selection/ComboboxSelection.spec.tsx +65 -0
- package/src/components/shared/Combobox/Selection/ComboboxSelection.tsx +77 -0
- package/src/components/shared/Combobox/Selection/__snapshots__/ComboboxSelection.spec.tsx.snap +76 -0
- package/src/components/shared/Combobox/constants.ts +9 -0
- package/src/components/shared/Combobox/index.ts +0 -0
- package/src/components/shared/ComponentErrors/ComponentErrors.spec.tsx +46 -0
- package/src/components/shared/ComponentErrors/ComponentErrors.tsx +48 -0
- package/src/components/shared/ComponentWrapper.tsx +66 -0
- package/src/components/shared/Declarations/Declarations.spec.tsx +101 -0
- package/src/components/shared/Declarations/Declarations.tsx +70 -0
- package/src/components/shared/Fieldset/Fieldset.spec.tsx +28 -0
- package/src/components/shared/Fieldset/Fieldset.tsx +47 -0
- package/src/components/shared/HOC/slottableComponent.tsx +155 -0
- package/src/components/shared/Icons/checkbox-checked-icon.tsx +27 -0
- package/src/components/shared/Icons/checkbox-disabled-icon.tsx +27 -0
- package/src/components/shared/Icons/checkbox-unchecked-icon.tsx +27 -0
- package/src/components/shared/Icons/closed-icon.tsx +22 -0
- package/src/components/shared/Icons/cross-icon.tsx +22 -0
- package/src/components/shared/Icons/icon-props.ts +5 -0
- package/src/components/shared/Icons/index.ts +10 -0
- package/src/components/shared/Icons/load-icon.tsx +22 -0
- package/src/components/shared/Icons/lunatic-icon.tsx +9 -0
- package/src/components/shared/Icons/network-icon.tsx +22 -0
- package/src/components/shared/Icons/on-drag-icon.tsx +22 -0
- package/src/components/shared/Icons/opened-icon.tsx +22 -0
- package/src/components/shared/Icons/radio-checked-icon.tsx +29 -0
- package/src/components/shared/Icons/radio-unchecked-icon.tsx +27 -0
- package/src/components/shared/Label/Label.spec.tsx +41 -0
- package/src/components/shared/Label/Label.tsx +46 -0
- package/src/components/shared/LabelDescription.tsx +22 -0
- package/src/components/shared/MDLabel/MDLabel.spec.tsx +145 -0
- package/src/components/shared/MDLabel/MDLabel.tsx +36 -0
- package/src/components/shared/MDLabel/MarkdownLink.tsx +43 -0
- package/src/components/shared/MDLabel/RouterLink.tsx +13 -0
- package/src/components/shared/Missing/Missing.spec.tsx +78 -0
- package/src/components/shared/Missing/Missing.tsx +128 -0
- package/src/components/shared/ModalControls/ModalControls.spec.tsx +69 -0
- package/src/components/shared/ModalControls/ModalControls.tsx +66 -0
- package/src/components/shared/Notification.tsx +25 -0
- package/src/components/shared/Radio/RadioGroup.tsx +80 -0
- package/src/components/shared/Radio/RadioOption.spec.tsx +76 -0
- package/src/components/shared/Radio/RadioOption.tsx +132 -0
- package/src/components/shared/Table/Table.spec.tsx +17 -0
- package/src/components/shared/Table/Table.tsx +48 -0
- package/src/components/shared/Table/TableHeader.tsx +24 -0
- package/src/components/shared/Table/Tbody.spec.tsx +24 -0
- package/src/components/shared/Table/Tbody.tsx +17 -0
- package/src/components/shared/Table/Td.spec.tsx +37 -0
- package/src/components/shared/Table/Td.tsx +28 -0
- package/src/components/shared/Table/Th.spec.tsx +38 -0
- package/src/components/shared/Table/Th.tsx +25 -0
- package/src/components/shared/Table/Thead.spec.tsx +13 -0
- package/src/components/shared/Table/Thead.tsx +17 -0
- package/src/components/shared/Table/Tr.spec.tsx +30 -0
- package/src/components/shared/Table/Tr.tsx +16 -0
- package/src/components/shared/Table/index.ts +7 -0
- package/src/components/type.ts +317 -0
- package/src/constants/component-types.ts +1 -0
- package/src/constants/declarations.ts +14 -0
- package/src/constants/event-types.ts +13 -0
- package/src/constants/index.ts +5 -0
- package/src/constants/indexedDBStore.ts +20 -0
- package/src/constants/supported-preferences.ts +10 -0
- package/src/constants/value-types.ts +5 -0
- package/src/constants/variable-types.ts +4 -0
- package/src/css/components/Button.scss +24 -0
- package/src/css/components/CheckboxGroup.scss +13 -0
- package/src/css/components/CheckboxOne.scss +19 -0
- package/src/css/components/CheckboxOption.scss +87 -0
- package/src/css/components/Combobox.scss +203 -0
- package/src/css/components/ComponentErrors.scss +5 -0
- package/src/css/components/Datepicker.scss +19 -0
- package/src/css/components/Declarations.scss +42 -0
- package/src/css/components/Dragger.scss +8 -0
- package/src/css/components/Dropdown.scss +38 -0
- package/src/css/components/Duration.scss +9 -0
- package/src/css/components/Fieldset.scss +5 -0
- package/src/css/components/IconButton.scss +38 -0
- package/src/css/components/Input.scss +42 -0
- package/src/css/components/InputNumber.scss +11 -0
- package/src/css/components/Label.scss +6 -0
- package/src/css/components/Missing.scss +27 -0
- package/src/css/components/ModalControls.scss +48 -0
- package/src/css/components/RosterForLoop.scss +39 -0
- package/src/css/components/Roundabout.scss +31 -0
- package/src/css/components/Sequence.scss +10 -0
- package/src/css/components/Suggester.scss +170 -0
- package/src/css/components/SuggesterWidget.scss +176 -0
- package/src/css/components/Table.scss +43 -0
- package/src/css/components/Textarea.scss +8 -0
- package/src/css/components/VariableStatus.scss +36 -0
- package/src/css/icons/alert-icon.svg +2 -0
- package/src/css/icons/wait-icon.svg +17 -0
- package/src/css/icons/warn-icon.svg +1 -0
- package/src/css/main.scss +183 -0
- package/src/hooks/use-auto-focus.ts +29 -0
- package/src/hooks/use-track-changes.ts +59 -0
- package/src/hooks/use-why-render.ts +14 -0
- package/src/hooks/useDebounce.ts +39 -0
- package/src/hooks/useDocumentEvent.ts +27 -0
- package/src/hooks/useKeyboardKey.ts +31 -0
- package/src/hooks/useListKeyboardHandler.ts +31 -0
- package/src/hooks/useRefSync.ts +10 -0
- package/src/i18n/build-dictionary.ts +52 -0
- package/src/i18n/dictionary.ts +39 -0
- package/src/i18n/index.ts +19 -0
- package/src/i18n/inputNumberProps.ts +10 -0
- package/src/index.ts +41 -0
- package/src/insee.d.ts +29 -0
- package/src/stories/accordion/accordion.stories.jsx +17 -0
- package/src/stories/accordion/source.json +48 -0
- package/src/stories/behaviour/cleaning/cleaning.stories.jsx +58 -0
- package/src/stories/behaviour/cleaning/source-loop.json +138 -0
- package/src/stories/behaviour/cleaning/source.json +152 -0
- package/src/stories/behaviour/controls/boucles-n.json +202 -0
- package/src/stories/behaviour/controls/controls.stories.jsx +81 -0
- package/src/stories/behaviour/controls/loop.json +141 -0
- package/src/stories/behaviour/controls/roundabout.json +114 -0
- package/src/stories/behaviour/controls/simple-numeric.json +1944 -0
- package/src/stories/behaviour/controls/simple.json +667 -0
- package/src/stories/behaviour/missing/missing.stories.jsx +60 -0
- package/src/stories/behaviour/missing/source.json +818 -0
- package/src/stories/behaviour/others/V2_DeclarationsSimples.json +964 -0
- package/src/stories/behaviour/others/V2_MinMaxSum_Boucles.json +509 -0
- package/src/stories/behaviour/others/V2_QuestSimple_Boucles.json +4347 -0
- package/src/stories/behaviour/others/V2_TCMRallyeGames.json +2892 -0
- package/src/stories/behaviour/others/test-dylan.json +558 -0
- package/src/stories/behaviour/others/test.stories.jsx +78 -0
- package/src/stories/behaviour/paste/source.json +36 -0
- package/src/stories/behaviour/paste/test.stories.jsx +52 -0
- package/src/stories/behaviour/performance/performance.stories.jsx +26 -0
- package/src/stories/behaviour/performance/source.json +179 -0
- package/src/stories/behaviour/resizing/resizing.stories.jsx +60 -0
- package/src/stories/behaviour/resizing/source-resizing-cleaning.json +173 -0
- package/src/stories/behaviour/resizing/source.json +789 -0
- package/src/stories/behaviour/slots.stories.jsx +32 -0
- package/src/stories/checkbox-boolean/checkboxBoolean.stories.jsx +17 -0
- package/src/stories/checkbox-boolean/source.json +58 -0
- package/src/stories/checkbox-group/checkbox-group.stories.jsx +58 -0
- package/src/stories/checkbox-group/source.json +403 -0
- package/src/stories/checkbox-group/sourceCondition.json +87 -0
- package/src/stories/checkbox-group/sourceDetail.json +310 -0
- package/src/stories/checkbox-group/sourceLoop.json +85 -0
- package/src/stories/checkbox-one/checkboxOne.stories.jsx +31 -0
- package/src/stories/checkbox-one/source.json +54 -0
- package/src/stories/checkbox-one/sourceDetail.json +78 -0
- package/src/stories/date-picker/data.json +3 -0
- package/src/stories/date-picker/datepicker.stories.jsx +26 -0
- package/src/stories/date-picker/source.json +65 -0
- package/src/stories/declaration/data.json +1 -0
- package/src/stories/declaration/input.stories.jsx +18 -0
- package/src/stories/declaration/source.json +86 -0
- package/src/stories/disabled/data.json +32 -0
- package/src/stories/disabled/disabled.stories.jsx +18 -0
- package/src/stories/disabled/source.json +383 -0
- package/src/stories/dropdown/data.json +16 -0
- package/src/stories/dropdown/dropdown.stories.jsx +25 -0
- package/src/stories/dropdown/source.json +141 -0
- package/src/stories/duration/duration.stories.jsx +25 -0
- package/src/stories/duration/mois.json +32 -0
- package/src/stories/duration/time.json +32 -0
- package/src/stories/filter-description/filter-description.stories.jsx +33 -0
- package/src/stories/filter-description/source-options.json +81 -0
- package/src/stories/filter-description/source.json +12 -0
- package/src/stories/input/data.json +1 -0
- package/src/stories/input/input.stories.jsx +18 -0
- package/src/stories/input/source.json +35 -0
- package/src/stories/input-number/input-number.stories.jsx +18 -0
- package/src/stories/input-number/source-euro.json +46 -0
- package/src/stories/input-number/source.json +32 -0
- package/src/stories/loop/loop.stories.jsx +29 -0
- package/src/stories/loop/roster-for-loop.stories.jsx +49 -0
- package/src/stories/loop/source-bloc.json +87 -0
- package/src/stories/loop/source-paginated.json +115 -0
- package/src/stories/loop/source-roster.json +115 -0
- package/src/stories/loop/source-with-header.json +136 -0
- package/src/stories/markdown/markdown.stories.jsx +20 -0
- package/src/stories/markdown/source.json +43 -0
- package/src/stories/overview/data.json +1 -0
- package/src/stories/overview/dataLoop.json +189 -0
- package/src/stories/overview/overview.stories.jsx +28 -0
- package/src/stories/overview/source.json +29 -0
- package/src/stories/overview/sourceLoop.json +1424 -0
- package/src/stories/overview/sourceWithHierarchy.json +6289 -0
- package/src/stories/pairwise/data.json +12 -0
- package/src/stories/pairwise/pairwise-links.stories.jsx +48 -0
- package/src/stories/pairwise/source.json +347 -0
- package/src/stories/question/question.stories.jsx +16 -0
- package/src/stories/question/source.json +212 -0
- package/src/stories/questionnaires/logement/data.json +2686 -0
- package/src/stories/questionnaires/logement/logement.stories.jsx +59 -0
- package/src/stories/questionnaires/logement/source-sequence.json +34175 -0
- package/src/stories/questionnaires/logement/source-sum.json +31800 -0
- package/src/stories/questionnaires/logement/source.json +34185 -0
- package/src/stories/questionnaires/recensement/data.json +12 -0
- package/src/stories/questionnaires/recensement/recensement.stories.jsx +35 -0
- package/src/stories/questionnaires/recensement/source.json +15190 -0
- package/src/stories/questionnaires/rp/data.json +5 -0
- package/src/stories/questionnaires/rp/rp.stories.jsx +23 -0
- package/src/stories/questionnaires/rp/source.json +262 -0
- package/src/stories/questionnaires/simpsons/simpsons.stories.jsx +246 -0
- package/src/stories/questionnaires/simpsons/source.json +5078 -0
- package/src/stories/radio/radio.stories.jsx +38 -0
- package/src/stories/radio/source.json +51 -0
- package/src/stories/radio/sourceCondition.json +75 -0
- package/src/stories/radio/sourceDetail.json +97 -0
- package/src/stories/radio/sourceHorizontal.json +42 -0
- package/src/stories/roundabout/data1.json +25 -0
- package/src/stories/roundabout/data2.json +32 -0
- package/src/stories/roundabout/roundabout.stories.jsx +32 -0
- package/src/stories/roundabout/source.json +294 -0
- package/src/stories/sequence/sequence.stories.jsx +29 -0
- package/src/stories/sequence/source-declarations.json +43 -0
- package/src/stories/sequence/source.json +21 -0
- package/src/stories/suggester/fakeReferentiel.json +12 -0
- package/src/stories/suggester/source-arbitrary-response.json +178 -0
- package/src/stories/suggester/source-error.json +155 -0
- package/src/stories/suggester/source-multiline.json +338 -0
- package/src/stories/suggester/source-option-responses.json +156 -0
- package/src/stories/suggester/source.json +425 -0
- package/src/stories/suggester/suggester.stories.jsx +71 -0
- package/src/stories/summary/data.json +32 -0
- package/src/stories/summary/source.json +370 -0
- package/src/stories/summary/summary.stories.jsx +23 -0
- package/src/stories/switch/README.md +29 -0
- package/src/stories/switch/data-forced.json +48 -0
- package/src/stories/switch/source.json +80 -0
- package/src/stories/switch/switch.stories.jsx +17 -0
- package/src/stories/table/data.json +1 -0
- package/src/stories/table/source-colspan.json +315 -0
- package/src/stories/table/source.json +34 -0
- package/src/stories/table/table-dynamique.json +66 -0
- package/src/stories/table/table.stories.jsx +30 -0
- package/src/stories/text/data-roster.json +5 -0
- package/src/stories/text/source-roster.json +187 -0
- package/src/stories/text/source-table.json +293 -0
- package/src/stories/text/source.json +14 -0
- package/src/stories/text/text.stories.jsx +20 -0
- package/src/stories/textarea/data.json +1 -0
- package/src/stories/textarea/source.json +36 -0
- package/src/stories/textarea/textarea.stories.jsx +18 -0
- package/src/stories/utils/SchemaValidator.jsx +40 -0
- package/src/stories/utils/custom-lunatic.scss +28 -0
- package/src/stories/utils/default-arg-types.js +28 -0
- package/src/stories/utils/options.js +19 -0
- package/src/stories/utils/orchestrator.jsx +260 -0
- package/src/stories/utils/orchestrator.scss +64 -0
- package/src/stories/utils/overview.jsx +39 -0
- package/src/stories/utils/overview.scss +38 -0
- package/src/stories/utils/referentiel.js +7 -0
- package/src/test.d.ts +8 -0
- package/src/tests/setup.ts +20 -0
- package/src/tests/utils/e2e.js +91 -0
- package/src/tests/utils/lunatic.ts +37 -0
- package/src/tests/utils/timer.ts +3 -0
- package/src/type.source.ts +468 -0
- package/src/type.utils.ts +8 -0
- package/src/use-lunatic/__snapshots__/use-lunatic.test.ts.snap +2502 -0
- package/src/use-lunatic/actions.ts +72 -0
- package/src/use-lunatic/commons/check-loops.ts +95 -0
- package/src/use-lunatic/commons/check-pager.ts +20 -0
- package/src/use-lunatic/commons/compile-controls.ts +231 -0
- package/src/use-lunatic/commons/component.ts +47 -0
- package/src/use-lunatic/commons/create-map-pages.ts +83 -0
- package/src/use-lunatic/commons/execute-condition-filter.ts +17 -0
- package/src/use-lunatic/commons/fill-components/fill-component-expressions.spec.ts +88 -0
- package/src/use-lunatic/commons/fill-components/fill-component-expressions.ts +205 -0
- package/src/use-lunatic/commons/fill-components/fill-components.ts +75 -0
- package/src/use-lunatic/commons/get-compatible-vtl-expression.ts +23 -0
- package/src/use-lunatic/commons/get-components-from-state.ts +25 -0
- package/src/use-lunatic/commons/is-First-last-page.ts +10 -0
- package/src/use-lunatic/commons/is-paginated-loop.ts +12 -0
- package/src/use-lunatic/commons/is-roundabout.ts +8 -0
- package/src/use-lunatic/commons/page-navigation.spec.ts +140 -0
- package/src/use-lunatic/commons/page-navigation.ts +126 -0
- package/src/use-lunatic/commons/page-tag.spec.ts +43 -0
- package/src/use-lunatic/commons/page-tag.ts +78 -0
- package/src/use-lunatic/commons/page.ts +47 -0
- package/src/use-lunatic/commons/variables/behaviours/cleaning-behaviour.ts +73 -0
- package/src/use-lunatic/commons/variables/behaviours/missing-behaviour.ts +36 -0
- package/src/use-lunatic/commons/variables/behaviours/resizing-behaviour.ts +89 -0
- package/src/use-lunatic/commons/variables/errors.ts +35 -0
- package/src/use-lunatic/commons/variables/get-questionnaire-data.ts +73 -0
- package/src/use-lunatic/commons/variables/lunatic-variables-store.spec.ts +492 -0
- package/src/use-lunatic/commons/variables/lunatic-variables-store.ts +493 -0
- package/src/use-lunatic/hooks/use-loop-variables.ts +23 -0
- package/src/use-lunatic/hooks/use-page-has-response.ts +122 -0
- package/src/use-lunatic/hooks/useOverview.ts +152 -0
- package/src/use-lunatic/hooks/useWarnDepChange.ts +22 -0
- package/src/use-lunatic/logger/ConsoleLogger.ts +13 -0
- package/src/use-lunatic/logger/type.ts +11 -0
- package/src/use-lunatic/lunatic-context.tsx +78 -0
- package/src/use-lunatic/props/getComponentTypeProps.ts +230 -0
- package/src/use-lunatic/props/propIterations.ts +51 -0
- package/src/use-lunatic/props/propMissingResponse.ts +28 -0
- package/src/use-lunatic/props/propOptions.spec.ts +98 -0
- package/src/use-lunatic/props/propOptions.ts +99 -0
- package/src/use-lunatic/props/propValue.spec.ts +67 -0
- package/src/use-lunatic/props/propValue.ts +40 -0
- package/src/use-lunatic/reducer/commons/auto-explore-loop.ts +68 -0
- package/src/use-lunatic/reducer/commons/resize-array-variable.ts +28 -0
- package/src/use-lunatic/reducer/commons/validate-condition-filter.ts +21 -0
- package/src/use-lunatic/reducer/controls/check-base-control.ts +47 -0
- package/src/use-lunatic/reducer/controls/check-roundabout-control.ts +40 -0
- package/src/use-lunatic/reducer/overview/overviewOnInit.ts +74 -0
- package/src/use-lunatic/reducer/reduce-go-next-page.ts +72 -0
- package/src/use-lunatic/reducer/reduce-go-previous-page.ts +39 -0
- package/src/use-lunatic/reducer/reduce-go-to-page.ts +69 -0
- package/src/use-lunatic/reducer/reduce-handle-changes.ts +33 -0
- package/src/use-lunatic/reducer/reducer.ts +24 -0
- package/src/use-lunatic/reducer/reducerInitializer.tsx +178 -0
- package/src/use-lunatic/replace-component-sequence.ts +25 -0
- package/src/use-lunatic/type.ts +212 -0
- package/src/use-lunatic/use-lunatic.test.ts +368 -0
- package/src/use-lunatic/use-lunatic.ts +221 -0
- package/src/utils/array.spec.ts +48 -0
- package/src/utils/array.ts +130 -0
- package/src/utils/constants/alphabet.ts +1 -0
- package/src/utils/constants/features.ts +4 -0
- package/src/utils/constants/links.ts +2 -0
- package/src/utils/constants/missing.ts +2 -0
- package/src/utils/constants/variable-status.ts +5 -0
- package/src/utils/constants/variable-types.ts +1 -0
- package/src/utils/dom.ts +33 -0
- package/src/utils/env.ts +11 -0
- package/src/utils/function.ts +32 -0
- package/src/utils/is-element.ts +7 -0
- package/src/utils/is-object.ts +6 -0
- package/src/utils/logger.ts +17 -0
- package/src/utils/number.spec.ts +10 -0
- package/src/utils/number.ts +33 -0
- package/src/utils/object.ts +35 -0
- package/src/utils/search/SearchInterface.ts +17 -0
- package/src/utils/search/SearchMinisearch.ts +54 -0
- package/src/utils/search/SuggestersDatabase.ts +46 -0
- package/src/utils/search/melauto.ts +48 -0
- package/src/utils/search/tokenizer.ts +77 -0
- package/src/utils/to-number.ts +12 -0
- package/src/utils/variables.spec.ts +94 -0
- package/src/utils/variables.ts +24 -0
- package/src/utils/vtl.ts +116 -0
- package/tests/setup.js +20 -0
- package/tests/setup.js.map +1 -0
- package/tests/utils/lunatic.js +35 -0
- package/tests/utils/lunatic.js.map +1 -0
- package/tests/utils/timer.js +7 -0
- package/tests/utils/timer.js.map +1 -0
- package/type.source.js +8 -0
- package/type.source.js.map +1 -0
- package/type.utils.js +3 -0
- package/type.utils.js.map +1 -0
- package/use-lunatic/actions.js +31 -0
- package/use-lunatic/actions.js.map +1 -0
- package/use-lunatic/commons/check-loops.js +68 -0
- package/use-lunatic/commons/check-loops.js.map +1 -0
- package/use-lunatic/commons/check-pager.js +20 -0
- package/use-lunatic/commons/check-pager.js.map +1 -0
- package/use-lunatic/commons/compile-controls.js +157 -0
- package/use-lunatic/commons/compile-controls.js.map +1 -0
- package/use-lunatic/commons/component.js +28 -0
- package/use-lunatic/commons/component.js.map +1 -0
- package/use-lunatic/commons/create-map-pages.js +63 -0
- package/use-lunatic/commons/create-map-pages.js.map +1 -0
- package/use-lunatic/commons/execute-condition-filter.js +13 -0
- package/use-lunatic/commons/execute-condition-filter.js.map +1 -0
- package/use-lunatic/commons/fill-components/fill-component-expressions.js +151 -0
- package/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -0
- package/use-lunatic/commons/fill-components/fill-component-expressions.spec.js +85 -0
- package/use-lunatic/commons/fill-components/fill-component-expressions.spec.js.map +1 -0
- package/use-lunatic/commons/fill-components/fill-components.js +46 -0
- package/use-lunatic/commons/fill-components/fill-components.js.map +1 -0
- package/use-lunatic/commons/get-compatible-vtl-expression.js +21 -0
- package/use-lunatic/commons/get-compatible-vtl-expression.js.map +1 -0
- package/use-lunatic/commons/get-components-from-state.js +25 -0
- package/use-lunatic/commons/get-components-from-state.js.map +1 -0
- package/use-lunatic/commons/index.d.ts +6 -0
- package/use-lunatic/commons/index.js +21 -0
- package/use-lunatic/commons/index.js.map +1 -0
- package/use-lunatic/commons/is-First-last-page.js +10 -0
- package/use-lunatic/commons/is-First-last-page.js.map +1 -0
- package/use-lunatic/commons/is-paginated-loop.js +7 -0
- package/use-lunatic/commons/is-paginated-loop.js.map +1 -0
- package/use-lunatic/commons/is-roundabout.js +8 -0
- package/use-lunatic/commons/is-roundabout.js.map +1 -0
- package/use-lunatic/commons/page-navigation.js +99 -0
- package/use-lunatic/commons/page-navigation.js.map +1 -0
- package/use-lunatic/commons/page-navigation.spec.js +138 -0
- package/use-lunatic/commons/page-navigation.spec.js.map +1 -0
- package/use-lunatic/commons/page-tag.js +62 -0
- package/use-lunatic/commons/page-tag.js.map +1 -0
- package/use-lunatic/commons/page-tag.spec.js +40 -0
- package/use-lunatic/commons/page-tag.spec.js.map +1 -0
- package/use-lunatic/commons/page.js +43 -0
- package/use-lunatic/commons/page.js.map +1 -0
- package/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +58 -0
- package/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js.map +1 -0
- package/use-lunatic/commons/variables/behaviours/missing-behaviour.js +29 -0
- package/use-lunatic/commons/variables/behaviours/missing-behaviour.js.map +1 -0
- package/use-lunatic/commons/variables/behaviours/resizing-behaviour.js +65 -0
- package/use-lunatic/commons/variables/behaviours/resizing-behaviour.js.map +1 -0
- package/use-lunatic/commons/variables/errors.js +42 -0
- package/use-lunatic/commons/variables/errors.js.map +1 -0
- package/use-lunatic/commons/variables/get-questionnaire-data.js +56 -0
- package/use-lunatic/commons/variables/get-questionnaire-data.js.map +1 -0
- package/use-lunatic/commons/variables/lunatic-variables-store.js +361 -0
- package/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -0
- package/use-lunatic/commons/variables/lunatic-variables-store.spec.js +440 -0
- package/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -0
- package/use-lunatic/hooks/use-loop-variables.js +20 -0
- package/use-lunatic/hooks/use-loop-variables.js.map +1 -0
- package/use-lunatic/hooks/use-page-has-response.js +90 -0
- package/use-lunatic/hooks/use-page-has-response.js.map +1 -0
- package/use-lunatic/hooks/useOverview.js +95 -0
- package/use-lunatic/hooks/useOverview.js.map +1 -0
- package/use-lunatic/hooks/useWarnDepChange.js +20 -0
- package/use-lunatic/hooks/useWarnDepChange.js.map +1 -0
- package/use-lunatic/logger/ConsoleLogger.js +16 -0
- package/use-lunatic/logger/ConsoleLogger.js.map +1 -0
- package/use-lunatic/logger/type.js +3 -0
- package/use-lunatic/logger/type.js.map +1 -0
- package/use-lunatic/lunatic-context.js +53 -0
- package/use-lunatic/lunatic-context.js.map +1 -0
- package/use-lunatic/props/getComponentTypeProps.d.ts +291 -0
- package/use-lunatic/props/getComponentTypeProps.js +167 -0
- package/use-lunatic/props/getComponentTypeProps.js.map +1 -0
- package/use-lunatic/props/propIterations.js +29 -0
- package/use-lunatic/props/propIterations.js.map +1 -0
- package/use-lunatic/props/propMissingResponse.js +16 -0
- package/use-lunatic/props/propMissingResponse.js.map +1 -0
- package/use-lunatic/props/propOptions.js +72 -0
- package/use-lunatic/props/propOptions.js.map +1 -0
- package/use-lunatic/props/propOptions.spec.js +59 -0
- package/use-lunatic/props/propOptions.spec.js.map +1 -0
- package/use-lunatic/props/propValue.js +31 -0
- package/use-lunatic/props/propValue.js.map +1 -0
- package/use-lunatic/props/propValue.spec.js +56 -0
- package/use-lunatic/props/propValue.spec.js.map +1 -0
- package/use-lunatic/reducer/commons/auto-explore-loop.js +55 -0
- package/use-lunatic/reducer/commons/auto-explore-loop.js.map +1 -0
- package/use-lunatic/reducer/commons/index.d.ts +2 -0
- package/use-lunatic/reducer/commons/index.js +24 -0
- package/use-lunatic/reducer/commons/index.js.map +1 -0
- package/use-lunatic/reducer/commons/resize-array-variable.js +23 -0
- package/use-lunatic/reducer/commons/resize-array-variable.js.map +1 -0
- package/use-lunatic/reducer/commons/validate-condition-filter.js +14 -0
- package/use-lunatic/reducer/commons/validate-condition-filter.js.map +1 -0
- package/use-lunatic/reducer/controls/check-base-control.js +38 -0
- package/use-lunatic/reducer/controls/check-base-control.js.map +1 -0
- package/use-lunatic/reducer/controls/check-roundabout-control.js +25 -0
- package/use-lunatic/reducer/controls/check-roundabout-control.js.map +1 -0
- package/use-lunatic/reducer/overview/overviewOnInit.js +53 -0
- package/use-lunatic/reducer/overview/overviewOnInit.js.map +1 -0
- package/use-lunatic/reducer/reduce-go-next-page.js +64 -0
- package/use-lunatic/reducer/reduce-go-next-page.js.map +1 -0
- package/use-lunatic/reducer/reduce-go-previous-page.js +33 -0
- package/use-lunatic/reducer/reduce-go-previous-page.js.map +1 -0
- package/use-lunatic/reducer/reduce-go-to-page.js +57 -0
- package/use-lunatic/reducer/reduce-go-to-page.js.map +1 -0
- package/use-lunatic/reducer/reduce-handle-changes.js +29 -0
- package/use-lunatic/reducer/reduce-handle-changes.js.map +1 -0
- package/use-lunatic/reducer/reducer.js +23 -0
- package/use-lunatic/reducer/reducer.js.map +1 -0
- package/use-lunatic/reducer/reducerInitializer.js +131 -0
- package/use-lunatic/reducer/reducerInitializer.js.map +1 -0
- package/use-lunatic/replace-component-sequence.d.ts +36 -0
- package/use-lunatic/replace-component-sequence.js +22 -0
- package/use-lunatic/replace-component-sequence.js.map +1 -0
- package/use-lunatic/type.js +3 -0
- package/use-lunatic/type.js.map +1 -0
- package/use-lunatic/use-lunatic.js +146 -0
- package/use-lunatic/use-lunatic.js.map +1 -0
- package/utils/array.js +117 -0
- package/utils/array.js.map +1 -0
- package/utils/array.spec.js +44 -0
- package/utils/array.spec.js.map +1 -0
- package/utils/constants/alphabet.js +5 -0
- package/utils/constants/alphabet.js.map +1 -0
- package/utils/constants/features.js +8 -0
- package/utils/constants/features.js.map +1 -0
- package/utils/constants/index.d.ts +5 -0
- package/utils/constants/index.js +22 -0
- package/utils/constants/index.js.map +1 -0
- package/utils/constants/links.js +6 -0
- package/utils/constants/links.js.map +1 -0
- package/utils/constants/missing.js +6 -0
- package/utils/constants/missing.js.map +1 -0
- package/utils/constants/variable-status.js +9 -0
- package/utils/constants/variable-status.js.map +1 -0
- package/utils/constants/variable-types.js +5 -0
- package/utils/constants/variable-types.js.map +1 -0
- package/utils/dom.js +27 -0
- package/utils/dom.js.map +1 -0
- package/utils/env.js +16 -0
- package/utils/env.js.map +1 -0
- package/utils/function.js +28 -0
- package/utils/function.js.map +1 -0
- package/utils/is-element.js +8 -0
- package/utils/is-element.js.map +1 -0
- package/utils/is-object.js +10 -0
- package/utils/is-object.js.map +1 -0
- package/utils/logger.js +19 -0
- package/utils/logger.js.map +1 -0
- package/utils/number.js +37 -0
- package/utils/number.js.map +1 -0
- package/utils/number.spec.js +12 -0
- package/utils/number.spec.js.map +1 -0
- package/utils/object.js +31 -0
- package/utils/object.js.map +1 -0
- package/utils/search/SearchInterface.js +3 -0
- package/utils/search/SearchInterface.js.map +1 -0
- package/utils/search/SearchMinisearch.js +47 -0
- package/utils/search/SearchMinisearch.js.map +1 -0
- package/utils/search/SuggestersDatabase.js +42 -0
- package/utils/search/SuggestersDatabase.js.map +1 -0
- package/utils/search/melauto.js +45 -0
- package/utils/search/melauto.js.map +1 -0
- package/utils/search/tokenizer.js +63 -0
- package/utils/search/tokenizer.js.map +1 -0
- package/utils/to-number.js +16 -0
- package/utils/to-number.js.map +1 -0
- package/utils/variables.js +23 -0
- package/utils/variables.js.map +1 -0
- package/utils/variables.spec.js +85 -0
- package/utils/variables.spec.js.map +1 -0
- package/utils/vtl.js +103 -0
- package/utils/vtl.js.map +1 -0
- package/lib/components/Accordion/Accordion.js +0 -6
- package/lib/components/Accordion/Accordion.js.map +0 -1
- package/lib/components/CheckboxBoolean/CheckboxBoolean.js +0 -19
- package/lib/components/CheckboxBoolean/CheckboxBoolean.js.map +0 -1
- package/lib/components/CheckboxBoolean/CheckboxBoolean.spec.js +0 -37
- package/lib/components/CheckboxBoolean/CheckboxBoolean.spec.js.map +0 -1
- package/lib/components/CheckboxGroup/CheckboxGroup.js +0 -7
- package/lib/components/CheckboxGroup/CheckboxGroup.js.map +0 -1
- package/lib/components/CheckboxGroup/CustomCheckboxGroup.js +0 -16
- package/lib/components/CheckboxGroup/CustomCheckboxGroup.js.map +0 -1
- package/lib/components/CheckboxGroup/CustomCheckboxGroup.spec.js +0 -45
- package/lib/components/CheckboxGroup/CustomCheckboxGroup.spec.js.map +0 -1
- package/lib/components/CheckboxOne/CheckboxOne.js +0 -10
- package/lib/components/CheckboxOne/CheckboxOne.js.map +0 -1
- package/lib/components/CheckboxOne/CheckboxOne.spec.js +0 -24
- package/lib/components/CheckboxOne/CheckboxOne.spec.js.map +0 -1
- package/lib/components/Datepicker/Datepicker.js +0 -66
- package/lib/components/Datepicker/Datepicker.js.map +0 -1
- package/lib/components/Datepicker/Datepicker.spec.js +0 -75
- package/lib/components/Datepicker/Datepicker.spec.js.map +0 -1
- package/lib/components/Datepicker/DatepickerField.js +0 -13
- package/lib/components/Datepicker/DatepickerField.js.map +0 -1
- package/lib/components/Dropdown/Dropdown.js +0 -15
- package/lib/components/Dropdown/Dropdown.js.map +0 -1
- package/lib/components/Dropdown/Dropdown.spec.js +0 -38
- package/lib/components/Dropdown/Dropdown.spec.js.map +0 -1
- package/lib/components/Dropdown/renderer/SimpleLabelRenderer.js +0 -19
- package/lib/components/Dropdown/renderer/SimpleLabelRenderer.js.map +0 -1
- package/lib/components/Dropdown/renderer/SimpleOptionRenderer.js +0 -10
- package/lib/components/Dropdown/renderer/SimpleOptionRenderer.js.map +0 -1
- package/lib/components/Duration/Duration.js +0 -31
- package/lib/components/Duration/Duration.js.map +0 -1
- package/lib/components/Duration/durationUtils.js +0 -26
- package/lib/components/Duration/durationUtils.js.map +0 -1
- package/lib/components/Duration/formatDuration.js +0 -18
- package/lib/components/Duration/formatDuration.js.map +0 -1
- package/lib/components/Duration/formatDuration.spec.js +0 -16
- package/lib/components/Duration/formatDuration.spec.js.map +0 -1
- package/lib/components/Duration/getDurationFromValue.js +0 -37
- package/lib/components/Duration/getDurationFromValue.js.map +0 -1
- package/lib/components/FilterDescription/FilterDescription.js +0 -4
- package/lib/components/FilterDescription/FilterDescription.js.map +0 -1
- package/lib/components/FilterDescription/FilterDescription.spec.js +0 -16
- package/lib/components/FilterDescription/FilterDescription.spec.js.map +0 -1
- package/lib/components/Input/Input.js +0 -15
- package/lib/components/Input/Input.js.map +0 -1
- package/lib/components/Input/Input.spec.js +0 -52
- package/lib/components/Input/Input.spec.js.map +0 -1
- package/lib/components/InputNumber/InputNumber.js +0 -15
- package/lib/components/InputNumber/InputNumber.js.map +0 -1
- package/lib/components/InputNumber/InputNumber.spec.js +0 -76
- package/lib/components/InputNumber/InputNumber.spec.js.map +0 -1
- package/lib/components/InputNumber/InputNumberThousand.js +0 -19
- package/lib/components/InputNumber/InputNumberThousand.js.map +0 -1
- package/lib/components/Loop/Loop.js +0 -55
- package/lib/components/Loop/Loop.js.map +0 -1
- package/lib/components/Loop/constant.js +0 -10
- package/lib/components/Loop/constant.js.map +0 -1
- package/lib/components/LunaticComponents.js +0 -82
- package/lib/components/LunaticComponents.js.map +0 -1
- package/lib/components/PairwiseLinks/PairwiseLinks.js +0 -42
- package/lib/components/PairwiseLinks/PairwiseLinks.js.map +0 -1
- package/lib/components/Question/Question.js +0 -21
- package/lib/components/Question/Question.js.map +0 -1
- package/lib/components/Radio/Radio.js +0 -10
- package/lib/components/Radio/Radio.js.map +0 -1
- package/lib/components/RosterForLoop/RosterForLoop.js +0 -62
- package/lib/components/RosterForLoop/RosterForLoop.js.map +0 -1
- package/lib/components/RosterForLoop/RosterForLoop.spec.js +0 -28
- package/lib/components/RosterForLoop/RosterForLoop.spec.js.map +0 -1
- package/lib/components/Roundabout/CustomRoundabout.js +0 -31
- package/lib/components/Roundabout/CustomRoundabout.js.map +0 -1
- package/lib/components/Roundabout/Roundabout.js +0 -28
- package/lib/components/Roundabout/Roundabout.js.map +0 -1
- package/lib/components/Roundabout/roundabout.spec.js +0 -47
- package/lib/components/Roundabout/roundabout.spec.js.map +0 -1
- package/lib/components/Sequence/Sequence.js +0 -9
- package/lib/components/Sequence/Sequence.js.map +0 -1
- package/lib/components/Subsequence/Subsequence.js +0 -8
- package/lib/components/Subsequence/Subsequence.js.map +0 -1
- package/lib/components/Subsequence/Subsequence.spec.js +0 -42
- package/lib/components/Subsequence/Subsequence.spec.js.map +0 -1
- package/lib/components/Suggester/CustomSuggester.js +0 -18
- package/lib/components/Suggester/CustomSuggester.js.map +0 -1
- package/lib/components/Suggester/Suggester.js +0 -103
- package/lib/components/Suggester/Suggester.js.map +0 -1
- package/lib/components/Suggester/SuggesterNotification.js +0 -16
- package/lib/components/Suggester/SuggesterNotification.js.map +0 -1
- package/lib/components/Suggester/SuggesterType.js +0 -2
- package/lib/components/Suggester/SuggesterType.js.map +0 -1
- package/lib/components/Suggester/useSuggestions.js +0 -86
- package/lib/components/Suggester/useSuggestions.js.map +0 -1
- package/lib/components/Summary/Summary.js +0 -66
- package/lib/components/Summary/Summary.js.map +0 -1
- package/lib/components/Switch/Switch.js +0 -31
- package/lib/components/Switch/Switch.js.map +0 -1
- package/lib/components/Table/Table.js +0 -9
- package/lib/components/Table/Table.js.map +0 -1
- package/lib/components/Text/Text.js +0 -4
- package/lib/components/Text/Text.js.map +0 -1
- package/lib/components/Textarea/Textarea.js +0 -14
- package/lib/components/Textarea/Textarea.js.map +0 -1
- package/lib/components/Textarea/Textarea.spec.js +0 -31
- package/lib/components/Textarea/Textarea.spec.js.map +0 -1
- package/lib/components/library.js +0 -52
- package/lib/components/library.js.map +0 -1
- package/lib/components/shared/Button/Button.js +0 -14
- package/lib/components/shared/Button/Button.js.map +0 -1
- package/lib/components/shared/Button/Button.spec.js +0 -51
- package/lib/components/shared/Button/Button.spec.js.map +0 -1
- package/lib/components/shared/Button/IconButton.js +0 -7
- package/lib/components/shared/Button/IconButton.js.map +0 -1
- package/lib/components/shared/Button/IconButton.spec.js +0 -53
- package/lib/components/shared/Button/IconButton.spec.js.map +0 -1
- package/lib/components/shared/Checkbox/CheckboxOption.js +0 -27
- package/lib/components/shared/Checkbox/CheckboxOption.js.map +0 -1
- package/lib/components/shared/Checkbox/CheckboxOption.spec.js +0 -52
- package/lib/components/shared/Checkbox/CheckboxOption.spec.js.map +0 -1
- package/lib/components/shared/Checkbox/getShortcutKey.js +0 -3
- package/lib/components/shared/Checkbox/getShortcutKey.js.map +0 -1
- package/lib/components/shared/Combobox/Combobox.js +0 -97
- package/lib/components/shared/Combobox/Combobox.js.map +0 -1
- package/lib/components/shared/Combobox/Combobox.stories.js +0 -46
- package/lib/components/shared/Combobox/Combobox.stories.js.map +0 -1
- package/lib/components/shared/Combobox/ComboboxContainer.js +0 -6
- package/lib/components/shared/Combobox/ComboboxContainer.js.map +0 -1
- package/lib/components/shared/Combobox/ComboboxContainer.spec.js +0 -24
- package/lib/components/shared/Combobox/ComboboxContainer.spec.js.map +0 -1
- package/lib/components/shared/Combobox/ComboboxContent.js +0 -33
- package/lib/components/shared/Combobox/ComboboxContent.js.map +0 -1
- package/lib/components/shared/Combobox/ComboboxContentBox.js +0 -8
- package/lib/components/shared/Combobox/ComboboxContentBox.js.map +0 -1
- package/lib/components/shared/Combobox/ComboboxType.js +0 -2
- package/lib/components/shared/Combobox/ComboboxType.js.map +0 -1
- package/lib/components/shared/Combobox/Panel/ComboboxOption.js +0 -15
- package/lib/components/shared/Combobox/Panel/ComboboxOption.js.map +0 -1
- package/lib/components/shared/Combobox/Panel/ComboboxOption.spec.js +0 -33
- package/lib/components/shared/Combobox/Panel/ComboboxOption.spec.js.map +0 -1
- package/lib/components/shared/Combobox/Panel/ComboboxOptionContainer.js +0 -36
- package/lib/components/shared/Combobox/Panel/ComboboxOptionContainer.js.map +0 -1
- package/lib/components/shared/Combobox/Panel/ComboboxOptionContainer.spec.js +0 -18
- package/lib/components/shared/Combobox/Panel/ComboboxOptionContainer.spec.js.map +0 -1
- package/lib/components/shared/Combobox/Panel/ComboboxPanel.js +0 -27
- package/lib/components/shared/Combobox/Panel/ComboboxPanel.js.map +0 -1
- package/lib/components/shared/Combobox/Panel/ComboboxPanel.spec.js +0 -57
- package/lib/components/shared/Combobox/Panel/ComboboxPanel.spec.js.map +0 -1
- package/lib/components/shared/Combobox/Panel/ComboboxPanelContainer.js +0 -9
- package/lib/components/shared/Combobox/Panel/ComboboxPanelContainer.js.map +0 -1
- package/lib/components/shared/Combobox/Panel/ComboboxPanelContainer.spec.js +0 -31
- package/lib/components/shared/Combobox/Panel/ComboboxPanelContainer.spec.js.map +0 -1
- package/lib/components/shared/Combobox/Selection/ComboboxClearButton.js +0 -28
- package/lib/components/shared/Combobox/Selection/ComboboxClearButton.js.map +0 -1
- package/lib/components/shared/Combobox/Selection/ComboboxClearButton.spec.js +0 -53
- package/lib/components/shared/Combobox/Selection/ComboboxClearButton.spec.js.map +0 -1
- package/lib/components/shared/Combobox/Selection/ComboboxInput.js +0 -21
- package/lib/components/shared/Combobox/Selection/ComboboxInput.js.map +0 -1
- package/lib/components/shared/Combobox/Selection/ComboboxLabelSelection.js +0 -31
- package/lib/components/shared/Combobox/Selection/ComboboxLabelSelection.js.map +0 -1
- package/lib/components/shared/Combobox/Selection/ComboboxLabelSelection.spec.js +0 -27
- package/lib/components/shared/Combobox/Selection/ComboboxLabelSelection.spec.js.map +0 -1
- package/lib/components/shared/Combobox/Selection/ComboboxSelection.js +0 -18
- package/lib/components/shared/Combobox/Selection/ComboboxSelection.js.map +0 -1
- package/lib/components/shared/Combobox/Selection/ComboboxSelection.spec.js +0 -36
- package/lib/components/shared/Combobox/Selection/ComboboxSelection.spec.js.map +0 -1
- package/lib/components/shared/Combobox/constants.js +0 -10
- package/lib/components/shared/Combobox/constants.js.map +0 -1
- package/lib/components/shared/Combobox/index.js.map +0 -1
- package/lib/components/shared/ComponentErrors/ComponentErrors.js +0 -24
- package/lib/components/shared/ComponentErrors/ComponentErrors.js.map +0 -1
- package/lib/components/shared/ComponentErrors/ComponentErrors.spec.js +0 -40
- package/lib/components/shared/ComponentErrors/ComponentErrors.spec.js.map +0 -1
- package/lib/components/shared/ComponentWrapper.js +0 -29
- package/lib/components/shared/ComponentWrapper.js.map +0 -1
- package/lib/components/shared/Declarations/Declarations.js +0 -14
- package/lib/components/shared/Declarations/Declarations.js.map +0 -1
- package/lib/components/shared/Declarations/Declarations.spec.js +0 -66
- package/lib/components/shared/Declarations/Declarations.spec.js.map +0 -1
- package/lib/components/shared/Fieldset/Fieldset.js +0 -29
- package/lib/components/shared/Fieldset/Fieldset.js.map +0 -1
- package/lib/components/shared/Fieldset/Fieldset.spec.js +0 -25
- package/lib/components/shared/Fieldset/Fieldset.spec.js.map +0 -1
- package/lib/components/shared/HOC/slottableComponent.js +0 -30
- package/lib/components/shared/HOC/slottableComponent.js.map +0 -1
- package/lib/components/shared/Icons/checkbox-checked-icon.js +0 -7
- package/lib/components/shared/Icons/checkbox-checked-icon.js.map +0 -1
- package/lib/components/shared/Icons/checkbox-disabled-icon.js +0 -7
- package/lib/components/shared/Icons/checkbox-disabled-icon.js.map +0 -1
- package/lib/components/shared/Icons/checkbox-unchecked-icon.js +0 -7
- package/lib/components/shared/Icons/checkbox-unchecked-icon.js.map +0 -1
- package/lib/components/shared/Icons/closed-icon.js +0 -7
- package/lib/components/shared/Icons/closed-icon.js.map +0 -1
- package/lib/components/shared/Icons/cross-icon.js +0 -7
- package/lib/components/shared/Icons/cross-icon.js.map +0 -1
- package/lib/components/shared/Icons/icon-props.js +0 -2
- package/lib/components/shared/Icons/icon-props.js.map +0 -1
- package/lib/components/shared/Icons/index.js +0 -11
- package/lib/components/shared/Icons/index.js.map +0 -1
- package/lib/components/shared/Icons/load-icon.js +0 -7
- package/lib/components/shared/Icons/load-icon.js.map +0 -1
- package/lib/components/shared/Icons/lunatic-icon.js +0 -7
- package/lib/components/shared/Icons/lunatic-icon.js.map +0 -1
- package/lib/components/shared/Icons/network-icon.js +0 -7
- package/lib/components/shared/Icons/network-icon.js.map +0 -1
- package/lib/components/shared/Icons/on-drag-icon.js +0 -7
- package/lib/components/shared/Icons/on-drag-icon.js.map +0 -1
- package/lib/components/shared/Icons/opened-icon.js +0 -7
- package/lib/components/shared/Icons/opened-icon.js.map +0 -1
- package/lib/components/shared/Icons/radio-checked-icon.js +0 -8
- package/lib/components/shared/Icons/radio-checked-icon.js.map +0 -1
- package/lib/components/shared/Icons/radio-unchecked-icon.js +0 -7
- package/lib/components/shared/Icons/radio-unchecked-icon.js.map +0 -1
- package/lib/components/shared/Label/Label.js +0 -16
- package/lib/components/shared/Label/Label.js.map +0 -1
- package/lib/components/shared/Label/Label.spec.js +0 -19
- package/lib/components/shared/Label/Label.spec.js.map +0 -1
- package/lib/components/shared/LabelDescription.js +0 -11
- package/lib/components/shared/LabelDescription.js.map +0 -1
- package/lib/components/shared/MDLabel/MDLabel.js +0 -20
- package/lib/components/shared/MDLabel/MDLabel.js.map +0 -1
- package/lib/components/shared/MDLabel/MDLabel.spec.js +0 -107
- package/lib/components/shared/MDLabel/MDLabel.spec.js.map +0 -1
- package/lib/components/shared/MDLabel/MarkdownLink.js +0 -14
- package/lib/components/shared/MDLabel/MarkdownLink.js.map +0 -1
- package/lib/components/shared/MDLabel/RouterLink.js +0 -7
- package/lib/components/shared/MDLabel/RouterLink.js.map +0 -1
- package/lib/components/shared/Missing/Missing.js +0 -51
- package/lib/components/shared/Missing/Missing.js.map +0 -1
- package/lib/components/shared/Missing/Missing.spec.js +0 -45
- package/lib/components/shared/Missing/Missing.spec.js.map +0 -1
- package/lib/components/shared/ModalControls/ModalControls.js +0 -30
- package/lib/components/shared/ModalControls/ModalControls.js.map +0 -1
- package/lib/components/shared/ModalControls/ModalControls.spec.js +0 -61
- package/lib/components/shared/ModalControls/ModalControls.spec.js.map +0 -1
- package/lib/components/shared/Notification.js +0 -9
- package/lib/components/shared/Notification.js.map +0 -1
- package/lib/components/shared/Radio/RadioGroup.js +0 -23
- package/lib/components/shared/Radio/RadioGroup.js.map +0 -1
- package/lib/components/shared/Radio/RadioOption.js +0 -37
- package/lib/components/shared/Radio/RadioOption.js.map +0 -1
- package/lib/components/shared/Radio/RadioOption.spec.js +0 -46
- package/lib/components/shared/Radio/RadioOption.spec.js.map +0 -1
- package/lib/components/shared/Table/Table.js +0 -14
- package/lib/components/shared/Table/Table.js.map +0 -1
- package/lib/components/shared/Table/Table.spec.js +0 -15
- package/lib/components/shared/Table/Table.spec.js.map +0 -1
- package/lib/components/shared/Table/TableHeader.js +0 -14
- package/lib/components/shared/Table/TableHeader.js.map +0 -1
- package/lib/components/shared/Table/Tbody.js +0 -8
- package/lib/components/shared/Table/Tbody.js.map +0 -1
- package/lib/components/shared/Table/Tbody.spec.js +0 -22
- package/lib/components/shared/Table/Tbody.spec.js.map +0 -1
- package/lib/components/shared/Table/Td.js +0 -8
- package/lib/components/shared/Table/Td.js.map +0 -1
- package/lib/components/shared/Table/Td.spec.js +0 -21
- package/lib/components/shared/Table/Td.spec.js.map +0 -1
- package/lib/components/shared/Table/Th.js +0 -8
- package/lib/components/shared/Table/Th.js.map +0 -1
- package/lib/components/shared/Table/Th.spec.js +0 -25
- package/lib/components/shared/Table/Th.spec.js.map +0 -1
- package/lib/components/shared/Table/Thead.js +0 -9
- package/lib/components/shared/Table/Thead.js.map +0 -1
- package/lib/components/shared/Table/Thead.spec.js +0 -12
- package/lib/components/shared/Table/Thead.spec.js.map +0 -1
- package/lib/components/shared/Table/Tr.js +0 -8
- package/lib/components/shared/Table/Tr.js.map +0 -1
- package/lib/components/shared/Table/Tr.spec.js +0 -19
- package/lib/components/shared/Table/Tr.spec.js.map +0 -1
- package/lib/components/shared/Table/index.js +0 -8
- package/lib/components/shared/Table/index.js.map +0 -1
- package/lib/components/type.d.ts +0 -304
- package/lib/components/type.js +0 -2
- package/lib/components/type.js.map +0 -1
- package/lib/constants/component-types.js +0 -2
- package/lib/constants/component-types.js.map +0 -1
- package/lib/constants/declarations.js +0 -12
- package/lib/constants/declarations.js.map +0 -1
- package/lib/constants/event-types.js +0 -13
- package/lib/constants/event-types.js.map +0 -1
- package/lib/constants/index.js +0 -6
- package/lib/constants/index.js.map +0 -1
- package/lib/constants/indexedDBStore.js +0 -19
- package/lib/constants/indexedDBStore.js.map +0 -1
- package/lib/constants/supported-preferences.js +0 -10
- package/lib/constants/supported-preferences.js.map +0 -1
- package/lib/constants/value-types.js +0 -6
- package/lib/constants/value-types.js.map +0 -1
- package/lib/constants/variable-types.js +0 -5
- package/lib/constants/variable-types.js.map +0 -1
- package/lib/hooks/use-auto-focus.js +0 -19
- package/lib/hooks/use-auto-focus.js.map +0 -1
- package/lib/hooks/use-track-changes.js +0 -41
- package/lib/hooks/use-track-changes.js.map +0 -1
- package/lib/hooks/use-why-render.js +0 -14
- package/lib/hooks/use-why-render.js.map +0 -1
- package/lib/hooks/useDebounce.js +0 -24
- package/lib/hooks/useDebounce.js.map +0 -1
- package/lib/hooks/useDocumentEvent.js +0 -18
- package/lib/hooks/useDocumentEvent.js.map +0 -1
- package/lib/hooks/useKeyboardKey.js +0 -25
- package/lib/hooks/useKeyboardKey.js.map +0 -1
- package/lib/hooks/useListKeyboardHandler.js +0 -28
- package/lib/hooks/useListKeyboardHandler.js.map +0 -1
- package/lib/hooks/useRefSync.js +0 -10
- package/lib/hooks/useRefSync.js.map +0 -1
- package/lib/i18n/build-dictionary.js +0 -38
- package/lib/i18n/build-dictionary.js.map +0 -1
- package/lib/i18n/dictionary.js +0 -27
- package/lib/i18n/dictionary.js.map +0 -1
- package/lib/i18n/index.js +0 -13
- package/lib/i18n/index.js.map +0 -1
- package/lib/i18n/inputNumberProps.js +0 -7
- package/lib/i18n/inputNumberProps.js.map +0 -1
- package/lib/index.js +0 -12
- package/lib/index.js.map +0 -1
- package/lib/tests/setup.js +0 -18
- package/lib/tests/setup.js.map +0 -1
- package/lib/tests/utils/lunatic.js +0 -31
- package/lib/tests/utils/lunatic.js.map +0 -1
- package/lib/tests/utils/timer.js +0 -4
- package/lib/tests/utils/timer.js.map +0 -1
- package/lib/type.source.js +0 -7
- package/lib/type.source.js.map +0 -1
- package/lib/type.utils.js +0 -2
- package/lib/type.utils.js.map +0 -1
- package/lib/use-lunatic/actions.js +0 -26
- package/lib/use-lunatic/actions.js.map +0 -1
- package/lib/use-lunatic/commons/check-loops.js +0 -63
- package/lib/use-lunatic/commons/check-loops.js.map +0 -1
- package/lib/use-lunatic/commons/check-pager.js +0 -17
- package/lib/use-lunatic/commons/check-pager.js.map +0 -1
- package/lib/use-lunatic/commons/compile-controls.js +0 -154
- package/lib/use-lunatic/commons/compile-controls.js.map +0 -1
- package/lib/use-lunatic/commons/component.js +0 -22
- package/lib/use-lunatic/commons/component.js.map +0 -1
- package/lib/use-lunatic/commons/create-map-pages.js +0 -58
- package/lib/use-lunatic/commons/create-map-pages.js.map +0 -1
- package/lib/use-lunatic/commons/execute-condition-filter.js +0 -11
- package/lib/use-lunatic/commons/execute-condition-filter.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +0 -148
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.spec.js +0 -83
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.spec.js.map +0 -1
- package/lib/use-lunatic/commons/fill-components/fill-components.js +0 -41
- package/lib/use-lunatic/commons/fill-components/fill-components.js.map +0 -1
- package/lib/use-lunatic/commons/get-compatible-vtl-expression.js +0 -19
- package/lib/use-lunatic/commons/get-compatible-vtl-expression.js.map +0 -1
- package/lib/use-lunatic/commons/get-components-from-state.js +0 -22
- package/lib/use-lunatic/commons/get-components-from-state.js.map +0 -1
- package/lib/use-lunatic/commons/index.js +0 -7
- package/lib/use-lunatic/commons/index.js.map +0 -1
- package/lib/use-lunatic/commons/is-First-last-page.js +0 -8
- package/lib/use-lunatic/commons/is-First-last-page.js.map +0 -1
- package/lib/use-lunatic/commons/is-paginated-loop.js +0 -5
- package/lib/use-lunatic/commons/is-paginated-loop.js.map +0 -1
- package/lib/use-lunatic/commons/is-roundabout.js +0 -5
- package/lib/use-lunatic/commons/is-roundabout.js.map +0 -1
- package/lib/use-lunatic/commons/page-navigation.js +0 -95
- package/lib/use-lunatic/commons/page-navigation.js.map +0 -1
- package/lib/use-lunatic/commons/page-navigation.spec.js +0 -136
- package/lib/use-lunatic/commons/page-navigation.spec.js.map +0 -1
- package/lib/use-lunatic/commons/page-tag.js +0 -55
- package/lib/use-lunatic/commons/page-tag.js.map +0 -1
- package/lib/use-lunatic/commons/page-tag.spec.js +0 -38
- package/lib/use-lunatic/commons/page-tag.spec.js.map +0 -1
- package/lib/use-lunatic/commons/page.js +0 -35
- package/lib/use-lunatic/commons/page.js.map +0 -1
- package/lib/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +0 -55
- package/lib/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js.map +0 -1
- package/lib/use-lunatic/commons/variables/behaviours/missing-behaviour.js +0 -26
- package/lib/use-lunatic/commons/variables/behaviours/missing-behaviour.js.map +0 -1
- package/lib/use-lunatic/commons/variables/behaviours/resizing-behaviour.js +0 -62
- package/lib/use-lunatic/commons/variables/behaviours/resizing-behaviour.js.map +0 -1
- package/lib/use-lunatic/commons/variables/errors.js +0 -35
- package/lib/use-lunatic/commons/variables/errors.js.map +0 -1
- package/lib/use-lunatic/commons/variables/get-questionnaire-data.js +0 -53
- package/lib/use-lunatic/commons/variables/get-questionnaire-data.js.map +0 -1
- package/lib/use-lunatic/commons/variables/lunatic-variables-store.js +0 -357
- package/lib/use-lunatic/commons/variables/lunatic-variables-store.js.map +0 -1
- package/lib/use-lunatic/commons/variables/lunatic-variables-store.spec.js +0 -438
- package/lib/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +0 -1
- package/lib/use-lunatic/hooks/use-loop-variables.js +0 -17
- package/lib/use-lunatic/hooks/use-loop-variables.js.map +0 -1
- package/lib/use-lunatic/hooks/use-page-has-response.js +0 -87
- package/lib/use-lunatic/hooks/use-page-has-response.js.map +0 -1
- package/lib/use-lunatic/hooks/useOverview.js +0 -91
- package/lib/use-lunatic/hooks/useOverview.js.map +0 -1
- package/lib/use-lunatic/hooks/useWarnDepChange.js +0 -17
- package/lib/use-lunatic/hooks/useWarnDepChange.js.map +0 -1
- package/lib/use-lunatic/logger/ConsoleLogger.js +0 -12
- package/lib/use-lunatic/logger/ConsoleLogger.js.map +0 -1
- package/lib/use-lunatic/logger/type.js +0 -2
- package/lib/use-lunatic/logger/type.js.map +0 -1
- package/lib/use-lunatic/lunatic-context.js +0 -44
- package/lib/use-lunatic/lunatic-context.js.map +0 -1
- package/lib/use-lunatic/props/getComponentTypeProps.d.ts +0 -291
- package/lib/use-lunatic/props/getComponentTypeProps.js +0 -165
- package/lib/use-lunatic/props/getComponentTypeProps.js.map +0 -1
- package/lib/use-lunatic/props/propIterations.js +0 -26
- package/lib/use-lunatic/props/propIterations.js.map +0 -1
- package/lib/use-lunatic/props/propMissingResponse.js +0 -13
- package/lib/use-lunatic/props/propMissingResponse.js.map +0 -1
- package/lib/use-lunatic/props/propOptions.js +0 -69
- package/lib/use-lunatic/props/propOptions.js.map +0 -1
- package/lib/use-lunatic/props/propOptions.spec.js +0 -57
- package/lib/use-lunatic/props/propOptions.spec.js.map +0 -1
- package/lib/use-lunatic/props/propValue.js +0 -28
- package/lib/use-lunatic/props/propValue.js.map +0 -1
- package/lib/use-lunatic/props/propValue.spec.js +0 -54
- package/lib/use-lunatic/props/propValue.spec.js.map +0 -1
- package/lib/use-lunatic/reducer/commons/auto-explore-loop.js +0 -52
- package/lib/use-lunatic/reducer/commons/auto-explore-loop.js.map +0 -1
- package/lib/use-lunatic/reducer/commons/index.js +0 -3
- package/lib/use-lunatic/reducer/commons/index.js.map +0 -1
- package/lib/use-lunatic/reducer/commons/resize-array-variable.js +0 -21
- package/lib/use-lunatic/reducer/commons/resize-array-variable.js.map +0 -1
- package/lib/use-lunatic/reducer/commons/validate-condition-filter.js +0 -12
- package/lib/use-lunatic/reducer/commons/validate-condition-filter.js.map +0 -1
- package/lib/use-lunatic/reducer/controls/check-base-control.js +0 -36
- package/lib/use-lunatic/reducer/controls/check-base-control.js.map +0 -1
- package/lib/use-lunatic/reducer/controls/check-roundabout-control.js +0 -23
- package/lib/use-lunatic/reducer/controls/check-roundabout-control.js.map +0 -1
- package/lib/use-lunatic/reducer/overview/overviewOnInit.js +0 -50
- package/lib/use-lunatic/reducer/overview/overviewOnInit.js.map +0 -1
- package/lib/use-lunatic/reducer/reduce-go-next-page.js +0 -61
- package/lib/use-lunatic/reducer/reduce-go-next-page.js.map +0 -1
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js +0 -30
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js.map +0 -1
- package/lib/use-lunatic/reducer/reduce-go-to-page.js +0 -55
- package/lib/use-lunatic/reducer/reduce-go-to-page.js.map +0 -1
- package/lib/use-lunatic/reducer/reduce-handle-changes.js +0 -26
- package/lib/use-lunatic/reducer/reduce-handle-changes.js.map +0 -1
- package/lib/use-lunatic/reducer/reducer.js +0 -20
- package/lib/use-lunatic/reducer/reducer.js.map +0 -1
- package/lib/use-lunatic/reducer/reducerInitializer.js +0 -128
- package/lib/use-lunatic/reducer/reducerInitializer.js.map +0 -1
- package/lib/use-lunatic/replace-component-sequence.d.ts +0 -9
- package/lib/use-lunatic/replace-component-sequence.js +0 -19
- package/lib/use-lunatic/replace-component-sequence.js.map +0 -1
- package/lib/use-lunatic/type.js +0 -2
- package/lib/use-lunatic/type.js.map +0 -1
- package/lib/use-lunatic/use-lunatic.js +0 -140
- package/lib/use-lunatic/use-lunatic.js.map +0 -1
- package/lib/utils/array.js +0 -107
- package/lib/utils/array.js.map +0 -1
- package/lib/utils/array.spec.js +0 -42
- package/lib/utils/array.spec.js.map +0 -1
- package/lib/utils/constants/alphabet.js +0 -2
- package/lib/utils/constants/alphabet.js.map +0 -1
- package/lib/utils/constants/features.js +0 -5
- package/lib/utils/constants/features.js.map +0 -1
- package/lib/utils/constants/index.js +0 -6
- package/lib/utils/constants/index.js.map +0 -1
- package/lib/utils/constants/links.js +0 -3
- package/lib/utils/constants/links.js.map +0 -1
- package/lib/utils/constants/missing.js +0 -3
- package/lib/utils/constants/missing.js.map +0 -1
- package/lib/utils/constants/variable-status.js +0 -6
- package/lib/utils/constants/variable-status.js.map +0 -1
- package/lib/utils/constants/variable-types.js +0 -2
- package/lib/utils/constants/variable-types.js.map +0 -1
- package/lib/utils/dom.js +0 -23
- package/lib/utils/dom.js.map +0 -1
- package/lib/utils/env.js +0 -13
- package/lib/utils/env.js.map +0 -1
- package/lib/utils/function.js +0 -23
- package/lib/utils/function.js.map +0 -1
- package/lib/utils/is-element.js +0 -6
- package/lib/utils/is-element.js.map +0 -1
- package/lib/utils/is-object.js +0 -7
- package/lib/utils/is-object.js.map +0 -1
- package/lib/utils/logger.js +0 -15
- package/lib/utils/logger.js.map +0 -1
- package/lib/utils/number.js +0 -32
- package/lib/utils/number.js.map +0 -1
- package/lib/utils/number.spec.js +0 -10
- package/lib/utils/number.spec.js.map +0 -1
- package/lib/utils/object.js +0 -26
- package/lib/utils/object.js.map +0 -1
- package/lib/utils/search/SearchInterface.js +0 -2
- package/lib/utils/search/SearchInterface.js.map +0 -1
- package/lib/utils/search/SearchMinisearch.js +0 -40
- package/lib/utils/search/SearchMinisearch.js.map +0 -1
- package/lib/utils/search/SuggestersDatabase.js +0 -38
- package/lib/utils/search/SuggestersDatabase.js.map +0 -1
- package/lib/utils/search/melauto.js +0 -41
- package/lib/utils/search/melauto.js.map +0 -1
- package/lib/utils/search/tokenizer.js +0 -57
- package/lib/utils/search/tokenizer.js.map +0 -1
- package/lib/utils/to-number.js +0 -13
- package/lib/utils/to-number.js.map +0 -1
- package/lib/utils/variables.js +0 -20
- package/lib/utils/variables.js.map +0 -1
- package/lib/utils/variables.spec.js +0 -83
- package/lib/utils/variables.spec.js.map +0 -1
- package/lib/utils/vtl.js +0 -93
- package/lib/utils/vtl.js.map +0 -1
- /package/{lib/components → components}/Accordion/Accordion.d.ts +0 -0
- /package/{lib/components → components}/CheckboxBoolean/CheckboxBoolean.d.ts +0 -0
- /package/{lib/components → components}/CheckboxBoolean/CheckboxBoolean.spec.d.ts +0 -0
- /package/{lib/components → components}/CheckboxGroup/CheckboxGroup.d.ts +0 -0
- /package/{lib/components → components}/CheckboxGroup/CustomCheckboxGroup.d.ts +0 -0
- /package/{lib/components → components}/CheckboxGroup/CustomCheckboxGroup.spec.d.ts +0 -0
- /package/{lib/components → components}/CheckboxOne/CheckboxOne.d.ts +0 -0
- /package/{lib/components → components}/CheckboxOne/CheckboxOne.spec.d.ts +0 -0
- /package/{lib/components → components}/Datepicker/Datepicker.d.ts +0 -0
- /package/{lib/components → components}/Datepicker/Datepicker.spec.d.ts +0 -0
- /package/{lib/components → components}/Datepicker/DatepickerField.d.ts +0 -0
- /package/{lib/components → components}/Dropdown/Dropdown.d.ts +0 -0
- /package/{lib/components → components}/Dropdown/Dropdown.spec.d.ts +0 -0
- /package/{lib/components → components}/Dropdown/renderer/SimpleLabelRenderer.d.ts +0 -0
- /package/{lib/components → components}/Dropdown/renderer/SimpleOptionRenderer.d.ts +0 -0
- /package/{lib/components → components}/Duration/Duration.d.ts +0 -0
- /package/{lib/components → components}/Duration/durationUtils.d.ts +0 -0
- /package/{lib/components → components}/Duration/formatDuration.d.ts +0 -0
- /package/{lib/components → components}/Duration/formatDuration.spec.d.ts +0 -0
- /package/{lib/components → components}/Duration/getDurationFromValue.d.ts +0 -0
- /package/{lib/components → components}/FilterDescription/FilterDescription.d.ts +0 -0
- /package/{lib/components → components}/FilterDescription/FilterDescription.spec.d.ts +0 -0
- /package/{lib/components → components}/Input/Input.d.ts +0 -0
- /package/{lib/components → components}/Input/Input.spec.d.ts +0 -0
- /package/{lib/components → components}/InputNumber/InputNumber.d.ts +0 -0
- /package/{lib/components → components}/InputNumber/InputNumber.spec.d.ts +0 -0
- /package/{lib/components → components}/InputNumber/InputNumberThousand.d.ts +0 -0
- /package/{lib/components → components}/Loop/Loop.d.ts +0 -0
- /package/{lib/components → components}/Loop/constant.d.ts +0 -0
- /package/{lib/components → components}/LunaticComponents.d.ts +0 -0
- /package/{lib/components → components}/PairwiseLinks/PairwiseLinks.d.ts +0 -0
- /package/{lib/components → components}/Question/Question.d.ts +0 -0
- /package/{lib/components → components}/Radio/Radio.d.ts +0 -0
- /package/{lib/components → components}/RosterForLoop/RosterForLoop.d.ts +0 -0
- /package/{lib/components → components}/RosterForLoop/RosterForLoop.spec.d.ts +0 -0
- /package/{lib/components → components}/Roundabout/CustomRoundabout.d.ts +0 -0
- /package/{lib/components → components}/Roundabout/Roundabout.d.ts +0 -0
- /package/{lib/components → components}/Roundabout/roundabout.spec.d.ts +0 -0
- /package/{lib/components → components}/Sequence/Sequence.d.ts +0 -0
- /package/{lib/components → components}/Subsequence/Subsequence.d.ts +0 -0
- /package/{lib/components → components}/Subsequence/Subsequence.spec.d.ts +0 -0
- /package/{lib/components → components}/Suggester/CustomSuggester.d.ts +0 -0
- /package/{lib/components → components}/Suggester/Suggester.d.ts +0 -0
- /package/{lib/components → components}/Suggester/SuggesterNotification.d.ts +0 -0
- /package/{lib/components → components}/Suggester/SuggesterType.d.ts +0 -0
- /package/{lib/components → components}/Suggester/useSuggestions.d.ts +0 -0
- /package/{lib/components → components}/Summary/Summary.d.ts +0 -0
- /package/{lib/components → components}/Switch/Switch.d.ts +0 -0
- /package/{lib/components → components}/Table/Table.d.ts +0 -0
- /package/{lib/components → components}/Text/Text.d.ts +0 -0
- /package/{lib/components → components}/Textarea/Textarea.d.ts +0 -0
- /package/{lib/components → components}/Textarea/Textarea.spec.d.ts +0 -0
- /package/{lib/components → components}/library.d.ts +0 -0
- /package/{lib/components → components}/shared/Button/Button.d.ts +0 -0
- /package/{lib/components → components}/shared/Button/Button.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Button/IconButton.d.ts +0 -0
- /package/{lib/components → components}/shared/Button/IconButton.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Checkbox/CheckboxOption.d.ts +0 -0
- /package/{lib/components → components}/shared/Checkbox/CheckboxOption.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Checkbox/getShortcutKey.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Combobox.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Combobox.stories.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/ComboboxContainer.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/ComboboxContainer.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/ComboboxContent.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/ComboboxContentBox.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/ComboboxType.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Panel/ComboboxOption.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Panel/ComboboxOption.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Panel/ComboboxOptionContainer.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Panel/ComboboxOptionContainer.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Panel/ComboboxPanel.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Panel/ComboboxPanel.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Panel/ComboboxPanelContainer.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Panel/ComboboxPanelContainer.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Selection/ComboboxClearButton.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Selection/ComboboxClearButton.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Selection/ComboboxInput.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Selection/ComboboxLabelSelection.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Selection/ComboboxLabelSelection.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Selection/ComboboxSelection.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/Selection/ComboboxSelection.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/constants.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/index.d.ts +0 -0
- /package/{lib/components → components}/shared/Combobox/index.js +0 -0
- /package/{lib/components → components}/shared/ComponentErrors/ComponentErrors.d.ts +0 -0
- /package/{lib/components → components}/shared/ComponentErrors/ComponentErrors.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/ComponentWrapper.d.ts +0 -0
- /package/{lib/components → components}/shared/Declarations/Declarations.d.ts +0 -0
- /package/{lib/components → components}/shared/Declarations/Declarations.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Fieldset/Fieldset.d.ts +0 -0
- /package/{lib/components → components}/shared/Fieldset/Fieldset.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/HOC/slottableComponent.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/checkbox-checked-icon.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/checkbox-disabled-icon.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/checkbox-unchecked-icon.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/closed-icon.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/cross-icon.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/icon-props.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/index.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/load-icon.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/lunatic-icon.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/network-icon.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/on-drag-icon.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/opened-icon.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/radio-checked-icon.d.ts +0 -0
- /package/{lib/components → components}/shared/Icons/radio-unchecked-icon.d.ts +0 -0
- /package/{lib/components → components}/shared/Label/Label.d.ts +0 -0
- /package/{lib/components → components}/shared/Label/Label.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/LabelDescription.d.ts +0 -0
- /package/{lib/components → components}/shared/MDLabel/MDLabel.d.ts +0 -0
- /package/{lib/components → components}/shared/MDLabel/MDLabel.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/MDLabel/MarkdownLink.d.ts +0 -0
- /package/{lib/components → components}/shared/MDLabel/RouterLink.d.ts +0 -0
- /package/{lib/components → components}/shared/Missing/Missing.d.ts +0 -0
- /package/{lib/components → components}/shared/Missing/Missing.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/ModalControls/ModalControls.d.ts +0 -0
- /package/{lib/components → components}/shared/ModalControls/ModalControls.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Notification.d.ts +0 -0
- /package/{lib/components → components}/shared/Radio/RadioGroup.d.ts +0 -0
- /package/{lib/components → components}/shared/Radio/RadioOption.d.ts +0 -0
- /package/{lib/components → components}/shared/Radio/RadioOption.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/Table.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/Table.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/TableHeader.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/Tbody.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/Tbody.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/Td.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/Td.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/Th.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/Th.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/Thead.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/Thead.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/Tr.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/Tr.spec.d.ts +0 -0
- /package/{lib/components → components}/shared/Table/index.d.ts +0 -0
- /package/{lib/constants → constants}/component-types.d.ts +0 -0
- /package/{lib/constants → constants}/declarations.d.ts +0 -0
- /package/{lib/constants → constants}/event-types.d.ts +0 -0
- /package/{lib/constants → constants}/index.d.ts +0 -0
- /package/{lib/constants → constants}/indexedDBStore.d.ts +0 -0
- /package/{lib/constants → constants}/supported-preferences.d.ts +0 -0
- /package/{lib/constants → constants}/value-types.d.ts +0 -0
- /package/{lib/constants → constants}/variable-types.d.ts +0 -0
- /package/{lib/hooks → hooks}/use-auto-focus.d.ts +0 -0
- /package/{lib/hooks → hooks}/use-track-changes.d.ts +0 -0
- /package/{lib/hooks → hooks}/use-why-render.d.ts +0 -0
- /package/{lib/hooks → hooks}/useDebounce.d.ts +0 -0
- /package/{lib/hooks → hooks}/useDocumentEvent.d.ts +0 -0
- /package/{lib/hooks → hooks}/useKeyboardKey.d.ts +0 -0
- /package/{lib/hooks → hooks}/useListKeyboardHandler.d.ts +0 -0
- /package/{lib/hooks → hooks}/useRefSync.d.ts +0 -0
- /package/{lib/i18n → i18n}/build-dictionary.d.ts +0 -0
- /package/{lib/i18n → i18n}/dictionary.d.ts +0 -0
- /package/{lib/i18n → i18n}/index.d.ts +0 -0
- /package/{lib/i18n → i18n}/inputNumberProps.d.ts +0 -0
- /package/{lib/icons → icons}/alert-icon.svg +0 -0
- /package/{lib/icons → icons}/wait-icon.svg +0 -0
- /package/{lib/icons → icons}/warn-icon.svg +0 -0
- /package/{lib/index.d.ts → index.d.ts} +0 -0
- /package/{lib/main.css → main.css} +0 -0
- /package/{lib/main.css.map → main.css.map} +0 -0
- /package/{lib/use-lunatic/commons/index.d.ts → src/use-lunatic/commons/index.ts} +0 -0
- /package/{lib/use-lunatic/reducer/commons/index.d.ts → src/use-lunatic/reducer/commons/index.ts} +0 -0
- /package/{lib/utils/constants/index.d.ts → src/utils/constants/index.ts} +0 -0
- /package/{lib/tests → tests}/setup.d.ts +0 -0
- /package/{lib/tests → tests}/utils/lunatic.d.ts +0 -0
- /package/{lib/tests → tests}/utils/timer.d.ts +0 -0
- /package/{lib/type.source.d.ts → type.source.d.ts} +0 -0
- /package/{lib/type.utils.d.ts → type.utils.d.ts} +0 -0
- /package/{lib/use-lunatic → use-lunatic}/actions.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/check-loops.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/check-pager.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/compile-controls.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/component.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/create-map-pages.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/execute-condition-filter.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/fill-components/fill-component-expressions.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/fill-components/fill-component-expressions.spec.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/fill-components/fill-components.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/get-compatible-vtl-expression.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/get-components-from-state.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/is-First-last-page.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/is-paginated-loop.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/is-roundabout.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/page-navigation.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/page-navigation.spec.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/page-tag.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/page-tag.spec.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/page.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/variables/behaviours/cleaning-behaviour.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/variables/behaviours/missing-behaviour.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/variables/behaviours/resizing-behaviour.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/variables/errors.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/variables/get-questionnaire-data.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/variables/lunatic-variables-store.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/commons/variables/lunatic-variables-store.spec.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/hooks/use-loop-variables.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/hooks/use-page-has-response.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/hooks/useOverview.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/hooks/useWarnDepChange.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/logger/ConsoleLogger.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/logger/type.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/lunatic-context.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/props/propIterations.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/props/propMissingResponse.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/props/propOptions.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/props/propOptions.spec.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/props/propValue.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/props/propValue.spec.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/reducer/commons/auto-explore-loop.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/reducer/commons/resize-array-variable.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/reducer/commons/validate-condition-filter.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/reducer/controls/check-base-control.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/reducer/controls/check-roundabout-control.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/reducer/overview/overviewOnInit.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/reducer/reduce-go-next-page.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/reducer/reduce-go-previous-page.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/reducer/reduce-go-to-page.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/reducer/reduce-handle-changes.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/reducer/reducer.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/reducer/reducerInitializer.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/type.d.ts +0 -0
- /package/{lib/use-lunatic → use-lunatic}/use-lunatic.d.ts +0 -0
- /package/{lib/utils → utils}/array.d.ts +0 -0
- /package/{lib/utils → utils}/array.spec.d.ts +0 -0
- /package/{lib/utils → utils}/constants/alphabet.d.ts +0 -0
- /package/{lib/utils → utils}/constants/features.d.ts +0 -0
- /package/{lib/utils → utils}/constants/links.d.ts +0 -0
- /package/{lib/utils → utils}/constants/missing.d.ts +0 -0
- /package/{lib/utils → utils}/constants/variable-status.d.ts +0 -0
- /package/{lib/utils → utils}/constants/variable-types.d.ts +0 -0
- /package/{lib/utils → utils}/dom.d.ts +0 -0
- /package/{lib/utils → utils}/env.d.ts +0 -0
- /package/{lib/utils → utils}/function.d.ts +0 -0
- /package/{lib/utils → utils}/is-element.d.ts +0 -0
- /package/{lib/utils → utils}/is-object.d.ts +0 -0
- /package/{lib/utils → utils}/logger.d.ts +0 -0
- /package/{lib/utils → utils}/number.d.ts +0 -0
- /package/{lib/utils → utils}/number.spec.d.ts +0 -0
- /package/{lib/utils → utils}/object.d.ts +0 -0
- /package/{lib/utils → utils}/search/SearchInterface.d.ts +0 -0
- /package/{lib/utils → utils}/search/SearchMinisearch.d.ts +0 -0
- /package/{lib/utils → utils}/search/SuggestersDatabase.d.ts +0 -0
- /package/{lib/utils → utils}/search/melauto.d.ts +0 -0
- /package/{lib/utils → utils}/search/tokenizer.d.ts +0 -0
- /package/{lib/utils → utils}/to-number.d.ts +0 -0
- /package/{lib/utils → utils}/variables.d.ts +0 -0
- /package/{lib/utils → utils}/variables.spec.d.ts +0 -0
- /package/{lib/utils → utils}/vtl.d.ts +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Suggester = Suggester;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const CustomSuggester_1 = require("./CustomSuggester");
|
|
10
|
+
const ComponentErrors_1 = require("../shared/ComponentErrors/ComponentErrors");
|
|
11
|
+
const useSuggestions_1 = require("./useSuggestions");
|
|
12
|
+
const i18n_1 = __importDefault(require("../../i18n"));
|
|
13
|
+
function Suggester({ storeName, id, className, optionRenderer, labelRenderer, handleChanges, disabled, value, label, declarations, description, errors, readOnly, response, optionResponses = [], executeExpression, iteration, arbitrary, arbitraryValue, }) {
|
|
14
|
+
// Default options should not change between render
|
|
15
|
+
// so we can break the rule of hooks here
|
|
16
|
+
const [selectedOptions, setSelectedOptions] = (0, react_1.useState)(() => {
|
|
17
|
+
if (arbitraryValue) {
|
|
18
|
+
return [{ id: 'OTHER', label: arbitraryValue, value: 'OTHER' }];
|
|
19
|
+
}
|
|
20
|
+
if (!value) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
const labelResponse = optionResponses?.find((o) => o.attribute === 'label');
|
|
24
|
+
if (!labelResponse) {
|
|
25
|
+
return [{ id: value, label: value, value: value }];
|
|
26
|
+
}
|
|
27
|
+
const label = executeExpression({ value: labelResponse.name, type: 'VTL' }, {
|
|
28
|
+
iteration,
|
|
29
|
+
});
|
|
30
|
+
if (typeof label !== 'string') {
|
|
31
|
+
return [{ id: value, label: value, value: value }];
|
|
32
|
+
}
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
id: value,
|
|
36
|
+
label: label,
|
|
37
|
+
value: value,
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
});
|
|
41
|
+
const { state, options, search, setSearch, onFocus, onBlur } = (0, useSuggestions_1.useSuggestions)({
|
|
42
|
+
storeName: storeName,
|
|
43
|
+
allowArbitrary: !!arbitrary,
|
|
44
|
+
selectedOptions: selectedOptions,
|
|
45
|
+
});
|
|
46
|
+
const onChange = (v) => {
|
|
47
|
+
setSelectedOptions(v?.id ? [v] : []);
|
|
48
|
+
// User has selected an option
|
|
49
|
+
if (v?.id && v.id !== useSuggestions_1.OTHER_VALUE) {
|
|
50
|
+
const newResponses = [
|
|
51
|
+
{ name: response.name, value: v.id },
|
|
52
|
+
];
|
|
53
|
+
if (arbitrary) {
|
|
54
|
+
newResponses.push({
|
|
55
|
+
name: arbitrary.response.name,
|
|
56
|
+
value: null,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
// Update additional responses
|
|
60
|
+
for (const optionResponse of optionResponses) {
|
|
61
|
+
if (optionResponse.attribute in v) {
|
|
62
|
+
newResponses.push({
|
|
63
|
+
name: optionResponse.name,
|
|
64
|
+
value: v[optionResponse.attribute],
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
handleChanges(newResponses);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// Use has selected the arbitrary value
|
|
72
|
+
const newResponses = [
|
|
73
|
+
{ name: response.name, value: null },
|
|
74
|
+
];
|
|
75
|
+
// User chose an arbitrary option or clear the value
|
|
76
|
+
if (arbitrary && arbitrary.response) {
|
|
77
|
+
newResponses.push({
|
|
78
|
+
name: arbitrary.response.name,
|
|
79
|
+
value: v?.id === useSuggestions_1.OTHER_VALUE ? search : null,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
for (const optionResponse of optionResponses) {
|
|
83
|
+
newResponses.push({ name: optionResponse.name, value: null });
|
|
84
|
+
}
|
|
85
|
+
handleChanges(newResponses);
|
|
86
|
+
onBlur();
|
|
87
|
+
};
|
|
88
|
+
const componentErrors = (0, ComponentErrors_1.getComponentErrors)(errors, id) ?? [];
|
|
89
|
+
if (state === 'error') {
|
|
90
|
+
componentErrors.push({
|
|
91
|
+
id: 'suggester',
|
|
92
|
+
errorMessage: i18n_1.default.SUGGESTER_ERROR,
|
|
93
|
+
criticality: 'ERROR',
|
|
94
|
+
typeOfControl: 'FORMAT',
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
const handleSearch = (query) => {
|
|
98
|
+
if (query === '' && selectedOptions.length > 0) {
|
|
99
|
+
onChange(null);
|
|
100
|
+
}
|
|
101
|
+
setSearch(query);
|
|
102
|
+
};
|
|
103
|
+
const handleClear = () => {
|
|
104
|
+
onChange(null);
|
|
105
|
+
setSearch('');
|
|
106
|
+
};
|
|
107
|
+
return ((0, jsx_runtime_1.jsx)(CustomSuggester_1.CustomSuggester, { state: state, id: id, className: className, optionRenderer: optionRenderer, labelRenderer: labelRenderer, options: options, onSelect: onChange, onFocus: onFocus, search: search, onSearch: handleSearch, onClear: handleClear, disabled: disabled, readOnly: readOnly, value: selectedOptions, label: label, onBlur: onBlur, declarations: declarations, description: description, errors: componentErrors }));
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=Suggester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Suggester.js","sourceRoot":"","sources":["../../src/components/Suggester/Suggester.tsx"],"names":[],"mappings":";;;;;AAQA,8BAuJC;;AA/JD,iCAAiC;AAEjC,uDAAoD;AACpD,+EAA+E;AAC/E,qDAA+D;AAC/D,sDAA2B;AAG3B,SAAgB,SAAS,CAAC,EACzB,SAAS,EACT,EAAE,EACF,SAAS,EACT,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAAQ,EACR,KAAK,EACL,KAAK,EACL,YAAY,EACZ,WAAW,EACX,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,eAAe,GAAG,EAAE,EACpB,iBAAiB,EACjB,SAAS,EACT,SAAS,EACT,cAAc,GACsB;IACpC,mDAAmD;IACnD,yCAAyC;IACzC,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAEpD,GAAG,EAAE;QACN,IAAI,cAAc,EAAE,CAAC;YACpB,OAAO,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,CAA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 -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SuggesterNotification = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Notification_1 = require("../shared/Notification");
|
|
6
|
+
const slottableComponent_1 = require("../shared/HOC/slottableComponent");
|
|
7
|
+
const Label_1 = require("../shared/Label/Label");
|
|
8
|
+
function LunaticSuggesterNotification({ status, storeName, label, description, }) {
|
|
9
|
+
if (status === 'Idle') {
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { description: description, children: label }), (0, jsx_runtime_1.jsx)(Notification_1.Notification, { className: "info", title: `Chargement : ${storeName}`, description: `Votre référentiel est en cours de chargement. Vous pouvez poursuivre le questionnaire et revenir ultérieurement sur cette question.` })] }));
|
|
11
|
+
}
|
|
12
|
+
if (status === 'Error') {
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { description: description, children: label }), (0, jsx_runtime_1.jsx)(Notification_1.Notification, { className: "error", title: `Échec chargement`, description: `Le référentiel ${storeName} n'a pas pu finir son chargement correctement.` })] }));
|
|
14
|
+
}
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { description: description, children: label }), (0, jsx_runtime_1.jsx)(Notification_1.Notification, { className: "warn", title: `Référentiel inconnu`, description: `Le référentiel ${storeName} n'est pas pris en compte par l'application.` })] }));
|
|
16
|
+
}
|
|
17
|
+
exports.SuggesterNotification = (0, slottableComponent_1.slottableComponent)('SuggesterNotification', LunaticSuggesterNotification);
|
|
18
|
+
//# sourceMappingURL=SuggesterNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuggesterNotification.js","sourceRoot":"","sources":["../../src/components/Suggester/SuggesterNotification.tsx"],"names":[],"mappings":";;;;AACA,yDAAsD;AACtD,yEAAsE;AACtE,iDAA8C;AAS9C,SAAS,4BAA4B,CAAC,EACrC,MAAM,EACN,SAAS,EACT,KAAK,EACL,WAAW,GACJ;IACP,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACvB,OAAO,CACN,6DACC,uBAAC,aAAK,IAAC,WAAW,EAAE,WAAW,YAAG,KAAK,GAAS,EAChD,uBAAC,2BAAY,IACZ,SAAS,EAAC,MAAM,EAChB,KAAK,EAAE,gBAAgB,SAAS,EAAE,EAClC,WAAW,EAAE,qIAAqI,GACjJ,IACA,CACH,CAAC;IACH,CAAC;IACD,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACxB,OAAO,CACN,6DACC,uBAAC,aAAK,IAAC,WAAW,EAAE,WAAW,YAAG,KAAK,GAAS,EAChD,uBAAC,2BAAY,IACZ,SAAS,EAAC,OAAO,EACjB,KAAK,EAAE,kBAAkB,EACzB,WAAW,EAAE,kBAAkB,SAAS,gDAAgD,GACvF,IACA,CACH,CAAC;IACH,CAAC;IACD,OAAO,CACN,6DACC,uBAAC,aAAK,IAAC,WAAW,EAAE,WAAW,YAAG,KAAK,GAAS,EAChD,uBAAC,2BAAY,IACZ,SAAS,EAAC,MAAM,EAChB,KAAK,EAAE,qBAAqB,EAC5B,WAAW,EAAE,kBAAkB,SAAS,8CAA8C,GACrF,IACA,CACH,CAAC;AACH,CAAC;AAEY,QAAA,qBAAqB,GAAG,IAAA,uCAAkB,EACtD,uBAAuB,EACvB,4BAA4B,CAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuggesterType.js","sourceRoot":"","sources":["../../src/components/Suggester/SuggesterType.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OTHER_VALUE = void 0;
|
|
4
|
+
exports.useSuggestions = useSuggestions;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const useDebounce_1 = require("../../hooks/useDebounce");
|
|
7
|
+
const SuggestersDatabase_1 = require("../../utils/search/SuggestersDatabase");
|
|
8
|
+
const useRefSync_1 = require("../../hooks/useRefSync");
|
|
9
|
+
exports.OTHER_VALUE = 'OTHER';
|
|
10
|
+
function useSuggestions({ storeName, selectedOptions, allowArbitrary, }) {
|
|
11
|
+
const [searchQuery, setSearchQuery] = (0, react_1.useState)('');
|
|
12
|
+
const store = (0, SuggestersDatabase_1.getSearchForStore)(storeName);
|
|
13
|
+
const searchIndexRef = (0, useRefSync_1.useRefSync)(store.index);
|
|
14
|
+
// eslint-disable-next-line prefer-const
|
|
15
|
+
let [options, setOptions] = (0, react_1.useState)(selectedOptions);
|
|
16
|
+
const [state, setState] = (0, react_1.useState)(store.error !== null
|
|
17
|
+
? 'error'
|
|
18
|
+
: store.search.isIndexed()
|
|
19
|
+
? 'success'
|
|
20
|
+
: 'loading');
|
|
21
|
+
// Index the data when the component is loaded
|
|
22
|
+
(0, react_1.useEffect)(() => {
|
|
23
|
+
if (!searchIndexRef.current) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
searchIndexRef
|
|
27
|
+
.current()
|
|
28
|
+
.then(() => {
|
|
29
|
+
setState('success');
|
|
30
|
+
})
|
|
31
|
+
.catch(() => {
|
|
32
|
+
setState('error');
|
|
33
|
+
});
|
|
34
|
+
}, [searchIndexRef]);
|
|
35
|
+
(0, useDebounce_1.useEffectDebounced)(() => {
|
|
36
|
+
// Do not reset search for empty search
|
|
37
|
+
if (!searchQuery) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
store.search
|
|
41
|
+
?.search(searchQuery)
|
|
42
|
+
.then((r) => {
|
|
43
|
+
setOptions(r);
|
|
44
|
+
setState('success');
|
|
45
|
+
})
|
|
46
|
+
.catch(() => setState('error'));
|
|
47
|
+
}, [searchQuery], 300);
|
|
48
|
+
if (searchQuery &&
|
|
49
|
+
allowArbitrary &&
|
|
50
|
+
options.length === 0 &&
|
|
51
|
+
state !== 'loading') {
|
|
52
|
+
options = [
|
|
53
|
+
{
|
|
54
|
+
id: exports.OTHER_VALUE,
|
|
55
|
+
label: searchQuery,
|
|
56
|
+
value: exports.OTHER_VALUE,
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
// Since the underlying implementation of onFocus / onBlur can be wrong, ensure we don't call focus / blur handler multiple times
|
|
61
|
+
const [isFocused, setFocused] = (0, react_1.useState)(false);
|
|
62
|
+
return {
|
|
63
|
+
search: searchQuery,
|
|
64
|
+
setSearch: (s) => {
|
|
65
|
+
if (s.length > 0 && !isFocused) {
|
|
66
|
+
setFocused(true);
|
|
67
|
+
}
|
|
68
|
+
// setState('loading'); // Current implementation being sync, we won't need to show a "loading" state
|
|
69
|
+
setSearchQuery(s);
|
|
70
|
+
},
|
|
71
|
+
state,
|
|
72
|
+
options: isFocused ? options : selectedOptions,
|
|
73
|
+
onBlur: () => {
|
|
74
|
+
setFocused(false);
|
|
75
|
+
setSearchQuery('');
|
|
76
|
+
// Prevent extra calls
|
|
77
|
+
if (!isFocused) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
setOptions(selectedOptions);
|
|
81
|
+
},
|
|
82
|
+
onFocus: () => {
|
|
83
|
+
if (!isFocused) {
|
|
84
|
+
setFocused(true);
|
|
85
|
+
setSearchQuery(selectedOptions[0]?.label ?? '');
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=useSuggestions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSuggestions.js","sourceRoot":"","sources":["../../src/components/Suggester/useSuggestions.ts"],"names":[],"mappings":";;;AAgBA,wCAgGC;AAhHD,iCAA4C;AAE5C,yDAA6D;A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AAC,IAAI,CAAC,CAAC;gBACjB,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;YACjD,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SummaryResponses = exports.SummaryTitle = void 0;
|
|
4
|
+
exports.Summary = Summary;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const slottableComponent_1 = require("../shared/HOC/slottableComponent");
|
|
7
|
+
/**
|
|
8
|
+
* Summarize the responses done by the user
|
|
9
|
+
*/
|
|
10
|
+
function Summary(props) {
|
|
11
|
+
const { executeExpression, label, sections } = props;
|
|
12
|
+
const compiledSections = sections.reduce((acc, section) => {
|
|
13
|
+
const { iterations, title, responses, id } = section;
|
|
14
|
+
if (iterations) {
|
|
15
|
+
const compiledIterations = executeExpression(iterations);
|
|
16
|
+
if (responses) {
|
|
17
|
+
const elements = Array(compiledIterations)
|
|
18
|
+
.fill(null)
|
|
19
|
+
.map(function (_, iteration) {
|
|
20
|
+
return {
|
|
21
|
+
values: interpretResponses(responses, executeExpression, iteration),
|
|
22
|
+
title: interpretTitle(title, executeExpression, iteration),
|
|
23
|
+
id: id,
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
return [...acc, ...elements];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (responses) {
|
|
30
|
+
const element = {
|
|
31
|
+
title: interpretTitle(title, executeExpression),
|
|
32
|
+
values: interpretResponses(responses, executeExpression, undefined),
|
|
33
|
+
id: id,
|
|
34
|
+
};
|
|
35
|
+
return [...acc, element];
|
|
36
|
+
}
|
|
37
|
+
return acc;
|
|
38
|
+
}, []);
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "lunatic-summary-container", children: [label && (0, jsx_runtime_1.jsx)(exports.SummaryTitle, { label: label }), (0, jsx_runtime_1.jsx)(exports.SummaryResponses, { sections: compiledSections })] }));
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Title displayed on top of the Summary
|
|
43
|
+
*/
|
|
44
|
+
exports.SummaryTitle = (0, slottableComponent_1.slottableComponent)('SummaryTitle', ({ label }) => (0, jsx_runtime_1.jsx)("div", { className: "lunatic-summary-label", children: label }));
|
|
45
|
+
exports.SummaryResponses = (0, slottableComponent_1.slottableComponent)('SummaryResponses', ({ sections }) => {
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: sections.map((section, index) => ((0, jsx_runtime_1.jsxs)("div", { className: "lunatic-summary-responses-iteration", children: [section.title, section.values && ((0, jsx_runtime_1.jsx)("ul", { children: section.values.map((value) => ((0, jsx_runtime_1.jsxs)("li", { children: [value.label, " : ", value.value] }, `response-${index}`))) }))] }, `${section.id}-${index}`))) }));
|
|
47
|
+
});
|
|
48
|
+
function interpretTitle(title, executeExpression, iteration) {
|
|
49
|
+
if (!title && iteration) {
|
|
50
|
+
return `Valeur pour ${iteration + 1}`;
|
|
51
|
+
}
|
|
52
|
+
if (!title) {
|
|
53
|
+
return `Valeurs renseignés :`;
|
|
54
|
+
}
|
|
55
|
+
const hasIteration = iteration || iteration === 0;
|
|
56
|
+
return executeExpression(title, hasIteration ? { iteration } : {});
|
|
57
|
+
}
|
|
58
|
+
function interpretResponses(responses, executeExpression, iteration) {
|
|
59
|
+
if (!responses) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
const option = iteration || iteration === 0 ? iteration : undefined;
|
|
63
|
+
return responses.map((r) => ({
|
|
64
|
+
label: executeExpression(r.label, { iteration: option }),
|
|
65
|
+
value: executeExpression(r.value, { iteration: option }),
|
|
66
|
+
id: r.id,
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=Summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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AAM,YAAY,GAAG,SAAS,IAAI,SAAS,KAAK,CAAC,CAAC;IAClD,OAAO,iBAAiB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,kBAAkB,CAC1B,SAA4E,EAC5E,iBAAwE,EACxE,SAAkB;IAElB,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,OAAO,EAAE,CAAC;IACX,CAAC;IACD,MAAM,MAAM,GAAG,SAAS,IAAI,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IACpE,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5B,KAAK,EAAE,iBAAiB,CAAY,CAAC,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QACnE,KAAK,EAAE,iBAAiB,CAAY,CAAC,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QACnE,EAAE,EAAE,CAAC,CAAC,EAAE;KACR,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Switch = exports.CustomSwitch = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const ComponentErrors_1 = require("../shared/ComponentErrors/ComponentErrors");
|
|
9
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
10
|
+
const slottableComponent_1 = require("../shared/HOC/slottableComponent");
|
|
11
|
+
const Label_1 = require("../shared/Label/Label");
|
|
12
|
+
const Declarations_1 = require("../shared/Declarations/Declarations");
|
|
13
|
+
const defaultLabel = { true: 'True', false: 'False' };
|
|
14
|
+
function LunaticSwitch({ handleChanges, response, errors, value, statusLabel, ...props }) {
|
|
15
|
+
const checked = value ?? false;
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(exports.CustomSwitch, { ...props, statusLabel: statusLabel ?? defaultLabel, checked: value ?? false, onChange: () => handleChanges([{ name: response.name, value: !checked }]), errors: (0, ComponentErrors_1.getComponentErrors)(errors, props.id) }));
|
|
17
|
+
}
|
|
18
|
+
exports.CustomSwitch = (0, slottableComponent_1.slottableComponent)('Switch', (props) => {
|
|
19
|
+
const { id, onChange, checked, statusLabel = defaultLabel, label, errors, disabled, declarations, } = props;
|
|
20
|
+
const { true: labelTrue, false: labelFalse } = statusLabel;
|
|
21
|
+
const labelId = `lunatic-switch-label-${id}`;
|
|
22
|
+
const handleKeyDown = (e) => {
|
|
23
|
+
const { code } = e;
|
|
24
|
+
if (code === 'Space') {
|
|
25
|
+
onChange();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { htmlFor: id, id: labelId, children: label }), (0, jsx_runtime_1.jsx)(Declarations_1.Declarations, { type: "AFTER_QUESTION_TEXT", declarations: declarations, id: id }), (0, jsx_runtime_1.jsxs)("div", { className: "lunatic-switch", id: id, children: [(0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('lunatic-switch-label', {
|
|
29
|
+
checked: !checked,
|
|
30
|
+
}), children: labelFalse }), (0, jsx_runtime_1.jsx)("div", { role: "switch", "aria-checked": checked, "aria-invalid": !!errors, tabIndex: 0, className: (0, classnames_1.default)('lunatic-switch-container', {
|
|
31
|
+
disabled,
|
|
32
|
+
checked,
|
|
33
|
+
}), onClick: onChange, onKeyDown: handleKeyDown, "aria-labelledby": labelId, children: (0, jsx_runtime_1.jsx)("div", { className: "lunatic-switch-button" }) }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)('lunatic-switch-label', { checked }), children: labelTrue })] }), (0, jsx_runtime_1.jsx)(ComponentErrors_1.ComponentErrors, { errors: errors })] }));
|
|
34
|
+
});
|
|
35
|
+
exports.Switch = (0, slottableComponent_1.slottableComponent)('Switch', LunaticSwitch);
|
|
36
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../src/components/Switch/Switch.tsx"],"names":[],"mappings":";;;;;;;AACA,+EAGmD;AAEnD,4DAAoC;AACpC,yEAAsE;AACtE,iDAA8C;AAC9C,sEAAmE;AAGnE,MAAM,YAAY,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAEtD,SAAS,aAAa,CAAC,EACtB,aAAa,EACb,QAAQ,EACR,MAAM,EACN,KAAK,EACL,WAAW,EACX,GAAG,KAAK,EACyB;IACjC,MAAM,OAAO,GAAG,KAAK,IAAI,KAAK,CAAC;IAC/B,OAAO,CACN,uBAAC,oBAAY,OACR,KAAK,EACT,WAAW,EAAE,WAAW,IAAI,YAAY,EACxC,OAAO,EAAE,KAAK,IAAI,KAAK,EACvB,QAAQ,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EACzE,MAAM,EAAE,IAAA,oCAAkB,EAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,GAC3C,CACF,CAAC;AACH,CAAC;AAWY,QAAA,YAAY,GAAG,IAAA,uCAAkB,EAC7C,QAAQ,EACR,CAAC,KAAK,EAAE,EAAE;IACT,MAAM,EACL,EAAE,EACF,QAAQ,EACR,OAAO,EACP,WAAW,GAAG,YAAY,EAC1B,KAAK,EACL,MAAM,EACN,QAAQ,EACR,YAAY,GACZ,GAAG,KA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kB,EAAC,QAAQ,EAAE,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Table = Table;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const LunaticComponents_1 = require("../LunaticComponents");
|
|
6
|
+
const ComponentErrors_1 = require("../shared/ComponentErrors/ComponentErrors");
|
|
7
|
+
const Table_1 = require("../shared/Table");
|
|
8
|
+
function Table(props) {
|
|
9
|
+
const { id, body, header, errors, declarations, label } = props;
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(Table_1.Table, { id: id, errors: (0, ComponentErrors_1.getComponentErrors)(errors, id), declarations: declarations, label: label, children: [(0, jsx_runtime_1.jsx)(Table_1.TableHeader, { header: header }), (0, jsx_runtime_1.jsx)(Table_1.Tbody, { children: body.map((row, rowIndex) => ((0, jsx_runtime_1.jsx)(Table_1.Tr, { row: rowIndex, children: (0, jsx_runtime_1.jsx)(LunaticComponents_1.LunaticComponents, { components: row, wrapper: ({ colspan, rowspan, ...props }) => ((0, jsx_runtime_1.jsx)(Table_1.Td, { row: rowIndex, colSpan: colspan, rowSpan: rowspan, ...props })) }) }, rowIndex))) })] }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../src/components/Table/Table.tsx"],"names":[],"mappings":";;AAYA,sBAmCC;;AA9CD,4DAAyD;AACzD,+EAA+E;AAC/E,2CAMyB;AAGzB,SAAgB,KAAK,CAAC,KAAqC;IAC1D,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAEhE,OAAO,CACN,wBAAC,aAAS,IACT,EAAE,EAAE,EAAE,EACN,MAAM,EAAE,IAAA,oCAAkB,EAAC,MAAM,EAAE,EAAE,CAAC,EACtC,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,KAAK,aAEZ,uBAAC,mBAAW,IAAC,MAAM,EAAE,MAAM,GAAI,EAC/B,uBAAC,aAAK,cACJ,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,CAC5B,uBAAC,UAAE,IAAC,GAAG,EAAE,QAAQ,YAChB,uBAAC,qCAAiB,IAMjB,UAAU,EAAE,GAAG,EACf,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,CAC5C,uBAAC,UAAE,IACF,GAAG,EAAE,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,KACZ,KAAK,GACR,CACF,GACA,IAhBqB,QAAQ,CAiB3B,CACL,CAAC,GACK,IACG,CACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/components/Text/Text.tsx"],"names":[],"mappings":";;AAEA,oBAEC;AAFD,SAAgB,IAAI,CAAC,EAAE,KAAK,EAAiC;IAC5D,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomTextarea = void 0;
|
|
4
|
+
exports.Textarea = Textarea;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const Label_1 = require("../shared/Label/Label");
|
|
7
|
+
const ComponentErrors_1 = require("../shared/ComponentErrors/ComponentErrors");
|
|
8
|
+
const slottableComponent_1 = require("../shared/HOC/slottableComponent");
|
|
9
|
+
const Declarations_1 = require("../shared/Declarations/Declarations");
|
|
10
|
+
function Textarea({ handleChanges, response, errors, ...props }) {
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(exports.CustomTextarea, { ...props, onChange: (value) => handleChanges([{ name: response.name, value }]), errors: (0, ComponentErrors_1.getComponentErrors)(errors, props.id) }));
|
|
12
|
+
}
|
|
13
|
+
exports.CustomTextarea = (0, slottableComponent_1.slottableComponent)('Textarea', (props) => {
|
|
14
|
+
const { value, onChange, disabled, required, maxLength, label, description, id, errors, readOnly, declarations, rows, cols, placeHolder, } = props;
|
|
15
|
+
const labelId = `label-${id}`;
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "lunatic-textarea", children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { htmlFor: id, id: labelId, description: description, children: label }), (0, jsx_runtime_1.jsx)(Declarations_1.Declarations, { type: "AFTER_QUESTION_TEXT", declarations: declarations, id: id }), (0, jsx_runtime_1.jsx)("textarea", { required: required, disabled: disabled, id: id, rows: rows, maxLength: maxLength, cols: cols, onChange: (e) => onChange(e.target.value), value: value ?? '', placeholder: placeHolder, readOnly: readOnly, "aria-invalid": !!errors }), (0, jsx_runtime_1.jsx)(ComponentErrors_1.ComponentErrors, { errors: errors })] }));
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=Textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":";;;AAUA,4BAaC;;AAtBD,iDAA8C;AAC9C,+EAGmD;AACnD,yEAAsE;AACtE,sEAAmE;AAGnE,SAAgB,QAAQ,CAAC,EACxB,aAAa,EACb,QAAQ,EACR,MAAM,EACN,GAAG,KAAK,EAC2B;IACnC,OAAO,CACN,uBAAC,sBAAc,OACV,KAAK,EACT,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,EACpE,MAAM,EAAE,IAAA,oCAAkB,EA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|
|
4
|
+
const react_1 = require("@testing-library/react");
|
|
5
|
+
const vitest_1 = require("vitest");
|
|
6
|
+
const Textarea_1 = require("./Textarea");
|
|
7
|
+
(0, vitest_1.describe)('Textarea', () => {
|
|
8
|
+
const mockOnChange = vitest_1.vi.fn();
|
|
9
|
+
const baseProps = {
|
|
10
|
+
value: 'input',
|
|
11
|
+
id: 'input',
|
|
12
|
+
'aria-labelledby': 'input',
|
|
13
|
+
handleChanges: mockOnChange,
|
|
14
|
+
response: { name: 'demo' },
|
|
15
|
+
};
|
|
16
|
+
(0, vitest_1.beforeEach)(() => {
|
|
17
|
+
mockOnChange.mockClear();
|
|
18
|
+
});
|
|
19
|
+
(0, vitest_1.it)('renders without crashing', () => {
|
|
20
|
+
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(Textarea_1.Textarea, { ...baseProps }));
|
|
21
|
+
(0, vitest_1.expect)(container).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
(0, vitest_1.it)('should handle readOnly', () => {
|
|
24
|
+
const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(Textarea_1.Textarea, { ...baseProps, id: "textarea", value: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', readOnly: true }));
|
|
25
|
+
(0, vitest_1.expect)(container).toMatchSnapshot();
|
|
26
|
+
const input = container.querySelector('textarea');
|
|
27
|
+
(0, vitest_1.expect)(input).toHaveAttribute('readonly');
|
|
28
|
+
input.focus();
|
|
29
|
+
(0, vitest_1.expect)(input).toHaveFocus();
|
|
30
|
+
(0, vitest_1.expect)(input).toHaveValue('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.');
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=Textarea.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.spec.js","sourceRoot":"","sources":["../../src/components/Textarea/Textarea.spec.tsx"],"names":[],"mappings":";;;AAAA,kDAAgD;AAChD,mCAA8D;AAC9D,yCAAsC;AAEtC,IAAA,iBAAQ,EAAC,UAAU,EAAE,GAAG,EAAE;IACzB,MAAM,YAAY,GAAG,WAAE,CAAC,EAAE,EAAE,CAAC;IAE7B,MAAM,SAAS,GAAG;QACjB,KAAK,EAAE,OAAO;QACd,EAAE,EAAE,OAAO;QACX,iBAAiB,EAAE,OAAO;QAC1B,aAAa,EAAE,YAAY;QAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;KAC1B,CAAC;IAEF,IAAA,mBAAU,EAAC,GAAG,EAAE;QACf,YAAY,CAAC,SAAS,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,0BAA0B,EAAE,GAAG,EAAE;QACnC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,cAAM,EAAC,uBAAC,mBAAQ,OAAK,SAAS,GAAI,CAAC,CAAC;QAC1D,IAAA,eAAM,EAAC,SAAS,CAAC,CAAC,eAAe,EAAE,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,wBAAwB,EAAE,GAAG,EAAE;QACjC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,cAAM,EAC3B,uBAAC,mBAAQ,OACJ,SAAS,EACb,EAAE,EAAC,UAAU,EACb,KAAK,EACJ,+bAA+b,EAEhc,QAAQ,SACP,CACF,CAAC;QACF,IAAA,eAAM,EAAC,SAAS,CAAC,CAAC,eAAe,EAAE,CAAC;QAEpC,MAAM,KAAK,GAAG,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAClD,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QACzC,KAAqB,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5B,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,WAAW,CACxB,+bAA+b,CAC/b,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.library = void 0;
|
|
4
|
+
const Sequence_1 = require("./Sequence/Sequence");
|
|
5
|
+
const Subsequence_1 = require("./Subsequence/Subsequence");
|
|
6
|
+
const RosterForLoop_1 = require("./RosterForLoop/RosterForLoop");
|
|
7
|
+
const Table_1 = require("./Table/Table");
|
|
8
|
+
const Datepicker_1 = require("./Datepicker/Datepicker");
|
|
9
|
+
const CheckboxGroup_1 = require("./CheckboxGroup/CheckboxGroup");
|
|
10
|
+
const CheckboxBoolean_1 = require("./CheckboxBoolean/CheckboxBoolean");
|
|
11
|
+
const Radio_1 = require("./Radio/Radio");
|
|
12
|
+
const Input_1 = require("./Input/Input");
|
|
13
|
+
const Accordion_1 = require("./Accordion/Accordion");
|
|
14
|
+
const Text_1 = require("./Text/Text");
|
|
15
|
+
const Textarea_1 = require("./Textarea/Textarea");
|
|
16
|
+
const Switch_1 = require("./Switch/Switch");
|
|
17
|
+
const FilterDescription_1 = require("./FilterDescription/FilterDescription");
|
|
18
|
+
const Question_1 = require("./Question/Question");
|
|
19
|
+
const InputNumber_1 = require("./InputNumber/InputNumber");
|
|
20
|
+
const Duration_1 = require("./Duration/Duration");
|
|
21
|
+
const Loop_1 = require("./Loop/Loop");
|
|
22
|
+
const Dropdown_1 = require("./Dropdown/Dropdown");
|
|
23
|
+
const Roundabout_1 = require("./Roundabout/Roundabout");
|
|
24
|
+
const PairwiseLinks_1 = require("./PairwiseLinks/PairwiseLinks");
|
|
25
|
+
const CheckboxOne_1 = require("./CheckboxOne/CheckboxOne");
|
|
26
|
+
const Suggester_1 = require("./Suggester/Suggester");
|
|
27
|
+
const Summary_1 = require("./Summary/Summary");
|
|
28
|
+
// List of all the "componentType"
|
|
29
|
+
exports.library = {
|
|
30
|
+
Sequence: Sequence_1.Sequence,
|
|
31
|
+
Subsequence: Subsequence_1.Subsequence,
|
|
32
|
+
RosterForLoop: RosterForLoop_1.RosterForLoop,
|
|
33
|
+
Loop: Loop_1.Loop,
|
|
34
|
+
Table: Table_1.Table,
|
|
35
|
+
InputNumber: InputNumber_1.InputNumber,
|
|
36
|
+
Datepicker: Datepicker_1.Datepicker,
|
|
37
|
+
CheckboxGroup: CheckboxGroup_1.CheckboxGroup,
|
|
38
|
+
CheckboxOne: CheckboxOne_1.CheckboxOne,
|
|
39
|
+
CheckboxBoolean: CheckboxBoolean_1.CheckboxBoolean,
|
|
40
|
+
Radio: Radio_1.Radio,
|
|
41
|
+
Text: Text_1.Text,
|
|
42
|
+
Input: Input_1.Input,
|
|
43
|
+
Duration: Duration_1.Duration,
|
|
44
|
+
Textarea: Textarea_1.Textarea,
|
|
45
|
+
Switch: Switch_1.Switch,
|
|
46
|
+
Question: Question_1.Question,
|
|
47
|
+
FilterDescription: FilterDescription_1.FilterDescription,
|
|
48
|
+
Dropdown: Dropdown_1.Dropdown,
|
|
49
|
+
PairwiseLinks: PairwiseLinks_1.PairwiseLinks,
|
|
50
|
+
Roundabout: Roundabout_1.Roundabout,
|
|
51
|
+
Suggester: Suggester_1.Suggester,
|
|
52
|
+
Summary: Summary_1.Summary,
|
|
53
|
+
Accordion: Accordion_1.Accordion,
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=library.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library.js","sourceRoot":"","sources":["../src/components/library.ts"],"names":[],"mappings":";;;AAAA,kDAA+C;AAC/C,2DAAwD;AACxD,iEAA8D;AAC9D,yCAAsC;AACtC,wDAAqD;AACrD,iEAA8D;AAC9D,uEAAoE;AACpE,yCAAsC;AACtC,yCAAsC;AACtC,qDAAkD;AAClD,sCAAmC;AACnC,kDAA+C;AAG/C,4CAAyC;AACzC,6EAA0E;AAC1E,kDAA+C;AAC/C,2DAAwD;AACxD,kDAA+C;AAC/C,sCAAmC;AACnC,kDAA+C;AAC/C,wDAAqD;AACrD,iEAA8D;AAC9D,2DAAwD;AACxD,qDAAkD;AAClD,+CAA4C;AAE5C,kCAAkC;AACrB,QAAA,OAAO,GAAG;IACtB,QAAQ,EAAE,mBAAQ;IAClB,WAAW,EAAE,yBAAW;IACxB,aAAa,EAAE,6BAAa;IAC5B,IAAI,EAAE,WAAI;IACV,KAAK,EAAE,aAAK;IACZ,WAAW,EAAE,yBAAW;IACxB,UAAU,EAAE,uBAAU;IACtB,aAAa,EAAE,6BAAa;IAC5B,WAAW,EAAE,yBAAW;IACxB,eAAe,EAAE,iCAAe;IAChC,KAAK,EAAE,aAAK;IACZ,IAAI,EAAE,WAAI;IACV,KAAK,EAAE,aAAK;IACZ,QAAQ,EAAE,mBAAQ;IAClB,QAAQ,EAAE,mBAAQ;IAClB,MAAM,EAAE,eAAM;IACd,QAAQ,EAAE,mBAAQ;IAClB,iBAAiB,EAAE,qCAAiB;IACpC,QAAQ,EAAE,mBAAQ;IAClB,aAAa,EAAE,6BAAa;IAC5B,UAAU,EAAE,uBAAU;IACtB,SAAS,EAAE,qBAAS;IACpB,OAAO,EAAE,iBAAO;IAChB,SAAS,EAAE,qBAAS;CAKpB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Button = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
9
|
+
const dom_1 = require("../../../utils/dom");
|
|
10
|
+
const is_element_1 = require("../../../utils/is-element");
|
|
11
|
+
const slottableComponent_1 = require("../HOC/slottableComponent");
|
|
12
|
+
function LunaticButton({ id, children, onClick, disabled, label, className, value, type = 'button', selected, readOnly, }) {
|
|
13
|
+
const handleClick = (0, dom_1.prevent)(onClick);
|
|
14
|
+
if ((0, is_element_1.isElement)(children) || value)
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)("button", { id: id, disabled: disabled || readOnly, type: type, className: (0, classnames_1.default)('button-lunatic', className, { disabled }), onClick: handleClick, value: value, "aria-pressed": selected, children: children }));
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("input", { id: id, "aria-pressed": selected, disabled: disabled || readOnly, type: "button", className: (0, classnames_1.default)('button-lunatic', className, { disabled }), value: label ?? children?.toString(), onClick: handleClick }));
|
|
17
|
+
}
|
|
18
|
+
exports.Button = (0, slottableComponent_1.slottableComponent)('Button', LunaticButton);
|
|
19
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/shared/Button/Button.tsx"],"names":[],"mappings":";;;;;;;AAAA,4DAAoC;AAEpC,4CAA6C;AAC7C,0DAAsD;AACtD,kEAA+D;AAc/D,SAAS,aAAa,CAAC,EACtB,EAAE,EACF,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,KAAK,EACL,SAAS,EACT,KAAK,EACL,IAAI,GAAG,QAAQ,EACf,QAAQ,EACR,QAAQ,GACD;IACP,MAAM,WAAW,GAAG,IAAA,aAAO,EAAC,OAAO,CAAC,CAAC;IAErC,IAAI,IAAA,sBAAS,EAAC,QAAQ,CAAC,IAAI,KAAK;QAC/B,OAAO,CACN,mCACC,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,IAAA,oBAAU,EAAC,gBAAgB,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,EAChE,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,KAAK,kBACE,QAAQ,YAErB,QAAQ,GACD,CACT,CAAC;IAEH,OAAO,CACN,kCACC,EAAE,EAAE,EAAE,kBACQ,QAAQ,EACtB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,IAAA,oBAAU,EAAC,gBAAgB,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,EAChE,KAAK,EAAE,KAAK,IAAI,QAAQ,EAAE,QAAQ,EAAE,EACpC,OAAO,EAAE,WAAW,GACnB,CACF,CAAC;AACH,CAAC;AAEY,QAAA,MAAM,GAAG,IAAA,uCAAkB,EAAC,QAAQ,EAAE,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("@testing-library/react");
|
|
5
|
+
const Button_1 = require("./Button");
|
|
6
|
+
const vitest_1 = require("vitest");
|
|
7
|
+
(0, vitest_1.describe)('Button', () => {
|
|
8
|
+
(0, vitest_1.it)('renders without crashing', () => {
|
|
9
|
+
const container = (0, react_1.render)((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: () => { }, children: (0, jsx_runtime_1.jsx)("span", { children: "Click me!" }) }));
|
|
10
|
+
(0, vitest_1.expect)(container).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
(0, vitest_1.it)('renders a button element with given children as a Span', () => {
|
|
13
|
+
const { getByRole } = (0, react_1.render)((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: () => { }, children: (0, jsx_runtime_1.jsx)("span", { children: "Click me!" }) }));
|
|
14
|
+
const button = getByRole('button');
|
|
15
|
+
(0, vitest_1.expect)(button).toBeInTheDocument();
|
|
16
|
+
(0, vitest_1.expect)(button.tagName).toBe('BUTTON');
|
|
17
|
+
(0, vitest_1.expect)(button).toHaveTextContent('Click me!');
|
|
18
|
+
});
|
|
19
|
+
(0, vitest_1.it)('renders a button element with given children if children is not a React element', () => {
|
|
20
|
+
const label = 'Click me!';
|
|
21
|
+
const { getByDisplayValue } = (0, react_1.render)((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: () => { }, children: label }));
|
|
22
|
+
const input = getByDisplayValue(label);
|
|
23
|
+
(0, vitest_1.expect)(input).toBeInTheDocument();
|
|
24
|
+
(0, vitest_1.expect)(input.tagName).toBe('INPUT');
|
|
25
|
+
(0, vitest_1.expect)(input).toHaveAttribute('value', label);
|
|
26
|
+
});
|
|
27
|
+
(0, vitest_1.it)('appelle onClick quand le bouton est cliqué', () => {
|
|
28
|
+
const handleClick = vitest_1.vi.fn();
|
|
29
|
+
const { getByText } = (0, react_1.render)((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: handleClick, children: "Cliquez ici" }));
|
|
30
|
+
const buttonElement = getByText('Cliquez ici');
|
|
31
|
+
react_1.fireEvent.click(buttonElement);
|
|
32
|
+
(0, vitest_1.expect)(handleClick).toHaveBeenCalledTimes(1);
|
|
33
|
+
});
|
|
34
|
+
(0, vitest_1.it)('renders an input element with given label without a child', () => {
|
|
35
|
+
const label = 'Click me!';
|
|
36
|
+
const { getByDisplayValue } = (0, react_1.render)((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: () => { }, label: label }));
|
|
37
|
+
const input = getByDisplayValue(label);
|
|
38
|
+
(0, vitest_1.expect)(input).toBeInTheDocument();
|
|
39
|
+
(0, vitest_1.expect)(input).toHaveAttribute('type', 'button');
|
|
40
|
+
(0, vitest_1.expect)(input).toHaveAttribute('value', label);
|
|
41
|
+
});
|
|
42
|
+
(0, vitest_1.it)('renders the disabled class when the disabled prop is true', () => {
|
|
43
|
+
const { getByText } = (0, react_1.render)((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: () => { }, disabled: true, children: "Cliquez ici" }));
|
|
44
|
+
const buttonElement = getByText('Cliquez ici');
|
|
45
|
+
(0, vitest_1.expect)(buttonElement).toHaveClass('disabled');
|
|
46
|
+
});
|
|
47
|
+
(0, vitest_1.it)('applies the provided className to the button element', () => {
|
|
48
|
+
const { getByRole } = (0, react_1.render)((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: () => { }, className: "test-class", children: "Click me!" }));
|
|
49
|
+
const button = getByRole('button');
|
|
50
|
+
(0, vitest_1.expect)(button).toHaveClass('test-class');
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=Button.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.spec.js","sourceRoot":"","sources":["../../../src/components/shared/Button/Button.spec.tsx"],"names":[],"mappings":";;;AAAA,kDAA2D;AAC3D,qCAAkC;AAClC,mCAAkD;AAElD,IAAA,iBAAQ,EAAC,QAAQ,EAAE,GAAG,EAAE;IACvB,IAAA,WAAE,EAAC,0BAA0B,EAAE,GAAG,EAAE;QACnC,MAAM,SAAS,GAAG,IAAA,cAAM,EACvB,uBAAC,eAAM,IAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,YACxB,yDAAsB,GACd,CACT,CAAC;QACF,IAAA,eAAM,EAAC,SAAS,CAAC,CAAC,eAAe,EAAE,CAAC;IACrC,CAAC,CAAC,CAAC;IACH,IAAA,WAAE,EAAC,wDAAwD,EAAE,GAAG,EAAE;QACjE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,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