@vtj/ui 0.5.2 → 0.6.0
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/cdn/index.js +1 -1
- package/cdn/style.css +1 -1
- package/lib/index.js +2739 -246
- package/lib/style.css +1 -1
- package/package.json +11 -11
- package/types/components/action/Action.d.ts +363 -0
- package/types/components/action/Trigger.d.ts +187 -0
- package/types/components/action/hooks.d.ts +43 -0
- package/types/components/action/index.d.ts +3 -0
- package/types/components/action/types.d.ts +151 -0
- package/types/components/action-bar/ActionBar.d.ts +684 -0
- package/types/components/action-bar/index.d.ts +3 -0
- package/types/components/action-bar/types.d.ts +124 -0
- package/types/components/container/Container.d.ts +147 -0
- package/types/components/container/index.d.ts +3 -0
- package/types/components/container/types.d.ts +120 -0
- package/types/components/dialog/Dialog.d.ts +334 -0
- package/types/components/dialog/create.d.ts +11 -0
- package/types/components/dialog/hooks.d.ts +58 -0
- package/types/components/dialog/index.d.ts +4 -0
- package/types/components/dialog/types.d.ts +124 -0
- package/types/components/header/Header.d.ts +61 -0
- package/types/components/header/index.d.ts +3 -0
- package/types/components/header/types.d.ts +29 -0
- package/types/components/icon/Icon.d.ts +1 -1
- package/types/components/index.d.ts +7 -0
- package/types/components/mask/Mask.d.ts +469 -0
- package/types/components/mask/components/Avatar.d.ts +21 -0
- package/types/components/mask/components/Brand.d.ts +47 -0
- package/types/components/mask/components/Content.d.ts +33 -0
- package/types/components/mask/components/Menu.d.ts +65 -0
- package/types/components/mask/components/Sidebar.d.ts +22 -0
- package/types/components/mask/components/SwitchBar.d.ts +39 -0
- package/types/components/mask/components/Tabs.d.ts +62 -0
- package/types/components/mask/components/ThemeSwitch.d.ts +3 -0
- package/types/components/mask/components/Toolbar.d.ts +50 -0
- package/types/components/mask/defineTab.d.ts +6 -0
- package/types/components/mask/hooks/index.d.ts +5 -0
- package/types/components/mask/hooks/useContent.d.ts +20 -0
- package/types/components/mask/hooks/useHome.d.ts +3 -0
- package/types/components/mask/hooks/useMenus.d.ts +28 -0
- package/types/components/mask/hooks/useSidebar.d.ts +7 -0
- package/types/components/mask/hooks/useTabs.d.ts +22 -0
- package/types/components/mask/index.d.ts +4 -0
- package/types/components/mask/types.d.ts +112 -0
- package/types/components/menu/Menu.d.ts +9 -75
- package/types/components/menu/MenuItem.d.ts +17 -2
- package/types/components/menu/types.d.ts +16 -5
- package/types/components/panel/Panel.d.ts +401 -0
- package/types/components/panel/index.d.ts +3 -0
- package/types/components/panel/types.d.ts +223 -0
- package/types/components/shared.d.ts +12 -0
- package/types/components/startup/Startup.d.ts +10 -0
- package/types/constants.d.ts +0 -3
- package/types/directives/index.d.ts +2 -0
- package/types/directives/vDraggable.d.ts +45 -0
- package/types/directives/vResizable.d.ts +37 -0
- package/types/hooks/index.d.ts +1 -2
- package/types/hooks/useDisabled.d.ts +3 -0
- package/types/hooks/useIcon.d.ts +3 -3
- package/types/index.d.ts +3 -0
- package/types/utils/index.d.ts +0 -2
- package/types/utils/install.d.ts +3 -8
- package/types/utils/util.d.ts +0 -3
- package/types/version.d.ts +1 -0
- package/types/hooks/useDraggable.d.ts +0 -13
- package/types/hooks/useResizable.d.ts +0 -25
- package/types/utils/emits.d.ts +0 -6
- package/types/utils/make-install.d.ts +0 -4
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DefineComponent, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
|
|
2
|
+
export interface Props {
|
|
3
|
+
collasped?: boolean;
|
|
4
|
+
favorite?: boolean;
|
|
5
|
+
keyword?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: DefineComponent<{
|
|
8
|
+
collasped: {
|
|
9
|
+
type: PropType<boolean>;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
favorite: {
|
|
13
|
+
type: PropType<boolean>;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
keyword: {
|
|
17
|
+
type: PropType<string>;
|
|
18
|
+
};
|
|
19
|
+
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("update:collasped" | "update:keyword" | "update:favorite")[], "update:collasped" | "update:keyword" | "update:favorite", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
20
|
+
collasped: {
|
|
21
|
+
type: PropType<boolean>;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
favorite: {
|
|
25
|
+
type: PropType<boolean>;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
keyword: {
|
|
29
|
+
type: PropType<string>;
|
|
30
|
+
};
|
|
31
|
+
}>> & {
|
|
32
|
+
"onUpdate:collasped"?: ((...args: any[]) => any) | undefined;
|
|
33
|
+
"onUpdate:keyword"?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
"onUpdate:favorite"?: ((...args: any[]) => any) | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
collasped: boolean;
|
|
37
|
+
favorite: boolean;
|
|
38
|
+
}, {}>;
|
|
39
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { DefineComponent, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
|
|
2
|
+
import { MenuDataItem } from '../../';
|
|
3
|
+
import { MaskTab } from '../types';
|
|
4
|
+
export interface Props {
|
|
5
|
+
tabs: MaskTab[];
|
|
6
|
+
home: MaskTab;
|
|
7
|
+
isActiveTab?: (tab: MaskTab) => boolean;
|
|
8
|
+
value?: string | number;
|
|
9
|
+
favorites: MenuDataItem[];
|
|
10
|
+
}
|
|
11
|
+
declare const _default: DefineComponent<{
|
|
12
|
+
tabs: {
|
|
13
|
+
type: PropType<MaskTab[]>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
home: {
|
|
17
|
+
type: PropType<MaskTab>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
isActiveTab: {
|
|
21
|
+
type: PropType<(tab: MaskTab) => boolean>;
|
|
22
|
+
};
|
|
23
|
+
value: {
|
|
24
|
+
type: PropType<string | number>;
|
|
25
|
+
};
|
|
26
|
+
favorites: {
|
|
27
|
+
type: PropType<MenuDataItem[]>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
31
|
+
click: (tab: MaskTab) => void;
|
|
32
|
+
remove: (tab: MaskTab) => void;
|
|
33
|
+
refresh: (tab: MaskTab) => void;
|
|
34
|
+
toggleFavorite: (item: MenuDataItem) => void;
|
|
35
|
+
dialog: (tab: MaskTab) => void;
|
|
36
|
+
}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
37
|
+
tabs: {
|
|
38
|
+
type: PropType<MaskTab[]>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
home: {
|
|
42
|
+
type: PropType<MaskTab>;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
isActiveTab: {
|
|
46
|
+
type: PropType<(tab: MaskTab) => boolean>;
|
|
47
|
+
};
|
|
48
|
+
value: {
|
|
49
|
+
type: PropType<string | number>;
|
|
50
|
+
};
|
|
51
|
+
favorites: {
|
|
52
|
+
type: PropType<MenuDataItem[]>;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
}>> & {
|
|
56
|
+
onClick?: ((tab: MaskTab) => any) | undefined;
|
|
57
|
+
onDialog?: ((tab: MaskTab) => any) | undefined;
|
|
58
|
+
onRemove?: ((tab: MaskTab) => any) | undefined;
|
|
59
|
+
onRefresh?: ((tab: MaskTab) => any) | undefined;
|
|
60
|
+
onToggleFavorite?: ((item: MenuDataItem) => any) | undefined;
|
|
61
|
+
}, {}, {}>;
|
|
62
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
|
|
2
|
+
declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{}>>, {}, {}>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DefineComponent, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
|
|
2
|
+
import { ActionBarItems } from '../../';
|
|
3
|
+
import { MaskTab } from '../types';
|
|
4
|
+
export interface Props {
|
|
5
|
+
tabs: MaskTab[];
|
|
6
|
+
actions?: ActionBarItems;
|
|
7
|
+
theme?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: __VLS_WithTemplateSlots<DefineComponent<{
|
|
10
|
+
actions: {
|
|
11
|
+
type: PropType<ActionBarItems>;
|
|
12
|
+
};
|
|
13
|
+
tabs: {
|
|
14
|
+
type: PropType<MaskTab[]>;
|
|
15
|
+
required: true;
|
|
16
|
+
default: () => never[];
|
|
17
|
+
};
|
|
18
|
+
theme: {
|
|
19
|
+
type: PropType<boolean>;
|
|
20
|
+
};
|
|
21
|
+
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("actionClick" | "actionCommand" | "closeOtherTabs" | "closeAllTabs" | "closeTab" | "clickTab")[], "actionClick" | "actionCommand" | "closeOtherTabs" | "closeAllTabs" | "closeTab" | "clickTab", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
22
|
+
actions: {
|
|
23
|
+
type: PropType<ActionBarItems>;
|
|
24
|
+
};
|
|
25
|
+
tabs: {
|
|
26
|
+
type: PropType<MaskTab[]>;
|
|
27
|
+
required: true;
|
|
28
|
+
default: () => never[];
|
|
29
|
+
};
|
|
30
|
+
theme: {
|
|
31
|
+
type: PropType<boolean>;
|
|
32
|
+
};
|
|
33
|
+
}>> & {
|
|
34
|
+
onActionClick?: ((...args: any[]) => any) | undefined;
|
|
35
|
+
onActionCommand?: ((...args: any[]) => any) | undefined;
|
|
36
|
+
onCloseOtherTabs?: ((...args: any[]) => any) | undefined;
|
|
37
|
+
onCloseAllTabs?: ((...args: any[]) => any) | undefined;
|
|
38
|
+
onCloseTab?: ((...args: any[]) => any) | undefined;
|
|
39
|
+
onClickTab?: ((...args: any[]) => any) | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
tabs: MaskTab[];
|
|
42
|
+
}, {}>, {
|
|
43
|
+
default?(_: {}): any;
|
|
44
|
+
}>;
|
|
45
|
+
export default _default;
|
|
46
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
47
|
+
new (): {
|
|
48
|
+
$slots: S;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { VNode, RendererNode, RendererElement, Ref } from 'vue';
|
|
2
|
+
import { RouteLocationNormalizedLoaded } from 'vue-router';
|
|
3
|
+
import { MaskTab } from '../types';
|
|
4
|
+
import { useTabs } from './useTabs';
|
|
5
|
+
export type UseContentOptions = ReturnType<typeof useTabs>;
|
|
6
|
+
export declare function useContent(options: Partial<UseContentOptions>): {
|
|
7
|
+
createView: (module: any, route: RouteLocationNormalizedLoaded) => any;
|
|
8
|
+
openDialog: (tab: MaskTab) => Promise<{
|
|
9
|
+
vnode: VNode<RendererNode, RendererElement, {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}>;
|
|
12
|
+
destroy: () => void;
|
|
13
|
+
}>;
|
|
14
|
+
refresh: (tab: MaskTab) => Promise<void>;
|
|
15
|
+
exclude: Ref<string[]>;
|
|
16
|
+
cleanCache: (tabs: MaskTab[]) => Promise<void>;
|
|
17
|
+
hasDialog: (url: string) => boolean;
|
|
18
|
+
closeDialog: (tab: MaskTab) => void;
|
|
19
|
+
closeDialogs: (tabs?: MaskTab[]) => void;
|
|
20
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EpPropMergeType } from 'element-plus/es/utils';
|
|
2
|
+
import { ShallowRef, ComputedRef, Ref, DefineComponent } from 'vue';
|
|
3
|
+
import { MaskProps, MaskEmitsFn } from '../types';
|
|
4
|
+
import { MenuDataItem } from '../../';
|
|
5
|
+
export declare function useMenus(props: MaskProps, emit: MaskEmitsFn): {
|
|
6
|
+
menus: ShallowRef<MenuDataItem[]>;
|
|
7
|
+
favorites: ShallowRef<MenuDataItem[]>;
|
|
8
|
+
flatMenus: ComputedRef<MenuDataItem[]>;
|
|
9
|
+
active: Ref<{
|
|
10
|
+
id: string | number;
|
|
11
|
+
title?: string | undefined;
|
|
12
|
+
icon?: string | Record<string, any> | DefineComponent<any, any, any, any> | undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
hidden?: boolean | undefined;
|
|
15
|
+
children?: any[] | undefined;
|
|
16
|
+
type?: "route" | "dialog" | "window" | undefined;
|
|
17
|
+
url?: string | undefined;
|
|
18
|
+
badge?: string | number | {
|
|
19
|
+
readonly value?: EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown> | undefined;
|
|
20
|
+
readonly max?: number | undefined;
|
|
21
|
+
readonly isDot?: boolean | undefined;
|
|
22
|
+
readonly hidden?: boolean | undefined;
|
|
23
|
+
readonly type?: EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown> | undefined;
|
|
24
|
+
} | undefined;
|
|
25
|
+
} | null>;
|
|
26
|
+
select: (id: string | number | MenuDataItem) => void;
|
|
27
|
+
toggleFavorite: (item: MenuDataItem) => void;
|
|
28
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { MaskProps, MaskEmitsFn, MaskTab } from '../types';
|
|
3
|
+
import { MenuDataItem } from '../../';
|
|
4
|
+
export declare function useTabs(props: MaskProps, emit: MaskEmitsFn, menus: ComputedRef<MenuDataItem[]>, active: Ref<MenuDataItem | null>, home: ComputedRef<MaskTab>): {
|
|
5
|
+
tabRef: Ref<any>;
|
|
6
|
+
tabs: Ref<MaskTab[]>;
|
|
7
|
+
showTabs: ComputedRef<MaskTab[]>;
|
|
8
|
+
currentTab: ComputedRef<MaskTab | undefined>;
|
|
9
|
+
changeTab: (tab: MaskTab) => void;
|
|
10
|
+
removeTab: (tab: MaskTab) => Promise<MaskTab | undefined>;
|
|
11
|
+
updateTab: (tab: MaskTab) => void;
|
|
12
|
+
addTab: (tab: MaskTab) => void;
|
|
13
|
+
home: ComputedRef<MaskTab>;
|
|
14
|
+
tabValue: Ref<string>;
|
|
15
|
+
isCurrentTab: (tab: MaskTab) => boolean;
|
|
16
|
+
activeHome: () => void;
|
|
17
|
+
activeTab: (tab: MaskTab) => void;
|
|
18
|
+
dropdownTabs: ComputedRef<MaskTab[]>;
|
|
19
|
+
removeAllTabs: () => Promise<MaskTab[] | undefined>;
|
|
20
|
+
removeOtherTabs: () => Promise<MaskTab[] | undefined>;
|
|
21
|
+
moveToShow: (tab: MaskTab) => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { PropType, InjectionKey, DefineComponent } from 'vue';
|
|
2
|
+
import { MenuDataItem, ActionBarItems, ActionProps, ActionMenuItem, ComponentPropsType, DialogProps } from '../';
|
|
3
|
+
import { Emits } from '../shared';
|
|
4
|
+
import type Mask from "./Mask";
|
|
5
|
+
export declare const TAB_ITEM_WIDTH = 140;
|
|
6
|
+
export declare const maskProps: {
|
|
7
|
+
/**
|
|
8
|
+
* 系统logo
|
|
9
|
+
*/
|
|
10
|
+
logo: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* 系统标题
|
|
16
|
+
*/
|
|
17
|
+
title: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* 菜单项数据
|
|
23
|
+
*/
|
|
24
|
+
menus: {
|
|
25
|
+
type: PropType<MenuDataItem[] | (() => Promise<MenuDataItem[]> | MenuDataItem[])>;
|
|
26
|
+
default(): never[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 收藏菜单项
|
|
30
|
+
*/
|
|
31
|
+
favorites: {
|
|
32
|
+
type: PropType<MenuDataItem[] | (() => Promise<MenuDataItem[]> | MenuDataItem[])>;
|
|
33
|
+
default(): never[];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* 菜单项数据适配函数,用作转换菜单项数据
|
|
37
|
+
*/
|
|
38
|
+
menuAdapter: {
|
|
39
|
+
type: PropType<(menu: MenuDataItem) => MenuDataItem>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* 主页Tab配置
|
|
43
|
+
*/
|
|
44
|
+
home: {
|
|
45
|
+
type: PropType<string | MaskTab>;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* 最大tabs数量
|
|
50
|
+
*/
|
|
51
|
+
tabs: {
|
|
52
|
+
type: NumberConstructor;
|
|
53
|
+
default: number;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* 右上角工具条配置
|
|
57
|
+
*/
|
|
58
|
+
actions: {
|
|
59
|
+
type: PropType<ActionBarItems>;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* 用户头像图片url
|
|
63
|
+
*/
|
|
64
|
+
avatar: {
|
|
65
|
+
type: StringConstructor;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* 开启主题切换
|
|
69
|
+
*/
|
|
70
|
+
theme: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* 禁用框架容器
|
|
75
|
+
*/
|
|
76
|
+
disabled: {
|
|
77
|
+
type: BooleanConstructor;
|
|
78
|
+
};
|
|
79
|
+
addFavorite: {
|
|
80
|
+
type: PropType<(menu: MenuDataItem) => void>;
|
|
81
|
+
};
|
|
82
|
+
removeFavorite: {
|
|
83
|
+
type: PropType<(menu: MenuDataItem) => void>;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export type MaskProps = ComponentPropsType<typeof maskProps>;
|
|
87
|
+
export type MaskInstance = InstanceType<typeof Mask>;
|
|
88
|
+
export type MaskEmits = {
|
|
89
|
+
select: [menu: MenuDataItem];
|
|
90
|
+
actionClick: [action: ActionProps];
|
|
91
|
+
actionCommand: [action: ActionProps, item: ActionMenuItem];
|
|
92
|
+
};
|
|
93
|
+
export type MaskEmitsFn = Emits<MaskEmits>;
|
|
94
|
+
export type MaskSlots = {
|
|
95
|
+
default(): any;
|
|
96
|
+
user(): any;
|
|
97
|
+
};
|
|
98
|
+
export interface MaskTab {
|
|
99
|
+
id: string;
|
|
100
|
+
name: string;
|
|
101
|
+
url: string;
|
|
102
|
+
title?: string;
|
|
103
|
+
icon?: string | Record<string, any> | DefineComponent<any, any, any, any>;
|
|
104
|
+
closable?: boolean;
|
|
105
|
+
dialog?: DialogProps & {
|
|
106
|
+
[index: string]: any;
|
|
107
|
+
};
|
|
108
|
+
menu?: MenuDataItem;
|
|
109
|
+
}
|
|
110
|
+
export type TabCreator = () => Promise<Partial<MaskTab>> | Partial<MaskTab>;
|
|
111
|
+
export declare const TAB_CREATORS_KEY: InjectionKey<Record<string, TabCreator>>;
|
|
112
|
+
export declare const MASK_KEY: unique symbol;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SubMenuProps } from 'element-plus';
|
|
2
2
|
import { DefineComponent, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
|
|
3
3
|
import { MenuDataItem } from './types';
|
|
4
4
|
declare const _default: DefineComponent<{
|
|
@@ -6,44 +6,11 @@ declare const _default: DefineComponent<{
|
|
|
6
6
|
type: PropType<MenuDataItem[]>;
|
|
7
7
|
default: () => never[];
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
type: PropType<
|
|
9
|
+
subMenu: {
|
|
10
|
+
type: PropType<Partial<SubMenuProps>>;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
type: PropType<
|
|
14
|
-
};
|
|
15
|
-
defaultOpeneds: {
|
|
16
|
-
type: PropType<string[]>;
|
|
17
|
-
};
|
|
18
|
-
uniqueOpened: {
|
|
19
|
-
type: PropType<boolean>;
|
|
20
|
-
};
|
|
21
|
-
router: {
|
|
22
|
-
type: PropType<boolean>;
|
|
23
|
-
};
|
|
24
|
-
menuTrigger: {
|
|
25
|
-
type: PropType<EpPropMergeType<StringConstructor, "hover" | "click", unknown>>;
|
|
26
|
-
};
|
|
27
|
-
collapse: {
|
|
28
|
-
type: PropType<boolean>;
|
|
29
|
-
};
|
|
30
|
-
backgroundColor: {
|
|
31
|
-
type: PropType<string>;
|
|
32
|
-
};
|
|
33
|
-
textColor: {
|
|
34
|
-
type: PropType<string>;
|
|
35
|
-
};
|
|
36
|
-
activeTextColor: {
|
|
37
|
-
type: PropType<string>;
|
|
38
|
-
};
|
|
39
|
-
collapseTransition: {
|
|
40
|
-
type: PropType<EpPropMergeType<BooleanConstructor, unknown, unknown>>;
|
|
41
|
-
};
|
|
42
|
-
ellipsis: {
|
|
43
|
-
type: PropType<EpPropMergeType<BooleanConstructor, unknown, unknown>>;
|
|
44
|
-
};
|
|
45
|
-
popperEffect: {
|
|
46
|
-
type: PropType<EpPropMergeType<StringConstructor, "light" | "dark", unknown>>;
|
|
12
|
+
defaultIcon: {
|
|
13
|
+
type: PropType<DefineComponent<any, any, any, any>>;
|
|
47
14
|
};
|
|
48
15
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
49
16
|
select: (item: MenuDataItem) => void;
|
|
@@ -52,44 +19,11 @@ declare const _default: DefineComponent<{
|
|
|
52
19
|
type: PropType<MenuDataItem[]>;
|
|
53
20
|
default: () => never[];
|
|
54
21
|
};
|
|
55
|
-
|
|
56
|
-
type: PropType<
|
|
57
|
-
};
|
|
58
|
-
defaultActive: {
|
|
59
|
-
type: PropType<string>;
|
|
60
|
-
};
|
|
61
|
-
defaultOpeneds: {
|
|
62
|
-
type: PropType<string[]>;
|
|
63
|
-
};
|
|
64
|
-
uniqueOpened: {
|
|
65
|
-
type: PropType<boolean>;
|
|
66
|
-
};
|
|
67
|
-
router: {
|
|
68
|
-
type: PropType<boolean>;
|
|
69
|
-
};
|
|
70
|
-
menuTrigger: {
|
|
71
|
-
type: PropType<EpPropMergeType<StringConstructor, "hover" | "click", unknown>>;
|
|
72
|
-
};
|
|
73
|
-
collapse: {
|
|
74
|
-
type: PropType<boolean>;
|
|
75
|
-
};
|
|
76
|
-
backgroundColor: {
|
|
77
|
-
type: PropType<string>;
|
|
78
|
-
};
|
|
79
|
-
textColor: {
|
|
80
|
-
type: PropType<string>;
|
|
81
|
-
};
|
|
82
|
-
activeTextColor: {
|
|
83
|
-
type: PropType<string>;
|
|
84
|
-
};
|
|
85
|
-
collapseTransition: {
|
|
86
|
-
type: PropType<EpPropMergeType<BooleanConstructor, unknown, unknown>>;
|
|
87
|
-
};
|
|
88
|
-
ellipsis: {
|
|
89
|
-
type: PropType<EpPropMergeType<BooleanConstructor, unknown, unknown>>;
|
|
22
|
+
subMenu: {
|
|
23
|
+
type: PropType<Partial<SubMenuProps>>;
|
|
90
24
|
};
|
|
91
|
-
|
|
92
|
-
type: PropType<
|
|
25
|
+
defaultIcon: {
|
|
26
|
+
type: PropType<DefineComponent<any, any, any, any>>;
|
|
93
27
|
};
|
|
94
28
|
}>> & {
|
|
95
29
|
onSelect?: ((item: MenuDataItem) => any) | undefined;
|
|
@@ -1,17 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MenuDataItem } from './types';
|
|
1
|
+
import { SubMenuProps } from 'element-plus';
|
|
2
|
+
import { MenuDataItem, SubMenuProps } from './types';
|
|
3
|
+
import { PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, DefineComponent } from 'vue';
|
|
3
4
|
export interface Props {
|
|
4
5
|
item: MenuDataItem;
|
|
6
|
+
subMenu?: SubMenuProps;
|
|
7
|
+
defaultIcon?: DefineComponent<any, any, any, any>;
|
|
5
8
|
}
|
|
6
9
|
declare const _default: DefineComponent<{
|
|
7
10
|
item: {
|
|
8
11
|
type: PropType<MenuDataItem>;
|
|
9
12
|
required: true;
|
|
10
13
|
};
|
|
14
|
+
subMenu: {
|
|
15
|
+
type: PropType<Partial<SubMenuProps>>;
|
|
16
|
+
};
|
|
17
|
+
defaultIcon: {
|
|
18
|
+
type: PropType<DefineComponent<any, any, any, any>>;
|
|
19
|
+
};
|
|
11
20
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
12
21
|
item: {
|
|
13
22
|
type: PropType<MenuDataItem>;
|
|
14
23
|
required: true;
|
|
15
24
|
};
|
|
25
|
+
subMenu: {
|
|
26
|
+
type: PropType<Partial<SubMenuProps>>;
|
|
27
|
+
};
|
|
28
|
+
defaultIcon: {
|
|
29
|
+
type: PropType<DefineComponent<any, any, any, any>>;
|
|
30
|
+
};
|
|
16
31
|
}>>, {}, {}>;
|
|
17
32
|
export default _default;
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SubMenuProps as ElSubMenuProps, BadgeProps } from 'element-plus';
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
2
3
|
export interface MenuDataItem {
|
|
3
|
-
id: string;
|
|
4
|
-
title
|
|
5
|
-
icon?: string
|
|
4
|
+
id: string | number;
|
|
5
|
+
title?: string;
|
|
6
|
+
icon?: string | Record<string, any> | DefineComponent<any, any, any, any>;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
hidden?: boolean;
|
|
8
9
|
children?: MenuDataItem[];
|
|
10
|
+
type?: 'route' | 'dialog' | 'window';
|
|
11
|
+
url?: string;
|
|
12
|
+
badge?: MenuBadge;
|
|
9
13
|
}
|
|
10
|
-
export
|
|
14
|
+
export type SubMenuProps = Partial<ElSubMenuProps>;
|
|
15
|
+
export type MenuBadge = number | string | Partial<BadgeProps>;
|
|
16
|
+
export interface MenuProps {
|
|
11
17
|
data?: MenuDataItem[];
|
|
18
|
+
subMenu?: SubMenuProps;
|
|
19
|
+
defaultIcon?: DefineComponent<any, any, any, any>;
|
|
12
20
|
}
|
|
21
|
+
export type MenuEmits = {
|
|
22
|
+
select: [item: MenuDataItem];
|
|
23
|
+
};
|