@imengyu/vue3-context-menu 1.3.2 → 1.3.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/examples/views/BasicUseage.vue +2 -2
- package/lib/ContextMenu.vue.d.ts +5 -5
- package/lib/ContextMenuDefine.d.ts +5 -3
- package/lib/ContextMenuInstance.d.ts +1 -1
- package/lib/ContextMenuItem.vue.d.ts +17 -7
- package/lib/ContextSubMenu.vue.d.ts +3 -3
- package/lib/ContextSubMenuWrapper.vue.d.ts +5 -5
- package/lib/MenuBar.vue.d.ts +3921 -0
- package/lib/MenuBarIconMenu.vue.d.ts +2 -0
- package/lib/vue3-context-menu.common.js +49 -41
- package/lib/vue3-context-menu.common.js.map +1 -1
- package/lib/vue3-context-menu.umd.js +49 -41
- package/lib/vue3-context-menu.umd.js.map +1 -1
- package/lib/vue3-context-menu.umd.min.js +1 -1
- package/lib/vue3-context-menu.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/ContextMenu.vue +2 -2
- package/src/ContextMenuDefine.ts +4 -2
- package/src/ContextMenuInstance.ts +2 -2
- package/src/ContextMenuItem.vue +8 -3
- package/src/ContextSubMenu.vue +2 -1
- package/src/ContextSubMenuWrapper.vue +4 -4
- package/src/MenuBar.vue +1 -1
package/lib/ContextMenu.vue.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { PropType, VNode } from 'vue';
|
|
2
2
|
import { MenuOptions } from './ContextMenuDefine';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type GlobalHasSlot = (name: string) => boolean;
|
|
4
|
+
export type GlobalRenderSlot = (name: string, params: Record<string, unknown>) => VNode;
|
|
5
|
+
/**
|
|
6
|
+
* Context menu component
|
|
7
|
+
*/
|
|
5
8
|
declare const _default: import("vue").DefineComponent<{
|
|
6
9
|
/**
|
|
7
10
|
* Menu options
|
|
@@ -41,7 +44,4 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
44
|
options: MenuOptions;
|
|
42
45
|
show: boolean;
|
|
43
46
|
}>;
|
|
44
|
-
/**
|
|
45
|
-
* Context menu component
|
|
46
|
-
*/
|
|
47
47
|
export default _default;
|
|
@@ -19,10 +19,11 @@ export declare const MenuConstOptions: {
|
|
|
19
19
|
export interface ContextMenuInstance {
|
|
20
20
|
/**
|
|
21
21
|
* Close this menu.
|
|
22
|
+
* @param fromItem The last clicked menu item, will pass to `MenuOptions.onClose` callback, if user does not click any item, can be `undefined`.
|
|
22
23
|
*/
|
|
23
|
-
closeMenu(): void;
|
|
24
|
+
closeMenu(fromItem?: MenuItem | undefined): void;
|
|
24
25
|
}
|
|
25
|
-
export
|
|
26
|
+
export type MenuPopDirection = 'br' | 'b' | 'bl' | 'tr' | 't' | 'tl' | 'l' | 'r';
|
|
26
27
|
export interface MenuOptions {
|
|
27
28
|
/**
|
|
28
29
|
* The items for this menu.
|
|
@@ -191,8 +192,9 @@ export interface MenuOptions {
|
|
|
191
192
|
getContainer?: HTMLElement | (() => HTMLElement);
|
|
192
193
|
/**
|
|
193
194
|
* This event emit when this menu is closing. (Usually used in function mode)
|
|
195
|
+
* @param lastClickItem The last clicked menu item, if user does not click any item, it is `undefined`. This param only valid in function mode.
|
|
194
196
|
*/
|
|
195
|
-
onClose?: (() => void) | undefined;
|
|
197
|
+
onClose?: ((lastClickItem: MenuItem | undefined) => void) | undefined;
|
|
196
198
|
/**
|
|
197
199
|
* Event for MenuBar component
|
|
198
200
|
*/
|
|
@@ -14,7 +14,7 @@ declare const _default: {
|
|
|
14
14
|
* @param customSlots You can provide some custom slots to customize the rendering style of the menu. These slots are the same as the slots of component ContextMenu.
|
|
15
15
|
* @returns Menu instance
|
|
16
16
|
*/
|
|
17
|
-
showContextMenu(options: MenuOptions, customSlots?: Record<string, Slot>
|
|
17
|
+
showContextMenu(options: MenuOptions, customSlots?: Record<string, Slot>): ContextMenuInstance;
|
|
18
18
|
closeContextMenu: typeof closeContextMenu;
|
|
19
19
|
transformMenuPosition: typeof transformMenuPosition;
|
|
20
20
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { PropType, SVGAttributes } from 'vue';
|
|
2
2
|
import { GlobalHasSlot, GlobalRenderSlot } from './ContextMenu.vue';
|
|
3
|
+
import { MenuItem } from './ContextMenuDefine';
|
|
4
|
+
/**
|
|
5
|
+
* Menu Item
|
|
6
|
+
*/
|
|
3
7
|
declare const _default: import("vue").DefineComponent<{
|
|
4
8
|
/**
|
|
5
9
|
* Is this menu disabled?
|
|
@@ -121,6 +125,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
121
125
|
type: BooleanConstructor;
|
|
122
126
|
default: boolean;
|
|
123
127
|
};
|
|
128
|
+
rawMenuItem: {
|
|
129
|
+
type: PropType<MenuItem>;
|
|
130
|
+
default: undefined;
|
|
131
|
+
};
|
|
124
132
|
}, {
|
|
125
133
|
getItemDataForChildren(): {
|
|
126
134
|
disabled: boolean;
|
|
@@ -135,8 +143,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
135
143
|
isOpen: import("vue").Ref<boolean>;
|
|
136
144
|
hasChildren: import("vue").Ref<boolean>;
|
|
137
145
|
onClick: (e: MouseEvent | KeyboardEvent) => void;
|
|
138
|
-
onMouseEnter: (e?: MouseEvent
|
|
139
|
-
closeMenu: () => void;
|
|
146
|
+
onMouseEnter: (e?: MouseEvent) => void;
|
|
147
|
+
closeMenu: (fromItem: MenuItem | undefined) => void;
|
|
140
148
|
};
|
|
141
149
|
showSubMenu: import("vue").Ref<boolean>;
|
|
142
150
|
keyBoardFocusMenu: import("vue").Ref<boolean>;
|
|
@@ -144,7 +152,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
144
152
|
globalHasSlot: GlobalHasSlot;
|
|
145
153
|
globalRenderSlot: GlobalRenderSlot;
|
|
146
154
|
globalIconFontClass: string;
|
|
147
|
-
onMouseEnter: (e?: MouseEvent
|
|
155
|
+
onMouseEnter: (e?: MouseEvent) => void;
|
|
148
156
|
onClick: (e: MouseEvent | KeyboardEvent) => void;
|
|
149
157
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "subMenuOpen" | "subMenuClose")[], "click" | "subMenuOpen" | "subMenuClose", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
150
158
|
/**
|
|
@@ -267,6 +275,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
267
275
|
type: BooleanConstructor;
|
|
268
276
|
default: boolean;
|
|
269
277
|
};
|
|
278
|
+
rawMenuItem: {
|
|
279
|
+
type: PropType<MenuItem>;
|
|
280
|
+
default: undefined;
|
|
281
|
+
};
|
|
270
282
|
}>> & {
|
|
271
283
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
272
284
|
onSubMenuClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -286,11 +298,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
286
298
|
clickableWhenHasChildren: boolean;
|
|
287
299
|
clickClose: boolean;
|
|
288
300
|
customClass: string;
|
|
301
|
+
hasChildren: boolean;
|
|
289
302
|
clickHandler: (e: MouseEvent | KeyboardEvent) => void;
|
|
290
303
|
showRightArrow: boolean;
|
|
291
|
-
|
|
304
|
+
rawMenuItem: MenuItem;
|
|
292
305
|
}>;
|
|
293
|
-
/**
|
|
294
|
-
* Menu Item
|
|
295
|
-
*/
|
|
296
306
|
export default _default;
|
|
@@ -50,6 +50,9 @@ export interface SubMenuParentContext {
|
|
|
50
50
|
getParentContext: () => SubMenuParentContext | null;
|
|
51
51
|
getElement: () => HTMLElement | null;
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Submenu container
|
|
55
|
+
*/
|
|
53
56
|
declare const _default: import("vue").DefineComponent<{
|
|
54
57
|
/**
|
|
55
58
|
* Items from options
|
|
@@ -160,7 +163,4 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
160
163
|
items: MenuItem[];
|
|
161
164
|
adjustPosition: boolean;
|
|
162
165
|
}>;
|
|
163
|
-
/**
|
|
164
|
-
* Submenu container
|
|
165
|
-
*/
|
|
166
166
|
export default _default;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { PropType, VNode } from 'vue';
|
|
2
2
|
import { MenuOptions } from './ContextMenuDefine';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type GlobalHasSlot = (name: string) => boolean;
|
|
4
|
+
export type GlobalRenderSlot = (name: string, params: Record<string, unknown>) => VNode;
|
|
5
|
+
/**
|
|
6
|
+
* Context menu component
|
|
7
|
+
*/
|
|
5
8
|
declare const _default: import("vue").DefineComponent<{
|
|
6
9
|
/**
|
|
7
10
|
* Menu options
|
|
@@ -71,7 +74,4 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
71
74
|
show: boolean;
|
|
72
75
|
isFullScreenContainer: boolean;
|
|
73
76
|
}>;
|
|
74
|
-
/**
|
|
75
|
-
* Context menu component
|
|
76
|
-
*/
|
|
77
77
|
export default _default;
|