@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
|
@@ -37,6 +37,7 @@ var SearchBar_1 = require("../common/SearchBar");
|
|
|
37
37
|
var ListContainer_1 = require("../common/ListContainer");
|
|
38
38
|
var List_1 = require("../common/List");
|
|
39
39
|
var ListFilter_1 = require("../common/ListFilter");
|
|
40
|
+
var GroupStickyHeader_1 = require("../common/GroupStickyHeader");
|
|
40
41
|
var kendo_react_common_2 = require("@progress/kendo-react-common");
|
|
41
42
|
var package_metadata_1 = require("../package-metadata");
|
|
42
43
|
var ClearButton_1 = require("../common/ClearButton");
|
|
@@ -123,7 +124,8 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
123
124
|
_this.onScroll = function (event) {
|
|
124
125
|
var _a = _this.base, vs = _a.vs, list = _a.list;
|
|
125
126
|
vs.scrollHandler(event);
|
|
126
|
-
var
|
|
127
|
+
var groupField = _this.props.groupField;
|
|
128
|
+
var _b = _this.props.data, data = _b === void 0 ? [] : _b;
|
|
127
129
|
if (!groupField || !data.length) {
|
|
128
130
|
return;
|
|
129
131
|
}
|
|
@@ -131,6 +133,9 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
131
133
|
_this.itemHeight || (vs.enabled ? vs.itemHeight : (list ? list.children[0].offsetHeight : 0));
|
|
132
134
|
var target = event.target;
|
|
133
135
|
var scrollTop = target.scrollTop - (vs.skip * itemHeight);
|
|
136
|
+
if (_this.props.groupMode === 'modern') {
|
|
137
|
+
data = _this.base.getGroupedDataModernMode(data, groupField);
|
|
138
|
+
}
|
|
134
139
|
var group = data[0][groupField];
|
|
135
140
|
for (var i = 1; i < data.length; i++) {
|
|
136
141
|
if (itemHeight * i > scrollTop) {
|
|
@@ -381,7 +386,9 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
381
386
|
});
|
|
382
387
|
/** @hidden */
|
|
383
388
|
ComboBoxWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
384
|
-
var _a
|
|
389
|
+
var _a;
|
|
390
|
+
var _b = this.props, dataItemKey = _b.dataItemKey, virtual = _b.virtual, _c = _b.groupField, groupField = _c === void 0 ? '' : _c;
|
|
391
|
+
var _d = this.props.data, data = _d === void 0 ? [] : _d;
|
|
385
392
|
var prevTotal = prevProps.virtual ? prevProps.virtual.total : 0;
|
|
386
393
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
387
394
|
var prevOpened = prevProps.opened !== undefined ? prevProps.opened : prevState.opened;
|
|
@@ -395,6 +402,10 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
395
402
|
else {
|
|
396
403
|
var prevSelectedItem = prevProps.value !== undefined ? prevProps.value : prevState.value;
|
|
397
404
|
var selectedItemIndex = data.findIndex(function (i) { return (0, utils_1.areSame)(i, selectedItem, dataItemKey); });
|
|
405
|
+
// Needed to calculate the proper item index when in 'modern' grouping mode
|
|
406
|
+
if (this.props.groupMode === 'modern') {
|
|
407
|
+
selectedItemIndex = (_a = this.base.getGroupedDataModernMode(data, groupField)) === null || _a === void 0 ? void 0 : _a.indexOf(selectedItem);
|
|
408
|
+
}
|
|
398
409
|
var selectedItemChanged = !(0, utils_1.areSame)(prevSelectedItem, selectedItem, dataItemKey);
|
|
399
410
|
if (opening && virtual) {
|
|
400
411
|
this.base.scrollToVirtualItem(virtual, selectedItemIndex);
|
|
@@ -585,7 +596,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
585
596
|
var _a;
|
|
586
597
|
var _this = this;
|
|
587
598
|
var _b = this.state.windowWidth, windowWidth = _b === void 0 ? 0 : _b;
|
|
588
|
-
var _c = this.props, header = _c.header, footer = _c.footer, size = _c.size, _d = _c.data, data = _d === void 0 ? [] : _d, groupField = _c.groupField, list = _c.list, virtual = _c.virtual, adaptiveTitle = _c.adaptiveTitle;
|
|
599
|
+
var _c = this.props, header = _c.header, footer = _c.footer, size = _c.size, _d = _c.data, data = _d === void 0 ? [] : _d, groupField = _c.groupField, groupMode = _c.groupMode, list = _c.list, virtual = _c.virtual, adaptiveTitle = _c.adaptiveTitle, groupStickyHeaderItemRender = _c.groupStickyHeaderItemRender;
|
|
589
600
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
590
601
|
var group = this.state.group;
|
|
591
602
|
if (group === undefined && groupField !== undefined) {
|
|
@@ -621,14 +632,14 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
621
632
|
_a["k-table-".concat(sizeMap[size] || size)] = list && size,
|
|
622
633
|
_a)) },
|
|
623
634
|
header && React.createElement("div", { className: "k-table-header" }, header),
|
|
624
|
-
!list && group && React.createElement(
|
|
635
|
+
!list && group && React.createElement(GroupStickyHeader_1.default, { group: group, groupMode: groupMode, render: groupStickyHeaderItemRender }),
|
|
625
636
|
this.renderList(),
|
|
626
637
|
footer && React.createElement("div", { className: "k-list-footer" }, footer)))))));
|
|
627
638
|
};
|
|
628
639
|
ComboBoxWithoutContext.prototype.renderListContainer = function () {
|
|
629
640
|
var _a;
|
|
630
641
|
var base = this.base;
|
|
631
|
-
var _b = this.props, dir = _b.dir, header = _b.header, footer = _b.footer, _c = _b.data, data = _c === void 0 ? [] : _c, groupField = _b.groupField, size = _b.size, list = _b.list, virtual = _b.virtual;
|
|
642
|
+
var _b = this.props, dir = _b.dir, header = _b.header, footer = _b.footer, _c = _b.data, data = _c === void 0 ? [] : _c, groupField = _b.groupField, groupMode = _b.groupMode, size = _b.size, list = _b.list, virtual = _b.virtual, groupStickyHeaderItemRender = _b.groupStickyHeaderItemRender;
|
|
632
643
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
633
644
|
var popupSettings = base.getPopupSettings();
|
|
634
645
|
var popupWidth = popupSettings.width !== undefined ? popupSettings.width : base.popupWidth;
|
|
@@ -652,7 +663,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
652
663
|
_a["k-table-".concat(sizeMap[size] || size)] = list && size,
|
|
653
664
|
_a)) },
|
|
654
665
|
header && React.createElement("div", { className: "k-table-header" }, header),
|
|
655
|
-
!list && group && React.createElement(
|
|
666
|
+
!list && group && React.createElement(GroupStickyHeader_1.default, { group: group, groupMode: groupMode, render: groupStickyHeaderItemRender }),
|
|
656
667
|
this.renderList(),
|
|
657
668
|
footer && React.createElement("div", { className: "k-list-footer" }, footer))));
|
|
658
669
|
};
|
|
@@ -660,7 +671,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
660
671
|
var _a;
|
|
661
672
|
var _this = this;
|
|
662
673
|
var base = this.base;
|
|
663
|
-
var _b = this.props, textField = _b.textField, dataItemKey = _b.dataItemKey, listNoDataRender = _b.listNoDataRender, itemRender = _b.itemRender, _c = _b.data, data = _c === void 0 ? [] : _c, _d = _b.virtual, virtual = _d === void 0 ? { skip: 0 } : _d;
|
|
674
|
+
var _b = this.props, textField = _b.textField, dataItemKey = _b.dataItemKey, listNoDataRender = _b.listNoDataRender, itemRender = _b.itemRender, groupHeaderItemRender = _b.groupHeaderItemRender, _c = _b.data, data = _c === void 0 ? [] : _c, _d = _b.virtual, virtual = _d === void 0 ? { skip: 0 } : _d;
|
|
664
675
|
var popupSettings = base.getPopupSettings();
|
|
665
676
|
var vs = base.vs;
|
|
666
677
|
var skip = virtual.skip;
|
|
@@ -671,11 +682,11 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
671
682
|
var selectedItemText = (0, utils_1.getItemValue)(this.value, textField);
|
|
672
683
|
var value = (0, utils_1.isPresent)(text) && text !== selectedItemText ? null : this.value;
|
|
673
684
|
var ListComponent = this.props.list || List_1.default;
|
|
674
|
-
return (React.createElement(ListComponent, { id: base.listBoxId, virtual: Boolean(virtual), show: opened, data: data, focusedIndex: focusedIndex, value: value, textField: textField, valueField: dataItemKey, groupField: this.props.groupField, optionsGuid: base.guid, listRef: function (list) { vs.list = _this.base.list = list; _this.itemHeight = 0; }, wrapperStyle: (this.state.windowWidth && this.state.windowWidth > constants_1.MOBILE_MEDIUM_DEVISE)
|
|
685
|
+
return (React.createElement(ListComponent, { id: base.listBoxId, virtual: Boolean(virtual), show: opened, data: data, focusedIndex: focusedIndex, value: value, textField: textField, valueField: dataItemKey, groupField: this.props.groupField, groupMode: this.props.groupMode, isMultiColumn: this.props.isMultiColumn, optionsGuid: base.guid, listRef: function (list) { vs.list = _this.base.list = list; _this.itemHeight = 0; }, wrapperStyle: (this.state.windowWidth && this.state.windowWidth > constants_1.MOBILE_MEDIUM_DEVISE)
|
|
675
686
|
? { maxHeight: popupSettings.height }
|
|
676
687
|
: {}, wrapperCssClass: (0, kendo_react_common_1.classNames)('k-list-content', (_a = {},
|
|
677
688
|
_a['k-list-scroller'] = !virtual,
|
|
678
|
-
_a)), listStyle: vs.enabled ? { transform: translate } : undefined, key: "listkey", skip: skip, onClick: this.handleItemClick, itemRender: itemRender, noDataRender: listNoDataRender, onMouseDown: function (e) { return e.preventDefault(); }, onScroll: this.onScroll, wrapperRef: vs.scrollerRef, scroller: this.base.renderScrollElement() }));
|
|
689
|
+
_a)), listStyle: vs.enabled ? { transform: translate } : undefined, key: "listkey", skip: skip, onClick: this.handleItemClick, itemRender: itemRender, groupHeaderItemRender: groupHeaderItemRender, noDataRender: listNoDataRender, onMouseDown: function (e) { return e.preventDefault(); }, onScroll: this.onScroll, wrapperRef: vs.scrollerRef, scroller: this.base.renderScrollElement() }));
|
|
679
690
|
};
|
|
680
691
|
ComboBoxWithoutContext.prototype.renderSearchBar = function (text, id, placeholder) {
|
|
681
692
|
var _this = this;
|
|
@@ -731,9 +742,9 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
731
742
|
;
|
|
732
743
|
ComboBoxWithoutContext.displayName = 'ComboBox';
|
|
733
744
|
/** @hidden */
|
|
734
|
-
ComboBoxWithoutContext.propTypes = __assign(__assign({}, DropDownBase_1.default.propTypes), { size: PropTypes.oneOf([null, 'small', 'medium', 'large']), rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']), fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline']), dataItemKey: PropTypes.string, groupField: PropTypes.string, suggest: PropTypes.bool, placeholder: PropTypes.string, allowCustom: PropTypes.bool, clearButton: PropTypes.bool, iconClassName: PropTypes.string, svgIcon: kendo_react_common_1.svgIconPropType, validationMessage: PropTypes.string, required: PropTypes.bool, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string, list: PropTypes.any, valueRender: PropTypes.func });
|
|
745
|
+
ComboBoxWithoutContext.propTypes = __assign(__assign({}, DropDownBase_1.default.propTypes), { size: PropTypes.oneOf([null, 'small', 'medium', 'large']), rounded: PropTypes.oneOf([null, 'small', 'medium', 'large', 'full']), fillMode: PropTypes.oneOf([null, 'solid', 'flat', 'outline']), dataItemKey: PropTypes.string, groupField: PropTypes.string, groupMode: PropTypes.oneOf([undefined, 'classic', 'modern']), isMultiColumn: PropTypes.bool, suggest: PropTypes.bool, placeholder: PropTypes.string, allowCustom: PropTypes.bool, clearButton: PropTypes.bool, iconClassName: PropTypes.string, svgIcon: kendo_react_common_1.svgIconPropType, validationMessage: PropTypes.string, required: PropTypes.bool, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string, list: PropTypes.any, valueRender: PropTypes.func });
|
|
735
746
|
/** @hidden */
|
|
736
|
-
ComboBoxWithoutContext.defaultProps = __assign(__assign({}, DropDownBase_1.default.defaultProps), { size: 'medium', rounded: 'medium', fillMode: 'solid', allowCustom: false, clearButton: true, required: false });
|
|
747
|
+
ComboBoxWithoutContext.defaultProps = __assign(__assign({}, DropDownBase_1.default.defaultProps), { size: 'medium', rounded: 'medium', fillMode: 'solid', allowCustom: false, clearButton: true, required: false, groupMode: 'classic', isMultiColumn: false });
|
|
737
748
|
return ComboBoxWithoutContext;
|
|
738
749
|
}(React.Component));
|
|
739
750
|
exports.ComboBoxWithoutContext = ComboBoxWithoutContext;
|
|
@@ -4,6 +4,8 @@ import { FilterChangeEvent, ChangeEvent, OpenEvent, CloseEvent, FocusEvent, Blur
|
|
|
4
4
|
import { FormComponentProps, SVGIcon } from '@progress/kendo-react-common';
|
|
5
5
|
import { VirtualizationSettings, DropDownsPopupSettings } from '../common/settings';
|
|
6
6
|
import { ListItemProps } from '../common/ListItem';
|
|
7
|
+
import { ListGroupItemProps } from '../common/ListGroupItem';
|
|
8
|
+
import { GroupStickyHeaderProps } from '../common/GroupStickyHeader';
|
|
7
9
|
/**
|
|
8
10
|
* Represents the object of the `FilterChange` ComboBox event.
|
|
9
11
|
*/
|
|
@@ -131,6 +133,14 @@ export interface ComboBoxProps extends FormComponentProps {
|
|
|
131
133
|
* Sets the data item field that represents the start of a group. Applicable to objects data.
|
|
132
134
|
*/
|
|
133
135
|
groupField?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Defines the `classic` or `modern` type of the grouping's visualization. Defaults to `classic`.
|
|
138
|
+
*/
|
|
139
|
+
groupMode?: string;
|
|
140
|
+
/**
|
|
141
|
+
* @hidden Used to indicate if the ComboBox is with multiple columns
|
|
142
|
+
*/
|
|
143
|
+
isMultiColumn?: boolean;
|
|
134
144
|
/**
|
|
135
145
|
* Sets the key for comparing the data items of the ComboBox. If `dataItemKey` is not set, the ComboBox compares the items by reference ([see example]({% slug binding_combobox %}#toc-datasets-of-objects)).
|
|
136
146
|
*/
|
|
@@ -213,6 +223,14 @@ export interface ComboBoxProps extends FormComponentProps {
|
|
|
213
223
|
* Fires when a ComboBox list item is about to be rendered ([see example]({% slug customrendering_combobox %}#toc-items)). Used to override the default appearance of the list items.
|
|
214
224
|
*/
|
|
215
225
|
itemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListItemProps) => React.ReactNode;
|
|
226
|
+
/**
|
|
227
|
+
* Fires when a ComboBox group header item is about to be rendered. Used to override the default appearance of the group's headers when the component is configured in `modern` group mode.
|
|
228
|
+
*/
|
|
229
|
+
groupHeaderItemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListGroupItemProps) => React.ReactNode;
|
|
230
|
+
/**
|
|
231
|
+
* 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.
|
|
232
|
+
*/
|
|
233
|
+
groupStickyHeaderItemRender?: (div: React.ReactElement<HTMLDivElement>, stickyHeaderProps: GroupStickyHeaderProps) => React.ReactNode;
|
|
216
234
|
/**
|
|
217
235
|
* Fires when the element which indicates no data in the popup is about to be rendered. Used to override the default appearance of the element.
|
|
218
236
|
*/
|
|
@@ -80,6 +80,8 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
|
|
|
80
80
|
ariaLabel: PropTypes.Requireable<string>;
|
|
81
81
|
leftRightKeysNavigation: PropTypes.Requireable<boolean>;
|
|
82
82
|
title: PropTypes.Requireable<string>;
|
|
83
|
+
groupField: PropTypes.Requireable<string>;
|
|
84
|
+
list: PropTypes.Requireable<any>;
|
|
83
85
|
};
|
|
84
86
|
/**
|
|
85
87
|
* @hidden
|
|
@@ -89,6 +91,7 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
|
|
|
89
91
|
size: "small" | "medium" | "large" | null | undefined;
|
|
90
92
|
rounded: "small" | "medium" | "full" | "large" | null | undefined;
|
|
91
93
|
fillMode: "flat" | "outline" | "solid" | null | undefined;
|
|
94
|
+
groupMode: string | undefined;
|
|
92
95
|
popupSettings: {
|
|
93
96
|
height: string;
|
|
94
97
|
};
|
|
@@ -111,6 +114,7 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
|
|
|
111
114
|
private _valueDuringOnChange;
|
|
112
115
|
private _navigated;
|
|
113
116
|
private _inputId;
|
|
117
|
+
private itemHeight;
|
|
114
118
|
private observerResize?;
|
|
115
119
|
private get document();
|
|
116
120
|
constructor(props: DropDownListProps);
|
|
@@ -170,6 +174,7 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
|
|
|
170
174
|
private renderAdaptiveListContainer;
|
|
171
175
|
private renderListContainer;
|
|
172
176
|
private renderList;
|
|
177
|
+
private onScroll;
|
|
173
178
|
private renderListFilter;
|
|
174
179
|
private renderDefaultItem;
|
|
175
180
|
private search;
|
|
@@ -34,6 +34,7 @@ var kendo_react_labels_1 = require("@progress/kendo-react-labels");
|
|
|
34
34
|
var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
|
|
35
35
|
var ListContainer_1 = require("../common/ListContainer");
|
|
36
36
|
var ListFilter_1 = require("../common/ListFilter");
|
|
37
|
+
var GroupStickyHeader_1 = require("../common/GroupStickyHeader");
|
|
37
38
|
var ListDefaultItem_1 = require("../common/ListDefaultItem");
|
|
38
39
|
var List_1 = require("../common/List");
|
|
39
40
|
var DropDownBase_1 = require("../common/DropDownBase");
|
|
@@ -66,6 +67,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
66
67
|
_this._filterInput = null;
|
|
67
68
|
_this._navigated = false;
|
|
68
69
|
_this._inputId = (0, kendo_react_common_1.guid)();
|
|
70
|
+
_this.itemHeight = 0;
|
|
69
71
|
/**
|
|
70
72
|
* @hidden
|
|
71
73
|
*/
|
|
@@ -99,7 +101,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
99
101
|
};
|
|
100
102
|
_this.renderListContainer = function () {
|
|
101
103
|
var _a;
|
|
102
|
-
var _b = _this.props, header = _b.header, footer = _b.footer, dir = _b.dir, _c = _b.data, data = _c === void 0 ? [] : _c, size = _b.size;
|
|
104
|
+
var _b = _this.props, header = _b.header, footer = _b.footer, dir = _b.dir, _c = _b.data, data = _c === void 0 ? [] : _c, size = _b.size, groupField = _b.groupField, groupStickyHeaderItemRender = _b.groupStickyHeaderItemRender, list = _b.list;
|
|
103
105
|
var base = _this.base;
|
|
104
106
|
var popupSettings = base.getPopupSettings();
|
|
105
107
|
var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;
|
|
@@ -119,24 +121,57 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
119
121
|
},
|
|
120
122
|
itemsCount: [data.length]
|
|
121
123
|
};
|
|
124
|
+
var group = _this.state.group;
|
|
125
|
+
if (group === undefined && groupField !== undefined) {
|
|
126
|
+
group = (0, utils_1.getItemValue)(data[0], groupField);
|
|
127
|
+
}
|
|
122
128
|
return (React.createElement(ListContainer_1.default, __assign({}, listContainerProps),
|
|
123
129
|
_this.renderListFilter(),
|
|
124
130
|
header && React.createElement("div", { className: "k-list-header" }, header),
|
|
125
131
|
React.createElement("div", { className: (0, kendo_react_common_1.classNames)('k-list', (_a = {}, _a["k-list-".concat(sizeMap[size] || size)] = size, _a['k-virtual-list'] = _this.base.vs.enabled, _a)) },
|
|
126
132
|
_this.renderDefaultItem(),
|
|
133
|
+
!list && group && React.createElement(GroupStickyHeader_1.default, { group: group, groupMode: 'modern', render: groupStickyHeaderItemRender }),
|
|
127
134
|
_this.renderList()),
|
|
128
135
|
footer && React.createElement("div", { className: "k-list-footer" }, footer)));
|
|
129
136
|
};
|
|
130
137
|
_this.renderList = function () {
|
|
131
|
-
var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, dataItemKey = _a.dataItemKey, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c, listNoDataRender = _a.listNoDataRender, itemRender = _a.itemRender;
|
|
138
|
+
var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, textField = _a.textField, dataItemKey = _a.dataItemKey, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c, groupHeaderItemRender = _a.groupHeaderItemRender, listNoDataRender = _a.listNoDataRender, itemRender = _a.itemRender;
|
|
132
139
|
var vs = _this.base.vs;
|
|
133
140
|
var skip = virtual.skip;
|
|
134
141
|
var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;
|
|
135
142
|
var popupSettings = _this.base.getPopupSettings();
|
|
136
143
|
var translate = "translateY(".concat(vs.translate, "px)");
|
|
137
|
-
return (React.createElement(List_1.default, { id: _this.base.listBoxId, show: opened, data: data.slice(), focusedIndex: _this.focusedIndex(), value: _this.value, textField: textField, valueField: dataItemKey, optionsGuid: _this.base.guid, listRef: function (list) { return vs.list = _this.base.list = list; }, wrapperStyle: { maxHeight: popupSettings.height }, wrapperCssClass: "k-list-content", listStyle: vs.enabled ? { transform: translate } : undefined, key: "listkey", skip: skip, onClick: _this.handleItemClick, itemRender: itemRender, noDataRender: listNoDataRender, onScroll:
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
return (React.createElement(List_1.default, { id: _this.base.listBoxId, show: opened, data: data.slice(), focusedIndex: _this.focusedIndex(), value: _this.value, textField: textField, valueField: dataItemKey, optionsGuid: _this.base.guid, groupField: _this.props.groupField, groupMode: 'modern', listRef: function (list) { return vs.list = _this.base.list = list; }, wrapperStyle: { maxHeight: popupSettings.height }, wrapperCssClass: "k-list-content", listStyle: vs.enabled ? { transform: translate } : undefined, key: "listkey", skip: skip, onClick: _this.handleItemClick, itemRender: itemRender, groupHeaderItemRender: groupHeaderItemRender, noDataRender: listNoDataRender, onScroll: _this.onScroll, wrapperRef: vs.scrollerRef, scroller: _this.base.renderScrollElement() }));
|
|
145
|
+
};
|
|
146
|
+
_this.onScroll = function (event) {
|
|
147
|
+
var _a = _this.base, vs = _a.vs, list = _a.list;
|
|
148
|
+
vs.scrollHandler(event);
|
|
149
|
+
var groupField = _this.props.groupField;
|
|
150
|
+
var _b = _this.props.data, data = _b === void 0 ? [] : _b;
|
|
151
|
+
if (!groupField || !data.length) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (groupField) {
|
|
155
|
+
var itemHeight = _this.itemHeight =
|
|
156
|
+
_this.itemHeight || (vs.enabled ? vs.itemHeight : (list ? list.children[0].offsetHeight : 0));
|
|
157
|
+
var target = event.target;
|
|
158
|
+
var scrollTop = target.scrollTop - (vs.skip * itemHeight);
|
|
159
|
+
data = _this.base.getGroupedDataModernMode(data, groupField);
|
|
160
|
+
var group = data[0][groupField];
|
|
161
|
+
for (var i = 1; i < data.length; i++) {
|
|
162
|
+
if (itemHeight * i > scrollTop) {
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
if (data[i] && data[i][groupField]) {
|
|
166
|
+
group = data[i][groupField];
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (group !== _this.state.group) {
|
|
170
|
+
_this.setState({
|
|
171
|
+
group: group
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
140
175
|
};
|
|
141
176
|
_this.renderListFilter = function () {
|
|
142
177
|
var filterText = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;
|
|
@@ -457,7 +492,9 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
457
492
|
* @hidden
|
|
458
493
|
*/
|
|
459
494
|
DropDownListWithoutContext.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
460
|
-
var _a
|
|
495
|
+
var _a;
|
|
496
|
+
var _b = this.props, dataItemKey = _b.dataItemKey, virtual = _b.virtual, _c = _b.groupField, groupField = _c === void 0 ? '' : _c;
|
|
497
|
+
var _d = this.props.data, data = _d === void 0 ? [] : _d;
|
|
461
498
|
var prevTotal = prevProps.virtual ? prevProps.virtual.total : 0;
|
|
462
499
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
463
500
|
var prevOpened = prevProps.opened !== undefined ? prevProps.opened : prevState.opened;
|
|
@@ -479,6 +516,9 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
479
516
|
var selectedItem_1 = this.value;
|
|
480
517
|
var prevSelectedItem = prevProps.value !== undefined ? prevProps.value : prevState.value;
|
|
481
518
|
var selectedItemIndex = data.findIndex(function (i) { return (0, utils_1.areSame)(i, selectedItem_1, dataItemKey); });
|
|
519
|
+
if (groupField !== '') {
|
|
520
|
+
selectedItemIndex = (_a = this.base.getGroupedDataModernMode(data, groupField)) === null || _a === void 0 ? void 0 : _a.indexOf(selectedItem_1);
|
|
521
|
+
}
|
|
482
522
|
var selectedItemChanged = !(0, utils_1.areSame)(prevSelectedItem, selectedItem_1, dataItemKey);
|
|
483
523
|
if (opening && virtual) {
|
|
484
524
|
this.base.scrollToVirtualItem(virtual, selectedItemIndex);
|
|
@@ -599,7 +639,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
599
639
|
var _a;
|
|
600
640
|
var _this = this;
|
|
601
641
|
var _b = this.state.windowWidth, windowWidth = _b === void 0 ? 0 : _b;
|
|
602
|
-
var _c = this.props, header = _c.header, footer = _c.footer, size = _c.size, adaptiveTitle = _c.adaptiveTitle;
|
|
642
|
+
var _c = this.props, header = _c.header, footer = _c.footer, size = _c.size, adaptiveTitle = _c.adaptiveTitle, groupField = _c.groupField, groupStickyHeaderItemRender = _c.groupStickyHeaderItemRender, list = _c.list, _d = _c.data, data = _d === void 0 ? [] : _d;
|
|
603
643
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
604
644
|
var actionSheetProps = {
|
|
605
645
|
navigatable: false,
|
|
@@ -612,6 +652,10 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
612
652
|
? 'k-adaptive-actionsheet k-actionsheet-fullscreen'
|
|
613
653
|
: 'k-adaptive-actionsheet k-actionsheet-bottom'
|
|
614
654
|
};
|
|
655
|
+
var group = this.state.group;
|
|
656
|
+
if (group === undefined && groupField !== undefined) {
|
|
657
|
+
group = (0, utils_1.getItemValue)(data[0], groupField);
|
|
658
|
+
}
|
|
615
659
|
return (React.createElement(React.Fragment, null,
|
|
616
660
|
React.createElement(kendo_react_layout_1.ActionSheet, __assign({}, actionSheetProps),
|
|
617
661
|
React.createElement(kendo_react_layout_1.ActionSheetHeader, { className: 'k-text-center' },
|
|
@@ -625,6 +669,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
625
669
|
header && React.createElement("div", { className: "k-list-header" }, header),
|
|
626
670
|
React.createElement("div", { className: (0, kendo_react_common_1.classNames)('k-list', (_a = {}, _a["k-list-".concat(sizeMap[size] || size)] = size, _a['k-virtual-list'] = this.base.vs.enabled, _a)) },
|
|
627
671
|
this.renderDefaultItem(),
|
|
672
|
+
!list && group && React.createElement(GroupStickyHeader_1.default, { group: group, groupMode: 'modern', render: groupStickyHeaderItemRender }),
|
|
628
673
|
this.renderList()),
|
|
629
674
|
footer && React.createElement("div", { className: "k-list-footer" }, footer)))));
|
|
630
675
|
};
|
|
@@ -674,11 +719,11 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
674
719
|
/**
|
|
675
720
|
* @hidden
|
|
676
721
|
*/
|
|
677
|
-
DropDownListWithoutContext.propTypes = __assign({ delay: PropTypes.number, ignoreCase: PropTypes.bool, iconClassName: PropTypes.string, svgIcon: kendo_react_common_1.svgIconPropType, defaultItem: PropTypes.any, valueRender: PropTypes.func, valueMap: PropTypes.func, validationMessage: PropTypes.string, required: PropTypes.bool, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string, ariaLabel: PropTypes.string, leftRightKeysNavigation: PropTypes.bool, title: PropTypes.string }, DropDownBase_1.default.propTypes);
|
|
722
|
+
DropDownListWithoutContext.propTypes = __assign({ delay: PropTypes.number, ignoreCase: PropTypes.bool, iconClassName: PropTypes.string, svgIcon: kendo_react_common_1.svgIconPropType, defaultItem: PropTypes.any, valueRender: PropTypes.func, valueMap: PropTypes.func, validationMessage: PropTypes.string, required: PropTypes.bool, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string, ariaLabel: PropTypes.string, leftRightKeysNavigation: PropTypes.bool, title: PropTypes.string, groupField: PropTypes.string, list: PropTypes.any }, DropDownBase_1.default.propTypes);
|
|
678
723
|
/**
|
|
679
724
|
* @hidden
|
|
680
725
|
*/
|
|
681
|
-
DropDownListWithoutContext.defaultProps = __assign(__assign({ delay: 500, tabIndex: 0, ignoreCase: true }, DropDownBase_1.default.defaultProps), { required: false, size: 'medium', rounded: 'medium', fillMode: 'solid' });
|
|
726
|
+
DropDownListWithoutContext.defaultProps = __assign(__assign({ delay: 500, tabIndex: 0, ignoreCase: true }, DropDownBase_1.default.defaultProps), { required: false, size: 'medium', rounded: 'medium', fillMode: 'solid', groupMode: 'modern' });
|
|
682
727
|
return DropDownListWithoutContext;
|
|
683
728
|
}(React.Component));
|
|
684
729
|
exports.DropDownListWithoutContext = DropDownListWithoutContext;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { DropDownList } from './DropDownList';
|
|
3
3
|
import { FilterChangeEvent, ChangeEvent, OpenEvent, CloseEvent, FocusEvent, BlurEvent, PageChangeEvent } from './../common/events';
|
|
4
4
|
import { VirtualizationSettings, DropDownsPopupSettings } from '../common/settings';
|
|
5
|
+
import { ListGroupItemProps } from '../common/ListGroupItem';
|
|
6
|
+
import { GroupStickyHeaderProps } from '../common/GroupStickyHeader';
|
|
5
7
|
import { ListItemProps } from '../common/ListItem';
|
|
6
8
|
import { FormComponentProps, SVGIcon } from '@progress/kendo-react-common';
|
|
7
9
|
/**
|
|
@@ -297,4 +299,24 @@ export interface DropDownListProps extends FormComponentProps {
|
|
|
297
299
|
* Specifies the text that is rendered as title in the adaptive popup.
|
|
298
300
|
*/
|
|
299
301
|
adaptiveTitle?: string;
|
|
302
|
+
/**
|
|
303
|
+
* Sets the data item field that represents the start of a group. Applicable to objects data.
|
|
304
|
+
*/
|
|
305
|
+
groupField?: string;
|
|
306
|
+
/**
|
|
307
|
+
* Fires when a DropDownList's group header item is about to be rendered. Used to override the default appearance of the group's headers.
|
|
308
|
+
*/
|
|
309
|
+
groupHeaderItemRender?: (li: React.ReactElement<HTMLLIElement>, itemProps: ListGroupItemProps) => React.ReactNode;
|
|
310
|
+
/**
|
|
311
|
+
* 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.
|
|
312
|
+
*/
|
|
313
|
+
groupStickyHeaderItemRender?: (div: React.ReactElement<HTMLDivElement>, stickyHeaderProps: GroupStickyHeaderProps) => React.ReactNode;
|
|
314
|
+
/**
|
|
315
|
+
* @hidden
|
|
316
|
+
*/
|
|
317
|
+
list?: any;
|
|
318
|
+
/**
|
|
319
|
+
* @hidden
|
|
320
|
+
*/
|
|
321
|
+
groupMode?: string;
|
|
300
322
|
}
|
|
@@ -76,6 +76,9 @@ exports.MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
|
76
76
|
}, [props.data, props.groupField]);
|
|
77
77
|
var _c = React.useState(initialGroupHeader), groupHeader = _c[0], setGroupHeader = _c[1];
|
|
78
78
|
var header = React.useMemo(function () {
|
|
79
|
+
var renderer = (React.createElement("th", { className: 'k-table-th', colSpan: columns.length },
|
|
80
|
+
groupHeader,
|
|
81
|
+
" "));
|
|
79
82
|
return (React.createElement(React.Fragment, null,
|
|
80
83
|
props.header,
|
|
81
84
|
React.createElement("div", { className: "k-table-header-wrap" },
|
|
@@ -87,8 +90,7 @@ exports.MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
|
87
90
|
React.createElement("tr", { className: 'k-table-row' }, columns.map(function (column, i) {
|
|
88
91
|
return (React.createElement("th", { className: "k-table-th", key: column.uniqueKey ? column.uniqueKey : i }, column.header || '\u00A0'));
|
|
89
92
|
})),
|
|
90
|
-
groupHeader && React.createElement("tr", { className: 'k-table-group-row' },
|
|
91
|
-
React.createElement("th", { className: 'k-table-th', colSpan: columns.length }, groupHeader)))))));
|
|
93
|
+
groupHeader && React.createElement("tr", { className: 'k-table-group-row' }, props.groupStickyHeaderItemRender ? props.groupStickyHeaderItemRender.call(undefined, renderer, {}) : renderer))))));
|
|
92
94
|
}, [props.header, columns, groupHeader]);
|
|
93
95
|
var popupWidth = React.useMemo(function () {
|
|
94
96
|
// These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
|
|
@@ -96,7 +98,7 @@ exports.MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
|
96
98
|
}, [columns, scrollbarWidth]);
|
|
97
99
|
var skip = props.virtual ? props.virtual.skip : 0;
|
|
98
100
|
var itemRender = React.useCallback(function (li, liProps) {
|
|
99
|
-
var children = columns.map(function (column, i) { return (React.createElement("span", { className:
|
|
101
|
+
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 ? (0, kendo_react_common_1.getter)(column.field)(liProps.dataItem) : '')); });
|
|
100
102
|
var group = undefined;
|
|
101
103
|
var curGroup, prevGroup, groupGetter, data = props.data || [];
|
|
102
104
|
var index = liProps.index - skip;
|
|
@@ -108,7 +110,7 @@ exports.MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
|
108
110
|
group = curGroup;
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
|
-
if (group) {
|
|
113
|
+
if (group && props.groupMode === 'classic') {
|
|
112
114
|
children.push(React.createElement("div", { key: "group", className: "k-table-td k-table-group-td" },
|
|
113
115
|
React.createElement("span", null, group)));
|
|
114
116
|
}
|
|
@@ -137,7 +139,7 @@ exports.MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
|
137
139
|
}, []);
|
|
138
140
|
React.useEffect(function () { (0, kendo_react_common_1.setScrollbarWidth)(); });
|
|
139
141
|
var List = React.useCallback(function (listProps) { return React.createElement(MultiColumnList_1.MultiColumnList, __assign({}, listProps)); }, []);
|
|
140
|
-
return (React.createElement(ComboBox_1.ComboBox, __assign({}, other, { list: List, popupSettings: __assign(__assign({ width: popupWidth }, popupSettings), { popupClass: 'k-dropdowngrid-popup k-reset', className: popupSettings.className }), ref: comboBoxRef, header: header, itemRender: itemRender, size: props.size, rounded: props.rounded, fillMode: props.fillMode, 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 })));
|
|
142
|
+
return (React.createElement(ComboBox_1.ComboBox, __assign({}, other, { list: List, popupSettings: __assign(__assign({ width: popupWidth }, popupSettings), { popupClass: 'k-dropdowngrid-popup k-reset', 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 })));
|
|
141
143
|
});
|
|
142
144
|
var propTypes = __assign(__assign({}, ComboBox_1.ComboBoxWithoutContext.propTypes), { columns: PropTypes.any.isRequired });
|
|
143
145
|
var defaultProps = {
|
|
@@ -5,28 +5,24 @@ import { TagData } from './TagList';
|
|
|
5
5
|
import DropDownBase from '../common/DropDownBase';
|
|
6
6
|
import { MultiSelectProps } from './MultiSelectProps';
|
|
7
7
|
import { DropDownStateBase, InternalState, ActiveDescendant } from './../common/settings';
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
8
|
+
/** @hidden */
|
|
11
9
|
export interface MultiSelectState extends DropDownStateBase {
|
|
12
10
|
selectedItems?: Array<any>;
|
|
13
11
|
focusedIndex?: number;
|
|
14
12
|
focusedTag?: TagData;
|
|
15
13
|
activedescendant?: ActiveDescendant;
|
|
16
14
|
value?: Array<any>;
|
|
15
|
+
currentTreeValue?: Array<any>;
|
|
16
|
+
windowWidth?: number;
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
19
|
-
* @hidden
|
|
20
|
-
*/
|
|
18
|
+
/** @hidden */
|
|
21
19
|
export interface MultiSelectInternalState extends InternalState {
|
|
22
20
|
data: MultiSelectState;
|
|
23
21
|
}
|
|
24
22
|
/** @hidden */
|
|
25
23
|
export declare class MultiSelectWithoutContext extends React.Component<MultiSelectProps, MultiSelectState> implements FormComponent {
|
|
26
24
|
static displayName: string;
|
|
27
|
-
/**
|
|
28
|
-
* @hidden
|
|
29
|
-
*/
|
|
25
|
+
/** @hidden */
|
|
30
26
|
static propTypes: {
|
|
31
27
|
autoClose: PropTypes.Requireable<boolean>;
|
|
32
28
|
value: PropTypes.Requireable<any[]>;
|
|
@@ -41,6 +37,11 @@ export declare class MultiSelectWithoutContext extends React.Component<MultiSele
|
|
|
41
37
|
id: PropTypes.Requireable<string>;
|
|
42
38
|
ariaLabelledBy: PropTypes.Requireable<string>;
|
|
43
39
|
ariaDescribedBy: PropTypes.Requireable<string>;
|
|
40
|
+
groupField: PropTypes.Requireable<string>;
|
|
41
|
+
list: PropTypes.Requireable<any>;
|
|
42
|
+
adaptive: PropTypes.Requireable<boolean>;
|
|
43
|
+
adaptiveTitle: PropTypes.Requireable<string>;
|
|
44
|
+
onCancel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
45
|
filterable: PropTypes.Requireable<boolean>;
|
|
45
46
|
filter: PropTypes.Requireable<string>;
|
|
46
47
|
virtual: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -82,23 +83,20 @@ export declare class MultiSelectWithoutContext extends React.Component<MultiSele
|
|
|
82
83
|
header: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
83
84
|
footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
84
85
|
};
|
|
85
|
-
/**
|
|
86
|
-
* @hidden
|
|
87
|
-
*/
|
|
86
|
+
/** @hidden */
|
|
88
87
|
static defaultProps: {
|
|
89
88
|
autoClose: boolean;
|
|
90
89
|
required: boolean;
|
|
91
90
|
size: "small" | "medium" | "large" | null | undefined;
|
|
92
91
|
rounded: "small" | "medium" | "full" | "large" | null | undefined;
|
|
93
92
|
fillMode: "flat" | "outline" | "solid" | null | undefined;
|
|
93
|
+
groupMode: string | undefined;
|
|
94
94
|
popupSettings: {
|
|
95
95
|
height: string;
|
|
96
96
|
};
|
|
97
97
|
validityStyles: boolean;
|
|
98
98
|
};
|
|
99
|
-
/**
|
|
100
|
-
* @hidden
|
|
101
|
-
*/
|
|
99
|
+
/** @hidden */
|
|
102
100
|
readonly state: MultiSelectState;
|
|
103
101
|
private _element;
|
|
104
102
|
private _valueItemsDuringOnChange;
|
|
@@ -106,17 +104,26 @@ export declare class MultiSelectWithoutContext extends React.Component<MultiSele
|
|
|
106
104
|
protected readonly base: DropDownBase;
|
|
107
105
|
private readonly _tags;
|
|
108
106
|
private _input;
|
|
107
|
+
private _adaptiveInput;
|
|
109
108
|
private _skipFocusEvent;
|
|
109
|
+
private itemHeight;
|
|
110
110
|
protected scrollToFocused: boolean;
|
|
111
|
+
private localization;
|
|
112
|
+
private observerResize?;
|
|
113
|
+
private get document();
|
|
111
114
|
constructor(props: MultiSelectProps);
|
|
112
|
-
/**
|
|
113
|
-
* @hidden
|
|
114
|
-
*/
|
|
115
|
+
/** @hidden */
|
|
115
116
|
focus: () => void;
|
|
117
|
+
/** @hidden */
|
|
118
|
+
get element(): HTMLSpanElement | null;
|
|
119
|
+
/** @hidden */
|
|
120
|
+
get opened(): boolean;
|
|
121
|
+
/** @hidden */
|
|
122
|
+
get tagsToRender(): Array<TagData>;
|
|
116
123
|
/**
|
|
117
|
-
*
|
|
124
|
+
* The mobile mode of the ComboBox.
|
|
118
125
|
*/
|
|
119
|
-
get
|
|
126
|
+
get mobileMode(): boolean;
|
|
120
127
|
/**
|
|
121
128
|
* Represents the value of the MultiSelect.
|
|
122
129
|
*/
|
|
@@ -129,41 +136,27 @@ export declare class MultiSelectWithoutContext extends React.Component<MultiSele
|
|
|
129
136
|
* Represents the validity state into which the MultiSelect is set.
|
|
130
137
|
*/
|
|
131
138
|
get validity(): FormComponentValidity;
|
|
132
|
-
/**
|
|
133
|
-
* @hidden
|
|
134
|
-
*/
|
|
139
|
+
/** @hidden */
|
|
135
140
|
protected get required(): boolean;
|
|
136
141
|
protected get validityStyles(): boolean;
|
|
137
|
-
/**
|
|
138
|
-
* @hidden
|
|
139
|
-
*/
|
|
142
|
+
/** @hidden */
|
|
140
143
|
componentDidUpdate(prevProps: MultiSelectProps, prevState: MultiSelectState): void;
|
|
141
|
-
/**
|
|
142
|
-
* @hidden
|
|
143
|
-
*/
|
|
144
|
+
/** @hidden */
|
|
144
145
|
componentDidMount(): void;
|
|
145
|
-
/**
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
/** @hidden */
|
|
147
|
+
componentWillUnmount(): void;
|
|
148
|
+
/** @hidden */
|
|
148
149
|
handleItemSelect: (index: number, state: MultiSelectInternalState) => void;
|
|
149
|
-
/**
|
|
150
|
-
* @hidden
|
|
151
|
-
*/
|
|
150
|
+
/** @hidden */
|
|
152
151
|
onTagDelete: (itemsToRemove: Array<any>, event: React.MouseEvent<HTMLSpanElement>) => void;
|
|
153
|
-
/**
|
|
154
|
-
* @hidden
|
|
155
|
-
*/
|
|
152
|
+
/** @hidden */
|
|
156
153
|
onNavigate(state: MultiSelectInternalState, keyCode: number): void;
|
|
157
|
-
/**
|
|
158
|
-
* @hidden
|
|
159
|
-
*/
|
|
154
|
+
/** @hidden */
|
|
160
155
|
itemFocus: (index: number, state: MultiSelectInternalState) => void;
|
|
161
|
-
/**
|
|
162
|
-
* @hidden
|
|
163
|
-
*/
|
|
156
|
+
/** @hidden */
|
|
164
157
|
render(): JSX.Element;
|
|
165
158
|
private componentRef;
|
|
166
|
-
private
|
|
159
|
+
private renderSearchBar;
|
|
167
160
|
private searchbarRef;
|
|
168
161
|
private onChangeHandler;
|
|
169
162
|
private clearButtonClick;
|
|
@@ -173,8 +166,13 @@ export declare class MultiSelectWithoutContext extends React.Component<MultiSele
|
|
|
173
166
|
private selectFocusedItem;
|
|
174
167
|
private setItems;
|
|
175
168
|
private getFocusedState;
|
|
169
|
+
private listContainerContent;
|
|
176
170
|
private renderListContainer;
|
|
171
|
+
private renderAdaptiveListContainer;
|
|
172
|
+
private closePopup;
|
|
173
|
+
private onCancel;
|
|
177
174
|
private renderList;
|
|
175
|
+
private onScroll;
|
|
178
176
|
private customItemSelect;
|
|
179
177
|
private handleWrapperClick;
|
|
180
178
|
private handleItemClick;
|
|
@@ -185,6 +183,7 @@ export declare class MultiSelectWithoutContext extends React.Component<MultiSele
|
|
|
185
183
|
private focusElement;
|
|
186
184
|
private applyState;
|
|
187
185
|
private setValidity;
|
|
186
|
+
private calculateMedia;
|
|
188
187
|
}
|
|
189
188
|
/**
|
|
190
189
|
* Represents the PropsContext of the `MultiSelect` component.
|