1 |
|
2 |
|
3 | import * as React from 'react';
|
4 | import CommonProps from '../util';
|
5 |
|
6 | interface HTMLAttributesWeak extends React.InputHTMLAttributes<HTMLElement> {
|
7 | defaultValue?: any;
|
8 | onChange?: any;
|
9 | onKeyDown?: any;
|
10 | size?: any;
|
11 | }
|
12 |
|
13 | export interface TextAreaProps extends HTMLAttributesWeak, CommonProps {
|
14 | |
15 |
|
16 |
|
17 | value?: string | number;
|
18 |
|
19 | |
20 |
|
21 |
|
22 | defaultValue?: string | number;
|
23 |
|
24 | |
25 |
|
26 |
|
27 | onChange?: (value: string, e: React.ChangeEvent<HTMLTextAreaElement>, type?: string) => void;
|
28 |
|
29 | |
30 |
|
31 |
|
32 | onKeyDown?: (e: React.KeyboardEvent<HTMLTextAreaElement>, opts: {}) => void;
|
33 |
|
34 | |
35 |
|
36 |
|
37 | disabled?: boolean;
|
38 |
|
39 | |
40 |
|
41 |
|
42 | maxLength?: number;
|
43 |
|
44 | |
45 |
|
46 |
|
47 | hasLimitHint?: boolean;
|
48 | showLimitHint?: boolean;
|
49 |
|
50 | |
51 |
|
52 |
|
53 | cutString?: boolean;
|
54 |
|
55 | |
56 |
|
57 |
|
58 | readOnly?: boolean;
|
59 |
|
60 | |
61 |
|
62 |
|
63 | trim?: boolean;
|
64 |
|
65 | |
66 |
|
67 |
|
68 | placeholder?: string;
|
69 |
|
70 | |
71 |
|
72 |
|
73 | onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
74 |
|
75 | |
76 |
|
77 |
|
78 | onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
79 |
|
80 | |
81 |
|
82 |
|
83 | getValueLength?: (value: string) => number;
|
84 |
|
85 | |
86 |
|
87 |
|
88 | className?: string;
|
89 |
|
90 | |
91 |
|
92 |
|
93 | style?: React.CSSProperties;
|
94 |
|
95 | |
96 |
|
97 |
|
98 | htmlType?: string;
|
99 |
|
100 | |
101 |
|
102 |
|
103 | name?: string;
|
104 |
|
105 | |
106 |
|
107 |
|
108 | state?: 'error' | 'warning';
|
109 |
|
110 | |
111 |
|
112 |
|
113 | hasBorder?: boolean;
|
114 |
|
115 | |
116 |
|
117 |
|
118 | autoHeight?: boolean | {};
|
119 |
|
120 | |
121 |
|
122 |
|
123 | rows?: number;
|
124 |
|
125 | |
126 |
|
127 |
|
128 | isPreview?: boolean;
|
129 |
|
130 | renderPreview?: (value: string | number) => React.ReactNode;
|
131 |
|
132 | |
133 |
|
134 |
|
135 | composition?: boolean;
|
136 | }
|
137 |
|
138 | export class TextArea extends React.Component<TextAreaProps, any> {}
|
139 |
|
140 | export interface GroupProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
|
141 | |
142 |
|
143 |
|
144 | prefix?: string;
|
145 |
|
146 | |
147 |
|
148 |
|
149 | addonBefore?: React.ReactNode;
|
150 |
|
151 | |
152 |
|
153 |
|
154 | addonBeforeClassName?: string;
|
155 |
|
156 | |
157 |
|
158 |
|
159 | addonAfter?: React.ReactNode;
|
160 |
|
161 | |
162 |
|
163 |
|
164 | addonAfterClassName?: string;
|
165 |
|
166 | |
167 |
|
168 |
|
169 | rtl?: boolean;
|
170 | }
|
171 |
|
172 | export class Group extends React.Component<GroupProps, any> {}
|
173 |
|
174 | export interface InputProps extends HTMLAttributesWeak, CommonProps {
|
175 | |
176 |
|
177 |
|
178 | value?: string | number;
|
179 |
|
180 | |
181 |
|
182 |
|
183 | defaultValue?: string | number;
|
184 |
|
185 | |
186 |
|
187 |
|
188 | onChange?: (value: string, e: React.ChangeEvent<HTMLInputElement>, type?: string) => void;
|
189 |
|
190 | |
191 |
|
192 |
|
193 | onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>, opts: {}) => void;
|
194 |
|
195 | |
196 |
|
197 |
|
198 | disabled?: boolean;
|
199 |
|
200 | |
201 |
|
202 |
|
203 | maxLength?: number;
|
204 |
|
205 | |
206 |
|
207 |
|
208 | hasLimitHint?: boolean;
|
209 | showLimitHint?: boolean;
|
210 |
|
211 | |
212 |
|
213 |
|
214 | cutString?: boolean;
|
215 |
|
216 | |
217 |
|
218 |
|
219 | readOnly?: boolean;
|
220 |
|
221 | |
222 |
|
223 |
|
224 | trim?: boolean;
|
225 |
|
226 | |
227 |
|
228 |
|
229 | placeholder?: string;
|
230 |
|
231 | |
232 |
|
233 |
|
234 | onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
235 |
|
236 | |
237 |
|
238 |
|
239 | onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
240 |
|
241 | |
242 |
|
243 |
|
244 | getValueLength?: (value: string) => number;
|
245 |
|
246 | |
247 |
|
248 |
|
249 | className?: string;
|
250 |
|
251 | |
252 |
|
253 |
|
254 | style?: React.CSSProperties;
|
255 |
|
256 | |
257 |
|
258 |
|
259 | htmlType?: string;
|
260 |
|
261 | |
262 |
|
263 |
|
264 | name?: string;
|
265 |
|
266 | |
267 |
|
268 |
|
269 | state?: 'error' | 'loading' | 'success' | 'warning';
|
270 |
|
271 | |
272 |
|
273 |
|
274 | label?: React.ReactNode;
|
275 |
|
276 | |
277 |
|
278 |
|
279 | hasClear?: boolean;
|
280 |
|
281 | |
282 |
|
283 |
|
284 | hasBorder?: boolean;
|
285 |
|
286 | |
287 |
|
288 |
|
289 | size?: 'small' | 'medium' | 'large';
|
290 |
|
291 | |
292 |
|
293 |
|
294 | onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
295 |
|
296 | |
297 |
|
298 |
|
299 | hint?: string | React.ReactNode;
|
300 |
|
301 | |
302 |
|
303 |
|
304 | innerBefore?: React.ReactNode;
|
305 |
|
306 | |
307 |
|
308 |
|
309 | innerAfter?: React.ReactNode;
|
310 |
|
311 | |
312 |
|
313 |
|
314 | addonBefore?: React.ReactNode;
|
315 |
|
316 | |
317 |
|
318 |
|
319 | addonAfter?: React.ReactNode;
|
320 |
|
321 | |
322 |
|
323 |
|
324 | addonTextBefore?: React.ReactNode;
|
325 |
|
326 | |
327 |
|
328 |
|
329 | addonTextAfter?: React.ReactNode;
|
330 |
|
331 | |
332 |
|
333 |
|
334 | autoComplete?: string;
|
335 |
|
336 | |
337 |
|
338 |
|
339 | autoFocus?: boolean;
|
340 |
|
341 | |
342 |
|
343 |
|
344 | isPreview?: boolean;
|
345 |
|
346 | renderPreview?: (value: string | number) => React.ReactNode;
|
347 | |
348 |
|
349 |
|
350 |
|
351 | hoverShowClear?: boolean;
|
352 | }
|
353 | export interface PasswordProps extends InputProps {
|
354 | |
355 |
|
356 |
|
357 | showToggle?: boolean;
|
358 | }
|
359 | export class Password extends React.Component<PasswordProps, any> {}
|
360 |
|
361 | export default class Input extends React.Component<InputProps, any> {
|
362 | static TextArea: typeof TextArea;
|
363 | static Group: typeof Group;
|
364 | static Password: typeof Password;
|
365 | getInputNode: () => HTMLInputElement;
|
366 | }
|
367 |
|