浏览代码

perf: format code with better style (#5283)

Vben 4 月之前
父节点
当前提交
081d2aed23
共有 100 个文件被更改,包括 403 次插入449 次删除
  1. 7 7
      .lintstagedrc.mjs
  2. 2 1
      apps/web-antd/src/adapter/component/index.ts
  3. 3 1
      apps/web-antd/src/locales/index.ts
  4. 3 5
      apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue
  5. 3 5
      apps/web-antd/src/views/dashboard/analytics/analytics-visits-data.vue
  6. 3 5
      apps/web-antd/src/views/dashboard/analytics/analytics-visits-sales.vue
  7. 3 5
      apps/web-antd/src/views/dashboard/analytics/analytics-visits-source.vue
  8. 3 5
      apps/web-antd/src/views/dashboard/analytics/analytics-visits.vue
  9. 1 1
      apps/web-antd/src/views/dashboard/analytics/index.vue
  10. 2 1
      apps/web-ele/src/adapter/component/index.ts
  11. 3 1
      apps/web-ele/src/locales/index.ts
  12. 3 5
      apps/web-ele/src/views/dashboard/analytics/analytics-trends.vue
  13. 3 5
      apps/web-ele/src/views/dashboard/analytics/analytics-visits-data.vue
  14. 3 5
      apps/web-ele/src/views/dashboard/analytics/analytics-visits-sales.vue
  15. 3 5
      apps/web-ele/src/views/dashboard/analytics/analytics-visits-source.vue
  16. 3 5
      apps/web-ele/src/views/dashboard/analytics/analytics-visits.vue
  17. 1 1
      apps/web-ele/src/views/dashboard/analytics/index.vue
  18. 2 1
      apps/web-naive/src/adapter/component/index.ts
  19. 2 2
      apps/web-naive/src/locales/index.ts
  20. 3 5
      apps/web-naive/src/views/dashboard/analytics/analytics-trends.vue
  21. 3 5
      apps/web-naive/src/views/dashboard/analytics/analytics-visits-data.vue
  22. 3 5
      apps/web-naive/src/views/dashboard/analytics/analytics-visits-sales.vue
  23. 3 5
      apps/web-naive/src/views/dashboard/analytics/analytics-visits-source.vue
  24. 3 5
      apps/web-naive/src/views/dashboard/analytics/analytics-visits.vue
  25. 1 1
      apps/web-naive/src/views/dashboard/analytics/index.vue
  26. 2 1
      apps/web-naive/src/views/demos/naive/index.vue
  27. 3 1
      docs/.vitepress/config/en.mts
  28. 3 1
      docs/.vitepress/config/zh.mts
  29. 0 1
      docs/.vitepress/theme/components/site-layout.vue
  30. 2 1
      docs/src/_env/adapter/component.ts
  31. 1 0
      internal/lint-configs/eslint-config/src/configs/import.ts
  32. 0 1
      internal/lint-configs/eslint-config/src/configs/javascript.ts
  33. 19 42
      internal/lint-configs/eslint-config/src/configs/perfectionist.ts
  34. 1 1
      internal/node-utils/src/index.ts
  35. 3 1
      internal/node-utils/src/spinner.ts
  36. 1 1
      internal/tailwind-config/src/index.ts
  37. 2 2
      internal/vite-config/src/plugins/importmap.ts
  38. 2 2
      internal/vite-config/src/plugins/inject-app-loading/index.ts
  39. 2 2
      internal/vite-config/src/utils/env.ts
  40. 1 1
      package.json
  41. 3 3
      packages/@core/base/icons/src/lucide.ts
  42. 1 1
      packages/@core/base/shared/package.json
  43. 9 9
      packages/@core/base/shared/src/cache/storage-manager.ts
  44. 6 6
      packages/@core/base/shared/src/utils/__tests__/util.test.ts
  45. 3 1
      packages/@core/base/shared/src/utils/cn.ts
  46. 6 6
      packages/@core/base/shared/src/utils/state-handler.ts
  47. 1 1
      packages/@core/base/typings/src/helper.d.ts
  48. 3 4
      packages/@core/base/typings/src/menu-record.ts
  49. 6 4
      packages/@core/base/typings/src/vue-router.d.ts
  50. 4 4
      packages/@core/composables/src/use-layout-style.ts
  51. 1 0
      packages/@core/composables/src/use-priority-value.ts
  52. 3 1
      packages/@core/composables/src/use-simple-locale/index.ts
  53. 84 84
      packages/@core/preferences/src/preferences.ts
  54. 2 1
      packages/@core/ui-kit/form-ui/src/config.ts
  55. 36 40
      packages/@core/ui-kit/form-ui/src/form-api.ts
  56. 2 2
      packages/@core/ui-kit/form-ui/src/form-render/form-field.vue
  57. 4 5
      packages/@core/ui-kit/form-ui/src/form-render/form.vue
  58. 1 1
      packages/@core/ui-kit/form-ui/src/form-render/index.ts
  59. 1 1
      packages/@core/ui-kit/form-ui/src/index.ts
  60. 10 9
      packages/@core/ui-kit/form-ui/src/types.ts
  61. 6 2
      packages/@core/ui-kit/form-ui/src/use-form-context.ts
  62. 2 4
      packages/@core/ui-kit/form-ui/src/vben-use-form.vue
  63. 2 1
      packages/@core/ui-kit/layout-ui/src/components/layout-content.vue
  64. 1 0
      packages/@core/ui-kit/layout-ui/src/components/layout-footer.vue
  65. 1 0
      packages/@core/ui-kit/layout-ui/src/components/layout-header.vue
  66. 1 0
      packages/@core/ui-kit/layout-ui/src/components/layout-sidebar.vue
  67. 1 0
      packages/@core/ui-kit/layout-ui/src/components/layout-tabbar.vue
  68. 2 1
      packages/@core/ui-kit/layout-ui/src/vben-layout.vue
  69. 1 1
      packages/@core/ui-kit/menu-ui/src/components/index.ts
  70. 2 1
      packages/@core/ui-kit/menu-ui/src/components/menu.vue
  71. 2 2
      packages/@core/ui-kit/menu-ui/src/types.ts
  72. 1 0
      packages/@core/ui-kit/menu-ui/src/utils/index.ts
  73. 4 15
      packages/@core/ui-kit/popup-ui/src/drawer/__tests__/drawer-api.test.ts
  74. 7 12
      packages/@core/ui-kit/popup-ui/src/drawer/drawer-api.ts
  75. 4 4
      packages/@core/ui-kit/popup-ui/src/drawer/drawer.ts
  76. 1 1
      packages/@core/ui-kit/popup-ui/src/drawer/use-drawer.ts
  77. 4 15
      packages/@core/ui-kit/popup-ui/src/modal/__tests__/modal-api.test.ts
  78. 7 12
      packages/@core/ui-kit/popup-ui/src/modal/modal-api.ts
  79. 4 4
      packages/@core/ui-kit/popup-ui/src/modal/modal.ts
  80. 2 1
      packages/@core/ui-kit/popup-ui/src/modal/use-modal-draggable.ts
  81. 1 1
      packages/@core/ui-kit/popup-ui/src/modal/use-modal.ts
  82. 3 2
      packages/@core/ui-kit/shadcn-ui/src/components/avatar/avatar.vue
  83. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb-view.vue
  84. 2 2
      packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/types.ts
  85. 2 2
      packages/@core/ui-kit/shadcn-ui/src/components/button/button.ts
  86. 4 3
      packages/@core/ui-kit/shadcn-ui/src/components/context-menu/context-menu.vue
  87. 2 1
      packages/@core/ui-kit/shadcn-ui/src/components/hover-card/hover-card.vue
  88. 3 1
      packages/@core/ui-kit/shadcn-ui/src/components/icon/icon.vue
  89. 2 1
      packages/@core/ui-kit/shadcn-ui/src/components/popover/popover.vue
  90. 1 0
      packages/@core/ui-kit/shadcn-ui/src/components/render-content/render-content.vue
  91. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/segmented/tabs-indicator.vue
  92. 2 1
      packages/@core/ui-kit/shadcn-ui/src/components/tooltip/tooltip.vue
  93. 3 6
      packages/@core/ui-kit/shadcn-ui/src/ui/accordion/Accordion.vue
  94. 4 2
      packages/@core/ui-kit/shadcn-ui/src/ui/accordion/AccordionContent.vue
  95. 4 6
      packages/@core/ui-kit/shadcn-ui/src/ui/accordion/AccordionItem.vue
  96. 4 6
      packages/@core/ui-kit/shadcn-ui/src/ui/accordion/AccordionTrigger.vue
  97. 3 1
      packages/@core/ui-kit/shadcn-ui/src/ui/avatar/Avatar.vue
  98. 3 1
      packages/@core/ui-kit/shadcn-ui/src/ui/avatar/AvatarFallback.vue
  99. 3 1
      packages/@core/ui-kit/shadcn-ui/src/ui/avatar/AvatarImage.vue
  100. 3 1
      packages/@core/ui-kit/shadcn-ui/src/ui/avatar/avatar.ts

+ 7 - 7
.lintstagedrc.mjs

@@ -1,4 +1,10 @@
 export default {
+  '*.md': ['prettier --cache --ignore-unknown --write'],
+  '*.vue': [
+    'prettier --write',
+    'eslint --cache --fix',
+    'stylelint --fix --allow-empty-input',
+  ],
   '*.{js,jsx,ts,tsx}': [
     'prettier --cache --ignore-unknown  --write',
     'eslint --cache --fix',
@@ -7,14 +13,8 @@ export default {
     'prettier --cache --ignore-unknown --write',
     'stylelint --fix --allow-empty-input',
   ],
-  '*.md': ['prettier --cache --ignore-unknown --write'],
-  '*.vue': [
-    'prettier --write',
-    'eslint --cache --fix',
-    'stylelint --fix --allow-empty-input',
-  ],
+  'package.json': ['prettier --cache --write'],
   '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': [
     'prettier --cache --write--parser json',
   ],
-  'package.json': ['prettier --cache --write'],
 };

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

@@ -3,9 +3,10 @@
  * 可用于 vben-form、vben-modal、vben-drawer 等组件使用,
  */
 
+import type { Component, SetupContext } from 'vue';
+
 import type { BaseFormComponentType } from '@vben/common-ui';
 
-import type { Component, SetupContext } from 'vue';
 import { h } from 'vue';
 
 import { ApiComponent, globalShareState, IconPicker } from '@vben/common-ui';

+ 3 - 1
apps/web-antd/src/locales/index.ts

@@ -1,7 +1,9 @@
-import type { LocaleSetupOptions, SupportedLanguagesType } from '@vben/locales';
 import type { Locale } from 'ant-design-vue/es/locale';
 
 import type { App } from 'vue';
+
+import type { LocaleSetupOptions, SupportedLanguagesType } from '@vben/locales';
+
 import { ref } from 'vue';
 
 import {

+ 3 - 5
apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 3 - 5
apps/web-antd/src/views/dashboard/analytics/analytics-visits-data.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 3 - 5
apps/web-antd/src/views/dashboard/analytics/analytics-visits-sales.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 3 - 5
apps/web-antd/src/views/dashboard/analytics/analytics-visits-source.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 3 - 5
apps/web-antd/src/views/dashboard/analytics/analytics-visits.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 1 - 1
apps/web-antd/src/views/dashboard/analytics/index.vue

@@ -15,10 +15,10 @@ import {
 } from '@vben/icons';
 
 import AnalyticsTrends from './analytics-trends.vue';
-import AnalyticsVisits from './analytics-visits.vue';
 import AnalyticsVisitsData from './analytics-visits-data.vue';
 import AnalyticsVisitsSales from './analytics-visits-sales.vue';
 import AnalyticsVisitsSource from './analytics-visits-source.vue';
+import AnalyticsVisits from './analytics-visits.vue';
 
 const overviewItems: AnalysisOverviewItem[] = [
   {

+ 2 - 1
apps/web-ele/src/adapter/component/index.ts

@@ -3,10 +3,11 @@
  * 可用于 vben-form、vben-modal、vben-drawer 等组件使用,
  */
 
+import type { Component, SetupContext } from 'vue';
+
 import type { BaseFormComponentType } from '@vben/common-ui';
 import type { Recordable } from '@vben/types';
 
-import type { Component, SetupContext } from 'vue';
 import { h } from 'vue';
 
 import { ApiComponent, globalShareState, IconPicker } from '@vben/common-ui';

+ 3 - 1
apps/web-ele/src/locales/index.ts

@@ -1,7 +1,9 @@
-import type { LocaleSetupOptions, SupportedLanguagesType } from '@vben/locales';
 import type { Language } from 'element-plus/es/locale';
 
 import type { App } from 'vue';
+
+import type { LocaleSetupOptions, SupportedLanguagesType } from '@vben/locales';
+
 import { ref } from 'vue';
 
 import {

+ 3 - 5
apps/web-ele/src/views/dashboard/analytics/analytics-trends.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 3 - 5
apps/web-ele/src/views/dashboard/analytics/analytics-visits-data.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 3 - 5
apps/web-ele/src/views/dashboard/analytics/analytics-visits-sales.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 3 - 5
apps/web-ele/src/views/dashboard/analytics/analytics-visits-source.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 3 - 5
apps/web-ele/src/views/dashboard/analytics/analytics-visits.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 1 - 1
apps/web-ele/src/views/dashboard/analytics/index.vue

@@ -15,10 +15,10 @@ import {
 } from '@vben/icons';
 
 import AnalyticsTrends from './analytics-trends.vue';
-import AnalyticsVisits from './analytics-visits.vue';
 import AnalyticsVisitsData from './analytics-visits-data.vue';
 import AnalyticsVisitsSales from './analytics-visits-sales.vue';
 import AnalyticsVisitsSource from './analytics-visits-source.vue';
+import AnalyticsVisits from './analytics-visits.vue';
 
 const overviewItems: AnalysisOverviewItem[] = [
   {

+ 2 - 1
apps/web-naive/src/adapter/component/index.ts

@@ -3,9 +3,10 @@
  * 可用于 vben-form、vben-modal、vben-drawer 等组件使用,
  */
 
+import type { Component, SetupContext } from 'vue';
+
 import type { BaseFormComponentType } from '@vben/common-ui';
 
-import type { Component, SetupContext } from 'vue';
 import { h } from 'vue';
 
 import { ApiComponent, globalShareState, IconPicker } from '@vben/common-ui';

+ 2 - 2
apps/web-naive/src/locales/index.ts

@@ -1,7 +1,7 @@
-import type { LocaleSetupOptions, SupportedLanguagesType } from '@vben/locales';
-
 import type { App } from 'vue';
 
+import type { LocaleSetupOptions, SupportedLanguagesType } from '@vben/locales';
+
 import {
   $t,
   setupI18n as coreSetup,

+ 3 - 5
apps/web-naive/src/views/dashboard/analytics/analytics-trends.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 3 - 5
apps/web-naive/src/views/dashboard/analytics/analytics-visits-data.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 3 - 5
apps/web-naive/src/views/dashboard/analytics/analytics-visits-sales.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 3 - 5
apps/web-naive/src/views/dashboard/analytics/analytics-visits-source.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 3 - 5
apps/web-naive/src/views/dashboard/analytics/analytics-visits.vue

@@ -1,11 +1,9 @@
 <script lang="ts" setup>
+import type { EchartsUIType } from '@vben/plugins/echarts';
+
 import { onMounted, ref } from 'vue';
 
-import {
-  EchartsUI,
-  type EchartsUIType,
-  useEcharts,
-} from '@vben/plugins/echarts';
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
 const chartRef = ref<EchartsUIType>();
 const { renderEcharts } = useEcharts(chartRef);

+ 1 - 1
apps/web-naive/src/views/dashboard/analytics/index.vue

@@ -15,10 +15,10 @@ import {
 } from '@vben/icons';
 
 import AnalyticsTrends from './analytics-trends.vue';
-import AnalyticsVisits from './analytics-visits.vue';
 import AnalyticsVisitsData from './analytics-visits-data.vue';
 import AnalyticsVisitsSales from './analytics-visits-sales.vue';
 import AnalyticsVisitsSource from './analytics-visits-source.vue';
+import AnalyticsVisits from './analytics-visits.vue';
 
 const overviewItems: AnalysisOverviewItem[] = [
   {

+ 2 - 1
apps/web-naive/src/views/demos/naive/index.vue

@@ -1,7 +1,8 @@
 <script lang="ts" setup>
+import type { NotificationType } from 'naive-ui';
+
 import { Page } from '@vben/common-ui';
 
-import { type NotificationType } from 'naive-ui';
 import { NButton, NCard, NSpace, useMessage, useNotification } from 'naive-ui';
 
 const notification = useNotification();

+ 3 - 1
docs/.vitepress/config/en.mts

@@ -1,4 +1,6 @@
-import { type DefaultTheme, defineConfig } from 'vitepress';
+import type { DefaultTheme } from 'vitepress';
+
+import { defineConfig } from 'vitepress';
 
 import { version } from '../../../package.json';
 

+ 3 - 1
docs/.vitepress/config/zh.mts

@@ -1,4 +1,6 @@
-import { type DefaultTheme, defineConfig } from 'vitepress';
+import type { DefaultTheme } from 'vitepress';
+
+import { defineConfig } from 'vitepress';
 
 import { version } from '../../../package.json';
 

+ 0 - 1
docs/.vitepress/theme/components/site-layout.vue

@@ -10,7 +10,6 @@ import {
 
 // import { useAntdDesignTokens } from '@vben/hooks';
 // import { initPreferences } from '@vben/preferences';
-
 import { ConfigProvider, theme } from 'ant-design-vue';
 import mediumZoom from 'medium-zoom';
 import { useRoute } from 'vitepress';

+ 2 - 1
docs/src/_env/adapter/component.ts

@@ -3,9 +3,10 @@
  * 可用于 vben-form、vben-modal、vben-drawer 等组件使用,
  */
 
+import type { Component, SetupContext } from 'vue';
+
 import type { BaseFormComponentType } from '@vben/common-ui';
 
-import type { Component, SetupContext } from 'vue';
 import { h } from 'vue';
 
 import { globalShareState } from '@vben/common-ui';

+ 1 - 0
internal/lint-configs/eslint-config/src/configs/import.ts

@@ -10,6 +10,7 @@ export async function importPluginConfig(): Promise<Linter.Config[]> {
         import: pluginImport,
       },
       rules: {
+        'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
         'import/first': 'error',
         'import/newline-after-import': 'error',
         'import/no-duplicates': 'error',

+ 0 - 1
internal/lint-configs/eslint-config/src/configs/javascript.ts

@@ -1,6 +1,5 @@
 import type { Linter } from 'eslint';
 
-// @ts-expect-error - no types
 import js from '@eslint/js';
 import pluginUnusedImports from 'eslint-plugin-unused-imports';
 import globals from 'globals';

+ 19 - 42
internal/lint-configs/eslint-config/src/configs/perfectionist.ts

@@ -1,8 +1,13 @@
 import type { Linter } from 'eslint';
 
-import perfectionistPlugin from 'eslint-plugin-perfectionist';
+import { interopDefault } from '../util';
 
 export async function perfectionist(): Promise<Linter.Config[]> {
+  const perfectionistPlugin = await interopDefault(
+    // @ts-expect-error - no types
+    import('eslint-plugin-perfectionist'),
+  );
+
   return [
     perfectionistPlugin.configs['recommended-natural'],
     {
@@ -19,21 +24,28 @@ export async function perfectionist(): Promise<Linter.Config[]> {
           {
             customGroups: {
               type: {
-                vben: 'vben',
-                vue: 'vue',
+                'vben-core-type': ['^@vben-core/.+'],
+                'vben-type': ['^@vben/.+'],
+                'vue-type': ['^vue$', '^vue-.+', '^@vue/.+'],
               },
               value: {
-                vben: ['@vben*', '@vben/**/**', '@vben-core/**/**'],
-                vue: ['vue', 'vue-*', '@vue*'],
+                vben: ['^@vben/.+'],
+                'vben-core': ['^@vben-core/.+'],
+                vue: ['^vue$', '^vue-.+', '^@vue/.+'],
               },
             },
+            environment: 'node',
             groups: [
               ['external-type', 'builtin-type', 'type'],
+              'vue-type',
+              'vben-type',
+              'vben-core-type',
               ['parent-type', 'sibling-type', 'index-type'],
               ['internal-type'],
               'builtin',
               'vue',
               'vben',
+              'vben-core',
               'external',
               'internal',
               ['parent', 'sibling', 'index'],
@@ -43,12 +55,13 @@ export async function perfectionist(): Promise<Linter.Config[]> {
               'object',
               'unknown',
             ],
-            internalPattern: ['#*', '#*/**'],
+            internalPattern: ['^#/.+'],
             newlinesBetween: 'always',
             order: 'asc',
             type: 'natural',
           },
         ],
+        'perfectionist/sort-modules': 'off',
         'perfectionist/sort-named-exports': [
           'error',
           {
@@ -67,42 +80,6 @@ export async function perfectionist(): Promise<Linter.Config[]> {
             groups: ['unknown', 'items', 'list', 'children'],
             ignorePattern: ['children'],
             order: 'asc',
-            partitionByComment: 'Part:**',
-            type: 'natural',
-          },
-        ],
-        'perfectionist/sort-vue-attributes': [
-          'error',
-          {
-            // Based on: https://vuejs.org/style-guide/rules-recommended.html#element-attribute-order
-            customGroups: {
-              /* eslint-disable perfectionist/sort-objects */
-              DEFINITION: '*(is|:is|v-is)',
-              LIST_RENDERING: 'v-for',
-              CONDITIONALS: 'v-*(else-if|if|else|show|cloak)',
-              RENDER_MODIFIERS: 'v-*(pre|once)',
-              GLOBAL: '*(:id|id)',
-              UNIQUE: '*(ref|key|:ref|:key)',
-              SLOT: '*(v-slot|slot)',
-              TWO_WAY_BINDING: '*(v-model|v-model:*)',
-              // OTHER_DIRECTIVES e.g. 'v-custom-directive'
-              EVENTS: '*(v-on|@*)',
-              CONTENT: 'v-*(html|text)',
-              /* eslint-enable perfectionist/sort-objects */
-            },
-            groups: [
-              'DEFINITION',
-              'LIST_RENDERING',
-              'CONDITIONALS',
-              'RENDER_MODIFIERS',
-              'GLOBAL',
-              'UNIQUE',
-              'SLOT',
-              'TWO_WAY_BINDING',
-              'unknown',
-              'EVENTS',
-              'CONTENT',
-            ],
             type: 'natural',
           },
         ],

+ 1 - 1
internal/node-utils/src/index.ts

@@ -2,7 +2,7 @@ export * from './constants';
 export * from './date';
 export * from './fs';
 export * from './git';
-export { add as gitAdd, getStagedFiles } from './git';
+export { getStagedFiles, add as gitAdd } from './git';
 export { generatorContentHash } from './hash';
 export * from './monorepo';
 export { toPosixPath } from './path';

+ 3 - 1
internal/node-utils/src/spinner.ts

@@ -1,4 +1,6 @@
-import ora, { type Ora } from 'ora';
+import type { Ora } from 'ora';
+
+import ora from 'ora';
 
 interface SpinnerOptions {
   failedText?: string;

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

@@ -130,7 +130,6 @@ export default {
     enterAnimationPlugin,
   ],
   prefix: '',
-  safelist: ['dark'],
   theme: {
     container: {
       center: true,
@@ -202,6 +201,7 @@ export default {
       },
     },
   },
+  safelist: ['dark'],
 } as Config;
 
 function createColorsPalette(name: string) {

+ 2 - 2
internal/vite-config/src/plugins/importmap.ts

@@ -10,11 +10,11 @@ import { minify } from 'html-minifier-terser';
 
 const DEFAULT_PROVIDER = 'jspm.io';
 
-type pluginOptions = {
+type pluginOptions = GeneratorOptions & {
   debug?: boolean;
   defaultProvider?: 'esm.sh' | 'jsdelivr' | 'jspm.io';
   importmap?: Array<{ name: string; range?: string }>;
-} & GeneratorOptions;
+};
 
 // async function getLatestVersionOfShims() {
 //   const result = await fetch('https://ga.jspm.io/npm:es-module-shims');

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

@@ -1,3 +1,5 @@
+import type { PluginOption } from 'vite';
+
 import fs from 'node:fs';
 import fsp from 'node:fs/promises';
 import { join } from 'node:path';
@@ -5,8 +7,6 @@ import { fileURLToPath } from 'node:url';
 
 import { readPackageJSON } from '@vben/node-utils';
 
-import { type PluginOption } from 'vite';
-
 /**
  * 用于生成将loading样式注入到项目中
  * 为多app提供loading样式,无需在每个 app -> index.html单独引入

+ 2 - 2
internal/vite-config/src/utils/env.ts

@@ -67,11 +67,11 @@ async function loadAndConvertEnv(
   match = 'VITE_',
   confFiles = getConfFiles(),
 ): Promise<
-  {
+  Partial<ApplicationPluginOptions> & {
     appTitle: string;
     base: string;
     port: number;
-  } & Partial<ApplicationPluginOptions>
+  }
 > {
   const envConfig = await loadEnv(match, confFiles);
 

+ 1 - 1
package.json

@@ -99,7 +99,7 @@
     "node": ">=20.10.0",
     "pnpm": ">=9.12.0"
   },
-  "packageManager": "pnpm@9.15.1",
+  "packageManager": "pnpm@9.15.2",
   "pnpm": {
     "peerDependencyRules": {
       "allowedVersions": {

+ 3 - 3
packages/@core/base/icons/src/lucide.ts

@@ -1,9 +1,7 @@
 export {
   ArrowDown,
   ArrowLeft,
-  ArrowLeftFromLine as MdiMenuOpen,
   ArrowLeftToLine,
-  ArrowRightFromLine as MdiMenuClose,
   ArrowRightLeft,
   ArrowRightToLine,
   ArrowUp,
@@ -29,6 +27,7 @@ export {
   Github,
   Grip,
   GripVertical,
+  Menu as IconDefault,
   Info,
   InspectionPanel,
   Languages,
@@ -37,7 +36,8 @@ export {
   LogOut,
   MailCheck,
   Maximize,
-  Menu as IconDefault,
+  ArrowRightFromLine as MdiMenuClose,
+  ArrowLeftFromLine as MdiMenuOpen,
   Menu,
   Minimize,
   Minimize2,

+ 1 - 1
packages/@core/base/shared/package.json

@@ -45,7 +45,7 @@
       "default": "./dist/store.mjs"
     },
     "./global-state": {
-      "types": "./dist/global-state.d.ts",
+      "types": "./src/global-state.ts",
       "development": "./src/global-state.ts",
       "default": "./dist/global-state.mjs"
     }

+ 9 - 9
packages/@core/base/shared/src/cache/storage-manager.ts

@@ -25,15 +25,6 @@ class StorageManager {
         : window.sessionStorage;
   }
 
-  /**
-   * 获取完整的存储键
-   * @param key 原始键
-   * @returns 带前缀的完整键
-   */
-  private getFullKey(key: string): string {
-    return `${this.prefix}-${key}`;
-  }
-
   /**
    * 清除所有带前缀的存储项
    */
@@ -113,6 +104,15 @@ class StorageManager {
       console.error(`Error setting item with key "${fullKey}":`, error);
     }
   }
+
+  /**
+   * 获取完整的存储键
+   * @param key 原始键
+   * @returns 带前缀的完整键
+   */
+  private getFullKey(key: string): string {
+    return `${this.prefix}-${key}`;
+  }
 }
 
 export { StorageManager };

+ 6 - 6
packages/@core/base/shared/src/utils/__tests__/util.test.ts

@@ -56,12 +56,6 @@ describe('bindMethods', () => {
 
   it('should not bind getter/setter properties', () => {
     class TestWithGetterSetter {
-      private _value: string = 'test';
-
-      constructor() {
-        bindMethods(this);
-      }
-
       get value() {
         return this._value;
       }
@@ -69,6 +63,12 @@ describe('bindMethods', () => {
       set value(newValue: string) {
         this._value = newValue;
       }
+
+      private _value: string = 'test';
+
+      constructor() {
+        bindMethods(this);
+      }
     }
 
     const instance = new TestWithGetterSetter();

+ 3 - 1
packages/@core/base/shared/src/utils/cn.ts

@@ -1,4 +1,6 @@
-import { type ClassValue, clsx } from 'clsx';
+import type { ClassValue } from 'clsx';
+
+import { clsx } from 'clsx';
 import { twMerge } from 'tailwind-merge';
 
 function cn(...inputs: ClassValue[]) {

+ 6 - 6
packages/@core/base/shared/src/utils/state-handler.ts

@@ -3,12 +3,6 @@ export class StateHandler {
   private rejectCondition: (() => void) | null = null;
   private resolveCondition: (() => void) | null = null;
 
-  // 清理 resolve/reject 函数
-  private clearPromises() {
-    this.resolveCondition = null;
-    this.rejectCondition = null;
-  }
-
   isConditionTrue(): boolean {
     return this.condition;
   }
@@ -47,4 +41,10 @@ export class StateHandler {
       }
     });
   }
+
+  // 清理 resolve/reject 函数
+  private clearPromises() {
+    this.resolveCondition = null;
+    this.rejectCondition = null;
+  }
 }

+ 1 - 1
packages/@core/base/typings/src/helper.d.ts

@@ -1,4 +1,4 @@
-import { type ComputedRef, type MaybeRef } from 'vue';
+import type { ComputedRef, MaybeRef } from 'vue';
 
 /**
  * 深层递归所有属性为可选

+ 3 - 4
packages/@core/base/typings/src/menu-record.ts

@@ -1,15 +1,14 @@
-import type { RouteRecordRaw } from 'vue-router';
-
 import type { Component } from 'vue';
+import type { RouteRecordRaw } from 'vue-router';
 
 /**
  * 扩展路由原始对象
  */
-type ExRouteRecordRaw = {
+type ExRouteRecordRaw = RouteRecordRaw & {
   parent?: string;
   parents?: string[];
   path?: any;
-} & RouteRecordRaw;
+};
 
 interface MenuRecordBadgeRaw {
   /**

+ 6 - 4
packages/@core/base/typings/src/vue-router.d.ts

@@ -1,6 +1,5 @@
-import type { Router, RouteRecordRaw } from 'vue-router';
-
 import type { Component } from 'vue';
+import type { Router, RouteRecordRaw } from 'vue-router';
 
 interface RouteMeta {
   /**
@@ -117,10 +116,13 @@ interface RouteMeta {
 }
 
 // 定义递归类型以将 RouteRecordRaw 的 component 属性更改为 string
-type RouteRecordStringComponent<T = string> = {
+type RouteRecordStringComponent<T = string> = Omit<
+  RouteRecordRaw,
+  'children' | 'component'
+> & {
   children?: RouteRecordStringComponent<T>[];
   component: T;
-} & Omit<RouteRecordRaw, 'children' | 'component'>;
+};
 
 type ComponentRecordType = Record<string, () => Promise<Component>>;
 

+ 4 - 4
packages/@core/composables/src/use-layout-style.ts

@@ -1,4 +1,7 @@
 import type { CSSProperties } from 'vue';
+
+import type { VisibleDomRect } from '@vben-core/shared/utils';
+
 import { computed, onMounted, onUnmounted, ref } from 'vue';
 
 import {
@@ -7,10 +10,7 @@ import {
   CSS_VARIABLE_LAYOUT_FOOTER_HEIGHT,
   CSS_VARIABLE_LAYOUT_HEADER_HEIGHT,
 } from '@vben-core/shared/constants';
-import {
-  getElementVisibleRect,
-  type VisibleDomRect,
-} from '@vben-core/shared/utils';
+import { getElementVisibleRect } from '@vben-core/shared/utils';
 
 import { useCssVar, useDebounceFn } from '@vueuse/core';
 

+ 1 - 0
packages/@core/composables/src/use-priority-value.ts

@@ -1,4 +1,5 @@
 import type { ComputedRef, Ref } from 'vue';
+
 import { computed, getCurrentInstance, unref, useAttrs, useSlots } from 'vue';
 
 import {

+ 3 - 1
packages/@core/composables/src/use-simple-locale/index.ts

@@ -1,8 +1,10 @@
+import type { Locale } from './messages';
+
 import { computed, ref } from 'vue';
 
 import { createSharedComposable } from '@vueuse/core';
 
-import { getMessages, type Locale } from './messages';
+import { getMessages } from './messages';
 
 export const useSimpleLocale = createSharedComposable(() => {
   const currentLocale = ref<Locale>('zh-CN');

+ 84 - 84
packages/@core/preferences/src/preferences.ts

@@ -39,6 +39,90 @@ class PreferenceManager {
     );
   }
 
+  clearCache() {
+    [STORAGE_KEY, STORAGE_KEY_LOCALE, STORAGE_KEY_THEME].forEach((key) => {
+      this.cache?.removeItem(key);
+    });
+  }
+
+  public getInitialPreferences() {
+    return this.initialPreferences;
+  }
+
+  public getPreferences() {
+    return readonly(this.state);
+  }
+
+  /**
+   * 覆盖偏好设置
+   * overrides  要覆盖的偏好设置
+   * namespace  命名空间
+   */
+  public async initPreferences({ namespace, overrides }: InitialOptions) {
+    // 是否初始化过
+    if (this.isInitialized) {
+      return;
+    }
+    // 初始化存储管理器
+    this.cache = new StorageManager({ prefix: namespace });
+    // 合并初始偏好设置
+    this.initialPreferences = merge({}, overrides, defaultPreferences);
+
+    // 加载并合并当前存储的偏好设置
+    const mergedPreference = merge(
+      {},
+      // overrides,
+      this.loadCachedPreferences() || {},
+      this.initialPreferences,
+    );
+
+    // 更新偏好设置
+    this.updatePreferences(mergedPreference);
+
+    this.setupWatcher();
+
+    this.initPlatform();
+    // 标记为已初始化
+    this.isInitialized = true;
+  }
+
+  /**
+   * 重置偏好设置
+   * 偏好设置将被重置为初始值,并从 localStorage 中移除。
+   *
+   * @example
+   * 假设 initialPreferences 为 { theme: 'light', language: 'en' }
+   * 当前 state 为 { theme: 'dark', language: 'fr' }
+   * this.resetPreferences();
+   * 调用后,state 将被重置为 { theme: 'light', language: 'en' }
+   * 并且 localStorage 中的对应项将被移除
+   */
+  resetPreferences() {
+    // 将状态重置为初始偏好设置
+    Object.assign(this.state, this.initialPreferences);
+    // 保存重置后的偏好设置
+    this.savePreferences(this.state);
+    // 从存储中移除偏好设置项
+    [STORAGE_KEY, STORAGE_KEY_THEME, STORAGE_KEY_LOCALE].forEach((key) => {
+      this.cache?.removeItem(key);
+    });
+    this.updatePreferences(this.state);
+  }
+
+  /**
+   * 更新偏好设置
+   * @param updates - 要更新的偏好设置
+   */
+  public updatePreferences(updates: DeepPartial<Preferences>) {
+    const mergedState = merge({}, updates, markRaw(this.state));
+
+    Object.assign(this.state, mergedState);
+
+    // 根据更新的键值执行相应的操作
+    this.handleUpdates(updates);
+    this.savePreferences(this.state);
+  }
+
   /**
    * 保存偏好设置
    * @param {Preferences} preference - 需要保存的偏好设置
@@ -138,90 +222,6 @@ class PreferenceManager {
         : dom.classList.remove(COLOR_GRAY);
     }
   }
-
-  clearCache() {
-    [STORAGE_KEY, STORAGE_KEY_LOCALE, STORAGE_KEY_THEME].forEach((key) => {
-      this.cache?.removeItem(key);
-    });
-  }
-
-  public getInitialPreferences() {
-    return this.initialPreferences;
-  }
-
-  public getPreferences() {
-    return readonly(this.state);
-  }
-
-  /**
-   * 覆盖偏好设置
-   * overrides  要覆盖的偏好设置
-   * namespace  命名空间
-   */
-  public async initPreferences({ namespace, overrides }: InitialOptions) {
-    // 是否初始化过
-    if (this.isInitialized) {
-      return;
-    }
-    // 初始化存储管理器
-    this.cache = new StorageManager({ prefix: namespace });
-    // 合并初始偏好设置
-    this.initialPreferences = merge({}, overrides, defaultPreferences);
-
-    // 加载并合并当前存储的偏好设置
-    const mergedPreference = merge(
-      {},
-      // overrides,
-      this.loadCachedPreferences() || {},
-      this.initialPreferences,
-    );
-
-    // 更新偏好设置
-    this.updatePreferences(mergedPreference);
-
-    this.setupWatcher();
-
-    this.initPlatform();
-    // 标记为已初始化
-    this.isInitialized = true;
-  }
-
-  /**
-   * 重置偏好设置
-   * 偏好设置将被重置为初始值,并从 localStorage 中移除。
-   *
-   * @example
-   * 假设 initialPreferences 为 { theme: 'light', language: 'en' }
-   * 当前 state 为 { theme: 'dark', language: 'fr' }
-   * this.resetPreferences();
-   * 调用后,state 将被重置为 { theme: 'light', language: 'en' }
-   * 并且 localStorage 中的对应项将被移除
-   */
-  resetPreferences() {
-    // 将状态重置为初始偏好设置
-    Object.assign(this.state, this.initialPreferences);
-    // 保存重置后的偏好设置
-    this.savePreferences(this.state);
-    // 从存储中移除偏好设置项
-    [STORAGE_KEY, STORAGE_KEY_THEME, STORAGE_KEY_LOCALE].forEach((key) => {
-      this.cache?.removeItem(key);
-    });
-    this.updatePreferences(this.state);
-  }
-
-  /**
-   * 更新偏好设置
-   * @param updates - 要更新的偏好设置
-   */
-  public updatePreferences(updates: DeepPartial<Preferences>) {
-    const mergedState = merge({}, updates, markRaw(this.state));
-
-    Object.assign(this.state, mergedState);
-
-    // 根据更新的键值执行相应的操作
-    this.handleUpdates(updates);
-    this.savePreferences(this.state);
-  }
 }
 
 const preferencesManager = new PreferenceManager();

+ 2 - 1
packages/@core/ui-kit/form-ui/src/config.ts

@@ -1,10 +1,11 @@
+import type { Component } from 'vue';
+
 import type {
   BaseFormComponentType,
   FormCommonConfig,
   VbenFormAdapterOptions,
 } from './types';
 
-import type { Component } from 'vue';
 import { h } from 'vue';
 
 import {

+ 36 - 40
packages/@core/ui-kit/form-ui/src/form-api.ts

@@ -1,4 +1,3 @@
-import type { Recordable } from '@vben-core/typings';
 import type {
   FormState,
   GenericObject,
@@ -6,6 +5,8 @@ import type {
   ValidationOptions,
 } from 'vee-validate';
 
+import type { Recordable } from '@vben-core/typings';
+
 import type { FormActions, FormSchema, VbenFormProps } from './types';
 
 import { toRaw } from 'vue';
@@ -45,20 +46,20 @@ function getDefaultState(): VbenFormProps {
 }
 
 export class FormApi {
-  // 最后一次点击提交时的表单值
-  private latestSubmissionValues: null | Recordable<any> = null;
-  private prevState: null | VbenFormProps = null;
-
   // private api: Pick<VbenFormProps, 'handleReset' | 'handleSubmit'>;
   public form = {} as FormActions;
   isMounted = false;
 
   public state: null | VbenFormProps = null;
-
   stateHandler: StateHandler;
 
   public store: Store<VbenFormProps>;
 
+  // 最后一次点击提交时的表单值
+  private latestSubmissionValues: null | Recordable<any> = null;
+
+  private prevState: null | VbenFormProps = null;
+
   constructor(options: VbenFormProps = {}) {
     const { ...storeState } = options;
 
@@ -83,40 +84,6 @@ export class FormApi {
     bindMethods(this);
   }
 
-  private async getForm() {
-    if (!this.isMounted) {
-      // 等待form挂载
-      await this.stateHandler.waitForCondition();
-    }
-    if (!this.form?.meta) {
-      throw new Error('<VbenForm /> is not mounted');
-    }
-    return this.form;
-  }
-
-  private updateState() {
-    const currentSchema = this.state?.schema ?? [];
-    const prevSchema = this.prevState?.schema ?? [];
-    // 进行了删除schema操作
-    if (currentSchema.length < prevSchema.length) {
-      const currentFields = new Set(
-        currentSchema.map((item) => item.fieldName),
-      );
-      const deletedSchema = prevSchema.filter(
-        (item) => !currentFields.has(item.fieldName),
-      );
-
-      for (const schema of deletedSchema) {
-        this.form?.setFieldValue(schema.fieldName, undefined);
-      }
-    }
-  }
-
-  // 如果需要多次更新状态,可以使用 batch 方法
-  batchStore(cb: () => void) {
-    this.store.batch(cb);
-  }
-
   getLatestSubmissionValues() {
     return this.latestSubmissionValues || {};
   }
@@ -363,4 +330,33 @@ export class FormApi {
     }
     return validateResult;
   }
+
+  private async getForm() {
+    if (!this.isMounted) {
+      // 等待form挂载
+      await this.stateHandler.waitForCondition();
+    }
+    if (!this.form?.meta) {
+      throw new Error('<VbenForm /> is not mounted');
+    }
+    return this.form;
+  }
+
+  private updateState() {
+    const currentSchema = this.state?.schema ?? [];
+    const prevSchema = this.prevState?.schema ?? [];
+    // 进行了删除schema操作
+    if (currentSchema.length < prevSchema.length) {
+      const currentFields = new Set(
+        currentSchema.map((item) => item.fieldName),
+      );
+      const deletedSchema = prevSchema.filter(
+        (item) => !currentFields.has(item.fieldName),
+      );
+
+      for (const schema of deletedSchema) {
+        this.form?.setFieldValue(schema.fieldName, undefined);
+      }
+    }
+  }
 }

+ 2 - 2
packages/@core/ui-kit/form-ui/src/form-render/form-field.vue

@@ -44,9 +44,9 @@ const {
   renderComponentContent,
   rules,
 } = defineProps<
-  {
+  Props & {
     commonComponentProps: MaybeComponentProps;
-  } & Props
+  }
 >();
 
 const { componentBindEventMap, componentMap, isVertical } = useFormContext();

+ 4 - 5
packages/@core/ui-kit/form-ui/src/form-render/form.vue

@@ -1,4 +1,5 @@
 <script setup lang="ts">
+import type { GenericObject } from 'vee-validate';
 import type { ZodTypeAny } from 'zod';
 
 import type {
@@ -13,8 +14,6 @@ import { computed } from 'vue';
 import { Form } from '@vben-core/shadcn-ui';
 import { cn, isString, mergeWithArrayOverride } from '@vben-core/shared/utils';
 
-import { type GenericObject } from 'vee-validate';
-
 import { provideFormRenderProps } from './context';
 import { useExpandable } from './expandable';
 import FormField from './form-field.vue';
@@ -23,7 +22,7 @@ import { getBaseRules, getDefaultValueInZodStack } from './helper';
 interface Props extends FormRenderProps {}
 
 const props = withDefaults(
-  defineProps<{ globalCommonConfig?: FormCommonConfig } & Props>(),
+  defineProps<Props & { globalCommonConfig?: FormCommonConfig }>(),
   {
     collapsedRows: 1,
     commonConfig: () => ({}),
@@ -81,10 +80,10 @@ const formCollapsed = computed(() => {
 });
 
 const computedSchema = computed(
-  (): ({
+  (): (Omit<FormSchema, 'formFieldProps'> & {
     commonComponentProps: Record<string, any>;
     formFieldProps: Record<string, any>;
-  } & Omit<FormSchema, 'formFieldProps'>)[] => {
+  })[] => {
     const {
       colon = false,
       componentProps = {},

+ 1 - 1
packages/@core/ui-kit/form-ui/src/form-render/index.ts

@@ -1,3 +1,3 @@
-export { default as Form } from './form.vue';
 export { default as FormField } from './form-field.vue';
 export { default as FormLabel } from './form-label.vue';
+export { default as Form } from './form.vue';

+ 1 - 1
packages/@core/ui-kit/form-ui/src/index.ts

@@ -3,8 +3,8 @@ export { setupVbenForm } from './config';
 export type {
   BaseFormComponentType,
   ExtendedFormApi,
-  FormSchema as VbenFormSchema,
   VbenFormProps,
+  FormSchema as VbenFormSchema,
 } from './types';
 
 export * from './use-vben-form';

+ 10 - 9
packages/@core/ui-kit/form-ui/src/types.ts

@@ -1,12 +1,13 @@
-import type { VbenButtonProps } from '@vben-core/shadcn-ui';
-import type { ClassType } from '@vben-core/typings';
 import type { FieldOptions, FormContext, GenericObject } from 'vee-validate';
 import type { ZodTypeAny } from 'zod';
 
-import type { FormApi } from './form-api';
-
 import type { Component, HtmlHTMLAttributes, Ref } from 'vue';
 
+import type { VbenButtonProps } from '@vben-core/shadcn-ui';
+import type { ClassType } from '@vben-core/typings';
+
+import type { FormApi } from './form-api';
+
 export type FormLayout = 'horizontal' | 'vertical';
 
 export type BaseFormComponentType =
@@ -19,7 +20,7 @@ export type BaseFormComponentType =
   | 'VbenSelect'
   | (Record<never, never> & string);
 
-type Breakpoints = '' | '2xl:' | '3xl:' | 'lg:' | 'md:' | 'sm:' | 'xl:';
+type Breakpoints = '2xl:' | '3xl:' | '' | 'lg:' | 'md:' | 'sm:' | 'xl:';
 
 type GridCols = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
 
@@ -35,12 +36,12 @@ export type FormItemClassType =
   | WrapperClassType;
 
 export type FormFieldOptions = Partial<
-  {
+  FieldOptions & {
     validateOnBlur?: boolean;
     validateOnChange?: boolean;
     validateOnInput?: boolean;
     validateOnModelUpdate?: boolean;
-  } & FieldOptions
+  }
 >;
 
 export interface FormShape {
@@ -372,11 +373,11 @@ export interface VbenFormProps<
   submitOnEnter?: boolean;
 }
 
-export type ExtendedFormApi = {
+export type ExtendedFormApi = FormApi & {
   useStore: <T = NoInfer<VbenFormProps>>(
     selector?: (state: NoInfer<VbenFormProps>) => T,
   ) => Readonly<Ref<T>>;
-} & FormApi;
+};
 
 export interface VbenFormAdapterOptions<
   T extends BaseFormComponentType = BaseFormComponentType,

+ 6 - 2
packages/@core/ui-kit/form-ui/src/use-form-context.ts

@@ -1,12 +1,16 @@
+import type { ZodRawShape } from 'zod';
+
+import type { ComputedRef } from 'vue';
+
 import type { FormActions, VbenFormProps } from './types';
 
-import { computed, type ComputedRef, unref, useSlots } from 'vue';
+import { computed, unref, useSlots } from 'vue';
 
 import { createContext } from '@vben-core/shadcn-ui';
 import { isString } from '@vben-core/shared/utils';
 
 import { useForm } from 'vee-validate';
-import { object, type ZodRawShape } from 'zod';
+import { object } from 'zod';
 import { getDefaultsForSchema } from 'zod-defaults';
 
 export const [injectFormProps, provideFormProps] =

+ 2 - 4
packages/@core/ui-kit/form-ui/src/vben-use-form.vue

@@ -2,12 +2,10 @@
 import type { ExtendedFormApi, VbenFormProps } from './types';
 
 // import { toRaw, watch } from 'vue';
-
-import { useForwardPriorityValues } from '@vben-core/composables';
-// import { isFunction } from '@vben-core/shared/utils';
-
 import { nextTick, onMounted, watch } from 'vue';
+// import { isFunction } from '@vben-core/shared/utils';
 
+import { useForwardPriorityValues } from '@vben-core/composables';
 import { cloneDeep } from '@vben-core/shared/utils';
 
 import { useDebounceFn } from '@vueuse/core';

+ 2 - 1
packages/@core/ui-kit/layout-ui/src/components/layout-content.vue

@@ -1,7 +1,8 @@
 <script setup lang="ts">
+import type { CSSProperties } from 'vue';
+
 import type { ContentCompactType } from '@vben-core/typings';
 
-import type { CSSProperties } from 'vue';
 import { computed } from 'vue';
 
 import { useLayoutContentStyle } from '@vben-core/composables';

+ 1 - 0
packages/@core/ui-kit/layout-ui/src/components/layout-footer.vue

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

+ 1 - 0
packages/@core/ui-kit/layout-ui/src/components/layout-header.vue

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

+ 1 - 0
packages/@core/ui-kit/layout-ui/src/components/layout-sidebar.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
 import type { CSSProperties } from 'vue';
+
 import { computed, shallowRef, useSlots, watchEffect } from 'vue';
 
 import { VbenScrollbar } from '@vben-core/shadcn-ui';

+ 1 - 0
packages/@core/ui-kit/layout-ui/src/components/layout-tabbar.vue

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

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

@@ -1,7 +1,8 @@
 <script setup lang="ts">
+import type { CSSProperties } from 'vue';
+
 import type { VbenLayoutProps } from './vben-layout';
 
-import type { CSSProperties } from 'vue';
 import { computed, ref, watch } from 'vue';
 
 import {

+ 1 - 1
packages/@core/ui-kit/menu-ui/src/components/index.ts

@@ -1,4 +1,4 @@
-export { default as Menu } from './menu.vue';
 export { default as MenuBadge } from './menu-badge.vue';
 export { default as MenuItem } from './menu-item.vue';
+export { default as Menu } from './menu.vue';
 export { default as SubMenu } from './sub-menu.vue';

+ 2 - 1
packages/@core/ui-kit/menu-ui/src/components/menu.vue

@@ -1,6 +1,8 @@
 <script lang="ts" setup>
 import type { UseResizeObserverReturn } from '@vueuse/core';
 
+import type { VNodeArrayChildren } from 'vue';
+
 import type {
   MenuItemClicked,
   MenuItemRegistered,
@@ -15,7 +17,6 @@ import {
   ref,
   toRef,
   useSlots,
-  type VNodeArrayChildren,
   watch,
   watchEffect,
 } from 'vue';

+ 2 - 2
packages/@core/ui-kit/menu-ui/src/types.ts

@@ -1,7 +1,7 @@
-import type { MenuRecordBadgeRaw, ThemeModeType } from '@vben-core/typings';
-
 import type { Component, Ref } from 'vue';
 
+import type { MenuRecordBadgeRaw, ThemeModeType } from '@vben-core/typings';
+
 interface MenuProps {
   /**
    * @zh_CN 是否开启手风琴模式

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

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

+ 4 - 15
packages/@core/ui-kit/popup-ui/src/drawer/__tests__/drawer-api.test.ts

@@ -9,7 +9,11 @@ vi.mock('@vben-core/shared/store', () => {
   return {
     isFunction: (fn: any) => typeof fn === 'function',
     Store: class {
+      get state() {
+        return this._state;
+      }
       private _state: DrawerState;
+
       private options: any;
 
       constructor(initialState: DrawerState, options: any) {
@@ -25,10 +29,6 @@ vi.mock('@vben-core/shared/store', () => {
         this._state = fn(this._state);
         this.options.onUpdate();
       }
-
-      get state() {
-        return this._state;
-      }
     },
   };
 });
@@ -100,17 +100,6 @@ describe('drawerApi', () => {
     expect(onOpenChange).toHaveBeenCalledWith(true);
   });
 
-  it('should batch state updates', () => {
-    const batchSpy = vi.spyOn(drawerApi.store, 'batch');
-    drawerApi.batchStore(() => {
-      drawerApi.setState({ title: 'Batch Title' });
-      drawerApi.setState({ confirmText: 'Batch Confirm' });
-    });
-    expect(batchSpy).toHaveBeenCalled();
-    expect(drawerApi.store.state.title).toBe('Batch Title');
-    expect(drawerApi.store.state.confirmText).toBe('Batch Confirm');
-  });
-
   it('should call onClosed callback when provided', () => {
     const onClosed = vi.fn();
     const drawerApiWithHook = new DrawerApi({ onClosed });

+ 7 - 12
packages/@core/ui-kit/popup-ui/src/drawer/drawer-api.ts

@@ -4,6 +4,12 @@ import { Store } from '@vben-core/shared/store';
 import { bindMethods, isFunction } from '@vben-core/shared/utils';
 
 export class DrawerApi {
+  // 共享数据
+  public sharedData: Record<'payload', any> = {
+    payload: {},
+  };
+  public store: Store<DrawerState>;
+
   private api: Pick<
     DrawerApiOptions,
     | 'onBeforeClose'
@@ -13,16 +19,10 @@ export class DrawerApi {
     | 'onOpenChange'
     | 'onOpened'
   >;
+
   // private prevState!: DrawerState;
   private state!: DrawerState;
 
-  // 共享数据
-  public sharedData: Record<'payload', any> = {
-    payload: {},
-  };
-
-  public store: Store<DrawerState>;
-
   constructor(options: DrawerApiOptions = {}) {
     const {
       connectedComponent: _,
@@ -83,11 +83,6 @@ export class DrawerApi {
     bindMethods(this);
   }
 
-  // 如果需要多次更新状态,可以使用 batch 方法
-  batchStore(cb: () => void) {
-    this.store.batch(cb);
-  }
-
   /**
    * 关闭弹窗
    */

+ 4 - 4
packages/@core/ui-kit/popup-ui/src/drawer/drawer.ts

@@ -1,9 +1,9 @@
+import type { Component, Ref } from 'vue';
+
 import type { ClassType } from '@vben-core/typings';
 
 import type { DrawerApi } from './drawer-api';
 
-import type { Component, Ref } from 'vue';
-
 export type DrawerPlacement = 'bottom' | 'left' | 'right' | 'top';
 
 export type CloseIconPlacement = 'left' | 'right';
@@ -124,11 +124,11 @@ export interface DrawerState extends DrawerProps {
   sharedData?: Record<string, any>;
 }
 
-export type ExtendedDrawerApi = {
+export type ExtendedDrawerApi = DrawerApi & {
   useStore: <T = NoInfer<DrawerState>>(
     selector?: (state: NoInfer<DrawerState>) => T,
   ) => Readonly<Ref<T>>;
-} & DrawerApi;
+};
 
 export interface DrawerApiOptions extends DrawerState {
   /**

+ 1 - 1
packages/@core/ui-kit/popup-ui/src/drawer/use-drawer.ts

@@ -16,8 +16,8 @@ import {
 
 import { useStore } from '@vben-core/shared/store';
 
-import VbenDrawer from './drawer.vue';
 import { DrawerApi } from './drawer-api';
+import VbenDrawer from './drawer.vue';
 
 const USER_DRAWER_INJECT_KEY = Symbol('VBEN_DRAWER_INJECT');
 

+ 4 - 15
packages/@core/ui-kit/popup-ui/src/modal/__tests__/modal-api.test.ts

@@ -8,7 +8,11 @@ vi.mock('@vben-core/shared/store', () => {
   return {
     isFunction: (fn: any) => typeof fn === 'function',
     Store: class {
+      get state() {
+        return this._state;
+      }
       private _state: ModalState;
+
       private options: any;
 
       constructor(initialState: ModalState, options: any) {
@@ -24,10 +28,6 @@ vi.mock('@vben-core/shared/store', () => {
         this._state = fn(this._state);
         this.options.onUpdate();
       }
-
-      get state() {
-        return this._state;
-      }
     },
   };
 });
@@ -100,17 +100,6 @@ describe('modalApi', () => {
     expect(onOpenChange).toHaveBeenCalledWith(true);
   });
 
-  it('should batch state updates', () => {
-    const batchSpy = vi.spyOn(modalApi.store, 'batch');
-    modalApi.batchStore(() => {
-      modalApi.setState({ title: 'Batch Title' });
-      modalApi.setState({ confirmText: 'Batch Confirm' });
-    });
-    expect(batchSpy).toHaveBeenCalled();
-    expect(modalApi.store.state.title).toBe('Batch Title');
-    expect(modalApi.store.state.confirmText).toBe('Batch Confirm');
-  });
-
   it('should call onClosed callback when provided', () => {
     const onClosed = vi.fn();
     const modalApiWithHook = new ModalApi({ onClosed });

+ 7 - 12
packages/@core/ui-kit/popup-ui/src/modal/modal-api.ts

@@ -4,6 +4,12 @@ import { Store } from '@vben-core/shared/store';
 import { bindMethods, isFunction } from '@vben-core/shared/utils';
 
 export class ModalApi {
+  // 共享数据
+  public sharedData: Record<'payload', any> = {
+    payload: {},
+  };
+  public store: Store<ModalState>;
+
   private api: Pick<
     ModalApiOptions,
     | 'onBeforeClose'
@@ -13,16 +19,10 @@ export class ModalApi {
     | 'onOpenChange'
     | 'onOpened'
   >;
+
   // private prevState!: ModalState;
   private state!: ModalState;
 
-  // 共享数据
-  public sharedData: Record<'payload', any> = {
-    payload: {},
-  };
-
-  public store: Store<ModalState>;
-
   constructor(options: ModalApiOptions = {}) {
     const {
       connectedComponent: _,
@@ -93,11 +93,6 @@ export class ModalApi {
     bindMethods(this);
   }
 
-  // 如果需要多次更新状态,可以使用 batch 方法
-  batchStore(cb: () => void) {
-    this.store.batch(cb);
-  }
-
   /**
    * 关闭弹窗
    */

+ 4 - 4
packages/@core/ui-kit/popup-ui/src/modal/modal.ts

@@ -1,7 +1,7 @@
-import type { ModalApi } from './modal-api';
-
 import type { Component, Ref } from 'vue';
 
+import type { ModalApi } from './modal-api';
+
 export interface ModalProps {
   /**
    * 是否要挂载到内容区域
@@ -132,11 +132,11 @@ export interface ModalState extends ModalProps {
   sharedData?: Record<string, any>;
 }
 
-export type ExtendedModalApi = {
+export type ExtendedModalApi = ModalApi & {
   useStore: <T = NoInfer<ModalState>>(
     selector?: (state: NoInfer<ModalState>) => T,
   ) => Readonly<Ref<T>>;
-} & ModalApi;
+};
 
 export interface ModalApiOptions extends ModalState {
   /**

+ 2 - 1
packages/@core/ui-kit/popup-ui/src/modal/use-modal-draggable.ts

@@ -3,9 +3,10 @@
  * 调整部分细节
  */
 
-import { onBeforeUnmount, onMounted, reactive, ref, watchEffect } from 'vue';
 import type { ComputedRef, Ref } from 'vue';
 
+import { onBeforeUnmount, onMounted, reactive, ref, watchEffect } from 'vue';
+
 import { unrefElement } from '@vueuse/core';
 
 export function useModalDraggable(

+ 1 - 1
packages/@core/ui-kit/popup-ui/src/modal/use-modal.ts

@@ -12,8 +12,8 @@ import {
 
 import { useStore } from '@vben-core/shared/store';
 
-import VbenModal from './modal.vue';
 import { ModalApi } from './modal-api';
+import VbenModal from './modal.vue';
 
 const USER_MODAL_INJECT_KEY = Symbol('VBEN_MODAL_INJECT');
 

+ 3 - 2
packages/@core/ui-kit/shadcn-ui/src/components/avatar/avatar.vue

@@ -1,16 +1,17 @@
 <script setup lang="ts">
-import type { ClassType } from '@vben-core/typings';
 import type {
   AvatarFallbackProps,
   AvatarImageProps,
   AvatarRootProps,
 } from 'radix-vue';
 
+import type { ClassType } from '@vben-core/typings';
+
 import { computed } from 'vue';
 
 import { Avatar, AvatarFallback, AvatarImage } from '../../ui';
 
-interface Props extends AvatarRootProps, AvatarFallbackProps, AvatarImageProps {
+interface Props extends AvatarFallbackProps, AvatarImageProps, AvatarRootProps {
   alt?: string;
   class?: ClassType;
   dot?: boolean;

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb-view.vue

@@ -3,8 +3,8 @@ import type { BreadcrumbProps } from './types';
 
 import { useForwardPropsEmits } from 'radix-vue';
 
-import Breadcrumb from './breadcrumb.vue';
 import BreadcrumbBackground from './breadcrumb-background.vue';
+import Breadcrumb from './breadcrumb.vue';
 
 interface Props extends BreadcrumbProps {
   class?: any;

+ 2 - 2
packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/types.ts

@@ -1,7 +1,7 @@
-import type { BreadcrumbStyleType } from '@vben-core/typings';
-
 import type { Component } from 'vue';
 
+import type { BreadcrumbStyleType } from '@vben-core/typings';
+
 export interface IBreadcrumb {
   icon?: Component | string;
   isHome?: boolean;

+ 2 - 2
packages/@core/ui-kit/shadcn-ui/src/components/button/button.ts

@@ -1,9 +1,9 @@
 import type { AsTag } from 'radix-vue';
 
-import type { ButtonVariants, ButtonVariantSize } from '../../ui';
-
 import type { Component } from 'vue';
 
+import type { ButtonVariants, ButtonVariantSize } from '../../ui';
+
 export interface VbenButtonProps {
   /**
    * The element or component this component should render as. Can be overwrite by `asChild`

+ 4 - 3
packages/@core/ui-kit/shadcn-ui/src/components/context-menu/context-menu.vue

@@ -1,11 +1,12 @@
 <script setup lang="ts">
-import type { ClassType } from '@vben-core/typings';
 import type {
   ContextMenuContentProps,
   ContextMenuRootEmits,
   ContextMenuRootProps,
 } from 'radix-vue';
 
+import type { ClassType } from '@vben-core/typings';
+
 import type { IContextMenuItem } from './interface';
 
 import { computed } from 'vue';
@@ -22,14 +23,14 @@ import {
 } from '../../ui/context-menu';
 
 const props = defineProps<
-  {
+  ContextMenuRootProps & {
     class?: ClassType;
     contentClass?: ClassType;
     contentProps?: ContextMenuContentProps;
     handlerData?: Record<string, any>;
     itemClass?: ClassType;
     menus: (data: any) => IContextMenuItem[];
-  } & ContextMenuRootProps
+  }
 >();
 
 const emits = defineEmits<ContextMenuRootEmits>();

+ 2 - 1
packages/@core/ui-kit/shadcn-ui/src/components/hover-card/hover-card.vue

@@ -1,11 +1,12 @@
 <script setup lang="ts">
-import type { ClassType } from '@vben-core/typings';
 import type {
   HoverCardContentProps,
   HoverCardRootEmits,
   HoverCardRootProps,
 } from 'radix-vue';
 
+import type { ClassType } from '@vben-core/typings';
+
 import { computed } from 'vue';
 
 import { useForwardPropsEmits } from 'radix-vue';

+ 3 - 1
packages/@core/ui-kit/shadcn-ui/src/components/icon/icon.vue

@@ -1,5 +1,7 @@
 <script setup lang="ts">
-import { type Component, computed } from 'vue';
+import type { Component } from 'vue';
+
+import { computed } from 'vue';
 
 import { IconDefault, IconifyIcon } from '@vben-core/icons';
 import {

+ 2 - 1
packages/@core/ui-kit/shadcn-ui/src/components/popover/popover.vue

@@ -1,11 +1,12 @@
 <script setup lang="ts">
-import type { ClassType } from '@vben-core/typings';
 import type {
   PopoverContentProps,
   PopoverRootEmits,
   PopoverRootProps,
 } from 'radix-vue';
 
+import type { ClassType } from '@vben-core/typings';
+
 import { computed } from 'vue';
 
 import { useForwardPropsEmits } from 'radix-vue';

+ 1 - 0
packages/@core/ui-kit/shadcn-ui/src/components/render-content/render-content.vue

@@ -1,5 +1,6 @@
 <script lang="ts">
 import type { Component, PropType } from 'vue';
+
 import { defineComponent, h } from 'vue';
 
 import { isFunction, isObject } from '@vben-core/shared/utils';

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/segmented/tabs-indicator.vue

@@ -7,7 +7,7 @@ import { cn } from '@vben-core/shared/utils';
 
 import { TabsIndicator, useForwardProps } from 'radix-vue';
 
-const props = defineProps<{ class?: any } & TabsIndicatorProps>();
+const props = defineProps<TabsIndicatorProps & { class?: any }>();
 
 const delegatedProps = computed(() => {
   const { class: _, ...delegated } = props;

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

@@ -1,9 +1,10 @@
 <script setup lang="ts">
-import type { ClassType } from '@vben-core/typings';
 import type { TooltipContentProps } from 'radix-vue';
 
 import type { StyleValue } from 'vue';
 
+import type { ClassType } from '@vben-core/typings';
+
 import {
   Tooltip,
   TooltipContent,

+ 3 - 6
packages/@core/ui-kit/shadcn-ui/src/ui/accordion/Accordion.vue

@@ -1,10 +1,7 @@
 <script setup lang="ts">
-import {
-  AccordionRoot,
-  type AccordionRootEmits,
-  type AccordionRootProps,
-  useForwardPropsEmits,
-} from 'radix-vue';
+import type { AccordionRootEmits, AccordionRootProps } from 'radix-vue';
+
+import { AccordionRoot, useForwardPropsEmits } from 'radix-vue';
 
 const props = defineProps<AccordionRootProps>();
 const emits = defineEmits<AccordionRootEmits>();

+ 4 - 2
packages/@core/ui-kit/shadcn-ui/src/ui/accordion/AccordionContent.vue

@@ -1,11 +1,13 @@
 <script setup lang="ts">
+import type { AccordionContentProps } from 'radix-vue';
+
 import { computed } from 'vue';
 
 import { cn } from '@vben-core/shared/utils';
 
-import { AccordionContent, type AccordionContentProps } from 'radix-vue';
+import { AccordionContent } from 'radix-vue';
 
-const props = defineProps<{ class?: any } & AccordionContentProps>();
+const props = defineProps<AccordionContentProps & { class?: any }>();
 
 const delegatedProps = computed(() => {
   const { class: _, ...delegated } = props;

+ 4 - 6
packages/@core/ui-kit/shadcn-ui/src/ui/accordion/AccordionItem.vue

@@ -1,15 +1,13 @@
 <script setup lang="ts">
+import type { AccordionItemProps } from 'radix-vue';
+
 import { computed } from 'vue';
 
 import { cn } from '@vben-core/shared/utils';
 
-import {
-  AccordionItem,
-  type AccordionItemProps,
-  useForwardProps,
-} from 'radix-vue';
+import { AccordionItem, useForwardProps } from 'radix-vue';
 
-const props = defineProps<{ class?: any } & AccordionItemProps>();
+const props = defineProps<AccordionItemProps & { class?: any }>();
 
 const delegatedProps = computed(() => {
   const { class: _, ...delegated } = props;

+ 4 - 6
packages/@core/ui-kit/shadcn-ui/src/ui/accordion/AccordionTrigger.vue

@@ -1,16 +1,14 @@
 <script setup lang="ts">
+import type { AccordionTriggerProps } from 'radix-vue';
+
 import { computed } from 'vue';
 
 import { cn } from '@vben-core/shared/utils';
 
 import { ChevronDown } from 'lucide-vue-next';
-import {
-  AccordionHeader,
-  AccordionTrigger,
-  type AccordionTriggerProps,
-} from 'radix-vue';
+import { AccordionHeader, AccordionTrigger } from 'radix-vue';
 
-const props = defineProps<{ class?: any } & AccordionTriggerProps>();
+const props = defineProps<AccordionTriggerProps & { class?: any }>();
 
 const delegatedProps = computed(() => {
   const { class: _, ...delegated } = props;

+ 3 - 1
packages/@core/ui-kit/shadcn-ui/src/ui/avatar/Avatar.vue

@@ -1,9 +1,11 @@
 <script setup lang="ts">
+import type { AvatarVariants } from './avatar';
+
 import { cn } from '@vben-core/shared/utils';
 
 import { AvatarRoot } from 'radix-vue';
 
-import { avatarVariant, type AvatarVariants } from './avatar';
+import { avatarVariant } from './avatar';
 
 const props = withDefaults(
   defineProps<{

+ 3 - 1
packages/@core/ui-kit/shadcn-ui/src/ui/avatar/AvatarFallback.vue

@@ -1,5 +1,7 @@
 <script setup lang="ts">
-import { AvatarFallback, type AvatarFallbackProps } from 'radix-vue';
+import type { AvatarFallbackProps } from 'radix-vue';
+
+import { AvatarFallback } from 'radix-vue';
 
 const props = defineProps<AvatarFallbackProps>();
 </script>

+ 3 - 1
packages/@core/ui-kit/shadcn-ui/src/ui/avatar/AvatarImage.vue

@@ -1,5 +1,7 @@
 <script setup lang="ts">
-import { AvatarImage, type AvatarImageProps } from 'radix-vue';
+import type { AvatarImageProps } from 'radix-vue';
+
+import { AvatarImage } from 'radix-vue';
 
 const props = defineProps<AvatarImageProps>();
 </script>

+ 3 - 1
packages/@core/ui-kit/shadcn-ui/src/ui/avatar/avatar.ts

@@ -1,4 +1,6 @@
-import { cva, type VariantProps } from 'class-variance-authority';
+import type { VariantProps } from 'class-variance-authority';
+
+import { cva } from 'class-variance-authority';
 
 export const avatarVariant = cva(
   'inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden',

部分文件因为文件数量过多而无法显示