@nuxt/ui 4.4.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/cli/package.json +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -3
- package/dist/runtime/components/Accordion.vue +12 -10
- package/dist/runtime/components/Alert.vue +12 -10
- package/dist/runtime/components/AuthForm.vue +19 -17
- package/dist/runtime/components/Avatar.vue +7 -5
- package/dist/runtime/components/AvatarGroup.vue +6 -4
- package/dist/runtime/components/Badge.vue +8 -6
- package/dist/runtime/components/Banner.vue +12 -10
- package/dist/runtime/components/BlogPost.d.vue.ts +3 -2
- package/dist/runtime/components/BlogPost.vue +16 -14
- package/dist/runtime/components/BlogPost.vue.d.ts +3 -2
- package/dist/runtime/components/BlogPosts.d.vue.ts +3 -0
- package/dist/runtime/components/BlogPosts.vue +5 -2
- package/dist/runtime/components/BlogPosts.vue.d.ts +3 -0
- package/dist/runtime/components/Breadcrumb.vue +12 -10
- package/dist/runtime/components/Button.vue +8 -6
- package/dist/runtime/components/Calendar.vue +15 -13
- package/dist/runtime/components/Card.vue +7 -5
- package/dist/runtime/components/Carousel.vue +13 -11
- package/dist/runtime/components/ChangelogVersion.d.vue.ts +2 -1
- package/dist/runtime/components/ChangelogVersion.vue +19 -17
- package/dist/runtime/components/ChangelogVersion.vue.d.ts +2 -1
- package/dist/runtime/components/ChangelogVersions.vue +7 -5
- package/dist/runtime/components/ChatMessage.vue +10 -8
- package/dist/runtime/components/ChatMessages.vue +16 -11
- package/dist/runtime/components/ChatPalette.vue +6 -4
- package/dist/runtime/components/ChatPrompt.vue +9 -6
- package/dist/runtime/components/ChatPromptSubmit.vue +5 -3
- package/dist/runtime/components/Checkbox.vue +19 -12
- package/dist/runtime/components/CheckboxGroup.d.vue.ts +5 -5
- package/dist/runtime/components/CheckboxGroup.vue +9 -7
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +5 -5
- package/dist/runtime/components/Chip.vue +5 -3
- package/dist/runtime/components/Collapsible.vue +5 -3
- package/dist/runtime/components/ColorPicker.vue +10 -8
- package/dist/runtime/components/CommandPalette.d.vue.ts +4 -4
- package/dist/runtime/components/CommandPalette.vue +33 -31
- package/dist/runtime/components/CommandPalette.vue.d.ts +4 -4
- package/dist/runtime/components/Container.d.vue.ts +3 -0
- package/dist/runtime/components/Container.vue +5 -2
- package/dist/runtime/components/Container.vue.d.ts +3 -0
- package/dist/runtime/components/ContextMenu.vue +5 -3
- package/dist/runtime/components/ContextMenuContent.vue +1 -0
- package/dist/runtime/components/DashboardGroup.d.vue.ts +3 -0
- package/dist/runtime/components/DashboardGroup.vue +4 -1
- package/dist/runtime/components/DashboardGroup.vue.d.ts +3 -0
- package/dist/runtime/components/DashboardNavbar.vue +10 -8
- package/dist/runtime/components/DashboardPanel.vue +6 -4
- package/dist/runtime/components/DashboardResizeHandle.d.vue.ts +3 -0
- package/dist/runtime/components/DashboardResizeHandle.vue +5 -2
- package/dist/runtime/components/DashboardResizeHandle.vue.d.ts +3 -0
- package/dist/runtime/components/DashboardSearch.vue +6 -3
- package/dist/runtime/components/DashboardSearchButton.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardSearchButton.vue +6 -4
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardSidebar.d.vue.ts +6 -1
- package/dist/runtime/components/DashboardSidebar.vue +16 -12
- package/dist/runtime/components/DashboardSidebar.vue.d.ts +6 -1
- package/dist/runtime/components/DashboardSidebarCollapse.d.vue.ts +3 -0
- package/dist/runtime/components/DashboardSidebarCollapse.vue +4 -2
- package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +3 -0
- package/dist/runtime/components/DashboardSidebarToggle.d.vue.ts +3 -0
- package/dist/runtime/components/DashboardSidebarToggle.vue +4 -2
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +3 -0
- package/dist/runtime/components/DashboardToolbar.vue +6 -4
- package/dist/runtime/components/Drawer.d.vue.ts +1 -1
- package/dist/runtime/components/Drawer.vue +16 -11
- package/dist/runtime/components/Drawer.vue.d.ts +1 -1
- package/dist/runtime/components/DropdownMenu.vue +6 -4
- package/dist/runtime/components/DropdownMenuContent.vue +1 -0
- package/dist/runtime/components/Editor.d.vue.ts +2 -1
- package/dist/runtime/components/Editor.vue +16 -4
- package/dist/runtime/components/Editor.vue.d.ts +2 -1
- package/dist/runtime/components/EditorDragHandle.d.vue.ts +13 -1
- package/dist/runtime/components/EditorDragHandle.vue +17 -8
- package/dist/runtime/components/EditorDragHandle.vue.d.ts +13 -1
- package/dist/runtime/components/EditorEmojiMenu.vue +1 -1
- package/dist/runtime/components/EditorMentionMenu.d.vue.ts +1 -1
- package/dist/runtime/components/EditorMentionMenu.vue +5 -2
- package/dist/runtime/components/EditorMentionMenu.vue.d.ts +1 -1
- package/dist/runtime/components/EditorSuggestionMenu.vue +1 -1
- package/dist/runtime/components/EditorToolbar.vue +10 -7
- package/dist/runtime/components/Empty.vue +11 -9
- package/dist/runtime/components/Error.vue +8 -6
- package/dist/runtime/components/FieldGroup.d.vue.ts +3 -1
- package/dist/runtime/components/FieldGroup.vue +4 -2
- package/dist/runtime/components/FieldGroup.vue.d.ts +3 -1
- package/dist/runtime/components/FileUpload.d.vue.ts +1 -1
- package/dist/runtime/components/FileUpload.vue +18 -16
- package/dist/runtime/components/FileUpload.vue.d.ts +1 -1
- package/dist/runtime/components/Footer.vue +10 -8
- package/dist/runtime/components/FooterColumns.vue +14 -12
- package/dist/runtime/components/Form.d.vue.ts +3 -0
- package/dist/runtime/components/Form.vue +10 -2
- package/dist/runtime/components/Form.vue.d.ts +3 -0
- package/dist/runtime/components/FormField.vue +12 -10
- package/dist/runtime/components/Header.d.vue.ts +6 -1
- package/dist/runtime/components/Header.vue +16 -12
- package/dist/runtime/components/Header.vue.d.ts +6 -1
- package/dist/runtime/components/Input.d.vue.ts +53 -11
- package/dist/runtime/components/Input.vue +16 -12
- package/dist/runtime/components/Input.vue.d.ts +53 -11
- package/dist/runtime/components/InputDate.d.vue.ts +2 -0
- package/dist/runtime/components/InputDate.vue +18 -11
- package/dist/runtime/components/InputDate.vue.d.ts +2 -0
- package/dist/runtime/components/InputMenu.d.vue.ts +153 -25
- package/dist/runtime/components/InputMenu.vue +51 -58
- package/dist/runtime/components/InputMenu.vue.d.ts +153 -25
- package/dist/runtime/components/InputNumber.d.vue.ts +15 -8
- package/dist/runtime/components/InputNumber.vue +23 -14
- package/dist/runtime/components/InputNumber.vue.d.ts +15 -8
- package/dist/runtime/components/InputTags.d.vue.ts +2 -0
- package/dist/runtime/components/InputTags.vue +16 -12
- package/dist/runtime/components/InputTags.vue.d.ts +2 -0
- package/dist/runtime/components/InputTime.d.vue.ts +6 -4
- package/dist/runtime/components/InputTime.vue +18 -10
- package/dist/runtime/components/InputTime.vue.d.ts +6 -4
- package/dist/runtime/components/Kbd.d.vue.ts +3 -0
- package/dist/runtime/components/Kbd.vue +5 -2
- package/dist/runtime/components/Kbd.vue.d.ts +3 -0
- package/dist/runtime/components/Link.d.vue.ts +1 -1
- package/dist/runtime/components/Link.vue +7 -7
- package/dist/runtime/components/Link.vue.d.ts +1 -1
- package/dist/runtime/components/Main.d.vue.ts +3 -0
- package/dist/runtime/components/Main.vue +5 -2
- package/dist/runtime/components/Main.vue.d.ts +3 -0
- package/dist/runtime/components/Marquee.vue +5 -3
- package/dist/runtime/components/Modal.d.vue.ts +2 -2
- package/dist/runtime/components/Modal.vue +17 -24
- package/dist/runtime/components/Modal.vue.d.ts +2 -2
- package/dist/runtime/components/NavigationMenu.d.vue.ts +13 -6
- package/dist/runtime/components/NavigationMenu.vue +77 -53
- package/dist/runtime/components/NavigationMenu.vue.d.ts +13 -6
- package/dist/runtime/components/Page.vue +7 -5
- package/dist/runtime/components/PageAnchors.vue +11 -9
- package/dist/runtime/components/PageAside.vue +9 -7
- package/dist/runtime/components/PageBody.d.vue.ts +3 -0
- package/dist/runtime/components/PageBody.vue +5 -2
- package/dist/runtime/components/PageBody.vue.d.ts +3 -0
- package/dist/runtime/components/PageCTA.vue +12 -10
- package/dist/runtime/components/PageCard.vue +14 -12
- package/dist/runtime/components/PageColumns.d.vue.ts +3 -0
- package/dist/runtime/components/PageColumns.vue +5 -2
- package/dist/runtime/components/PageColumns.vue.d.ts +3 -0
- package/dist/runtime/components/PageFeature.vue +9 -7
- package/dist/runtime/components/PageGrid.d.vue.ts +3 -0
- package/dist/runtime/components/PageGrid.vue +5 -2
- package/dist/runtime/components/PageGrid.vue.d.ts +3 -0
- package/dist/runtime/components/PageHeader.vue +10 -8
- package/dist/runtime/components/PageHero.vue +13 -11
- package/dist/runtime/components/PageLinks.vue +11 -9
- package/dist/runtime/components/PageList.d.vue.ts +3 -0
- package/dist/runtime/components/PageList.vue +5 -2
- package/dist/runtime/components/PageList.vue.d.ts +3 -0
- package/dist/runtime/components/PageLogos.vue +9 -7
- package/dist/runtime/components/PageSection.d.vue.ts +1 -1
- package/dist/runtime/components/PageSection.vue +16 -14
- package/dist/runtime/components/PageSection.vue.d.ts +1 -1
- package/dist/runtime/components/Pagination.d.vue.ts +1 -1
- package/dist/runtime/components/Pagination.vue +11 -9
- package/dist/runtime/components/Pagination.vue.d.ts +1 -1
- package/dist/runtime/components/PinInput.d.vue.ts +2 -0
- package/dist/runtime/components/PinInput.vue +12 -5
- package/dist/runtime/components/PinInput.vue.d.ts +2 -0
- package/dist/runtime/components/Popover.vue +8 -3
- package/dist/runtime/components/PricingPlan.vue +24 -22
- package/dist/runtime/components/PricingPlans.d.vue.ts +3 -0
- package/dist/runtime/components/PricingPlans.vue +5 -2
- package/dist/runtime/components/PricingPlans.vue.d.ts +3 -0
- package/dist/runtime/components/PricingTable.vue +38 -36
- package/dist/runtime/components/Progress.vue +9 -7
- package/dist/runtime/components/RadioGroup.d.vue.ts +2 -2
- package/dist/runtime/components/RadioGroup.vue +13 -11
- package/dist/runtime/components/RadioGroup.vue.d.ts +2 -2
- package/dist/runtime/components/ScrollArea.d.vue.ts +7 -0
- package/dist/runtime/components/ScrollArea.vue +35 -11
- package/dist/runtime/components/ScrollArea.vue.d.ts +7 -0
- package/dist/runtime/components/Select.d.vue.ts +64 -25
- package/dist/runtime/components/Select.vue +34 -35
- package/dist/runtime/components/Select.vue.d.ts +64 -25
- package/dist/runtime/components/SelectMenu.d.vue.ts +115 -30
- package/dist/runtime/components/SelectMenu.vue +51 -57
- package/dist/runtime/components/SelectMenu.vue.d.ts +115 -30
- package/dist/runtime/components/Separator.vue +9 -7
- package/dist/runtime/components/Skeleton.d.vue.ts +3 -0
- package/dist/runtime/components/Skeleton.vue +5 -2
- package/dist/runtime/components/Skeleton.vue.d.ts +3 -0
- package/dist/runtime/components/Slideover.d.vue.ts +3 -3
- package/dist/runtime/components/Slideover.vue +16 -11
- package/dist/runtime/components/Slideover.vue.d.ts +3 -3
- package/dist/runtime/components/Slider.d.vue.ts +1 -1
- package/dist/runtime/components/Slider.vue +8 -6
- package/dist/runtime/components/Slider.vue.d.ts +1 -1
- package/dist/runtime/components/Stepper.d.vue.ts +1 -1
- package/dist/runtime/components/Stepper.vue +15 -13
- package/dist/runtime/components/Stepper.vue.d.ts +1 -1
- package/dist/runtime/components/Switch.vue +20 -13
- package/dist/runtime/components/Table.d.vue.ts +1 -1
- package/dist/runtime/components/Table.vue +26 -24
- package/dist/runtime/components/Table.vue.d.ts +1 -1
- package/dist/runtime/components/Tabs.vue +17 -12
- package/dist/runtime/components/Textarea.d.vue.ts +53 -11
- package/dist/runtime/components/Textarea.vue +16 -12
- package/dist/runtime/components/Textarea.vue.d.ts +53 -11
- package/dist/runtime/components/Theme.d.vue.ts +17 -0
- package/dist/runtime/components/Theme.vue +17 -0
- package/dist/runtime/components/Theme.vue.d.ts +17 -0
- package/dist/runtime/components/Timeline.d.vue.ts +1 -1
- package/dist/runtime/components/Timeline.vue +12 -10
- package/dist/runtime/components/Timeline.vue.d.ts +1 -1
- package/dist/runtime/components/Toast.vue +16 -16
- package/dist/runtime/components/Toaster.vue +7 -4
- package/dist/runtime/components/Tooltip.vue +8 -6
- package/dist/runtime/components/Tree.vue +13 -11
- package/dist/runtime/components/User.vue +9 -7
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +1 -1
- package/dist/runtime/components/color-mode/ColorModeButton.vue +5 -3
- package/dist/runtime/components/color-mode/ColorModeImage.vue +8 -3
- package/dist/runtime/components/color-mode/ColorModeSelect.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +1 -1
- package/dist/runtime/components/content/ContentNavigation.vue +21 -19
- package/dist/runtime/components/content/ContentSearch.d.vue.ts +1 -1
- package/dist/runtime/components/content/ContentSearch.vue +6 -3
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +1 -1
- package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +1 -1
- package/dist/runtime/components/content/ContentSearchButton.vue +6 -4
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +1 -1
- package/dist/runtime/components/content/ContentSurround.vue +9 -7
- package/dist/runtime/components/content/ContentToc.vue +18 -16
- package/dist/runtime/components/locale/LocaleSelect.d.vue.ts +1 -1
- package/dist/runtime/components/locale/LocaleSelect.vue +2 -2
- package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +1 -1
- package/dist/runtime/components/prose/A.d.vue.ts +3 -0
- package/dist/runtime/components/prose/A.vue +7 -4
- package/dist/runtime/components/prose/A.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Accordion.vue +4 -2
- package/dist/runtime/components/prose/AccordionItem.d.vue.ts +3 -0
- package/dist/runtime/components/prose/AccordionItem.vue +5 -2
- package/dist/runtime/components/prose/AccordionItem.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Badge.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Badge.vue +5 -2
- package/dist/runtime/components/prose/Badge.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Blockquote.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Blockquote.vue +5 -2
- package/dist/runtime/components/prose/Blockquote.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Callout.vue +6 -4
- package/dist/runtime/components/prose/Card.vue +8 -6
- package/dist/runtime/components/prose/CardGroup.d.vue.ts +3 -0
- package/dist/runtime/components/prose/CardGroup.vue +5 -2
- package/dist/runtime/components/prose/CardGroup.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Code.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Code.vue +5 -2
- package/dist/runtime/components/prose/Code.vue.d.ts +3 -0
- package/dist/runtime/components/prose/CodeCollapse.vue +7 -5
- package/dist/runtime/components/prose/CodeGroup.vue +9 -7
- package/dist/runtime/components/prose/CodePreview.vue +6 -4
- package/dist/runtime/components/prose/CodeTree.vue +14 -12
- package/dist/runtime/components/prose/Collapsible.vue +7 -5
- package/dist/runtime/components/prose/Em.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Em.vue +5 -2
- package/dist/runtime/components/prose/Em.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Field.vue +10 -8
- package/dist/runtime/components/prose/FieldGroup.d.vue.ts +3 -0
- package/dist/runtime/components/prose/FieldGroup.vue +5 -2
- package/dist/runtime/components/prose/FieldGroup.vue.d.ts +3 -0
- package/dist/runtime/components/prose/H1.vue +5 -3
- package/dist/runtime/components/prose/H2.vue +7 -5
- package/dist/runtime/components/prose/H3.vue +7 -5
- package/dist/runtime/components/prose/H4.vue +5 -3
- package/dist/runtime/components/prose/Hr.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Hr.vue +5 -2
- package/dist/runtime/components/prose/Hr.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Icon.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Icon.vue +5 -2
- package/dist/runtime/components/prose/Icon.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Img.vue +9 -15
- package/dist/runtime/components/prose/Kbd.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Kbd.vue +5 -2
- package/dist/runtime/components/prose/Kbd.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Li.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Li.vue +5 -2
- package/dist/runtime/components/prose/Li.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Ol.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Ol.vue +5 -2
- package/dist/runtime/components/prose/Ol.vue.d.ts +3 -0
- package/dist/runtime/components/prose/P.d.vue.ts +3 -0
- package/dist/runtime/components/prose/P.vue +5 -2
- package/dist/runtime/components/prose/P.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Pre.vue +9 -7
- package/dist/runtime/components/prose/Steps.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Steps.vue +5 -2
- package/dist/runtime/components/prose/Steps.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Strong.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Strong.vue +5 -2
- package/dist/runtime/components/prose/Strong.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Table.vue +5 -3
- package/dist/runtime/components/prose/Tabs.vue +4 -2
- package/dist/runtime/components/prose/TabsItem.d.vue.ts +3 -0
- package/dist/runtime/components/prose/TabsItem.vue +5 -2
- package/dist/runtime/components/prose/TabsItem.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Tbody.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Tbody.vue +5 -2
- package/dist/runtime/components/prose/Tbody.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Td.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Td.vue +5 -2
- package/dist/runtime/components/prose/Td.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Th.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Th.vue +5 -2
- package/dist/runtime/components/prose/Th.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Thead.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Thead.vue +5 -2
- package/dist/runtime/components/prose/Thead.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Tr.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Tr.vue +5 -2
- package/dist/runtime/components/prose/Tr.vue.d.ts +3 -0
- package/dist/runtime/components/prose/Ul.d.vue.ts +3 -0
- package/dist/runtime/components/prose/Ul.vue +5 -2
- package/dist/runtime/components/prose/Ul.vue.d.ts +3 -0
- package/dist/runtime/composables/defineShortcuts.js +4 -1
- package/dist/runtime/composables/internal/useFilter.d.ts +9 -0
- package/dist/runtime/composables/internal/useFilter.js +60 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useComponentUI.d.ts +33 -0
- package/dist/runtime/composables/useComponentUI.js +13 -0
- package/dist/runtime/composables/useEditorMenu.js +27 -10
- package/dist/runtime/composables/useFieldGroup.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +1 -1
- package/dist/runtime/composables/useToast.d.ts +4 -0
- package/dist/runtime/composables/useToast.js +25 -1
- package/dist/runtime/keyframes.css +1 -1
- package/dist/runtime/locale/be.d.ts +3 -0
- package/dist/runtime/locale/be.js +129 -0
- package/dist/runtime/locale/index.d.ts +1 -0
- package/dist/runtime/locale/index.js +1 -0
- package/dist/runtime/types/html.d.ts +3 -1
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/input.d.ts +16 -6
- package/dist/runtime/types/utils.d.ts +10 -8
- package/dist/runtime/utils/index.d.ts +1 -0
- package/dist/runtime/utils/index.js +10 -0
- package/dist/runtime/utils/overlay.d.ts +19 -0
- package/dist/runtime/utils/overlay.js +13 -0
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +2 -2
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +1 -1
- package/dist/runtime/vue/overrides/inertia/Link.d.vue.ts +1 -1
- package/dist/runtime/vue/overrides/inertia/Link.vue +4 -2
- package/dist/runtime/vue/overrides/inertia/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/overrides/none/Link.d.vue.ts +1 -1
- package/dist/runtime/vue/overrides/none/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/overrides/vue-router/Link.d.vue.ts +1 -1
- package/dist/runtime/vue/overrides/vue-router/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/stubs/base.d.ts +6 -0
- package/dist/runtime/vue/stubs/base.js +8 -0
- package/dist/shared/{ui.Ddb3hKxo.mjs → ui.BrgdrRzy.mjs} +99 -51
- package/dist/unplugin.d.mts +1 -1
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +50 -51
|
@@ -3,11 +3,12 @@ import theme from "#build/ui/scroll-area";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { computed, toRef, useTemplateRef, watch } from "vue";
|
|
6
|
+
import { computed, onMounted, onUnmounted, toRef, useTemplateRef, watch } from "vue";
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { defu } from "defu";
|
|
9
9
|
import { useVirtualizer } from "@tanstack/vue-virtual";
|
|
10
10
|
import { useAppConfig } from "#imports";
|
|
11
|
+
import { useComponentUI } from "../composables/useComponentUI";
|
|
11
12
|
import { tv } from "../utils/tv";
|
|
12
13
|
import { useLocale } from "../composables/useLocale";
|
|
13
14
|
const props = defineProps({
|
|
@@ -16,12 +17,13 @@ const props = defineProps({
|
|
|
16
17
|
items: { type: Array, required: false },
|
|
17
18
|
virtualize: { type: [Boolean, Object], required: false, default: false },
|
|
18
19
|
class: { type: null, required: false },
|
|
19
|
-
ui: { type:
|
|
20
|
+
ui: { type: Object, required: false }
|
|
20
21
|
});
|
|
21
22
|
defineSlots();
|
|
22
23
|
const emits = defineEmits(["scroll"]);
|
|
23
24
|
const { dir } = useLocale();
|
|
24
25
|
const appConfig = useAppConfig();
|
|
26
|
+
const uiProp = useComponentUI("scrollArea", props);
|
|
25
27
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.scrollArea || {} })({
|
|
26
28
|
orientation: props.orientation
|
|
27
29
|
}));
|
|
@@ -44,6 +46,9 @@ const lanes = computed(() => {
|
|
|
44
46
|
const value = virtualizerProps.value.lanes;
|
|
45
47
|
return typeof value === "number" ? value : void 0;
|
|
46
48
|
});
|
|
49
|
+
const skipMeasurement = computed(() => {
|
|
50
|
+
return typeof props.virtualize === "object" && props.virtualize.skipMeasurement === true;
|
|
51
|
+
});
|
|
47
52
|
const virtualizer = !!props.virtualize && useVirtualizer({
|
|
48
53
|
...virtualizerProps.value,
|
|
49
54
|
get overscan() {
|
|
@@ -101,13 +106,32 @@ function getVirtualItemStyle(virtualItem) {
|
|
|
101
106
|
transform: isHorizontal.value ? `translateX(${isRtl.value ? -virtualItem.start : virtualItem.start}px)` : `translateY(${virtualItem.start}px)`
|
|
102
107
|
};
|
|
103
108
|
}
|
|
104
|
-
|
|
109
|
+
let resizeObserver = null;
|
|
110
|
+
let rafId = null;
|
|
111
|
+
onMounted(() => {
|
|
105
112
|
if (virtualizer) {
|
|
106
|
-
|
|
113
|
+
const el = rootRef.value?.$el;
|
|
114
|
+
if (el) {
|
|
115
|
+
resizeObserver = new ResizeObserver(() => {
|
|
116
|
+
if (rafId !== null) return;
|
|
117
|
+
rafId = requestAnimationFrame(() => {
|
|
118
|
+
rafId = null;
|
|
119
|
+
virtualizer.value.measure();
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
resizeObserver.observe(el);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
onUnmounted(() => {
|
|
127
|
+
if (rafId !== null) {
|
|
128
|
+
cancelAnimationFrame(rafId);
|
|
129
|
+
rafId = null;
|
|
107
130
|
}
|
|
108
|
-
|
|
131
|
+
resizeObserver?.disconnect();
|
|
132
|
+
});
|
|
109
133
|
function measureElement(el) {
|
|
110
|
-
if (el && virtualizer) {
|
|
134
|
+
if (el && virtualizer && !skipMeasurement.value) {
|
|
111
135
|
const element = el instanceof Element ? el : el.$el;
|
|
112
136
|
virtualizer.value.measureElement(element);
|
|
113
137
|
}
|
|
@@ -139,12 +163,12 @@ defineExpose({
|
|
|
139
163
|
:as="as"
|
|
140
164
|
data-slot="root"
|
|
141
165
|
:data-orientation="orientation"
|
|
142
|
-
:class="ui.root({ class: [
|
|
166
|
+
:class="ui.root({ class: [uiProp?.root, props.class] })"
|
|
143
167
|
>
|
|
144
168
|
<template v-if="virtualizer">
|
|
145
169
|
<div
|
|
146
170
|
data-slot="viewport"
|
|
147
|
-
:class="ui.viewport({ class:
|
|
171
|
+
:class="ui.viewport({ class: uiProp?.viewport })"
|
|
148
172
|
:style="virtualViewportStyle"
|
|
149
173
|
>
|
|
150
174
|
<div
|
|
@@ -153,7 +177,7 @@ defineExpose({
|
|
|
153
177
|
:ref="measureElement"
|
|
154
178
|
:data-index="virtualItem.index"
|
|
155
179
|
data-slot="item"
|
|
156
|
-
:class="ui.item({ class:
|
|
180
|
+
:class="ui.item({ class: uiProp?.item })"
|
|
157
181
|
:style="getVirtualItemStyle(virtualItem)"
|
|
158
182
|
>
|
|
159
183
|
<slot
|
|
@@ -166,13 +190,13 @@ defineExpose({
|
|
|
166
190
|
</template>
|
|
167
191
|
|
|
168
192
|
<template v-else>
|
|
169
|
-
<div data-slot="viewport" :class="ui.viewport({ class:
|
|
193
|
+
<div data-slot="viewport" :class="ui.viewport({ class: uiProp?.viewport })">
|
|
170
194
|
<template v-if="items?.length">
|
|
171
195
|
<div
|
|
172
196
|
v-for="(item, index) in items"
|
|
173
197
|
:key="getItemKey(item, index)"
|
|
174
198
|
data-slot="item"
|
|
175
|
-
:class="ui.item({ class:
|
|
199
|
+
:class="ui.item({ class: uiProp?.item })"
|
|
176
200
|
>
|
|
177
201
|
<slot :item="item" :index="index" />
|
|
178
202
|
</div>
|
|
@@ -20,6 +20,13 @@ export interface ScrollAreaVirtualizeOptions extends Partial<Omit<VirtualizerOpt
|
|
|
20
20
|
* @defaultValue undefined
|
|
21
21
|
*/
|
|
22
22
|
lanes?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Skip per-item DOM measurement for uniform-height items.
|
|
25
|
+
* When `true`, uses `estimateSize` only — significantly improving performance for uniform items.
|
|
26
|
+
* When `false` (default), measures each item for variable-height layouts (e.g., masonry).
|
|
27
|
+
* @defaultValue false
|
|
28
|
+
*/
|
|
29
|
+
skipMeasurement?: boolean;
|
|
23
30
|
}
|
|
24
31
|
export type ScrollAreaItem = any;
|
|
25
32
|
export interface ScrollAreaProps<T extends ScrollAreaItem = ScrollAreaItem> {
|
|
@@ -3,9 +3,9 @@ import type { AppConfig } from '@nuxt/schema';
|
|
|
3
3
|
import theme from '#build/ui/select';
|
|
4
4
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
5
5
|
import type { AvatarProps, ChipProps, IconProps } from '../types';
|
|
6
|
-
import type { ModelModifiers } from '../types/input';
|
|
6
|
+
import type { ModelModifiers, ApplyModifiers } from '../types/input';
|
|
7
7
|
import type { ButtonHTMLAttributes } from '../types/html';
|
|
8
|
-
import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetModelValue,
|
|
8
|
+
import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetModelValue, NestedItem, EmitsToProps } from '../types/utils';
|
|
9
9
|
import type { ComponentConfig } from '../types/tv';
|
|
10
10
|
type Select = ComponentConfig<typeof theme, AppConfig, 'select'>;
|
|
11
11
|
export type SelectValue = AcceptableValue;
|
|
@@ -30,7 +30,10 @@ export type SelectItem = SelectValue | {
|
|
|
30
30
|
ui?: Pick<Select['slots'], 'label' | 'separator' | 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChipSize' | 'itemLeadingChip' | 'itemWrapper' | 'itemLabel' | 'itemDescription' | 'itemTrailing' | 'itemTrailingIcon'>;
|
|
31
31
|
[key: string]: any;
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
type ExcludeItem = {
|
|
34
|
+
type: 'label' | 'separator';
|
|
35
|
+
};
|
|
36
|
+
export interface SelectProps<T extends ArrayOrNested<SelectItem> = ArrayOrNested<SelectItem>, VK extends GetItemKeys<T> = 'value', M extends boolean = false, Mod extends Omit<ModelModifiers, 'lazy'> = Omit<ModelModifiers, 'lazy'>> extends Omit<SelectRootProps<T>, 'dir' | 'multiple' | 'modelValue' | 'defaultValue' | 'by'>, UseComponentIconsProps, /** @vue-ignore */ Omit<ButtonHTMLAttributes, 'type' | 'disabled' | 'name'> {
|
|
34
37
|
id?: string;
|
|
35
38
|
/** The placeholder text when the select is empty. */
|
|
36
39
|
placeholder?: string;
|
|
@@ -90,17 +93,12 @@ export interface SelectProps<T extends ArrayOrNested<SelectItem> = ArrayOrNested
|
|
|
90
93
|
descriptionKey?: GetItemKeys<T>;
|
|
91
94
|
items?: T;
|
|
92
95
|
/** The value of the Select when initially rendered. Use when you do not need to control the state of the Select. */
|
|
93
|
-
defaultValue?: GetModelValue<T, VK, M>;
|
|
96
|
+
defaultValue?: ApplyModifiers<GetModelValue<T, VK, M, ExcludeItem>, Mod>;
|
|
94
97
|
/** The controlled value of the Select. Can be bind as `v-model`. */
|
|
95
|
-
modelValue?: GetModelValue<T, VK, M>;
|
|
96
|
-
modelModifiers?:
|
|
98
|
+
modelValue?: ApplyModifiers<GetModelValue<T, VK, M, ExcludeItem>, Mod>;
|
|
99
|
+
modelModifiers?: Mod;
|
|
97
100
|
/** Whether multiple options can be selected or not. */
|
|
98
101
|
multiple?: M & boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Use a custom comparator to compare objects.
|
|
101
|
-
* This can be a string (key) or a function that compares two objects.
|
|
102
|
-
*/
|
|
103
|
-
by?: string | ((a: any, b: any) => boolean);
|
|
104
102
|
/** Highlight the ring color like a focus state. */
|
|
105
103
|
highlight?: boolean;
|
|
106
104
|
autofocus?: boolean;
|
|
@@ -108,29 +106,30 @@ export interface SelectProps<T extends ArrayOrNested<SelectItem> = ArrayOrNested
|
|
|
108
106
|
class?: any;
|
|
109
107
|
ui?: Select['slots'];
|
|
110
108
|
}
|
|
111
|
-
export
|
|
112
|
-
change: [event: Event];
|
|
113
|
-
blur: [event: FocusEvent];
|
|
114
|
-
focus: [event: FocusEvent];
|
|
115
|
-
|
|
109
|
+
export interface SelectEmits<A extends ArrayOrNested<SelectItem>, VK extends GetItemKeys<A> | undefined, M extends boolean, Mod extends Omit<ModelModifiers, 'lazy'> = Omit<ModelModifiers, 'lazy'>> extends Omit<SelectRootEmits, 'update:modelValue'> {
|
|
110
|
+
'change': [event: Event];
|
|
111
|
+
'blur': [event: FocusEvent];
|
|
112
|
+
'focus': [event: FocusEvent];
|
|
113
|
+
'update:modelValue': [value: ApplyModifiers<GetModelValue<A, VK, M, ExcludeItem>, Mod>];
|
|
114
|
+
}
|
|
116
115
|
type SlotProps<T extends SelectItem> = (props: {
|
|
117
116
|
item: T;
|
|
118
117
|
index: number;
|
|
119
118
|
ui: Select['ui'];
|
|
120
119
|
}) => any;
|
|
121
|
-
export interface SelectSlots<A extends ArrayOrNested<SelectItem> = ArrayOrNested<SelectItem>, VK extends GetItemKeys<A> | undefined = undefined, M extends boolean = false, T extends NestedItem<A> = NestedItem<A>> {
|
|
120
|
+
export interface SelectSlots<A extends ArrayOrNested<SelectItem> = ArrayOrNested<SelectItem>, VK extends GetItemKeys<A> | undefined = undefined, M extends boolean = false, Mod extends Omit<ModelModifiers, 'lazy'> = Omit<ModelModifiers, 'lazy'>, T extends NestedItem<A> = NestedItem<A>> {
|
|
122
121
|
'leading'(props: {
|
|
123
|
-
modelValue?: GetModelValue<A, VK, M>;
|
|
122
|
+
modelValue?: ApplyModifiers<GetModelValue<A, VK, M, ExcludeItem>, Mod>;
|
|
124
123
|
open: boolean;
|
|
125
124
|
ui: Select['ui'];
|
|
126
125
|
}): any;
|
|
127
126
|
'default'(props: {
|
|
128
|
-
modelValue?: GetModelValue<A, VK, M>;
|
|
127
|
+
modelValue?: ApplyModifiers<GetModelValue<A, VK, M, ExcludeItem>, Mod>;
|
|
129
128
|
open: boolean;
|
|
130
129
|
ui: Select['ui'];
|
|
131
130
|
}): any;
|
|
132
131
|
'trailing'(props: {
|
|
133
|
-
modelValue?: GetModelValue<A, VK, M>;
|
|
132
|
+
modelValue?: ApplyModifiers<GetModelValue<A, VK, M, ExcludeItem>, Mod>;
|
|
134
133
|
open: boolean;
|
|
135
134
|
ui: Select['ui'];
|
|
136
135
|
}): any;
|
|
@@ -150,13 +149,33 @@ export interface SelectSlots<A extends ArrayOrNested<SelectItem> = ArrayOrNested
|
|
|
150
149
|
}
|
|
151
150
|
declare const _default: typeof __VLS_export;
|
|
152
151
|
export default _default;
|
|
153
|
-
declare const __VLS_export: <T extends ArrayOrNested<SelectItem>, VK extends GetItemKeys<T> = "value", M extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
154
|
-
props: import("vue").PublicProps & __VLS_PrettifyLocal<SelectProps<T, VK, M> & {
|
|
152
|
+
declare const __VLS_export: <T extends ArrayOrNested<SelectItem>, VK extends GetItemKeys<T> = "value", M extends boolean = false, Mod extends Omit<ModelModifiers, "lazy"> = Omit<ModelModifiers, "lazy">>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
153
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<SelectProps<T, VK, M, Mod> & {
|
|
155
154
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
156
155
|
onChange?: ((event: Event) => any) | undefined;
|
|
157
156
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
158
157
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
159
|
-
"onUpdate:modelValue"?: ((value:
|
|
158
|
+
"onUpdate:modelValue"?: ((value: Mod extends {
|
|
159
|
+
number: true;
|
|
160
|
+
} ? (Mod extends {
|
|
161
|
+
optional: true;
|
|
162
|
+
} ? (Mod extends {
|
|
163
|
+
nullable: true;
|
|
164
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
165
|
+
nullable: true;
|
|
166
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) extends infer T_1 ? T_1 extends (Mod extends {
|
|
167
|
+
optional: true;
|
|
168
|
+
} ? (Mod extends {
|
|
169
|
+
nullable: true;
|
|
170
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
171
|
+
nullable: true;
|
|
172
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) ? T_1 extends string ? number | T_1 : T_1 : never : never : Mod extends {
|
|
173
|
+
optional: true;
|
|
174
|
+
} ? (Mod extends {
|
|
175
|
+
nullable: true;
|
|
176
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
177
|
+
nullable: true;
|
|
178
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) => any) | undefined;
|
|
160
179
|
}> & (typeof globalThis extends {
|
|
161
180
|
__VLS_PROPS_FALLBACK: infer P;
|
|
162
181
|
} ? P : {});
|
|
@@ -165,8 +184,28 @@ declare const __VLS_export: <T extends ArrayOrNested<SelectItem>, VK extends Get
|
|
|
165
184
|
viewportRef: Readonly<import("vue").Ref<HTMLDivElement | null, HTMLDivElement | null>>;
|
|
166
185
|
}>) => void;
|
|
167
186
|
attrs: any;
|
|
168
|
-
slots: SelectSlots<T, VK, M, NestedItem<T>>;
|
|
169
|
-
emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", value:
|
|
187
|
+
slots: SelectSlots<T, VK, M, Mod, NestedItem<T>>;
|
|
188
|
+
emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", value: Mod extends {
|
|
189
|
+
number: true;
|
|
190
|
+
} ? (Mod extends {
|
|
191
|
+
optional: true;
|
|
192
|
+
} ? (Mod extends {
|
|
193
|
+
nullable: true;
|
|
194
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
195
|
+
nullable: true;
|
|
196
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) extends infer T_1 ? T_1 extends (Mod extends {
|
|
197
|
+
optional: true;
|
|
198
|
+
} ? (Mod extends {
|
|
199
|
+
nullable: true;
|
|
200
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
201
|
+
nullable: true;
|
|
202
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) ? T_1 extends string ? number | T_1 : T_1 : never : never : Mod extends {
|
|
203
|
+
optional: true;
|
|
204
|
+
} ? (Mod extends {
|
|
205
|
+
nullable: true;
|
|
206
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
207
|
+
nullable: true;
|
|
208
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) => void);
|
|
170
209
|
}>) => import("vue").VNode & {
|
|
171
210
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
172
211
|
};
|
|
@@ -8,6 +8,7 @@ import { SelectRoot, SelectArrow, SelectTrigger, SelectPortal, SelectContent, Se
|
|
|
8
8
|
import { defu } from "defu";
|
|
9
9
|
import { reactivePick } from "@vueuse/core";
|
|
10
10
|
import { useAppConfig } from "#imports";
|
|
11
|
+
import { useComponentUI } from "../composables/useComponentUI";
|
|
11
12
|
import { useFieldGroup } from "../composables/useFieldGroup";
|
|
12
13
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
13
14
|
import { useFormField } from "../composables/useFormField";
|
|
@@ -35,14 +36,13 @@ const props = defineProps({
|
|
|
35
36
|
items: { type: null, required: false },
|
|
36
37
|
defaultValue: { type: null, required: false },
|
|
37
38
|
modelValue: { type: null, required: false },
|
|
38
|
-
modelModifiers: { type:
|
|
39
|
+
modelModifiers: { type: null, required: false },
|
|
39
40
|
multiple: { type: Boolean, required: false },
|
|
40
|
-
by: { type: [String, Function], required: false },
|
|
41
41
|
highlight: { type: Boolean, required: false },
|
|
42
42
|
autofocus: { type: Boolean, required: false },
|
|
43
43
|
autofocusDelay: { type: Number, required: false, default: 0 },
|
|
44
44
|
class: { type: null, required: false },
|
|
45
|
-
ui: { type:
|
|
45
|
+
ui: { type: Object, required: false },
|
|
46
46
|
open: { type: Boolean, required: false },
|
|
47
47
|
defaultOpen: { type: Boolean, required: false },
|
|
48
48
|
autocomplete: { type: String, required: false },
|
|
@@ -57,10 +57,11 @@ const props = defineProps({
|
|
|
57
57
|
loading: { type: Boolean, required: false },
|
|
58
58
|
loadingIcon: { type: null, required: false }
|
|
59
59
|
});
|
|
60
|
-
const emits = defineEmits(["
|
|
60
|
+
const emits = defineEmits(["change", "blur", "focus", "update:modelValue", "update:open"]);
|
|
61
61
|
const slots = defineSlots();
|
|
62
62
|
const appConfig = useAppConfig();
|
|
63
|
-
const
|
|
63
|
+
const uiProp = useComponentUI("select", props);
|
|
64
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "open", "defaultOpen", "disabled", "autocomplete", "required", "multiple"), emits);
|
|
64
65
|
const portalProps = usePortal(toRef(() => props.portal));
|
|
65
66
|
const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8, position: "popper" }));
|
|
66
67
|
const arrowProps = toRef(() => props.arrow);
|
|
@@ -86,15 +87,13 @@ function displayValue(value) {
|
|
|
86
87
|
if (props.multiple && Array.isArray(value)) {
|
|
87
88
|
const displayedValues = value.map((item) => getDisplayValue(items.value, item, {
|
|
88
89
|
labelKey: props.labelKey,
|
|
89
|
-
valueKey: props.valueKey
|
|
90
|
-
by: props.by
|
|
90
|
+
valueKey: props.valueKey
|
|
91
91
|
})).filter((v) => v != null && v !== "");
|
|
92
92
|
return displayedValues.length > 0 ? displayedValues.join(", ") : void 0;
|
|
93
93
|
}
|
|
94
94
|
return getDisplayValue(items.value, value, {
|
|
95
95
|
labelKey: props.labelKey,
|
|
96
|
-
valueKey: props.valueKey
|
|
97
|
-
by: props.by
|
|
96
|
+
valueKey: props.valueKey
|
|
98
97
|
});
|
|
99
98
|
}
|
|
100
99
|
const triggerRef = useTemplateRef("triggerRef");
|
|
@@ -111,7 +110,7 @@ onMounted(() => {
|
|
|
111
110
|
}, props.autofocusDelay);
|
|
112
111
|
});
|
|
113
112
|
function onUpdate(value) {
|
|
114
|
-
if (props.modelModifiers?.trim) {
|
|
113
|
+
if (props.modelModifiers?.trim && (typeof value === "string" || value === null || value === void 0)) {
|
|
115
114
|
value = value?.trim() ?? null;
|
|
116
115
|
}
|
|
117
116
|
if (props.modelModifiers?.number) {
|
|
@@ -120,7 +119,7 @@ function onUpdate(value) {
|
|
|
120
119
|
if (props.modelModifiers?.nullable) {
|
|
121
120
|
value ??= null;
|
|
122
121
|
}
|
|
123
|
-
if (props.modelModifiers?.optional) {
|
|
122
|
+
if (props.modelModifiers?.optional && !props.modelModifiers?.nullable && value !== null) {
|
|
124
123
|
value ??= void 0;
|
|
125
124
|
}
|
|
126
125
|
const event = new Event("change", { target: { value } });
|
|
@@ -165,89 +164,89 @@ defineExpose({
|
|
|
165
164
|
:id="id"
|
|
166
165
|
ref="triggerRef"
|
|
167
166
|
data-slot="base"
|
|
168
|
-
:class="ui.base({ class: [
|
|
167
|
+
:class="ui.base({ class: [uiProp?.base, props.class] })"
|
|
169
168
|
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
170
169
|
>
|
|
171
|
-
<span v-if="isLeading || !!avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class:
|
|
170
|
+
<span v-if="isLeading || !!avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class: uiProp?.leading })">
|
|
172
171
|
<slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
|
|
173
|
-
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class:
|
|
174
|
-
<UAvatar v-else-if="!!avatar" :size="
|
|
172
|
+
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class: uiProp?.leadingIcon })" />
|
|
173
|
+
<UAvatar v-else-if="!!avatar" :size="uiProp?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="avatar" data-slot="itemLeadingAvatar" :class="ui.itemLeadingAvatar({ class: uiProp?.itemLeadingAvatar })" />
|
|
175
174
|
</slot>
|
|
176
175
|
</span>
|
|
177
176
|
|
|
178
177
|
<slot :model-value="modelValue" :open="open" :ui="ui">
|
|
179
178
|
<template v-for="displayedModelValue in [displayValue(modelValue)]" :key="displayedModelValue">
|
|
180
|
-
<span v-if="displayedModelValue !== void 0 && displayedModelValue !== null" data-slot="value" :class="ui.value({ class:
|
|
179
|
+
<span v-if="displayedModelValue !== void 0 && displayedModelValue !== null" data-slot="value" :class="ui.value({ class: uiProp?.value })">
|
|
181
180
|
{{ displayedModelValue }}
|
|
182
181
|
</span>
|
|
183
|
-
<span v-else data-slot="placeholder" :class="ui.placeholder({ class:
|
|
182
|
+
<span v-else data-slot="placeholder" :class="ui.placeholder({ class: uiProp?.placeholder })">
|
|
184
183
|
{{ placeholder ?? "\xA0" }}
|
|
185
184
|
</span>
|
|
186
185
|
</template>
|
|
187
186
|
</slot>
|
|
188
187
|
|
|
189
|
-
<span v-if="isTrailing || !!slots.trailing" data-slot="trailing" :class="ui.trailing({ class:
|
|
188
|
+
<span v-if="isTrailing || !!slots.trailing" data-slot="trailing" :class="ui.trailing({ class: uiProp?.trailing })">
|
|
190
189
|
<slot name="trailing" :model-value="modelValue" :open="open" :ui="ui">
|
|
191
|
-
<UIcon v-if="trailingIconName" :name="trailingIconName" data-slot="trailingIcon" :class="ui.trailingIcon({ class:
|
|
190
|
+
<UIcon v-if="trailingIconName" :name="trailingIconName" data-slot="trailingIcon" :class="ui.trailingIcon({ class: uiProp?.trailingIcon })" />
|
|
192
191
|
</slot>
|
|
193
192
|
</span>
|
|
194
193
|
</SelectTrigger>
|
|
195
194
|
|
|
196
195
|
<SelectPortal v-bind="portalProps">
|
|
197
|
-
<SelectContent data-slot="content" :class="ui.content({ class:
|
|
196
|
+
<SelectContent data-slot="content" :class="ui.content({ class: uiProp?.content })" v-bind="contentProps">
|
|
198
197
|
<slot name="content-top" />
|
|
199
198
|
|
|
200
|
-
<div ref="viewportRef" role="presentation" data-slot="viewport" :class="ui.viewport({ class:
|
|
201
|
-
<SelectGroup v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" data-slot="group" :class="ui.group({ class:
|
|
199
|
+
<div ref="viewportRef" role="presentation" data-slot="viewport" :class="ui.viewport({ class: uiProp?.viewport })">
|
|
200
|
+
<SelectGroup v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" data-slot="group" :class="ui.group({ class: uiProp?.group })">
|
|
202
201
|
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
203
|
-
<SelectLabel v-if="isSelectItem(item) && item.type === 'label'" data-slot="label" :class="ui.label({ class: [
|
|
202
|
+
<SelectLabel v-if="isSelectItem(item) && item.type === 'label'" data-slot="label" :class="ui.label({ class: [uiProp?.label, item.ui?.label, item.class] })">
|
|
204
203
|
{{ get(item, props.labelKey) }}
|
|
205
204
|
</SelectLabel>
|
|
206
205
|
|
|
207
|
-
<SelectSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" data-slot="separator" :class="ui.separator({ class: [
|
|
206
|
+
<SelectSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" data-slot="separator" :class="ui.separator({ class: [uiProp?.separator, item.ui?.separator, item.class] })" />
|
|
208
207
|
|
|
209
208
|
<RSelectItem
|
|
210
209
|
v-else
|
|
211
210
|
data-slot="item"
|
|
212
|
-
:class="ui.item({ class: [
|
|
211
|
+
:class="ui.item({ class: [uiProp?.item, isSelectItem(item) && item.ui?.item, isSelectItem(item) && item.class] })"
|
|
213
212
|
:disabled="isSelectItem(item) && item.disabled"
|
|
214
213
|
:value="isSelectItem(item) ? get(item, props.valueKey) : item"
|
|
215
214
|
@select="isSelectItem(item) && item.onSelect?.($event)"
|
|
216
215
|
>
|
|
217
216
|
<slot name="item" :item="item" :index="index" :ui="ui">
|
|
218
217
|
<slot name="item-leading" :item="item" :index="index" :ui="ui">
|
|
219
|
-
<UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" data-slot="itemLeadingIcon" :class="ui.itemLeadingIcon({ class: [
|
|
220
|
-
<UAvatar v-else-if="isSelectItem(item) && item.avatar" :size="item.ui?.itemLeadingAvatarSize ||
|
|
218
|
+
<UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" data-slot="itemLeadingIcon" :class="ui.itemLeadingIcon({ class: [uiProp?.itemLeadingIcon, item.ui?.itemLeadingIcon] })" />
|
|
219
|
+
<UAvatar v-else-if="isSelectItem(item) && item.avatar" :size="item.ui?.itemLeadingAvatarSize || uiProp?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" data-slot="itemLeadingAvatar" :class="ui.itemLeadingAvatar({ class: [uiProp?.itemLeadingAvatar, item.ui?.itemLeadingAvatar] })" />
|
|
221
220
|
<UChip
|
|
222
221
|
v-else-if="isSelectItem(item) && item.chip"
|
|
223
|
-
:size="item.ui?.itemLeadingChipSize ||
|
|
222
|
+
:size="item.ui?.itemLeadingChipSize || uiProp?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
224
223
|
inset
|
|
225
224
|
standalone
|
|
226
225
|
v-bind="item.chip"
|
|
227
226
|
data-slot="itemLeadingChip"
|
|
228
|
-
:class="ui.itemLeadingChip({ class: [
|
|
227
|
+
:class="ui.itemLeadingChip({ class: [uiProp?.itemLeadingChip, item.ui?.itemLeadingChip] })"
|
|
229
228
|
/>
|
|
230
229
|
</slot>
|
|
231
230
|
|
|
232
|
-
<span data-slot="itemWrapper" :class="ui.itemWrapper({ class: [
|
|
233
|
-
<SelectItemText data-slot="itemLabel" :class="ui.itemLabel({ class: [
|
|
231
|
+
<span data-slot="itemWrapper" :class="ui.itemWrapper({ class: [uiProp?.itemWrapper, isSelectItem(item) && item.ui?.itemWrapper] })">
|
|
232
|
+
<SelectItemText data-slot="itemLabel" :class="ui.itemLabel({ class: [uiProp?.itemLabel, isSelectItem(item) && item.ui?.itemLabel] })">
|
|
234
233
|
<slot name="item-label" :item="item" :index="index">
|
|
235
234
|
{{ isSelectItem(item) ? get(item, props.labelKey) : item }}
|
|
236
235
|
</slot>
|
|
237
236
|
</SelectItemText>
|
|
238
237
|
|
|
239
|
-
<span v-if="isSelectItem(item) && (get(item, props.descriptionKey) || !!slots['item-description'])" data-slot="itemDescription" :class="ui.itemDescription({ class: [
|
|
238
|
+
<span v-if="isSelectItem(item) && (get(item, props.descriptionKey) || !!slots['item-description'])" data-slot="itemDescription" :class="ui.itemDescription({ class: [uiProp?.itemDescription, isSelectItem(item) && item.ui?.itemDescription] })">
|
|
240
239
|
<slot name="item-description" :item="item" :index="index">
|
|
241
240
|
{{ get(item, props.descriptionKey) }}
|
|
242
241
|
</slot>
|
|
243
242
|
</span>
|
|
244
243
|
</span>
|
|
245
244
|
|
|
246
|
-
<span data-slot="itemTrailing" :class="ui.itemTrailing({ class: [
|
|
245
|
+
<span data-slot="itemTrailing" :class="ui.itemTrailing({ class: [uiProp?.itemTrailing, isSelectItem(item) && item.ui?.itemTrailing] })">
|
|
247
246
|
<slot name="item-trailing" :item="item" :index="index" :ui="ui" />
|
|
248
247
|
|
|
249
248
|
<SelectItemIndicator as-child>
|
|
250
|
-
<UIcon :name="selectedIcon || appConfig.ui.icons.check" data-slot="itemTrailingIcon" :class="ui.itemTrailingIcon({ class: [
|
|
249
|
+
<UIcon :name="selectedIcon || appConfig.ui.icons.check" data-slot="itemTrailingIcon" :class="ui.itemTrailingIcon({ class: [uiProp?.itemTrailingIcon, isSelectItem(item) && item.ui?.itemTrailingIcon] })" />
|
|
251
250
|
</SelectItemIndicator>
|
|
252
251
|
</span>
|
|
253
252
|
</slot>
|
|
@@ -258,7 +257,7 @@ defineExpose({
|
|
|
258
257
|
|
|
259
258
|
<slot name="content-bottom" />
|
|
260
259
|
|
|
261
|
-
<SelectArrow v-if="!!arrow" v-bind="arrowProps" data-slot="arrow" :class="ui.arrow({ class:
|
|
260
|
+
<SelectArrow v-if="!!arrow" v-bind="arrowProps" data-slot="arrow" :class="ui.arrow({ class: uiProp?.arrow })" />
|
|
262
261
|
</SelectContent>
|
|
263
262
|
</SelectPortal>
|
|
264
263
|
</SelectRoot>
|