primevue-mirror/components/panelmenu/PanelMenu.d.ts

99 lines
2.4 KiB
TypeScript
Raw Normal View History

2022-09-06 12:03:37 +00:00
import { VNode } from 'vue';
import { MenuItem } from '../menuitem';
2022-12-08 11:04:25 +00:00
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
2022-09-06 12:03:37 +00:00
export interface PanelMenuExpandedKeys {
[key: string]: any;
}
2022-12-08 11:04:25 +00:00
export interface PanelMenuPanelOpenEvent {
/**
* Browser mouse event.
* @type {MouseEvent}
*/
originalEvent: MouseEvent;
/**
* Current item.
*/
item: any;
}
/**
* @extends {PanelMenuPanelOpenEvent}
*/
export interface PanelMenuPanelCloseEvent extends PanelMenuPanelOpenEvent {}
2022-09-06 12:03:37 +00:00
export interface PanelMenuProps {
/**
* An array of menuitems.
*/
model?: MenuItem[] | undefined;
/**
* A map of keys to represent the expansion state in controlled mode.
* @see PanelMenuExpandedKeys
*/
expandedKeys?: PanelMenuExpandedKeys;
/**
* Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
*/
exact?: boolean | undefined;
2022-12-08 11:04:25 +00:00
/**
* Index of the element in tabbing order.
*/
tabindex?: number | string | undefined;
2022-09-06 12:03:37 +00:00
}
export interface PanelMenuSlots {
/**
* Custom content for each item.
* @param {Object} scope - item slot's params.
*/
item: (scope: {
/**
* Menuitem instance
*/
item: MenuItem;
}) => VNode[];
}
export declare type PanelMenuEmits = {
/**
* Emitted when the expandedKeys changes.
* @param {*} value - New value.
*/
'update:expandedKeys': (value: any) => void;
2022-12-08 11:04:25 +00:00
/**
* Callback to invoke when a panel gets expanded.
* @param {PanelMenuPanelOpenEvent} event - Custom panel open event.
*/
'panel-open': (event: PanelMenuPanelOpenEvent) => void;
/**
* Callback to invoke when an active panel is collapsed by clicking on the header.
* @param {PanelMenuPanelCloseEvent} event - Custom panel close event.
*/
'panel-close': (event: PanelMenuPanelCloseEvent) => void;
2022-09-14 11:26:01 +00:00
};
2022-09-06 12:03:37 +00:00
2022-09-14 11:26:01 +00:00
declare class PanelMenu extends ClassComponent<PanelMenuProps, PanelMenuSlots, PanelMenuEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
PanelMenu: GlobalComponentConstructor<PanelMenu>;
2022-09-06 12:03:37 +00:00
}
}
/**
*
* PanelMenu is a hybrid of Accordion and Tree components.
*
* Helper API:
*
2022-09-14 11:26:01 +00:00
* - [MenuItem](https://www.primefaces.org/primevue/menumodel)
2022-09-06 12:03:37 +00:00
*
* Demos:
*
2022-09-14 11:26:01 +00:00
* - [PanelMenu](https://www.primefaces.org/primevue/panelmenu)
2022-09-06 12:03:37 +00:00
*
*/
export default PanelMenu;