@progress/kendo-react-dropdowns 6.1.1 → 7.0.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/{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 +7 -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 +4383 -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,294 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FormComponentProps } from '@progress/kendo-react-common';
|
|
3
|
-
import { ItemRenderProps } from '@progress/kendo-react-treeview';
|
|
4
|
-
import { FilterChangeEvent, ChangeEvent, OpenEvent, CloseEvent, FocusEvent, BlurEvent, DropdownEvent } from '../common/events';
|
|
5
|
-
import { DropDownsPopupSettings } from '../common/settings';
|
|
6
|
-
/**
|
|
7
|
-
* Represents the Object which is passed to the
|
|
8
|
-
* [`ref`](https://reactjs.org/docs/refs-and-the-dom.html) callback of the DropDownTree component.
|
|
9
|
-
*/
|
|
10
|
-
export interface DropDownTreeHandle {
|
|
11
|
-
/**
|
|
12
|
-
* The current element or `null` if there is no one.
|
|
13
|
-
*/
|
|
14
|
-
element: HTMLElement | null;
|
|
15
|
-
/**
|
|
16
|
-
* The props of the DropDownTree component.
|
|
17
|
-
*/
|
|
18
|
-
props: DropDownTreeProps;
|
|
19
|
-
/**
|
|
20
|
-
* The focus function.
|
|
21
|
-
*/
|
|
22
|
-
focus: () => void;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Represents the object of the `onFilterChange` DropDownTree event.
|
|
26
|
-
*/
|
|
27
|
-
export interface DropDownTreeFilterChangeEvent extends FilterChangeEvent<DropDownTreeHandle> {
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Represents the object of the `onChange` DropDownTree event.
|
|
31
|
-
*/
|
|
32
|
-
export interface DropDownTreeChangeEvent extends ChangeEvent<DropDownTreeHandle> {
|
|
33
|
-
level: number[];
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Represents the object of the `onOpen` DropDownTree event.
|
|
37
|
-
*/
|
|
38
|
-
export interface DropDownTreeOpenEvent extends OpenEvent<DropDownTreeHandle> {
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Represents the object of the `onClose` DropDownTree event.
|
|
42
|
-
*/
|
|
43
|
-
export interface DropDownTreeCloseEvent extends CloseEvent<DropDownTreeHandle> {
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Represents the object of the `onFocus` DropDownTree event.
|
|
47
|
-
*/
|
|
48
|
-
export interface DropDownTreeFocusEvent extends FocusEvent<DropDownTreeHandle> {
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Represents the object of the `onBlur` DropDownTree event.
|
|
52
|
-
*/
|
|
53
|
-
export interface DropDownTreeBlurEvent extends BlurEvent<DropDownTreeHandle> {
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Represents the object of the `onExpandChange` DropDownTree event.
|
|
57
|
-
*/
|
|
58
|
-
export interface DropDownTreeExpandEvent extends DropdownEvent<DropDownTreeHandle> {
|
|
59
|
-
item: any;
|
|
60
|
-
level: number[];
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* The props of component that will be used for rendering each of the DropDownTree items
|
|
64
|
-
* ([see example]({% slug customrendering_dropdowntree %}#toc-items-and-value-element)).
|
|
65
|
-
*/
|
|
66
|
-
export interface ItemProps extends ItemRenderProps {
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* The props of the `ListNoData` component ([see example]({% slug customrendering_dropdowntree %}#toc-no-data)).
|
|
70
|
-
*/
|
|
71
|
-
export interface ListNoDataProps {
|
|
72
|
-
children?: React.ReactNode;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* The props of the `ValueHolder` component ([see example]({% slug customrendering_dropdowntree %}#toc-items-and-value-element)).
|
|
76
|
-
*/
|
|
77
|
-
export interface ValueHolderProps {
|
|
78
|
-
children?: React.ReactNode;
|
|
79
|
-
item?: any;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Represents the props of the [KendoReact DropDownTree component]({% slug overview_dropdowntree %}).
|
|
83
|
-
*/
|
|
84
|
-
export interface DropDownTreeProps extends FormComponentProps {
|
|
85
|
-
/**
|
|
86
|
-
* Sets the data of the DropDownTree ([see example]({% slug overview_dropdowntree %})).
|
|
87
|
-
*/
|
|
88
|
-
data?: any[];
|
|
89
|
-
/**
|
|
90
|
-
* Sets the opened state of the DropDownTree.
|
|
91
|
-
*/
|
|
92
|
-
opened?: boolean;
|
|
93
|
-
/**
|
|
94
|
-
* The styles that are applied to the DropDownTree.
|
|
95
|
-
*/
|
|
96
|
-
style?: React.CSSProperties;
|
|
97
|
-
/**
|
|
98
|
-
* Sets the value of the DropDownTree ([see example]({% slug overview_dropdowntree %})).
|
|
99
|
-
* It can be an object from the data-tree.
|
|
100
|
-
*/
|
|
101
|
-
value?: any;
|
|
102
|
-
/**
|
|
103
|
-
* The hint that is displayed when the DropDownTree is empty.
|
|
104
|
-
*/
|
|
105
|
-
placeholder?: string;
|
|
106
|
-
/**
|
|
107
|
-
* Sets the key for comparing the data items of the DropDownTree ([see example]({% slug overview_dropdowntree %})).
|
|
108
|
-
* If `dataItemKey` is not set, the DropDownTree compares the items by reference.
|
|
109
|
-
*/
|
|
110
|
-
dataItemKey: string;
|
|
111
|
-
/**
|
|
112
|
-
* Sets additional classes to the DropDownTree.
|
|
113
|
-
*/
|
|
114
|
-
className?: string;
|
|
115
|
-
/**
|
|
116
|
-
* Sets the disabled state of the DropDownTree.
|
|
117
|
-
*/
|
|
118
|
-
disabled?: boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Represents the `dir` HTML attribute.
|
|
121
|
-
*/
|
|
122
|
-
dir?: string;
|
|
123
|
-
/**
|
|
124
|
-
* Renders a floating label for the DropDownTree.
|
|
125
|
-
*/
|
|
126
|
-
label?: string;
|
|
127
|
-
/**
|
|
128
|
-
* Specifies the id of the component.
|
|
129
|
-
*/
|
|
130
|
-
id?: string;
|
|
131
|
-
/**
|
|
132
|
-
* 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).
|
|
133
|
-
* For example these elements could contain error or hint message.
|
|
134
|
-
*/
|
|
135
|
-
ariaDescribedBy?: string;
|
|
136
|
-
/**
|
|
137
|
-
* Identifies the element(s) which will label the component.
|
|
138
|
-
*/
|
|
139
|
-
ariaLabelledBy?: string;
|
|
140
|
-
/**
|
|
141
|
-
* Enables the filtering functionality of the DropDownTree ([more information and examples]({% slug filtering_dropdowntree %})).
|
|
142
|
-
*/
|
|
143
|
-
filterable?: boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Sets the value of filtering input.
|
|
146
|
-
* Useful for making the filtering input a [controlled component](https://reactjs.org/docs/forms.html#controlled-components).
|
|
147
|
-
*/
|
|
148
|
-
filter?: string;
|
|
149
|
-
/**
|
|
150
|
-
* Sets the loading state of the DropDownTree ([see example]({% slug filtering_dropdowntree %}#toc-visualize-filtering)).
|
|
151
|
-
*/
|
|
152
|
-
loading?: boolean;
|
|
153
|
-
/**
|
|
154
|
-
* Specifies the `tabIndex` of the DropDownTree.
|
|
155
|
-
*/
|
|
156
|
-
tabIndex?: number;
|
|
157
|
-
/**
|
|
158
|
-
* Specifies the `accessKey` of the DropDownTree.
|
|
159
|
-
*/
|
|
160
|
-
accessKey?: string;
|
|
161
|
-
/**
|
|
162
|
-
* Sets the data item field that represents the item text ([see example]({% slug overview_dropdowntree %})).
|
|
163
|
-
*/
|
|
164
|
-
textField: string;
|
|
165
|
-
/**
|
|
166
|
-
* Specifies the name of the field which will provide a Boolean representation of the selected state of the item.
|
|
167
|
-
*/
|
|
168
|
-
selectField?: string;
|
|
169
|
-
/**
|
|
170
|
-
* Specifies the name of the field which will provide a Boolean representation of the expanded state of the item.
|
|
171
|
-
*/
|
|
172
|
-
expandField?: string;
|
|
173
|
-
/**
|
|
174
|
-
* Specifies the name of the field which will provide an array representation of the item subitems.
|
|
175
|
-
* Defaults to 'items'.
|
|
176
|
-
*/
|
|
177
|
-
subItemsField?: string;
|
|
178
|
-
/**
|
|
179
|
-
* Configures the popup of the DropDownTree.
|
|
180
|
-
*/
|
|
181
|
-
popupSettings?: DropDownsPopupSettings;
|
|
182
|
-
/**
|
|
183
|
-
* 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.
|
|
184
|
-
*
|
|
185
|
-
* @example
|
|
186
|
-
* ```jsx-no-run
|
|
187
|
-
* class App extends React.Component {
|
|
188
|
-
* render() {
|
|
189
|
-
* return (
|
|
190
|
-
* <form>
|
|
191
|
-
* <DropDownTree
|
|
192
|
-
* data={[ { text: "Austria", id: 1 } , { text: "Belarus", id: 2 } ]}
|
|
193
|
-
* valueMap={value => value && value.id}
|
|
194
|
-
* />
|
|
195
|
-
* <button type="submit">Submit</button>
|
|
196
|
-
* </form>
|
|
197
|
-
* );
|
|
198
|
-
* }
|
|
199
|
-
* }
|
|
200
|
-
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
201
|
-
* ```
|
|
202
|
-
*/
|
|
203
|
-
valueMap?: (value: any) => any;
|
|
204
|
-
/**
|
|
205
|
-
* Fires each time the popup of the DropDownTree is about to open.
|
|
206
|
-
*/
|
|
207
|
-
onOpen?: (event: DropDownTreeOpenEvent) => void;
|
|
208
|
-
/**
|
|
209
|
-
* Fires each time the popup of the DropDownTree is about to close.
|
|
210
|
-
*/
|
|
211
|
-
onClose?: (event: DropDownTreeCloseEvent) => void;
|
|
212
|
-
/**
|
|
213
|
-
* Fires each time the user focuses the DropDownTree.
|
|
214
|
-
*/
|
|
215
|
-
onFocus?: (event: DropDownTreeFocusEvent) => void;
|
|
216
|
-
/**
|
|
217
|
-
* Fires each time the DropDownTree gets blurred.
|
|
218
|
-
*/
|
|
219
|
-
onBlur?: (event: DropDownTreeBlurEvent) => void;
|
|
220
|
-
/**
|
|
221
|
-
* Fires each time the value of the DropDownTree is about to change ([see examples]({% slug overview_dropdowntree %})).
|
|
222
|
-
*/
|
|
223
|
-
onChange?: (event: DropDownTreeChangeEvent) => void;
|
|
224
|
-
/**
|
|
225
|
-
* Fires each time the user types in the filter input
|
|
226
|
-
* ([see example]({% slug filtering_dropdowntree %}#toc-basic-configuration)).
|
|
227
|
-
* You can filter the source based on the passed filtration value.
|
|
228
|
-
*/
|
|
229
|
-
onFilterChange?: (event: DropDownTreeFilterChangeEvent) => void;
|
|
230
|
-
/**
|
|
231
|
-
* Fires when the expanding or collapsing of an item is requested ([see examples]({% slug overview_dropdowntree %})).
|
|
232
|
-
*/
|
|
233
|
-
onExpandChange?: (event: any) => void;
|
|
234
|
-
/**
|
|
235
|
-
* Defines the component that will be used for rendering each of the DropDownTree items
|
|
236
|
-
* ([see example]({% slug customrendering_dropdowntree %}#toc-items-and-value-element)).
|
|
237
|
-
*/
|
|
238
|
-
item?: React.ComponentType<ItemProps>;
|
|
239
|
-
/**
|
|
240
|
-
* Defines the component that will be used for rendering the selected value
|
|
241
|
-
* ([see example]({% slug customrendering_dropdowntree %}#toc-items-and-value-element)).
|
|
242
|
-
*/
|
|
243
|
-
valueHolder?: React.ComponentType<ValueHolderProps>;
|
|
244
|
-
/**
|
|
245
|
-
* Defines the component that will be rendered in the DropDownTree popup when no data is available
|
|
246
|
-
* ([see example]({% slug customrendering_dropdowntree %}#toc-no-data)).
|
|
247
|
-
*/
|
|
248
|
-
listNoData?: React.ComponentType<ListNoDataProps>;
|
|
249
|
-
/**
|
|
250
|
-
* Configures the `size` of the DropDownTree.
|
|
251
|
-
*
|
|
252
|
-
* The available options are:
|
|
253
|
-
* - small
|
|
254
|
-
* - medium
|
|
255
|
-
* - large
|
|
256
|
-
* - null—Does not set a size `className`.
|
|
257
|
-
*
|
|
258
|
-
* @default `medium`
|
|
259
|
-
*/
|
|
260
|
-
size?: null | 'small' | 'medium' | 'large';
|
|
261
|
-
/**
|
|
262
|
-
* Configures the `roundness` of the DropDownTree.
|
|
263
|
-
*
|
|
264
|
-
* The available options are:
|
|
265
|
-
* - small
|
|
266
|
-
* - medium
|
|
267
|
-
* - large
|
|
268
|
-
* - full
|
|
269
|
-
* - null—Does not set a rounded `className`.
|
|
270
|
-
*
|
|
271
|
-
* @default `medium`
|
|
272
|
-
*/
|
|
273
|
-
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
274
|
-
/**
|
|
275
|
-
* Configures the `fillMode` of the DropDownTree.
|
|
276
|
-
*
|
|
277
|
-
* The available options are:
|
|
278
|
-
* - solid
|
|
279
|
-
* - flat
|
|
280
|
-
* - outline
|
|
281
|
-
* - null—Does not set a fillMode `className`.
|
|
282
|
-
*
|
|
283
|
-
* @default `solid`
|
|
284
|
-
*/
|
|
285
|
-
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
286
|
-
/**
|
|
287
|
-
* Providing different rendering of the popup element based on the screen dimensions.
|
|
288
|
-
*/
|
|
289
|
-
adaptive?: boolean;
|
|
290
|
-
/**
|
|
291
|
-
* Specifies the text that is rendered as title in the adaptive popup.
|
|
292
|
-
*/
|
|
293
|
-
adaptiveTitle?: string;
|
|
294
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
*/
|
|
5
|
-
export function useDropdownWidth(elementRef, initialStyleWidth, args) {
|
|
6
|
-
var _a = React.useState(initialStyleWidth), width = _a[0], setWidth = _a[1];
|
|
7
|
-
React.useEffect(function () {
|
|
8
|
-
if (width !== undefined && elementRef.current) {
|
|
9
|
-
setWidth(elementRef.current.offsetWidth);
|
|
10
|
-
}
|
|
11
|
-
}, args);
|
|
12
|
-
return width;
|
|
13
|
-
}
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import * as React from 'react';
|
|
24
|
-
import * as PropTypes from 'prop-types';
|
|
25
|
-
import { PopupPropsContext } from '@progress/kendo-react-popup';
|
|
26
|
-
import { MultiColumnList } from './../common/MultiColumnList';
|
|
27
|
-
import { classNames, getScrollbarWidth, setScrollbarWidth, getter, usePropsContext, createPropsContext } from '@progress/kendo-react-common';
|
|
28
|
-
import { ComboBox, ComboBoxWithoutContext } from '../ComboBox/ComboBox';
|
|
29
|
-
import { getItemValue } from '../common/utils';
|
|
30
|
-
var columnWidth = function (width, defaultWidth) {
|
|
31
|
-
if (width) {
|
|
32
|
-
return typeof width === 'number' ? width + 'px' : width;
|
|
33
|
-
}
|
|
34
|
-
return defaultWidth;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Represents the PropsContext of the `MultiColumnComboBox` component.
|
|
38
|
-
* Used for global configuration of all `MultiColumnComboBox` instances.
|
|
39
|
-
*
|
|
40
|
-
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
41
|
-
*/
|
|
42
|
-
export var MultiColumnComboBoxPropsContext = createPropsContext();
|
|
43
|
-
/**
|
|
44
|
-
* Represents the MultiColumnComboBox component.
|
|
45
|
-
*
|
|
46
|
-
* Accepts properties of type [MultiColumnComboBoxProps]({% slug api_dropdowns_multicolumncomboboxprops %}).
|
|
47
|
-
* Obtaining the `ref` returns an object of type [MultiColumnComboBoxHandle]({% slug api_dropdowns_multicolumncomboboxhandle %}).
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```jsx
|
|
51
|
-
* const columns = [
|
|
52
|
-
* {
|
|
53
|
-
* field: "id",
|
|
54
|
-
* header: "ID",
|
|
55
|
-
* width: "100px",
|
|
56
|
-
* },
|
|
57
|
-
* {
|
|
58
|
-
* field: "name",
|
|
59
|
-
* header: "Name",
|
|
60
|
-
* width: "300px",
|
|
61
|
-
* },
|
|
62
|
-
* {
|
|
63
|
-
* field: "position",
|
|
64
|
-
* header: "Position",
|
|
65
|
-
* width: "300px",
|
|
66
|
-
* },
|
|
67
|
-
* ];
|
|
68
|
-
* const App = () => {
|
|
69
|
-
* return (
|
|
70
|
-
* <div>
|
|
71
|
-
* <div>Employees:</div>
|
|
72
|
-
* <MultiColumnComboBox
|
|
73
|
-
* data={employees}
|
|
74
|
-
* columns={columns}
|
|
75
|
-
* textField={"name"}
|
|
76
|
-
* style={{
|
|
77
|
-
* width: "300px",
|
|
78
|
-
* }}
|
|
79
|
-
* placeholder="Please select ..."
|
|
80
|
-
* />
|
|
81
|
-
* </div>
|
|
82
|
-
* );
|
|
83
|
-
* };
|
|
84
|
-
* ReactDOM.render(<App />, document.querySelector("my-app"));
|
|
85
|
-
* ```
|
|
86
|
-
*/
|
|
87
|
-
export var MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
88
|
-
var props = usePropsContext(MultiColumnComboBoxPropsContext, directProps);
|
|
89
|
-
var target = React.useRef(null);
|
|
90
|
-
var comboBoxRef = React.useRef(null);
|
|
91
|
-
var scrollbarWidth = getScrollbarWidth();
|
|
92
|
-
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"]);
|
|
93
|
-
React.useImperativeHandle(target, function () {
|
|
94
|
-
return ({
|
|
95
|
-
element: comboBoxRef.current && comboBoxRef.current.element,
|
|
96
|
-
focus: function () {
|
|
97
|
-
if (comboBoxRef.current) {
|
|
98
|
-
comboBoxRef.current.focus();
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
get value() { return comboBoxRef.current && comboBoxRef.current.value; },
|
|
102
|
-
get name() { return comboBoxRef.current && comboBoxRef.current.name; },
|
|
103
|
-
props: props
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
React.useImperativeHandle(ref, function () { return target.current; });
|
|
107
|
-
var initialGroupHeader = React.useMemo(function () {
|
|
108
|
-
if (props.groupField !== undefined && props.data) {
|
|
109
|
-
return getItemValue(props.data[0], props.groupField);
|
|
110
|
-
}
|
|
111
|
-
}, [props.data, props.groupField]);
|
|
112
|
-
var _c = React.useState(initialGroupHeader), groupHeader = _c[0], setGroupHeader = _c[1];
|
|
113
|
-
var _d = React.useState(true), showStickyHeader = _d[0], setShowStickyHeader = _d[1];
|
|
114
|
-
var header = React.useMemo(function () {
|
|
115
|
-
var renderer = (React.createElement("th", { className: 'k-table-th', colSpan: columns.length }, groupHeader));
|
|
116
|
-
return (React.createElement(React.Fragment, null,
|
|
117
|
-
props.header,
|
|
118
|
-
React.createElement("div", { className: "k-table-header-wrap" },
|
|
119
|
-
React.createElement("table", { className: "k-table", role: "presentation" },
|
|
120
|
-
React.createElement("colgroup", null, columns.map(function (column, i) {
|
|
121
|
-
return (React.createElement("col", { key: column.uniqueKey ? column.uniqueKey : i, style: { width: column.width ? column.width : defaultProps.width } }));
|
|
122
|
-
})),
|
|
123
|
-
React.createElement("thead", { className: 'k-table-thead' },
|
|
124
|
-
React.createElement("tr", { className: 'k-table-row' }, columns.map(function (column, i) {
|
|
125
|
-
return (React.createElement("th", { className: "k-table-th", key: column.uniqueKey ? column.uniqueKey : i }, column.header || '\u00A0'));
|
|
126
|
-
})),
|
|
127
|
-
groupHeader && showStickyHeader && React.createElement("tr", { className: 'k-table-group-row' }, props.groupStickyHeaderItemRender ? props.groupStickyHeaderItemRender.call(undefined, renderer, {}) : renderer))))));
|
|
128
|
-
}, [props.header, columns, groupHeader, showStickyHeader]);
|
|
129
|
-
var popupWidth = React.useMemo(function () {
|
|
130
|
-
// These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
|
|
131
|
-
return "calc(".concat(columns.map(function (column) { return columnWidth(column.width, defaultProps.width); }).filter(Boolean).join(' + '), " + ").concat(scrollbarWidth, "px + 4px)");
|
|
132
|
-
}, [columns, scrollbarWidth]);
|
|
133
|
-
var skip = props.virtual ? props.virtual.skip : 0;
|
|
134
|
-
var itemRender = React.useCallback(function (li, liProps) {
|
|
135
|
-
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(getter(column.field)(liProps.dataItem)) : '')); });
|
|
136
|
-
var group = undefined;
|
|
137
|
-
var curGroup, prevGroup, groupGetter, data = props.data || [];
|
|
138
|
-
var index = liProps.index - skip;
|
|
139
|
-
if (props.groupField !== undefined) {
|
|
140
|
-
groupGetter = getter(props.groupField);
|
|
141
|
-
curGroup = groupGetter(data[index]);
|
|
142
|
-
prevGroup = groupGetter(data[index - 1]);
|
|
143
|
-
if (curGroup && prevGroup && curGroup !== prevGroup) {
|
|
144
|
-
group = curGroup;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
if (group && props.groupMode === 'classic') {
|
|
148
|
-
children.push(React.createElement("div", { key: "group", className: "k-table-td k-table-group-td" },
|
|
149
|
-
React.createElement("span", null, group)));
|
|
150
|
-
}
|
|
151
|
-
var rendering = React.cloneElement(li, __assign(__assign({}, li.props), { className: classNames('k-table-row', {
|
|
152
|
-
'k-table-alt-row': liProps.index % 2 !== 0,
|
|
153
|
-
'k-focus': liProps.focused,
|
|
154
|
-
'k-selected': liProps.selected,
|
|
155
|
-
'k-first': Boolean(group),
|
|
156
|
-
'k-disabled': liProps.dataItem.disabled
|
|
157
|
-
}) }), children);
|
|
158
|
-
return props.itemRender ? props.itemRender.call(undefined, rendering, liProps) : rendering;
|
|
159
|
-
}, [columns, props.groupField, props.itemRender, props.data, skip]);
|
|
160
|
-
var handleEvent = React.useCallback(function (handler, event) {
|
|
161
|
-
if (handler) {
|
|
162
|
-
handler.call(undefined, __assign(__assign({}, event), { target: target.current }));
|
|
163
|
-
}
|
|
164
|
-
}, []);
|
|
165
|
-
var onOpenHandler = React.useCallback(function (event) {
|
|
166
|
-
// Resets the sticky header group value for scenarios with open/close of component's popup
|
|
167
|
-
if (!props.virtual) {
|
|
168
|
-
setGroupHeader(initialGroupHeader);
|
|
169
|
-
}
|
|
170
|
-
;
|
|
171
|
-
return handleEvent(onOpen, event);
|
|
172
|
-
}, [handleEvent, onOpen, props.virtual, initialGroupHeader]);
|
|
173
|
-
var onCloseHandler = React.useCallback(function (event) { return handleEvent(onClose, event); }, [onClose]);
|
|
174
|
-
var onFocusHandler = React.useCallback(function (event) { return handleEvent(onFocus, event); }, [onFocus]);
|
|
175
|
-
var onBlurHandler = React.useCallback(function (event) { return handleEvent(onBlur, event); }, [onBlur]);
|
|
176
|
-
var onChangeHandler = React.useCallback(function (event) { return handleEvent(onChange, event); }, [onChange]);
|
|
177
|
-
var onPageChangeHandler = React.useCallback(function (event) { return handleEvent(onPageChange, event); }, [onPageChange]);
|
|
178
|
-
var onFilterChangeHandler = React.useCallback(function (event) {
|
|
179
|
-
setGroupHeader(initialGroupHeader);
|
|
180
|
-
return handleEvent(onFilterChange, __assign(__assign({}, event), { mobileMode: event.target.mobileMode }));
|
|
181
|
-
}, [onFilterChange]);
|
|
182
|
-
var onGroupScroll = React.useCallback(function (event) {
|
|
183
|
-
setGroupHeader(event.group);
|
|
184
|
-
}, []);
|
|
185
|
-
React.useEffect(function () { setScrollbarWidth(); });
|
|
186
|
-
React.useEffect(function () {
|
|
187
|
-
var data = props.data;
|
|
188
|
-
setGroupHeader(initialGroupHeader);
|
|
189
|
-
if (data && data.length !== 0) {
|
|
190
|
-
setShowStickyHeader(true);
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
setShowStickyHeader(false);
|
|
194
|
-
}
|
|
195
|
-
;
|
|
196
|
-
}, [props.data]);
|
|
197
|
-
var List = React.useCallback(function (listProps) { return React.createElement(MultiColumnList, __assign({}, listProps)); }, []);
|
|
198
|
-
return (React.createElement(PopupPropsContext.Provider, { value: function (PopupProps) { return (__assign(__assign({}, PopupProps), { popupClass: "k-dropdowngrid-popup ".concat(popupSettings.popupClass) })); } },
|
|
199
|
-
React.createElement(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: classNames('k-dropdowngrid', className), required: props.required, adaptive: props.adaptive, adaptiveFilter: props.adaptiveFilter, adaptiveTitle: props.adaptiveTitle, footer: props.footer, footerClassName: 'k-table-footer' }))));
|
|
200
|
-
});
|
|
201
|
-
var propTypes = __assign(__assign({}, ComboBoxWithoutContext.propTypes), { columns: PropTypes.any.isRequired });
|
|
202
|
-
var defaultProps = {
|
|
203
|
-
columns: [],
|
|
204
|
-
popupSettings: {},
|
|
205
|
-
width: '200px',
|
|
206
|
-
size: 'medium',
|
|
207
|
-
rounded: 'medium',
|
|
208
|
-
fillMode: 'solid'
|
|
209
|
-
};
|
|
210
|
-
MultiColumnComboBox.displayName = 'KendoMultiColumnComboBox';
|
|
211
|
-
// TODO: delete casting when @types/react is updated!
|
|
212
|
-
MultiColumnComboBox.propTypes = propTypes;
|
|
213
|
-
MultiColumnComboBox.defaultProps = defaultProps;
|