@imengyu/vue3-context-menu 1.4.2 → 1.4.4

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/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export * from './lib';
9
9
 
10
10
  declare module 'vue3-context-menu' {
11
11
  }
12
- declare module '@vue/runtime-core' {
12
+ declare module 'vue' {
13
13
  export interface ComponentCustomProperties {
14
14
  /**
15
15
  * Show a ContextMenu .
@@ -1,4 +1,4 @@
1
- import type { SVGAttributes, TransitionProps, VNode } from "vue";
1
+ import type { ComputedRef, SVGAttributes, TransitionProps, VNode } from "vue";
2
2
  /**
3
3
  * Default config
4
4
  */
@@ -410,23 +410,23 @@ export interface MenuItem {
410
410
  /**
411
411
  * Disable menu item?
412
412
  */
413
- disabled?: boolean;
413
+ disabled?: boolean | ComputedRef<boolean>;
414
414
  /**
415
415
  * Hide menu item?
416
416
  */
417
- hidden?: boolean;
417
+ hidden?: boolean | ComputedRef<boolean>;
418
418
  /**
419
419
  * Is this menu item checked?
420
420
  *
421
421
  * The check mark are displayed on the left side of the icon, so it is not recommended to display the icon at the same time.
422
422
  */
423
- checked?: boolean;
423
+ checked?: boolean | ComputedRef<boolean>;
424
424
  /**
425
425
  * Shortcut key text display on the right.
426
426
  *
427
427
  * The shortcut keys here are only for display. You need to handle the key events by yourself.
428
428
  */
429
- shortcut?: string | string;
429
+ shortcut?: string;
430
430
  /**
431
431
  * Set the submenu pop-up direction relative to coordinates.
432
432
  *
@@ -480,12 +480,16 @@ export interface MenuItem {
480
480
  onClick?: (e?: MouseEvent | KeyboardEvent) => void;
481
481
  /**
482
482
  * This event emit when submenu of this item is closing.
483
+ *
484
+ * @param itemInstance The instance of this submenu, undefined if in topmost level.
483
485
  */
484
- onSubMenuClose?: ((itemInstance: MenuItemContext) => void) | undefined;
486
+ onSubMenuClose?: ((itemInstance?: MenuItemContext) => void) | undefined;
485
487
  /**
486
488
  * This event emit when submenu of this item is showing.
489
+ *
490
+ * @param itemInstance The instance of this submenu, undefined if in topmost level.
487
491
  */
488
- onSubMenuOpen?: ((itemInstance: MenuItemContext) => void) | undefined;
492
+ onSubMenuOpen?: ((itemInstance?: MenuItemContext) => void) | undefined;
489
493
  /**
490
494
  * A custom render callback that allows you to customize the rendering
491
495
  * of the current item.