@progress/kendo-react-dropdowns 13.3.0-develop.9 → 13.4.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.d.ts +274 -0
- package/AutoComplete/AutoComplete.js +1 -1
- package/AutoComplete/AutoComplete.mjs +67 -69
- package/AutoComplete/AutoCompleteProps.d.ts +509 -0
- package/ComboBox/ComboBox.d.ts +279 -0
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +281 -297
- package/ComboBox/ComboBoxProps.d.ts +632 -0
- package/DropDownList/DropDownList.d.ts +41 -0
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +78 -83
- package/DropDownList/DropDownListProps.d.ts +594 -0
- package/DropDownList/models/index.d.ts +54 -0
- package/DropDownTree/DropDownTree.d.ts +76 -0
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +6 -8
- package/DropDownTree/DropDownTreeProps.d.ts +506 -0
- package/DropDownTree/ListNoData.d.ts +13 -0
- package/DropDownTree/useDropdownWidth.d.ts +13 -0
- package/MultiColumnComboBox/MultiColumnComboBox.d.ts +299 -0
- package/MultiColumnComboBox/MultiColumnComboBox.js +1 -1
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +45 -48
- package/MultiSelect/MultiSelect.d.ts +281 -0
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +13 -15
- package/MultiSelect/MultiSelectProps.d.ts +592 -0
- package/MultiSelect/TagList.d.ts +45 -0
- package/MultiSelectTree/MultiSelectTree.d.ts +87 -0
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +7 -7
- package/MultiSelectTree/MultiSelectTreeProps.d.ts +554 -0
- package/MultiSelectTree/utils.d.ts +24 -0
- package/common/AdaptiveMode.d.ts +22 -0
- package/common/ClearButton.d.ts +19 -0
- package/common/DropDownBase.d.ts +186 -0
- package/common/DropDownBase.js +1 -1
- package/common/DropDownBase.mjs +1 -1
- package/common/GroupStickyHeader.d.ts +26 -0
- package/common/GroupStickyHeader.js +1 -1
- package/common/GroupStickyHeader.mjs +6 -6
- package/common/List.d.ts +54 -0
- package/common/List.js +1 -1
- package/common/List.mjs +129 -77
- package/common/ListContainer.d.ts +24 -0
- package/common/ListDefaultItem.d.ts +22 -0
- package/common/ListFilter.d.ts +29 -0
- package/common/ListFilter.js +1 -1
- package/common/ListFilter.mjs +12 -12
- package/common/ListGroupItem.d.ts +54 -0
- package/common/ListGroupItem.js +1 -1
- package/common/ListGroupItem.mjs +21 -13
- package/common/ListItem.d.ts +87 -0
- package/common/ListItem.js +1 -1
- package/common/ListItem.mjs +62 -21
- package/common/ListItemIcon.d.ts +26 -0
- package/common/ListItemIcon.js +8 -0
- package/common/ListItemIcon.mjs +21 -0
- package/common/MultiColumnList.d.ts +13 -0
- package/common/Navigation.d.ts +20 -0
- package/common/SearchBar.d.ts +55 -0
- package/common/VirtualScrollStatic.d.ts +44 -0
- package/common/events.d.ts +82 -0
- package/common/filterDescriptor.d.ts +48 -0
- package/common/settings.d.ts +112 -0
- package/common/utils.d.ts +82 -0
- package/common/utils.js +1 -1
- package/common/utils.mjs +50 -47
- package/common/withCustomComponent.d.ts +12 -0
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +28 -5545
- package/index.d.ts +28 -5545
- package/messages/index.d.ts +52 -0
- package/package-metadata.d.ts +12 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +10 -16
- package/package.json +10 -10
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 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 { ComboBoxBlurEvent, ComboBoxChangeEvent, ComboBoxCloseEvent, ComboBoxFilterChangeEvent, ComboBoxFocusEvent, ComboBoxOpenEvent, ComboBoxPageChangeEvent, ComboBoxProps } from '../ComboBox/ComboBoxProps.js';
|
|
10
|
+
import { DropDownsPopupSettings, VirtualizationSettings } from '../common/settings.js';
|
|
11
|
+
import { ListItemProps } from '../common/ListItem.js';
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
/**
|
|
14
|
+
* The represents the interface of the MultiColumnComboBox columns.
|
|
15
|
+
*/
|
|
16
|
+
export interface MultiColumnComboBoxColumn {
|
|
17
|
+
/**
|
|
18
|
+
* The unique id of the column.
|
|
19
|
+
*/
|
|
20
|
+
uniqueKey?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The field of the column.
|
|
23
|
+
*/
|
|
24
|
+
field?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The header of the column.
|
|
27
|
+
*/
|
|
28
|
+
header?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Represents the width of the column. If the width is not specified it is applied the default width of `200px`.
|
|
31
|
+
*/
|
|
32
|
+
width?: string | number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Represents the properties of the [MultiColumnComboBox](https://www.telerik.com/kendo-react-ui/components/dropdowns/api/multicolumncombobox) component.
|
|
36
|
+
*/
|
|
37
|
+
export interface MultiColumnComboBoxProps extends ComboBoxProps {
|
|
38
|
+
/**
|
|
39
|
+
* Determines the columns array of the MultiColumnComboBox.
|
|
40
|
+
*/
|
|
41
|
+
columns: MultiColumnComboBoxColumn[];
|
|
42
|
+
/**
|
|
43
|
+
* Sets the data of the MultiColumnComboBox.
|
|
44
|
+
*/
|
|
45
|
+
data?: any[];
|
|
46
|
+
/**
|
|
47
|
+
* Sets the opened and closed state of the MultiColumnComboBox.
|
|
48
|
+
*/
|
|
49
|
+
opened?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The styles that are applied to the MultiColumnComboBox.
|
|
52
|
+
*/
|
|
53
|
+
style?: React.CSSProperties;
|
|
54
|
+
/**
|
|
55
|
+
* Sets the value of the MultiColumnComboBox. It can either be of the primitive (string, numbers) or of the complex (objects) type.
|
|
56
|
+
*/
|
|
57
|
+
value?: any;
|
|
58
|
+
/**
|
|
59
|
+
* Sets the default value of the MultiColumnComboBox. Similar to the native `select` HTML element.
|
|
60
|
+
*/
|
|
61
|
+
defaultValue?: any;
|
|
62
|
+
/**
|
|
63
|
+
* Sets additional classes to the MultiColumnComboBox.
|
|
64
|
+
*/
|
|
65
|
+
className?: string;
|
|
66
|
+
/**
|
|
67
|
+
* 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.
|
|
68
|
+
*/
|
|
69
|
+
clearButton?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The hint that is displayed when the MultiColumnComboBox is empty.
|
|
72
|
+
*/
|
|
73
|
+
placeholder?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Specifies whether the MultiColumnComboBox allows user-defined values that are not present in the dataset. Defaults to `false`.
|
|
76
|
+
*/
|
|
77
|
+
allowCustom?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Sets the disabled state of the MultiColumnComboBox.
|
|
80
|
+
*/
|
|
81
|
+
disabled?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Enables the filtering functionality of the MultiColumnComboBox.
|
|
84
|
+
*/
|
|
85
|
+
filterable?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Sets the value of MultiColumnComboBox input. Useful for making the MultiColumnComboBox input a controlled component.
|
|
88
|
+
*/
|
|
89
|
+
filter?: string | null;
|
|
90
|
+
/**
|
|
91
|
+
* Sets the loading state of the MultiColumnComboBox.
|
|
92
|
+
*/
|
|
93
|
+
loading?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Specifies the `tabIndex` of the MultiColumnComboBox.
|
|
96
|
+
*/
|
|
97
|
+
tabIndex?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Specifies the `accessKey` of the MultiColumnComboBox.
|
|
100
|
+
*/
|
|
101
|
+
accessKey?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Sets the key for comparing the data items of the MultiColumnComboBox. If `dataItemKey` is not set, the MultiColumnComboBox compares the items by reference.
|
|
104
|
+
*/
|
|
105
|
+
dataItemKey?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Renders a floating label for the MultiColumnComboBox.
|
|
108
|
+
*/
|
|
109
|
+
label?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Configures the popup of the MultiColumnComboBox.
|
|
112
|
+
*/
|
|
113
|
+
popupSettings?: DropDownsPopupSettings;
|
|
114
|
+
/**
|
|
115
|
+
* Configures the virtual scrolling of the MultiColumnComboBox.
|
|
116
|
+
*/
|
|
117
|
+
virtual?: VirtualizationSettings;
|
|
118
|
+
/**
|
|
119
|
+
* 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.
|
|
120
|
+
*/
|
|
121
|
+
focusedItemIndex?: (data: any, inputText: string, textField?: string) => number;
|
|
122
|
+
/**
|
|
123
|
+
* Fires each time the popup of the MultiColumnComboBox is about to open.
|
|
124
|
+
*/
|
|
125
|
+
onOpen?: (event: ComboBoxOpenEvent) => void;
|
|
126
|
+
/**
|
|
127
|
+
* Fires each time the popup of the MultiColumnComboBox is about to close.
|
|
128
|
+
*/
|
|
129
|
+
onClose?: (event: ComboBoxCloseEvent) => void;
|
|
130
|
+
/**
|
|
131
|
+
* Fires each time the user focuses the MultiColumnComboBox.
|
|
132
|
+
*/
|
|
133
|
+
onFocus?: (event: ComboBoxFocusEvent) => void;
|
|
134
|
+
/**
|
|
135
|
+
* Fires each time the MultiColumnComboBox gets blurred.
|
|
136
|
+
*/
|
|
137
|
+
onBlur?: (event: ComboBoxBlurEvent) => void;
|
|
138
|
+
/**
|
|
139
|
+
* Fires each time the value of the MultiColumnComboBox is about to change.
|
|
140
|
+
*/
|
|
141
|
+
onChange?: (event: ComboBoxChangeEvent) => void;
|
|
142
|
+
/**
|
|
143
|
+
* Fires each time the user types in the filter input. You can filter the source based on the passed filtration value.
|
|
144
|
+
*/
|
|
145
|
+
onFilterChange?: (event: ComboBoxFilterChangeEvent) => void;
|
|
146
|
+
/**
|
|
147
|
+
* Fires when both the virtual scrolling of the MultiColumnComboBox is enabled and the component requires data for another page.
|
|
148
|
+
*/
|
|
149
|
+
onPageChange?: (event: ComboBoxPageChangeEvent) => void;
|
|
150
|
+
/**
|
|
151
|
+
* @hidden
|
|
152
|
+
*/
|
|
153
|
+
onGroupScroll?: (event: {
|
|
154
|
+
group?: string;
|
|
155
|
+
}) => void;
|
|
156
|
+
/**
|
|
157
|
+
* Fires when a MultiColumnComboBox list item is about to be rendered. Used to override the default appearance of the list items.
|
|
158
|
+
*/
|
|
159
|
+
itemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React.ReactNode;
|
|
160
|
+
/**
|
|
161
|
+
* Sets the header component of the MultiColumnComboBox.
|
|
162
|
+
*/
|
|
163
|
+
header?: React.ReactNode;
|
|
164
|
+
/**
|
|
165
|
+
* Sets the footer component of the MultiColumnComboBox.
|
|
166
|
+
*/
|
|
167
|
+
footer?: React.ReactNode;
|
|
168
|
+
/**
|
|
169
|
+
* Configures the `size` of the MultiColumnComboBox.
|
|
170
|
+
*
|
|
171
|
+
* The available options are:
|
|
172
|
+
* - small
|
|
173
|
+
* - medium
|
|
174
|
+
* - large
|
|
175
|
+
*
|
|
176
|
+
* @default undefined (theme-controlled)
|
|
177
|
+
*/
|
|
178
|
+
size?: 'small' | 'medium' | 'large';
|
|
179
|
+
/**
|
|
180
|
+
* Configures the `roundness` of the MultiColumnComboBox.
|
|
181
|
+
*
|
|
182
|
+
* The available options are:
|
|
183
|
+
* - small
|
|
184
|
+
* - medium
|
|
185
|
+
* - large
|
|
186
|
+
* - full
|
|
187
|
+
*
|
|
188
|
+
* @default undefined (theme-controlled)
|
|
189
|
+
*/
|
|
190
|
+
rounded?: 'small' | 'medium' | 'large' | 'full';
|
|
191
|
+
/**
|
|
192
|
+
* Configures the `fillMode` of the MultiColumnComboBox.
|
|
193
|
+
*
|
|
194
|
+
* The available options are:
|
|
195
|
+
* - solid
|
|
196
|
+
* - flat
|
|
197
|
+
* - outline
|
|
198
|
+
*
|
|
199
|
+
* @default undefined (theme-controlled)
|
|
200
|
+
*/
|
|
201
|
+
fillMode?: 'solid' | 'flat' | 'outline';
|
|
202
|
+
/**
|
|
203
|
+
* Sets a custom prefix to the MultiColumnComboBox component.
|
|
204
|
+
*/
|
|
205
|
+
prefix?: CustomComponent<any> | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* Sets a custom suffix to the MultiColumnComboBox component.
|
|
208
|
+
*/
|
|
209
|
+
suffix?: CustomComponent<any> | undefined;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Represents the target(element and props) of the MultiColumnComboBoxChangeEvent.
|
|
213
|
+
*/
|
|
214
|
+
export interface MultiColumnComboBoxHandle {
|
|
215
|
+
/**
|
|
216
|
+
* The current element or `null` of there is no one.
|
|
217
|
+
*/
|
|
218
|
+
element: HTMLSpanElement | null;
|
|
219
|
+
/**
|
|
220
|
+
* The value of the MultiColumnComboBox.
|
|
221
|
+
*/
|
|
222
|
+
value: any;
|
|
223
|
+
/**
|
|
224
|
+
* The props values of the MultiColumnComboBox.
|
|
225
|
+
*/
|
|
226
|
+
props: MultiColumnComboBoxProps;
|
|
227
|
+
/**
|
|
228
|
+
* The focus event callback.
|
|
229
|
+
*/
|
|
230
|
+
focus: () => void;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Represents the type of the MultiColumnComboBoxChangeEvent.
|
|
234
|
+
*/
|
|
235
|
+
export interface MultiColumnComboBoxChangeEvent {
|
|
236
|
+
/**
|
|
237
|
+
* The value of the MultiColumnComboBoxChangeEvent.
|
|
238
|
+
*/
|
|
239
|
+
value: any;
|
|
240
|
+
/**
|
|
241
|
+
* The target of the MultiColumnComboBoxChangeEvent from MultiColumnComboBoxHandle.
|
|
242
|
+
*/
|
|
243
|
+
target: MultiColumnComboBoxHandle;
|
|
244
|
+
/**
|
|
245
|
+
* The event of the MultiColumnComboBoxChangeEvent.
|
|
246
|
+
*/
|
|
247
|
+
syntheticEvent: React.SyntheticEvent<any>;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Represents the PropsContext of the `MultiColumnComboBox` component.
|
|
251
|
+
* Used for global configuration of all `MultiColumnComboBox` instances.
|
|
252
|
+
*
|
|
253
|
+
* For more information, refer to the [Dropdowns Props Context](https://www.telerik.com/kendo-react-ui/components/dropdowns/props-context) article.
|
|
254
|
+
*/
|
|
255
|
+
export declare const MultiColumnComboBoxPropsContext: React.Context<(p: MultiColumnComboBoxProps) => MultiColumnComboBoxProps>;
|
|
256
|
+
/**
|
|
257
|
+
* Represents the MultiColumnComboBox component.
|
|
258
|
+
*
|
|
259
|
+
* Accepts properties of type [MultiColumnComboBoxProps](https://www.telerik.com/kendo-react-ui/components/dropdowns/api/multicolumncomboboxprops).
|
|
260
|
+
* Obtaining the `ref` returns an object of type [MultiColumnComboBoxHandle](https://www.telerik.com/kendo-react-ui/components/dropdowns/api/multicolumncomboboxhandle).
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* ```jsx
|
|
264
|
+
* const columns = [
|
|
265
|
+
* {
|
|
266
|
+
* field: "id",
|
|
267
|
+
* header: "ID",
|
|
268
|
+
* width: "100px",
|
|
269
|
+
* },
|
|
270
|
+
* {
|
|
271
|
+
* field: "name",
|
|
272
|
+
* header: "Name",
|
|
273
|
+
* width: "300px",
|
|
274
|
+
* },
|
|
275
|
+
* {
|
|
276
|
+
* field: "position",
|
|
277
|
+
* header: "Position",
|
|
278
|
+
* width: "300px",
|
|
279
|
+
* },
|
|
280
|
+
* ];
|
|
281
|
+
* const App = () => {
|
|
282
|
+
* return (
|
|
283
|
+
* <div>
|
|
284
|
+
* <div>Employees:</div>
|
|
285
|
+
* <MultiColumnComboBox
|
|
286
|
+
* data={employees}
|
|
287
|
+
* columns={columns}
|
|
288
|
+
* textField={"name"}
|
|
289
|
+
* style={{
|
|
290
|
+
* width: "300px",
|
|
291
|
+
* }}
|
|
292
|
+
* placeholder="Please select ..."
|
|
293
|
+
* />
|
|
294
|
+
* </div>
|
|
295
|
+
* );
|
|
296
|
+
* };
|
|
297
|
+
* ```
|
|
298
|
+
*/
|
|
299
|
+
export declare const MultiColumnComboBox: React.ForwardRefExoticComponent<MultiColumnComboBoxProps & React.RefAttributes<MultiColumnComboBoxHandle | null>>;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("react"),ie=require("prop-types"),de=require("../common/MultiColumnList.js"),n=require("@progress/kendo-react-common"),j=require("../ComboBox/ComboBox.js"),ce=require("../common/utils.js"),K=require("../common/withCustomComponent.js");function pe(a){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const d=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(i,e,d.get?d:{enumerable:!0,get:()=>a[e]})}}return i.default=a,Object.freeze(i)}const t=pe(ue),me=(a,i)=>a?typeof a=="number"?a+"px":a:i,G=n.createPropsContext(),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("react"),ie=require("prop-types"),de=require("../common/MultiColumnList.js"),n=require("@progress/kendo-react-common"),j=require("../ComboBox/ComboBox.js"),ce=require("../common/utils.js"),K=require("../common/withCustomComponent.js");function pe(a){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const d=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(i,e,d.get?d:{enumerable:!0,get:()=>a[e]})}}return i.default=a,Object.freeze(i)}const t=pe(ue),me=(a,i)=>a?typeof a=="number"?a+"px":a:i,G=n.createPropsContext(),x=t.forwardRef((a,i)=>{const e=n.usePropsContext(G,a),d=t.useRef(null),c=t.useRef(null),y=n.getScrollbarWidth(),{columns:l=u.columns,popupSettings:f=u.popupSettings,size:W=u.size,rounded:z=u.rounded,fillMode:L=u.fillMode,className:_,prefix:D=void 0,suffix:$=void 0,onOpen:S,onClose:w,onFocus:F,onBlur:N,onChange:H,onFilterChange:M,onPageChange:R,...V}=e;t.useImperativeHandle(d,()=>{var o;return{element:((o=c.current)==null?void 0:o.element)||null,focus(){c.current&&c.current.focus()},get value(){var r;return(r=c.current)==null?void 0:r.value},get name(){var r;return(r=c.current)==null?void 0:r.name},props:e}}),t.useImperativeHandle(i,()=>d.current);const m=t.useMemo(()=>{if(e.groupField!==void 0&&e.data)return ce.getItemValue(e.data[0],e.groupField)},[e.data,e.groupField]),[h,b]=t.useState(m),[E,q]=t.useState(!0),[A]=D?K(e.prefix||t.Fragment):[],[J]=$?K(e.suffix||t.Fragment):[],Q=t.useMemo(()=>{const o=t.createElement("th",{className:"k-table-th",colSpan:l.length},h);return t.createElement(t.Fragment,null,e.header,t.createElement("div",{className:"k-table-header-wrap k-table-scroller"},t.createElement("table",{className:"k-table",role:"presentation"},t.createElement("colgroup",null,l.map((r,g)=>t.createElement("col",{key:r.uniqueKey?r.uniqueKey:g,style:{width:r.width?r.width:u.width}}))),t.createElement("thead",{className:"k-table-thead"},t.createElement("tr",{className:"k-table-row"},l.map((r,g)=>t.createElement("th",{className:"k-table-th",key:r.uniqueKey?r.uniqueKey:g},r.header||" "))),h&&E&&t.createElement("tr",{className:"k-table-group-row"},e.groupStickyHeaderItemRender?e.groupStickyHeaderItemRender.call(void 0,o,{}):o)))))},[e.header,l,h,E]),U=t.useMemo(()=>`calc(${l.map(o=>me(o.width,u.width)).filter(Boolean).join(" + ")} + ${y}px + 4px)`,[l,y]),B=e.virtual?e.virtual.skip:0,X=t.useCallback((o,r)=>{const g=l.map((p,se)=>t.createElement("span",{className:e.itemRender?void 0:"k-table-td",style:e.itemRender?void 0:{width:p.width?p.width:u.width},key:p.uniqueKey?p.uniqueKey:se},p.field?String(n.getter(p.field)(r.dataItem)):""));let I,C,k,v,O=e.data||[];const P=r.index-B;e.groupField!==void 0&&(v=n.getter(e.groupField),C=v(O[P]),k=v(O[P-1]),C&&k&&C!==k&&(I=C));const T=t.cloneElement(o,{...o.props,className:n.classNames("k-table-row",{"k-table-alt-row":r.index%2!==0,"k-focus":r.focused,"k-selected":r.selected,"k-first":!!I,"k-disabled":r.dataItem.disabled})},g);return e.itemRender?e.itemRender.call(void 0,T,r):T},[l,e.groupField,e.itemRender,e.data,B]),s=t.useCallback((o,r)=>{o&&o.call(void 0,{...r,target:d.current})},[]),Y=t.useCallback(o=>(e.virtual||b(m),s(S,o)),[s,S,e.virtual,m]),Z=t.useCallback(o=>s(w,o),[w]),ee=t.useCallback(o=>s(F,o),[F]),te=t.useCallback(o=>s(N,o),[N]),oe=t.useCallback(o=>s(H,o),[H]),re=t.useCallback(o=>s(R,o),[R]),ae=t.useCallback(o=>(b(m),s(M,{...o,mobileMode:o.target.mobileMode})),[M]),ne=t.useCallback(o=>{b(o.group)},[]);t.useEffect(()=>{n.setScrollbarWidth()}),t.useEffect(()=>{const o=e.data;b(m),o&&o.length!==0?q(!0):q(!1)},[e.data]);const le=t.useCallback(o=>t.createElement(de.MultiColumnList,{...o}),[]);return t.createElement(j.ComboBox,{...V,list:le,popupSettings:{...f,popupClass:n.classNames("k-dropdowngrid-popup",f.popupClass),width:f.width||U,className:f.className},ref:c,header:Q,itemRender:X,groupHeaderItemRender:e.groupHeaderItemRender,size:W,rounded:z,fillMode:L,groupField:e.groupField,isMultiColumn:!0,onOpen:Y,onClose:Z,onFocus:ee,onBlur:te,onChange:oe,onFilterChange:ae,onPageChange:re,onGroupScroll:ne,className:n.classNames("k-dropdowngrid",_),required:e.required,adaptive:e.adaptive,adaptiveFilter:e.adaptiveFilter,adaptiveTitle:e.adaptiveTitle,adaptiveSubtitle:e.adaptiveSubtitle,footer:e.footer,footerClassName:"k-table-footer",prefix:A,suffix:J})}),ge={...j.ComboBoxWithoutContext.propTypes,columns:ie.any.isRequired},u={columns:[],popupSettings:{},width:"200px",size:void 0,rounded:void 0,fillMode:void 0};x.displayName="KendoMultiColumnComboBox";x.propTypes=ge;exports.MultiColumnComboBox=x;exports.MultiColumnComboBoxPropsContext=G;
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import se from "prop-types";
|
|
10
10
|
import { MultiColumnList as ie } from "../common/MultiColumnList.mjs";
|
|
11
|
-
import { createPropsContext as ue, usePropsContext as de, getScrollbarWidth as ce, getter as T, classNames as
|
|
11
|
+
import { createPropsContext as ue, usePropsContext as de, getScrollbarWidth as ce, getter as T, classNames as v, setScrollbarWidth as pe } from "@progress/kendo-react-common";
|
|
12
12
|
import { ComboBox as me, ComboBoxWithoutContext as fe } from "../ComboBox/ComboBox.mjs";
|
|
13
13
|
import { getItemValue as ge } from "../common/utils.mjs";
|
|
14
14
|
import W from "../common/withCustomComponent.mjs";
|
|
15
|
-
const he = (s,
|
|
16
|
-
(s,
|
|
17
|
-
const t = de(
|
|
15
|
+
const he = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, Ce = ue(), P = e.forwardRef(
|
|
16
|
+
(s, g) => {
|
|
17
|
+
const t = de(Ce, s), h = e.useRef(null), i = e.useRef(null), x = ce(), {
|
|
18
18
|
columns: r = l.columns,
|
|
19
19
|
popupSettings: p = l.popupSettings,
|
|
20
20
|
size: z = l.size,
|
|
@@ -23,16 +23,16 @@ const he = (s, h) => s ? typeof s == "number" ? s + "px" : s : h, be = ue(), P =
|
|
|
23
23
|
className: $,
|
|
24
24
|
prefix: j = void 0,
|
|
25
25
|
suffix: V = void 0,
|
|
26
|
-
onOpen:
|
|
27
|
-
onClose:
|
|
26
|
+
onOpen: y,
|
|
27
|
+
onClose: w,
|
|
28
28
|
onFocus: F,
|
|
29
29
|
onBlur: S,
|
|
30
30
|
onChange: H,
|
|
31
|
-
onFilterChange:
|
|
32
|
-
onPageChange:
|
|
31
|
+
onFilterChange: E,
|
|
32
|
+
onPageChange: N,
|
|
33
33
|
...A
|
|
34
34
|
} = t;
|
|
35
|
-
e.useImperativeHandle(
|
|
35
|
+
e.useImperativeHandle(h, () => {
|
|
36
36
|
var o;
|
|
37
37
|
return {
|
|
38
38
|
element: ((o = i.current) == null ? void 0 : o.element) || null,
|
|
@@ -50,74 +50,72 @@ const he = (s, h) => s ? typeof s == "number" ? s + "px" : s : h, be = ue(), P =
|
|
|
50
50
|
props: t
|
|
51
51
|
};
|
|
52
52
|
}), e.useImperativeHandle(
|
|
53
|
-
|
|
54
|
-
() =>
|
|
53
|
+
g,
|
|
54
|
+
() => h.current
|
|
55
55
|
);
|
|
56
|
-
const
|
|
56
|
+
const d = e.useMemo(() => {
|
|
57
57
|
if (t.groupField !== void 0 && t.data)
|
|
58
58
|
return ge(t.data[0], t.groupField);
|
|
59
|
-
}, [t.data, t.groupField]), [C, m] = e.useState(
|
|
59
|
+
}, [t.data, t.groupField]), [C, m] = e.useState(d), [R, M] = e.useState(!0), [D] = j ? W(t.prefix || e.Fragment) : [], [J] = V ? W(t.suffix || e.Fragment) : [], Q = e.useMemo(() => {
|
|
60
60
|
const o = /* @__PURE__ */ e.createElement("th", { className: "k-table-th", colSpan: r.length }, C);
|
|
61
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, t.header, /* @__PURE__ */ e.createElement("div", { className: "k-table-header-wrap k-table-scroller" }, /* @__PURE__ */ e.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ e.createElement("colgroup", null, r.map((a,
|
|
61
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, t.header, /* @__PURE__ */ e.createElement("div", { className: "k-table-header-wrap k-table-scroller" }, /* @__PURE__ */ e.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ e.createElement("colgroup", null, r.map((a, c) => /* @__PURE__ */ e.createElement(
|
|
62
62
|
"col",
|
|
63
63
|
{
|
|
64
|
-
key: a.uniqueKey ? a.uniqueKey :
|
|
64
|
+
key: a.uniqueKey ? a.uniqueKey : c,
|
|
65
65
|
style: { width: a.width ? a.width : l.width }
|
|
66
66
|
}
|
|
67
|
-
))), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" }, r.map((a,
|
|
67
|
+
))), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" }, r.map((a, c) => /* @__PURE__ */ e.createElement("th", { className: "k-table-th", key: a.uniqueKey ? a.uniqueKey : c }, a.header || " "))), C && R && /* @__PURE__ */ e.createElement("tr", { className: "k-table-group-row" }, t.groupStickyHeaderItemRender ? t.groupStickyHeaderItemRender.call(void 0, o, {}) : o)))));
|
|
68
68
|
}, [t.header, r, C, R]), U = e.useMemo(
|
|
69
69
|
() => (
|
|
70
70
|
// These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
|
|
71
|
-
`calc(${r.map((o) => he(o.width, l.width)).filter(Boolean).join(" + ")} + ${
|
|
71
|
+
`calc(${r.map((o) => he(o.width, l.width)).filter(Boolean).join(" + ")} + ${x}px + 4px)`
|
|
72
72
|
),
|
|
73
|
-
[r,
|
|
74
|
-
),
|
|
73
|
+
[r, x]
|
|
74
|
+
), B = t.virtual ? t.virtual.skip : 0, X = e.useCallback(
|
|
75
75
|
(o, a) => {
|
|
76
|
-
const
|
|
76
|
+
const c = r.map((u, le) => /* @__PURE__ */ e.createElement(
|
|
77
77
|
"span",
|
|
78
78
|
{
|
|
79
79
|
className: t.itemRender ? void 0 : "k-table-td",
|
|
80
|
-
style: t.itemRender ? void 0 : { width:
|
|
81
|
-
key:
|
|
80
|
+
style: t.itemRender ? void 0 : { width: u.width ? u.width : l.width },
|
|
81
|
+
key: u.uniqueKey ? u.uniqueKey : le
|
|
82
82
|
},
|
|
83
|
-
|
|
83
|
+
u.field ? String(T(u.field)(a.dataItem)) : ""
|
|
84
84
|
));
|
|
85
|
-
let f,
|
|
86
|
-
const K = a.index -
|
|
87
|
-
t.groupField !== void 0 && (
|
|
88
|
-
/* @__PURE__ */ e.createElement("div", { key: "group", className: "k-table-td k-table-group-td" }, /* @__PURE__ */ e.createElement("span", null, f))
|
|
89
|
-
);
|
|
85
|
+
let q, f, b, k, I = t.data || [];
|
|
86
|
+
const K = a.index - B;
|
|
87
|
+
t.groupField !== void 0 && (k = T(t.groupField), f = k(I[K]), b = k(I[K - 1]), f && b && f !== b && (q = f));
|
|
90
88
|
const G = e.cloneElement(
|
|
91
89
|
o,
|
|
92
90
|
{
|
|
93
91
|
...o.props,
|
|
94
|
-
className:
|
|
92
|
+
className: v("k-table-row", {
|
|
95
93
|
"k-table-alt-row": a.index % 2 !== 0,
|
|
96
94
|
"k-focus": a.focused,
|
|
97
95
|
"k-selected": a.selected,
|
|
98
|
-
"k-first": !!
|
|
96
|
+
"k-first": !!q,
|
|
99
97
|
"k-disabled": a.dataItem.disabled
|
|
100
98
|
})
|
|
101
99
|
},
|
|
102
|
-
|
|
100
|
+
c
|
|
103
101
|
);
|
|
104
102
|
return t.itemRender ? t.itemRender.call(void 0, G, a) : G;
|
|
105
103
|
},
|
|
106
|
-
[r, t.groupField, t.itemRender, t.data,
|
|
104
|
+
[r, t.groupField, t.itemRender, t.data, B]
|
|
107
105
|
), n = e.useCallback((o, a) => {
|
|
108
106
|
o && o.call(void 0, {
|
|
109
107
|
...a,
|
|
110
|
-
target:
|
|
108
|
+
target: h.current
|
|
111
109
|
});
|
|
112
110
|
}, []), Y = e.useCallback(
|
|
113
|
-
(o) => (t.virtual || m(
|
|
114
|
-
[n,
|
|
115
|
-
), Z = e.useCallback((o) => n(
|
|
116
|
-
(o) => (m(
|
|
111
|
+
(o) => (t.virtual || m(d), n(y, o)),
|
|
112
|
+
[n, y, t.virtual, d]
|
|
113
|
+
), Z = e.useCallback((o) => n(w, o), [w]), _ = e.useCallback((o) => n(F, o), [F]), ee = e.useCallback((o) => n(S, o), [S]), te = e.useCallback((o) => n(H, o), [H]), oe = e.useCallback((o) => n(N, o), [N]), ae = e.useCallback(
|
|
114
|
+
(o) => (m(d), n(E, {
|
|
117
115
|
...o,
|
|
118
116
|
mobileMode: o.target.mobileMode
|
|
119
117
|
})),
|
|
120
|
-
[
|
|
118
|
+
[E]
|
|
121
119
|
), re = e.useCallback((o) => {
|
|
122
120
|
m(o.group);
|
|
123
121
|
}, []);
|
|
@@ -125,7 +123,7 @@ const he = (s, h) => s ? typeof s == "number" ? s + "px" : s : h, be = ue(), P =
|
|
|
125
123
|
pe();
|
|
126
124
|
}), e.useEffect(() => {
|
|
127
125
|
const o = t.data;
|
|
128
|
-
m(
|
|
126
|
+
m(d), o && o.length !== 0 ? M(!0) : M(!1);
|
|
129
127
|
}, [t.data]);
|
|
130
128
|
const ne = e.useCallback((o) => /* @__PURE__ */ e.createElement(ie, { ...o }), []);
|
|
131
129
|
return /* @__PURE__ */ e.createElement(
|
|
@@ -135,7 +133,7 @@ const he = (s, h) => s ? typeof s == "number" ? s + "px" : s : h, be = ue(), P =
|
|
|
135
133
|
list: ne,
|
|
136
134
|
popupSettings: {
|
|
137
135
|
...p,
|
|
138
|
-
popupClass:
|
|
136
|
+
popupClass: v("k-dropdowngrid-popup", p.popupClass),
|
|
139
137
|
width: p.width || U,
|
|
140
138
|
className: p.className
|
|
141
139
|
},
|
|
@@ -146,7 +144,6 @@ const he = (s, h) => s ? typeof s == "number" ? s + "px" : s : h, be = ue(), P =
|
|
|
146
144
|
size: z,
|
|
147
145
|
rounded: O,
|
|
148
146
|
fillMode: L,
|
|
149
|
-
groupMode: t.groupMode,
|
|
150
147
|
groupField: t.groupField,
|
|
151
148
|
isMultiColumn: !0,
|
|
152
149
|
onOpen: Y,
|
|
@@ -157,7 +154,7 @@ const he = (s, h) => s ? typeof s == "number" ? s + "px" : s : h, be = ue(), P =
|
|
|
157
154
|
onFilterChange: ae,
|
|
158
155
|
onPageChange: oe,
|
|
159
156
|
onGroupScroll: re,
|
|
160
|
-
className:
|
|
157
|
+
className: v("k-dropdowngrid", $),
|
|
161
158
|
required: t.required,
|
|
162
159
|
adaptive: t.adaptive,
|
|
163
160
|
adaptiveFilter: t.adaptiveFilter,
|
|
@@ -170,20 +167,20 @@ const he = (s, h) => s ? typeof s == "number" ? s + "px" : s : h, be = ue(), P =
|
|
|
170
167
|
}
|
|
171
168
|
);
|
|
172
169
|
}
|
|
173
|
-
),
|
|
170
|
+
), be = {
|
|
174
171
|
...fe.propTypes,
|
|
175
172
|
columns: se.any.isRequired
|
|
176
173
|
}, l = {
|
|
177
174
|
columns: [],
|
|
178
175
|
popupSettings: {},
|
|
179
176
|
width: "200px",
|
|
180
|
-
size:
|
|
181
|
-
rounded:
|
|
182
|
-
fillMode:
|
|
177
|
+
size: void 0,
|
|
178
|
+
rounded: void 0,
|
|
179
|
+
fillMode: void 0
|
|
183
180
|
};
|
|
184
181
|
P.displayName = "KendoMultiColumnComboBox";
|
|
185
|
-
P.propTypes =
|
|
182
|
+
P.propTypes = be;
|
|
186
183
|
export {
|
|
187
184
|
P as MultiColumnComboBox,
|
|
188
|
-
|
|
185
|
+
Ce as MultiColumnComboBoxPropsContext
|
|
189
186
|
};
|