1 |
|
2 |
|
3 | import * as React from 'react';
|
4 | import CommonProps from '../util';
|
5 |
|
6 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
7 | onChange?: any;
|
8 | onClick?: any;
|
9 | onKeyDown?: any;
|
10 | }
|
11 |
|
12 | export interface SwitchProps extends HTMLAttributesWeak, CommonProps {
|
13 | |
14 |
|
15 |
|
16 | className?: string;
|
17 | name?: string;
|
18 |
|
19 | |
20 |
|
21 |
|
22 | style?: React.CSSProperties;
|
23 |
|
24 | |
25 |
|
26 |
|
27 | checkedChildren?: React.ReactNode;
|
28 |
|
29 | |
30 |
|
31 |
|
32 | unCheckedChildren?: React.ReactNode;
|
33 |
|
34 | |
35 |
|
36 |
|
37 | onChange?: (checked: boolean, e: any) => void;
|
38 |
|
39 | |
40 |
|
41 |
|
42 | checked?: boolean;
|
43 | autoWidth?: boolean;
|
44 |
|
45 | |
46 |
|
47 |
|
48 | defaultChecked?: boolean;
|
49 |
|
50 | |
51 |
|
52 |
|
53 | disabled?: boolean;
|
54 |
|
55 | |
56 |
|
57 |
|
58 | size?: 'medium' | 'small';
|
59 |
|
60 | |
61 |
|
62 |
|
63 | onClick?: React.MouseEventHandler;
|
64 |
|
65 | |
66 |
|
67 |
|
68 | onKeyDown?: React.KeyboardEventHandler;
|
69 |
|
70 | |
71 |
|
72 |
|
73 | loading?: boolean;
|
74 | }
|
75 |
|
76 | export default class Switch extends React.Component<SwitchProps, any> {}
|