@progress/kendo-react-dropdowns 6.1.1 → 7.0.0-develop.10
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/{dist/es/AutoComplete → AutoComplete}/AutoComplete.d.ts +12 -8
- package/{dist/npm/AutoComplete → AutoComplete}/AutoCompleteProps.d.ts +4 -1
- package/{dist/es/ComboBox → ComboBox}/ComboBox.d.ts +12 -8
- package/{dist/es/ComboBox → ComboBox}/ComboBoxProps.d.ts +4 -1
- package/{dist/es/DropDownList → DropDownList}/DropDownList.d.ts +9 -5
- package/{dist/es/DropDownList → DropDownList}/DropDownListProps.d.ts +4 -1
- package/{dist/es/DropDownTree → DropDownTree}/DropDownTree.d.ts +4 -0
- package/{dist/npm/DropDownTree → DropDownTree}/DropDownTreeProps.d.ts +4 -1
- package/DropDownTree/ListNoData.d.ts +10 -0
- package/DropDownTree/useDropdownWidth.d.ts +9 -0
- package/LICENSE.md +1 -1
- package/{dist/es/MultiColumnComboBox → MultiColumnComboBox}/MultiColumnComboBox.d.ts +4 -0
- package/{dist/npm/MultiSelect → MultiSelect}/MultiSelect.d.ts +9 -5
- package/{dist/es/MultiSelect → MultiSelect}/MultiSelectProps.d.ts +4 -1
- package/{dist/npm/MultiSelect → MultiSelect}/TagList.d.ts +5 -1
- package/{dist/es/MultiSelectTree → MultiSelectTree}/MultiSelectTree.d.ts +4 -0
- package/{dist/es/MultiSelectTree → MultiSelectTree}/MultiSelectTreeProps.d.ts +5 -1
- package/{dist/npm/MultiSelectTree → MultiSelectTree}/utils.d.ts +5 -1
- package/{dist/npm/common → common}/AdaptiveMode.d.ts +5 -1
- package/common/ClearButton.d.ts +18 -0
- package/{dist/npm/common → common}/DropDownBase.d.ts +5 -1
- package/{dist/es/common → common}/GroupStickyHeader.d.ts +5 -1
- package/{dist/es/common → common}/List.d.ts +8 -3
- package/common/ListContainer.d.ts +22 -0
- package/common/ListDefaultItem.d.ts +20 -0
- package/{dist/npm/common → common}/ListFilter.d.ts +4 -0
- package/{dist/npm/common → common}/ListGroupItem.d.ts +5 -1
- package/{dist/npm/common → common}/ListItem.d.ts +5 -1
- package/common/MultiColumnList.d.ts +9 -0
- package/common/Navigation.d.ts +17 -0
- package/{dist/es/common → common}/SearchBar.d.ts +5 -1
- package/{dist/npm/common → common}/VirtualScroll.d.ts +4 -1
- package/common/constants.d.ts +8 -0
- package/{dist/es/common → common}/events.d.ts +4 -1
- package/{dist/npm/common → common}/filterDescriptor.d.ts +4 -0
- package/{dist/es/common → common}/settings.d.ts +5 -2
- package/{dist/npm/common → common}/utils.d.ts +4 -0
- package/dist/cdn/js/kendo-react-dropdowns.js +5 -1
- package/index.d.ts +29 -0
- package/index.js +5 -0
- package/index.mjs +4397 -0
- package/{dist/npm/messages → messages}/index.d.ts +4 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +34 -62
- package/about.md +0 -3
- package/dist/es/AutoComplete/AutoComplete.js +0 -652
- package/dist/es/AutoComplete/AutoCompleteProps.d.ts +0 -243
- package/dist/es/AutoComplete/AutoCompleteProps.js +0 -2
- package/dist/es/ComboBox/ComboBox.js +0 -915
- package/dist/es/ComboBox/ComboBoxProps.js +0 -2
- package/dist/es/DropDownList/DropDownList.js +0 -887
- package/dist/es/DropDownList/DropDownListProps.js +0 -2
- package/dist/es/DropDownTree/DropDownTree.js +0 -540
- package/dist/es/DropDownTree/DropDownTreeProps.d.ts +0 -294
- package/dist/es/DropDownTree/DropDownTreeProps.js +0 -2
- package/dist/es/DropDownTree/ListNoData.d.ts +0 -6
- package/dist/es/DropDownTree/ListNoData.js +0 -8
- package/dist/es/DropDownTree/useDropdownWidth.d.ts +0 -5
- package/dist/es/DropDownTree/useDropdownWidth.js +0 -13
- package/dist/es/MultiColumnComboBox/MultiColumnComboBox.js +0 -213
- package/dist/es/MultiSelect/MultiSelect.d.ts +0 -256
- package/dist/es/MultiSelect/MultiSelect.js +0 -1110
- package/dist/es/MultiSelect/MultiSelectProps.js +0 -2
- package/dist/es/MultiSelect/TagList.d.ts +0 -38
- package/dist/es/MultiSelect/TagList.js +0 -39
- package/dist/es/MultiSelectTree/MultiSelectTree.js +0 -619
- package/dist/es/MultiSelectTree/MultiSelectTreeProps.js +0 -2
- package/dist/es/MultiSelectTree/utils.d.ts +0 -17
- package/dist/es/MultiSelectTree/utils.js +0 -191
- package/dist/es/common/AdaptiveMode.d.ts +0 -21
- package/dist/es/common/AdaptiveMode.js +0 -45
- package/dist/es/common/ClearButton.d.ts +0 -14
- package/dist/es/common/ClearButton.js +0 -39
- package/dist/es/common/DropDownBase.d.ts +0 -175
- package/dist/es/common/DropDownBase.js +0 -297
- package/dist/es/common/GroupStickyHeader.js +0 -34
- package/dist/es/common/List.js +0 -75
- package/dist/es/common/ListContainer.d.ts +0 -18
- package/dist/es/common/ListContainer.js +0 -43
- package/dist/es/common/ListDefaultItem.d.ts +0 -16
- package/dist/es/common/ListDefaultItem.js +0 -36
- package/dist/es/common/ListFilter.d.ts +0 -19
- package/dist/es/common/ListFilter.js +0 -37
- package/dist/es/common/ListGroupItem.d.ts +0 -33
- package/dist/es/common/ListGroupItem.js +0 -33
- package/dist/es/common/ListItem.d.ts +0 -61
- package/dist/es/common/ListItem.js +0 -44
- package/dist/es/common/MultiColumnList.d.ts +0 -6
- package/dist/es/common/MultiColumnList.js +0 -22
- package/dist/es/common/Navigation.d.ts +0 -13
- package/dist/es/common/Navigation.js +0 -34
- package/dist/es/common/SearchBar.js +0 -62
- package/dist/es/common/VirtualScroll.d.ts +0 -42
- package/dist/es/common/VirtualScroll.js +0 -161
- package/dist/es/common/constants.d.ts +0 -4
- package/dist/es/common/constants.js +0 -4
- package/dist/es/common/events.js +0 -1
- package/dist/es/common/filterDescriptor.d.ts +0 -41
- package/dist/es/common/filterDescriptor.js +0 -2
- package/dist/es/common/settings.js +0 -8
- package/dist/es/common/utils.d.ts +0 -62
- package/dist/es/common/utils.js +0 -194
- package/dist/es/main.d.ts +0 -25
- package/dist/es/main.js +0 -19
- package/dist/es/messages/index.d.ts +0 -40
- package/dist/es/messages/index.js +0 -41
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/npm/AutoComplete/AutoComplete.d.ts +0 -230
- package/dist/npm/AutoComplete/AutoComplete.js +0 -655
- package/dist/npm/AutoComplete/AutoCompleteProps.js +0 -3
- package/dist/npm/ComboBox/ComboBox.d.ts +0 -248
- package/dist/npm/ComboBox/ComboBox.js +0 -918
- package/dist/npm/ComboBox/ComboBoxProps.d.ts +0 -313
- package/dist/npm/ComboBox/ComboBoxProps.js +0 -3
- package/dist/npm/DropDownList/DropDownList.d.ts +0 -258
- package/dist/npm/DropDownList/DropDownList.js +0 -890
- package/dist/npm/DropDownList/DropDownListProps.d.ts +0 -326
- package/dist/npm/DropDownList/DropDownListProps.js +0 -3
- package/dist/npm/DropDownTree/DropDownTree.d.ts +0 -70
- package/dist/npm/DropDownTree/DropDownTree.js +0 -543
- package/dist/npm/DropDownTree/DropDownTreeProps.js +0 -3
- package/dist/npm/DropDownTree/ListNoData.d.ts +0 -6
- package/dist/npm/DropDownTree/ListNoData.js +0 -12
- package/dist/npm/DropDownTree/useDropdownWidth.d.ts +0 -5
- package/dist/npm/DropDownTree/useDropdownWidth.js +0 -17
- package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.d.ts +0 -287
- package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.js +0 -216
- package/dist/npm/MultiSelect/MultiSelect.js +0 -1113
- package/dist/npm/MultiSelect/MultiSelectProps.d.ts +0 -314
- package/dist/npm/MultiSelect/MultiSelectProps.js +0 -3
- package/dist/npm/MultiSelect/TagList.js +0 -41
- package/dist/npm/MultiSelectTree/MultiSelectTree.d.ts +0 -81
- package/dist/npm/MultiSelectTree/MultiSelectTree.js +0 -622
- package/dist/npm/MultiSelectTree/MultiSelectTreeProps.d.ts +0 -320
- package/dist/npm/MultiSelectTree/MultiSelectTreeProps.js +0 -3
- package/dist/npm/MultiSelectTree/utils.js +0 -196
- package/dist/npm/common/AdaptiveMode.js +0 -49
- package/dist/npm/common/ClearButton.d.ts +0 -14
- package/dist/npm/common/ClearButton.js +0 -41
- package/dist/npm/common/DropDownBase.js +0 -299
- package/dist/npm/common/GroupStickyHeader.d.ts +0 -24
- package/dist/npm/common/GroupStickyHeader.js +0 -36
- package/dist/npm/common/List.d.ts +0 -45
- package/dist/npm/common/List.js +0 -77
- package/dist/npm/common/ListContainer.d.ts +0 -18
- package/dist/npm/common/ListContainer.js +0 -45
- package/dist/npm/common/ListDefaultItem.d.ts +0 -16
- package/dist/npm/common/ListDefaultItem.js +0 -38
- package/dist/npm/common/ListFilter.js +0 -39
- package/dist/npm/common/ListGroupItem.js +0 -35
- package/dist/npm/common/ListItem.js +0 -46
- package/dist/npm/common/MultiColumnList.d.ts +0 -6
- package/dist/npm/common/MultiColumnList.js +0 -26
- package/dist/npm/common/Navigation.d.ts +0 -13
- package/dist/npm/common/Navigation.js +0 -37
- package/dist/npm/common/SearchBar.d.ts +0 -43
- package/dist/npm/common/SearchBar.js +0 -64
- package/dist/npm/common/VirtualScroll.js +0 -163
- package/dist/npm/common/constants.d.ts +0 -4
- package/dist/npm/common/constants.js +0 -7
- package/dist/npm/common/events.d.ts +0 -73
- package/dist/npm/common/events.js +0 -2
- package/dist/npm/common/filterDescriptor.js +0 -3
- package/dist/npm/common/settings.d.ts +0 -114
- package/dist/npm/common/settings.js +0 -11
- package/dist/npm/common/utils.js +0 -211
- package/dist/npm/main.d.ts +0 -25
- package/dist/npm/main.js +0 -62
- package/dist/npm/messages/index.js +0 -44
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/systemjs/kendo-react-dropdowns.js +0 -1
- package/e2e-next/combobox.basic.ts +0 -24
- package/e2e-next/dropdownlist.basic.tests.ts +0 -24
- package/e2e-next/dropdowntree.basic.tests.ts +0 -24
- package/e2e-next/multicolumncombobox.basic.tests.ts +0 -24
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ComboBoxBlurEvent, ComboBoxChangeEvent, ComboBoxCloseEvent, ComboBoxFilterChangeEvent, ComboBoxFocusEvent, ComboBoxOpenEvent, ComboBoxPageChangeEvent, ComboBoxProps } from '../ComboBox/ComboBoxProps';
|
|
3
|
-
import { DropDownsPopupSettings, VirtualizationSettings } from '../common/settings';
|
|
4
|
-
import { ListItemProps } from '../common/ListItem';
|
|
5
|
-
/**
|
|
6
|
-
* The represents the interface of the MultiColumnComboBox columns.
|
|
7
|
-
*/
|
|
8
|
-
export interface MultiColumnComboBoxColumn {
|
|
9
|
-
/**
|
|
10
|
-
* The unique id of the column.
|
|
11
|
-
*/
|
|
12
|
-
uniqueKey?: string;
|
|
13
|
-
/**
|
|
14
|
-
* The field of the column.
|
|
15
|
-
*/
|
|
16
|
-
field?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The header of the column.
|
|
19
|
-
*/
|
|
20
|
-
header?: React.ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* Represents the width of the column. If the width is not specified it is applied the default width of `200px`.
|
|
23
|
-
*/
|
|
24
|
-
width?: string | number;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Represents the properties of the [MultiColumnComboBox]({% slug api_dropdowns_multicolumncombobox %}) component.
|
|
28
|
-
*/
|
|
29
|
-
export interface MultiColumnComboBoxProps extends ComboBoxProps {
|
|
30
|
-
/**
|
|
31
|
-
* Determines the columns array of the MultiColumnComboBox.
|
|
32
|
-
*/
|
|
33
|
-
columns: MultiColumnComboBoxColumn[];
|
|
34
|
-
/**
|
|
35
|
-
* Sets the data of the MultiColumnComboBox.
|
|
36
|
-
*/
|
|
37
|
-
data?: any[];
|
|
38
|
-
/**
|
|
39
|
-
* Sets the opened and closed state of the MultiColumnComboBox.
|
|
40
|
-
*/
|
|
41
|
-
opened?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The styles that are applied to the MultiColumnComboBox.
|
|
44
|
-
*/
|
|
45
|
-
style?: React.CSSProperties;
|
|
46
|
-
/**
|
|
47
|
-
* Sets the value of the MultiColumnComboBox. It can either be of the primitive (string, numbers) or of the complex (objects) type.
|
|
48
|
-
*/
|
|
49
|
-
value?: any;
|
|
50
|
-
/**
|
|
51
|
-
* Sets the default value of the MultiColumnComboBox. Similar to the native `select` HTML element.
|
|
52
|
-
*/
|
|
53
|
-
defaultValue?: any;
|
|
54
|
-
/**
|
|
55
|
-
* Sets additional classes to the MultiColumnComboBox.
|
|
56
|
-
*/
|
|
57
|
-
className?: string;
|
|
58
|
-
/**
|
|
59
|
-
* 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.
|
|
60
|
-
*/
|
|
61
|
-
clearButton?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* The hint that is displayed when the MultiColumnComboBox is empty.
|
|
64
|
-
*/
|
|
65
|
-
placeholder?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Specifies whether the MultiColumnComboBox allows user-defined values that are not present in the dataset. Defaults to `false`.
|
|
68
|
-
*/
|
|
69
|
-
allowCustom?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Sets the disabled state of the MultiColumnComboBox.
|
|
72
|
-
*/
|
|
73
|
-
disabled?: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Enables the filtering functionality of the MultiColumnComboBox.
|
|
76
|
-
*/
|
|
77
|
-
filterable?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Sets the value of MultiColumnComboBox input. Useful for making the MultiColumnComboBox input a controlled component.
|
|
80
|
-
*/
|
|
81
|
-
filter?: string | null;
|
|
82
|
-
/**
|
|
83
|
-
* Sets the loading state of the MultiColumnComboBox.
|
|
84
|
-
*/
|
|
85
|
-
loading?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Specifies the `tabIndex` of the MultiColumnComboBox.
|
|
88
|
-
*/
|
|
89
|
-
tabIndex?: number;
|
|
90
|
-
/**
|
|
91
|
-
* Specifies the `accessKey` of the MultiColumnComboBox.
|
|
92
|
-
*/
|
|
93
|
-
accessKey?: string;
|
|
94
|
-
/**
|
|
95
|
-
* Sets the key for comparing the data items of the MultiColumnComboBox. If `dataItemKey` is not set, the MultiColumnComboBox compares the items by reference.
|
|
96
|
-
*/
|
|
97
|
-
dataItemKey?: string;
|
|
98
|
-
/**
|
|
99
|
-
* Renders a floating label for the MultiColumnComboBox.
|
|
100
|
-
*/
|
|
101
|
-
label?: string;
|
|
102
|
-
/**
|
|
103
|
-
* Configures the popup of the MultiColumnComboBox.
|
|
104
|
-
*/
|
|
105
|
-
popupSettings?: DropDownsPopupSettings;
|
|
106
|
-
/**
|
|
107
|
-
* Configures the virtual scrolling of the MultiColumnComboBox.
|
|
108
|
-
*/
|
|
109
|
-
virtual?: VirtualizationSettings;
|
|
110
|
-
/**
|
|
111
|
-
* 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.
|
|
112
|
-
*/
|
|
113
|
-
focusedItemIndex?: (data: any, inputText: string, textField?: string) => number;
|
|
114
|
-
/**
|
|
115
|
-
* Fires each time the popup of the MultiColumnComboBox is about to open.
|
|
116
|
-
*/
|
|
117
|
-
onOpen?: (event: ComboBoxOpenEvent) => void;
|
|
118
|
-
/**
|
|
119
|
-
* Fires each time the popup of the MultiColumnComboBox is about to close.
|
|
120
|
-
*/
|
|
121
|
-
onClose?: (event: ComboBoxCloseEvent) => void;
|
|
122
|
-
/**
|
|
123
|
-
* Fires each time the user focuses the MultiColumnComboBox.
|
|
124
|
-
*/
|
|
125
|
-
onFocus?: (event: ComboBoxFocusEvent) => void;
|
|
126
|
-
/**
|
|
127
|
-
* Fires each time the MultiColumnComboBox gets blurred.
|
|
128
|
-
*/
|
|
129
|
-
onBlur?: (event: ComboBoxBlurEvent) => void;
|
|
130
|
-
/**
|
|
131
|
-
* Fires each time the value of the MultiColumnComboBox is about to change.
|
|
132
|
-
*/
|
|
133
|
-
onChange?: (event: ComboBoxChangeEvent) => void;
|
|
134
|
-
/**
|
|
135
|
-
* Fires each time the user types in the filter input. You can filter the source based on the passed filtration value.
|
|
136
|
-
*/
|
|
137
|
-
onFilterChange?: (event: ComboBoxFilterChangeEvent) => void;
|
|
138
|
-
/**
|
|
139
|
-
* Fires when both the virtual scrolling of the MultiColumnComboBox is enabled and the component requires data for another page.
|
|
140
|
-
*/
|
|
141
|
-
onPageChange?: (event: ComboBoxPageChangeEvent) => void;
|
|
142
|
-
/**
|
|
143
|
-
* @hidden
|
|
144
|
-
*/
|
|
145
|
-
onGroupScroll?: (event: {
|
|
146
|
-
group?: string;
|
|
147
|
-
}) => void;
|
|
148
|
-
/**
|
|
149
|
-
* Fires when a MultiColumnComboBox list item is about to be rendered. Used to override the default appearance of the list items.
|
|
150
|
-
*/
|
|
151
|
-
itemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React.ReactNode;
|
|
152
|
-
/**
|
|
153
|
-
* Sets the header component of the MultiColumnComboBox.
|
|
154
|
-
*/
|
|
155
|
-
header?: React.ReactNode;
|
|
156
|
-
/**
|
|
157
|
-
* Sets the footer component of the MultiColumnComboBox.
|
|
158
|
-
*/
|
|
159
|
-
footer?: React.ReactNode;
|
|
160
|
-
/**
|
|
161
|
-
* Configures the `size` of the MultiColumnComboBox.
|
|
162
|
-
*
|
|
163
|
-
* The available options are:
|
|
164
|
-
* - small
|
|
165
|
-
* - medium
|
|
166
|
-
* - large
|
|
167
|
-
* - null—Does not set a size `className`.
|
|
168
|
-
*
|
|
169
|
-
* @default `medium`
|
|
170
|
-
*/
|
|
171
|
-
size?: null | 'small' | 'medium' | 'large';
|
|
172
|
-
/**
|
|
173
|
-
* Configures the `roundness` of the MultiColumnComboBox.
|
|
174
|
-
*
|
|
175
|
-
* The available options are:
|
|
176
|
-
* - small
|
|
177
|
-
* - medium
|
|
178
|
-
* - large
|
|
179
|
-
* - full
|
|
180
|
-
* - null—Does not set a rounded `className`.
|
|
181
|
-
*
|
|
182
|
-
* @default `medium`
|
|
183
|
-
*/
|
|
184
|
-
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
185
|
-
/**
|
|
186
|
-
* Configures the `fillMode` of the MultiColumnComboBox.
|
|
187
|
-
*
|
|
188
|
-
* The available options are:
|
|
189
|
-
* - solid
|
|
190
|
-
* - flat
|
|
191
|
-
* - outline
|
|
192
|
-
* - null—Does not set a fillMode `className`.
|
|
193
|
-
*
|
|
194
|
-
* @default `solid`
|
|
195
|
-
*/
|
|
196
|
-
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Represents the target(element and props) of the MultiColumnComboBoxChangeEvent.
|
|
200
|
-
*/
|
|
201
|
-
export interface MultiColumnComboBoxHandle {
|
|
202
|
-
/**
|
|
203
|
-
* The current element or `null` of there is no one.
|
|
204
|
-
*/
|
|
205
|
-
element: HTMLSpanElement | null;
|
|
206
|
-
/**
|
|
207
|
-
* The value of the MultiColumnComboBox.
|
|
208
|
-
*/
|
|
209
|
-
value: any;
|
|
210
|
-
/**
|
|
211
|
-
* The props values of the MultiColumnComboBox.
|
|
212
|
-
*/
|
|
213
|
-
props: MultiColumnComboBoxProps;
|
|
214
|
-
/**
|
|
215
|
-
* The focus event callback.
|
|
216
|
-
*/
|
|
217
|
-
focus: () => void;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Represents the type of the MultiColumnComboBoxChangeEvent.
|
|
221
|
-
*/
|
|
222
|
-
export interface MultiColumnComboBoxChangeEvent {
|
|
223
|
-
/**
|
|
224
|
-
* The value of the MultiColumnComboBoxChangeEvent.
|
|
225
|
-
*/
|
|
226
|
-
value: any;
|
|
227
|
-
/**
|
|
228
|
-
* The target of the MultiColumnComboBoxChangeEvent from MultiColumnComboBoxHandle.
|
|
229
|
-
*/
|
|
230
|
-
target: MultiColumnComboBoxHandle;
|
|
231
|
-
/**
|
|
232
|
-
* The event of the MultiColumnComboBoxChangeEvent.
|
|
233
|
-
*/
|
|
234
|
-
syntheticEvent: React.SyntheticEvent<any>;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Represents the PropsContext of the `MultiColumnComboBox` component.
|
|
238
|
-
* Used for global configuration of all `MultiColumnComboBox` instances.
|
|
239
|
-
*
|
|
240
|
-
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
241
|
-
*/
|
|
242
|
-
export declare const MultiColumnComboBoxPropsContext: React.Context<(p: MultiColumnComboBoxProps) => MultiColumnComboBoxProps>;
|
|
243
|
-
/**
|
|
244
|
-
* Represents the MultiColumnComboBox component.
|
|
245
|
-
*
|
|
246
|
-
* Accepts properties of type [MultiColumnComboBoxProps]({% slug api_dropdowns_multicolumncomboboxprops %}).
|
|
247
|
-
* Obtaining the `ref` returns an object of type [MultiColumnComboBoxHandle]({% slug api_dropdowns_multicolumncomboboxhandle %}).
|
|
248
|
-
*
|
|
249
|
-
* @example
|
|
250
|
-
* ```jsx
|
|
251
|
-
* const columns = [
|
|
252
|
-
* {
|
|
253
|
-
* field: "id",
|
|
254
|
-
* header: "ID",
|
|
255
|
-
* width: "100px",
|
|
256
|
-
* },
|
|
257
|
-
* {
|
|
258
|
-
* field: "name",
|
|
259
|
-
* header: "Name",
|
|
260
|
-
* width: "300px",
|
|
261
|
-
* },
|
|
262
|
-
* {
|
|
263
|
-
* field: "position",
|
|
264
|
-
* header: "Position",
|
|
265
|
-
* width: "300px",
|
|
266
|
-
* },
|
|
267
|
-
* ];
|
|
268
|
-
* const App = () => {
|
|
269
|
-
* return (
|
|
270
|
-
* <div>
|
|
271
|
-
* <div>Employees:</div>
|
|
272
|
-
* <MultiColumnComboBox
|
|
273
|
-
* data={employees}
|
|
274
|
-
* columns={columns}
|
|
275
|
-
* textField={"name"}
|
|
276
|
-
* style={{
|
|
277
|
-
* width: "300px",
|
|
278
|
-
* }}
|
|
279
|
-
* placeholder="Please select ..."
|
|
280
|
-
* />
|
|
281
|
-
* </div>
|
|
282
|
-
* );
|
|
283
|
-
* };
|
|
284
|
-
* ReactDOM.render(<App />, document.querySelector("my-app"));
|
|
285
|
-
* ```
|
|
286
|
-
*/
|
|
287
|
-
export declare const MultiColumnComboBox: React.ForwardRefExoticComponent<MultiColumnComboBoxProps & React.RefAttributes<MultiColumnComboBoxHandle | null>>;
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.MultiColumnComboBox = exports.MultiColumnComboBoxPropsContext = void 0;
|
|
26
|
-
var React = require("react");
|
|
27
|
-
var PropTypes = require("prop-types");
|
|
28
|
-
var kendo_react_popup_1 = require("@progress/kendo-react-popup");
|
|
29
|
-
var MultiColumnList_1 = require("./../common/MultiColumnList");
|
|
30
|
-
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
31
|
-
var ComboBox_1 = require("../ComboBox/ComboBox");
|
|
32
|
-
var utils_1 = require("../common/utils");
|
|
33
|
-
var columnWidth = function (width, defaultWidth) {
|
|
34
|
-
if (width) {
|
|
35
|
-
return typeof width === 'number' ? width + 'px' : width;
|
|
36
|
-
}
|
|
37
|
-
return defaultWidth;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Represents the PropsContext of the `MultiColumnComboBox` component.
|
|
41
|
-
* Used for global configuration of all `MultiColumnComboBox` instances.
|
|
42
|
-
*
|
|
43
|
-
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
44
|
-
*/
|
|
45
|
-
exports.MultiColumnComboBoxPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
46
|
-
/**
|
|
47
|
-
* Represents the MultiColumnComboBox component.
|
|
48
|
-
*
|
|
49
|
-
* Accepts properties of type [MultiColumnComboBoxProps]({% slug api_dropdowns_multicolumncomboboxprops %}).
|
|
50
|
-
* Obtaining the `ref` returns an object of type [MultiColumnComboBoxHandle]({% slug api_dropdowns_multicolumncomboboxhandle %}).
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```jsx
|
|
54
|
-
* const columns = [
|
|
55
|
-
* {
|
|
56
|
-
* field: "id",
|
|
57
|
-
* header: "ID",
|
|
58
|
-
* width: "100px",
|
|
59
|
-
* },
|
|
60
|
-
* {
|
|
61
|
-
* field: "name",
|
|
62
|
-
* header: "Name",
|
|
63
|
-
* width: "300px",
|
|
64
|
-
* },
|
|
65
|
-
* {
|
|
66
|
-
* field: "position",
|
|
67
|
-
* header: "Position",
|
|
68
|
-
* width: "300px",
|
|
69
|
-
* },
|
|
70
|
-
* ];
|
|
71
|
-
* const App = () => {
|
|
72
|
-
* return (
|
|
73
|
-
* <div>
|
|
74
|
-
* <div>Employees:</div>
|
|
75
|
-
* <MultiColumnComboBox
|
|
76
|
-
* data={employees}
|
|
77
|
-
* columns={columns}
|
|
78
|
-
* textField={"name"}
|
|
79
|
-
* style={{
|
|
80
|
-
* width: "300px",
|
|
81
|
-
* }}
|
|
82
|
-
* placeholder="Please select ..."
|
|
83
|
-
* />
|
|
84
|
-
* </div>
|
|
85
|
-
* );
|
|
86
|
-
* };
|
|
87
|
-
* ReactDOM.render(<App />, document.querySelector("my-app"));
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
exports.MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
91
|
-
var props = (0, kendo_react_common_1.usePropsContext)(exports.MultiColumnComboBoxPropsContext, directProps);
|
|
92
|
-
var target = React.useRef(null);
|
|
93
|
-
var comboBoxRef = React.useRef(null);
|
|
94
|
-
var scrollbarWidth = (0, kendo_react_common_1.getScrollbarWidth)();
|
|
95
|
-
var _a = props.columns, columns = _a === void 0 ? defaultProps.columns : _a, _b = props.popupSettings, popupSettings = _b === void 0 ? defaultProps.popupSettings : _b, className = props.className, size = props.size, onOpen = props.onOpen, onClose = props.onClose, onFocus = props.onFocus, onBlur = props.onBlur, onChange = props.onChange, onFilterChange = props.onFilterChange, onPageChange = props.onPageChange, other = __rest(props, ["columns", "popupSettings", "className", "size", "onOpen", "onClose", "onFocus", "onBlur", "onChange", "onFilterChange", "onPageChange"]);
|
|
96
|
-
React.useImperativeHandle(target, function () {
|
|
97
|
-
return ({
|
|
98
|
-
element: comboBoxRef.current && comboBoxRef.current.element,
|
|
99
|
-
focus: function () {
|
|
100
|
-
if (comboBoxRef.current) {
|
|
101
|
-
comboBoxRef.current.focus();
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
get value() { return comboBoxRef.current && comboBoxRef.current.value; },
|
|
105
|
-
get name() { return comboBoxRef.current && comboBoxRef.current.name; },
|
|
106
|
-
props: props
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
React.useImperativeHandle(ref, function () { return target.current; });
|
|
110
|
-
var initialGroupHeader = React.useMemo(function () {
|
|
111
|
-
if (props.groupField !== undefined && props.data) {
|
|
112
|
-
return (0, utils_1.getItemValue)(props.data[0], props.groupField);
|
|
113
|
-
}
|
|
114
|
-
}, [props.data, props.groupField]);
|
|
115
|
-
var _c = React.useState(initialGroupHeader), groupHeader = _c[0], setGroupHeader = _c[1];
|
|
116
|
-
var _d = React.useState(true), showStickyHeader = _d[0], setShowStickyHeader = _d[1];
|
|
117
|
-
var header = React.useMemo(function () {
|
|
118
|
-
var renderer = (React.createElement("th", { className: 'k-table-th', colSpan: columns.length }, groupHeader));
|
|
119
|
-
return (React.createElement(React.Fragment, null,
|
|
120
|
-
props.header,
|
|
121
|
-
React.createElement("div", { className: "k-table-header-wrap" },
|
|
122
|
-
React.createElement("table", { className: "k-table", role: "presentation" },
|
|
123
|
-
React.createElement("colgroup", null, columns.map(function (column, i) {
|
|
124
|
-
return (React.createElement("col", { key: column.uniqueKey ? column.uniqueKey : i, style: { width: column.width ? column.width : defaultProps.width } }));
|
|
125
|
-
})),
|
|
126
|
-
React.createElement("thead", { className: 'k-table-thead' },
|
|
127
|
-
React.createElement("tr", { className: 'k-table-row' }, columns.map(function (column, i) {
|
|
128
|
-
return (React.createElement("th", { className: "k-table-th", key: column.uniqueKey ? column.uniqueKey : i }, column.header || '\u00A0'));
|
|
129
|
-
})),
|
|
130
|
-
groupHeader && showStickyHeader && React.createElement("tr", { className: 'k-table-group-row' }, props.groupStickyHeaderItemRender ? props.groupStickyHeaderItemRender.call(undefined, renderer, {}) : renderer))))));
|
|
131
|
-
}, [props.header, columns, groupHeader, showStickyHeader]);
|
|
132
|
-
var popupWidth = React.useMemo(function () {
|
|
133
|
-
// These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
|
|
134
|
-
return "calc(".concat(columns.map(function (column) { return columnWidth(column.width, defaultProps.width); }).filter(Boolean).join(' + '), " + ").concat(scrollbarWidth, "px + 4px)");
|
|
135
|
-
}, [columns, scrollbarWidth]);
|
|
136
|
-
var skip = props.virtual ? props.virtual.skip : 0;
|
|
137
|
-
var itemRender = React.useCallback(function (li, liProps) {
|
|
138
|
-
var children = columns.map(function (column, i) { return (React.createElement("span", { className: !props.itemRender ? 'k-table-td' : undefined, style: !props.itemRender ? { width: column.width ? column.width : defaultProps.width } : undefined, key: column.uniqueKey ? column.uniqueKey : i }, column.field ? String((0, kendo_react_common_1.getter)(column.field)(liProps.dataItem)) : '')); });
|
|
139
|
-
var group = undefined;
|
|
140
|
-
var curGroup, prevGroup, groupGetter, data = props.data || [];
|
|
141
|
-
var index = liProps.index - skip;
|
|
142
|
-
if (props.groupField !== undefined) {
|
|
143
|
-
groupGetter = (0, kendo_react_common_1.getter)(props.groupField);
|
|
144
|
-
curGroup = groupGetter(data[index]);
|
|
145
|
-
prevGroup = groupGetter(data[index - 1]);
|
|
146
|
-
if (curGroup && prevGroup && curGroup !== prevGroup) {
|
|
147
|
-
group = curGroup;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
if (group && props.groupMode === 'classic') {
|
|
151
|
-
children.push(React.createElement("div", { key: "group", className: "k-table-td k-table-group-td" },
|
|
152
|
-
React.createElement("span", null, group)));
|
|
153
|
-
}
|
|
154
|
-
var rendering = React.cloneElement(li, __assign(__assign({}, li.props), { className: (0, kendo_react_common_1.classNames)('k-table-row', {
|
|
155
|
-
'k-table-alt-row': liProps.index % 2 !== 0,
|
|
156
|
-
'k-focus': liProps.focused,
|
|
157
|
-
'k-selected': liProps.selected,
|
|
158
|
-
'k-first': Boolean(group),
|
|
159
|
-
'k-disabled': liProps.dataItem.disabled
|
|
160
|
-
}) }), children);
|
|
161
|
-
return props.itemRender ? props.itemRender.call(undefined, rendering, liProps) : rendering;
|
|
162
|
-
}, [columns, props.groupField, props.itemRender, props.data, skip]);
|
|
163
|
-
var handleEvent = React.useCallback(function (handler, event) {
|
|
164
|
-
if (handler) {
|
|
165
|
-
handler.call(undefined, __assign(__assign({}, event), { target: target.current }));
|
|
166
|
-
}
|
|
167
|
-
}, []);
|
|
168
|
-
var onOpenHandler = React.useCallback(function (event) {
|
|
169
|
-
// Resets the sticky header group value for scenarios with open/close of component's popup
|
|
170
|
-
if (!props.virtual) {
|
|
171
|
-
setGroupHeader(initialGroupHeader);
|
|
172
|
-
}
|
|
173
|
-
;
|
|
174
|
-
return handleEvent(onOpen, event);
|
|
175
|
-
}, [handleEvent, onOpen, props.virtual, initialGroupHeader]);
|
|
176
|
-
var onCloseHandler = React.useCallback(function (event) { return handleEvent(onClose, event); }, [onClose]);
|
|
177
|
-
var onFocusHandler = React.useCallback(function (event) { return handleEvent(onFocus, event); }, [onFocus]);
|
|
178
|
-
var onBlurHandler = React.useCallback(function (event) { return handleEvent(onBlur, event); }, [onBlur]);
|
|
179
|
-
var onChangeHandler = React.useCallback(function (event) { return handleEvent(onChange, event); }, [onChange]);
|
|
180
|
-
var onPageChangeHandler = React.useCallback(function (event) { return handleEvent(onPageChange, event); }, [onPageChange]);
|
|
181
|
-
var onFilterChangeHandler = React.useCallback(function (event) {
|
|
182
|
-
setGroupHeader(initialGroupHeader);
|
|
183
|
-
return handleEvent(onFilterChange, __assign(__assign({}, event), { mobileMode: event.target.mobileMode }));
|
|
184
|
-
}, [onFilterChange]);
|
|
185
|
-
var onGroupScroll = React.useCallback(function (event) {
|
|
186
|
-
setGroupHeader(event.group);
|
|
187
|
-
}, []);
|
|
188
|
-
React.useEffect(function () { (0, kendo_react_common_1.setScrollbarWidth)(); });
|
|
189
|
-
React.useEffect(function () {
|
|
190
|
-
var data = props.data;
|
|
191
|
-
setGroupHeader(initialGroupHeader);
|
|
192
|
-
if (data && data.length !== 0) {
|
|
193
|
-
setShowStickyHeader(true);
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
setShowStickyHeader(false);
|
|
197
|
-
}
|
|
198
|
-
;
|
|
199
|
-
}, [props.data]);
|
|
200
|
-
var List = React.useCallback(function (listProps) { return React.createElement(MultiColumnList_1.MultiColumnList, __assign({}, listProps)); }, []);
|
|
201
|
-
return (React.createElement(kendo_react_popup_1.PopupPropsContext.Provider, { value: function (PopupProps) { return (__assign(__assign({}, PopupProps), { popupClass: "k-dropdowngrid-popup ".concat(popupSettings.popupClass) })); } },
|
|
202
|
-
React.createElement(ComboBox_1.ComboBox, __assign({}, other, { list: List, popupSettings: __assign(__assign({ width: popupWidth }, popupSettings), { className: popupSettings.className }), ref: comboBoxRef, header: header, itemRender: itemRender, groupHeaderItemRender: props.groupHeaderItemRender, size: props.size, rounded: props.rounded, fillMode: props.fillMode, groupMode: props.groupMode, groupField: props.groupField, isMultiColumn: true, onOpen: onOpenHandler, onClose: onCloseHandler, onFocus: onFocusHandler, onBlur: onBlurHandler, onChange: onChangeHandler, onFilterChange: onFilterChangeHandler, onPageChange: onPageChangeHandler, onGroupScroll: onGroupScroll, className: (0, kendo_react_common_1.classNames)('k-dropdowngrid', className), required: props.required, adaptive: props.adaptive, adaptiveFilter: props.adaptiveFilter, adaptiveTitle: props.adaptiveTitle, footer: props.footer, footerClassName: 'k-table-footer' }))));
|
|
203
|
-
});
|
|
204
|
-
var propTypes = __assign(__assign({}, ComboBox_1.ComboBoxWithoutContext.propTypes), { columns: PropTypes.any.isRequired });
|
|
205
|
-
var defaultProps = {
|
|
206
|
-
columns: [],
|
|
207
|
-
popupSettings: {},
|
|
208
|
-
width: '200px',
|
|
209
|
-
size: 'medium',
|
|
210
|
-
rounded: 'medium',
|
|
211
|
-
fillMode: 'solid'
|
|
212
|
-
};
|
|
213
|
-
exports.MultiColumnComboBox.displayName = 'KendoMultiColumnComboBox';
|
|
214
|
-
// TODO: delete casting when @types/react is updated!
|
|
215
|
-
exports.MultiColumnComboBox.propTypes = propTypes;
|
|
216
|
-
exports.MultiColumnComboBox.defaultProps = defaultProps;
|