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