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