@keyblade/pro-components 0.0.1-alpha.6 → 0.0.1-alpha.8
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/es/components.d.ts +1 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -0
- package/es/pro-layout/enum.d.ts +5 -0
- package/es/pro-layout/enum.js +8 -0
- package/es/pro-layout/hooks/index.d.ts +20 -0
- package/es/pro-layout/hooks/index.js +148 -0
- package/es/pro-layout/hooks/theme.d.ts +6 -0
- package/es/pro-layout/hooks/theme.js +41 -0
- package/es/pro-layout/index.d.ts +379 -0
- package/es/pro-layout/index.js +25 -0
- package/es/pro-layout/pro-layout.vue.d.ts +147 -0
- package/es/pro-layout/pro-layout.vue.js +300 -0
- package/es/pro-layout/pro-layout.vue2.js +4 -0
- package/es/pro-layout/pro-layout.vue3.js +6 -0
- package/es/pro-menu/index.d.ts +26 -30
- package/es/pro-menu/pro-menu.vue.d.ts +9 -9
- package/es/pro-menu/pro-menu.vue.js +5 -1
- package/es/pro-page-wrapper/index.d.ts +4 -4
- package/es/pro-page-wrapper/pro-page-wrapper.vue.d.ts +1 -1
- package/es/style.css +77 -3
- package/package.json +1 -1
- package/src/index.ts +5 -0
package/es/components.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare module 'vue' {
|
|
2
2
|
interface GlobalComponents {
|
|
3
3
|
KbProBreadcrumb: typeof import('./index')['ProBreadcrumb'];
|
|
4
|
+
KbProLayout: typeof import('./index')['ProLayout'];
|
|
4
5
|
KbProMenu: typeof import('./index')['ProMenu'];
|
|
5
6
|
KbProPageWrapper: typeof import('./index')['ProPageWrapper'];
|
|
6
7
|
KbProReuseTabs: typeof import('./index')['ProReuseTabs'];
|
package/es/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ declare const _default: {
|
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
export { default as ProBreadcrumb } from './pro-breadcrumb';
|
|
7
|
+
export { default as ProLayout } from './pro-layout';
|
|
8
|
+
export type { EProLayoutTheme } from './pro-layout';
|
|
7
9
|
export { default as ProMenu } from './pro-menu';
|
|
8
10
|
export type { IProMenuItem } from './pro-menu';
|
|
9
11
|
export { default as ProPageWrapper } from './pro-page-wrapper';
|
package/es/index.js
CHANGED
|
@@ -6,9 +6,12 @@ import { ProPageWrapper } from "./pro-page-wrapper/index.js";
|
|
|
6
6
|
import { ProPageWrapper as ProPageWrapper2 } from "./pro-page-wrapper/index.js";
|
|
7
7
|
import { ProReuseTabs } from "./pro-reuse-tabs/index.js";
|
|
8
8
|
import { ProReuseTabs as ProReuseTabs2 } from "./pro-reuse-tabs/index.js";
|
|
9
|
+
import { ProLayout } from "./pro-layout/index.js";
|
|
10
|
+
import { ProLayout as ProLayout2 } from "./pro-layout/index.js";
|
|
9
11
|
const index = {
|
|
10
12
|
install(app) {
|
|
11
13
|
app.use(ProBreadcrumb);
|
|
14
|
+
app.use(ProLayout);
|
|
12
15
|
app.use(ProMenu);
|
|
13
16
|
app.use(ProPageWrapper);
|
|
14
17
|
app.use(ProReuseTabs);
|
|
@@ -16,6 +19,7 @@ const index = {
|
|
|
16
19
|
};
|
|
17
20
|
export {
|
|
18
21
|
ProBreadcrumb2 as ProBreadcrumb,
|
|
22
|
+
ProLayout2 as ProLayout,
|
|
19
23
|
ProMenu2 as ProMenu,
|
|
20
24
|
ProPageWrapper2 as ProPageWrapper,
|
|
21
25
|
ProReuseTabs2 as ProReuseTabs,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { IProMenuItem } from '../../pro-menu';
|
|
3
|
+
export declare function useHooks(menuItems: Ref<IProMenuItem[]>, options: {
|
|
4
|
+
tabsMode: boolean;
|
|
5
|
+
}): {
|
|
6
|
+
menuSelectedKeys: Ref<string[]>;
|
|
7
|
+
menuOpenKeys: Ref<string[]>;
|
|
8
|
+
onMenuItemClick: (key: string) => void;
|
|
9
|
+
onSubMenuClick: (key: string, openKeys: string[]) => void;
|
|
10
|
+
activeMenuItem: Ref<IProMenuItem | undefined>;
|
|
11
|
+
breadcrumbItems: Ref<string[]>;
|
|
12
|
+
tabs: Ref<{
|
|
13
|
+
name: string;
|
|
14
|
+
title: string;
|
|
15
|
+
fullPath: string;
|
|
16
|
+
active: boolean;
|
|
17
|
+
}[]>;
|
|
18
|
+
onTabClick: (key: string) => void;
|
|
19
|
+
onTabDelete: (key: string) => void;
|
|
20
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { ref, watch } from "vue";
|
|
2
|
+
import { useRoute, useRouter } from "vue-router";
|
|
3
|
+
function useHooks(menuItems, options) {
|
|
4
|
+
const route = useRoute();
|
|
5
|
+
const router = useRouter();
|
|
6
|
+
const menuSelectedKeys = ref([]);
|
|
7
|
+
const menuOpenKeys = ref([]);
|
|
8
|
+
const onMenuItemClick = (key) => {
|
|
9
|
+
menuSelectedKeys.value = [key];
|
|
10
|
+
};
|
|
11
|
+
const onSubMenuClick = (key, openKeys) => {
|
|
12
|
+
menuOpenKeys.value = openKeys;
|
|
13
|
+
};
|
|
14
|
+
const activeMenuItem = ref();
|
|
15
|
+
const menuItemMap = ref({});
|
|
16
|
+
const breadcrumbItems = ref([]);
|
|
17
|
+
const tabs = ref([]);
|
|
18
|
+
const setBreadcrumbItems = () => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
const menuItemPaths = [];
|
|
21
|
+
const recursion = (_menuItem) => {
|
|
22
|
+
var _a2;
|
|
23
|
+
let find = false;
|
|
24
|
+
for (const i in _menuItem) {
|
|
25
|
+
if (_menuItem[i].name === ((_a2 = activeMenuItem.value) == null ? void 0 : _a2.name)) {
|
|
26
|
+
find = true;
|
|
27
|
+
menuItemPaths.push(_menuItem[i]);
|
|
28
|
+
}
|
|
29
|
+
const children = _menuItem[i].children;
|
|
30
|
+
if (children) {
|
|
31
|
+
const node = recursion(children);
|
|
32
|
+
if (node) {
|
|
33
|
+
menuItemPaths.push(_menuItem[i]);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return find;
|
|
38
|
+
};
|
|
39
|
+
recursion(menuItems.value);
|
|
40
|
+
const activeMenuItemPaths = menuItemPaths.reverse();
|
|
41
|
+
const parentMenuPaths = activeMenuItemPaths.filter((_, i) => i !== activeMenuItemPaths.length - 1);
|
|
42
|
+
const keySet = /* @__PURE__ */ new Set([...parentMenuPaths.map((v) => v.name), ...menuOpenKeys.value]);
|
|
43
|
+
menuOpenKeys.value = [...keySet];
|
|
44
|
+
const activeMenuItemTitles = activeMenuItemPaths.map((v) => v.title);
|
|
45
|
+
breadcrumbItems.value = ((_a = activeMenuItem.value) == null ? void 0 : _a.breadcrumbs) ? (_b = activeMenuItem.value) == null ? void 0 : _b.breadcrumbs : activeMenuItemTitles.length !== 0 ? activeMenuItemTitles : [];
|
|
46
|
+
};
|
|
47
|
+
function setTabs() {
|
|
48
|
+
const { name: menuItemName, title: menuItemTitle, noAffix } = activeMenuItem.value;
|
|
49
|
+
if (noAffix) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
let findIndex = -1;
|
|
53
|
+
tabs.value.forEach((v, i) => {
|
|
54
|
+
v.active = false;
|
|
55
|
+
if (v.name === menuItemName) {
|
|
56
|
+
findIndex = i;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const newTab = {
|
|
60
|
+
name: menuItemName,
|
|
61
|
+
title: menuItemTitle ?? menuItemName,
|
|
62
|
+
fullPath: route.fullPath,
|
|
63
|
+
active: true
|
|
64
|
+
};
|
|
65
|
+
if (~findIndex) {
|
|
66
|
+
const findTab = tabs.value[findIndex];
|
|
67
|
+
if (findTab.fullPath === route.fullPath) {
|
|
68
|
+
findTab.active = true;
|
|
69
|
+
findTab.fullPath = route.fullPath;
|
|
70
|
+
} else {
|
|
71
|
+
tabs.value.splice(findIndex, 1);
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
tabs.value.push(newTab);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
tabs.value.push(newTab);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const onTabClick = (key) => {
|
|
81
|
+
const findTabIndex = tabs.value.findIndex((v) => v.name === key);
|
|
82
|
+
const findTab = tabs.value[findTabIndex];
|
|
83
|
+
router.push(findTab.fullPath);
|
|
84
|
+
};
|
|
85
|
+
const onTabDelete = (key) => {
|
|
86
|
+
let activeIndex = -1;
|
|
87
|
+
let findTabIndex = -1;
|
|
88
|
+
tabs.value.forEach((tab, index) => {
|
|
89
|
+
if (tab.name === key) {
|
|
90
|
+
findTabIndex = index;
|
|
91
|
+
}
|
|
92
|
+
if (tab.active) {
|
|
93
|
+
activeIndex = index;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
if (activeIndex === findTabIndex) {
|
|
97
|
+
let tab;
|
|
98
|
+
if (findTabIndex === 0) {
|
|
99
|
+
tab = tabs.value[findTabIndex + 1];
|
|
100
|
+
} else {
|
|
101
|
+
tab = tabs.value[findTabIndex - 1];
|
|
102
|
+
}
|
|
103
|
+
tab.active = true;
|
|
104
|
+
router.push(tab.fullPath);
|
|
105
|
+
}
|
|
106
|
+
tabs.value.splice(findTabIndex, 1);
|
|
107
|
+
};
|
|
108
|
+
watch(menuItems, () => {
|
|
109
|
+
const _menuItemMap = {};
|
|
110
|
+
const fn = (_menuItem) => {
|
|
111
|
+
_menuItem.forEach((menuItem) => {
|
|
112
|
+
if (menuItem.children && menuItem.children.length > 0) {
|
|
113
|
+
fn(menuItem.children);
|
|
114
|
+
}
|
|
115
|
+
delete menuItem["children"];
|
|
116
|
+
_menuItemMap[menuItem.name] = menuItem;
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
fn(JSON.parse(JSON.stringify(menuItems.value)));
|
|
120
|
+
menuItemMap.value = _menuItemMap;
|
|
121
|
+
}, { immediate: true });
|
|
122
|
+
watch(() => route.name, () => {
|
|
123
|
+
const routeName = route.name;
|
|
124
|
+
activeMenuItem.value = menuItemMap.value[routeName];
|
|
125
|
+
if (!(activeMenuItem == null ? void 0 : activeMenuItem.value)) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
menuSelectedKeys.value = [activeMenuItem.value.name];
|
|
129
|
+
setBreadcrumbItems();
|
|
130
|
+
if (options.tabsMode) {
|
|
131
|
+
setTabs();
|
|
132
|
+
}
|
|
133
|
+
}, { immediate: true });
|
|
134
|
+
return {
|
|
135
|
+
menuSelectedKeys,
|
|
136
|
+
menuOpenKeys,
|
|
137
|
+
onMenuItemClick,
|
|
138
|
+
onSubMenuClick,
|
|
139
|
+
activeMenuItem,
|
|
140
|
+
breadcrumbItems,
|
|
141
|
+
tabs,
|
|
142
|
+
onTabClick,
|
|
143
|
+
onTabDelete
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
useHooks
|
|
148
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ref, watch, readonly } from "vue";
|
|
2
|
+
import { EProLayoutTheme } from "../enum.js";
|
|
3
|
+
function useThemeHooks(initValue) {
|
|
4
|
+
const themeStorageKey = "theme";
|
|
5
|
+
const theme = ref(localStorage.getItem(themeStorageKey) ?? initValue);
|
|
6
|
+
const setTheme = (_theme) => {
|
|
7
|
+
switch (_theme) {
|
|
8
|
+
case EProLayoutTheme.light:
|
|
9
|
+
document.body.removeAttribute("arco-theme");
|
|
10
|
+
break;
|
|
11
|
+
case EProLayoutTheme.dark:
|
|
12
|
+
document.body.setAttribute("arco-theme", "dark");
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
theme.value = _theme;
|
|
16
|
+
localStorage.setItem(themeStorageKey, theme.value);
|
|
17
|
+
};
|
|
18
|
+
const onToggleTheme = () => {
|
|
19
|
+
switch (theme.value) {
|
|
20
|
+
case EProLayoutTheme.light:
|
|
21
|
+
setTheme(EProLayoutTheme.dark);
|
|
22
|
+
break;
|
|
23
|
+
case EProLayoutTheme.dark:
|
|
24
|
+
setTheme(EProLayoutTheme.light);
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
watch(theme, () => {
|
|
29
|
+
setTheme(theme.value);
|
|
30
|
+
}, { immediate: true });
|
|
31
|
+
watch(() => initValue, () => {
|
|
32
|
+
setTheme(initValue);
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
currentTheme: readonly(theme),
|
|
36
|
+
onToggleCurrentTheme: onToggleTheme
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
useThemeHooks
|
|
41
|
+
};
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import type { EProLayoutTheme } from './enum';
|
|
2
|
+
import type { IProMenuItem } from '../pro-menu';
|
|
3
|
+
import type { ComponentInternalInstance, ExtractPropTypes, PropType, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, Ref, ComputedRef, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, App } from 'vue';
|
|
4
|
+
declare const ProLayout: {
|
|
5
|
+
new (...args: any[]): {
|
|
6
|
+
$: ComponentInternalInstance;
|
|
7
|
+
$data: {};
|
|
8
|
+
$props: Partial<{
|
|
9
|
+
menuItems: IProMenuItem[];
|
|
10
|
+
headerTitle: string;
|
|
11
|
+
headerLogo: string;
|
|
12
|
+
headerRightItemSlotNames: string[];
|
|
13
|
+
hideThemeItem: boolean;
|
|
14
|
+
footerTitle: string;
|
|
15
|
+
theme: EProLayoutTheme;
|
|
16
|
+
tabsMode: boolean;
|
|
17
|
+
user: {
|
|
18
|
+
name: string;
|
|
19
|
+
avatar?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
}> & Omit<Readonly<ExtractPropTypes<{
|
|
22
|
+
menuItems: {
|
|
23
|
+
type: PropType<IProMenuItem[]>;
|
|
24
|
+
required: false;
|
|
25
|
+
default: () => never[];
|
|
26
|
+
};
|
|
27
|
+
headerTitle: {
|
|
28
|
+
type: PropType<string>;
|
|
29
|
+
required: false;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
headerLogo: {
|
|
33
|
+
type: PropType<string>;
|
|
34
|
+
required: false;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
headerRightItemSlotNames: {
|
|
38
|
+
type: PropType<string[]>;
|
|
39
|
+
required: false;
|
|
40
|
+
default: () => never[];
|
|
41
|
+
};
|
|
42
|
+
hideThemeItem: {
|
|
43
|
+
type: PropType<boolean>;
|
|
44
|
+
required: false;
|
|
45
|
+
default: boolean;
|
|
46
|
+
};
|
|
47
|
+
footerTitle: {
|
|
48
|
+
type: PropType<string>;
|
|
49
|
+
required: false;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
theme: {
|
|
53
|
+
type: PropType<EProLayoutTheme>;
|
|
54
|
+
required: false;
|
|
55
|
+
default: EProLayoutTheme;
|
|
56
|
+
};
|
|
57
|
+
tabsMode: {
|
|
58
|
+
type: PropType<boolean>;
|
|
59
|
+
required: false;
|
|
60
|
+
default: boolean;
|
|
61
|
+
};
|
|
62
|
+
user: {
|
|
63
|
+
type: PropType<{
|
|
64
|
+
name: string;
|
|
65
|
+
avatar?: string | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
required: false;
|
|
68
|
+
default: undefined;
|
|
69
|
+
};
|
|
70
|
+
}>> & VNodeProps & AllowedComponentProps & ComponentCustomProps, "menuItems" | "headerTitle" | "headerLogo" | "headerRightItemSlotNames" | "hideThemeItem" | "footerTitle" | "theme" | "tabsMode" | "user">;
|
|
71
|
+
$attrs: {
|
|
72
|
+
[x: string]: unknown;
|
|
73
|
+
};
|
|
74
|
+
$refs: {
|
|
75
|
+
[x: string]: unknown;
|
|
76
|
+
};
|
|
77
|
+
$slots: Readonly<{
|
|
78
|
+
[name: string]: Slot | undefined;
|
|
79
|
+
}>;
|
|
80
|
+
$root: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
81
|
+
$parent: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
82
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
83
|
+
$el: any;
|
|
84
|
+
$options: ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
85
|
+
menuItems: {
|
|
86
|
+
type: PropType<IProMenuItem[]>;
|
|
87
|
+
required: false;
|
|
88
|
+
default: () => never[];
|
|
89
|
+
};
|
|
90
|
+
headerTitle: {
|
|
91
|
+
type: PropType<string>;
|
|
92
|
+
required: false;
|
|
93
|
+
default: string;
|
|
94
|
+
};
|
|
95
|
+
headerLogo: {
|
|
96
|
+
type: PropType<string>;
|
|
97
|
+
required: false;
|
|
98
|
+
default: string;
|
|
99
|
+
};
|
|
100
|
+
headerRightItemSlotNames: {
|
|
101
|
+
type: PropType<string[]>;
|
|
102
|
+
required: false;
|
|
103
|
+
default: () => never[];
|
|
104
|
+
};
|
|
105
|
+
hideThemeItem: {
|
|
106
|
+
type: PropType<boolean>;
|
|
107
|
+
required: false;
|
|
108
|
+
default: boolean;
|
|
109
|
+
};
|
|
110
|
+
footerTitle: {
|
|
111
|
+
type: PropType<string>;
|
|
112
|
+
required: false;
|
|
113
|
+
default: string;
|
|
114
|
+
};
|
|
115
|
+
theme: {
|
|
116
|
+
type: PropType<EProLayoutTheme>;
|
|
117
|
+
required: false;
|
|
118
|
+
default: EProLayoutTheme;
|
|
119
|
+
};
|
|
120
|
+
tabsMode: {
|
|
121
|
+
type: PropType<boolean>;
|
|
122
|
+
required: false;
|
|
123
|
+
default: boolean;
|
|
124
|
+
};
|
|
125
|
+
user: {
|
|
126
|
+
type: PropType<{
|
|
127
|
+
name: string;
|
|
128
|
+
avatar?: string | undefined;
|
|
129
|
+
}>;
|
|
130
|
+
required: false;
|
|
131
|
+
default: undefined;
|
|
132
|
+
};
|
|
133
|
+
}>>, {
|
|
134
|
+
prefixClsName: string;
|
|
135
|
+
props: any;
|
|
136
|
+
menuItems: Ref<IProMenuItem[]>;
|
|
137
|
+
slots: Readonly<{
|
|
138
|
+
[name: string]: Slot | undefined;
|
|
139
|
+
}>;
|
|
140
|
+
currentTheme: Readonly<Ref<EProLayoutTheme>>;
|
|
141
|
+
onToggleCurrentTheme: () => void;
|
|
142
|
+
menuSelectedKeys: Ref<string[]>;
|
|
143
|
+
menuOpenKeys: Ref<string[]>;
|
|
144
|
+
onMenuItemClick: (key: string) => void;
|
|
145
|
+
onSubMenuClick: (key: string, openKeys: string[]) => void;
|
|
146
|
+
activeMenuItem: Ref<IProMenuItem | undefined>;
|
|
147
|
+
breadcrumbItems: Ref<string[]>;
|
|
148
|
+
tabs: Ref<{
|
|
149
|
+
name: string;
|
|
150
|
+
title: string;
|
|
151
|
+
fullPath: string;
|
|
152
|
+
active: boolean;
|
|
153
|
+
}[]>;
|
|
154
|
+
onTabClick: (key: string) => void;
|
|
155
|
+
onTabDelete: (key: string) => void;
|
|
156
|
+
keepAliveKeys: ComputedRef<string[]>;
|
|
157
|
+
siderWidth: number;
|
|
158
|
+
siderCollapsedWidth: number;
|
|
159
|
+
siderWidthPx: string;
|
|
160
|
+
siderCollapsedWidthPx: string;
|
|
161
|
+
siderCollapsed: Ref<boolean>;
|
|
162
|
+
onSiderCollapse: (val: boolean) => void;
|
|
163
|
+
readonly EProLayoutTheme: typeof EProLayoutTheme;
|
|
164
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
165
|
+
menuItems: IProMenuItem[];
|
|
166
|
+
headerTitle: string;
|
|
167
|
+
headerLogo: string;
|
|
168
|
+
headerRightItemSlotNames: string[];
|
|
169
|
+
hideThemeItem: boolean;
|
|
170
|
+
footerTitle: string;
|
|
171
|
+
theme: EProLayoutTheme;
|
|
172
|
+
tabsMode: boolean;
|
|
173
|
+
user: {
|
|
174
|
+
name: string;
|
|
175
|
+
avatar?: string | undefined;
|
|
176
|
+
};
|
|
177
|
+
}, {}, string> & {
|
|
178
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
179
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
180
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
181
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
182
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
183
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
184
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
185
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
186
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
187
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
188
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
189
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
190
|
+
renderTracked?: (((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[]) | undefined;
|
|
191
|
+
renderTriggered?: (((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[]) | undefined;
|
|
192
|
+
errorCaptured?: (((err: unknown, instance: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
|
|
193
|
+
};
|
|
194
|
+
$forceUpdate: () => void;
|
|
195
|
+
$nextTick: typeof nextTick;
|
|
196
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: WatchOptions<boolean> | undefined): WatchStopHandle;
|
|
197
|
+
} & Readonly<ExtractPropTypes<{
|
|
198
|
+
menuItems: {
|
|
199
|
+
type: PropType<IProMenuItem[]>;
|
|
200
|
+
required: false;
|
|
201
|
+
default: () => never[];
|
|
202
|
+
};
|
|
203
|
+
headerTitle: {
|
|
204
|
+
type: PropType<string>;
|
|
205
|
+
required: false;
|
|
206
|
+
default: string;
|
|
207
|
+
};
|
|
208
|
+
headerLogo: {
|
|
209
|
+
type: PropType<string>;
|
|
210
|
+
required: false;
|
|
211
|
+
default: string;
|
|
212
|
+
};
|
|
213
|
+
headerRightItemSlotNames: {
|
|
214
|
+
type: PropType<string[]>;
|
|
215
|
+
required: false;
|
|
216
|
+
default: () => never[];
|
|
217
|
+
};
|
|
218
|
+
hideThemeItem: {
|
|
219
|
+
type: PropType<boolean>;
|
|
220
|
+
required: false;
|
|
221
|
+
default: boolean;
|
|
222
|
+
};
|
|
223
|
+
footerTitle: {
|
|
224
|
+
type: PropType<string>;
|
|
225
|
+
required: false;
|
|
226
|
+
default: string;
|
|
227
|
+
};
|
|
228
|
+
theme: {
|
|
229
|
+
type: PropType<EProLayoutTheme>;
|
|
230
|
+
required: false;
|
|
231
|
+
default: EProLayoutTheme;
|
|
232
|
+
};
|
|
233
|
+
tabsMode: {
|
|
234
|
+
type: PropType<boolean>;
|
|
235
|
+
required: false;
|
|
236
|
+
default: boolean;
|
|
237
|
+
};
|
|
238
|
+
user: {
|
|
239
|
+
type: PropType<{
|
|
240
|
+
name: string;
|
|
241
|
+
avatar?: string | undefined;
|
|
242
|
+
}>;
|
|
243
|
+
required: false;
|
|
244
|
+
default: undefined;
|
|
245
|
+
};
|
|
246
|
+
}>> & ShallowUnwrapRef<{
|
|
247
|
+
prefixClsName: string;
|
|
248
|
+
props: any;
|
|
249
|
+
menuItems: Ref<IProMenuItem[]>;
|
|
250
|
+
slots: Readonly<{
|
|
251
|
+
[name: string]: Slot | undefined;
|
|
252
|
+
}>;
|
|
253
|
+
currentTheme: Readonly<Ref<EProLayoutTheme>>;
|
|
254
|
+
onToggleCurrentTheme: () => void;
|
|
255
|
+
menuSelectedKeys: Ref<string[]>;
|
|
256
|
+
menuOpenKeys: Ref<string[]>;
|
|
257
|
+
onMenuItemClick: (key: string) => void;
|
|
258
|
+
onSubMenuClick: (key: string, openKeys: string[]) => void;
|
|
259
|
+
activeMenuItem: Ref<IProMenuItem | undefined>;
|
|
260
|
+
breadcrumbItems: Ref<string[]>;
|
|
261
|
+
tabs: Ref<{
|
|
262
|
+
name: string;
|
|
263
|
+
title: string;
|
|
264
|
+
fullPath: string;
|
|
265
|
+
active: boolean;
|
|
266
|
+
}[]>;
|
|
267
|
+
onTabClick: (key: string) => void;
|
|
268
|
+
onTabDelete: (key: string) => void;
|
|
269
|
+
keepAliveKeys: ComputedRef<string[]>;
|
|
270
|
+
siderWidth: number;
|
|
271
|
+
siderCollapsedWidth: number;
|
|
272
|
+
siderWidthPx: string;
|
|
273
|
+
siderCollapsedWidthPx: string;
|
|
274
|
+
siderCollapsed: Ref<boolean>;
|
|
275
|
+
onSiderCollapse: (val: boolean) => void;
|
|
276
|
+
readonly EProLayoutTheme: typeof EProLayoutTheme;
|
|
277
|
+
}> & {} & ComponentCustomProperties & {};
|
|
278
|
+
__isFragment?: undefined;
|
|
279
|
+
__isTeleport?: undefined;
|
|
280
|
+
__isSuspense?: undefined;
|
|
281
|
+
} & ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
282
|
+
menuItems: {
|
|
283
|
+
type: PropType<IProMenuItem[]>;
|
|
284
|
+
required: false;
|
|
285
|
+
default: () => never[];
|
|
286
|
+
};
|
|
287
|
+
headerTitle: {
|
|
288
|
+
type: PropType<string>;
|
|
289
|
+
required: false;
|
|
290
|
+
default: string;
|
|
291
|
+
};
|
|
292
|
+
headerLogo: {
|
|
293
|
+
type: PropType<string>;
|
|
294
|
+
required: false;
|
|
295
|
+
default: string;
|
|
296
|
+
};
|
|
297
|
+
headerRightItemSlotNames: {
|
|
298
|
+
type: PropType<string[]>;
|
|
299
|
+
required: false;
|
|
300
|
+
default: () => never[];
|
|
301
|
+
};
|
|
302
|
+
hideThemeItem: {
|
|
303
|
+
type: PropType<boolean>;
|
|
304
|
+
required: false;
|
|
305
|
+
default: boolean;
|
|
306
|
+
};
|
|
307
|
+
footerTitle: {
|
|
308
|
+
type: PropType<string>;
|
|
309
|
+
required: false;
|
|
310
|
+
default: string;
|
|
311
|
+
};
|
|
312
|
+
theme: {
|
|
313
|
+
type: PropType<EProLayoutTheme>;
|
|
314
|
+
required: false;
|
|
315
|
+
default: EProLayoutTheme;
|
|
316
|
+
};
|
|
317
|
+
tabsMode: {
|
|
318
|
+
type: PropType<boolean>;
|
|
319
|
+
required: false;
|
|
320
|
+
default: boolean;
|
|
321
|
+
};
|
|
322
|
+
user: {
|
|
323
|
+
type: PropType<{
|
|
324
|
+
name: string;
|
|
325
|
+
avatar?: string | undefined;
|
|
326
|
+
}>;
|
|
327
|
+
required: false;
|
|
328
|
+
default: undefined;
|
|
329
|
+
};
|
|
330
|
+
}>>, {
|
|
331
|
+
prefixClsName: string;
|
|
332
|
+
props: any;
|
|
333
|
+
menuItems: Ref<IProMenuItem[]>;
|
|
334
|
+
slots: Readonly<{
|
|
335
|
+
[name: string]: Slot | undefined;
|
|
336
|
+
}>;
|
|
337
|
+
currentTheme: Readonly<Ref<EProLayoutTheme>>;
|
|
338
|
+
onToggleCurrentTheme: () => void;
|
|
339
|
+
menuSelectedKeys: Ref<string[]>;
|
|
340
|
+
menuOpenKeys: Ref<string[]>;
|
|
341
|
+
onMenuItemClick: (key: string) => void;
|
|
342
|
+
onSubMenuClick: (key: string, openKeys: string[]) => void;
|
|
343
|
+
activeMenuItem: Ref<IProMenuItem | undefined>;
|
|
344
|
+
breadcrumbItems: Ref<string[]>;
|
|
345
|
+
tabs: Ref<{
|
|
346
|
+
name: string;
|
|
347
|
+
title: string;
|
|
348
|
+
fullPath: string;
|
|
349
|
+
active: boolean;
|
|
350
|
+
}[]>;
|
|
351
|
+
onTabClick: (key: string) => void;
|
|
352
|
+
onTabDelete: (key: string) => void;
|
|
353
|
+
keepAliveKeys: ComputedRef<string[]>;
|
|
354
|
+
siderWidth: number;
|
|
355
|
+
siderCollapsedWidth: number;
|
|
356
|
+
siderWidthPx: string;
|
|
357
|
+
siderCollapsedWidthPx: string;
|
|
358
|
+
siderCollapsed: Ref<boolean>;
|
|
359
|
+
onSiderCollapse: (val: boolean) => void;
|
|
360
|
+
readonly EProLayoutTheme: typeof EProLayoutTheme;
|
|
361
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
362
|
+
menuItems: IProMenuItem[];
|
|
363
|
+
headerTitle: string;
|
|
364
|
+
headerLogo: string;
|
|
365
|
+
headerRightItemSlotNames: string[];
|
|
366
|
+
hideThemeItem: boolean;
|
|
367
|
+
footerTitle: string;
|
|
368
|
+
theme: EProLayoutTheme;
|
|
369
|
+
tabsMode: boolean;
|
|
370
|
+
user: {
|
|
371
|
+
name: string;
|
|
372
|
+
avatar?: string | undefined;
|
|
373
|
+
};
|
|
374
|
+
}, {}, string> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
|
|
375
|
+
install: (app: App) => void;
|
|
376
|
+
};
|
|
377
|
+
export * from './enum';
|
|
378
|
+
export { ProLayout };
|
|
379
|
+
export default ProLayout;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _sfc_main from "./pro-layout.vue.js";
|
|
2
|
+
import "./pro-layout.vue2.js";
|
|
3
|
+
import { Layout, Space, Typography, Tooltip, Button, Dropdown, Avatar } from "@arco-design/web-vue";
|
|
4
|
+
import { ProMenu } from "../pro-menu/index.js";
|
|
5
|
+
import { ProReuseTabs } from "../pro-reuse-tabs/index.js";
|
|
6
|
+
import { ProPageWrapper } from "../pro-page-wrapper/index.js";
|
|
7
|
+
const ProLayout = Object.assign(_sfc_main, {
|
|
8
|
+
install: (app) => {
|
|
9
|
+
app.use(Layout);
|
|
10
|
+
app.use(Space);
|
|
11
|
+
app.use(Typography);
|
|
12
|
+
app.use(Tooltip);
|
|
13
|
+
app.use(Button);
|
|
14
|
+
app.use(Dropdown);
|
|
15
|
+
app.use(Avatar);
|
|
16
|
+
app.use(ProMenu);
|
|
17
|
+
app.use(ProReuseTabs);
|
|
18
|
+
app.use(ProPageWrapper);
|
|
19
|
+
app.component("KbProLayout", _sfc_main);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
ProLayout,
|
|
24
|
+
ProLayout as default
|
|
25
|
+
};
|