diff --git a/packages/@core/forward/preferences/src/config.ts b/packages/@core/forward/preferences/src/config.ts index 4ef14f78..2e24471f 100644 --- a/packages/@core/forward/preferences/src/config.ts +++ b/packages/@core/forward/preferences/src/config.ts @@ -69,10 +69,12 @@ const defaultPreferences: Preferences = { width: 240, }, tabbar: { + dragable: true, enable: true, keepAlive: true, persist: true, showIcon: true, + styleType: 'chrome', }, theme: { builtinType: 'default', diff --git a/packages/@core/forward/preferences/src/types.ts b/packages/@core/forward/preferences/src/types.ts index 872966ab..7f2d0722 100644 --- a/packages/@core/forward/preferences/src/types.ts +++ b/packages/@core/forward/preferences/src/types.ts @@ -10,6 +10,7 @@ import type { NavigationStyleType, PageTransitionType, SupportedLanguagesType, + TabsStyleType, ThemeModeType, } from '@vben-core/typings'; @@ -135,6 +136,8 @@ interface ShortcutKeyPreferences { } interface TabbarPreferences { + /** 是否开启多标签页拖拽 */ + dragable: boolean; /** 是否开启多标签页 */ enable: boolean; /** 开启标签页缓存功能 */ @@ -143,6 +146,8 @@ interface TabbarPreferences { persist: boolean; /** 是否开启多标签页图标 */ showIcon: boolean; + /** 标签页风格 */ + styleType: TabsStyleType; } interface ThemePreferences { diff --git a/packages/@core/locales/src/langs/en-US.json b/packages/@core/locales/src/langs/en-US.json index 48d61e10..4d3dc611 100644 --- a/packages/@core/locales/src/langs/en-US.json +++ b/packages/@core/locales/src/langs/en-US.json @@ -176,6 +176,14 @@ "enable": "Enable Tab Bar", "icon": "Show Tabbar Icon", "persist": "Persist Tabs", + "dragable": "Enable Dragable Sort", + "styleType": { + "title": "Tabs Style", + "chrome": "Chrome", + "card": "Card", + "plain": "Plain", + "brisk": "Brisk" + }, "contextMenu": { "reload": "Reload", "close": "Close", diff --git a/packages/@core/locales/src/langs/zh-CN.json b/packages/@core/locales/src/langs/zh-CN.json index c2659d75..42312644 100644 --- a/packages/@core/locales/src/langs/zh-CN.json +++ b/packages/@core/locales/src/langs/zh-CN.json @@ -176,6 +176,14 @@ "enable": "启用标签栏", "icon": "显示标签栏图标", "persist": "持久化标签页", + "dragable": "启动拖拽排序", + "styleType": { + "title": "标签页风格", + "chrome": "谷歌", + "card": "卡片", + "plain": "朴素", + "brisk": "轻快" + }, "contextMenu": { "reload": "重新加载", "close": "关闭", diff --git a/packages/@core/shared/hooks/src/use-sortable.ts b/packages/@core/shared/hooks/src/use-sortable.ts index 563a2a79..527226fd 100644 --- a/packages/@core/shared/hooks/src/use-sortable.ts +++ b/packages/@core/shared/hooks/src/use-sortable.ts @@ -1,4 +1,5 @@ import type { SortableOptions } from 'sortablejs'; +import type Sortable from 'sortablejs'; function useSortable( sortableContainer: T, @@ -22,7 +23,7 @@ function useSortable( delayOnTouchOnly: true, ...options, }); - return sortable; + return sortable as Sortable; }; return { @@ -31,3 +32,5 @@ function useSortable( } export { useSortable }; + +export type { Sortable }; diff --git a/packages/@core/shared/typings/src/app.d.ts b/packages/@core/shared/typings/src/app.d.ts index 120ab8dd..5b34e2fc 100644 --- a/packages/@core/shared/typings/src/app.d.ts +++ b/packages/@core/shared/typings/src/app.d.ts @@ -44,6 +44,8 @@ type AccessModeType = 'allow-all' | 'backend' | 'frontend'; type NavigationStyleType = 'plain' | 'rounded'; +type TabsStyleType = 'brisk' | 'card' | 'chrome' | 'plain'; + type PageTransitionType = 'fade' | 'fade-down' | 'fade-slide' | 'fade-up'; type AuthPageLayoutType = 'panel-center' | 'panel-left' | 'panel-right'; @@ -60,5 +62,6 @@ export type { NavigationStyleType, PageTransitionType, SupportedLanguagesType, + TabsStyleType, ThemeModeType, }; diff --git a/packages/@core/ui-kit/layout-ui/src/components/layout-sidebar.vue b/packages/@core/ui-kit/layout-ui/src/components/layout-sidebar.vue index d2bbd00e..19ffbd4c 100644 --- a/packages/@core/ui-kit/layout-ui/src/components/layout-sidebar.vue +++ b/packages/@core/ui-kit/layout-ui/src/components/layout-sidebar.vue @@ -267,7 +267,7 @@ function handleMouseleave() {
- + @@ -297,7 +297,7 @@ function handleMouseleave() {
- + diff --git a/packages/@core/ui-kit/layout-ui/src/components/layout-tabbar.vue b/packages/@core/ui-kit/layout-ui/src/components/layout-tabbar.vue index d79d02c5..b7b211d8 100644 --- a/packages/@core/ui-kit/layout-ui/src/components/layout-tabbar.vue +++ b/packages/@core/ui-kit/layout-ui/src/components/layout-tabbar.vue @@ -39,8 +39,5 @@ const style = computed((): CSSProperties => { diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/scrollbar/scrollbar.vue b/packages/@core/ui-kit/shadcn-ui/src/components/scrollbar/scrollbar.vue index 7cb2f4a2..b152b4cb 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/components/scrollbar/scrollbar.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/components/scrollbar/scrollbar.vue @@ -2,15 +2,22 @@ import type { HTMLAttributes } from 'vue'; import { ref } from 'vue'; -import { ScrollArea } from '@vben-core/shadcn-ui/components/ui/scroll-area'; +import { + ScrollArea, + ScrollBar, +} from '@vben-core/shadcn-ui/components/ui/scroll-area'; import { cn } from '@vben-core/toolkit'; interface Props { class?: HTMLAttributes['class']; + horizontal?: boolean; + shadow?: boolean; } const props = withDefaults(defineProps(), { class: '', + horizontal: false, + shadow: false, }); const isAtTop = ref(true); @@ -33,6 +40,7 @@ function handleScroll(event: Event) { class="relative" >
+ diff --git a/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue b/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue index a2e84f78..a709758f 100644 --- a/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue +++ b/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue @@ -5,13 +5,13 @@ import type { TabConfig, TabsProps } from '../../types'; import { computed, nextTick, onMounted, ref, watch } from 'vue'; -import { MdiPin } from '@vben-core/iconify'; +import { IcRoundClose, MdiPin } from '@vben-core/iconify'; import { VbenContextMenu, VbenIcon } from '@vben-core/shadcn-ui'; interface Props extends TabsProps {} defineOptions({ - name: 'TabsChrome', + name: 'VbenTabsChrome', // eslint-disable-next-line perfectionist/sort-objects inheritAttrs: false, }); @@ -94,7 +94,10 @@ function handleUnpinTab(tab: TabConfig) {