2023-03-01 13:04:32 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* PanelMenu is a hybrid of Accordion and Tree components.
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/panelmenu/)
|
|
|
|
*
|
|
|
|
* @module panelmenu
|
|
|
|
*
|
|
|
|
*/
|
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
|
|
|
|
2023-03-01 13:04:32 +00:00
|
|
|
/**
|
|
|
|
* Custom expanded keys metadata.
|
|
|
|
* @see {@link PanelMenuProps.expandedKeys}
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface PanelMenuExpandedKeys {
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
2023-03-01 13:04:32 +00:00
|
|
|
/**
|
|
|
|
* Custom panel open event.
|
|
|
|
* @see {@link PanelMenuEmits['panel-open']}
|
|
|
|
*/
|
2022-12-08 11:04:25 +00:00
|
|
|
export interface PanelMenuPanelOpenEvent {
|
|
|
|
/**
|
|
|
|
* Browser mouse event.
|
|
|
|
* @type {MouseEvent}
|
|
|
|
*/
|
|
|
|
originalEvent: MouseEvent;
|
|
|
|
/**
|
|
|
|
* Current item.
|
|
|
|
*/
|
|
|
|
item: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-03-01 13:04:32 +00:00
|
|
|
* Custom panel close event.
|
|
|
|
* @see {@link PanelMenuEmits['panel-close']}
|
2022-12-08 11:04:25 +00:00
|
|
|
* @extends {PanelMenuPanelOpenEvent}
|
|
|
|
*/
|
|
|
|
export interface PanelMenuPanelCloseEvent extends PanelMenuPanelOpenEvent {}
|
|
|
|
|
2023-03-01 13:04:32 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in PanelMenu component.
|
|
|
|
*/
|
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.
|
2023-03-01 13:04:32 +00:00
|
|
|
* @type {PanelMenuExpandedKeys}
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
expandedKeys?: PanelMenuExpandedKeys;
|
|
|
|
/**
|
|
|
|
* Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
|
2023-03-01 13:04:32 +00:00
|
|
|
* @defaultValue true
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-03-01 13:04:32 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in PanelMenu component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface PanelMenuSlots {
|
|
|
|
/**
|
|
|
|
* Custom content for each item.
|
|
|
|
* @param {Object} scope - item slot's params.
|
|
|
|
*/
|
2023-03-01 13:04:32 +00:00
|
|
|
item(scope: {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Menuitem instance
|
|
|
|
*/
|
|
|
|
item: MenuItem;
|
2023-03-01 13:04:32 +00:00
|
|
|
}): VNode[];
|
2023-04-05 12:14:26 +00:00
|
|
|
/**
|
|
|
|
* Custom submenu icon template.
|
|
|
|
*/
|
|
|
|
submenuicon(scope: {
|
|
|
|
/**
|
|
|
|
* Whether item is active
|
|
|
|
*/
|
|
|
|
active: boolean;
|
|
|
|
}): VNode[];
|
2023-04-17 06:30:28 +00:00
|
|
|
/**
|
|
|
|
* Custom header icon template.
|
|
|
|
* @param {Object} scope - header icon slot's params.
|
|
|
|
*/
|
|
|
|
headericon(scope: {
|
|
|
|
/**
|
|
|
|
* Menuitem instance
|
|
|
|
*/
|
|
|
|
item: MenuItem;
|
|
|
|
/**
|
|
|
|
* Style class of the item icon element.
|
|
|
|
*/
|
|
|
|
class: any;
|
|
|
|
}): VNode[];
|
|
|
|
/**
|
|
|
|
* Custom item icon template.
|
|
|
|
* @param {Object} scope - item icon slot's params.
|
|
|
|
*/
|
|
|
|
itemicon(scope: {
|
|
|
|
/**
|
|
|
|
* Menuitem instance
|
|
|
|
*/
|
|
|
|
item: MenuItem;
|
|
|
|
/**
|
|
|
|
* Style class of the item icon element.
|
|
|
|
*/
|
|
|
|
class: any;
|
|
|
|
}): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 13:04:32 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in PanelMenu component.
|
|
|
|
*/
|
|
|
|
export interface PanelMenuEmits {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Emitted when the expandedKeys changes.
|
|
|
|
* @param {*} value - New value.
|
|
|
|
*/
|
2023-03-01 13:04:32 +00:00
|
|
|
'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.
|
|
|
|
*/
|
2023-03-01 13:04:32 +00:00
|
|
|
'panel-open'(event: PanelMenuPanelOpenEvent): void;
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when an active panel is collapsed by clicking on the header.
|
|
|
|
* @param {PanelMenuPanelCloseEvent} event - Custom panel close event.
|
|
|
|
*/
|
2023-03-01 13:04:32 +00:00
|
|
|
'panel-close'(event: PanelMenuPanelCloseEvent): void;
|
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-01 13:04:32 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - PanelMenu**
|
|
|
|
*
|
|
|
|
* _PanelMenu is a hybrid of Accordion and Tree components._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/panelmenu/)
|
|
|
|
* --- ---
|
2023-03-03 10:55:20 +00:00
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
2023-03-01 13:04:32 +00:00
|
|
|
*
|
|
|
|
* @group Component
|
|
|
|
*
|
|
|
|
*/
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default PanelMenu;
|