@eslamdevui/ui 3.2.0-beta.1 → 3.2.0-beta.2
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/alert.ts +5 -0
- package/.nuxt/ui/badge.ts +5 -0
- package/.nuxt/ui/button-group.ts +13 -0
- package/.nuxt/ui/button.ts +5 -0
- package/.nuxt/ui/carousel.ts +5 -0
- package/.nuxt/ui/content/content-navigation.ts +339 -0
- package/.nuxt/ui/content/content-search-button.ts +6 -0
- package/.nuxt/ui/content/content-search.ts +6 -0
- package/.nuxt/ui/content/content-surround.ts +39 -0
- package/.nuxt/ui/content/content-toc.ts +150 -0
- package/.nuxt/ui/content/index.ts +5 -0
- package/.nuxt/ui/content-surround.ts +5 -0
- package/.nuxt/ui/content-toc.ts +6 -6
- package/.nuxt/ui/dashboard-navbar.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar-collapse.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar-toggle.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar.ts +10 -0
- package/.nuxt/ui/error.ts +9 -0
- package/.nuxt/ui/index.ts +48 -1
- package/.nuxt/ui/input-menu.ts +9 -0
- package/.nuxt/ui/input-number.ts +5 -0
- package/.nuxt/ui/input-tags.ts +9 -0
- package/.nuxt/ui/input.ts +9 -0
- package/.nuxt/ui/prose/a.ts +6 -0
- package/.nuxt/ui/prose/accordion-item.ts +3 -0
- package/.nuxt/ui/prose/accordion.ts +6 -0
- package/.nuxt/ui/prose/badge.ts +3 -0
- package/.nuxt/ui/prose/blockquote.ts +3 -0
- package/.nuxt/ui/prose/callout.ts +129 -0
- package/.nuxt/ui/prose/card-group.ts +3 -0
- package/.nuxt/ui/prose/card.ts +119 -0
- package/.nuxt/ui/prose/code-collapse.ts +19 -0
- package/.nuxt/ui/prose/code-group.ts +13 -0
- package/.nuxt/ui/prose/code-icon.ts +66 -0
- package/.nuxt/ui/prose/code-preview.ts +14 -0
- package/.nuxt/ui/prose/code-tree.ts +28 -0
- package/.nuxt/ui/prose/code.ts +27 -0
- package/.nuxt/ui/prose/collapsible.ts +12 -0
- package/.nuxt/ui/prose/em.ts +3 -0
- package/.nuxt/ui/prose/field-group.ts +3 -0
- package/.nuxt/ui/prose/field.ts +11 -0
- package/.nuxt/ui/prose/h1.ts +6 -0
- package/.nuxt/ui/prose/h2.ts +14 -0
- package/.nuxt/ui/prose/h3.ts +14 -0
- package/.nuxt/ui/prose/h4.ts +6 -0
- package/.nuxt/ui/prose/hr.ts +3 -0
- package/.nuxt/ui/prose/icon.ts +3 -0
- package/.nuxt/ui/prose/img.ts +3 -0
- package/.nuxt/ui/prose/index.ts +41 -0
- package/.nuxt/ui/prose/kbd.ts +3 -0
- package/.nuxt/ui/prose/li.ts +3 -0
- package/.nuxt/ui/prose/ol.ts +3 -0
- package/.nuxt/ui/prose/p.ts +3 -0
- package/.nuxt/ui/prose/pre.ts +17 -0
- package/.nuxt/ui/prose/steps.ts +19 -0
- package/.nuxt/ui/prose/strong.ts +3 -0
- package/.nuxt/ui/prose/table.ts +6 -0
- package/.nuxt/ui/prose/tabs-item.ts +3 -0
- package/.nuxt/ui/prose/tabs.ts +5 -0
- package/.nuxt/ui/prose/tbody.ts +3 -0
- package/.nuxt/ui/prose/td.ts +3 -0
- package/.nuxt/ui/prose/th.ts +3 -0
- package/.nuxt/ui/prose/thead.ts +3 -0
- package/.nuxt/ui/prose/tr.ts +3 -0
- package/.nuxt/ui/prose/ul.ts +3 -0
- package/.nuxt/ui/select-menu.ts +9 -0
- package/.nuxt/ui/select.ts +9 -0
- package/.nuxt/ui/textarea.ts +9 -0
- package/.nuxt/ui/toast.ts +5 -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 -228
- package/cli/utils.mjs +31 -31
- package/dist/module.json +1 -1
- package/dist/module.mjs +18 -13
- 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/Avatar.vue +27 -27
- package/dist/runtime/components/AvatarGroup.vue +4 -4
- package/dist/runtime/components/Badge.vue +16 -16
- 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/ChatMessage.vue +35 -35
- package/dist/runtime/components/ChatMessages.vue +71 -71
- package/dist/runtime/components/ChatMessages.vue.d.ts +1 -2
- package/dist/runtime/components/ChatPrompt.vue +30 -31
- package/dist/runtime/components/ChatPrompt.vue.d.ts +4 -4
- 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/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 +41 -41
- package/dist/runtime/components/DashboardNavbar.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardPanel.vue +29 -29
- package/dist/runtime/components/DashboardPanel.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardResizeHandle.vue +7 -7
- package/dist/runtime/components/DashboardSearch.vue +24 -25
- package/dist/runtime/components/DashboardSearch.vue.d.ts +3 -3
- package/dist/runtime/components/DashboardSearchButton.vue +63 -41
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +7 -1
- package/dist/runtime/components/DashboardSidebar.vue +77 -77
- package/dist/runtime/components/DashboardSidebarCollapse.vue +7 -7
- package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardSidebarToggle.vue +14 -17
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +4 -6
- 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 +57 -0
- package/dist/runtime/components/Error.vue.d.ts +52 -0
- package/dist/runtime/components/Form.vue +8 -8
- package/dist/runtime/components/Form.vue.d.ts +1 -1
- package/dist/runtime/components/FormField.vue +37 -37
- 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/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/Modal.vue +69 -69
- package/dist/runtime/components/NavigationMenu.vue +166 -166
- package/dist/runtime/components/OverlayProvider.vue +9 -9
- 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/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/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 +37 -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/color-mode/ColorModeAvatar.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +2 -2
- package/dist/runtime/components/color-mode/ColorModeButton.vue +16 -16
- package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +3 -3
- 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/ColorModeSelect.vue.d.ts +1 -1
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +19 -19
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
- package/dist/runtime/components/content/ContentNavigation.vue +175 -0
- package/dist/runtime/components/content/ContentNavigation.vue.d.ts +53 -0
- package/dist/runtime/components/content/ContentSearch.vue +184 -0
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +111 -0
- package/dist/runtime/components/content/ContentSearchButton.vue +95 -0
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +12 -0
- package/dist/runtime/components/content/ContentSurround.vue +61 -0
- package/dist/runtime/components/content/ContentSurround.vue.d.ts +59 -0
- package/dist/runtime/components/content/ContentToc.vue +146 -0
- package/dist/runtime/components/content/ContentToc.vue.d.ts +88 -0
- package/dist/runtime/components/locale/LocaleSelect.vue +20 -20
- package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +1 -1
- package/dist/runtime/components/prose/A.vue +24 -0
- package/dist/runtime/components/prose/A.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Accordion.vue +43 -0
- package/dist/runtime/components/prose/Accordion.vue.d.ts +16 -0
- package/dist/runtime/components/prose/AccordionItem.vue +25 -0
- package/dist/runtime/components/prose/AccordionItem.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Badge.vue +21 -0
- package/dist/runtime/components/prose/Badge.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Blockquote.vue +21 -0
- package/dist/runtime/components/prose/Blockquote.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Callout.vue +60 -0
- package/dist/runtime/components/prose/Callout.vue.d.ts +26 -0
- package/dist/runtime/components/prose/Card.vue +83 -0
- package/dist/runtime/components/prose/Card.vue.d.ts +30 -0
- package/dist/runtime/components/prose/CardGroup.vue +21 -0
- package/dist/runtime/components/prose/CardGroup.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Code.vue +23 -0
- package/dist/runtime/components/prose/Code.vue.d.ts +22 -0
- package/dist/runtime/components/prose/CodeCollapse.vue +44 -0
- package/dist/runtime/components/prose/CodeCollapse.vue.d.ts +46 -0
- package/dist/runtime/components/prose/CodeGroup.vue +70 -0
- package/dist/runtime/components/prose/CodeGroup.vue.d.ts +37 -0
- package/dist/runtime/components/prose/CodeIcon.vue +28 -0
- package/dist/runtime/components/prose/CodeIcon.vue.d.ts +24 -0
- package/dist/runtime/components/prose/CodePreview.vue +28 -0
- package/dist/runtime/components/prose/CodePreview.vue.d.ts +19 -0
- package/dist/runtime/components/prose/CodeTree.vue +160 -0
- package/dist/runtime/components/prose/CodeTree.vue.d.ts +30 -0
- package/dist/runtime/components/prose/Collapsible.vue +41 -0
- package/dist/runtime/components/prose/Collapsible.vue.d.ts +38 -0
- package/dist/runtime/components/prose/Em.vue +19 -0
- package/dist/runtime/components/prose/Em.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Field.vue +48 -0
- package/dist/runtime/components/prose/Field.vue.d.ts +39 -0
- package/dist/runtime/components/prose/FieldGroup.vue +23 -0
- package/dist/runtime/components/prose/FieldGroup.vue.d.ts +18 -0
- package/dist/runtime/components/prose/H1.vue +28 -0
- package/dist/runtime/components/prose/H1.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H2.vue +32 -0
- package/dist/runtime/components/prose/H2.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H3.vue +32 -0
- package/dist/runtime/components/prose/H3.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H4.vue +28 -0
- package/dist/runtime/components/prose/H4.vue.d.ts +19 -0
- package/dist/runtime/components/prose/Hr.vue +18 -0
- package/dist/runtime/components/prose/Hr.vue.d.ts +5 -0
- package/dist/runtime/components/prose/Icon.vue +19 -0
- package/dist/runtime/components/prose/Icon.vue.d.ts +6 -0
- package/dist/runtime/components/prose/Img.vue +40 -0
- package/dist/runtime/components/prose/Img.vue.d.ts +9 -0
- package/dist/runtime/components/prose/Kbd.vue +19 -0
- package/dist/runtime/components/prose/Kbd.vue.d.ts +6 -0
- package/dist/runtime/components/prose/Li.vue +21 -0
- package/dist/runtime/components/prose/Li.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Ol.vue +21 -0
- package/dist/runtime/components/prose/Ol.vue.d.ts +13 -0
- package/dist/runtime/components/prose/P.vue +21 -0
- package/dist/runtime/components/prose/P.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Pre.vue +63 -0
- package/dist/runtime/components/prose/Pre.vue.d.ts +25 -0
- package/dist/runtime/components/prose/Script.vue +12 -0
- package/dist/runtime/components/prose/Script.vue.d.ts +12 -0
- package/dist/runtime/components/prose/Steps.vue +22 -0
- package/dist/runtime/components/prose/Steps.vue.d.ts +22 -0
- package/dist/runtime/components/prose/Strong.vue +21 -0
- package/dist/runtime/components/prose/Strong.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Table.vue +24 -0
- package/dist/runtime/components/prose/Table.vue.d.ts +18 -0
- package/dist/runtime/components/prose/Tabs.vue +78 -0
- package/dist/runtime/components/prose/Tabs.vue.d.ts +36 -0
- package/dist/runtime/components/prose/TabsItem.vue +25 -0
- package/dist/runtime/components/prose/TabsItem.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Tbody.vue +21 -0
- package/dist/runtime/components/prose/Tbody.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Td.vue +21 -0
- package/dist/runtime/components/prose/Td.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Th.vue +21 -0
- package/dist/runtime/components/prose/Th.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Thead.vue +21 -0
- package/dist/runtime/components/prose/Thead.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Tr.vue +21 -0
- package/dist/runtime/components/prose/Tr.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Ul.vue +21 -0
- package/dist/runtime/components/prose/Ul.vue.d.ts +13 -0
- package/dist/runtime/components/prose/callout/Caution.vue +11 -0
- package/dist/runtime/components/prose/callout/Caution.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Note.vue +11 -0
- package/dist/runtime/components/prose/callout/Note.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Tip.vue +11 -0
- package/dist/runtime/components/prose/callout/Tip.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Warning.vue +11 -0
- package/dist/runtime/components/prose/callout/Warning.vue.d.ts +14 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +2 -2
- package/dist/runtime/composables/usePortal.d.ts +1 -1
- package/dist/runtime/composables/useResizable.d.ts +1 -1
- 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/content.d.ts +4 -1
- package/dist/runtime/types/content.js +4 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/prose.d.ts +42 -1
- package/dist/runtime/types/prose.js +42 -0
- package/dist/runtime/types/tv.d.ts +2 -2
- package/dist/runtime/utils/index.d.ts +1 -1
- package/dist/runtime/utils/index.js +13 -4
- 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.BcVNrqyb.mjs → ui.DQZ75GCP.mjs} +183 -180
- package/dist/unplugin.mjs +9 -9
- package/dist/vite.mjs +1 -1
- package/package.json +8 -9
- package/vue-plugin.d.ts +5 -5
|
@@ -3,14 +3,15 @@ import theme from "#build/ui/dashboard-search-button";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { computed } from "vue";
|
|
6
|
+
import { computed, toRef } from "vue";
|
|
7
7
|
import { useForwardProps } from "reka-ui";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { defu } from "defu";
|
|
9
|
+
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
10
10
|
import { useAppConfig } from "#imports";
|
|
11
|
+
import UTooltip from "./Tooltip.vue";
|
|
11
12
|
import { useLocalePro } from "../composables/useLocalePro";
|
|
12
13
|
import { useDashboard } from "../utils/dashboard";
|
|
13
|
-
import { transformUI } from "../utils";
|
|
14
|
+
import { transformUI, omit } from "../utils";
|
|
14
15
|
import { tv } from "../utils/tv";
|
|
15
16
|
const props = defineProps({
|
|
16
17
|
icon: { type: String, required: false },
|
|
@@ -19,54 +20,75 @@ const props = defineProps({
|
|
|
19
20
|
variant: { type: null, required: false },
|
|
20
21
|
size: { type: null, required: false },
|
|
21
22
|
collapsed: { type: Boolean, required: false, default: false },
|
|
23
|
+
tooltip: { type: [Boolean, Object], required: false, default: false },
|
|
22
24
|
kbds: { type: Array, required: false, default: () => ["meta", "k"] },
|
|
23
25
|
ui: { type: void 0, required: false },
|
|
24
26
|
class: { type: null, required: false }
|
|
25
27
|
});
|
|
26
|
-
defineSlots();
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const { t } = useLocalePro();
|
|
28
|
+
const slots = defineSlots();
|
|
29
|
+
const [DefineButtonTemplate, ReuseButtonTemplate] = createReusableTemplate();
|
|
30
|
+
const proxySlots = omit(slots, ["trailing"]);
|
|
30
31
|
const appConfig = useAppConfig();
|
|
32
|
+
const { t } = useLocalePro();
|
|
31
33
|
const { toggleSearch } = useDashboard();
|
|
32
|
-
const
|
|
34
|
+
const labelText = computed(() => props.label || t("dashboardSearchButton.label"));
|
|
35
|
+
const uiPro = computed(
|
|
33
36
|
() => tv({
|
|
34
37
|
extend: tv(theme),
|
|
35
38
|
...appConfig.ui?.dashboardSearchButton
|
|
36
|
-
})
|
|
39
|
+
})()
|
|
37
40
|
);
|
|
41
|
+
const tooltipProps = toRef(
|
|
42
|
+
() => defu(
|
|
43
|
+
typeof props.tooltip === "boolean" ? {} : props.tooltip,
|
|
44
|
+
{ delayDuration: 0, content: { side: "right" } }
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
const rootProps = useForwardProps(reactivePick(props, "color", "size"));
|
|
38
48
|
</script>
|
|
39
49
|
|
|
40
50
|
<template>
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
51
|
+
<DefineButtonTemplate>
|
|
52
|
+
<UButton
|
|
53
|
+
:icon="props.icon || appConfig.ui.icons.search"
|
|
54
|
+
:label="props.collapsed ? void 0 : labelText"
|
|
55
|
+
:variant="props.variant || (props.collapsed ? 'ghost' : 'outline')"
|
|
56
|
+
:aria-label="props.collapsed ? labelText : void 0"
|
|
57
|
+
:square="props.collapsed"
|
|
58
|
+
:class="uiPro.base({ class: [props.ui?.base, props.class] })"
|
|
59
|
+
:ui="transformUI(uiPro, props.ui)"
|
|
60
|
+
v-bind="rootProps"
|
|
61
|
+
@click="toggleSearch"
|
|
62
|
+
>
|
|
63
|
+
<template #default="slotProps">
|
|
64
|
+
<template v-for="(_, name) in proxySlots" :key="name">
|
|
65
|
+
<slot :name="name" v-bind="slotProps" />
|
|
66
|
+
</template>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<template v-if="!props.collapsed" #trailing>
|
|
70
|
+
<div :class="uiPro.trailing({ class: props.ui?.trailing })">
|
|
71
|
+
<slot name="trailing">
|
|
72
|
+
<template v-if="props.kbds?.length">
|
|
73
|
+
<UKbd
|
|
74
|
+
v-for="(kbd, index) in props.kbds"
|
|
75
|
+
:key="index"
|
|
76
|
+
variant="subtle"
|
|
77
|
+
v-bind="typeof kbd === 'string' ? { value: kbd } : kbd"
|
|
78
|
+
/>
|
|
79
|
+
</template>
|
|
80
|
+
</slot>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
83
|
+
</UButton>
|
|
84
|
+
</DefineButtonTemplate>
|
|
85
|
+
|
|
86
|
+
<UTooltip
|
|
87
|
+
v-if="props.collapsed && props.tooltip"
|
|
88
|
+
:text="labelText"
|
|
89
|
+
v-bind="tooltipProps"
|
|
90
|
+
>
|
|
91
|
+
<ReuseButtonTemplate />
|
|
92
|
+
</UTooltip>
|
|
93
|
+
<ReuseButtonTemplate v-else />
|
|
72
94
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
-
import type { ButtonProps, KbdProps, ComponentConfig } from '
|
|
2
|
+
import type { ButtonProps, KbdProps, ComponentConfig, TooltipProps } from '../types';
|
|
3
3
|
import theme from '#build/ui/dashboard-search-button';
|
|
4
4
|
export type DashboardSearchButton = ComponentConfig<typeof theme, AppConfig, 'dashboardSearchButton'>;
|
|
5
5
|
export interface DashboardSearchButtonProps {
|
|
@@ -30,6 +30,11 @@ export interface DashboardSearchButtonProps {
|
|
|
30
30
|
* @defaultValue false
|
|
31
31
|
*/
|
|
32
32
|
collapsed?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Display a tooltip on the button when is collapsed with the button label.
|
|
35
|
+
* This has priority over the global `tooltip` prop.
|
|
36
|
+
*/
|
|
37
|
+
tooltip?: boolean | TooltipProps;
|
|
33
38
|
/**
|
|
34
39
|
* The keyboard keys to display in the button.
|
|
35
40
|
* `{ variant: 'subtle' }`{lang="ts-type"}
|
|
@@ -41,6 +46,7 @@ export interface DashboardSearchButtonProps {
|
|
|
41
46
|
}
|
|
42
47
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<DashboardSearchButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardSearchButtonProps> & Readonly<{}>, {
|
|
43
48
|
color: "error" | "info" | "primary" | "secondary" | "success" | "warning" | "neutral";
|
|
49
|
+
tooltip: boolean | TooltipProps;
|
|
44
50
|
kbds: KbdProps["value"][] | KbdProps[];
|
|
45
51
|
collapsed: boolean;
|
|
46
52
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
|
|
@@ -6,9 +6,9 @@ import theme from "#build/ui/dashboard-sidebar";
|
|
|
6
6
|
import { ref, computed, toRef, useId, watch } from "vue";
|
|
7
7
|
import { defu } from "defu";
|
|
8
8
|
import { createReusableTemplate } from "@vueuse/core";
|
|
9
|
-
import USlideover from "
|
|
10
|
-
import UModal from "
|
|
11
|
-
import UDrawer from "
|
|
9
|
+
import USlideover from "./Slideover.vue";
|
|
10
|
+
import UModal from "./Modal.vue";
|
|
11
|
+
import UDrawer from "./Drawer.vue";
|
|
12
12
|
import { useAppConfig, useRuntimeHook, useRoute } from "#imports";
|
|
13
13
|
import { useResizable } from "../composables/useResizable";
|
|
14
14
|
import { useDashboard } from "../utils/dashboard";
|
|
@@ -90,81 +90,81 @@ function toggleOpen() {
|
|
|
90
90
|
</script>
|
|
91
91
|
|
|
92
92
|
<template>
|
|
93
|
-
<DefineToggle>
|
|
94
|
-
<slot name="toggle" :open="open" :toggle="toggleOpen">
|
|
95
|
-
<UDashboardSidebarToggle
|
|
96
|
-
v-if="props.toggle"
|
|
97
|
-
v-bind="typeof props.toggle === 'object' ? props.toggle : {}"
|
|
98
|
-
:side="props.toggleSide"
|
|
99
|
-
:class="ui.toggle({ class: props.ui?.toggle, toggleSide: props.toggleSide })"
|
|
100
|
-
/>
|
|
101
|
-
</slot>
|
|
102
|
-
</DefineToggle>
|
|
103
|
-
|
|
104
|
-
<DefineHandle>
|
|
105
|
-
<slot name="resize-handle" :on-mouse-down="onMouseDown" :on-touch-start="onTouchStart">
|
|
106
|
-
<UDashboardResizeHandle
|
|
107
|
-
v-if="props.resizable"
|
|
108
|
-
:aria-controls="id"
|
|
109
|
-
:class="ui.handle({ class: props.ui?.handle })"
|
|
110
|
-
@mousedown="onMouseDown"
|
|
111
|
-
@touchstart="onTouchStart"
|
|
112
|
-
/>
|
|
113
|
-
</slot>
|
|
114
|
-
</DefineHandle>
|
|
115
|
-
|
|
116
|
-
<ReuseHandle v-if="props.side === 'right'" />
|
|
117
|
-
|
|
118
|
-
<div
|
|
119
|
-
:id="id"
|
|
120
|
-
ref="el"
|
|
121
|
-
:data-collapsed="isCollapsed"
|
|
122
|
-
:data-dragging="isDragging"
|
|
123
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
124
|
-
:style="{ '--width': `${size}${dashboardCtx.unit}` }"
|
|
125
|
-
>
|
|
126
|
-
<div v-if="$slots.header" :class="ui.header({ class: props.ui?.header })">
|
|
127
|
-
<slot name="header" :collapsed="isCollapsed" :collapse="collapse" />
|
|
128
|
-
</div>
|
|
129
|
-
|
|
130
|
-
<div :class="ui.body({ class: props.ui?.body })">
|
|
131
|
-
<slot :collapsed="isCollapsed" :collapse="collapse" />
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
<div v-if="$slots.footer" :class="ui.footer({ class: props.ui?.footer })">
|
|
135
|
-
<slot name="footer" :collapsed="isCollapsed" :collapse="collapse" />
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
|
|
139
|
-
<ReuseHandle v-if="props.side === 'left'" />
|
|
140
|
-
|
|
141
|
-
<Menu
|
|
142
|
-
v-model:open="open"
|
|
143
|
-
v-bind="menuProps"
|
|
93
|
+
<DefineToggle>
|
|
94
|
+
<slot name="toggle" :open="open" :toggle="toggleOpen">
|
|
95
|
+
<UDashboardSidebarToggle
|
|
96
|
+
v-if="props.toggle"
|
|
97
|
+
v-bind="typeof props.toggle === 'object' ? props.toggle : {}"
|
|
98
|
+
:side="props.toggleSide"
|
|
99
|
+
:class="ui.toggle({ class: props.ui?.toggle, toggleSide: props.toggleSide })"
|
|
100
|
+
/>
|
|
101
|
+
</slot>
|
|
102
|
+
</DefineToggle>
|
|
103
|
+
|
|
104
|
+
<DefineHandle>
|
|
105
|
+
<slot name="resize-handle" :on-mouse-down="onMouseDown" :on-touch-start="onTouchStart">
|
|
106
|
+
<UDashboardResizeHandle
|
|
107
|
+
v-if="props.resizable"
|
|
108
|
+
:aria-controls="id"
|
|
109
|
+
:class="ui.handle({ class: props.ui?.handle })"
|
|
110
|
+
@mousedown="onMouseDown"
|
|
111
|
+
@touchstart="onTouchStart"
|
|
112
|
+
/>
|
|
113
|
+
</slot>
|
|
114
|
+
</DefineHandle>
|
|
115
|
+
|
|
116
|
+
<ReuseHandle v-if="props.side === 'right'" />
|
|
117
|
+
|
|
118
|
+
<div
|
|
119
|
+
:id="id"
|
|
120
|
+
ref="el"
|
|
121
|
+
:data-collapsed="isCollapsed"
|
|
122
|
+
:data-dragging="isDragging"
|
|
123
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
124
|
+
:style="{ '--width': `${size}${dashboardCtx.unit}` }"
|
|
125
|
+
>
|
|
126
|
+
<div v-if="$slots.header" :class="ui.header({ class: props.ui?.header })">
|
|
127
|
+
<slot name="header" :collapsed="isCollapsed" :collapse="collapse" />
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<div :class="ui.body({ class: props.ui?.body })">
|
|
131
|
+
<slot :collapsed="isCollapsed" :collapse="collapse" />
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<div v-if="$slots.footer" :class="ui.footer({ class: props.ui?.footer })">
|
|
135
|
+
<slot name="footer" :collapsed="isCollapsed" :collapse="collapse" />
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<ReuseHandle v-if="props.side === 'left'" />
|
|
140
|
+
|
|
141
|
+
<Menu
|
|
142
|
+
v-model:open="open"
|
|
143
|
+
v-bind="menuProps"
|
|
144
144
|
:ui="{
|
|
145
145
|
overlay: ui.overlay({ class: props.ui?.overlay }),
|
|
146
146
|
content: ui.content({ class: props.ui?.content })
|
|
147
|
-
}"
|
|
148
|
-
>
|
|
149
|
-
<template #content>
|
|
150
|
-
<slot name="content">
|
|
151
|
-
<div
|
|
152
|
-
v-if="$slots.header || props.mode !== 'drawer'"
|
|
153
|
-
:class="ui.header({ class: props.ui?.header, menu: true })"
|
|
154
|
-
>
|
|
155
|
-
<ReuseToggle v-if="props.mode !== 'drawer' && props.toggleSide === 'left'" />
|
|
156
|
-
<slot name="header" />
|
|
157
|
-
<ReuseToggle v-if="props.mode !== 'drawer' && props.toggleSide === 'right'" />
|
|
158
|
-
</div>
|
|
159
|
-
|
|
160
|
-
<div :class="ui.body({ class: props.ui?.body, menu: true })">
|
|
161
|
-
<slot />
|
|
162
|
-
</div>
|
|
163
|
-
|
|
164
|
-
<div v-if="$slots.footer" :class="ui.footer({ class: props.ui?.footer, menu: true })">
|
|
165
|
-
<slot name="footer" />
|
|
166
|
-
</div>
|
|
167
|
-
</slot>
|
|
168
|
-
</template>
|
|
169
|
-
</Menu>
|
|
147
|
+
}"
|
|
148
|
+
>
|
|
149
|
+
<template #content>
|
|
150
|
+
<slot name="content">
|
|
151
|
+
<div
|
|
152
|
+
v-if="$slots.header || props.mode !== 'drawer'"
|
|
153
|
+
:class="ui.header({ class: props.ui?.header, menu: true })"
|
|
154
|
+
>
|
|
155
|
+
<ReuseToggle v-if="props.mode !== 'drawer' && props.toggleSide === 'left'" />
|
|
156
|
+
<slot name="header" />
|
|
157
|
+
<ReuseToggle v-if="props.mode !== 'drawer' && props.toggleSide === 'right'" />
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<div :class="ui.body({ class: props.ui?.body, menu: true })">
|
|
161
|
+
<slot />
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<div v-if="$slots.footer" :class="ui.footer({ class: props.ui?.footer, menu: true })">
|
|
165
|
+
<slot name="footer" />
|
|
166
|
+
</div>
|
|
167
|
+
</slot>
|
|
168
|
+
</template>
|
|
169
|
+
</Menu>
|
|
170
170
|
</template>
|
|
@@ -32,15 +32,15 @@ function toggleCollapse() {
|
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
34
|
<template>
|
|
35
|
-
<UButton
|
|
36
|
-
v-bind="rootProps"
|
|
35
|
+
<UButton
|
|
36
|
+
v-bind="rootProps"
|
|
37
37
|
:aria-label="
|
|
38
38
|
sidebarCollapsed ? t('dashboardSidebarCollapse.expand') : t('dashboardSidebarCollapse.collapse')
|
|
39
|
-
"
|
|
39
|
+
"
|
|
40
40
|
:icon="
|
|
41
41
|
sidebarCollapsed ? appConfig.ui.icons.panelOpen : appConfig.ui.icons.panelClose
|
|
42
|
-
"
|
|
43
|
-
:class="ui({ class: props.class })"
|
|
44
|
-
@click="toggleCollapse"
|
|
45
|
-
/>
|
|
42
|
+
"
|
|
43
|
+
:class="ui({ class: props.class })"
|
|
44
|
+
@click="toggleCollapse"
|
|
45
|
+
/>
|
|
46
46
|
</template>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ButtonProps } from '
|
|
1
|
+
import type { ButtonProps } from '../types';
|
|
2
2
|
export interface DashboardSidebarCollapseProps extends /** @vue-ignore */ Pick<ButtonProps, 'as' | 'size' | 'disabled' | 'ui'> {
|
|
3
3
|
side?: 'left' | 'right';
|
|
4
4
|
/** @defaultValue 'neutral' */
|
|
@@ -14,30 +14,27 @@ const props = defineProps({
|
|
|
14
14
|
side: { type: String, required: false },
|
|
15
15
|
color: { type: null, required: false },
|
|
16
16
|
variant: { type: null, required: false },
|
|
17
|
-
class: { type: null, required: false }
|
|
18
|
-
ui: { type: null, required: false },
|
|
19
|
-
as: { type: null, required: false },
|
|
20
|
-
size: { type: null, required: false },
|
|
21
|
-
disabled: { type: Boolean, required: false }
|
|
17
|
+
class: { type: null, required: false }
|
|
22
18
|
});
|
|
23
19
|
const rootProps = useForwardProps(reactivePick(props, "color", "variant", "size", "as", "disabled", "ui"));
|
|
24
20
|
const { t } = useLocalePro();
|
|
25
21
|
const appConfig = useAppConfig();
|
|
26
22
|
const { sidebarOpen, toggleSidebar } = useDashboard();
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
const ui = computed(() => {
|
|
24
|
+
const baseTheme = typeof theme === "string" ? { base: theme } : theme;
|
|
25
|
+
return tv({
|
|
26
|
+
extend: tv(baseTheme),
|
|
30
27
|
...appConfig.ui?.dashboardSidebarToggle
|
|
31
|
-
})
|
|
32
|
-
);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
33
30
|
</script>
|
|
34
31
|
|
|
35
32
|
<template>
|
|
36
|
-
<UButton
|
|
37
|
-
v-bind="rootProps"
|
|
38
|
-
:aria-label="sidebarOpen ? t('dashboardSidebarToggle.close') : t('dashboardSidebarToggle.open')"
|
|
39
|
-
:icon="sidebarOpen ? appConfig.ui.icons.close : appConfig.ui.icons.menu"
|
|
40
|
-
:class="
|
|
41
|
-
@click="toggleSidebar"
|
|
42
|
-
/>
|
|
33
|
+
<UButton
|
|
34
|
+
v-bind="rootProps"
|
|
35
|
+
:aria-label="sidebarOpen ? t('dashboardSidebarToggle.close') : t('dashboardSidebarToggle.open')"
|
|
36
|
+
:icon="sidebarOpen ? appConfig.ui.icons.close : appConfig.ui.icons.menu"
|
|
37
|
+
:class="typeof ui === 'function' ? ui({ class: props.class, side: props.side }) : ui"
|
|
38
|
+
@click="toggleSidebar"
|
|
39
|
+
/>
|
|
43
40
|
</template>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export interface DashboardSidebarToggleProps extends Pick<ButtonProps, 'as' | 'size' | 'disabled' | 'ui'> {
|
|
1
|
+
import type { ButtonProps } from '@nuxt/ui';
|
|
2
|
+
export interface DashboardSidebarToggleProps extends
|
|
3
|
+
/** @vue-ignore */
|
|
4
|
+
Pick<ButtonProps, 'as' | 'size' | 'disabled' | 'ui'> {
|
|
6
5
|
side?: 'left' | 'right';
|
|
7
6
|
/**
|
|
8
7
|
* @defaultValue 'neutral'
|
|
@@ -13,7 +12,6 @@ export interface DashboardSidebarToggleProps extends Pick<ButtonProps, 'as' | 's
|
|
|
13
12
|
*/
|
|
14
13
|
variant?: ButtonProps['variant'];
|
|
15
14
|
class?: any;
|
|
16
|
-
ui?: DashboardSidebarToggle['slots'];
|
|
17
15
|
}
|
|
18
16
|
declare const _default: import("vue").DefineComponent<DashboardSidebarToggleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardSidebarToggleProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
17
|
export default _default;
|
|
@@ -54,59 +54,59 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.drawer || {}
|
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
<template>
|
|
57
|
-
<DrawerRoot v-bind="rootProps">
|
|
58
|
-
<DrawerTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
59
|
-
<slot />
|
|
60
|
-
</DrawerTrigger>
|
|
61
|
-
|
|
62
|
-
<DrawerPortal v-bind="portalProps">
|
|
63
|
-
<DrawerOverlay v-if="overlay" :class="ui.overlay({ class: props.ui?.overlay })" />
|
|
64
|
-
|
|
65
|
-
<DrawerContent :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-bind="contentProps" v-on="contentEvents">
|
|
66
|
-
<DrawerHandle v-if="handle" :class="ui.handle({ class: props.ui?.handle })" />
|
|
67
|
-
|
|
68
|
-
<VisuallyHidden v-if="!!slots.content && (title || !!slots.title || (description || !!slots.description))">
|
|
69
|
-
<DrawerTitle v-if="title || !!slots.title">
|
|
70
|
-
<slot name="title">
|
|
71
|
-
{{ title }}
|
|
72
|
-
</slot>
|
|
73
|
-
</DrawerTitle>
|
|
74
|
-
|
|
75
|
-
<DrawerDescription v-if="description || !!slots.description">
|
|
76
|
-
<slot name="description">
|
|
77
|
-
{{ description }}
|
|
78
|
-
</slot>
|
|
79
|
-
</DrawerDescription>
|
|
80
|
-
</VisuallyHidden>
|
|
81
|
-
|
|
82
|
-
<slot name="content">
|
|
83
|
-
<div :class="ui.container({ class: props.ui?.container })">
|
|
84
|
-
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description)" :class="ui.header({ class: props.ui?.header })">
|
|
85
|
-
<slot name="header">
|
|
86
|
-
<DrawerTitle v-if="title || !!slots.title" :class="ui.title({ class: props.ui?.title })">
|
|
87
|
-
<slot name="title">
|
|
88
|
-
{{ title }}
|
|
89
|
-
</slot>
|
|
90
|
-
</DrawerTitle>
|
|
91
|
-
|
|
92
|
-
<DrawerDescription v-if="description || !!slots.description" :class="ui.description({ class: props.ui?.description })">
|
|
93
|
-
<slot name="description">
|
|
94
|
-
{{ description }}
|
|
95
|
-
</slot>
|
|
96
|
-
</DrawerDescription>
|
|
97
|
-
</slot>
|
|
98
|
-
</div>
|
|
99
|
-
|
|
100
|
-
<div v-if="!!slots.body" :class="ui.body({ class: props.ui?.body })">
|
|
101
|
-
<slot name="body" />
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
<div v-if="!!slots.footer" :class="ui.footer({ class: props.ui?.footer })">
|
|
105
|
-
<slot name="footer" />
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
</slot>
|
|
109
|
-
</DrawerContent>
|
|
110
|
-
</DrawerPortal>
|
|
111
|
-
</DrawerRoot>
|
|
57
|
+
<DrawerRoot v-bind="rootProps">
|
|
58
|
+
<DrawerTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
59
|
+
<slot />
|
|
60
|
+
</DrawerTrigger>
|
|
61
|
+
|
|
62
|
+
<DrawerPortal v-bind="portalProps">
|
|
63
|
+
<DrawerOverlay v-if="overlay" :class="ui.overlay({ class: props.ui?.overlay })" />
|
|
64
|
+
|
|
65
|
+
<DrawerContent :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-bind="contentProps" v-on="contentEvents">
|
|
66
|
+
<DrawerHandle v-if="handle" :class="ui.handle({ class: props.ui?.handle })" />
|
|
67
|
+
|
|
68
|
+
<VisuallyHidden v-if="!!slots.content && (title || !!slots.title || (description || !!slots.description))">
|
|
69
|
+
<DrawerTitle v-if="title || !!slots.title">
|
|
70
|
+
<slot name="title">
|
|
71
|
+
{{ title }}
|
|
72
|
+
</slot>
|
|
73
|
+
</DrawerTitle>
|
|
74
|
+
|
|
75
|
+
<DrawerDescription v-if="description || !!slots.description">
|
|
76
|
+
<slot name="description">
|
|
77
|
+
{{ description }}
|
|
78
|
+
</slot>
|
|
79
|
+
</DrawerDescription>
|
|
80
|
+
</VisuallyHidden>
|
|
81
|
+
|
|
82
|
+
<slot name="content">
|
|
83
|
+
<div :class="ui.container({ class: props.ui?.container })">
|
|
84
|
+
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description)" :class="ui.header({ class: props.ui?.header })">
|
|
85
|
+
<slot name="header">
|
|
86
|
+
<DrawerTitle v-if="title || !!slots.title" :class="ui.title({ class: props.ui?.title })">
|
|
87
|
+
<slot name="title">
|
|
88
|
+
{{ title }}
|
|
89
|
+
</slot>
|
|
90
|
+
</DrawerTitle>
|
|
91
|
+
|
|
92
|
+
<DrawerDescription v-if="description || !!slots.description" :class="ui.description({ class: props.ui?.description })">
|
|
93
|
+
<slot name="description">
|
|
94
|
+
{{ description }}
|
|
95
|
+
</slot>
|
|
96
|
+
</DrawerDescription>
|
|
97
|
+
</slot>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div v-if="!!slots.body" :class="ui.body({ class: props.ui?.body })">
|
|
101
|
+
<slot name="body" />
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div v-if="!!slots.footer" :class="ui.footer({ class: props.ui?.footer })">
|
|
105
|
+
<slot name="footer" />
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</slot>
|
|
109
|
+
</DrawerContent>
|
|
110
|
+
</DrawerPortal>
|
|
111
|
+
</DrawerRoot>
|
|
112
112
|
</template>
|
|
@@ -41,28 +41,28 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dropdownMenu
|
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
43
|
<template>
|
|
44
|
-
<DropdownMenuRoot v-slot="{ open }" v-bind="rootProps">
|
|
45
|
-
<DropdownMenuTrigger v-if="!!slots.default" as-child :class="props.class" :disabled="disabled">
|
|
46
|
-
<slot :open="open" />
|
|
47
|
-
</DropdownMenuTrigger>
|
|
48
|
-
|
|
49
|
-
<UDropdownMenuContent
|
|
50
|
-
:class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })"
|
|
51
|
-
:ui="ui"
|
|
52
|
-
:ui-override="props.ui"
|
|
53
|
-
v-bind="contentProps"
|
|
54
|
-
:items="items"
|
|
55
|
-
:portal="portal"
|
|
56
|
-
:label-key="labelKey"
|
|
57
|
-
:checked-icon="checkedIcon"
|
|
58
|
-
:loading-icon="loadingIcon"
|
|
59
|
-
:external-icon="externalIcon"
|
|
60
|
-
>
|
|
61
|
-
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
62
|
-
<slot :name="name" v-bind="slotData" />
|
|
63
|
-
</template>
|
|
64
|
-
|
|
65
|
-
<DropdownMenuArrow v-if="!!arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
66
|
-
</UDropdownMenuContent>
|
|
67
|
-
</DropdownMenuRoot>
|
|
44
|
+
<DropdownMenuRoot v-slot="{ open }" v-bind="rootProps">
|
|
45
|
+
<DropdownMenuTrigger v-if="!!slots.default" as-child :class="props.class" :disabled="disabled">
|
|
46
|
+
<slot :open="open" />
|
|
47
|
+
</DropdownMenuTrigger>
|
|
48
|
+
|
|
49
|
+
<UDropdownMenuContent
|
|
50
|
+
:class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })"
|
|
51
|
+
:ui="ui"
|
|
52
|
+
:ui-override="props.ui"
|
|
53
|
+
v-bind="contentProps"
|
|
54
|
+
:items="items"
|
|
55
|
+
:portal="portal"
|
|
56
|
+
:label-key="labelKey"
|
|
57
|
+
:checked-icon="checkedIcon"
|
|
58
|
+
:loading-icon="loadingIcon"
|
|
59
|
+
:external-icon="externalIcon"
|
|
60
|
+
>
|
|
61
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
62
|
+
<slot :name="name" v-bind="slotData" />
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<DropdownMenuArrow v-if="!!arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
66
|
+
</UDropdownMenuContent>
|
|
67
|
+
</DropdownMenuRoot>
|
|
68
68
|
</template>
|