1 |
|
2 |
|
3 | import * as React from 'react';
|
4 | import CommonProps from '../util';
|
5 | import { PopupProps } from '../overlay';
|
6 |
|
7 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
8 | title?: any;
|
9 | }
|
10 |
|
11 | export interface ItemProps extends HTMLAttributesWeak, CommonProps {
|
12 | |
13 |
|
14 |
|
15 | title?: React.ReactNode;
|
16 |
|
17 | |
18 |
|
19 |
|
20 | closeable?: boolean;
|
21 |
|
22 | |
23 |
|
24 |
|
25 | disabled?: boolean;
|
26 | }
|
27 |
|
28 | export class Item extends React.Component<ItemProps, any> {}
|
29 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
30 | onClick?: any;
|
31 | onChange?: any;
|
32 | }
|
33 |
|
34 | export interface TabProps extends HTMLAttributesWeak, CommonProps {
|
35 | |
36 |
|
37 |
|
38 | activeKey?: string;
|
39 |
|
40 | |
41 |
|
42 |
|
43 | defaultActiveKey?: string;
|
44 |
|
45 | |
46 |
|
47 |
|
48 | shape?: 'pure' | 'wrapped' | 'text' | 'capsule';
|
49 |
|
50 | |
51 |
|
52 |
|
53 | animation?: boolean;
|
54 |
|
55 | |
56 |
|
57 |
|
58 | excessMode?: 'slide' | 'dropdown';
|
59 |
|
60 | |
61 |
|
62 |
|
63 | tabPosition?: 'top' | 'bottom' | 'left' | 'right';
|
64 |
|
65 | |
66 |
|
67 |
|
68 | size?: 'small' | 'medium';
|
69 |
|
70 | |
71 |
|
72 |
|
73 | triggerType?: 'hover' | 'click';
|
74 |
|
75 | |
76 |
|
77 |
|
78 | lazyLoad?: boolean;
|
79 |
|
80 | |
81 |
|
82 |
|
83 | unmountInactiveTabs?: boolean;
|
84 |
|
85 | |
86 |
|
87 |
|
88 | navStyle?: React.CSSProperties;
|
89 |
|
90 | |
91 |
|
92 |
|
93 | navClassName?: string;
|
94 |
|
95 | |
96 |
|
97 |
|
98 | contentStyle?: React.CSSProperties;
|
99 |
|
100 | |
101 |
|
102 |
|
103 | contentClassName?: string;
|
104 |
|
105 | |
106 |
|
107 |
|
108 | extra?: React.ReactNode;
|
109 |
|
110 | |
111 |
|
112 |
|
113 | disableKeyboard?: boolean;
|
114 |
|
115 | |
116 |
|
117 |
|
118 | onClick?: (key: string) => void;
|
119 |
|
120 | |
121 |
|
122 |
|
123 | onChange?: (key: string) => void;
|
124 |
|
125 | |
126 |
|
127 |
|
128 | onClose?: (key: string) => void;
|
129 |
|
130 | |
131 |
|
132 |
|
133 | tabRender?: (key: string, props: {}) => React.ReactNode;
|
134 |
|
135 | |
136 |
|
137 |
|
138 | popupProps?: PopupProps;
|
139 |
|
140 | |
141 |
|
142 |
|
143 | icons?: {
|
144 | dropdown?: string | React.ReactNode;
|
145 | prev?: string | React.ReactNode;
|
146 | next?: string | React.ReactNode;
|
147 | };
|
148 | |
149 |
|
150 |
|
151 | showAdd?: boolean,
|
152 | |
153 |
|
154 |
|
155 | onAdd?: () => void,
|
156 |
|
157 | |
158 |
|
159 |
|
160 | addIcon?: React.ReactNode;
|
161 | }
|
162 |
|
163 | export default class Tab extends React.Component<TabProps, any> {
|
164 | static Item: typeof Item;
|
165 | }
|