@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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"links.js","sourceRoot":"","sources":["../../../src/utils/constants/links.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC;AAC9B,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"missing.js","sourceRoot":"","sources":["../../../src/utils/constants/missing.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG,IAAa,CAAC;AAChC,MAAM,CAAC,MAAM,EAAE,GAAG,IAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable-status.js","sourceRoot":"","sources":["../../../src/utils/constants/variable-status.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAmB,CAAC;AAC5C,MAAM,CAAC,MAAM,SAAS,GAAG,WAAoB,CAAC;AAC9C,MAAM,CAAC,MAAM,MAAM,GAAG,QAAiB,CAAC;AACxC,MAAM,CAAC,MAAM,MAAM,GAAG,QAAiB,CAAC;AACxC,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CALCULATED: "CALCULATED";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable-types.js","sourceRoot":"","sources":["../../../src/utils/constants/variable-types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,YAAqB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrap a callback calling preventDefault and stopPropagation on the event before passing it
|
|
3
|
+
*/
|
|
4
|
+
export declare function prevent<T extends {
|
|
5
|
+
preventDefault: () => void;
|
|
6
|
+
stopPropagation: () => void;
|
|
7
|
+
}>(cb?: (e: T) => void): undefined | ((e: T) => void);
|
|
8
|
+
/**
|
|
9
|
+
* Check if an event is within a rectangle
|
|
10
|
+
*/
|
|
11
|
+
export declare function isEventInRect(event: {
|
|
12
|
+
clientX: number;
|
|
13
|
+
clientY: number;
|
|
14
|
+
}, rect: DOMRect): boolean;
|
package/esm/utils/dom.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrap a callback calling preventDefault and stopPropagation on the event before passing it
|
|
3
|
+
*/
|
|
4
|
+
export function prevent(cb) {
|
|
5
|
+
if (!cb) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
return (e) => {
|
|
9
|
+
e.preventDefault();
|
|
10
|
+
e.stopPropagation();
|
|
11
|
+
cb(e);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Check if an event is within a rectangle
|
|
16
|
+
*/
|
|
17
|
+
export function isEventInRect(event, rect) {
|
|
18
|
+
return (rect.top <= event.clientY &&
|
|
19
|
+
event.clientY <= rect.top + rect.height &&
|
|
20
|
+
rect.left <= event.clientX &&
|
|
21
|
+
event.clientX <= rect.left + rect.width);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=dom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,OAAO,CAKrB,EAAmB;IACpB,IAAI,CAAC,EAAE,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,CAAC,CAAC,EAAE,EAAE;QACZ,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,CAAC,CAAC,eAAe,EAAE,CAAC;QACpB,EAAE,CAAC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC5B,KAA2C,EAC3C,IAAa;IAEb,OAAO,CACN,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,OAAO;QACzB,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM;QACvC,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO;QAC1B,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CACvC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isTestEnv(): boolean;
|
package/esm/utils/env.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function isTestEnv() {
|
|
2
|
+
try {
|
|
3
|
+
// using vitest, process.env is defined
|
|
4
|
+
return `${process.env.VITEST}` === 'true';
|
|
5
|
+
}
|
|
6
|
+
catch (_a) {
|
|
7
|
+
// process.env is not defined
|
|
8
|
+
// so we are not running as test so we can return false
|
|
9
|
+
// process.env is not defined during storybook running/
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS;IACxB,IAAI,CAAC;QACJ,uCAAuC;QACvC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,MAAM,CAAC;IAC3C,CAAC;IAAC,WAAM,CAAC;QACR,6BAA6B;QAC7B,uDAAuD;QACvD,uDAAuD;QACvD,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global void function to use as default parameters
|
|
3
|
+
*/
|
|
4
|
+
export declare const voidFunction: () => void;
|
|
5
|
+
export declare function debounce<A extends unknown[], R = void>(fn: (...args: A) => R, ms: number): [(...args: A) => Promise<R extends Promise<infer RR> ? RR : R>, () => void];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global void function to use as default parameters
|
|
3
|
+
*/
|
|
4
|
+
export const voidFunction = () => { };
|
|
5
|
+
export function debounce(fn, ms) {
|
|
6
|
+
let timer;
|
|
7
|
+
const debouncedFunc = (...args) => new Promise((resolve, reject) => {
|
|
8
|
+
if (timer) {
|
|
9
|
+
clearTimeout(timer);
|
|
10
|
+
}
|
|
11
|
+
timer = window.setTimeout(async () => {
|
|
12
|
+
try {
|
|
13
|
+
resolve((await fn(...args)));
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
reject(e);
|
|
17
|
+
}
|
|
18
|
+
}, ms);
|
|
19
|
+
});
|
|
20
|
+
const teardown = () => clearTimeout(timer);
|
|
21
|
+
return [debouncedFunc, teardown];
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function.js","sourceRoot":"","sources":["../../src/utils/function.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAErC,MAAM,UAAU,QAAQ,CACvB,EAAqB,EACrB,EAAU;IAEV,IAAI,KAAa,CAAC;IAElB,MAAM,aAAa,GAAG,CACrB,GAAG,IAAO,EACsC,EAAE,CAClD,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC/B,IAAI,KAAK,EAAE,CAAC;YACX,YAAY,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QAED,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE;YACpC,IAAI,CAAC;gBACJ,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAQ,CAAC,CAAC;YACrC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACZ,MAAM,CAAC,CAAC,CAAC,CAAC;YACX,CAAC;QACF,CAAC,EAAE,EAAE,CAAC,CAAC;IACR,CAAC,CAAC,CAAC;IAEJ,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAE3C,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-element.js","sourceRoot":"","sources":["../../src/utils/is-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AAE1D,SAAS,SAAS,CAAc,OAAgB;IAC/C,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-object.js","sourceRoot":"","sources":["../../src/utils/is-object.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAU;IAClC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class Logger {
|
|
2
|
+
static info(...args) {
|
|
3
|
+
console.info(...args);
|
|
4
|
+
}
|
|
5
|
+
static error(...args) {
|
|
6
|
+
console.error(...args);
|
|
7
|
+
}
|
|
8
|
+
static log(...args) {
|
|
9
|
+
console.log(...args);
|
|
10
|
+
}
|
|
11
|
+
static warn(...args) {
|
|
12
|
+
console.warn(...args);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,MAAM;IAClB,MAAM,CAAC,IAAI,CAAC,GAAG,IAAe;QAC7B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAG,IAAe;QAC9B,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,GAAG,IAAe;QAC5B,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACtB,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,IAAe;QAC7B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,CAAC;CACD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function forceInt(n: unknown): number;
|
|
2
|
+
/**
|
|
3
|
+
* Limit a number between 2 values
|
|
4
|
+
*/
|
|
5
|
+
export declare function between(n: number, min: number, max: number): number;
|
|
6
|
+
/**
|
|
7
|
+
* Check if the value is a number
|
|
8
|
+
*/
|
|
9
|
+
export declare function isNumber(n: unknown): n is number;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function forceInt(n) {
|
|
2
|
+
if (typeof n === 'string') {
|
|
3
|
+
const casted = parseInt(n, 10);
|
|
4
|
+
if (Number.isNaN(casted)) {
|
|
5
|
+
throw new Error(`Cannot cast ${n} to int`);
|
|
6
|
+
}
|
|
7
|
+
return casted;
|
|
8
|
+
}
|
|
9
|
+
if (typeof n === 'number') {
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
throw new Error(`Cannot cast ${typeof n} to int`);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Limit a number between 2 values
|
|
16
|
+
*/
|
|
17
|
+
export function between(n, min, max) {
|
|
18
|
+
if (n < min) {
|
|
19
|
+
return min;
|
|
20
|
+
}
|
|
21
|
+
if (n > max) {
|
|
22
|
+
return max;
|
|
23
|
+
}
|
|
24
|
+
return n;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check if the value is a number
|
|
28
|
+
*/
|
|
29
|
+
export function isNumber(n) {
|
|
30
|
+
return typeof n === 'number' && Number.isFinite(n);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.js","sourceRoot":"","sources":["../../src/utils/number.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAC,CAAU;IAClC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/B,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,CAAC,CAAC;IACV,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,eAAe,OAAO,CAAC,SAAS,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,CAAS,EAAE,GAAW,EAAE,GAAW;IAC1D,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACb,OAAO,GAAG,CAAC;IACZ,CAAC;IACD,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACb,OAAO,GAAG,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAU;IAClC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { between } from './number';
|
|
3
|
+
describe('between', () => {
|
|
4
|
+
it('should work', () => {
|
|
5
|
+
expect(between(0, -5, 100)).toBe(0);
|
|
6
|
+
expect(between(1000, -5, 100)).toBe(100);
|
|
7
|
+
expect(between(-23.22, -5, 100)).toBe(-5);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=number.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.spec.js","sourceRoot":"","sources":["../../src/utils/number.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;QACtB,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Array.map() but for objet
|
|
3
|
+
*/
|
|
4
|
+
export declare function objectMap<T extends Record<string, any>, V>(object: T, callback: (k: keyof T, v: T[keyof T]) => [k: keyof T, v: V] | null): Record<keyof T, V>;
|
|
5
|
+
export declare function objectKeys<T extends Record<string, unknown>>(object: T): (keyof T)[];
|
|
6
|
+
export declare function mergeDefault<T extends Record<string, unknown>, D extends Record<string, unknown>>(obj: T, defaults: D): T & D;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Array.map() but for objet
|
|
3
|
+
*/
|
|
4
|
+
export function objectMap(object, callback) {
|
|
5
|
+
return Object.entries(object).reduce((acc, [k, v]) => {
|
|
6
|
+
const result = callback(k, v);
|
|
7
|
+
if (!Array.isArray(result)) {
|
|
8
|
+
return acc;
|
|
9
|
+
}
|
|
10
|
+
const [key, value] = result;
|
|
11
|
+
acc[key] = value;
|
|
12
|
+
return acc;
|
|
13
|
+
}, {});
|
|
14
|
+
}
|
|
15
|
+
// Adds the possibility of preserving the original type of the object's keys.
|
|
16
|
+
// The native function produces an array of strings. (Object.keys)
|
|
17
|
+
export function objectKeys(object) {
|
|
18
|
+
return Object.keys(object);
|
|
19
|
+
}
|
|
20
|
+
export function mergeDefault(obj, defaults) {
|
|
21
|
+
return objectMap({ ...obj, ...defaults }, (k) => {
|
|
22
|
+
var _a;
|
|
23
|
+
// @ts-expect-error Ignore this line since TS is not able to handle this case
|
|
24
|
+
return [k, (_a = obj[k]) !== null && _a !== void 0 ? _a : defaults[k]];
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,SAAS,CACxB,MAAS,EACT,QAAkE;IAElE,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CACnC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QACf,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,OAAO,GAAG,CAAC;QACZ,CAAC;QACD,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,MAAM,CAAC;QAC5B,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACjB,OAAO,GAAG,CAAC;IACZ,CAAC,EACD,EAAwB,CACxB,CAAC;AACH,CAAC;AACD,6EAA6E;AAC7E,kEAAkE;AAClE,MAAM,UAAU,UAAU,CAAoC,MAAS;IACtE,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAgB,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,YAAY,CAG1B,GAAM,EAAE,QAAW;IACpB,OAAO,SAAS,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE;;QAC/C,6EAA6E;QAC7E,OAAO,CAAC,CAAC,EAAE,MAAA,GAAG,CAAC,CAAC,CAAC,mCAAI,QAAQ,CAAC,CAAC,CAAC,CAAU,CAAC;IAC5C,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LunaticSuggester } from '../../use-lunatic/type';
|
|
2
|
+
export type SearchInfo = LunaticSuggester;
|
|
3
|
+
export type IndexEntry = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
[k: string]: string;
|
|
7
|
+
};
|
|
8
|
+
export interface SearchInterface<T extends IndexEntry> {
|
|
9
|
+
isIndexed(): boolean;
|
|
10
|
+
index(data: T[]): Promise<void>;
|
|
11
|
+
search(q: string): Promise<T[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInterface.js","sourceRoot":"","sources":["../../../src/utils/search/SearchInterface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IndexEntry, SearchInfo, SearchInterface } from './SearchInterface';
|
|
2
|
+
import MiniSearch from 'minisearch';
|
|
3
|
+
export declare class SearchMinisearch<T extends IndexEntry> implements SearchInterface<T> {
|
|
4
|
+
db: MiniSearch<T> | null;
|
|
5
|
+
info: SearchInfo;
|
|
6
|
+
indexed: boolean;
|
|
7
|
+
constructor(info: SearchInfo);
|
|
8
|
+
isIndexed(): boolean;
|
|
9
|
+
index(data: T[]): Promise<void>;
|
|
10
|
+
search(q: string): Promise<T[]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { applyMelauto } from './melauto';
|
|
2
|
+
import MiniSearch from 'minisearch';
|
|
3
|
+
import { tokenizer } from './tokenizer';
|
|
4
|
+
export class SearchMinisearch {
|
|
5
|
+
constructor(info) {
|
|
6
|
+
this.db = null;
|
|
7
|
+
this.indexed = false;
|
|
8
|
+
this.info = info;
|
|
9
|
+
}
|
|
10
|
+
isIndexed() {
|
|
11
|
+
return this.indexed;
|
|
12
|
+
}
|
|
13
|
+
async index(data) {
|
|
14
|
+
if (this.indexed) {
|
|
15
|
+
return Promise.resolve();
|
|
16
|
+
}
|
|
17
|
+
const nameFields = this.info.fields.map(({ name }) => name);
|
|
18
|
+
this.db = new MiniSearch({
|
|
19
|
+
fields: nameFields,
|
|
20
|
+
storeFields: data[0] ? Object.keys(data[0]) : nameFields,
|
|
21
|
+
tokenize: tokenizer(this.info),
|
|
22
|
+
});
|
|
23
|
+
this.db.addAll(data);
|
|
24
|
+
this.indexed = true;
|
|
25
|
+
}
|
|
26
|
+
async search(q) {
|
|
27
|
+
if (!this.db || !this.info.queryParser) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
let data = this.db.search(q, {
|
|
31
|
+
prefix: (term) => term.length > 2,
|
|
32
|
+
});
|
|
33
|
+
// Apply melauto to classify results
|
|
34
|
+
data = applyMelauto(q, data);
|
|
35
|
+
data = data.slice(0, this.info.max);
|
|
36
|
+
return data;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=SearchMinisearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchMinisearch.js","sourceRoot":"","sources":["../../../src/utils/search/SearchMinisearch.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,OAAO,gBAAgB;IAO5B,YAAY,IAAgB;QAJ5B,OAAE,GAAyB,IAAI,CAAC;QAEhC,YAAO,GAAG,KAAK,CAAC;QAGf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IAED,SAAS;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAS;QACpB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC1B,CAAC;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;QAC5D,IAAI,CAAC,EAAE,GAAG,IAAI,UAAU,CAAC;YACxB,MAAM,EAAE,UAAU;YAClB,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU;YACxD,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;SAC9B,CAAC,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,CAAS;QACrB,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACxC,OAAO,EAAE,CAAC;QACX,CAAC;QACD,IAAI,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE;YAC5B,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;SACjC,CAAe,CAAC;QAEjB,oCAAoC;QACpC,IAAI,GAAG,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAE7B,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEpC,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IndexEntry, SearchInterface } from './SearchInterface';
|
|
2
|
+
import type { LunaticSource } from '../../use-lunatic/type';
|
|
3
|
+
/**
|
|
4
|
+
* This file retains a dictionary of all the search indexed by storeName
|
|
5
|
+
*/
|
|
6
|
+
export declare function registerSuggesters(infos: LunaticSource['suggesters'], fetcher: (name: string) => Promise<Array<IndexEntry>>): void;
|
|
7
|
+
export declare function getSearchForStore(storeName: string): {
|
|
8
|
+
error: string;
|
|
9
|
+
search?: undefined;
|
|
10
|
+
index?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
error: null;
|
|
13
|
+
search: SearchInterface<IndexEntry>;
|
|
14
|
+
index: () => Promise<void>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SearchMinisearch } from './SearchMinisearch';
|
|
2
|
+
const suggesters = new Map();
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
|
+
let dataFetcher = (_) => Promise.resolve([]);
|
|
5
|
+
/**
|
|
6
|
+
* This file retains a dictionary of all the search indexed by storeName
|
|
7
|
+
*/
|
|
8
|
+
export function registerSuggesters(infos, fetcher) {
|
|
9
|
+
if (!infos) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
dataFetcher = fetcher;
|
|
13
|
+
for (const suggester of infos) {
|
|
14
|
+
suggesters.set(suggester.name, new SearchMinisearch(suggester));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function getSearchForStore(storeName) {
|
|
18
|
+
const search = suggesters.get(storeName);
|
|
19
|
+
if (!search) {
|
|
20
|
+
return {
|
|
21
|
+
error: 'Cannot find search for store : ' + storeName,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
error: null,
|
|
26
|
+
search,
|
|
27
|
+
index: () => {
|
|
28
|
+
if (!search) {
|
|
29
|
+
return Promise.reject();
|
|
30
|
+
}
|
|
31
|
+
if (search.isIndexed()) {
|
|
32
|
+
return Promise.resolve();
|
|
33
|
+
}
|
|
34
|
+
return dataFetcher(storeName).then((data) => search.index(data));
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=SuggestersDatabase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuggestersDatabase.js","sourceRoot":"","sources":["../../../src/utils/search/SuggestersDatabase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAuC,CAAC;AAClE,6DAA6D;AAC7D,IAAI,WAAW,GAAG,CAAC,CAAS,EAA8B,EAAE,CAC3D,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAErB;;GAEG;AACH,MAAM,UAAU,kBAAkB,CACjC,KAAkC,EAClC,OAAqD;IAErD,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,OAAO;IACR,CAAC;IACD,WAAW,GAAG,OAAO,CAAC;IACtB,KAAK,MAAM,SAAS,IAAI,KAAK,EAAE,CAAC;QAC/B,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,gBAAgB,CAAa,SAAS,CAAC,CAAC,CAAC;IAC7E,CAAC;AACF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IAClD,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,OAAO;YACN,KAAK,EAAE,iCAAiC,GAAG,SAAS;SACpD,CAAC;IACH,CAAC;IACD,OAAO;QACN,KAAK,EAAE,IAAI;QACX,MAAM;QACN,KAAK,EAAE,GAAG,EAAE;YACX,IAAI,CAAC,MAAM,EAAE,CAAC;gBACb,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;YACzB,CAAC;YACD,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;gBACxB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;YAC1B,CAAC;YACD,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAClE,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply Melauto sorting algorithm on the data
|
|
3
|
+
*/
|
|
4
|
+
export declare function applyMelauto<T extends {
|
|
5
|
+
id: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
}>(query: string, data: T[]): T[];
|
|
8
|
+
/**
|
|
9
|
+
* Melauto scoring algorithm
|
|
10
|
+
*
|
|
11
|
+
* - Rank up result if the word is closer to the start of the string
|
|
12
|
+
* - Rank better the first word in the query
|
|
13
|
+
* - Rank up the proportion of query terms in the string
|
|
14
|
+
*/
|
|
15
|
+
export declare function melautoScore(str: string, query: string): number;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply Melauto sorting algorithm on the data
|
|
3
|
+
*/
|
|
4
|
+
export function applyMelauto(query, data) {
|
|
5
|
+
return data.sort((a, b) => {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
return melautoScore((_a = b.label) !== null && _a !== void 0 ? _a : a.id, query) -
|
|
8
|
+
melautoScore((_b = a.label) !== null && _b !== void 0 ? _b : a.id, query);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Normalize a string to remove accent and other unicode character
|
|
13
|
+
* "Héllo (wörld)" becomes "Hello world"
|
|
14
|
+
*/
|
|
15
|
+
const normalize = (str) => {
|
|
16
|
+
return str
|
|
17
|
+
.normalize('NFD')
|
|
18
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
19
|
+
.toLowerCase()
|
|
20
|
+
.split(/[^a-z0-9]+/)
|
|
21
|
+
.filter((w) => w.length > 0)
|
|
22
|
+
.join(' ');
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Melauto scoring algorithm
|
|
26
|
+
*
|
|
27
|
+
* - Rank up result if the word is closer to the start of the string
|
|
28
|
+
* - Rank better the first word in the query
|
|
29
|
+
* - Rank up the proportion of query terms in the string
|
|
30
|
+
*/
|
|
31
|
+
export function melautoScore(str, query) {
|
|
32
|
+
const cleanedStr = normalize(str);
|
|
33
|
+
const queryTerms = normalize(query).split(' ');
|
|
34
|
+
return queryTerms.reduce(function (score, token, i) {
|
|
35
|
+
const index = cleanedStr.search(token);
|
|
36
|
+
if (index < 0) {
|
|
37
|
+
return score;
|
|
38
|
+
}
|
|
39
|
+
const how = (cleanedStr.length - index) / cleanedStr.length;
|
|
40
|
+
const weight = (queryTerms.length - i) / queryTerms.length;
|
|
41
|
+
return score + how * weight;
|
|
42
|
+
}, 0);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=melauto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"melauto.js","sourceRoot":"","sources":["../../../src/utils/search/melauto.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,YAAY,CAC3B,KAAa,EACb,IAAS;IAET,OAAO,IAAI,CAAC,IAAI,CACf,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;;QACR,OAAA,YAAY,CAAC,MAAA,CAAC,CAAC,KAAK,mCAAI,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC;YACpC,YAAY,CAAC,MAAA,CAAC,CAAC,KAAK,mCAAI,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;KAAA,CACrC,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,SAAS,GAAG,CAAC,GAAW,EAAU,EAAE;IACzC,OAAO,GAAG;SACR,SAAS,CAAC,KAAK,CAAC;SAChB,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;SAC/B,WAAW,EAAE;SACb,KAAK,CAAC,YAAY,CAAC;SACnB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SAC3B,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,KAAa;IACtD,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/C,OAAO,UAAU,CAAC,MAAM,CAAC,UAAU,KAAK,EAAE,KAAK,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACf,OAAO,KAAK,CAAC;QACd,CAAC;QACD,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,KAAK,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC;QAC5D,MAAM,MAAM,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC;QAC3D,OAAO,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC;IAC7B,CAAC,EAAE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SearchInfo } from './SearchInterface';
|
|
2
|
+
import type { ItemOf } from '../../type.utils';
|
|
3
|
+
/**
|
|
4
|
+
* Generates a tokenize method
|
|
5
|
+
*/
|
|
6
|
+
export declare const tokenizer: (info: SearchInfo) => (str: string, fieldName?: string) => string[];
|
|
7
|
+
/**
|
|
8
|
+
* Tokenizer used for the query entered by the user (based on "queryParser" info)
|
|
9
|
+
*/
|
|
10
|
+
export declare const tokenizeQuery: (str: string, info: SearchInfo["queryParser"]) => string[];
|
|
11
|
+
/**
|
|
12
|
+
* Tokenizer used for indexing (based on "fields" specification)
|
|
13
|
+
*/
|
|
14
|
+
export declare const tokenizeIndex: (str: string, info: ItemOf<SearchInfo["fields"]>) => string[];
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a tokenize method
|
|
3
|
+
*/
|
|
4
|
+
export const tokenizer = (info) => (str, fieldName) => {
|
|
5
|
+
const field = info.fields.find((f) => f.name === fieldName);
|
|
6
|
+
return field
|
|
7
|
+
? tokenizeIndex(str, field)
|
|
8
|
+
: tokenizeQuery(str, info.queryParser);
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Tokenizer used for the query entered by the user (based on "queryParser" info)
|
|
12
|
+
*/
|
|
13
|
+
export const tokenizeQuery = (str, info) => {
|
|
14
|
+
var _a, _b, _c;
|
|
15
|
+
if (info.type === 'soft') {
|
|
16
|
+
return normalizeStr(str)
|
|
17
|
+
.split(/[^a-z0-9]+/)
|
|
18
|
+
.filter((w) => w.length > 0);
|
|
19
|
+
}
|
|
20
|
+
const wordRegex = info.params.pattern && info.params.pattern !== 'soft'
|
|
21
|
+
? /\w+/gi
|
|
22
|
+
: new RegExp(info.params.pattern, 'gi');
|
|
23
|
+
const minLength = (_a = info.params.min) !== null && _a !== void 0 ? _a : 1;
|
|
24
|
+
return ((_c = (_b = normalizeStr(str)
|
|
25
|
+
.match(wordRegex)) === null || _b === void 0 ? void 0 : _b.filter((w) => w.length >= minLength)) !== null && _c !== void 0 ? _c : []);
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Tokenizer used for indexing (based on "fields" specification)
|
|
29
|
+
*/
|
|
30
|
+
export const tokenizeIndex = (str, info) => {
|
|
31
|
+
var _a, _b, _c;
|
|
32
|
+
const wordRegex = info.rules && info.rules !== 'soft'
|
|
33
|
+
? /\w+/gi
|
|
34
|
+
: new RegExp(info.rules[0], 'gi');
|
|
35
|
+
const minLength = (_a = info.min) !== null && _a !== void 0 ? _a : 1;
|
|
36
|
+
// For synonyms, add the synonyms to the string
|
|
37
|
+
if (info.synonyms) {
|
|
38
|
+
for (const source in info.synonyms) {
|
|
39
|
+
const synonyms = info.synonyms[source].join(' ');
|
|
40
|
+
str = str.replaceAll(source, `${source} ${synonyms}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return ((_c = (_b = normalizeStr(str)
|
|
44
|
+
.match(wordRegex)) === null || _b === void 0 ? void 0 : _b.filter((w) => w.length >= minLength)) !== null && _c !== void 0 ? _c : []);
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Normalize a string
|
|
48
|
+
* - Remove accent (é => e, à => a
|
|
49
|
+
* - Lowercase
|
|
50
|
+
*/
|
|
51
|
+
const normalizeStr = (str) => {
|
|
52
|
+
return str
|
|
53
|
+
.normalize('NFD')
|
|
54
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
55
|
+
.toLowerCase();
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=tokenizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokenizer.js","sourceRoot":"","sources":["../../../src/utils/search/tokenizer.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GACrB,CAAC,IAAgB,EAAE,EAAE,CAAC,CAAC,GAAW,EAAE,SAAkB,EAAE,EAAE;IACzD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IAE5D,OAAO,KAAK;QACX,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,CAAC;QAC3B,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AACzC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAW,EAAE,IAA+B,EAAE,EAAE;;IAC7E,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC1B,OAAO,YAAY,CAAC,GAAG,CAAC;aACtB,KAAK,CAAC,YAAY,CAAC;aACnB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,SAAS,GACd,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,MAAM;QACpD,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,GAAG,mCAAI,CAAC,CAAC;IAEvC,OAAO,CACN,MAAA,MAAA,YAAY,CAAC,GAAG,CAAC;SACf,KAAK,CAAC,SAAS,CAAC,0CACf,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,SAAS,CAAC,mCAAI,EAAE,CAC7C,CAAC;AACH,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC5B,GAAW,EACX,IAAkC,EACjC,EAAE;;IACH,MAAM,SAAS,GACd,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM;QAClC,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,GAAG,mCAAI,CAAC,CAAC;IAEhC,+CAA+C;IAC/C,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnB,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACjD,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAC;QACvD,CAAC;IACF,CAAC;IAED,OAAO,CACN,MAAA,MAAA,YAAY,CAAC,GAAG,CAAC;SACf,KAAK,CAAC,SAAS,CAAC,0CACf,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,SAAS,CAAC,mCAAI,EAAE,CAC7C,CAAC;AACH,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE;IACpC,OAAO,GAAG;SACR,SAAS,CAAC,KAAK,CAAC;SAChB,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;SAC/B,WAAW,EAAE,CAAC;AACjB,CAAC,CAAC"}
|