@nuxt/ui 4.7.1 → 4.8.1
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/.nuxt/{ui.css → ui.static.css} +0 -10
- package/LICENSE.md +1 -1
- package/cli/commands/make/component.mjs +6 -2
- package/cli/templates.mjs +46 -20
- package/cli/utils.mjs +19 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +4 -4
- package/dist/runtime/components/Accordion.vue +15 -14
- package/dist/runtime/components/Alert.vue +20 -20
- package/dist/runtime/components/AuthForm.vue +37 -37
- package/dist/runtime/components/Avatar.d.vue.ts +4 -0
- package/dist/runtime/components/Avatar.vue +14 -12
- package/dist/runtime/components/Avatar.vue.d.ts +4 -0
- package/dist/runtime/components/AvatarGroup.d.vue.ts +4 -0
- package/dist/runtime/components/AvatarGroup.vue +11 -8
- package/dist/runtime/components/AvatarGroup.vue.d.ts +4 -0
- package/dist/runtime/components/Badge.vue +11 -11
- package/dist/runtime/components/Banner.vue +25 -23
- package/dist/runtime/components/BlogPost.d.vue.ts +1 -1
- package/dist/runtime/components/BlogPost.vue +30 -28
- package/dist/runtime/components/BlogPost.vue.d.ts +1 -1
- package/dist/runtime/components/BlogPosts.vue +6 -6
- package/dist/runtime/components/Breadcrumb.d.vue.ts +4 -0
- package/dist/runtime/components/Breadcrumb.vue +21 -18
- package/dist/runtime/components/Breadcrumb.vue.d.ts +4 -0
- package/dist/runtime/components/Button.vue +16 -16
- package/dist/runtime/components/Calendar.vue +21 -20
- package/dist/runtime/components/Card.vue +11 -11
- package/dist/runtime/components/Carousel.vue +23 -22
- package/dist/runtime/components/ChangelogVersion.vue +31 -29
- package/dist/runtime/components/ChangelogVersions.vue +8 -8
- package/dist/runtime/components/ChatMessage.d.vue.ts +6 -0
- package/dist/runtime/components/ChatMessage.vue +46 -36
- package/dist/runtime/components/ChatMessage.vue.d.ts +6 -0
- package/dist/runtime/components/ChatMessages.vue +14 -14
- package/dist/runtime/components/ChatPalette.vue +6 -6
- package/dist/runtime/components/ChatPrompt.d.vue.ts +7 -0
- package/dist/runtime/components/ChatPrompt.vue +22 -12
- package/dist/runtime/components/ChatPrompt.vue.d.ts +7 -0
- package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +3 -3
- package/dist/runtime/components/ChatPromptSubmit.vue +6 -6
- package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +3 -3
- package/dist/runtime/components/ChatReasoning.vue +20 -20
- package/dist/runtime/components/ChatShimmer.vue +7 -7
- package/dist/runtime/components/ChatTool.d.vue.ts +1 -1
- package/dist/runtime/components/ChatTool.vue +19 -19
- package/dist/runtime/components/ChatTool.vue.d.ts +1 -1
- package/dist/runtime/components/Checkbox.d.vue.ts +2 -0
- package/dist/runtime/components/Checkbox.vue +25 -24
- package/dist/runtime/components/Checkbox.vue.d.ts +2 -0
- package/dist/runtime/components/CheckboxGroup.d.vue.ts +1 -1
- package/dist/runtime/components/CheckboxGroup.vue +17 -14
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Chip.vue +8 -8
- package/dist/runtime/components/Collapsible.vue +8 -7
- package/dist/runtime/components/ColorPicker.d.vue.ts +2 -0
- package/dist/runtime/components/ColorPicker.vue +10 -10
- package/dist/runtime/components/ColorPicker.vue.d.ts +2 -0
- package/dist/runtime/components/CommandPalette.d.vue.ts +5 -5
- package/dist/runtime/components/CommandPalette.vue +92 -69
- package/dist/runtime/components/CommandPalette.vue.d.ts +5 -5
- package/dist/runtime/components/Container.vue +4 -4
- package/dist/runtime/components/ContextMenu.vue +16 -15
- package/dist/runtime/components/DashboardGroup.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardGroup.vue +6 -4
- package/dist/runtime/components/DashboardGroup.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardNavbar.vue +16 -16
- package/dist/runtime/components/DashboardPanel.vue +7 -7
- package/dist/runtime/components/DashboardResizeHandle.vue +5 -5
- package/dist/runtime/components/DashboardSearch.d.vue.ts +16 -1
- package/dist/runtime/components/DashboardSearch.vue +25 -12
- package/dist/runtime/components/DashboardSearch.vue.d.ts +16 -1
- package/dist/runtime/components/DashboardSearchButton.d.vue.ts +2 -2
- package/dist/runtime/components/DashboardSearchButton.vue +15 -15
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +2 -2
- package/dist/runtime/components/DashboardSidebar.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardSidebar.vue +22 -22
- package/dist/runtime/components/DashboardSidebar.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardSidebarCollapse.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardSidebarCollapse.vue +5 -5
- package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardSidebarToggle.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardSidebarToggle.vue +5 -5
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardToolbar.vue +6 -6
- package/dist/runtime/components/Drawer.d.vue.ts +1 -1
- package/dist/runtime/components/Drawer.vue +23 -22
- package/dist/runtime/components/Drawer.vue.d.ts +1 -1
- package/dist/runtime/components/DropdownMenu.vue +21 -20
- package/dist/runtime/components/Editor.vue +8 -7
- package/dist/runtime/components/EditorDragHandle.d.vue.ts +2 -2
- package/dist/runtime/components/EditorDragHandle.vue +9 -8
- package/dist/runtime/components/EditorDragHandle.vue.d.ts +2 -2
- package/dist/runtime/components/EditorToolbar.vue +10 -9
- package/dist/runtime/components/Empty.vue +14 -14
- package/dist/runtime/components/Error.d.vue.ts +9 -1
- package/dist/runtime/components/Error.vue +17 -10
- package/dist/runtime/components/Error.vue.d.ts +9 -1
- package/dist/runtime/components/FieldGroup.vue +4 -4
- package/dist/runtime/components/FileUpload.vue +36 -37
- package/dist/runtime/components/Footer.vue +10 -10
- package/dist/runtime/components/FooterColumns.vue +15 -15
- package/dist/runtime/components/Form.d.vue.ts +1 -1
- package/dist/runtime/components/Form.vue +6 -5
- package/dist/runtime/components/Form.vue.d.ts +1 -1
- package/dist/runtime/components/FormField.d.vue.ts +1 -0
- package/dist/runtime/components/FormField.vue +21 -21
- package/dist/runtime/components/FormField.vue.d.ts +1 -0
- package/dist/runtime/components/Header.vue +19 -19
- package/dist/runtime/components/Icon.vue +2 -1
- package/dist/runtime/components/Input.vue +19 -19
- package/dist/runtime/components/InputDate.vue +21 -20
- package/dist/runtime/components/InputMenu.d.vue.ts +52 -51
- package/dist/runtime/components/InputMenu.vue +66 -63
- package/dist/runtime/components/InputMenu.vue.d.ts +52 -51
- package/dist/runtime/components/InputNumber.vue +25 -24
- package/dist/runtime/components/InputTags.vue +26 -25
- package/dist/runtime/components/InputTime.vue +21 -20
- package/dist/runtime/components/Kbd.vue +5 -5
- package/dist/runtime/components/Link.d.vue.ts +2 -2
- package/dist/runtime/components/Link.vue.d.ts +2 -2
- package/dist/runtime/components/LinkBase.d.vue.ts +1 -1
- package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/components/Listbox.d.vue.ts +13 -9
- package/dist/runtime/components/Listbox.vue +34 -32
- package/dist/runtime/components/Listbox.vue.d.ts +13 -9
- package/dist/runtime/components/Main.vue +4 -4
- package/dist/runtime/components/Marquee.vue +5 -5
- package/dist/runtime/components/Modal.d.vue.ts +2 -2
- package/dist/runtime/components/Modal.vue +25 -24
- package/dist/runtime/components/Modal.vue.d.ts +2 -2
- package/dist/runtime/components/NavigationMenu.vue +66 -65
- package/dist/runtime/components/Page.vue +7 -7
- package/dist/runtime/components/PageAnchors.vue +11 -11
- package/dist/runtime/components/PageAside.vue +9 -9
- package/dist/runtime/components/PageBody.vue +4 -4
- package/dist/runtime/components/PageCTA.vue +18 -16
- package/dist/runtime/components/PageCard.vue +25 -23
- package/dist/runtime/components/PageColumns.vue +4 -4
- package/dist/runtime/components/PageFeature.vue +17 -15
- package/dist/runtime/components/PageGrid.vue +4 -4
- package/dist/runtime/components/PageHeader.vue +14 -14
- package/dist/runtime/components/PageHero.vue +20 -18
- package/dist/runtime/components/PageLinks.vue +12 -12
- package/dist/runtime/components/PageList.vue +4 -4
- package/dist/runtime/components/PageLogos.vue +16 -16
- package/dist/runtime/components/PageSection.d.vue.ts +1 -1
- package/dist/runtime/components/PageSection.vue +24 -22
- package/dist/runtime/components/PageSection.vue.d.ts +1 -1
- package/dist/runtime/components/Pagination.d.vue.ts +2 -2
- package/dist/runtime/components/Pagination.vue +23 -22
- package/dist/runtime/components/Pagination.vue.d.ts +2 -2
- package/dist/runtime/components/PinInput.vue +15 -14
- package/dist/runtime/components/Popover.vue +9 -8
- package/dist/runtime/components/PricingPlan.vue +36 -36
- package/dist/runtime/components/PricingPlans.vue +6 -6
- package/dist/runtime/components/PricingTable.vue +44 -44
- package/dist/runtime/components/Progress.d.vue.ts +1 -1
- package/dist/runtime/components/Progress.vue +12 -11
- package/dist/runtime/components/Progress.vue.d.ts +1 -1
- package/dist/runtime/components/RadioGroup.d.vue.ts +2 -0
- package/dist/runtime/components/RadioGroup.vue +28 -27
- package/dist/runtime/components/RadioGroup.vue.d.ts +2 -0
- package/dist/runtime/components/ScrollArea.vue +13 -13
- package/dist/runtime/components/Select.vue +38 -40
- package/dist/runtime/components/SelectMenu.d.vue.ts +46 -46
- package/dist/runtime/components/SelectMenu.vue +49 -48
- package/dist/runtime/components/SelectMenu.vue.d.ts +46 -46
- package/dist/runtime/components/Separator.d.vue.ts +9 -3
- package/dist/runtime/components/Separator.vue +29 -16
- package/dist/runtime/components/Separator.vue.d.ts +9 -3
- package/dist/runtime/components/Sidebar.vue +28 -28
- package/dist/runtime/components/Skeleton.vue +5 -5
- package/dist/runtime/components/Slideover.d.vue.ts +3 -3
- package/dist/runtime/components/Slideover.vue +24 -23
- package/dist/runtime/components/Slideover.vue.d.ts +3 -3
- package/dist/runtime/components/Slider.vue +16 -15
- package/dist/runtime/components/Stepper.vue +19 -18
- package/dist/runtime/components/Switch.d.vue.ts +2 -0
- package/dist/runtime/components/Switch.vue +26 -23
- package/dist/runtime/components/Switch.vue.d.ts +2 -0
- package/dist/runtime/components/Table.vue +26 -25
- package/dist/runtime/components/Tabs.vue +22 -21
- package/dist/runtime/components/Textarea.vue +19 -18
- package/dist/runtime/components/Theme.d.vue.ts +13 -5
- package/dist/runtime/components/Theme.vue +32 -4
- package/dist/runtime/components/Theme.vue.d.ts +13 -5
- package/dist/runtime/components/Timeline.vue +15 -15
- package/dist/runtime/components/Toast.vue +35 -34
- package/dist/runtime/components/Toaster.d.vue.ts +1 -1
- package/dist/runtime/components/Toaster.vue +10 -9
- package/dist/runtime/components/Toaster.vue.d.ts +1 -1
- package/dist/runtime/components/Tooltip.vue +13 -12
- package/dist/runtime/components/Tree.vue +24 -23
- package/dist/runtime/components/User.vue +23 -21
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +5 -2
- package/dist/runtime/components/color-mode/ColorModeButton.d.vue.ts +1 -1
- package/dist/runtime/components/color-mode/ColorModeButton.vue +8 -6
- package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +1 -1
- package/dist/runtime/components/color-mode/ColorModeImage.vue +4 -2
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +1 -0
- package/dist/runtime/components/content/ContentNavigation.vue +31 -30
- package/dist/runtime/components/content/ContentSearch.d.vue.ts +31 -4
- package/dist/runtime/components/content/ContentSearch.vue +78 -33
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +31 -4
- package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +2 -2
- package/dist/runtime/components/content/ContentSearchButton.vue +15 -15
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +2 -2
- package/dist/runtime/components/content/ContentSurround.vue +14 -12
- package/dist/runtime/components/content/ContentToc.vue +34 -33
- package/dist/runtime/components/prose/A.vue +4 -4
- package/dist/runtime/components/prose/Accordion.vue +4 -4
- package/dist/runtime/components/prose/AccordionItem.vue +5 -5
- package/dist/runtime/components/prose/Badge.vue +4 -4
- package/dist/runtime/components/prose/Blockquote.vue +4 -4
- package/dist/runtime/components/prose/Callout.vue +8 -8
- package/dist/runtime/components/prose/Card.vue +12 -12
- package/dist/runtime/components/prose/CardGroup.vue +4 -4
- package/dist/runtime/components/prose/Code.vue +4 -4
- package/dist/runtime/components/prose/CodeCollapse.vue +8 -8
- package/dist/runtime/components/prose/CodeGroup.vue +9 -9
- package/dist/runtime/components/prose/CodePreview.vue +6 -6
- package/dist/runtime/components/prose/CodeTree.vue +14 -14
- package/dist/runtime/components/prose/Collapsible.vue +7 -7
- package/dist/runtime/components/prose/Em.vue +4 -4
- package/dist/runtime/components/prose/Field.vue +13 -13
- package/dist/runtime/components/prose/FieldGroup.vue +4 -4
- package/dist/runtime/components/prose/H1.vue +5 -5
- package/dist/runtime/components/prose/H2.vue +7 -7
- package/dist/runtime/components/prose/H3.vue +7 -7
- package/dist/runtime/components/prose/H4.vue +5 -5
- package/dist/runtime/components/prose/Hr.vue +4 -4
- package/dist/runtime/components/prose/Icon.vue +4 -4
- package/dist/runtime/components/prose/Img.vue +12 -12
- package/dist/runtime/components/prose/Kbd.d.vue.ts +10 -2
- package/dist/runtime/components/prose/Kbd.vue +8 -5
- package/dist/runtime/components/prose/Kbd.vue.d.ts +10 -2
- package/dist/runtime/components/prose/Li.vue +4 -4
- package/dist/runtime/components/prose/Ol.vue +4 -4
- package/dist/runtime/components/prose/P.vue +4 -4
- package/dist/runtime/components/prose/Pre.vue +9 -9
- package/dist/runtime/components/prose/Prompt.vue +12 -12
- package/dist/runtime/components/prose/Steps.vue +4 -4
- package/dist/runtime/components/prose/Strong.vue +4 -4
- package/dist/runtime/components/prose/Table.vue +5 -5
- package/dist/runtime/components/prose/Tabs.vue +4 -4
- package/dist/runtime/components/prose/TabsItem.vue +5 -5
- package/dist/runtime/components/prose/Tbody.vue +4 -4
- package/dist/runtime/components/prose/Td.vue +4 -4
- package/dist/runtime/components/prose/Th.vue +4 -4
- package/dist/runtime/components/prose/Thead.vue +4 -4
- package/dist/runtime/components/prose/Tr.vue +4 -4
- package/dist/runtime/components/prose/Ul.vue +4 -4
- package/dist/runtime/composables/defineShortcuts.js +7 -2
- package/dist/runtime/composables/index.d.ts +1 -2
- package/dist/runtime/composables/index.js +1 -2
- package/dist/runtime/composables/useAvatarGroup.d.ts +12 -1
- package/dist/runtime/composables/useAvatarGroup.js +4 -2
- package/dist/runtime/composables/useComponentIcons.js +1 -1
- package/dist/runtime/composables/useComponentProps.d.ts +180 -0
- package/dist/runtime/composables/useComponentProps.js +59 -0
- package/dist/runtime/composables/useContentSearch.d.ts +4 -2
- package/dist/runtime/composables/useContentSearch.js +64 -7
- package/dist/runtime/composables/useFieldGroup.d.ts +9 -1
- package/dist/runtime/composables/useFormField.d.ts +21 -1
- package/dist/runtime/composables/useForwardProps.d.ts +13 -0
- package/dist/runtime/composables/useForwardProps.js +14 -0
- package/dist/runtime/composables/usePrefix.d.ts +6 -0
- package/dist/runtime/composables/usePrefix.js +11 -0
- package/dist/runtime/composables/useResizable.d.ts +4 -0
- package/dist/runtime/composables/useResizable.js +1 -1
- package/dist/runtime/locale/ar.js +1 -0
- package/dist/runtime/locale/az.js +1 -0
- package/dist/runtime/locale/be.js +1 -0
- package/dist/runtime/locale/bg.js +1 -0
- package/dist/runtime/locale/bn.js +1 -0
- package/dist/runtime/locale/ca.js +1 -0
- package/dist/runtime/locale/ckb.js +1 -0
- package/dist/runtime/locale/cs.js +1 -0
- package/dist/runtime/locale/da.js +1 -0
- package/dist/runtime/locale/de.js +1 -0
- package/dist/runtime/locale/de_ch.js +1 -0
- package/dist/runtime/locale/el.js +1 -0
- package/dist/runtime/locale/en.js +1 -0
- package/dist/runtime/locale/es.js +1 -0
- package/dist/runtime/locale/et.js +1 -0
- package/dist/runtime/locale/eu.js +1 -0
- package/dist/runtime/locale/fa_ir.js +1 -0
- package/dist/runtime/locale/fi.js +1 -0
- package/dist/runtime/locale/fr.js +1 -0
- package/dist/runtime/locale/gl.js +1 -0
- package/dist/runtime/locale/he.js +1 -0
- package/dist/runtime/locale/hi.js +1 -0
- package/dist/runtime/locale/hr.js +1 -0
- package/dist/runtime/locale/hu.js +1 -0
- package/dist/runtime/locale/hy.js +1 -0
- package/dist/runtime/locale/id.js +1 -0
- package/dist/runtime/locale/is.js +1 -0
- package/dist/runtime/locale/it.js +1 -0
- package/dist/runtime/locale/ja.js +1 -0
- package/dist/runtime/locale/ka.js +1 -0
- package/dist/runtime/locale/kk.js +1 -0
- package/dist/runtime/locale/km.js +1 -0
- package/dist/runtime/locale/ko.js +1 -0
- package/dist/runtime/locale/ky.js +1 -0
- package/dist/runtime/locale/lb.js +1 -0
- package/dist/runtime/locale/lo.js +1 -0
- package/dist/runtime/locale/lt.js +1 -0
- package/dist/runtime/locale/mn.js +1 -0
- package/dist/runtime/locale/ms.js +1 -0
- package/dist/runtime/locale/nb_no.js +1 -0
- package/dist/runtime/locale/nl.js +1 -0
- package/dist/runtime/locale/pl.js +1 -0
- package/dist/runtime/locale/pt.js +1 -0
- package/dist/runtime/locale/pt_br.js +1 -0
- package/dist/runtime/locale/ro.js +1 -0
- package/dist/runtime/locale/ru.js +1 -0
- package/dist/runtime/locale/sk.js +1 -0
- package/dist/runtime/locale/sl.js +1 -0
- package/dist/runtime/locale/sq.js +1 -0
- package/dist/runtime/locale/sv.js +1 -0
- package/dist/runtime/locale/th.js +7 -6
- package/dist/runtime/locale/tj.js +1 -0
- package/dist/runtime/locale/tr.js +1 -0
- package/dist/runtime/locale/ug_cn.js +1 -0
- package/dist/runtime/locale/uk.js +1 -0
- package/dist/runtime/locale/ur.js +1 -0
- package/dist/runtime/locale/uz.js +1 -0
- package/dist/runtime/locale/vi.js +1 -0
- package/dist/runtime/locale/zh_cn.js +1 -0
- package/dist/runtime/locale/zh_tw.js +1 -0
- package/dist/runtime/plugins/colors.js +1 -1
- package/dist/runtime/types/content.d.ts +1 -0
- package/dist/runtime/types/content.js +1 -0
- package/dist/runtime/types/form.d.ts +2 -2
- package/dist/runtime/types/locale.d.ts +1 -0
- package/dist/runtime/types/tv.d.ts +13 -7
- package/dist/runtime/types/utils.d.ts +3 -0
- package/dist/runtime/utils/dashboard.d.ts +1 -1
- package/dist/runtime/utils/{fuse.d.ts → search.d.ts} +2 -1
- package/dist/runtime/utils/{fuse.js → search.js} +11 -2
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +1 -0
- package/dist/runtime/vue/overrides/inertia/Link.d.vue.ts +2 -2
- package/dist/runtime/vue/overrides/inertia/Link.vue +5 -0
- package/dist/runtime/vue/overrides/inertia/Link.vue.d.ts +2 -2
- package/dist/runtime/vue/overrides/inertia/LinkBase.d.vue.ts +1 -1
- package/dist/runtime/vue/overrides/inertia/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/vue/overrides/none/Link.d.vue.ts +2 -2
- package/dist/runtime/vue/overrides/none/Link.vue.d.ts +2 -2
- package/dist/runtime/vue/overrides/vue-router/Link.d.vue.ts +2 -2
- package/dist/runtime/vue/overrides/vue-router/Link.vue.d.ts +2 -2
- package/dist/shared/{ui.C6mn7iap.mjs → ui.BzjkAvk7.mjs} +244 -78
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +46 -53
- package/dist/runtime/composables/useComponentUI.d.ts +0 -33
- package/dist/runtime/composables/useComponentUI.js +0 -13
- package/dist/runtime/composables/useResolvedVariants.d.ts +0 -21
- package/dist/runtime/composables/useResolvedVariants.js +0 -14
|
@@ -4,11 +4,12 @@ import theme from "#build/ui/select-menu";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { useTemplateRef, computed, onMounted, toRef, toRaw } from "vue";
|
|
7
|
-
import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxCancel, ComboboxPortal, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxVirtualizer, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, FocusScope
|
|
7
|
+
import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxCancel, ComboboxPortal, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxVirtualizer, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, FocusScope } from "reka-ui";
|
|
8
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
8
9
|
import { defu } from "defu";
|
|
9
10
|
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
10
11
|
import { useAppConfig } from "#imports";
|
|
11
|
-
import {
|
|
12
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
12
13
|
import { useFieldGroup, FieldGroupReset } from "../composables/useFieldGroup";
|
|
13
14
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
14
15
|
import { useFormField } from "../composables/useFormField";
|
|
@@ -24,7 +25,7 @@ import UButton from "./Button.vue";
|
|
|
24
25
|
import UChip from "./Chip.vue";
|
|
25
26
|
import UInput from "./Input.vue";
|
|
26
27
|
defineOptions({ inheritAttrs: false });
|
|
27
|
-
const
|
|
28
|
+
const _props = defineProps({
|
|
28
29
|
id: { type: String, required: false },
|
|
29
30
|
placeholder: { type: String, required: false },
|
|
30
31
|
searchInput: { type: [Boolean, Object], required: false, default: true },
|
|
@@ -75,12 +76,12 @@ const props = defineProps({
|
|
|
75
76
|
});
|
|
76
77
|
const emits = defineEmits(["change", "blur", "focus", "create", "clear", "highlight", "update:modelValue", "update:open"]);
|
|
77
78
|
const slots = defineSlots();
|
|
79
|
+
const props = useComponentProps("selectMenu", _props);
|
|
78
80
|
const searchTerm = defineModel("searchTerm", { type: String, ...{ default: "" } });
|
|
79
81
|
const { t } = useLocale();
|
|
80
82
|
const appConfig = useAppConfig();
|
|
81
|
-
const uiProp = useComponentUI("selectMenu", props);
|
|
82
83
|
const { filterGroups } = useFilter();
|
|
83
|
-
const rootProps =
|
|
84
|
+
const rootProps = useForwardProps(reactivePick(props, "modelValue", "defaultValue", "open", "defaultOpen", "required", "multiple", "resetSearchTermOnBlur", "resetSearchTermOnSelect", "resetModelValueOnClear", "highlightOnHover", "by"), emits);
|
|
84
85
|
const portalProps = usePortal(toRef(() => props.portal));
|
|
85
86
|
const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8, position: "popper" }));
|
|
86
87
|
const arrowProps = toRef(() => defu(props.arrow, { rounded: true }));
|
|
@@ -92,8 +93,8 @@ const virtualizerProps = toRef(() => {
|
|
|
92
93
|
});
|
|
93
94
|
});
|
|
94
95
|
const searchInputProps = toRef(() => defu(props.searchInput, { placeholder: t("selectMenu.search"), variant: "none" }));
|
|
95
|
-
const { emitFormBlur, emitFormFocus, emitFormInput, emitFormChange, size: formFieldSize, color, id, name, highlight, disabled, ariaAttrs } = useFormField(
|
|
96
|
-
const { orientation, size: fieldGroupSize } = useFieldGroup(
|
|
96
|
+
const { emitFormBlur, emitFormFocus, emitFormInput, emitFormChange, size: formFieldSize, color, id, name, highlight, disabled, ariaAttrs } = useFormField(_props);
|
|
97
|
+
const { orientation, size: fieldGroupSize } = useFieldGroup(_props);
|
|
97
98
|
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(toRef(() => defu(props, { trailingIcon: appConfig.ui.icons.chevronDown })));
|
|
98
99
|
const selectSize = computed(() => fieldGroupSize.value || formFieldSize.value);
|
|
99
100
|
const [DefineCreateItemTemplate, ReuseCreateItemTemplate] = createReusableTemplate();
|
|
@@ -110,11 +111,11 @@ const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate({
|
|
|
110
111
|
}
|
|
111
112
|
});
|
|
112
113
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.selectMenu || {} })({
|
|
113
|
-
color: color.value,
|
|
114
|
+
color: color.value ?? props.color,
|
|
114
115
|
variant: props.variant,
|
|
115
|
-
size: selectSize?.value,
|
|
116
|
+
size: selectSize?.value ?? props.size,
|
|
116
117
|
loading: props.loading,
|
|
117
|
-
highlight: highlight.value,
|
|
118
|
+
highlight: highlight.value ?? props.highlight,
|
|
118
119
|
leading: isLeading.value || !!props.avatar || !!slots.leading,
|
|
119
120
|
trailing: isTrailing.value || !!slots.trailing,
|
|
120
121
|
fieldGroup: orientation.value,
|
|
@@ -255,11 +256,11 @@ defineExpose({
|
|
|
255
256
|
<DefineCreateItemTemplate>
|
|
256
257
|
<ComboboxItem
|
|
257
258
|
data-slot="item"
|
|
258
|
-
:class="ui.item({ class:
|
|
259
|
+
:class="ui.item({ class: props.ui?.item })"
|
|
259
260
|
:value="searchTerm"
|
|
260
261
|
@select="onCreate"
|
|
261
262
|
>
|
|
262
|
-
<span data-slot="itemLabel" :class="ui.itemLabel({ class:
|
|
263
|
+
<span data-slot="itemLabel" :class="ui.itemLabel({ class: props.ui?.itemLabel })">
|
|
263
264
|
<slot name="create-item-label" :item="searchTerm">
|
|
264
265
|
{{ t("selectMenu.create", { label: searchTerm }) }}
|
|
265
266
|
</slot>
|
|
@@ -268,54 +269,54 @@ defineExpose({
|
|
|
268
269
|
</DefineCreateItemTemplate>
|
|
269
270
|
|
|
270
271
|
<DefineItemTemplate v-slot="{ item, index }">
|
|
271
|
-
<ComboboxLabel v-if="isSelectItem(item) && item.type === 'label'" data-slot="label" :class="ui.label({ class: [
|
|
272
|
+
<ComboboxLabel v-if="isSelectItem(item) && item.type === 'label'" data-slot="label" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
|
|
272
273
|
{{ get(item, props.labelKey) }}
|
|
273
274
|
</ComboboxLabel>
|
|
274
275
|
|
|
275
|
-
<ComboboxSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" data-slot="separator" :class="ui.separator({ class: [
|
|
276
|
+
<ComboboxSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" data-slot="separator" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator, item.class] })" />
|
|
276
277
|
|
|
277
278
|
<ComboboxItem
|
|
278
279
|
v-else
|
|
279
280
|
data-slot="item"
|
|
280
|
-
:class="ui.item({ class: [
|
|
281
|
+
:class="ui.item({ class: [props.ui?.item, isSelectItem(item) && item.ui?.item, isSelectItem(item) && item.class] })"
|
|
281
282
|
:disabled="isSelectItem(item) && item.disabled"
|
|
282
283
|
:value="props.valueKey && isSelectItem(item) ? get(item, props.valueKey) : item"
|
|
283
284
|
@select="onSelect($event, item)"
|
|
284
285
|
>
|
|
285
286
|
<slot name="item" :item="item" :index="index" :ui="ui">
|
|
286
287
|
<slot name="item-leading" :item="item" :index="index" :ui="ui">
|
|
287
|
-
<UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" data-slot="itemLeadingIcon" :class="ui.itemLeadingIcon({ class: [
|
|
288
|
-
<UAvatar v-else-if="isSelectItem(item) && item.avatar" :size="item.ui?.itemLeadingAvatarSize ||
|
|
288
|
+
<UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" data-slot="itemLeadingIcon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon] })" />
|
|
289
|
+
<UAvatar v-else-if="isSelectItem(item) && item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" data-slot="itemLeadingAvatar" :class="ui.itemLeadingAvatar({ class: [props.ui?.itemLeadingAvatar, item.ui?.itemLeadingAvatar] })" />
|
|
289
290
|
<UChip
|
|
290
291
|
v-else-if="isSelectItem(item) && item.chip"
|
|
291
|
-
:size="item.ui?.itemLeadingChipSize ||
|
|
292
|
+
:size="item.ui?.itemLeadingChipSize || props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
292
293
|
inset
|
|
293
294
|
standalone
|
|
294
295
|
v-bind="item.chip"
|
|
295
296
|
data-slot="itemLeadingChip"
|
|
296
|
-
:class="ui.itemLeadingChip({ class: [
|
|
297
|
+
:class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip] })"
|
|
297
298
|
/>
|
|
298
299
|
</slot>
|
|
299
300
|
|
|
300
|
-
<span data-slot="itemWrapper" :class="ui.itemWrapper({ class: [
|
|
301
|
-
<span data-slot="itemLabel" :class="ui.itemLabel({ class: [
|
|
301
|
+
<span data-slot="itemWrapper" :class="ui.itemWrapper({ class: [props.ui?.itemWrapper, isSelectItem(item) && item.ui?.itemWrapper] })">
|
|
302
|
+
<span data-slot="itemLabel" :class="ui.itemLabel({ class: [props.ui?.itemLabel, isSelectItem(item) && item.ui?.itemLabel] })">
|
|
302
303
|
<slot name="item-label" :item="item" :index="index">
|
|
303
304
|
{{ isSelectItem(item) ? get(item, props.labelKey) : item }}
|
|
304
305
|
</slot>
|
|
305
306
|
</span>
|
|
306
307
|
|
|
307
|
-
<span v-if="isSelectItem(item) && (get(item, props.descriptionKey) || !!slots['item-description'])" data-slot="itemDescription" :class="ui.itemDescription({ class: [
|
|
308
|
+
<span v-if="isSelectItem(item) && (get(item, props.descriptionKey) || !!slots['item-description'])" data-slot="itemDescription" :class="ui.itemDescription({ class: [props.ui?.itemDescription, isSelectItem(item) && item.ui?.itemDescription] })">
|
|
308
309
|
<slot name="item-description" :item="item" :index="index">
|
|
309
310
|
{{ get(item, props.descriptionKey) }}
|
|
310
311
|
</slot>
|
|
311
312
|
</span>
|
|
312
313
|
</span>
|
|
313
314
|
|
|
314
|
-
<span data-slot="itemTrailing" :class="ui.itemTrailing({ class: [
|
|
315
|
+
<span data-slot="itemTrailing" :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, isSelectItem(item) && item.ui?.itemTrailing] })">
|
|
315
316
|
<slot name="item-trailing" :item="item" :index="index" :ui="ui" />
|
|
316
317
|
|
|
317
318
|
<ComboboxItemIndicator as-child>
|
|
318
|
-
<UIcon :name="selectedIcon || appConfig.ui.icons.check" data-slot="itemTrailingIcon" :class="ui.itemTrailingIcon({ class: [
|
|
319
|
+
<UIcon :name="props.selectedIcon || appConfig.ui.icons.check" data-slot="itemTrailingIcon" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, isSelectItem(item) && item.ui?.itemTrailingIcon] })" />
|
|
319
320
|
</ComboboxItemIndicator>
|
|
320
321
|
</span>
|
|
321
322
|
</slot>
|
|
@@ -334,43 +335,43 @@ defineExpose({
|
|
|
334
335
|
@update:open="onUpdateOpen"
|
|
335
336
|
>
|
|
336
337
|
<ComboboxAnchor as-child>
|
|
337
|
-
<ComboboxTrigger ref="triggerRef" data-slot="base" :class="ui.base({ class: [
|
|
338
|
-
<span v-if="isLeading || !!avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class:
|
|
338
|
+
<ComboboxTrigger ref="triggerRef" data-slot="base" :class="ui.base({ class: [props.ui?.base, props.class] })" tabindex="0">
|
|
339
|
+
<span v-if="isLeading || !!props.avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
339
340
|
<slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
|
|
340
|
-
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class:
|
|
341
|
-
<UAvatar v-else-if="!!avatar" :size="
|
|
341
|
+
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
342
|
+
<UAvatar v-else-if="!!props.avatar" :size="props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="props.avatar" data-slot="itemLeadingAvatar" :class="ui.itemLeadingAvatar({ class: props.ui?.itemLeadingAvatar })" />
|
|
342
343
|
</slot>
|
|
343
344
|
</span>
|
|
344
345
|
|
|
345
346
|
<slot :model-value="modelValue" :open="open" :ui="ui">
|
|
346
347
|
<template v-for="displayedModelValue in [displayValue(modelValue)]" :key="displayedModelValue">
|
|
347
|
-
<span v-if="displayedModelValue !== void 0 && displayedModelValue !== null" data-slot="value" :class="ui.value({ class:
|
|
348
|
+
<span v-if="displayedModelValue !== void 0 && displayedModelValue !== null" data-slot="value" :class="ui.value({ class: props.ui?.value })">
|
|
348
349
|
{{ displayedModelValue }}
|
|
349
350
|
</span>
|
|
350
|
-
<span v-else data-slot="placeholder" :class="ui.placeholder({ class:
|
|
351
|
-
{{ placeholder ?? "\xA0" }}
|
|
351
|
+
<span v-else data-slot="placeholder" :class="ui.placeholder({ class: props.ui?.placeholder })">
|
|
352
|
+
{{ props.placeholder ?? "\xA0" }}
|
|
352
353
|
</span>
|
|
353
354
|
</template>
|
|
354
355
|
</slot>
|
|
355
356
|
|
|
356
|
-
<span v-if="isTrailing || !!slots.trailing || !!clear" data-slot="trailing" :class="ui.trailing({ class:
|
|
357
|
+
<span v-if="isTrailing || !!slots.trailing || !!props.clear" data-slot="trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
357
358
|
<slot name="trailing" :model-value="modelValue" :open="open" :ui="ui">
|
|
358
|
-
<ComboboxCancel v-if="!!clear && !isModelValueEmpty(modelValue)" as-child>
|
|
359
|
+
<ComboboxCancel v-if="!!props.clear && !isModelValueEmpty(modelValue)" as-child>
|
|
359
360
|
<UButton
|
|
360
361
|
as="span"
|
|
361
|
-
:icon="clearIcon || appConfig.ui.icons.close"
|
|
362
|
+
:icon="props.clearIcon || appConfig.ui.icons.close"
|
|
362
363
|
:size="selectSize"
|
|
363
364
|
variant="link"
|
|
364
365
|
color="neutral"
|
|
365
366
|
tabindex="-1"
|
|
366
367
|
v-bind="clearProps"
|
|
367
368
|
data-slot="trailingClear"
|
|
368
|
-
:class="ui.trailingClear({ class:
|
|
369
|
+
:class="ui.trailingClear({ class: props.ui?.trailingClear })"
|
|
369
370
|
@click.stop="onClear"
|
|
370
371
|
/>
|
|
371
372
|
</ComboboxCancel>
|
|
372
373
|
|
|
373
|
-
<UIcon v-else-if="trailingIconName" :name="trailingIconName" data-slot="trailingIcon" :class="ui.trailingIcon({ class:
|
|
374
|
+
<UIcon v-else-if="trailingIconName" :name="trailingIconName" data-slot="trailingIcon" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
374
375
|
</slot>
|
|
375
376
|
</span>
|
|
376
377
|
</ComboboxTrigger>
|
|
@@ -378,33 +379,33 @@ defineExpose({
|
|
|
378
379
|
|
|
379
380
|
<ComboboxPortal v-bind="portalProps">
|
|
380
381
|
<FieldGroupReset>
|
|
381
|
-
<ComboboxContent data-slot="content" :class="ui.content({ class:
|
|
382
|
-
<FocusScope trapped data-slot="focusScope" :class="ui.focusScope({ class:
|
|
382
|
+
<ComboboxContent data-slot="content" :class="ui.content({ class: props.ui?.content })" v-bind="contentProps">
|
|
383
|
+
<FocusScope trapped data-slot="focusScope" :class="ui.focusScope({ class: props.ui?.focusScope })">
|
|
383
384
|
<slot name="content-top" />
|
|
384
385
|
|
|
385
|
-
<ComboboxInput v-if="!!searchInput" v-model="searchTerm" :display-value="() => searchTerm" as-child>
|
|
386
|
+
<ComboboxInput v-if="!!props.searchInput" v-model="searchTerm" :display-value="() => searchTerm" as-child>
|
|
386
387
|
<UInput
|
|
387
388
|
autofocus
|
|
388
389
|
autocomplete="off"
|
|
389
390
|
:size="selectSize"
|
|
390
391
|
v-bind="searchInputProps"
|
|
391
392
|
:model-modifiers="{
|
|
392
|
-
trim: modelModifiers?.trim
|
|
393
|
+
trim: props.modelModifiers?.trim
|
|
393
394
|
}"
|
|
394
395
|
data-slot="input"
|
|
395
|
-
:class="ui.input({ class:
|
|
396
|
+
:class="ui.input({ class: props.ui?.input })"
|
|
396
397
|
@change.stop
|
|
397
398
|
/>
|
|
398
399
|
</ComboboxInput>
|
|
399
400
|
|
|
400
|
-
<ComboboxEmpty data-slot="empty" :class="ui.empty({ class:
|
|
401
|
+
<ComboboxEmpty data-slot="empty" :class="ui.empty({ class: props.ui?.empty })">
|
|
401
402
|
<slot name="empty" :search-term="searchTerm">
|
|
402
403
|
{{ searchTerm ? t("selectMenu.noMatch", { searchTerm }) : t("selectMenu.noData") }}
|
|
403
404
|
</slot>
|
|
404
405
|
</ComboboxEmpty>
|
|
405
406
|
|
|
406
|
-
<div ref="viewportRef" role="presentation" data-slot="viewport" :class="ui.viewport({ class:
|
|
407
|
-
<template v-if="!!virtualize">
|
|
407
|
+
<div ref="viewportRef" role="presentation" data-slot="viewport" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
408
|
+
<template v-if="!!props.virtualize">
|
|
408
409
|
<ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'top'" />
|
|
409
410
|
|
|
410
411
|
<ComboboxVirtualizer
|
|
@@ -420,15 +421,15 @@ defineExpose({
|
|
|
420
421
|
</template>
|
|
421
422
|
|
|
422
423
|
<template v-else>
|
|
423
|
-
<ComboboxGroup v-if="createItem && createItemPosition === 'top'" data-slot="group" :class="ui.group({ class:
|
|
424
|
+
<ComboboxGroup v-if="createItem && createItemPosition === 'top'" data-slot="group" :class="ui.group({ class: props.ui?.group })">
|
|
424
425
|
<ReuseCreateItemTemplate />
|
|
425
426
|
</ComboboxGroup>
|
|
426
427
|
|
|
427
|
-
<ComboboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" data-slot="group" :class="ui.group({ class:
|
|
428
|
+
<ComboboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" data-slot="group" :class="ui.group({ class: props.ui?.group })">
|
|
428
429
|
<ReuseItemTemplate v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`" :item="item" :index="index" />
|
|
429
430
|
</ComboboxGroup>
|
|
430
431
|
|
|
431
|
-
<ComboboxGroup v-if="createItem && createItemPosition === 'bottom'" data-slot="group" :class="ui.group({ class:
|
|
432
|
+
<ComboboxGroup v-if="createItem && createItemPosition === 'bottom'" data-slot="group" :class="ui.group({ class: props.ui?.group })">
|
|
432
433
|
<ReuseCreateItemTemplate />
|
|
433
434
|
</ComboboxGroup>
|
|
434
435
|
</template>
|
|
@@ -437,7 +438,7 @@ defineExpose({
|
|
|
437
438
|
<slot name="content-bottom" />
|
|
438
439
|
</FocusScope>
|
|
439
440
|
|
|
440
|
-
<ComboboxArrow v-if="!!arrow" v-bind="arrowProps" data-slot="arrow" :class="ui.arrow({ class:
|
|
441
|
+
<ComboboxArrow v-if="!!props.arrow" v-bind="arrowProps" data-slot="arrow" :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
441
442
|
</ComboboxContent>
|
|
442
443
|
</FieldGroupReset>
|
|
443
444
|
</ComboboxPortal>
|
|
@@ -228,6 +228,30 @@ declare const __VLS_export: <T extends ArrayOrNested<SelectMenuItem>, VK extends
|
|
|
228
228
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
229
229
|
onChange?: ((event: Event) => any) | undefined;
|
|
230
230
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
231
|
+
onClear?: (() => any) | undefined;
|
|
232
|
+
onCreate?: ((item: string) => any) | undefined;
|
|
233
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
234
|
+
"onUpdate:modelValue"?: ((value: (Mod extends {
|
|
235
|
+
number: true;
|
|
236
|
+
} ? (Mod extends {
|
|
237
|
+
optional: true;
|
|
238
|
+
} ? (Mod extends {
|
|
239
|
+
nullable: true;
|
|
240
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
241
|
+
nullable: true;
|
|
242
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) extends infer T_1 ? T_1 extends (Mod extends {
|
|
243
|
+
optional: true;
|
|
244
|
+
} ? (Mod extends {
|
|
245
|
+
nullable: true;
|
|
246
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
247
|
+
nullable: true;
|
|
248
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) ? T_1 extends string ? number | T_1 : T_1 : never : never : Mod extends {
|
|
249
|
+
optional: true;
|
|
250
|
+
} ? (Mod extends {
|
|
251
|
+
nullable: true;
|
|
252
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
253
|
+
nullable: true;
|
|
254
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | IsClearUsed<M, C>) => any) | undefined;
|
|
231
255
|
onHighlight?: ((payload: {
|
|
232
256
|
ref: HTMLElement;
|
|
233
257
|
value: (Mod extends {
|
|
@@ -252,30 +276,6 @@ declare const __VLS_export: <T extends ArrayOrNested<SelectMenuItem>, VK extends
|
|
|
252
276
|
nullable: true;
|
|
253
277
|
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | IsClearUsed<M, C>;
|
|
254
278
|
} | undefined) => any) | undefined;
|
|
255
|
-
onClear?: (() => any) | undefined;
|
|
256
|
-
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
257
|
-
onCreate?: ((item: string) => any) | undefined;
|
|
258
|
-
"onUpdate:modelValue"?: ((value: (Mod extends {
|
|
259
|
-
number: true;
|
|
260
|
-
} ? (Mod extends {
|
|
261
|
-
optional: true;
|
|
262
|
-
} ? (Mod extends {
|
|
263
|
-
nullable: true;
|
|
264
|
-
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
265
|
-
nullable: true;
|
|
266
|
-
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) extends infer T_1 ? T_1 extends (Mod extends {
|
|
267
|
-
optional: true;
|
|
268
|
-
} ? (Mod extends {
|
|
269
|
-
nullable: true;
|
|
270
|
-
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
271
|
-
nullable: true;
|
|
272
|
-
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) ? T_1 extends string ? number | T_1 : T_1 : never : never : Mod extends {
|
|
273
|
-
optional: true;
|
|
274
|
-
} ? (Mod extends {
|
|
275
|
-
nullable: true;
|
|
276
|
-
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
277
|
-
nullable: true;
|
|
278
|
-
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | IsClearUsed<M, C>) => any) | undefined;
|
|
279
279
|
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
280
280
|
}> & (typeof globalThis extends {
|
|
281
281
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -286,7 +286,27 @@ declare const __VLS_export: <T extends ArrayOrNested<SelectMenuItem>, VK extends
|
|
|
286
286
|
}>) => void;
|
|
287
287
|
attrs: any;
|
|
288
288
|
slots: SelectMenuSlots<T, VK, M, Mod, C, NestedItem<T>>;
|
|
289
|
-
emit: (((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "
|
|
289
|
+
emit: (((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "clear") => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", value: (Mod extends {
|
|
290
|
+
number: true;
|
|
291
|
+
} ? (Mod extends {
|
|
292
|
+
optional: true;
|
|
293
|
+
} ? (Mod extends {
|
|
294
|
+
nullable: true;
|
|
295
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
296
|
+
nullable: true;
|
|
297
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) extends infer T_1 ? T_1 extends (Mod extends {
|
|
298
|
+
optional: true;
|
|
299
|
+
} ? (Mod extends {
|
|
300
|
+
nullable: true;
|
|
301
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
302
|
+
nullable: true;
|
|
303
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) ? T_1 extends string ? number | T_1 : T_1 : never : never : Mod extends {
|
|
304
|
+
optional: true;
|
|
305
|
+
} ? (Mod extends {
|
|
306
|
+
nullable: true;
|
|
307
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
308
|
+
nullable: true;
|
|
309
|
+
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | IsClearUsed<M, C>) => void) & ((evt: "highlight", payload: {
|
|
290
310
|
ref: HTMLElement;
|
|
291
311
|
value: (Mod extends {
|
|
292
312
|
number: true;
|
|
@@ -309,27 +329,7 @@ declare const __VLS_export: <T extends ArrayOrNested<SelectMenuItem>, VK extends
|
|
|
309
329
|
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
310
330
|
nullable: true;
|
|
311
331
|
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | IsClearUsed<M, C>;
|
|
312
|
-
} | undefined) => void)
|
|
313
|
-
number: true;
|
|
314
|
-
} ? (Mod extends {
|
|
315
|
-
optional: true;
|
|
316
|
-
} ? (Mod extends {
|
|
317
|
-
nullable: true;
|
|
318
|
-
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
319
|
-
nullable: true;
|
|
320
|
-
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) extends infer T_1 ? T_1 extends (Mod extends {
|
|
321
|
-
optional: true;
|
|
322
|
-
} ? (Mod extends {
|
|
323
|
-
nullable: true;
|
|
324
|
-
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
325
|
-
nullable: true;
|
|
326
|
-
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) ? T_1 extends string ? number | T_1 : T_1 : never : never : Mod extends {
|
|
327
|
-
optional: true;
|
|
328
|
-
} ? (Mod extends {
|
|
329
|
-
nullable: true;
|
|
330
|
-
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | undefined : Mod extends {
|
|
331
|
-
nullable: true;
|
|
332
|
-
} ? GetModelValue<T, VK, M, ExcludeItem> | null : GetModelValue<T, VK, M, ExcludeItem>) | IsClearUsed<M, C>) => void)) & ((event: "update:searchTerm", value: string) => void);
|
|
332
|
+
} | undefined) => void)) & ((event: "update:searchTerm", value: string) => void);
|
|
333
333
|
}>) => import("vue").VNode & {
|
|
334
334
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
335
335
|
};
|
|
@@ -12,14 +12,14 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
|
|
|
12
12
|
* @defaultValue 'div'
|
|
13
13
|
*/
|
|
14
14
|
as?: any;
|
|
15
|
-
/** Display a label
|
|
15
|
+
/** Display a label on the separator. */
|
|
16
16
|
label?: string;
|
|
17
17
|
/**
|
|
18
|
-
* Display an icon
|
|
18
|
+
* Display an icon on the separator.
|
|
19
19
|
* @IconifyIcon
|
|
20
20
|
*/
|
|
21
21
|
icon?: IconProps['name'];
|
|
22
|
-
/** Display an avatar
|
|
22
|
+
/** Display an avatar on the separator. */
|
|
23
23
|
avatar?: AvatarProps;
|
|
24
24
|
/**
|
|
25
25
|
* @defaultValue 'neutral'
|
|
@@ -38,6 +38,11 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
|
|
|
38
38
|
* @defaultValue 'horizontal'
|
|
39
39
|
*/
|
|
40
40
|
orientation?: Separator['variants']['orientation'];
|
|
41
|
+
/**
|
|
42
|
+
* The position of the content.
|
|
43
|
+
* @defaultValue 'center'
|
|
44
|
+
*/
|
|
45
|
+
position?: Separator['variants']['position'];
|
|
41
46
|
class?: any;
|
|
42
47
|
ui?: Separator['slots'];
|
|
43
48
|
}
|
|
@@ -49,6 +54,7 @@ export interface SeparatorSlots {
|
|
|
49
54
|
declare const _default: typeof __VLS_export;
|
|
50
55
|
export default _default;
|
|
51
56
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SeparatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SeparatorProps> & Readonly<{}>, {
|
|
57
|
+
position: Separator["variants"]["position"];
|
|
52
58
|
orientation: Separator["variants"]["orientation"];
|
|
53
59
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SeparatorSlots>;
|
|
54
60
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -4,14 +4,15 @@ import theme from "#build/ui/separator";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed } from "vue";
|
|
7
|
-
import { Separator
|
|
8
|
-
import { reactivePick } from "@vueuse/core";
|
|
7
|
+
import { Separator } from "reka-ui";
|
|
8
|
+
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
|
-
import {
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
11
12
|
import { tv } from "../utils/tv";
|
|
12
13
|
import UIcon from "./Icon.vue";
|
|
13
14
|
import UAvatar from "./Avatar.vue";
|
|
14
|
-
const
|
|
15
|
+
const _props = defineProps({
|
|
15
16
|
as: { type: null, required: false },
|
|
16
17
|
label: { type: String, required: false },
|
|
17
18
|
icon: { type: null, required: false },
|
|
@@ -20,36 +21,48 @@ const props = defineProps({
|
|
|
20
21
|
size: { type: null, required: false },
|
|
21
22
|
type: { type: null, required: false },
|
|
22
23
|
orientation: { type: null, required: false, default: "horizontal" },
|
|
24
|
+
position: { type: null, required: false, default: "center" },
|
|
23
25
|
class: { type: null, required: false },
|
|
24
26
|
ui: { type: null, required: false },
|
|
25
27
|
decorative: { type: Boolean, required: false }
|
|
26
28
|
});
|
|
27
29
|
const slots = defineSlots();
|
|
30
|
+
const props = useComponentProps("separator", _props);
|
|
28
31
|
const appConfig = useAppConfig();
|
|
29
|
-
const uiProp = useComponentUI("separator", props);
|
|
30
32
|
const rootProps = useForwardProps(reactivePick(props, "as", "decorative", "orientation"));
|
|
33
|
+
const [DefineContainer, ReuseContainer] = createReusableTemplate();
|
|
34
|
+
const hasContent = computed(() => !!(props.label || props.icon || props.avatar || slots.default));
|
|
31
35
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.separator || {} })({
|
|
32
36
|
color: props.color,
|
|
33
37
|
orientation: props.orientation,
|
|
34
38
|
size: props.size,
|
|
39
|
+
position: props.position,
|
|
35
40
|
type: props.type
|
|
36
41
|
}));
|
|
37
42
|
</script>
|
|
38
43
|
|
|
39
44
|
<template>
|
|
40
|
-
<
|
|
41
|
-
<div data-slot="
|
|
45
|
+
<DefineContainer>
|
|
46
|
+
<div data-slot="container" :class="ui.container({ class: props.ui?.container })">
|
|
47
|
+
<slot :ui="ui">
|
|
48
|
+
<span v-if="props.label" data-slot="label" :class="ui.label({ class: props.ui?.label })">{{ props.label }}</span>
|
|
49
|
+
<UIcon v-else-if="props.icon" :name="props.icon" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
|
|
50
|
+
<UAvatar v-else-if="props.avatar" :size="props.ui?.avatarSize || ui.avatarSize()" v-bind="props.avatar" data-slot="avatar" :class="ui.avatar({ class: props.ui?.avatar })" />
|
|
51
|
+
</slot>
|
|
52
|
+
</div>
|
|
53
|
+
</DefineContainer>
|
|
42
54
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<slot :ui="ui">
|
|
46
|
-
<span v-if="label" data-slot="label" :class="ui.label({ class: uiProp?.label })">{{ label }}</span>
|
|
47
|
-
<UIcon v-else-if="icon" :name="icon" data-slot="icon" :class="ui.icon({ class: uiProp?.icon })" />
|
|
48
|
-
<UAvatar v-else-if="avatar" :size="uiProp?.avatarSize || ui.avatarSize()" v-bind="avatar" data-slot="avatar" :class="ui.avatar({ class: uiProp?.avatar })" />
|
|
49
|
-
</slot>
|
|
50
|
-
</div>
|
|
55
|
+
<Separator v-bind="rootProps" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
56
|
+
<ReuseContainer v-if="hasContent && props.position === 'start'" />
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
<div data-slot="border" :class="ui.border({ class: props.ui?.border })" />
|
|
59
|
+
|
|
60
|
+
<template v-if="hasContent && props.position === 'center'">
|
|
61
|
+
<ReuseContainer />
|
|
62
|
+
|
|
63
|
+
<div data-slot="border" :class="ui.border({ class: props.ui?.border })" />
|
|
53
64
|
</template>
|
|
65
|
+
|
|
66
|
+
<ReuseContainer v-if="hasContent && props.position === 'end'" />
|
|
54
67
|
</Separator>
|
|
55
68
|
</template>
|
|
@@ -12,14 +12,14 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
|
|
|
12
12
|
* @defaultValue 'div'
|
|
13
13
|
*/
|
|
14
14
|
as?: any;
|
|
15
|
-
/** Display a label
|
|
15
|
+
/** Display a label on the separator. */
|
|
16
16
|
label?: string;
|
|
17
17
|
/**
|
|
18
|
-
* Display an icon
|
|
18
|
+
* Display an icon on the separator.
|
|
19
19
|
* @IconifyIcon
|
|
20
20
|
*/
|
|
21
21
|
icon?: IconProps['name'];
|
|
22
|
-
/** Display an avatar
|
|
22
|
+
/** Display an avatar on the separator. */
|
|
23
23
|
avatar?: AvatarProps;
|
|
24
24
|
/**
|
|
25
25
|
* @defaultValue 'neutral'
|
|
@@ -38,6 +38,11 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
|
|
|
38
38
|
* @defaultValue 'horizontal'
|
|
39
39
|
*/
|
|
40
40
|
orientation?: Separator['variants']['orientation'];
|
|
41
|
+
/**
|
|
42
|
+
* The position of the content.
|
|
43
|
+
* @defaultValue 'center'
|
|
44
|
+
*/
|
|
45
|
+
position?: Separator['variants']['position'];
|
|
41
46
|
class?: any;
|
|
42
47
|
ui?: Separator['slots'];
|
|
43
48
|
}
|
|
@@ -49,6 +54,7 @@ export interface SeparatorSlots {
|
|
|
49
54
|
declare const _default: typeof __VLS_export;
|
|
50
55
|
export default _default;
|
|
51
56
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SeparatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SeparatorProps> & Readonly<{}>, {
|
|
57
|
+
position: Separator["variants"]["position"];
|
|
52
58
|
orientation: Separator["variants"]["orientation"];
|
|
53
59
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SeparatorSlots>;
|
|
54
60
|
type __VLS_WithSlots<T, S> = T & {
|