1 | import * as React from "react";
|
2 | import { AbstractPureComponent2 } from "../../common";
|
3 | import { Props } from "../../common/props";
|
4 | import { Tab, TabId } from "./tab";
|
5 | export declare const Expander: React.FunctionComponent;
|
6 | export declare type TabsProps = ITabsProps;
|
7 |
|
8 | export interface ITabsProps extends Props {
|
9 | |
10 |
|
11 |
|
12 |
|
13 |
|
14 | animate?: boolean;
|
15 | |
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | defaultSelectedTabId?: TabId;
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 | id: TabId;
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | large?: boolean;
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | renderActiveTabPanelOnly?: boolean;
|
43 | |
44 |
|
45 |
|
46 |
|
47 |
|
48 | selectedTabId?: TabId;
|
49 | |
50 |
|
51 |
|
52 |
|
53 |
|
54 | vertical?: boolean;
|
55 | |
56 |
|
57 |
|
58 | onChange?(newTabId: TabId, prevTabId: TabId | undefined, event: React.MouseEvent<HTMLElement>): void;
|
59 | }
|
60 | export interface ITabsState {
|
61 | indicatorWrapperStyle?: React.CSSProperties;
|
62 | selectedTabId?: TabId;
|
63 | }
|
64 | export declare class Tabs extends AbstractPureComponent2<TabsProps, ITabsState> {
|
65 |
|
66 | static Expander: React.FunctionComponent<{}>;
|
67 | static Tab: typeof Tab;
|
68 | static defaultProps: Partial<TabsProps>;
|
69 | static displayName: string;
|
70 | static getDerivedStateFromProps({ selectedTabId }: TabsProps): {
|
71 | selectedTabId: string | number;
|
72 | } | null;
|
73 | private tablistElement;
|
74 | private refHandlers;
|
75 | constructor(props: TabsProps);
|
76 | render(): JSX.Element;
|
77 | componentDidMount(): void;
|
78 | componentDidUpdate(prevProps: TabsProps, prevState: ITabsState): void;
|
79 | private getInitialSelectedTabId;
|
80 | private getKeyCodeDirection;
|
81 | private getTabChildrenProps;
|
82 | /** Filters children to only `<Tab>`s */
|
83 | private getTabChildren;
|
84 | /** Queries root HTML element for all tabs with optional filter selector */
|
85 | private getTabElements;
|
86 | private handleKeyDown;
|
87 | private handleKeyPress;
|
88 | private handleTabClick;
|
89 | /**
|
90 | * Calculate the new height, width, and position of the tab indicator.
|
91 | * Store the CSS values so the transition animation can start.
|
92 | */
|
93 | private moveSelectionIndicator;
|
94 | private renderTabPanel;
|
95 | private renderTabTitle;
|
96 | }
|