ContextMenu d.ts updated

pull/3689/head
mertsincan 2023-03-01 13:03:58 +00:00
parent df5a35a277
commit d8470f9673
1 changed files with 51 additions and 35 deletions

View File

@ -1,9 +1,20 @@
/**
*
* ContextMenu displays an overlay menu on right click of its target. Note that components like DataTable has special integration with ContextMenu.
* Refer to documentation of the individual documentation of the with context menu support.
*
* [Live Demo](https://www.primevue.org/contextmenu/)
*
* @module contextmenu
*
*/
import { VNode } from 'vue'; import { VNode } from 'vue';
import { MenuItem } from '../menuitem'; import { MenuItem } from '../menuitem';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
type ContextMenuAppendTo = 'body' | 'self' | string | undefined | HTMLElement; /**
* Defines valid properties in ContextMenu component.
*/
export interface ContextMenuProps { export interface ContextMenuProps {
/** /**
* An array of menuitems. * An array of menuitems.
@ -11,27 +22,27 @@ export interface ContextMenuProps {
model?: MenuItem[] | undefined; model?: MenuItem[] | undefined;
/** /**
* A valid query selector or an HTMLElement to specify where the overlay gets attached. * A valid query selector or an HTMLElement to specify where the overlay gets attached.
* @see ContextMenuAppendTo * @defaultValue body
* Default value is 'body'
*/ */
appendTo?: ContextMenuAppendTo; appendTo?: 'body' | 'self' | string | undefined | HTMLElement;
/** /**
* Whether to automatically manage layering. * Whether to automatically manage layering.
* Default value is true. * @defaultValue true
*/ */
autoZIndex?: boolean | undefined; autoZIndex?: boolean | undefined;
/** /**
* Base zIndex value to use in layering. * Base zIndex value to use in layering.
* Default value is 0. * @defaultValue 0
*/ */
baseZIndex?: number | undefined; baseZIndex?: number | undefined;
/** /**
* Attaches the menu to document instead of a particular item. * Attaches the menu to document instead of a particular item.
* @defaultValue false
*/ */
global?: boolean | undefined; global?: boolean | undefined;
/** /**
* Whether to apply 'router-link-active-exact' class if route exactly matches the item path. * Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
* Default value is true. * @defaultValue true
*/ */
exact?: boolean | undefined; exact?: boolean | undefined;
/** /**
@ -48,48 +59,67 @@ export interface ContextMenuProps {
'aria-labelledby'?: string | undefined; 'aria-labelledby'?: string | undefined;
} }
/**
* Defines valid slots in ContextMenu component.
*/
export interface ContextMenuSlots { export interface ContextMenuSlots {
/** /**
* Custom item template. * Custom item template.
* @param {Object} scope - item slot's params. * @param {Object} scope - item slot's params.
*/ */
item: (scope: { item(scope: {
/** /**
* Menuitem instance * Menuitem instance
*/ */
item: MenuItem; item: MenuItem;
}) => VNode[]; }): VNode[];
} }
export declare type ContextMenuEmits = { /**
* Defines valid emits in ContextMenu component.
*/
export interface ContextMenuEmits {
/** /**
* Callback to invoke when the component receives focus. * Callback to invoke when the component receives focus.
* @param {Event} event - Browser event. * @param {Event} event - Browser event.
*/ */
focus: (event: Event) => void; focus(event: Event): void;
/** /**
* Callback to invoke when the component loses focus. * Callback to invoke when the component loses focus.
* @param {Event} event - Browser event. * @param {Event} event - Browser event.
*/ */
blur: (event: Event) => void; blur(event: Event): void;
/** /**
* Callback to invoke before the popup is shown. * Callback to invoke before the popup is shown.
*/ */
'before-show': () => void; 'before-show'(): void;
/** /**
* Callback to invoke before the popup is hidden. * Callback to invoke before the popup is hidden.
*/ */
'before-hide': () => void; 'before-hide'(): void;
/** /**
* Callback to invoke when the popup is shown. * Callback to invoke when the popup is shown.
*/ */
show: () => void; show(): void;
/** /**
* Callback to invoke when the popup is hidden. * Callback to invoke when the popup is hidden.
*/ */
hide: () => void; hide(): void;
}; }
/**
* **PrimeVue - ContextMenu**
*
* _ContextMenu displays an overlay menu on right click of its target. Note that components like DataTable has special integration with ContextMenu.
* Refer to documentation of the individual documentation of the with context menu support._
*
* [Live Demo](https://www.primevue.org/contextmenu/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo.svg)
*
* @group Component
*
*/
declare class ContextMenu extends ClassComponent<ContextMenuProps, ContextMenuSlots, ContextMenuEmits> { declare class ContextMenu extends ClassComponent<ContextMenuProps, ContextMenuSlots, ContextMenuEmits> {
/** /**
* Toggles the visibility of the menu. * Toggles the visibility of the menu.
@ -97,20 +127,20 @@ declare class ContextMenu extends ClassComponent<ContextMenuProps, ContextMenuSl
* *
* @memberof ContextMenu * @memberof ContextMenu
*/ */
toggle: (event: Event) => void; toggle(event: Event): void;
/** /**
* Shows the menu. * Shows the menu.
* @param {Event} event - Browser event. * @param {Event} event - Browser event.
* *
* @memberof ContextMenu * @memberof ContextMenu
*/ */
show: (event: Event) => void; show(event: Event): void;
/** /**
* Hides the menu. * Hides the menu.
* *
* @memberof ContextMenu * @memberof ContextMenu
*/ */
hide: () => void; hide(): void;
} }
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
@ -119,18 +149,4 @@ declare module '@vue/runtime-core' {
} }
} }
/**
*
* ContextMenu displays an overlay menu on right click of its target. Note that components like DataTable has special integration with ContextMenu.
* Refer to documentation of the individual documentation of the with context menu support.
*
* Helper API:
*
* - [MenuItem](https://www.primefaces.org/primevue/menumodel)
*
* Demos:
*
* - [ContextMenu](https://www.primefaces.org/primevue/contextmenu)
*
*/
export default ContextMenu; export default ContextMenu;