1 |
|
2 |
|
3 | import * as React from 'react';
|
4 | import { CascaderProps, data, extra } from '../cascader';
|
5 | import CommonProps from '../util';
|
6 | import { PopupProps } from '../overlay';
|
7 |
|
8 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
9 | defaultValue?: any;
|
10 | onChange?: any;
|
11 | }
|
12 |
|
13 | export interface CascaderSelectProps extends CascaderProps, HTMLAttributesWeak, CommonProps {
|
14 | |
15 |
|
16 |
|
17 | size?: 'small' | 'medium' | 'large';
|
18 | name?: string;
|
19 |
|
20 | |
21 |
|
22 |
|
23 | placeholder?: string;
|
24 |
|
25 | |
26 |
|
27 |
|
28 | disabled?: boolean;
|
29 |
|
30 | |
31 |
|
32 |
|
33 | hasArrow?: boolean;
|
34 |
|
35 | |
36 |
|
37 |
|
38 | hasBorder?: boolean;
|
39 |
|
40 | |
41 |
|
42 |
|
43 | hasClear?: boolean;
|
44 |
|
45 | |
46 |
|
47 |
|
48 | label?: React.ReactNode;
|
49 |
|
50 | |
51 |
|
52 |
|
53 | readOnly?: boolean;
|
54 |
|
55 | |
56 |
|
57 |
|
58 | dataSource?: Array<data>;
|
59 |
|
60 | |
61 |
|
62 |
|
63 | defaultValue?: string | Array<string>;
|
64 |
|
65 | |
66 |
|
67 |
|
68 | value?: string | Array<string>;
|
69 |
|
70 | valueRender?: (item: any) => React.ReactNode;
|
71 |
|
72 | |
73 |
|
74 |
|
75 | onChange?: (value: string | Array<string>, data: data | Array<data>, extra: extra) => void;
|
76 |
|
77 | |
78 |
|
79 |
|
80 | defaultExpandedValue?: Array<string>;
|
81 |
|
82 | |
83 |
|
84 |
|
85 | expandTriggerType?: 'click' | 'hover';
|
86 |
|
87 | |
88 |
|
89 |
|
90 | useVirtual?: boolean;
|
91 |
|
92 | |
93 |
|
94 |
|
95 | multiple?: boolean;
|
96 |
|
97 | |
98 |
|
99 |
|
100 | changeOnSelect?: boolean;
|
101 |
|
102 | |
103 |
|
104 |
|
105 | canOnlyCheckLeaf?: boolean;
|
106 |
|
107 | |
108 |
|
109 |
|
110 | checkStrictly?: boolean;
|
111 |
|
112 | |
113 |
|
114 |
|
115 | listStyle?: React.CSSProperties;
|
116 |
|
117 | |
118 |
|
119 |
|
120 | listClassName?: string;
|
121 |
|
122 | |
123 |
|
124 |
|
125 | displayRender?: (label: Array<any>) => React.ReactNode;
|
126 |
|
127 | |
128 |
|
129 |
|
130 | itemRender?: (item: data) => React.ReactNode;
|
131 |
|
132 | |
133 |
|
134 |
|
135 | showSearch?: boolean;
|
136 |
|
137 | |
138 |
|
139 |
|
140 | filter?: (searchValue: string, path: Array<any>) => boolean;
|
141 |
|
142 | |
143 |
|
144 |
|
145 | onSearch?: (value: string) => void;
|
146 |
|
147 | |
148 |
|
149 |
|
150 | resultRender?: (searchValue: string, path: Array<any>) => React.ReactNode;
|
151 |
|
152 | |
153 |
|
154 |
|
155 | resultAutoWidth?: boolean;
|
156 |
|
157 | |
158 |
|
159 |
|
160 | notFoundContent?: React.ReactNode;
|
161 |
|
162 | |
163 |
|
164 |
|
165 | loadData?: (data: {}) => void;
|
166 |
|
167 | |
168 |
|
169 |
|
170 | header?: React.ReactNode;
|
171 |
|
172 | |
173 |
|
174 |
|
175 | footer?: React.ReactNode;
|
176 |
|
177 | |
178 |
|
179 |
|
180 | defaultVisible?: boolean;
|
181 |
|
182 | |
183 |
|
184 |
|
185 | visible?: boolean;
|
186 |
|
187 | |
188 |
|
189 |
|
190 | onVisibleChange?: (visible: boolean, type: string) => void;
|
191 |
|
192 | |
193 |
|
194 |
|
195 | popupStyle?: React.CSSProperties;
|
196 |
|
197 | |
198 |
|
199 |
|
200 | popupClassName?: string;
|
201 |
|
202 | |
203 |
|
204 |
|
205 | popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);
|
206 |
|
207 | /**
|
208 | * 是否跟随滚动
|
209 | */
|
210 | followTrigger?: boolean;
|
211 |
|
212 | /**
|
213 | * 透传到 Popup 的属性对象
|
214 | */
|
215 | popupProps?: PopupProps;
|
216 |
|
217 | /**
|
218 | * 是否是不可变数据
|
219 | */
|
220 | immutable?: boolean;
|
221 |
|
222 | /**
|
223 | * 是否为预览态
|
224 | */
|
225 | isPreview?: boolean;
|
226 |
|
227 | renderPreview?: (value: string | Array<string>) => React.ReactNode;
|
228 | }
|
229 |
|
230 | export default class CascaderSelect extends React.Component<CascaderSelectProps, any> {}
|