UNPKG

1.85 kBTypeScriptView Raw
1import { CSSProperties, FunctionComponent, JSXElementConstructor, Key, MouseEvent, MouseEventHandler, ReactNode } from 'react';
2import { TabsPosition, TabsType } from './enum';
3import TabPane, { TabPaneProps } from './TabPane';
4import TabGroup, { TabGroupProps } from './TabGroup';
5import { Size } from '../_util/enum';
6export declare type Animated = {
7 inkBar: boolean;
8 tabPane: boolean;
9};
10export interface TabsCustomized {
11 defaultActiveKey?: string;
12 panes: {
13 [key: string]: TabPaneProps;
14 };
15}
16export interface TabsProps<T = string> {
17 activeKey?: string;
18 defaultActiveKey?: string;
19 hideAdd?: boolean;
20 hideOnlyGroup?: boolean;
21 onChange?: (activeKey: T) => void;
22 onTabClick?: (key: string) => void;
23 onPrevClick?: MouseEventHandler<any>;
24 onNextClick?: MouseEventHandler<any>;
25 tabBarExtraContent?: ReactNode | null;
26 tabBarStyle?: CSSProperties;
27 inkBarStyle?: CSSProperties;
28 tabBarGutter?: number;
29 type?: TabsType;
30 tabPosition?: TabsPosition;
31 onEdit?: (targetKey: Key | MouseEvent<HTMLElement>, action: 'add' | 'remove') => void;
32 size?: Size;
33 style?: CSSProperties;
34 prefixCls?: string;
35 className?: string;
36 animated?: boolean | Animated;
37 closeShortcut?: boolean;
38 keyboard?: boolean;
39 destroyInactiveTabPane?: boolean;
40 children?: ReactNode;
41 customizable?: boolean;
42 customizedCode?: string;
43}
44export declare type GroupPanelMap = {
45 group: TabGroupProps;
46 panelsMap: Map<string, TabPaneProps & {
47 type: string | JSXElementConstructor<any>;
48 }>;
49 lastActiveKey?: string;
50};
51declare const Tabs: FunctionComponent<TabsProps>;
52export declare type ForwardTabsType = typeof Tabs & {
53 TabPane: typeof TabPane;
54 TabGroup: typeof TabGroup;
55};
56declare const _default: ForwardTabsType;
57export default _default;