@nuxt/ui 4.7.0 → 4.8.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/.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 +17 -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 +13 -11
- 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 +8 -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 +5 -5
- package/dist/runtime/components/Form.vue.d.ts +1 -1
- package/dist/runtime/components/FormField.d.vue.ts +2 -1
- package/dist/runtime/components/FormField.vue +21 -21
- package/dist/runtime/components/FormField.vue.d.ts +2 -1
- package/dist/runtime/components/Header.vue +19 -19
- 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 +11 -2
- package/dist/runtime/components/Link.vue +13 -4
- package/dist/runtime/components/Link.vue.d.ts +11 -2
- 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 +30 -3
- package/dist/runtime/components/content/ContentSearch.vue +66 -32
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +30 -3
- 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 +17 -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 +1 -0
- 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/utils/dashboard.d.ts +1 -1
- package/dist/runtime/utils/link.d.ts +1 -1
- package/dist/runtime/utils/link.js +1 -0
- 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 +1 -1
- package/dist/runtime/vue/overrides/inertia/Link.vue +5 -0
- 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/shared/{ui.BIQuJqNV.mjs → ui.CoJ8bnb0.mjs} +244 -83
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +27 -34
- 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
|
@@ -3,16 +3,17 @@ import theme from "#build/ui/command-palette";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { computed, ref, useTemplateRef, toRef } from "vue";
|
|
7
|
-
import { ListboxRoot, ListboxFilter, ListboxContent, ListboxGroup, ListboxGroupLabel, ListboxVirtualizer, ListboxItem, ListboxItemIndicator
|
|
6
|
+
import { computed, ref, useTemplateRef, toRef, watch, nextTick } from "vue";
|
|
7
|
+
import { ListboxRoot, ListboxFilter, ListboxContent, ListboxGroup, ListboxGroupLabel, ListboxVirtualizer, ListboxItem, ListboxItemIndicator } from "reka-ui";
|
|
8
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
8
9
|
import { defu } from "defu";
|
|
9
10
|
import { reactivePick, createReusableTemplate, refDebounced, refThrottled } from "@vueuse/core";
|
|
10
11
|
import { useFuse } from "@vueuse/integrations/useFuse";
|
|
11
12
|
import { useAppConfig } from "#imports";
|
|
12
|
-
import {
|
|
13
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
13
14
|
import { useLocale } from "../composables/useLocale";
|
|
14
15
|
import { omit, get } from "../utils";
|
|
15
|
-
import { highlight } from "../utils/
|
|
16
|
+
import { highlight } from "../utils/search";
|
|
16
17
|
import { pickLinkProps } from "../utils/link";
|
|
17
18
|
import { getEstimateSize } from "../utils/virtualizer";
|
|
18
19
|
import { tv } from "../utils/tv";
|
|
@@ -25,7 +26,7 @@ import ULink from "./Link.vue";
|
|
|
25
26
|
import UInput from "./Input.vue";
|
|
26
27
|
import UKbd from "./Kbd.vue";
|
|
27
28
|
defineOptions({ inheritAttrs: false });
|
|
28
|
-
const
|
|
29
|
+
const _props = defineProps({
|
|
29
30
|
as: { type: null, required: false },
|
|
30
31
|
size: { type: null, required: false },
|
|
31
32
|
icon: { type: null, required: false },
|
|
@@ -61,11 +62,11 @@ const props = defineProps({
|
|
|
61
62
|
});
|
|
62
63
|
const emits = defineEmits(["update:modelValue", "highlight", "entryFocus", "leave", "update:open"]);
|
|
63
64
|
const slots = defineSlots();
|
|
65
|
+
const props = useComponentProps("commandPalette", _props);
|
|
64
66
|
const searchTerm = defineModel("searchTerm", { type: String, ...{ default: "" } });
|
|
65
67
|
const { t } = useLocale();
|
|
66
68
|
const appConfig = useAppConfig();
|
|
67
|
-
const
|
|
68
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "disabled", "multiple", "modelValue", "defaultValue", "highlightOnHover", "by"), emits);
|
|
69
|
+
const rootProps = useForwardProps(reactivePick(props, "as", "disabled", "multiple", "modelValue", "defaultValue", "highlightOnHover", "by"), emits);
|
|
69
70
|
const virtualizerProps = toRef(() => {
|
|
70
71
|
if (!props.virtualize) return false;
|
|
71
72
|
return defu(typeof props.virtualize === "boolean" ? {} : props.virtualize, {
|
|
@@ -96,7 +97,7 @@ const fuse = computed(() => defu({}, props.fuse, {
|
|
|
96
97
|
fuseOptions: {
|
|
97
98
|
ignoreLocation: true,
|
|
98
99
|
threshold: 0.1,
|
|
99
|
-
keys: [props.labelKey, "suffix"]
|
|
100
|
+
keys: [props.labelKey, props.descriptionKey, "suffix"]
|
|
100
101
|
},
|
|
101
102
|
resultLimit: 12,
|
|
102
103
|
matchAllWhenSearchEmpty: true
|
|
@@ -127,16 +128,17 @@ function processGroupItems(group, items2) {
|
|
|
127
128
|
items: processedItems.slice(0, fuse.value.resultLimit).map((item) => {
|
|
128
129
|
return {
|
|
129
130
|
...item,
|
|
130
|
-
labelHtml: highlight(item, fuseSearchTerm.value, props.labelKey),
|
|
131
|
-
suffixHtml: highlight(item, fuseSearchTerm.value,
|
|
131
|
+
labelHtml: item.labelHtml ?? highlight(item, fuseSearchTerm.value, props.labelKey, void 0, fuse.value.fuseOptions?.useTokenSearch),
|
|
132
|
+
suffixHtml: item.suffixHtml ?? highlight(item, fuseSearchTerm.value, "suffix", [props.labelKey], fuse.value.fuseOptions?.useTokenSearch),
|
|
133
|
+
descriptionHtml: item.descriptionHtml ?? highlight(item, fuseSearchTerm.value, props.descriptionKey, [props.labelKey, "suffix"], fuse.value.fuseOptions?.useTokenSearch)
|
|
132
134
|
};
|
|
133
135
|
})
|
|
134
136
|
};
|
|
135
137
|
}
|
|
136
138
|
const filteredGroups = computed(() => {
|
|
137
139
|
const currentGroups = groups.value;
|
|
138
|
-
const groupsById = throttledFuseResults.value.reduce((acc,
|
|
139
|
-
const { item, matches } =
|
|
140
|
+
const groupsById = throttledFuseResults.value.reduce((acc, result2) => {
|
|
141
|
+
const { item, matches } = result2;
|
|
140
142
|
if (!item.group) {
|
|
141
143
|
return acc;
|
|
142
144
|
}
|
|
@@ -169,17 +171,37 @@ const filteredGroups = computed(() => {
|
|
|
169
171
|
const processedGroup = processGroupItems(group, items2);
|
|
170
172
|
return processedGroup.items?.length ? processedGroup : void 0;
|
|
171
173
|
}).filter((group) => !!group);
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
174
|
+
const result = [...fuseGroups];
|
|
175
|
+
for (const group of currentGroups || []) {
|
|
176
|
+
if (!group.ignoreFilter || !group.items?.length) {
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
const processedGroup = processGroupItems(group, group.items);
|
|
180
|
+
if (!processedGroup.items?.length) {
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
const originalIndex = currentGroups.indexOf(group);
|
|
184
|
+
const precedingIds = /* @__PURE__ */ new Set();
|
|
185
|
+
for (let i = 0; i < originalIndex; i++) {
|
|
186
|
+
precedingIds.add(currentGroups[i].id);
|
|
187
|
+
}
|
|
188
|
+
let insertAfter = -1;
|
|
189
|
+
for (let i = 0; i < result.length; i++) {
|
|
190
|
+
if (precedingIds.has(result[i].id)) {
|
|
191
|
+
insertAfter = i;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
result.splice(insertAfter + 1, 0, processedGroup);
|
|
195
|
+
}
|
|
196
|
+
return result;
|
|
180
197
|
});
|
|
181
198
|
const filteredItems = computed(() => filteredGroups.value.flatMap((group) => group.items || []));
|
|
182
199
|
const rootRef = useTemplateRef("rootRef");
|
|
200
|
+
watch(filteredGroups, () => {
|
|
201
|
+
nextTick(() => {
|
|
202
|
+
rootRef.value?.highlightFirstItem();
|
|
203
|
+
});
|
|
204
|
+
});
|
|
183
205
|
function navigate(item) {
|
|
184
206
|
if (!item.children?.length) {
|
|
185
207
|
return;
|
|
@@ -221,66 +243,67 @@ function onSelect(e, item) {
|
|
|
221
243
|
<DefineItemTemplate v-slot="{ item, index, group }">
|
|
222
244
|
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
223
245
|
<ListboxItem
|
|
224
|
-
:value="props.valueKey ? get(item, props.valueKey) : omit(item, ['matches', 'group', 'onSelect', 'labelHtml', 'suffixHtml', 'children'])"
|
|
246
|
+
:value="props.valueKey ? get(item, props.valueKey) : omit(item, ['matches', 'group', 'onSelect', 'labelHtml', 'suffixHtml', 'descriptionHtml', 'children'])"
|
|
225
247
|
:disabled="item.disabled"
|
|
226
248
|
as-child
|
|
227
249
|
@select="onSelect($event, item)"
|
|
228
250
|
>
|
|
229
|
-
<ULinkBase v-bind="slotProps" data-slot="item" :class="ui.item({ class: [
|
|
251
|
+
<ULinkBase v-bind="slotProps" data-slot="item" :class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class], active: active || item.active })">
|
|
230
252
|
<slot :name="item.slot || group?.slot || 'item'" :item="item" :index="index" :ui="ui">
|
|
231
253
|
<slot :name="item.slot ? `${item.slot}-leading` : group?.slot ? `${group.slot}-leading` : `item-leading`" :item="item" :index="index" :ui="ui">
|
|
232
|
-
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" data-slot="itemLeadingIcon" :class="ui.itemLeadingIcon({ class: [
|
|
233
|
-
<UIcon v-else-if="item.icon" :name="item.icon" data-slot="itemLeadingIcon" :class="ui.itemLeadingIcon({ class: [
|
|
234
|
-
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize ||
|
|
254
|
+
<UIcon v-if="item.loading" :name="props.loadingIcon || appConfig.ui.icons.loading" data-slot="itemLeadingIcon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon], loading: true })" />
|
|
255
|
+
<UIcon v-else-if="item.icon" :name="item.icon" data-slot="itemLeadingIcon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon], active: active || item.active })" />
|
|
256
|
+
<UAvatar v-else-if="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], active: active || item.active })" />
|
|
235
257
|
<UChip
|
|
236
258
|
v-else-if="item.chip"
|
|
237
|
-
:size="item.ui?.itemLeadingChipSize ||
|
|
259
|
+
:size="item.ui?.itemLeadingChipSize || props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
238
260
|
inset
|
|
239
261
|
standalone
|
|
240
262
|
v-bind="item.chip"
|
|
241
263
|
data-slot="itemLeadingChip"
|
|
242
|
-
:class="ui.itemLeadingChip({ class: [
|
|
264
|
+
:class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip], active: active || item.active })"
|
|
243
265
|
/>
|
|
244
266
|
</slot>
|
|
245
267
|
|
|
246
|
-
<span v-if="item.prefix || (item.labelHtml || get(item, props.labelKey)) || (item.suffixHtml || item.suffix) || !!slots[item.slot ? `${item.slot}-label` : group?.slot ? `${group.slot}-label` : `item-label`] || (get(item, props.descriptionKey) || !!slots[item.slot ? `${item.slot}-description` : group?.slot ? `${group.slot}-description` : `item-description`])" data-slot="itemWrapper" :class="ui.itemWrapper({ class: [
|
|
247
|
-
<span data-slot="itemLabel" :class="ui.itemLabel({ class: [
|
|
268
|
+
<span v-if="item.prefix || (item.labelHtml || get(item, props.labelKey)) || (item.suffixHtml || item.suffix) || !!slots[item.slot ? `${item.slot}-label` : group?.slot ? `${group.slot}-label` : `item-label`] || (get(item, props.descriptionKey) || !!slots[item.slot ? `${item.slot}-description` : group?.slot ? `${group.slot}-description` : `item-description`])" data-slot="itemWrapper" :class="ui.itemWrapper({ class: [props.ui?.itemWrapper, item.ui?.itemWrapper] })">
|
|
269
|
+
<span data-slot="itemLabel" :class="ui.itemLabel({ class: [props.ui?.itemLabel, item.ui?.itemLabel], active: active || item.active })">
|
|
248
270
|
<slot :name="item.slot ? `${item.slot}-label` : group?.slot ? `${group.slot}-label` : `item-label`" :item="item" :index="index" :ui="ui">
|
|
249
|
-
<span v-if="item.prefix" data-slot="itemLabelPrefix" :class="ui.itemLabelPrefix({ class: [
|
|
271
|
+
<span v-if="item.prefix" data-slot="itemLabelPrefix" :class="ui.itemLabelPrefix({ class: [props.ui?.itemLabelPrefix, item.ui?.itemLabelPrefix] })">{{ item.prefix }}</span>
|
|
250
272
|
|
|
251
|
-
<span v-if="item.labelHtml" data-slot="itemLabelBase" :class="ui.itemLabelBase({ class: [
|
|
252
|
-
<span v-else data-slot="itemLabelBase" :class="ui.itemLabelBase({ class: [
|
|
273
|
+
<span v-if="item.labelHtml" data-slot="itemLabelBase" :class="ui.itemLabelBase({ class: [props.ui?.itemLabelBase, item.ui?.itemLabelBase], active: active || item.active })" v-html="item.labelHtml" />
|
|
274
|
+
<span v-else data-slot="itemLabelBase" :class="ui.itemLabelBase({ class: [props.ui?.itemLabelBase, item.ui?.itemLabelBase], active: active || item.active })">{{ get(item, props.labelKey) }}</span>
|
|
253
275
|
|
|
254
|
-
<span v-if="item.suffixHtml" data-slot="itemLabelSuffix" :class="ui.itemLabelSuffix({ class: [
|
|
255
|
-
<span v-else-if="item.suffix" data-slot="itemLabelSuffix" :class="ui.itemLabelSuffix({ class: [
|
|
276
|
+
<span v-if="item.suffixHtml" data-slot="itemLabelSuffix" :class="ui.itemLabelSuffix({ class: [props.ui?.itemLabelSuffix, item.ui?.itemLabelSuffix], active: active || item.active })" v-html="item.suffixHtml" />
|
|
277
|
+
<span v-else-if="item.suffix" data-slot="itemLabelSuffix" :class="ui.itemLabelSuffix({ class: [props.ui?.itemLabelSuffix, item.ui?.itemLabelSuffix], active: active || item.active })">{{ item.suffix }}</span>
|
|
256
278
|
</slot>
|
|
257
279
|
</span>
|
|
258
280
|
|
|
259
|
-
<span v-if="
|
|
281
|
+
<span v-if="item.descriptionHtml" data-slot="itemDescription" :class="ui.itemDescription({ class: [props.ui?.itemDescription, item.ui?.itemDescription] })" v-html="item.descriptionHtml" />
|
|
282
|
+
<span v-else-if="get(item, props.descriptionKey) || !!slots[item.slot ? `${item.slot}-description` : group?.slot ? `${group.slot}-description` : `item-description`]" data-slot="itemDescription" :class="ui.itemDescription({ class: [props.ui?.itemDescription, item.ui?.itemDescription] })">
|
|
260
283
|
<slot :name="item.slot ? `${item.slot}-description` : group?.slot ? `${group.slot}-description` : `item-description`" :item="item" :index="index" :ui="ui">
|
|
261
284
|
{{ get(item, props.descriptionKey) }}
|
|
262
285
|
</slot>
|
|
263
286
|
</span>
|
|
264
287
|
</span>
|
|
265
288
|
|
|
266
|
-
<span data-slot="itemTrailing" :class="ui.itemTrailing({ class: [
|
|
289
|
+
<span data-slot="itemTrailing" :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, item.ui?.itemTrailing] })">
|
|
267
290
|
<slot :name="item.slot ? `${item.slot}-trailing` : group?.slot ? `${group.slot}-trailing` : `item-trailing`" :item="item" :index="index" :ui="ui">
|
|
268
291
|
<UIcon
|
|
269
292
|
v-if="item.children && item.children.length > 0"
|
|
270
|
-
:name="childrenIcon || appConfig.ui.icons.chevronRight"
|
|
293
|
+
:name="props.childrenIcon || appConfig.ui.icons.chevronRight"
|
|
271
294
|
data-slot="itemTrailingIcon"
|
|
272
|
-
:class="ui.itemTrailingIcon({ class: [
|
|
295
|
+
:class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, item.ui?.itemTrailingIcon] })"
|
|
273
296
|
/>
|
|
274
297
|
|
|
275
|
-
<span v-else-if="item.kbds?.length" data-slot="itemTrailingKbds" :class="ui.itemTrailingKbds({ class: [
|
|
276
|
-
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize ||
|
|
298
|
+
<span v-else-if="item.kbds?.length" data-slot="itemTrailingKbds" :class="ui.itemTrailingKbds({ class: [props.ui?.itemTrailingKbds, item.ui?.itemTrailingKbds] })">
|
|
299
|
+
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize || props.ui?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
277
300
|
</span>
|
|
278
301
|
|
|
279
|
-
<UIcon v-else-if="group?.highlightedIcon" :name="group.highlightedIcon" data-slot="itemTrailingHighlightedIcon" :class="ui.itemTrailingHighlightedIcon({ class: [
|
|
302
|
+
<UIcon v-else-if="group?.highlightedIcon" :name="group.highlightedIcon" data-slot="itemTrailingHighlightedIcon" :class="ui.itemTrailingHighlightedIcon({ class: [props.ui?.itemTrailingHighlightedIcon, item.ui?.itemTrailingHighlightedIcon] })" />
|
|
280
303
|
</slot>
|
|
281
304
|
|
|
282
305
|
<ListboxItemIndicator v-if="!item.children?.length" as-child>
|
|
283
|
-
<UIcon :name="selectedIcon || appConfig.ui.icons.check" data-slot="itemTrailingIcon" :class="ui.itemTrailingIcon({ class: [
|
|
306
|
+
<UIcon :name="props.selectedIcon || appConfig.ui.icons.check" data-slot="itemTrailingIcon" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, item.ui?.itemTrailingIcon] })" />
|
|
284
307
|
</ListboxItemIndicator>
|
|
285
308
|
</span>
|
|
286
309
|
</slot>
|
|
@@ -289,50 +312,50 @@ function onSelect(e, item) {
|
|
|
289
312
|
</ULink>
|
|
290
313
|
</DefineItemTemplate>
|
|
291
314
|
|
|
292
|
-
<ListboxRoot v-bind="{ ...rootProps, ...$attrs }" ref="rootRef" :selection-behavior="selectionBehavior" data-slot="root" :class="ui.root({ class: [
|
|
293
|
-
<ListboxFilter v-if="input" v-model="searchTerm" as-child>
|
|
315
|
+
<ListboxRoot v-bind="{ ...rootProps, ...$attrs }" ref="rootRef" :selection-behavior="props.selectionBehavior" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
316
|
+
<ListboxFilter v-if="props.input" v-model="searchTerm" as-child>
|
|
294
317
|
<UInput
|
|
295
318
|
variant="none"
|
|
296
|
-
:size="size"
|
|
319
|
+
:size="props.size"
|
|
297
320
|
v-bind="typeof props.input === 'object' ? props.input : {}"
|
|
298
321
|
:placeholder="placeholder"
|
|
299
|
-
:autofocus="autofocus"
|
|
300
|
-
:loading="loading"
|
|
301
|
-
:loading-icon="loadingIcon"
|
|
302
|
-
:trailing-icon="trailingIcon"
|
|
303
|
-
:icon="icon || appConfig.ui.icons.search"
|
|
322
|
+
:autofocus="props.autofocus"
|
|
323
|
+
:loading="props.loading"
|
|
324
|
+
:loading-icon="props.loadingIcon"
|
|
325
|
+
:trailing-icon="props.trailingIcon"
|
|
326
|
+
:icon="props.icon || appConfig.ui.icons.search"
|
|
304
327
|
data-slot="input"
|
|
305
|
-
:class="ui.input({ class:
|
|
328
|
+
:class="ui.input({ class: props.ui?.input })"
|
|
306
329
|
@keydown.backspace="onBackspace"
|
|
307
330
|
>
|
|
308
|
-
<template v-if="history?.length && (back || !!slots.back)" #leading>
|
|
331
|
+
<template v-if="history?.length && (props.back || !!slots.back)" #leading>
|
|
309
332
|
<slot name="back" :ui="ui">
|
|
310
333
|
<UButton
|
|
311
|
-
:size="size"
|
|
312
|
-
:icon="backIcon || appConfig.ui.icons.arrowLeft"
|
|
334
|
+
:size="props.size"
|
|
335
|
+
:icon="props.backIcon || appConfig.ui.icons.arrowLeft"
|
|
313
336
|
color="neutral"
|
|
314
337
|
variant="link"
|
|
315
338
|
:aria-label="t('commandPalette.back')"
|
|
316
|
-
v-bind="typeof back === 'object' ? back : {}"
|
|
339
|
+
v-bind="typeof props.back === 'object' ? props.back : {}"
|
|
317
340
|
data-slot="back"
|
|
318
|
-
:class="ui.back({ class:
|
|
341
|
+
:class="ui.back({ class: props.ui?.back })"
|
|
319
342
|
@click="navigateBack"
|
|
320
343
|
/>
|
|
321
344
|
</slot>
|
|
322
345
|
</template>
|
|
323
346
|
|
|
324
|
-
<template v-if="close || !!slots.close" #trailing>
|
|
347
|
+
<template v-if="props.close || !!slots.close" #trailing>
|
|
325
348
|
<slot name="close" :ui="ui">
|
|
326
349
|
<UButton
|
|
327
|
-
v-if="close"
|
|
328
|
-
:size="size"
|
|
329
|
-
:icon="closeIcon || appConfig.ui.icons.close"
|
|
350
|
+
v-if="props.close"
|
|
351
|
+
:size="props.size"
|
|
352
|
+
:icon="props.closeIcon || appConfig.ui.icons.close"
|
|
330
353
|
color="neutral"
|
|
331
354
|
variant="ghost"
|
|
332
355
|
:aria-label="t('commandPalette.close')"
|
|
333
|
-
v-bind="typeof close === 'object' ? close : {}"
|
|
356
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
334
357
|
data-slot="close"
|
|
335
|
-
:class="ui.close({ class:
|
|
358
|
+
:class="ui.close({ class: props.ui?.close })"
|
|
336
359
|
@click="emits('update:open', false)"
|
|
337
360
|
/>
|
|
338
361
|
</slot>
|
|
@@ -340,10 +363,10 @@ function onSelect(e, item) {
|
|
|
340
363
|
</UInput>
|
|
341
364
|
</ListboxFilter>
|
|
342
365
|
|
|
343
|
-
<ListboxContent data-slot="content" :class="ui.content({ class:
|
|
344
|
-
<div v-if="filteredGroups?.length" role="presentation" data-slot="viewport" :class="ui.viewport({ class:
|
|
366
|
+
<ListboxContent data-slot="content" :class="ui.content({ class: props.ui?.content })">
|
|
367
|
+
<div v-if="filteredGroups?.length" role="presentation" data-slot="viewport" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
345
368
|
<ListboxVirtualizer
|
|
346
|
-
v-if="!!virtualize"
|
|
369
|
+
v-if="!!props.virtualize"
|
|
347
370
|
v-slot="{ option: item, virtualItem }"
|
|
348
371
|
:options="filteredItems"
|
|
349
372
|
:text-content="(item2) => get(item2, props.labelKey)"
|
|
@@ -353,8 +376,8 @@ function onSelect(e, item) {
|
|
|
353
376
|
</ListboxVirtualizer>
|
|
354
377
|
|
|
355
378
|
<template v-else>
|
|
356
|
-
<ListboxGroup v-for="group in filteredGroups" :key="`group-${group.id}`" data-slot="group" :class="ui.group({ class:
|
|
357
|
-
<ListboxGroupLabel v-if="get(group, props.labelKey) || !!slots[group.slot ? `${group.slot}-group-label` : 'group-label']" data-slot="label" :class="ui.label({ class:
|
|
379
|
+
<ListboxGroup v-for="group in filteredGroups" :key="`group-${group.id}`" data-slot="group" :class="ui.group({ class: props.ui?.group })">
|
|
380
|
+
<ListboxGroupLabel v-if="get(group, props.labelKey) || !!slots[group.slot ? `${group.slot}-group-label` : 'group-label']" data-slot="label" :class="ui.label({ class: props.ui?.label })">
|
|
358
381
|
<slot :name="group.slot ? `${group.slot}-group-label` : 'group-label'" :group="group" :label="get(group, props.labelKey)" :ui="ui">
|
|
359
382
|
{{ get(group, props.labelKey) }}
|
|
360
383
|
</slot>
|
|
@@ -371,14 +394,14 @@ function onSelect(e, item) {
|
|
|
371
394
|
</template>
|
|
372
395
|
</div>
|
|
373
396
|
|
|
374
|
-
<div v-else data-slot="empty" :class="ui.empty({ class:
|
|
397
|
+
<div v-else data-slot="empty" :class="ui.empty({ class: props.ui?.empty })">
|
|
375
398
|
<slot name="empty" :search-term="searchTerm">
|
|
376
399
|
{{ searchTerm ? t("commandPalette.noMatch", { searchTerm }) : t("commandPalette.noData") }}
|
|
377
400
|
</slot>
|
|
378
401
|
</div>
|
|
379
402
|
</ListboxContent>
|
|
380
403
|
|
|
381
|
-
<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class:
|
|
404
|
+
<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class: props.ui?.footer })">
|
|
382
405
|
<slot name="footer" :ui="ui" />
|
|
383
406
|
</div>
|
|
384
407
|
</ListboxRoot>
|
|
@@ -134,7 +134,7 @@ export interface CommandPaletteProps<G extends CommandPaletteGroup<T> = CommandP
|
|
|
134
134
|
fuseOptions: {
|
|
135
135
|
ignoreLocation: true,
|
|
136
136
|
threshold: 0.1,
|
|
137
|
-
keys: ['label', 'suffix']
|
|
137
|
+
keys: ['label', 'description', 'suffix']
|
|
138
138
|
},
|
|
139
139
|
resultLimit: 12,
|
|
140
140
|
matchAllWhenSearchEmpty: true
|
|
@@ -230,12 +230,12 @@ declare const __VLS_export: <G extends CommandPaletteGroup<T>, T extends Command
|
|
|
230
230
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<(CommandPaletteProps<G, T> & {
|
|
231
231
|
searchTerm?: string;
|
|
232
232
|
}) & {
|
|
233
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
234
|
+
"onUpdate:modelValue"?: ((value: T) => any) | undefined;
|
|
233
235
|
onHighlight?: ((payload: {
|
|
234
236
|
ref: HTMLElement;
|
|
235
237
|
value: T;
|
|
236
238
|
} | undefined) => any) | undefined;
|
|
237
|
-
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
238
|
-
"onUpdate:modelValue"?: ((value: T) => any) | undefined;
|
|
239
239
|
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
240
240
|
onEntryFocus?: ((event: CustomEvent<any>) => any) | undefined;
|
|
241
241
|
onLeave?: ((event: Event) => any) | undefined;
|
|
@@ -245,10 +245,10 @@ declare const __VLS_export: <G extends CommandPaletteGroup<T>, T extends Command
|
|
|
245
245
|
expose: (exposed: {}) => void;
|
|
246
246
|
attrs: any;
|
|
247
247
|
slots: CommandPaletteSlots<T, G>;
|
|
248
|
-
emit: (((evt: "highlight", payload: {
|
|
248
|
+
emit: (((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", value: T) => void) & ((evt: "highlight", payload: {
|
|
249
249
|
ref: HTMLElement;
|
|
250
250
|
value: T;
|
|
251
|
-
} | undefined) => void) & ((evt: "
|
|
251
|
+
} | undefined) => void) & ((evt: "entryFocus", event: CustomEvent<any>) => void) & ((evt: "leave", event: Event) => void)) & ((event: "update:searchTerm", value: string) => void);
|
|
252
252
|
}>) => import("vue").VNode & {
|
|
253
253
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
254
254
|
};
|
|
@@ -7,20 +7,20 @@ import { computed } from "vue";
|
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
9
|
import { tv } from "../utils/tv";
|
|
10
|
-
import {
|
|
11
|
-
const
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
|
+
const _props = defineProps({
|
|
12
12
|
as: { type: null, required: false },
|
|
13
13
|
class: { type: null, required: false },
|
|
14
14
|
ui: { type: Object, required: false }
|
|
15
15
|
});
|
|
16
16
|
defineSlots();
|
|
17
|
+
const props = useComponentProps("container", _props);
|
|
17
18
|
const appConfig = useAppConfig();
|
|
18
|
-
const uiProp = useComponentUI("container", props);
|
|
19
19
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.container || {} }));
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<template>
|
|
23
|
-
<Primitive :as="as" :class="ui({ class: [
|
|
23
|
+
<Primitive :as="props.as" :class="ui({ class: [props.ui?.base, props.class] })">
|
|
24
24
|
<slot />
|
|
25
25
|
</Primitive>
|
|
26
26
|
</template>
|
|
@@ -4,14 +4,15 @@ import theme from "#build/ui/context-menu";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef } from "vue";
|
|
7
|
-
import { ContextMenuRoot, ContextMenuTrigger
|
|
7
|
+
import { ContextMenuRoot, ContextMenuTrigger } from "reka-ui";
|
|
8
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
8
9
|
import { reactivePick } from "@vueuse/core";
|
|
9
10
|
import { useAppConfig } from "#imports";
|
|
10
|
-
import {
|
|
11
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
12
|
import { omit } from "../utils";
|
|
12
13
|
import { tv } from "../utils/tv";
|
|
13
14
|
import UContextMenuContent from "./ContextMenuContent.vue";
|
|
14
|
-
const
|
|
15
|
+
const _props = defineProps({
|
|
15
16
|
size: { type: null, required: false },
|
|
16
17
|
items: { type: null, required: false },
|
|
17
18
|
checkedIcon: { type: null, required: false },
|
|
@@ -29,9 +30,9 @@ const props = defineProps({
|
|
|
29
30
|
});
|
|
30
31
|
const emits = defineEmits(["update:open"]);
|
|
31
32
|
const slots = defineSlots();
|
|
33
|
+
const props = useComponentProps("contextMenu", _props);
|
|
32
34
|
const appConfig = useAppConfig();
|
|
33
|
-
const
|
|
34
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "modal"), emits);
|
|
35
|
+
const rootProps = useForwardProps(reactivePick(props, "modal"), emits);
|
|
35
36
|
const contentProps = toRef(() => props.content);
|
|
36
37
|
const getProxySlots = () => omit(slots, ["default"]);
|
|
37
38
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.contextMenu || {} })({
|
|
@@ -41,22 +42,22 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.contextMenu |
|
|
|
41
42
|
|
|
42
43
|
<template>
|
|
43
44
|
<ContextMenuRoot v-bind="rootProps">
|
|
44
|
-
<ContextMenuTrigger v-if="!!slots.default" as-child :disabled="disabled" :class="props.class">
|
|
45
|
+
<ContextMenuTrigger v-if="!!slots.default" as-child :disabled="props.disabled" :class="props.class">
|
|
45
46
|
<slot />
|
|
46
47
|
</ContextMenuTrigger>
|
|
47
48
|
|
|
48
49
|
<UContextMenuContent
|
|
49
|
-
:class="ui.content({ class: [!slots.default && props.class,
|
|
50
|
+
:class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })"
|
|
50
51
|
:ui="ui"
|
|
51
|
-
:ui-override="
|
|
52
|
+
:ui-override="props.ui"
|
|
52
53
|
v-bind="contentProps"
|
|
53
|
-
:items="items"
|
|
54
|
-
:portal="portal"
|
|
55
|
-
:label-key="labelKey"
|
|
56
|
-
:description-key="descriptionKey"
|
|
57
|
-
:checked-icon="checkedIcon"
|
|
58
|
-
:loading-icon="loadingIcon"
|
|
59
|
-
:external-icon="externalIcon"
|
|
54
|
+
:items="props.items"
|
|
55
|
+
:portal="props.portal"
|
|
56
|
+
:label-key="props.labelKey"
|
|
57
|
+
:description-key="props.descriptionKey"
|
|
58
|
+
:checked-icon="props.checkedIcon"
|
|
59
|
+
:loading-icon="props.loadingIcon"
|
|
60
|
+
:external-icon="props.externalIcon"
|
|
60
61
|
>
|
|
61
62
|
<template v-for="(_, name) in getProxySlots()" #[name]="slotData">
|
|
62
63
|
<slot :name="name" v-bind="slotData" />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { UseResizableProps } from '../composables/useResizable';
|
|
3
|
-
export interface DashboardGroupProps extends Pick<UseResizableProps, 'storage' | 'storageKey' | 'persistent' | 'unit'> {
|
|
3
|
+
export interface DashboardGroupProps extends Pick<UseResizableProps, 'storage' | 'storageKey' | 'storageOptions' | 'persistent' | 'unit'> {
|
|
4
4
|
/**
|
|
5
5
|
* The element or component this component should render as.
|
|
6
6
|
* @defaultValue 'div'
|
|
@@ -8,26 +8,28 @@ import { Primitive } from "reka-ui";
|
|
|
8
8
|
import { useNuxtApp, useAppConfig } from "#imports";
|
|
9
9
|
import { provideDashboardContext } from "../utils/dashboard";
|
|
10
10
|
import { tv } from "../utils/tv";
|
|
11
|
-
import {
|
|
12
|
-
const
|
|
11
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
12
|
+
const _props = defineProps({
|
|
13
13
|
as: { type: null, required: false },
|
|
14
14
|
class: { type: null, required: false },
|
|
15
15
|
ui: { type: Object, required: false },
|
|
16
16
|
storage: { type: String, required: false, default: "cookie" },
|
|
17
17
|
storageKey: { type: String, required: false, default: "dashboard" },
|
|
18
|
+
storageOptions: { type: Object, required: false },
|
|
18
19
|
persistent: { type: Boolean, required: false, default: true },
|
|
19
20
|
unit: { type: String, required: false, default: "%" }
|
|
20
21
|
});
|
|
21
22
|
defineSlots();
|
|
23
|
+
const props = useComponentProps("dashboardGroup", _props);
|
|
22
24
|
const nuxtApp = useNuxtApp();
|
|
23
25
|
const appConfig = useAppConfig();
|
|
24
|
-
const uiProp = useComponentUI("dashboardGroup", props);
|
|
25
26
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardGroup || {} }));
|
|
26
27
|
const sidebarOpen = ref(false);
|
|
27
28
|
const sidebarCollapsed = ref(false);
|
|
28
29
|
provideDashboardContext({
|
|
29
30
|
storage: props.storage,
|
|
30
31
|
storageKey: props.storageKey,
|
|
32
|
+
storageOptions: props.storageOptions,
|
|
31
33
|
persistent: props.persistent,
|
|
32
34
|
unit: props.unit,
|
|
33
35
|
sidebarOpen,
|
|
@@ -45,7 +47,7 @@ provideDashboardContext({
|
|
|
45
47
|
</script>
|
|
46
48
|
|
|
47
49
|
<template>
|
|
48
|
-
<Primitive :as="as" :class="ui({ class: [
|
|
50
|
+
<Primitive :as="props.as" :class="ui({ class: [props.ui?.base, props.class] })">
|
|
49
51
|
<slot />
|
|
50
52
|
</Primitive>
|
|
51
53
|
</template>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { UseResizableProps } from '../composables/useResizable';
|
|
3
|
-
export interface DashboardGroupProps extends Pick<UseResizableProps, 'storage' | 'storageKey' | 'persistent' | 'unit'> {
|
|
3
|
+
export interface DashboardGroupProps extends Pick<UseResizableProps, 'storage' | 'storageKey' | 'storageOptions' | 'persistent' | 'unit'> {
|
|
4
4
|
/**
|
|
5
5
|
* The element or component this component should render as.
|
|
6
6
|
* @defaultValue 'div'
|
|
@@ -7,13 +7,13 @@ import { computed } from "vue";
|
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { createReusableTemplate } from "@vueuse/core";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
|
-
import {
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
11
|
import { useDashboard } from "../utils/dashboard";
|
|
12
12
|
import { tv } from "../utils/tv";
|
|
13
13
|
import UDashboardSidebarToggle from "./DashboardSidebarToggle.vue";
|
|
14
14
|
import UIcon from "./Icon.vue";
|
|
15
15
|
defineOptions({ inheritAttrs: false });
|
|
16
|
-
const
|
|
16
|
+
const _props = defineProps({
|
|
17
17
|
as: { type: null, required: false },
|
|
18
18
|
icon: { type: null, required: false },
|
|
19
19
|
title: { type: String, required: false },
|
|
@@ -23,8 +23,8 @@ const props = defineProps({
|
|
|
23
23
|
ui: { type: Object, required: false }
|
|
24
24
|
});
|
|
25
25
|
const slots = defineSlots();
|
|
26
|
+
const props = useComponentProps("dashboardNavbar", _props);
|
|
26
27
|
const appConfig = useAppConfig();
|
|
27
|
-
const uiProp = useComponentUI("dashboardNavbar", props);
|
|
28
28
|
const dashboardContext = useDashboard({});
|
|
29
29
|
const [DefineToggleTemplate, ReuseToggleTemplate] = createReusableTemplate();
|
|
30
30
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardNavbar || {} })());
|
|
@@ -34,27 +34,27 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardNavb
|
|
|
34
34
|
<DefineToggleTemplate>
|
|
35
35
|
<slot name="toggle" v-bind="{ ...dashboardContext, ui }">
|
|
36
36
|
<UDashboardSidebarToggle
|
|
37
|
-
v-if="toggle"
|
|
38
|
-
v-bind="typeof toggle === 'object' ? toggle : {}"
|
|
39
|
-
:side="toggleSide"
|
|
37
|
+
v-if="props.toggle"
|
|
38
|
+
v-bind="typeof props.toggle === 'object' ? props.toggle : {}"
|
|
39
|
+
:side="props.toggleSide"
|
|
40
40
|
data-slot="toggle"
|
|
41
|
-
:class="ui.toggle({ class:
|
|
41
|
+
:class="ui.toggle({ class: props.ui?.toggle, toggleSide: props.toggleSide })"
|
|
42
42
|
/>
|
|
43
43
|
</slot>
|
|
44
44
|
</DefineToggleTemplate>
|
|
45
45
|
|
|
46
|
-
<Primitive :as="as" v-bind="$attrs" data-slot="root" :class="ui.root({ class: [
|
|
47
|
-
<div data-slot="left" :class="ui.left({ class:
|
|
48
|
-
<ReuseToggleTemplate v-if="toggleSide === 'left'" />
|
|
46
|
+
<Primitive :as="props.as" v-bind="$attrs" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
47
|
+
<div data-slot="left" :class="ui.left({ class: props.ui?.left })">
|
|
48
|
+
<ReuseToggleTemplate v-if="props.toggleSide === 'left'" />
|
|
49
49
|
|
|
50
50
|
<slot name="left" v-bind="dashboardContext">
|
|
51
51
|
<slot name="leading" v-bind="{ ...dashboardContext, ui }">
|
|
52
|
-
<UIcon v-if="icon" :name="icon" data-slot="icon" :class="ui.icon({ class:
|
|
52
|
+
<UIcon v-if="props.icon" :name="props.icon" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
|
|
53
53
|
</slot>
|
|
54
54
|
|
|
55
|
-
<h1 data-slot="title" :class="ui.title({ class:
|
|
55
|
+
<h1 data-slot="title" :class="ui.title({ class: props.ui?.title })">
|
|
56
56
|
<slot name="title">
|
|
57
|
-
{{ title }}
|
|
57
|
+
{{ props.title }}
|
|
58
58
|
</slot>
|
|
59
59
|
</h1>
|
|
60
60
|
|
|
@@ -62,14 +62,14 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardNavb
|
|
|
62
62
|
</slot>
|
|
63
63
|
</div>
|
|
64
64
|
|
|
65
|
-
<div v-if="!!slots.default" data-slot="center" :class="ui.center({ class:
|
|
65
|
+
<div v-if="!!slots.default" data-slot="center" :class="ui.center({ class: props.ui?.center })">
|
|
66
66
|
<slot v-bind="dashboardContext" />
|
|
67
67
|
</div>
|
|
68
68
|
|
|
69
|
-
<div data-slot="right" :class="ui.right({ class:
|
|
69
|
+
<div data-slot="right" :class="ui.right({ class: props.ui?.right })">
|
|
70
70
|
<slot name="right" v-bind="dashboardContext" />
|
|
71
71
|
|
|
72
|
-
<ReuseToggleTemplate v-if="toggleSide === 'right'" />
|
|
72
|
+
<ReuseToggleTemplate v-if="props.toggleSide === 'right'" />
|
|
73
73
|
</div>
|
|
74
74
|
</Primitive>
|
|
75
75
|
</template>
|