primevue-mirror/components/megamenu/MegaMenu.d.ts

97 lines
2.3 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
type MegaMenuOrientationType = 'horizontal' | 'vertical' | undefined;
export interface MegaMenuProps {
/**
* An array of menuitems.
*/
model?: MenuItem[] | undefined;
/**
* Defines the orientation.
* @see MegaMenuOrientationType
* Default value is 'horizontal'.
*/
orientation?: MegaMenuOrientationType;
/**
* Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
* Default value is true.
*/
exact?: boolean | undefined;
2022-12-08 11:04:25 +00:00
/**
* When present, it specifies that the component should be disabled.
*/
disabled?: boolean | undefined;
/**
* Index of the element in tabbing order.
*/
tabindex?: number | string | undefined;
/**
* Defines a string value that labels an interactive element.
*/
'aria-label'?: string | undefined;
/**
* Identifier of the underlying menu element.
*/
'aria-labelledby'?: string | undefined;
2022-09-06 12:03:37 +00:00
}
export interface MegaMenuSlots {
/**
* Custom start template.
*/
start: () => VNode[];
/**
* Custom end template.
*/
end: () => VNode[];
/**
* Custom item template.
* @param {Object} scope - item slot's params.
*/
item: (scope: {
/**
* Menuitem instance
*/
item: MenuItem;
}) => VNode[];
}
2022-12-08 11:04:25 +00:00
export declare type MegaMenuEmits = {
/**
* Callback to invoke when the component receives focus.
* @param {Event} event - Browser event.
*/
focus: (event: Event) => void;
/**
* Callback to invoke when the component loses focus.
* @param {Event} event - Browser event.
*/
blur: (event: Event) => void;
};
2022-09-06 12:03:37 +00:00
2022-09-14 11:26:01 +00:00
declare class MegaMenu extends ClassComponent<MegaMenuProps, MegaMenuSlots, MegaMenuEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
MegaMenu: GlobalComponentConstructor<MegaMenu>;
2022-09-06 12:03:37 +00:00
}
}
/**
*
* MegaMenu is navigation component that displays submenus together.
*
* 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
* - [MegaMenu](https://www.primefaces.org/primevue/megamenu)
2022-09-06 12:03:37 +00:00
*
*/
export default MegaMenu;