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

This commit is contained in:
dap
2026-02-03 10:30:21 +08:00
13 changed files with 62 additions and 47 deletions

View File

@@ -1 +1 @@
22.1.0 22.22.0

View File

@@ -181,7 +181,8 @@
"markdown", "markdown",
"json", "json",
"jsonc", "jsonc",
"json5" "json5",
"yaml"
], ],
"tailwindCSS.experimental.classRegex": [ "tailwindCSS.experimental.classRegex": [

View File

@@ -92,5 +92,5 @@
"node": ">=20.19.0", "node": ">=20.19.0",
"pnpm": ">=10.0.0" "pnpm": ">=10.0.0"
}, },
"packageManager": "pnpm@10.28.1" "packageManager": "pnpm@10.28.2"
} }

View File

@@ -6,12 +6,30 @@ import type {
import { computed, ref, watch } from 'vue'; import { computed, ref, watch } from 'vue';
import { isBoolean, isFunction } from '@vben-core/shared/utils'; import { get, isBoolean, isFunction } from '@vben-core/shared/utils';
import { useFormValues } from 'vee-validate'; import { useFormValues } from 'vee-validate';
import { injectRenderFormProps } from './context'; import { injectRenderFormProps } from './context';
/**
* 解析Nested Objects对应的字段值
* @param values 表单值
* @param fieldName 字段名
*/
function resolveValueByFieldName(
values: Record<string, any>,
fieldName: string,
) {
// vee-validate[] 表示禁用嵌套
if (fieldName.startsWith('[') && fieldName.endsWith(']')) {
const rawKey = fieldName.slice(1, -1);
return values[rawKey];
}
return get(values, fieldName);
}
export default function useDependencies( export default function useDependencies(
getDependencies: () => FormItemDependencies | undefined, getDependencies: () => FormItemDependencies | undefined,
) { ) {
@@ -37,7 +55,7 @@ export default function useDependencies(
// 该字段可能会被多个字段触发 // 该字段可能会被多个字段触发
const triggerFields = getDependencies()?.triggerFields ?? []; const triggerFields = getDependencies()?.triggerFields ?? [];
return triggerFields.map((dep) => { return triggerFields.map((dep) => {
return values.value[dep]; return resolveValueByFieldName(values.value, dep);
}); });
}); });

View File

@@ -53,6 +53,7 @@ const wrapperClass = computed(() => {
provideFormRenderProps(props); provideFormRenderProps(props);
// @ts-expect-error unused
const { isCalculated, keepFormItemIndex, wrapperRef } = useExpandable(props); const { isCalculated, keepFormItemIndex, wrapperRef } = useExpandable(props);
const shapes = computed(() => { const shapes = computed(() => {

View File

@@ -26,8 +26,8 @@ interface Props {
const props = withDefaults(defineProps<Props>(), {}); const props = withDefaults(defineProps<Props>(), {});
const { contentElement: _contentElement, overlayStyle } = // @ts-expect-error unused
useLayoutContentStyle(); const { contentElement, overlayStyle } = useLayoutContentStyle();
const style = computed((): CSSProperties => { const style = computed((): CSSProperties => {
const { const {
@@ -56,11 +56,7 @@ const style = computed((): CSSProperties => {
</script> </script>
<template> <template>
<main <main ref="contentElement" :style="style" class="relative bg-background-deep">
ref="_contentElement"
:style="style"
class="relative bg-background-deep"
>
<Slot :style="overlayStyle"> <Slot :style="overlayStyle">
<slot name="overlay"></slot> <slot name="overlay"></slot>
</Slot> </Slot>

View File

@@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { CSSProperties } from 'vue'; import type { CSSProperties } from 'vue';
import { computed, useSlots, watchEffect } from 'vue'; import { computed, shallowRef, useSlots, watchEffect } from 'vue';
import { VbenScrollbar } from '@vben-core/shadcn-ui'; import { VbenScrollbar } from '@vben-core/shadcn-ui';
@@ -114,7 +114,8 @@ const extraVisible = defineModel<boolean>('extraVisible');
const isLocked = useScrollLock(document.body); const isLocked = useScrollLock(document.body);
const slots = useSlots(); const slots = useSlots();
// const asideRef = shallowRef<HTMLDivElement | null>(); // @ts-expect-error unused
const asideRef = shallowRef<HTMLDivElement | null>();
const hiddenSideStyle = computed((): CSSProperties => calcMenuWidthStyle(true)); const hiddenSideStyle = computed((): CSSProperties => calcMenuWidthStyle(true));
@@ -290,6 +291,7 @@ function handleMouseleave() {
/> />
<div <div
v-if="isSidebarMixed" v-if="isSidebarMixed"
ref="asideRef"
:class="{ :class="{
'border-l': extraVisible, 'border-l': extraVisible,
}" }"

View File

@@ -54,7 +54,8 @@ const components = globalShareState.getComponents();
const id = useId(); const id = useId();
provide('DISMISSABLE_DRAWER_ID', id); provide('DISMISSABLE_DRAWER_ID', id);
// const wrapperRef = ref<HTMLElement>(); // @ts-expect-error unused
const wrapperRef = ref<HTMLElement>();
const { $t } = useSimpleLocale(); const { $t } = useSimpleLocale();
const { isMobile } = useIsMobile(); const { isMobile } = useIsMobile();
@@ -282,6 +283,7 @@ const getForceMount = computed(() => {
</VisuallyHidden> </VisuallyHidden>
</template> </template>
<div <div
ref="wrapperRef"
:class=" :class="
cn('relative flex-1 overflow-y-auto p-3', contentClass, { cn('relative flex-1 overflow-y-auto p-3', contentClass, {
'pointer-events-none': showLoading || submitting, 'pointer-events-none': showLoading || submitting,

View File

@@ -50,10 +50,12 @@ const props = withDefaults(defineProps<Props>(), {
const components = globalShareState.getComponents(); const components = globalShareState.getComponents();
const contentRef = ref(); const contentRef = ref();
// const wrapperRef = ref<HTMLElement>(); // @ts-expect-error unused
const wrapperRef = ref<HTMLElement>();
const dialogRef = ref(); const dialogRef = ref();
const headerRef = ref(); const headerRef = ref();
// const footerRef = ref(); // @ts-expect-error unused
const footerRef = ref();
const id = useId(); const id = useId();
@@ -306,6 +308,7 @@ function handleClosed() {
</VisuallyHidden> </VisuallyHidden>
</DialogHeader> </DialogHeader>
<div <div
ref="wrapperRef"
:class=" :class="
cn('relative min-h-40 flex-1 overflow-y-auto p-3', contentClass, { cn('relative min-h-40 flex-1 overflow-y-auto p-3', contentClass, {
'pointer-events-none': showLoading || submitting, 'pointer-events-none': showLoading || submitting,
@@ -325,6 +328,7 @@ function handleClosed() {
</VbenIconButton> </VbenIconButton>
<DialogFooter <DialogFooter
ref="footerRef"
v-if="showFooter" v-if="showFooter"
:class=" :class="
cn( cn(

View File

@@ -97,6 +97,7 @@ export function useVbenModal<TParentModalProps extends ModalProps = ModalProps>(
mergedOptions.onClosed = () => { mergedOptions.onClosed = () => {
onClosed?.(); onClosed?.();
if (mergedOptions.destroyOnClose) { if (mergedOptions.destroyOnClose) {
injectData.consumed = false;
injectData.reCreateModal?.(); injectData.reCreateModal?.();
} }
}; };

View File

@@ -3,7 +3,7 @@ import type { TabDefinition } from '@vben-core/typings';
import type { TabConfig, TabsProps } from '../../types'; import type { TabConfig, TabsProps } from '../../types';
import { computed } from 'vue'; import { computed, ref } from 'vue';
import { Pin, X } from '@vben-core/icons'; import { Pin, X } from '@vben-core/icons';
import { VbenContextMenu, VbenIcon } from '@vben-core/shadcn-ui'; import { VbenContextMenu, VbenIcon } from '@vben-core/shadcn-ui';
@@ -28,8 +28,10 @@ const emit = defineEmits<{
}>(); }>();
const active = defineModel<string>('active'); const active = defineModel<string>('active');
// const contentRef = ref(); // @ts-expect-error unused
// const tabRef = ref(); const contentRef = ref();
// @ts-expect-error unused
const tabRef = ref();
const style = computed(() => { const style = computed(() => {
const { gap } = props; const { gap } = props;
@@ -73,6 +75,7 @@ function onMouseDown(e: MouseEvent, tab: TabConfig) {
<template> <template>
<div <div
ref="contentRef"
:class="contentClass" :class="contentClass"
:style="style" :style="style"
class="tabs-chrome !flex h-full w-max overflow-y-hidden pr-6" class="tabs-chrome !flex h-full w-max overflow-y-hidden pr-6"
@@ -81,6 +84,7 @@ function onMouseDown(e: MouseEvent, tab: TabConfig) {
<div <div
v-for="(tab, i) in tabsView" v-for="(tab, i) in tabsView"
:key="tab.key" :key="tab.key"
ref="tabRef"
:class="[ :class="[
{ {
'is-active': tab.key === active, 'is-active': tab.key === active,

View File

@@ -29,7 +29,8 @@ const forward = useForwardPropsEmits(props, emit);
const { const {
handleScrollAt, handleScrollAt,
handleWheel, handleWheel,
scrollbarRef: _scrollbarRef, // @ts-expect-error unused
scrollbarRef,
scrollDirection, scrollDirection,
scrollIsAtLeft, scrollIsAtLeft,
scrollIsAtRight, scrollIsAtRight,
@@ -69,7 +70,7 @@ useTabsDrag(props, emit);
class="size-full flex-1 overflow-hidden" class="size-full flex-1 overflow-hidden"
> >
<VbenScrollbar <VbenScrollbar
ref="_scrollbarRef" ref="scrollbarRef"
:shadow-bottom="false" :shadow-bottom="false"
:shadow-top="false" :shadow-top="false"
class="h-full" class="h-full"

View File

@@ -33,28 +33,23 @@ catalog:
'@commitlint/config-conventional': ^19.8.1 '@commitlint/config-conventional': ^19.8.1
'@ctrl/tinycolor': ^4.2.0 '@ctrl/tinycolor': ^4.2.0
'@eslint/js': ^9.39.2 '@eslint/js': ^9.39.2
'@faker-js/faker': ^9.9.0 '@iconify/json': ^2.2.432
'@iconify/json': ^2.2.431
'@iconify/tailwind': ^1.2.0 '@iconify/tailwind': ^1.2.0
'@iconify/vue': ^5.0.0 '@iconify/vue': ^5.0.0
'@intlify/core-base': ^11.2.8 '@intlify/core-base': ^11.2.8
'@intlify/unplugin-vue-i18n': ^6.0.8 '@intlify/unplugin-vue-i18n': ^6.0.8
'@jspm/generator': ^2.9.0 '@jspm/generator': ^2.9.0
'@manypkg/get-packages': ^3.1.0 '@manypkg/get-packages': ^3.1.0
'@nolebase/vitepress-plugin-git-changelog': ^2.18.2
'@playwright/test': ^1.58.0 '@playwright/test': ^1.58.0
'@pnpm/workspace.read-manifest': ^1000.2.10 '@pnpm/workspace.read-manifest': ^1000.2.10
'@stylistic/stylelint-plugin': ^4.0.1 '@stylistic/stylelint-plugin': ^4.0.1
'@tailwindcss/nesting': 0.0.0-insiders.565cd3e '@tailwindcss/nesting': 0.0.0-insiders.565cd3e
'@tailwindcss/typography': ^0.5.19 '@tailwindcss/typography': ^0.5.19
'@tanstack/vue-query': ^5.92.8
'@tanstack/vue-store': ^0.8.0 '@tanstack/vue-store': ^0.8.0
'@tinymce/tinymce-vue': ^6.0.1 '@tinymce/tinymce-vue': ^6.0.1
'@types/archiver': ^6.0.4 '@types/archiver': ^6.0.4
'@types/eslint': ^9.6.1 '@types/eslint': ^9.6.1
'@types/html-minifier-terser': ^7.0.2 '@types/html-minifier-terser': ^7.0.2
'@types/json-bigint': ^1.0.4
'@types/jsonwebtoken': ^9.0.10
'@types/lodash-es': ^4.17.12 '@types/lodash-es': ^4.17.12
'@types/lodash.clonedeep': ^4.5.9 '@types/lodash.clonedeep': ^4.5.9
'@types/node': ^24.10.9 '@types/node': ^24.10.9
@@ -63,10 +58,9 @@ catalog:
'@types/qrcode': ^1.5.6 '@types/qrcode': ^1.5.6
'@types/qs': ^6.14.0 '@types/qs': ^6.14.0
'@types/sortablejs': ^1.15.9 '@types/sortablejs': ^1.15.9
'@typescript-eslint/eslint-plugin': ^8.53.1 '@typescript-eslint/eslint-plugin': ^8.54.0
'@typescript-eslint/parser': ^8.53.1 '@typescript-eslint/parser': ^8.54.0
'@vee-validate/zod': ^4.15.1 '@vee-validate/zod': ^4.15.1
'@vite-pwa/vitepress': ^1.1.0
'@vitejs/plugin-vue': ^6.0.3 '@vitejs/plugin-vue': ^6.0.3
'@vitejs/plugin-vue-jsx': ^5.1.3 '@vitejs/plugin-vue-jsx': ^5.1.3
'@vue/shared': ^3.5.27 '@vue/shared': ^3.5.27
@@ -78,11 +72,11 @@ catalog:
antdv-next: 1.0.0-rc.8 antdv-next: 1.0.0-rc.8
archiver: ^7.0.1 archiver: ^7.0.1
autoprefixer: ^10.4.23 autoprefixer: ^10.4.23
axios: ^1.13.2 axios: ^1.13.4
axios-mock-adapter: ^2.1.0 axios-mock-adapter: ^2.1.0
cac: ^6.7.14 cac: ^6.7.14
chalk: ^5.6.2 chalk: ^5.6.2
cheerio: ^1.1.2 cheerio: ^1.2.0
circular-dependency-scanner: ^2.3.0 circular-dependency-scanner: ^2.3.0
class-variance-authority: ^0.7.1 class-variance-authority: ^0.7.1
clsx: ^2.1.1 clsx: ^2.1.1
@@ -90,7 +84,7 @@ catalog:
consola: ^3.4.2 consola: ^3.4.2
cropperjs: ^1.6.2 cropperjs: ^1.6.2
cross-env: ^10.1.0 cross-env: ^10.1.0
cspell: ^9.6.0 cspell: ^9.6.2
cssnano: ^7.1.2 cssnano: ^7.1.2
cz-git: ^1.12.0 cz-git: ^1.12.0
czg: ^1.12.0 czg: ^1.12.0
@@ -99,11 +93,10 @@ catalog:
depcheck: ^1.4.7 depcheck: ^1.4.7
dotenv: ^16.6.1 dotenv: ^16.6.1
echarts: ^6.0.0 echarts: ^6.0.0
element-plus: ^2.13.1
es-toolkit: ^1.44.0 es-toolkit: ^1.44.0
esbuild: ^0.25.12 esbuild: ^0.25.12
eslint: ^9.39.2 eslint: ^9.39.2
eslint-config-turbo: ^2.7.5 eslint-config-turbo: ^2.7.6
eslint-plugin-command: ^3.4.0 eslint-plugin-command: ^3.4.0
eslint-plugin-eslint-comments: ^3.2.0 eslint-plugin-eslint-comments: ^3.2.0
eslint-plugin-import-x: ^4.16.1 eslint-plugin-import-x: ^4.16.1
@@ -124,21 +117,17 @@ catalog:
find-up: ^7.0.0 find-up: ^7.0.0
get-port: ^7.1.0 get-port: ^7.1.0
globals: ^16.5.0 globals: ^16.5.0
h3: ^1.15.5
happy-dom: ^17.6.3 happy-dom: ^17.6.3
html-minifier-terser: ^7.2.0 html-minifier-terser: ^7.2.0
is-ci: ^4.1.0 is-ci: ^4.1.0
jiti: ^2.6.1 jiti: ^2.6.1
json-bigint: ^1.0.0 json-bigint: ^1.0.0
jsonc-eslint-parser: ^2.4.2 jsonc-eslint-parser: ^2.4.2
jsonwebtoken: ^9.0.3
lefthook: ^2.0.15 lefthook: ^2.0.15
lodash-es: ^4.17.21 lodash-es: ^4.17.21
lodash.clonedeep: ^4.5.0 lodash.clonedeep: ^4.5.0
lucide-vue-next: ^0.553.0 lucide-vue-next: ^0.553.0
medium-zoom: ^1.1.0
motion-v: ^1.10.2 motion-v: ^1.10.2
naive-ui: ^2.43.2
nitropack: ^2.13.1 nitropack: ^2.13.1
nprogress: ^0.2.0 nprogress: ^0.2.0
ora: ^8.2.0 ora: ^8.2.0
@@ -160,7 +149,7 @@ catalog:
reka-ui: ^2.7.0 reka-ui: ^2.7.0
resolve.exports: ^2.0.3 resolve.exports: ^2.0.3
rimraf: ^6.1.2 rimraf: ^6.1.2
rollup: ^4.56.0 rollup: ^4.57.0
rollup-plugin-visualizer: ^5.14.0 rollup-plugin-visualizer: ^5.14.0
sass: ^1.97.3 sass: ^1.97.3
secure-ls: ^2.0.0 secure-ls: ^2.0.0
@@ -177,14 +166,12 @@ catalog:
tailwind-merge: ^2.6.0 tailwind-merge: ^2.6.0
tailwindcss: ^3.4.19 tailwindcss: ^3.4.19
tailwindcss-animate: ^1.0.7 tailwindcss-animate: ^1.0.7
tdesign-vue-next: ^1.18.0
theme-colors: ^0.1.0 theme-colors: ^0.1.0
tinymce: 7.9.1 tinymce: 7.9.1
tippy.js: ^6.3.7 tippy.js: ^6.3.7
turbo: ^2.7.6 turbo: ^2.7.6
typescript: ^5.9.3 typescript: ^5.9.3
unbuild: ^3.6.1 unbuild: ^3.6.1
unplugin-element-plus: ^0.11.2
unplugin-vue-components: ^0.27.3 unplugin-vue-components: ^0.27.3
vee-validate: ^4.15.1 vee-validate: ^4.15.1
version-polling: ^1.3.3 version-polling: ^1.3.3
@@ -195,8 +182,6 @@ catalog:
vite-plugin-lazy-import: ^1.0.7 vite-plugin-lazy-import: ^1.0.7
vite-plugin-pwa: ^1.2.0 vite-plugin-pwa: ^1.2.0
vite-plugin-vue-devtools: ^8.0.5 vite-plugin-vue-devtools: ^8.0.5
vitepress: ^1.6.4
vitepress-plugin-group-icons: ^1.7.1
vitest: ^3.2.4 vitest: ^3.2.4
vue: ^3.5.27 vue: ^3.5.27
vue-eslint-parser: ^10.2.0 vue-eslint-parser: ^10.2.0
@@ -204,8 +189,8 @@ catalog:
vue-json-viewer: ^3.0.4 vue-json-viewer: ^3.0.4
vue-router: ^4.6.4 vue-router: ^4.6.4
vue-tippy: ^6.7.1 vue-tippy: ^6.7.1
vue-tsc: ^3.2.3 vue-tsc: ^3.2.4
vxe-pc-ui: ^4.12.10 vxe-pc-ui: ^4.12.16
vxe-table: ^4.17.46 vxe-table: ^4.17.46
watermark-js-plus: ^1.6.3 watermark-js-plus: ^1.6.3
yaml-eslint-parser: ^1.3.2 yaml-eslint-parser: ^1.3.2