1 |
|
2 |
|
3 | import React from 'react';
|
4 | import { CommonProps } from '../util';
|
5 | import { PopupProps } from '../overlay';
|
6 | import { TreeProps, Node } from '../tree';
|
7 | import { item } from '../select';
|
8 |
|
9 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
10 | defaultValue?: any;
|
11 | onChange?: any;
|
12 | }
|
13 |
|
14 | export interface TreeSelectProps extends HTMLAttributesWeak, CommonProps {
|
15 | |
16 |
|
17 |
|
18 | children?: React.ReactNode;
|
19 |
|
20 | |
21 |
|
22 |
|
23 | size?: 'small' | 'medium' | 'large';
|
24 |
|
25 | |
26 |
|
27 |
|
28 | placeholder?: string;
|
29 |
|
30 | |
31 |
|
32 |
|
33 | disabled?: boolean;
|
34 |
|
35 | |
36 |
|
37 |
|
38 | hasArrow?: boolean;
|
39 |
|
40 | |
41 |
|
42 |
|
43 | hasBorder?: boolean;
|
44 |
|
45 | |
46 |
|
47 |
|
48 | hasClear?: boolean;
|
49 |
|
50 | |
51 |
|
52 |
|
53 | label?: React.ReactNode;
|
54 |
|
55 | |
56 |
|
57 |
|
58 | readOnly?: boolean;
|
59 |
|
60 | |
61 |
|
62 |
|
63 | autoWidth?: boolean;
|
64 |
|
65 | |
66 |
|
67 |
|
68 | dataSource?: Array<any>;
|
69 |
|
70 | |
71 |
|
72 |
|
73 | value?: string | object | Array<any>;
|
74 |
|
75 | |
76 |
|
77 |
|
78 | defaultValue?: string | object | Array<any>;
|
79 |
|
80 | |
81 |
|
82 |
|
83 | preserveNonExistentValue?: boolean;
|
84 |
|
85 | |
86 |
|
87 |
|
88 | onChange?: (value: any | Array<any>, data: any | Array<any>) => void;
|
89 |
|
90 | |
91 |
|
92 |
|
93 | useDetailValue?: boolean;
|
94 |
|
95 | |
96 |
|
97 |
|
98 | tagInline?: boolean;
|
99 |
|
100 | |
101 |
|
102 |
|
103 |
|
104 |
|
105 | maxTagPlaceholder?: (
|
106 | selectedValues: any[],
|
107 | totalValues?: any[]
|
108 | ) => React.ReactNode | HTMLElement;
|
109 |
|
110 | |
111 |
|
112 |
|
113 | autoClearSearch?: boolean;
|
114 |
|
115 | |
116 |
|
117 |
|
118 | showSearch?: boolean;
|
119 |
|
120 | |
121 |
|
122 |
|
123 | onSearch?: (keyword: string) => void;
|
124 | onSearchClear?: (actionType: string) => void;
|
125 | |
126 |
|
127 |
|
128 | notFoundContent?: React.ReactNode;
|
129 |
|
130 | |
131 |
|
132 |
|
133 | multiple?: boolean;
|
134 |
|
135 | |
136 |
|
137 |
|
138 | treeCheckable?: boolean;
|
139 |
|
140 | |
141 |
|
142 |
|
143 | treeCheckStrictly?: boolean;
|
144 |
|
145 | |
146 |
|
147 |
|
148 | treeCheckedStrategy?: 'all' | 'parent' | 'child';
|
149 |
|
150 | |
151 |
|
152 |
|
153 | treeDefaultExpandAll?: boolean;
|
154 |
|
155 | |
156 |
|
157 |
|
158 | treeDefaultExpandedKeys?: Array<any>;
|
159 |
|
160 | |
161 |
|
162 |
|
163 | treeLoadData?: (node: React.ReactElement<any>) => void;
|
164 |
|
165 | |
166 |
|
167 |
|
168 | treeProps?: TreeProps;
|
169 |
|
170 | |
171 |
|
172 |
|
173 | defaultVisible?: boolean;
|
174 |
|
175 | |
176 |
|
177 |
|
178 | visible?: boolean;
|
179 |
|
180 | |
181 |
|
182 |
|
183 | onVisibleChange?: (visible: boolean, type: string) => void;
|
184 |
|
185 | |
186 |
|
187 |
|
188 | popupStyle?: React.CSSProperties;
|
189 |
|
190 | |
191 |
|
192 |
|
193 | popupClassName?: string;
|
194 |
|
195 | |
196 |
|
197 |
|
198 | popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);
|
199 |
|
200 | /**
|
201 | * 透传到 Popup 的属性对象
|
202 | */
|
203 | popupProps?: PopupProps;
|
204 | /**
|
205 | * 是否跟随滚动
|
206 | */
|
207 | followTrigger?: boolean;
|
208 |
|
209 | /**
|
210 | * 是否为预览态
|
211 | */
|
212 | isPreview?: boolean;
|
213 |
|
214 | /**
|
215 | * 预览态模式下渲染的内容
|
216 | * @param {Array<data>} value 选择值 { label: , value:}
|
217 | */
|
218 | renderPreview?: (data: string | Array<any>, props: any | Array<any>) => React.ReactNode;
|
219 |
|
220 | |
221 |
|
222 |
|
223 | useVirtual?: boolean;
|
224 |
|
225 | |
226 |
|
227 |
|
228 | filterLocal?: boolean;
|
229 |
|
230 | immutable?: boolean;
|
231 |
|
232 | |
233 |
|
234 |
|
235 | fillProps?: string;
|
236 |
|
237 | |
238 |
|
239 |
|
240 | clickToCheck?: boolean;
|
241 |
|
242 | |
243 |
|
244 |
|
245 |
|
246 |
|
247 | valueRender?: (item: any, itemPaths: item[]) => React.ReactNode;
|
248 | }
|
249 |
|
250 | export default class TreeSelect extends React.Component<TreeSelectProps, any> {
|
251 | static Node: typeof Node;
|
252 | }
|