@inseefr/lunatic 3.4.5-rc.0 → 3.4.6-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/esm/components/Accordion/Accordion.d.ts +7 -0
- package/esm/components/Accordion/Accordion.js +6 -0
- package/esm/components/Accordion/Accordion.js.map +1 -0
- package/esm/components/CheckboxBoolean/CheckboxBoolean.d.ts +10 -0
- package/esm/components/CheckboxBoolean/CheckboxBoolean.js +19 -0
- package/esm/components/CheckboxBoolean/CheckboxBoolean.js.map +1 -0
- package/esm/components/CheckboxBoolean/CheckboxBoolean.spec.d.ts +1 -0
- package/esm/components/CheckboxBoolean/CheckboxBoolean.spec.js +37 -0
- package/esm/components/CheckboxBoolean/CheckboxBoolean.spec.js.map +1 -0
- package/esm/components/CheckboxGroup/CheckboxGroup.d.ts +2 -0
- package/esm/components/CheckboxGroup/CheckboxGroup.js +7 -0
- package/esm/components/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.d.ts +7 -0
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.js +17 -0
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.js.map +1 -0
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.spec.d.ts +1 -0
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.spec.js +45 -0
- package/esm/components/CheckboxGroup/CustomCheckboxGroup.spec.js.map +1 -0
- package/esm/components/CheckboxOne/CheckboxOne.d.ts +5 -0
- package/esm/components/CheckboxOne/CheckboxOne.js +10 -0
- package/esm/components/CheckboxOne/CheckboxOne.js.map +1 -0
- package/esm/components/CheckboxOne/CheckboxOne.spec.d.ts +1 -0
- package/esm/components/CheckboxOne/CheckboxOne.spec.js +24 -0
- package/esm/components/CheckboxOne/CheckboxOne.spec.js.map +1 -0
- package/esm/components/Datepicker/Datepicker.d.ts +9 -0
- package/esm/components/Datepicker/Datepicker.js +66 -0
- package/esm/components/Datepicker/Datepicker.js.map +1 -0
- package/esm/components/Datepicker/Datepicker.spec.d.ts +1 -0
- package/esm/components/Datepicker/Datepicker.spec.js +75 -0
- package/esm/components/Datepicker/Datepicker.spec.js.map +1 -0
- package/esm/components/Datepicker/DatepickerField.d.ts +12 -0
- package/esm/components/Datepicker/DatepickerField.js +13 -0
- package/esm/components/Datepicker/DatepickerField.js.map +1 -0
- package/esm/components/Dropdown/Dropdown.d.ts +9 -0
- package/esm/components/Dropdown/Dropdown.js +15 -0
- package/esm/components/Dropdown/Dropdown.js.map +1 -0
- package/esm/components/Dropdown/Dropdown.spec.d.ts +1 -0
- package/esm/components/Dropdown/Dropdown.spec.js +38 -0
- package/esm/components/Dropdown/Dropdown.spec.js.map +1 -0
- package/esm/components/Dropdown/renderer/SimpleLabelRenderer.d.ts +8 -0
- package/esm/components/Dropdown/renderer/SimpleLabelRenderer.js +19 -0
- package/esm/components/Dropdown/renderer/SimpleLabelRenderer.js.map +1 -0
- package/esm/components/Dropdown/renderer/SimpleOptionRenderer.d.ts +7 -0
- package/esm/components/Dropdown/renderer/SimpleOptionRenderer.js +10 -0
- package/esm/components/Dropdown/renderer/SimpleOptionRenderer.js.map +1 -0
- package/esm/components/Duration/Duration.d.ts +9 -0
- package/esm/components/Duration/Duration.js +34 -0
- package/esm/components/Duration/Duration.js.map +1 -0
- package/esm/components/Duration/durationUtils.d.ts +47 -0
- package/esm/components/Duration/durationUtils.js +26 -0
- package/esm/components/Duration/durationUtils.js.map +1 -0
- package/esm/components/Duration/formatDuration.d.ts +2 -0
- package/esm/components/Duration/formatDuration.js +18 -0
- package/esm/components/Duration/formatDuration.js.map +1 -0
- package/esm/components/Duration/formatDuration.spec.d.ts +1 -0
- package/esm/components/Duration/formatDuration.spec.js +16 -0
- package/esm/components/Duration/formatDuration.spec.js.map +1 -0
- package/esm/components/Duration/getDurationFromValue.d.ts +8 -0
- package/esm/components/Duration/getDurationFromValue.js +36 -0
- package/esm/components/Duration/getDurationFromValue.js.map +1 -0
- package/esm/components/FilterDescription/FilterDescription.d.ts +7 -0
- package/esm/components/FilterDescription/FilterDescription.js +3 -0
- package/esm/components/FilterDescription/FilterDescription.js.map +1 -0
- package/esm/components/FilterDescription/FilterDescription.spec.d.ts +1 -0
- package/esm/components/FilterDescription/FilterDescription.spec.js +16 -0
- package/esm/components/FilterDescription/FilterDescription.spec.js.map +1 -0
- package/esm/components/Input/Input.d.ts +9 -0
- package/esm/components/Input/Input.js +15 -0
- package/esm/components/Input/Input.js.map +1 -0
- package/esm/components/Input/Input.spec.d.ts +1 -0
- package/esm/components/Input/Input.spec.js +52 -0
- package/esm/components/Input/Input.spec.js.map +1 -0
- package/esm/components/InputNumber/InputNumber.d.ts +9 -0
- package/esm/components/InputNumber/InputNumber.js +15 -0
- package/esm/components/InputNumber/InputNumber.js.map +1 -0
- package/esm/components/InputNumber/InputNumber.spec.d.ts +1 -0
- package/esm/components/InputNumber/InputNumber.spec.js +76 -0
- package/esm/components/InputNumber/InputNumber.spec.js.map +1 -0
- package/esm/components/InputNumber/InputNumberThousand.d.ts +14 -0
- package/esm/components/InputNumber/InputNumberThousand.js +20 -0
- package/esm/components/InputNumber/InputNumberThousand.js.map +1 -0
- package/esm/components/Loop/Loop.d.ts +15 -0
- package/esm/components/Loop/Loop.js +56 -0
- package/esm/components/Loop/Loop.js.map +1 -0
- package/esm/components/Loop/constant.d.ts +4 -0
- package/esm/components/Loop/constant.js +10 -0
- package/esm/components/Loop/constant.js.map +1 -0
- package/esm/components/LunaticComponents.d.ts +22 -0
- package/esm/components/LunaticComponents.js +83 -0
- package/esm/components/LunaticComponents.js.map +1 -0
- package/esm/components/PairwiseLinks/PairwiseLinks.d.ts +2 -0
- package/esm/components/PairwiseLinks/PairwiseLinks.js +42 -0
- package/esm/components/PairwiseLinks/PairwiseLinks.js.map +1 -0
- package/esm/components/Question/Question.d.ts +9 -0
- package/esm/components/Question/Question.js +16 -0
- package/esm/components/Question/Question.js.map +1 -0
- package/esm/components/Radio/Radio.d.ts +9 -0
- package/esm/components/Radio/Radio.js +10 -0
- package/esm/components/Radio/Radio.js.map +1 -0
- package/esm/components/RosterForLoop/RosterForLoop.d.ts +5 -0
- package/esm/components/RosterForLoop/RosterForLoop.js +63 -0
- package/esm/components/RosterForLoop/RosterForLoop.js.map +1 -0
- package/esm/components/RosterForLoop/RosterForLoop.spec.d.ts +1 -0
- package/esm/components/RosterForLoop/RosterForLoop.spec.js +28 -0
- package/esm/components/RosterForLoop/RosterForLoop.spec.js.map +1 -0
- package/esm/components/Roundabout/CustomRoundabout.d.ts +16 -0
- package/esm/components/Roundabout/CustomRoundabout.js +31 -0
- package/esm/components/Roundabout/CustomRoundabout.js.map +1 -0
- package/esm/components/Roundabout/Roundabout.d.ts +5 -0
- package/esm/components/Roundabout/Roundabout.js +28 -0
- package/esm/components/Roundabout/Roundabout.js.map +1 -0
- package/esm/components/Roundabout/roundabout.spec.d.ts +1 -0
- package/esm/components/Roundabout/roundabout.spec.js +47 -0
- package/esm/components/Roundabout/roundabout.spec.js.map +1 -0
- package/esm/components/Sequence/Sequence.d.ts +3 -0
- package/esm/components/Sequence/Sequence.js +9 -0
- package/esm/components/Sequence/Sequence.js.map +1 -0
- package/esm/components/Subsequence/Subsequence.d.ts +3 -0
- package/esm/components/Subsequence/Subsequence.js +9 -0
- package/esm/components/Subsequence/Subsequence.js.map +1 -0
- package/esm/components/Subsequence/Subsequence.spec.d.ts +1 -0
- package/esm/components/Subsequence/Subsequence.spec.js +43 -0
- package/esm/components/Subsequence/Subsequence.spec.js.map +1 -0
- package/esm/components/Suggester/CustomSuggester.d.ts +29 -0
- package/esm/components/Suggester/CustomSuggester.js +19 -0
- package/esm/components/Suggester/CustomSuggester.js.map +1 -0
- package/esm/components/Suggester/Suggester.d.ts +2 -0
- package/esm/components/Suggester/Suggester.js +104 -0
- package/esm/components/Suggester/Suggester.js.map +1 -0
- package/esm/components/Suggester/SuggesterNotification.d.ts +9 -0
- package/esm/components/Suggester/SuggesterNotification.js +15 -0
- package/esm/components/Suggester/SuggesterNotification.js.map +1 -0
- package/esm/components/Suggester/SuggesterType.d.ts +5 -0
- package/esm/components/Suggester/SuggesterType.js +2 -0
- package/esm/components/Suggester/SuggesterType.js.map +1 -0
- package/esm/components/Suggester/useSuggestions.d.ts +17 -0
- package/esm/components/Suggester/useSuggestions.js +85 -0
- package/esm/components/Suggester/useSuggestions.js.map +1 -0
- package/esm/components/Summary/Summary.d.ts +25 -0
- package/esm/components/Summary/Summary.js +65 -0
- package/esm/components/Summary/Summary.js.map +1 -0
- package/esm/components/Switch/Switch.d.ts +20 -0
- package/esm/components/Switch/Switch.js +30 -0
- package/esm/components/Switch/Switch.js.map +1 -0
- package/esm/components/Table/Table.d.ts +2 -0
- package/esm/components/Table/Table.js +9 -0
- package/esm/components/Table/Table.js.map +1 -0
- package/esm/components/Text/Text.d.ts +2 -0
- package/esm/components/Text/Text.js +4 -0
- package/esm/components/Text/Text.js.map +1 -0
- package/esm/components/Textarea/Textarea.d.ts +9 -0
- package/esm/components/Textarea/Textarea.js +14 -0
- package/esm/components/Textarea/Textarea.js.map +1 -0
- package/esm/components/Textarea/Textarea.spec.d.ts +1 -0
- package/esm/components/Textarea/Textarea.spec.js +31 -0
- package/esm/components/Textarea/Textarea.spec.js.map +1 -0
- package/esm/components/library.d.ts +73 -0
- package/esm/components/library.js +52 -0
- package/esm/components/library.js.map +1 -0
- package/esm/components/shared/Button/Button.d.ts +14 -0
- package/esm/components/shared/Button/Button.js +13 -0
- package/esm/components/shared/Button/Button.js.map +1 -0
- package/esm/components/shared/Button/Button.spec.d.ts +1 -0
- package/esm/components/shared/Button/Button.spec.js +51 -0
- package/esm/components/shared/Button/Button.spec.js.map +1 -0
- package/esm/components/shared/Button/IconButton.d.ts +6 -0
- package/esm/components/shared/Button/IconButton.js +7 -0
- package/esm/components/shared/Button/IconButton.js.map +1 -0
- package/esm/components/shared/Button/IconButton.spec.d.ts +1 -0
- package/esm/components/shared/Button/IconButton.spec.js +53 -0
- package/esm/components/shared/Button/IconButton.spec.js.map +1 -0
- package/esm/components/shared/Checkbox/CheckboxOption.d.ts +15 -0
- package/esm/components/shared/Checkbox/CheckboxOption.js +26 -0
- package/esm/components/shared/Checkbox/CheckboxOption.js.map +1 -0
- package/esm/components/shared/Checkbox/CheckboxOption.spec.d.ts +1 -0
- package/esm/components/shared/Checkbox/CheckboxOption.spec.js +52 -0
- package/esm/components/shared/Checkbox/CheckboxOption.spec.js.map +1 -0
- package/esm/components/shared/Checkbox/getShortcutKey.d.ts +1 -0
- package/esm/components/shared/Checkbox/getShortcutKey.js +3 -0
- package/esm/components/shared/Checkbox/getShortcutKey.js.map +1 -0
- package/esm/components/shared/Combobox/Combobox.d.ts +25 -0
- package/esm/components/shared/Combobox/Combobox.js +97 -0
- package/esm/components/shared/Combobox/Combobox.js.map +1 -0
- package/esm/components/shared/Combobox/Combobox.stories.d.ts +6 -0
- package/esm/components/shared/Combobox/Combobox.stories.js +47 -0
- package/esm/components/shared/Combobox/Combobox.stories.js.map +1 -0
- package/esm/components/shared/Combobox/ComboboxContainer.d.ts +11 -0
- package/esm/components/shared/Combobox/ComboboxContainer.js +6 -0
- package/esm/components/shared/Combobox/ComboboxContainer.js.map +1 -0
- package/esm/components/shared/Combobox/ComboboxContainer.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/ComboboxContainer.spec.js +24 -0
- package/esm/components/shared/Combobox/ComboboxContainer.spec.js.map +1 -0
- package/esm/components/shared/Combobox/ComboboxContent.d.ts +10 -0
- package/esm/components/shared/Combobox/ComboboxContent.js +35 -0
- package/esm/components/shared/Combobox/ComboboxContent.js.map +1 -0
- package/esm/components/shared/Combobox/ComboboxContentBox.d.ts +7 -0
- package/esm/components/shared/Combobox/ComboboxContentBox.js +7 -0
- package/esm/components/shared/Combobox/ComboboxContentBox.js.map +1 -0
- package/esm/components/shared/Combobox/ComboboxType.d.ts +51 -0
- package/esm/components/shared/Combobox/ComboboxType.js +2 -0
- package/esm/components/shared/Combobox/ComboboxType.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOption.d.ts +7 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOption.js +15 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOption.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOption.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOption.spec.js +33 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOption.spec.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOptionContainer.d.ts +8 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOptionContainer.js +36 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOptionContainer.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOptionContainer.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOptionContainer.spec.js +18 -0
- package/esm/components/shared/Combobox/Panel/ComboboxOptionContainer.spec.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanel.d.ts +5 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanel.js +30 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanel.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanel.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanel.spec.js +57 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanel.spec.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanelContainer.d.ts +8 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanelContainer.js +8 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanelContainer.js.map +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanelContainer.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanelContainer.spec.js +31 -0
- package/esm/components/shared/Combobox/Panel/ComboboxPanelContainer.spec.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxClearButton.d.ts +8 -0
- package/esm/components/shared/Combobox/Selection/ComboboxClearButton.js +28 -0
- package/esm/components/shared/Combobox/Selection/ComboboxClearButton.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxClearButton.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxClearButton.spec.js +53 -0
- package/esm/components/shared/Combobox/Selection/ComboboxClearButton.spec.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxInput.d.ts +11 -0
- package/esm/components/shared/Combobox/Selection/ComboboxInput.js +21 -0
- package/esm/components/shared/Combobox/Selection/ComboboxInput.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxLabelSelection.d.ts +10 -0
- package/esm/components/shared/Combobox/Selection/ComboboxLabelSelection.js +31 -0
- package/esm/components/shared/Combobox/Selection/ComboboxLabelSelection.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxLabelSelection.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxLabelSelection.spec.js +27 -0
- package/esm/components/shared/Combobox/Selection/ComboboxLabelSelection.spec.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxSelection.d.ts +6 -0
- package/esm/components/shared/Combobox/Selection/ComboboxSelection.js +18 -0
- package/esm/components/shared/Combobox/Selection/ComboboxSelection.js.map +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxSelection.spec.d.ts +1 -0
- package/esm/components/shared/Combobox/Selection/ComboboxSelection.spec.js +36 -0
- package/esm/components/shared/Combobox/Selection/ComboboxSelection.spec.js.map +1 -0
- package/esm/components/shared/Combobox/constants.d.ts +9 -0
- package/esm/components/shared/Combobox/constants.js +10 -0
- package/esm/components/shared/Combobox/constants.js.map +1 -0
- package/esm/components/shared/Combobox/index.d.ts +0 -0
- package/esm/components/shared/Combobox/index.js +2 -0
- package/esm/components/shared/Combobox/index.js.map +1 -0
- package/esm/components/shared/ComponentErrors/ComponentErrors.d.ts +14 -0
- package/esm/components/shared/ComponentErrors/ComponentErrors.js +24 -0
- package/esm/components/shared/ComponentErrors/ComponentErrors.js.map +1 -0
- package/esm/components/shared/ComponentErrors/ComponentErrors.spec.d.ts +1 -0
- package/esm/components/shared/ComponentErrors/ComponentErrors.spec.js +40 -0
- package/esm/components/shared/ComponentErrors/ComponentErrors.spec.js.map +1 -0
- package/esm/components/shared/ComponentWrapper.d.ts +25 -0
- package/esm/components/shared/ComponentWrapper.js +28 -0
- package/esm/components/shared/ComponentWrapper.js.map +1 -0
- package/esm/components/shared/Declarations/Declarations.d.ts +16 -0
- package/esm/components/shared/Declarations/Declarations.js +14 -0
- package/esm/components/shared/Declarations/Declarations.js.map +1 -0
- package/esm/components/shared/Declarations/Declarations.spec.d.ts +1 -0
- package/esm/components/shared/Declarations/Declarations.spec.js +66 -0
- package/esm/components/shared/Declarations/Declarations.spec.js.map +1 -0
- package/esm/components/shared/Fieldset/Fieldset.d.ts +9 -0
- package/esm/components/shared/Fieldset/Fieldset.js +28 -0
- package/esm/components/shared/Fieldset/Fieldset.js.map +1 -0
- package/esm/components/shared/Fieldset/Fieldset.spec.d.ts +1 -0
- package/esm/components/shared/Fieldset/Fieldset.spec.js +25 -0
- package/esm/components/shared/Fieldset/Fieldset.spec.js.map +1 -0
- package/esm/components/shared/HOC/slottableComponent.d.ts +101 -0
- package/esm/components/shared/HOC/slottableComponent.js +31 -0
- package/esm/components/shared/HOC/slottableComponent.js.map +1 -0
- package/esm/components/shared/Icons/checkbox-checked-icon.d.ts +2 -0
- package/esm/components/shared/Icons/checkbox-checked-icon.js +6 -0
- package/esm/components/shared/Icons/checkbox-checked-icon.js.map +1 -0
- package/esm/components/shared/Icons/checkbox-disabled-icon.d.ts +2 -0
- package/esm/components/shared/Icons/checkbox-disabled-icon.js +6 -0
- package/esm/components/shared/Icons/checkbox-disabled-icon.js.map +1 -0
- package/esm/components/shared/Icons/checkbox-unchecked-icon.d.ts +2 -0
- package/esm/components/shared/Icons/checkbox-unchecked-icon.js +6 -0
- package/esm/components/shared/Icons/checkbox-unchecked-icon.js.map +1 -0
- package/esm/components/shared/Icons/closed-icon.d.ts +2 -0
- package/esm/components/shared/Icons/closed-icon.js +6 -0
- package/esm/components/shared/Icons/closed-icon.js.map +1 -0
- package/esm/components/shared/Icons/cross-icon.d.ts +2 -0
- package/esm/components/shared/Icons/cross-icon.js +6 -0
- package/esm/components/shared/Icons/cross-icon.js.map +1 -0
- package/esm/components/shared/Icons/icon-props.d.ts +5 -0
- package/esm/components/shared/Icons/icon-props.js +2 -0
- package/esm/components/shared/Icons/icon-props.js.map +1 -0
- package/esm/components/shared/Icons/index.d.ts +10 -0
- package/esm/components/shared/Icons/index.js +11 -0
- package/esm/components/shared/Icons/index.js.map +1 -0
- package/esm/components/shared/Icons/load-icon.d.ts +2 -0
- package/esm/components/shared/Icons/load-icon.js +6 -0
- package/esm/components/shared/Icons/load-icon.js.map +1 -0
- package/esm/components/shared/Icons/lunatic-icon.d.ts +4 -0
- package/esm/components/shared/Icons/lunatic-icon.js +6 -0
- package/esm/components/shared/Icons/lunatic-icon.js.map +1 -0
- package/esm/components/shared/Icons/network-icon.d.ts +2 -0
- package/esm/components/shared/Icons/network-icon.js +6 -0
- package/esm/components/shared/Icons/network-icon.js.map +1 -0
- package/esm/components/shared/Icons/on-drag-icon.d.ts +2 -0
- package/esm/components/shared/Icons/on-drag-icon.js +6 -0
- package/esm/components/shared/Icons/on-drag-icon.js.map +1 -0
- package/esm/components/shared/Icons/opened-icon.d.ts +2 -0
- package/esm/components/shared/Icons/opened-icon.js +6 -0
- package/esm/components/shared/Icons/opened-icon.js.map +1 -0
- package/esm/components/shared/Icons/radio-checked-icon.d.ts +3 -0
- package/esm/components/shared/Icons/radio-checked-icon.js +7 -0
- package/esm/components/shared/Icons/radio-checked-icon.js.map +1 -0
- package/esm/components/shared/Icons/radio-unchecked-icon.d.ts +2 -0
- package/esm/components/shared/Icons/radio-unchecked-icon.js +6 -0
- package/esm/components/shared/Icons/radio-unchecked-icon.js.map +1 -0
- package/esm/components/shared/Label/Label.d.ts +10 -0
- package/esm/components/shared/Label/Label.js +15 -0
- package/esm/components/shared/Label/Label.js.map +1 -0
- package/esm/components/shared/Label/Label.spec.d.ts +1 -0
- package/esm/components/shared/Label/Label.spec.js +19 -0
- package/esm/components/shared/Label/Label.spec.js.map +1 -0
- package/esm/components/shared/LabelDescription.d.ts +7 -0
- package/esm/components/shared/LabelDescription.js +11 -0
- package/esm/components/shared/LabelDescription.js.map +1 -0
- package/esm/components/shared/MDLabel/MDLabel.d.ts +5 -0
- package/esm/components/shared/MDLabel/MDLabel.js +20 -0
- package/esm/components/shared/MDLabel/MDLabel.js.map +1 -0
- package/esm/components/shared/MDLabel/MDLabel.spec.d.ts +1 -0
- package/esm/components/shared/MDLabel/MDLabel.spec.js +107 -0
- package/esm/components/shared/MDLabel/MDLabel.spec.js.map +1 -0
- package/esm/components/shared/MDLabel/MarkdownLink.d.ts +7 -0
- package/esm/components/shared/MDLabel/MarkdownLink.js +14 -0
- package/esm/components/shared/MDLabel/MarkdownLink.js.map +1 -0
- package/esm/components/shared/MDLabel/RouterLink.d.ts +6 -0
- package/esm/components/shared/MDLabel/RouterLink.js +7 -0
- package/esm/components/shared/MDLabel/RouterLink.js.map +1 -0
- package/esm/components/shared/Missing/Missing.d.ts +14 -0
- package/esm/components/shared/Missing/Missing.js +52 -0
- package/esm/components/shared/Missing/Missing.js.map +1 -0
- package/esm/components/shared/Missing/Missing.spec.d.ts +1 -0
- package/esm/components/shared/Missing/Missing.spec.js +45 -0
- package/esm/components/shared/Missing/Missing.spec.js.map +1 -0
- package/esm/components/shared/ModalControls/ModalControls.d.ts +10 -0
- package/esm/components/shared/ModalControls/ModalControls.js +29 -0
- package/esm/components/shared/ModalControls/ModalControls.js.map +1 -0
- package/esm/components/shared/ModalControls/ModalControls.spec.d.ts +1 -0
- package/esm/components/shared/ModalControls/ModalControls.spec.js +61 -0
- package/esm/components/shared/ModalControls/ModalControls.spec.js.map +1 -0
- package/esm/components/shared/Notification.d.ts +8 -0
- package/esm/components/shared/Notification.js +8 -0
- package/esm/components/shared/Notification.js.map +1 -0
- package/esm/components/shared/Radio/RadioGroup.d.ts +7 -0
- package/esm/components/shared/Radio/RadioGroup.js +23 -0
- package/esm/components/shared/Radio/RadioGroup.js.map +1 -0
- package/esm/components/shared/Radio/RadioOption.d.ts +17 -0
- package/esm/components/shared/Radio/RadioOption.js +38 -0
- package/esm/components/shared/Radio/RadioOption.js.map +1 -0
- package/esm/components/shared/Radio/RadioOption.spec.d.ts +1 -0
- package/esm/components/shared/Radio/RadioOption.spec.js +46 -0
- package/esm/components/shared/Radio/RadioOption.spec.js.map +1 -0
- package/esm/components/shared/Table/Table.d.ts +8 -0
- package/esm/components/shared/Table/Table.js +13 -0
- package/esm/components/shared/Table/Table.js.map +1 -0
- package/esm/components/shared/Table/Table.spec.d.ts +1 -0
- package/esm/components/shared/Table/Table.spec.js +15 -0
- package/esm/components/shared/Table/Table.spec.js.map +1 -0
- package/esm/components/shared/Table/TableHeader.d.ts +2 -0
- package/esm/components/shared/Table/TableHeader.js +14 -0
- package/esm/components/shared/Table/TableHeader.js.map +1 -0
- package/esm/components/shared/Table/Tbody.d.ts +6 -0
- package/esm/components/shared/Table/Tbody.js +8 -0
- package/esm/components/shared/Table/Tbody.js.map +1 -0
- package/esm/components/shared/Table/Tbody.spec.d.ts +1 -0
- package/esm/components/shared/Table/Tbody.spec.js +22 -0
- package/esm/components/shared/Table/Tbody.spec.js.map +1 -0
- package/esm/components/shared/Table/Td.d.ts +11 -0
- package/esm/components/shared/Table/Td.js +8 -0
- package/esm/components/shared/Table/Td.js.map +1 -0
- package/esm/components/shared/Table/Td.spec.d.ts +1 -0
- package/esm/components/shared/Table/Td.spec.js +21 -0
- package/esm/components/shared/Table/Td.spec.js.map +1 -0
- package/esm/components/shared/Table/Th.d.ts +10 -0
- package/esm/components/shared/Table/Th.js +8 -0
- package/esm/components/shared/Table/Th.js.map +1 -0
- package/esm/components/shared/Table/Th.spec.d.ts +1 -0
- package/esm/components/shared/Table/Th.spec.js +25 -0
- package/esm/components/shared/Table/Th.spec.js.map +1 -0
- package/esm/components/shared/Table/Thead.d.ts +6 -0
- package/esm/components/shared/Table/Thead.js +8 -0
- package/esm/components/shared/Table/Thead.js.map +1 -0
- package/esm/components/shared/Table/Thead.spec.d.ts +1 -0
- package/esm/components/shared/Table/Thead.spec.js +12 -0
- package/esm/components/shared/Table/Thead.spec.js.map +1 -0
- package/esm/components/shared/Table/Tr.d.ts +7 -0
- package/esm/components/shared/Table/Tr.js +8 -0
- package/esm/components/shared/Table/Tr.js.map +1 -0
- package/esm/components/shared/Table/Tr.spec.d.ts +1 -0
- package/esm/components/shared/Table/Tr.spec.js +19 -0
- package/esm/components/shared/Table/Tr.spec.js.map +1 -0
- package/esm/components/shared/Table/index.d.ts +7 -0
- package/esm/components/shared/Table/index.js +8 -0
- package/esm/components/shared/Table/index.js.map +1 -0
- package/esm/components/type.d.ts +305 -0
- package/esm/components/type.js +2 -0
- package/esm/components/type.js.map +1 -0
- package/esm/constants/component-types.d.ts +1 -0
- package/esm/constants/component-types.js +2 -0
- package/esm/constants/component-types.js.map +1 -0
- package/esm/constants/declarations.d.ts +9 -0
- package/esm/constants/declarations.js +12 -0
- package/esm/constants/declarations.js.map +1 -0
- package/esm/constants/event-types.d.ts +10 -0
- package/esm/constants/event-types.js +13 -0
- package/esm/constants/event-types.js.map +1 -0
- package/esm/constants/index.d.ts +5 -0
- package/esm/constants/index.js +6 -0
- package/esm/constants/index.js.map +1 -0
- package/esm/constants/indexedDBStore.d.ts +21 -0
- package/esm/constants/indexedDBStore.js +19 -0
- package/esm/constants/indexedDBStore.js.map +1 -0
- package/esm/constants/supported-preferences.d.ts +1 -0
- package/esm/constants/supported-preferences.js +10 -0
- package/esm/constants/supported-preferences.js.map +1 -0
- package/esm/constants/value-types.d.ts +5 -0
- package/esm/constants/value-types.js +6 -0
- package/esm/constants/value-types.js.map +1 -0
- package/esm/constants/variable-types.d.ts +2 -0
- package/esm/constants/variable-types.js +5 -0
- package/esm/constants/variable-types.js.map +1 -0
- package/esm/hooks/use-auto-focus.d.ts +6 -0
- package/esm/hooks/use-auto-focus.js +19 -0
- package/esm/hooks/use-auto-focus.js.map +1 -0
- package/esm/hooks/use-track-changes.d.ts +11 -0
- package/esm/hooks/use-track-changes.js +41 -0
- package/esm/hooks/use-track-changes.js.map +1 -0
- package/esm/hooks/use-why-render.d.ts +4 -0
- package/esm/hooks/use-why-render.js +14 -0
- package/esm/hooks/use-why-render.js.map +1 -0
- package/esm/hooks/useDebounce.d.ts +4 -0
- package/esm/hooks/useDebounce.js +24 -0
- package/esm/hooks/useDebounce.js.map +1 -0
- package/esm/hooks/useDocumentEvent.d.ts +2 -0
- package/esm/hooks/useDocumentEvent.js +18 -0
- package/esm/hooks/useDocumentEvent.js.map +1 -0
- package/esm/hooks/useKeyboardKey.d.ts +4 -0
- package/esm/hooks/useKeyboardKey.js +25 -0
- package/esm/hooks/useKeyboardKey.js.map +1 -0
- package/esm/hooks/useListKeyboardHandler.d.ts +11 -0
- package/esm/hooks/useListKeyboardHandler.js +28 -0
- package/esm/hooks/useListKeyboardHandler.js.map +1 -0
- package/esm/hooks/useRefSync.d.ts +4 -0
- package/esm/hooks/useRefSync.js +10 -0
- package/esm/hooks/useRefSync.js.map +1 -0
- package/esm/i18n/build-dictionary.d.ts +24 -0
- package/esm/i18n/build-dictionary.js +37 -0
- package/esm/i18n/build-dictionary.js.map +1 -0
- package/esm/i18n/dictionary.d.ts +57 -0
- package/esm/i18n/dictionary.js +27 -0
- package/esm/i18n/dictionary.js.map +1 -0
- package/esm/i18n/index.d.ts +7 -0
- package/esm/i18n/index.js +13 -0
- package/esm/i18n/index.js.map +1 -0
- package/esm/i18n/inputNumberProps.d.ts +13 -0
- package/esm/i18n/inputNumberProps.js +7 -0
- package/esm/i18n/inputNumberProps.js.map +1 -0
- package/esm/index.d.ts +14 -0
- package/esm/index.js +12 -0
- package/esm/index.js.map +1 -0
- package/esm/tests/setup.d.ts +1 -0
- package/esm/tests/setup.js +18 -0
- package/esm/tests/setup.js.map +1 -0
- package/esm/tests/utils/lunatic.d.ts +19 -0
- package/esm/tests/utils/lunatic.js +31 -0
- package/esm/tests/utils/lunatic.js.map +1 -0
- package/esm/tests/utils/timer.d.ts +1 -0
- package/esm/tests/utils/timer.js +4 -0
- package/esm/tests/utils/timer.js.map +1 -0
- package/esm/tsconfig-esm.tsbuildinfo +1 -0
- package/esm/type.source.d.ts +408 -0
- package/esm/type.source.js +7 -0
- package/esm/type.source.js.map +1 -0
- package/esm/type.utils.d.ts +5 -0
- package/esm/type.utils.js +2 -0
- package/esm/type.utils.js.map +1 -0
- package/esm/use-lunatic/actions.d.ts +50 -0
- package/esm/use-lunatic/actions.js +26 -0
- package/esm/use-lunatic/actions.js.map +1 -0
- package/esm/use-lunatic/commons/check-loops.d.ts +30 -0
- package/esm/use-lunatic/commons/check-loops.js +63 -0
- package/esm/use-lunatic/commons/check-loops.js.map +1 -0
- package/esm/use-lunatic/commons/check-pager.d.ts +5 -0
- package/esm/use-lunatic/commons/check-pager.js +17 -0
- package/esm/use-lunatic/commons/check-pager.js.map +1 -0
- package/esm/use-lunatic/commons/compile-controls.d.ts +9 -0
- package/esm/use-lunatic/commons/compile-controls.js +156 -0
- package/esm/use-lunatic/commons/compile-controls.js.map +1 -0
- package/esm/use-lunatic/commons/component.d.ts +22 -0
- package/esm/use-lunatic/commons/component.js +22 -0
- package/esm/use-lunatic/commons/component.js.map +1 -0
- package/esm/use-lunatic/commons/create-map-pages.d.ts +6 -0
- package/esm/use-lunatic/commons/create-map-pages.js +58 -0
- package/esm/use-lunatic/commons/create-map-pages.js.map +1 -0
- package/esm/use-lunatic/commons/execute-condition-filter.d.ts +3 -0
- package/esm/use-lunatic/commons/execute-condition-filter.js +11 -0
- package/esm/use-lunatic/commons/execute-condition-filter.js.map +1 -0
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.d.ts +34 -0
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js +149 -0
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -0
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.spec.d.ts +1 -0
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.spec.js +83 -0
- package/esm/use-lunatic/commons/fill-components/fill-component-expressions.spec.js.map +1 -0
- package/esm/use-lunatic/commons/fill-components/fill-components.d.ts +25 -0
- package/esm/use-lunatic/commons/fill-components/fill-components.js +41 -0
- package/esm/use-lunatic/commons/fill-components/fill-components.js.map +1 -0
- package/esm/use-lunatic/commons/get-compatible-vtl-expression.d.ts +7 -0
- package/esm/use-lunatic/commons/get-compatible-vtl-expression.js +19 -0
- package/esm/use-lunatic/commons/get-compatible-vtl-expression.js.map +1 -0
- package/esm/use-lunatic/commons/get-components-from-state.d.ts +5 -0
- package/esm/use-lunatic/commons/get-components-from-state.js +22 -0
- package/esm/use-lunatic/commons/get-components-from-state.js.map +1 -0
- package/esm/use-lunatic/commons/index.d.ts +6 -0
- package/esm/use-lunatic/commons/index.js +7 -0
- package/esm/use-lunatic/commons/index.js.map +1 -0
- package/esm/use-lunatic/commons/is-First-last-page.d.ts +6 -0
- package/esm/use-lunatic/commons/is-First-last-page.js +8 -0
- package/esm/use-lunatic/commons/is-First-last-page.js.map +1 -0
- package/esm/use-lunatic/commons/is-paginated-loop.d.ts +6 -0
- package/esm/use-lunatic/commons/is-paginated-loop.js +5 -0
- package/esm/use-lunatic/commons/is-paginated-loop.js.map +1 -0
- package/esm/use-lunatic/commons/is-roundabout.d.ts +2 -0
- package/esm/use-lunatic/commons/is-roundabout.js +5 -0
- package/esm/use-lunatic/commons/is-roundabout.js.map +1 -0
- package/esm/use-lunatic/commons/page-navigation.d.ts +7 -0
- package/esm/use-lunatic/commons/page-navigation.js +95 -0
- package/esm/use-lunatic/commons/page-navigation.js.map +1 -0
- package/esm/use-lunatic/commons/page-navigation.spec.d.ts +1 -0
- package/esm/use-lunatic/commons/page-navigation.spec.js +136 -0
- package/esm/use-lunatic/commons/page-navigation.spec.js.map +1 -0
- package/esm/use-lunatic/commons/page-tag.d.ts +23 -0
- package/esm/use-lunatic/commons/page-tag.js +56 -0
- package/esm/use-lunatic/commons/page-tag.js.map +1 -0
- package/esm/use-lunatic/commons/page-tag.spec.d.ts +1 -0
- package/esm/use-lunatic/commons/page-tag.spec.js +38 -0
- package/esm/use-lunatic/commons/page-tag.spec.js.map +1 -0
- package/esm/use-lunatic/commons/page.d.ts +11 -0
- package/esm/use-lunatic/commons/page.js +35 -0
- package/esm/use-lunatic/commons/page.js.map +1 -0
- package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.d.ts +7 -0
- package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js +55 -0
- package/esm/use-lunatic/commons/variables/behaviours/cleaning-behaviour.js.map +1 -0
- package/esm/use-lunatic/commons/variables/behaviours/missing-behaviour.d.ts +7 -0
- package/esm/use-lunatic/commons/variables/behaviours/missing-behaviour.js +26 -0
- package/esm/use-lunatic/commons/variables/behaviours/missing-behaviour.js.map +1 -0
- package/esm/use-lunatic/commons/variables/behaviours/resizing-behaviour.d.ts +7 -0
- package/esm/use-lunatic/commons/variables/behaviours/resizing-behaviour.js +62 -0
- package/esm/use-lunatic/commons/variables/behaviours/resizing-behaviour.js.map +1 -0
- package/esm/use-lunatic/commons/variables/errors.d.ts +19 -0
- package/esm/use-lunatic/commons/variables/errors.js +28 -0
- package/esm/use-lunatic/commons/variables/errors.js.map +1 -0
- package/esm/use-lunatic/commons/variables/get-questionnaire-data.d.ts +3 -0
- package/esm/use-lunatic/commons/variables/get-questionnaire-data.js +53 -0
- package/esm/use-lunatic/commons/variables/get-questionnaire-data.js.map +1 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.d.ts +90 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.js +349 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.d.ts +1 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js +438 -0
- package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -0
- package/esm/use-lunatic/hooks/use-loop-variables.d.ts +5 -0
- package/esm/use-lunatic/hooks/use-loop-variables.js +18 -0
- package/esm/use-lunatic/hooks/use-loop-variables.js.map +1 -0
- package/esm/use-lunatic/hooks/use-page-has-response.d.ts +6 -0
- package/esm/use-lunatic/hooks/use-page-has-response.js +89 -0
- package/esm/use-lunatic/hooks/use-page-has-response.js.map +1 -0
- package/esm/use-lunatic/hooks/useOverview.d.ts +16 -0
- package/esm/use-lunatic/hooks/useOverview.js +92 -0
- package/esm/use-lunatic/hooks/useOverview.js.map +1 -0
- package/esm/use-lunatic/hooks/useWarnDepChange.d.ts +6 -0
- package/esm/use-lunatic/hooks/useWarnDepChange.js +17 -0
- package/esm/use-lunatic/hooks/useWarnDepChange.js.map +1 -0
- package/esm/use-lunatic/logger/ConsoleLogger.d.ts +5 -0
- package/esm/use-lunatic/logger/ConsoleLogger.js +12 -0
- package/esm/use-lunatic/logger/ConsoleLogger.js.map +1 -0
- package/esm/use-lunatic/logger/type.d.ts +9 -0
- package/esm/use-lunatic/logger/type.js +2 -0
- package/esm/use-lunatic/logger/type.js.map +1 -0
- package/esm/use-lunatic/lunatic-context.d.ts +28 -0
- package/esm/use-lunatic/lunatic-context.js +44 -0
- package/esm/use-lunatic/lunatic-context.js.map +1 -0
- package/esm/use-lunatic/props/getComponentTypeProps.d.ts +291 -0
- package/esm/use-lunatic/props/getComponentTypeProps.js +165 -0
- package/esm/use-lunatic/props/getComponentTypeProps.js.map +1 -0
- package/esm/use-lunatic/props/propIterations.d.ts +7 -0
- package/esm/use-lunatic/props/propIterations.js +26 -0
- package/esm/use-lunatic/props/propIterations.js.map +1 -0
- package/esm/use-lunatic/props/propMissingResponse.d.ts +9 -0
- package/esm/use-lunatic/props/propMissingResponse.js +13 -0
- package/esm/use-lunatic/props/propMissingResponse.js.map +1 -0
- package/esm/use-lunatic/props/propOptions.d.ts +37 -0
- package/esm/use-lunatic/props/propOptions.js +75 -0
- package/esm/use-lunatic/props/propOptions.js.map +1 -0
- package/esm/use-lunatic/props/propOptions.spec.d.ts +1 -0
- package/esm/use-lunatic/props/propOptions.spec.js +57 -0
- package/esm/use-lunatic/props/propOptions.spec.js.map +1 -0
- package/esm/use-lunatic/props/propValue.d.ts +6 -0
- package/esm/use-lunatic/props/propValue.js +29 -0
- package/esm/use-lunatic/props/propValue.js.map +1 -0
- package/esm/use-lunatic/props/propValue.spec.d.ts +1 -0
- package/esm/use-lunatic/props/propValue.spec.js +54 -0
- package/esm/use-lunatic/props/propValue.spec.js.map +1 -0
- package/esm/use-lunatic/reducer/commons/auto-explore-loop.d.ts +5 -0
- package/esm/use-lunatic/reducer/commons/auto-explore-loop.js +52 -0
- package/esm/use-lunatic/reducer/commons/auto-explore-loop.js.map +1 -0
- package/esm/use-lunatic/reducer/commons/index.d.ts +2 -0
- package/esm/use-lunatic/reducer/commons/index.js +3 -0
- package/esm/use-lunatic/reducer/commons/index.js.map +1 -0
- package/esm/use-lunatic/reducer/commons/resize-array-variable.d.ts +5 -0
- package/esm/use-lunatic/reducer/commons/resize-array-variable.js +21 -0
- package/esm/use-lunatic/reducer/commons/resize-array-variable.js.map +1 -0
- package/esm/use-lunatic/reducer/commons/validate-condition-filter.d.ts +6 -0
- package/esm/use-lunatic/reducer/commons/validate-condition-filter.js +12 -0
- package/esm/use-lunatic/reducer/commons/validate-condition-filter.js.map +1 -0
- package/esm/use-lunatic/reducer/controls/check-base-control.d.ts +2 -0
- package/esm/use-lunatic/reducer/controls/check-base-control.js +35 -0
- package/esm/use-lunatic/reducer/controls/check-base-control.js.map +1 -0
- package/esm/use-lunatic/reducer/controls/check-roundabout-control.d.ts +9 -0
- package/esm/use-lunatic/reducer/controls/check-roundabout-control.js +22 -0
- package/esm/use-lunatic/reducer/controls/check-roundabout-control.js.map +1 -0
- package/esm/use-lunatic/reducer/overview/overviewOnInit.d.ts +6 -0
- package/esm/use-lunatic/reducer/overview/overviewOnInit.js +50 -0
- package/esm/use-lunatic/reducer/overview/overviewOnInit.js.map +1 -0
- package/esm/use-lunatic/reducer/reduce-go-next-page.d.ts +2 -0
- package/esm/use-lunatic/reducer/reduce-go-next-page.js +62 -0
- package/esm/use-lunatic/reducer/reduce-go-next-page.js.map +1 -0
- package/esm/use-lunatic/reducer/reduce-go-previous-page.d.ts +2 -0
- package/esm/use-lunatic/reducer/reduce-go-previous-page.js +31 -0
- package/esm/use-lunatic/reducer/reduce-go-previous-page.js.map +1 -0
- package/esm/use-lunatic/reducer/reduce-go-to-page.d.ts +3 -0
- package/esm/use-lunatic/reducer/reduce-go-to-page.js +55 -0
- package/esm/use-lunatic/reducer/reduce-go-to-page.js.map +1 -0
- package/esm/use-lunatic/reducer/reduce-handle-changes.d.ts +6 -0
- package/esm/use-lunatic/reducer/reduce-handle-changes.js +26 -0
- package/esm/use-lunatic/reducer/reduce-handle-changes.js.map +1 -0
- package/esm/use-lunatic/reducer/reducer.d.ts +3 -0
- package/esm/use-lunatic/reducer/reducer.js +20 -0
- package/esm/use-lunatic/reducer/reducer.js.map +1 -0
- package/esm/use-lunatic/reducer/reducerInitializer.d.ts +14 -0
- package/esm/use-lunatic/reducer/reducerInitializer.js +130 -0
- package/esm/use-lunatic/reducer/reducerInitializer.js.map +1 -0
- package/esm/use-lunatic/replace-component-sequence.d.ts +36 -0
- package/esm/use-lunatic/replace-component-sequence.js +19 -0
- package/esm/use-lunatic/replace-component-sequence.js.map +1 -0
- package/esm/use-lunatic/type.d.ts +166 -0
- package/esm/use-lunatic/type.js +2 -0
- package/esm/use-lunatic/type.js.map +1 -0
- package/esm/use-lunatic/use-lunatic.d.ts +37 -0
- package/esm/use-lunatic/use-lunatic.js +140 -0
- package/esm/use-lunatic/use-lunatic.js.map +1 -0
- package/esm/utils/array.d.ts +32 -0
- package/esm/utils/array.js +107 -0
- package/esm/utils/array.js.map +1 -0
- package/esm/utils/array.spec.d.ts +1 -0
- package/esm/utils/array.spec.js +42 -0
- package/esm/utils/array.spec.js.map +1 -0
- package/esm/utils/constants/alphabet.d.ts +1 -0
- package/esm/utils/constants/alphabet.js +2 -0
- package/esm/utils/constants/alphabet.js.map +1 -0
- package/esm/utils/constants/features.d.ts +4 -0
- package/esm/utils/constants/features.js +5 -0
- package/esm/utils/constants/features.js.map +1 -0
- package/esm/utils/constants/index.d.ts +5 -0
- package/esm/utils/constants/index.js +6 -0
- package/esm/utils/constants/index.js.map +1 -0
- package/esm/utils/constants/links.d.ts +2 -0
- package/esm/utils/constants/links.js +3 -0
- package/esm/utils/constants/links.js.map +1 -0
- package/esm/utils/constants/missing.d.ts +2 -0
- package/esm/utils/constants/missing.js +3 -0
- package/esm/utils/constants/missing.js.map +1 -0
- package/esm/utils/constants/variable-status.d.ts +5 -0
- package/esm/utils/constants/variable-status.js +6 -0
- package/esm/utils/constants/variable-status.js.map +1 -0
- package/esm/utils/constants/variable-types.d.ts +1 -0
- package/esm/utils/constants/variable-types.js +2 -0
- package/esm/utils/constants/variable-types.js.map +1 -0
- package/esm/utils/dom.d.ts +14 -0
- package/esm/utils/dom.js +23 -0
- package/esm/utils/dom.js.map +1 -0
- package/esm/utils/env.d.ts +1 -0
- package/esm/utils/env.js +13 -0
- package/esm/utils/env.js.map +1 -0
- package/esm/utils/function.d.ts +5 -0
- package/esm/utils/function.js +23 -0
- package/esm/utils/function.js.map +1 -0
- package/esm/utils/is-element.d.ts +3 -0
- package/esm/utils/is-element.js +6 -0
- package/esm/utils/is-element.js.map +1 -0
- package/esm/utils/is-object.d.ts +4 -0
- package/esm/utils/is-object.js +7 -0
- package/esm/utils/is-object.js.map +1 -0
- package/esm/utils/logger.d.ts +6 -0
- package/esm/utils/logger.js +15 -0
- package/esm/utils/logger.js.map +1 -0
- package/esm/utils/number.d.ts +9 -0
- package/esm/utils/number.js +32 -0
- package/esm/utils/number.js.map +1 -0
- package/esm/utils/number.spec.d.ts +1 -0
- package/esm/utils/number.spec.js +10 -0
- package/esm/utils/number.spec.js.map +1 -0
- package/esm/utils/object.d.ts +6 -0
- package/esm/utils/object.js +27 -0
- package/esm/utils/object.js.map +1 -0
- package/esm/utils/search/SearchInterface.d.ts +12 -0
- package/esm/utils/search/SearchInterface.js +2 -0
- package/esm/utils/search/SearchInterface.js.map +1 -0
- package/esm/utils/search/SearchMinisearch.d.ts +11 -0
- package/esm/utils/search/SearchMinisearch.js +39 -0
- package/esm/utils/search/SearchMinisearch.js.map +1 -0
- package/esm/utils/search/SuggestersDatabase.d.ts +15 -0
- package/esm/utils/search/SuggestersDatabase.js +38 -0
- package/esm/utils/search/SuggestersDatabase.js.map +1 -0
- package/esm/utils/search/melauto.d.ts +15 -0
- package/esm/utils/search/melauto.js +44 -0
- package/esm/utils/search/melauto.js.map +1 -0
- package/esm/utils/search/tokenizer.d.ts +14 -0
- package/esm/utils/search/tokenizer.js +57 -0
- package/esm/utils/search/tokenizer.js.map +1 -0
- package/esm/utils/to-number.d.ts +4 -0
- package/esm/utils/to-number.js +13 -0
- package/esm/utils/to-number.js.map +1 -0
- package/esm/utils/variables.d.ts +5 -0
- package/esm/utils/variables.js +21 -0
- package/esm/utils/variables.js.map +1 -0
- package/esm/utils/variables.spec.d.ts +1 -0
- package/esm/utils/variables.spec.js +83 -0
- package/esm/utils/variables.spec.js.map +1 -0
- package/esm/utils/vtl.d.ts +14 -0
- package/esm/utils/vtl.js +93 -0
- package/esm/utils/vtl.js.map +1 -0
- package/package.json +750 -2
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { LunaticComponentDefinition } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* Pour le Question : les composants du fieldset n'existe pas dans pages.
|
|
4
|
+
* Ils échappent donc aux controls. On les substitue ici au Question.
|
|
5
|
+
* On ne peut pas les ajouter directement dans pages (en spécifiant un page), car ils s'afficheraient 2 fois : dans le fieldset et en dessus, comme
|
|
6
|
+
* des composant à part entière.
|
|
7
|
+
* D'autres composant pourraient un jour figurer ici.
|
|
8
|
+
*/
|
|
9
|
+
export declare function replaceComponentSequence(components: Array<LunaticComponentDefinition>): (import("../type.source").ComponentInputDefinition | import("../type.source").ComponentSequenceDefinition | import("../type.source").ComponentRoundaboutDefinition | ({
|
|
10
|
+
componentType: "Loop";
|
|
11
|
+
loopDependencies?: string[];
|
|
12
|
+
} & import("../type.source").ComponentDefinitionBase & {
|
|
13
|
+
components: import("../type.source").ComponentDefinitionWithPage[];
|
|
14
|
+
iterations: import("../type.source").VTLScalarExpression;
|
|
15
|
+
maxPage: string;
|
|
16
|
+
paginatedLoop: true;
|
|
17
|
+
}) | ({
|
|
18
|
+
componentType: "Loop";
|
|
19
|
+
loopDependencies?: string[];
|
|
20
|
+
} & import("../type.source").ComponentDefinitionBase & {
|
|
21
|
+
paginatedLoop: false;
|
|
22
|
+
components: import("../type.source").ComponentDefinition[];
|
|
23
|
+
} & {
|
|
24
|
+
lines: {
|
|
25
|
+
min: import("../type.source").VTLExpression;
|
|
26
|
+
max: import("../type.source").VTLExpression;
|
|
27
|
+
};
|
|
28
|
+
}) | ({
|
|
29
|
+
componentType: "Loop";
|
|
30
|
+
loopDependencies?: string[];
|
|
31
|
+
} & import("../type.source").ComponentDefinitionBase & {
|
|
32
|
+
paginatedLoop: false;
|
|
33
|
+
components: import("../type.source").ComponentDefinition[];
|
|
34
|
+
} & {
|
|
35
|
+
iterations: import("../type.source").VTLExpression;
|
|
36
|
+
}) | import("../type.source").ComponentRosterForLoopDefinition | import("../type.source").ComponentTableDefinition | import("../type.source").ComponentNumberDefinition | import("../type.source").ComponentDurationDefinition | import("../type.source").ComponentDatePickerDefinition | import("../type.source").ComponentCheckboxGroupDefinition | import("../type.source").ComponentCheckboxBooleanDefinition | import("../type.source").ComponentRadioDefinition | import("../type.source").ComponentDropdownDefinition | import("../type.source").ComponentQuestionDefinition | import("../type.source").ComponentCheckboxOneDefinition | import("../type.source").ComponentSuggesterDefinition | import("../type.source").ComponentPairWiseLinksDefinition | import("../type.source").ComponentSummaryDefinition | import("../type.source").ComponentText | import("../type.source").ComponentAccordion)[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pour le Question : les composants du fieldset n'existe pas dans pages.
|
|
3
|
+
* Ils échappent donc aux controls. On les substitue ici au Question.
|
|
4
|
+
* On ne peut pas les ajouter directement dans pages (en spécifiant un page), car ils s'afficheraient 2 fois : dans le fieldset et en dessus, comme
|
|
5
|
+
* des composant à part entière.
|
|
6
|
+
* D'autres composant pourraient un jour figurer ici.
|
|
7
|
+
*/
|
|
8
|
+
export function replaceComponentSequence(components) {
|
|
9
|
+
return components.reduce(function (acc, component) {
|
|
10
|
+
const { componentType } = component;
|
|
11
|
+
switch (componentType) {
|
|
12
|
+
case 'Question':
|
|
13
|
+
return [...acc, ...component.components];
|
|
14
|
+
default:
|
|
15
|
+
return [...acc, component];
|
|
16
|
+
}
|
|
17
|
+
}, []);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=replace-component-sequence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace-component-sequence.js","sourceRoot":"","sources":["../../src/use-lunatic/replace-component-sequence.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACvC,UAA6C;IAE7C,OAAO,UAAU,CAAC,MAAM,CAAC,UACxB,GAAsC,EACtC,SAAS;QAET,MAAM,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;QACpC,QAAQ,aAAa,EAAE,CAAC;YACvB,KAAK,UAAU;gBACd,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;YAC1C;gBACC,OAAO,CAAC,GAAG,GAAG,EAAE,SAAS,CAAC,CAAC;QAC7B,CAAC;IACF,CAAC,EAAE,EAAE,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { FunctionComponent, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import type { ComponentDefinition, ControlDefinition, LunaticSource, SuggesterDefinition, Variable, VTLExpression, VTLScalarExpression } from '../type.source';
|
|
3
|
+
import type { EventArgs as LunaticVariablesStoreEvents, LunaticVariablesStore } from './commons/variables/lunatic-variables-store';
|
|
4
|
+
import type { IndexEntry } from '../utils/search/SearchInterface';
|
|
5
|
+
import type { InterpretedLunaticOverviewItem } from './hooks/useOverview';
|
|
6
|
+
import type { LunaticComponentProps } from '../components/type';
|
|
7
|
+
import type { LunaticLogger } from './logger/type';
|
|
8
|
+
export type { LunaticSource } from '../type.source';
|
|
9
|
+
export type LunaticComponentDefinition<T extends string = string> = ComponentDefinition & {
|
|
10
|
+
componentType: T;
|
|
11
|
+
page?: string;
|
|
12
|
+
};
|
|
13
|
+
export type LunaticControl = ControlDefinition;
|
|
14
|
+
export type LunaticOverviewItem = {
|
|
15
|
+
id: string;
|
|
16
|
+
pageTag: string;
|
|
17
|
+
page: number;
|
|
18
|
+
label: LunaticExpression;
|
|
19
|
+
description: LunaticExpression | undefined;
|
|
20
|
+
type: string;
|
|
21
|
+
conditionFilter?: LunaticExpression;
|
|
22
|
+
iterations?: LunaticExpression;
|
|
23
|
+
};
|
|
24
|
+
export type LunaticSuggester = SuggesterDefinition;
|
|
25
|
+
export type LunaticData = Partial<Record<Exclude<VariableType, 'COLLECTED'>, Record<string, unknown>> & {
|
|
26
|
+
COLLECTED: Record<string, LunaticCollectedValue>;
|
|
27
|
+
}>;
|
|
28
|
+
export type LunaticValues = {
|
|
29
|
+
[variableName: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
export type LunaticError = Pick<ControlDefinition, 'id' | 'criticality' | 'typeOfControl'> & {
|
|
32
|
+
errorMessage: ReactNode;
|
|
33
|
+
};
|
|
34
|
+
export type VariableType = 'COLLECTED' | 'EXTERNAL' | 'CALCULATED';
|
|
35
|
+
export type LunaticExpression = VTLExpression | VTLScalarExpression;
|
|
36
|
+
export type PageTag = `${number}.${number}#${number}` | `${number}`;
|
|
37
|
+
export type LunaticVariable = Variable;
|
|
38
|
+
export type LunaticCollectedValue = Partial<{
|
|
39
|
+
COLLECTED: unknown;
|
|
40
|
+
EDITED: unknown;
|
|
41
|
+
FORCED: unknown;
|
|
42
|
+
INPUTTED: unknown;
|
|
43
|
+
PREVIOUS: unknown;
|
|
44
|
+
}>;
|
|
45
|
+
export type LunaticStateVariable = {
|
|
46
|
+
[key in LunaticVariable['variableType']]: {
|
|
47
|
+
type: key;
|
|
48
|
+
value: unknown;
|
|
49
|
+
variable: LunaticVariable & {
|
|
50
|
+
variableType: key;
|
|
51
|
+
};
|
|
52
|
+
CalculatedLinked?: LunaticVariable[];
|
|
53
|
+
};
|
|
54
|
+
}[LunaticVariable['variableType']];
|
|
55
|
+
export type LunaticPager = {
|
|
56
|
+
lastReachedPage?: PageTag;
|
|
57
|
+
maxPage: number;
|
|
58
|
+
nbSubPages?: number;
|
|
59
|
+
page: number;
|
|
60
|
+
subPage?: number;
|
|
61
|
+
iteration?: number;
|
|
62
|
+
nbIterations?: number;
|
|
63
|
+
shallowIteration?: number;
|
|
64
|
+
linksIterations?: number[];
|
|
65
|
+
};
|
|
66
|
+
export type LunaticReducerState = {
|
|
67
|
+
variables: LunaticVariablesStore;
|
|
68
|
+
overview: LunaticOverviewItem[];
|
|
69
|
+
previousPager: LunaticPager;
|
|
70
|
+
pager: LunaticPager;
|
|
71
|
+
pages: {
|
|
72
|
+
[key: number | string]: {
|
|
73
|
+
components: LunaticSource['components'];
|
|
74
|
+
isLoop: false;
|
|
75
|
+
iterations?: undefined;
|
|
76
|
+
loopDependencies?: undefined;
|
|
77
|
+
subPages?: undefined;
|
|
78
|
+
} | {
|
|
79
|
+
components: LunaticSource['components'];
|
|
80
|
+
isLoop: true;
|
|
81
|
+
iterations: VTLScalarExpression;
|
|
82
|
+
loopDependencies: string[];
|
|
83
|
+
subPages: string[];
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
executeExpression: <T = unknown>(expression: VTLExpression, args?: {
|
|
87
|
+
iteration?: number | number[];
|
|
88
|
+
bindingDependencies?: string[];
|
|
89
|
+
deps?: string[];
|
|
90
|
+
}) => T;
|
|
91
|
+
isInLoop: boolean;
|
|
92
|
+
updatedAt: number;
|
|
93
|
+
updateBindings: (variableName: string, value: unknown, options: {
|
|
94
|
+
iteration?: number[];
|
|
95
|
+
}) => unknown;
|
|
96
|
+
};
|
|
97
|
+
export type LunaticOptions = {
|
|
98
|
+
features?: ('MD' | 'VTL')[];
|
|
99
|
+
preferences?: ['COLLECTED'];
|
|
100
|
+
savingType?: 'COLLECTED';
|
|
101
|
+
onChange?: LunaticChangesHandler;
|
|
102
|
+
onVariableChange?: (event: LunaticVariablesStoreEvents['change']) => void;
|
|
103
|
+
management?: boolean;
|
|
104
|
+
shortcut?: boolean;
|
|
105
|
+
initialPage?: PageTag;
|
|
106
|
+
lastReachedPage?: PageTag;
|
|
107
|
+
autoSuggesterLoading?: boolean;
|
|
108
|
+
getReferentiel?: (name: string) => Promise<Array<IndexEntry>>;
|
|
109
|
+
activeControls?: boolean;
|
|
110
|
+
withOverview?: boolean;
|
|
111
|
+
missing?: boolean;
|
|
112
|
+
missingStrategy?: () => void;
|
|
113
|
+
missingShortcut?: {
|
|
114
|
+
dontKnow: string;
|
|
115
|
+
refused: string;
|
|
116
|
+
};
|
|
117
|
+
dontKnowButton?: string;
|
|
118
|
+
refusedButton?: string;
|
|
119
|
+
trackChanges?: boolean;
|
|
120
|
+
logger?: LunaticLogger;
|
|
121
|
+
};
|
|
122
|
+
export type LunaticState = {
|
|
123
|
+
pager: LunaticPager;
|
|
124
|
+
overview: InterpretedLunaticOverviewItem[];
|
|
125
|
+
pageTag: PageTag;
|
|
126
|
+
updatedAt: number;
|
|
127
|
+
Provider: FunctionComponent<PropsWithChildren>;
|
|
128
|
+
isInLoop: boolean;
|
|
129
|
+
loopVariables: string[];
|
|
130
|
+
isFirstPage: boolean;
|
|
131
|
+
isLastPage: boolean;
|
|
132
|
+
errors?: {
|
|
133
|
+
[page: string]: {
|
|
134
|
+
[id: string]: LunaticError[];
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
currentErrors?: {
|
|
138
|
+
[id: string]: LunaticError[];
|
|
139
|
+
};
|
|
140
|
+
modalErrors?: Record<string, LunaticError[]>;
|
|
141
|
+
goToPage: (page: {
|
|
142
|
+
page: PageTag | number;
|
|
143
|
+
iteration?: number;
|
|
144
|
+
nbIterations?: number;
|
|
145
|
+
subPage?: number;
|
|
146
|
+
}) => void;
|
|
147
|
+
goNextPage: () => void;
|
|
148
|
+
goPreviousPage: () => void;
|
|
149
|
+
compileControls: () => {
|
|
150
|
+
currentErrors: Record<string, LunaticError[]> | undefined;
|
|
151
|
+
isCritical: boolean;
|
|
152
|
+
};
|
|
153
|
+
getComponents: () => LunaticComponentProps[];
|
|
154
|
+
getData: (withRefreshedCalculated: boolean, variableNames?: string[]) => LunaticData;
|
|
155
|
+
getChangedData: (reset: boolean) => LunaticData;
|
|
156
|
+
resetChangedData: () => void;
|
|
157
|
+
hasPageResponse: () => boolean;
|
|
158
|
+
testing: {
|
|
159
|
+
handleChanges: LunaticChangesHandler;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
export type LunaticChangesHandler = (args: {
|
|
163
|
+
name: string;
|
|
164
|
+
value: any;
|
|
165
|
+
iteration?: number[];
|
|
166
|
+
}[]) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/use-lunatic/type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { LunaticChangesHandler, LunaticData, LunaticOptions, PageTag } from './type';
|
|
2
|
+
import type { LunaticSource } from './type';
|
|
3
|
+
export declare function useLunatic(source: LunaticSource, data?: LunaticData, argOptions?: LunaticOptions): {
|
|
4
|
+
pageTag: PageTag;
|
|
5
|
+
isFirstPage: boolean;
|
|
6
|
+
isLastPage: boolean;
|
|
7
|
+
updatedAt: number;
|
|
8
|
+
pager: import("./type").LunaticPager;
|
|
9
|
+
isInLoop: boolean;
|
|
10
|
+
overview: import("./hooks/useOverview").InterpretedLunaticOverviewItem[];
|
|
11
|
+
loopVariables: string[];
|
|
12
|
+
getComponents: () => import("..").LunaticComponentProps[];
|
|
13
|
+
goPreviousPage: () => void;
|
|
14
|
+
goNextPage: () => void;
|
|
15
|
+
goToPage: (page: {
|
|
16
|
+
page: PageTag | number;
|
|
17
|
+
iteration?: number;
|
|
18
|
+
nbIterations?: number;
|
|
19
|
+
subPage?: number;
|
|
20
|
+
}) => void;
|
|
21
|
+
compileControls: () => {
|
|
22
|
+
currentErrors: Record<string, import("./type").LunaticError[]> | undefined;
|
|
23
|
+
isCritical: boolean;
|
|
24
|
+
};
|
|
25
|
+
getData: (withRefreshedCalculated: boolean, variableNames?: string[]) => LunaticData;
|
|
26
|
+
getChangedData: (reset?: boolean) => Partial<Record<"EXTERNAL" | "CALCULATED", Record<string, unknown>> & {
|
|
27
|
+
COLLECTED: Record<string, import("./type").LunaticCollectedValue>;
|
|
28
|
+
}>;
|
|
29
|
+
resetChangedData: () => void;
|
|
30
|
+
hasPageResponse: () => boolean;
|
|
31
|
+
Provider: import("react").FunctionComponent<{
|
|
32
|
+
children?: import("react").ReactNode | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
testing: {
|
|
35
|
+
handleChanges: LunaticChangesHandler;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { useCallback, useMemo, useReducer } from 'react';
|
|
2
|
+
import { goToPageAction, goNextPageAction, goPreviousPageAction, handleChangesAction, } from './actions';
|
|
3
|
+
import { getPageTag, isFirstLastPage } from './commons';
|
|
4
|
+
import D from '../i18n';
|
|
5
|
+
import { COLLECTED } from '../utils/constants';
|
|
6
|
+
import { createLunaticProvider } from './lunatic-context';
|
|
7
|
+
import { compileControls as compileControlsLib } from './commons/compile-controls';
|
|
8
|
+
import { useLoopVariables } from './hooks/use-loop-variables';
|
|
9
|
+
import { getQuestionnaireData } from './commons/variables/get-questionnaire-data';
|
|
10
|
+
import { useTrackChanges } from '../hooks/use-track-changes';
|
|
11
|
+
import { usePageHasResponse } from './hooks/use-page-has-response';
|
|
12
|
+
import { useOverview } from './hooks/useOverview';
|
|
13
|
+
import { reducerInitializer } from './reducer/reducerInitializer';
|
|
14
|
+
import { getComponentsFromState } from './commons/get-components-from-state';
|
|
15
|
+
import { fillComponents } from './commons/fill-components/fill-components';
|
|
16
|
+
import { reducer } from './reducer/reducer';
|
|
17
|
+
import { mergeDefault } from '../utils/object';
|
|
18
|
+
import { useRefSync } from '../hooks/useRefSync';
|
|
19
|
+
import { ConsoleLogger } from './logger/ConsoleLogger';
|
|
20
|
+
import { useWarnDepChange } from './hooks/useWarnDepChange';
|
|
21
|
+
const empty = {}; // Keep the same empty object (to avoid problem with useEffect dependencies)
|
|
22
|
+
const DEFAULT_DATA = empty;
|
|
23
|
+
const DEFAULT_FEATURES = ['VTL', 'MD'];
|
|
24
|
+
const DEFAULT_PREFERENCES = [COLLECTED];
|
|
25
|
+
const DEFAULT_SHORTCUT = { dontKnow: '', refused: '' };
|
|
26
|
+
const DEFAULT_DONT_KNOW = D.DK;
|
|
27
|
+
const DEFAULT_REFUSED = D.RF;
|
|
28
|
+
const defaultOptions = {
|
|
29
|
+
features: DEFAULT_FEATURES,
|
|
30
|
+
preferences: DEFAULT_PREFERENCES,
|
|
31
|
+
savingType: COLLECTED,
|
|
32
|
+
onChange: () => { },
|
|
33
|
+
onVariableChange: () => { },
|
|
34
|
+
management: false,
|
|
35
|
+
shortcut: false,
|
|
36
|
+
initialPage: '1',
|
|
37
|
+
lastReachedPage: undefined,
|
|
38
|
+
autoSuggesterLoading: false,
|
|
39
|
+
activeControls: false,
|
|
40
|
+
// Calculate an overview of every sequence (will be exposed as "overview")
|
|
41
|
+
withOverview: false,
|
|
42
|
+
missing: false,
|
|
43
|
+
missingStrategy: () => { },
|
|
44
|
+
missingShortcut: DEFAULT_SHORTCUT,
|
|
45
|
+
dontKnowButton: DEFAULT_DONT_KNOW,
|
|
46
|
+
refusedButton: DEFAULT_REFUSED,
|
|
47
|
+
trackChanges: false,
|
|
48
|
+
logger: ConsoleLogger,
|
|
49
|
+
};
|
|
50
|
+
export function useLunatic(source, data = DEFAULT_DATA, argOptions = empty) {
|
|
51
|
+
const options = mergeDefault(argOptions, defaultOptions);
|
|
52
|
+
const { management, missing, missingStrategy, shortcut, missingShortcut, dontKnowButton, refusedButton, onChange, trackChanges, preferences, logger, } = options;
|
|
53
|
+
// Help debug with warnings for options expected to be memoized
|
|
54
|
+
useWarnDepChange(logger, "'logger' option should not change between render", logger);
|
|
55
|
+
const [state, dispatch] = useReducer(reducer, {
|
|
56
|
+
...options,
|
|
57
|
+
source,
|
|
58
|
+
data,
|
|
59
|
+
onVariableChange: useRefSync(options.onVariableChange),
|
|
60
|
+
}, reducerInitializer);
|
|
61
|
+
// Required context provider: cleaner than prop drilling through every component
|
|
62
|
+
const Provider = useMemo(() => createLunaticProvider({
|
|
63
|
+
management,
|
|
64
|
+
missing,
|
|
65
|
+
missingStrategy,
|
|
66
|
+
shortcut,
|
|
67
|
+
missingShortcut,
|
|
68
|
+
dontKnowButton,
|
|
69
|
+
refusedButton,
|
|
70
|
+
}), [
|
|
71
|
+
management,
|
|
72
|
+
missing,
|
|
73
|
+
missingStrategy,
|
|
74
|
+
shortcut,
|
|
75
|
+
missingShortcut,
|
|
76
|
+
dontKnowButton,
|
|
77
|
+
refusedButton,
|
|
78
|
+
]);
|
|
79
|
+
const compileControls = () => {
|
|
80
|
+
return compileControlsLib(state);
|
|
81
|
+
};
|
|
82
|
+
const goPreviousPage = useCallback(function () {
|
|
83
|
+
dispatch(goPreviousPageAction());
|
|
84
|
+
}, [dispatch]);
|
|
85
|
+
const goNextPage = useCallback(function (payload = {}) {
|
|
86
|
+
dispatch(goNextPageAction(payload));
|
|
87
|
+
}, [dispatch]);
|
|
88
|
+
const goToPage = useCallback(function (payload) {
|
|
89
|
+
dispatch(goToPageAction(payload));
|
|
90
|
+
}, [dispatch]);
|
|
91
|
+
const handleChanges = useCallback((responses) => {
|
|
92
|
+
dispatch(handleChangesAction(responses));
|
|
93
|
+
onChange(responses);
|
|
94
|
+
}, [dispatch, onChange]);
|
|
95
|
+
const getData = (withRefreshedCalculated, variableNames) => {
|
|
96
|
+
return getQuestionnaireData(state.variables, source.variables, withRefreshedCalculated, variableNames);
|
|
97
|
+
};
|
|
98
|
+
const { resetChangedData, getChangedData } = useTrackChanges(trackChanges, state.variables, (variableNames) => getData(false, variableNames));
|
|
99
|
+
const pageTag = getPageTag(state.pager);
|
|
100
|
+
const { isFirstPage, isLastPage } = isFirstLastPage(state.pager);
|
|
101
|
+
const components = fillComponents(getComponentsFromState(state), {
|
|
102
|
+
handleChanges,
|
|
103
|
+
preferences,
|
|
104
|
+
goToPage,
|
|
105
|
+
shortcut,
|
|
106
|
+
goNextPage,
|
|
107
|
+
goPreviousPage,
|
|
108
|
+
management,
|
|
109
|
+
...state,
|
|
110
|
+
});
|
|
111
|
+
const getComponents = () => {
|
|
112
|
+
return components;
|
|
113
|
+
};
|
|
114
|
+
return {
|
|
115
|
+
pageTag,
|
|
116
|
+
isFirstPage,
|
|
117
|
+
isLastPage,
|
|
118
|
+
updatedAt: state.updatedAt,
|
|
119
|
+
pager: state.pager,
|
|
120
|
+
isInLoop: state.isInLoop,
|
|
121
|
+
overview: useOverview(state, [pageTag]),
|
|
122
|
+
loopVariables: useLoopVariables(state.pager, state.pages),
|
|
123
|
+
// Methods
|
|
124
|
+
getComponents,
|
|
125
|
+
goPreviousPage,
|
|
126
|
+
goNextPage,
|
|
127
|
+
goToPage,
|
|
128
|
+
compileControls,
|
|
129
|
+
getData,
|
|
130
|
+
getChangedData,
|
|
131
|
+
resetChangedData,
|
|
132
|
+
hasPageResponse: usePageHasResponse(components, state.executeExpression),
|
|
133
|
+
// Components
|
|
134
|
+
Provider,
|
|
135
|
+
testing: {
|
|
136
|
+
handleChanges,
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=use-lunatic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-lunatic.js","sourceRoot":"","sources":["../../src/use-lunatic/use-lunatic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAQxD,OAAO,CAAC,MAAM,SAAS,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UA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C,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC;QACvC,aAAa,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;QACzD,UAAU;QACV,aAAa;QACb,cAAc;QACd,UAAU;QACV,QAAQ;QACR,eAAe;QACf,OAAO;QACP,cAAc;QACd,gBAAgB;QAChB,eAAe,EAAE,kBAAkB,CAAC,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC;QACxE,aAAa;QACb,QAAQ;QACR,OAAO,EAAE;YACR,aAAa;SACb;KACsB,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Call a callback x times
|
|
3
|
+
*/
|
|
4
|
+
export declare function times<T>(n: number, cb: (k: number) => T): T[];
|
|
5
|
+
/**
|
|
6
|
+
* Update an item in an array without mutating the array
|
|
7
|
+
*/
|
|
8
|
+
export declare function setAtIndex<T>(arr: T, index: number | number[], newValue: unknown): T;
|
|
9
|
+
/**
|
|
10
|
+
* Get a value inside an array
|
|
11
|
+
*/
|
|
12
|
+
export declare function getAtIndex(arr: unknown, indexes: number[]): unknown;
|
|
13
|
+
export declare function resizeArray<T = unknown>(array: unknown, newLength: number, defaultValue?: T): T[];
|
|
14
|
+
/**
|
|
15
|
+
* Return the first non-null/undefined value of an array
|
|
16
|
+
*/
|
|
17
|
+
export declare function firstValueItem<T = unknown>(items: T | T[]): T | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Return a list of partial array
|
|
20
|
+
*
|
|
21
|
+
* Example :
|
|
22
|
+
* - subArray([1, 2, 3]) // [[1], [1, 2], [1, 2, 3]]
|
|
23
|
+
*/
|
|
24
|
+
export declare function subArrays<T = unknown>(items: T[] | T): T[][];
|
|
25
|
+
/**
|
|
26
|
+
* Calculates the depth of an array
|
|
27
|
+
*/
|
|
28
|
+
export declare function depth(arr: unknown, base?: number): number;
|
|
29
|
+
/**
|
|
30
|
+
* Find the longest array from a list of arrays
|
|
31
|
+
*/
|
|
32
|
+
export declare function findLongest<T>(arr: T[]): T;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Call a callback x times
|
|
3
|
+
*/
|
|
4
|
+
export function times(n, cb) {
|
|
5
|
+
return new Array(n).fill(null).map((_, k) => cb(k));
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Update an item in an array without mutating the array
|
|
9
|
+
*/
|
|
10
|
+
export function setAtIndex(arr, index, newValue) {
|
|
11
|
+
if (!Array.isArray(index)) {
|
|
12
|
+
return setAtIndex(arr, [index], newValue);
|
|
13
|
+
}
|
|
14
|
+
const [currentIndex, ...restIndex] = index;
|
|
15
|
+
let newArray = Array.isArray(arr) ? [...arr] : [arr];
|
|
16
|
+
if (newArray.length < currentIndex + 1) {
|
|
17
|
+
newArray = resizeArray(newArray, currentIndex + 1, null);
|
|
18
|
+
}
|
|
19
|
+
newArray[currentIndex] =
|
|
20
|
+
restIndex.length === 0
|
|
21
|
+
? newValue
|
|
22
|
+
: setAtIndex(newArray[currentIndex], restIndex, newValue);
|
|
23
|
+
return newArray;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get a value inside an array
|
|
27
|
+
*/
|
|
28
|
+
export function getAtIndex(arr, indexes) {
|
|
29
|
+
let current = arr;
|
|
30
|
+
if (!Array.isArray(current)) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
for (const index of indexes) {
|
|
34
|
+
if (index < 0 || index >= current.length) {
|
|
35
|
+
return undefined; // Index out of bounds, return undefined
|
|
36
|
+
}
|
|
37
|
+
current = current[index];
|
|
38
|
+
}
|
|
39
|
+
return current;
|
|
40
|
+
}
|
|
41
|
+
export function resizeArray(array, newLength, defaultValue) {
|
|
42
|
+
// The value is not an array, create an empty array
|
|
43
|
+
if (!Array.isArray(array)) {
|
|
44
|
+
return new Array(newLength).fill(defaultValue !== null && defaultValue !== void 0 ? defaultValue : null);
|
|
45
|
+
}
|
|
46
|
+
if (array.length === newLength) {
|
|
47
|
+
return array;
|
|
48
|
+
}
|
|
49
|
+
return new Array(newLength).fill(defaultValue !== null && defaultValue !== void 0 ? defaultValue : null).map(function (value, index) {
|
|
50
|
+
return index < array.length ? array[index] : value;
|
|
51
|
+
}, []);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Return the first non-null/undefined value of an array
|
|
55
|
+
*/
|
|
56
|
+
export function firstValueItem(items) {
|
|
57
|
+
if (!Array.isArray(items)) {
|
|
58
|
+
return items;
|
|
59
|
+
}
|
|
60
|
+
return items.find((v) => v !== undefined && v !== null);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Return a list of partial array
|
|
64
|
+
*
|
|
65
|
+
* Example :
|
|
66
|
+
* - subArray([1, 2, 3]) // [[1], [1, 2], [1, 2, 3]]
|
|
67
|
+
*/
|
|
68
|
+
export function subArrays(items) {
|
|
69
|
+
if (!Array.isArray(items)) {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
if (items.length === 1) {
|
|
73
|
+
return [items];
|
|
74
|
+
}
|
|
75
|
+
const arrays = [];
|
|
76
|
+
for (let i = 1; i <= items.length; i++) {
|
|
77
|
+
arrays.push(items.slice(0, i));
|
|
78
|
+
}
|
|
79
|
+
return arrays;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Calculates the depth of an array
|
|
83
|
+
*/
|
|
84
|
+
export function depth(arr, base = 0) {
|
|
85
|
+
if (!Array.isArray(arr)) {
|
|
86
|
+
return base;
|
|
87
|
+
}
|
|
88
|
+
return depth(arr[0], base + 1);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Find the longest array from a list of arrays
|
|
92
|
+
*/
|
|
93
|
+
export function findLongest(arr) {
|
|
94
|
+
let longest = arr[0];
|
|
95
|
+
let max = -1;
|
|
96
|
+
for (const item of arr) {
|
|
97
|
+
if (Array.isArray(item) && item.length > max) {
|
|
98
|
+
max = item.length;
|
|
99
|
+
longest = item;
|
|
100
|
+
}
|
|
101
|
+
if (!Array.isArray(item) && max < 0) {
|
|
102
|
+
longest = item;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return longest;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=array.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.js","sourceRoot":"","sources":["../../src/utils/array.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,KAAK,CAAI,CAAS,EAAE,EAAoB;IACvD,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CACzB,GAAM,EACN,KAAwB,EACxB,QAAiB;IAEjB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,GAAG,KAAK,CAAC;IAE3C,IAAI,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACrD,IAAI,QAAQ,CAAC,MAAM,GAAG,YAAY,GAAG,CAAC,EAAE,CAAC;QACxC,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,YAAY,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;IAC1D,CAAC;IACD,QAAQ,CAAC,YAAY,CAAC;QACrB,SAAS,CAAC,MAAM,KAAK,CAAC;YACrB,CAAC,CAAC,Q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rB,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC;IACb,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;QACxB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YAC9C,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;YAClB,OAAO,GAAG,IAAI,CAAC;QAChB,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;YACrC,OAAO,GAAG,IAAI,CAAC;QAChB,CAAC;IACF,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { firstValueItem, resizeArray, setAtIndex } from './array';
|
|
3
|
+
describe('array', () => {
|
|
4
|
+
describe('resizeArray()', () => {
|
|
5
|
+
it('should append new value', () => {
|
|
6
|
+
expect(resizeArray([1, 2], 3, 3)).toEqual([1, 2, 3]);
|
|
7
|
+
expect(resizeArray([1, 2], 4, 3)).toEqual([1, 2, 3, 3]);
|
|
8
|
+
});
|
|
9
|
+
it('should remove value', () => {
|
|
10
|
+
expect(resizeArray([1, 2, 3], 1)).toEqual([1]);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
describe('setAtIndex', () => {
|
|
14
|
+
it('should work with simple index', () => {
|
|
15
|
+
expect(setAtIndex([1, 2, 3], 1, 3)).toEqual([1, 3, 3]);
|
|
16
|
+
});
|
|
17
|
+
it('should work with non array value', () => {
|
|
18
|
+
expect(setAtIndex(null, 1, 3)).toEqual([null, 3]);
|
|
19
|
+
expect(setAtIndex(4, 1, 3)).toEqual([4, 3]);
|
|
20
|
+
});
|
|
21
|
+
it('should work with deep index', () => {
|
|
22
|
+
expect(setAtIndex([
|
|
23
|
+
[1, 2, 3],
|
|
24
|
+
[1, 2, 3],
|
|
25
|
+
[1, 2, 3],
|
|
26
|
+
], [1, 2], 10)).toEqual([
|
|
27
|
+
[1, 2, 3],
|
|
28
|
+
[1, 2, 10],
|
|
29
|
+
[1, 2, 3],
|
|
30
|
+
]);
|
|
31
|
+
});
|
|
32
|
+
it('should work with deep and non array value', () => {
|
|
33
|
+
expect(setAtIndex([null], [1, 2], 10)).toEqual([null, [null, null, 10]]);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
it('firstValueItem', () => {
|
|
37
|
+
expect(firstValueItem([0, 1, 2])).toBe(0);
|
|
38
|
+
expect(firstValueItem([null, 1, 2])).toBe(1);
|
|
39
|
+
expect(firstValueItem([null, undefined, false])).toBe(false);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=array.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.spec.js","sourceRoot":"","sources":["../../src/utils/array.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAElE,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACtB,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;QAC9B,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;YAClC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACrD,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CA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,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;gBACT,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBACV,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;aACT,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;YACpD,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;QACzB,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1C,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const alphabet: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alphabet.js","sourceRoot":"","sources":["../../../src/utils/constants/alphabet.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,4BAA4B,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../../src/utils/constants/features.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,GAAG,GAAG,KAAc,CAAC;AAClC,MAAM,CAAC,MAAM,EAAE,GAAG,IAAa,CAAC;AAChC,MAAM,CAAC,MAAM,GAAG,GAAG,KAAc,CAAC;AAClC,MAAM,CAAC,MAAM,MAAM,GAAG,QAAiB,CAAC"}
|