25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
feat(ui): replace dense dropdown menus
t8y279700c0b4170
diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vueindex d534345c15..fbd0d2112d 100644--- a/apps/desktop/src/components/grid/DataGrid.vue+++ b/apps/desktop/src/components/grid/DataGrid.vue@@ -68,6 +68,7 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTriggeimport { Input } from "@/components/ui/input";import LightTooltip from "@/components/ui/LightTooltip.vue";import LightDropdown from "@/components/ui/LightDropdown.vue";+import LightDropdownMenu from "@/components/ui/LightDropdownMenu.vue";import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "@/components/ui/popover";import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";@@ -146,6 +147,12 @@ const settingsStore = useSettingsStore();const { isDark } = useTheme();const { toast } = useToast();const { highlight } = useSqlHighlighter();+const binaryCellDownloadMenuItems = computed(() =>+ BINARY_CELL_DOWNLOAD_MODES.map((mode) => ({+ label: t(`grid.binaryDownload.${mode}`),+ value: mode,+ })),+);interface PreparedCopyValue {key: string;@@ -650,6 +657,30 @@ function openCompactLocalFilter(colIdx: number) {});}+function compactColumnActionMenuItems(columnName: string) {+ return [+ {+ label: t("grid.columnFormatter"),+ value: "formatter",+ icon: Code2,+ disabled: !formatterKeyForColumn(columnName),+ },+ {+ label: t("grid.localFilter"),+ value: "localFilter",+ icon: Filter,+ },+ ];+}++function selectCompactColumnAction(value: string, columnIndex: number) {+ if (value === "formatter") {+ openCompactColumnFormatter(columnIndex);+ } else if (value === "localFilter") {+ openCompactLocalFilter(columnIndex);+ }+}+function handleLocalFilterOpenChange(value: boolean, columnIndex: number) {if (value) {openLocalFilter(columnIndex);@@ -6659,18 +6690,22 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {<template v-else>{{ cell.display }}<div v-if="cellDetailButtonVisible(cell.recordIndex, cell.valueIndex)" class="absolute right-0.5 top-0.5 flex items-center gap-1">- <DropdownMenu v-if="canQuickDownloadCellValue(cell.recordIndex, cell.valueIndex)" :open="quickDownloadMenuOpenFor(cell.recordIndex, cell.valueIndex)" @update:open="(value: boolean) => handleQuickDownloadMenuOpenChange(value, cell.recordIndex, cell.valueIndex)">- <DropdownMenuTrigger as-child>- <button class="flex h-5 w-5 items-center justify-center rounded bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border hover:text-foreground" :title="t('grid.downloadBinaryValue')" @mousedown.stop @click.stop>+ <LightDropdownMenu+ v-if="canQuickDownloadCellValue(cell.recordIndex, cell.valueIndex)"+ :items="binaryCellDownloadMenuItems"+ :open="quickDownloadMenuOpenFor(cell.recordIndex, cell.valueIndex)"+ align="end"+ content-class="w-44"+ :match-trigger-width="false"+ @update:open="(value: boolean) => handleQuickDownloadMenuOpenChange(value, cell.recordIndex, cell.valueIndex)"+ @select="(mode: string) => downloadCellBinaryValue(cell.recordIndex, cell.valueIndex, mode as BinaryCellDownloadMode)"+ >+ <template #trigger="{ open, toggle }">+ <button class="flex h-5 w-5 items-center justify-center rounded bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border hover:text-foreground" :title="t('grid.downloadBinaryValue')" :aria-expanded="open" @mousedown.stop @click.stop="toggle"><Download class="h-3 w-3" /></button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end" class="w-44">- <DropdownMenuItem v-for="mode in BINARY_CELL_DOWNLOAD_MODES" :key="mode" @click="downloadCellBinaryValue(cell.recordIndex, cell.valueIndex, mode)">- {{ t(`grid.binaryDownload.${mode}`) }}- </DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>+ </template>+ </LightDropdownMenu><buttonclass="flex h-5 w-5 items-center justify-center rounded bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border hover:text-foreground":title="t('grid.cellDetails')"@@ -6735,29 +6770,31 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {<ArrowDown v-else-if="sortCol === col.name && sortColIndex === col.actualColIdx && sortDir === 'desc'" class="h-3 w-3 shrink-0" /><ArrowUpDown v-else class="h-3 w-3 shrink-0" /></button>- <DropdownMenu v-if="compactColumnHeaderActions" :open="headerActionMenuOpenColumn === col.actualColIdx" @update:open="(value: boolean) => (headerActionMenuOpenColumn = value ? col.actualColIdx : null)">- <DropdownMenuTrigger as-child>+ <LightDropdownMenu+ v-if="compactColumnHeaderActions"+ :items="compactColumnActionMenuItems(col.name)"+ :open="headerActionMenuOpenColumn === col.actualColIdx"+ align="end"+ content-class="w-max min-w-28 max-w-48 p-0.5"+ item-class="gap-1 px-1.5 py-0.5 text-xs"+ item-icon-class="h-3 w-3"+ :match-trigger-width="false"+ @update:open="(value: boolean) => (headerActionMenuOpenColumn = value ? col.actualColIdx : null)"+ @select="(value: string) => selectCompactColumnAction(value, col.actualColIdx)"+ >+ <template #trigger="{ open, toggle }"><buttontype="button"class="flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-gray-200 dark:hover:bg-gray-800 hover:text-foreground":class="columnHasFormatter(col.actualColIdx) || localFilterActive(col.actualColIdx) ? 'text-primary opacity-90' : 'opacity-80'":title="t('grid.columnActions')"- @click.stop+ :aria-expanded="open"+ @click.stop="toggle"><ChevronDown class="h-3 w-3" /></button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end" class="w-max min-w-28 max-w-48 p-0.5" @click.stop @keydown.stop>- <DropdownMenuItem class="gap-1 px-1.5 py-0.5 text-xs" :disabled="!formatterKeyForColumn(col.name)" @select.prevent="openCompactColumnFormatter(col.actualColIdx)">- <Code2 class="h-3 w-3" />- {{ t("grid.columnFormatter") }}- </DropdownMenuItem>- <DropdownMenuItem class="gap-1 px-1.5 py-0.5 text-xs" @select.prevent="openCompactLocalFilter(col.actualColIdx)">- <Filter class="h-3 w-3" />- {{ t("grid.localFilter") }}- </DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>+ </template>+ </LightDropdownMenu><Popover :open="formatterOpenColumn === col.actualColIdx" @update:open="(value: boolean) => handleColumnFormatterOpenChange(value, col.actualColIdx)"><PopoverAnchor v-if="compactColumnHeaderActions" as-child><span class="pointer-events-none absolute right-3 top-1/2 h-px w-px -translate-y-1/2" />@@ -7052,22 +7089,22 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {/></div><div v-if="canvasDetailButtonCell" class="absolute pointer-events-auto z-20 flex items-center gap-1" :style="canvasDetailButtonStyle" @mouseenter="keepCanvasDetailHover" @mouseleave="clearCanvasDetailHover">- <DropdownMenu+ <LightDropdownMenuv-if="canvasDetailButtonCell.canQuickDownload"+ :items="binaryCellDownloadMenuItems":open="quickDownloadMenuOpenFor(canvasDetailButtonCell.rowIndex, canvasDetailButtonCell.actualColIdx)"+ align="end"+ content-class="w-44"+ :match-trigger-width="false"@update:open="(value: boolean) => handleQuickDownloadMenuOpenChange(value, canvasDetailButtonCell!.rowIndex, canvasDetailButtonCell!.actualColIdx)"+ @select="(mode: string) => downloadCellBinaryValue(canvasDetailButtonCell!.rowIndex, canvasDetailButtonCell!.actualColIdx, mode as BinaryCellDownloadMode)">- <DropdownMenuTrigger as-child>- <button class="flex h-5 w-5 items-center justify-center rounded bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border hover:text-foreground" :title="t('grid.downloadBinaryValue')" @mousedown.stop @click.stop>+ <template #trigger="{ open, toggle }">+ <button class="flex h-5 w-5 items-center justify-center rounded bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border hover:text-foreground" :title="t('grid.downloadBinaryValue')" :aria-expanded="open" @mousedown.stop @click.stop="toggle"><Download class="h-3 w-3" /></button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end" class="w-44">- <DropdownMenuItem v-for="mode in BINARY_CELL_DOWNLOAD_MODES" :key="mode" @click="downloadCellBinaryValue(canvasDetailButtonCell.rowIndex, canvasDetailButtonCell.actualColIdx, mode)">- {{ t(`grid.binaryDownload.${mode}`) }}- </DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>+ </template>+ </LightDropdownMenu><buttonclass="flex h-5 w-5 items-center justify-center rounded bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border hover:text-foreground":title="t('grid.cellDetails')"@@ -7164,18 +7201,22 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {<template v-else>{{ formatCellCached(item.data[col.actualColIdx], col.actualColIdx) }}<div v-if="cellDetailButtonVisible(item.displayIndex, col.actualColIdx)" class="absolute right-0.5 top-0.5 flex items-center gap-1">- <DropdownMenu v-if="canQuickDownloadCellValue(item.displayIndex, col.actualColIdx)" :open="quickDownloadMenuOpenFor(item.displayIndex, col.actualColIdx)" @update:open="(value: boolean) => handleQuickDownloadMenuOpenChange(value, item.displayIndex, col.actualColIdx)">- <DropdownMenuTrigger as-child>- <button class="flex h-5 w-5 items-center justify-center rounded bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border hover:text-foreground" :title="t('grid.downloadBinaryValue')" @mousedown.stop @click.stop>+ <LightDropdownMenu+ v-if="canQuickDownloadCellValue(item.displayIndex, col.actualColIdx)"+ :items="binaryCellDownloadMenuItems"+ :open="quickDownloadMenuOpenFor(item.displayIndex, col.actualColIdx)"+ align="end"+ content-class="w-44"+ :match-trigger-width="false"+ @update:open="(value: boolean) => handleQuickDownloadMenuOpenChange(value, item.displayIndex, col.actualColIdx)"+ @select="(mode: string) => downloadCellBinaryValue(item.displayIndex, col.actualColIdx, mode as BinaryCellDownloadMode)"+ >+ <template #trigger="{ open, toggle }">+ <button class="flex h-5 w-5 items-center justify-center rounded bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border hover:text-foreground" :title="t('grid.downloadBinaryValue')" :aria-expanded="open" @mousedown.stop @click.stop="toggle"><Download class="h-3 w-3" /></button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end" class="w-44">- <DropdownMenuItem v-for="mode in BINARY_CELL_DOWNLOAD_MODES" :key="mode" @click="downloadCellBinaryValue(item.displayIndex, col.actualColIdx, mode)">- {{ t(`grid.binaryDownload.${mode}`) }}- </DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>+ </template>+ </LightDropdownMenu><buttonclass="flex h-5 w-5 items-center justify-center rounded bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border hover:text-foreground":title="t('grid.cellDetails')"diff --git a/apps/desktop/src/components/ui/LightDropdown.vue b/apps/desktop/src/components/ui/LightDropdown.vueindex 84bc84108b..0190fe80ea 100644--- a/apps/desktop/src/components/ui/LightDropdown.vue+++ b/apps/desktop/src/components/ui/LightDropdown.vue@@ -23,6 +23,7 @@ const props = withDefaults(triggerTitle?: string;triggerIcon?: Component;triggerLabel?: string;+ disabled?: boolean;showTriggerLabel?: boolean;showChevron?: boolean;checkPosition?: "left" | "right" | "none";@@ -46,6 +47,7 @@ const props = withDefaults(triggerTitle: undefined,triggerIcon: undefined,triggerLabel: undefined,+ disabled: false,showTriggerLabel: true,showChevron: true,checkPosition: "left",@@ -115,6 +117,7 @@ function fitPositionToViewport() {}function openMenu() {+ if (props.disabled) return;updatePosition();open.value = true;nextTick(fitPositionToViewport);@@ -160,7 +163,7 @@ onBeforeUnmount(close);</script><template>- <button ref="triggerRef" type="button" :class="triggerClass" :title="triggerTitle ?? selectedItem?.title" :aria-label="ariaLabel" :aria-expanded="open" @click="toggle">+ <button ref="triggerRef" type="button" :class="triggerClass" :title="triggerTitle ?? selectedItem?.title" :aria-label="ariaLabel" :aria-expanded="open" :disabled="disabled" @click="toggle"><component :is="triggerIcon" v-if="triggerIcon" :class="triggerIconClass" /><span v-if="showTriggerLabel">{{ triggerLabel ?? selectedItem?.label }}</span><ChevronDown v-if="showChevron" class="h-3 w-3 opacity-50" />diff --git a/apps/desktop/src/components/ui/LightDropdownMenu.vue b/apps/desktop/src/components/ui/LightDropdownMenu.vuenew file mode 100644index 0000000000..bc2d0db1bf--- /dev/null+++ b/apps/desktop/src/components/ui/LightDropdownMenu.vue@@ -0,0 +1,292 @@+<script setup lang="ts">+import type { Component, HTMLAttributes } from "vue";+import { computed, nextTick, onBeforeUnmount, ref, watch } from "vue";+import { Check, ChevronDown } from "@lucide/vue";+import { cn } from "@/lib/utils";++export interface LightDropdownMenuItem {+ label: string;+ value: string;+ title?: string;+ icon?: Component;+ iconClass?: HTMLAttributes["class"];+ leadingText?: string;+ shortcut?: string;+ disabled?: boolean;+ separatorBefore?: boolean;+ destructive?: boolean;+ checked?: boolean;+ closeOnSelect?: boolean;+ onSelect?: () => void;+}++const props = withDefaults(+ defineProps<{+ items: LightDropdownMenuItem[];+ ariaLabel?: string;+ label?: string;+ triggerLabel?: string;+ triggerTitle?: string;+ triggerIcon?: Component;+ showTriggerLabel?: boolean;+ showChevron?: boolean;+ disabled?: boolean;+ open?: boolean;+ selectedValue?: string;+ selectedValues?: string[];+ checkPosition?: "left" | "right" | "none";+ align?: "start" | "end";+ side?: "top" | "bottom";+ sideOffset?: number;+ matchTriggerWidth?: boolean;+ closeOnSelect?: boolean;+ triggerClass?: HTMLAttributes["class"];+ triggerIconClass?: HTMLAttributes["class"];+ contentClass?: HTMLAttributes["class"];+ labelClass?: HTMLAttributes["class"];+ itemClass?: HTMLAttributes["class"];+ itemIconClass?: HTMLAttributes["class"];+ selectedItemClass?: HTMLAttributes["class"];+ selectedCheckClass?: HTMLAttributes["class"];+ }>(),+ {+ ariaLabel: undefined,+ label: undefined,+ triggerLabel: undefined,+ triggerTitle: undefined,+ triggerIcon: undefined,+ showTriggerLabel: true,+ showChevron: true,+ disabled: false,+ open: undefined,+ selectedValue: undefined,+ selectedValues: undefined,+ checkPosition: "left",+ align: "start",+ side: "bottom",+ sideOffset: 4,+ matchTriggerWidth: true,+ closeOnSelect: true,+ triggerClass: "flex h-6 items-center gap-1 rounded-full border border-border bg-background px-2 text-[11px] text-muted-foreground hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50 aria-expanded:bg-muted aria-expanded:text-foreground",+ triggerIconClass: "h-3 w-3",+ contentClass: "",+ labelClass: "",+ itemClass: "",+ itemIconClass: "h-3.5 w-3.5",+ selectedItemClass: "bg-accent",+ selectedCheckClass: "",+ },+);++const emit = defineEmits<{+ select: [value: string, item: LightDropdownMenuItem];+ "update:open": [open: boolean];+}>();++const triggerRef = ref<HTMLElement>();+const menuRef = ref<HTMLElement>();+const internalOpen = ref(false);+const x = ref(0);+const y = ref(0);+const minWidth = ref(0);++const isOpen = computed(() => props.open ?? internalOpen.value);++const menuStyle = computed(() => ({+ left: `${x.value}px`,+ top: `${y.value}px`,+ minWidth: props.matchTriggerWidth ? `${minWidth.value}px` : undefined,+ "--reka-dropdown-menu-trigger-width": `${minWidth.value}px`,+ "--reka-dropdown-menu-content-available-height": "calc(100vh - 16px)",+}));++function setOpen(value: boolean) {+ if (props.open === undefined) {+ internalOpen.value = value;+ }+ emit("update:open", value);+}++function removeMenuListeners() {+ document.removeEventListener("pointerdown", onOutsidePointerDown, true);+ document.removeEventListener("keydown", onKeydown);+ window.removeEventListener("scroll", close, true);+ window.removeEventListener("resize", close);+}++function close() {+ setOpen(false);+ removeMenuListeners();+}++function updatePosition() {+ const trigger = triggerRef.value;+ if (!trigger) return;++ const rect = trigger.getBoundingClientRect();+ x.value = Math.min(Math.max(8, rect.left), window.innerWidth - 8);+ y.value = props.side === "top" ? rect.top - props.sideOffset : rect.bottom + props.sideOffset;+ minWidth.value = rect.width;+}++function fitPositionToViewport() {+ const trigger = triggerRef.value;+ const menu = menuRef.value;+ if (!trigger || !menu) return;++ const triggerRect = trigger.getBoundingClientRect();+ const menuRect = menu.getBoundingClientRect();+ const margin = 8;+ const preferredX = props.align === "end" ? triggerRect.right - menuRect.width : triggerRect.left;+ const belowY = triggerRect.bottom + props.sideOffset;+ const aboveY = triggerRect.top - menuRect.height - props.sideOffset;+ const fitsBelow = belowY + menuRect.height <= window.innerHeight - margin;+ const fitsAbove = aboveY >= margin;++ x.value = Math.min(Math.max(margin, preferredX), Math.max(margin, window.innerWidth - menuRect.width - margin));+ y.value = props.side === "top" && fitsAbove ? aboveY : props.side === "bottom" && fitsBelow ? belowY : fitsBelow ? belowY : Math.max(margin, aboveY);+}++function openMenu() {+ if (props.disabled) return;+ updatePosition();+ setOpen(true);+ nextTick(fitPositionToViewport);+ document.addEventListener("pointerdown", onOutsidePointerDown, true);+ document.addEventListener("keydown", onKeydown);+ window.addEventListener("scroll", close, true);+ window.addEventListener("resize", close);+}++function toggle() {+ if (isOpen.value) {+ close();+ } else {+ openMenu();+ }+}++function onOutsidePointerDown(event: PointerEvent) {+ const target = event.target as Node;+ if (triggerRef.value?.contains(target) || menuRef.value?.contains(target)) return;+ close();+}++function onKeydown(event: KeyboardEvent) {+ if (event.key === "Escape") {+ event.preventDefault();+ close();+ } else if (event.key === "ArrowDown" || event.key === "ArrowUp") {+ event.preventDefault();+ focusMenuItem(event.key === "ArrowDown" ? 1 : -1);+ } else if (event.key === "Home") {+ event.preventDefault();+ focusFirstMenuItem();+ } else if (event.key === "End") {+ event.preventDefault();+ focusLastMenuItem();+ }+}++function menuItems() {+ return Array.from(menuRef.value?.querySelectorAll<HTMLButtonElement>("[role='menuitem']:not(:disabled)") ?? []);+}++function focusMenuItem(direction: 1 | -1) {+ const items = menuItems();+ if (items.length === 0) return;++ const currentIndex = items.indexOf(document.activeElement as HTMLButtonElement);+ const nextIndex = currentIndex === -1 ? (direction === 1 ? 0 : items.length - 1) : (currentIndex + direction + items.length) % items.length;+ items[nextIndex]?.focus();+}++function focusFirstMenuItem() {+ menuItems()[0]?.focus();+}++function focusLastMenuItem() {+ const items = menuItems();+ items[items.length - 1]?.focus();+}++function itemIsSelected(item: LightDropdownMenuItem) {+ if (item.checked !== undefined) return item.checked;+ if (props.selectedValues) return props.selectedValues.includes(item.value);+ return props.selectedValue === item.value;+}++function selectItem(item: LightDropdownMenuItem) {+ if (item.disabled) return;++ emit("select", item.value, item);+ item.onSelect?.();++ if (item.closeOnSelect ?? props.closeOnSelect) {+ close();+ }+}++onBeforeUnmount(close);++watch(+ () => props.open,+ (value) => {+ if (value === false) {+ removeMenuListeners();+ }+ },+);+</script>++<template>+ <span ref="triggerRef" class="inline-flex min-w-0" @click="toggle">+ <slot name="trigger" :open="isOpen" :toggle="toggle" :disabled="disabled">+ <button type="button" :class="triggerClass" :title="triggerTitle" :aria-label="ariaLabel" :aria-expanded="isOpen" :disabled="disabled">+ <component :is="triggerIcon" v-if="triggerIcon" :class="triggerIconClass" />+ <span v-if="showTriggerLabel && triggerLabel" class="truncate">{{ triggerLabel }}</span>+ <ChevronDown v-if="showChevron" class="h-3 w-3 shrink-0 opacity-50" />+ </button>+ </slot>+ </span>+ <Teleport to="body">+ <div+ v-if="isOpen"+ ref="menuRef"+ class="ring-foreground/10 fixed z-50 max-h-(--reka-dropdown-menu-content-available-height) min-w-32 overflow-x-hidden overflow-y-auto rounded-lg p-1 ring-1 cn-menu-translucent text-popover-foreground"+ :class="cn(matchTriggerWidth ? 'w-(--reka-dropdown-menu-trigger-width)' : '', contentClass)"+ :style="menuStyle"+ role="menu"+ >+ <div v-if="label" :class="cn('text-muted-foreground px-1.5 py-1 text-xs font-medium', labelClass)">{{ label }}</div>+ <div v-if="label" class="bg-border -mx-1 my-1 h-px" />+ <slot name="before-items" />+ <template v-for="item in items" :key="item.value">+ <div v-if="item.separatorBefore" class="bg-border -mx-1 my-1 h-px" />+ <slot name="item" :item="item" :selected="itemIsSelected(item)" :select="selectItem">+ <button+ type="button"+ class="group/dropdown-menu-item relative flex w-full cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-left text-sm outline-hidden hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4"+ :class="+ cn(item.destructive ? 'text-destructive hover:bg-destructive/10 hover:text-destructive focus:bg-destructive/10 focus:text-destructive dark:hover:bg-destructive/20 dark:focus:bg-destructive/20 [&_svg]:text-destructive' : '', itemIsSelected(item) ? selectedItemClass : '', itemClass)+ "+ :disabled="item.disabled"+ :title="item.title"+ role="menuitem"+ @click="selectItem(item)"+ >+ <Check v-if="checkPosition === 'left'" class="h-3 w-3 shrink-0" :class="itemIsSelected(item) ? selectedCheckClass : 'opacity-0'" />+ <span v-if="item.leadingText" class="inline-flex h-5 w-6 shrink-0 items-center justify-center text-sm font-medium leading-none">+ {{ item.leadingText }}+ </span>+ <component :is="item.icon" v-if="item.icon" :class="cn('shrink-0 text-muted-foreground', itemIconClass, item.iconClass)" />+ <span class="min-w-0 flex-1 truncate">{{ item.label }}</span>+ <span v-if="item.shortcut" class="ml-4 shrink-0 text-xs text-muted-foreground">{{ item.shortcut }}</span>+ <Check v-if="checkPosition === 'right' && itemIsSelected(item)" class="ml-auto h-4 w-4 shrink-0" :class="selectedCheckClass" />+ </button>+ </slot>+ </template>+ <slot />+ </div>+ </Teleport>+</template>