@eslamdevui/ui 3.2.0-beta.2 → 3.2.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/auth-form.ts +20 -0
- package/.nuxt/ui/banner.ts +105 -0
- package/.nuxt/ui/blog-post.ts +140 -0
- package/.nuxt/ui/blog-posts.ts +14 -0
- package/.nuxt/ui/changelog-version.ts +41 -0
- package/.nuxt/ui/changelog-versions.ts +8 -0
- package/.nuxt/ui/chat-palette.ts +8 -0
- package/.nuxt/ui/content/content-navigation.ts +6 -4
- package/.nuxt/ui/content-navigation.ts +6 -4
- package/.nuxt/ui/footer-columns.ts +28 -0
- package/.nuxt/ui/footer.ts +11 -0
- package/.nuxt/ui/header.ts +30 -0
- package/.nuxt/ui/index.ts +32 -1
- package/.nuxt/ui/main.ts +3 -0
- package/.nuxt/ui/page-accordion.ts +7 -0
- package/.nuxt/ui/page-anchors.ts +30 -0
- package/.nuxt/ui/page-aside.ts +10 -0
- package/.nuxt/ui/page-body.ts +3 -0
- package/.nuxt/ui/page-card.ts +276 -0
- package/.nuxt/ui/page-columns.ts +3 -0
- package/.nuxt/ui/page-cta.ts +72 -0
- package/.nuxt/ui/page-feature.ts +31 -0
- package/.nuxt/ui/page-grid.ts +3 -0
- package/.nuxt/ui/page-header.ts +18 -0
- package/.nuxt/ui/page-hero.ts +46 -0
- package/.nuxt/ui/page-links.ts +25 -0
- package/.nuxt/ui/page-list.ts +8 -0
- package/.nuxt/ui/page-logos.ts +15 -0
- package/.nuxt/ui/page-marquee.ts +66 -0
- package/.nuxt/ui/page-section.ts +88 -0
- package/.nuxt/ui/page.ts +32 -0
- package/.nuxt/ui/pricing-plan.ts +101 -0
- package/.nuxt/ui/pricing-plans.ts +27 -0
- package/.nuxt/ui/pricing-table.ts +51 -0
- package/.nuxt/ui/user.ts +106 -0
- package/LICENSE.md +9 -9
- package/README.md +147 -147
- package/cli/commands/make/component.mjs +95 -95
- package/cli/commands/make/index.mjs +14 -14
- package/cli/commands/make/locale.mjs +64 -64
- package/cli/index.mjs +15 -15
- package/cli/package.json +13 -13
- package/cli/templates.mjs +236 -236
- package/cli/utils.mjs +31 -31
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Accordion.vue +36 -36
- package/dist/runtime/components/Alert.vue +46 -46
- package/dist/runtime/components/App.vue +10 -10
- package/dist/runtime/components/AuthForm.vue +195 -0
- package/dist/runtime/components/AuthForm.vue.d.ts +85 -0
- package/dist/runtime/components/Avatar.vue +27 -27
- package/dist/runtime/components/AvatarGroup.vue +4 -4
- package/dist/runtime/components/Badge.vue +16 -16
- package/dist/runtime/components/Banner.vue +113 -0
- package/dist/runtime/components/Banner.vue.d.ts +68 -0
- package/dist/runtime/components/BlogPost.vue +141 -0
- package/dist/runtime/components/BlogPost.vue.d.ts +59 -0
- package/dist/runtime/components/BlogPosts.vue +33 -0
- package/dist/runtime/components/BlogPosts.vue.d.ts +30 -0
- package/dist/runtime/components/Breadcrumb.vue +32 -32
- package/dist/runtime/components/Button.vue +28 -28
- package/dist/runtime/components/ButtonGroup.vue +3 -3
- package/dist/runtime/components/Calendar.vue +74 -74
- package/dist/runtime/components/Card.vue +13 -13
- package/dist/runtime/components/Carousel.vue +58 -58
- package/dist/runtime/components/ChangelogVersion.vue +165 -0
- package/dist/runtime/components/ChangelogVersion.vue.d.ts +58 -0
- package/dist/runtime/components/ChangelogVersions.vue +54 -0
- package/dist/runtime/components/ChangelogVersions.vue.d.ts +74 -0
- package/dist/runtime/components/ChatMessage.vue +35 -35
- package/dist/runtime/components/ChatMessages.vue +55 -55
- package/dist/runtime/components/ChatPalette.vue +32 -0
- package/dist/runtime/components/ChatPalette.vue.d.ts +24 -0
- package/dist/runtime/components/ChatPrompt.vue +26 -26
- package/dist/runtime/components/ChatPrompt.vue.d.ts +1 -1
- package/dist/runtime/components/ChatPromptSubmit.vue +10 -10
- package/dist/runtime/components/Checkbox.vue +33 -33
- package/dist/runtime/components/CheckboxGroup.vue +32 -32
- package/dist/runtime/components/Chip.vue +11 -11
- package/dist/runtime/components/Collapsible.vue +9 -9
- package/dist/runtime/components/ColorPicker.vue +30 -30
- package/dist/runtime/components/CommandPalette.vue +117 -117
- package/dist/runtime/components/CommandPalette.vue.d.ts +3 -3
- package/dist/runtime/components/Container.vue +3 -3
- package/dist/runtime/components/ContextMenu.vue +22 -22
- package/dist/runtime/components/ContextMenuContent.vue +105 -105
- package/dist/runtime/components/DashboardGroup.vue +3 -3
- package/dist/runtime/components/DashboardNavbar.vue +40 -40
- package/dist/runtime/components/DashboardPanel.vue +27 -27
- package/dist/runtime/components/DashboardResizeHandle.vue +7 -7
- package/dist/runtime/components/DashboardSearch.vue +20 -20
- package/dist/runtime/components/DashboardSearchButton.vue +43 -43
- package/dist/runtime/components/DashboardSidebar.vue +74 -74
- package/dist/runtime/components/DashboardSidebarCollapse.vue +7 -7
- package/dist/runtime/components/DashboardSidebarToggle.vue +7 -7
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -1
- package/dist/runtime/components/Drawer.vue +55 -55
- package/dist/runtime/components/DropdownMenu.vue +24 -24
- package/dist/runtime/components/DropdownMenuContent.vue +107 -107
- package/dist/runtime/components/Error.vue +22 -22
- package/dist/runtime/components/Error.vue.d.ts +1 -1
- package/dist/runtime/components/Footer.vue +44 -0
- package/dist/runtime/components/Footer.vue.d.ts +29 -0
- package/dist/runtime/components/FooterColumns.vue +68 -0
- package/dist/runtime/components/FooterColumns.vue.d.ts +52 -0
- package/dist/runtime/components/Form.vue +8 -8
- package/dist/runtime/components/FormField.vue +37 -37
- package/dist/runtime/components/Header.vue +137 -0
- package/dist/runtime/components/Header.vue.d.ts +72 -0
- package/dist/runtime/components/Icon.vue +1 -1
- package/dist/runtime/components/Input.vue +34 -34
- package/dist/runtime/components/InputMenu.vue +163 -163
- package/dist/runtime/components/InputMenu.vue.d.ts +3 -3
- package/dist/runtime/components/InputNumber.vue +49 -49
- package/dist/runtime/components/InputTags.vue +55 -55
- package/dist/runtime/components/Kbd.vue +5 -5
- package/dist/runtime/components/Link.vue +14 -14
- package/dist/runtime/components/LinkBase.vue +8 -8
- package/dist/runtime/components/Main.vue +23 -0
- package/dist/runtime/components/Main.vue.d.ts +20 -0
- package/dist/runtime/components/Modal.vue +69 -69
- package/dist/runtime/components/NavigationMenu.vue +166 -166
- package/dist/runtime/components/OverlayProvider.vue +9 -9
- package/dist/runtime/components/Page.vue +37 -0
- package/dist/runtime/components/Page.vue.d.ts +25 -0
- package/dist/runtime/components/PageAccordion.vue +26 -0
- package/dist/runtime/components/PageAccordion.vue.d.ts +21 -0
- package/dist/runtime/components/PageAnchors.vue +50 -0
- package/dist/runtime/components/PageAnchors.vue.d.ts +42 -0
- package/dist/runtime/components/PageAside.vue +36 -0
- package/dist/runtime/components/PageAside.vue.d.ts +27 -0
- package/dist/runtime/components/PageBody.vue +23 -0
- package/dist/runtime/components/PageBody.vue.d.ts +18 -0
- package/dist/runtime/components/PageCTA.vue +58 -0
- package/dist/runtime/components/PageCTA.vue.d.ts +49 -0
- package/dist/runtime/components/PageCard.vue +121 -0
- package/dist/runtime/components/PageCard.vue.d.ts +71 -0
- package/dist/runtime/components/PageColumns.vue +23 -0
- package/dist/runtime/components/PageColumns.vue.d.ts +18 -0
- package/dist/runtime/components/PageFeature.vue +71 -0
- package/dist/runtime/components/PageFeature.vue.d.ts +43 -0
- package/dist/runtime/components/PageGrid.vue +23 -0
- package/dist/runtime/components/PageGrid.vue.d.ts +18 -0
- package/dist/runtime/components/PageHeader.vue +58 -0
- package/dist/runtime/components/PageHeader.vue.d.ts +35 -0
- package/dist/runtime/components/PageHero.vue +67 -0
- package/dist/runtime/components/PageHero.vue.d.ts +49 -0
- package/dist/runtime/components/PageLinks.vue +55 -0
- package/dist/runtime/components/PageLinks.vue.d.ts +44 -0
- package/dist/runtime/components/PageList.vue +24 -0
- package/dist/runtime/components/PageList.vue.d.ts +21 -0
- package/dist/runtime/components/PageLogos.vue +64 -0
- package/dist/runtime/components/PageLogos.vue.d.ts +32 -0
- package/dist/runtime/components/PageMarquee.vue +40 -0
- package/dist/runtime/components/PageMarquee.vue.d.ts +30 -0
- package/dist/runtime/components/PageSection.vue +88 -0
- package/dist/runtime/components/PageSection.vue.d.ts +64 -0
- package/dist/runtime/components/Pagination.vue +47 -47
- package/dist/runtime/components/PinInput.vue +20 -20
- package/dist/runtime/components/Popover.vue +17 -17
- package/dist/runtime/components/PricingPlan.vue +129 -0
- package/dist/runtime/components/PricingPlan.vue.d.ts +109 -0
- package/dist/runtime/components/PricingPlans.vue +45 -0
- package/dist/runtime/components/PricingPlans.vue.d.ts +41 -0
- package/dist/runtime/components/PricingTable.vue +235 -0
- package/dist/runtime/components/PricingTable.vue.d.ts +98 -0
- package/dist/runtime/components/Progress.vue +19 -19
- package/dist/runtime/components/RadioGroup.vue +43 -43
- package/dist/runtime/components/Select.vue +96 -96
- package/dist/runtime/components/SelectMenu.vue +130 -130
- package/dist/runtime/components/SelectMenu.vue.d.ts +3 -3
- package/dist/runtime/components/Separator.vue +15 -15
- package/dist/runtime/components/Skeleton.vue +10 -10
- package/dist/runtime/components/Slideover.vue +76 -76
- package/dist/runtime/components/Slider.vue +27 -27
- package/dist/runtime/components/Stepper.vue +51 -51
- package/dist/runtime/components/Switch.vue +33 -33
- package/dist/runtime/components/Table.vue +77 -77
- package/dist/runtime/components/Tabs.vue +38 -37
- package/dist/runtime/components/Textarea.vue +33 -33
- package/dist/runtime/components/Timeline.vue +38 -38
- package/dist/runtime/components/Toast.vue +69 -69
- package/dist/runtime/components/Toaster.vue +28 -28
- package/dist/runtime/components/Tooltip.vue +19 -19
- package/dist/runtime/components/Tree.vue +60 -60
- package/dist/runtime/components/User.vue +69 -0
- package/dist/runtime/components/User.vue.d.ts +46 -0
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeButton.vue +16 -16
- package/dist/runtime/components/color-mode/ColorModeImage.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeSelect.vue +19 -19
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +19 -19
- package/dist/runtime/components/content/ContentNavigation.vue +109 -109
- package/dist/runtime/components/content/ContentSearch.vue +25 -25
- package/dist/runtime/components/content/ContentSearchButton.vue +38 -38
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +58 -12
- package/dist/runtime/components/content/ContentSurround.vue +31 -31
- package/dist/runtime/components/content/ContentSurround.vue.d.ts +52 -59
- package/dist/runtime/components/content/ContentToc.vue +88 -76
- package/dist/runtime/components/content/ContentToc.vue.d.ts +86 -88
- package/dist/runtime/components/locale/LocaleSelect.vue +20 -20
- package/dist/runtime/components/prose/A.vue +3 -3
- package/dist/runtime/components/prose/Accordion.vue +5 -5
- package/dist/runtime/components/prose/AccordionItem.vue +5 -5
- package/dist/runtime/components/prose/Badge.vue +3 -3
- package/dist/runtime/components/prose/Blockquote.vue +3 -3
- package/dist/runtime/components/prose/Callout.vue +27 -27
- package/dist/runtime/components/prose/Card.vue +43 -43
- package/dist/runtime/components/prose/CardGroup.vue +3 -3
- package/dist/runtime/components/prose/Code.vue +3 -3
- package/dist/runtime/components/prose/CodeCollapse.vue +16 -16
- package/dist/runtime/components/prose/CodeGroup.vue +15 -15
- package/dist/runtime/components/prose/CodeIcon.vue +1 -1
- package/dist/runtime/components/prose/CodePreview.vue +9 -9
- package/dist/runtime/components/prose/CodeTree.vue +61 -61
- package/dist/runtime/components/prose/Collapsible.vue +15 -15
- package/dist/runtime/components/prose/Em.vue +1 -1
- package/dist/runtime/components/prose/Field.vue +23 -23
- package/dist/runtime/components/prose/FieldGroup.vue +3 -3
- package/dist/runtime/components/prose/H1.vue +6 -6
- package/dist/runtime/components/prose/H2.vue +10 -10
- package/dist/runtime/components/prose/H3.vue +10 -10
- package/dist/runtime/components/prose/H4.vue +6 -6
- package/dist/runtime/components/prose/Hr.vue +1 -1
- package/dist/runtime/components/prose/Icon.vue +1 -1
- package/dist/runtime/components/prose/Img.vue +8 -8
- package/dist/runtime/components/prose/Kbd.vue +1 -1
- package/dist/runtime/components/prose/Li.vue +3 -3
- package/dist/runtime/components/prose/Ol.vue +3 -3
- package/dist/runtime/components/prose/P.vue +3 -3
- package/dist/runtime/components/prose/Pre.vue +20 -20
- package/dist/runtime/components/prose/Script.vue +3 -3
- package/dist/runtime/components/prose/Steps.vue +3 -3
- package/dist/runtime/components/prose/Strong.vue +3 -3
- package/dist/runtime/components/prose/Table.vue +5 -5
- package/dist/runtime/components/prose/Tabs.vue +14 -14
- package/dist/runtime/components/prose/TabsItem.vue +5 -5
- package/dist/runtime/components/prose/Tbody.vue +3 -3
- package/dist/runtime/components/prose/Td.vue +3 -3
- package/dist/runtime/components/prose/Th.vue +3 -3
- package/dist/runtime/components/prose/Thead.vue +3 -3
- package/dist/runtime/components/prose/Tr.vue +3 -3
- package/dist/runtime/components/prose/Ul.vue +3 -3
- package/dist/runtime/components/prose/callout/Caution.vue +3 -3
- package/dist/runtime/components/prose/callout/Note.vue +3 -3
- package/dist/runtime/components/prose/callout/Tip.vue +3 -3
- package/dist/runtime/components/prose/callout/Warning.vue +3 -3
- package/dist/runtime/inertia/components/Link.vue +12 -12
- package/dist/runtime/inertia/components/LinkBase.vue +15 -15
- package/dist/runtime/types/app.config.d.ts +6 -6
- package/dist/runtime/types/index.d.ts +33 -0
- package/dist/runtime/types/index.js +33 -0
- package/dist/runtime/vue/components/Icon.vue +1 -1
- package/dist/runtime/vue/components/Link.vue +31 -31
- package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +7 -7
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +7 -7
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +7 -7
- package/dist/shared/{ui.DQZ75GCP.mjs → ui.DErCA3YU.mjs} +1247 -50
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
- package/vue-plugin.d.ts +5 -5
- package/.nuxt/ui/prose.ts +0 -321
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/header";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed, watch, toRef } from "vue";
|
|
7
|
+
import { Primitive } from "reka-ui";
|
|
8
|
+
import { defu } from "defu";
|
|
9
|
+
import { createReusableTemplate } from "@vueuse/core";
|
|
10
|
+
import USlideover from "./Slideover.vue";
|
|
11
|
+
import UModal from "./Modal.vue";
|
|
12
|
+
import UDrawer from "./Drawer.vue";
|
|
13
|
+
import { useAppConfig, useRoute } from "#imports";
|
|
14
|
+
import { useLocalePro } from "../composables/useLocalePro";
|
|
15
|
+
import { getSlotChildrenText } from "../utils";
|
|
16
|
+
import { tv } from "../utils/tv";
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
as: { type: null, required: false, default: "header" },
|
|
19
|
+
title: { type: String, required: false, default: "Nuxt UI Pro" },
|
|
20
|
+
to: { type: String, required: false, default: "/" },
|
|
21
|
+
mode: { type: null, required: false, default: "modal" },
|
|
22
|
+
menu: { type: null, required: false },
|
|
23
|
+
toggle: { type: [Boolean, Object], required: false, default: true },
|
|
24
|
+
toggleSide: { type: String, required: false, default: "right" },
|
|
25
|
+
class: { type: null, required: false },
|
|
26
|
+
ui: { type: null, required: false }
|
|
27
|
+
});
|
|
28
|
+
const slots = defineSlots();
|
|
29
|
+
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
30
|
+
const route = useRoute();
|
|
31
|
+
const { t } = useLocalePro();
|
|
32
|
+
const appConfig = useAppConfig();
|
|
33
|
+
const [DefineLeftTemplate, ReuseLeftTemplate] = createReusableTemplate();
|
|
34
|
+
const [DefineRightTemplate, ReuseRightTemplate] = createReusableTemplate();
|
|
35
|
+
const [DefineToggleTemplate, ReuseToggleTemplate] = createReusableTemplate();
|
|
36
|
+
const ariaLabel = computed(() => {
|
|
37
|
+
const slotText = slots.title && getSlotChildrenText(slots.title());
|
|
38
|
+
return (slotText || props.title || "Nuxt UI Pro").trim();
|
|
39
|
+
});
|
|
40
|
+
watch(() => route.fullPath, () => {
|
|
41
|
+
open.value = false;
|
|
42
|
+
});
|
|
43
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.header || {} })());
|
|
44
|
+
const Menu = computed(() => ({
|
|
45
|
+
slideover: USlideover,
|
|
46
|
+
modal: UModal,
|
|
47
|
+
drawer: UDrawer
|
|
48
|
+
})[props.mode]);
|
|
49
|
+
const menuProps = toRef(() => defu(props.menu, {
|
|
50
|
+
content: {
|
|
51
|
+
onOpenAutoFocus: (e) => e.preventDefault()
|
|
52
|
+
}
|
|
53
|
+
}, props.mode === "modal" ? { fullscreen: true, transition: false } : {}));
|
|
54
|
+
function toggleOpen() {
|
|
55
|
+
open.value = !open.value;
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<template>
|
|
60
|
+
<DefineToggleTemplate>
|
|
61
|
+
<slot name="toggle" :open="open" :toggle="toggleOpen">
|
|
62
|
+
<UButton
|
|
63
|
+
v-if="toggle"
|
|
64
|
+
color="neutral"
|
|
65
|
+
variant="ghost"
|
|
66
|
+
:aria-label="open ? t('header.close') : t('header.open')"
|
|
67
|
+
:icon="open ? appConfig.ui.icons.close : appConfig.ui.icons.menu"
|
|
68
|
+
v-bind="typeof toggle === 'object' ? toggle : {}"
|
|
69
|
+
:class="ui.toggle({ class: props.ui?.toggle, toggleSide })"
|
|
70
|
+
@click="toggleOpen"
|
|
71
|
+
/>
|
|
72
|
+
</slot>
|
|
73
|
+
</DefineToggleTemplate>
|
|
74
|
+
|
|
75
|
+
<DefineLeftTemplate>
|
|
76
|
+
<div :class="ui.left({ class: props.ui?.left })">
|
|
77
|
+
<ReuseToggleTemplate v-if="toggleSide === 'left'" />
|
|
78
|
+
|
|
79
|
+
<slot name="left">
|
|
80
|
+
<ULink :to="to" :aria-label="ariaLabel" :class="ui.title({ class: props.ui?.title })">
|
|
81
|
+
<slot name="title">
|
|
82
|
+
{{ title }}
|
|
83
|
+
</slot>
|
|
84
|
+
</ULink>
|
|
85
|
+
</slot>
|
|
86
|
+
</div>
|
|
87
|
+
</DefineLeftTemplate>
|
|
88
|
+
|
|
89
|
+
<DefineRightTemplate>
|
|
90
|
+
<div :class="ui.right({ class: props.ui?.right })">
|
|
91
|
+
<slot name="right" />
|
|
92
|
+
|
|
93
|
+
<ReuseToggleTemplate v-if="toggleSide === 'right'" />
|
|
94
|
+
</div>
|
|
95
|
+
</DefineRightTemplate>
|
|
96
|
+
|
|
97
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
98
|
+
<slot name="top" />
|
|
99
|
+
|
|
100
|
+
<UContainer :class="ui.container({ class: props.ui?.container })">
|
|
101
|
+
<ReuseLeftTemplate />
|
|
102
|
+
|
|
103
|
+
<div :class="ui.center({ class: props.ui?.center })">
|
|
104
|
+
<slot />
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<ReuseRightTemplate />
|
|
108
|
+
</UContainer>
|
|
109
|
+
|
|
110
|
+
<slot name="bottom" />
|
|
111
|
+
</Primitive>
|
|
112
|
+
|
|
113
|
+
<Menu
|
|
114
|
+
v-model:open="open"
|
|
115
|
+
:title="t('header.title')"
|
|
116
|
+
:description="t('header.description')"
|
|
117
|
+
v-bind="menuProps"
|
|
118
|
+
:ui="{
|
|
119
|
+
overlay: ui.overlay({ class: props.ui?.overlay }),
|
|
120
|
+
content: ui.content({ class: props.ui?.content })
|
|
121
|
+
}"
|
|
122
|
+
>
|
|
123
|
+
<template #content>
|
|
124
|
+
<slot name="content">
|
|
125
|
+
<div v-if="mode !== 'drawer'" :class="ui.header({ class: props.ui?.header })">
|
|
126
|
+
<ReuseLeftTemplate />
|
|
127
|
+
|
|
128
|
+
<ReuseRightTemplate />
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div :class="ui.body({ class: props.ui?.body })">
|
|
132
|
+
<slot name="body" />
|
|
133
|
+
</div>
|
|
134
|
+
</slot>
|
|
135
|
+
</template>
|
|
136
|
+
</Menu>
|
|
137
|
+
</template>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import theme from '#build/ui/header';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import type { ButtonProps, DrawerProps, ModalProps, SlideoverProps, ComponentConfig } from '../types';
|
|
4
|
+
type Header = ComponentConfig<typeof theme, AppConfig, 'header'>;
|
|
5
|
+
type HeaderMode = 'modal' | 'slideover' | 'drawer';
|
|
6
|
+
type HeaderMenu<T> = T extends 'modal' ? ModalProps : T extends 'slideover' ? SlideoverProps : T extends 'drawer' ? DrawerProps : never;
|
|
7
|
+
export interface HeaderProps<T extends HeaderMode = HeaderMode> {
|
|
8
|
+
/**
|
|
9
|
+
* The element or component this component should render as.
|
|
10
|
+
* @defaultValue 'header'
|
|
11
|
+
*/
|
|
12
|
+
as?: any;
|
|
13
|
+
title?: string;
|
|
14
|
+
to?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The mode of the header menu.
|
|
17
|
+
* @defaultValue 'modal'
|
|
18
|
+
*/
|
|
19
|
+
mode?: T;
|
|
20
|
+
/**
|
|
21
|
+
* The props for the header menu component.
|
|
22
|
+
*/
|
|
23
|
+
menu?: HeaderMenu<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Customize the toggle button to open the header menu displayed when the `content` slot is used.
|
|
26
|
+
* `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
|
|
27
|
+
*/
|
|
28
|
+
toggle?: boolean | Partial<ButtonProps>;
|
|
29
|
+
/**
|
|
30
|
+
* The side to render the toggle button on.
|
|
31
|
+
* @defaultValue 'right'
|
|
32
|
+
*/
|
|
33
|
+
toggleSide?: 'left' | 'right';
|
|
34
|
+
class?: any;
|
|
35
|
+
ui?: Header['slots'];
|
|
36
|
+
}
|
|
37
|
+
export interface HeaderSlots {
|
|
38
|
+
title(props?: {}): any;
|
|
39
|
+
left(props?: {}): any;
|
|
40
|
+
default(props?: {}): any;
|
|
41
|
+
right(props?: {}): any;
|
|
42
|
+
toggle(props: {
|
|
43
|
+
open: boolean;
|
|
44
|
+
toggle: () => void;
|
|
45
|
+
}): any;
|
|
46
|
+
top(props?: {}): any;
|
|
47
|
+
bottom(props?: {}): any;
|
|
48
|
+
body(props?: {}): any;
|
|
49
|
+
content(props?: {}): any;
|
|
50
|
+
}
|
|
51
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<HeaderProps<HeaderMode> & {
|
|
52
|
+
open?: boolean;
|
|
53
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
54
|
+
"update:open": (value: boolean | undefined) => any;
|
|
55
|
+
}, string, import("vue").PublicProps, Readonly<HeaderProps<HeaderMode> & {
|
|
56
|
+
open?: boolean;
|
|
57
|
+
}> & Readonly<{
|
|
58
|
+
"onUpdate:open"?: ((value: boolean | undefined) => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
toggle: boolean | Partial<ButtonProps>;
|
|
61
|
+
title: string;
|
|
62
|
+
to: string;
|
|
63
|
+
mode: HeaderMode;
|
|
64
|
+
as: any;
|
|
65
|
+
toggleSide: "left" | "right";
|
|
66
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, HeaderSlots>;
|
|
67
|
+
export default _default;
|
|
68
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
69
|
+
new (): {
|
|
70
|
+
$slots: S;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
@@ -110,38 +110,38 @@ defineExpose({
|
|
|
110
110
|
</script>
|
|
111
111
|
|
|
112
112
|
<template>
|
|
113
|
-
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
114
|
-
<input
|
|
115
|
-
:id="id"
|
|
116
|
-
ref="inputRef"
|
|
117
|
-
:type="type"
|
|
118
|
-
:value="modelValue"
|
|
119
|
-
:name="name"
|
|
120
|
-
:placeholder="placeholder"
|
|
121
|
-
:class="ui.base({ class: props.ui?.base })"
|
|
122
|
-
:disabled="disabled"
|
|
123
|
-
:required="required"
|
|
124
|
-
:autocomplete="autocomplete"
|
|
125
|
-
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
126
|
-
@input="onInput"
|
|
127
|
-
@blur="onBlur"
|
|
128
|
-
@change="onChange"
|
|
129
|
-
@focus="emitFormFocus"
|
|
130
|
-
>
|
|
131
|
-
|
|
132
|
-
<slot />
|
|
133
|
-
|
|
134
|
-
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
135
|
-
<slot name="leading">
|
|
136
|
-
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
137
|
-
<UAvatar v-else-if="!!avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
|
|
138
|
-
</slot>
|
|
139
|
-
</span>
|
|
140
|
-
|
|
141
|
-
<span v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
142
|
-
<slot name="trailing">
|
|
143
|
-
<UIcon v-if="trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
144
|
-
</slot>
|
|
145
|
-
</span>
|
|
146
|
-
</Primitive>
|
|
113
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
114
|
+
<input
|
|
115
|
+
:id="id"
|
|
116
|
+
ref="inputRef"
|
|
117
|
+
:type="type"
|
|
118
|
+
:value="modelValue"
|
|
119
|
+
:name="name"
|
|
120
|
+
:placeholder="placeholder"
|
|
121
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
122
|
+
:disabled="disabled"
|
|
123
|
+
:required="required"
|
|
124
|
+
:autocomplete="autocomplete"
|
|
125
|
+
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
126
|
+
@input="onInput"
|
|
127
|
+
@blur="onBlur"
|
|
128
|
+
@change="onChange"
|
|
129
|
+
@focus="emitFormFocus"
|
|
130
|
+
>
|
|
131
|
+
|
|
132
|
+
<slot />
|
|
133
|
+
|
|
134
|
+
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
135
|
+
<slot name="leading">
|
|
136
|
+
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
137
|
+
<UAvatar v-else-if="!!avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
|
|
138
|
+
</slot>
|
|
139
|
+
</span>
|
|
140
|
+
|
|
141
|
+
<span v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
142
|
+
<slot name="trailing">
|
|
143
|
+
<UIcon v-if="trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
144
|
+
</slot>
|
|
145
|
+
</span>
|
|
146
|
+
</Primitive>
|
|
147
147
|
</template>
|
|
@@ -207,167 +207,167 @@ defineExpose({
|
|
|
207
207
|
</script>
|
|
208
208
|
|
|
209
209
|
<template>
|
|
210
|
-
<DefineCreateItemTemplate>
|
|
211
|
-
<ComboboxGroup :class="ui.group({ class: props.ui?.group })">
|
|
212
|
-
<ComboboxItem
|
|
213
|
-
:class="ui.item({ class: props.ui?.item })"
|
|
214
|
-
:value="searchTerm"
|
|
215
|
-
@select.prevent="emits('create', searchTerm)"
|
|
216
|
-
>
|
|
217
|
-
<span :class="ui.itemLabel({ class: props.ui?.itemLabel })">
|
|
218
|
-
<slot name="create-item-label" :item="searchTerm">
|
|
219
|
-
{{ t("inputMenu.create", { label: searchTerm }) }}
|
|
220
|
-
</slot>
|
|
221
|
-
</span>
|
|
222
|
-
</ComboboxItem>
|
|
223
|
-
</ComboboxGroup>
|
|
224
|
-
</DefineCreateItemTemplate>
|
|
225
|
-
|
|
226
|
-
<ComboboxRoot
|
|
227
|
-
:id="id"
|
|
228
|
-
v-slot="{ modelValue, open }"
|
|
229
|
-
v-bind="rootProps"
|
|
230
|
-
:name="name"
|
|
231
|
-
:disabled="disabled"
|
|
232
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
233
|
-
:as-child="!!multiple"
|
|
234
|
-
ignore-filter
|
|
235
|
-
@update:model-value="onUpdate"
|
|
236
|
-
@update:open="onUpdateOpen"
|
|
237
|
-
@keydown.enter="$event.preventDefault()"
|
|
238
|
-
>
|
|
239
|
-
<ComboboxAnchor :as-child="!multiple" :class="ui.base({ class: props.ui?.base })">
|
|
240
|
-
<TagsInputRoot
|
|
241
|
-
v-if="multiple"
|
|
242
|
-
v-slot="{ modelValue: tags }"
|
|
243
|
-
:model-value="modelValue"
|
|
244
|
-
:disabled="disabled"
|
|
245
|
-
:required="required"
|
|
246
|
-
delimiter=""
|
|
247
|
-
as-child
|
|
248
|
-
@blur="onBlur"
|
|
249
|
-
@focus="onFocus"
|
|
250
|
-
@remove-tag="onRemoveTag"
|
|
251
|
-
>
|
|
252
|
-
<TagsInputItem v-for="(item, index) in tags" :key="index" :value="item" :class="ui.tagsItem({ class: [props.ui?.tagsItem, isInputItem(item) && item.ui?.tagsItem] })">
|
|
253
|
-
<TagsInputItemText :class="ui.tagsItemText({ class: [props.ui?.tagsItemText, isInputItem(item) && item.ui?.tagsItemText] })">
|
|
254
|
-
<slot name="tags-item-text" :item="item" :index="index">
|
|
255
|
-
{{ displayValue(item) }}
|
|
256
|
-
</slot>
|
|
257
|
-
</TagsInputItemText>
|
|
258
|
-
|
|
259
|
-
<TagsInputItemDelete :class="ui.tagsItemDelete({ class: [props.ui?.tagsItemDelete, isInputItem(item) && item.ui?.tagsItemDelete] })" :disabled="disabled">
|
|
260
|
-
<slot name="tags-item-delete" :item="item" :index="index">
|
|
261
|
-
<UIcon :name="deleteIcon || appConfig.ui.icons.close" :class="ui.tagsItemDeleteIcon({ class: [props.ui?.tagsItemDeleteIcon, isInputItem(item) && item.ui?.tagsItemDeleteIcon] })" />
|
|
262
|
-
</slot>
|
|
263
|
-
</TagsInputItemDelete>
|
|
264
|
-
</TagsInputItem>
|
|
265
|
-
|
|
266
|
-
<ComboboxInput v-model="searchTerm" as-child>
|
|
267
|
-
<TagsInputInput
|
|
268
|
-
ref="inputRef"
|
|
269
|
-
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
270
|
-
:placeholder="placeholder"
|
|
271
|
-
:class="ui.tagsInput({ class: props.ui?.tagsInput })"
|
|
272
|
-
@keydown.enter.prevent
|
|
273
|
-
/>
|
|
274
|
-
</ComboboxInput>
|
|
275
|
-
</TagsInputRoot>
|
|
276
|
-
|
|
277
|
-
<ComboboxInput
|
|
278
|
-
v-else
|
|
279
|
-
ref="inputRef"
|
|
280
|
-
:display-value="displayValue"
|
|
281
|
-
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
282
|
-
:type="type"
|
|
283
|
-
:placeholder="placeholder"
|
|
284
|
-
:required="required"
|
|
285
|
-
@blur="onBlur"
|
|
286
|
-
@focus="onFocus"
|
|
287
|
-
@update:model-value="searchTerm = $event"
|
|
288
|
-
/>
|
|
289
|
-
|
|
290
|
-
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
291
|
-
<slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
|
|
292
|
-
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
293
|
-
<UAvatar v-else-if="!!avatar" :size="props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="avatar" :class="ui.itemLeadingAvatar({ class: props.ui?.itemLeadingAvatar })" />
|
|
294
|
-
</slot>
|
|
295
|
-
</span>
|
|
296
|
-
|
|
297
|
-
<ComboboxTrigger v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
298
|
-
<slot name="trailing" :model-value="modelValue" :open="open" :ui="ui">
|
|
299
|
-
<UIcon v-if="trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
300
|
-
</slot>
|
|
301
|
-
</ComboboxTrigger>
|
|
302
|
-
</ComboboxAnchor>
|
|
303
|
-
|
|
304
|
-
<ComboboxPortal v-bind="portalProps">
|
|
305
|
-
<ComboboxContent :class="ui.content({ class: props.ui?.content })" v-bind="contentProps">
|
|
306
|
-
<slot name="content-top" />
|
|
307
|
-
|
|
308
|
-
<ComboboxEmpty :class="ui.empty({ class: props.ui?.empty })">
|
|
309
|
-
<slot name="empty" :search-term="searchTerm">
|
|
310
|
-
{{ searchTerm ? t("inputMenu.noMatch", { searchTerm }) : t("inputMenu.noData") }}
|
|
311
|
-
</slot>
|
|
312
|
-
</ComboboxEmpty>
|
|
313
|
-
|
|
314
|
-
<div role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
315
|
-
<ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'top'" />
|
|
316
|
-
|
|
317
|
-
<ComboboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" :class="ui.group({ class: props.ui?.group })">
|
|
318
|
-
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
319
|
-
<ComboboxLabel v-if="isInputItem(item) && item.type === 'label'" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
|
|
320
|
-
{{ get(item, props.labelKey) }}
|
|
321
|
-
</ComboboxLabel>
|
|
322
|
-
|
|
323
|
-
<ComboboxSeparator v-else-if="isInputItem(item) && item.type === 'separator'" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator, item.class] })" />
|
|
324
|
-
|
|
325
|
-
<ComboboxItem
|
|
326
|
-
v-else
|
|
327
|
-
:class="ui.item({ class: [props.ui?.item, isInputItem(item) && item.ui?.item, isInputItem(item) && item.class] })"
|
|
328
|
-
:disabled="isInputItem(item) && item.disabled"
|
|
329
|
-
:value="props.valueKey && isInputItem(item) ? get(item, props.valueKey) : item"
|
|
330
|
-
@select="onSelect($event, item)"
|
|
331
|
-
>
|
|
332
|
-
<slot name="item" :item="item" :index="index">
|
|
333
|
-
<slot name="item-leading" :item="item" :index="index">
|
|
334
|
-
<UIcon v-if="isInputItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon] })" />
|
|
335
|
-
<UAvatar v-else-if="isInputItem(item) && item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [props.ui?.itemLeadingAvatar, item.ui?.itemLeadingAvatar] })" />
|
|
336
|
-
<UChip
|
|
337
|
-
v-else-if="isInputItem(item) && item.chip"
|
|
338
|
-
:size="item.ui?.itemLeadingChipSize || props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
339
|
-
inset
|
|
340
|
-
standalone
|
|
341
|
-
v-bind="item.chip"
|
|
342
|
-
:class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip] })"
|
|
343
|
-
/>
|
|
344
|
-
</slot>
|
|
345
|
-
|
|
346
|
-
<span :class="ui.itemLabel({ class: [props.ui?.itemLabel, isInputItem(item) && item.ui?.itemLabel] })">
|
|
347
|
-
<slot name="item-label" :item="item" :index="index">
|
|
348
|
-
{{ isInputItem(item) ? get(item, props.labelKey) : item }}
|
|
349
|
-
</slot>
|
|
350
|
-
</span>
|
|
351
|
-
|
|
352
|
-
<span :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, isInputItem(item) && item.ui?.itemTrailing] })">
|
|
353
|
-
<slot name="item-trailing" :item="item" :index="index" />
|
|
354
|
-
|
|
355
|
-
<ComboboxItemIndicator as-child>
|
|
356
|
-
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, isInputItem(item) && item.ui?.itemTrailingIcon] })" />
|
|
357
|
-
</ComboboxItemIndicator>
|
|
358
|
-
</span>
|
|
359
|
-
</slot>
|
|
360
|
-
</ComboboxItem>
|
|
361
|
-
</template>
|
|
362
|
-
</ComboboxGroup>
|
|
363
|
-
|
|
364
|
-
<ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'bottom'" />
|
|
365
|
-
</div>
|
|
366
|
-
|
|
367
|
-
<slot name="content-bottom" />
|
|
368
|
-
|
|
369
|
-
<ComboboxArrow v-if="!!arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
370
|
-
</ComboboxContent>
|
|
371
|
-
</ComboboxPortal>
|
|
372
|
-
</ComboboxRoot>
|
|
210
|
+
<DefineCreateItemTemplate>
|
|
211
|
+
<ComboboxGroup :class="ui.group({ class: props.ui?.group })">
|
|
212
|
+
<ComboboxItem
|
|
213
|
+
:class="ui.item({ class: props.ui?.item })"
|
|
214
|
+
:value="searchTerm"
|
|
215
|
+
@select.prevent="emits('create', searchTerm)"
|
|
216
|
+
>
|
|
217
|
+
<span :class="ui.itemLabel({ class: props.ui?.itemLabel })">
|
|
218
|
+
<slot name="create-item-label" :item="searchTerm">
|
|
219
|
+
{{ t("inputMenu.create", { label: searchTerm }) }}
|
|
220
|
+
</slot>
|
|
221
|
+
</span>
|
|
222
|
+
</ComboboxItem>
|
|
223
|
+
</ComboboxGroup>
|
|
224
|
+
</DefineCreateItemTemplate>
|
|
225
|
+
|
|
226
|
+
<ComboboxRoot
|
|
227
|
+
:id="id"
|
|
228
|
+
v-slot="{ modelValue, open }"
|
|
229
|
+
v-bind="rootProps"
|
|
230
|
+
:name="name"
|
|
231
|
+
:disabled="disabled"
|
|
232
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
233
|
+
:as-child="!!multiple"
|
|
234
|
+
ignore-filter
|
|
235
|
+
@update:model-value="onUpdate"
|
|
236
|
+
@update:open="onUpdateOpen"
|
|
237
|
+
@keydown.enter="$event.preventDefault()"
|
|
238
|
+
>
|
|
239
|
+
<ComboboxAnchor :as-child="!multiple" :class="ui.base({ class: props.ui?.base })">
|
|
240
|
+
<TagsInputRoot
|
|
241
|
+
v-if="multiple"
|
|
242
|
+
v-slot="{ modelValue: tags }"
|
|
243
|
+
:model-value="modelValue"
|
|
244
|
+
:disabled="disabled"
|
|
245
|
+
:required="required"
|
|
246
|
+
delimiter=""
|
|
247
|
+
as-child
|
|
248
|
+
@blur="onBlur"
|
|
249
|
+
@focus="onFocus"
|
|
250
|
+
@remove-tag="onRemoveTag"
|
|
251
|
+
>
|
|
252
|
+
<TagsInputItem v-for="(item, index) in tags" :key="index" :value="item" :class="ui.tagsItem({ class: [props.ui?.tagsItem, isInputItem(item) && item.ui?.tagsItem] })">
|
|
253
|
+
<TagsInputItemText :class="ui.tagsItemText({ class: [props.ui?.tagsItemText, isInputItem(item) && item.ui?.tagsItemText] })">
|
|
254
|
+
<slot name="tags-item-text" :item="item" :index="index">
|
|
255
|
+
{{ displayValue(item) }}
|
|
256
|
+
</slot>
|
|
257
|
+
</TagsInputItemText>
|
|
258
|
+
|
|
259
|
+
<TagsInputItemDelete :class="ui.tagsItemDelete({ class: [props.ui?.tagsItemDelete, isInputItem(item) && item.ui?.tagsItemDelete] })" :disabled="disabled">
|
|
260
|
+
<slot name="tags-item-delete" :item="item" :index="index">
|
|
261
|
+
<UIcon :name="deleteIcon || appConfig.ui.icons.close" :class="ui.tagsItemDeleteIcon({ class: [props.ui?.tagsItemDeleteIcon, isInputItem(item) && item.ui?.tagsItemDeleteIcon] })" />
|
|
262
|
+
</slot>
|
|
263
|
+
</TagsInputItemDelete>
|
|
264
|
+
</TagsInputItem>
|
|
265
|
+
|
|
266
|
+
<ComboboxInput v-model="searchTerm" as-child>
|
|
267
|
+
<TagsInputInput
|
|
268
|
+
ref="inputRef"
|
|
269
|
+
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
270
|
+
:placeholder="placeholder"
|
|
271
|
+
:class="ui.tagsInput({ class: props.ui?.tagsInput })"
|
|
272
|
+
@keydown.enter.prevent
|
|
273
|
+
/>
|
|
274
|
+
</ComboboxInput>
|
|
275
|
+
</TagsInputRoot>
|
|
276
|
+
|
|
277
|
+
<ComboboxInput
|
|
278
|
+
v-else
|
|
279
|
+
ref="inputRef"
|
|
280
|
+
:display-value="displayValue"
|
|
281
|
+
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
282
|
+
:type="type"
|
|
283
|
+
:placeholder="placeholder"
|
|
284
|
+
:required="required"
|
|
285
|
+
@blur="onBlur"
|
|
286
|
+
@focus="onFocus"
|
|
287
|
+
@update:model-value="searchTerm = $event"
|
|
288
|
+
/>
|
|
289
|
+
|
|
290
|
+
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
291
|
+
<slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
|
|
292
|
+
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
293
|
+
<UAvatar v-else-if="!!avatar" :size="props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="avatar" :class="ui.itemLeadingAvatar({ class: props.ui?.itemLeadingAvatar })" />
|
|
294
|
+
</slot>
|
|
295
|
+
</span>
|
|
296
|
+
|
|
297
|
+
<ComboboxTrigger v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
298
|
+
<slot name="trailing" :model-value="modelValue" :open="open" :ui="ui">
|
|
299
|
+
<UIcon v-if="trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
300
|
+
</slot>
|
|
301
|
+
</ComboboxTrigger>
|
|
302
|
+
</ComboboxAnchor>
|
|
303
|
+
|
|
304
|
+
<ComboboxPortal v-bind="portalProps">
|
|
305
|
+
<ComboboxContent :class="ui.content({ class: props.ui?.content })" v-bind="contentProps">
|
|
306
|
+
<slot name="content-top" />
|
|
307
|
+
|
|
308
|
+
<ComboboxEmpty :class="ui.empty({ class: props.ui?.empty })">
|
|
309
|
+
<slot name="empty" :search-term="searchTerm">
|
|
310
|
+
{{ searchTerm ? t("inputMenu.noMatch", { searchTerm }) : t("inputMenu.noData") }}
|
|
311
|
+
</slot>
|
|
312
|
+
</ComboboxEmpty>
|
|
313
|
+
|
|
314
|
+
<div role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
315
|
+
<ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'top'" />
|
|
316
|
+
|
|
317
|
+
<ComboboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" :class="ui.group({ class: props.ui?.group })">
|
|
318
|
+
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
319
|
+
<ComboboxLabel v-if="isInputItem(item) && item.type === 'label'" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
|
|
320
|
+
{{ get(item, props.labelKey) }}
|
|
321
|
+
</ComboboxLabel>
|
|
322
|
+
|
|
323
|
+
<ComboboxSeparator v-else-if="isInputItem(item) && item.type === 'separator'" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator, item.class] })" />
|
|
324
|
+
|
|
325
|
+
<ComboboxItem
|
|
326
|
+
v-else
|
|
327
|
+
:class="ui.item({ class: [props.ui?.item, isInputItem(item) && item.ui?.item, isInputItem(item) && item.class] })"
|
|
328
|
+
:disabled="isInputItem(item) && item.disabled"
|
|
329
|
+
:value="props.valueKey && isInputItem(item) ? get(item, props.valueKey) : item"
|
|
330
|
+
@select="onSelect($event, item)"
|
|
331
|
+
>
|
|
332
|
+
<slot name="item" :item="item" :index="index">
|
|
333
|
+
<slot name="item-leading" :item="item" :index="index">
|
|
334
|
+
<UIcon v-if="isInputItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon] })" />
|
|
335
|
+
<UAvatar v-else-if="isInputItem(item) && item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [props.ui?.itemLeadingAvatar, item.ui?.itemLeadingAvatar] })" />
|
|
336
|
+
<UChip
|
|
337
|
+
v-else-if="isInputItem(item) && item.chip"
|
|
338
|
+
:size="item.ui?.itemLeadingChipSize || props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
339
|
+
inset
|
|
340
|
+
standalone
|
|
341
|
+
v-bind="item.chip"
|
|
342
|
+
:class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip] })"
|
|
343
|
+
/>
|
|
344
|
+
</slot>
|
|
345
|
+
|
|
346
|
+
<span :class="ui.itemLabel({ class: [props.ui?.itemLabel, isInputItem(item) && item.ui?.itemLabel] })">
|
|
347
|
+
<slot name="item-label" :item="item" :index="index">
|
|
348
|
+
{{ isInputItem(item) ? get(item, props.labelKey) : item }}
|
|
349
|
+
</slot>
|
|
350
|
+
</span>
|
|
351
|
+
|
|
352
|
+
<span :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, isInputItem(item) && item.ui?.itemTrailing] })">
|
|
353
|
+
<slot name="item-trailing" :item="item" :index="index" />
|
|
354
|
+
|
|
355
|
+
<ComboboxItemIndicator as-child>
|
|
356
|
+
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, isInputItem(item) && item.ui?.itemTrailingIcon] })" />
|
|
357
|
+
</ComboboxItemIndicator>
|
|
358
|
+
</span>
|
|
359
|
+
</slot>
|
|
360
|
+
</ComboboxItem>
|
|
361
|
+
</template>
|
|
362
|
+
</ComboboxGroup>
|
|
363
|
+
|
|
364
|
+
<ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'bottom'" />
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
<slot name="content-bottom" />
|
|
368
|
+
|
|
369
|
+
<ComboboxArrow v-if="!!arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
370
|
+
</ComboboxContent>
|
|
371
|
+
</ComboboxPortal>
|
|
372
|
+
</ComboboxRoot>
|
|
373
373
|
</template>
|
|
@@ -179,11 +179,11 @@ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetI
|
|
|
179
179
|
readonly onFocus?: ((payload: FocusEvent) => any) | undefined;
|
|
180
180
|
readonly onCreate?: ((item: string) => any) | undefined;
|
|
181
181
|
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
182
|
-
readonly "onUpdate:modelValue"?: ((payload: GetModelValue<T, VK, M>) => any) | undefined;
|
|
183
182
|
readonly onHighlight?: ((payload: {
|
|
184
183
|
ref: HTMLElement;
|
|
185
184
|
value: GetModelValue<T, VK, M>;
|
|
186
185
|
} | undefined) => any) | undefined;
|
|
186
|
+
readonly "onUpdate:modelValue"?: ((payload: GetModelValue<T, VK, M>) => any) | undefined;
|
|
187
187
|
readonly "onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
188
188
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onFocus" | "onBlur" | "onChange" | "onUpdate:open" | "onUpdate:modelValue" | "onHighlight" | "onUpdate:searchTerm" | "onCreate"> & (InputMenuProps<T, VK, M> & {
|
|
189
189
|
searchTerm?: string;
|
|
@@ -521,10 +521,10 @@ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetI
|
|
|
521
521
|
}>): void;
|
|
522
522
|
attrs: any;
|
|
523
523
|
slots: InputMenuSlots<T, VK, M, NestedItem<T>>;
|
|
524
|
-
emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "
|
|
524
|
+
emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "highlight", payload: {
|
|
525
525
|
ref: HTMLElement;
|
|
526
526
|
value: GetModelValue<T, VK, M>;
|
|
527
|
-
} | undefined) => void)) & ((evt: "update:searchTerm", value: string) => void);
|
|
527
|
+
} | undefined) => void) & ((evt: "update:modelValue", payload: GetModelValue<T, VK, M>) => void)) & ((evt: "update:searchTerm", value: string) => void);
|
|
528
528
|
}>) => import("vue").VNode & {
|
|
529
529
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
530
530
|
};
|