1 |
|
2 |
|
3 | import * as React from 'react';
|
4 | import CommonProps from '../util';
|
5 |
|
6 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
7 | defaultValue?: any;
|
8 | onChange?: any;
|
9 | }
|
10 |
|
11 | type data = {
|
12 | value?: string | number;
|
13 | label?: React.ReactNode;
|
14 | disabled?: boolean;
|
15 | [propName: string]: any;
|
16 | }
|
17 |
|
18 | export interface GroupProps extends HTMLAttributesWeak, CommonProps {
|
19 | |
20 |
|
21 |
|
22 | className?: string;
|
23 |
|
24 | |
25 |
|
26 |
|
27 | style?: React.CSSProperties;
|
28 |
|
29 | |
30 |
|
31 |
|
32 | disabled?: boolean;
|
33 |
|
34 | |
35 |
|
36 |
|
37 | isPreview?: boolean;
|
38 |
|
39 | renderPreview?: (checked: boolean, props: object) => React.ReactNode;
|
40 |
|
41 | |
42 |
|
43 |
|
44 | dataSource?: Array<string> | Array<data> | Array<number>;
|
45 |
|
46 | |
47 |
|
48 |
|
49 | value?: Array<string> | Array<number> | string | number;
|
50 |
|
51 | |
52 |
|
53 |
|
54 | defaultValue?: Array<string> | Array<number> | string | number;
|
55 |
|
56 | |
57 |
|
58 |
|
59 | name?: string;
|
60 |
|
61 | |
62 |
|
63 |
|
64 | children?: Array<any>;
|
65 |
|
66 | |
67 |
|
68 |
|
69 | onChange?: (value: Array<string>, e: any) => void;
|
70 |
|
71 | |
72 |
|
73 |
|
74 |
|
75 |
|
76 | direction?: 'hoz' | 'ver';
|
77 | itemDirection?: 'hoz' | 'ver';
|
78 | }
|
79 |
|
80 | export class Group extends React.Component<GroupProps, any> {}
|
81 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
82 | onChange?: any;
|
83 | onMouseEnter?: any;
|
84 | onMouseLeave?: any;
|
85 | }
|
86 |
|
87 | export interface CheckboxProps extends HTMLAttributesWeak, CommonProps {
|
88 | |
89 |
|
90 |
|
91 | className?: string;
|
92 |
|
93 | |
94 |
|
95 |
|
96 | id?: string;
|
97 |
|
98 | |
99 |
|
100 |
|
101 | style?: React.CSSProperties;
|
102 |
|
103 | |
104 |
|
105 |
|
106 | checked?: boolean;
|
107 |
|
108 | |
109 |
|
110 |
|
111 | value?: string | number;
|
112 |
|
113 | |
114 |
|
115 |
|
116 | name?: string;
|
117 |
|
118 | |
119 |
|
120 |
|
121 | defaultChecked?: boolean;
|
122 |
|
123 | |
124 |
|
125 |
|
126 | disabled?: boolean;
|
127 |
|
128 | |
129 |
|
130 |
|
131 | label?: React.ReactNode;
|
132 |
|
133 | |
134 |
|
135 |
|
136 | indeterminate?: boolean;
|
137 |
|
138 | |
139 |
|
140 |
|
141 | defaultIndeterminate?: boolean;
|
142 |
|
143 | |
144 |
|
145 |
|
146 | isPreview?: boolean;
|
147 |
|
148 | |
149 |
|
150 |
|
151 | onChange?: (checked: boolean, e: any) => void;
|
152 |
|
153 | |
154 |
|
155 |
|
156 | onMouseEnter?: (e: React.MouseEvent<HTMLInputElement>) => void;
|
157 |
|
158 | |
159 |
|
160 |
|
161 | onMouseLeave?: (e: React.MouseEvent<HTMLInputElement>) => void;
|
162 | }
|
163 |
|
164 | export default class Checkbox extends React.Component<CheckboxProps, any> {
|
165 | static Group: typeof Group;
|
166 | }
|