Browse Source

chore: format code

vben 9 months ago
parent
commit
7bcd7746ca
100 changed files with 342 additions and 229 deletions
  1. 2 1
      apps/web-antd/src/apis/modules/user.ts
  2. 4 3
      apps/web-antd/src/app.vue
  3. 3 3
      apps/web-antd/src/bootstrap.ts
  4. 4 4
      apps/web-antd/src/layouts/basic.vue
  5. 9 7
      apps/web-antd/src/router/guard.ts
  6. 2 1
      apps/web-antd/src/router/index.ts
  7. 5 5
      apps/web-antd/src/router/routes/_essentials.ts
  8. 3 2
      apps/web-antd/src/router/routes/dynamic/vben.ts
  9. 4 3
      apps/web-antd/src/router/routes/index.ts
  10. 2 2
      apps/web-antd/src/store/index.ts
  11. 2 1
      apps/web-antd/src/views/_essential/authentication/code-login.vue
  12. 2 1
      apps/web-antd/src/views/_essential/authentication/forget-password.vue
  13. 5 4
      apps/web-antd/src/views/_essential/authentication/login.vue
  14. 2 1
      apps/web-antd/src/views/_essential/authentication/register.vue
  15. 0 0
      apps/web-antd/src/views/_essential/fallback/forbidden.vue
  16. 0 0
      apps/web-antd/src/views/_essential/fallback/internal-error.vue
  17. 7 0
      apps/web-antd/src/views/_essential/fallback/not-found.vue
  18. 2 2
      internal/lint-configs/eslint-config/package.json
  19. 18 11
      internal/lint-configs/eslint-config/src/configs/perfectionist.ts
  20. 2 2
      internal/tailwind-config/package.json
  21. 2 1
      internal/tailwind-config/src/index.ts
  22. 2 2
      internal/vite-config/src/config/application.ts
  23. 2 2
      internal/vite-config/src/config/index.ts
  24. 3 2
      internal/vite-config/src/config/library.ts
  25. 1 0
      internal/vite-config/src/plugins/extra-app-config.ts
  26. 9 8
      internal/vite-config/src/plugins/index.ts
  27. 1 0
      internal/vite-config/src/plugins/inject-app-loading/index.ts
  28. 1 1
      internal/vite-config/src/plugins/inject-app-loading/loading-antd.html
  29. 1 1
      internal/vite-config/src/plugins/inject-app-loading/loading.html
  30. 1 0
      internal/vite-config/src/utils/env.ts
  31. 2 2
      package.json
  32. 1 1
      packages/@vben-core/forward/helpers/src/generator-menus.ts
  33. 28 5
      packages/@vben-core/forward/helpers/src/generator-routes.ts
  34. 2 2
      packages/@vben-core/forward/helpers/src/merge-route-modules.test.ts
  35. 2 2
      packages/@vben-core/forward/preferences/src/index.ts
  36. 4 3
      packages/@vben-core/forward/preferences/src/preferences.ts
  37. 2 2
      packages/@vben-core/forward/preferences/src/use-preferences.ts
  38. 2 2
      packages/@vben-core/forward/request/src/request-client/request-client.ts
  39. 0 1
      packages/@vben-core/forward/stores/src/modules/access.ts
  40. 2 1
      packages/@vben-core/forward/stores/src/modules/tabs.test.ts
  41. 4 2
      packages/@vben-core/forward/stores/src/modules/tabs.ts
  42. 2 1
      packages/@vben-core/shared/iconify/src/factory.ts
  43. 5 0
      packages/@vben-core/shared/typings/src/vue-router.d.ts
  44. 2 2
      packages/@vben-core/shared/typings/vue-router.d.ts
  45. 0 1
      packages/@vben-core/uikit/layout-ui/src/components/layout-content.vue
  46. 2 3
      packages/@vben-core/uikit/layout-ui/src/components/layout-footer.vue
  47. 3 4
      packages/@vben-core/uikit/layout-ui/src/components/layout-header.vue
  48. 3 4
      packages/@vben-core/uikit/layout-ui/src/components/layout-side.vue
  49. 0 1
      packages/@vben-core/uikit/layout-ui/src/components/layout-tabs.vue
  50. 1 1
      packages/@vben-core/uikit/layout-ui/src/vben-layout.vue
  51. 4 4
      packages/@vben-core/uikit/menu-ui/src/components/menu-item.vue
  52. 11 10
      packages/@vben-core/uikit/menu-ui/src/components/menu.vue
  53. 2 2
      packages/@vben-core/uikit/menu-ui/src/components/normal-menu/normal-menu.vue
  54. 4 4
      packages/@vben-core/uikit/menu-ui/src/components/sub-menu-content.vue
  55. 8 8
      packages/@vben-core/uikit/menu-ui/src/components/sub-menu.vue
  56. 2 2
      packages/@vben-core/uikit/menu-ui/src/hooks/use-menu-context.ts
  57. 2 2
      packages/@vben-core/uikit/menu-ui/src/sub-menu.vue
  58. 0 1
      packages/@vben-core/uikit/menu-ui/src/utils/index.ts
  59. 1 1
      packages/@vben-core/uikit/shadcn-ui/src/components/avatar/avatar.vue
  60. 3 3
      packages/@vben-core/uikit/shadcn-ui/src/components/back-top/back-top.vue
  61. 3 2
      packages/@vben-core/uikit/shadcn-ui/src/components/back-top/use-backtop.ts
  62. 2 2
      packages/@vben-core/uikit/shadcn-ui/src/components/breadcrumb/breadcrumb-background.vue
  63. 2 2
      packages/@vben-core/uikit/shadcn-ui/src/components/breadcrumb/breadcrumb.vue
  64. 4 3
      packages/@vben-core/uikit/shadcn-ui/src/components/button/button.vue
  65. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/button/icon-button.vue
  66. 2 1
      packages/@vben-core/uikit/shadcn-ui/src/components/checkbox/checkbox.vue
  67. 5 4
      packages/@vben-core/uikit/shadcn-ui/src/components/context-menu/context-menu.vue
  68. 5 5
      packages/@vben-core/uikit/shadcn-ui/src/components/dropdown-menu/dropdown-menu.vue
  69. 2 2
      packages/@vben-core/uikit/shadcn-ui/src/components/dropdown-menu/dropdown-radio-menu.vue
  70. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/hover-card/hover-card.vue
  71. 2 2
      packages/@vben-core/uikit/shadcn-ui/src/components/icon/icon.vue
  72. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/input-password/input-password.vue
  73. 2 2
      packages/@vben-core/uikit/shadcn-ui/src/components/input/input.vue
  74. 2 2
      packages/@vben-core/uikit/shadcn-ui/src/components/menu-badge/menu-badge.vue
  75. 4 3
      packages/@vben-core/uikit/shadcn-ui/src/components/pin-input/input.vue
  76. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/popover/popover.vue
  77. 6 4
      packages/@vben-core/uikit/shadcn-ui/src/components/segmented/segmented.vue
  78. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/segmented/tabs-indicator.vue
  79. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/sheet/sheet.vue
  80. 2 1
      packages/@vben-core/uikit/shadcn-ui/src/components/tooltip/tooltip.vue
  81. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogAction.vue
  82. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogCancel.vue
  83. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogContent.vue
  84. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogDescription.vue
  85. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogTitle.vue
  86. 2 1
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/avatar/Avatar.vue
  87. 2 1
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/breadcrumb/BreadcrumbEllipsis.vue
  88. 2 1
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/breadcrumb/BreadcrumbLink.vue
  89. 2 1
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/breadcrumb/BreadcrumbSeparator.vue
  90. 2 1
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/button/Button.vue
  91. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/checkbox/Checkbox.vue
  92. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuCheckboxItem.vue
  93. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuContent.vue
  94. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuItem.vue
  95. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuLabel.vue
  96. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuRadioItem.vue
  97. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuSeparator.vue
  98. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuSubContent.vue
  99. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuSubTrigger.vue
  100. 4 2
      packages/@vben-core/uikit/shadcn-ui/src/components/ui/dialog/DialogContent.vue

+ 2 - 1
apps/web-antd/src/apis/modules/user.ts

@@ -1,6 +1,7 @@
-import type { UserApiType } from '@/apis/types';
 import type { UserInfo } from '@vben/types';
 
+import type { UserApiType } from '@/apis/types';
+
 import { request } from '@/forward';
 
 /**

+ 4 - 3
apps/web-antd/src/app.vue

@@ -1,13 +1,14 @@
 <script lang="ts" setup>
-import 'dayjs/locale/zh-cn';
+import { computed } from 'vue';
 
+import { GlobalProvider } from '@vben/common-ui';
 import { preferences, usePreferences } from '@vben-core/preferences';
 
-import { GlobalProvider } from '@vben/common-ui';
 import { ConfigProvider, theme } from 'ant-design-vue';
 import zhCN from 'ant-design-vue/es/locale/zh_CN';
 import dayjs from 'dayjs';
-import { computed } from 'vue';
+
+import 'dayjs/locale/zh-cn';
 
 defineOptions({ name: 'App' });
 

+ 3 - 3
apps/web-antd/src/bootstrap.ts

@@ -1,10 +1,10 @@
-import '@vben/styles';
+import { createApp } from 'vue';
 
+import { setupI18n } from '@vben/locales';
+import '@vben/styles';
 import { preferences } from '@vben-core/preferences';
 
 import { setupStore } from '@/store';
-import { setupI18n } from '@vben/locales';
-import { createApp } from 'vue';
 
 import App from './app.vue';
 import { router } from './router';

+ 4 - 4
apps/web-antd/src/layouts/basic.vue

@@ -1,16 +1,16 @@
 <script lang="ts" setup>
 import type { NotificationItem } from '@vben/common-ui';
 
-import { preferences } from '@vben-core/preferences';
-import { useAccessStore } from '@vben-core/stores';
+import { computed, ref } from 'vue';
+import { useRouter } from 'vue-router';
 
 import { Notification, UserDropdown } from '@vben/common-ui';
 import { IcRoundCreditScore, MdiDriveDocument, MdiGithub } from '@vben/icons';
 import { BasicLayout } from '@vben/layouts';
 import { $t } from '@vben/locales';
 import { openWindow } from '@vben/utils';
-import { computed, ref } from 'vue';
-import { useRouter } from 'vue-router';
+import { preferences } from '@vben-core/preferences';
+import { useAccessStore } from '@vben-core/stores';
 
 // https://avatar.vercel.sh/vercel.svg?text=Vaa
 // https://avatar.vercel.sh/1

+ 9 - 7
apps/web-antd/src/router/guard.ts

@@ -1,11 +1,12 @@
-import { generatorMenus, generatorRoutes } from '@vben-core/helpers';
-import { preferences } from '@vben-core/preferences';
-import { useAccessStore } from '@vben-core/stores';
 import type { RouteLocationNormalized, Router } from 'vue-router';
 
 import { LOGIN_PATH } from '@vben/constants';
 import { $t } from '@vben/locales';
 import { startProgress, stopProgress } from '@vben/utils';
+import { generatorMenus, generatorRoutes } from '@vben-core/helpers';
+import { preferences } from '@vben-core/preferences';
+import { useAccessStore } from '@vben-core/stores';
+
 import { useTitle } from '@vueuse/core';
 
 import { dynamicRoutes } from '@/router/routes';
@@ -81,15 +82,16 @@ function setupAccessGuard(router: Router) {
     // 生成路由表
     // 当前登录用户拥有的角色标识列表
     const userRoles = accessStore.getUserRoles;
-    const routes = await generatorRoutes(dynamicRoutes, userRoles);
+    const accessibleRoutes = await generatorRoutes(dynamicRoutes, userRoles);
     // 动态添加到router实例内
-    routes.forEach((route) => router.addRoute(route));
+    accessibleRoutes.forEach((route) => router.addRoute(route));
 
-    const menus = await generatorMenus(routes, router);
+    // 生成菜单
+    const menus = await generatorMenus(accessibleRoutes, router);
 
     // 保存菜单信息和路由信息
     accessStore.setAccessMenus(menus);
-    accessStore.setAccessRoutes(routes);
+    accessStore.setAccessRoutes(accessibleRoutes);
     const redirectPath = (from.query.redirect ?? to.path) as string;
 
     return {

+ 2 - 1
apps/web-antd/src/router/index.ts

@@ -1,8 +1,9 @@
 import type { RouteRecordName, RouteRecordRaw } from 'vue-router';
 
-import { traverseTreeValues } from '@vben/utils';
 import { createRouter, createWebHashHistory } from 'vue-router';
 
+import { traverseTreeValues } from '@vben/utils';
+
 import { createRouterGuard } from './guard';
 import { routes } from './routes';
 

+ 5 - 5
apps/web-antd/src/router/routes/_essential.ts → apps/web-antd/src/router/routes/_essentials.ts

@@ -1,13 +1,13 @@
 import type { RouteRecordRaw } from 'vue-router';
 
-import { AuthPageLayoutType } from '@/layouts';
-import { Fallback } from '@vben/common-ui';
 import { $t } from '@vben/locales';
 
+import { AuthPageLayoutType } from '@/layouts';
+
 import Login from '@/views/_essential/authentication/login.vue';
 
 /** 基本路由,这些路由是必须存在的 */
-const essentialRoutes: RouteRecordRaw[] = [
+const essentialsRoutes: RouteRecordRaw[] = [
   {
     component: AuthPageLayoutType,
     meta: {
@@ -69,7 +69,7 @@ const essentialRoutes: RouteRecordRaw[] = [
   },
   // 错误页
   {
-    component: Fallback,
+    component: () => import('@/views/_essential/fallback/not-found.vue'),
     meta: {
       hideInBreadcrumb: true,
       hideInMenu: true,
@@ -82,4 +82,4 @@ const essentialRoutes: RouteRecordRaw[] = [
   },
 ];
 
-export { essentialRoutes };
+export { essentialsRoutes };

+ 3 - 2
apps/web-antd/src/router/routes/dynamic/vben.ts

@@ -1,8 +1,9 @@
-import { preferences } from '@vben-core/preferences';
 import type { RouteRecordRaw } from 'vue-router';
 
-import { BasicLayout, IFrameView } from '@/layouts';
 import { VBEN_GITHUB_URL } from '@vben/constants';
+import { preferences } from '@vben-core/preferences';
+
+import { BasicLayout, IFrameView } from '@/layouts';
 import { $t } from '@vben/locales/helper';
 
 const routes: RouteRecordRaw[] = [

+ 4 - 3
apps/web-antd/src/router/routes/index.ts

@@ -1,7 +1,8 @@
-import { mergeRouteModules } from '@vben-core/helpers';
 import type { RouteRecordRaw } from 'vue-router';
 
-import { essentialRoutes } from './_essential';
+import { mergeRouteModules } from '@vben-core/helpers';
+
+import { essentialsRoutes } from './_essentials';
 
 const dynamicRouteFiles = import.meta.glob('./dynamic/**/*.ts', {
   eager: true,
@@ -23,6 +24,6 @@ const staticRoutes: RouteRecordRaw[] = mergeRouteModules(staticRouteFiles);
 const externalRoutes: RouteRecordRaw[] = mergeRouteModules(externalRouteFiles);
 
 /** 路由列表,由基本路由+静态路由组成 */
-const routes: RouteRecordRaw[] = [...essentialRoutes, ...staticRoutes];
+const routes: RouteRecordRaw[] = [...essentialsRoutes, ...staticRoutes];
 
 export { dynamicRoutes, externalRoutes, routes };

+ 2 - 2
apps/web-antd/src/store/index.ts

@@ -1,9 +1,9 @@
 import type { InitStoreOptions } from '@vben-core/stores';
 
-import { initStore } from '@vben-core/stores';
-
 import type { App } from 'vue';
 
+import { initStore } from '@vben-core/stores';
+
 /**
  * @zh_CN 初始化pinia
  * @param app vue app 实例

+ 2 - 1
apps/web-antd/src/views/_essential/authentication/code-login.vue

@@ -1,9 +1,10 @@
 <script lang="ts" setup>
 import type { LoginCodeParams } from '@vben/common-ui';
 
-import { AuthenticationCodeLogin } from '@vben/common-ui';
 import { ref } from 'vue';
 
+import { AuthenticationCodeLogin } from '@vben/common-ui';
+
 defineOptions({ name: 'CodeLogin' });
 
 const loading = ref(false);

+ 2 - 1
apps/web-antd/src/views/_essential/authentication/forget-password.vue

@@ -1,7 +1,8 @@
 <script lang="ts" setup>
-import { AuthenticationForgetPassword } from '@vben/common-ui';
 import { ref } from 'vue';
 
+import { AuthenticationForgetPassword } from '@vben/common-ui';
+
 defineOptions({ name: 'ForgetPassword' });
 
 const loading = ref(false);

+ 5 - 4
apps/web-antd/src/views/_essential/authentication/login.vue

@@ -1,15 +1,16 @@
 <script lang="ts" setup>
 import type { LoginAndRegisterParams } from '@vben/common-ui';
 
+import { computed } from 'vue';
+import { useRouter } from 'vue-router';
+
+import { AuthenticationLogin } from '@vben/common-ui';
+import { $t } from '@vben/locales';
 import { useRequest } from '@vben-core/request';
 import { useAccessStore } from '@vben-core/stores';
 
 import { getUserInfo, userLogin } from '@/apis';
-import { AuthenticationLogin } from '@vben/common-ui';
-import { $t } from '@vben/locales';
 import { notification } from 'ant-design-vue';
-import { computed } from 'vue';
-import { useRouter } from 'vue-router';
 
 defineOptions({ name: 'Login' });
 

+ 2 - 1
apps/web-antd/src/views/_essential/authentication/register.vue

@@ -1,9 +1,10 @@
 <script lang="ts" setup>
 import type { LoginAndRegisterParams } from '@vben/common-ui';
 
-import { AuthenticationRegister } from '@vben/common-ui';
 import { ref } from 'vue';
 
+import { AuthenticationRegister } from '@vben/common-ui';
+
 defineOptions({ name: 'Register' });
 
 const loading = ref(false);

+ 0 - 0
apps/web-antd/src/views/_essential/fallback/.gitkeep → apps/web-antd/src/views/_essential/fallback/forbidden.vue


+ 0 - 0
apps/web-antd/src/views/_essential/fallback/internal-error.vue


+ 7 - 0
apps/web-antd/src/views/_essential/fallback/not-found.vue

@@ -0,0 +1,7 @@
+<script lang="ts" setup>
+import { Fallback } from '@vben/common-ui';
+</script>
+
+<template>
+  <Fallback />
+</template>

+ 2 - 2
internal/lint-configs/eslint-config/package.json

@@ -41,9 +41,9 @@
     "eslint-config-prettier": "^9.1.0",
     "eslint-plugin-eslint-comments": "^3.2.0",
     "eslint-plugin-i": "^2.29.1",
-    "eslint-plugin-jsdoc": "^48.2.7",
+    "eslint-plugin-jsdoc": "^48.2.8",
     "eslint-plugin-jsonc": "^2.16.0",
-    "eslint-plugin-n": "^17.7.0",
+    "eslint-plugin-n": "^17.8.0",
     "eslint-plugin-no-only-tests": "^3.1.0",
     "eslint-plugin-perfectionist": "^2.10.0",
     "eslint-plugin-prettier": "^5.1.3",

+ 18 - 11
internal/lint-configs/eslint-config/src/configs/perfectionist.ts

@@ -22,31 +22,38 @@ export async function perfectionist(): Promise<Linter.FlatConfig[]> {
           {
             'custom-groups': {
               type: {
-                vben: 'vue',
-                vue: ['vue', 'vue-*', '@vue*'],
+                vben: 'vben',
+                vue: 'vue',
               },
               value: {
-                vben: 'vben',
-                vue: ['@vben-*', '@vben-core/*'],
+                vben: ['@vben*', '@vben/*', '@vben-core/*'],
+                vue: ['vue', 'vue-*', '@vue*'],
               },
             },
             groups: [
-              'side-effect',
-              'type',
-              'vue',
+              ['external-type', 'builtin-type', 'type'],
+              ['parent-type', 'sibling-type', 'index-type'],
+              ['internal-type'],
               'builtin',
+              'vue',
               'vben',
               'external',
-              'internal-type',
               'internal',
               ['parent', 'sibling', 'index'],
+              'side-effect',
+              'side-effect-style',
               'style',
               'object',
               'unknown',
-              'type',
-              ['parent-type', 'sibling-type', 'index-type'],
             ],
-            'internal-pattern': ['@/layouts/**', '@/router/**', '@/views/**'],
+            'internal-pattern': [
+              '@/layouts/**',
+              '@/apis/**',
+              '@/forward/**',
+              '@/router/**',
+              '@/views/**',
+              '#/**',
+            ],
             'newlines-between': 'always',
             order: 'asc',
             type: 'natural',

+ 2 - 2
internal/tailwind-config/package.json

@@ -54,12 +54,12 @@
     "@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
     "@tailwindcss/typography": "^0.5.13",
     "autoprefixer": "^10.4.19",
-    "cssnano": "^7.0.1",
+    "cssnano": "^7.0.2",
     "postcss": "^8.4.38",
     "postcss-antd-fixes": "^0.2.0",
     "postcss-import": "^16.1.0",
     "postcss-preset-env": "^9.5.14",
-    "tailwindcss": "^3.4.3",
+    "tailwindcss": "^3.4.4",
     "tailwindcss-animate": "^1.0.7"
   },
   "devDependencies": {

+ 2 - 1
internal/tailwind-config/src/index.ts

@@ -2,10 +2,11 @@ import type { Config } from 'tailwindcss';
 
 import path from 'node:path';
 
+import { fs, getPackagesSync } from '@vben/node-utils';
+
 import { addDynamicIconSelectors } from '@iconify/tailwind';
 import formsPlugin from '@tailwindcss/forms';
 import typographyPlugin from '@tailwindcss/typography';
-import { fs, getPackagesSync } from '@vben/node-utils';
 import animate from 'tailwindcss-animate';
 
 import { enterAnimationPlugin } from './plugins/entry';

+ 2 - 2
internal/vite-config/src/config/application.ts

@@ -1,5 +1,7 @@
 import type { UserConfig } from 'vite';
 
+import type { DefineApplicationOptions } from '../typing';
+
 import { resolve } from 'node:path';
 
 import { defineConfig, loadEnv, mergeConfig } from 'vite';
@@ -7,8 +9,6 @@ import { defineConfig, loadEnv, mergeConfig } from 'vite';
 import { getApplicationConditionPlugins } from '../plugins';
 import { getCommonConfig } from './common';
 
-import type { DefineApplicationOptions } from '../typing';
-
 function defineApplicationConfig(options: DefineApplicationOptions = {}) {
   return defineConfig(async ({ command, mode }) => {
     const { application = {}, vite = {} } = options;

+ 2 - 2
internal/vite-config/src/config/index.ts

@@ -1,11 +1,11 @@
+import type { DefineConfig } from '../typing';
+
 import { existsSync } from 'node:fs';
 import { join } from 'node:path';
 
 import { defineApplicationConfig } from './application';
 import { defineLibraryConfig } from './library';
 
-import type { DefineConfig } from '../typing';
-
 export * from './application';
 export * from './library';
 

+ 3 - 2
internal/vite-config/src/config/library.ts

@@ -1,13 +1,14 @@
 import type { UserConfig } from 'vite';
 
+import type { DefineLibraryOptions } from '../typing';
+
 import { readPackageJSON } from '@vben/node-utils';
+
 import { defineConfig, mergeConfig } from 'vite';
 
 import { getLibraryConditionPlugins } from '../plugins';
 import { getCommonConfig } from './common';
 
-import type { DefineLibraryOptions } from '../typing';
-
 function defineLibraryConfig(options: DefineLibraryOptions = {}) {
   return defineConfig(async ({ command, mode }) => {
     const root = process.cwd();

+ 1 - 0
internal/vite-config/src/plugins/extra-app-config.ts

@@ -3,6 +3,7 @@ import {
   generatorContentHash,
   readPackageJSON,
 } from '@vben/node-utils';
+
 import { type PluginOption } from 'vite';
 
 import { getEnvConfig } from '../utils/env';

+ 9 - 8
internal/vite-config/src/plugins/index.ts

@@ -1,9 +1,17 @@
 import type { PluginOption } from 'vite';
 
+import type {
+  ApplicationPluginOptions,
+  CommonPluginOptions,
+  ConditionPlugin,
+  LibraryPluginOptions,
+} from '../typing';
+
 import { join } from 'node:path';
 
-import viteVueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
 import { getPackage } from '@vben/node-utils';
+
+import viteVueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
 import viteVue from '@vitejs/plugin-vue';
 import viteVueJsx from '@vitejs/plugin-vue-jsx';
 import { visualizer as viteVisualizerPlugin } from 'rollup-plugin-visualizer';
@@ -19,13 +27,6 @@ import { viteExtraAppConfigPlugin } from './extra-app-config';
 import { viteImportMapPlugin } from './importmap';
 import { viteInjectAppLoadingPlugin } from './inject-app-loading';
 
-import type {
-  ApplicationPluginOptions,
-  CommonPluginOptions,
-  ConditionPlugin,
-  LibraryPluginOptions,
-} from '../typing';
-
 /**
  * 获取条件成立的 vite 插件
  * @param conditionPlugins

+ 1 - 0
internal/vite-config/src/plugins/inject-app-loading/index.ts

@@ -2,6 +2,7 @@ import { join } from 'node:path';
 import { fileURLToPath } from 'node:url';
 
 import { fs } from '@vben/node-utils';
+
 import { type PluginOption } from 'vite';
 
 /**

+ 1 - 1
internal/vite-config/src/plugins/inject-app-loading/loading-antd.html

@@ -29,7 +29,7 @@
   .loading.hidden {
     visibility: hidden;
     opacity: 0;
-    transition: all 1s ease-out;
+    transition: all 0.6s ease-out;
   }
 
   .loading .dots {

+ 1 - 1
internal/vite-config/src/plugins/inject-app-loading/loading.html

@@ -23,7 +23,7 @@
   .loading.hidden {
     visibility: hidden;
     opacity: 0;
-    transition: all 1s ease-out;
+    transition: all 0.6s ease-out;
   }
 
   .dark .loading {

+ 1 - 0
internal/vite-config/src/utils/env.ts

@@ -1,6 +1,7 @@
 import { join } from 'node:path';
 
 import { fs } from '@vben/node-utils';
+
 import dotenv from 'dotenv';
 
 /**

+ 2 - 2
package.json

@@ -48,7 +48,7 @@
     "@changesets/cli": "^2.27.5",
     "@ls-lint/ls-lint": "^2.2.3",
     "@types/jsdom": "^21.1.7",
-    "@types/node": "^20.14.1",
+    "@types/node": "^20.14.2",
     "@vben/commitlint-config": "workspace:*",
     "@vben/eslint-config": "workspace:*",
     "@vben/lint-staged-config": "workspace:*",
@@ -76,7 +76,7 @@
     "node": ">=18.7.0",
     "pnpm": ">=8.5.0"
   },
-  "packageManager": "pnpm@9.1.4",
+  "packageManager": "pnpm@9.2.0",
   "pnpm": {
     "overrides": {
       "@ctrl/tinycolor": "4.1.0",

+ 1 - 1
packages/@vben-core/forward/helpers/src/generator-menus.ts

@@ -1,7 +1,7 @@
 import type { ExRouteRecordRaw, MenuRecordRaw } from '@vben-core/typings';
+import type { RouteRecordRaw, Router } from 'vue-router';
 
 import { mapTree } from '@vben-core/toolkit';
-import type { RouteRecordRaw, Router } from 'vue-router';
 
 /**
  * 根据 routes 生成菜单列表

+ 28 - 5
packages/@vben-core/forward/helpers/src/generator-routes.ts

@@ -1,16 +1,30 @@
-import { filterTree } from '@vben-core/toolkit';
 import type { RouteRecordRaw } from 'vue-router';
+
+import { filterTree, mapTree } from '@vben-core/toolkit';
 /**
  * 动态生成路由
  */
 async function generatorRoutes(
   routes: RouteRecordRaw[],
   roles: string[],
+  forbiddenPage?: RouteRecordRaw['component'],
 ): Promise<RouteRecordRaw[]> {
   // 根据角色标识过滤路由表,判断当前用户是否拥有指定权限
-  return filterTree(routes, (route) => {
+  const finalRoutes = filterTree(routes, (route) => {
     return hasVisible(route) && hasAuthority(route, roles);
   });
+
+  if (!forbiddenPage) {
+    return finalRoutes;
+  }
+
+  // 如果有禁止访问的页面,将禁止访问的页面替换为403页面
+  return mapTree(finalRoutes, (route) => {
+    if (menuHasVisibleWithForbidden(route)) {
+      route.component = forbiddenPage;
+    }
+    return route;
+  });
 }
 
 /**
@@ -24,9 +38,10 @@ function hasAuthority(route: RouteRecordRaw, access: string[]) {
   if (!authority) {
     return true;
   }
-  return access.some((value) => {
-    return authority.includes(value);
-  });
+  return (
+    access.some((value) => authority.includes(value)) ||
+    menuHasVisibleWithForbidden(route)
+  );
 }
 
 /**
@@ -37,4 +52,12 @@ function hasVisible(route?: RouteRecordRaw) {
   return !route?.meta?.hideInMenu;
 }
 
+/**
+ * 判断路由是否在菜单中显示,但是访问会被重定向到403
+ * @param route
+ */
+function menuHasVisibleWithForbidden(route: RouteRecordRaw) {
+  return !!route.meta?.menuVisibleWithForbidden;
+}
+
 export { generatorRoutes, hasAuthority, hasVisible };

+ 2 - 2
packages/@vben-core/forward/helpers/src/merge-route-modules.test.ts

@@ -1,11 +1,11 @@
 import type { RouteRecordRaw } from 'vue-router';
 
+import type { RouteModuleType } from './merge-route-modules';
+
 import { describe, expect, it } from 'vitest';
 
 import { mergeRouteModules } from './merge-route-modules';
 
-import type { RouteModuleType } from './merge-route-modules';
-
 describe('mergeRouteModules', () => {
   it('should merge route modules correctly', () => {
     const routeModules: Record<string, RouteModuleType> = {

+ 2 - 2
packages/@vben-core/forward/preferences/src/index.ts

@@ -1,9 +1,9 @@
 import type { Flatten } from '@vben-core/typings';
 
-import { preferencesManager } from './preferences';
-
 import type { Preferences } from './types';
 
+import { preferencesManager } from './preferences';
+
 // 偏好设置(带有层级关系)
 const preferences: Preferences = preferencesManager.getPreferences();
 

+ 4 - 3
packages/@vben-core/forward/preferences/src/preferences.ts

@@ -4,6 +4,10 @@ import type {
   FlattenObjectKeys,
 } from '@vben-core/typings';
 
+import type { Preferences } from './types';
+
+import { markRaw, reactive, watch } from 'vue';
+
 import { StorageManager } from '@vben-core/cache';
 import { flattenObject, nestedObject } from '@vben-core/helpers';
 import { convertToHslCssVar, merge } from '@vben-core/toolkit';
@@ -14,12 +18,9 @@ import {
   useCssVar,
   useDebounceFn,
 } from '@vueuse/core';
-import { markRaw, reactive, watch } from 'vue';
 
 import { defaultPreferences } from './config';
 
-import type { Preferences } from './types';
-
 const STORAGE_KEY = 'preferences';
 const STORAGE_KEY_LOCALE = `${STORAGE_KEY}-locale`;
 const STORAGE_KEY_THEME = `${STORAGE_KEY}-theme`;

+ 2 - 2
packages/@vben-core/forward/preferences/src/use-preferences.ts

@@ -1,7 +1,7 @@
-import { diff } from '@vben-core/toolkit';
-
 import { computed } from 'vue';
 
+import { diff } from '@vben-core/toolkit';
+
 import { isDarkTheme, preferencesManager } from './preferences';
 
 function usePreferences() {

+ 2 - 2
packages/@vben-core/forward/request/src/request-client/request-client.ts

@@ -6,6 +6,8 @@ import type {
   InternalAxiosRequestConfig,
 } from 'axios';
 
+import type { MakeAuthorizationFn, RequestClientOptions } from './types';
+
 import { merge } from '@vben-core/toolkit';
 
 import axios from 'axios';
@@ -15,8 +17,6 @@ import { FileDownloader } from './modules/downloader';
 import { InterceptorManager } from './modules/interceptor';
 import { FileUploader } from './modules/uploader';
 
-import type { MakeAuthorizationFn, RequestClientOptions } from './types';
-
 class RequestClient {
   private instance: AxiosInstance;
   private makeAuthorization: MakeAuthorizationFn | undefined;

+ 0 - 1
packages/@vben-core/forward/stores/src/modules/access.ts

@@ -1,5 +1,4 @@
 import type { MenuRecordRaw } from '@vben-core/typings';
-
 import type { RouteRecordRaw } from 'vue-router';
 
 import { acceptHMRUpdate, defineStore } from 'pinia';

+ 2 - 1
packages/@vben-core/forward/stores/src/modules/tabs.test.ts

@@ -1,6 +1,7 @@
+import { createRouter, createWebHistory } from 'vue-router';
+
 import { createPinia, setActivePinia } from 'pinia';
 import { beforeEach, describe, expect, it, vi } from 'vitest';
-import { createRouter, createWebHistory } from 'vue-router';
 
 import { useTabsStore } from './tabs';
 

+ 4 - 2
packages/@vben-core/forward/stores/src/modules/tabs.ts

@@ -1,9 +1,11 @@
+import type { RouteRecordNormalized, Router } from 'vue-router';
+
+import { toRaw } from 'vue';
+
 import { startProgress, stopProgress } from '@vben-core/toolkit';
 import { TabItem } from '@vben-core/typings';
-import type { RouteRecordNormalized, Router } from 'vue-router';
 
 import { acceptHMRUpdate, defineStore } from 'pinia';
-import { toRaw } from 'vue';
 
 /**
  * @zh_CN 克隆路由,防止路由被修改

+ 2 - 1
packages/@vben-core/shared/iconify/src/factory.ts

@@ -1,6 +1,7 @@
-import { Icon } from '@iconify/vue';
 import { defineComponent, h } from 'vue';
 
+import { Icon } from '@iconify/vue';
+
 function createIcon(name: string) {
   return defineComponent({
     setup(props, { attrs }) {

+ 5 - 0
packages/@vben-core/shared/typings/src/vue-router.d.ts

@@ -72,6 +72,10 @@ interface RouteMeta {
    * 路由是否已经加载过
    */
   loaded?: boolean;
+  /**
+   * 菜单可以看到,但是访问会被重定向到403
+   */
+  menuVisibleWithForbidden?: boolean;
   /**
    * 用于路由->菜单排序
    */
@@ -80,6 +84,7 @@ interface RouteMeta {
    * 外链-跳转路径
    */
   target?: string;
+
   /**
    * 标题名称
    */

+ 2 - 2
packages/@vben-core/shared/typings/vue-router.d.ts

@@ -1,7 +1,7 @@
-import 'vue-router';
-
 import type { RouteMeta as IRouteMeta } from '@vben-core/typings';
 
+import 'vue-router';
+
 declare module 'vue-router' {
   interface RouteMeta extends IRouteMeta {}
 }

+ 0 - 1
packages/@vben-core/uikit/layout-ui/src/components/layout-content.vue

@@ -2,7 +2,6 @@
 import type { ContentCompactType } from '@vben-core/typings';
 
 import type { CSSProperties } from 'vue';
-
 import { computed } from 'vue';
 
 interface Props {

+ 2 - 3
packages/@vben-core/uikit/layout-ui/src/components/layout-footer.vue

@@ -1,10 +1,9 @@
 <script setup lang="ts">
-import { useNamespace } from '@vben-core/toolkit';
-
 import type { CSSProperties } from 'vue';
-
 import { computed } from 'vue';
 
+import { useNamespace } from '@vben-core/toolkit';
+
 interface Props {
   /**
    * 背景颜色

+ 3 - 4
packages/@vben-core/uikit/layout-ui/src/components/layout-header.vue

@@ -1,11 +1,10 @@
 <script setup lang="ts">
-import { IcRoundMenu } from '@vben-core/iconify';
-import { VbenIconButton } from '@vben-core/shadcn-ui';
-
 import type { CSSProperties } from 'vue';
-
 import { computed, useSlots } from 'vue';
 
+import { IcRoundMenu } from '@vben-core/iconify';
+import { VbenIconButton } from '@vben-core/shadcn-ui';
+
 interface Props {
   /**
    * 背景颜色

+ 3 - 4
packages/@vben-core/uikit/layout-ui/src/components/layout-side.vue

@@ -1,12 +1,11 @@
 <script setup lang="ts">
-import { ScrollArea } from '@vben-core/shadcn-ui';
-import { useNamespace } from '@vben-core/toolkit';
-
 import type { CSSProperties } from 'vue';
-
 // import { onClickOutside } from '@vueuse/core';
 import { computed, ref, shallowRef, useSlots, watchEffect } from 'vue';
 
+import { ScrollArea } from '@vben-core/shadcn-ui';
+import { useNamespace } from '@vben-core/toolkit';
+
 import { SideCollapseButton, SidePinButton } from './widgets';
 
 interface Props {

+ 0 - 1
packages/@vben-core/uikit/layout-ui/src/components/layout-tabs.vue

@@ -1,6 +1,5 @@
 <script setup lang="ts">
 import type { CSSProperties } from 'vue';
-
 import { computed } from 'vue';
 
 interface Props {

+ 1 - 1
packages/@vben-core/uikit/layout-ui/src/vben-layout.vue

@@ -1,8 +1,8 @@
 <script setup lang="ts">
 import type { CSSProperties } from 'vue';
+import { computed, ref, watch } from 'vue';
 
 import { useMouse, useScroll, useThrottleFn } from '@vueuse/core';
-import { computed, ref, watch } from 'vue';
 
 import {
   LayoutContent,

+ 4 - 4
packages/@vben-core/uikit/menu-ui/src/components/menu-item.vue

@@ -1,12 +1,12 @@
 <script lang="ts" setup>
-import { VbenIcon, VbenMenuBadge, VbenTooltip } from '@vben-core/shadcn-ui';
-import { useNamespace } from '@vben-core/toolkit';
+import type { MenuItemProps, MenuItemRegistered } from '../interface';
 
 import { computed, onBeforeUnmount, onMounted, reactive, useSlots } from 'vue';
 
-import { useMenu, useMenuContext, useSubMenuContext } from '../hooks';
+import { VbenIcon, VbenMenuBadge, VbenTooltip } from '@vben-core/shadcn-ui';
+import { useNamespace } from '@vben-core/toolkit';
 
-import type { MenuItemProps, MenuItemRegistered } from '../interface';
+import { useMenu, useMenuContext, useSubMenuContext } from '../hooks';
 
 interface Props extends MenuItemProps {}
 

+ 11 - 10
packages/@vben-core/uikit/menu-ui/src/components/menu.vue

@@ -1,8 +1,11 @@
 <script lang="ts" setup>
-import { IcRoundMoreHoriz } from '@vben-core/iconify';
-import { isHttpUrl, useNamespace } from '@vben-core/toolkit';
+import type {
+  MenuItemClicked,
+  MenuItemRegistered,
+  MenuProps,
+  MenuProvider,
+} from '../interface';
 
-import { UseResizeObserverReturn, useResizeObserver } from '@vueuse/core';
 import {
   type VNodeArrayChildren,
   computed,
@@ -15,6 +18,11 @@ import {
   watchEffect,
 } from 'vue';
 
+import { IcRoundMoreHoriz } from '@vben-core/iconify';
+import { isHttpUrl, useNamespace } from '@vben-core/toolkit';
+
+import { UseResizeObserverReturn, useResizeObserver } from '@vueuse/core';
+
 import {
   createMenuContext,
   createSubMenuContext,
@@ -23,13 +31,6 @@ import {
 import { flattedChildren } from '../utils';
 import SubMenu from './sub-menu.vue';
 
-import type {
-  MenuItemClicked,
-  MenuItemRegistered,
-  MenuProps,
-  MenuProvider,
-} from '../interface';
-
 interface Props extends MenuProps {}
 
 defineOptions({ name: 'Menu' });

+ 2 - 2
packages/@vben-core/uikit/menu-ui/src/components/normal-menu/normal-menu.vue

@@ -1,11 +1,11 @@
 <script setup lang="ts">
 import type { MenuRecordRaw } from '@vben-core/typings';
 
+import type { NormalMenuProps } from './normal-menu';
+
 import { VbenIcon } from '@vben-core/shadcn-ui';
 import { useNamespace } from '@vben-core/toolkit';
 
-import type { NormalMenuProps } from './normal-menu';
-
 interface Props extends NormalMenuProps {}
 
 defineOptions({

+ 4 - 4
packages/@vben-core/uikit/menu-ui/src/components/sub-menu-content.vue

@@ -1,4 +1,8 @@
 <script lang="ts" setup>
+import type { MenuItemProps } from '../interface';
+
+import { computed } from 'vue';
+
 import {
   IcRoundChevronRight,
   IcRoundKeyboardArrowDown,
@@ -6,12 +10,8 @@ import {
 import { VbenIcon } from '@vben-core/shadcn-ui';
 import { useNamespace } from '@vben-core/toolkit';
 
-import { computed } from 'vue';
-
 import { useMenuContext } from '../hooks';
 
-import type { MenuItemProps } from '../interface';
-
 interface Props extends MenuItemProps {
   isMenuMore: boolean;
   isTopLevelMenuSubmenu: boolean;

+ 8 - 8
packages/@vben-core/uikit/menu-ui/src/components/sub-menu.vue

@@ -1,11 +1,17 @@
 <script lang="ts" setup>
 import type { HoverCardContentProps } from '@vben-core/shadcn-ui';
 
-import { VbenHoverCard } from '@vben-core/shadcn-ui';
-import { useNamespace } from '@vben-core/toolkit';
+import type {
+  MenuItemRegistered,
+  MenuProvider,
+  SubMenuProps,
+} from '../interface';
 
 import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue';
 
+import { VbenHoverCard } from '@vben-core/shadcn-ui';
+import { useNamespace } from '@vben-core/toolkit';
+
 import {
   createSubMenuContext,
   useMenu,
@@ -16,12 +22,6 @@ import {
 import CollapseTransition from './collapse-transition.vue';
 import SubMenuContent from './sub-menu-content.vue';
 
-import type {
-  MenuItemRegistered,
-  MenuProvider,
-  SubMenuProps,
-} from '../interface';
-
 interface Props extends SubMenuProps {
   isSubMenuMore?: boolean;
 }

+ 2 - 2
packages/@vben-core/uikit/menu-ui/src/hooks/use-menu-context.ts

@@ -1,9 +1,9 @@
+import type { MenuProvider, SubMenuProvider } from '../interface';
+
 import { getCurrentInstance, inject, provide } from 'vue';
 
 import { findComponentUpward } from '../utils';
 
-import type { MenuProvider, SubMenuProvider } from '../interface';
-
 const menuContextKey = Symbol('menuContext');
 
 /**

+ 2 - 2
packages/@vben-core/uikit/menu-ui/src/sub-menu.vue

@@ -1,10 +1,10 @@
 <script setup lang="ts">
 import type { MenuRecordRaw } from '@vben-core/typings';
 
-import { VbenMenuBadge } from '@vben-core/shadcn-ui';
-
 import { computed } from 'vue';
 
+import { VbenMenuBadge } from '@vben-core/shadcn-ui';
+
 import { MenuItem, SubMenu as SubMenuComp } from './components';
 // eslint-disable-next-line import/no-self-import
 import SubMenu from './sub-menu.vue';

+ 0 - 1
packages/@vben-core/uikit/menu-ui/src/utils/index.ts

@@ -4,7 +4,6 @@ import type {
   VNodeChild,
   VNodeNormalizedChildren,
 } from 'vue';
-
 import { isVNode } from 'vue';
 
 type VNodeChildAtom = Exclude<VNodeChild, Array<any>>;

+ 1 - 1
packages/@vben-core/uikit/shadcn-ui/src/components/avatar/avatar.vue

@@ -6,9 +6,9 @@ import type {
 } from 'radix-vue';
 
 import type { HTMLAttributes } from 'vue';
+import { computed } from 'vue';
 
 import { Avatar, AvatarFallback, AvatarImage } from '#/components/ui/avatar';
-import { computed } from 'vue';
 
 interface Props extends AvatarRootProps, AvatarFallbackProps, AvatarImageProps {
   alt?: string;

+ 3 - 3
packages/@vben-core/uikit/shadcn-ui/src/components/back-top/back-top.vue

@@ -1,13 +1,13 @@
 <script lang="ts" setup>
-import { IcRoundArrowUpward } from '@vben-core/iconify';
+import type { BacktopProps } from './backtop';
 
 import { computed } from 'vue';
 
+import { IcRoundArrowUpward } from '@vben-core/iconify';
+
 import { VbenButton } from '../button';
 import { useBackTop } from './use-backtop';
 
-import type { BacktopProps } from './backtop';
-
 interface Props extends BacktopProps {}
 
 defineOptions({ name: 'BackTop' });

+ 3 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/back-top/use-backtop.ts

@@ -1,7 +1,8 @@
-import { useEventListener, useThrottleFn } from '@vueuse/core';
+import type { BacktopProps } from './backtop';
+
 import { onMounted, ref, shallowRef } from 'vue';
 
-import type { BacktopProps } from './backtop';
+import { useEventListener, useThrottleFn } from '@vueuse/core';
 
 export const useBackTop = (props: BacktopProps) => {
   const el = shallowRef<HTMLElement>();

+ 2 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/breadcrumb/breadcrumb-background.vue

@@ -1,8 +1,8 @@
 <script lang="ts" setup>
-import { VbenIcon } from '../icon';
-
 import type { IBreadcrumb } from './interface';
 
+import { VbenIcon } from '../icon';
+
 interface Props {
   breadcrumbs: IBreadcrumb[];
   showIcon?: boolean;

+ 2 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/breadcrumb/breadcrumb.vue

@@ -1,4 +1,6 @@
 <script lang="ts" setup>
+import type { IBreadcrumb } from './interface';
+
 import { IcRoundKeyboardArrowDown } from '@vben-core/iconify';
 
 import {
@@ -18,8 +20,6 @@ import {
 
 import { VbenIcon } from '../';
 
-import type { IBreadcrumb } from './interface';
-
 interface Props {
   breadcrumbs: IBreadcrumb[];
   showIcon?: boolean;

+ 4 - 3
packages/@vben-core/uikit/shadcn-ui/src/components/button/button.vue

@@ -1,12 +1,13 @@
 <script setup lang="ts">
+import type { HTMLAttributes } from 'vue';
+import { computed } from 'vue';
+
 import { MdiLoading } from '@vben-core/iconify';
 
-import type { HTMLAttributes } from 'vue';
+import { Primitive, type PrimitiveProps } from 'radix-vue';
 
 import { type ButtonVariants, buttonVariants } from '#/components/ui/button';
 import { cn } from '#/lib/utils';
-import { Primitive, type PrimitiveProps } from 'radix-vue';
-import { computed } from 'vue';
 
 interface Props extends PrimitiveProps {
   class?: HTMLAttributes['class'];

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/button/icon-button.vue

@@ -1,9 +1,11 @@
 <script setup lang="ts">
+import { type HTMLAttributes, computed, useSlots } from 'vue';
+
+import { type PrimitiveProps } from 'radix-vue';
+
 import { VbenTooltip } from '#/components/tooltip';
 import { ButtonVariants } from '#/components/ui/button';
 import { cn } from '#/lib/utils';
-import { type PrimitiveProps } from 'radix-vue';
-import { type HTMLAttributes, computed, useSlots } from 'vue';
 
 import VbenButton from './button.vue';
 

+ 2 - 1
packages/@vben-core/uikit/shadcn-ui/src/components/checkbox/checkbox.vue

@@ -1,9 +1,10 @@
 <script setup lang="ts">
 import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
 
-import { Checkbox } from '#/components/ui/checkbox';
 import { useForwardPropsEmits } from 'radix-vue';
 
+import { Checkbox } from '#/components/ui/checkbox';
+
 const props = defineProps<
   {
     name: string;

+ 5 - 4
packages/@vben-core/uikit/shadcn-ui/src/components/context-menu/context-menu.vue

@@ -5,7 +5,12 @@ import type {
   ContextMenuRootProps,
 } from 'radix-vue';
 
+import type { IContextMenuItem } from './interface';
+
 import type { HTMLAttributes } from 'vue';
+import { computed } from 'vue';
+
+import { useForwardPropsEmits } from 'radix-vue';
 
 import {
   ContextMenu,
@@ -15,10 +20,6 @@ import {
   ContextMenuShortcut,
   ContextMenuTrigger,
 } from '#/components/ui/context-menu';
-import { useForwardPropsEmits } from 'radix-vue';
-import { computed } from 'vue';
-
-import type { IContextMenuItem } from './interface';
 
 const props = defineProps<
   {

+ 5 - 5
packages/@vben-core/uikit/shadcn-ui/src/components/dropdown-menu/dropdown-menu.vue

@@ -1,4 +1,9 @@
 <script lang="ts" setup>
+import type {
+  DropdownMenuProps,
+  VbenDropdownMenuItem as IDropdownMenuItem,
+} from './interface';
+
 import {
   DropdownMenu,
   DropdownMenuContent,
@@ -8,11 +13,6 @@ import {
   DropdownMenuTrigger,
 } from '#/components/ui/dropdown-menu';
 
-import type {
-  DropdownMenuProps,
-  VbenDropdownMenuItem as IDropdownMenuItem,
-} from './interface';
-
 interface Props extends DropdownMenuProps {}
 
 defineOptions({ name: 'DropdownMenu' });

+ 2 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/dropdown-menu/dropdown-radio-menu.vue

@@ -1,4 +1,6 @@
 <script lang="ts" setup>
+import type { DropdownMenuProps } from './interface';
+
 import {
   DropdownMenu,
   DropdownMenuContent,
@@ -7,8 +9,6 @@ import {
   DropdownMenuTrigger,
 } from '#/components/ui/dropdown-menu';
 
-import type { DropdownMenuProps } from './interface';
-
 interface Props extends DropdownMenuProps {}
 
 defineOptions({ name: 'DropdownRadioMenu' });

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/hover-card/hover-card.vue

@@ -1,13 +1,15 @@
 <script setup lang="ts">
 import type { HoverCardRootEmits, HoverCardRootProps } from 'radix-vue';
 
+import { HTMLAttributes, computed } from 'vue';
+
+import { HoverCardContentProps, useForwardPropsEmits } from 'radix-vue';
+
 import {
   HoverCard,
   HoverCardContent,
   HoverCardTrigger,
 } from '#/components/ui/hover-card';
-import { HoverCardContentProps, useForwardPropsEmits } from 'radix-vue';
-import { HTMLAttributes, computed } from 'vue';
 
 const props = defineProps<
   {

+ 2 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/icon/icon.vue

@@ -1,9 +1,9 @@
 <script setup lang="ts">
+import { type Component, computed } from 'vue';
+
 import { Icon, IconDefault } from '@vben-core/iconify';
 import { isHttpUrl, isObject, isString } from '@vben-core/toolkit';
 
-import { type Component, computed } from 'vue';
-
 const props = defineProps<{
   // 没有是否显示默认图标
   fallback?: boolean;

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/input-password/input-password.vue

@@ -1,12 +1,14 @@
 <script setup lang="ts">
+import { ref, useSlots } from 'vue';
+
 import {
   IcOutlineVisibility,
   IcOutlineVisibilityOff,
 } from '@vben-core/iconify';
 
-import { type InputProps, VbenInput } from '#/components/input/index';
 import { useForwardProps } from 'radix-vue';
-import { ref, useSlots } from 'vue';
+
+import { type InputProps, VbenInput } from '#/components/input/index';
 
 import PasswordStrength from './password-strength.vue';
 

+ 2 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/input/input.vue

@@ -1,8 +1,8 @@
 <script setup lang="ts">
-import { computed } from 'vue';
-
 import type { InputProps } from './interface';
 
+import { computed } from 'vue';
+
 defineOptions({
   inheritAttrs: false,
 });

+ 2 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/menu-badge/menu-badge.vue

@@ -1,10 +1,10 @@
 <script setup lang="ts">
 import type { MenuRecordBadgeRaw } from '@vben-core/typings';
 
-import { isValidColor } from '@vben-core/toolkit';
-
 import { computed } from 'vue';
 
+import { isValidColor } from '@vben-core/toolkit';
+
 import BadgeDot from './menu-badge-dot.vue';
 
 interface Props extends MenuRecordBadgeRaw {

+ 4 - 3
packages/@vben-core/uikit/shadcn-ui/src/components/pin-input/input.vue

@@ -1,13 +1,14 @@
 <script setup lang="ts">
+import type { PinInputProps } from './interface';
+
+import { computed, ref, watch } from 'vue';
+
 import { VbenButton } from '#/components/button';
 import {
   PinInput,
   PinInputGroup,
   PinInputInput,
 } from '#/components/ui/pin-input';
-import { computed, ref, watch } from 'vue';
-
-import type { PinInputProps } from './interface';
 
 defineOptions({
   inheritAttrs: false,

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/popover/popover.vue

@@ -5,13 +5,15 @@ import type {
   PopoverRootProps,
 } from 'radix-vue';
 
+import { HTMLAttributes, computed } from 'vue';
+
+import { useForwardPropsEmits } from 'radix-vue';
+
 import {
   PopoverContent,
   Popover as PopoverRoot,
   PopoverTrigger,
 } from '#/components/ui/popover';
-import { useForwardPropsEmits } from 'radix-vue';
-import { HTMLAttributes, computed } from 'vue';
 
 const props = withDefaults(
   defineProps<

+ 6 - 4
packages/@vben-core/uikit/shadcn-ui/src/components/segmented/segmented.vue

@@ -1,11 +1,13 @@
 <script setup lang="ts">
-import { Tabs, TabsContent, TabsList } from '#/components/ui/tabs';
-import { TabsTrigger } from 'radix-vue';
+import type { SegmentedItem } from './interface';
+
 import { computed } from 'vue';
 
-import TabsIndicator from './tabs-indicator.vue';
+import { TabsTrigger } from 'radix-vue';
 
-import type { SegmentedItem } from './interface';
+import { Tabs, TabsContent, TabsList } from '#/components/ui/tabs';
+
+import TabsIndicator from './tabs-indicator.vue';
 
 interface Props {
   defaultValue?: string;

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/segmented/tabs-indicator.vue

@@ -1,11 +1,13 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
+import { type HTMLAttributes, computed } from 'vue';
+
 import {
   TabsIndicator,
   type TabsIndicatorProps,
   useForwardProps,
 } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
+
+import { cn } from '#/lib/utils';
 
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & TabsIndicatorProps

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/sheet/sheet.vue

@@ -1,4 +1,8 @@
 <script setup lang="ts">
+import { computed, useSlots } from 'vue';
+
+import { Cross2Icon } from '@radix-icons/vue';
+
 import { VbenButton, VbenIconButton } from '#/components/button';
 import { ScrollArea } from '#/components/ui/scroll-area';
 import {
@@ -11,8 +15,6 @@ import {
   SheetTitle,
   SheetTrigger,
 } from '#/components/ui/sheet';
-import { Cross2Icon } from '@radix-icons/vue';
-import { computed, useSlots } from 'vue';
 
 interface Props {
   cancelText?: string;

+ 2 - 1
packages/@vben-core/uikit/shadcn-ui/src/components/tooltip/tooltip.vue

@@ -1,11 +1,12 @@
 <script setup lang="ts">
+import { TooltipContentProps } from 'radix-vue';
+
 import {
   Tooltip,
   TooltipContent,
   TooltipProvider,
   TooltipTrigger,
 } from '#/components/ui/tooltip';
-import { TooltipContentProps } from 'radix-vue';
 
 interface Props {
   delayDuration?: number;

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogAction.vue

@@ -1,8 +1,10 @@
 <script setup lang="ts">
+import { type HTMLAttributes, computed } from 'vue';
+
+import { AlertDialogAction, type AlertDialogActionProps } from 'radix-vue';
+
 import { buttonVariants } from '#/components/ui/button';
 import { cn } from '#/lib/utils';
-import { AlertDialogAction, type AlertDialogActionProps } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
 
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & AlertDialogActionProps

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogCancel.vue

@@ -1,8 +1,10 @@
 <script setup lang="ts">
+import { type HTMLAttributes, computed } from 'vue';
+
+import { AlertDialogCancel, type AlertDialogCancelProps } from 'radix-vue';
+
 import { buttonVariants } from '#/components/ui/button';
 import { cn } from '#/lib/utils';
-import { AlertDialogCancel, type AlertDialogCancelProps } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
 
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & AlertDialogCancelProps

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogContent.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
+import { type HTMLAttributes, computed } from 'vue';
+
 import {
   AlertDialogContent,
   type AlertDialogContentEmits,
@@ -8,7 +9,8 @@ import {
   AlertDialogPortal,
   useForwardPropsEmits,
 } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
+
+import { cn } from '#/lib/utils';
 
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & AlertDialogContentProps

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogDescription.vue

@@ -1,10 +1,12 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
+import { type HTMLAttributes, computed } from 'vue';
+
 import {
   AlertDialogDescription,
   type AlertDialogDescriptionProps,
 } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
+
+import { cn } from '#/lib/utils';
 
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & AlertDialogDescriptionProps

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogTitle.vue

@@ -1,8 +1,10 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
-import { AlertDialogTitle, type AlertDialogTitleProps } from 'radix-vue';
 import { type HTMLAttributes, computed } from 'vue';
 
+import { AlertDialogTitle, type AlertDialogTitleProps } from 'radix-vue';
+
+import { cn } from '#/lib/utils';
+
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & AlertDialogTitleProps
 >();

+ 2 - 1
packages/@vben-core/uikit/shadcn-ui/src/components/ui/avatar/Avatar.vue

@@ -1,9 +1,10 @@
 <script setup lang="ts">
 import type { HTMLAttributes } from 'vue';
 
-import { cn } from '#/lib/utils';
 import { AvatarRoot } from 'radix-vue';
 
+import { cn } from '#/lib/utils';
+
 import { type AvatarVariants, avatarVariant } from './avatar';
 
 const props = withDefaults(

+ 2 - 1
packages/@vben-core/uikit/shadcn-ui/src/components/ui/breadcrumb/BreadcrumbEllipsis.vue

@@ -1,9 +1,10 @@
 <script lang="ts" setup>
 import type { HTMLAttributes } from 'vue';
 
-import { cn } from '#/lib/utils';
 import { DotsHorizontalIcon } from '@radix-icons/vue';
 
+import { cn } from '#/lib/utils';
+
 const props = defineProps<{
   class?: HTMLAttributes['class'];
 }>();

+ 2 - 1
packages/@vben-core/uikit/shadcn-ui/src/components/ui/breadcrumb/BreadcrumbLink.vue

@@ -1,9 +1,10 @@
 <script lang="ts" setup>
 import type { HTMLAttributes } from 'vue';
 
-import { cn } from '#/lib/utils';
 import { Primitive, type PrimitiveProps } from 'radix-vue';
 
+import { cn } from '#/lib/utils';
+
 const props = withDefaults(
   defineProps<{ class?: HTMLAttributes['class'] } & PrimitiveProps>(),
   {

+ 2 - 1
packages/@vben-core/uikit/shadcn-ui/src/components/ui/breadcrumb/BreadcrumbSeparator.vue

@@ -1,9 +1,10 @@
 <script lang="ts" setup>
 import type { HTMLAttributes } from 'vue';
 
-import { cn } from '#/lib/utils';
 import { ChevronRightIcon } from '@radix-icons/vue';
 
+import { cn } from '#/lib/utils';
+
 const props = defineProps<{
   class?: HTMLAttributes['class'];
 }>();

+ 2 - 1
packages/@vben-core/uikit/shadcn-ui/src/components/ui/button/Button.vue

@@ -1,9 +1,10 @@
 <script setup lang="ts">
 import type { HTMLAttributes } from 'vue';
 
-import { cn } from '#/lib/utils';
 import { Primitive, type PrimitiveProps } from 'radix-vue';
 
+import { cn } from '#/lib/utils';
+
 import { type ButtonVariants, buttonVariants } from './button';
 
 interface Props extends PrimitiveProps {

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/checkbox/Checkbox.vue

@@ -1,14 +1,16 @@
 <script setup lang="ts">
 import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
 
-import { cn } from '#/lib/utils';
+import { type HTMLAttributes, computed } from 'vue';
+
 import { CheckIcon } from '@radix-icons/vue';
 import {
   CheckboxIndicator,
   CheckboxRoot,
   useForwardPropsEmits,
 } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
+
+import { cn } from '#/lib/utils';
 
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & CheckboxRootProps

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuCheckboxItem.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
+import { type HTMLAttributes, computed } from 'vue';
+
 import { CheckIcon } from '@radix-icons/vue';
 import {
   ContextMenuCheckboxItem,
@@ -8,7 +9,8 @@ import {
   ContextMenuItemIndicator,
   useForwardPropsEmits,
 } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
+
+import { cn } from '#/lib/utils';
 
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & ContextMenuCheckboxItemProps

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuContent.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
+import { type HTMLAttributes, computed } from 'vue';
+
 import {
   ContextMenuContent,
   type ContextMenuContentEmits,
@@ -7,7 +8,8 @@ import {
   ContextMenuPortal,
   useForwardPropsEmits,
 } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
+
+import { cn } from '#/lib/utils';
 
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & ContextMenuContentProps

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuItem.vue

@@ -1,12 +1,14 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
+import { type HTMLAttributes, computed } from 'vue';
+
 import {
   ContextMenuItem,
   type ContextMenuItemEmits,
   type ContextMenuItemProps,
   useForwardPropsEmits,
 } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
+
+import { cn } from '#/lib/utils';
 
 const props = defineProps<
   { class?: HTMLAttributes['class']; inset?: boolean } & ContextMenuItemProps

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuLabel.vue

@@ -1,8 +1,10 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
-import { ContextMenuLabel, type ContextMenuLabelProps } from 'radix-vue';
 import { type HTMLAttributes, computed } from 'vue';
 
+import { ContextMenuLabel, type ContextMenuLabelProps } from 'radix-vue';
+
+import { cn } from '#/lib/utils';
+
 const props = defineProps<
   { class?: HTMLAttributes['class']; inset?: boolean } & ContextMenuLabelProps
 >();

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuRadioItem.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
+import { type HTMLAttributes, computed } from 'vue';
+
 import { DotFilledIcon } from '@radix-icons/vue';
 import {
   ContextMenuItemIndicator,
@@ -8,7 +9,8 @@ import {
   type ContextMenuRadioItemProps,
   useForwardPropsEmits,
 } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
+
+import { cn } from '#/lib/utils';
 
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & ContextMenuRadioItemProps

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuSeparator.vue

@@ -1,10 +1,12 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
+import { type HTMLAttributes, computed } from 'vue';
+
 import {
   ContextMenuSeparator,
   type ContextMenuSeparatorProps,
 } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
+
+import { cn } from '#/lib/utils';
 
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & ContextMenuSeparatorProps

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuSubContent.vue

@@ -1,12 +1,14 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
+import { type HTMLAttributes, computed } from 'vue';
+
 import {
   ContextMenuSubContent,
   type DropdownMenuSubContentEmits,
   type DropdownMenuSubContentProps,
   useForwardPropsEmits,
 } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
+
+import { cn } from '#/lib/utils';
 
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & DropdownMenuSubContentProps

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/context-menu/ContextMenuSubTrigger.vue

@@ -1,12 +1,14 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
+import { type HTMLAttributes, computed } from 'vue';
+
 import { ChevronRightIcon } from '@radix-icons/vue';
 import {
   ContextMenuSubTrigger,
   type ContextMenuSubTriggerProps,
   useForwardProps,
 } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
+
+import { cn } from '#/lib/utils';
 
 const props = defineProps<
   {

+ 4 - 2
packages/@vben-core/uikit/shadcn-ui/src/components/ui/dialog/DialogContent.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
-import { cn } from '#/lib/utils';
+import { type HTMLAttributes, computed } from 'vue';
+
 import { Cross2Icon } from '@radix-icons/vue';
 import {
   DialogClose,
@@ -10,7 +11,8 @@ import {
   DialogPortal,
   useForwardPropsEmits,
 } from 'radix-vue';
-import { type HTMLAttributes, computed } from 'vue';
+
+import { cn } from '#/lib/utils';
 
 const props = defineProps<
   { class?: HTMLAttributes['class'] } & DialogContentProps

Some files were not shown because too many files changed in this diff