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

237 lines
6.2 KiB
TypeScript
Raw Normal View History

2023-03-01 08:06:07 +00:00
/**
*
2024-04-19 13:51:57 +00:00
* TabPanel is a helper component for Tabs component.
2023-03-01 08:06:07 +00:00
*
2024-04-19 13:51:57 +00:00
* [Live Demo](https://www.primevue.org/tabs/)
2023-03-01 08:06:07 +00:00
*
* @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 { DefineComponent, DesignToken, EmitFn, 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 valid attributes.
*/
attrs: any;
/**
* 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 {
/**
* Used to pass attributes to the root's DOM element.
*/
root?: TabPanelPassThroughOptionType;
/**
* Used to pass attributes to the header's DOM element.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
*/
header?: TabPanelPassThroughOptionType;
/**
* Used to pass attributes to the header action's DOM element.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
*/
2023-04-19 08:00:52 +00:00
headerAction?: TabPanelPassThroughOptionType;
/**
* Used to pass attributes to the title's DOM element.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
*/
2023-04-19 08:00:52 +00:00
headerTitle?: TabPanelPassThroughOptionType;
/**
* Used to pass attributes to the list's DOM element.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
*/
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 {
2024-04-19 13:51:57 +00:00
/**
* Value of tabpanel.
*/
value: string;
/**
* Use to change the HTML tag of root element.
* @defaultValue DIV
*/
as?: string | undefined;
/**
* When enabled, it changes the default rendered element for the one passed as a child element.
* @defaultValue false
*/
asChild?: boolean | undefined;
2022-09-06 12:03:37 +00:00
/**
* Orientation of tab headers.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
2022-09-06 12:03:37 +00:00
*/
header?: string | undefined;
2022-09-14 11:26:01 +00:00
/**
* Inline style of the tab header.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
2022-09-14 11:26:01 +00:00
*/
headerStyle?: any;
/**
* Style class of the tab header.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
2022-09-14 11:26:01 +00:00
*/
headerClass?: any;
/**
2023-08-01 14:01:12 +00:00
* Used to pass all properties of the HTMLLiElement to the tab header.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
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.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
2022-09-14 11:26:01 +00:00
*/
headerActionProps?: AnchorHTMLAttributes | undefined;
/**
* Inline style of the tab content.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
2022-09-14 11:26:01 +00:00
*/
contentStyle?: any;
/**
* Style class of the tab content.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
2022-09-14 11:26:01 +00:00
*/
contentClass?: any;
/**
2023-08-01 14:01:12 +00:00
* Used to pass all properties of the HTMLDivElement to the tab content.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
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
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
2022-09-06 12:03:37 +00:00
*/
disabled?: boolean | undefined;
/**
* It generates scoped CSS variables using design tokens for the component.
*/
dt?: DesignToken<any>;
/**
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.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
2023-05-24 07:07:13 +00:00
*/
index: number;
/**
* Count of tabs
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
*/
count: number;
/**
* Whether the tab is first.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
*/
first: boolean;
/**
* Whether the tab is last.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
*/
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.
2024-04-19 13:51:57 +00:00
* @deprecated since v4. Only supported by TabView.
2022-09-06 12:03:37 +00:00
*/
2023-04-12 06:42:12 +00:00
header(): VNode[];
2022-09-06 12:03:37 +00:00
}
2024-05-16 14:05:43 +00:00
export interface TabPanelEmitsOptions {}
export declare type TabPanelEmits = EmitFn<TabPanelEmitsOptions>;
2022-09-06 12:03:37 +00:00
2023-03-01 08:06:07 +00:00
/**
* **PrimeVue - TabPanel**
*
2024-04-19 13:51:57 +00:00
* _TabPanel is a helper component for Tabs component._
2023-03-01 08:06:07 +00:00
*
2024-04-19 13:51:57 +00:00
* [Live Demo](https://www.primevue.org/tabs/)
2023-03-01 08:06:07 +00:00
* --- ---
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
*
*/
declare const TabPanel: DefineComponent<TabPanelProps, TabPanelSlots, TabPanelEmits>;
2022-09-06 12:03:37 +00:00
declare module 'vue' {
export interface GlobalComponents {
TabPanel: GlobalComponentConstructor<TabPanelProps, TabPanelSlots, TabPanelEmits>;
2022-09-06 12:03:37 +00:00
}
}
export default TabPanel;