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

119 lines
2.7 KiB
TypeScript
Raw Normal View History

2023-03-01 13:04:44 +00:00
/**
*
* TabMenu is a navigation component that displays items as tab headers. Example below uses nested routes with TabMenu.
*
* [Live Demo](https://www.primevue.org/tabmenu/)
*
* @module tabmenu
*
*/
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:44 +00:00
/**
* Custom change event.
* @see {@link TabMenuEmits['tab-change']}
*/
2022-09-06 12:03:37 +00:00
export interface TabMenuChangeEvent {
/**
* Browser event
*/
originalEvent: Event;
/**
* Index of the selected tab
*/
index: number;
}
2023-03-01 13:04:44 +00:00
/**
* Defines valid properties in TabMenu component.
*/
2022-09-06 12:03:37 +00:00
export interface TabMenuProps {
/**
* An array of menuitems.
*/
model?: MenuItem[] | undefined;
/**
* Defines if active route highlight should match the exact route path.
2023-03-01 13:04:44 +00:00
* @defaultValue true
2022-09-06 12:03:37 +00:00
*/
exact?: boolean | undefined;
/**
* Active index of menuitem.
2023-03-01 13:04:44 +00:00
* @defaultValue 0
2022-09-06 12:03:37 +00:00
*/
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
}
2023-03-01 13:04:44 +00:00
/**
* Defines valid slots in TabMenu component.
*/
2022-09-06 12:03:37 +00:00
export interface TabMenuSlots {
/**
* Custom content for each item.
* @param {Object} scope - item slot's params.
*/
2023-03-01 13:04:44 +00:00
item(scope: {
2022-09-06 12:03:37 +00:00
/**
* Menuitem instance
*/
item: MenuItem;
2023-03-01 13:04:44 +00:00
}): 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:44 +00:00
/**
* Defines valid emits in TabMenu component.
*/
export interface TabMenuEmits {
2022-09-06 12:03:37 +00:00
/**
* Callback to invoke when an active tab is changed.
* @param {TabMenuChangeEvent} event - Custom tab change event.
*/
2023-03-01 13:04:44 +00:00
'tab-change'(event: TabMenuChangeEvent): void;
}
2022-09-06 12:03:37 +00:00
2023-03-01 13:04:44 +00:00
/**
* **PrimeVue - TabMenu**
*
* _TabMenu is a navigation component that displays items as tab headers. Example below uses nested routes with TabMenu._
*
* [Live Demo](https://www.primevue.org/tabmenu/)
* --- ---
2023-03-03 10:55:20 +00:00
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
2023-03-01 13:04:44 +00:00
*
* @group Component
*
*/
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
}
}
export default TabMenu;