primevue-mirror/components/tabmenu/TabMenu.d.ts

80 lines
1.8 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 TabMenuChangeEvent {
/**
* Browser event
*/
originalEvent: Event;
/**
* Index of the selected tab
*/
index: number;
}
export interface TabMenuProps {
/**
* An array of menuitems.
*/
model?: MenuItem[] | undefined;
/**
* Defines if active route highlight should match the exact route path.
* Default value is true.
*/
exact?: boolean | undefined;
/**
* Active index of menuitem.
* Default value is 0.
*/
activeIndex?: number | undefined;
2022-12-08 11:04:25 +00:00
/**
* Defines a string value that labels an interactive element.
*/
'aria-label'?: string | undefined;
/**
* Identifier of the underlying input element.
*/
'aria-labelledby'?: string | undefined;
2022-09-06 12:03:37 +00:00
}
export interface TabMenuSlots {
/**
* Custom content for each item.
* @param {Object} scope - item slot's params.
*/
item: (scope: {
/**
* Menuitem instance
*/
item: MenuItem;
}) => VNode[];
}
export declare type TabMenuEmits = {
/**
* Callback to invoke when an active tab is changed.
* @param {TabMenuChangeEvent} event - Custom tab change event.
*/
'tab-change': (event: TabMenuChangeEvent) => 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 TabMenu extends ClassComponent<TabMenuProps, TabMenuSlots, TabMenuEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
TabMenu: GlobalComponentConstructor<TabMenu>;
2022-09-06 12:03:37 +00:00
}
}
/**
*
* TabMenu is a navigation component that displays items as tab headers. Example below uses nested routes with TabMenu.
*
* Demos:
*
2022-09-14 11:26:01 +00:00
* - [TabMenu](https://www.primefaces.org/primevue/tabmenu)
2022-09-06 12:03:37 +00:00
*
*/
export default TabMenu;