From b92ac5c36d6d046d80c464c4cd6da8df1281af5e Mon Sep 17 00:00:00 2001 From: vben Date: Tue, 18 Mar 2025 21:43:27 +0800 Subject: [PATCH 01/74] chore: release 5.5.4 --- apps/web-antd/package.json | 2 +- apps/web-ele/package.json | 2 +- apps/web-naive/package.json | 2 +- docs/package.json | 2 +- internal/lint-configs/commitlint-config/package.json | 2 +- internal/lint-configs/stylelint-config/package.json | 2 +- internal/node-utils/package.json | 2 +- internal/tailwind-config/package.json | 2 +- internal/tsconfig/package.json | 2 +- internal/vite-config/package.json | 2 +- package.json | 2 +- packages/@core/base/design/package.json | 2 +- packages/@core/base/icons/package.json | 2 +- packages/@core/base/shared/package.json | 2 +- packages/@core/base/typings/package.json | 2 +- packages/@core/composables/package.json | 2 +- packages/@core/preferences/package.json | 2 +- packages/@core/ui-kit/form-ui/package.json | 2 +- packages/@core/ui-kit/layout-ui/package.json | 2 +- packages/@core/ui-kit/menu-ui/package.json | 2 +- packages/@core/ui-kit/shadcn-ui/package.json | 2 +- packages/@core/ui-kit/tabs-ui/package.json | 2 +- packages/constants/package.json | 2 +- packages/effects/access/package.json | 2 +- packages/effects/common-ui/package.json | 2 +- packages/effects/hooks/package.json | 2 +- packages/effects/layouts/package.json | 2 +- packages/effects/plugins/package.json | 2 +- packages/effects/request/package.json | 2 +- packages/icons/package.json | 2 +- packages/locales/package.json | 2 +- packages/preferences/package.json | 2 +- packages/stores/package.json | 2 +- packages/styles/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- playground/package.json | 2 +- scripts/turbo-run/package.json | 2 +- scripts/vsh/package.json | 2 +- 39 files changed, 39 insertions(+), 39 deletions(-) diff --git a/apps/web-antd/package.json b/apps/web-antd/package.json index 487622574..ca88bf1ac 100644 --- a/apps/web-antd/package.json +++ b/apps/web-antd/package.json @@ -1,6 +1,6 @@ { "name": "@vben/web-antd", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://vben.pro", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/apps/web-ele/package.json b/apps/web-ele/package.json index 0b21070d7..7b90f172f 100644 --- a/apps/web-ele/package.json +++ b/apps/web-ele/package.json @@ -1,6 +1,6 @@ { "name": "@vben/web-ele", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://vben.pro", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/apps/web-naive/package.json b/apps/web-naive/package.json index c649252d2..d0eddbf6e 100644 --- a/apps/web-naive/package.json +++ b/apps/web-naive/package.json @@ -1,6 +1,6 @@ { "name": "@vben/web-naive", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://vben.pro", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/docs/package.json b/docs/package.json index ca04e8364..926cd44d3 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "@vben/docs", - "version": "5.5.3", + "version": "5.5.4", "private": true, "scripts": { "build": "vitepress build", diff --git a/internal/lint-configs/commitlint-config/package.json b/internal/lint-configs/commitlint-config/package.json index a1645bb77..3f1037b12 100644 --- a/internal/lint-configs/commitlint-config/package.json +++ b/internal/lint-configs/commitlint-config/package.json @@ -1,6 +1,6 @@ { "name": "@vben/commitlint-config", - "version": "5.5.3", + "version": "5.5.4", "private": true, "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", diff --git a/internal/lint-configs/stylelint-config/package.json b/internal/lint-configs/stylelint-config/package.json index da7f4e8d1..e9bd45d39 100644 --- a/internal/lint-configs/stylelint-config/package.json +++ b/internal/lint-configs/stylelint-config/package.json @@ -1,6 +1,6 @@ { "name": "@vben/stylelint-config", - "version": "5.5.3", + "version": "5.5.4", "private": true, "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", diff --git a/internal/node-utils/package.json b/internal/node-utils/package.json index 2ad95772b..7783e3537 100644 --- a/internal/node-utils/package.json +++ b/internal/node-utils/package.json @@ -1,6 +1,6 @@ { "name": "@vben/node-utils", - "version": "5.5.3", + "version": "5.5.4", "private": true, "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", diff --git a/internal/tailwind-config/package.json b/internal/tailwind-config/package.json index 9737ab338..86c41208f 100644 --- a/internal/tailwind-config/package.json +++ b/internal/tailwind-config/package.json @@ -1,6 +1,6 @@ { "name": "@vben/tailwind-config", - "version": "5.5.3", + "version": "5.5.4", "private": true, "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", diff --git a/internal/tsconfig/package.json b/internal/tsconfig/package.json index efeef619c..e2425691e 100644 --- a/internal/tsconfig/package.json +++ b/internal/tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "@vben/tsconfig", - "version": "5.5.3", + "version": "5.5.4", "private": true, "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", diff --git a/internal/vite-config/package.json b/internal/vite-config/package.json index 708d519cd..28655a56c 100644 --- a/internal/vite-config/package.json +++ b/internal/vite-config/package.json @@ -1,6 +1,6 @@ { "name": "@vben/vite-config", - "version": "5.5.3", + "version": "5.5.4", "private": true, "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", diff --git a/package.json b/package.json index f6665e516..67bc8fb61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vben-admin-monorepo", - "version": "5.5.3", + "version": "5.5.4", "private": true, "keywords": [ "monorepo", diff --git a/packages/@core/base/design/package.json b/packages/@core/base/design/package.json index ee1968114..11b585a28 100644 --- a/packages/@core/base/design/package.json +++ b/packages/@core/base/design/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/design", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/base/icons/package.json b/packages/@core/base/icons/package.json index cd8b38962..2fc39647f 100644 --- a/packages/@core/base/icons/package.json +++ b/packages/@core/base/icons/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/icons", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/base/shared/package.json b/packages/@core/base/shared/package.json index bc1c6f3e4..ebf481bf6 100644 --- a/packages/@core/base/shared/package.json +++ b/packages/@core/base/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/shared", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/base/typings/package.json b/packages/@core/base/typings/package.json index f453b6ec4..6073fbcdd 100644 --- a/packages/@core/base/typings/package.json +++ b/packages/@core/base/typings/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/typings", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/composables/package.json b/packages/@core/composables/package.json index 1a8df3557..31f3e7838 100644 --- a/packages/@core/composables/package.json +++ b/packages/@core/composables/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/composables", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/preferences/package.json b/packages/@core/preferences/package.json index 1ab498a8c..886fbed35 100644 --- a/packages/@core/preferences/package.json +++ b/packages/@core/preferences/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/preferences", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/ui-kit/form-ui/package.json b/packages/@core/ui-kit/form-ui/package.json index 36a0596df..db6cbab51 100644 --- a/packages/@core/ui-kit/form-ui/package.json +++ b/packages/@core/ui-kit/form-ui/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/form-ui", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/ui-kit/layout-ui/package.json b/packages/@core/ui-kit/layout-ui/package.json index 0bed9beb4..0f26fa31c 100644 --- a/packages/@core/ui-kit/layout-ui/package.json +++ b/packages/@core/ui-kit/layout-ui/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/layout-ui", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/ui-kit/menu-ui/package.json b/packages/@core/ui-kit/menu-ui/package.json index edb320f4c..f44097b4e 100644 --- a/packages/@core/ui-kit/menu-ui/package.json +++ b/packages/@core/ui-kit/menu-ui/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/menu-ui", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/ui-kit/shadcn-ui/package.json b/packages/@core/ui-kit/shadcn-ui/package.json index 8f649d4c8..9bb36babb 100644 --- a/packages/@core/ui-kit/shadcn-ui/package.json +++ b/packages/@core/ui-kit/shadcn-ui/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/shadcn-ui", - "version": "5.5.3", + "version": "5.5.4", "#main": "./dist/index.mjs", "#module": "./dist/index.mjs", "homepage": "https://github.com/vbenjs/vue-vben-admin", diff --git a/packages/@core/ui-kit/tabs-ui/package.json b/packages/@core/ui-kit/tabs-ui/package.json index af32067e0..3add131c7 100644 --- a/packages/@core/ui-kit/tabs-ui/package.json +++ b/packages/@core/ui-kit/tabs-ui/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/tabs-ui", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/constants/package.json b/packages/constants/package.json index dae564a41..2685dc8f1 100644 --- a/packages/constants/package.json +++ b/packages/constants/package.json @@ -1,6 +1,6 @@ { "name": "@vben/constants", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/effects/access/package.json b/packages/effects/access/package.json index 7a24ba8bb..f7fd192d6 100644 --- a/packages/effects/access/package.json +++ b/packages/effects/access/package.json @@ -1,6 +1,6 @@ { "name": "@vben/access", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/effects/common-ui/package.json b/packages/effects/common-ui/package.json index 37b1b76a3..5ae51a566 100644 --- a/packages/effects/common-ui/package.json +++ b/packages/effects/common-ui/package.json @@ -1,6 +1,6 @@ { "name": "@vben/common-ui", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/effects/hooks/package.json b/packages/effects/hooks/package.json index c9120d2ad..659d723ec 100644 --- a/packages/effects/hooks/package.json +++ b/packages/effects/hooks/package.json @@ -1,6 +1,6 @@ { "name": "@vben/hooks", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/effects/layouts/package.json b/packages/effects/layouts/package.json index 34da7f99f..617f32316 100644 --- a/packages/effects/layouts/package.json +++ b/packages/effects/layouts/package.json @@ -1,6 +1,6 @@ { "name": "@vben/layouts", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/effects/plugins/package.json b/packages/effects/plugins/package.json index 5c29e0f54..809b269cc 100644 --- a/packages/effects/plugins/package.json +++ b/packages/effects/plugins/package.json @@ -1,6 +1,6 @@ { "name": "@vben/plugins", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/effects/request/package.json b/packages/effects/request/package.json index bbea72627..f35edd523 100644 --- a/packages/effects/request/package.json +++ b/packages/effects/request/package.json @@ -1,6 +1,6 @@ { "name": "@vben/request", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/icons/package.json b/packages/icons/package.json index 57a7c9d4a..9184d418d 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -1,6 +1,6 @@ { "name": "@vben/icons", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/locales/package.json b/packages/locales/package.json index 4ec643061..7b78e47fc 100644 --- a/packages/locales/package.json +++ b/packages/locales/package.json @@ -1,6 +1,6 @@ { "name": "@vben/locales", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/preferences/package.json b/packages/preferences/package.json index 950ba8478..538caaed2 100644 --- a/packages/preferences/package.json +++ b/packages/preferences/package.json @@ -1,6 +1,6 @@ { "name": "@vben/preferences", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/stores/package.json b/packages/stores/package.json index fe79f8e5a..2ff766cbf 100644 --- a/packages/stores/package.json +++ b/packages/stores/package.json @@ -1,6 +1,6 @@ { "name": "@vben/stores", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/styles/package.json b/packages/styles/package.json index b8d96dab8..73f835c95 100644 --- a/packages/styles/package.json +++ b/packages/styles/package.json @@ -1,6 +1,6 @@ { "name": "@vben/styles", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/types/package.json b/packages/types/package.json index 3b2323fc5..edfd1ec0f 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@vben/types", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/utils/package.json b/packages/utils/package.json index 6550554f4..6e2d5dc6c 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@vben/utils", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/playground/package.json b/playground/package.json index 8897e0e3c..0cc4ebf8d 100644 --- a/playground/package.json +++ b/playground/package.json @@ -1,6 +1,6 @@ { "name": "@vben/playground", - "version": "5.5.3", + "version": "5.5.4", "homepage": "https://vben.pro", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/scripts/turbo-run/package.json b/scripts/turbo-run/package.json index 8128ec5c2..b6e65e41f 100644 --- a/scripts/turbo-run/package.json +++ b/scripts/turbo-run/package.json @@ -1,6 +1,6 @@ { "name": "@vben/turbo-run", - "version": "5.5.3", + "version": "5.5.4", "private": true, "license": "MIT", "type": "module", diff --git a/scripts/vsh/package.json b/scripts/vsh/package.json index 9767a4dc0..1f65cc979 100644 --- a/scripts/vsh/package.json +++ b/scripts/vsh/package.json @@ -1,6 +1,6 @@ { "name": "@vben/vsh", - "version": "5.5.3", + "version": "5.5.4", "private": true, "license": "MIT", "type": "module", From f0a43912d16e21aaccbeb612252fb2a8ef0dfd4e Mon Sep 17 00:00:00 2001 From: anyup <85225562+anyup@users.noreply.github.com> Date: Thu, 20 Mar 2025 19:41:46 +0800 Subject: [PATCH 02/74] fix: sort the menu so that it doesn't get replaced with 999 when order=0 (#5753) Co-authored-by: anyup --- packages/utils/src/helpers/generate-menus.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utils/src/helpers/generate-menus.ts b/packages/utils/src/helpers/generate-menus.ts index 6f0d9474b..5df0653b0 100644 --- a/packages/utils/src/helpers/generate-menus.ts +++ b/packages/utils/src/helpers/generate-menus.ts @@ -69,8 +69,8 @@ async function generateMenus( }; }); - // 对菜单进行排序 - menus = menus.sort((a, b) => (a.order || 999) - (b.order || 999)); + // 对菜单进行排序,避免order=0时被替换成999的问题 + menus = menus.sort((a, b) => (a?.order ?? 999) - (b?.order ?? 999)); const finalMenus = filterTree(menus, (menu) => { return !!menu.show; From 3133f8f8b962b1d3e4a27cdb27c350922ce87db5 Mon Sep 17 00:00:00 2001 From: Netfan Date: Thu, 20 Mar 2025 19:42:22 +0800 Subject: [PATCH 03/74] fix: table form reset will trigger reload twice while submitOnChange set (#5756) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复表格的搜索表单在重置时,可能会触发2次表格刷新的问题 --- packages/effects/plugins/src/vxe-table/use-vxe-grid.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue index 3d11fe868..34c89d038 100644 --- a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue +++ b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue @@ -29,7 +29,7 @@ import { usePriorityValues } from '@vben/hooks'; import { EmptyIcon } from '@vben/icons'; import { $t } from '@vben/locales'; import { usePreferences } from '@vben/preferences'; -import { cloneDeep, cn, mergeWithArrayOverride } from '@vben/utils'; +import { cloneDeep, cn, isEqual, mergeWithArrayOverride } from '@vben/utils'; import { VbenHelpTooltip, VbenLoading } from '@vben-core/shadcn-ui'; @@ -81,10 +81,14 @@ const [Form, formApi] = useTableForm({ props.api.reload(formValues); }, handleReset: async () => { + const prevValues = await formApi.getValues(); await formApi.resetForm(); const formValues = await formApi.getValues(); formApi.setLatestSubmissionValues(formValues); - props.api.reload(formValues); + // 如果值发生了变化,submitOnChange会触发刷新。所以只在submitOnChange为false或者值没有发生变化时,手动刷新 + if (isEqual(prevValues, formValues) || !formOptions.value?.submitOnChange) { + props.api.reload(formValues); + } }, commonConfig: { componentProps: { From 711a179c694c4b4b1c7186c06a8a65cc7e4df4b6 Mon Sep 17 00:00:00 2001 From: Jin Mao <50581550+jinmao88@users.noreply.github.com> Date: Fri, 21 Mar 2025 08:37:21 +0800 Subject: [PATCH 04/74] chore: update codeowners (#5750) --- .github/CODEOWNERS | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9fd865479..b95ff9460 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,14 +1,14 @@ # default onwer -* anncwb@126.com vince292007@gmail.com netfan@foxmail.com +* anncwb@126.com vince292007@gmail.com netfan@foxmail.com jinmao88@qq.com # vben core onwer -/.github/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com -/.vscode/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com -/packages/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com -/packages/@core/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com -/internal/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com -/scripts/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com +/.github/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com jinmao88@qq.com +/.vscode/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com jinmao88@qq.com +/packages/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com jinmao88@qq.com +/packages/@core/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com jinmao88@qq.com +/internal/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com jinmao88@qq.com +/scripts/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com jinmao88@qq.com # vben team onwer -apps/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com @vbenjs/team-v5 -docs/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com @vbenjs/team-v5 +apps/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com @vbenjs/team-v5 jinmao88@qq.com +docs/ anncwb@126.com vince292007@gmail.com netfan@foxmail.com @vbenjs/team-v5 jinmao88@qq.com From efb69fc75f5e6d4fda1bd635a6d3b52d77212415 Mon Sep 17 00:00:00 2001 From: Netfan Date: Fri, 21 Mar 2025 09:25:38 +0800 Subject: [PATCH 05/74] feat: add `form-is-required` class for required items. fixed: #5739 (#5759) --- packages/@core/ui-kit/form-ui/src/form-render/form-field.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue b/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue index bdb275289..74cb14eea 100644 --- a/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue +++ b/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue @@ -290,6 +290,7 @@ onUnmounted(() => { v-show="isShow" :class="{ 'form-valid-error': isInValid, + 'form-is-required': shouldRequired, 'flex-col': isVertical, 'flex-row items-center': !isVertical, 'pb-6': !compact, From 39888cebaa407cd609cfb1fe8511e0ceacf020b8 Mon Sep 17 00:00:00 2001 From: Netfan Date: Fri, 21 Mar 2025 09:41:42 +0800 Subject: [PATCH 06/74] fix: base component focus color in form (#5760) --- packages/@core/ui-kit/form-ui/src/form-render/form-field.vue | 2 +- .../@core/ui-kit/shadcn-ui/src/components/select/select.vue | 4 ++++ packages/@core/ui-kit/shadcn-ui/src/ui/input/Input.vue | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue b/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue index 74cb14eea..61852aaeb 100644 --- a/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue +++ b/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue @@ -321,7 +321,7 @@ onUnmounted(() => { -
+
(); button[role='combobox'][data-placeholder] { color: hsl(var(--muted-foreground)); } + +button { + --ring: var(--primary); +} diff --git a/packages/@core/ui-kit/shadcn-ui/src/ui/input/Input.vue b/packages/@core/ui-kit/shadcn-ui/src/ui/input/Input.vue index 68b90db2b..6dfd4c8b8 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/ui/input/Input.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/ui/input/Input.vue @@ -30,3 +30,8 @@ const modelValue = useVModel(props, 'modelValue', emits, { " /> + From 03ceb2aac5a47d7127562f2855d41da5c58b81bf Mon Sep 17 00:00:00 2001 From: Netfan Date: Fri, 21 Mar 2025 16:06:14 +0800 Subject: [PATCH 07/74] fix: default value for nested fields (#5763) --- packages/@core/base/shared/package.json | 2 + packages/@core/base/shared/src/utils/index.ts | 1 + .../ui-kit/form-ui/src/use-form-context.ts | 10 ++-- pnpm-lock.yaml | 52 ++++++++++++++----- pnpm-workspace.yaml | 2 + 5 files changed, 50 insertions(+), 17 deletions(-) diff --git a/packages/@core/base/shared/package.json b/packages/@core/base/shared/package.json index ebf481bf6..70ad17c35 100644 --- a/packages/@core/base/shared/package.json +++ b/packages/@core/base/shared/package.json @@ -88,6 +88,7 @@ "lodash.clonedeep": "catalog:", "lodash.get": "catalog:", "lodash.isequal": "catalog:", + "lodash.set": "catalog:", "nprogress": "catalog:", "tailwind-merge": "catalog:", "theme-colors": "catalog:" @@ -96,6 +97,7 @@ "@types/lodash.clonedeep": "catalog:", "@types/lodash.get": "catalog:", "@types/lodash.isequal": "catalog:", + "@types/lodash.set": "catalog:", "@types/nprogress": "catalog:" } } diff --git a/packages/@core/base/shared/src/utils/index.ts b/packages/@core/base/shared/src/utils/index.ts index 1bf09c713..925af1c12 100644 --- a/packages/@core/base/shared/src/utils/index.ts +++ b/packages/@core/base/shared/src/utils/index.ts @@ -17,3 +17,4 @@ export * from './window'; export { default as cloneDeep } from 'lodash.clonedeep'; export { default as get } from 'lodash.get'; export { default as isEqual } from 'lodash.isequal'; +export { default as set } from 'lodash.set'; diff --git a/packages/@core/ui-kit/form-ui/src/use-form-context.ts b/packages/@core/ui-kit/form-ui/src/use-form-context.ts index 0374cf326..60148bfba 100644 --- a/packages/@core/ui-kit/form-ui/src/use-form-context.ts +++ b/packages/@core/ui-kit/form-ui/src/use-form-context.ts @@ -7,7 +7,7 @@ import type { ExtendedFormApi, FormActions, VbenFormProps } from './types'; import { computed, unref, useSlots } from 'vue'; import { createContext } from '@vben-core/shadcn-ui'; -import { isString } from '@vben-core/shared/utils'; +import { isString, mergeWithArrayOverride, set } from '@vben-core/shared/utils'; import { useForm } from 'vee-validate'; import { object } from 'zod'; @@ -50,7 +50,7 @@ export function useFormInitial( const zodObject: ZodRawShape = {}; (unref(props).schema || []).forEach((item) => { if (Reflect.has(item, 'defaultValue')) { - initialValues[item.fieldName] = item.defaultValue; + set(initialValues, item.fieldName, item.defaultValue); } else if (item.rules && !isString(item.rules)) { zodObject[item.fieldName] = item.rules; } @@ -58,7 +58,11 @@ export function useFormInitial( const schemaInitialValues = getDefaultsForSchema(object(zodObject)); - return { ...initialValues, ...schemaInitialValues }; + const zodDefaults: Record = {}; + for (const key in schemaInitialValues) { + set(zodDefaults, key, schemaInitialValues[key]); + } + return mergeWithArrayOverride(initialValues, zodDefaults); } return { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 35e1b4a2b..ec1fb451a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -96,6 +96,9 @@ catalogs: '@types/lodash.isequal': specifier: ^4.5.8 version: 4.5.8 + '@types/lodash.set': + specifier: ^4.3.2 + version: 4.3.9 '@types/node': specifier: ^22.13.10 version: 22.13.10 @@ -306,6 +309,9 @@ catalogs: lodash.isequal: specifier: ^4.5.0 version: 4.5.0 + lodash.set: + specifier: ^4.3.2 + version: 4.3.2 lucide-vue-next: specifier: ^0.469.0 version: 0.469.0 @@ -1240,6 +1246,9 @@ importers: lodash.isequal: specifier: 'catalog:' version: 4.5.0 + lodash.set: + specifier: 'catalog:' + version: 4.3.2 nprogress: specifier: 'catalog:' version: 0.2.0 @@ -1259,6 +1268,9 @@ importers: '@types/lodash.isequal': specifier: 'catalog:' version: 4.5.8 + '@types/lodash.set': + specifier: 'catalog:' + version: 4.3.9 '@types/nprogress': specifier: 'catalog:' version: 0.2.3 @@ -3534,22 +3546,22 @@ packages: resolution: {integrity: sha512-nmG512G8QOABsserleechwHGZxzKSAlggGf9hQX0nltvSwyKNVuB/4o6iFeG2OnjXK253r8p8eSDOZf8PgFdWw==} engines: {node: '>= 16'} - '@intlify/message-compiler@11.0.0-rc.1': - resolution: {integrity: sha512-TGw2uBfuTFTegZf/BHtUQBEKxl7Q/dVGLoqRIdw8lFsp9g/53sYn5iD+0HxIzdYjbWL6BTJMXCPUHp9PxDTRPw==} - engines: {node: '>= 16'} - '@intlify/message-compiler@11.1.2': resolution: {integrity: sha512-T/xbNDzi+Yv0Qn2Dfz2CWCAJiwNgU5d95EhhAEf4YmOgjCKktpfpiUSmLcBvK1CtLpPQ85AMMQk/2NCcXnNj1g==} engines: {node: '>= 16'} - '@intlify/shared@11.0.0-rc.1': - resolution: {integrity: sha512-8tR1xe7ZEbkabTuE/tNhzpolygUn9OaYp9yuYAF4MgDNZg06C3Qny80bes2/e9/Wm3aVkPUlCw6WgU7mQd0yEg==} + '@intlify/message-compiler@12.0.0-alpha.2': + resolution: {integrity: sha512-PD9C+oQbb7BF52hec0+vLnScaFkvnfX+R7zSbODYuRo/E2niAtGmHd0wPvEMsDhf9Z9b8f/qyDsVeZnD/ya9Ug==} engines: {node: '>= 16'} '@intlify/shared@11.1.2': resolution: {integrity: sha512-dF2iMMy8P9uKVHV/20LA1ulFLL+MKSbfMiixSmn6fpwqzvix38OIc7ebgnFbBqElvghZCW9ACtzKTGKsTGTWGA==} engines: {node: '>= 16'} + '@intlify/shared@12.0.0-alpha.2': + resolution: {integrity: sha512-P2DULVX9nz3y8zKNqLw9Es1aAgQ1JGC+kgpx5q7yLmrnAKkPR5MybQWoEhxanefNJgUY5ehsgo+GKif59SrncA==} + engines: {node: '>= 16'} + '@intlify/unplugin-vue-i18n@6.0.3': resolution: {integrity: sha512-9ZDjBlhUHtgjRl23TVcgfJttgu8cNepwVhWvOv3mUMRDAhjW0pur1mWKEUKr1I8PNwE4Gvv2IQ1xcl4RL0nG0g==} engines: {node: '>= 18'} @@ -4277,6 +4289,9 @@ packages: '@types/lodash.isequal@4.5.8': resolution: {integrity: sha512-uput6pg4E/tj2LGxCZo9+y27JNyB2OZuuI/T5F+ylVDYuqICLG2/ktjxx0v6GvVntAf8TvEzeQLcV0ffRirXuA==} + '@types/lodash.set@4.3.9': + resolution: {integrity: sha512-KOxyNkZpbaggVmqbpr82N2tDVTx05/3/j0f50Es1prxrWB0XYf9p3QNxqcbWb7P1Q9wlvsUSlCFnwlPCIJ46PQ==} + '@types/lodash@4.17.16': resolution: {integrity: sha512-HX7Em5NYQAXKW+1T+FiuG27NGwzJfCX3s1GjOa7ujxZa52kjJLOr4FUxT+giF6Tgxv1e+/czV/iTtBw27WTU9g==} @@ -7318,6 +7333,9 @@ packages: lodash.once@4.1.1: resolution: {integrity: sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==} + lodash.set@4.3.2: + resolution: {integrity: sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg==} + lodash.snakecase@4.1.1: resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} @@ -12279,8 +12297,8 @@ snapshots: '@intlify/bundle-utils@10.0.0(vue-i18n@11.1.2(vue@3.5.13(typescript@5.8.2)))': dependencies: - '@intlify/message-compiler': 11.0.0-rc.1 - '@intlify/shared': 11.0.0-rc.1 + '@intlify/message-compiler': 12.0.0-alpha.2 + '@intlify/shared': 12.0.0-alpha.2 acorn: 8.14.1 escodegen: 2.1.0 estree-walker: 2.0.2 @@ -12296,20 +12314,20 @@ snapshots: '@intlify/message-compiler': 11.1.2 '@intlify/shared': 11.1.2 - '@intlify/message-compiler@11.0.0-rc.1': - dependencies: - '@intlify/shared': 11.0.0-rc.1 - source-map-js: 1.2.1 - '@intlify/message-compiler@11.1.2': dependencies: '@intlify/shared': 11.1.2 source-map-js: 1.2.1 - '@intlify/shared@11.0.0-rc.1': {} + '@intlify/message-compiler@12.0.0-alpha.2': + dependencies: + '@intlify/shared': 12.0.0-alpha.2 + source-map-js: 1.2.1 '@intlify/shared@11.1.2': {} + '@intlify/shared@12.0.0-alpha.2': {} + '@intlify/unplugin-vue-i18n@6.0.3(@vue/compiler-dom@3.5.13)(eslint@9.22.0(jiti@2.4.2))(rollup@4.35.0)(typescript@5.8.2)(vue-i18n@11.1.2(vue@3.5.13(typescript@5.8.2)))(vue@3.5.13(typescript@5.8.2))': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.22.0(jiti@2.4.2)) @@ -13103,6 +13121,10 @@ snapshots: dependencies: '@types/lodash': 4.17.16 + '@types/lodash.set@4.3.9': + dependencies: + '@types/lodash': 4.17.16 + '@types/lodash@4.17.16': {} '@types/markdown-it@14.1.2': @@ -16558,6 +16580,8 @@ snapshots: lodash.once@4.1.1: {} + lodash.set@4.3.2: {} + lodash.snakecase@4.1.1: {} lodash.sortby@4.7.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 438335b50..06081dac9 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -45,6 +45,7 @@ catalog: '@types/lodash.clonedeep': ^4.5.9 '@types/lodash.get': ^4.4.9 '@types/lodash.isequal': ^4.5.8 + '@types/lodash.set': ^4.3.2 '@types/node': ^22.13.10 '@types/nprogress': ^0.2.3 '@types/postcss-import': ^14.0.3 @@ -116,6 +117,7 @@ catalog: lint-staged: ^15.4.3 lodash.clonedeep: ^4.5.0 lodash.get: ^4.4.2 + lodash.set: ^4.3.2 lodash.isequal: ^4.5.0 lucide-vue-next: ^0.469.0 medium-zoom: ^1.1.0 From 66c1d390b948a673cdf1207f2a6bab456b1ad269 Mon Sep 17 00:00:00 2001 From: Jin Mao <50581550+jinmao88@users.noreply.github.com> Date: Sun, 23 Mar 2025 10:02:22 +0800 Subject: [PATCH 08/74] feat(ui): logo icon support click events (#5725) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(ui): 扩展auth页面添加点击 Logo 的事件处理 在 `authentication.vue` 中新增 `clickLogo` 属性,允许在点击 Logo 时执行自定义操作。在 `auth.vue` 中实现了一个示例的点击事件处理函数,用于测试该功能。 * feat(layout): 添加点击 logo 的事件处理函数 在 BasicLayout 组件中添加了 clickLogo 事件处理函数,并通过 emit 方法触发 clickLogo 事件。同时,在 basic.vue 中实现了 handleClickLogo 函数,用于处理 logo 点击事件。 * fix(ui): 移除logo点击事件的控制台日志 --- .../effects/layouts/src/authentication/authentication.vue | 8 +++++++- packages/effects/layouts/src/basic/layout.vue | 7 ++++++- playground/src/layouts/auth.vue | 2 ++ playground/src/layouts/basic.vue | 7 ++++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/packages/effects/layouts/src/authentication/authentication.vue b/packages/effects/layouts/src/authentication/authentication.vue index 0c79591ee..401154584 100644 --- a/packages/effects/layouts/src/authentication/authentication.vue +++ b/packages/effects/layouts/src/authentication/authentication.vue @@ -17,6 +17,7 @@ interface Props { toolbar?: boolean; copyright?: boolean; toolbarList?: ToolbarType[]; + clickLogo?: () => void; } withDefaults(defineProps(), { @@ -28,6 +29,7 @@ withDefaults(defineProps(), { sloganImage: '', toolbar: true, toolbarList: () => ['color', 'language', 'layout', 'theme'], + clickLogo: () => {}, }); const { authPanelCenter, authPanelLeft, authPanelRight, isDark } = @@ -61,7 +63,11 @@ const { authPanelCenter, authPanelLeft, authPanelRight, isDark } = -
+
diff --git a/packages/effects/layouts/src/basic/layout.vue b/packages/effects/layouts/src/basic/layout.vue index 1fb90448f..4a8e963aa 100644 --- a/packages/effects/layouts/src/basic/layout.vue +++ b/packages/effects/layouts/src/basic/layout.vue @@ -34,7 +34,7 @@ import { LayoutTabbar } from './tabbar'; defineOptions({ name: 'BasicLayout' }); -const emit = defineEmits<{ clearPreferencesAndLogout: [] }>(); +const emit = defineEmits<{ clearPreferencesAndLogout: []; clickLogo: [] }>(); const { isDark, @@ -149,6 +149,10 @@ function clearPreferencesAndLogout() { emit('clearPreferencesAndLogout'); } +function clickLogo() { + emit('clickLogo'); +} + watch( () => preferences.app.layout, async (val) => { @@ -221,6 +225,7 @@ const headerSlots = computed(() => { :src="preferences.logo.source" :text="preferences.app.name" :theme="showHeaderNav ? headerTheme : theme" + @click="clickLogo" /> diff --git a/playground/src/layouts/auth.vue b/playground/src/layouts/auth.vue index 18d415bc7..c33a632a0 100644 --- a/playground/src/layouts/auth.vue +++ b/playground/src/layouts/auth.vue @@ -8,6 +8,7 @@ import { $t } from '#/locales'; const appName = computed(() => preferences.app.name); const logo = computed(() => preferences.logo.source); +const clickLogo = () => {};