@pubinfo/core 2.0.0-rc.2 → 2.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AppSetting-D2RJrc9O.js → AppSetting-3wJKvibc.js} +19 -19
- package/dist/{HCheckList.vue_vue_type_script_setup_true_lang-DusVz35O.js → HCheckList.vue_vue_type_script_setup_true_lang-17EywJvs.js} +1 -1
- package/dist/{HToggle-DMcVgMVY.js → HToggle-B-ZjSh6S.js} +1 -1
- package/dist/{PreferencesContent-Dtd9rtew.js → PreferencesContent-xT4paU7N.js} +52 -52
- package/dist/{SettingBreadcrumb-QSCSviKM.js → SettingBreadcrumb-CYnO51Ek.js} +5 -5
- package/dist/{SettingCopyright-Dr5P6yfq.js → SettingCopyright-FOW5ObHK.js} +2 -2
- package/dist/{SettingEnableTransition-DGiHEbCI.js → SettingEnableTransition-Q5cvubmF.js} +12 -12
- package/dist/{SettingHome-CEPcBlds.js → SettingHome-Df7-AlWB.js} +8 -8
- package/dist/{SettingMenu-BJdjnRA6.js → SettingMenu-BNAJ3el9.js} +14 -14
- package/dist/{SettingMode-BnuCHoEY.js → SettingMode-LzlRsBL9.js} +3 -3
- package/dist/{SettingNavSearch-CiU4BmlU.js → SettingNavSearch-BA08vYuw.js} +6 -6
- package/dist/{SettingOther-DTHjVlFe.js → SettingOther-BE8dDCYD.js} +11 -11
- package/dist/{SettingPage-D75_Nf05.js → SettingPage-D061yXCv.js} +2 -2
- package/dist/{SettingTabbar-D48dzvgA.js → SettingTabbar-COwdPPKy.js} +13 -13
- package/dist/{SettingThemes-D-8vTs5n.js → SettingThemes-BHaYERNp.js} +12 -12
- package/dist/{SettingToolbar-DjIjm9V-.js → SettingToolbar-fSuzu6ND.js} +10 -10
- package/dist/{SettingTopbar-Cg30OTH3.js → SettingTopbar-D7GgP0KB.js} +6 -6
- package/dist/{SettingWidthMode-BKV_7kb8.js → SettingWidthMode-CNjzChe1.js} +11 -11
- package/dist/{TopThinMode-JFYsp_lJ.js → TopThinMode-B-28sBJD.js} +3 -3
- package/dist/built-in/layout-component/Layout.vue.d.ts +1 -0
- package/dist/built-in/layout-component/components/Tools/Fullscreen.vue.d.ts +2 -0
- package/dist/built-in/layout-component/components/Tools/PageReload.vue.d.ts +2 -0
- package/dist/built-in/layout-component/components/Tools/SearchBar.vue.d.ts +2 -0
- package/dist/built-in/layout-component/components/Tools/index.vue.d.ts +47 -1
- package/dist/built-in/layout-component/components/Tools/interface.d.ts +26 -0
- package/dist/built-in/layout-component/components/ui/HDropdownMenu.vue.d.ts +2 -7
- package/dist/built-in/layout-component/composables/useHotkey.d.ts +1 -5
- package/dist/built-in/layout-component/composables/useMainPage.d.ts +1 -1
- package/dist/built-in/layout-component/composables/useMenu.d.ts +1 -1
- package/dist/built-in/layout-component/composables/useTabbar.d.ts +1 -1
- package/dist/built-in/layout-component/composables/useTitle.d.ts +2 -1
- package/dist/built-in/layout-component/composables/useWatermark.d.ts +3 -1
- package/dist/built-in/layout-component/index.d.ts +9 -6
- package/dist/built-in/layout-component/utils/index.d.ts +0 -1
- package/dist/{colors-CODcBxrF.js → colors-BIQSd520.js} +1 -1
- package/dist/{index-Jd3PYkpj.js → index-Beb7_0-E.js} +11384 -11329
- package/dist/{index-BAoB7aoj.js → index-CPRiufg0.js} +1 -1
- package/dist/{index-DmcblkoZ.js → index-DNdH93AP.js} +13 -13
- package/dist/{index-DQn1WFMa.js → index-DYMBkmAp.js} +2 -2
- package/dist/{index-BVLkBCRY.js → index-Dlf6GQBd.js} +6418 -6439
- package/dist/{index-DvJr0paY.js → index-IscoZG-Y.js} +2 -2
- package/dist/{index-BROqFYXS.js → index-WubcSL0v.js} +1 -1
- package/dist/{index-RT-QBzm0.js → index-YSjb6X1D.js} +10 -12
- package/dist/{index-D4_xmL_A.js → index-wxEEuQXu.js} +17 -17
- package/dist/index.d.ts +4 -2
- package/dist/index.js +53 -55
- package/dist/{pick-BLJM77QN.js → pick-D_XPbQHB.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +9 -9
- package/src/built-in/layout-component/Layout.vue +11 -22
- package/src/built-in/layout-component/components/Header/TopMode/index.vue +1 -1
- package/src/built-in/layout-component/components/Sidebar/MainSidebar.vue +1 -1
- package/src/built-in/layout-component/components/Sidebar/index.vue +1 -1
- package/src/built-in/layout-component/components/Tools/DarkModeToggle.vue +108 -0
- package/src/built-in/layout-component/components/Tools/Fullscreen.vue +24 -0
- package/src/built-in/layout-component/components/Tools/PageReload.vue +22 -0
- package/src/built-in/layout-component/components/Tools/SearchBar.vue +44 -0
- package/src/built-in/layout-component/components/Tools/{Search.vue → SearchPanel.vue} +1 -1
- package/src/built-in/layout-component/components/Tools/index.vue +63 -131
- package/src/built-in/layout-component/components/Tools/interface.ts +27 -0
- package/src/built-in/layout-component/components/Topbar/Tabbar/MoreAction.vue +2 -2
- package/src/built-in/layout-component/components/Topbar/Tabbar/index.vue +2 -2
- package/src/built-in/layout-component/components/ui/HDropdownMenu.vue +19 -26
- package/src/built-in/layout-component/composables/useGetComputedStyle.ts +2 -3
- package/src/built-in/layout-component/composables/useHotkey.ts +6 -10
- package/src/built-in/layout-component/composables/useMainPage.ts +5 -6
- package/src/built-in/layout-component/composables/useMenu.ts +3 -5
- package/src/built-in/layout-component/composables/useTabbar.ts +3 -5
- package/src/built-in/layout-component/composables/useTitle.ts +2 -3
- package/src/built-in/layout-component/composables/useWatermark.ts +25 -12
- package/src/built-in/layout-component/index.ts +21 -12
- package/src/built-in/layout-component/provider.ts +6 -2
- package/src/built-in/layout-component/utils/index.ts +0 -1
- package/src/built-in/settings/router.ts +5 -1
- package/src/features/stores/utils/routerHelper.ts +3 -0
- package/src/index.ts +7 -9
- package/dist/built-in/layout-component/utils/eventBus.d.ts +0 -5
- package/src/built-in/layout-component/components/Tools/DayNightSwitch.vue +0 -70
- package/src/built-in/layout-component/utils/eventBus.ts +0 -8
- /package/dist/built-in/layout-component/components/Tools/{DayNightSwitch.vue.d.ts → DarkModeToggle.vue.d.ts} +0 -0
- /package/dist/built-in/layout-component/components/Tools/{Search.vue.d.ts → SearchPanel.vue.d.ts} +0 -0
|
@@ -13,8 +13,8 @@ import RiPushpin2Fill from '~icons/ri/pushpin-2-fill';
|
|
|
13
13
|
import { PubinfoIcon } from '@/features/components';
|
|
14
14
|
import { useContext } from '../../../composables/useContext';
|
|
15
15
|
import { useGlobalSearch } from '../../../composables/useGlobalSearch';
|
|
16
|
-
import useTabbar from '../../../composables/useTabbar';
|
|
17
|
-
import Search from '../../Tools/
|
|
16
|
+
import { useTabbar } from '../../../composables/useTabbar';
|
|
17
|
+
import Search from '../../Tools/SearchPanel.vue';
|
|
18
18
|
|
|
19
19
|
defineOptions({
|
|
20
20
|
name: 'TabbarMoreAction',
|
|
@@ -11,8 +11,8 @@ import RiPushpin2Fill from '~icons/ri/pushpin-2-fill';
|
|
|
11
11
|
import { PubinfoIcon } from '@/features/components';
|
|
12
12
|
import { storage } from '@/utils';
|
|
13
13
|
import { useContext } from '../../../composables/useContext';
|
|
14
|
-
import useMainPage from '../../../composables/useMainPage';
|
|
15
|
-
import useTabbar from '../../../composables/useTabbar';
|
|
14
|
+
import { useMainPage } from '../../../composables/useMainPage';
|
|
15
|
+
import { useTabbar } from '../../../composables/useTabbar';
|
|
16
16
|
import MoreAction from './MoreAction.vue';
|
|
17
17
|
import '@imengyu/vue3-context-menu/lib/vue3-context-menu.css';
|
|
18
18
|
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenu } from '../Tools/interface';
|
|
2
3
|
import { PubinfoIcon } from '@/features/components';
|
|
3
4
|
|
|
4
5
|
const props = defineProps<{
|
|
5
|
-
items:
|
|
6
|
-
icon?: string
|
|
7
|
-
label: string
|
|
8
|
-
disabled?: boolean
|
|
9
|
-
hide?: boolean
|
|
10
|
-
handle?: () => void
|
|
11
|
-
}[][]
|
|
6
|
+
items: DropdownMenu[]
|
|
12
7
|
}>();
|
|
13
8
|
|
|
14
9
|
const myItems = computed(() => {
|
|
15
|
-
return props.items.
|
|
16
|
-
return item.filter(v => !v.hide);
|
|
17
|
-
}).filter(v => v.length);
|
|
10
|
+
return props.items.filter(item => !item?.hide);
|
|
18
11
|
});
|
|
19
12
|
</script>
|
|
20
13
|
|
|
@@ -27,23 +20,23 @@ const myItems = computed(() => {
|
|
|
27
20
|
:auto-hide="false"
|
|
28
21
|
>
|
|
29
22
|
<slot />
|
|
23
|
+
|
|
30
24
|
<template #popper>
|
|
31
|
-
<div
|
|
32
|
-
v-for="(item, index) in myItems"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</button>
|
|
25
|
+
<div class="dark:bg-[var(--g-container-bg)] py-1">
|
|
26
|
+
<template v-for="(item, index) in myItems" :key="index">
|
|
27
|
+
<div v-if="item?.key === 'divider'" border-b="~ solid stone-2 dark:stone-7 last:size-0" class="my-1" />
|
|
28
|
+
|
|
29
|
+
<div v-else class="px-1">
|
|
30
|
+
<button
|
|
31
|
+
:disabled="item.disabled"
|
|
32
|
+
class="w-full flex cursor-pointer items-center gap-2 border-size-0 rounded-md bg-inherit px-2 py-1.5 text-sm text-dark disabled:cursor-not-allowed dark:text-white disabled:opacity-50 hover:not-disabled:bg-stone-1 dark:hover:not-disabled:bg-stone-9"
|
|
33
|
+
@click="item?.onClick"
|
|
34
|
+
>
|
|
35
|
+
<PubinfoIcon v-if="item?.icon" :name="item.icon" />
|
|
36
|
+
{{ item?.label }}
|
|
37
|
+
</button>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
47
40
|
</div>
|
|
48
41
|
</template>
|
|
49
42
|
</VMenu>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useContext } from './useContext';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 获取指定元素的计算样式属性值
|
|
@@ -17,8 +17,7 @@ type unit = `${string}px`;
|
|
|
17
17
|
* @returns 包含主侧边栏和子侧边栏实际宽度的计算属性对象。
|
|
18
18
|
*/
|
|
19
19
|
export function useGetSidebarActualWidth() {
|
|
20
|
-
const settingsStore =
|
|
21
|
-
const menuStore = useMenuStore();
|
|
20
|
+
const { settingsStore, menuStore } = useContext();
|
|
22
21
|
|
|
23
22
|
const mainSidebarActualWidth = computed<unit>(() => {
|
|
24
23
|
const menuMode = settingsStore.settings.menu.menuMode;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import type { useMenuStore, useSettingsStore } from '@/features/stores';
|
|
2
1
|
import hotkeys from 'hotkeys-js';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { useContext } from './useContext';
|
|
3
|
+
import { useMainPage } from './useMainPage';
|
|
4
|
+
import { useMenu } from './useMenu';
|
|
5
|
+
|
|
6
|
+
export function useHotkey() {
|
|
7
|
+
const { settingsStore, menuStore } = useContext();
|
|
5
8
|
|
|
6
|
-
export function useHotkey({
|
|
7
|
-
menuStore,
|
|
8
|
-
settingsStore,
|
|
9
|
-
}: {
|
|
10
|
-
menuStore: ReturnType<typeof useMenuStore>
|
|
11
|
-
settingsStore: ReturnType<typeof useSettingsStore>
|
|
12
|
-
}) {
|
|
13
9
|
const mainPage = useMainPage();
|
|
14
10
|
const menu = useMenu();
|
|
15
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import useTabbar from './useTabbar';
|
|
1
|
+
import { useContext } from './useContext';
|
|
2
|
+
import { useTabbar } from './useTabbar';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 用于主页面功能的自定义钩子。
|
|
@@ -9,13 +9,12 @@ import useTabbar from './useTabbar';
|
|
|
9
9
|
* - resetCustomTitle: 重置当前页面的自定义标题。
|
|
10
10
|
* - maximize: 设置主页面的最大化状态。
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export function useMainPage() {
|
|
13
|
+
const { settingsStore, tabbarStore } = useContext();
|
|
14
|
+
|
|
13
15
|
const route = useRoute();
|
|
14
16
|
const router = useRouter();
|
|
15
17
|
|
|
16
|
-
const settingsStore = useSettingsStore();
|
|
17
|
-
const tabbarStore = useTabbarStore();
|
|
18
|
-
|
|
19
18
|
const tabbar = useTabbar();
|
|
20
19
|
|
|
21
20
|
/**
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import type { Menu } from '#/menu';
|
|
2
2
|
import { message } from 'ant-design-vue';
|
|
3
|
-
import {
|
|
3
|
+
import { useContext } from './useContext';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 用于管理菜单功能的自定义组合函数。
|
|
7
7
|
* @returns 一个包含 `switchTo` 函数的对象。
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export function useMenu() {
|
|
10
|
+
const { settingsStore, menuStore } = useContext();
|
|
10
11
|
const router = useRouter();
|
|
11
12
|
|
|
12
|
-
const settingsStore = useSettingsStore();
|
|
13
|
-
const menuStore = useMenuStore();
|
|
14
|
-
|
|
15
13
|
function switchTo(index: number | string, mainRouter?: Menu.recordMainRaw) {
|
|
16
14
|
if (mainRouter && mainRouter.meta?.isDev) {
|
|
17
15
|
message.info('暂未上线,敬请期待!');
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { RouteLocationRaw } from 'vue-router';
|
|
2
2
|
import Message from 'vue-m-message';
|
|
3
|
-
import {
|
|
3
|
+
import { useContext } from './useContext';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export function useTabbar() {
|
|
6
|
+
const { settingsStore, tabbarStore } = useContext();
|
|
6
7
|
const route = useRoute();
|
|
7
8
|
const router = useRouter();
|
|
8
9
|
|
|
9
|
-
const settingsStore = useSettingsStore();
|
|
10
|
-
const tabbarStore = useTabbarStore();
|
|
11
|
-
|
|
12
10
|
function getId() {
|
|
13
11
|
return settingsStore.settings.tabbar.mergeTabsBy === 'activeMenu' ? (route.meta.activeMenu ?? route.fullPath) : route.fullPath;
|
|
14
12
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import type { useSettingsStore } from '@/features/stores';
|
|
1
2
|
import { useI18n } from 'vue-i18n';
|
|
2
|
-
import { useSettingsStore } from '@/features/stores';
|
|
3
3
|
|
|
4
|
-
export function useTitle(appTitle: string) {
|
|
5
|
-
const settingsStore = useSettingsStore();
|
|
4
|
+
export function useTitle(appTitle: string, settingsStore: ReturnType<typeof useSettingsStore>) {
|
|
6
5
|
const { t, te } = useI18n();
|
|
7
6
|
const routeInfo = useRoute();
|
|
8
7
|
watch(
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import mitt from 'mitt';
|
|
2
|
+
import { watermark } from '../utils';
|
|
3
|
+
import { useContext } from './useContext';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const eventBus = mitt();
|
|
6
|
+
|
|
7
|
+
export function useWatermark() {
|
|
8
|
+
const { settingsStore, userStore } = useContext();
|
|
7
9
|
const { init, remove } = watermark();
|
|
8
10
|
|
|
9
|
-
eventBus.on('updateWatermark',
|
|
11
|
+
eventBus.on('updateWatermark', updateWatermark);
|
|
12
|
+
|
|
13
|
+
function updateWatermark() {
|
|
10
14
|
if (settingsStore.settings.watermark.enable) {
|
|
11
15
|
loadWatermark();
|
|
12
16
|
window.addEventListener('resize', loadWatermark);
|
|
@@ -15,13 +19,17 @@ export default function useWatermark() {
|
|
|
15
19
|
removeWatermark();
|
|
16
20
|
window.removeEventListener('resize', loadWatermark);
|
|
17
21
|
}
|
|
18
|
-
}
|
|
22
|
+
}
|
|
19
23
|
|
|
20
|
-
watch(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
watch(
|
|
25
|
+
() => settingsStore.settings.app.colorScheme,
|
|
26
|
+
() => {
|
|
27
|
+
if (settingsStore.settings.watermark.enable) {
|
|
28
|
+
loadWatermark();
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{ immediate: true },
|
|
32
|
+
);
|
|
25
33
|
|
|
26
34
|
function getTextVal() {
|
|
27
35
|
const type = settingsStore.settings.watermark.text;
|
|
@@ -63,5 +71,10 @@ export default function useWatermark() {
|
|
|
63
71
|
return {
|
|
64
72
|
loadWatermark,
|
|
65
73
|
removeWatermark,
|
|
74
|
+
updateWatermark,
|
|
66
75
|
};
|
|
67
76
|
}
|
|
77
|
+
|
|
78
|
+
export function updateWatermark() {
|
|
79
|
+
eventBus.emit('updateWatermark');
|
|
80
|
+
}
|
|
@@ -7,18 +7,17 @@ import { Provider as LayoutProvider } from './provider';
|
|
|
7
7
|
import Layout from './Layout.vue';
|
|
8
8
|
import LayoutContent from './components/Content/index.vue';
|
|
9
9
|
import LayoutHeader from './components/Header/index.vue';
|
|
10
|
+
import LayoutSidebar from './components/Sidebar/index.vue';
|
|
11
|
+
import LayoutTopbar from './components/Topbar/index.vue';
|
|
10
12
|
|
|
11
13
|
import Logo from './components/Logo/index.vue';
|
|
12
|
-
import Menu from './components/Menu/index.vue';
|
|
13
14
|
import Tools from './components/Tools/index.vue';
|
|
15
|
+
import Fullscreen from './components/Tools/Fullscreen.vue';
|
|
16
|
+
import PageReload from './components/Tools/PageReload.vue';
|
|
17
|
+
import DarkModeToggle from './components/Tools/DarkModeToggle.vue';
|
|
14
18
|
|
|
15
|
-
import Topbar from './components/Topbar/index.vue';
|
|
16
|
-
import Sidebar from './components/Sidebar/index.vue';
|
|
17
19
|
import Copyright from './components/Copyright/index.vue';
|
|
18
20
|
|
|
19
|
-
import SettingBar from './components/SettingBar/index.vue';
|
|
20
|
-
import BackTop from './components/BackTop/index.vue';
|
|
21
|
-
|
|
22
21
|
import FloatingVue from 'floating-vue';
|
|
23
22
|
import Message from 'vue-m-message';
|
|
24
23
|
import 'vue-m-message/dist/style.css';
|
|
@@ -62,20 +61,30 @@ export function LayoutComponent(): ModuleOptions {
|
|
|
62
61
|
};
|
|
63
62
|
}
|
|
64
63
|
|
|
64
|
+
export type { DropdownMenu, DropdownMenuRender } from './components/Tools/interface';
|
|
65
|
+
|
|
66
|
+
export const Tool = {
|
|
67
|
+
Fullscreen,
|
|
68
|
+
PageReload,
|
|
69
|
+
DarkModeToggle,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
Layout.Provider = LayoutProvider;
|
|
73
|
+
Layout.Header = LayoutHeader;
|
|
74
|
+
Layout.Content = LayoutContent;
|
|
75
|
+
Layout.Sidebar = LayoutSidebar;
|
|
76
|
+
Layout.Topbar = LayoutTopbar;
|
|
77
|
+
|
|
65
78
|
export {
|
|
66
79
|
LayoutProvider,
|
|
67
80
|
Layout,
|
|
68
81
|
LayoutContent,
|
|
69
82
|
LayoutHeader,
|
|
83
|
+
LayoutSidebar,
|
|
84
|
+
LayoutTopbar,
|
|
70
85
|
|
|
71
86
|
Logo,
|
|
72
|
-
Menu,
|
|
73
87
|
Tools,
|
|
74
88
|
|
|
75
|
-
Topbar,
|
|
76
|
-
Sidebar,
|
|
77
89
|
Copyright,
|
|
78
|
-
|
|
79
|
-
SettingBar,
|
|
80
|
-
BackTop,
|
|
81
90
|
};
|
|
@@ -38,7 +38,7 @@ export const Provider = defineComponent({
|
|
|
38
38
|
const tabbarStore = useTabbarStore();
|
|
39
39
|
const favoritesStore = useFavoritesStore();
|
|
40
40
|
|
|
41
|
-
const { generateI18nTitle } = useTitle(props.appTitle);
|
|
41
|
+
const { generateI18nTitle } = useTitle(props.appTitle, settingsStore);
|
|
42
42
|
|
|
43
43
|
createContext({
|
|
44
44
|
settingsStore,
|
|
@@ -58,7 +58,11 @@ export const Provider = defineComponent({
|
|
|
58
58
|
return () => h(
|
|
59
59
|
PubinfoProvider,
|
|
60
60
|
{},
|
|
61
|
-
() => slots?.default?.(
|
|
61
|
+
() => slots?.default?.({
|
|
62
|
+
allMenus: menuStore.allMenus,
|
|
63
|
+
sidebarMenus: menuStore.sidebarMenus,
|
|
64
|
+
activedMenuIndex: menuStore.actived,
|
|
65
|
+
}),
|
|
62
66
|
);
|
|
63
67
|
},
|
|
64
68
|
});
|
|
@@ -106,7 +106,11 @@ function hitCache(
|
|
|
106
106
|
cache?: RouterMetaRawBaseOptions['cache'],
|
|
107
107
|
noCache?: RouterMetaRawBaseOptions['noCache'],
|
|
108
108
|
) {
|
|
109
|
-
|
|
109
|
+
if (typeof cache === 'boolean') {
|
|
110
|
+
return cache && !matched(name, noCache);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return matched(name, cache) && !matched(name, noCache);
|
|
110
114
|
}
|
|
111
115
|
|
|
112
116
|
function matched(
|
|
@@ -136,6 +136,7 @@ function transformMenuAndIframe(route: BackEndRoute, parent: API.PubResourceTree
|
|
|
136
136
|
const menuRouteChildren: BackEndRoute[] = [
|
|
137
137
|
{
|
|
138
138
|
path: '',
|
|
139
|
+
name: route.name,
|
|
139
140
|
component: replaceComponent(route.component, route.meta?.scope),
|
|
140
141
|
meta: {
|
|
141
142
|
...route.meta,
|
|
@@ -155,6 +156,7 @@ function transformMenuAndIframe(route: BackEndRoute, parent: API.PubResourceTree
|
|
|
155
156
|
menuRoute = {
|
|
156
157
|
...route,
|
|
157
158
|
path: startsWithSlash(route.path),
|
|
159
|
+
name: undefined,
|
|
158
160
|
component: setupDefaultLayout(),
|
|
159
161
|
children: menuRouteChildren,
|
|
160
162
|
};
|
|
@@ -165,6 +167,7 @@ function transformMenuAndIframe(route: BackEndRoute, parent: API.PubResourceTree
|
|
|
165
167
|
menuRoute = {
|
|
166
168
|
...route,
|
|
167
169
|
path: route.path,
|
|
170
|
+
name: undefined,
|
|
168
171
|
component: undefined,
|
|
169
172
|
children: menuRouteChildren,
|
|
170
173
|
};
|
package/src/index.ts
CHANGED
|
@@ -78,22 +78,21 @@ export function createPubinfo(options: PubinfoOptions) {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
export { RESPONSE_CODE } from './built-in/authentication';
|
|
81
82
|
export {
|
|
82
|
-
BackTop,
|
|
83
83
|
Copyright,
|
|
84
84
|
Layout,
|
|
85
85
|
LayoutContent,
|
|
86
86
|
LayoutHeader,
|
|
87
87
|
LayoutProvider,
|
|
88
|
+
LayoutSidebar,
|
|
89
|
+
LayoutTopbar,
|
|
88
90
|
Logo,
|
|
89
|
-
|
|
90
|
-
RESPONSE_CODE,
|
|
91
|
-
SettingBar,
|
|
92
|
-
Sidebar,
|
|
91
|
+
Tool,
|
|
93
92
|
Tools,
|
|
94
|
-
|
|
95
|
-
} from './built-in';
|
|
96
|
-
export {
|
|
93
|
+
} from './built-in/layout-component';
|
|
94
|
+
export type { DropdownMenu, DropdownMenuRender } from './built-in/layout-component';
|
|
95
|
+
export { updateWatermark } from './built-in/layout-component/composables/useWatermark';
|
|
97
96
|
|
|
98
97
|
export {
|
|
99
98
|
createRequest,
|
|
@@ -103,7 +102,6 @@ export {
|
|
|
103
102
|
getAllRouteModules,
|
|
104
103
|
readProjectModules,
|
|
105
104
|
} from './core';
|
|
106
|
-
|
|
107
105
|
export * from './core/interface';
|
|
108
106
|
|
|
109
107
|
export * from './features';
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { useContext } from '../../composables/useContext';
|
|
3
|
-
|
|
4
|
-
defineOptions({
|
|
5
|
-
name: 'DayNightSwitch',
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
const { settingsStore } = useContext();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<template>
|
|
12
|
-
<label v-if="settingsStore.settings.toolbar.enableColorScheme" class="day-night">
|
|
13
|
-
<div
|
|
14
|
-
class="animate-icon"
|
|
15
|
-
:class="{
|
|
16
|
-
'animate-icon-day': settingsStore.settings.app.colorScheme !== 'dark',
|
|
17
|
-
}"
|
|
18
|
-
/>
|
|
19
|
-
</label>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<style scoped>
|
|
23
|
-
.day-night {
|
|
24
|
-
--at-apply: size-11 cursor-pointer scale-45;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.animate-icon {
|
|
28
|
-
--at-apply: relative size-38px rounded-1/2 ;
|
|
29
|
-
box-shadow: inset 16px -16px 0 0 #fff;
|
|
30
|
-
transition: box-shadow 0.5s ease 0s, transform 0.4s ease 0.1s;
|
|
31
|
-
transform: scale(1) rotate(-2deg);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.animate-icon::before {
|
|
35
|
-
--at-apply: absolute w-[inherit] h-[inherit] content-empty rounded-[inherit] left-0 top-0;
|
|
36
|
-
transition: background 0.3s ease;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.animate-icon::after {
|
|
40
|
-
--at-apply: absolute top-1/2 left-1/2 size-2 -ml-1 mr-0 -mt-1 mb-0 rounded-[50%] content-empty;
|
|
41
|
-
box-shadow:
|
|
42
|
-
0 -23px 0 #ffce6e,
|
|
43
|
-
0 23px 0 #ffce6e,
|
|
44
|
-
23px 0 0 #ffce6e,
|
|
45
|
-
-23px 0 0 #ffce6e,
|
|
46
|
-
15px 15px 0 #ffce6e,
|
|
47
|
-
-15px 15px 0 #ffce6e,
|
|
48
|
-
15px -15px 0 #ffce6e,
|
|
49
|
-
-15px -15px 0 #ffce6e;
|
|
50
|
-
transition: all 0.3s ease;
|
|
51
|
-
transform: scale(0);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.animate-icon-day {
|
|
55
|
-
--at-apply: size-11;
|
|
56
|
-
box-shadow: inset 32px -32px 0 0 #fff;
|
|
57
|
-
transition: transform 0.3s ease 0.1s, box-shadow 0.2s ease 0s;
|
|
58
|
-
transform: scale(0.5) rotate(0deg);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.animate-icon-day::before {
|
|
62
|
-
background: #ffce6e;
|
|
63
|
-
transition: background 0.3s ease 0.1s;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.animate-icon-day::after {
|
|
67
|
-
transition: transform 0.5s ease 0.15s;
|
|
68
|
-
transform: scale(1.5);
|
|
69
|
-
}
|
|
70
|
-
</style>
|
|
File without changes
|
/package/dist/built-in/layout-component/components/Tools/{Search.vue.d.ts → SearchPanel.vue.d.ts}
RENAMED
|
File without changes
|