Fixed #1836 - For Menu

pull/1846/head
mertsincan 2021-12-01 16:50:42 +03:00
parent 8284727c43
commit 709862f0b1
1 changed files with 84 additions and 15 deletions

View File

@ -1,26 +1,95 @@
import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
import { MenuItem } from '../menuitem';
interface MenuProps {
popup?: boolean;
model?: any[];
appendTo?: string;
autoZIndex?: boolean;
baseZIndex?: number;
exact?: boolean;
type MenuAppendToType = 'body' | 'self' | string | undefined;
export interface MenuProps {
/**
* An array of menuitems.
*/
model?: MenuItem[] | undefined;
/**
* Defines if menu would displayed as a popup.
*/
popup?: boolean | undefined;
/**
* A valid query selector or an HTMLElement to specify where the overlay gets attached.
* @see MenuAppendToType
* Default value is 'body'.
*/
appendTo?: MenuAppendToType;
/**
* Whether to automatically manage layering.
* Default value is true.
*/
autoZIndex?: boolean | undefined;
/**
* Base zIndex value to use in layering.
* Default value is 0.
*/
baseZIndex?: number | undefined;
/**
* Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
* Default value is true.
*/
exact?: boolean | undefined;
}
interface MenuItemSlotInterface {
item: any;
export interface MenuSlots {
/**
* Custom item template.
* @param {Object} scope - item slot's params.
*/
item: (scope: {
item: MenuItem;
}) => VNode[];
}
declare class Menu {
$props: MenuProps;
toggle(event: Event): void;
show(event: Event, target?: any): void;
export declare type MenuEmits = {
}
declare class Menu extends ClassComponent<MenuProps, MenuSlots, MenuEmits> {
/**
* Toggles the visibility of the overlay.
* @param {Event} event - Browser event.
*
* @memberof Menu
*/
toggle: (event: Event) => void;
/**
* Shows the overlay.
* @param {Event} event - Browser event.
* @param {*} [target] - Optional target if event.target would not be used.
*
* @memberof Menu
*/
show: (event: Event, target?: any) => void;
/**
* Hides the overlay.
*
* @memberof Menu
*/
hide(): void;
$slots: {
item: MenuItemSlotInterface;
}
declare module '@vue/runtime-core' {
interface GlobalComponents {
Menu: GlobalComponentConstructor<Menu>
}
}
/**
*
* Menu is a navigation / command component that supports dynamic and static positioning.
*
* Helper API:
*
* - [MenuItem](https://www.primefaces.org/primevue/showcase/#/menumodel)
*
* Demos:
*
* - [Menu](https://www.primefaces.org/primevue/showcase/#/menu)
*
*/
export default Menu;