@inseefr/lunatic 3.4.4 → 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.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.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 -83
- 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 -16
- 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.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.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/components → components}/type.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/getComponentTypeProps.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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-paginated-loop.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/is-paginated-loop.ts"],"names":[],"mappings":"AAEA,SAAS,eAAe,CACvB,SAAqC;IAKrC,OAAO,SAAS,CAAC,aAAa,KAAK,MAAM,IAAI,SAAS,CAAC,aAAa,CAAC;AACtE,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-roundabout.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/is-roundabout.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,YAAY,CACnC,SAAqC;IAErC,MAAM,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;IACpC,OAAO,aAAa,KAAK,YAAY,CAAC;AACvC,CAAC"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
const resetIteration = {
|
|
2
|
-
subPage: undefined,
|
|
3
|
-
nbSubPages: undefined,
|
|
4
|
-
iteration: undefined,
|
|
5
|
-
nbIterations: undefined,
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Increment the pager to reach the next page or iteration
|
|
9
|
-
*/
|
|
10
|
-
export function getNextPager(pager, parent) {
|
|
11
|
-
// Increment the page or subPage
|
|
12
|
-
// eslint-disable-next-line prefer-const
|
|
13
|
-
let [page, subPage] = pager.subPage !== undefined
|
|
14
|
-
? [pager.page, pager.subPage + 1]
|
|
15
|
-
: [pager.page + 1, undefined];
|
|
16
|
-
let iteration = pager.iteration;
|
|
17
|
-
// We reached the end of the questionnaire
|
|
18
|
-
if (page > pager.maxPage) {
|
|
19
|
-
return pager;
|
|
20
|
-
}
|
|
21
|
-
// We reached the end of the sequence
|
|
22
|
-
const isEndSequence = subPage && pager.nbSubPages ? subPage >= pager.nbSubPages : false;
|
|
23
|
-
const moveUpOnEnd = parent === 'Roundabout' && pager.nbIterations && pager.nbIterations > 1;
|
|
24
|
-
// Move up at the end of a sequence (instead of going to the next Iteration)
|
|
25
|
-
if (isEndSequence && moveUpOnEnd) {
|
|
26
|
-
return {
|
|
27
|
-
...pager,
|
|
28
|
-
page: page,
|
|
29
|
-
...resetIteration,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
// Move to the next parent page (for loops)
|
|
33
|
-
if (isEndSequence && iteration !== undefined) {
|
|
34
|
-
subPage = 0;
|
|
35
|
-
iteration++;
|
|
36
|
-
}
|
|
37
|
-
// We reached the end of an iteration, move up
|
|
38
|
-
if (iteration !== undefined &&
|
|
39
|
-
pager.nbIterations &&
|
|
40
|
-
iteration >= pager.nbIterations) {
|
|
41
|
-
return getNextPager({
|
|
42
|
-
...pager,
|
|
43
|
-
page: page,
|
|
44
|
-
...resetIteration,
|
|
45
|
-
}, parent);
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
...pager,
|
|
49
|
-
page: page,
|
|
50
|
-
subPage,
|
|
51
|
-
iteration,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export function getPrevPager(pager, parent) {
|
|
55
|
-
// Decrement the page or subPage
|
|
56
|
-
// eslint-disable-next-line prefer-const
|
|
57
|
-
let [page, subPage] = pager.subPage !== undefined
|
|
58
|
-
? [pager.page, pager.subPage - 1]
|
|
59
|
-
: [pager.page - 1, undefined];
|
|
60
|
-
let iteration = pager.iteration;
|
|
61
|
-
const moveUpOnStart = parent === 'Roundabout' && pager.nbIterations && pager.nbIterations > 1;
|
|
62
|
-
// We reached the start of the questionnaire
|
|
63
|
-
if (page <= 0) {
|
|
64
|
-
return pager;
|
|
65
|
-
}
|
|
66
|
-
// We reached the start of the sequence, move up
|
|
67
|
-
if (subPage !== undefined && pager.nbSubPages !== undefined && subPage < 0) {
|
|
68
|
-
// Move up at the start of an iteration (for roundabout)
|
|
69
|
-
if (moveUpOnStart) {
|
|
70
|
-
return {
|
|
71
|
-
...pager,
|
|
72
|
-
page: page,
|
|
73
|
-
...resetIteration,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
subPage = pager.nbSubPages - 1;
|
|
77
|
-
iteration = (iteration ?? 0) - 1;
|
|
78
|
-
}
|
|
79
|
-
const isStartSequence = iteration !== undefined && iteration < 0;
|
|
80
|
-
// We reached the start of an iteration, keep going backward
|
|
81
|
-
if (isStartSequence) {
|
|
82
|
-
return getPrevPager({
|
|
83
|
-
...pager,
|
|
84
|
-
page: page,
|
|
85
|
-
...resetIteration,
|
|
86
|
-
}, parent);
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
...pager,
|
|
90
|
-
page: page,
|
|
91
|
-
subPage,
|
|
92
|
-
iteration,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=page-navigation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-navigation.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/page-navigation.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { getNextPager, getPrevPager } from './page-navigation';
|
|
3
|
-
describe('page-navigation', () => {
|
|
4
|
-
describe('getNextPager', () => {
|
|
5
|
-
const base = {
|
|
6
|
-
page: 2,
|
|
7
|
-
maxPage: 3,
|
|
8
|
-
subPage: 0,
|
|
9
|
-
nbSubPages: 3,
|
|
10
|
-
iteration: 0,
|
|
11
|
-
nbIterations: 2,
|
|
12
|
-
};
|
|
13
|
-
it('should navigate inside a sequence', () => {
|
|
14
|
-
expect(getNextPager(base)).toEqual({
|
|
15
|
-
...base,
|
|
16
|
-
subPage: 1,
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
it('should increment iteration at the end of a sequence', () => {
|
|
20
|
-
const pager = {
|
|
21
|
-
...base,
|
|
22
|
-
subPage: 2,
|
|
23
|
-
};
|
|
24
|
-
expect(getNextPager(pager).subPage).toEqual(0);
|
|
25
|
-
expect(getNextPager(pager).iteration).toEqual(1);
|
|
26
|
-
});
|
|
27
|
-
it('should move up at the end of a sequence and an iteration', () => {
|
|
28
|
-
const pager = {
|
|
29
|
-
...base,
|
|
30
|
-
subPage: 3,
|
|
31
|
-
iteration: 1,
|
|
32
|
-
};
|
|
33
|
-
const reset = {
|
|
34
|
-
subPage: undefined,
|
|
35
|
-
nbSubPages: undefined,
|
|
36
|
-
iteration: undefined,
|
|
37
|
-
nbIterations: undefined,
|
|
38
|
-
};
|
|
39
|
-
expect(getNextPager(pager)).toEqual({
|
|
40
|
-
...pager,
|
|
41
|
-
...reset,
|
|
42
|
-
page: 3,
|
|
43
|
-
});
|
|
44
|
-
expect(getNextPager(pager, 'Roundabout')).toEqual({
|
|
45
|
-
...pager,
|
|
46
|
-
...reset,
|
|
47
|
-
page: 2,
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
it('should navigate on simple page without iteration', () => {
|
|
51
|
-
const pager = {
|
|
52
|
-
page: 1,
|
|
53
|
-
maxPage: 3,
|
|
54
|
-
iteration: undefined,
|
|
55
|
-
};
|
|
56
|
-
expect(getNextPager(pager).page).toEqual(2);
|
|
57
|
-
});
|
|
58
|
-
it('should stop at the last page', () => {
|
|
59
|
-
const pager = {
|
|
60
|
-
page: 3,
|
|
61
|
-
maxPage: 3,
|
|
62
|
-
iteration: undefined,
|
|
63
|
-
};
|
|
64
|
-
expect(getNextPager(pager).page).toEqual(3);
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
describe('getPrevPager', () => {
|
|
68
|
-
const base = {
|
|
69
|
-
page: 2,
|
|
70
|
-
maxPage: 3,
|
|
71
|
-
subPage: 2,
|
|
72
|
-
nbSubPages: 3,
|
|
73
|
-
iteration: 1,
|
|
74
|
-
nbIterations: 2,
|
|
75
|
-
};
|
|
76
|
-
it('should navigate inside a sequence', () => {
|
|
77
|
-
expect(getPrevPager(base)).toEqual({
|
|
78
|
-
...base,
|
|
79
|
-
subPage: 1,
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
it('should decrement iteration at the start of a sequence', () => {
|
|
83
|
-
const pager = {
|
|
84
|
-
...base,
|
|
85
|
-
subPage: 0,
|
|
86
|
-
};
|
|
87
|
-
expect(getPrevPager(pager).subPage).toEqual(2);
|
|
88
|
-
expect(getPrevPager(pager).iteration).toEqual(0);
|
|
89
|
-
});
|
|
90
|
-
it('should move up at the start of a sequence and an iteration', () => {
|
|
91
|
-
const pager = {
|
|
92
|
-
...base,
|
|
93
|
-
subPage: 0,
|
|
94
|
-
iteration: 0,
|
|
95
|
-
};
|
|
96
|
-
const reset = {
|
|
97
|
-
subPage: undefined,
|
|
98
|
-
nbSubPages: undefined,
|
|
99
|
-
iteration: undefined,
|
|
100
|
-
nbIterations: undefined,
|
|
101
|
-
};
|
|
102
|
-
expect(getPrevPager(pager)).toEqual({
|
|
103
|
-
...pager,
|
|
104
|
-
...reset,
|
|
105
|
-
page: 1,
|
|
106
|
-
});
|
|
107
|
-
expect(getPrevPager(pager, 'Roundabout')).toEqual({
|
|
108
|
-
...pager,
|
|
109
|
-
...reset,
|
|
110
|
-
page: 2,
|
|
111
|
-
});
|
|
112
|
-
expect(getPrevPager({ ...pager, iteration: 1 }, 'Roundabout')).toEqual({
|
|
113
|
-
...pager,
|
|
114
|
-
...reset,
|
|
115
|
-
page: 2,
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
it('should navigate on simple page without iteration', () => {
|
|
119
|
-
const pager = {
|
|
120
|
-
page: 2,
|
|
121
|
-
maxPage: 3,
|
|
122
|
-
iteration: undefined,
|
|
123
|
-
};
|
|
124
|
-
expect(getPrevPager(pager).page).toEqual(1);
|
|
125
|
-
});
|
|
126
|
-
it('should stop at the first page', () => {
|
|
127
|
-
const pager = {
|
|
128
|
-
page: 1,
|
|
129
|
-
maxPage: 3,
|
|
130
|
-
iteration: undefined,
|
|
131
|
-
};
|
|
132
|
-
expect(getPrevPager(pager).page).toEqual(1);
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
//# sourceMappingURL=page-navigation.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-navigation.spec.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/page-navigation.spec.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate page name from the pager
|
|
3
|
-
*/
|
|
4
|
-
export function getPageTag(pager) {
|
|
5
|
-
const { page, subPage, iteration } = pager;
|
|
6
|
-
if (subPage !== undefined && iteration !== undefined) {
|
|
7
|
-
return `${page}.${subPage + 1}#${iteration + 1}`;
|
|
8
|
-
}
|
|
9
|
-
return `${page}`;
|
|
10
|
-
}
|
|
11
|
-
export function getPagerFromPageTag(pageTag = 1) {
|
|
12
|
-
if (typeof pageTag === 'number') {
|
|
13
|
-
return { page: pageTag };
|
|
14
|
-
}
|
|
15
|
-
const pattern = /(?<page>\d+)\.?(?<subPagePlusUn>\d+)?#?(?<iterationPlusUn>\d+)?/g;
|
|
16
|
-
const match = [...pageTag?.toString().matchAll(pattern)];
|
|
17
|
-
if (match.length === 0) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
const [{ groups: { page, subPagePlusUn, iterationPlusUn }, },] = match;
|
|
21
|
-
if (!subPagePlusUn) {
|
|
22
|
-
return { page: parseInt(page, 10) };
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
page: parseInt(page, 10),
|
|
26
|
-
subPage: parseInt(subPagePlusUn, 10) - 1,
|
|
27
|
-
iteration: parseInt(iterationPlusUn, 10) - 1,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export function isNewReachedPage(pager) {
|
|
31
|
-
const { lastReachedPage } = pager;
|
|
32
|
-
const pageTag = getPageTag(pager);
|
|
33
|
-
return pageTagComparator(pageTag, lastReachedPage ?? '0') > 0;
|
|
34
|
-
}
|
|
35
|
-
export function getNewReachedPage(pager) {
|
|
36
|
-
return isNewReachedPage(pager) ? getPageTag(pager) : pager.lastReachedPage;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Comparison function for pageTag
|
|
40
|
-
* - negative if a comes before b
|
|
41
|
-
* - positive if a comes after b
|
|
42
|
-
* - 0 if a is the same as b
|
|
43
|
-
*/
|
|
44
|
-
export function pageTagComparator(a, b) {
|
|
45
|
-
const pageA = a.split(/\D/).map((v) => parseInt(v, 10));
|
|
46
|
-
const pageB = b.split(/\D/).map((v) => parseInt(v, 10));
|
|
47
|
-
// [0, 2, 1] is used to extract the significant part of the pageTag part (start with page, then iteration, then subpage)
|
|
48
|
-
for (const index of [0, 2, 1]) {
|
|
49
|
-
if (pageA[index] !== pageB[index]) {
|
|
50
|
-
return (pageA[index] ?? -1) - (pageB[index] ?? -1);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return 0;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=page-tag.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-tag.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/page-tag.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,KAAmC;IAC7D,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC3C,IAAI,OAAO,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QACtD,OAAO,GAAG,IAAI,IAAI,OAAO,GAAG,CAAC,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;IAClD,CAAC;IAED,OAAO,GAAG,IAAI,EAAE,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,UAA2B,CAAC;IAC/D,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC1B,CAAC;IACD,MAAM,OAAO,GACZ,kEAAkE,CAAC;IACpE,MAAM,KAAK,GAAG,CAAC,GAAI,OAAO,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAS,CAU3D,CAAC;IACN,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,MAAM,CACL,EACC,MAAM,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,eAAe,EAAE,GAChD,EACD,GAAG,KAAK,CAAC;IACV,IAAI,CAAC,aAAa,EAAE,CAAC;QACpB,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;IACrC,CAAC;IACD,OAAO;QACN,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QACxB,OAAO,EAAE,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC,GAAG,CAAC;QACxC,SAAS,EAAE,QAAQ,CAAC,eAAe,EAAE,EAAE,CAAC,GAAG,CAAC;KAC5C,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAmC;IACnE,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAClC,OAAO,iBAAiB,CAAC,OAAO,EAAE,eAAe,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,iBAAiB,CAChC,KAAmC;IAEnC,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC;AAC5E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAU,EAAE,CAAU;IACvD,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACxD,wHAAwH;IACxH,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAC/B,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC;IACF,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { getPagerFromPageTag, pageTagComparator } from './page-tag';
|
|
3
|
-
describe('page-tag', () => {
|
|
4
|
-
describe('getPagerFromPageTag', () => {
|
|
5
|
-
it('should handle simple page', () => {
|
|
6
|
-
expect(getPagerFromPageTag('2')).toEqual({
|
|
7
|
-
page: 2,
|
|
8
|
-
});
|
|
9
|
-
});
|
|
10
|
-
it('should handle page with iteration', () => {
|
|
11
|
-
expect(getPagerFromPageTag('2.1#3')).toEqual({
|
|
12
|
-
page: 2,
|
|
13
|
-
subPage: 0,
|
|
14
|
-
iteration: 2,
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
it.each([
|
|
19
|
-
['4.1', '4.2', -1],
|
|
20
|
-
['4.2#1', '4.2#1', 0],
|
|
21
|
-
['4.2#2', '4.2#1', 1],
|
|
22
|
-
['4.1#2', '4.2#1', 1],
|
|
23
|
-
['4.3#1', '4.2#1', 1],
|
|
24
|
-
['4', '4.2#1', -1],
|
|
25
|
-
])('pageTagComparator("%s", "%s") -> %d', (a, b, expected) => {
|
|
26
|
-
const expectation = expect(pageTagComparator(a, b));
|
|
27
|
-
if (expected === 0) {
|
|
28
|
-
expectation.toBe(0);
|
|
29
|
-
}
|
|
30
|
-
if (expected === 1) {
|
|
31
|
-
expectation.toBeGreaterThan(0);
|
|
32
|
-
}
|
|
33
|
-
if (expected === -1) {
|
|
34
|
-
expectation.toBeLessThan(0);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=page-tag.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-tag.spec.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/page-tag.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpE,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACzB,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACpC,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;YACpC,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;gBACxC,IAAI,EAAE,CAAC;aACP,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;YAC5C,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;gBAC5C,IAAI,EAAE,CAAC;gBACP,OAAO,EAAE,CAAC;gBACV,SAAS,EAAE,CAAC;aACZ,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,IAAI,CAAC;QACP,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QAClB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QACrB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QACrB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QACrB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QACrB,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;KACqB,CAAC,CACxC,qCAAqC,EACrC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE;QAClB,MAAM,WAAW,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACpD,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;YACpB,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;YACpB,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QAChC,CAAC;QACD,IAAI,QAAQ,KAAK,CAAC,CAAC,EAAE,CAAC;YACrB,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC7B,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { getComponentsFromState } from './get-components-from-state';
|
|
2
|
-
import executeConditionFilter from './execute-condition-filter';
|
|
3
|
-
export function getPageId({ subPage, page, }) {
|
|
4
|
-
if (subPage === undefined) {
|
|
5
|
-
return page;
|
|
6
|
-
}
|
|
7
|
-
return `${page}.${subPage + 1}`;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Converts a page number (3.1.2) to an array of numbers [3, 1, 2]
|
|
11
|
-
*/
|
|
12
|
-
export function pageStringToNumbers(page) {
|
|
13
|
-
return page.split('.').map((v) => parseInt(v, 10));
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Check if we are on an empty page
|
|
17
|
-
* if no components can be displayed on this page (using filter)
|
|
18
|
-
*/
|
|
19
|
-
export function isPageEmpty(state) {
|
|
20
|
-
const { executeExpression, pager } = state;
|
|
21
|
-
const { iteration } = pager;
|
|
22
|
-
const components = getComponentsFromState(state);
|
|
23
|
-
const visibleComponents = components.filter((component) => {
|
|
24
|
-
if ('conditionFilter' in component && component.conditionFilter) {
|
|
25
|
-
return executeConditionFilter(component.conditionFilter, executeExpression, iteration);
|
|
26
|
-
}
|
|
27
|
-
return true;
|
|
28
|
-
});
|
|
29
|
-
// No components are displayable on this page
|
|
30
|
-
if (visibleComponents.length === 0) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/use-lunatic/commons/page.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAEhE,MAAM,UAAU,SAAS,CAAC,EACzB,OAAO,EACP,IAAI,GACoD;IACxD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,GAAG,IAAI,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAA0B;IACrD,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC3C,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC5B,MAAM,UAAU,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IACjD,MAAM,iBAAiB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE;QACzD,IAAI,iBAAiB,IAAI,SAAS,IAAI,SAAS,CAAC,eAAe,EAAE,CAAC;YACjE,OAAO,sBAAsB,CAC5B,SAAS,CAAC,eAAe,EACzB,iBAAiB,EACjB,SAAS,CACT,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC,CAAC,CAAC;IAEH,6CAA6C;IAC7C,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { depth } from '../../../../utils/array';
|
|
2
|
-
/**
|
|
3
|
-
* Cleaning behaviour for the store
|
|
4
|
-
* When a variable changes, other variables can be reset
|
|
5
|
-
*/
|
|
6
|
-
export function cleaningBehaviour(store, cleaning,
|
|
7
|
-
// Value used as default when cleaning a variable
|
|
8
|
-
initialValues = {}) {
|
|
9
|
-
if (!cleaning) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
// Create a map to improve performance
|
|
13
|
-
const cleaningMap = new Map(Object.entries(cleaning));
|
|
14
|
-
store.on('change', (e) => {
|
|
15
|
-
const cleaningInfo = cleaningMap.get(e.detail.name);
|
|
16
|
-
const iteration = e.detail.iteration;
|
|
17
|
-
// The variable does not have cleaning
|
|
18
|
-
if (!cleaningInfo) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
for (const variableName in cleaningInfo) {
|
|
22
|
-
try {
|
|
23
|
-
const skipCleaning = store.run(cleaningInfo[variableName], {
|
|
24
|
-
iteration,
|
|
25
|
-
});
|
|
26
|
-
if (skipCleaning) {
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
// Variable may be top level, so we need to deduce expected iteration
|
|
30
|
-
const variableDepth = depth(initialValues[variableName]);
|
|
31
|
-
const variableIteration = variableDepth === 0
|
|
32
|
-
? undefined
|
|
33
|
-
: iteration?.slice(0, depth(initialValues[variableName]));
|
|
34
|
-
store.set(variableName, getValueAtIteration(initialValues[variableName], variableIteration), {
|
|
35
|
-
iteration: variableIteration,
|
|
36
|
-
cause: 'cleaning',
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
// If we have an error, skip this cleaning
|
|
41
|
-
console.error(e);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function getValueAtIteration(value, iteration) {
|
|
47
|
-
if (!iteration || iteration.length === 0) {
|
|
48
|
-
return value ?? null;
|
|
49
|
-
}
|
|
50
|
-
if (!Array.isArray(value)) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
return getValueAtIteration(value[iteration[0]], iteration.slice(1));
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=cleaning-behaviour.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cleaning-behaviour.js","sourceRoot":"","sources":["../../../../../src/use-lunatic/commons/variables/behaviours/cleaning-behaviour.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAChC,KAA4B,EAC5B,QAAmC;AACnC,iDAAiD;AACjD,gBAAyC,EAAE;IAE3C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO;IACR,CAAC;IAED,sCAAsC;IACtC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEtD,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;QACxB,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;QAErC,sCAAsC;QACtC,IAAI,CAAC,YAAY,EAAE,CAAC;YACnB,OAAO;QACR,CAAC;QAED,KAAK,MAAM,YAAY,IAAI,YAAY,EAAE,CAAC;YACzC,IAAI,CAAC;gBACJ,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE;oBAC1D,SAAS;iBACT,CAAC,CAAC;gBACH,IAAI,YAAY,EAAE,CAAC;oBAClB,SAAS;gBACV,CAAC;gBAED,qEAAqE;gBACrE,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC;gBACzD,MAAM,iBAAiB,GACtB,aAAa,KAAK,CAAC;oBAClB,CAAC,CAAC,SAAS;oBACX,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;gBAE5D,KAAK,CAAC,GAAG,CACR,YAAY,EACZ,mBAAmB,CAAC,aAAa,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC,EACnE;oBACC,SAAS,EAAE,iBAAiB;oBAC5B,KAAK,EAAE,UAAU;iBACjB,CACD,CAAC;YACH,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACZ,0CAA0C;gBAC1C,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACF,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAc,EAAE,SAAoB;IAChE,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1C,OAAO,KAAK,IAAI,IAAI,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,mBAAmB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Add missing behaviour to the store
|
|
3
|
-
* Missing works as a simplified cleaning that reset a linked variable
|
|
4
|
-
*/
|
|
5
|
-
export function missingBehaviour(store, missing) {
|
|
6
|
-
if (!missing) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
// Create a map to improve performance
|
|
10
|
-
const missingMap = new Map(Object.entries(missing));
|
|
11
|
-
store.on('change', (e) => {
|
|
12
|
-
// Only clean if a value is set
|
|
13
|
-
if (e.detail.value === null || e.detail.value === undefined) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
const linkedVariables = missingMap.get(e.detail.name);
|
|
17
|
-
// The variable does not have missing variable linked
|
|
18
|
-
if (!linkedVariables) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
for (const variableName of linkedVariables) {
|
|
22
|
-
store.set(variableName, null, { iteration: e.detail.iteration });
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=missing-behaviour.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"missing-behaviour.js","sourceRoot":"","sources":["../../../../../src/use-lunatic/commons/variables/behaviours/missing-behaviour.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC/B,KAA4B,EAC5B,OAAsC;IAEtC,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,OAAO;IACR,CAAC;IAED,sCAAsC;IACtC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAEpD,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;QACxB,+BAA+B;QAC/B,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7D,OAAO;QACR,CAAC;QAED,MAAM,eAAe,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEtD,qDAAqD;QACrD,IAAI,CAAC,eAAe,EAAE,CAAC;YACtB,OAAO;QACR,CAAC;QAED,KAAK,MAAM,YAAY,IAAI,eAAe,EAAE,CAAC;YAC5C,KAAK,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAClE,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { forceInt } from '../../../../utils/number';
|
|
2
|
-
import { resizeArrayVariable } from '../../../reducer/commons';
|
|
3
|
-
import { getExpressionAsString } from '../../../../utils/vtl';
|
|
4
|
-
import { resizeArray } from '../../../../utils/array';
|
|
5
|
-
/**
|
|
6
|
-
* Resizing behaviour for the store
|
|
7
|
-
* When a variable changes, multiple other variables can change size (size of the array)
|
|
8
|
-
*/
|
|
9
|
-
export function resizingBehaviour(store, resizing) {
|
|
10
|
-
if (!resizing) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
// Create a map to improve performance
|
|
14
|
-
const resizingMap = new Map(Object.entries(resizing));
|
|
15
|
-
store.on('change', (e) => {
|
|
16
|
-
// The variable does not have resizing
|
|
17
|
-
const resizingInfo = resizingMap.get(e.detail.name);
|
|
18
|
-
if (!resizingInfo) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
// Pairwise resizing
|
|
22
|
-
if ('sizeForLinksVariables' in resizingInfo) {
|
|
23
|
-
resizePairwise(store, resizingInfo, e.detail);
|
|
24
|
-
if (!('size' in resizingInfo)) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
if (!resizingInfo.size) {
|
|
29
|
-
throw new Error(`Cannot resize ${e.detail.name} missing "size" property`);
|
|
30
|
-
}
|
|
31
|
-
const newSize = forceInt(store.run(resizingInfo.size));
|
|
32
|
-
for (const variableName of resizingInfo.variables) {
|
|
33
|
-
const value = store.get(variableName);
|
|
34
|
-
if (!Array.isArray(value) || value.length !== newSize) {
|
|
35
|
-
store.set(variableName, resizeArrayVariable(value, newSize, null), {
|
|
36
|
-
cause: 'resizing',
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function resizePairwise(store, resizingInfo, args) {
|
|
43
|
-
// Handle expression being sent as an array or an object (ensure backward compatibility)
|
|
44
|
-
// Issue : https://github.com/InseeFr/Lunatic/issues/883
|
|
45
|
-
const sizeExpressions = Array.isArray(resizingInfo.sizeForLinksVariables)
|
|
46
|
-
? resizingInfo.sizeForLinksVariables
|
|
47
|
-
: [
|
|
48
|
-
resizingInfo.sizeForLinksVariables.xAxisSize,
|
|
49
|
-
resizingInfo.sizeForLinksVariables.yAxisSize,
|
|
50
|
-
];
|
|
51
|
-
const [xSize, ySize] = sizeExpressions.map((expression) => {
|
|
52
|
-
return forceInt(store.run(getExpressionAsString(expression)));
|
|
53
|
-
});
|
|
54
|
-
resizingInfo.linksVariables.forEach((variable) => {
|
|
55
|
-
const value = store.get(variable, args.iteration);
|
|
56
|
-
const resizedValue = resizeArray(
|
|
57
|
-
// The value is not an array, force an array
|
|
58
|
-
Array.isArray(value) ? value.map((i) => resizeArray(i, ySize, null)) : [], xSize, new Array(ySize).fill(null));
|
|
59
|
-
store.set(variable, resizedValue);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=resizing-behaviour.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resizing-behaviour.js","sourceRoot":"","sources":["../../../../../src/use-lunatic/commons/variables/behaviours/resizing-behaviour.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export class VTLExpressionError extends Error {
|
|
2
|
-
expression;
|
|
3
|
-
constructor(expression, message) {
|
|
4
|
-
super(`Cannot interpret expression "${expression}" ${message}`);
|
|
5
|
-
this.expression = expression;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export class VTLInterpretationError extends VTLExpressionError {
|
|
9
|
-
expression;
|
|
10
|
-
bindings;
|
|
11
|
-
constructor(expression, bindings) {
|
|
12
|
-
super(expression, `with bindings ${JSON.stringify(bindings)}`);
|
|
13
|
-
this.expression = expression;
|
|
14
|
-
this.bindings = bindings;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export class VTLMissingDependency extends VTLExpressionError {
|
|
18
|
-
expression;
|
|
19
|
-
variableName;
|
|
20
|
-
constructor(expression, variableName) {
|
|
21
|
-
super(expression, `unknown variable ${variableName}`);
|
|
22
|
-
this.expression = expression;
|
|
23
|
-
this.variableName = variableName;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export class VTLMissingDependencies extends VTLExpressionError {
|
|
27
|
-
expression;
|
|
28
|
-
dependencies;
|
|
29
|
-
constructor(expression, dependencies) {
|
|
30
|
-
super(expression, `unknown dependencies ${JSON.stringify(dependencies)}`);
|
|
31
|
-
this.expression = expression;
|
|
32
|
-
this.dependencies = dependencies;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/use-lunatic/commons/variables/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAE3B;IADjB,YACiB,UAAkB,EAClC,OAAe;QAEf,KAAK,CAAC,gCAAgC,UAAU,KAAK,OAAO,EAAE,CAAC,CAAC;QAHhD,eAAU,GAAV,UAAU,CAAQ;IAInC,CAAC;CACD;AAED,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAE5C;IACA;IAFjB,YACiB,UAAkB,EAClB,QAAiC;QAEjD,KAAK,CAAC,UAAU,EAAE,iBAAiB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAH/C,eAAU,GAAV,UAAU,CAAQ;QAClB,aAAQ,GAAR,QAAQ,CAAyB;IAGlD,CAAC;CACD;AAED,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IAE1C;IACA;IAFjB,YACiB,UAAkB,EAClB,YAAoB;QAEpC,KAAK,CAAC,UAAU,EAAE,oBAAoB,YAAY,EAAE,CAAC,CAAC;QAHtC,eAAU,GAAV,UAAU,CAAQ;QAClB,iBAAY,GAAZ,YAAY,CAAQ;IAGrC,CAAC;CACD;AAED,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAE5C;IACA;IAFjB,YACiB,UAAkB,EAClB,YAAsB;QAEtC,KAAK,CAAC,UAAU,EAAE,wBAAwB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAH1D,eAAU,GAAV,UAAU,CAAQ;QAClB,iBAAY,GAAZ,YAAY,CAAU;IAGvC,CAAC;CACD"}
|