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

112 lines
2.6 KiB
TypeScript
Executable File

/**
*
* MegaMenu is navigation component that displays submenus together.
*
* [Live Demo](https://www.primevue.org/megamenu/)
*
* @module megamenu
*
*/
import { VNode } from 'vue';
import { MenuItem } from '../menuitem';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
/**
* Defines valid properties in MegaMenu component.
*/
export interface MegaMenuProps {
/**
* An array of menuitems.
*/
model?: MenuItem[] | undefined;
/**
* Defines the orientation.
* @defaultValue 'horizontal'
*/
orientation?: 'horizontal' | 'vertical' | undefined;
/**
* Whether to apply 'router-link-active-exact' class if route exactly matches the item path.
* @defaultValue true
*/
exact?: boolean | undefined;
/**
* When present, it specifies that the component should be disabled.
* @defaultValue false
*/
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;
}
/**
* Defines valid slots in MegaMenu component.
*/
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[];
}
/**
* Defines valid emits in MegaMenu component.
*/
export interface 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;
}
/**
* **PrimeVue - MegaMenu**
*
* _MegaMenu is navigation component that displays submenus together._
*
* [Live Demo](https://www.primevue.org/megamenu/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo.svg)
*
* @group Component
*
*/
declare class MegaMenu extends ClassComponent<MegaMenuProps, MegaMenuSlots, MegaMenuEmits> {}
declare module '@vue/runtime-core' {
interface GlobalComponents {
MegaMenu: GlobalComponentConstructor<MegaMenu>;
}
}
export default MegaMenu;