Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin into antdv-next

This commit is contained in:
dap
2026-03-23 13:34:03 +08:00
4 changed files with 149 additions and 17 deletions

View File

@@ -109,6 +109,90 @@
color-scheme: light; color-scheme: light;
} }
.light,
.light[data-theme='custom'],
.light[data-theme='default'] {
/* Default background color of <body />...etc */
--background: 0 0% 100%;
/* 主体区域背景色 */
--background-deep: 216 20.11% 95.47%;
--foreground: 210 6% 21%;
/* Background color for <Card /> */
--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;
/* Background color for popovers such as <DropdownMenu />, <HoverCard />, <Popover /> */
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
/* Muted backgrounds such as <TabsList />, <Skeleton /> and <Switch /> */
--muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;
/* 主题颜色 */
--primary-foreground: 0 0% 98%;
/* Used for destructive actions such as <Button variant="destructive"> */
--destructive-foreground: 0 0% 98%;
/* Used for success actions such as <message> */
--info-foreground: 220, 4%, 58%;
--success-foreground: 0 0% 98%;
/* Used for warning actions such as <message> */
--warning-foreground: 0 0% 98%;
/* Secondary colors for <Button /> */
--secondary: 240 5% 96%;
--secondary-foreground: 240 6% 10%;
/* Used for accents such as hover effects on <DropdownMenuItem>, <SelectItem>...etc */
--accent: 240 5% 96%;
--accent-dark: 216 14% 93%;
--accent-darker: 216 11% 91%;
--accent-lighter: 240 0% 98%;
--accent-hover: 200deg 10% 90%;
--accent-foreground: 240 6% 10%;
/* Darker color */
--heavy: 192deg 9.43% 89.61%;
--heavy-foreground: var(--accent-foreground);
/* Default border color */
--border: 240 5.9% 90%;
/* Border color for inputs such as <Input />, <Select />, <Textarea /> */
--input: 240deg 5.88% 90%;
--input-placeholder: 217 10.6% 65%;
--input-background: 0 0% 100%;
/* Used for focus ring */
--ring: 222.2 84% 4.9%;
/* ============= custom ============= */
/* 遮罩颜色 */
--overlay: 0 0% 0% / 45%;
--overlay-content: 0 0% 95% / 45%;
/* =============component & UI============= */
/* menu */
--sidebar: 0 0% 100%;
--sidebar-deep: 0 0% 100%;
--menu: var(--sidebar);
/* header */
--header: 0 0% 100%;
accent-color: var(--primary);
color-scheme: light;
}
.light[data-theme='violet'],
[data-theme='violet'] .light,
[data-theme='violet'] { [data-theme='violet'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 224 71.4% 4.1%; --foreground: 224 71.4% 4.1%;
@@ -130,6 +214,8 @@
--ring: 262.1 83.3% 57.8%; --ring: 262.1 83.3% 57.8%;
} }
.light[data-theme='pink'],
[data-theme='pink'] .light,
[data-theme='pink'] { [data-theme='pink'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 240 10% 3.9%; --foreground: 240 10% 3.9%;
@@ -151,6 +237,8 @@
--ring: 346.8 77.2% 49.8%; --ring: 346.8 77.2% 49.8%;
} }
.light[data-theme='rose'],
[data-theme='rose'] .light,
[data-theme='rose'] { [data-theme='rose'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 240 10% 3.9%; --foreground: 240 10% 3.9%;
@@ -172,6 +260,8 @@
--ring: 346.8 77.2% 49.8%; --ring: 346.8 77.2% 49.8%;
} }
.light[data-theme='sky-blue'],
[data-theme='sky-blue'] .light,
[data-theme='sky-blue'] { [data-theme='sky-blue'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 222.2 84% 4.9%; --foreground: 222.2 84% 4.9%;
@@ -193,6 +283,8 @@
--ring: 221.2 83.2% 53.3%; --ring: 221.2 83.2% 53.3%;
} }
.light[data-theme='deep-blue'],
[data-theme='deep-blue'] .light,
[data-theme='deep-blue'] { [data-theme='deep-blue'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 222.2 84% 4.9%; --foreground: 222.2 84% 4.9%;
@@ -214,6 +306,8 @@
--ring: 221.2 83.2% 53.3%; --ring: 221.2 83.2% 53.3%;
} }
.light[data-theme='green'],
[data-theme='green'] .light,
[data-theme='green'] { [data-theme='green'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 240 10% 3.9%; --foreground: 240 10% 3.9%;
@@ -235,6 +329,8 @@
--ring: 142.1 76.2% 36.3%; --ring: 142.1 76.2% 36.3%;
} }
.light[data-theme='deep-green'],
[data-theme='deep-green'] .light,
[data-theme='deep-green'] { [data-theme='deep-green'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 240 10% 3.9%; --foreground: 240 10% 3.9%;
@@ -256,6 +352,8 @@
--ring: 142.1 76.2% 36.3%; --ring: 142.1 76.2% 36.3%;
} }
.light[data-theme='orange'],
[data-theme='orange'] .light,
[data-theme='orange'] { [data-theme='orange'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 20 14.3% 4.1%; --foreground: 20 14.3% 4.1%;
@@ -277,6 +375,8 @@
--ring: 24.6 95% 53.1%; --ring: 24.6 95% 53.1%;
} }
.light[data-theme='yellow'],
[data-theme='yellow'] .light,
[data-theme='yellow'] { [data-theme='yellow'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 20 14.3% 4.1%; --foreground: 20 14.3% 4.1%;
@@ -298,6 +398,8 @@
--ring: 20 14.3% 4.1%; --ring: 20 14.3% 4.1%;
} }
.light[data-theme='zinc'],
[data-theme='zinc'] .light,
[data-theme='zinc'] { [data-theme='zinc'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 240 10% 3.9%; --foreground: 240 10% 3.9%;
@@ -319,6 +421,8 @@
--ring: 240 5.9% 10%; --ring: 240 5.9% 10%;
} }
.light[data-theme='neutral'],
[data-theme='neutral'] .light,
[data-theme='neutral'] { [data-theme='neutral'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 0 0% 3.9%; --foreground: 0 0% 3.9%;
@@ -340,6 +444,8 @@
--ring: 0 0% 3.9%; --ring: 0 0% 3.9%;
} }
.light[data-theme='slate'],
[data-theme='slate'] .light,
[data-theme='slate'] { [data-theme='slate'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 222.2 84% 4.9%; --foreground: 222.2 84% 4.9%;
@@ -361,6 +467,8 @@
--ring: 222.2 84% 4.9%; --ring: 222.2 84% 4.9%;
} }
.light[data-theme='gray'],
[data-theme='gray'] .light,
[data-theme='gray'] { [data-theme='gray'] {
/* --background: 0 0% 100%; */ /* --background: 0 0% 100%; */
--foreground: 224 71.4% 4.1%; --foreground: 224 71.4% 4.1%;

View File

@@ -5,6 +5,7 @@ import { computed, onBeforeUnmount, onMounted, reactive, useSlots } from 'vue';
import { useNamespace } from '@vben-core/composables'; import { useNamespace } from '@vben-core/composables';
import { VbenIcon, VbenTooltip } from '@vben-core/shadcn-ui'; import { VbenIcon, VbenTooltip } from '@vben-core/shadcn-ui';
import { isHttpUrl } from '@vben-core/shared/utils';
import qs from 'qs'; import qs from 'qs';
@@ -29,12 +30,21 @@ const subMenu = useSubMenuContext();
const { parentMenu, parentPaths } = useMenu(); const { parentMenu, parentPaths } = useMenu();
const active = computed(() => props.path === rootMenu?.activePath); const active = computed(() => props.path === rootMenu?.activePath);
const menuIcon = computed(() => (active.value ? props.activeIcon || props.icon : props.icon)); const menuIcon = computed(() =>
active.value ? props.activeIcon || props.icon : props.icon,
);
const isTopLevelMenuItem = computed(() => parentMenu.value?.type.name === 'Menu'); const isHttp = computed(() => isHttpUrl(item.parentPaths.at(-1)));
const isTopLevelMenuItem = computed(
() => parentMenu.value?.type.name === 'Menu',
);
const collapseShowTitle = computed( const collapseShowTitle = computed(
() => rootMenu.props?.collapseShowTitle && isTopLevelMenuItem.value && rootMenu.props.collapse, () =>
rootMenu.props?.collapseShowTitle &&
isTopLevelMenuItem.value &&
rootMenu.props.collapse,
); );
const showTooltip = computed( const showTooltip = computed(
@@ -77,11 +87,16 @@ onBeforeUnmount(() => {
}); });
</script> </script>
<template> <template>
<a <router-link
:href="(item.parentPaths.at(-1) ?? '') + (item?.query ? `?${qs.stringify(item?.query)}` : '')" v-slot="{ href }"
@click.prevent.stop="handleClick" custom
:to="
(item.parentPaths.at(-1) ?? '') +
(item?.query ? `?${qs.stringify(item?.query)}` : '')
"
> >
<li <a
:href="isHttp ? item.parentPaths.at(-1) : href"
:class="[ :class="[
rootMenu.theme, rootMenu.theme,
b(), b(),
@@ -90,9 +105,13 @@ onBeforeUnmount(() => {
is('collapse-show-title', collapseShowTitle), is('collapse-show-title', collapseShowTitle),
]" ]"
role="menuitem" role="menuitem"
@click.prevent.stop="handleClick"
> >
<!-- --> <VbenTooltip
<VbenTooltip v-if="showTooltip" :content-class="[rootMenu.theme]" side="right"> v-if="showTooltip"
:content-class="[rootMenu.theme]"
side="right"
>
<template #trigger> <template #trigger>
<div :class="[nsMenu.be('tooltip', 'trigger')]"> <div :class="[nsMenu.be('tooltip', 'trigger')]">
<VbenIcon :class="nsMenu.e('icon')" :icon="menuIcon" fallback /> <VbenIcon :class="nsMenu.e('icon')" :icon="menuIcon" fallback />
@@ -105,11 +124,15 @@ onBeforeUnmount(() => {
<slot name="title"></slot> <slot name="title"></slot>
</VbenTooltip> </VbenTooltip>
<div v-show="!showTooltip" :class="[e('content')]"> <div v-show="!showTooltip" :class="[e('content')]">
<MenuBadge v-if="rootMenu.props.mode !== 'horizontal'" class="right-2" v-bind="props" /> <MenuBadge
v-if="rootMenu.props.mode !== 'horizontal'"
class="right-2"
v-bind="props"
/>
<VbenIcon :class="nsMenu.e('icon')" :icon="menuIcon" /> <VbenIcon :class="nsMenu.e('icon')" :icon="menuIcon" />
<slot></slot> <slot></slot>
<slot name="title"></slot> <slot name="title"></slot>
</div> </div>
</li> </a>
</a> </router-link>
</template> </template>

View File

@@ -373,7 +373,7 @@ const headerSlots = computed(() => {
v-if="preferences.logo.enable" v-if="preferences.logo.enable"
:fit="preferences.logo.fit" :fit="preferences.logo.fit"
:text="preferences.app.name" :text="preferences.app.name"
:theme="theme" :theme="sidebarThemeSub"
> >
<template v-if="$slots['logo-text']" #text> <template v-if="$slots['logo-text']" #text>
<slot name="logo-text"></slot> <slot name="logo-text"></slot>

View File

@@ -10,7 +10,8 @@ packages:
- packages/business/* - packages/business/*
- apps/* - apps/*
- scripts/* - scripts/*
- docs
- playground
overrides: overrides:
'@ast-grep/napi': 'catalog:' '@ast-grep/napi': 'catalog:'
'@ctrl/tinycolor': 'catalog:' '@ctrl/tinycolor': 'catalog:'
@@ -128,7 +129,7 @@ catalog:
ora: ^9.3.0 ora: ^9.3.0
oxfmt: ^0.41.0 oxfmt: ^0.41.0
oxlint: ^1.56.0 oxlint: ^1.56.0
oxlint-tsgolint: ^0.17.0 oxlint-tsgolint: ^0.17.1
pinia: ^3.0.4 pinia: ^3.0.4
pinia-plugin-persistedstate: ^4.7.1 pinia-plugin-persistedstate: ^4.7.1
pkg-types: ^2.3.0 pkg-types: ^2.3.0
@@ -161,7 +162,7 @@ catalog:
tinymce: 7.9.1 tinymce: 7.9.1
tippy.js: ^6.3.7 tippy.js: ^6.3.7
tsdown: ^0.21.4 tsdown: ^0.21.4
turbo: ^2.8.19 turbo: ^2.8.20
tw-animate-css: ^1.4.0 tw-animate-css: ^1.4.0
typescript: ^5.9.3 typescript: ^5.9.3
unplugin-dts: ^1.0.0-beta.6 unplugin-dts: ^1.0.0-beta.6
@@ -170,7 +171,7 @@ catalog:
vditor: 3.10.9 vditor: 3.10.9
vee-validate: ^4.15.1 vee-validate: ^4.15.1
version-polling: ^1.3.3 version-polling: ^1.3.3
vite: ^8.0.0 vite: ^8.0.1
vite-plugin-compression: ^0.5.1 vite-plugin-compression: ^0.5.1
vite-plugin-html: ^3.2.2 vite-plugin-html: ^3.2.2
vite-plugin-lazy-import: ^1.0.7 vite-plugin-lazy-import: ^1.0.7