primevue-mirror/components/lib/tabpanel/TabPanel.d.ts

198 lines
4.7 KiB
TypeScript
Raw Normal View History

2023-03-01 08:06:07 +00:00
/**
*
* TabPanel is a helper component for TabPanel component.
*
* [Live Demo](https://www.primevue.org/tabview/)
*
* @module tabpanel
*
*/
2022-09-14 11:26:01 +00:00
import { AnchorHTMLAttributes, HTMLAttributes, LiHTMLAttributes, VNode } from 'vue';
2023-07-06 11:17:08 +00:00
import { ComponentHooks } from '../basecomponent';
2023-09-05 08:50:46 +00:00
import { PassThroughOptions } from '../passthrough';
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
2022-09-06 12:03:37 +00:00
export declare type TabPanelPassThroughOptionType = TabPanelPassThroughAttributes | ((options: TabPanelPassThroughMethodOptions) => TabPanelPassThroughAttributes | string) | string | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface TabPanelPassThroughMethodOptions {
/**
* Defines instance.
*/
2023-07-06 12:01:33 +00:00
instance: any;
/**
* Defines valid properties.
*/
props: TabPanelProps;
/**
* Defines current options.
*/
2023-05-24 07:07:13 +00:00
context: TabPanelContext;
/**
* Defines parent options.
*/
parent: any;
2023-09-05 08:50:46 +00:00
/**
* Defines passthrough(pt) options in global config.
*/
global: object | undefined;
}
/**
* Custom passthrough(pt) options.
* @see {@link TabPanelProps.pt}
*/
export interface TabPanelPassThroughOptions {
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the root's DOM element.
*/
root?: TabPanelPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the header's DOM element.
*/
header?: TabPanelPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the header action's DOM element.
*/
2023-04-19 08:00:52 +00:00
headerAction?: TabPanelPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the title's DOM element.
*/
2023-04-19 08:00:52 +00:00
headerTitle?: TabPanelPassThroughOptionType;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to the list's DOM element.
*/
content?: TabPanelPassThroughOptionType;
2023-07-06 11:09:01 +00:00
/**
2023-11-07 06:16:39 +00:00
* Used to manage all lifecycle hooks.
2023-07-06 11:09:01 +00:00
* @see {@link BaseComponent.ComponentHooks}
*/
hooks?: ComponentHooks;
}
export interface TabPanelPassThroughAttributes {
[key: string]: any;
}
2023-03-01 08:06:07 +00:00
/**
* Defines valid properties in TabPanel component.
*/
2022-09-06 12:03:37 +00:00
export interface TabPanelProps {
/**
* Orientation of tab headers.
*/
header?: string | undefined;
2022-09-14 11:26:01 +00:00
/**
* Inline style of the tab header.
*/
headerStyle?: any;
/**
* Style class of the tab header.
*/
headerClass?: any;
/**
2023-08-01 14:01:12 +00:00
* Used to pass all properties of the HTMLLiElement to the tab header.
* @deprecated since v3.26.0. Use 'pt' property instead.
2022-09-14 11:26:01 +00:00
*/
headerProps?: LiHTMLAttributes | undefined;
/**
2023-08-01 14:01:12 +00:00
* Used to pass all properties of the HTMLAnchorElement to the focusable anchor element inside the tab header.
* @deprecated since v3.26.0. Use 'pt' property instead.
2022-09-14 11:26:01 +00:00
*/
headerActionProps?: AnchorHTMLAttributes | undefined;
/**
* Inline style of the tab content.
*/
contentStyle?: any;
/**
* Style class of the tab content.
*/
contentClass?: any;
/**
2023-08-01 14:01:12 +00:00
* Used to pass all properties of the HTMLDivElement to the tab content.
2023-04-12 06:49:45 +00:00
* @deprecated since v3.26.0. Use 'pt' property instead.
2022-09-14 11:26:01 +00:00
*/
contentProps?: HTMLAttributes | undefined;
2022-09-06 12:03:37 +00:00
/**
* Whether the tab is disabled.
2023-03-01 08:06:07 +00:00
* @defaultValue false
2022-09-06 12:03:37 +00:00
*/
disabled?: boolean | undefined;
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to DOM elements inside the component.
* @type {TabPanelPassThroughOptions}
*/
pt?: PassThrough<TabPanelPassThroughOptions>;
2023-09-05 08:50:46 +00:00
/**
* Used to configure passthrough(pt) options of the component.
* @type {PassThroughOptions}
*/
ptOptions?: PassThroughOptions;
2022-09-06 12:03:37 +00:00
}
2023-05-24 07:07:13 +00:00
/**
* Defines current options in TabPanel component.
*/
export interface TabPanelContext {
/**
* Current index of the tab.
*/
index: number;
/**
* Count of tabs
*/
count: number;
/**
* Whether the tab is first.
*/
first: boolean;
/**
* Whether the tab is last.
*/
last: boolean;
/**
* Whether the tab is active.
*/
active: boolean;
2023-05-24 07:07:13 +00:00
}
2023-03-01 08:06:07 +00:00
/**
* Defines valid slots in TabPanel slots.
*/
2022-09-06 12:03:37 +00:00
export interface TabPanelSlots {
/**
* Custom content template.
*/
2023-04-12 06:42:12 +00:00
default(): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom header template.
*/
2023-04-12 06:42:12 +00:00
header(): VNode[];
2022-09-06 12:03:37 +00:00
}
2023-03-01 08:06:07 +00:00
export interface TabPanelEmits {}
2022-09-06 12:03:37 +00:00
2023-03-01 08:06:07 +00:00
/**
* **PrimeVue - TabPanel**
*
* _TabPanel is a helper component for TabPanel component._
*
* [Live Demo](https://www.primevue.org/tabview/)
* --- ---
2023-03-03 10:55:20 +00:00
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
2023-03-01 08:06:07 +00:00
*
* @group Component
*
*/
2023-03-01 12:30:54 +00:00
declare class TabPanel extends ClassComponent<TabPanelProps, TabPanelSlots, TabPanelEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
TabPanel: GlobalComponentConstructor<TabPanel>;
2022-09-06 12:03:37 +00:00
}
}
export default TabPanel;