@itwin/core-react
Version:
A react component library of iTwin.js UI general purpose components
70 lines • 2.52 kB
TypeScript
/** @packageDocumentation
* @module Tabs
*/
import * as React from "react";
import type { CommonProps } from "../utils/Props.js";
import { Orientation } from "../enums/Orientation.js";
/** TabLabel provides ability to define label, icon, and tooltip for a tab entry. The tooltip can be defined as JSX|Element
* to support react-tooltip component or a string that will be use to set the title property.
* @public
* @deprecated in 4.12.0. Interface used in a deprecated component {@link Tabs}.
*/
export interface TabLabel {
label: string;
subLabel?: string;
icon?: string | React.ReactElement;
tabId: string;
/** tooltip allows React.ReactElement to support styled tooltips like react-tooltip. */
tooltip?: string | React.ReactElement;
disabled?: boolean;
}
/** Properties for the [[VerticalTabs]] component
* @public
* @deprecated in 4.12.0. Props of deprecated component {@link Tabs}.
*/
export interface TabsProps extends React.AllHTMLAttributes<HTMLUListElement>, CommonProps {
/** Text shown for each tab */
labels: Array<string | TabLabel>;
/** Handler for activating a tab */
onActivateTab?: (index: number) => any;
/** Index of the initial active tab */
activeIndex?: number;
/** Indicates whether the bar on the active tab is green instead of the default blue */
green?: boolean;
}
interface TabsState {
activeIndex: number;
}
/** Properties for the base [[Tabs]] component
* @public
* @deprecated in 4.12.0. Props of deprecated component {@link Tabs}.
*/
export interface MainTabsProps extends TabsProps {
/** Main CSS class name */
mainClassName: string;
/** Orientation of the Tabs list */
orientation: Orientation;
}
/** Tabs meant to represent the current position in a page/section
* @public
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/tabs iTwinUI Tabs} instead.
*/
export declare class Tabs extends React.PureComponent<MainTabsProps, TabsState> {
private _anchorRefs;
private _itemKeyboardNavigator;
constructor(props: MainTabsProps);
private validateActiveIndex;
componentDidMount(): void;
/** @internal */
componentDidUpdate(prevProps: MainTabsProps): void;
private _handleFocusItem;
private _handleTabClick;
/** Handle keydown on tabs */
private _handleKeyDownEvent;
/** Handle keyup on tabs */
private _handleKeyUpEvent;
private _activateTab;
render(): React.ReactElement;
}
export {};
//# sourceMappingURL=Tabs.d.ts.map