@progress/kendo-react-dropdowns 5.13.0-dev.202304200559 → 5.13.0-dev.202304201241
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/cdn/js/kendo-react-dropdowns.js +1 -1
- package/dist/es/AutoComplete/AutoComplete.d.ts +11 -2
- package/dist/es/AutoComplete/AutoComplete.js +60 -9
- package/dist/es/AutoComplete/AutoCompleteProps.d.ts +22 -0
- package/dist/es/ComboBox/ComboBox.d.ts +5 -1
- package/dist/es/ComboBox/ComboBox.js +22 -11
- package/dist/es/ComboBox/ComboBoxProps.d.ts +18 -0
- package/dist/es/DropDownList/DropDownList.d.ts +5 -0
- package/dist/es/DropDownList/DropDownList.js +54 -9
- package/dist/es/DropDownList/DropDownListProps.d.ts +22 -0
- package/dist/es/MultiColumnComboBox/MultiColumnComboBox.js +7 -5
- package/dist/es/MultiSelect/MultiSelect.d.ts +44 -45
- package/dist/es/MultiSelect/MultiSelect.js +277 -128
- package/dist/es/MultiSelect/MultiSelectProps.d.ts +44 -1
- package/dist/es/common/DropDownBase.d.ts +1 -0
- package/dist/es/common/DropDownBase.js +13 -0
- package/dist/es/common/GroupStickyHeader.d.ts +24 -0
- package/dist/es/common/GroupStickyHeader.js +34 -0
- package/dist/es/common/List.d.ts +5 -1
- package/dist/es/common/List.js +9 -2
- package/dist/es/common/ListGroupItem.d.ts +33 -0
- package/dist/es/common/ListGroupItem.js +33 -0
- package/dist/es/common/ListItem.d.ts +4 -0
- package/dist/es/common/ListItem.js +3 -3
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/AutoComplete/AutoComplete.d.ts +11 -2
- package/dist/npm/AutoComplete/AutoComplete.js +60 -9
- package/dist/npm/AutoComplete/AutoCompleteProps.d.ts +22 -0
- package/dist/npm/ComboBox/ComboBox.d.ts +5 -1
- package/dist/npm/ComboBox/ComboBox.js +22 -11
- package/dist/npm/ComboBox/ComboBoxProps.d.ts +18 -0
- package/dist/npm/DropDownList/DropDownList.d.ts +5 -0
- package/dist/npm/DropDownList/DropDownList.js +54 -9
- package/dist/npm/DropDownList/DropDownListProps.d.ts +22 -0
- package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.js +7 -5
- package/dist/npm/MultiSelect/MultiSelect.d.ts +44 -45
- package/dist/npm/MultiSelect/MultiSelect.js +276 -127
- package/dist/npm/MultiSelect/MultiSelectProps.d.ts +44 -1
- package/dist/npm/common/DropDownBase.d.ts +1 -0
- package/dist/npm/common/DropDownBase.js +13 -0
- package/dist/npm/common/GroupStickyHeader.d.ts +24 -0
- package/dist/npm/common/GroupStickyHeader.js +36 -0
- package/dist/npm/common/List.d.ts +5 -1
- package/dist/npm/common/List.js +9 -2
- package/dist/npm/common/ListGroupItem.d.ts +33 -0
- package/dist/npm/common/ListGroupItem.js +35 -0
- package/dist/npm/common/ListItem.d.ts +4 -0
- package/dist/npm/common/ListItem.js +3 -3
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-react-dropdowns.js +1 -1
- package/package.json +13 -13
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { MultiSelect } from './MultiSelect';
|
|
3
3
|
import { FormComponentProps } from '@progress/kendo-react-common';
|
|
4
|
-
import { FilterChangeEvent, ChangeEvent, OpenEvent, CloseEvent, FocusEvent, BlurEvent, PageChangeEvent } from './../common/events';
|
|
4
|
+
import { FilterChangeEvent, ChangeEvent, OpenEvent, CloseEvent, FocusEvent, BlurEvent, PageChangeEvent, CancelEvent } from './../common/events';
|
|
5
5
|
import { VirtualizationSettings, DropDownsPopupSettings } from '../common/settings';
|
|
6
|
+
import { ListGroupItemProps } from '../common/ListGroupItem';
|
|
7
|
+
import { GroupStickyHeaderProps } from '../common/GroupStickyHeader';
|
|
6
8
|
import { ListItemProps } from '../common/ListItem';
|
|
7
9
|
import { TagData } from './TagList';
|
|
8
10
|
/**
|
|
@@ -15,6 +17,11 @@ export interface MultiSelectFilterChangeEvent extends FilterChangeEvent<MultiSel
|
|
|
15
17
|
*/
|
|
16
18
|
export interface MultiSelectChangeEvent extends ChangeEvent<MultiSelect> {
|
|
17
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Represents the object of the `onCancel` MultiSelect event.
|
|
22
|
+
*/
|
|
23
|
+
export interface MultiSelectCancelEvent extends CancelEvent<MultiSelect> {
|
|
24
|
+
}
|
|
18
25
|
/**
|
|
19
26
|
* Represents the object of the `open` MultiSelect event.
|
|
20
27
|
*/
|
|
@@ -151,6 +158,10 @@ export interface MultiSelectProps extends FormComponentProps {
|
|
|
151
158
|
* Sets the value of filtering input. Useful for making the filtering input a [controlled component](https://reactjs.org/docs/forms.html#controlled-components).
|
|
152
159
|
*/
|
|
153
160
|
filter?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Sets the value of the adaptive filtering input of the of ComboBox.
|
|
163
|
+
*/
|
|
164
|
+
adaptiveFilter?: string;
|
|
154
165
|
/**
|
|
155
166
|
* Sets the loading state of the MultiSelect ([see example]({% slug filtering_multiselect %}#toc-basic-configuration)).
|
|
156
167
|
*/
|
|
@@ -199,6 +210,10 @@ export interface MultiSelectProps extends FormComponentProps {
|
|
|
199
210
|
* Fires each time the value of the MultiSelect is about to change ([see examples]({% slug binding_multiselect %})).
|
|
200
211
|
*/
|
|
201
212
|
onChange?: (event: MultiSelectChangeEvent) => void;
|
|
213
|
+
/**
|
|
214
|
+
* Fires each time the popup of the MultiSelect is about to cancel in ([adaptive mode]({% slug adaptive_rendering_multiselect %})).
|
|
215
|
+
*/
|
|
216
|
+
onCancel?: (event: MultiSelectCancelEvent) => void;
|
|
202
217
|
/**
|
|
203
218
|
* Fires each time the user types in the filter input ([see example]({% slug filtering_multiselect %}#toc-basic-configuration)). You can filter the source based on the passed filtration value.
|
|
204
219
|
*/
|
|
@@ -264,4 +279,32 @@ export interface MultiSelectProps extends FormComponentProps {
|
|
|
264
279
|
* @default `solid`
|
|
265
280
|
*/
|
|
266
281
|
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
282
|
+
/**
|
|
283
|
+
* Sets the data item field that represents the start of a group. Applicable to objects data.
|
|
284
|
+
*/
|
|
285
|
+
groupField?: string;
|
|
286
|
+
/**
|
|
287
|
+
* Fires when a DropDownList's group header item is about to be rendered. Used to override the default appearance of the group's headers.
|
|
288
|
+
*/
|
|
289
|
+
groupHeaderItemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListGroupItemProps) => React.ReactNode;
|
|
290
|
+
/**
|
|
291
|
+
* Fires when a DropDownList's sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component.
|
|
292
|
+
*/
|
|
293
|
+
groupStickyHeaderItemRender?: (div: React.ReactElement<HTMLDivElement>, stickyHeaderProps: GroupStickyHeaderProps) => React.ReactNode;
|
|
294
|
+
/**
|
|
295
|
+
* @hidden
|
|
296
|
+
*/
|
|
297
|
+
list?: any;
|
|
298
|
+
/**
|
|
299
|
+
* @hidden
|
|
300
|
+
*/
|
|
301
|
+
groupMode?: string;
|
|
302
|
+
/**
|
|
303
|
+
* Providing different rendering of the popup element based on the screen dimensions.
|
|
304
|
+
*/
|
|
305
|
+
adaptive?: boolean;
|
|
306
|
+
/**
|
|
307
|
+
* Specifies the text that is rendered as title in the adaptive popup.
|
|
308
|
+
*/
|
|
309
|
+
adaptiveTitle?: string;
|
|
267
310
|
}
|
|
@@ -160,4 +160,5 @@ export default class DropDownBase {
|
|
|
160
160
|
scrollToVirtualItem: (virtual: VirtualizationSettings, selectedItemIndex: number) => void;
|
|
161
161
|
renderScrollElement: () => false | JSX.Element;
|
|
162
162
|
getPopupSettings(): DropDownsPopupSettings;
|
|
163
|
+
getGroupedDataModernMode(data: any[], groupField: string): any[];
|
|
163
164
|
}
|
|
@@ -211,6 +211,19 @@ var DropDownBase = /** @class */ (function () {
|
|
|
211
211
|
return Object
|
|
212
212
|
.assign({}, DropDownBase.defaultProps.popupSettings, this.component.props.popupSettings);
|
|
213
213
|
};
|
|
214
|
+
DropDownBase.prototype.getGroupedDataModernMode = function (data, groupField) {
|
|
215
|
+
var newData = [];
|
|
216
|
+
data.forEach(function (el, index) {
|
|
217
|
+
if (data[index - 1] && el[groupField] !== data[index - 1][groupField]) {
|
|
218
|
+
newData.push({ position: el[groupField] });
|
|
219
|
+
newData.push(data[index]);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
newData.push(data[index]);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
return newData;
|
|
226
|
+
};
|
|
214
227
|
DropDownBase.basicPropTypes = {
|
|
215
228
|
opened: PropTypes.bool,
|
|
216
229
|
disabled: PropTypes.bool,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the props of the GroupStickyHeader component.
|
|
4
|
+
*/
|
|
5
|
+
export interface GroupStickyHeaderProps {
|
|
6
|
+
/**
|
|
7
|
+
* The group that will be rendered.
|
|
8
|
+
*/
|
|
9
|
+
group?: string;
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
groupMode?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Fires when a ComboBox sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component.
|
|
16
|
+
*/
|
|
17
|
+
render?: (div: React.ReactElement<HTMLDivElement>, itemProps: GroupStickyHeaderProps) => React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
export default class GroupStickyHeader extends React.Component<GroupStickyHeaderProps, {}> {
|
|
23
|
+
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
24
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var React = require("react");
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
var GroupStickyHeader = /** @class */ (function (_super) {
|
|
23
|
+
__extends(GroupStickyHeader, _super);
|
|
24
|
+
function GroupStickyHeader() {
|
|
25
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
}
|
|
27
|
+
GroupStickyHeader.prototype.render = function () {
|
|
28
|
+
var _a = this.props, group = _a.group, groupMode = _a.groupMode, renderer = _a.render;
|
|
29
|
+
var item = (React.createElement("div", { className: "k-list-group-sticky-header" }, groupMode === 'classic'
|
|
30
|
+
? group
|
|
31
|
+
: React.createElement("div", { className: "k-list-header-text" }, group)));
|
|
32
|
+
return renderer !== undefined ? renderer.call(undefined, item, this.props) : item;
|
|
33
|
+
};
|
|
34
|
+
return GroupStickyHeader;
|
|
35
|
+
}(React.Component));
|
|
36
|
+
exports.default = GroupStickyHeader;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ListItemProps } from './ListItem';
|
|
3
|
+
import { ListGroupItemProps } from './ListGroupItem';
|
|
3
4
|
import { LocalizationService } from '@progress/kendo-react-intl';
|
|
4
5
|
/**
|
|
5
6
|
* @hidden
|
|
@@ -13,6 +14,8 @@ export interface ListProps {
|
|
|
13
14
|
textField?: string;
|
|
14
15
|
valueField?: string;
|
|
15
16
|
groupField?: string;
|
|
17
|
+
groupMode?: string;
|
|
18
|
+
isMultiColumn?: boolean;
|
|
16
19
|
optionsGuid?: string;
|
|
17
20
|
listRef?: React.Ref<HTMLUListElement>;
|
|
18
21
|
wrapperRef?: React.Ref<HTMLDivElement>;
|
|
@@ -25,6 +28,7 @@ export interface ListProps {
|
|
|
25
28
|
highlightSelected?: boolean;
|
|
26
29
|
onClick: (index: number, event: React.MouseEvent<HTMLLIElement>) => void;
|
|
27
30
|
itemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React.ReactNode;
|
|
31
|
+
groupHeaderItemRender?: (li: React.ReactElement<HTMLLIElement>, groupItemProps: ListGroupItemProps) => React.ReactNode;
|
|
28
32
|
noDataRender?: (element: React.ReactElement<HTMLDivElement>) => React.ReactNode;
|
|
29
33
|
onMouseDown?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
30
34
|
onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
@@ -35,7 +39,7 @@ export interface ListProps {
|
|
|
35
39
|
* @hidden
|
|
36
40
|
*/
|
|
37
41
|
export default class List extends React.Component<ListProps> {
|
|
38
|
-
renderItems(): JSX.Element[];
|
|
42
|
+
renderItems(): (false | JSX.Element)[][];
|
|
39
43
|
renderNoValueElement(localizationService: LocalizationService): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
40
44
|
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
41
45
|
}
|
package/dist/npm/common/List.js
CHANGED
|
@@ -17,6 +17,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
var React = require("react");
|
|
19
19
|
var ListItem_1 = require("./ListItem");
|
|
20
|
+
var ListGroupItem_1 = require("./ListGroupItem");
|
|
20
21
|
var utils_1 = require("./utils");
|
|
21
22
|
var kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
22
23
|
var messages_1 = require("../messages");
|
|
@@ -30,10 +31,12 @@ var List = /** @class */ (function (_super) {
|
|
|
30
31
|
}
|
|
31
32
|
List.prototype.renderItems = function () {
|
|
32
33
|
var _this = this;
|
|
33
|
-
var _a = this.props, textField = _a.textField, valueField = _a.valueField, groupField = _a.groupField, optionsGuid = _a.optionsGuid, _b = _a.skip, skip = _b === void 0 ? 0 : _b, virtual = _a.virtual, focusedIndex = _a.focusedIndex, _c = _a.highlightSelected, highlightSelected = _c === void 0 ? true : _c, value = _a.value, data = _a.data, itemRender = _a.itemRender;
|
|
34
|
+
var _a = this.props, textField = _a.textField, valueField = _a.valueField, groupField = _a.groupField, groupMode = _a.groupMode, isMultiColumn = _a.isMultiColumn, optionsGuid = _a.optionsGuid, _b = _a.skip, skip = _b === void 0 ? 0 : _b, virtual = _a.virtual, focusedIndex = _a.focusedIndex, _c = _a.highlightSelected, highlightSelected = _c === void 0 ? true : _c, value = _a.value, data = _a.data, itemRender = _a.itemRender, groupHeaderItemRender = _a.groupHeaderItemRender;
|
|
34
35
|
var isArray = Array.isArray(value);
|
|
36
|
+
var groupCounter = 0;
|
|
35
37
|
return data.map(function (item, index) {
|
|
36
38
|
var realIndex = skip + index;
|
|
39
|
+
var idIndex = skip + index + groupCounter;
|
|
37
40
|
var selected = highlightSelected &&
|
|
38
41
|
((!isArray && (0, utils_1.areSame)(item, value, valueField)) ||
|
|
39
42
|
(isArray && value.findIndex(function (i) { return (0, utils_1.areSame)(i, item, valueField); }) !== -1));
|
|
@@ -46,7 +49,11 @@ var List = /** @class */ (function (_super) {
|
|
|
46
49
|
group = current;
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
|
-
|
|
52
|
+
group !== undefined && groupMode === 'modern' ? groupCounter += 1 : '';
|
|
53
|
+
return [
|
|
54
|
+
group !== undefined && groupMode === 'modern' && React.createElement(ListGroupItem_1.default, { id: "option-".concat(optionsGuid, "-").concat(idIndex), virtual: virtual, key: realIndex + '-group-item', group: group, isMultiColumn: isMultiColumn, render: groupHeaderItemRender }),
|
|
55
|
+
React.createElement(ListItem_1.default, { id: "option-".concat(optionsGuid, "-").concat(group !== undefined && groupMode === 'modern' ? idIndex + 1 : idIndex), virtual: virtual, dataItem: item, groupMode: groupMode, selected: selected, focused: focusedIndex === index, index: realIndex, key: realIndex, onClick: _this.props.onClick, textField: textField, group: group, render: itemRender })
|
|
56
|
+
];
|
|
50
57
|
});
|
|
51
58
|
};
|
|
52
59
|
List.prototype.renderNoValueElement = function (localizationService) {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the props of the ListGroupItem component.
|
|
4
|
+
*/
|
|
5
|
+
export interface ListGroupItemProps {
|
|
6
|
+
/**
|
|
7
|
+
* Specifies the id that will be added to the group header item element.
|
|
8
|
+
*/
|
|
9
|
+
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The group that will be rendered.
|
|
12
|
+
*/
|
|
13
|
+
group?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
virtual?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
* Provides information if the rendered list is a multicolumn popup
|
|
21
|
+
*/
|
|
22
|
+
isMultiColumn?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Fires when the group header item is about to be rendered. Used to override the default appearance of the group header item.
|
|
25
|
+
*/
|
|
26
|
+
render?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListGroupItemProps) => React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @hidden
|
|
30
|
+
*/
|
|
31
|
+
export default class ListGroupItem extends React.Component<ListGroupItemProps, {}> {
|
|
32
|
+
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
33
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var React = require("react");
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
var ListGroupItem = /** @class */ (function (_super) {
|
|
23
|
+
__extends(ListGroupItem, _super);
|
|
24
|
+
function ListGroupItem() {
|
|
25
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
}
|
|
27
|
+
ListGroupItem.prototype.render = function () {
|
|
28
|
+
var _a = this.props, group = _a.group, virtual = _a.virtual, renderer = _a.render, _b = _a.isMultiColumn, isMultiColumn = _b === void 0 ? false : _b;
|
|
29
|
+
var item = (React.createElement("li", { id: this.props.id, role: "group", className: isMultiColumn ? 'k-table-group-row' : 'k-list-group-item', style: isMultiColumn ? { 'boxSizing': 'inherit' } : { position: virtual ? 'relative' : 'unset' } },
|
|
30
|
+
React.createElement("span", { className: !renderer ? isMultiColumn ? 'k-table-th' : 'k-list-item-text' : undefined }, group)));
|
|
31
|
+
return renderer !== undefined ? renderer.call(undefined, item, this.props) : item;
|
|
32
|
+
};
|
|
33
|
+
return ListGroupItem;
|
|
34
|
+
}(React.Component));
|
|
35
|
+
exports.default = ListGroupItem;
|
|
@@ -15,6 +15,10 @@ export interface ListItemProps {
|
|
|
15
15
|
* Represents the data item of the list item element.
|
|
16
16
|
*/
|
|
17
17
|
dataItem: any;
|
|
18
|
+
/**
|
|
19
|
+
* Represents the `classic` or `modern` grouping mode of the DropDowns. Defaults to `classic`.
|
|
20
|
+
*/
|
|
21
|
+
groupMode: any;
|
|
18
22
|
/**
|
|
19
23
|
* Sets the data item field that represents the item text. If the data contains only primitive values, do not define it.
|
|
20
24
|
*/
|
|
@@ -30,14 +30,14 @@ var ListItem = /** @class */ (function (_super) {
|
|
|
30
30
|
return _this;
|
|
31
31
|
}
|
|
32
32
|
ListItem.prototype.render = function () {
|
|
33
|
-
var _a = this.props, selected = _a.selected, group = _a.group, dataItem = _a.dataItem, virtual = _a.virtual, renderer = _a.render;
|
|
33
|
+
var _a = this.props, selected = _a.selected, group = _a.group, dataItem = _a.dataItem, virtual = _a.virtual, groupMode = _a.groupMode, renderer = _a.render;
|
|
34
34
|
var item = (React.createElement("li", { id: this.props.id, role: "option", "aria-selected": selected, className: (0, kendo_react_common_1.classNames)('k-list-item', {
|
|
35
35
|
'k-selected': selected,
|
|
36
36
|
'k-focus': this.props.focused,
|
|
37
|
-
'k-first': Boolean(group)
|
|
37
|
+
'k-first': Boolean(group) && groupMode === 'classic'
|
|
38
38
|
}), onClick: this.handleClick, style: { position: virtual ? 'relative' : 'unset' } },
|
|
39
39
|
React.createElement("span", { className: 'k-list-item-text' }, (0, utils_1.getItemValue)(dataItem, this.props.textField).toString()),
|
|
40
|
-
group !== undefined ? React.createElement("div", { className: "k-list-item-group-label" }, group) : null));
|
|
40
|
+
group !== undefined && groupMode === 'classic' ? React.createElement("div", { className: "k-list-item-group-label" }, group) : null));
|
|
41
41
|
return renderer !== undefined ? renderer.call(undefined, item, this.props) : item;
|
|
42
42
|
};
|
|
43
43
|
return ListItem;
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-react-dropdowns',
|
|
9
9
|
productName: 'KendoReact',
|
|
10
10
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1681992695,
|
|
12
12
|
version: '',
|
|
13
13
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
14
14
|
};
|