@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,10 +4,11 @@ import theme from "#build/ui/input-tags";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, useTemplateRef, onMounted, toRaw, toRef } from "vue";
|
|
7
|
-
import { TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput
|
|
7
|
+
import { TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput } 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 { useFieldGroup } from "../composables/useFieldGroup";
|
|
12
13
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
13
14
|
import { useFormField } from "../composables/useFormField";
|
|
@@ -15,7 +16,7 @@ import { tv } from "../utils/tv";
|
|
|
15
16
|
import UIcon from "./Icon.vue";
|
|
16
17
|
import UAvatar from "./Avatar.vue";
|
|
17
18
|
defineOptions({ inheritAttrs: false });
|
|
18
|
-
const
|
|
19
|
+
const _props = defineProps({
|
|
19
20
|
as: { type: null, required: false },
|
|
20
21
|
placeholder: { type: String, required: false },
|
|
21
22
|
maxLength: { type: Number, required: false },
|
|
@@ -54,19 +55,19 @@ const props = defineProps({
|
|
|
54
55
|
});
|
|
55
56
|
const emits = defineEmits(["change", "blur", "focus", "update:modelValue", "invalid", "addTag", "removeTag"]);
|
|
56
57
|
const slots = defineSlots();
|
|
58
|
+
const props = useComponentProps("inputTags", _props);
|
|
57
59
|
const appConfig = useAppConfig();
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
const {
|
|
61
|
-
const { orientation, size: fieldGroupSize } = useFieldGroup(props);
|
|
60
|
+
const rootProps = useForwardProps(reactivePick(props, "as", "addOnPaste", "addOnTab", "addOnBlur", "duplicate", "delimiter", "max", "convertValue", "displayValue", "required"), emits);
|
|
61
|
+
const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, size: formFieldSize, color, id, name, highlight, disabled, ariaAttrs } = useFormField(_props);
|
|
62
|
+
const { orientation, size: fieldGroupSize } = useFieldGroup(_props);
|
|
62
63
|
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
|
|
63
64
|
const inputSize = computed(() => fieldGroupSize.value || formFieldSize.value);
|
|
64
65
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.inputTags || {} })({
|
|
65
|
-
color: color.value,
|
|
66
|
+
color: color.value ?? props.color,
|
|
66
67
|
variant: props.variant,
|
|
67
|
-
size: inputSize?.value,
|
|
68
|
+
size: inputSize?.value ?? props.size,
|
|
68
69
|
loading: props.loading,
|
|
69
|
-
highlight: highlight.value,
|
|
70
|
+
highlight: highlight.value ?? props.highlight,
|
|
70
71
|
fixed: props.fixed,
|
|
71
72
|
leading: isLeading.value || !!props.avatar || !!slots.leading,
|
|
72
73
|
trailing: isTrailing.value || !!slots.trailing,
|
|
@@ -109,10 +110,10 @@ defineExpose({
|
|
|
109
110
|
<TagsInputRoot
|
|
110
111
|
:id="id"
|
|
111
112
|
v-slot="{ modelValue: tags }"
|
|
112
|
-
:model-value="modelValue"
|
|
113
|
-
:default-value="defaultValue"
|
|
113
|
+
:model-value="props.modelValue"
|
|
114
|
+
:default-value="props.defaultValue"
|
|
114
115
|
data-slot="root"
|
|
115
|
-
:class="ui.root({ class: [ui.base({ class:
|
|
116
|
+
:class="ui.root({ class: [ui.base({ class: props.ui?.base }), props.ui?.root, props.class] })"
|
|
116
117
|
v-bind="rootProps"
|
|
117
118
|
:name="name"
|
|
118
119
|
:disabled="disabled"
|
|
@@ -123,19 +124,19 @@ defineExpose({
|
|
|
123
124
|
:key="index"
|
|
124
125
|
:value="item"
|
|
125
126
|
data-slot="item"
|
|
126
|
-
:class="ui.item({ class: [
|
|
127
|
+
:class="ui.item({ class: [props.ui?.item] })"
|
|
127
128
|
>
|
|
128
|
-
<TagsInputItemText data-slot="itemText" :class="ui.itemText({ class: [
|
|
129
|
+
<TagsInputItemText data-slot="itemText" :class="ui.itemText({ class: [props.ui?.itemText] })">
|
|
129
130
|
<slot v-if="!!slots['item-text']" name="item-text" :item="item" :index="index" :ui="ui" />
|
|
130
131
|
</TagsInputItemText>
|
|
131
132
|
|
|
132
133
|
<TagsInputItemDelete
|
|
133
134
|
data-slot="itemDelete"
|
|
134
|
-
:class="ui.itemDelete({ class: [
|
|
135
|
+
:class="ui.itemDelete({ class: [props.ui?.itemDelete] })"
|
|
135
136
|
:disabled="disabled"
|
|
136
137
|
>
|
|
137
138
|
<slot name="item-delete" :item="item" :index="index" :ui="ui">
|
|
138
|
-
<UIcon :name="deleteIcon || appConfig.ui.icons.close" data-slot="itemDeleteIcon" :class="ui.itemDeleteIcon({ class: [
|
|
139
|
+
<UIcon :name="props.deleteIcon || appConfig.ui.icons.close" data-slot="itemDeleteIcon" :class="ui.itemDeleteIcon({ class: [props.ui?.itemDeleteIcon] })" />
|
|
139
140
|
</slot>
|
|
140
141
|
</TagsInputItemDelete>
|
|
141
142
|
</TagsInputItem>
|
|
@@ -143,26 +144,26 @@ defineExpose({
|
|
|
143
144
|
<TagsInputInput
|
|
144
145
|
ref="inputRef"
|
|
145
146
|
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
146
|
-
:placeholder="placeholder"
|
|
147
|
-
:max-length="maxLength"
|
|
147
|
+
:placeholder="props.placeholder"
|
|
148
|
+
:max-length="props.maxLength"
|
|
148
149
|
data-slot="input"
|
|
149
|
-
:class="ui.input({ class:
|
|
150
|
+
:class="ui.input({ class: props.ui?.input })"
|
|
150
151
|
@blur="onBlur"
|
|
151
152
|
@focus="onFocus"
|
|
152
153
|
/>
|
|
153
154
|
|
|
154
155
|
<slot :ui="ui" />
|
|
155
156
|
|
|
156
|
-
<span v-if="isLeading || !!avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class:
|
|
157
|
+
<span v-if="isLeading || !!props.avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
157
158
|
<slot name="leading" :ui="ui">
|
|
158
|
-
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class:
|
|
159
|
-
<UAvatar v-else-if="!!avatar" :size="
|
|
159
|
+
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
160
|
+
<UAvatar v-else-if="!!props.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="props.avatar" data-slot="leadingAvatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
|
|
160
161
|
</slot>
|
|
161
162
|
</span>
|
|
162
163
|
|
|
163
|
-
<span v-if="isTrailing || !!slots.trailing" data-slot="trailing" :class="ui.trailing({ class:
|
|
164
|
+
<span v-if="isTrailing || !!slots.trailing" data-slot="trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
164
165
|
<slot name="trailing" :ui="ui">
|
|
165
|
-
<UIcon v-if="trailingIconName" :name="trailingIconName" data-slot="trailingIcon" :class="ui.trailingIcon({ class:
|
|
166
|
+
<UIcon v-if="trailingIconName" :name="trailingIconName" data-slot="trailingIcon" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
166
167
|
</slot>
|
|
167
168
|
</span>
|
|
168
169
|
</TagsInputRoot>
|
|
@@ -4,11 +4,12 @@ import theme from "#build/ui/input-time";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, onMounted, ref } from "vue";
|
|
7
|
-
import { TimeRangeFieldRoot, TimeRangeFieldInput
|
|
7
|
+
import { TimeRangeFieldRoot, TimeRangeFieldInput } from "reka-ui";
|
|
8
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
8
9
|
import { TimeField as SingleTimeField } from "reka-ui/namespaced";
|
|
9
10
|
import { reactiveOmit, createReusableTemplate } from "@vueuse/core";
|
|
10
11
|
import { useAppConfig } from "#imports";
|
|
11
|
-
import {
|
|
12
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
12
13
|
import { useFieldGroup } from "../composables/useFieldGroup";
|
|
13
14
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
14
15
|
import { useFormField } from "../composables/useFormField";
|
|
@@ -16,7 +17,7 @@ import { tv } from "../utils/tv";
|
|
|
16
17
|
import UIcon from "./Icon.vue";
|
|
17
18
|
import UAvatar from "./Avatar.vue";
|
|
18
19
|
defineOptions({ inheritAttrs: false });
|
|
19
|
-
const
|
|
20
|
+
const _props = defineProps({
|
|
20
21
|
as: { type: null, required: false },
|
|
21
22
|
color: { type: null, required: false },
|
|
22
23
|
variant: { type: null, required: false },
|
|
@@ -57,19 +58,19 @@ const props = defineProps({
|
|
|
57
58
|
});
|
|
58
59
|
const emits = defineEmits(["update:modelValue", "change", "blur", "focus", "update:placeholder"]);
|
|
59
60
|
const slots = defineSlots();
|
|
61
|
+
const props = useComponentProps("inputTime", _props);
|
|
60
62
|
const appConfig = useAppConfig();
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const {
|
|
64
|
-
const { orientation, size: fieldGroupSize } = useFieldGroup(props);
|
|
63
|
+
const rootProps = useForwardProps(reactiveOmit(props, "id", "name", "range", "modelValue", "defaultValue", "color", "variant", "size", "highlight", "fixed", "disabled", "autofocus", "autofocusDelay", "icon", "avatar", "leading", "leadingIcon", "trailing", "trailingIcon", "loading", "loadingIcon", "separatorIcon", "class", "ui"), emits);
|
|
64
|
+
const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size: formFieldSize, name, highlight, disabled, ariaAttrs } = useFormField(_props);
|
|
65
|
+
const { orientation, size: fieldGroupSize } = useFieldGroup(_props);
|
|
65
66
|
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
|
|
66
67
|
const inputSize = computed(() => fieldGroupSize.value || formFieldSize.value);
|
|
67
68
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.inputTime || {} })({
|
|
68
|
-
color: color.value,
|
|
69
|
+
color: color.value ?? props.color,
|
|
69
70
|
variant: props.variant,
|
|
70
|
-
size: inputSize.value,
|
|
71
|
+
size: inputSize.value ?? props.size,
|
|
71
72
|
loading: props.loading,
|
|
72
|
-
highlight: highlight.value,
|
|
73
|
+
highlight: highlight.value ?? props.highlight,
|
|
73
74
|
fixed: props.fixed,
|
|
74
75
|
leading: isLeading.value || !!props.avatar || !!slots.leading,
|
|
75
76
|
trailing: isTrailing.value || !!slots.trailing,
|
|
@@ -120,7 +121,7 @@ defineExpose({
|
|
|
120
121
|
:type="type"
|
|
121
122
|
:part="segment.part"
|
|
122
123
|
data-slot="segment"
|
|
123
|
-
:class="ui.segment({ class:
|
|
124
|
+
:class="ui.segment({ class: props.ui?.segment })"
|
|
124
125
|
:data-segment="segment.part"
|
|
125
126
|
>
|
|
126
127
|
{{ segment.value.trim() }}
|
|
@@ -133,10 +134,10 @@ defineExpose({
|
|
|
133
134
|
v-slot="{ segments }"
|
|
134
135
|
:name="name"
|
|
135
136
|
:disabled="disabled"
|
|
136
|
-
:model-value="modelValue"
|
|
137
|
-
:default-value="defaultValue"
|
|
137
|
+
:model-value="props.modelValue"
|
|
138
|
+
:default-value="props.defaultValue"
|
|
138
139
|
data-slot="base"
|
|
139
|
-
:class="ui.base({ class: [
|
|
140
|
+
:class="ui.base({ class: [props.ui?.base, props.class] })"
|
|
140
141
|
@update:model-value="onUpdate"
|
|
141
142
|
@blur="onBlur"
|
|
142
143
|
@focus="onFocus"
|
|
@@ -147,23 +148,23 @@ defineExpose({
|
|
|
147
148
|
<template v-else>
|
|
148
149
|
<ReuseSegmentsTemplate :segments="segments.start" type="start" />
|
|
149
150
|
<slot name="separator" :ui="ui">
|
|
150
|
-
<UIcon :name="separatorIcon || appConfig.ui.icons.minus" data-slot="separatorIcon" :class="ui.separatorIcon({ class:
|
|
151
|
+
<UIcon :name="props.separatorIcon || appConfig.ui.icons.minus" data-slot="separatorIcon" :class="ui.separatorIcon({ class: props.ui?.separatorIcon })" />
|
|
151
152
|
</slot>
|
|
152
153
|
<ReuseSegmentsTemplate :segments="segments.end" type="end" />
|
|
153
154
|
</template>
|
|
154
155
|
|
|
155
156
|
<slot :ui="ui" />
|
|
156
157
|
|
|
157
|
-
<span v-if="isLeading || !!avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class:
|
|
158
|
+
<span v-if="isLeading || !!props.avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
158
159
|
<slot name="leading" :ui="ui">
|
|
159
|
-
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class:
|
|
160
|
-
<UAvatar v-else-if="!!avatar" :size="
|
|
160
|
+
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
161
|
+
<UAvatar v-else-if="!!props.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="props.avatar" data-slot="leadingAvatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
|
|
161
162
|
</slot>
|
|
162
163
|
</span>
|
|
163
164
|
|
|
164
|
-
<span v-if="isTrailing || !!slots.trailing" data-slot="trailing" :class="ui.trailing({ class:
|
|
165
|
+
<span v-if="isTrailing || !!slots.trailing" data-slot="trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
165
166
|
<slot name="trailing" :ui="ui">
|
|
166
|
-
<UIcon v-if="trailingIconName" :name="trailingIconName" data-slot="trailingIcon" :class="ui.trailingIcon({ class:
|
|
167
|
+
<UIcon v-if="trailingIconName" :name="trailingIconName" data-slot="trailingIcon" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
167
168
|
</slot>
|
|
168
169
|
</span>
|
|
169
170
|
</TimeField.Root>
|
|
@@ -7,9 +7,9 @@ import { computed } from "vue";
|
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
9
|
import { useKbd } from "../composables/useKbd";
|
|
10
|
-
import {
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
11
|
import { tv } from "../utils/tv";
|
|
12
|
-
const
|
|
12
|
+
const _props = defineProps({
|
|
13
13
|
as: { type: null, required: false, default: "kbd" },
|
|
14
14
|
value: { type: null, required: false },
|
|
15
15
|
color: { type: null, required: false },
|
|
@@ -19,16 +19,16 @@ const props = defineProps({
|
|
|
19
19
|
ui: { type: Object, required: false }
|
|
20
20
|
});
|
|
21
21
|
defineSlots();
|
|
22
|
+
const props = useComponentProps("kbd", _props);
|
|
22
23
|
const { getKbdKey } = useKbd();
|
|
23
24
|
const appConfig = useAppConfig();
|
|
24
|
-
const uiProp = useComponentUI("kbd", props);
|
|
25
25
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.kbd || {} }));
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
28
|
<template>
|
|
29
|
-
<Primitive :as="as" :class="ui({ class: [
|
|
29
|
+
<Primitive :as="props.as" :class="ui({ class: [props.ui?.base, props.class], color: props.color, variant: props.variant, size: props.size })">
|
|
30
30
|
<slot>
|
|
31
|
-
{{ getKbdKey(value) }}
|
|
31
|
+
{{ getKbdKey(props.value) }}
|
|
32
32
|
</slot>
|
|
33
33
|
</Primitive>
|
|
34
34
|
</template>
|
|
@@ -100,9 +100,9 @@ export interface LinkSlots {
|
|
|
100
100
|
declare const _default: typeof __VLS_export;
|
|
101
101
|
export default _default;
|
|
102
102
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkProps> & Readonly<{}>, {
|
|
103
|
-
active: boolean;
|
|
104
|
-
as: any;
|
|
105
103
|
type: "reset" | "submit" | "button";
|
|
104
|
+
as: any;
|
|
105
|
+
active: boolean;
|
|
106
106
|
ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
|
|
107
107
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
|
|
108
108
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -100,9 +100,9 @@ export interface LinkSlots {
|
|
|
100
100
|
declare const _default: typeof __VLS_export;
|
|
101
101
|
export default _default;
|
|
102
102
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkProps> & Readonly<{}>, {
|
|
103
|
-
active: boolean;
|
|
104
|
-
as: any;
|
|
105
103
|
type: "reset" | "submit" | "button";
|
|
104
|
+
as: any;
|
|
105
|
+
active: boolean;
|
|
106
106
|
ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
|
|
107
107
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
|
|
108
108
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -14,8 +14,8 @@ export interface LinkBaseProps {
|
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
15
15
|
export default _default;
|
|
16
16
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkBaseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkBaseProps> & Readonly<{}>, {
|
|
17
|
-
as: string;
|
|
18
17
|
type: string;
|
|
18
|
+
as: string;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
20
20
|
default?: (props: {}) => any;
|
|
21
21
|
}>;
|
|
@@ -14,8 +14,8 @@ export interface LinkBaseProps {
|
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
15
15
|
export default _default;
|
|
16
16
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkBaseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkBaseProps> & Readonly<{}>, {
|
|
17
|
-
as: string;
|
|
18
17
|
type: string;
|
|
18
|
+
as: string;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
20
20
|
default?: (props: {}) => any;
|
|
21
21
|
}>;
|
|
@@ -34,6 +34,10 @@ export interface ListboxProps<T extends ArrayOrNested<ListboxItem> = ArrayOrNest
|
|
|
34
34
|
* @defaultValue 'div'
|
|
35
35
|
*/
|
|
36
36
|
as?: any;
|
|
37
|
+
/**
|
|
38
|
+
* @defaultValue 'primary'
|
|
39
|
+
*/
|
|
40
|
+
color?: Listbox['variants']['color'];
|
|
37
41
|
/**
|
|
38
42
|
* @defaultValue 'md'
|
|
39
43
|
*/
|
|
@@ -160,10 +164,6 @@ declare const __VLS_export: <T extends ArrayOrNested<ListboxItem>, VK extends Ge
|
|
|
160
164
|
searchTerm?: string;
|
|
161
165
|
}) & {
|
|
162
166
|
onChange?: ((event: Event) => any) | undefined;
|
|
163
|
-
onHighlight?: ((payload: {
|
|
164
|
-
ref: HTMLElement;
|
|
165
|
-
value: import("reka-ui").AcceptableValue;
|
|
166
|
-
} | undefined) => any) | undefined;
|
|
167
167
|
"onUpdate:modelValue"?: ((value: Mod extends {
|
|
168
168
|
number: true;
|
|
169
169
|
} ? (Mod extends {
|
|
@@ -185,6 +185,10 @@ declare const __VLS_export: <T extends ArrayOrNested<ListboxItem>, VK extends Ge
|
|
|
185
185
|
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) | undefined : Mod extends {
|
|
186
186
|
nullable: true;
|
|
187
187
|
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) => any) | undefined;
|
|
188
|
+
onHighlight?: ((payload: {
|
|
189
|
+
ref: HTMLElement;
|
|
190
|
+
value: import("reka-ui").AcceptableValue;
|
|
191
|
+
} | undefined) => any) | undefined;
|
|
188
192
|
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
189
193
|
onEntryFocus?: ((event: CustomEvent<any>) => any) | undefined;
|
|
190
194
|
onLeave?: ((event: Event) => any) | undefined;
|
|
@@ -194,10 +198,7 @@ declare const __VLS_export: <T extends ArrayOrNested<ListboxItem>, VK extends Ge
|
|
|
194
198
|
expose: (exposed: {}) => void;
|
|
195
199
|
attrs: any;
|
|
196
200
|
slots: ListboxSlots<T>;
|
|
197
|
-
emit: (((evt: "change", event: Event) => void) & ((evt: "
|
|
198
|
-
ref: HTMLElement;
|
|
199
|
-
value: import("reka-ui").AcceptableValue;
|
|
200
|
-
} | undefined) => void) & ((evt: "update:modelValue", value: Mod extends {
|
|
201
|
+
emit: (((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: Mod extends {
|
|
201
202
|
number: true;
|
|
202
203
|
} ? (Mod extends {
|
|
203
204
|
optional: true;
|
|
@@ -217,7 +218,10 @@ declare const __VLS_export: <T extends ArrayOrNested<ListboxItem>, VK extends Ge
|
|
|
217
218
|
nullable: true;
|
|
218
219
|
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) | undefined : Mod extends {
|
|
219
220
|
nullable: true;
|
|
220
|
-
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) => void) & ((evt: "
|
|
221
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) => void) & ((evt: "highlight", payload: {
|
|
222
|
+
ref: HTMLElement;
|
|
223
|
+
value: import("reka-ui").AcceptableValue;
|
|
224
|
+
} | undefined) => void) & ((evt: "entryFocus", event: CustomEvent<any>) => void) & ((evt: "leave", event: Event) => void)) & ((event: "update:searchTerm", value: string) => void);
|
|
221
225
|
}>) => import("vue").VNode & {
|
|
222
226
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
223
227
|
};
|
|
@@ -4,11 +4,12 @@ import theme from "#build/ui/listbox";
|
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<script setup>
|
|
7
|
-
import { ListboxRoot, ListboxContent, ListboxGroup, ListboxGroupLabel, ListboxVirtualizer, ListboxItem as RekaListboxItem, ListboxItemIndicator, ListboxFilter
|
|
7
|
+
import { ListboxRoot, ListboxContent, ListboxGroup, ListboxGroupLabel, ListboxVirtualizer, ListboxItem as RekaListboxItem, ListboxItemIndicator, ListboxFilter } from "reka-ui";
|
|
8
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
8
9
|
import { createReusableTemplate, reactivePick } from "@vueuse/core";
|
|
9
10
|
import { defu } from "defu";
|
|
10
11
|
import { useAppConfig } from "#imports";
|
|
11
|
-
import {
|
|
12
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
12
13
|
import { useFilter } from "../composables/useFilter";
|
|
13
14
|
import { useFormField } from "../composables/useFormField";
|
|
14
15
|
import { useLocale } from "../composables/useLocale";
|
|
@@ -20,9 +21,10 @@ import UAvatar from "./Avatar.vue";
|
|
|
20
21
|
import UChip from "./Chip.vue";
|
|
21
22
|
import UInput from "./Input.vue";
|
|
22
23
|
defineOptions({ inheritAttrs: false });
|
|
23
|
-
const
|
|
24
|
+
const _props = defineProps({
|
|
24
25
|
id: { type: String, required: false },
|
|
25
26
|
as: { type: null, required: false },
|
|
27
|
+
color: { type: null, required: false },
|
|
26
28
|
size: { type: null, required: false },
|
|
27
29
|
items: { type: null, required: false },
|
|
28
30
|
modelValue: { type: null, required: false },
|
|
@@ -54,12 +56,12 @@ const props = defineProps({
|
|
|
54
56
|
});
|
|
55
57
|
const emits = defineEmits(["entryFocus", "highlight", "leave", "change", "update:modelValue"]);
|
|
56
58
|
const slots = defineSlots();
|
|
59
|
+
const props = useComponentProps("listbox", _props);
|
|
57
60
|
const searchTerm = defineModel("searchTerm", { type: String, ...{ default: "" } });
|
|
58
61
|
const { t } = useLocale();
|
|
59
62
|
const appConfig = useAppConfig();
|
|
60
|
-
const uiProp = useComponentUI("listbox", props);
|
|
61
63
|
const { filterGroups } = useFilter();
|
|
62
|
-
const rootProps =
|
|
64
|
+
const rootProps = useForwardProps(reactivePick(props, "as", "modelValue", "defaultValue", "multiple", "selectionBehavior", "highlightOnHover", "by", "orientation", "required"), emits);
|
|
63
65
|
const virtualizerProps = toRef(() => {
|
|
64
66
|
if (!props.virtualize) return false;
|
|
65
67
|
return defu(typeof props.virtualize === "boolean" ? {} : props.virtualize, {
|
|
@@ -67,7 +69,7 @@ const virtualizerProps = toRef(() => {
|
|
|
67
69
|
});
|
|
68
70
|
});
|
|
69
71
|
const inputProps = toRef(() => defu(typeof props.filter === "object" ? props.filter : {}, { placeholder: t("listbox.search"), variant: "none" }));
|
|
70
|
-
const { emitFormChange, emitFormInput, name, size, color, id, highlight, disabled, ariaAttrs } = useFormField(
|
|
72
|
+
const { emitFormChange, emitFormInput, name, size, color, id, highlight, disabled, ariaAttrs } = useFormField(_props, { bind: false });
|
|
71
73
|
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate({
|
|
72
74
|
props: {
|
|
73
75
|
item: {
|
|
@@ -81,9 +83,9 @@ const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate({
|
|
|
81
83
|
}
|
|
82
84
|
});
|
|
83
85
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.listbox || {} })({
|
|
84
|
-
color: color.value,
|
|
85
|
-
size: size.value,
|
|
86
|
-
highlight: highlight.value,
|
|
86
|
+
color: color.value ?? props.color,
|
|
87
|
+
size: size.value ?? props.size,
|
|
88
|
+
highlight: highlight.value ?? props.highlight,
|
|
87
89
|
disabled: disabled.value,
|
|
88
90
|
virtualize: !!props.virtualize
|
|
89
91
|
}));
|
|
@@ -136,54 +138,54 @@ const filteredItems = computed(() => filteredGroups.value.flatMap((group) => gro
|
|
|
136
138
|
|
|
137
139
|
<template>
|
|
138
140
|
<DefineItemTemplate v-slot="{ item, index }">
|
|
139
|
-
<ListboxGroupLabel v-if="item.type === 'label'" data-slot="label" :class="ui.label({ class: [
|
|
141
|
+
<ListboxGroupLabel v-if="item.type === 'label'" data-slot="label" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
|
|
140
142
|
{{ get(item, props.labelKey) }}
|
|
141
143
|
</ListboxGroupLabel>
|
|
142
144
|
|
|
143
|
-
<div v-else-if="item.type === 'separator'" role="separator" data-slot="separator" :class="ui.separator({ class: [
|
|
145
|
+
<div v-else-if="item.type === 'separator'" role="separator" data-slot="separator" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator, item.class] })" />
|
|
144
146
|
|
|
145
147
|
<RekaListboxItem
|
|
146
148
|
v-else
|
|
147
149
|
:value="props.valueKey ? get(item, props.valueKey) : item"
|
|
148
150
|
:disabled="item.disabled"
|
|
149
151
|
data-slot="item"
|
|
150
|
-
:class="ui.item({ class: [
|
|
152
|
+
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
151
153
|
@select="onSelect($event, item)"
|
|
152
154
|
>
|
|
153
155
|
<slot name="item" :item="item" :index="index" :ui="ui">
|
|
154
156
|
<slot name="item-leading" :item="item" :index="index" :ui="ui">
|
|
155
|
-
<UIcon v-if="item.icon" :name="item.icon" data-slot="itemLeadingIcon" :class="ui.itemLeadingIcon({ class: [
|
|
156
|
-
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize ||
|
|
157
|
+
<UIcon v-if="item.icon" :name="item.icon" data-slot="itemLeadingIcon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon] })" />
|
|
158
|
+
<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] })" />
|
|
157
159
|
<UChip
|
|
158
160
|
v-else-if="item.chip"
|
|
159
|
-
:size="item.ui?.itemLeadingChipSize ||
|
|
161
|
+
:size="item.ui?.itemLeadingChipSize || props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
160
162
|
inset
|
|
161
163
|
standalone
|
|
162
164
|
v-bind="item.chip"
|
|
163
165
|
data-slot="itemLeadingChip"
|
|
164
|
-
:class="ui.itemLeadingChip({ class: [
|
|
166
|
+
:class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip] })"
|
|
165
167
|
/>
|
|
166
168
|
</slot>
|
|
167
169
|
|
|
168
|
-
<span v-if="get(item, props.labelKey) || get(item, props.descriptionKey) || !!slots['item-label'] || !!slots['item-description']" data-slot="itemWrapper" :class="ui.itemWrapper({ class: [
|
|
169
|
-
<span v-if="get(item, props.labelKey) || !!slots['item-label']" data-slot="itemLabel" :class="ui.itemLabel({ class: [
|
|
170
|
+
<span v-if="get(item, props.labelKey) || get(item, props.descriptionKey) || !!slots['item-label'] || !!slots['item-description']" data-slot="itemWrapper" :class="ui.itemWrapper({ class: [props.ui?.itemWrapper, item.ui?.itemWrapper] })">
|
|
171
|
+
<span v-if="get(item, props.labelKey) || !!slots['item-label']" data-slot="itemLabel" :class="ui.itemLabel({ class: [props.ui?.itemLabel, item.ui?.itemLabel] })">
|
|
170
172
|
<slot name="item-label" :item="item" :index="index">
|
|
171
173
|
{{ get(item, props.labelKey) }}
|
|
172
174
|
</slot>
|
|
173
175
|
</span>
|
|
174
176
|
|
|
175
|
-
<span v-if="get(item, props.descriptionKey) || !!slots['item-description']" data-slot="itemDescription" :class="ui.itemDescription({ class: [
|
|
177
|
+
<span v-if="get(item, props.descriptionKey) || !!slots['item-description']" data-slot="itemDescription" :class="ui.itemDescription({ class: [props.ui?.itemDescription, item.ui?.itemDescription] })">
|
|
176
178
|
<slot name="item-description" :item="item" :index="index">
|
|
177
179
|
{{ get(item, props.descriptionKey) }}
|
|
178
180
|
</slot>
|
|
179
181
|
</span>
|
|
180
182
|
</span>
|
|
181
183
|
|
|
182
|
-
<span data-slot="itemTrailing" :class="ui.itemTrailing({ class: [
|
|
184
|
+
<span data-slot="itemTrailing" :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, item.ui?.itemTrailing] })">
|
|
183
185
|
<slot name="item-trailing" :item="item" :index="index" :ui="ui" />
|
|
184
186
|
|
|
185
187
|
<ListboxItemIndicator as-child>
|
|
186
|
-
<UIcon :name="selectedIcon || appConfig.ui.icons.check" data-slot="itemTrailingIcon" :class="ui.itemTrailingIcon({ class: [
|
|
188
|
+
<UIcon :name="props.selectedIcon || appConfig.ui.icons.check" data-slot="itemTrailingIcon" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, item.ui?.itemTrailingIcon] })" />
|
|
187
189
|
</ListboxItemIndicator>
|
|
188
190
|
</span>
|
|
189
191
|
</slot>
|
|
@@ -196,34 +198,34 @@ const filteredItems = computed(() => filteredGroups.value.flatMap((group) => gro
|
|
|
196
198
|
:disabled="disabled"
|
|
197
199
|
:name="name"
|
|
198
200
|
data-slot="root"
|
|
199
|
-
:class="ui.root({ class: [
|
|
201
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
200
202
|
@update:model-value="onUpdate"
|
|
201
203
|
>
|
|
202
|
-
<ListboxFilter v-if="filter" v-model="searchTerm" as-child>
|
|
204
|
+
<ListboxFilter v-if="props.filter" v-model="searchTerm" as-child>
|
|
203
205
|
<UInput
|
|
204
|
-
:autofocus="autofocus"
|
|
205
|
-
:autofocus-delay="autofocusDelay"
|
|
206
|
+
:autofocus="props.autofocus"
|
|
207
|
+
:autofocus-delay="props.autofocusDelay"
|
|
206
208
|
:size="size"
|
|
207
209
|
v-bind="inputProps"
|
|
208
210
|
data-slot="input"
|
|
209
|
-
:class="ui.input({ class:
|
|
211
|
+
:class="ui.input({ class: props.ui?.input })"
|
|
210
212
|
/>
|
|
211
213
|
</ListboxFilter>
|
|
212
214
|
|
|
213
|
-
<ListboxContent data-slot="content" :class="ui.content({ class:
|
|
214
|
-
<div v-if="loading" data-slot="loading" :class="ui.loading({ class:
|
|
215
|
+
<ListboxContent data-slot="content" :class="ui.content({ class: props.ui?.content })">
|
|
216
|
+
<div v-if="props.loading" data-slot="loading" :class="ui.loading({ class: props.ui?.loading })">
|
|
215
217
|
<slot name="loading">
|
|
216
|
-
<UIcon :name="loadingIcon || appConfig.ui.icons.loading" data-slot="loadingIcon" :class="ui.loadingIcon({ class:
|
|
218
|
+
<UIcon :name="props.loadingIcon || appConfig.ui.icons.loading" data-slot="loadingIcon" :class="ui.loadingIcon({ class: props.ui?.loadingIcon })" />
|
|
217
219
|
</slot>
|
|
218
220
|
</div>
|
|
219
|
-
<div v-else-if="!filteredItems.length" data-slot="empty" :class="ui.empty({ class:
|
|
221
|
+
<div v-else-if="!filteredItems.length" data-slot="empty" :class="ui.empty({ class: props.ui?.empty })">
|
|
220
222
|
<slot name="empty" :search-term="searchTerm">
|
|
221
223
|
{{ searchTerm ? t("listbox.noMatch", { searchTerm }) : t("listbox.noData") }}
|
|
222
224
|
</slot>
|
|
223
225
|
</div>
|
|
224
226
|
|
|
225
227
|
<ListboxVirtualizer
|
|
226
|
-
v-else-if="!!virtualize"
|
|
228
|
+
v-else-if="!!props.virtualize"
|
|
227
229
|
v-slot="{ option: item, virtualItem }"
|
|
228
230
|
:options="filteredItems"
|
|
229
231
|
:text-content="(item2) => get(item2, props.labelKey)"
|
|
@@ -233,7 +235,7 @@ const filteredItems = computed(() => filteredGroups.value.flatMap((group) => gro
|
|
|
233
235
|
</ListboxVirtualizer>
|
|
234
236
|
|
|
235
237
|
<template v-else>
|
|
236
|
-
<ListboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" data-slot="group" :class="ui.group({ class:
|
|
238
|
+
<ListboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" data-slot="group" :class="ui.group({ class: props.ui?.group })">
|
|
237
239
|
<ReuseItemTemplate v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`" :item="item" :index="index" />
|
|
238
240
|
</ListboxGroup>
|
|
239
241
|
</template>
|
|
@@ -34,6 +34,10 @@ export interface ListboxProps<T extends ArrayOrNested<ListboxItem> = ArrayOrNest
|
|
|
34
34
|
* @defaultValue 'div'
|
|
35
35
|
*/
|
|
36
36
|
as?: any;
|
|
37
|
+
/**
|
|
38
|
+
* @defaultValue 'primary'
|
|
39
|
+
*/
|
|
40
|
+
color?: Listbox['variants']['color'];
|
|
37
41
|
/**
|
|
38
42
|
* @defaultValue 'md'
|
|
39
43
|
*/
|
|
@@ -160,10 +164,6 @@ declare const __VLS_export: <T extends ArrayOrNested<ListboxItem>, VK extends Ge
|
|
|
160
164
|
searchTerm?: string;
|
|
161
165
|
}) & {
|
|
162
166
|
onChange?: ((event: Event) => any) | undefined;
|
|
163
|
-
onHighlight?: ((payload: {
|
|
164
|
-
ref: HTMLElement;
|
|
165
|
-
value: import("reka-ui").AcceptableValue;
|
|
166
|
-
} | undefined) => any) | undefined;
|
|
167
167
|
"onUpdate:modelValue"?: ((value: Mod extends {
|
|
168
168
|
number: true;
|
|
169
169
|
} ? (Mod extends {
|
|
@@ -185,6 +185,10 @@ declare const __VLS_export: <T extends ArrayOrNested<ListboxItem>, VK extends Ge
|
|
|
185
185
|
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) | undefined : Mod extends {
|
|
186
186
|
nullable: true;
|
|
187
187
|
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) => any) | undefined;
|
|
188
|
+
onHighlight?: ((payload: {
|
|
189
|
+
ref: HTMLElement;
|
|
190
|
+
value: import("reka-ui").AcceptableValue;
|
|
191
|
+
} | undefined) => any) | undefined;
|
|
188
192
|
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
189
193
|
onEntryFocus?: ((event: CustomEvent<any>) => any) | undefined;
|
|
190
194
|
onLeave?: ((event: Event) => any) | undefined;
|
|
@@ -194,10 +198,7 @@ declare const __VLS_export: <T extends ArrayOrNested<ListboxItem>, VK extends Ge
|
|
|
194
198
|
expose: (exposed: {}) => void;
|
|
195
199
|
attrs: any;
|
|
196
200
|
slots: ListboxSlots<T>;
|
|
197
|
-
emit: (((evt: "change", event: Event) => void) & ((evt: "
|
|
198
|
-
ref: HTMLElement;
|
|
199
|
-
value: import("reka-ui").AcceptableValue;
|
|
200
|
-
} | undefined) => void) & ((evt: "update:modelValue", value: Mod extends {
|
|
201
|
+
emit: (((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: Mod extends {
|
|
201
202
|
number: true;
|
|
202
203
|
} ? (Mod extends {
|
|
203
204
|
optional: true;
|
|
@@ -217,7 +218,10 @@ declare const __VLS_export: <T extends ArrayOrNested<ListboxItem>, VK extends Ge
|
|
|
217
218
|
nullable: true;
|
|
218
219
|
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) | undefined : Mod extends {
|
|
219
220
|
nullable: true;
|
|
220
|
-
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) => void) & ((evt: "
|
|
221
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) => void) & ((evt: "highlight", payload: {
|
|
222
|
+
ref: HTMLElement;
|
|
223
|
+
value: import("reka-ui").AcceptableValue;
|
|
224
|
+
} | undefined) => void) & ((evt: "entryFocus", event: CustomEvent<any>) => void) & ((evt: "leave", event: Event) => void)) & ((event: "update:searchTerm", value: string) => void);
|
|
221
225
|
}>) => import("vue").VNode & {
|
|
222
226
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
223
227
|
};
|