@volverjs/ui-vue 0.0.10-beta.47 → 0.0.10-beta.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/auto-imports.d.ts +19 -11
- package/bin/icons.js +1 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +4 -5
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +8 -11
- package/dist/components/VvAccordion/index.d.ts +2 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +45 -46
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +11 -13
- package/dist/components/VvAccordionGroup/index.d.ts +2 -2
- package/dist/components/VvAction/VvAction.vue.d.ts +8 -10
- package/dist/components/VvAction/index.d.ts +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +158 -161
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +20 -22
- package/dist/components/VvAlert/index.d.ts +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +271 -274
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +9 -11
- package/dist/components/VvAlertGroup/index.d.ts +2 -2
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +6 -6
- package/dist/components/VvAvatar/index.d.ts +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +21 -22
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +6 -6
- package/dist/components/VvAvatarGroup/index.d.ts +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +6 -6
- package/dist/components/VvBadge/index.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +23 -23
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +19 -19
- package/dist/components/VvBreadcrumb/index.d.ts +1 -1
- package/dist/components/VvButton/VvButton.es.js +313 -314
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +14 -16
- package/dist/components/VvButton/index.d.ts +9 -9
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +2 -2
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +6 -8
- package/dist/components/VvButtonGroup/index.d.ts +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +6 -6
- package/dist/components/VvCard/index.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +186 -187
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +11 -13
- package/dist/components/VvCheckbox/index.d.ts +7 -7
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -191
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +11 -13
- package/dist/components/VvCheckboxGroup/index.d.ts +2 -2
- package/dist/components/VvCombobox/VvCombobox.es.js +1864 -1865
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +72 -291
- package/dist/components/VvCombobox/index.d.ts +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +7 -9
- package/dist/components/VvDialog/index.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +9 -10
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +51 -51
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +22 -16
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +6 -6
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +2 -2
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +2 -2
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +2 -2
- package/dist/components/VvIcon/VvIcon.vue.d.ts +2 -23
- package/dist/components/VvInputFile/VvInputFile.es.js +651 -652
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +19 -19
- package/dist/components/VvInputFile/index.d.ts +4 -4
- package/dist/components/VvInputText/VvInputClearAction.d.ts +10 -6
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +11 -7
- package/dist/components/VvInputText/VvInputStepAction.d.ts +10 -6
- package/dist/components/VvInputText/VvInputText.es.js +715 -716
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +30 -32
- package/dist/components/VvInputText/index.d.ts +1 -1
- package/dist/components/VvNav/VvNav.es.js +5 -5
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +8 -10
- package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
- package/dist/components/VvNav/index.d.ts +2 -2
- package/dist/components/VvProgress/VvProgress.vue.d.ts +6 -6
- package/dist/components/VvProgress/index.d.ts +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +186 -187
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +10 -12
- package/dist/components/VvRadio/index.d.ts +5 -5
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +190 -191
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +11 -13
- package/dist/components/VvRadioGroup/index.d.ts +2 -2
- package/dist/components/VvSelect/VvSelect.es.js +337 -338
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +20 -131
- package/dist/components/VvSelect/index.d.ts +7 -7
- package/dist/components/VvTab/VvTab.es.js +18 -18
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +6 -8
- package/dist/components/VvTab/index.d.ts +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +292 -293
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +14 -16
- package/dist/components/VvTextarea/index.d.ts +3 -3
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +8 -8
- package/dist/components/common/HintSlot.d.ts +6 -6
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.es.js +2760 -2763
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +4 -4
- package/dist/composables/alert/{useProvideAlert.d.ts → useAlertProvide.d.ts} +1 -1
- package/dist/composables/dropdown/useDropdownContextmenu.d.ts +18 -0
- package/dist/composables/dropdown/{useProvideDropdown.d.ts → useDropdownProvide.d.ts} +6 -6
- package/dist/composables/dropdown/useDropdownVirtualElement.d.ts +17 -0
- package/dist/composables/group/{useInjectedGroupState.d.ts → useGroupStateInject.d.ts} +1 -1
- package/dist/composables/group/{useProvideGroupState.d.ts → useGroupStateProvide.d.ts} +2 -2
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.es.js +87 -3
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useOptions.d.ts +1 -1
- package/dist/composables/usePersistence.d.ts +1 -1
- package/dist/composables/useUniqueId.d.ts +1 -1
- package/dist/constants.d.ts +3 -3
- package/dist/directives/index.d.ts +2 -2
- package/dist/directives/index.es.js +145 -39
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.es.js +137 -31
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/icons.d.ts +17 -17
- package/dist/icons.es.js +424 -424
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +4 -4
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +178 -474
- package/dist/stories/Alert/Alert.settings.d.ts +1 -1
- package/dist/stories/Alert/AlertModifiers.stories.d.ts +1 -1
- package/dist/stories/Alert/AlertSlots.stories.d.ts +1 -1
- package/dist/stories/AlertGroup/AlertGroupPosition.stories.d.ts +1 -1
- package/dist/stories/AlertGroup/AlertGroupSlots.stories.d.ts +1 -1
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Button/Button.settings.d.ts +1 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +1 -1
- package/dist/stories/Nav/Nav.settings.d.ts +1 -1
- package/dist/stories/Tab/Tab.settings.d.ts +1 -1
- package/dist/types/floating-ui.d.ts +1 -1
- package/dist/types/group.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/DomUtilities.d.ts +1 -0
- package/package.json +43 -43
- package/src/Volver.ts +3 -3
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/VvAccordion.vue +5 -5
- package/src/components/VvAccordion/index.ts +2 -2
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +5 -5
- package/src/components/VvAction/VvAction.vue +1 -1
- package/src/components/VvAlert/VvAlert.vue +1 -1
- package/src/components/VvAlert/index.ts +1 -1
- package/src/components/VvAlertGroup/VvAlertGroup.vue +1 -1
- package/src/components/VvAlertGroup/index.ts +3 -3
- package/src/components/VvAvatarGroup/VvAvatarGroup.vue +1 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +2 -2
- package/src/components/VvBreadcrumb/index.ts +1 -1
- package/src/components/VvButton/VvButton.vue +3 -3
- package/src/components/VvButton/index.ts +4 -4
- package/src/components/VvButtonGroup/VvButtonGroup.vue +3 -3
- package/src/components/VvCheckbox/VvCheckbox.vue +2 -2
- package/src/components/VvCheckbox/index.ts +2 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +2 -2
- package/src/components/VvCombobox/VvCombobox.vue +9 -9
- package/src/components/VvCombobox/index.ts +15 -15
- package/src/components/VvDropdown/VvDropdown.vue +19 -19
- package/src/components/VvDropdown/VvDropdownAction.vue +1 -1
- package/src/components/VvDropdown/VvDropdownItem.vue +1 -1
- package/src/components/VvDropdown/VvDropdownOption.vue +1 -1
- package/src/components/VvDropdown/index.ts +2 -2
- package/src/components/VvIcon/VvIcon.vue +2 -2
- package/src/components/VvInputFile/VvInputFile.vue +7 -7
- package/src/components/VvInputFile/index.ts +7 -7
- package/src/components/VvInputText/VvInputPasswordAction.ts +1 -1
- package/src/components/VvInputText/VvInputText.vue +19 -19
- package/src/components/VvInputText/VvInputTextActions.ts +4 -4
- package/src/components/VvInputText/index.ts +2 -2
- package/src/components/VvNav/VvNav.vue +1 -1
- package/src/components/VvRadio/VvRadio.vue +1 -1
- package/src/components/VvRadio/index.ts +2 -2
- package/src/components/VvRadioGroup/VvRadioGroup.vue +2 -2
- package/src/components/VvSelect/VvSelect.vue +6 -6
- package/src/components/VvSelect/index.ts +12 -12
- package/src/components/VvTab/VvTab.vue +2 -2
- package/src/components/VvTab/index.ts +1 -1
- package/src/components/VvTextarea/VvTextarea.vue +1 -1
- package/src/components/common/HintSlot.ts +14 -14
- package/src/components/index.ts +1 -1
- package/src/composables/alert/useAlert.ts +2 -2
- package/src/composables/alert/{useProvideAlert.ts → useAlertProvide.ts} +2 -2
- package/src/composables/dropdown/useDropdownContextmenu.ts +22 -0
- package/src/composables/dropdown/{useProvideDropdown.ts → useDropdownProvide.ts} +9 -9
- package/src/composables/dropdown/useDropdownVirtualElement.ts +53 -0
- package/src/composables/group/{useInjectedGroupState.ts → useGroupStateInject.ts} +2 -2
- package/src/composables/group/{useProvideGroupState.ts → useGroupStateProvide.ts} +2 -2
- package/src/composables/index.ts +2 -0
- package/src/composables/useBlurhash.ts +2 -2
- package/src/composables/useOptions.ts +1 -1
- package/src/composables/usePersistence.ts +1 -1
- package/src/composables/useTextCount.ts +2 -2
- package/src/composables/useUniqueId.ts +2 -3
- package/src/constants.ts +5 -5
- package/src/directives/index.ts +2 -2
- package/src/directives/v-contextmenu.ts +21 -29
- package/src/directives/v-tooltip.ts +2 -2
- package/src/icons.ts +2 -2
- package/src/index.ts +1 -1
- package/src/props/index.ts +7 -7
- package/src/resolvers/unplugin.ts +5 -5
- package/src/stories/Accordion/Accordion.stories.ts +2 -2
- package/src/stories/Accordion/Accordion.test.ts +1 -1
- package/src/stories/Accordion/AccordionSlots.stories.ts +2 -2
- package/src/stories/AccordionGroup/AccordionGroup.stories.ts +2 -2
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +1 -1
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +3 -3
- package/src/stories/Alert/Alert.settings.ts +1 -1
- package/src/stories/Alert/Alert.stories.ts +2 -2
- package/src/stories/Alert/Alert.test.ts +1 -1
- package/src/stories/Alert/AlertModifiers.stories.ts +2 -2
- package/src/stories/Alert/AlertSlots.stories.ts +2 -2
- package/src/stories/AlertGroup/AlertGroup.stories.ts +2 -2
- package/src/stories/AlertGroup/AlertGroup.test.ts +3 -3
- package/src/stories/AlertGroup/AlertGroupPosition.stories.ts +2 -2
- package/src/stories/AlertGroup/AlertGroupSlots.stories.ts +2 -2
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
- package/src/stories/Avatar/Avatar.stories.ts +2 -2
- package/src/stories/Avatar/Avatar.test.ts +1 -1
- package/src/stories/Avatar/AvatarBadge.stories.ts +1 -1
- package/src/stories/Avatar/AvatarModifiers.stories.ts +2 -2
- package/src/stories/Avatar/AvatarSlots.stories.ts +2 -2
- package/src/stories/AvatarGroup/AvatarGroup.stories.ts +2 -2
- package/src/stories/AvatarGroup/AvatarGroup.test.ts +1 -1
- package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +2 -2
- package/src/stories/AvatarGroup/AvatarGroupSlotDefault.stories.ts +3 -3
- package/src/stories/Badge/Badge.stories.ts +2 -2
- package/src/stories/Badge/Badge.test.ts +1 -1
- package/src/stories/Badge/BadgeSlots.stories.ts +2 -2
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +37 -117
- package/src/stories/Breadcrumb/Breadcrumb.stories.ts +2 -2
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.ts +5 -5
- package/src/stories/Button/Button.settings.ts +3 -3
- package/src/stories/Button/Button.stories.ts +2 -2
- package/src/stories/Button/Button.test.ts +1 -1
- package/src/stories/Button/ButtonIcon.stories.ts +2 -2
- package/src/stories/Button/ButtonLink.stories.ts +2 -2
- package/src/stories/Button/ButtonLoading.stories.ts +2 -2
- package/src/stories/Button/ButtonModifiers.stories.ts +2 -2
- package/src/stories/Button/ButtonSlots.stories.ts +3 -3
- package/src/stories/Button/ButtonState.stories.ts +2 -2
- package/src/stories/Button/ButtonToggle.stories.ts +2 -2
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +2 -2
- package/src/stories/ButtonGroup/ButtonGroup.stories.ts +2 -2
- package/src/stories/ButtonGroup/ButtonGroup.test.ts +1 -1
- package/src/stories/ButtonGroup/ButtonGroupModifiers.stories.ts +2 -2
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.ts +2 -2
- package/src/stories/ButtonGroup/ButtonGroupToggle.stories.ts +2 -2
- package/src/stories/Card/Card.stories.ts +2 -2
- package/src/stories/Card/Card.test.ts +1 -1
- package/src/stories/Card/CardSlots.stories.ts +2 -2
- package/src/stories/Checkbox/Checkbox.stories.ts +2 -2
- package/src/stories/Checkbox/Checkbox.test.ts +1 -1
- package/src/stories/Checkbox/CheckboxBinary.stories.ts +2 -2
- package/src/stories/Checkbox/CheckboxSlots.stories.ts +2 -2
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.ts +2 -2
- package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +2 -2
- package/src/stories/CheckboxGroup/CheckboxGroupOptions.stories.ts +2 -2
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.ts +3 -3
- package/src/stories/Combobox/Combobox.settings.ts +9 -9
- package/src/stories/Combobox/Combobox.stories.ts +2 -2
- package/src/stories/Combobox/Combobox.test.ts +2 -2
- package/src/stories/Combobox/ComboboxIconPosition.stories.ts +2 -2
- package/src/stories/Combobox/ComboboxMultiple.stories.ts +2 -2
- package/src/stories/Combobox/ComboboxOptions.stories.ts +2 -2
- package/src/stories/Combobox/ComboboxSlots.stories.ts +3 -3
- package/src/stories/Dialog/Dialog.stories.ts +2 -2
- package/src/stories/Dialog/Dialog.test.ts +1 -1
- package/src/stories/Dialog/DialogModifiers.stories.ts +2 -2
- package/src/stories/Dialog/DialogSlots.stories.ts +2 -2
- package/src/stories/Dropdown/Dropdown.settings.ts +1 -1
- package/src/stories/Dropdown/Dropdown.stories.ts +4 -4
- package/src/stories/Dropdown/Dropdown.test.ts +1 -1
- package/src/stories/Dropdown/DropdownContextmenuDirective.stories.ts +3 -4
- package/src/stories/Dropdown/DropdownMultilevel.stories.ts +4 -4
- package/src/stories/Dropdown/DropdownSlots.stories.ts +4 -4
- package/src/stories/Icon/Icon.settings.ts +1 -1
- package/src/stories/Icon/Icon.stories.ts +2 -2
- package/src/stories/Icon/IconsCollection.stories.ts +3 -3
- package/src/stories/InputFile/InputFile.settings.ts +1 -1
- package/src/stories/InputFile/InputFile.stories.ts +1 -1
- package/src/stories/InputFile/InputFileDropArea.stories.ts +2 -2
- package/src/stories/InputFile/InputFileIconPosition.stories.ts +2 -2
- package/src/stories/InputFile/InputFileSlots.stories.ts +2 -2
- package/src/stories/InputText/InputText.settings.ts +2 -2
- package/src/stories/InputText/InputText.stories.ts +2 -2
- package/src/stories/InputText/InputText.test.ts +2 -2
- package/src/stories/InputText/InputTextIconPosition.stories.ts +2 -2
- package/src/stories/InputText/InputTextLength.stories.ts +2 -2
- package/src/stories/InputText/InputTextMask.stories.ts +2 -2
- package/src/stories/InputText/InputTextMinMax.stories.ts +2 -2
- package/src/stories/InputText/InputTextSlots.stories.ts +2 -2
- package/src/stories/InputText/InputTextType.stories.ts +2 -2
- package/src/stories/Nav/Nav.settings.ts +1 -1
- package/src/stories/Nav/Nav.stories.ts +2 -2
- package/src/stories/Nav/Nav.test.ts +1 -1
- package/src/stories/Nav/NavModifiers.stories.ts +2 -2
- package/src/stories/Progress/Progress.stories.ts +2 -2
- package/src/stories/Progress/Progress.test.ts +2 -2
- package/src/stories/Radio/Radio.stories.ts +2 -2
- package/src/stories/Radio/Radio.test.ts +1 -1
- package/src/stories/Radio/RadioSlots.stories.ts +2 -2
- package/src/stories/RadioGroup/RadioGroup.stories.ts +2 -2
- package/src/stories/RadioGroup/RadioGroup.test.ts +2 -2
- package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +2 -2
- package/src/stories/RadioGroup/RadioGroupSlots.stories.ts +3 -3
- package/src/stories/Select/Select.settings.ts +10 -10
- package/src/stories/Select/Select.stories.ts +2 -2
- package/src/stories/Select/Select.test.ts +1 -1
- package/src/stories/Select/SelectIconPosition.stories.ts +2 -2
- package/src/stories/Select/SelectOptions.stories.ts +2 -2
- package/src/stories/Select/SelectSlots.stories.ts +2 -2
- package/src/stories/Tab/Tab.settings.ts +1 -1
- package/src/stories/Tab/Tab.stories.ts +1 -1
- package/src/stories/Tab/Tab.test.ts +1 -1
- package/src/stories/Textarea/Textarea.settings.ts +1 -1
- package/src/stories/Textarea/Textarea.stories.ts +2 -2
- package/src/stories/Textarea/Textarea.test.ts +1 -1
- package/src/stories/Textarea/TextareaLength.stories.ts +2 -2
- package/src/stories/Textarea/TextareaSlots.stories.ts +2 -2
- package/src/stories/Textarea/TextareatIconPosition.stories.ts +2 -2
- package/src/stories/Tooltip/Tooltip.stories.ts +3 -3
- package/src/stories/Tooltip/Tooltip.test.ts +1 -1
- package/src/stories/Tooltip/TooltipDirective.stories.ts +3 -3
- package/src/test/expect.ts +3 -3
- package/src/test/types.d.ts +2 -2
- package/src/types/floating-ui.ts +1 -1
- package/src/types/group.ts +1 -1
- package/src/types/index.ts +2 -2
- package/src/utils/DomUtilities.ts +15 -0
- package/src/utils/ObjectUtilities.ts +4 -4
- package/src/workers/blurhash.ts +1 -1
- package/dist/composables/alert/{useInjectAlert.d.ts → useAlerInject.d.ts} +0 -0
- package/dist/composables/dropdown/{useInjectDropdown.d.ts → useDropdownInject.d.ts} +0 -0
- package/src/assets/icons/normal/{dulicate.svg → duplicate.svg} +0 -0
- package/src/composables/alert/{useInjectAlert.ts → useAlerInject.ts} +0 -0
- package/src/composables/dropdown/{useInjectDropdown.ts → useDropdownInject.ts} +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import type { MaskedNumberOptions } from 'imask'
|
|
2
3
|
import type { InputHTMLAttributes } from 'vue'
|
|
3
4
|
import { useIMask } from 'vue-imask'
|
|
4
|
-
import type { MaskedNumberOptions } from 'imask'
|
|
5
5
|
import HintSlotFactory from '../common/HintSlot'
|
|
6
|
-
import VvIcon from '../VvIcon/VvIcon.vue'
|
|
7
|
-
import { ACTION_ICONS } from '../VvIcon'
|
|
8
|
-
import VvInputTextActionsFactory from '../VvInputText/VvInputTextActions'
|
|
9
6
|
import VvDropdown from '../VvDropdown/VvDropdown.vue'
|
|
10
7
|
import VvDropdownOption from '../VvDropdown/VvDropdownOption.vue'
|
|
8
|
+
import { ACTION_ICONS } from '../VvIcon'
|
|
9
|
+
import VvIcon from '../VvIcon/VvIcon.vue'
|
|
11
10
|
import {
|
|
11
|
+
INPUT_TYPES,
|
|
12
12
|
VvInputTextEvents,
|
|
13
13
|
VvInputTextProps,
|
|
14
|
-
INPUT_TYPES,
|
|
15
14
|
} from '../VvInputText'
|
|
15
|
+
import VvInputTextActionsFactory from '../VvInputText/VvInputTextActions'
|
|
16
16
|
|
|
17
17
|
// props, emit, slots and attrs
|
|
18
18
|
const props = defineProps(VvInputTextProps)
|
|
@@ -135,9 +135,9 @@ const { el, mask, typed, masked, unmasked } = useIMask(
|
|
|
135
135
|
date = new Date(date)
|
|
136
136
|
}
|
|
137
137
|
localModelValue.value = `${date.getFullYear()}-${(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
`0${
|
|
139
|
+
date.getMonth() + 1}`
|
|
140
|
+
).slice(-2)}-${(`0${date.getDate()}`).slice(-2)}`
|
|
141
141
|
return
|
|
142
142
|
}
|
|
143
143
|
if (type.value === INPUT_TYPES.DATETIME_LOCAL) {
|
|
@@ -160,11 +160,11 @@ const { el, mask, typed, masked, unmasked } = useIMask(
|
|
|
160
160
|
date = new Date(date)
|
|
161
161
|
}
|
|
162
162
|
localModelValue.value = `${date.getFullYear()}-${(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
`0${
|
|
164
|
+
date.getMonth() + 1}`
|
|
165
|
+
).slice(-2)}-${(`0${date.getDate()}`).slice(-2)}T${(
|
|
166
|
+
`0${date.getHours()}`
|
|
167
|
+
).slice(-2)}:${(`0${date.getMinutes()}`).slice(-2)}`
|
|
168
168
|
return
|
|
169
169
|
}
|
|
170
170
|
if (!localModelValue.value && !unmasked.value) {
|
|
@@ -217,9 +217,9 @@ watch(
|
|
|
217
217
|
|
|
218
218
|
// template refs
|
|
219
219
|
const inputEl = el as Ref<HTMLInputElement>
|
|
220
|
-
const innerEl =
|
|
221
|
-
const wrapperEl =
|
|
222
|
-
const dropdownEl =
|
|
220
|
+
const innerEl = useTemplateRef<HTMLInputElement>('innerEl')
|
|
221
|
+
const wrapperEl = useTemplateRef<HTMLDivElement>('wrapperEl')
|
|
222
|
+
const dropdownEl = useTemplateRef<typeof VvDropdown>('dropdownEl')
|
|
223
223
|
|
|
224
224
|
defineExpose({ $inner: innerEl })
|
|
225
225
|
|
|
@@ -372,9 +372,9 @@ const filteredSuggestions = computed(() => {
|
|
|
372
372
|
suggestion =>
|
|
373
373
|
isEmpty(localModelValue.value)
|
|
374
374
|
|| (`${suggestion}`
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
375
|
+
.toLowerCase()
|
|
376
|
+
.includes(`${localModelValue.value}`.toLowerCase())
|
|
377
|
+
&& suggestion !== localModelValue.value),
|
|
378
378
|
)
|
|
379
379
|
.reverse()
|
|
380
380
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Component } from 'vue'
|
|
2
|
+
import { INPUT_TYPES, type VvInputTextPropsTypes } from '.'
|
|
2
3
|
import VvIcon from '../VvIcon/VvIcon.vue'
|
|
4
|
+
import VvInputClearAction from '../VvInputText/VvInputClearAction'
|
|
3
5
|
import VvInputPasswordAction from '../VvInputText/VvInputPasswordAction'
|
|
4
6
|
import VvInputStepAction from '../VvInputText/VvInputStepAction'
|
|
5
|
-
import VvInputClearAction from '../VvInputText/VvInputClearAction'
|
|
6
|
-
import { type VvInputTextPropsTypes, INPUT_TYPES } from '.'
|
|
7
7
|
|
|
8
8
|
export default function VvInputTextActionsFactory(
|
|
9
9
|
type: string,
|
|
@@ -69,7 +69,7 @@ export default function VvInputTextActionsFactory(
|
|
|
69
69
|
disabled:
|
|
70
70
|
this.isDisabled
|
|
71
71
|
|| (parentProps.max !== undefined
|
|
72
|
-
|
|
72
|
+
&& parentProps.modelValue === parentProps.max),
|
|
73
73
|
label: this.labelStepUp,
|
|
74
74
|
onStepUp,
|
|
75
75
|
onStepDown,
|
|
@@ -79,7 +79,7 @@ export default function VvInputTextActionsFactory(
|
|
|
79
79
|
disabled:
|
|
80
80
|
this.isDisabled
|
|
81
81
|
|| (parentProps.min !== undefined
|
|
82
|
-
|
|
82
|
+
&& parentProps.modelValue === parentProps.min),
|
|
83
83
|
label: this.labelStepDown,
|
|
84
84
|
onStepUp,
|
|
85
85
|
onStepDown,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ExtractPropTypes, PropType } from 'vue'
|
|
2
1
|
import type { FactoryOpts } from 'imask'
|
|
2
|
+
import type { ExtractPropTypes, PropType } from 'vue'
|
|
3
3
|
import { InputTextareaProps, StorageProps } from '../../props'
|
|
4
|
-
import { type VvIconProps
|
|
4
|
+
import { ACTION_ICONS, type VvIconProps } from '../VvIcon'
|
|
5
5
|
|
|
6
6
|
export const INPUT_TYPES = {
|
|
7
7
|
TEXT: 'text',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { VvNavEvents, VvNavProps } from '@/components/VvNav'
|
|
2
3
|
import VvNavItem from './VvNavItem.vue'
|
|
3
|
-
import { VvNavProps, VvNavEvents } from '@/components/VvNav'
|
|
4
4
|
|
|
5
5
|
const props = defineProps(VvNavProps)
|
|
6
6
|
const emit = defineEmits(VvNavEvents)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useGroupProps, VvRadioEvents, VvRadioProps } from '.'
|
|
2
3
|
import { HintSlotFactory } from '../common/HintSlot'
|
|
3
|
-
import { VvRadioProps, VvRadioEvents, useGroupProps } from '.'
|
|
4
4
|
|
|
5
5
|
// props, emit and slots
|
|
6
6
|
const props = defineProps(VvRadioProps)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExtractPropTypes } from 'vue'
|
|
2
2
|
import type { InputGroupState } from '../../types/group'
|
|
3
|
-
import { CheckboxRadioProps } from '../../props'
|
|
4
3
|
import { INJECTION_KEY_RADIO_GROUP } from '../../constants'
|
|
4
|
+
import { CheckboxRadioProps } from '../../props'
|
|
5
5
|
|
|
6
6
|
export const VvRadioProps = CheckboxRadioProps
|
|
7
7
|
|
|
@@ -18,7 +18,7 @@ export function useGroupProps(
|
|
|
18
18
|
) {
|
|
19
19
|
const { id } = toRefs(props)
|
|
20
20
|
const { group, isInGroup, getGroupOrLocalRef }
|
|
21
|
-
=
|
|
21
|
+
= useGroupStateInject<InputGroupState>(INJECTION_KEY_RADIO_GROUP)
|
|
22
22
|
|
|
23
23
|
// global props
|
|
24
24
|
const modelValue = getGroupOrLocalRef('modelValue', props, emit)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { Option } from '../../types/generic'
|
|
3
3
|
import type { InputGroupState } from '../../types/group'
|
|
4
|
+
import { VvRadioGroupEvents, VvRadioGroupProps } from '.'
|
|
4
5
|
import { INJECTION_KEY_RADIO_GROUP } from '../../constants'
|
|
5
6
|
import { HintSlotFactory } from '../common/HintSlot'
|
|
6
7
|
import VvRadio from '../VvRadio/VvRadio.vue'
|
|
7
|
-
import { VvRadioGroupProps, VvRadioGroupEvents } from '.'
|
|
8
8
|
|
|
9
9
|
// props, emit and slots
|
|
10
10
|
const props = defineProps(VvRadioGroupProps)
|
|
@@ -25,7 +25,7 @@ const modelValue = useVModel(props, 'modelValue', emit)
|
|
|
25
25
|
const { disabled, readonly, vertical, valid, invalid, modifiers }
|
|
26
26
|
= toRefs(props)
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
useGroupStateProvide<InputGroupState>(INJECTION_KEY_RADIO_GROUP, {
|
|
29
29
|
modelValue,
|
|
30
30
|
disabled,
|
|
31
31
|
readonly,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts" generic="T extends string | Option">
|
|
2
2
|
import type { SelectHTMLAttributes } from 'vue'
|
|
3
|
-
import VvIcon from '../VvIcon/VvIcon.vue'
|
|
4
|
-
import HintSlotFactory from '../common/HintSlot'
|
|
5
3
|
import type { Option } from '../../types/generic'
|
|
6
|
-
import { type VvSelectEmits
|
|
4
|
+
import { useVvSelectProps, type VvSelectEmits } from '.'
|
|
5
|
+
import HintSlotFactory from '../common/HintSlot'
|
|
6
|
+
import VvIcon from '../VvIcon/VvIcon.vue'
|
|
7
7
|
|
|
8
8
|
// props, emit and slots
|
|
9
9
|
// WARNING: This is a provisiaonal implementation, it may change in the future
|
|
@@ -20,7 +20,7 @@ const propsDefaults = useDefaults<typeof VvSelectProps>(
|
|
|
20
20
|
)
|
|
21
21
|
|
|
22
22
|
// template refs
|
|
23
|
-
const selectEl =
|
|
23
|
+
const selectEl = useTemplateRef<HTMLSelectElement>('selectEl')
|
|
24
24
|
|
|
25
25
|
// hint
|
|
26
26
|
const {
|
|
@@ -72,8 +72,8 @@ const localModelValue = computed({
|
|
|
72
72
|
set: (newValue) => {
|
|
73
73
|
if (Array.isArray(newValue)) {
|
|
74
74
|
newValue = newValue.filter(item => item !== undefined)
|
|
75
|
-
if (newValue.length === 0 && !props.unselectable) {
|
|
76
|
-
selectEl.value.value = props.modelValue
|
|
75
|
+
if (newValue.length === 0 && !props.unselectable && selectEl.value) {
|
|
76
|
+
selectEl.value.value = String(props.modelValue)
|
|
77
77
|
return
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import type { MaybeElement } from '@vueuse/core'
|
|
2
|
+
import type { Option } from '../../types/generic'
|
|
2
3
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
HintProps,
|
|
6
|
-
LoadingProps,
|
|
4
|
+
AutocompleteProps,
|
|
5
|
+
AutofocusProps,
|
|
7
6
|
DisabledProps,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
TabindexProps,
|
|
11
|
-
OptionsProps,
|
|
7
|
+
FloatingLabelProps,
|
|
8
|
+
HintProps,
|
|
12
9
|
IconProps,
|
|
13
10
|
IdNameProps,
|
|
14
|
-
|
|
15
|
-
AutofocusProps,
|
|
16
|
-
AutocompleteProps,
|
|
11
|
+
InvalidProps,
|
|
17
12
|
LabelProps,
|
|
13
|
+
LoadingProps,
|
|
14
|
+
ModifiersProps,
|
|
15
|
+
OptionsProps,
|
|
16
|
+
ReadonlyProps,
|
|
17
|
+
TabindexProps,
|
|
18
18
|
UnselectableProps,
|
|
19
|
+
ValidProps,
|
|
19
20
|
} from '../../props'
|
|
20
|
-
import type { Option } from '../../types/generic'
|
|
21
21
|
|
|
22
22
|
export type VvSelectEmits = {
|
|
23
23
|
'update:modelValue': [any]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { VvTabProps, VvTabEvents } from '@/components/VvTab'
|
|
3
|
-
import VvNav from '@/components/VvNav/VvNav.vue'
|
|
4
2
|
import type { NavItemTab } from '@/types/nav'
|
|
3
|
+
import VvNav from '@/components/VvNav/VvNav.vue'
|
|
4
|
+
import { VvTabEvents, VvTabProps } from '@/components/VvTab'
|
|
5
5
|
|
|
6
6
|
const props = defineProps(VvTabProps)
|
|
7
7
|
const emit = defineEmits(VvTabEvents)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { TextareaHTMLAttributes } from 'vue'
|
|
3
|
+
import { VvTextareaEvents, VvTextareaProps } from '.'
|
|
3
4
|
import HintSlotFactory from '../common/HintSlot'
|
|
4
5
|
import VvIcon from '../VvIcon/VvIcon.vue'
|
|
5
|
-
import { VvTextareaProps, VvTextareaEvents } from '.'
|
|
6
6
|
|
|
7
7
|
// props, emit and slots
|
|
8
8
|
const props = defineProps(VvTextareaProps)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtractPropTypes,
|
|
1
|
+
import type { ExtractPropTypes, Ref, Slots } from 'vue'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Merge array of string
|
|
@@ -14,18 +14,18 @@ function joinLines(items: string[] | string | unknown[] | undefined) {
|
|
|
14
14
|
|
|
15
15
|
export type HintSlotProps = Readonly<
|
|
16
16
|
ExtractPropTypes<{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
hintLabel: {
|
|
18
|
+
type: StringConstructor
|
|
19
|
+
default: ''
|
|
20
|
+
required: true
|
|
21
|
+
}
|
|
22
|
+
modelValue: unknown
|
|
23
|
+
valid: BooleanConstructor
|
|
24
|
+
validLabel: (StringConstructor | ArrayConstructor)[]
|
|
25
|
+
invalid: BooleanConstructor
|
|
26
|
+
invalidLabel: (StringConstructor | ArrayConstructor)[]
|
|
27
|
+
loading: BooleanConstructor
|
|
28
|
+
loadingLabel: StringConstructor
|
|
29
29
|
}>
|
|
30
30
|
>
|
|
31
31
|
|
|
@@ -60,7 +60,7 @@ export function HintSlotFactory(
|
|
|
60
60
|
() =>
|
|
61
61
|
!hasLoadingLabelOrSlot.value
|
|
62
62
|
&& Boolean(
|
|
63
|
-
|
|
63
|
+
props.value.invalid && (slots.invalid || invalidLabel.value),
|
|
64
64
|
),
|
|
65
65
|
)
|
|
66
66
|
const hasValidLabelOrSlot = computed(
|
package/src/components/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { default as VvDropdownItem } from './VvDropdown/VvDropdownItem.vue'
|
|
|
20
20
|
export { default as VvDropdownOptgroup } from './VvDropdown/VvDropdownOptgroup.vue'
|
|
21
21
|
export { default as VvDropdownOption } from './VvDropdown/VvDropdownOption.vue'
|
|
22
22
|
export { default as VvIcon } from './VvIcon/VvIcon.vue'
|
|
23
|
+
export { default as VvInputFile } from './VvInputFile/VvInputFile.vue'
|
|
23
24
|
export { default as VvInputText } from './VvInputText/VvInputText.vue'
|
|
24
25
|
export { default as VvNav } from './VvNav/VvNav.vue'
|
|
25
26
|
export { default as VvNavItem } from './VvNav/VvNavItem.vue'
|
|
@@ -31,4 +32,3 @@ export { default as VvSelect } from './VvSelect/VvSelect.vue'
|
|
|
31
32
|
export { default as VvTab } from './VvTab/VvTab.vue'
|
|
32
33
|
export { default as VvTextarea } from './VvTextarea/VvTextarea.vue'
|
|
33
34
|
export { default as VvTooltip } from './VvTooltip/VvTooltip.vue'
|
|
34
|
-
export { default as VvInputFile } from './VvInputFile/VvInputFile.vue'
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { Alert } from '@/types/alert'
|
|
1
2
|
import {
|
|
2
3
|
DEFAULT_ALERT_AUTO_CLOSE,
|
|
3
4
|
DEFAULT_ALERT_DISMISSABLE,
|
|
4
5
|
DEFAULT_ALERT_GROUP,
|
|
5
|
-
DEFAULT_ALERT_MODIFIERS,
|
|
6
6
|
DEFAULT_ALERT_INFO_ICON,
|
|
7
|
+
DEFAULT_ALERT_MODIFIERS,
|
|
7
8
|
DefaultAlertIconMap,
|
|
8
9
|
} from '@/constants'
|
|
9
|
-
import type { Alert } from '@/types/alert'
|
|
10
10
|
|
|
11
11
|
type AlertInGroup = Alert & { timestamp: number, group: string }
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Ref } from 'vue'
|
|
2
|
-
import mitt from 'mitt'
|
|
3
2
|
import { INJECTION_KEY_ALERT_GROUP } from '@/constants'
|
|
3
|
+
import mitt from 'mitt'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Share the alert group name with all its children.
|
|
7
7
|
* @param {Ref<string | undefined>} name the alert group name
|
|
8
8
|
*/
|
|
9
|
-
export function
|
|
9
|
+
export function useAlertProvideGroup({
|
|
10
10
|
name,
|
|
11
11
|
}: {
|
|
12
12
|
name: Ref<string | undefined>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type VvDropdown from '@/components/VvDropdown/VvDropdown.vue'
|
|
2
|
+
import { computed, getCurrentInstance, onMounted, onUnmounted, type Ref, unref } from 'vue'
|
|
3
|
+
|
|
4
|
+
export function useDropdownContextmenu(dropdownEl: Ref<typeof VvDropdown>, targetEl?: Ref<HTMLElement> | HTMLElement) {
|
|
5
|
+
const { x, y, getBoundingClientRect, onScroll } = useDropdownVirtualElement(dropdownEl)
|
|
6
|
+
const onContextmenu = (event: MouseEvent) => {
|
|
7
|
+
x.value = event.clientX
|
|
8
|
+
y.value = event.clientY
|
|
9
|
+
event.preventDefault()
|
|
10
|
+
dropdownEl.value.show()
|
|
11
|
+
}
|
|
12
|
+
const target = computed(() => unref(targetEl))
|
|
13
|
+
if (target && getCurrentInstance()) {
|
|
14
|
+
onMounted(() => {
|
|
15
|
+
target.value?.addEventListener('contextmenu', onContextmenu, false)
|
|
16
|
+
})
|
|
17
|
+
onUnmounted(() => {
|
|
18
|
+
target.value?.removeEventListener('contextmenu', onContextmenu)
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
return { x, y, getBoundingClientRect, onContextmenu, onScroll }
|
|
22
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { type Ref, Fragment } from 'vue'
|
|
2
1
|
import mitt from 'mitt'
|
|
2
|
+
import { Fragment, type Ref } from 'vue'
|
|
3
3
|
import {
|
|
4
|
+
ActionRoles,
|
|
5
|
+
DropdownItemRole,
|
|
4
6
|
type DropdownItemState,
|
|
5
|
-
|
|
7
|
+
DropdownRole,
|
|
6
8
|
INJECTION_KEY_DROPDOWN_ACTION,
|
|
7
9
|
INJECTION_KEY_DROPDOWN_ITEM,
|
|
8
|
-
|
|
9
|
-
DropdownItemRole,
|
|
10
|
-
ActionRoles,
|
|
10
|
+
INJECTION_KEY_DROPDOWN_TRIGGER,
|
|
11
11
|
} from '../../constants'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Share the dropdown reference and the event bus with all its children.
|
|
15
15
|
* @param {Ref<HTMLElement | null>} reference the dropdown reference
|
|
16
16
|
*/
|
|
17
|
-
export function
|
|
17
|
+
export function useDropdownProvideTrigger({
|
|
18
18
|
reference,
|
|
19
19
|
id,
|
|
20
20
|
expanded,
|
|
21
21
|
aria,
|
|
22
22
|
}: {
|
|
23
|
-
reference: Ref<HTMLElement | null>
|
|
23
|
+
reference: Ref<HTMLElement | null | undefined>
|
|
24
24
|
id: Ref<string | number>
|
|
25
25
|
expanded: Ref<boolean>
|
|
26
26
|
aria: Ref<{
|
|
@@ -60,7 +60,7 @@ export function useProvideDropdownTrigger({
|
|
|
60
60
|
* Share the dropdown item role with all its children.
|
|
61
61
|
* @param {Ref<string>} role the dropdown item role
|
|
62
62
|
*/
|
|
63
|
-
export function
|
|
63
|
+
export function useDropdownProvideItem({
|
|
64
64
|
role,
|
|
65
65
|
...others
|
|
66
66
|
}: Omit<DropdownItemState, 'role'> & {
|
|
@@ -82,7 +82,7 @@ export function useProvideDropdownItem({
|
|
|
82
82
|
* Share the dropdown item role with all its children.
|
|
83
83
|
* @param {Ref<string>} role the dropdown item role
|
|
84
84
|
*/
|
|
85
|
-
export function
|
|
85
|
+
export function useDropdownProvideAction({
|
|
86
86
|
expanded,
|
|
87
87
|
}: {
|
|
88
88
|
expanded?: Ref<boolean>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type VvDropdown from '@/components/VvDropdown/VvDropdown.vue'
|
|
2
|
+
import { onMounted, type Ref, ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
export function useDropdownVirtualElement(dropdownEl: Ref<typeof VvDropdown>) {
|
|
5
|
+
const x = ref(0)
|
|
6
|
+
const y = ref(0)
|
|
7
|
+
|
|
8
|
+
const scrollContainerEl = ref<HTMLElement>()
|
|
9
|
+
let scrollXDelta = 0
|
|
10
|
+
let scrollYDelta = 0
|
|
11
|
+
let lastScrollTop = 0
|
|
12
|
+
let lastScrollLeft = 0
|
|
13
|
+
const onScroll = (event: HTMLElementEventMap['scroll']) => {
|
|
14
|
+
const scrollEl = event.target as HTMLElement
|
|
15
|
+
scrollXDelta = scrollEl.scrollLeft - lastScrollLeft
|
|
16
|
+
scrollYDelta = scrollEl.scrollTop - lastScrollTop
|
|
17
|
+
y.value = y.value - scrollYDelta
|
|
18
|
+
x.value = x.value - scrollXDelta
|
|
19
|
+
lastScrollLeft = scrollEl.scrollLeft
|
|
20
|
+
lastScrollTop = scrollEl.scrollTop
|
|
21
|
+
}
|
|
22
|
+
const getBoundingClientRect = () => ({
|
|
23
|
+
width: 0,
|
|
24
|
+
height: 0,
|
|
25
|
+
x: x.value,
|
|
26
|
+
y: y.value,
|
|
27
|
+
top: y.value,
|
|
28
|
+
left: x.value,
|
|
29
|
+
right: x.value,
|
|
30
|
+
bottom: y.value,
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
if (getCurrentInstance()) {
|
|
34
|
+
onMounted(() => {
|
|
35
|
+
if (dropdownEl.value) {
|
|
36
|
+
dropdownEl.value.init({
|
|
37
|
+
getBoundingClientRect,
|
|
38
|
+
})
|
|
39
|
+
scrollContainerEl.value = findScrollContainer(dropdownEl.value.$el)
|
|
40
|
+
if (scrollContainerEl.value) {
|
|
41
|
+
scrollContainerEl.value.addEventListener('scroll', onScroll)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
onUnmounted(() => {
|
|
47
|
+
if (scrollContainerEl.value) {
|
|
48
|
+
scrollContainerEl.value.removeEventListener('scroll', onScroll)
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
return { x, y, getBoundingClientRect, onScroll }
|
|
53
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Injects a group state
|
|
5
5
|
*/
|
|
6
|
-
export function
|
|
6
|
+
export function useGroupStateInject<GroupStateType>(
|
|
7
7
|
groupKey: InjectionKey<GroupStateType>,
|
|
8
8
|
) {
|
|
9
9
|
// Get group state
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Ref, InjectionKey } from 'vue'
|
|
2
1
|
import type { Emitter } from 'mitt'
|
|
2
|
+
import type { InjectionKey, Ref } from 'vue'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Share part of the state of the component with all its children.
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
7
|
+
export function useGroupStateProvide<
|
|
8
8
|
TGroupState extends Record<
|
|
9
9
|
string,
|
|
10
10
|
Ref<unknown> | Emitter<any>
|
package/src/composables/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { wrap } from 'comlink'
|
|
2
|
-
import Pica from 'pica'
|
|
3
1
|
import type { BlurhashWorkerType } from '@/types/blurhash'
|
|
4
2
|
import BlurhashWorker from '@/workers/blurhash?worker&inline'
|
|
3
|
+
import { wrap } from 'comlink'
|
|
4
|
+
import Pica from 'pica'
|
|
5
5
|
|
|
6
6
|
const remoteFunction = wrap<BlurhashWorkerType>(new BlurhashWorker())
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Ref } from 'vue'
|
|
2
|
-
import { computed, isRef, ref, unref, watch } from 'vue'
|
|
3
2
|
import { StorageType } from '@/constants'
|
|
3
|
+
import { computed, isRef, ref, unref, watch } from 'vue'
|
|
4
4
|
|
|
5
5
|
export function usePersistence<T>(storageKey: Ref<string | undefined> | undefined, storageType: Ref<`${StorageType}`> | `${StorageType}` = StorageType.local, defaultValue?: T) {
|
|
6
6
|
const localValue: Ref<T | undefined> = ref()
|
|
@@ -35,8 +35,8 @@ export function useTextCount(
|
|
|
35
35
|
|
|
36
36
|
if (options?.mode === 'limit' && options?.upperLimit) {
|
|
37
37
|
return `${length.value} / ${
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
options.lowerLimit ? `${options.lowerLimit}-` : ''
|
|
39
|
+
}${options.upperLimit}`
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
if (options?.mode === 'countdown') {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Ref } from 'vue'
|
|
1
|
+
import { type Ref, useId } from 'vue'
|
|
3
2
|
|
|
4
3
|
export function useUniqueId(id?: Ref<string | number | undefined>) {
|
|
5
|
-
return computed(() => String(id?.value ||
|
|
4
|
+
return computed(() => String(id?.value || useId()))
|
|
6
5
|
}
|
package/src/constants.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { InjectionKey, Ref } from 'vue'
|
|
2
1
|
import type { Emitter } from 'mitt'
|
|
3
|
-
import type {
|
|
2
|
+
import type { InjectionKey, Ref } from 'vue'
|
|
4
3
|
import type {
|
|
5
4
|
AccordionGroupState,
|
|
6
|
-
InputGroupState,
|
|
7
|
-
ButtonGroupState,
|
|
8
5
|
AlertGroupState,
|
|
9
6
|
AlertModifier,
|
|
7
|
+
ButtonGroupState,
|
|
8
|
+
InputGroupState,
|
|
10
9
|
} from './types'
|
|
10
|
+
import type { Volver } from './Volver'
|
|
11
11
|
|
|
12
12
|
export const DEFAULT_ICONIFY_PROVIDER = 'vv'
|
|
13
13
|
|
|
@@ -98,7 +98,7 @@ export const INJECTION_KEY_ACCORDION_GROUP = Symbol.for(
|
|
|
98
98
|
// dropdown
|
|
99
99
|
export type DropdownTriggerState = {
|
|
100
100
|
id?: Ref<string | number>
|
|
101
|
-
reference?: Ref<HTMLElement | null>
|
|
101
|
+
reference?: Ref<HTMLElement | null | undefined>
|
|
102
102
|
bus?: Emitter<{
|
|
103
103
|
click: Event
|
|
104
104
|
mouseover: Event
|
package/src/directives/index.ts
CHANGED