@imengyu/vue3-context-menu 1.3.6 → 1.3.7
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/lib/ContextMenu.vue.d.ts +2 -2
- package/lib/ContextMenuDefine.d.ts +8 -2
- package/lib/ContextMenuInstance.d.ts +1 -1
- package/lib/ContextMenuItem.vue.d.ts +20 -29
- package/lib/ContextMenuMutex.d.ts +1 -0
- package/lib/ContextSubMenuWrapper.vue.d.ts +28 -15
- package/lib/vue3-context-menu.es.js +614 -601
- package/lib/vue3-context-menu.es.js.map +1 -1
- package/lib/vue3-context-menu.umd.js +1 -1
- package/lib/vue3-context-menu.umd.js.map +1 -1
- package/package.json +6 -4
package/lib/ContextMenu.vue.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
22
22
|
};
|
|
23
23
|
}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
24
24
|
[key: string]: any;
|
|
25
|
-
}>[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
25
|
+
}>[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "update:show")[], "close" | "update:show", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
26
|
/**
|
|
27
27
|
* Menu options
|
|
28
28
|
*/
|
|
@@ -38,8 +38,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
38
38
|
default: boolean;
|
|
39
39
|
};
|
|
40
40
|
}>> & {
|
|
41
|
-
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
|
42
41
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
42
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
|
43
43
|
}, {
|
|
44
44
|
options: MenuOptions;
|
|
45
45
|
show: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SVGAttributes, VNode } from "vue";
|
|
1
|
+
import type { SVGAttributes, TransitionProps, VNode } from "vue";
|
|
2
2
|
/**
|
|
3
3
|
* Default config
|
|
4
4
|
*/
|
|
@@ -28,6 +28,7 @@ export interface ContextMenuInstance {
|
|
|
28
28
|
isClosed(): boolean;
|
|
29
29
|
}
|
|
30
30
|
export type MenuPopDirection = 'br' | 'b' | 'bl' | 'tr' | 't' | 'tl' | 'l' | 'r';
|
|
31
|
+
export type MenuChildren = MenuItem[];
|
|
31
32
|
export interface MenuOptions {
|
|
32
33
|
/**
|
|
33
34
|
* The items for this menu.
|
|
@@ -140,6 +141,11 @@ export interface MenuOptions {
|
|
|
140
141
|
* Only for css font icon, If you use the svg icon, you do not need to use this.
|
|
141
142
|
*/
|
|
142
143
|
iconFontClass?: string;
|
|
144
|
+
/**
|
|
145
|
+
* The Vue Transition props used when menu show or hide.
|
|
146
|
+
* @default undefined
|
|
147
|
+
*/
|
|
148
|
+
menuTransitionProps?: TransitionProps;
|
|
143
149
|
/**
|
|
144
150
|
* Should a fixed-width icon area be reserved for menu items without icon. (global)
|
|
145
151
|
*
|
|
@@ -360,7 +366,7 @@ export interface MenuItem {
|
|
|
360
366
|
/**
|
|
361
367
|
* Child menu items (Valid in function mode).
|
|
362
368
|
*/
|
|
363
|
-
children?:
|
|
369
|
+
children?: MenuChildren;
|
|
364
370
|
}
|
|
365
371
|
export interface ContextMenuPositionData {
|
|
366
372
|
x: number;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { type PropType, type SVGAttributes } from 'vue';
|
|
2
|
-
import type { GlobalHasSlot, GlobalRenderSlot } from './ContextMenu.vue';
|
|
3
2
|
import type { MenuItem } from './ContextMenuDefine';
|
|
4
|
-
|
|
5
|
-
* Menu Item
|
|
6
|
-
*/
|
|
7
|
-
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
8
4
|
/**
|
|
9
5
|
* Is this menu disabled?
|
|
10
6
|
*/
|
|
@@ -130,31 +126,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
130
126
|
default: undefined;
|
|
131
127
|
};
|
|
132
128
|
}, {
|
|
133
|
-
getItemDataForChildren(): {
|
|
134
|
-
disabled: boolean;
|
|
135
|
-
label: string | Function | Record<string, any>;
|
|
136
|
-
icon: string | Function | Record<string, any>;
|
|
137
|
-
iconFontClass: string;
|
|
138
|
-
showRightArrow: boolean;
|
|
139
|
-
clickClose: boolean;
|
|
140
|
-
clickableWhenHasChildren: boolean;
|
|
141
|
-
shortcut: string;
|
|
142
|
-
theme: string;
|
|
143
|
-
isOpen: import("vue").Ref<boolean>;
|
|
144
|
-
hasChildren: import("vue").Ref<boolean>;
|
|
145
|
-
onClick: (e: MouseEvent | KeyboardEvent) => void;
|
|
146
|
-
onMouseEnter: (e?: MouseEvent) => void;
|
|
147
|
-
closeMenu: (fromItem: MenuItem | undefined) => void;
|
|
148
|
-
};
|
|
149
129
|
showSubMenu: import("vue").Ref<boolean>;
|
|
150
130
|
keyBoardFocusMenu: import("vue").Ref<boolean>;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
onClick: (e: MouseEvent | KeyboardEvent) => void;
|
|
157
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "subMenuOpen" | "subMenuClose")[], "click" | "subMenuOpen" | "subMenuClose", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
131
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
132
|
+
click: (...args: any[]) => void;
|
|
133
|
+
subMenuOpen: (...args: any[]) => void;
|
|
134
|
+
subMenuClose: (...args: any[]) => void;
|
|
135
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
158
136
|
/**
|
|
159
137
|
* Is this menu disabled?
|
|
160
138
|
*/
|
|
@@ -302,5 +280,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
302
280
|
clickHandler: (e: MouseEvent | KeyboardEvent) => void;
|
|
303
281
|
showRightArrow: boolean;
|
|
304
282
|
rawMenuItem: MenuItem;
|
|
305
|
-
}, {}
|
|
283
|
+
}, {}>, {
|
|
284
|
+
default?(_: {}): any;
|
|
285
|
+
icon?(_: {}): any;
|
|
286
|
+
check?(_: {}): any;
|
|
287
|
+
label?(_: {}): any;
|
|
288
|
+
shortcut?(_: {}): any;
|
|
289
|
+
rightArrow?(_: {}): any;
|
|
290
|
+
submenu?(_: {}): any;
|
|
291
|
+
}>;
|
|
306
292
|
export default _default;
|
|
293
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
294
|
+
new (): {
|
|
295
|
+
$slots: S;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContextMenuInstance } from "./ContextMenuDefine";
|
|
2
|
+
export declare function checkOpenedContextMenu(): boolean;
|
|
2
3
|
export declare function addOpenedContextMenu(inst: ContextMenuInstance): void;
|
|
3
4
|
export declare function removeOpenedContextMenu(inst: ContextMenuInstance): void;
|
|
4
5
|
/**
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { type PropType, type VNode } from 'vue';
|
|
2
|
-
import type { MenuOptions } from './ContextMenuDefine';
|
|
3
|
-
export type GlobalHasSlot = (name: string) => boolean;
|
|
4
|
-
export type GlobalRenderSlot = (name: string, params: Record<string, unknown>) => VNode;
|
|
1
|
+
import { type PropType, type VNode, type Ref } from 'vue';
|
|
2
|
+
import type { MenuItem, MenuOptions } from './ContextMenuDefine';
|
|
5
3
|
/**
|
|
6
4
|
* Context menu component
|
|
7
5
|
*/
|
|
8
|
-
|
|
6
|
+
export type GlobalHasSlot = (name: string) => boolean;
|
|
7
|
+
export type GlobalRenderSlot = (name: string, params: Record<string, unknown>) => VNode;
|
|
8
|
+
declare function closeMenu(fromItem?: MenuItem | undefined): void;
|
|
9
|
+
declare function isClosed(): boolean;
|
|
10
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
9
11
|
/**
|
|
10
12
|
* Menu options
|
|
11
13
|
*/
|
|
@@ -17,8 +19,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
17
19
|
* Show menu?
|
|
18
20
|
*/
|
|
19
21
|
show: {
|
|
20
|
-
type:
|
|
21
|
-
default:
|
|
22
|
+
type: PropType<Ref<boolean>>;
|
|
23
|
+
default: null;
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
24
26
|
* Current container, For calculation only
|
|
@@ -34,9 +36,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
34
36
|
type: BooleanConstructor;
|
|
35
37
|
default: boolean;
|
|
36
38
|
};
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
}, {
|
|
40
|
+
closeMenu: typeof closeMenu;
|
|
41
|
+
isClosed: typeof isClosed;
|
|
42
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
+
close: (...args: any[]) => void;
|
|
44
|
+
closeAnimFinished: (...args: any[]) => void;
|
|
45
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
40
46
|
/**
|
|
41
47
|
* Menu options
|
|
42
48
|
*/
|
|
@@ -48,8 +54,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
48
54
|
* Show menu?
|
|
49
55
|
*/
|
|
50
56
|
show: {
|
|
51
|
-
type:
|
|
52
|
-
default:
|
|
57
|
+
type: PropType<Ref<boolean>>;
|
|
58
|
+
default: null;
|
|
53
59
|
};
|
|
54
60
|
/**
|
|
55
61
|
* Current container, For calculation only
|
|
@@ -66,12 +72,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
66
72
|
default: boolean;
|
|
67
73
|
};
|
|
68
74
|
}>> & {
|
|
69
|
-
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
|
70
75
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
76
|
+
onCloseAnimFinished?: ((...args: any[]) => any) | undefined;
|
|
71
77
|
}, {
|
|
72
78
|
options: MenuOptions;
|
|
73
79
|
container: HTMLElement;
|
|
74
|
-
show: boolean
|
|
80
|
+
show: Ref<boolean>;
|
|
75
81
|
isFullScreenContainer: boolean;
|
|
76
|
-
}, {}
|
|
82
|
+
}, {}>, {
|
|
83
|
+
default?(_: {}): any;
|
|
84
|
+
}>;
|
|
77
85
|
export default _default;
|
|
86
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
87
|
+
new (): {
|
|
88
|
+
$slots: S;
|
|
89
|
+
};
|
|
90
|
+
};
|