@progress/kendo-react-dropdowns 7.2.4-develop.3 → 7.3.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoComplete/AutoComplete.js +8 -0
- package/AutoComplete/AutoComplete.mjs +458 -0
- package/ComboBox/ComboBox.js +8 -0
- package/ComboBox/ComboBox.mjs +618 -0
- package/DropDownList/DropDownList.js +8 -0
- package/DropDownList/DropDownList.mjs +630 -0
- package/DropDownTree/DropDownTree.js +8 -0
- package/DropDownTree/DropDownTree.mjs +550 -0
- package/DropDownTree/ListNoData.js +8 -0
- package/DropDownTree/ListNoData.mjs +13 -0
- package/DropDownTree/useDropdownWidth.js +8 -0
- package/DropDownTree/useDropdownWidth.mjs +25 -0
- package/MultiColumnComboBox/MultiColumnComboBox.js +8 -0
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +186 -0
- package/MultiSelect/MultiSelect.js +8 -0
- package/MultiSelect/MultiSelect.mjs +694 -0
- package/MultiSelect/TagList.js +8 -0
- package/MultiSelect/TagList.mjs +48 -0
- package/MultiSelectTree/MultiSelectTree.js +8 -0
- package/MultiSelectTree/MultiSelectTree.mjs +590 -0
- package/MultiSelectTree/utils.js +8 -0
- package/MultiSelectTree/utils.mjs +74 -0
- package/common/AdaptiveMode.js +8 -0
- package/common/AdaptiveMode.mjs +73 -0
- package/common/ClearButton.js +8 -0
- package/common/ClearButton.mjs +38 -0
- package/common/DropDownBase.js +8 -0
- package/common/DropDownBase.mjs +194 -0
- package/common/GroupStickyHeader.js +8 -0
- package/common/GroupStickyHeader.mjs +22 -0
- package/common/List.js +8 -0
- package/common/List.mjs +117 -0
- package/common/ListContainer.js +8 -0
- package/common/ListContainer.mjs +33 -0
- package/common/ListDefaultItem.js +8 -0
- package/common/ListDefaultItem.mjs +36 -0
- package/common/ListFilter.js +8 -0
- package/common/ListFilter.mjs +49 -0
- package/common/ListGroupItem.js +8 -0
- package/common/ListGroupItem.mjs +32 -0
- package/common/ListItem.js +8 -0
- package/common/ListItem.mjs +49 -0
- package/common/MultiColumnList.js +8 -0
- package/common/MultiColumnList.mjs +28 -0
- package/common/Navigation.js +8 -0
- package/common/Navigation.mjs +29 -0
- package/common/SearchBar.js +8 -0
- package/common/SearchBar.mjs +65 -0
- package/common/VirtualScroll.js +8 -0
- package/common/VirtualScroll.mjs +75 -0
- package/common/constants.js +8 -0
- package/common/constants.mjs +13 -0
- package/common/settings.js +8 -0
- package/common/settings.mjs +12 -0
- package/common/utils.js +8 -0
- package/common/utils.mjs +109 -0
- package/common/withCustomComponent.js +8 -0
- package/common/withCustomComponent.mjs +13 -0
- package/dist/cdn/js/kendo-react-dropdowns.js +8 -5
- package/index.d.mts +4098 -5
- package/index.d.ts +4098 -31
- package/index.js +8 -5
- package/index.mjs +55 -4429
- package/messages/index.js +8 -0
- package/messages/index.mjs +27 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +9 -9
- package/AutoComplete/AutoComplete.d.ts +0 -236
- package/AutoComplete/AutoCompleteProps.d.ts +0 -254
- package/ComboBox/ComboBox.d.ts +0 -254
- package/ComboBox/ComboBoxProps.d.ts +0 -324
- package/DropDownList/DropDownList.d.ts +0 -264
- package/DropDownList/DropDownListProps.d.ts +0 -329
- package/DropDownTree/DropDownTree.d.ts +0 -74
- package/DropDownTree/DropDownTreeProps.d.ts +0 -297
- package/DropDownTree/ListNoData.d.ts +0 -10
- package/DropDownTree/useDropdownWidth.d.ts +0 -10
- package/MultiColumnComboBox/MultiColumnComboBox.d.ts +0 -300
- package/MultiSelect/MultiSelect.d.ts +0 -262
- package/MultiSelect/MultiSelectProps.d.ts +0 -325
- package/MultiSelect/TagList.d.ts +0 -42
- package/MultiSelectTree/MultiSelectTree.d.ts +0 -85
- package/MultiSelectTree/MultiSelectTreeProps.d.ts +0 -324
- package/MultiSelectTree/utils.d.ts +0 -21
- package/common/AdaptiveMode.d.ts +0 -25
- package/common/ClearButton.d.ts +0 -18
- package/common/DropDownBase.d.ts +0 -180
- package/common/GroupStickyHeader.d.ts +0 -28
- package/common/List.d.ts +0 -50
- package/common/ListContainer.d.ts +0 -22
- package/common/ListDefaultItem.d.ts +0 -20
- package/common/ListFilter.d.ts +0 -23
- package/common/ListGroupItem.d.ts +0 -37
- package/common/ListItem.d.ts +0 -65
- package/common/MultiColumnList.d.ts +0 -9
- package/common/Navigation.d.ts +0 -17
- package/common/SearchBar.d.ts +0 -47
- package/common/VirtualScroll.d.ts +0 -45
- package/common/constants.d.ts +0 -8
- package/common/events.d.ts +0 -76
- package/common/filterDescriptor.d.ts +0 -45
- package/common/settings.d.ts +0 -109
- package/common/utils.d.ts +0 -70
- package/common/withCustomComponent.d.ts +0 -11
- package/messages/index.d.ts +0 -44
- package/package-metadata.d.ts +0 -9
package/index.d.mts
CHANGED
|
@@ -1,5 +1,4098 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { CustomComponent } from '@progress/kendo-react-common';
|
|
9
|
+
import { FormComponent } from '@progress/kendo-react-common';
|
|
10
|
+
import { FormComponentProps } from '@progress/kendo-react-common';
|
|
11
|
+
import { FormComponentValidity } from '@progress/kendo-react-common';
|
|
12
|
+
import { ItemRenderProps } from '@progress/kendo-react-treeview';
|
|
13
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
14
|
+
import { LocalizationService } from '@progress/kendo-react-intl';
|
|
15
|
+
import { PopupProps } from '@progress/kendo-react-popup';
|
|
16
|
+
import PropTypes from 'prop-types';
|
|
17
|
+
import * as React_2 from 'react';
|
|
18
|
+
import { SVGIcon } from '@progress/kendo-react-common';
|
|
19
|
+
import { TextBoxChangeEvent } from '@progress/kendo-react-inputs';
|
|
20
|
+
import { TextBoxHandle } from '@progress/kendo-react-inputs';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
declare enum ActiveDescendant {
|
|
26
|
+
PopupList = 0,
|
|
27
|
+
TagsList = 1
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** @hidden */
|
|
31
|
+
export declare type AutoComplete = AutoCompleteHandle;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Represents the [KendoReact AutoComplete component]({% slug overview_autocomplete %}).
|
|
35
|
+
*
|
|
36
|
+
* Accepts properties of type [AutoCompleteProps]({% slug api_dropdowns_autocompleteprops %}).
|
|
37
|
+
* Obtaining the `ref` returns an object of type [AutoCompleteHandle]({% slug api_dropdowns_autocompletehandle %}).
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```jsx
|
|
41
|
+
* class App extends React.Component {
|
|
42
|
+
* autocomplete = null;
|
|
43
|
+
* render() {
|
|
44
|
+
* return (
|
|
45
|
+
* <div>
|
|
46
|
+
* <AutoComplete
|
|
47
|
+
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
48
|
+
* ref={component => this.autocomplete = component}
|
|
49
|
+
* />
|
|
50
|
+
* <button onClick={() => alert(this.autocomplete.value)}>alert value</button>
|
|
51
|
+
* </div>
|
|
52
|
+
* );
|
|
53
|
+
* }
|
|
54
|
+
* }
|
|
55
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare const AutoComplete: React_2.ForwardRefExoticComponent<AutoCompleteProps & React_2.RefAttributes<any>>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Represents the object of the `blur` AutoComplete event.
|
|
62
|
+
*/
|
|
63
|
+
export declare interface AutoCompleteBlurEvent extends BlurEvent<AutoComplete> {
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Represents the object of the `change` AutoComplete event.
|
|
68
|
+
*/
|
|
69
|
+
export declare interface AutoCompleteChangeEvent extends ChangeEvent<AutoComplete> {
|
|
70
|
+
suggestion?: Suggestion;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Represents the object of the `close` AutoComplete event.
|
|
75
|
+
*/
|
|
76
|
+
export declare interface AutoCompleteCloseEvent extends CloseEvent_2<AutoComplete> {
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Represents the object of the `focus` AutoComplete event.
|
|
81
|
+
*/
|
|
82
|
+
export declare interface AutoCompleteFocusEvent extends FocusEvent_2<AutoComplete> {
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Represent the `ref` of the AutoComplete component.
|
|
87
|
+
*/
|
|
88
|
+
export declare interface AutoCompleteHandle extends Pick<AutoCompleteWithoutContext, keyof AutoCompleteWithoutContext> {
|
|
89
|
+
/**
|
|
90
|
+
* Gets the `name` property of the AutoComplete.
|
|
91
|
+
*/
|
|
92
|
+
name: string | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Represents the validity state into which the AutoComplete is set.
|
|
95
|
+
*/
|
|
96
|
+
validity: FormComponentValidity;
|
|
97
|
+
/**
|
|
98
|
+
* The value of the AutoComplete.
|
|
99
|
+
*/
|
|
100
|
+
value: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @hidden
|
|
105
|
+
*/
|
|
106
|
+
declare interface AutoCompleteInternalState extends InternalState {
|
|
107
|
+
data: AutoCompleteState;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Represents the object of the `open` AutoComplete event.
|
|
112
|
+
*/
|
|
113
|
+
export declare interface AutoCompleteOpenEvent extends OpenEvent<AutoComplete> {
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Represents the props of the [KendoReact AutoComplete component]({% slug overview_autocomplete %}).
|
|
118
|
+
*/
|
|
119
|
+
export declare interface AutoCompleteProps extends FormComponentProps {
|
|
120
|
+
/**
|
|
121
|
+
* Sets the data of the AutoComplete ([more information and example]({% slug binding_autocomplete %})).
|
|
122
|
+
*/
|
|
123
|
+
data?: any[];
|
|
124
|
+
/**
|
|
125
|
+
* Sets the opened and closed state of the AutoComplete.
|
|
126
|
+
*/
|
|
127
|
+
opened?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* The styles that are applied to the AutoComplete.
|
|
130
|
+
*/
|
|
131
|
+
style?: React.CSSProperties;
|
|
132
|
+
/**
|
|
133
|
+
* Sets the value of the AutoComplete ([more information and example]({% slug binding_autocomplete %})).
|
|
134
|
+
*/
|
|
135
|
+
value?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Sets the default value of the AutoComplete. Similar to the native `input` HTML element.
|
|
138
|
+
*/
|
|
139
|
+
defaultValue?: string;
|
|
140
|
+
/**
|
|
141
|
+
* Sets additional classes to the AutoComplete.
|
|
142
|
+
*/
|
|
143
|
+
className?: string;
|
|
144
|
+
/**
|
|
145
|
+
* By default, the AutoComplete renders a button on hovering over the component, which resets the value.
|
|
146
|
+
* If `clearButton` is set to `false`, the button will not be rendered.
|
|
147
|
+
*/
|
|
148
|
+
clearButton?: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* The hint that is displayed when the AutoComplete is empty.
|
|
151
|
+
*/
|
|
152
|
+
placeholder?: string;
|
|
153
|
+
/**
|
|
154
|
+
* Sets the read-only state of the AutoComplete.
|
|
155
|
+
*/
|
|
156
|
+
readonly?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Enables the auto-completion of the text based on the first data item ([see example]({% slug suggestions_autocomplete %})).
|
|
159
|
+
*/
|
|
160
|
+
suggest?: boolean | string;
|
|
161
|
+
/**
|
|
162
|
+
* Sets the disabled state of the AutoComplete.
|
|
163
|
+
*/
|
|
164
|
+
disabled?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Represents the `dir` HTML attribute.
|
|
167
|
+
*/
|
|
168
|
+
dir?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Sets the loading state of the AutoComplete ([see example]({% slug filtering_autocomplete %}#toc-basic-configuration)).
|
|
171
|
+
*/
|
|
172
|
+
loading?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Specifies the `tabIndex` of the AutoComplete.
|
|
175
|
+
*/
|
|
176
|
+
tabIndex?: number;
|
|
177
|
+
/**
|
|
178
|
+
* Specifies the `accessKey` of the AutoComplete.
|
|
179
|
+
*/
|
|
180
|
+
accessKey?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Sets the data item field that represents the item text ([see example]({% slug binding_autocomplete %}#toc-datasets-of-objects)). If the data contains only primitive values, do not define it.
|
|
183
|
+
*/
|
|
184
|
+
textField?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Renders a floating label for the AutoComplete.
|
|
187
|
+
*/
|
|
188
|
+
label?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Configures the popup of the AutoComplete.
|
|
191
|
+
*/
|
|
192
|
+
popupSettings?: DropDownsPopupSettings;
|
|
193
|
+
/**
|
|
194
|
+
* Specifies the id of the component.
|
|
195
|
+
*/
|
|
196
|
+
id?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute).
|
|
199
|
+
* For example these elements could contain error or hint message.
|
|
200
|
+
*/
|
|
201
|
+
ariaDescribedBy?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Identifies the element(s) which will label the component.
|
|
204
|
+
*/
|
|
205
|
+
ariaLabelledBy?: string;
|
|
206
|
+
/**
|
|
207
|
+
* If set, the AutoComplete will use it to get the focused item index.
|
|
208
|
+
*
|
|
209
|
+
* Default functionality returns the first item which starts with the input text.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* ```jsx-no-run
|
|
213
|
+
* const focusedItemIndex = (data, inputText, textField) => {
|
|
214
|
+
* let text = inputText.toLowerCase();
|
|
215
|
+
* return data.findIndex(item =>
|
|
216
|
+
* String(textField ? item[textField] : item).toLowerCase().includes(text));
|
|
217
|
+
* };
|
|
218
|
+
*
|
|
219
|
+
* <AutoComplete focusedItemIndex={focusedItemIndex} />
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
focusedItemIndex?: (data: any, inputText: string, textField?: string) => number;
|
|
223
|
+
/**
|
|
224
|
+
* Fires each time the popup of the AutoComplete is about to open.
|
|
225
|
+
*/
|
|
226
|
+
onOpen?: (event: AutoCompleteOpenEvent) => void;
|
|
227
|
+
/**
|
|
228
|
+
* Fires each time the popup of the AutoComplete is about to close.
|
|
229
|
+
*/
|
|
230
|
+
onClose?: (event: AutoCompleteCloseEvent) => void;
|
|
231
|
+
/**
|
|
232
|
+
* Fires each time the user focuses the AutoComplete.
|
|
233
|
+
*/
|
|
234
|
+
onFocus?: (event: AutoCompleteFocusEvent) => void;
|
|
235
|
+
/**
|
|
236
|
+
* Fires each time the AutoComplete gets blurred.
|
|
237
|
+
*/
|
|
238
|
+
onBlur?: (event: AutoCompleteBlurEvent) => void;
|
|
239
|
+
/**
|
|
240
|
+
* Fires each time the value of the AutoComplete is about to change ([more information and example]({% slug binding_autocomplete %})).
|
|
241
|
+
*/
|
|
242
|
+
onChange?: (event: AutoCompleteChangeEvent) => void;
|
|
243
|
+
/**
|
|
244
|
+
* Fires when the AutoComplete input element is about to be rendered. Use it to override the default appearance of the component.
|
|
245
|
+
*/
|
|
246
|
+
valueRender?: (rendering: React.ReactElement<HTMLSpanElement>) => React.ReactNode;
|
|
247
|
+
/**
|
|
248
|
+
* Fires when an AutoComplete list item is about to be rendered ([see example]({% slug customrendering_autocomplete %}#toc-items)). Used to override the default appearance of the list items.
|
|
249
|
+
*/
|
|
250
|
+
itemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React.ReactNode;
|
|
251
|
+
/**
|
|
252
|
+
* Fires when the element which indicates no data in the popup is about to be rendered ([see example]({% slug customrendering_autocomplete %}#toc-no-data)). Used to override the default appearance of the element.
|
|
253
|
+
*/
|
|
254
|
+
listNoDataRender?: (element: React.ReactElement<HTMLDivElement>) => React.ReactNode;
|
|
255
|
+
/**
|
|
256
|
+
* Sets the header component of the AutoComplete ([see example]({% slug customrendering_autocomplete %}#toc-headers-and-footers)).
|
|
257
|
+
*/
|
|
258
|
+
header?: React.ReactNode;
|
|
259
|
+
/**
|
|
260
|
+
* Sets the footer component of the AutoComplete ([see example]({% slug customrendering_autocomplete %}#toc-headers-and-footers)).
|
|
261
|
+
*/
|
|
262
|
+
footer?: React.ReactNode;
|
|
263
|
+
/**
|
|
264
|
+
* Configures the `size` of the AutoComplete.
|
|
265
|
+
*
|
|
266
|
+
* The available options are:
|
|
267
|
+
* - small
|
|
268
|
+
* - medium
|
|
269
|
+
* - large
|
|
270
|
+
* - null—Does not set a size `className`.
|
|
271
|
+
*
|
|
272
|
+
* @default `medium`
|
|
273
|
+
*/
|
|
274
|
+
size?: null | 'small' | 'medium' | 'large';
|
|
275
|
+
/**
|
|
276
|
+
* Configures the `roundness` of the AutoComplete.
|
|
277
|
+
*
|
|
278
|
+
* The available options are:
|
|
279
|
+
* - small
|
|
280
|
+
* - medium
|
|
281
|
+
* - large
|
|
282
|
+
* - full
|
|
283
|
+
* - null—Does not set a rounded `className`.
|
|
284
|
+
*
|
|
285
|
+
* @default `medium`
|
|
286
|
+
*/
|
|
287
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
288
|
+
/**
|
|
289
|
+
* Configures the `fillMode` of the AutoComplete.
|
|
290
|
+
*
|
|
291
|
+
* The available options are:
|
|
292
|
+
* - solid
|
|
293
|
+
* - flat
|
|
294
|
+
* - outline
|
|
295
|
+
* - null—Does not set a fillMode `className`.
|
|
296
|
+
*
|
|
297
|
+
* @default `solid`
|
|
298
|
+
*/
|
|
299
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
300
|
+
/**
|
|
301
|
+
* Sets the data item field that represents the start of a group. Applicable to objects data.
|
|
302
|
+
*/
|
|
303
|
+
groupField?: string;
|
|
304
|
+
/**
|
|
305
|
+
* Fires when a AutoComplete group header item is about to be rendered. Used to override the default appearance of the group's headers.
|
|
306
|
+
*/
|
|
307
|
+
groupHeaderItemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListGroupItemProps) => React.ReactNode;
|
|
308
|
+
/**
|
|
309
|
+
* Fires when a AutoComplete sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component.
|
|
310
|
+
*/
|
|
311
|
+
groupStickyHeaderItemRender?: (div: React.ReactElement<HTMLDivElement>, stickyHeaderProps: GroupStickyHeaderProps) => React.ReactNode;
|
|
312
|
+
/**
|
|
313
|
+
* @hidden
|
|
314
|
+
*/
|
|
315
|
+
list?: any;
|
|
316
|
+
/**
|
|
317
|
+
* Sets the key for comparing the data items of the AutoComplete. If `dataItemKey` is not set, the AutoComplete compares the items by reference.
|
|
318
|
+
*/
|
|
319
|
+
dataItemKey?: string;
|
|
320
|
+
/**
|
|
321
|
+
* Defines if AutoComplete's disabled items will be skipped or focused when navigating through the list of items using a keyboard. Defaults to `true`.
|
|
322
|
+
*/
|
|
323
|
+
skipDisabledItems?: boolean;
|
|
324
|
+
/**
|
|
325
|
+
* Sets a custom prefix to the AutoComplete component.
|
|
326
|
+
*/
|
|
327
|
+
prefix?: CustomComponent<any>;
|
|
328
|
+
/**
|
|
329
|
+
* Sets a custom suffix to the AutoComplete component.
|
|
330
|
+
*/
|
|
331
|
+
suffix?: CustomComponent<any>;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Represents the PropsContext of the `AutoComplete` component.
|
|
336
|
+
* Used for global configuration of all `AutoComplete` instances.
|
|
337
|
+
*
|
|
338
|
+
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
339
|
+
*/
|
|
340
|
+
export declare const AutoCompletePropsContext: React_2.Context<(p: AutoCompleteProps) => AutoCompleteProps>;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* @hidden
|
|
344
|
+
*/
|
|
345
|
+
declare interface AutoCompleteState extends DropDownStateBase {
|
|
346
|
+
focusedItem?: any;
|
|
347
|
+
value?: string;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/** @hidden */
|
|
351
|
+
export declare class AutoCompleteWithoutContext extends React_2.Component<AutoCompleteProps, AutoCompleteState> implements FormComponent {
|
|
352
|
+
static displayName: string;
|
|
353
|
+
/**
|
|
354
|
+
* @hidden
|
|
355
|
+
*/
|
|
356
|
+
static propTypes: {
|
|
357
|
+
size: PropTypes.Requireable<"small" | "large" | "medium" | null | undefined>;
|
|
358
|
+
rounded: PropTypes.Requireable<"small" | "large" | "medium" | "full" | null | undefined>;
|
|
359
|
+
fillMode: PropTypes.Requireable<"flat" | "solid" | "outline" | null | undefined>;
|
|
360
|
+
groupField: PropTypes.Requireable<string>;
|
|
361
|
+
suggest: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
362
|
+
placeholder: PropTypes.Requireable<string>;
|
|
363
|
+
value: PropTypes.Requireable<string>;
|
|
364
|
+
defaultValue: PropTypes.Requireable<string>;
|
|
365
|
+
validationMessage: PropTypes.Requireable<string>;
|
|
366
|
+
required: PropTypes.Requireable<boolean>;
|
|
367
|
+
readonly: PropTypes.Requireable<boolean>;
|
|
368
|
+
clearButton: PropTypes.Requireable<boolean>;
|
|
369
|
+
valueRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
370
|
+
id: PropTypes.Requireable<string>;
|
|
371
|
+
ariaLabelledBy: PropTypes.Requireable<string>;
|
|
372
|
+
ariaDescribedBy: PropTypes.Requireable<string>;
|
|
373
|
+
list: PropTypes.Requireable<any>;
|
|
374
|
+
skipDisabledItems: PropTypes.Requireable<boolean>;
|
|
375
|
+
opened: PropTypes.Requireable<boolean>;
|
|
376
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
377
|
+
dir: PropTypes.Requireable<string>;
|
|
378
|
+
tabIndex: PropTypes.Requireable<number>;
|
|
379
|
+
accessKey: PropTypes.Requireable<string>;
|
|
380
|
+
data: PropTypes.Requireable<any[]>;
|
|
381
|
+
textField: PropTypes.Requireable<string>;
|
|
382
|
+
className: PropTypes.Requireable<string>;
|
|
383
|
+
label: PropTypes.Requireable<string>;
|
|
384
|
+
loading: PropTypes.Requireable<boolean>;
|
|
385
|
+
popupSettings: PropTypes.Requireable<PropTypes.InferProps<{
|
|
386
|
+
animate: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
387
|
+
openDuration: PropTypes.Requireable<number>;
|
|
388
|
+
closeDuration: PropTypes.Requireable<number>;
|
|
389
|
+
}> | null | undefined>>;
|
|
390
|
+
popupClass: PropTypes.Requireable<string>;
|
|
391
|
+
className: PropTypes.Requireable<string>;
|
|
392
|
+
appendTo: PropTypes.Requireable<any>;
|
|
393
|
+
width: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
394
|
+
height: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
395
|
+
}>>;
|
|
396
|
+
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
397
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
398
|
+
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
399
|
+
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
400
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
401
|
+
itemRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
402
|
+
listNoDataRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
403
|
+
focusedItemIndex: PropTypes.Requireable<(...args: any[]) => any>;
|
|
404
|
+
header: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
405
|
+
footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* @hidden
|
|
409
|
+
*/
|
|
410
|
+
static defaultProps: {
|
|
411
|
+
size: "small" | "large" | "medium" | null | undefined;
|
|
412
|
+
rounded: "small" | "large" | "medium" | "full" | null | undefined;
|
|
413
|
+
fillMode: "flat" | "solid" | "outline" | null | undefined;
|
|
414
|
+
skipDisabledItems: boolean;
|
|
415
|
+
prefix: undefined;
|
|
416
|
+
suffix: undefined;
|
|
417
|
+
popupSettings: {
|
|
418
|
+
height: string;
|
|
419
|
+
};
|
|
420
|
+
required: boolean;
|
|
421
|
+
validityStyles: boolean;
|
|
422
|
+
};
|
|
423
|
+
/**
|
|
424
|
+
* @hidden
|
|
425
|
+
*/
|
|
426
|
+
readonly state: AutoCompleteState;
|
|
427
|
+
protected readonly base: DropDownBase;
|
|
428
|
+
private _element;
|
|
429
|
+
private get _inputId();
|
|
430
|
+
private _suggested;
|
|
431
|
+
private _input;
|
|
432
|
+
private _valueDuringOnChange?;
|
|
433
|
+
private _isScrolling;
|
|
434
|
+
private itemHeight;
|
|
435
|
+
constructor(props: AutoCompleteProps);
|
|
436
|
+
/**
|
|
437
|
+
* @hidden
|
|
438
|
+
*/
|
|
439
|
+
focus: () => void;
|
|
440
|
+
/**
|
|
441
|
+
* @hidden
|
|
442
|
+
*/
|
|
443
|
+
get element(): HTMLSpanElement | null;
|
|
444
|
+
/**
|
|
445
|
+
* The value of the AutoComplete.
|
|
446
|
+
*/
|
|
447
|
+
get value(): string;
|
|
448
|
+
/**
|
|
449
|
+
* Gets the `name` property of the AutoComplete.
|
|
450
|
+
*/
|
|
451
|
+
get name(): string | undefined;
|
|
452
|
+
/**
|
|
453
|
+
* Represents the validity state into which the AutoComplete is set.
|
|
454
|
+
*/
|
|
455
|
+
get validity(): FormComponentValidity;
|
|
456
|
+
/**
|
|
457
|
+
* @hidden
|
|
458
|
+
*/
|
|
459
|
+
protected get validityStyles(): boolean;
|
|
460
|
+
/**
|
|
461
|
+
* @hidden
|
|
462
|
+
*/
|
|
463
|
+
protected get required(): boolean;
|
|
464
|
+
/**
|
|
465
|
+
* @hidden
|
|
466
|
+
*/
|
|
467
|
+
componentDidUpdate(prevProps: AutoCompleteProps, prevState: AutoCompleteState): void;
|
|
468
|
+
/**
|
|
469
|
+
* @hidden
|
|
470
|
+
*/
|
|
471
|
+
componentDidMount(): void;
|
|
472
|
+
/**
|
|
473
|
+
* @hidden
|
|
474
|
+
*/
|
|
475
|
+
render(): JSX_2.Element;
|
|
476
|
+
/**
|
|
477
|
+
* @hidden
|
|
478
|
+
*/
|
|
479
|
+
handleItemSelect: (index: number, state: AutoCompleteInternalState) => void;
|
|
480
|
+
/**
|
|
481
|
+
* @hidden
|
|
482
|
+
*/
|
|
483
|
+
itemFocus: (index: number, state: AutoCompleteInternalState) => void;
|
|
484
|
+
/**
|
|
485
|
+
* @hidden
|
|
486
|
+
*/
|
|
487
|
+
togglePopup: (state: InternalState) => void;
|
|
488
|
+
/**
|
|
489
|
+
* @hidden
|
|
490
|
+
*/
|
|
491
|
+
onNavigate(state: AutoCompleteInternalState, keyCode: number, skipItems?: number): void;
|
|
492
|
+
/**
|
|
493
|
+
* @hidden
|
|
494
|
+
*/
|
|
495
|
+
applyInputValue(value: string, state: AutoCompleteInternalState, eventKey?: number): void;
|
|
496
|
+
private setValidity;
|
|
497
|
+
private renderSearchBar;
|
|
498
|
+
private renderListContainer;
|
|
499
|
+
private renderList;
|
|
500
|
+
private onScroll;
|
|
501
|
+
private handleItemClick;
|
|
502
|
+
private onChangeHandler;
|
|
503
|
+
private clearButtonClick;
|
|
504
|
+
private onInputKeyDown;
|
|
505
|
+
private handleBlur;
|
|
506
|
+
private triggerOnChange;
|
|
507
|
+
private applyState;
|
|
508
|
+
private suggestValue;
|
|
509
|
+
private focusedIndex;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* @hidden
|
|
514
|
+
*/
|
|
515
|
+
declare interface BlurEvent<T> extends DropdownEvent<T> {
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* @hidden
|
|
520
|
+
*/
|
|
521
|
+
declare interface CancelEvent<T> extends DropdownEvent<T> {
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* @hidden
|
|
526
|
+
*/
|
|
527
|
+
declare interface ChangeEvent<T> extends DropdownEvent<T> {
|
|
528
|
+
/**
|
|
529
|
+
* The current value of the component.
|
|
530
|
+
*/
|
|
531
|
+
value: any;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* @hidden
|
|
536
|
+
*/
|
|
537
|
+
declare interface CloseEvent_2<T> extends DropdownEvent<T> {
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/** @hidden */
|
|
541
|
+
export declare type ComboBox = ComboBoxHandle;
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Represents the [KendoReact ComboBox component]({% slug overview_combobox %}).
|
|
545
|
+
*
|
|
546
|
+
* Accepts properties of type [ComboBoxProps]({% slug api_dropdowns_comboboxprops %}).
|
|
547
|
+
* Obtaining the `ref` returns an object of type [ComboBoxHandle]({% slug api_dropdowns_comboboxhandle %}).
|
|
548
|
+
*
|
|
549
|
+
* @example
|
|
550
|
+
* ```jsx
|
|
551
|
+
* class App extends React.Component {
|
|
552
|
+
* combobox = null;
|
|
553
|
+
* render() {
|
|
554
|
+
* return (
|
|
555
|
+
* <div>
|
|
556
|
+
* <ComboBox
|
|
557
|
+
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
558
|
+
* ref={component => this.combobox = component}
|
|
559
|
+
* />
|
|
560
|
+
* <button onClick={() => alert(this.combobox.value)}>alert value</button>
|
|
561
|
+
* </div>
|
|
562
|
+
* );
|
|
563
|
+
* }
|
|
564
|
+
* }
|
|
565
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
566
|
+
* ```
|
|
567
|
+
*/
|
|
568
|
+
export declare const ComboBox: React_2.ForwardRefExoticComponent<ComboBoxProps & React_2.RefAttributes<any>>;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Represents the object of the `blur` ComboBox event.
|
|
572
|
+
*/
|
|
573
|
+
export declare interface ComboBoxBlurEvent extends BlurEvent<ComboBox> {
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Represents the object of the `change` ComboBox event.
|
|
578
|
+
*/
|
|
579
|
+
export declare interface ComboBoxChangeEvent extends ChangeEvent<ComboBox> {
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Represents the object of the `close` ComboBox event.
|
|
584
|
+
*/
|
|
585
|
+
export declare interface ComboBoxCloseEvent extends CloseEvent_2<ComboBox> {
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Represents the object of the `FilterChange` ComboBox event.
|
|
590
|
+
*/
|
|
591
|
+
export declare interface ComboBoxFilterChangeEvent extends FilterChangeEvent<ComboBox> {
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Represents the object of the `focus` ComboBox event.
|
|
596
|
+
*/
|
|
597
|
+
export declare interface ComboBoxFocusEvent extends FocusEvent_2<ComboBox> {
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Represent the `ref` of the ComboBox component.
|
|
602
|
+
*/
|
|
603
|
+
export declare interface ComboBoxHandle extends Pick<ComboBoxWithoutContext, keyof ComboBoxWithoutContext> {
|
|
604
|
+
/**
|
|
605
|
+
* The index of the selected item.
|
|
606
|
+
*/
|
|
607
|
+
index: number;
|
|
608
|
+
/**
|
|
609
|
+
* Gets the `name` property of the ComboBox.
|
|
610
|
+
*/
|
|
611
|
+
name: string | undefined;
|
|
612
|
+
/**
|
|
613
|
+
* Represents the validity state into which the component is set.
|
|
614
|
+
*/
|
|
615
|
+
validity: FormComponentValidity;
|
|
616
|
+
/**
|
|
617
|
+
* The value of the ComboBox.
|
|
618
|
+
*/
|
|
619
|
+
value: any;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Represents the object of the `open` ComboBox event.
|
|
624
|
+
*/
|
|
625
|
+
export declare interface ComboBoxOpenEvent extends OpenEvent<ComboBox> {
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Represents the object of the `PageChange` ComboBox event.
|
|
630
|
+
*/
|
|
631
|
+
export declare interface ComboBoxPageChangeEvent extends PageChangeEvent<ComboBox> {
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Represents the props of the [KendoReact ComboBox component]({% slug overview_combobox %}).
|
|
636
|
+
*/
|
|
637
|
+
export declare interface ComboBoxProps extends FormComponentProps {
|
|
638
|
+
/**
|
|
639
|
+
* Sets the data of the ComboBox ([more information and examples]({% slug binding_combobox %})).
|
|
640
|
+
*/
|
|
641
|
+
data?: any[];
|
|
642
|
+
/**
|
|
643
|
+
* Sets the opened and closed state of the ComboBox.
|
|
644
|
+
*/
|
|
645
|
+
opened?: boolean;
|
|
646
|
+
/**
|
|
647
|
+
* The styles that are applied to the ComboBox.
|
|
648
|
+
*/
|
|
649
|
+
style?: React.CSSProperties;
|
|
650
|
+
/**
|
|
651
|
+
* Sets the value of the ComboBox ([more information and examples]({% slug binding_combobox %})). It can either be of the primitive (string, numbers) or of the complex (objects) type.
|
|
652
|
+
*/
|
|
653
|
+
value?: any;
|
|
654
|
+
/**
|
|
655
|
+
* Sets the default value of the ComboBox. Similar to the native `select` HTML element.
|
|
656
|
+
*/
|
|
657
|
+
defaultValue?: any;
|
|
658
|
+
/**
|
|
659
|
+
* Sets additional classes to the ComboBox.
|
|
660
|
+
*/
|
|
661
|
+
className?: string;
|
|
662
|
+
/**
|
|
663
|
+
* Sets CSS classes to the expand `icon` DOM element.
|
|
664
|
+
*/
|
|
665
|
+
iconClassName?: string;
|
|
666
|
+
/**
|
|
667
|
+
* Sets the specified SVG icon.
|
|
668
|
+
*/
|
|
669
|
+
svgIcon?: SVGIcon;
|
|
670
|
+
/**
|
|
671
|
+
* If `clearButton` is set to `true`, the ComboBox renders a button on hovering over the component. Clicking this button resets the value of the ComboBox to `undefined` and triggers the `change` event.
|
|
672
|
+
*/
|
|
673
|
+
clearButton?: boolean;
|
|
674
|
+
/**
|
|
675
|
+
* The hint that is displayed when the ComboBox is empty.
|
|
676
|
+
*/
|
|
677
|
+
placeholder?: string;
|
|
678
|
+
/**
|
|
679
|
+
* Sets the title attribute to the underlying input element of the ComboBox.
|
|
680
|
+
*/
|
|
681
|
+
title?: string;
|
|
682
|
+
/**
|
|
683
|
+
* Enables the auto-completion of the text based on the first data item ([see example]({% slug suggestions_combobox %})).
|
|
684
|
+
*/
|
|
685
|
+
suggest?: boolean;
|
|
686
|
+
/**
|
|
687
|
+
* Specifies whether the ComboBox allows user-defined values that are not present in the dataset ([see example]({% slug custom_values_combobox %})). Defaults to `false`.
|
|
688
|
+
*/
|
|
689
|
+
allowCustom?: boolean;
|
|
690
|
+
/**
|
|
691
|
+
* Sets the disabled state of the ComboBox.
|
|
692
|
+
*/
|
|
693
|
+
disabled?: boolean;
|
|
694
|
+
/**
|
|
695
|
+
* Represents the `dir` HTML attribute.
|
|
696
|
+
*/
|
|
697
|
+
dir?: string;
|
|
698
|
+
/**
|
|
699
|
+
* Enables the filtering functionality of the ComboBox ([more information and examples]({% slug filtering_combobox %})).
|
|
700
|
+
*/
|
|
701
|
+
filterable?: boolean;
|
|
702
|
+
/**
|
|
703
|
+
* Sets the value of ComboBox input. Useful for making the ComboBox input a [controlled component](https://reactjs.org/docs/forms.html#controlled-components).
|
|
704
|
+
*/
|
|
705
|
+
filter?: string | null;
|
|
706
|
+
/**
|
|
707
|
+
* Sets the value of the adaptive filtering input of the of ComboBox.
|
|
708
|
+
*/
|
|
709
|
+
adaptiveFilter?: string;
|
|
710
|
+
/**
|
|
711
|
+
* Sets the loading state of the ComboBox ([see example]({% slug filtering_combobox %}#toc-basic-configuration)).
|
|
712
|
+
*/
|
|
713
|
+
loading?: boolean;
|
|
714
|
+
/**
|
|
715
|
+
* Specifies the `tabIndex` of the ComboBox.
|
|
716
|
+
*/
|
|
717
|
+
tabIndex?: number;
|
|
718
|
+
/**
|
|
719
|
+
* Specifies the `accessKey` of the ComboBox.
|
|
720
|
+
*/
|
|
721
|
+
accessKey?: string;
|
|
722
|
+
/**
|
|
723
|
+
* Sets the data item field that represents the item text. If the data contains only primitive values, do not define it.
|
|
724
|
+
*/
|
|
725
|
+
textField?: string;
|
|
726
|
+
/**
|
|
727
|
+
* Sets the data item field that represents the start of a group. Applicable to objects data.
|
|
728
|
+
*/
|
|
729
|
+
groupField?: string;
|
|
730
|
+
/**
|
|
731
|
+
* Defines the `classic` or `modern` type of the grouping's visualization. Defaults to `modern`.
|
|
732
|
+
*/
|
|
733
|
+
groupMode?: string;
|
|
734
|
+
/**
|
|
735
|
+
* @hidden Used to indicate if the ComboBox is with multiple columns
|
|
736
|
+
*/
|
|
737
|
+
isMultiColumn?: boolean;
|
|
738
|
+
/**
|
|
739
|
+
* Sets the key for comparing the data items of the ComboBox. If `dataItemKey` is not set, the ComboBox compares the items by reference ([see example]({% slug binding_combobox %}#toc-datasets-of-objects)).
|
|
740
|
+
*/
|
|
741
|
+
dataItemKey?: string;
|
|
742
|
+
/**
|
|
743
|
+
* Renders a floating label for the ComboBox.
|
|
744
|
+
*/
|
|
745
|
+
label?: string;
|
|
746
|
+
/**
|
|
747
|
+
* Configures the popup of the ComboBox.
|
|
748
|
+
*/
|
|
749
|
+
popupSettings?: DropDownsPopupSettings;
|
|
750
|
+
/**
|
|
751
|
+
* Configures the virtual scrolling of the ComboBox ([more information and examples]({% slug virtualization_combobox %})).
|
|
752
|
+
*/
|
|
753
|
+
virtual?: VirtualizationSettings;
|
|
754
|
+
/**
|
|
755
|
+
* Specifies the id of the component.
|
|
756
|
+
*/
|
|
757
|
+
id?: string;
|
|
758
|
+
/**
|
|
759
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute).
|
|
760
|
+
* For example these elements could contain error or hint message.
|
|
761
|
+
*/
|
|
762
|
+
ariaDescribedBy?: string;
|
|
763
|
+
/**
|
|
764
|
+
* Identifies the element(s) which will label the component.
|
|
765
|
+
*/
|
|
766
|
+
ariaLabelledBy?: string;
|
|
767
|
+
/**
|
|
768
|
+
* If set, the ComboBox will use it to get the focused item index.
|
|
769
|
+
*
|
|
770
|
+
* Default functionality returns the first item which starts with the input text.
|
|
771
|
+
*
|
|
772
|
+
* @example
|
|
773
|
+
* ```jsx-no-run
|
|
774
|
+
* const focusedItemIndex = (data, inputText, textField) => {
|
|
775
|
+
* let text = inputText.toLowerCase();
|
|
776
|
+
* return data.findIndex(item =>
|
|
777
|
+
* String(textField ? item[textField] : item).toLowerCase().includes(text));
|
|
778
|
+
* };
|
|
779
|
+
*
|
|
780
|
+
* <ComboBox focusedItemIndex={focusedItemIndex} />
|
|
781
|
+
* ```
|
|
782
|
+
*/
|
|
783
|
+
focusedItemIndex?: (data: any, inputText: string, textField?: string) => number;
|
|
784
|
+
/**
|
|
785
|
+
* Fires each time the popup of the ComboBox is about to open.
|
|
786
|
+
*/
|
|
787
|
+
onOpen?: (event: ComboBoxOpenEvent) => void;
|
|
788
|
+
/**
|
|
789
|
+
* Fires each time the popup of the ComboBox is about to close.
|
|
790
|
+
*/
|
|
791
|
+
onClose?: (event: ComboBoxCloseEvent) => void;
|
|
792
|
+
/**
|
|
793
|
+
* Fires each time the user focuses the ComboBox.
|
|
794
|
+
*/
|
|
795
|
+
onFocus?: (event: ComboBoxFocusEvent) => void;
|
|
796
|
+
/**
|
|
797
|
+
* Fires each time the ComboBox gets blurred.
|
|
798
|
+
*/
|
|
799
|
+
onBlur?: (event: ComboBoxBlurEvent) => void;
|
|
800
|
+
/**
|
|
801
|
+
* Fires each time the value of the ComboBox is about to change ([see examples]({% slug binding_combobox %})).
|
|
802
|
+
*/
|
|
803
|
+
onChange?: (event: ComboBoxChangeEvent) => void;
|
|
804
|
+
/**
|
|
805
|
+
* Fires each time the user types in the filter input ([see examples]({% slug filtering_combobox %}#toc-basic-configuration)). You can filter the source based on the passed filtration value.
|
|
806
|
+
*/
|
|
807
|
+
onFilterChange?: (event: ComboBoxFilterChangeEvent) => void;
|
|
808
|
+
/**
|
|
809
|
+
* Fires when both the virtual scrolling of the ComboBox is enabled and the component requires data for another page ([more information and examples]({% slug virtualization_combobox %})).
|
|
810
|
+
*/
|
|
811
|
+
onPageChange?: (event: ComboBoxPageChangeEvent) => void;
|
|
812
|
+
/**
|
|
813
|
+
* Fires when the ComboBox input element is about to be rendered. Use it to override the default appearance of the component.
|
|
814
|
+
*/
|
|
815
|
+
valueRender?: (rendering: React.ReactElement<HTMLSpanElement>) => React.ReactNode;
|
|
816
|
+
/**
|
|
817
|
+
* Fires when a ComboBox list item is about to be rendered ([see example]({% slug customrendering_combobox %}#toc-items)). Used to override the default appearance of the list items.
|
|
818
|
+
*/
|
|
819
|
+
itemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React.ReactNode;
|
|
820
|
+
/**
|
|
821
|
+
* Fires when a ComboBox group header item is about to be rendered. Used to override the default appearance of the group's headers when the component is configured in `modern` group mode.
|
|
822
|
+
*/
|
|
823
|
+
groupHeaderItemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListGroupItemProps) => React.ReactNode;
|
|
824
|
+
/**
|
|
825
|
+
* Fires when a ComboBox sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component.
|
|
826
|
+
*/
|
|
827
|
+
groupStickyHeaderItemRender?: (div: React.ReactElement<HTMLDivElement>, stickyHeaderProps: GroupStickyHeaderProps) => React.ReactNode;
|
|
828
|
+
/**
|
|
829
|
+
* Fires when the element which indicates no data in the popup is about to be rendered. Used to override the default appearance of the element.
|
|
830
|
+
*/
|
|
831
|
+
listNoDataRender?: (element: React.ReactElement<HTMLDivElement>) => React.ReactNode;
|
|
832
|
+
/**
|
|
833
|
+
* @hidden
|
|
834
|
+
*/
|
|
835
|
+
onGroupScroll?: (event: {
|
|
836
|
+
group?: string;
|
|
837
|
+
}) => void;
|
|
838
|
+
/**
|
|
839
|
+
* Sets the header component of the ComboBox ([see example]({% slug customrendering_combobox %}#toc-headers-and-footers)).
|
|
840
|
+
*/
|
|
841
|
+
header?: React.ReactNode;
|
|
842
|
+
/**
|
|
843
|
+
* Sets the footer component of the ComboBox ([see example]({% slug customrendering_combobox %}#toc-headers-and-footers)).
|
|
844
|
+
*/
|
|
845
|
+
footer?: React.ReactNode;
|
|
846
|
+
/**
|
|
847
|
+
* @hidden
|
|
848
|
+
*/
|
|
849
|
+
footerClassName?: string;
|
|
850
|
+
/**
|
|
851
|
+
* @hidden
|
|
852
|
+
*/
|
|
853
|
+
list?: any;
|
|
854
|
+
/**
|
|
855
|
+
* Configures the `size` of the ComboBox.
|
|
856
|
+
*
|
|
857
|
+
* The available options are:
|
|
858
|
+
* - small
|
|
859
|
+
* - medium
|
|
860
|
+
* - large
|
|
861
|
+
* - null—Does not set a size `className`.
|
|
862
|
+
*
|
|
863
|
+
* @default `medium`
|
|
864
|
+
*/
|
|
865
|
+
size?: null | 'small' | 'medium' | 'large';
|
|
866
|
+
/**
|
|
867
|
+
* Configures the `roundness` of the ComboBox.
|
|
868
|
+
*
|
|
869
|
+
* The available options are:
|
|
870
|
+
* - small
|
|
871
|
+
* - medium
|
|
872
|
+
* - large
|
|
873
|
+
* - full
|
|
874
|
+
* - null—Does not set a rounded `className`.
|
|
875
|
+
*
|
|
876
|
+
* @default `medium`
|
|
877
|
+
*/
|
|
878
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
879
|
+
/**
|
|
880
|
+
* Configures the `fillMode` of the ComboBox.
|
|
881
|
+
*
|
|
882
|
+
* The available options are:
|
|
883
|
+
* - solid
|
|
884
|
+
* - flat
|
|
885
|
+
* - outline
|
|
886
|
+
* - null—Does not set a fillMode `className`.
|
|
887
|
+
*
|
|
888
|
+
* @default `solid`
|
|
889
|
+
*/
|
|
890
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
891
|
+
/**
|
|
892
|
+
* Providing different rendering of the popup element based on the screen dimensions.
|
|
893
|
+
*/
|
|
894
|
+
adaptive?: boolean;
|
|
895
|
+
/**
|
|
896
|
+
* Specifies the text that is rendered as title in the adaptive popup.
|
|
897
|
+
*/
|
|
898
|
+
adaptiveTitle?: string;
|
|
899
|
+
/**
|
|
900
|
+
* Defines if ComboBox's disabled items will be skipped or focused when navigating through the list of items using a keyboard. Defaults to `true`.
|
|
901
|
+
*/
|
|
902
|
+
skipDisabledItems?: boolean;
|
|
903
|
+
/**
|
|
904
|
+
* Sets a custom prefix to the ComboBox component.
|
|
905
|
+
*/
|
|
906
|
+
prefix?: CustomComponent<any>;
|
|
907
|
+
/**
|
|
908
|
+
* Sets a custom suffix to the ComboBox component.
|
|
909
|
+
*/
|
|
910
|
+
suffix?: CustomComponent<any>;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* Represents the PropsContext of the `ComboBox` component.
|
|
915
|
+
* Used for global configuration of all `ComboBox` instances.
|
|
916
|
+
*
|
|
917
|
+
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
918
|
+
*/
|
|
919
|
+
export declare const ComboBoxPropsContext: React_2.Context<(p: ComboBoxProps) => ComboBoxProps>;
|
|
920
|
+
|
|
921
|
+
/** @hidden */
|
|
922
|
+
declare interface ComboBoxState extends DropDownStateBase {
|
|
923
|
+
filterText?: string;
|
|
924
|
+
suggestedText?: string;
|
|
925
|
+
focusedItem?: any;
|
|
926
|
+
windowWidth?: number;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/** @hidden */
|
|
930
|
+
export declare class ComboBoxWithoutContext extends React_2.Component<ComboBoxProps, ComboBoxState> implements FormComponent {
|
|
931
|
+
static displayName: string;
|
|
932
|
+
/** @hidden */
|
|
933
|
+
static propTypes: {
|
|
934
|
+
size: PropTypes.Requireable<"small" | "large" | "medium" | null | undefined>;
|
|
935
|
+
rounded: PropTypes.Requireable<"small" | "large" | "medium" | "full" | null | undefined>;
|
|
936
|
+
fillMode: PropTypes.Requireable<"flat" | "solid" | "outline" | null | undefined>;
|
|
937
|
+
dataItemKey: PropTypes.Requireable<string>;
|
|
938
|
+
groupField: PropTypes.Requireable<string>;
|
|
939
|
+
groupMode: PropTypes.Requireable<string | undefined>;
|
|
940
|
+
isMultiColumn: PropTypes.Requireable<boolean>;
|
|
941
|
+
suggest: PropTypes.Requireable<boolean>;
|
|
942
|
+
placeholder: PropTypes.Requireable<string>;
|
|
943
|
+
title: PropTypes.Requireable<string>;
|
|
944
|
+
allowCustom: PropTypes.Requireable<boolean>;
|
|
945
|
+
clearButton: PropTypes.Requireable<boolean>;
|
|
946
|
+
iconClassName: PropTypes.Requireable<string>;
|
|
947
|
+
svgIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
948
|
+
name: PropTypes.Validator<string>;
|
|
949
|
+
content: PropTypes.Validator<string>;
|
|
950
|
+
viewBox: PropTypes.Validator<string>;
|
|
951
|
+
}>>;
|
|
952
|
+
validationMessage: PropTypes.Requireable<string>;
|
|
953
|
+
required: PropTypes.Requireable<boolean>;
|
|
954
|
+
id: PropTypes.Requireable<string>;
|
|
955
|
+
ariaLabelledBy: PropTypes.Requireable<string>;
|
|
956
|
+
ariaDescribedBy: PropTypes.Requireable<string>;
|
|
957
|
+
list: PropTypes.Requireable<any>;
|
|
958
|
+
valueRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
959
|
+
skipDisabledItems: PropTypes.Requireable<boolean>;
|
|
960
|
+
value: PropTypes.Requireable<any>;
|
|
961
|
+
defaultValue: PropTypes.Requireable<any>;
|
|
962
|
+
filterable: PropTypes.Requireable<boolean>;
|
|
963
|
+
filter: PropTypes.Requireable<string>;
|
|
964
|
+
virtual: PropTypes.Requireable<PropTypes.InferProps<{
|
|
965
|
+
pageSize: PropTypes.Validator<number>;
|
|
966
|
+
skip: PropTypes.Validator<number>;
|
|
967
|
+
total: PropTypes.Validator<number>;
|
|
968
|
+
}>>;
|
|
969
|
+
onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
970
|
+
onPageChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
971
|
+
opened: PropTypes.Requireable<boolean>;
|
|
972
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
973
|
+
dir: PropTypes.Requireable<string>;
|
|
974
|
+
tabIndex: PropTypes.Requireable<number>;
|
|
975
|
+
accessKey: PropTypes.Requireable<string>;
|
|
976
|
+
data: PropTypes.Requireable<any[]>;
|
|
977
|
+
textField: PropTypes.Requireable<string>;
|
|
978
|
+
className: PropTypes.Requireable<string>;
|
|
979
|
+
label: PropTypes.Requireable<string>;
|
|
980
|
+
loading: PropTypes.Requireable<boolean>;
|
|
981
|
+
popupSettings: PropTypes.Requireable<PropTypes.InferProps<{
|
|
982
|
+
animate: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
983
|
+
openDuration: PropTypes.Requireable<number>;
|
|
984
|
+
closeDuration: PropTypes.Requireable<number>;
|
|
985
|
+
}> | null | undefined>>;
|
|
986
|
+
popupClass: PropTypes.Requireable<string>;
|
|
987
|
+
className: PropTypes.Requireable<string>;
|
|
988
|
+
appendTo: PropTypes.Requireable<any>;
|
|
989
|
+
width: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
990
|
+
height: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
991
|
+
}>>;
|
|
992
|
+
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
993
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
994
|
+
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
995
|
+
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
996
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
997
|
+
itemRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
998
|
+
listNoDataRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
999
|
+
focusedItemIndex: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1000
|
+
header: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
1001
|
+
footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
1002
|
+
};
|
|
1003
|
+
/** @hidden */
|
|
1004
|
+
static defaultProps: {
|
|
1005
|
+
size: "small" | "large" | "medium" | null | undefined;
|
|
1006
|
+
rounded: "small" | "large" | "medium" | "full" | null | undefined;
|
|
1007
|
+
fillMode: "flat" | "solid" | "outline" | null | undefined;
|
|
1008
|
+
allowCustom: boolean;
|
|
1009
|
+
clearButton: boolean;
|
|
1010
|
+
required: boolean;
|
|
1011
|
+
groupMode: string | undefined;
|
|
1012
|
+
isMultiColumn: boolean;
|
|
1013
|
+
skipDisabledItems: boolean;
|
|
1014
|
+
prefix: undefined;
|
|
1015
|
+
suffix: undefined;
|
|
1016
|
+
popupSettings: {
|
|
1017
|
+
height: string;
|
|
1018
|
+
};
|
|
1019
|
+
validityStyles: boolean;
|
|
1020
|
+
};
|
|
1021
|
+
/** @hidden */
|
|
1022
|
+
readonly state: ComboBoxState;
|
|
1023
|
+
protected readonly base: DropDownBase;
|
|
1024
|
+
private _element;
|
|
1025
|
+
private get _inputId();
|
|
1026
|
+
private _valueDuringOnChange;
|
|
1027
|
+
private _valueOnDidUpdate;
|
|
1028
|
+
private _suggested;
|
|
1029
|
+
private _skipBlur;
|
|
1030
|
+
private _input;
|
|
1031
|
+
private _adaptiveFilterInput;
|
|
1032
|
+
private itemHeight;
|
|
1033
|
+
private observerResize?;
|
|
1034
|
+
private get document();
|
|
1035
|
+
constructor(props: ComboBoxProps);
|
|
1036
|
+
/** @hidden */
|
|
1037
|
+
focus: () => void;
|
|
1038
|
+
/** @hidden */
|
|
1039
|
+
get element(): HTMLSpanElement | null;
|
|
1040
|
+
/**
|
|
1041
|
+
* The mobile mode of the ComboBox.
|
|
1042
|
+
*/
|
|
1043
|
+
get mobileMode(): boolean;
|
|
1044
|
+
/**
|
|
1045
|
+
* The value of the ComboBox.
|
|
1046
|
+
*/
|
|
1047
|
+
get value(): any;
|
|
1048
|
+
/**
|
|
1049
|
+
* The index of the selected item.
|
|
1050
|
+
*/
|
|
1051
|
+
get index(): number;
|
|
1052
|
+
/**
|
|
1053
|
+
* Gets the `name` property of the ComboBox.
|
|
1054
|
+
*/
|
|
1055
|
+
get name(): string | undefined;
|
|
1056
|
+
/**
|
|
1057
|
+
* Represents the validity state into which the component is set.
|
|
1058
|
+
*/
|
|
1059
|
+
get validity(): FormComponentValidity;
|
|
1060
|
+
protected get validityStyles(): boolean;
|
|
1061
|
+
/** @hidden */
|
|
1062
|
+
protected get required(): boolean;
|
|
1063
|
+
/** @hidden */
|
|
1064
|
+
componentDidUpdate(prevProps: ComboBoxProps, prevState: ComboBoxState): void;
|
|
1065
|
+
/** @hidden */
|
|
1066
|
+
componentDidMount(): void;
|
|
1067
|
+
/** @hidden */
|
|
1068
|
+
componentWillUnmount(): void;
|
|
1069
|
+
/** @hidden */
|
|
1070
|
+
render(): JSX_2.Element;
|
|
1071
|
+
/** @hidden */
|
|
1072
|
+
handleItemSelect: (index: number, state: ComboInternalState) => void;
|
|
1073
|
+
/** @hidden */
|
|
1074
|
+
onNavigate(state: InternalState, keyCode: number, skipItems?: number): void;
|
|
1075
|
+
private onPopupOpened;
|
|
1076
|
+
private componentRef;
|
|
1077
|
+
private getCurrentValueDisabledStatus;
|
|
1078
|
+
private toggleBtnClick;
|
|
1079
|
+
private applyValueOnEnter;
|
|
1080
|
+
private applyValueOnRejectSuggestions;
|
|
1081
|
+
private selectFocusedItem;
|
|
1082
|
+
private renderAdaptiveListContainer;
|
|
1083
|
+
private renderMobileListFilter;
|
|
1084
|
+
private renderListContainer;
|
|
1085
|
+
private renderList;
|
|
1086
|
+
private handleMobileFilterChange;
|
|
1087
|
+
private renderSearchBar;
|
|
1088
|
+
private onScroll;
|
|
1089
|
+
private handleItemClick;
|
|
1090
|
+
private handleBlur;
|
|
1091
|
+
private onInputClick;
|
|
1092
|
+
private onInputKeyDown;
|
|
1093
|
+
private inputOnChange;
|
|
1094
|
+
private clearValue;
|
|
1095
|
+
private clearButtonClick;
|
|
1096
|
+
private clearValueOnEnterOrEsc;
|
|
1097
|
+
private clearValueOnBlur;
|
|
1098
|
+
private clearValueOnToggleBtnClick;
|
|
1099
|
+
private triggerOnChange;
|
|
1100
|
+
private getFocusedIndex;
|
|
1101
|
+
private suggestValue;
|
|
1102
|
+
private applyState;
|
|
1103
|
+
private setValidity;
|
|
1104
|
+
private calculateMedia;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
/** @hidden */
|
|
1108
|
+
declare interface ComboInternalState extends InternalState {
|
|
1109
|
+
data: ComboBoxState;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* @hidden
|
|
1114
|
+
*/
|
|
1115
|
+
declare class DropDownBase {
|
|
1116
|
+
static basicPropTypes: {
|
|
1117
|
+
opened: PropTypes.Requireable<boolean>;
|
|
1118
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
1119
|
+
dir: PropTypes.Requireable<string>;
|
|
1120
|
+
tabIndex: PropTypes.Requireable<number>;
|
|
1121
|
+
accessKey: PropTypes.Requireable<string>;
|
|
1122
|
+
data: PropTypes.Requireable<any[]>;
|
|
1123
|
+
textField: PropTypes.Requireable<string>;
|
|
1124
|
+
className: PropTypes.Requireable<string>;
|
|
1125
|
+
label: PropTypes.Requireable<string>;
|
|
1126
|
+
loading: PropTypes.Requireable<boolean>;
|
|
1127
|
+
popupSettings: PropTypes.Requireable<PropTypes.InferProps<{
|
|
1128
|
+
animate: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
1129
|
+
openDuration: PropTypes.Requireable<number>;
|
|
1130
|
+
closeDuration: PropTypes.Requireable<number>;
|
|
1131
|
+
}> | null | undefined>>;
|
|
1132
|
+
popupClass: PropTypes.Requireable<string>;
|
|
1133
|
+
className: PropTypes.Requireable<string>;
|
|
1134
|
+
appendTo: PropTypes.Requireable<any>;
|
|
1135
|
+
width: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
1136
|
+
height: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
1137
|
+
}>>;
|
|
1138
|
+
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1139
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1140
|
+
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1141
|
+
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1142
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1143
|
+
itemRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1144
|
+
listNoDataRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1145
|
+
focusedItemIndex: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1146
|
+
header: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
1147
|
+
footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
1148
|
+
};
|
|
1149
|
+
static propTypes: {
|
|
1150
|
+
value: PropTypes.Requireable<any>;
|
|
1151
|
+
defaultValue: PropTypes.Requireable<any>;
|
|
1152
|
+
filterable: PropTypes.Requireable<boolean>;
|
|
1153
|
+
filter: PropTypes.Requireable<string>;
|
|
1154
|
+
virtual: PropTypes.Requireable<PropTypes.InferProps<{
|
|
1155
|
+
pageSize: PropTypes.Validator<number>;
|
|
1156
|
+
skip: PropTypes.Validator<number>;
|
|
1157
|
+
total: PropTypes.Validator<number>;
|
|
1158
|
+
}>>;
|
|
1159
|
+
onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1160
|
+
onPageChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1161
|
+
opened: PropTypes.Requireable<boolean>;
|
|
1162
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
1163
|
+
dir: PropTypes.Requireable<string>;
|
|
1164
|
+
tabIndex: PropTypes.Requireable<number>;
|
|
1165
|
+
accessKey: PropTypes.Requireable<string>;
|
|
1166
|
+
data: PropTypes.Requireable<any[]>;
|
|
1167
|
+
textField: PropTypes.Requireable<string>;
|
|
1168
|
+
className: PropTypes.Requireable<string>;
|
|
1169
|
+
label: PropTypes.Requireable<string>;
|
|
1170
|
+
loading: PropTypes.Requireable<boolean>;
|
|
1171
|
+
popupSettings: PropTypes.Requireable<PropTypes.InferProps<{
|
|
1172
|
+
animate: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
1173
|
+
openDuration: PropTypes.Requireable<number>;
|
|
1174
|
+
closeDuration: PropTypes.Requireable<number>;
|
|
1175
|
+
}> | null | undefined>>;
|
|
1176
|
+
popupClass: PropTypes.Requireable<string>;
|
|
1177
|
+
className: PropTypes.Requireable<string>;
|
|
1178
|
+
appendTo: PropTypes.Requireable<any>;
|
|
1179
|
+
width: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
1180
|
+
height: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
1181
|
+
}>>;
|
|
1182
|
+
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1183
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1184
|
+
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1185
|
+
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1186
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1187
|
+
itemRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1188
|
+
listNoDataRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1189
|
+
focusedItemIndex: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1190
|
+
header: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
1191
|
+
footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
1192
|
+
};
|
|
1193
|
+
static defaultProps: {
|
|
1194
|
+
popupSettings: {
|
|
1195
|
+
height: string;
|
|
1196
|
+
};
|
|
1197
|
+
required: boolean;
|
|
1198
|
+
validityStyles: boolean;
|
|
1199
|
+
};
|
|
1200
|
+
popupWidth?: string;
|
|
1201
|
+
wrapper: HTMLSpanElement | null;
|
|
1202
|
+
list: HTMLUListElement | null;
|
|
1203
|
+
dirCalculated?: string;
|
|
1204
|
+
readonly vs: VirtualScroll;
|
|
1205
|
+
readonly navigation: Navigation;
|
|
1206
|
+
readonly listBoxId: string;
|
|
1207
|
+
readonly guid: string;
|
|
1208
|
+
readonly component: DropDownComponent;
|
|
1209
|
+
constructor(component: DropDownComponent);
|
|
1210
|
+
didMount(): void;
|
|
1211
|
+
calculateDir(): void;
|
|
1212
|
+
calculatePopupWidth(): void;
|
|
1213
|
+
scrollToItem(itemIndex: number, vsEnabled?: boolean, once?: boolean): void;
|
|
1214
|
+
handleItemClick: (index: number, event: React_2.MouseEvent<HTMLLIElement> | React_2.KeyboardEvent<HTMLInputElement>) => void;
|
|
1215
|
+
handleFocus: React_2.FocusEventHandler<HTMLSpanElement>;
|
|
1216
|
+
filterChanged: (text: string | null, state: InternalState) => void;
|
|
1217
|
+
initState(): InternalState;
|
|
1218
|
+
applyState(state: InternalState): void;
|
|
1219
|
+
togglePopup: (state: InternalState) => void;
|
|
1220
|
+
pageChange: (page: Page, syntheticEvent: React_2.SyntheticEvent<any>) => void;
|
|
1221
|
+
triggerOnPageChange(state: InternalState, skip: number, take: number): void;
|
|
1222
|
+
triggerPageChangeCornerItems(item: any, state: InternalState): void;
|
|
1223
|
+
scrollToVirtualItem: (virtual: VirtualizationSettings, selectedItemIndex: number) => void;
|
|
1224
|
+
/**
|
|
1225
|
+
* @hidden
|
|
1226
|
+
* Scrolls the data inside the popup of a selected DropDown by `one page`. The page size
|
|
1227
|
+
* depends on the height of the popup.
|
|
1228
|
+
*
|
|
1229
|
+
* @param {number} direction Defines the direction(Up/Down) in which the page will be moved
|
|
1230
|
+
* @param {number} filterHeight Defines the heigh of the filter element that appears in the DropDownList and DropDownTree.
|
|
1231
|
+
* This property is added for handling the filtering scenarios of the mentioned components.
|
|
1232
|
+
*/
|
|
1233
|
+
scrollPopupByPageSize: (direction: number) => void;
|
|
1234
|
+
renderScrollElement: () => false | JSX_2.Element;
|
|
1235
|
+
getPopupSettings(): DropDownsPopupSettings;
|
|
1236
|
+
getGroupedDataModernMode(data: any[], groupField: string): any[];
|
|
1237
|
+
resetGroupStickyHeader: (groupName: string, that: any) => void;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* @hidden
|
|
1242
|
+
*/
|
|
1243
|
+
declare interface DropDownComponent {
|
|
1244
|
+
props: DropDownComponentProps;
|
|
1245
|
+
setState: Function;
|
|
1246
|
+
forceUpdate: Function;
|
|
1247
|
+
state: DropDownStateBase;
|
|
1248
|
+
element: HTMLSpanElement | null;
|
|
1249
|
+
handleItemSelect: Function;
|
|
1250
|
+
value: any;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* @hidden
|
|
1255
|
+
*/
|
|
1256
|
+
declare interface DropDownComponentProps {
|
|
1257
|
+
data?: any[];
|
|
1258
|
+
opened?: boolean;
|
|
1259
|
+
value?: any;
|
|
1260
|
+
disabled?: boolean;
|
|
1261
|
+
tabIndex?: number;
|
|
1262
|
+
dir?: string;
|
|
1263
|
+
defaultItem?: any;
|
|
1264
|
+
filterable?: boolean;
|
|
1265
|
+
filter?: string | null;
|
|
1266
|
+
textField?: string;
|
|
1267
|
+
dataItemKey?: string;
|
|
1268
|
+
popupSettings?: DropDownsPopupSettings;
|
|
1269
|
+
style?: React_2.CSSProperties;
|
|
1270
|
+
virtual?: VirtualizationSettings;
|
|
1271
|
+
onOpen?: (event: any) => void;
|
|
1272
|
+
onClose?: (event: any) => void;
|
|
1273
|
+
onFocus?: (event: any) => void;
|
|
1274
|
+
onBlur?: (event: any) => void;
|
|
1275
|
+
onChange?: (event: any) => void;
|
|
1276
|
+
onFilterChange?: (event: any) => void;
|
|
1277
|
+
onPageChange?: (event: any) => void;
|
|
1278
|
+
itemRender?: (li: React_2.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React_2.ReactNode;
|
|
1279
|
+
listNoDataRender?: (element: React_2.ReactElement<HTMLDivElement>) => React_2.ReactNode;
|
|
1280
|
+
header?: React_2.ReactNode;
|
|
1281
|
+
footer?: React_2.ReactNode;
|
|
1282
|
+
id?: string;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
/**
|
|
1286
|
+
* @hidden
|
|
1287
|
+
*/
|
|
1288
|
+
declare interface DropdownEvent<T> {
|
|
1289
|
+
/**
|
|
1290
|
+
* A native DOM event.
|
|
1291
|
+
*/
|
|
1292
|
+
nativeEvent: Event;
|
|
1293
|
+
/**
|
|
1294
|
+
* A React [`SyntheticEvent`](https://reactjs.org/docs/events.html).
|
|
1295
|
+
*/
|
|
1296
|
+
syntheticEvent: React.SyntheticEvent<HTMLElement>;
|
|
1297
|
+
/**
|
|
1298
|
+
* An event target.
|
|
1299
|
+
*/
|
|
1300
|
+
target: T;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
/** @hidden */
|
|
1304
|
+
export declare type DropDownList = DropDownListHandle;
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* Represents the [KendoReact DropDownList component]({% slug overview_dropdownlist %}).
|
|
1308
|
+
*
|
|
1309
|
+
* Accepts properties of type [DropDownListProps]({% slug api_dropdowns_dropdownlistprops %}).
|
|
1310
|
+
* Obtaining the `ref` returns an object of type [DropDownListHandle]({% slug api_dropdowns_dropdownlisthandle %}).
|
|
1311
|
+
*
|
|
1312
|
+
* @example
|
|
1313
|
+
* ```jsx
|
|
1314
|
+
* class App extends React.Component {
|
|
1315
|
+
* dropdownlist = null;
|
|
1316
|
+
* render() {
|
|
1317
|
+
* return (
|
|
1318
|
+
* <div>
|
|
1319
|
+
* <DropDownList
|
|
1320
|
+
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
1321
|
+
* ref={component => this.dropdownlist = component}
|
|
1322
|
+
* />
|
|
1323
|
+
* <button onClick={() => alert(this.dropdownlist.value)}>alert value</button>
|
|
1324
|
+
* </div>
|
|
1325
|
+
* );
|
|
1326
|
+
* }
|
|
1327
|
+
* }
|
|
1328
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
1329
|
+
* ```
|
|
1330
|
+
*/
|
|
1331
|
+
export declare const DropDownList: React_2.ForwardRefExoticComponent<DropDownListProps & React_2.RefAttributes<any>>;
|
|
1332
|
+
|
|
1333
|
+
/**
|
|
1334
|
+
* Represents the object of the `blur` DropDownList event.
|
|
1335
|
+
*/
|
|
1336
|
+
export declare interface DropDownListBlurEvent extends BlurEvent<DropDownList> {
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
/**
|
|
1340
|
+
* Represents the object of the `change` DropDownList event.
|
|
1341
|
+
*/
|
|
1342
|
+
export declare interface DropDownListChangeEvent extends ChangeEvent<DropDownList> {
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* Represents the object of the `close` DropDownList event.
|
|
1347
|
+
*/
|
|
1348
|
+
export declare interface DropDownListCloseEvent extends CloseEvent_2<DropDownList> {
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* Represents the object of the `filterChange` DropDownList event.
|
|
1353
|
+
*/
|
|
1354
|
+
export declare interface DropDownListFilterChangeEvent extends FilterChangeEvent<DropDownList> {
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
/**
|
|
1358
|
+
* Represents the object of the `focus` DropDownList event.
|
|
1359
|
+
*/
|
|
1360
|
+
export declare interface DropDownListFocusEvent extends FocusEvent_2<DropDownList> {
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
/**
|
|
1364
|
+
* Represent the `ref` of the DropDownList component.
|
|
1365
|
+
*/
|
|
1366
|
+
export declare interface DropDownListHandle extends Pick<DropDownListWithoutContext, keyof DropDownListWithoutContext> {
|
|
1367
|
+
/**
|
|
1368
|
+
* The index of the selected item.
|
|
1369
|
+
*/
|
|
1370
|
+
index: number;
|
|
1371
|
+
/**
|
|
1372
|
+
* Gets the `name` property of the DropDownList.
|
|
1373
|
+
*/
|
|
1374
|
+
name: string | undefined;
|
|
1375
|
+
/**
|
|
1376
|
+
* Represents the validity state into which the DropDownList is set.
|
|
1377
|
+
*/
|
|
1378
|
+
validity: FormComponentValidity;
|
|
1379
|
+
/**
|
|
1380
|
+
* The value of the DropDownList.
|
|
1381
|
+
*/
|
|
1382
|
+
value: any;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
/**
|
|
1386
|
+
* Represents the object of the `open` DropDownList event.
|
|
1387
|
+
*/
|
|
1388
|
+
export declare interface DropDownListOpenEvent extends OpenEvent<DropDownList> {
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
/**
|
|
1392
|
+
* Represents the object of the `pageChange` DropDownList event.
|
|
1393
|
+
*/
|
|
1394
|
+
export declare interface DropDownListPageChangeEvent extends PageChangeEvent<DropDownList> {
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* Represents the props of the [KendoReact DropDownList component]({% slug overview_dropdownlist %}).
|
|
1399
|
+
*/
|
|
1400
|
+
export declare interface DropDownListProps extends FormComponentProps {
|
|
1401
|
+
/**
|
|
1402
|
+
* Sets the data of the DropDownList ([see example]({% slug binding_dropdownlist %})).
|
|
1403
|
+
*/
|
|
1404
|
+
data?: any[];
|
|
1405
|
+
/**
|
|
1406
|
+
* Sets the text of the default empty item. The type of the defined value has to match the data type.
|
|
1407
|
+
*/
|
|
1408
|
+
defaultItem?: any;
|
|
1409
|
+
/**
|
|
1410
|
+
* Sets the delay before an item search is performed. When filtration is disabled, use this option.
|
|
1411
|
+
*/
|
|
1412
|
+
delay?: number;
|
|
1413
|
+
/**
|
|
1414
|
+
* Enables a case-insensitive search. When filtering is disabled, use this option.
|
|
1415
|
+
*/
|
|
1416
|
+
ignoreCase?: boolean;
|
|
1417
|
+
/**
|
|
1418
|
+
* Sets the opened and closed state of the DropDownList.
|
|
1419
|
+
*/
|
|
1420
|
+
opened?: boolean;
|
|
1421
|
+
/**
|
|
1422
|
+
* The styles that are applied to the DropDownList.
|
|
1423
|
+
*/
|
|
1424
|
+
style?: React.CSSProperties;
|
|
1425
|
+
/**
|
|
1426
|
+
* Sets the value of the DropDownList ([see example]({% slug binding_dropdownlist %})). It can either be of the primitive (string, numbers) or of the complex (objects) type.
|
|
1427
|
+
*/
|
|
1428
|
+
value?: any;
|
|
1429
|
+
/**
|
|
1430
|
+
* Sets the default value of the DropDownList ([see example]({% slug defaultitem_dropdownlist %})). Similar to the native `select` HTML element.
|
|
1431
|
+
*/
|
|
1432
|
+
defaultValue?: any;
|
|
1433
|
+
/**
|
|
1434
|
+
* Sets additional classes to the DropDownList.
|
|
1435
|
+
*/
|
|
1436
|
+
className?: string;
|
|
1437
|
+
/**
|
|
1438
|
+
* Sets CSS classes to the expand `icon` DOM element.
|
|
1439
|
+
*/
|
|
1440
|
+
iconClassName?: string;
|
|
1441
|
+
/**
|
|
1442
|
+
* Sets the specified SVG icon.
|
|
1443
|
+
*/
|
|
1444
|
+
svgIcon?: SVGIcon;
|
|
1445
|
+
/**
|
|
1446
|
+
* Sets the title attribute to the DropDownList DOM element.
|
|
1447
|
+
*/
|
|
1448
|
+
title?: string;
|
|
1449
|
+
/**
|
|
1450
|
+
* Sets the disabled state of the DropDownList.
|
|
1451
|
+
*/
|
|
1452
|
+
disabled?: boolean;
|
|
1453
|
+
/**
|
|
1454
|
+
* Represents the `dir` HTML attribute.
|
|
1455
|
+
*/
|
|
1456
|
+
dir?: string;
|
|
1457
|
+
/**
|
|
1458
|
+
* Enables the filtering functionality of the DropDownList ([more information and examples]({% slug filtering_dropdownlist %})).
|
|
1459
|
+
*/
|
|
1460
|
+
filterable?: boolean;
|
|
1461
|
+
/**
|
|
1462
|
+
* Sets the value of filtering input. Useful for making the filtering input a [controlled component](https://reactjs.org/docs/forms.html#controlled-components).
|
|
1463
|
+
*/
|
|
1464
|
+
filter?: string;
|
|
1465
|
+
/**
|
|
1466
|
+
* Sets the loading state of the DropDownList.
|
|
1467
|
+
*/
|
|
1468
|
+
loading?: boolean;
|
|
1469
|
+
/**
|
|
1470
|
+
* Specifies the `tabIndex` of the DropDownList.
|
|
1471
|
+
*/
|
|
1472
|
+
tabIndex?: number;
|
|
1473
|
+
/**
|
|
1474
|
+
* Specifies the `accessKey` of the DropDownList.
|
|
1475
|
+
*/
|
|
1476
|
+
accessKey?: string;
|
|
1477
|
+
/**
|
|
1478
|
+
* Sets the data item field that represents the item text ([see example]({% slug defaultitem_dropdownlist %})). If the data contains only primitive values, do not define it.
|
|
1479
|
+
*/
|
|
1480
|
+
textField?: string;
|
|
1481
|
+
/**
|
|
1482
|
+
* Sets the key for comparing the data items of the DropDownList. If `dataItemKey` is not set, the DropDownList compares the items by reference ([see example]({% slug binding_dropdownlist %}#toc-datasets-of-objects)).
|
|
1483
|
+
*/
|
|
1484
|
+
dataItemKey?: string;
|
|
1485
|
+
/**
|
|
1486
|
+
* Represents a callback function, which returns the value for submitting. The returned value will be rendered in an `option` of a hidden [`select`](https://reactjs.org/docs/forms.html#the-select-tag) element.
|
|
1487
|
+
*
|
|
1488
|
+
* @example
|
|
1489
|
+
* ```jsx-no-run
|
|
1490
|
+
* class App extends React.Component {
|
|
1491
|
+
* render() {
|
|
1492
|
+
* return (
|
|
1493
|
+
* <form>
|
|
1494
|
+
* <DropDownList
|
|
1495
|
+
* data={[ { text: "Austria", id: 1 } , { text: "Belarus", id: 2 } ]}
|
|
1496
|
+
* valueMap={value => value && value.id}
|
|
1497
|
+
* />
|
|
1498
|
+
* <button type="submit">Submit</button>
|
|
1499
|
+
* </form>
|
|
1500
|
+
* );
|
|
1501
|
+
* }
|
|
1502
|
+
* }
|
|
1503
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
1504
|
+
* ```
|
|
1505
|
+
*/
|
|
1506
|
+
valueMap?: (value: any) => any;
|
|
1507
|
+
/**
|
|
1508
|
+
* Renders a floating label for the DropDownList.
|
|
1509
|
+
*/
|
|
1510
|
+
label?: string;
|
|
1511
|
+
/**
|
|
1512
|
+
* Specifies the id of the component.
|
|
1513
|
+
*/
|
|
1514
|
+
id?: string;
|
|
1515
|
+
/**
|
|
1516
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute).
|
|
1517
|
+
* For example these elements could contain error or hint message.
|
|
1518
|
+
*/
|
|
1519
|
+
ariaDescribedBy?: string;
|
|
1520
|
+
/**
|
|
1521
|
+
* Identifies the element(s) which will label the component.
|
|
1522
|
+
*/
|
|
1523
|
+
ariaLabelledBy?: string;
|
|
1524
|
+
/**
|
|
1525
|
+
* The accessible label of the component. By default is set to value of `label` prop.
|
|
1526
|
+
*/
|
|
1527
|
+
ariaLabel?: string;
|
|
1528
|
+
/**
|
|
1529
|
+
* Configures the popup of the DropDownList.
|
|
1530
|
+
*/
|
|
1531
|
+
popupSettings?: DropDownsPopupSettings;
|
|
1532
|
+
/**
|
|
1533
|
+
* Configures the virtual scrolling of the DropDownList ([see example]({% slug virtualization_dropdownlist %})).
|
|
1534
|
+
*/
|
|
1535
|
+
virtual?: VirtualizationSettings;
|
|
1536
|
+
/**
|
|
1537
|
+
* If set, the DropDownList will use it to get the focused item index.
|
|
1538
|
+
*
|
|
1539
|
+
* Default functionality returns the first item which starts with the input text.
|
|
1540
|
+
*
|
|
1541
|
+
* @example
|
|
1542
|
+
* ```jsx-no-run
|
|
1543
|
+
* const focusedItemIndex = (data, inputText, textField) => {
|
|
1544
|
+
* let text = inputText.toLowerCase();
|
|
1545
|
+
* return data.findIndex(item =>
|
|
1546
|
+
* String(textField ? item[textField] : item).toLowerCase().includes(text));
|
|
1547
|
+
* };
|
|
1548
|
+
*
|
|
1549
|
+
* <DropDownList focusedItemIndex={focusedItemIndex} />
|
|
1550
|
+
* ```
|
|
1551
|
+
*/
|
|
1552
|
+
focusedItemIndex?: (data: any, inputText: string, textField?: string) => number;
|
|
1553
|
+
/**
|
|
1554
|
+
* Fires each time the popup of the DropDownList is about to open.
|
|
1555
|
+
*/
|
|
1556
|
+
onOpen?: (event: DropDownListOpenEvent) => void;
|
|
1557
|
+
/**
|
|
1558
|
+
* Fires each time the popup of the DropDownList is about to close.
|
|
1559
|
+
*/
|
|
1560
|
+
onClose?: (event: DropDownListCloseEvent) => void;
|
|
1561
|
+
/**
|
|
1562
|
+
* Fires each time the user focuses the DropDownList.
|
|
1563
|
+
*/
|
|
1564
|
+
onFocus?: (event: DropDownListFocusEvent) => void;
|
|
1565
|
+
/**
|
|
1566
|
+
* Fires each time the DropDownList gets blurred.
|
|
1567
|
+
*/
|
|
1568
|
+
onBlur?: (event: DropDownListBlurEvent) => void;
|
|
1569
|
+
/**
|
|
1570
|
+
* Fires each time the value of the DropDownList is about to change ([see examples]({% slug binding_dropdownlist %})).
|
|
1571
|
+
*/
|
|
1572
|
+
onChange?: (event: DropDownListChangeEvent) => void;
|
|
1573
|
+
/**
|
|
1574
|
+
* Fires each time the user types in the filter input. You can filter the source based on the passed filtration value.
|
|
1575
|
+
*/
|
|
1576
|
+
onFilterChange?: (event: DropDownListFilterChangeEvent) => void;
|
|
1577
|
+
/**
|
|
1578
|
+
* Fires when both the virtual scrolling of the DropDownList is enabled and the component requires data for another page ([see example]({% slug virtualization_dropdownlist %})).
|
|
1579
|
+
*/
|
|
1580
|
+
onPageChange?: (event: DropDownListPageChangeEvent) => void;
|
|
1581
|
+
/**
|
|
1582
|
+
* Fires when a DropDownList item is about to be rendered ([see example]({% slug customrendering_dropdownlist %}#toc-items)). Used to override the default appearance of the list items.
|
|
1583
|
+
*/
|
|
1584
|
+
itemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React.ReactNode;
|
|
1585
|
+
/**
|
|
1586
|
+
* Fires when the element which renders the value is about to be rendered ([see example]({% slug customrendering_dropdownlist %}#toc-values)). Used to override the default appearance of the element.
|
|
1587
|
+
*/
|
|
1588
|
+
valueRender?: (element: React.ReactElement<HTMLSpanElement>, value: any) => React.ReactNode;
|
|
1589
|
+
/**
|
|
1590
|
+
* Fires when the element which indicates no data in the popup is about to be rendered ([see example]({% slug customrendering_dropdownlist %}#toc-no-data)). Used to override the default appearance of the element.
|
|
1591
|
+
*/
|
|
1592
|
+
listNoDataRender?: (element: React.ReactElement<HTMLDivElement>) => React.ReactNode;
|
|
1593
|
+
/**
|
|
1594
|
+
* Sets the header component of the DropDownList ([see example]({% slug customrendering_dropdownlist %}#toc-headers-and-footers)).
|
|
1595
|
+
*/
|
|
1596
|
+
header?: React.ReactNode;
|
|
1597
|
+
/**
|
|
1598
|
+
* Sets the footer component of the DropDownList ([see example]({% slug customrendering_dropdownlist %}#toc-headers-and-footers)).
|
|
1599
|
+
*/
|
|
1600
|
+
footer?: React.ReactNode;
|
|
1601
|
+
/**
|
|
1602
|
+
* Specifies the `name` property of the `select` DOM element.
|
|
1603
|
+
*/
|
|
1604
|
+
name?: string;
|
|
1605
|
+
/**
|
|
1606
|
+
* If set to `false`, the DropDownList will not navigate over its data through left and right keys.
|
|
1607
|
+
* Useful when the DropDownList is placed inside a toolbar which needs to handle left and right keys.
|
|
1608
|
+
*/
|
|
1609
|
+
leftRightKeysNavigation?: boolean;
|
|
1610
|
+
/**
|
|
1611
|
+
* Configures the `size` of the DropDownList.
|
|
1612
|
+
*
|
|
1613
|
+
* The available options are:
|
|
1614
|
+
* - small
|
|
1615
|
+
* - medium
|
|
1616
|
+
* - large
|
|
1617
|
+
* - null—Does not set a size `className`.
|
|
1618
|
+
*
|
|
1619
|
+
* @default `medium`
|
|
1620
|
+
*/
|
|
1621
|
+
size?: null | 'small' | 'medium' | 'large';
|
|
1622
|
+
/**
|
|
1623
|
+
* Configures the `roundness` of the DropDownList.
|
|
1624
|
+
*
|
|
1625
|
+
* The available options are:
|
|
1626
|
+
* - small
|
|
1627
|
+
* - medium
|
|
1628
|
+
* - large
|
|
1629
|
+
* - full
|
|
1630
|
+
* - null—Does not set a rounded `className`.
|
|
1631
|
+
*
|
|
1632
|
+
* @default `medium`
|
|
1633
|
+
*/
|
|
1634
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
1635
|
+
/**
|
|
1636
|
+
* Configures the `fillMode` of the DropDownList.
|
|
1637
|
+
*
|
|
1638
|
+
* The available options are:
|
|
1639
|
+
* - solid
|
|
1640
|
+
* - flat
|
|
1641
|
+
* - outline
|
|
1642
|
+
* - null—Does not set a fillMode `className`.
|
|
1643
|
+
*
|
|
1644
|
+
* @default `solid`
|
|
1645
|
+
*/
|
|
1646
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
1647
|
+
/**
|
|
1648
|
+
* Providing different rendering of the popup element based on the screen dimensions.
|
|
1649
|
+
*/
|
|
1650
|
+
adaptive?: boolean;
|
|
1651
|
+
/**
|
|
1652
|
+
* Specifies the text that is rendered as title in the adaptive popup.
|
|
1653
|
+
*/
|
|
1654
|
+
adaptiveTitle?: string;
|
|
1655
|
+
/**
|
|
1656
|
+
* Sets the data item field that represents the start of a group. Applicable to objects data.
|
|
1657
|
+
*/
|
|
1658
|
+
groupField?: string;
|
|
1659
|
+
/**
|
|
1660
|
+
* Fires when a DropDownList's group header item is about to be rendered. Used to override the default appearance of the group's headers.
|
|
1661
|
+
*/
|
|
1662
|
+
groupHeaderItemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListGroupItemProps) => React.ReactNode;
|
|
1663
|
+
/**
|
|
1664
|
+
* Fires when a DropDownList's sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component.
|
|
1665
|
+
*/
|
|
1666
|
+
groupStickyHeaderItemRender?: (div: React.ReactElement<HTMLDivElement>, stickyHeaderProps: GroupStickyHeaderProps) => React.ReactNode;
|
|
1667
|
+
/**
|
|
1668
|
+
* @hidden
|
|
1669
|
+
*/
|
|
1670
|
+
list?: any;
|
|
1671
|
+
/**
|
|
1672
|
+
* @hidden
|
|
1673
|
+
*/
|
|
1674
|
+
groupMode?: string;
|
|
1675
|
+
/**
|
|
1676
|
+
* Defines if DropDownList's disabled items will be skipped or focused when navigating through the list of items using a keyboard. Defaults to `true`.
|
|
1677
|
+
*/
|
|
1678
|
+
skipDisabledItems?: boolean;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
/**
|
|
1682
|
+
* Represents the PropsContext of the `DropDownList` component.
|
|
1683
|
+
* Used for global configuration of all `DropDownList` instances.
|
|
1684
|
+
*
|
|
1685
|
+
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
1686
|
+
*/
|
|
1687
|
+
export declare const DropDownListPropsContext: React_2.Context<(p: DropDownListProps) => DropDownListProps>;
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* @hidden
|
|
1691
|
+
*/
|
|
1692
|
+
declare interface DropDownListState extends DropDownStateBase {
|
|
1693
|
+
windowWidth?: number;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
/**
|
|
1697
|
+
* @hidden
|
|
1698
|
+
*/
|
|
1699
|
+
declare class DropDownListWithoutContext extends React_2.Component<DropDownListProps, DropDownListState> implements FormComponent {
|
|
1700
|
+
static displayName: string;
|
|
1701
|
+
/**
|
|
1702
|
+
* @hidden
|
|
1703
|
+
*/
|
|
1704
|
+
static propTypes: {
|
|
1705
|
+
value: PropTypes.Requireable<any>;
|
|
1706
|
+
defaultValue: PropTypes.Requireable<any>;
|
|
1707
|
+
filterable: PropTypes.Requireable<boolean>;
|
|
1708
|
+
filter: PropTypes.Requireable<string>;
|
|
1709
|
+
virtual: PropTypes.Requireable<PropTypes.InferProps<{
|
|
1710
|
+
pageSize: PropTypes.Validator<number>;
|
|
1711
|
+
skip: PropTypes.Validator<number>;
|
|
1712
|
+
total: PropTypes.Validator<number>;
|
|
1713
|
+
}>>;
|
|
1714
|
+
onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1715
|
+
onPageChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1716
|
+
opened: PropTypes.Requireable<boolean>;
|
|
1717
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
1718
|
+
dir: PropTypes.Requireable<string>;
|
|
1719
|
+
tabIndex: PropTypes.Requireable<number>;
|
|
1720
|
+
accessKey: PropTypes.Requireable<string>;
|
|
1721
|
+
data: PropTypes.Requireable<any[]>;
|
|
1722
|
+
textField: PropTypes.Requireable<string>;
|
|
1723
|
+
className: PropTypes.Requireable<string>;
|
|
1724
|
+
label: PropTypes.Requireable<string>;
|
|
1725
|
+
loading: PropTypes.Requireable<boolean>;
|
|
1726
|
+
popupSettings: PropTypes.Requireable<PropTypes.InferProps<{
|
|
1727
|
+
animate: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
1728
|
+
openDuration: PropTypes.Requireable<number>;
|
|
1729
|
+
closeDuration: PropTypes.Requireable<number>;
|
|
1730
|
+
}> | null | undefined>>;
|
|
1731
|
+
popupClass: PropTypes.Requireable<string>;
|
|
1732
|
+
className: PropTypes.Requireable<string>;
|
|
1733
|
+
appendTo: PropTypes.Requireable<any>;
|
|
1734
|
+
width: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
1735
|
+
height: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
1736
|
+
}>>;
|
|
1737
|
+
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1738
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1739
|
+
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1740
|
+
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1741
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1742
|
+
itemRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1743
|
+
listNoDataRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1744
|
+
focusedItemIndex: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1745
|
+
header: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
1746
|
+
footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
1747
|
+
delay: PropTypes.Requireable<number>;
|
|
1748
|
+
ignoreCase: PropTypes.Requireable<boolean>;
|
|
1749
|
+
iconClassName: PropTypes.Requireable<string>;
|
|
1750
|
+
svgIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
1751
|
+
name: PropTypes.Validator<string>;
|
|
1752
|
+
content: PropTypes.Validator<string>;
|
|
1753
|
+
viewBox: PropTypes.Validator<string>;
|
|
1754
|
+
}>>;
|
|
1755
|
+
defaultItem: PropTypes.Requireable<any>;
|
|
1756
|
+
valueRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1757
|
+
valueMap: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1758
|
+
validationMessage: PropTypes.Requireable<string>;
|
|
1759
|
+
required: PropTypes.Requireable<boolean>;
|
|
1760
|
+
id: PropTypes.Requireable<string>;
|
|
1761
|
+
ariaLabelledBy: PropTypes.Requireable<string>;
|
|
1762
|
+
ariaDescribedBy: PropTypes.Requireable<string>;
|
|
1763
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
1764
|
+
leftRightKeysNavigation: PropTypes.Requireable<boolean>;
|
|
1765
|
+
title: PropTypes.Requireable<string>;
|
|
1766
|
+
groupField: PropTypes.Requireable<string>;
|
|
1767
|
+
list: PropTypes.Requireable<any>;
|
|
1768
|
+
skipDisabledItems: PropTypes.Requireable<boolean>;
|
|
1769
|
+
};
|
|
1770
|
+
/**
|
|
1771
|
+
* @hidden
|
|
1772
|
+
*/
|
|
1773
|
+
static defaultProps: {
|
|
1774
|
+
required: boolean;
|
|
1775
|
+
size: "small" | "large" | "medium" | null | undefined;
|
|
1776
|
+
rounded: "small" | "large" | "medium" | "full" | null | undefined;
|
|
1777
|
+
fillMode: "flat" | "solid" | "outline" | null | undefined;
|
|
1778
|
+
groupMode: string | undefined;
|
|
1779
|
+
popupSettings: {
|
|
1780
|
+
height: string;
|
|
1781
|
+
};
|
|
1782
|
+
validityStyles: boolean;
|
|
1783
|
+
delay: number;
|
|
1784
|
+
tabIndex: number;
|
|
1785
|
+
ignoreCase: boolean;
|
|
1786
|
+
};
|
|
1787
|
+
/**
|
|
1788
|
+
* @hidden
|
|
1789
|
+
*/
|
|
1790
|
+
readonly state: DropDownListState;
|
|
1791
|
+
private _element;
|
|
1792
|
+
private _typingTimeout;
|
|
1793
|
+
protected readonly base: DropDownBase;
|
|
1794
|
+
private searchState;
|
|
1795
|
+
private _select;
|
|
1796
|
+
private _skipFocusEvent;
|
|
1797
|
+
private _filterInput;
|
|
1798
|
+
private _valueDuringOnChange;
|
|
1799
|
+
private _navigated;
|
|
1800
|
+
private _lastKeypressIsFilter;
|
|
1801
|
+
private get _inputId();
|
|
1802
|
+
private get _listboxId();
|
|
1803
|
+
private get _guid();
|
|
1804
|
+
private itemHeight;
|
|
1805
|
+
private observerResize?;
|
|
1806
|
+
private get document();
|
|
1807
|
+
constructor(props: DropDownListProps);
|
|
1808
|
+
/**
|
|
1809
|
+
* @hidden
|
|
1810
|
+
*/
|
|
1811
|
+
focus: () => void;
|
|
1812
|
+
/**
|
|
1813
|
+
* @hidden
|
|
1814
|
+
*/
|
|
1815
|
+
get element(): HTMLSpanElement | null;
|
|
1816
|
+
/**
|
|
1817
|
+
* The value of the DropDownList.
|
|
1818
|
+
*/
|
|
1819
|
+
get value(): any;
|
|
1820
|
+
/**
|
|
1821
|
+
* The index of the selected item.
|
|
1822
|
+
*/
|
|
1823
|
+
get index(): number;
|
|
1824
|
+
/**
|
|
1825
|
+
* Gets the `name` property of the DropDownList.
|
|
1826
|
+
*/
|
|
1827
|
+
get name(): string | undefined;
|
|
1828
|
+
/**
|
|
1829
|
+
* Represents the validity state into which the DropDownList is set.
|
|
1830
|
+
*/
|
|
1831
|
+
get validity(): FormComponentValidity;
|
|
1832
|
+
protected get validityStyles(): boolean;
|
|
1833
|
+
/**
|
|
1834
|
+
* @hidden
|
|
1835
|
+
*/
|
|
1836
|
+
protected get required(): boolean;
|
|
1837
|
+
/**
|
|
1838
|
+
* @hidden
|
|
1839
|
+
*/
|
|
1840
|
+
componentDidUpdate(prevProps: DropDownListProps, prevState: DropDownListState): void;
|
|
1841
|
+
/**
|
|
1842
|
+
* @hidden
|
|
1843
|
+
*/
|
|
1844
|
+
componentDidMount(): void;
|
|
1845
|
+
/** @hidden */
|
|
1846
|
+
componentWillUnmount(): void;
|
|
1847
|
+
/**
|
|
1848
|
+
* @hidden
|
|
1849
|
+
*/
|
|
1850
|
+
render(): JSX_2.Element;
|
|
1851
|
+
/**
|
|
1852
|
+
* @hidden
|
|
1853
|
+
*/
|
|
1854
|
+
handleItemSelect: (index: number, state: InternalState) => void;
|
|
1855
|
+
/**
|
|
1856
|
+
* @hidden
|
|
1857
|
+
*/
|
|
1858
|
+
onNavigate(state: InternalState, keyCode: number, skipItems?: number): void;
|
|
1859
|
+
private componentRef;
|
|
1860
|
+
private dummySelect;
|
|
1861
|
+
private renderAdaptiveListContainer;
|
|
1862
|
+
private renderListContainer;
|
|
1863
|
+
private renderList;
|
|
1864
|
+
private onScroll;
|
|
1865
|
+
private renderListFilter;
|
|
1866
|
+
private renderDefaultItem;
|
|
1867
|
+
private search;
|
|
1868
|
+
private selectNext;
|
|
1869
|
+
private handleKeyDown;
|
|
1870
|
+
private handleItemClick;
|
|
1871
|
+
private handleFocus;
|
|
1872
|
+
private handleBlur;
|
|
1873
|
+
private handleDefaultItemClick;
|
|
1874
|
+
private handleWrapperClick;
|
|
1875
|
+
private handleKeyPress;
|
|
1876
|
+
private handleListFilterChange;
|
|
1877
|
+
private onPopupOpened;
|
|
1878
|
+
private onPopupClosed;
|
|
1879
|
+
private getFocusedIndex;
|
|
1880
|
+
private focusElement;
|
|
1881
|
+
private setValidity;
|
|
1882
|
+
private triggerOnChange;
|
|
1883
|
+
private applyState;
|
|
1884
|
+
private calculateMedia;
|
|
1885
|
+
private resetValueIfDisabledItem;
|
|
1886
|
+
private haveFocusedItemAndDataNotEmpty;
|
|
1887
|
+
}
|
|
1888
|
+
export { DropDownListWithoutContext as DropDownListClassComponent }
|
|
1889
|
+
export { DropDownListWithoutContext }
|
|
1890
|
+
|
|
1891
|
+
/**
|
|
1892
|
+
* @hidden
|
|
1893
|
+
*/
|
|
1894
|
+
export declare const dropdownsMessages: {
|
|
1895
|
+
"dropdowns.clear": string;
|
|
1896
|
+
"dropdowns.nodata": string;
|
|
1897
|
+
"dropdowns.comboArrowBtnAriaLabelExpand": string;
|
|
1898
|
+
"dropdowns.comboArrowBtnAriaLabelCollapse": string;
|
|
1899
|
+
"dropdowns.dropDownListArrowBtnAriaLabel": string;
|
|
1900
|
+
"dropdowns.apply": string;
|
|
1901
|
+
"dropdowns.cancel": string;
|
|
1902
|
+
};
|
|
1903
|
+
|
|
1904
|
+
/**
|
|
1905
|
+
* The settings of the popup container.
|
|
1906
|
+
*/
|
|
1907
|
+
export declare interface DropDownsPopupSettings extends PopupProps {
|
|
1908
|
+
/**
|
|
1909
|
+
* Specifies a list of CSS classes that are used for styling the popup inner element.
|
|
1910
|
+
*/
|
|
1911
|
+
popupClass?: string;
|
|
1912
|
+
/**
|
|
1913
|
+
* Sets the width of the popup container. By default, the width of the host element is used.
|
|
1914
|
+
*/
|
|
1915
|
+
width?: string | number;
|
|
1916
|
+
/**
|
|
1917
|
+
* Sets the height of the DOM element inside the DropDowns' popup that contains the data items of each component. This height doesn't include the header and footer.
|
|
1918
|
+
*/
|
|
1919
|
+
height?: string | number;
|
|
1920
|
+
/**
|
|
1921
|
+
* Defines the container to which the Popup will be appended.
|
|
1922
|
+
* Defaults to [`body`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body).
|
|
1923
|
+
* * If set to `null` the Popup will be rendered without React Portal.
|
|
1924
|
+
*/
|
|
1925
|
+
appendTo?: HTMLElement | null;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
/**
|
|
1929
|
+
* @hidden
|
|
1930
|
+
*/
|
|
1931
|
+
declare interface DropDownStateBase {
|
|
1932
|
+
/**
|
|
1933
|
+
* Input element text of the Component.
|
|
1934
|
+
*/
|
|
1935
|
+
text?: string;
|
|
1936
|
+
value?: any;
|
|
1937
|
+
focused?: boolean;
|
|
1938
|
+
opened?: boolean;
|
|
1939
|
+
group?: string;
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
/**
|
|
1943
|
+
* Represents the DropDownTree component.
|
|
1944
|
+
*
|
|
1945
|
+
* Accepts properties of type [DropDownTreeProps]({% slug api_dropdowns_dropdowntreeprops %}).
|
|
1946
|
+
* Obtaining the `ref` returns an object of type [DropDownTreeHandle]({% slug api_dropdowns_dropdowntreehandle %}).
|
|
1947
|
+
*
|
|
1948
|
+
* @example
|
|
1949
|
+
* ```jsx
|
|
1950
|
+
* const selectField = "selected";
|
|
1951
|
+
* const expandField = "expanded";
|
|
1952
|
+
* const dataItemKey = "id";
|
|
1953
|
+
* const textField = "text";
|
|
1954
|
+
* const subItemsField = "items";
|
|
1955
|
+
* const fields = {
|
|
1956
|
+
* selectField,
|
|
1957
|
+
* expandField,
|
|
1958
|
+
* dataItemKey,
|
|
1959
|
+
* subItemsField,
|
|
1960
|
+
* };
|
|
1961
|
+
* const App = () => {
|
|
1962
|
+
* const [value, setValue] = React.useState(null);
|
|
1963
|
+
* const [expanded, setExpanded] = React.useState([data[0][dataItemKey]]);
|
|
1964
|
+
* const onChange = (event) => setValue(event.value);
|
|
1965
|
+
* const onExpandChange = React.useCallback(
|
|
1966
|
+
* (event) => setExpanded(expandedState(event.item, dataItemKey, expanded)),
|
|
1967
|
+
* [expanded]
|
|
1968
|
+
* );
|
|
1969
|
+
* const treeData = React.useMemo(
|
|
1970
|
+
* () =>
|
|
1971
|
+
* processTreeData(
|
|
1972
|
+
* data,
|
|
1973
|
+
* {
|
|
1974
|
+
* expanded,
|
|
1975
|
+
* value,
|
|
1976
|
+
* },
|
|
1977
|
+
* fields
|
|
1978
|
+
* ),
|
|
1979
|
+
* [expanded, value]
|
|
1980
|
+
* );
|
|
1981
|
+
*
|
|
1982
|
+
* return (
|
|
1983
|
+
* <DropDownTree
|
|
1984
|
+
* style={{
|
|
1985
|
+
* width: '300px',
|
|
1986
|
+
* }}
|
|
1987
|
+
* placeholder="Please select ..."
|
|
1988
|
+
* data={treeData}
|
|
1989
|
+
* value={value}
|
|
1990
|
+
* onChange={onChange}
|
|
1991
|
+
* textField={textField}
|
|
1992
|
+
* dataItemKey={dataItemKey}
|
|
1993
|
+
* selectField={selectField}
|
|
1994
|
+
* expandField={expandField}
|
|
1995
|
+
* onExpandChange={onExpandChange}
|
|
1996
|
+
* />
|
|
1997
|
+
* );
|
|
1998
|
+
* };
|
|
1999
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
2000
|
+
* ```
|
|
2001
|
+
*/
|
|
2002
|
+
export declare const DropDownTree: React_2.ForwardRefExoticComponent<DropDownTreeProps & React_2.RefAttributes<DropDownTreeHandle | null>>;
|
|
2003
|
+
|
|
2004
|
+
/**
|
|
2005
|
+
* Represents the object of the `onBlur` DropDownTree event.
|
|
2006
|
+
*/
|
|
2007
|
+
export declare interface DropDownTreeBlurEvent extends BlurEvent<DropDownTreeHandle> {
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
/**
|
|
2011
|
+
* Represents the object of the `onChange` DropDownTree event.
|
|
2012
|
+
*/
|
|
2013
|
+
export declare interface DropDownTreeChangeEvent extends ChangeEvent<DropDownTreeHandle> {
|
|
2014
|
+
level: number[];
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
/**
|
|
2018
|
+
* Represents the object of the `onClose` DropDownTree event.
|
|
2019
|
+
*/
|
|
2020
|
+
export declare interface DropDownTreeCloseEvent extends CloseEvent_2<DropDownTreeHandle> {
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
/**
|
|
2024
|
+
* Represents the object of the `onExpandChange` DropDownTree event.
|
|
2025
|
+
*/
|
|
2026
|
+
export declare interface DropDownTreeExpandEvent extends DropdownEvent<DropDownTreeHandle> {
|
|
2027
|
+
item: any;
|
|
2028
|
+
level: number[];
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
/**
|
|
2032
|
+
* Represents the object of the `onFilterChange` DropDownTree event.
|
|
2033
|
+
*/
|
|
2034
|
+
export declare interface DropDownTreeFilterChangeEvent extends FilterChangeEvent<DropDownTreeHandle> {
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
/**
|
|
2038
|
+
* Represents the object of the `onFocus` DropDownTree event.
|
|
2039
|
+
*/
|
|
2040
|
+
export declare interface DropDownTreeFocusEvent extends FocusEvent_2<DropDownTreeHandle> {
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
/**
|
|
2044
|
+
* Represents the Object which is passed to the
|
|
2045
|
+
* [`ref`](https://reactjs.org/docs/refs-and-the-dom.html) callback of the DropDownTree component.
|
|
2046
|
+
*/
|
|
2047
|
+
export declare interface DropDownTreeHandle {
|
|
2048
|
+
/**
|
|
2049
|
+
* The current element or `null` if there is no one.
|
|
2050
|
+
*/
|
|
2051
|
+
element: HTMLElement | null;
|
|
2052
|
+
/**
|
|
2053
|
+
* The props of the DropDownTree component.
|
|
2054
|
+
*/
|
|
2055
|
+
props: DropDownTreeProps;
|
|
2056
|
+
/**
|
|
2057
|
+
* The focus function.
|
|
2058
|
+
*/
|
|
2059
|
+
focus: () => void;
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
/**
|
|
2063
|
+
* Represents the object of the `onOpen` DropDownTree event.
|
|
2064
|
+
*/
|
|
2065
|
+
export declare interface DropDownTreeOpenEvent extends OpenEvent<DropDownTreeHandle> {
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
/**
|
|
2069
|
+
* Represents the props of the [KendoReact DropDownTree component]({% slug overview_dropdowntree %}).
|
|
2070
|
+
*/
|
|
2071
|
+
export declare interface DropDownTreeProps extends FormComponentProps {
|
|
2072
|
+
/**
|
|
2073
|
+
* Sets the data of the DropDownTree ([see example]({% slug overview_dropdowntree %})).
|
|
2074
|
+
*/
|
|
2075
|
+
data?: any[];
|
|
2076
|
+
/**
|
|
2077
|
+
* Sets the opened state of the DropDownTree.
|
|
2078
|
+
*/
|
|
2079
|
+
opened?: boolean;
|
|
2080
|
+
/**
|
|
2081
|
+
* The styles that are applied to the DropDownTree.
|
|
2082
|
+
*/
|
|
2083
|
+
style?: React.CSSProperties;
|
|
2084
|
+
/**
|
|
2085
|
+
* Sets the value of the DropDownTree ([see example]({% slug overview_dropdowntree %})).
|
|
2086
|
+
* It can be an object from the data-tree.
|
|
2087
|
+
*/
|
|
2088
|
+
value?: any;
|
|
2089
|
+
/**
|
|
2090
|
+
* The hint that is displayed when the DropDownTree is empty.
|
|
2091
|
+
*/
|
|
2092
|
+
placeholder?: string;
|
|
2093
|
+
/**
|
|
2094
|
+
* Sets the key for comparing the data items of the DropDownTree ([see example]({% slug overview_dropdowntree %})).
|
|
2095
|
+
* If `dataItemKey` is not set, the DropDownTree compares the items by reference.
|
|
2096
|
+
*/
|
|
2097
|
+
dataItemKey: string;
|
|
2098
|
+
/**
|
|
2099
|
+
* Sets additional classes to the DropDownTree.
|
|
2100
|
+
*/
|
|
2101
|
+
className?: string;
|
|
2102
|
+
/**
|
|
2103
|
+
* Sets the disabled state of the DropDownTree.
|
|
2104
|
+
*/
|
|
2105
|
+
disabled?: boolean;
|
|
2106
|
+
/**
|
|
2107
|
+
* Represents the `dir` HTML attribute.
|
|
2108
|
+
*/
|
|
2109
|
+
dir?: string;
|
|
2110
|
+
/**
|
|
2111
|
+
* Renders a floating label for the DropDownTree.
|
|
2112
|
+
*/
|
|
2113
|
+
label?: string;
|
|
2114
|
+
/**
|
|
2115
|
+
* Specifies the id of the component.
|
|
2116
|
+
*/
|
|
2117
|
+
id?: string;
|
|
2118
|
+
/**
|
|
2119
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute).
|
|
2120
|
+
* For example these elements could contain error or hint message.
|
|
2121
|
+
*/
|
|
2122
|
+
ariaDescribedBy?: string;
|
|
2123
|
+
/**
|
|
2124
|
+
* Identifies the element(s) which will label the component.
|
|
2125
|
+
*/
|
|
2126
|
+
ariaLabelledBy?: string;
|
|
2127
|
+
/**
|
|
2128
|
+
* Enables the filtering functionality of the DropDownTree ([more information and examples]({% slug filtering_dropdowntree %})).
|
|
2129
|
+
*/
|
|
2130
|
+
filterable?: boolean;
|
|
2131
|
+
/**
|
|
2132
|
+
* Sets the value of filtering input.
|
|
2133
|
+
* Useful for making the filtering input a [controlled component](https://reactjs.org/docs/forms.html#controlled-components).
|
|
2134
|
+
*/
|
|
2135
|
+
filter?: string;
|
|
2136
|
+
/**
|
|
2137
|
+
* Sets the loading state of the DropDownTree ([see example]({% slug filtering_dropdowntree %}#toc-visualize-filtering)).
|
|
2138
|
+
*/
|
|
2139
|
+
loading?: boolean;
|
|
2140
|
+
/**
|
|
2141
|
+
* Specifies the `tabIndex` of the DropDownTree.
|
|
2142
|
+
*/
|
|
2143
|
+
tabIndex?: number;
|
|
2144
|
+
/**
|
|
2145
|
+
* Specifies the `accessKey` of the DropDownTree.
|
|
2146
|
+
*/
|
|
2147
|
+
accessKey?: string;
|
|
2148
|
+
/**
|
|
2149
|
+
* Sets the data item field that represents the item text ([see example]({% slug overview_dropdowntree %})).
|
|
2150
|
+
*/
|
|
2151
|
+
textField: string;
|
|
2152
|
+
/**
|
|
2153
|
+
* Specifies the name of the field which will provide a Boolean representation of the selected state of the item.
|
|
2154
|
+
*/
|
|
2155
|
+
selectField?: string;
|
|
2156
|
+
/**
|
|
2157
|
+
* Specifies the name of the field which will provide a Boolean representation of the expanded state of the item.
|
|
2158
|
+
*/
|
|
2159
|
+
expandField?: string;
|
|
2160
|
+
/**
|
|
2161
|
+
* Specifies the name of the field which will provide an array representation of the item subitems.
|
|
2162
|
+
* Defaults to 'items'.
|
|
2163
|
+
*/
|
|
2164
|
+
subItemsField?: string;
|
|
2165
|
+
/**
|
|
2166
|
+
* Configures the popup of the DropDownTree.
|
|
2167
|
+
*/
|
|
2168
|
+
popupSettings?: DropDownsPopupSettings;
|
|
2169
|
+
/**
|
|
2170
|
+
* Represents a callback function, which returns the value for submitting. The returned value will be rendered in an `option` of a hidden [`select`](https://reactjs.org/docs/forms.html#the-select-tag) element.
|
|
2171
|
+
*
|
|
2172
|
+
* @example
|
|
2173
|
+
* ```jsx-no-run
|
|
2174
|
+
* class App extends React.Component {
|
|
2175
|
+
* render() {
|
|
2176
|
+
* return (
|
|
2177
|
+
* <form>
|
|
2178
|
+
* <DropDownTree
|
|
2179
|
+
* data={[ { text: "Austria", id: 1 } , { text: "Belarus", id: 2 } ]}
|
|
2180
|
+
* valueMap={value => value && value.id}
|
|
2181
|
+
* />
|
|
2182
|
+
* <button type="submit">Submit</button>
|
|
2183
|
+
* </form>
|
|
2184
|
+
* );
|
|
2185
|
+
* }
|
|
2186
|
+
* }
|
|
2187
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
2188
|
+
* ```
|
|
2189
|
+
*/
|
|
2190
|
+
valueMap?: (value: any) => any;
|
|
2191
|
+
/**
|
|
2192
|
+
* Fires each time the popup of the DropDownTree is about to open.
|
|
2193
|
+
*/
|
|
2194
|
+
onOpen?: (event: DropDownTreeOpenEvent) => void;
|
|
2195
|
+
/**
|
|
2196
|
+
* Fires each time the popup of the DropDownTree is about to close.
|
|
2197
|
+
*/
|
|
2198
|
+
onClose?: (event: DropDownTreeCloseEvent) => void;
|
|
2199
|
+
/**
|
|
2200
|
+
* Fires each time the user focuses the DropDownTree.
|
|
2201
|
+
*/
|
|
2202
|
+
onFocus?: (event: DropDownTreeFocusEvent) => void;
|
|
2203
|
+
/**
|
|
2204
|
+
* Fires each time the DropDownTree gets blurred.
|
|
2205
|
+
*/
|
|
2206
|
+
onBlur?: (event: DropDownTreeBlurEvent) => void;
|
|
2207
|
+
/**
|
|
2208
|
+
* Fires each time the value of the DropDownTree is about to change ([see examples]({% slug overview_dropdowntree %})).
|
|
2209
|
+
*/
|
|
2210
|
+
onChange?: (event: DropDownTreeChangeEvent) => void;
|
|
2211
|
+
/**
|
|
2212
|
+
* Fires each time the user types in the filter input
|
|
2213
|
+
* ([see example]({% slug filtering_dropdowntree %}#toc-basic-configuration)).
|
|
2214
|
+
* You can filter the source based on the passed filtration value.
|
|
2215
|
+
*/
|
|
2216
|
+
onFilterChange?: (event: DropDownTreeFilterChangeEvent) => void;
|
|
2217
|
+
/**
|
|
2218
|
+
* Fires when the expanding or collapsing of an item is requested ([see examples]({% slug overview_dropdowntree %})).
|
|
2219
|
+
*/
|
|
2220
|
+
onExpandChange?: (event: any) => void;
|
|
2221
|
+
/**
|
|
2222
|
+
* Defines the component that will be used for rendering each of the DropDownTree items
|
|
2223
|
+
* ([see example]({% slug customrendering_dropdowntree %}#toc-items-and-value-element)).
|
|
2224
|
+
*/
|
|
2225
|
+
item?: React.ComponentType<ItemProps>;
|
|
2226
|
+
/**
|
|
2227
|
+
* Defines the component that will be used for rendering the selected value
|
|
2228
|
+
* ([see example]({% slug customrendering_dropdowntree %}#toc-items-and-value-element)).
|
|
2229
|
+
*/
|
|
2230
|
+
valueHolder?: React.ComponentType<ValueHolderProps>;
|
|
2231
|
+
/**
|
|
2232
|
+
* Defines the component that will be rendered in the DropDownTree popup when no data is available
|
|
2233
|
+
* ([see example]({% slug customrendering_dropdowntree %}#toc-no-data)).
|
|
2234
|
+
*/
|
|
2235
|
+
listNoData?: React.ComponentType<ListNoDataProps>;
|
|
2236
|
+
/**
|
|
2237
|
+
* Configures the `size` of the DropDownTree.
|
|
2238
|
+
*
|
|
2239
|
+
* The available options are:
|
|
2240
|
+
* - small
|
|
2241
|
+
* - medium
|
|
2242
|
+
* - large
|
|
2243
|
+
* - null—Does not set a size `className`.
|
|
2244
|
+
*
|
|
2245
|
+
* @default `medium`
|
|
2246
|
+
*/
|
|
2247
|
+
size?: null | 'small' | 'medium' | 'large';
|
|
2248
|
+
/**
|
|
2249
|
+
* Configures the `roundness` of the DropDownTree.
|
|
2250
|
+
*
|
|
2251
|
+
* The available options are:
|
|
2252
|
+
* - small
|
|
2253
|
+
* - medium
|
|
2254
|
+
* - large
|
|
2255
|
+
* - full
|
|
2256
|
+
* - null—Does not set a rounded `className`.
|
|
2257
|
+
*
|
|
2258
|
+
* @default `medium`
|
|
2259
|
+
*/
|
|
2260
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
2261
|
+
/**
|
|
2262
|
+
* Configures the `fillMode` of the DropDownTree.
|
|
2263
|
+
*
|
|
2264
|
+
* The available options are:
|
|
2265
|
+
* - solid
|
|
2266
|
+
* - flat
|
|
2267
|
+
* - outline
|
|
2268
|
+
* - null—Does not set a fillMode `className`.
|
|
2269
|
+
*
|
|
2270
|
+
* @default `solid`
|
|
2271
|
+
*/
|
|
2272
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
2273
|
+
/**
|
|
2274
|
+
* Providing different rendering of the popup element based on the screen dimensions.
|
|
2275
|
+
*/
|
|
2276
|
+
adaptive?: boolean;
|
|
2277
|
+
/**
|
|
2278
|
+
* Specifies the text that is rendered as title in the adaptive popup.
|
|
2279
|
+
*/
|
|
2280
|
+
adaptiveTitle?: string;
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
/**
|
|
2284
|
+
* Represents the PropsContext of the `DropDownTree` component.
|
|
2285
|
+
* Used for global configuration of all `DropDownTree` instances.
|
|
2286
|
+
*
|
|
2287
|
+
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
2288
|
+
*/
|
|
2289
|
+
export declare const DropDownTreePropsContext: React_2.Context<(p: DropDownTreeProps) => DropDownTreeProps>;
|
|
2290
|
+
|
|
2291
|
+
/**
|
|
2292
|
+
* @hidden
|
|
2293
|
+
*/
|
|
2294
|
+
declare interface EventData {
|
|
2295
|
+
type?: string;
|
|
2296
|
+
filter?: FilterDescriptor;
|
|
2297
|
+
page?: Page;
|
|
2298
|
+
suggestion?: Suggestion;
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
/**
|
|
2302
|
+
* @hidden
|
|
2303
|
+
*/
|
|
2304
|
+
declare interface FilterChangeEvent<T> extends DropdownEvent<T> {
|
|
2305
|
+
/**
|
|
2306
|
+
* A React [`SyntheticEvent`](https://reactjs.org/docs/events.html).
|
|
2307
|
+
*/
|
|
2308
|
+
syntheticEvent: React.ChangeEvent<HTMLInputElement>;
|
|
2309
|
+
/**
|
|
2310
|
+
* The default `FilterDescriptor` object.
|
|
2311
|
+
*/
|
|
2312
|
+
filter: FilterDescriptor;
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
/**
|
|
2316
|
+
* A basic filter expression. Usually a part of [`CompositeFilterDescriptor`]({% slug api_kendo-data-query_compositefilterdescriptor %}).
|
|
2317
|
+
*
|
|
2318
|
+
* For more information, refer to the [`filterBy`]({% slug api_kendo-data-query_filterby %}) method.
|
|
2319
|
+
*/
|
|
2320
|
+
declare interface FilterDescriptor {
|
|
2321
|
+
/**
|
|
2322
|
+
* The field of the data item to which the filter operator is applied.
|
|
2323
|
+
*/
|
|
2324
|
+
field?: string | Function;
|
|
2325
|
+
/**
|
|
2326
|
+
* The filter operator (comparison).
|
|
2327
|
+
*
|
|
2328
|
+
* The supported operators are:
|
|
2329
|
+
* * `"eq"` (equal to)
|
|
2330
|
+
* * `"neq"` (not equal to)
|
|
2331
|
+
* * `"isnull"` (is equal to null)
|
|
2332
|
+
* * `"isnotnull"` (is not equal to null)
|
|
2333
|
+
* * `"lt"` (less than)
|
|
2334
|
+
* * `"lte"` (less than or equal to)
|
|
2335
|
+
* * `"gt"` (greater than)
|
|
2336
|
+
* * `"gte"` (greater than or equal to)
|
|
2337
|
+
*
|
|
2338
|
+
* The following operators are supported for string fields only:
|
|
2339
|
+
* * `"startswith"`
|
|
2340
|
+
* * `"endswith"`
|
|
2341
|
+
* * `"contains"`
|
|
2342
|
+
* * `"doesnotcontain"`
|
|
2343
|
+
* * `"isempty"`
|
|
2344
|
+
* * `"isnotempty"`
|
|
2345
|
+
*/
|
|
2346
|
+
operator: string | Function;
|
|
2347
|
+
/**
|
|
2348
|
+
* The value to which the field is compared. Has to be of the same type as the field.
|
|
2349
|
+
*/
|
|
2350
|
+
value?: any;
|
|
2351
|
+
/**
|
|
2352
|
+
* Determines if the string comparison is case-insensitive.
|
|
2353
|
+
*/
|
|
2354
|
+
ignoreCase?: boolean;
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
/**
|
|
2358
|
+
* Find item in the data by field and value.
|
|
2359
|
+
*/
|
|
2360
|
+
export declare const findByFieldValue: (data: any[], field: string, value: string | number | null) => any;
|
|
2361
|
+
|
|
2362
|
+
/**
|
|
2363
|
+
* @hidden
|
|
2364
|
+
*/
|
|
2365
|
+
declare interface FocusEvent_2<T> extends DropdownEvent<T> {
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
export { FormComponentValidity }
|
|
2369
|
+
|
|
2370
|
+
/**
|
|
2371
|
+
* Get the value of the item by its field.
|
|
2372
|
+
*/
|
|
2373
|
+
export declare const getItemValue: (item: any, field?: string) => any;
|
|
2374
|
+
|
|
2375
|
+
/**
|
|
2376
|
+
* Get MultiSelectTree new value from the component `onChange` event.
|
|
2377
|
+
*
|
|
2378
|
+
* @param {any[]} data
|
|
2379
|
+
* @param {object} options
|
|
2380
|
+
* @returns {any[]}
|
|
2381
|
+
*/
|
|
2382
|
+
export declare const getMultiSelectTreeValue: (data: any[], options: {
|
|
2383
|
+
subItemsField?: string;
|
|
2384
|
+
dataItemKey: string;
|
|
2385
|
+
items: any;
|
|
2386
|
+
value: Array<any>;
|
|
2387
|
+
operation: MultiSelectTreeChangeEventOperation;
|
|
2388
|
+
}) => any[];
|
|
2389
|
+
|
|
2390
|
+
/** @hidden */
|
|
2391
|
+
export declare const getValueMap: (value: any[], idGetter: any) => any;
|
|
2392
|
+
|
|
2393
|
+
/**
|
|
2394
|
+
* Represents the props of the GroupStickyHeader component.
|
|
2395
|
+
*/
|
|
2396
|
+
export declare interface GroupStickyHeaderProps {
|
|
2397
|
+
/**
|
|
2398
|
+
* The group that will be rendered.
|
|
2399
|
+
*/
|
|
2400
|
+
group?: string;
|
|
2401
|
+
/**
|
|
2402
|
+
* @hidden
|
|
2403
|
+
*/
|
|
2404
|
+
groupMode?: string;
|
|
2405
|
+
/**
|
|
2406
|
+
* Fires when a ComboBox sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component.
|
|
2407
|
+
*/
|
|
2408
|
+
render?: (div: React_2.ReactElement<HTMLDivElement>, itemProps: GroupStickyHeaderProps) => React_2.ReactNode;
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
/**
|
|
2412
|
+
* @hidden
|
|
2413
|
+
*/
|
|
2414
|
+
declare interface InternalState {
|
|
2415
|
+
data: DropDownStateBase;
|
|
2416
|
+
events: Array<EventData>;
|
|
2417
|
+
syntheticEvent: React.MouseEvent<HTMLElement> | React.FocusEvent<HTMLElement> | React.ChangeEvent<HTMLInputElement> | React.FormEvent<HTMLInputElement> | React.KeyboardEvent<HTMLElement> | undefined;
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
/**
|
|
2421
|
+
* The props of component that will be used for rendering each of the DropDownTree items
|
|
2422
|
+
* ([see example]({% slug customrendering_dropdowntree %}#toc-items-and-value-element)).
|
|
2423
|
+
*/
|
|
2424
|
+
export declare interface ItemProps extends ItemRenderProps {
|
|
2425
|
+
}
|
|
2426
|
+
|
|
2427
|
+
/**
|
|
2428
|
+
* @hidden
|
|
2429
|
+
*/
|
|
2430
|
+
export declare class List extends React_2.Component<ListProps> {
|
|
2431
|
+
renderItems(): (false | JSX_2.Element)[][];
|
|
2432
|
+
renderNoValueElement(localizationService: LocalizationService): string | number | boolean | Iterable<React_2.ReactNode> | JSX_2.Element | null | undefined;
|
|
2433
|
+
render(): string | number | boolean | Iterable<React_2.ReactNode> | JSX_2.Element | null | undefined;
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
/**
|
|
2437
|
+
* @hidden
|
|
2438
|
+
*/
|
|
2439
|
+
export declare class ListContainer extends React_2.Component<ListContainerProps, {}> {
|
|
2440
|
+
render(): JSX_2.Element;
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
/**
|
|
2444
|
+
* @hidden
|
|
2445
|
+
*/
|
|
2446
|
+
declare interface ListContainerProps {
|
|
2447
|
+
width?: string | number;
|
|
2448
|
+
dir?: string;
|
|
2449
|
+
popupSettings?: PopupProps;
|
|
2450
|
+
itemsCount?: number[];
|
|
2451
|
+
children?: React_2.ReactNode;
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
/**
|
|
2455
|
+
* @hidden
|
|
2456
|
+
*/
|
|
2457
|
+
export declare const ListFilter: React_2.ForwardRefExoticComponent<ListFilterProps & React_2.RefAttributes<TextBoxHandle | null>>;
|
|
2458
|
+
|
|
2459
|
+
/**
|
|
2460
|
+
* @hidden
|
|
2461
|
+
*/
|
|
2462
|
+
declare interface ListFilterProps {
|
|
2463
|
+
value?: string | number | readonly string[] | undefined;
|
|
2464
|
+
tabIndex?: number;
|
|
2465
|
+
onChange?: (event: TextBoxChangeEvent) => void;
|
|
2466
|
+
onKeyDown?: React_2.KeyboardEventHandler<HTMLInputElement>;
|
|
2467
|
+
size?: null | 'small' | 'medium' | 'large';
|
|
2468
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
2469
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2472
|
+
/**
|
|
2473
|
+
* Represents the props of the ListGroupItem component.
|
|
2474
|
+
*/
|
|
2475
|
+
export declare interface ListGroupItemProps {
|
|
2476
|
+
/**
|
|
2477
|
+
* Specifies the id that will be added to the group header item element.
|
|
2478
|
+
*/
|
|
2479
|
+
id?: string;
|
|
2480
|
+
/**
|
|
2481
|
+
* The group that will be rendered.
|
|
2482
|
+
*/
|
|
2483
|
+
group?: string;
|
|
2484
|
+
/**
|
|
2485
|
+
* @hidden
|
|
2486
|
+
*/
|
|
2487
|
+
virtual?: boolean;
|
|
2488
|
+
/**
|
|
2489
|
+
* @hidden
|
|
2490
|
+
* Provides information if the rendered list is a multicolumn popup
|
|
2491
|
+
*/
|
|
2492
|
+
isMultiColumn?: boolean;
|
|
2493
|
+
/**
|
|
2494
|
+
* Fires when the group header item is about to be rendered. Used to override the default appearance of the group header item.
|
|
2495
|
+
*/
|
|
2496
|
+
render?: (li: React_2.ReactElement<HTMLLIElement>, itemProps: ListGroupItemProps) => React_2.ReactNode;
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
/**
|
|
2500
|
+
* @hidden
|
|
2501
|
+
*/
|
|
2502
|
+
export declare class ListItem extends React_2.Component<ListItemProps, {}> {
|
|
2503
|
+
handleClick: React_2.MouseEventHandler<HTMLLIElement>;
|
|
2504
|
+
render(): string | number | boolean | Iterable<React_2.ReactNode> | JSX_2.Element | null | undefined;
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
/**
|
|
2508
|
+
* Represents the props of the ListItem component.
|
|
2509
|
+
*/
|
|
2510
|
+
export declare interface ListItemProps {
|
|
2511
|
+
/**
|
|
2512
|
+
* Specifies the id that will be added to the list item element.
|
|
2513
|
+
*/
|
|
2514
|
+
id?: string;
|
|
2515
|
+
/**
|
|
2516
|
+
* Represents the index of the list item element.
|
|
2517
|
+
*/
|
|
2518
|
+
index: number;
|
|
2519
|
+
/**
|
|
2520
|
+
* Represents the data item of the list item element.
|
|
2521
|
+
*/
|
|
2522
|
+
dataItem: any;
|
|
2523
|
+
/**
|
|
2524
|
+
* Represents the `classic` or `modern` grouping mode of the DropDowns. Defaults to `classic`.
|
|
2525
|
+
*/
|
|
2526
|
+
groupMode: any;
|
|
2527
|
+
/**
|
|
2528
|
+
* Sets the data item field that represents the item text. If the data contains only primitive values, do not define it.
|
|
2529
|
+
*/
|
|
2530
|
+
textField?: string;
|
|
2531
|
+
/**
|
|
2532
|
+
* The group that will be rendered.
|
|
2533
|
+
*/
|
|
2534
|
+
group?: string;
|
|
2535
|
+
/**
|
|
2536
|
+
* Indicates the focused state of the list item element.
|
|
2537
|
+
*/
|
|
2538
|
+
focused: boolean;
|
|
2539
|
+
/**
|
|
2540
|
+
* Indicates the selected state of the list item element.
|
|
2541
|
+
*/
|
|
2542
|
+
selected: boolean;
|
|
2543
|
+
/**
|
|
2544
|
+
* Indicates the disabled/enabled state of the list item element.
|
|
2545
|
+
*/
|
|
2546
|
+
disabled?: boolean;
|
|
2547
|
+
/**
|
|
2548
|
+
* @hidden
|
|
2549
|
+
*/
|
|
2550
|
+
virtual?: boolean;
|
|
2551
|
+
/**
|
|
2552
|
+
* Fires when the list item is about to be rendered. Used to override the default appearance of the list item.
|
|
2553
|
+
*/
|
|
2554
|
+
render?: (li: React_2.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React_2.ReactNode;
|
|
2555
|
+
/**
|
|
2556
|
+
* The `onClick` event handler of the list item element.
|
|
2557
|
+
*/
|
|
2558
|
+
onClick: (index: number, event: React_2.MouseEvent<HTMLLIElement>) => void;
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2561
|
+
/**
|
|
2562
|
+
* The props of the `ListNoData` component ([see example]({% slug customrendering_dropdowntree %}#toc-no-data)).
|
|
2563
|
+
*/
|
|
2564
|
+
export declare interface ListNoDataProps {
|
|
2565
|
+
children?: React.ReactNode;
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
/**
|
|
2569
|
+
* @hidden
|
|
2570
|
+
*/
|
|
2571
|
+
declare interface ListProps {
|
|
2572
|
+
id?: string;
|
|
2573
|
+
virtual?: boolean;
|
|
2574
|
+
show?: boolean;
|
|
2575
|
+
data: any[];
|
|
2576
|
+
value?: any;
|
|
2577
|
+
textField?: string;
|
|
2578
|
+
valueField?: string;
|
|
2579
|
+
groupField?: string;
|
|
2580
|
+
groupMode?: string;
|
|
2581
|
+
isMultiColumn?: boolean;
|
|
2582
|
+
optionsGuid?: string;
|
|
2583
|
+
listRef?: React_2.Ref<HTMLUListElement>;
|
|
2584
|
+
wrapperRef?: React_2.Ref<HTMLDivElement>;
|
|
2585
|
+
wrapperCssClass?: string;
|
|
2586
|
+
wrapperStyle?: React_2.CSSProperties;
|
|
2587
|
+
listStyle?: React_2.CSSProperties;
|
|
2588
|
+
listClassName?: string;
|
|
2589
|
+
skip?: number;
|
|
2590
|
+
focusedIndex?: number;
|
|
2591
|
+
highlightSelected?: boolean;
|
|
2592
|
+
ariaSetSize?: number;
|
|
2593
|
+
onClick: (index: number, event: React_2.MouseEvent<HTMLLIElement>) => void;
|
|
2594
|
+
itemRender?: (li: React_2.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React_2.ReactNode;
|
|
2595
|
+
groupHeaderItemRender?: (li: React_2.ReactElement<HTMLLIElement>, groupItemProps: ListGroupItemProps) => React_2.ReactNode;
|
|
2596
|
+
noDataRender?: (element: React_2.ReactElement<HTMLDivElement>) => React_2.ReactNode;
|
|
2597
|
+
onMouseDown?: (event: React_2.MouseEvent<HTMLDivElement>) => void;
|
|
2598
|
+
onBlur?: (event: React_2.FocusEvent<HTMLDivElement>) => void;
|
|
2599
|
+
onScroll?: (event: React_2.UIEvent<HTMLDivElement>) => void;
|
|
2600
|
+
scroller?: any;
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
/**
|
|
2604
|
+
* Represents the MultiColumnComboBox component.
|
|
2605
|
+
*
|
|
2606
|
+
* Accepts properties of type [MultiColumnComboBoxProps]({% slug api_dropdowns_multicolumncomboboxprops %}).
|
|
2607
|
+
* Obtaining the `ref` returns an object of type [MultiColumnComboBoxHandle]({% slug api_dropdowns_multicolumncomboboxhandle %}).
|
|
2608
|
+
*
|
|
2609
|
+
* @example
|
|
2610
|
+
* ```jsx
|
|
2611
|
+
* const columns = [
|
|
2612
|
+
* {
|
|
2613
|
+
* field: "id",
|
|
2614
|
+
* header: "ID",
|
|
2615
|
+
* width: "100px",
|
|
2616
|
+
* },
|
|
2617
|
+
* {
|
|
2618
|
+
* field: "name",
|
|
2619
|
+
* header: "Name",
|
|
2620
|
+
* width: "300px",
|
|
2621
|
+
* },
|
|
2622
|
+
* {
|
|
2623
|
+
* field: "position",
|
|
2624
|
+
* header: "Position",
|
|
2625
|
+
* width: "300px",
|
|
2626
|
+
* },
|
|
2627
|
+
* ];
|
|
2628
|
+
* const App = () => {
|
|
2629
|
+
* return (
|
|
2630
|
+
* <div>
|
|
2631
|
+
* <div>Employees:</div>
|
|
2632
|
+
* <MultiColumnComboBox
|
|
2633
|
+
* data={employees}
|
|
2634
|
+
* columns={columns}
|
|
2635
|
+
* textField={"name"}
|
|
2636
|
+
* style={{
|
|
2637
|
+
* width: "300px",
|
|
2638
|
+
* }}
|
|
2639
|
+
* placeholder="Please select ..."
|
|
2640
|
+
* />
|
|
2641
|
+
* </div>
|
|
2642
|
+
* );
|
|
2643
|
+
* };
|
|
2644
|
+
* ReactDOM.render(<App />, document.querySelector("my-app"));
|
|
2645
|
+
* ```
|
|
2646
|
+
*/
|
|
2647
|
+
export declare const MultiColumnComboBox: React_2.ForwardRefExoticComponent<MultiColumnComboBoxProps & React_2.RefAttributes<MultiColumnComboBoxHandle | null>>;
|
|
2648
|
+
|
|
2649
|
+
/**
|
|
2650
|
+
* Represents the type of the MultiColumnComboBoxChangeEvent.
|
|
2651
|
+
*/
|
|
2652
|
+
export declare interface MultiColumnComboBoxChangeEvent {
|
|
2653
|
+
/**
|
|
2654
|
+
* The value of the MultiColumnComboBoxChangeEvent.
|
|
2655
|
+
*/
|
|
2656
|
+
value: any;
|
|
2657
|
+
/**
|
|
2658
|
+
* The target of the MultiColumnComboBoxChangeEvent from MultiColumnComboBoxHandle.
|
|
2659
|
+
*/
|
|
2660
|
+
target: MultiColumnComboBoxHandle;
|
|
2661
|
+
/**
|
|
2662
|
+
* The event of the MultiColumnComboBoxChangeEvent.
|
|
2663
|
+
*/
|
|
2664
|
+
syntheticEvent: React_2.SyntheticEvent<any>;
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
/**
|
|
2668
|
+
* The represents the interface of the MultiColumnComboBox columns.
|
|
2669
|
+
*/
|
|
2670
|
+
export declare interface MultiColumnComboBoxColumn {
|
|
2671
|
+
/**
|
|
2672
|
+
* The unique id of the column.
|
|
2673
|
+
*/
|
|
2674
|
+
uniqueKey?: string;
|
|
2675
|
+
/**
|
|
2676
|
+
* The field of the column.
|
|
2677
|
+
*/
|
|
2678
|
+
field?: string;
|
|
2679
|
+
/**
|
|
2680
|
+
* The header of the column.
|
|
2681
|
+
*/
|
|
2682
|
+
header?: React_2.ReactNode;
|
|
2683
|
+
/**
|
|
2684
|
+
* Represents the width of the column. If the width is not specified it is applied the default width of `200px`.
|
|
2685
|
+
*/
|
|
2686
|
+
width?: string | number;
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
/**
|
|
2690
|
+
* Represents the target(element and props) of the MultiColumnComboBoxChangeEvent.
|
|
2691
|
+
*/
|
|
2692
|
+
export declare interface MultiColumnComboBoxHandle {
|
|
2693
|
+
/**
|
|
2694
|
+
* The current element or `null` of there is no one.
|
|
2695
|
+
*/
|
|
2696
|
+
element: HTMLSpanElement | null;
|
|
2697
|
+
/**
|
|
2698
|
+
* The value of the MultiColumnComboBox.
|
|
2699
|
+
*/
|
|
2700
|
+
value: any;
|
|
2701
|
+
/**
|
|
2702
|
+
* The props values of the MultiColumnComboBox.
|
|
2703
|
+
*/
|
|
2704
|
+
props: MultiColumnComboBoxProps;
|
|
2705
|
+
/**
|
|
2706
|
+
* The focus event callback.
|
|
2707
|
+
*/
|
|
2708
|
+
focus: () => void;
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
/**
|
|
2712
|
+
* Represents the properties of the [MultiColumnComboBox]({% slug api_dropdowns_multicolumncombobox %}) component.
|
|
2713
|
+
*/
|
|
2714
|
+
export declare interface MultiColumnComboBoxProps extends ComboBoxProps {
|
|
2715
|
+
/**
|
|
2716
|
+
* Determines the columns array of the MultiColumnComboBox.
|
|
2717
|
+
*/
|
|
2718
|
+
columns: MultiColumnComboBoxColumn[];
|
|
2719
|
+
/**
|
|
2720
|
+
* Sets the data of the MultiColumnComboBox.
|
|
2721
|
+
*/
|
|
2722
|
+
data?: any[];
|
|
2723
|
+
/**
|
|
2724
|
+
* Sets the opened and closed state of the MultiColumnComboBox.
|
|
2725
|
+
*/
|
|
2726
|
+
opened?: boolean;
|
|
2727
|
+
/**
|
|
2728
|
+
* The styles that are applied to the MultiColumnComboBox.
|
|
2729
|
+
*/
|
|
2730
|
+
style?: React_2.CSSProperties;
|
|
2731
|
+
/**
|
|
2732
|
+
* Sets the value of the MultiColumnComboBox. It can either be of the primitive (string, numbers) or of the complex (objects) type.
|
|
2733
|
+
*/
|
|
2734
|
+
value?: any;
|
|
2735
|
+
/**
|
|
2736
|
+
* Sets the default value of the MultiColumnComboBox. Similar to the native `select` HTML element.
|
|
2737
|
+
*/
|
|
2738
|
+
defaultValue?: any;
|
|
2739
|
+
/**
|
|
2740
|
+
* Sets additional classes to the MultiColumnComboBox.
|
|
2741
|
+
*/
|
|
2742
|
+
className?: string;
|
|
2743
|
+
/**
|
|
2744
|
+
* If `clearButton` is set to `true`, the MultiColumnComboBox renders a button on hovering over the component. Clicking this button resets the value of the MultiColumnComboBox to `undefined` and triggers the `change` event.
|
|
2745
|
+
*/
|
|
2746
|
+
clearButton?: boolean;
|
|
2747
|
+
/**
|
|
2748
|
+
* The hint that is displayed when the MultiColumnComboBox is empty.
|
|
2749
|
+
*/
|
|
2750
|
+
placeholder?: string;
|
|
2751
|
+
/**
|
|
2752
|
+
* Specifies whether the MultiColumnComboBox allows user-defined values that are not present in the dataset. Defaults to `false`.
|
|
2753
|
+
*/
|
|
2754
|
+
allowCustom?: boolean;
|
|
2755
|
+
/**
|
|
2756
|
+
* Sets the disabled state of the MultiColumnComboBox.
|
|
2757
|
+
*/
|
|
2758
|
+
disabled?: boolean;
|
|
2759
|
+
/**
|
|
2760
|
+
* Enables the filtering functionality of the MultiColumnComboBox.
|
|
2761
|
+
*/
|
|
2762
|
+
filterable?: boolean;
|
|
2763
|
+
/**
|
|
2764
|
+
* Sets the value of MultiColumnComboBox input. Useful for making the MultiColumnComboBox input a controlled component.
|
|
2765
|
+
*/
|
|
2766
|
+
filter?: string | null;
|
|
2767
|
+
/**
|
|
2768
|
+
* Sets the loading state of the MultiColumnComboBox.
|
|
2769
|
+
*/
|
|
2770
|
+
loading?: boolean;
|
|
2771
|
+
/**
|
|
2772
|
+
* Specifies the `tabIndex` of the MultiColumnComboBox.
|
|
2773
|
+
*/
|
|
2774
|
+
tabIndex?: number;
|
|
2775
|
+
/**
|
|
2776
|
+
* Specifies the `accessKey` of the MultiColumnComboBox.
|
|
2777
|
+
*/
|
|
2778
|
+
accessKey?: string;
|
|
2779
|
+
/**
|
|
2780
|
+
* Sets the key for comparing the data items of the MultiColumnComboBox. If `dataItemKey` is not set, the MultiColumnComboBox compares the items by reference.
|
|
2781
|
+
*/
|
|
2782
|
+
dataItemKey?: string;
|
|
2783
|
+
/**
|
|
2784
|
+
* Renders a floating label for the MultiColumnComboBox.
|
|
2785
|
+
*/
|
|
2786
|
+
label?: string;
|
|
2787
|
+
/**
|
|
2788
|
+
* Configures the popup of the MultiColumnComboBox.
|
|
2789
|
+
*/
|
|
2790
|
+
popupSettings?: DropDownsPopupSettings;
|
|
2791
|
+
/**
|
|
2792
|
+
* Configures the virtual scrolling of the MultiColumnComboBox.
|
|
2793
|
+
*/
|
|
2794
|
+
virtual?: VirtualizationSettings;
|
|
2795
|
+
/**
|
|
2796
|
+
* If set, the MultiColumnComboBox will use it to get the focused item index. Default functionality returns the first item which starts with the input text.
|
|
2797
|
+
*/
|
|
2798
|
+
focusedItemIndex?: (data: any, inputText: string, textField?: string) => number;
|
|
2799
|
+
/**
|
|
2800
|
+
* Fires each time the popup of the MultiColumnComboBox is about to open.
|
|
2801
|
+
*/
|
|
2802
|
+
onOpen?: (event: ComboBoxOpenEvent) => void;
|
|
2803
|
+
/**
|
|
2804
|
+
* Fires each time the popup of the MultiColumnComboBox is about to close.
|
|
2805
|
+
*/
|
|
2806
|
+
onClose?: (event: ComboBoxCloseEvent) => void;
|
|
2807
|
+
/**
|
|
2808
|
+
* Fires each time the user focuses the MultiColumnComboBox.
|
|
2809
|
+
*/
|
|
2810
|
+
onFocus?: (event: ComboBoxFocusEvent) => void;
|
|
2811
|
+
/**
|
|
2812
|
+
* Fires each time the MultiColumnComboBox gets blurred.
|
|
2813
|
+
*/
|
|
2814
|
+
onBlur?: (event: ComboBoxBlurEvent) => void;
|
|
2815
|
+
/**
|
|
2816
|
+
* Fires each time the value of the MultiColumnComboBox is about to change.
|
|
2817
|
+
*/
|
|
2818
|
+
onChange?: (event: ComboBoxChangeEvent) => void;
|
|
2819
|
+
/**
|
|
2820
|
+
* Fires each time the user types in the filter input. You can filter the source based on the passed filtration value.
|
|
2821
|
+
*/
|
|
2822
|
+
onFilterChange?: (event: ComboBoxFilterChangeEvent) => void;
|
|
2823
|
+
/**
|
|
2824
|
+
* Fires when both the virtual scrolling of the MultiColumnComboBox is enabled and the component requires data for another page.
|
|
2825
|
+
*/
|
|
2826
|
+
onPageChange?: (event: ComboBoxPageChangeEvent) => void;
|
|
2827
|
+
/**
|
|
2828
|
+
* @hidden
|
|
2829
|
+
*/
|
|
2830
|
+
onGroupScroll?: (event: {
|
|
2831
|
+
group?: string;
|
|
2832
|
+
}) => void;
|
|
2833
|
+
/**
|
|
2834
|
+
* Fires when a MultiColumnComboBox list item is about to be rendered. Used to override the default appearance of the list items.
|
|
2835
|
+
*/
|
|
2836
|
+
itemRender?: (li: React_2.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React_2.ReactNode;
|
|
2837
|
+
/**
|
|
2838
|
+
* Sets the header component of the MultiColumnComboBox.
|
|
2839
|
+
*/
|
|
2840
|
+
header?: React_2.ReactNode;
|
|
2841
|
+
/**
|
|
2842
|
+
* Sets the footer component of the MultiColumnComboBox.
|
|
2843
|
+
*/
|
|
2844
|
+
footer?: React_2.ReactNode;
|
|
2845
|
+
/**
|
|
2846
|
+
* Configures the `size` of the MultiColumnComboBox.
|
|
2847
|
+
*
|
|
2848
|
+
* The available options are:
|
|
2849
|
+
* - small
|
|
2850
|
+
* - medium
|
|
2851
|
+
* - large
|
|
2852
|
+
* - null—Does not set a size `className`.
|
|
2853
|
+
*
|
|
2854
|
+
* @default `medium`
|
|
2855
|
+
*/
|
|
2856
|
+
size?: null | 'small' | 'medium' | 'large';
|
|
2857
|
+
/**
|
|
2858
|
+
* Configures the `roundness` of the MultiColumnComboBox.
|
|
2859
|
+
*
|
|
2860
|
+
* The available options are:
|
|
2861
|
+
* - small
|
|
2862
|
+
* - medium
|
|
2863
|
+
* - large
|
|
2864
|
+
* - full
|
|
2865
|
+
* - null—Does not set a rounded `className`.
|
|
2866
|
+
*
|
|
2867
|
+
* @default `medium`
|
|
2868
|
+
*/
|
|
2869
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
2870
|
+
/**
|
|
2871
|
+
* Configures the `fillMode` of the MultiColumnComboBox.
|
|
2872
|
+
*
|
|
2873
|
+
* The available options are:
|
|
2874
|
+
* - solid
|
|
2875
|
+
* - flat
|
|
2876
|
+
* - outline
|
|
2877
|
+
* - null—Does not set a fillMode `className`.
|
|
2878
|
+
*
|
|
2879
|
+
* @default `solid`
|
|
2880
|
+
*/
|
|
2881
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
2882
|
+
/**
|
|
2883
|
+
* Sets a custom prefix to the MultiColumnComboBox component.
|
|
2884
|
+
*/
|
|
2885
|
+
prefix?: CustomComponent<any> | undefined;
|
|
2886
|
+
/**
|
|
2887
|
+
* Sets a custom suffix to the MultiColumnComboBox component.
|
|
2888
|
+
*/
|
|
2889
|
+
suffix?: CustomComponent<any> | undefined;
|
|
2890
|
+
}
|
|
2891
|
+
|
|
2892
|
+
/**
|
|
2893
|
+
* Represents the PropsContext of the `MultiColumnComboBox` component.
|
|
2894
|
+
* Used for global configuration of all `MultiColumnComboBox` instances.
|
|
2895
|
+
*
|
|
2896
|
+
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
2897
|
+
*/
|
|
2898
|
+
export declare const MultiColumnComboBoxPropsContext: React_2.Context<(p: MultiColumnComboBoxProps) => MultiColumnComboBoxProps>;
|
|
2899
|
+
|
|
2900
|
+
/** @hidden */
|
|
2901
|
+
export declare type MultiSelect = MultiSelectHandle;
|
|
2902
|
+
|
|
2903
|
+
/**
|
|
2904
|
+
* Represents the [KendoReact MultiSelect component]({% slug overview_multiselect %}).
|
|
2905
|
+
*
|
|
2906
|
+
* Accepts properties of type [MultiSelectProps]({% slug api_dropdowns_multiselectprops %}).
|
|
2907
|
+
* Obtaining the `ref` returns an object of type [MultiSelectHandle]({% slug api_dropdowns_multiselecthandle %}).
|
|
2908
|
+
*
|
|
2909
|
+
* @example
|
|
2910
|
+
* ```jsx
|
|
2911
|
+
* class App extends React.Component {
|
|
2912
|
+
* multiselect = null;
|
|
2913
|
+
* render() {
|
|
2914
|
+
* return (
|
|
2915
|
+
* <div>
|
|
2916
|
+
* <MultiSelect
|
|
2917
|
+
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
2918
|
+
* ref={component => this.multiselect = component}
|
|
2919
|
+
* />
|
|
2920
|
+
* <button onClick={() => alert(this.multiselect.value)}>alert value</button>
|
|
2921
|
+
* </div>
|
|
2922
|
+
* );
|
|
2923
|
+
* }
|
|
2924
|
+
* }
|
|
2925
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
2926
|
+
* ```
|
|
2927
|
+
*/
|
|
2928
|
+
export declare const MultiSelect: React_2.ForwardRefExoticComponent<MultiSelectProps & React_2.RefAttributes<any>>;
|
|
2929
|
+
|
|
2930
|
+
/**
|
|
2931
|
+
* Represents the object of the `blur` MultiSelect event.
|
|
2932
|
+
*/
|
|
2933
|
+
export declare interface MultiSelectBlurEvent extends BlurEvent<MultiSelect> {
|
|
2934
|
+
}
|
|
2935
|
+
|
|
2936
|
+
/**
|
|
2937
|
+
* Represents the object of the `onCancel` MultiSelect event.
|
|
2938
|
+
*/
|
|
2939
|
+
declare interface MultiSelectCancelEvent extends CancelEvent<MultiSelect> {
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
/**
|
|
2943
|
+
* Represents the object of the `change` MultiSelect event.
|
|
2944
|
+
*/
|
|
2945
|
+
export declare interface MultiSelectChangeEvent extends ChangeEvent<MultiSelect> {
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
/**
|
|
2949
|
+
* Represents the object of the `close` MultiSelect event.
|
|
2950
|
+
*/
|
|
2951
|
+
export declare interface MultiSelectCloseEvent extends CloseEvent_2<MultiSelect> {
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2954
|
+
/**
|
|
2955
|
+
* Represents the object of the `filterChange` MultiSelect event.
|
|
2956
|
+
*/
|
|
2957
|
+
export declare interface MultiSelectFilterChangeEvent extends FilterChangeEvent<MultiSelect> {
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
/**
|
|
2961
|
+
* Represents the object of the `focus` MultiSelect event.
|
|
2962
|
+
*/
|
|
2963
|
+
export declare interface MultiSelectFocusEvent extends FocusEvent_2<MultiSelect> {
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2966
|
+
/**
|
|
2967
|
+
* Represent the `ref` of the MultiSelect component.
|
|
2968
|
+
*/
|
|
2969
|
+
export declare interface MultiSelectHandle extends Pick<MultiSelectWithoutContext, keyof MultiSelectWithoutContext> {
|
|
2970
|
+
/**
|
|
2971
|
+
* Gets the `name` property of the MultiSelect.
|
|
2972
|
+
*/
|
|
2973
|
+
name: string | undefined;
|
|
2974
|
+
/**
|
|
2975
|
+
* Represents the validity state into which the MultiSelect is set.
|
|
2976
|
+
*/
|
|
2977
|
+
validity: FormComponentValidity;
|
|
2978
|
+
/**
|
|
2979
|
+
* Represents the value of the MultiSelect.
|
|
2980
|
+
*/
|
|
2981
|
+
value: Array<any>;
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
/** @hidden */
|
|
2985
|
+
declare interface MultiSelectInternalState extends InternalState {
|
|
2986
|
+
data: MultiSelectState;
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2989
|
+
/**
|
|
2990
|
+
* Represents the object of the `open` MultiSelect event.
|
|
2991
|
+
*/
|
|
2992
|
+
export declare interface MultiSelectOpenEvent extends OpenEvent<MultiSelect> {
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
/**
|
|
2996
|
+
* Represents the object of the `pageChange` MultiSelect event.
|
|
2997
|
+
*/
|
|
2998
|
+
export declare interface MultiSelectPageChangeEvent extends PageChangeEvent<MultiSelect> {
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
/**
|
|
3002
|
+
* Represents the props of the [KendoReact MultiSelect component]({% slug overview_multiselect %}).
|
|
3003
|
+
*/
|
|
3004
|
+
export declare interface MultiSelectProps extends FormComponentProps {
|
|
3005
|
+
/**
|
|
3006
|
+
* Specifies whether the MultiSelect allows user-defined values that are not present in the dataset ([see example]({% slug custom_values_multiselect %})). Defaults to `false`.
|
|
3007
|
+
*/
|
|
3008
|
+
allowCustom?: boolean;
|
|
3009
|
+
/**
|
|
3010
|
+
* Sets the data of the MultiSelect ([see example]({% slug binding_multiselect %})).
|
|
3011
|
+
*/
|
|
3012
|
+
data?: any[];
|
|
3013
|
+
/**
|
|
3014
|
+
* Sets the opened and closed state of the MultiSelect.
|
|
3015
|
+
*/
|
|
3016
|
+
opened?: boolean;
|
|
3017
|
+
/**
|
|
3018
|
+
* Determines whether to close the options list of the MultiSelect after the item selection is finished.
|
|
3019
|
+
*
|
|
3020
|
+
* @example
|
|
3021
|
+
* ```jsx
|
|
3022
|
+
* class App extends React.Component {
|
|
3023
|
+
* render() {
|
|
3024
|
+
* return (
|
|
3025
|
+
* <MultiSelect
|
|
3026
|
+
* data={[ "Albania", "Andorra", "Austria", "Belarus" ]}
|
|
3027
|
+
* autoClose={false}
|
|
3028
|
+
* />
|
|
3029
|
+
* );
|
|
3030
|
+
* }
|
|
3031
|
+
* }
|
|
3032
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
3033
|
+
* ```
|
|
3034
|
+
*
|
|
3035
|
+
* @default true
|
|
3036
|
+
*/
|
|
3037
|
+
autoClose?: boolean;
|
|
3038
|
+
/**
|
|
3039
|
+
* The styles that are applied to the MultiSelect.
|
|
3040
|
+
*/
|
|
3041
|
+
style?: React.CSSProperties;
|
|
3042
|
+
/**
|
|
3043
|
+
* Sets the value of the MultiSelect ([see example]({% slug binding_multiselect %})). It can either be of the primitive (string, numbers) or of the complex (objects) type.
|
|
3044
|
+
*/
|
|
3045
|
+
value?: Array<any>;
|
|
3046
|
+
/**
|
|
3047
|
+
* The hint that is displayed when the MultiSelect is empty.
|
|
3048
|
+
*/
|
|
3049
|
+
placeholder?: string;
|
|
3050
|
+
/**
|
|
3051
|
+
* Sets the tags of the MultiSelect ([see example]({% slug customtags_multiselect %})).
|
|
3052
|
+
*/
|
|
3053
|
+
tags?: Array<TagData>;
|
|
3054
|
+
/**
|
|
3055
|
+
* Sets the key for comparing the data items of the MultiSelect ([see example]({% slug binding_multiselect %}#toc-datasets-of-objects)). If `dataItemKey` is not set, the MultiSelect compares the items by reference.
|
|
3056
|
+
*/
|
|
3057
|
+
dataItemKey?: string;
|
|
3058
|
+
/**
|
|
3059
|
+
* Sets the default value of the MultiSelect. Similar to the native `select` HTML element.
|
|
3060
|
+
*/
|
|
3061
|
+
defaultValue?: Array<any>;
|
|
3062
|
+
/**
|
|
3063
|
+
* Sets additional classes to the MultiSelect.
|
|
3064
|
+
*/
|
|
3065
|
+
className?: string;
|
|
3066
|
+
/**
|
|
3067
|
+
* Sets the disabled state of the MultiSelect.
|
|
3068
|
+
*/
|
|
3069
|
+
disabled?: boolean;
|
|
3070
|
+
/**
|
|
3071
|
+
* Represents the `dir` HTML attribute.
|
|
3072
|
+
*/
|
|
3073
|
+
dir?: string;
|
|
3074
|
+
/**
|
|
3075
|
+
* Enables the filtering functionality of the MultiSelect ([more information and examples]({% slug filtering_multiselect %})).
|
|
3076
|
+
*/
|
|
3077
|
+
filterable?: boolean;
|
|
3078
|
+
/**
|
|
3079
|
+
* Specifies the id of the component.
|
|
3080
|
+
*/
|
|
3081
|
+
id?: string;
|
|
3082
|
+
/**
|
|
3083
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute).
|
|
3084
|
+
* For example these elements could contain error or hint message.
|
|
3085
|
+
*/
|
|
3086
|
+
ariaDescribedBy?: string;
|
|
3087
|
+
/**
|
|
3088
|
+
* Identifies the element(s) which will label the component.
|
|
3089
|
+
*/
|
|
3090
|
+
ariaLabelledBy?: string;
|
|
3091
|
+
/**
|
|
3092
|
+
* If set, the MultiSelect will use it to get the focused item index.
|
|
3093
|
+
*
|
|
3094
|
+
* Default functionality returns the first item which starts with the input text.
|
|
3095
|
+
*
|
|
3096
|
+
* @example
|
|
3097
|
+
* ```jsx-no-run
|
|
3098
|
+
* const focusedItemIndex = (data, inputText, textField) => {
|
|
3099
|
+
* let text = inputText.toLowerCase();
|
|
3100
|
+
* return data.findIndex(item =>
|
|
3101
|
+
* String(textField ? item[textField] : item).toLowerCase().includes(text));
|
|
3102
|
+
* };
|
|
3103
|
+
*
|
|
3104
|
+
* <MultiSelect focusedItemIndex={focusedItemIndex} />
|
|
3105
|
+
* ```
|
|
3106
|
+
*/
|
|
3107
|
+
focusedItemIndex?: (data: any, inputText: string, textField?: string) => number;
|
|
3108
|
+
/**
|
|
3109
|
+
* Sets the value of filtering input. Useful for making the filtering input a [controlled component](https://reactjs.org/docs/forms.html#controlled-components).
|
|
3110
|
+
*/
|
|
3111
|
+
filter?: string;
|
|
3112
|
+
/**
|
|
3113
|
+
* Sets the value of the adaptive filtering input of the of MultiSelect.
|
|
3114
|
+
*/
|
|
3115
|
+
adaptiveFilter?: string;
|
|
3116
|
+
/**
|
|
3117
|
+
* Sets the loading state of the MultiSelect ([see example]({% slug filtering_multiselect %}#toc-basic-configuration)).
|
|
3118
|
+
*/
|
|
3119
|
+
loading?: boolean;
|
|
3120
|
+
/**
|
|
3121
|
+
* Specifies the `tabIndex` of the MultiSelect.
|
|
3122
|
+
*/
|
|
3123
|
+
tabIndex?: number;
|
|
3124
|
+
/**
|
|
3125
|
+
* Specifies the `accessKey` of the MultiSelect.
|
|
3126
|
+
*/
|
|
3127
|
+
accessKey?: string;
|
|
3128
|
+
/**
|
|
3129
|
+
* Sets the data item field that represents the item text ([see example]({% slug binding_multiselect %}#toc-datasets-of-objects)). If the data contains only primitive values, do not define it.
|
|
3130
|
+
*/
|
|
3131
|
+
textField?: string;
|
|
3132
|
+
/**
|
|
3133
|
+
* Renders a floating label for the MultiSelect.
|
|
3134
|
+
*/
|
|
3135
|
+
label?: string;
|
|
3136
|
+
/**
|
|
3137
|
+
* Configures the popup of the MultiSelect.
|
|
3138
|
+
*/
|
|
3139
|
+
popupSettings?: DropDownsPopupSettings;
|
|
3140
|
+
/**
|
|
3141
|
+
* Configures the virtual scrolling of the MultiSelect ([see example]({% slug virtualization_multiselect %})).
|
|
3142
|
+
*/
|
|
3143
|
+
virtual?: VirtualizationSettings;
|
|
3144
|
+
/**
|
|
3145
|
+
* Fires each time the popup of the MultiSelect is about to open.
|
|
3146
|
+
*/
|
|
3147
|
+
onOpen?: (event: MultiSelectOpenEvent) => void;
|
|
3148
|
+
/**
|
|
3149
|
+
* Fires each time the popup of the MultiSelect is about to close.
|
|
3150
|
+
*/
|
|
3151
|
+
onClose?: (event: MultiSelectCloseEvent) => void;
|
|
3152
|
+
/**
|
|
3153
|
+
* Fires each time the user focuses the MultiSelect.
|
|
3154
|
+
*/
|
|
3155
|
+
onFocus?: (event: MultiSelectFocusEvent) => void;
|
|
3156
|
+
/**
|
|
3157
|
+
* Fires each time the MultiSelect gets blurred.
|
|
3158
|
+
*/
|
|
3159
|
+
onBlur?: (event: MultiSelectBlurEvent) => void;
|
|
3160
|
+
/**
|
|
3161
|
+
* Fires each time the value of the MultiSelect is about to change ([see examples]({% slug binding_multiselect %})).
|
|
3162
|
+
*/
|
|
3163
|
+
onChange?: (event: MultiSelectChangeEvent) => void;
|
|
3164
|
+
/**
|
|
3165
|
+
* Fires each time the popup of the MultiSelect is about to cancel in ([adaptive mode]({% slug adaptive_rendering_multiselect %})).
|
|
3166
|
+
*/
|
|
3167
|
+
onCancel?: (event: MultiSelectCancelEvent) => void;
|
|
3168
|
+
/**
|
|
3169
|
+
* Fires each time the user types in the filter input ([see example]({% slug filtering_multiselect %}#toc-basic-configuration)). You can filter the source based on the passed filtration value.
|
|
3170
|
+
*/
|
|
3171
|
+
onFilterChange?: (event: MultiSelectFilterChangeEvent) => void;
|
|
3172
|
+
/**
|
|
3173
|
+
* Fires when both the virtual scrolling of the MultiSelect is enabled and when the component requires data for another page ([see example]({% slug virtualization_multiselect %})).
|
|
3174
|
+
*/
|
|
3175
|
+
onPageChange?: (event: MultiSelectPageChangeEvent) => void;
|
|
3176
|
+
/**
|
|
3177
|
+
* Fires when a MultiSelect item is about to be rendered ([see example]({% slug customrendering_multiselect %}#toc-items)). Used to override the default appearance of the list items.
|
|
3178
|
+
*/
|
|
3179
|
+
itemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React.ReactNode;
|
|
3180
|
+
/**
|
|
3181
|
+
* Fires when the element which indicates no data in the popup is about to be rendered ([see example]({% slug customrendering_multiselect %}#toc-no-data)). Used to override the default appearance of the element.
|
|
3182
|
+
*/
|
|
3183
|
+
listNoDataRender?: (element: React.ReactElement<HTMLDivElement>) => React.ReactNode;
|
|
3184
|
+
/**
|
|
3185
|
+
* Fires when a tag element is about to be rendered ([see example]({% slug customrendering_multiselect %}#toc-tags)). Used to override the default appearance of the element.
|
|
3186
|
+
*/
|
|
3187
|
+
tagRender?: (tagData: TagData, tag: React.ReactElement) => React.ReactElement;
|
|
3188
|
+
/**
|
|
3189
|
+
* Sets the header component of the MultiSelect ([see example]({% slug customrendering_multiselect %}#toc-headers-and-footers)).
|
|
3190
|
+
*/
|
|
3191
|
+
header?: React.ReactNode;
|
|
3192
|
+
/**
|
|
3193
|
+
* Sets the footer component of the MultiSelect ([see example]({% slug customrendering_multiselect %}#toc-headers-and-footers)).
|
|
3194
|
+
*/
|
|
3195
|
+
footer?: React.ReactNode;
|
|
3196
|
+
/**
|
|
3197
|
+
* Configures the `size` of the MultiSelect.
|
|
3198
|
+
*
|
|
3199
|
+
* The available options are:
|
|
3200
|
+
* - small
|
|
3201
|
+
* - medium
|
|
3202
|
+
* - large
|
|
3203
|
+
* - null—Does not set a size `className`.
|
|
3204
|
+
*
|
|
3205
|
+
* @default `medium`
|
|
3206
|
+
*/
|
|
3207
|
+
size?: null | 'small' | 'medium' | 'large';
|
|
3208
|
+
/**
|
|
3209
|
+
* Configures the `roundness` of the MultiSelect.
|
|
3210
|
+
*
|
|
3211
|
+
* The available options are:
|
|
3212
|
+
* - small
|
|
3213
|
+
* - medium
|
|
3214
|
+
* - large
|
|
3215
|
+
* - full
|
|
3216
|
+
* - null—Does not set a rounded `className`.
|
|
3217
|
+
*
|
|
3218
|
+
* @default `medium`
|
|
3219
|
+
*/
|
|
3220
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
3221
|
+
/**
|
|
3222
|
+
* Configures the `fillMode` of the MultiSelect.
|
|
3223
|
+
*
|
|
3224
|
+
* The available options are:
|
|
3225
|
+
* - solid
|
|
3226
|
+
* - flat
|
|
3227
|
+
* - outline
|
|
3228
|
+
* - null—Does not set a fillMode `className`.
|
|
3229
|
+
*
|
|
3230
|
+
* @default `solid`
|
|
3231
|
+
*/
|
|
3232
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
3233
|
+
/**
|
|
3234
|
+
* Sets the data item field that represents the start of a group. Applicable to objects data.
|
|
3235
|
+
*/
|
|
3236
|
+
groupField?: string;
|
|
3237
|
+
/**
|
|
3238
|
+
* Fires when a DropDownList's group header item is about to be rendered. Used to override the default appearance of the group's headers.
|
|
3239
|
+
*/
|
|
3240
|
+
groupHeaderItemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListGroupItemProps) => React.ReactNode;
|
|
3241
|
+
/**
|
|
3242
|
+
* Fires when a DropDownList's sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component.
|
|
3243
|
+
*/
|
|
3244
|
+
groupStickyHeaderItemRender?: (div: React.ReactElement<HTMLDivElement>, stickyHeaderProps: GroupStickyHeaderProps) => React.ReactNode;
|
|
3245
|
+
/**
|
|
3246
|
+
* @hidden
|
|
3247
|
+
*/
|
|
3248
|
+
list?: any;
|
|
3249
|
+
/**
|
|
3250
|
+
* @hidden
|
|
3251
|
+
*/
|
|
3252
|
+
groupMode?: string;
|
|
3253
|
+
/**
|
|
3254
|
+
* Providing different rendering of the popup element based on the screen dimensions.
|
|
3255
|
+
*/
|
|
3256
|
+
adaptive?: boolean;
|
|
3257
|
+
/**
|
|
3258
|
+
* Specifies the text that is rendered as title in the adaptive popup.
|
|
3259
|
+
*/
|
|
3260
|
+
adaptiveTitle?: string;
|
|
3261
|
+
/**
|
|
3262
|
+
* Defines if MultiSelect's disabled items will be skipped or focused when navigating through the list of items using a keyboard. Defaults to `true`.
|
|
3263
|
+
*/
|
|
3264
|
+
skipDisabledItems?: boolean;
|
|
3265
|
+
/**
|
|
3266
|
+
* Sets a custom prefix to the MultiSelect component.
|
|
3267
|
+
*/
|
|
3268
|
+
prefix?: CustomComponent<any>;
|
|
3269
|
+
/**
|
|
3270
|
+
* Sets a custom suffix to the MultiSelect component.
|
|
3271
|
+
*/
|
|
3272
|
+
suffix?: CustomComponent<any>;
|
|
3273
|
+
}
|
|
3274
|
+
|
|
3275
|
+
/**
|
|
3276
|
+
* Represents the PropsContext of the `MultiSelect` component.
|
|
3277
|
+
* Used for global configuration of all `MultiSelect` instances.
|
|
3278
|
+
*
|
|
3279
|
+
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
3280
|
+
*/
|
|
3281
|
+
export declare const MultiSelectPropsContext: React_2.Context<(p: MultiSelectProps) => MultiSelectProps>;
|
|
3282
|
+
|
|
3283
|
+
/** @hidden */
|
|
3284
|
+
declare interface MultiSelectState extends DropDownStateBase {
|
|
3285
|
+
selectedItems?: Array<any>;
|
|
3286
|
+
focusedIndex?: number;
|
|
3287
|
+
focusedTag?: TagData;
|
|
3288
|
+
activedescendant?: ActiveDescendant;
|
|
3289
|
+
value?: Array<any>;
|
|
3290
|
+
currentValue?: Array<any>;
|
|
3291
|
+
windowWidth?: number;
|
|
3292
|
+
}
|
|
3293
|
+
|
|
3294
|
+
/**
|
|
3295
|
+
* Represents the MultiSelectTree component.
|
|
3296
|
+
*
|
|
3297
|
+
* Accepts properties of type [MultiSelectTreeProps]({% slug api_dropdowns_multiselecttreeprops %}).
|
|
3298
|
+
* Obtaining the `ref` returns an object of type [MultiSelectTreeHandle]({% slug api_dropdowns_multiselecttreehandle %}).
|
|
3299
|
+
*
|
|
3300
|
+
* @example
|
|
3301
|
+
* ```jsx
|
|
3302
|
+
* const dataItemKey = 'id';
|
|
3303
|
+
* const checkField = 'checkField';
|
|
3304
|
+
* const checkIndeterminateField = 'checkIndeterminateField';
|
|
3305
|
+
* const subItemsField = 'items';
|
|
3306
|
+
* const expandField = 'expanded';
|
|
3307
|
+
* const textField = 'text';
|
|
3308
|
+
* const fields = {
|
|
3309
|
+
* dataItemKey,
|
|
3310
|
+
* checkField,
|
|
3311
|
+
* checkIndeterminateField,
|
|
3312
|
+
* expandField,
|
|
3313
|
+
* subItemsField,
|
|
3314
|
+
* };
|
|
3315
|
+
* const App = () => {
|
|
3316
|
+
* const [value, setValue] = React.useState([]);
|
|
3317
|
+
* const [expanded, setExpanded] = React.useState([data[0][dataItemKey]]);
|
|
3318
|
+
* const onChange = (event) =>
|
|
3319
|
+
* setValue(
|
|
3320
|
+
* getMultiSelectTreeValue(data, {
|
|
3321
|
+
* ...fields,
|
|
3322
|
+
* ...event,
|
|
3323
|
+
* value,
|
|
3324
|
+
* })
|
|
3325
|
+
* );
|
|
3326
|
+
* const onExpandChange = React.useCallback(
|
|
3327
|
+
* (event) => setExpanded(expandedState(event.item, dataItemKey, expanded)),
|
|
3328
|
+
* [expanded]
|
|
3329
|
+
* );
|
|
3330
|
+
* const treeData = React.useMemo(
|
|
3331
|
+
* () =>
|
|
3332
|
+
* processMultiSelectTreeData(data, {
|
|
3333
|
+
* expanded,
|
|
3334
|
+
* value,
|
|
3335
|
+
* ...fields,
|
|
3336
|
+
* }),
|
|
3337
|
+
* [expanded, value]
|
|
3338
|
+
* );
|
|
3339
|
+
*
|
|
3340
|
+
* return (
|
|
3341
|
+
* <div>
|
|
3342
|
+
* <div>Categories:</div>
|
|
3343
|
+
* <MultiSelectTree
|
|
3344
|
+
* style={{
|
|
3345
|
+
* width: '300px',
|
|
3346
|
+
* }}
|
|
3347
|
+
* data={treeData}
|
|
3348
|
+
* value={value}
|
|
3349
|
+
* onChange={onChange}
|
|
3350
|
+
* placeholder="Please select ..."
|
|
3351
|
+
* textField={textField}
|
|
3352
|
+
* dataItemKey={dataItemKey}
|
|
3353
|
+
* checkField={checkField}
|
|
3354
|
+
* checkIndeterminateField={checkIndeterminateField}
|
|
3355
|
+
* expandField={expandField}
|
|
3356
|
+
* subItemsField={subItemsField}
|
|
3357
|
+
* onExpandChange={onExpandChange}
|
|
3358
|
+
* />
|
|
3359
|
+
* </div>
|
|
3360
|
+
* );
|
|
3361
|
+
* };
|
|
3362
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
3363
|
+
* ```
|
|
3364
|
+
*/
|
|
3365
|
+
export declare const MultiSelectTree: React_2.ForwardRefExoticComponent<MultiSelectTreeProps & React_2.RefAttributes<MultiSelectTreeHandle | null>>;
|
|
3366
|
+
|
|
3367
|
+
/**
|
|
3368
|
+
* Represents the object of the `onBlur` MultiSelectTree event.
|
|
3369
|
+
*/
|
|
3370
|
+
export declare interface MultiSelectTreeBlurEvent extends BlurEvent<MultiSelectTreeHandle> {
|
|
3371
|
+
}
|
|
3372
|
+
|
|
3373
|
+
/**
|
|
3374
|
+
* Represents the object of the `onCancel` MultiSelectTree event.
|
|
3375
|
+
*/
|
|
3376
|
+
export declare interface MultiSelectTreeCancelEvent extends CancelEvent<MultiSelectTreeHandle> {
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3379
|
+
/**
|
|
3380
|
+
* Represents the object of the `onChange` MultiSelectTree event.
|
|
3381
|
+
*/
|
|
3382
|
+
export declare interface MultiSelectTreeChangeEvent extends DropdownEvent<MultiSelectTreeHandle> {
|
|
3383
|
+
/**
|
|
3384
|
+
* The items related to current operation.
|
|
3385
|
+
*/
|
|
3386
|
+
items: any[];
|
|
3387
|
+
/**
|
|
3388
|
+
* Describes the current operation:
|
|
3389
|
+
* * `clear` - clear button is clicked and value is cleared. Null value is retured.
|
|
3390
|
+
* * `delete` - tag is deleted using keyboard or mouse. The items contained in current tag are returned.
|
|
3391
|
+
* * `toggle` - item in TreeView is toggled. Single item is returned.
|
|
3392
|
+
*/
|
|
3393
|
+
operation: MultiSelectTreeChangeEventOperation;
|
|
3394
|
+
}
|
|
3395
|
+
|
|
3396
|
+
export declare type MultiSelectTreeChangeEventOperation = 'clear' | 'delete' | 'toggle';
|
|
3397
|
+
|
|
3398
|
+
/**
|
|
3399
|
+
* Represents the object of the `onClose` MultiSelectTree event.
|
|
3400
|
+
*/
|
|
3401
|
+
export declare interface MultiSelectTreeCloseEvent extends CloseEvent_2<MultiSelectTreeHandle> {
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3404
|
+
/**
|
|
3405
|
+
* Represents the object of the `onExpandChange` MultiSelectTree event.
|
|
3406
|
+
*/
|
|
3407
|
+
export declare interface MultiSelectTreeExpandEvent extends DropdownEvent<MultiSelectTreeHandle> {
|
|
3408
|
+
item: any;
|
|
3409
|
+
level: number[];
|
|
3410
|
+
}
|
|
3411
|
+
|
|
3412
|
+
/**
|
|
3413
|
+
* Represents the object of the `onFilterChange` MultiSelectTree event.
|
|
3414
|
+
*/
|
|
3415
|
+
export declare interface MultiSelectTreeFilterChangeEvent extends FilterChangeEvent<MultiSelectTreeHandle> {
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
/**
|
|
3419
|
+
* Represents the object of the `onFocus` MultiSelectTree event.
|
|
3420
|
+
*/
|
|
3421
|
+
export declare interface MultiSelectTreeFocusEvent extends FocusEvent_2<MultiSelectTreeHandle> {
|
|
3422
|
+
}
|
|
3423
|
+
|
|
3424
|
+
/**
|
|
3425
|
+
* Represents the Object which is passed to the
|
|
3426
|
+
* [`ref`](https://reactjs.org/docs/refs-and-the-dom.html) callback of the MultiSelectTree component.
|
|
3427
|
+
*/
|
|
3428
|
+
export declare interface MultiSelectTreeHandle {
|
|
3429
|
+
/**
|
|
3430
|
+
* The current element or `null` if there is no one.
|
|
3431
|
+
*/
|
|
3432
|
+
element: HTMLElement | null;
|
|
3433
|
+
/**
|
|
3434
|
+
* The props of the MultiSelectTree component.
|
|
3435
|
+
*/
|
|
3436
|
+
props: MultiSelectTreeProps;
|
|
3437
|
+
/**
|
|
3438
|
+
* The focus function.
|
|
3439
|
+
*/
|
|
3440
|
+
focus: () => void;
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
/**
|
|
3444
|
+
* The props of component that will be used for rendering each of the MultiSelectTree items
|
|
3445
|
+
* ([see example]({% slug customrendering_multiselecttree %}#toc-items-and-value-element)).
|
|
3446
|
+
*/
|
|
3447
|
+
export declare interface MultiSelectTreeItemProps extends ItemRenderProps {
|
|
3448
|
+
}
|
|
3449
|
+
|
|
3450
|
+
/**
|
|
3451
|
+
* The props of the `ListNoData` component ([see example]({% slug customrendering_multiselecttree %}#toc-no-data)).
|
|
3452
|
+
*/
|
|
3453
|
+
export declare interface MultiSelectTreeListNoDataProps {
|
|
3454
|
+
children?: React_2.ReactNode;
|
|
3455
|
+
}
|
|
3456
|
+
|
|
3457
|
+
/**
|
|
3458
|
+
* Represents the object of the `onOpen` MultiSelectTree event.
|
|
3459
|
+
*/
|
|
3460
|
+
export declare interface MultiSelectTreeOpenEvent extends OpenEvent<MultiSelectTreeHandle> {
|
|
3461
|
+
}
|
|
3462
|
+
|
|
3463
|
+
/**
|
|
3464
|
+
* Represents the props of the [KendoReact MultiSelectTree component]({% slug overview_multiselecttree %}).
|
|
3465
|
+
*/
|
|
3466
|
+
export declare interface MultiSelectTreeProps extends FormComponentProps {
|
|
3467
|
+
/**
|
|
3468
|
+
* Sets the data of the MultiSelectTree ([see example]({% slug overview_multiselecttree %})).
|
|
3469
|
+
*/
|
|
3470
|
+
data?: any[];
|
|
3471
|
+
/**
|
|
3472
|
+
* Sets the opened state of the MultiSelectTree.
|
|
3473
|
+
*/
|
|
3474
|
+
opened?: boolean;
|
|
3475
|
+
/**
|
|
3476
|
+
* The styles that are applied to the MultiSelectTree.
|
|
3477
|
+
*/
|
|
3478
|
+
style?: React_2.CSSProperties;
|
|
3479
|
+
/**
|
|
3480
|
+
* Sets the value of the MultiSelectTree. It can either be of the primitive (string, numbers) or of the complex (objects) type.
|
|
3481
|
+
*/
|
|
3482
|
+
value?: Array<any>;
|
|
3483
|
+
/**
|
|
3484
|
+
* The hint that is displayed when the MultiSelectTree is empty.
|
|
3485
|
+
*/
|
|
3486
|
+
placeholder?: string;
|
|
3487
|
+
/**
|
|
3488
|
+
* Sets the key for comparing the data items of the MultiSelectTree ([see example]({% slug overview_multiselecttree %})).
|
|
3489
|
+
* If `dataItemKey` is not set, the MultiSelectTree compares the items by reference.
|
|
3490
|
+
*/
|
|
3491
|
+
dataItemKey: string;
|
|
3492
|
+
/**
|
|
3493
|
+
* Sets additional classes to the MultiSelectTree.
|
|
3494
|
+
*/
|
|
3495
|
+
className?: string;
|
|
3496
|
+
/**
|
|
3497
|
+
* Sets the disabled state of the MultiSelectTree.
|
|
3498
|
+
*/
|
|
3499
|
+
disabled?: boolean;
|
|
3500
|
+
/**
|
|
3501
|
+
* Represents the `dir` HTML attribute.
|
|
3502
|
+
*/
|
|
3503
|
+
dir?: string;
|
|
3504
|
+
/**
|
|
3505
|
+
* Renders a floating label for the MultiSelectTree.
|
|
3506
|
+
*/
|
|
3507
|
+
label?: string;
|
|
3508
|
+
/**
|
|
3509
|
+
* Specifies the id of the component.
|
|
3510
|
+
*/
|
|
3511
|
+
id?: string;
|
|
3512
|
+
/**
|
|
3513
|
+
* Sets the tags of the MultiSelect ([see example]({% slug customtags_multiselect %})).
|
|
3514
|
+
*/
|
|
3515
|
+
tags?: Array<TagData>;
|
|
3516
|
+
/**
|
|
3517
|
+
* Identifies the element(s) which will describe the component, similar to [HTML aria-describedby attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute).
|
|
3518
|
+
* For example these elements could contain error or hint message.
|
|
3519
|
+
*/
|
|
3520
|
+
ariaDescribedBy?: string;
|
|
3521
|
+
/**
|
|
3522
|
+
* Identifies the element(s) which will label the component.
|
|
3523
|
+
*/
|
|
3524
|
+
ariaLabelledBy?: string;
|
|
3525
|
+
/**
|
|
3526
|
+
* Enables the filtering functionality of the MultiSelectTree ([more information and examples]({% slug filtering_multiselecttree %})).
|
|
3527
|
+
*/
|
|
3528
|
+
filterable?: boolean;
|
|
3529
|
+
/**
|
|
3530
|
+
* Sets the value of filtering input.
|
|
3531
|
+
* Useful for making the filtering input a [controlled component](https://reactjs.org/docs/forms.html#controlled-components).
|
|
3532
|
+
*/
|
|
3533
|
+
filter?: string;
|
|
3534
|
+
/**
|
|
3535
|
+
* Sets the loading state of the MultiSelectTree ([see example]({% slug filtering_multiselecttree %}#toc-visualize-filtering)).
|
|
3536
|
+
*/
|
|
3537
|
+
loading?: boolean;
|
|
3538
|
+
/**
|
|
3539
|
+
* Specifies the `tabIndex` of the MultiSelectTree.
|
|
3540
|
+
*/
|
|
3541
|
+
tabIndex?: number;
|
|
3542
|
+
/**
|
|
3543
|
+
* Specifies the `accessKey` of the MultiSelectTree.
|
|
3544
|
+
*/
|
|
3545
|
+
accessKey?: string;
|
|
3546
|
+
/**
|
|
3547
|
+
* Sets the data item field that represents the item text ([see example]({% slug overview_multiselecttree %})).
|
|
3548
|
+
*/
|
|
3549
|
+
textField: string;
|
|
3550
|
+
/**
|
|
3551
|
+
* Specifies the name of the field which will provide a Boolean representation of the checked state of the item.
|
|
3552
|
+
*/
|
|
3553
|
+
checkField?: string;
|
|
3554
|
+
/**
|
|
3555
|
+
* Specifies the name of the field which will provide a Boolean representation of the checked indeterminaet state of the item.
|
|
3556
|
+
*/
|
|
3557
|
+
checkIndeterminateField?: string;
|
|
3558
|
+
/**
|
|
3559
|
+
* Specifies the name of the field which will provide a Boolean representation of the expanded state of the item.
|
|
3560
|
+
*/
|
|
3561
|
+
expandField?: string;
|
|
3562
|
+
/**
|
|
3563
|
+
* Specifies the name of the field which will provide an array representation of the item subitems.
|
|
3564
|
+
* Defaults to 'items'.
|
|
3565
|
+
*/
|
|
3566
|
+
subItemsField?: string;
|
|
3567
|
+
/**
|
|
3568
|
+
* Configures the popup of the MultiSelectTree.
|
|
3569
|
+
*/
|
|
3570
|
+
popupSettings?: DropDownsPopupSettings;
|
|
3571
|
+
/**
|
|
3572
|
+
* Represents a callback function, which returns the value for submitting. The returned value will be rendered in an `option` of a hidden [`select`](https://reactjs.org/docs/forms.html#the-select-tag) element.
|
|
3573
|
+
*
|
|
3574
|
+
* @example
|
|
3575
|
+
* ```jsx-no-run
|
|
3576
|
+
* class App extends React.Component {
|
|
3577
|
+
* render() {
|
|
3578
|
+
* return (
|
|
3579
|
+
* <form>
|
|
3580
|
+
* <MultiSelectTree
|
|
3581
|
+
* data={[ { text: "Austria", id: 1 } , { text: "Belarus", id: 2 } ]}
|
|
3582
|
+
* valueMap={value => value && value.id}
|
|
3583
|
+
* />
|
|
3584
|
+
* <button type="submit">Submit</button>
|
|
3585
|
+
* </form>
|
|
3586
|
+
* );
|
|
3587
|
+
* }
|
|
3588
|
+
* }
|
|
3589
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
3590
|
+
* ```
|
|
3591
|
+
*/
|
|
3592
|
+
valueMap?: (value: Array<any>) => any;
|
|
3593
|
+
/**
|
|
3594
|
+
* Fires each time the popup of the MultiSelectTree is about to open.
|
|
3595
|
+
*/
|
|
3596
|
+
onOpen?: (event: MultiSelectTreeOpenEvent) => void;
|
|
3597
|
+
/**
|
|
3598
|
+
* Fires each time the popup of the MultiSelectTree is about to close.
|
|
3599
|
+
*/
|
|
3600
|
+
onClose?: (event: MultiSelectTreeCloseEvent) => void;
|
|
3601
|
+
/**
|
|
3602
|
+
* Fires each time the user focuses the MultiSelectTree.
|
|
3603
|
+
*/
|
|
3604
|
+
onFocus?: (event: MultiSelectTreeFocusEvent) => void;
|
|
3605
|
+
/**
|
|
3606
|
+
* Fires each time the MultiSelectTree gets blurred.
|
|
3607
|
+
*/
|
|
3608
|
+
onBlur?: (event: MultiSelectTreeBlurEvent) => void;
|
|
3609
|
+
/**
|
|
3610
|
+
* Fires each time the value of the MultiSelectTree is about to change ([see examples]({% slug overview_multiselecttree %})).
|
|
3611
|
+
*/
|
|
3612
|
+
onChange?: (event: MultiSelectTreeChangeEvent) => void;
|
|
3613
|
+
/**
|
|
3614
|
+
* Fires each time the popup of the MultiSelectTree is about to cancel in ([adaptive mode]({% slug adaptive_rendering_multiselecttree %})).
|
|
3615
|
+
*/
|
|
3616
|
+
onCancel?: (event: MultiSelectTreeCancelEvent) => void;
|
|
3617
|
+
/**
|
|
3618
|
+
* Fires each time the user types in the filter input
|
|
3619
|
+
* ([see example]({% slug filtering_multiselecttree %}#toc-basic-configuration)).
|
|
3620
|
+
* You can filter the source based on the passed filtration value.
|
|
3621
|
+
*/
|
|
3622
|
+
onFilterChange?: (event: MultiSelectTreeFilterChangeEvent) => void;
|
|
3623
|
+
/**
|
|
3624
|
+
* Fires when the expanding or collapsing of an item is requested ([see examples]({% slug overview_multiselecttree %})).
|
|
3625
|
+
*/
|
|
3626
|
+
onExpandChange?: (event: any) => void;
|
|
3627
|
+
/**
|
|
3628
|
+
* Defines the component that will be used for rendering each of the MultiSelectTree items
|
|
3629
|
+
* ([see example]({% slug customrendering_multiselecttree %}#toc-items-and-value-element)).
|
|
3630
|
+
*/
|
|
3631
|
+
item?: React_2.ComponentType<MultiSelectTreeItemProps>;
|
|
3632
|
+
/**
|
|
3633
|
+
* Defines the component that will be rendered in the MultiSelectTree popup when no data is available
|
|
3634
|
+
* ([see example]({% slug customrendering_multiselecttree %}#toc-no-data)).
|
|
3635
|
+
*/
|
|
3636
|
+
listNoData?: React_2.ComponentType<MultiSelectTreeListNoDataProps>;
|
|
3637
|
+
tag?: React_2.ComponentType<MultiSelectTreeTagProps>;
|
|
3638
|
+
/**
|
|
3639
|
+
* Configures the `size` of the MultiSelectTree.
|
|
3640
|
+
*
|
|
3641
|
+
* The available options are:
|
|
3642
|
+
* - small
|
|
3643
|
+
* - medium
|
|
3644
|
+
* - large
|
|
3645
|
+
* - null—Does not set a size `className`.
|
|
3646
|
+
*
|
|
3647
|
+
* @default `medium`
|
|
3648
|
+
*/
|
|
3649
|
+
size?: null | 'small' | 'medium' | 'large';
|
|
3650
|
+
/**
|
|
3651
|
+
* Configures the `roundness` of the MultiSelectTree.
|
|
3652
|
+
*
|
|
3653
|
+
* The available options are:
|
|
3654
|
+
* - small
|
|
3655
|
+
* - medium
|
|
3656
|
+
* - large
|
|
3657
|
+
* - full
|
|
3658
|
+
* - null—Does not set a rounded `className`.
|
|
3659
|
+
*
|
|
3660
|
+
* @default `medium`
|
|
3661
|
+
*/
|
|
3662
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
3663
|
+
/**
|
|
3664
|
+
* Configures the `fillMode` of the MultiSelectTree.
|
|
3665
|
+
*
|
|
3666
|
+
* The available options are:
|
|
3667
|
+
* - solid
|
|
3668
|
+
* - flat
|
|
3669
|
+
* - outline
|
|
3670
|
+
* - null—Does not set a fillMode `className`.
|
|
3671
|
+
*
|
|
3672
|
+
* @default `solid`
|
|
3673
|
+
*/
|
|
3674
|
+
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
3675
|
+
/**
|
|
3676
|
+
* Providing different rendering of the popup element based on the screen dimensions.
|
|
3677
|
+
*/
|
|
3678
|
+
adaptive?: boolean;
|
|
3679
|
+
/**
|
|
3680
|
+
* Specifies the text that is rendered as title in the adaptive popup.
|
|
3681
|
+
*/
|
|
3682
|
+
adaptiveTitle?: string | React_2.ReactNode;
|
|
3683
|
+
}
|
|
3684
|
+
|
|
3685
|
+
/**
|
|
3686
|
+
* Represents the PropsContext of the `MultiSelectTree` component.
|
|
3687
|
+
* Used for global configuration of all `MultiSelectTree` instances.
|
|
3688
|
+
*
|
|
3689
|
+
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
3690
|
+
*/
|
|
3691
|
+
export declare const MultiSelectTreePropsContext: React_2.Context<(p: MultiSelectTreeProps) => MultiSelectTreeProps>;
|
|
3692
|
+
|
|
3693
|
+
/**
|
|
3694
|
+
* The props of component that will be used for rendering each of the MultiSelectTree tags
|
|
3695
|
+
*/
|
|
3696
|
+
export declare interface MultiSelectTreeTagProps {
|
|
3697
|
+
tagData: TagData;
|
|
3698
|
+
guid: string;
|
|
3699
|
+
focusedTag?: TagData;
|
|
3700
|
+
onTagDelete: (items: Array<any>, event: React_2.MouseEvent<HTMLSpanElement>) => void;
|
|
3701
|
+
}
|
|
3702
|
+
|
|
3703
|
+
/** @hidden */
|
|
3704
|
+
export declare class MultiSelectWithoutContext extends React_2.Component<MultiSelectProps, MultiSelectState> implements FormComponent {
|
|
3705
|
+
static displayName: string;
|
|
3706
|
+
/** @hidden */
|
|
3707
|
+
static propTypes: {
|
|
3708
|
+
autoClose: PropTypes.Requireable<boolean>;
|
|
3709
|
+
value: PropTypes.Requireable<any[]>;
|
|
3710
|
+
defaultValue: PropTypes.Requireable<any[]>;
|
|
3711
|
+
dataItemKey: PropTypes.Requireable<string>;
|
|
3712
|
+
placeholder: PropTypes.Requireable<string>;
|
|
3713
|
+
tags: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
3714
|
+
text: PropTypes.Requireable<string>;
|
|
3715
|
+
data: PropTypes.Requireable<any[]>;
|
|
3716
|
+
}> | null | undefined)[]>;
|
|
3717
|
+
tagRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
3718
|
+
id: PropTypes.Requireable<string>;
|
|
3719
|
+
ariaLabelledBy: PropTypes.Requireable<string>;
|
|
3720
|
+
ariaDescribedBy: PropTypes.Requireable<string>;
|
|
3721
|
+
groupField: PropTypes.Requireable<string>;
|
|
3722
|
+
list: PropTypes.Requireable<any>;
|
|
3723
|
+
adaptive: PropTypes.Requireable<boolean>;
|
|
3724
|
+
adaptiveTitle: PropTypes.Requireable<string>;
|
|
3725
|
+
onCancel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
3726
|
+
skipDisabledItems: PropTypes.Requireable<boolean>;
|
|
3727
|
+
filterable: PropTypes.Requireable<boolean>;
|
|
3728
|
+
filter: PropTypes.Requireable<string>;
|
|
3729
|
+
virtual: PropTypes.Requireable<PropTypes.InferProps<{
|
|
3730
|
+
pageSize: PropTypes.Validator<number>;
|
|
3731
|
+
skip: PropTypes.Validator<number>;
|
|
3732
|
+
total: PropTypes.Validator<number>;
|
|
3733
|
+
}>>;
|
|
3734
|
+
onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
3735
|
+
onPageChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
3736
|
+
opened: PropTypes.Requireable<boolean>;
|
|
3737
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
3738
|
+
dir: PropTypes.Requireable<string>;
|
|
3739
|
+
tabIndex: PropTypes.Requireable<number>;
|
|
3740
|
+
accessKey: PropTypes.Requireable<string>;
|
|
3741
|
+
data: PropTypes.Requireable<any[]>;
|
|
3742
|
+
textField: PropTypes.Requireable<string>;
|
|
3743
|
+
className: PropTypes.Requireable<string>;
|
|
3744
|
+
label: PropTypes.Requireable<string>;
|
|
3745
|
+
loading: PropTypes.Requireable<boolean>;
|
|
3746
|
+
popupSettings: PropTypes.Requireable<PropTypes.InferProps<{
|
|
3747
|
+
animate: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
3748
|
+
openDuration: PropTypes.Requireable<number>;
|
|
3749
|
+
closeDuration: PropTypes.Requireable<number>;
|
|
3750
|
+
}> | null | undefined>>;
|
|
3751
|
+
popupClass: PropTypes.Requireable<string>;
|
|
3752
|
+
className: PropTypes.Requireable<string>;
|
|
3753
|
+
appendTo: PropTypes.Requireable<any>;
|
|
3754
|
+
width: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
3755
|
+
height: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
3756
|
+
}>>;
|
|
3757
|
+
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
3758
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
3759
|
+
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
3760
|
+
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
3761
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
3762
|
+
itemRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
3763
|
+
listNoDataRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
3764
|
+
focusedItemIndex: PropTypes.Requireable<(...args: any[]) => any>;
|
|
3765
|
+
header: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
3766
|
+
footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
3767
|
+
};
|
|
3768
|
+
/** @hidden */
|
|
3769
|
+
static defaultProps: {
|
|
3770
|
+
autoClose: boolean;
|
|
3771
|
+
required: boolean;
|
|
3772
|
+
size: "small" | "large" | "medium" | null | undefined;
|
|
3773
|
+
rounded: "small" | "large" | "medium" | "full" | null | undefined;
|
|
3774
|
+
fillMode: "flat" | "solid" | "outline" | null | undefined;
|
|
3775
|
+
groupMode: string | undefined;
|
|
3776
|
+
skipDisabledItems: boolean;
|
|
3777
|
+
prefix: undefined;
|
|
3778
|
+
suffix: undefined;
|
|
3779
|
+
popupSettings: {
|
|
3780
|
+
height: string;
|
|
3781
|
+
};
|
|
3782
|
+
validityStyles: boolean;
|
|
3783
|
+
};
|
|
3784
|
+
/** @hidden */
|
|
3785
|
+
readonly state: MultiSelectState;
|
|
3786
|
+
private _element;
|
|
3787
|
+
private _valueItemsDuringOnChange;
|
|
3788
|
+
private get _inputId();
|
|
3789
|
+
protected readonly base: DropDownBase;
|
|
3790
|
+
private readonly _tags;
|
|
3791
|
+
private _input;
|
|
3792
|
+
private _adaptiveInput;
|
|
3793
|
+
private _skipFocusEvent;
|
|
3794
|
+
private _lastSelectedOrDeslectedItemIndex;
|
|
3795
|
+
private itemHeight;
|
|
3796
|
+
protected scrollToFocused: boolean;
|
|
3797
|
+
private localization;
|
|
3798
|
+
private observerResize?;
|
|
3799
|
+
private get document();
|
|
3800
|
+
constructor(props: MultiSelectProps);
|
|
3801
|
+
/** @hidden */
|
|
3802
|
+
focus: () => void;
|
|
3803
|
+
/** @hidden */
|
|
3804
|
+
get element(): HTMLSpanElement | null;
|
|
3805
|
+
/** @hidden */
|
|
3806
|
+
get opened(): boolean;
|
|
3807
|
+
/** @hidden */
|
|
3808
|
+
get tagsToRender(): Array<TagData>;
|
|
3809
|
+
/**
|
|
3810
|
+
* The mobile mode of the ComboBox.
|
|
3811
|
+
*/
|
|
3812
|
+
get mobileMode(): boolean;
|
|
3813
|
+
/**
|
|
3814
|
+
* Represents the value of the MultiSelect.
|
|
3815
|
+
*/
|
|
3816
|
+
get value(): Array<any>;
|
|
3817
|
+
/**
|
|
3818
|
+
* Gets the `name` property of the MultiSelect.
|
|
3819
|
+
*/
|
|
3820
|
+
get name(): string | undefined;
|
|
3821
|
+
/**
|
|
3822
|
+
* Represents the validity state into which the MultiSelect is set.
|
|
3823
|
+
*/
|
|
3824
|
+
get validity(): FormComponentValidity;
|
|
3825
|
+
/** @hidden */
|
|
3826
|
+
protected get required(): boolean;
|
|
3827
|
+
protected get validityStyles(): boolean;
|
|
3828
|
+
/** @hidden */
|
|
3829
|
+
componentDidUpdate(prevProps: MultiSelectProps, prevState: MultiSelectState): void;
|
|
3830
|
+
/** @hidden */
|
|
3831
|
+
componentDidMount(): void;
|
|
3832
|
+
/** @hidden */
|
|
3833
|
+
componentWillUnmount(): void;
|
|
3834
|
+
/** @hidden */
|
|
3835
|
+
handleItemSelect: (index: number, state: MultiSelectInternalState) => void;
|
|
3836
|
+
/** @hidden */
|
|
3837
|
+
onTagDelete: (itemsToRemove: Array<any>, event: React_2.MouseEvent<HTMLSpanElement>) => void;
|
|
3838
|
+
/** @hidden */
|
|
3839
|
+
onNavigate(state: MultiSelectInternalState, keyCode: number, skipItems?: number): void;
|
|
3840
|
+
/** @hidden */
|
|
3841
|
+
itemFocus: (index: number, state: MultiSelectInternalState) => void;
|
|
3842
|
+
/** @hidden */
|
|
3843
|
+
render(): JSX_2.Element;
|
|
3844
|
+
private componentRef;
|
|
3845
|
+
private renderSearchBar;
|
|
3846
|
+
private searchbarRef;
|
|
3847
|
+
private onChangeHandler;
|
|
3848
|
+
private clearButtonClick;
|
|
3849
|
+
private onInputKeyDown;
|
|
3850
|
+
private onTagsNavigate;
|
|
3851
|
+
private triggerOnChange;
|
|
3852
|
+
private selectFocusedItem;
|
|
3853
|
+
private setItems;
|
|
3854
|
+
private getFocusedState;
|
|
3855
|
+
private listContainerContent;
|
|
3856
|
+
private renderListContainer;
|
|
3857
|
+
private renderAdaptiveListContainer;
|
|
3858
|
+
private closePopup;
|
|
3859
|
+
private onCancel;
|
|
3860
|
+
private renderList;
|
|
3861
|
+
private onScroll;
|
|
3862
|
+
private customItemSelect;
|
|
3863
|
+
private handleWrapperClick;
|
|
3864
|
+
private handleItemClick;
|
|
3865
|
+
private handleBlur;
|
|
3866
|
+
private handleFocus;
|
|
3867
|
+
private onPopupOpened;
|
|
3868
|
+
private onPopupClosed;
|
|
3869
|
+
private focusElement;
|
|
3870
|
+
private applyState;
|
|
3871
|
+
private setValidity;
|
|
3872
|
+
private calculateMedia;
|
|
3873
|
+
/**
|
|
3874
|
+
* Updates the state of the MultiSelect when the complex keyboard navigation that
|
|
3875
|
+
* includes key combinations with the Ctrl/Command, Shift, Home and End keys
|
|
3876
|
+
*
|
|
3877
|
+
* @param {Array<string | Object>} dataToSet Defines the array of new values that will be applied to the MultiSelect
|
|
3878
|
+
* @param {MultiSelectInternalState} state The current state of the MultiSelect
|
|
3879
|
+
*/
|
|
3880
|
+
private updateStateOnKeyboardNavigation;
|
|
3881
|
+
/**
|
|
3882
|
+
* Returns the last element that was selected or deselected. Needed for the keyboard navigation specifications
|
|
3883
|
+
*
|
|
3884
|
+
* @param {number} correction A correction is needed depending on if UP or DOWN key is pressed
|
|
3885
|
+
*/
|
|
3886
|
+
private getLastSelectedOrDeselectedIndex;
|
|
3887
|
+
}
|
|
3888
|
+
|
|
3889
|
+
/**
|
|
3890
|
+
* @hidden
|
|
3891
|
+
*/
|
|
3892
|
+
declare class Navigation {
|
|
3893
|
+
navigate(args: {
|
|
3894
|
+
keyCode: number;
|
|
3895
|
+
current: number;
|
|
3896
|
+
max: number;
|
|
3897
|
+
min: number;
|
|
3898
|
+
skipItems?: number;
|
|
3899
|
+
}): number | undefined;
|
|
3900
|
+
private next;
|
|
3901
|
+
}
|
|
3902
|
+
|
|
3903
|
+
/**
|
|
3904
|
+
* @hidden
|
|
3905
|
+
*/
|
|
3906
|
+
export declare const nodata = "dropdowns.nodata";
|
|
3907
|
+
|
|
3908
|
+
/**
|
|
3909
|
+
* @hidden
|
|
3910
|
+
*/
|
|
3911
|
+
declare interface OpenEvent<T> extends DropdownEvent<T> {
|
|
3912
|
+
}
|
|
3913
|
+
|
|
3914
|
+
/**
|
|
3915
|
+
* Represents the `skip` and `take` configurations which are wrapped in the `page` object.
|
|
3916
|
+
*/
|
|
3917
|
+
export declare interface Page {
|
|
3918
|
+
/**
|
|
3919
|
+
* The number of records to skip.
|
|
3920
|
+
*/
|
|
3921
|
+
skip: number;
|
|
3922
|
+
/**
|
|
3923
|
+
* The number of records to take.
|
|
3924
|
+
*/
|
|
3925
|
+
take: number;
|
|
3926
|
+
}
|
|
3927
|
+
|
|
3928
|
+
/**
|
|
3929
|
+
* @hidden
|
|
3930
|
+
*/
|
|
3931
|
+
declare interface PageChangeEvent<T> extends DropdownEvent<T> {
|
|
3932
|
+
page: Page;
|
|
3933
|
+
}
|
|
3934
|
+
|
|
3935
|
+
/**
|
|
3936
|
+
* @hidden
|
|
3937
|
+
*/
|
|
3938
|
+
export declare const scrollToItem: (scrollElem: HTMLDivElement, list: HTMLUListElement, itemIndex: number, translate: number, virtualScroll: boolean) => void;
|
|
3939
|
+
|
|
3940
|
+
/**
|
|
3941
|
+
* @hidden
|
|
3942
|
+
*/
|
|
3943
|
+
export declare class SearchBar extends React_2.Component<SearchBarProps> {
|
|
3944
|
+
private _input;
|
|
3945
|
+
/**
|
|
3946
|
+
* @hidden
|
|
3947
|
+
*/
|
|
3948
|
+
get input(): HTMLInputElement | null;
|
|
3949
|
+
componentDidUpdate(prevProps: SearchBarProps): void;
|
|
3950
|
+
render(): string | number | boolean | Iterable<React_2.ReactNode> | JSX_2.Element | null | undefined;
|
|
3951
|
+
}
|
|
3952
|
+
|
|
3953
|
+
/**
|
|
3954
|
+
* @hidden
|
|
3955
|
+
*/
|
|
3956
|
+
declare interface SearchBarProps {
|
|
3957
|
+
value: string;
|
|
3958
|
+
onChange: React_2.FormEventHandler<HTMLInputElement>;
|
|
3959
|
+
render?: (rendering: React_2.ReactElement<HTMLSpanElement>) => React_2.ReactNode;
|
|
3960
|
+
id?: string;
|
|
3961
|
+
placeholder?: string;
|
|
3962
|
+
title?: string;
|
|
3963
|
+
tabIndex?: number;
|
|
3964
|
+
size?: number;
|
|
3965
|
+
suggestedText?: string;
|
|
3966
|
+
focused?: boolean;
|
|
3967
|
+
onKeyDown?: React_2.KeyboardEventHandler<HTMLInputElement>;
|
|
3968
|
+
onFocus?: React_2.FocusEventHandler<HTMLInputElement>;
|
|
3969
|
+
onBlur?: React_2.FocusEventHandler<HTMLInputElement>;
|
|
3970
|
+
onClick?: React_2.MouseEventHandler<HTMLInputElement>;
|
|
3971
|
+
disabled?: boolean;
|
|
3972
|
+
readOnly?: boolean;
|
|
3973
|
+
expanded?: boolean;
|
|
3974
|
+
owns?: string;
|
|
3975
|
+
role?: string;
|
|
3976
|
+
name?: string;
|
|
3977
|
+
activedescendant?: string;
|
|
3978
|
+
accessKey?: string;
|
|
3979
|
+
ariaLabelledBy?: string;
|
|
3980
|
+
ariaDescribedBy?: string;
|
|
3981
|
+
ariaRequired?: boolean;
|
|
3982
|
+
}
|
|
3983
|
+
|
|
3984
|
+
/**
|
|
3985
|
+
* Represents the `Suggestion` object of the AutoComplete.
|
|
3986
|
+
*/
|
|
3987
|
+
export declare interface Suggestion {
|
|
3988
|
+
/**
|
|
3989
|
+
* Represents the typed text of the user.
|
|
3990
|
+
*/
|
|
3991
|
+
readonly userInput: string;
|
|
3992
|
+
/**
|
|
3993
|
+
* Represents the suggested text without the user input.
|
|
3994
|
+
*/
|
|
3995
|
+
readonly value: string;
|
|
3996
|
+
}
|
|
3997
|
+
|
|
3998
|
+
/**
|
|
3999
|
+
* Represents the tag data.
|
|
4000
|
+
*/
|
|
4001
|
+
declare interface TagData {
|
|
4002
|
+
/**
|
|
4003
|
+
* Represents the text of the tag.
|
|
4004
|
+
*/
|
|
4005
|
+
text: string;
|
|
4006
|
+
/**
|
|
4007
|
+
* Represents the data items which correspond to the tag.
|
|
4008
|
+
*/
|
|
4009
|
+
data: Array<any>;
|
|
4010
|
+
}
|
|
4011
|
+
export { TagData as MultiSelectTagData }
|
|
4012
|
+
export { TagData }
|
|
4013
|
+
|
|
4014
|
+
/**
|
|
4015
|
+
* @hidden
|
|
4016
|
+
*/
|
|
4017
|
+
export declare class TagList extends React_2.Component<TagListProps, {}> {
|
|
4018
|
+
render(): JSX_2.Element;
|
|
4019
|
+
}
|
|
4020
|
+
|
|
4021
|
+
/**
|
|
4022
|
+
* @hidden
|
|
4023
|
+
*/
|
|
4024
|
+
declare interface TagListProps {
|
|
4025
|
+
children?: React_2.ReactNode;
|
|
4026
|
+
data: Array<TagData>;
|
|
4027
|
+
guid: string;
|
|
4028
|
+
focused?: TagData;
|
|
4029
|
+
onTagDelete: (items: Array<any>, event: React_2.MouseEvent<HTMLSpanElement>) => void;
|
|
4030
|
+
tagRender?: (tagData: TagData, tag: React_2.ReactElement) => React_2.ReactElement;
|
|
4031
|
+
tag?: React_2.ComponentType<{
|
|
4032
|
+
tagData: TagData;
|
|
4033
|
+
guid: string;
|
|
4034
|
+
focusedTag?: TagData;
|
|
4035
|
+
onTagDelete: (items: Array<any>, event: React_2.MouseEvent<HTMLSpanElement>) => void;
|
|
4036
|
+
}>;
|
|
4037
|
+
size?: null | 'small' | 'medium' | 'large';
|
|
4038
|
+
}
|
|
4039
|
+
|
|
4040
|
+
/**
|
|
4041
|
+
* The props of the `ValueHolder` component ([see example]({% slug customrendering_dropdowntree %}#toc-items-and-value-element)).
|
|
4042
|
+
*/
|
|
4043
|
+
export declare interface ValueHolderProps {
|
|
4044
|
+
children?: React.ReactNode;
|
|
4045
|
+
item?: any;
|
|
4046
|
+
}
|
|
4047
|
+
|
|
4048
|
+
/**
|
|
4049
|
+
* The virtualization settings.
|
|
4050
|
+
*/
|
|
4051
|
+
export declare interface VirtualizationSettings {
|
|
4052
|
+
/**
|
|
4053
|
+
* The number of the requested records.
|
|
4054
|
+
*/
|
|
4055
|
+
pageSize: number;
|
|
4056
|
+
/**
|
|
4057
|
+
* The number of records to skip.
|
|
4058
|
+
*/
|
|
4059
|
+
skip: number;
|
|
4060
|
+
/**
|
|
4061
|
+
* The number of all records.
|
|
4062
|
+
*/
|
|
4063
|
+
total: number;
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
/**
|
|
4067
|
+
* @hidden
|
|
4068
|
+
*/
|
|
4069
|
+
declare class VirtualScroll {
|
|
4070
|
+
container: HTMLDivElement | null;
|
|
4071
|
+
scrollElement: HTMLDivElement | null;
|
|
4072
|
+
list: HTMLUListElement | null;
|
|
4073
|
+
containerHeight: number;
|
|
4074
|
+
skip: number;
|
|
4075
|
+
total: number;
|
|
4076
|
+
enabled: boolean;
|
|
4077
|
+
pageSize: number;
|
|
4078
|
+
itemHeight: number;
|
|
4079
|
+
PageChange: ((event: Page, syntheticEvent: React.SyntheticEvent<any>) => void) | null;
|
|
4080
|
+
private prevScrollPos;
|
|
4081
|
+
private listTranslate;
|
|
4082
|
+
private scrollSyncing;
|
|
4083
|
+
constructor();
|
|
4084
|
+
get translate(): number;
|
|
4085
|
+
scrollerRef: (element: HTMLDivElement | null) => void;
|
|
4086
|
+
calcScrollElementHeight: () => boolean;
|
|
4087
|
+
changePage(skip: number, e: React.SyntheticEvent<HTMLElement>): void;
|
|
4088
|
+
translateTo(dY: number): void;
|
|
4089
|
+
reset(): void;
|
|
4090
|
+
scrollToEnd(): void;
|
|
4091
|
+
localScrollUp(e: React.SyntheticEvent<HTMLElement>): void;
|
|
4092
|
+
localScrollDown(e: React.SyntheticEvent<HTMLElement>): void;
|
|
4093
|
+
scrollNonStrict(e: React.SyntheticEvent<HTMLElement>): void;
|
|
4094
|
+
scrollHandler(e: React.SyntheticEvent<HTMLElement>): void;
|
|
4095
|
+
validateTranslate(translate: number): number;
|
|
4096
|
+
}
|
|
4097
|
+
|
|
4098
|
+
export { }
|