@progress/kendo-react-dropdowns 5.4.0-dev.202205271059 → 5.4.0-dev.202206090823
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 +6 -6
- package/dist/es/AutoComplete/AutoComplete.js +6 -4
- package/dist/es/ComboBox/ComboBox.d.ts +6 -6
- package/dist/es/ComboBox/ComboBox.js +12 -10
- package/dist/es/DropDownList/DropDownList.d.ts +3 -6
- package/dist/es/DropDownList/DropDownList.js +10 -8
- package/dist/es/DropDownTree/DropDownTree.d.ts +1 -1
- package/dist/es/DropDownTree/DropDownTree.js +17 -13
- package/dist/es/MultiColumnComboBox/MultiColumnComboBox.d.ts +2 -2
- package/dist/es/MultiColumnComboBox/MultiColumnComboBox.js +1 -1
- package/dist/es/MultiSelect/MultiSelect.d.ts +5 -5
- package/dist/es/MultiSelect/MultiSelect.js +23 -17
- package/dist/es/MultiSelect/TagList.d.ts +1 -0
- package/dist/es/MultiSelect/TagList.js +1 -1
- package/dist/es/MultiSelectTree/MultiSelectTree.d.ts +1 -1
- package/dist/es/MultiSelectTree/MultiSelectTree.js +16 -12
- package/dist/es/MultiSelectTree/utils.d.ts +3 -3
- package/dist/es/MultiSelectTree/utils.js +11 -7
- package/dist/es/common/DropDownBase.d.ts +1 -1
- package/dist/es/common/DropDownBase.js +2 -0
- package/dist/es/common/List.d.ts +2 -2
- package/dist/es/common/List.js +1 -1
- package/dist/es/common/ListContainer.d.ts +1 -0
- package/dist/es/common/ListFilter.js +6 -4
- package/dist/es/common/ListItem.d.ts +1 -1
- package/dist/es/common/MultiColumnList.d.ts +2 -1
- package/dist/es/common/Navigation.d.ts +1 -1
- package/dist/es/common/SearchBar.d.ts +1 -1
- package/dist/es/common/SearchBar.js +3 -1
- package/dist/es/common/VirtualScroll.d.ts +1 -1
- package/dist/es/common/VirtualScroll.js +5 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/AutoComplete/AutoComplete.d.ts +6 -6
- package/dist/npm/AutoComplete/AutoComplete.js +21 -19
- package/dist/npm/ComboBox/ComboBox.d.ts +6 -6
- package/dist/npm/ComboBox/ComboBox.js +46 -44
- package/dist/npm/DropDownList/DropDownList.d.ts +3 -6
- package/dist/npm/DropDownList/DropDownList.js +37 -35
- package/dist/npm/DropDownTree/DropDownTree.d.ts +1 -1
- package/dist/npm/DropDownTree/DropDownTree.js +33 -29
- package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.d.ts +2 -2
- package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.js +10 -10
- package/dist/npm/MultiSelect/MultiSelect.d.ts +5 -5
- package/dist/npm/MultiSelect/MultiSelect.js +43 -37
- package/dist/npm/MultiSelect/TagList.d.ts +1 -0
- package/dist/npm/MultiSelect/TagList.js +1 -1
- package/dist/npm/MultiSelectTree/MultiSelectTree.d.ts +1 -1
- package/dist/npm/MultiSelectTree/MultiSelectTree.js +30 -26
- package/dist/npm/MultiSelectTree/utils.d.ts +3 -3
- package/dist/npm/MultiSelectTree/utils.js +18 -14
- package/dist/npm/common/ClearButton.js +2 -2
- package/dist/npm/common/DropDownBase.d.ts +1 -1
- package/dist/npm/common/DropDownBase.js +7 -5
- package/dist/npm/common/List.d.ts +2 -2
- package/dist/npm/common/List.js +7 -7
- package/dist/npm/common/ListContainer.d.ts +1 -0
- package/dist/npm/common/ListDefaultItem.js +2 -2
- package/dist/npm/common/ListFilter.js +7 -5
- package/dist/npm/common/ListItem.d.ts +1 -1
- package/dist/npm/common/ListItem.js +2 -2
- package/dist/npm/common/MultiColumnList.d.ts +2 -1
- package/dist/npm/common/Navigation.d.ts +1 -1
- package/dist/npm/common/Navigation.js +1 -1
- package/dist/npm/common/SearchBar.d.ts +1 -1
- package/dist/npm/common/SearchBar.js +3 -1
- package/dist/npm/common/VirtualScroll.d.ts +1 -1
- package/dist/npm/common/VirtualScroll.js +5 -1
- package/dist/npm/main.js +5 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-react-dropdowns.js +1 -1
- package/package.json +13 -13
|
@@ -51,8 +51,10 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
51
51
|
*/
|
|
52
52
|
_this.state = {};
|
|
53
53
|
_this.base = new DropDownBase_1.default(_this);
|
|
54
|
-
_this.
|
|
54
|
+
_this._element = null;
|
|
55
|
+
_this._inputId = (0, kendo_react_common_1.guid)();
|
|
55
56
|
_this._suggested = '';
|
|
57
|
+
_this._input = null;
|
|
56
58
|
_this.itemHeight = 0;
|
|
57
59
|
/**
|
|
58
60
|
* @hidden
|
|
@@ -69,7 +71,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
69
71
|
var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, virtual = _a.virtual, dataItemKey = _a.dataItemKey;
|
|
70
72
|
var skip = virtual ? virtual.skip : 0;
|
|
71
73
|
var item = data[index - skip];
|
|
72
|
-
var newSelected = !utils_1.areSame(item, _this.value, dataItemKey);
|
|
74
|
+
var newSelected = !(0, utils_1.areSame)(item, _this.value, dataItemKey);
|
|
73
75
|
_this.triggerOnChange(item, state);
|
|
74
76
|
if (_this.state.text !== undefined) {
|
|
75
77
|
state.data.text = undefined;
|
|
@@ -171,8 +173,8 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
171
173
|
if (_this.props.suggest) {
|
|
172
174
|
var selectionAtEnd = input.selectionEnd === value.length;
|
|
173
175
|
var prevText = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;
|
|
174
|
-
if (!utils_1.isPresent(prevText)) {
|
|
175
|
-
prevText = utils_1.getItemValue(_this.value, _this.props.textField) || '';
|
|
176
|
+
if (!(0, utils_1.isPresent)(prevText)) {
|
|
177
|
+
prevText = (0, utils_1.getItemValue)(_this.value, _this.props.textField) || '';
|
|
176
178
|
}
|
|
177
179
|
var deletedSuggestion = prevText && prevText === value;
|
|
178
180
|
var deleting = prevText && prevText.length > value.length;
|
|
@@ -218,7 +220,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
218
220
|
: _this.props.validationMessage || VALIDATION_MESSAGE);
|
|
219
221
|
}
|
|
220
222
|
};
|
|
221
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
223
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
222
224
|
return _this;
|
|
223
225
|
}
|
|
224
226
|
Object.defineProperty(ComboBoxWithoutContext.prototype, "element", {
|
|
@@ -261,7 +263,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
261
263
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey;
|
|
262
264
|
var value = this.value;
|
|
263
265
|
// TO DO: deprecate it!
|
|
264
|
-
return data.findIndex(function (i) { return utils_1.areSame(i, value, dataItemKey); });
|
|
266
|
+
return data.findIndex(function (i) { return (0, utils_1.areSame)(i, value, dataItemKey); });
|
|
265
267
|
},
|
|
266
268
|
enumerable: false,
|
|
267
269
|
configurable: true
|
|
@@ -334,8 +336,8 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
334
336
|
}
|
|
335
337
|
else {
|
|
336
338
|
var prevSelectedItem = prevProps.value !== undefined ? prevProps.value : prevState.value;
|
|
337
|
-
var selectedItemIndex = data.findIndex(function (i) { return utils_1.areSame(i, selectedItem, dataItemKey); });
|
|
338
|
-
var selectedItemChanged = !utils_1.areSame(prevSelectedItem, selectedItem, dataItemKey);
|
|
339
|
+
var selectedItemIndex = data.findIndex(function (i) { return (0, utils_1.areSame)(i, selectedItem, dataItemKey); });
|
|
340
|
+
var selectedItemChanged = !(0, utils_1.areSame)(prevSelectedItem, selectedItem, dataItemKey);
|
|
339
341
|
if (opening && virtual) {
|
|
340
342
|
this.base.scrollToVirtualItem(virtual, selectedItemIndex);
|
|
341
343
|
}
|
|
@@ -366,9 +368,9 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
366
368
|
var _c = this.props, dir = _c.dir, disabled = _c.disabled, _d = _c.clearButton, clearButton = _d === void 0 ? ComboBoxWithoutContext.defaultProps.clearButton : _d, label = _c.label, textField = _c.textField, className = _c.className, style = _c.style, loading = _c.loading, iconClassName = _c.iconClassName, virtual = _c.virtual, size = _c.size, rounded = _c.rounded, fillMode = _c.fillMode;
|
|
367
369
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
368
370
|
var text = this.props.filter !== undefined ? this.props.filter : this.state.text;
|
|
369
|
-
var selectedItemText = utils_1.getItemValue(this.value, textField);
|
|
370
|
-
var inputText = utils_1.isPresent(text) ? text : selectedItemText;
|
|
371
|
-
var renderClearButton = clearButton && (!!(inputText) || utils_1.isPresent(this.value));
|
|
371
|
+
var selectedItemText = (0, utils_1.getItemValue)(this.value, textField);
|
|
372
|
+
var inputText = (0, utils_1.isPresent)(text) ? text : selectedItemText;
|
|
373
|
+
var renderClearButton = clearButton && (!!(inputText) || (0, utils_1.isPresent)(this.value));
|
|
372
374
|
var base = this.base;
|
|
373
375
|
var vs = base.vs;
|
|
374
376
|
var id = this.props.id || this._inputId;
|
|
@@ -378,10 +380,10 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
378
380
|
vs.total = virtual.total;
|
|
379
381
|
vs.pageSize = virtual.pageSize;
|
|
380
382
|
}
|
|
381
|
-
var combobox = (React.createElement("span", { className: kendo_react_common_1.classNames('k-combobox k-input', (_a = {},
|
|
382
|
-
_a["k-input-"
|
|
383
|
-
_a["k-rounded-"
|
|
384
|
-
_a["k-input-"
|
|
383
|
+
var combobox = (React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-combobox k-input', (_a = {},
|
|
384
|
+
_a["k-input-".concat(sizeMap[size] || size)] = size,
|
|
385
|
+
_a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded,
|
|
386
|
+
_a["k-input-".concat(fillMode)] = fillMode,
|
|
385
387
|
_a['k-invalid'] = !isValid,
|
|
386
388
|
_a['k-loading'] = loading,
|
|
387
389
|
_a['k-required'] = this.required,
|
|
@@ -390,12 +392,12 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
390
392
|
this.renderSearchBar(inputText || '', id),
|
|
391
393
|
renderClearButton && !loading && React.createElement(ClearButton_1.default, { onClick: this.clearButtonClick, key: "clearbutton" }),
|
|
392
394
|
loading && React.createElement("span", { className: "k-icon k-i-loading k-input-loading-icon", key: "loading" }),
|
|
393
|
-
React.createElement("button", { tabIndex: -1, type: "button", className: kendo_react_common_1.classNames('k-input-button k-button k-icon-button', (_b = {},
|
|
394
|
-
_b["k-button-"
|
|
395
|
-
_b["k-button-"
|
|
396
|
-
_b["k-button-"
|
|
395
|
+
React.createElement("button", { tabIndex: -1, type: "button", className: (0, kendo_react_common_1.classNames)('k-input-button k-button k-icon-button', (_b = {},
|
|
396
|
+
_b["k-button-".concat(sizeMap[size] || size)] = size,
|
|
397
|
+
_b["k-button-".concat(fillMode)] = fillMode,
|
|
398
|
+
_b["k-button-".concat(fillMode, "-base")] = fillMode,
|
|
397
399
|
_b)), onClick: this.toggleBtnClick, onMouseDown: function (e) { return e.preventDefault(); } },
|
|
398
|
-
React.createElement("span", { className: kendo_react_common_1.classNames('k-button-icon k-icon k-i-arrow-s', iconClassName) })),
|
|
400
|
+
React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-button-icon k-icon k-i-arrow-s', iconClassName) })),
|
|
399
401
|
this.renderListContainer()));
|
|
400
402
|
return label
|
|
401
403
|
? (React.createElement(kendo_react_labels_1.FloatingLabel, { label: label, editorId: id, editorValue: inputText, editorValid: isValid, editorDisabled: disabled, style: { width: style ? style.width : undefined }, children: combobox }))
|
|
@@ -411,7 +413,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
411
413
|
var vs = this.base.vs;
|
|
412
414
|
var value = this.value;
|
|
413
415
|
this._suggested = '';
|
|
414
|
-
if (focusedIndex !== -1 && !utils_1.isPresent(value)) {
|
|
416
|
+
if (focusedIndex !== -1 && !(0, utils_1.isPresent)(value)) {
|
|
415
417
|
this.handleItemSelect(focusedIndex, state);
|
|
416
418
|
}
|
|
417
419
|
else if (text === '') {
|
|
@@ -434,9 +436,9 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
434
436
|
var _a;
|
|
435
437
|
var _b = this.props, _c = _b.data, data = _c === void 0 ? [] : _c, textField = _b.textField, allowCustom = _b.allowCustom;
|
|
436
438
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
437
|
-
var currentValueText = utils_1.getItemValue(this.value, textField);
|
|
439
|
+
var currentValueText = (0, utils_1.getItemValue)(this.value, textField);
|
|
438
440
|
var valueIndex = currentValueText === value ?
|
|
439
|
-
this.index : utils_1.getItemIndexByText(data, value, textField);
|
|
441
|
+
this.index : (0, utils_1.getItemIndexByText)(data, value, textField);
|
|
440
442
|
var itemSelected = valueIndex !== -1;
|
|
441
443
|
var newSelected = undefined;
|
|
442
444
|
this._suggested = '';
|
|
@@ -464,15 +466,15 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
464
466
|
var _a;
|
|
465
467
|
var _b = this.props, _c = _b.data, data = _c === void 0 ? [] : _c, textField = _b.textField, allowCustom = _b.allowCustom;
|
|
466
468
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
467
|
-
var valueItemText = utils_1.getItemValue(this.value, textField);
|
|
469
|
+
var valueItemText = (0, utils_1.getItemValue)(this.value, textField);
|
|
468
470
|
this._suggested = '';
|
|
469
|
-
if (text === valueItemText || (text === '' && !utils_1.isPresent(valueItemText))) {
|
|
471
|
+
if (text === valueItemText || (text === '' && !(0, utils_1.isPresent)(valueItemText))) {
|
|
470
472
|
if (opened) {
|
|
471
473
|
this.base.togglePopup(state);
|
|
472
474
|
}
|
|
473
475
|
return this.applyState(state);
|
|
474
476
|
}
|
|
475
|
-
var valueIndex = utils_1.getItemIndexByText(data, text, textField, true);
|
|
477
|
+
var valueIndex = (0, utils_1.getItemIndexByText)(data, text, textField, true);
|
|
476
478
|
var itemSelected = valueIndex !== -1;
|
|
477
479
|
var newSelected = null;
|
|
478
480
|
if (itemSelected) {
|
|
@@ -520,22 +522,22 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
520
522
|
var popupWidth = popupSettings.width !== undefined ? popupSettings.width : base.popupWidth;
|
|
521
523
|
var group = this.state.group;
|
|
522
524
|
if (group === undefined && groupField !== undefined) {
|
|
523
|
-
group = utils_1.getItemValue(data[0], groupField);
|
|
525
|
+
group = (0, utils_1.getItemValue)(data[0], groupField);
|
|
524
526
|
}
|
|
525
527
|
return (React.createElement(ListContainer_1.default, { width: popupWidth, popupSettings: {
|
|
526
528
|
animate: popupSettings.animate,
|
|
527
529
|
anchor: this.element,
|
|
528
530
|
show: opened,
|
|
529
|
-
popupClass: kendo_react_common_1.classNames(popupSettings.popupClass, 'k-reset'),
|
|
531
|
+
popupClass: (0, kendo_react_common_1.classNames)(popupSettings.popupClass, 'k-reset'),
|
|
530
532
|
className: popupSettings.className,
|
|
531
533
|
appendTo: popupSettings.appendTo
|
|
532
534
|
}, dir: dir !== undefined ? dir : this.base.dirCalculated, itemsCount: [data.length] },
|
|
533
|
-
React.createElement("div", { className: kendo_react_common_1.classNames((_a = {},
|
|
535
|
+
React.createElement("div", { className: (0, kendo_react_common_1.classNames)((_a = {},
|
|
534
536
|
_a['k-list'] = !list,
|
|
535
|
-
_a["k-list-"
|
|
537
|
+
_a["k-list-".concat(sizeMap[size] || size)] = !list && size,
|
|
536
538
|
_a['k-virtual-list'] = virtual,
|
|
537
539
|
_a['k-data-table'] = list,
|
|
538
|
-
_a["k-table-"
|
|
540
|
+
_a["k-table-".concat(sizeMap[size] || size)] = list && size,
|
|
539
541
|
_a)) },
|
|
540
542
|
header && React.createElement("div", { className: "k-table-header" }, header),
|
|
541
543
|
!list && group && React.createElement("div", { className: "k-list-group-sticky-header" }, group),
|
|
@@ -551,13 +553,13 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
551
553
|
var vs = base.vs;
|
|
552
554
|
var skip = virtual.skip;
|
|
553
555
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
554
|
-
var translate = "translateY("
|
|
556
|
+
var translate = "translateY(".concat(vs.translate, "px)");
|
|
555
557
|
var focusedIndex = opened ? this.getFocusedIndex() : undefined;
|
|
556
558
|
var text = this.props.filter !== undefined ? this.props.filter : this.state.text;
|
|
557
|
-
var selectedItemText = utils_1.getItemValue(this.value, textField);
|
|
558
|
-
var value = utils_1.isPresent(text) && text !== selectedItemText ? null : this.value;
|
|
559
|
+
var selectedItemText = (0, utils_1.getItemValue)(this.value, textField);
|
|
560
|
+
var value = (0, utils_1.isPresent)(text) && text !== selectedItemText ? null : this.value;
|
|
559
561
|
var ListComponent = this.props.list || List_1.default;
|
|
560
|
-
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: { maxHeight: popupSettings.height }, wrapperCssClass: kendo_react_common_1.classNames('k-list-content', (_a = {},
|
|
562
|
+
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: { maxHeight: popupSettings.height }, wrapperCssClass: (0, kendo_react_common_1.classNames)('k-list-content', (_a = {},
|
|
561
563
|
_a['k-list-scroller'] = !virtual,
|
|
562
564
|
_a['k-virtual-content'] = virtual,
|
|
563
565
|
_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() }));
|
|
@@ -567,15 +569,15 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
567
569
|
var _a = this.props, placeholder = _a.placeholder, tabIndex = _a.tabIndex, disabled = _a.disabled, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c;
|
|
568
570
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
569
571
|
var value = this.value;
|
|
570
|
-
var selectedIndex = Math.max(0, data.findIndex(function (i) { return utils_1.areSame(i, value, dataItemKey); }));
|
|
571
|
-
if (this._suggested && !utils_1.areSame(this._valueOnDidUpdate, value, dataItemKey)) {
|
|
572
|
+
var selectedIndex = Math.max(0, data.findIndex(function (i) { return (0, utils_1.areSame)(i, value, dataItemKey); }));
|
|
573
|
+
if (this._suggested && !(0, utils_1.areSame)(this._valueOnDidUpdate, value, dataItemKey)) {
|
|
572
574
|
this._suggested = '';
|
|
573
575
|
}
|
|
574
|
-
return (React.createElement(SearchBar_1.default, { id: id, placeholder: placeholder, tabIndex: tabIndex || undefined, accessKey: this.props.accessKey, value: text + this._suggested, suggestedText: this._suggested, ref: function (el) { return _this._input = el && el.input; }, onKeyDown: this.onInputKeyDown, onChange: this.inputOnChange, onFocus: this.base.handleFocus, onBlur: this.handleBlur, disabled: disabled, expanded: opened, owns: this.base.listBoxId, activedescendant: "option-"
|
|
576
|
+
return (React.createElement(SearchBar_1.default, { id: id, placeholder: placeholder, tabIndex: tabIndex || undefined, accessKey: this.props.accessKey, value: text + this._suggested, suggestedText: this._suggested, ref: function (el) { return _this._input = el && el.input; }, onKeyDown: this.onInputKeyDown, onChange: this.inputOnChange, onFocus: this.base.handleFocus, onBlur: this.handleBlur, disabled: disabled, expanded: opened, owns: this.base.listBoxId, activedescendant: "option-".concat(this.base.guid, "-").concat(selectedIndex + virtual.skip), role: "combobox", ariaLabelledBy: this.props.ariaLabelledBy, ariaDescribedBy: this.props.ariaDescribedBy, render: this.props.valueRender }));
|
|
575
577
|
};
|
|
576
578
|
ComboBoxWithoutContext.prototype.triggerOnChange = function (item, state) {
|
|
577
579
|
var value = this.value;
|
|
578
|
-
if ((!utils_1.isPresent(value) && !utils_1.isPresent(item)) || utils_1.areSame(value, item, this.props.dataItemKey)) {
|
|
580
|
+
if ((!(0, utils_1.isPresent)(value) && !(0, utils_1.isPresent)(item)) || (0, utils_1.areSame)(value, item, this.props.dataItemKey)) {
|
|
579
581
|
return;
|
|
580
582
|
}
|
|
581
583
|
if (this.props.value === undefined) {
|
|
@@ -588,8 +590,8 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
588
590
|
var value = this.value;
|
|
589
591
|
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, _d = _a.focusedItemIndex, focusedItemIndex = _d === void 0 ? utils_1.itemIndexStartsWith : _d;
|
|
590
592
|
var text = this.props.filter ? this.props.filter : this.state.text;
|
|
591
|
-
if (utils_1.isPresent(value) && text === undefined) {
|
|
592
|
-
return data.findIndex(function (i) { return utils_1.areSame(i, value, dataItemKey); });
|
|
593
|
+
if ((0, utils_1.isPresent)(value) && text === undefined) {
|
|
594
|
+
return data.findIndex(function (i) { return (0, utils_1.areSame)(i, value, dataItemKey); });
|
|
593
595
|
}
|
|
594
596
|
else if (text) {
|
|
595
597
|
return focusedItemIndex(data, text, textField);
|
|
@@ -600,7 +602,7 @@ var ComboBoxWithoutContext = /** @class */ (function (_super) {
|
|
|
600
602
|
};
|
|
601
603
|
ComboBoxWithoutContext.prototype.suggestValue = function (value) {
|
|
602
604
|
var _a = this.props, data = _a.data, textField = _a.textField;
|
|
603
|
-
this._suggested = utils_1.suggestValue(value, data, textField);
|
|
605
|
+
this._suggested = (0, utils_1.suggestValue)(value, data, textField);
|
|
604
606
|
};
|
|
605
607
|
ComboBoxWithoutContext.prototype.applyState = function (state) {
|
|
606
608
|
this.base.applyState(state);
|
|
@@ -624,7 +626,7 @@ exports.ComboBoxWithoutContext = ComboBoxWithoutContext;
|
|
|
624
626
|
*
|
|
625
627
|
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
626
628
|
*/
|
|
627
|
-
exports.ComboBoxPropsContext = kendo_react_common_1.createPropsContext();
|
|
629
|
+
exports.ComboBoxPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
628
630
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
629
631
|
/**
|
|
630
632
|
* Represents the [KendoReact ComboBox component]({% slug overview_combobox %}).
|
|
@@ -651,5 +653,5 @@ exports.ComboBoxPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
651
653
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
652
654
|
* ```
|
|
653
655
|
*/
|
|
654
|
-
exports.ComboBox = kendo_react_common_1.withPropsContext(exports.ComboBoxPropsContext, ComboBoxWithoutContext);
|
|
656
|
+
exports.ComboBox = (0, kendo_react_common_1.withPropsContext)(exports.ComboBoxPropsContext, ComboBoxWithoutContext);
|
|
655
657
|
exports.ComboBox.displayName = 'KendoReactComboBox';
|
|
@@ -19,9 +19,6 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
|
|
|
19
19
|
*/
|
|
20
20
|
static propTypes: {
|
|
21
21
|
value: PropTypes.Requireable<any>;
|
|
22
|
-
/**
|
|
23
|
-
* @hidden
|
|
24
|
-
*/
|
|
25
22
|
defaultValue: PropTypes.Requireable<any>;
|
|
26
23
|
filterable: PropTypes.Requireable<boolean>;
|
|
27
24
|
filter: PropTypes.Requireable<string>;
|
|
@@ -83,9 +80,9 @@ export declare class DropDownListWithoutContext extends React.Component<DropDown
|
|
|
83
80
|
*/
|
|
84
81
|
static defaultProps: {
|
|
85
82
|
required: boolean;
|
|
86
|
-
size: "small" | "medium" | "large";
|
|
87
|
-
rounded: "small" | "medium" | "full" | "large";
|
|
88
|
-
fillMode: "flat" | "
|
|
83
|
+
size: "small" | "medium" | "large" | null | undefined;
|
|
84
|
+
rounded: "small" | "medium" | "full" | "large" | null | undefined;
|
|
85
|
+
fillMode: "flat" | "outline" | "solid" | null | undefined;
|
|
89
86
|
popupSettings: {
|
|
90
87
|
height: string;
|
|
91
88
|
};
|
|
@@ -52,8 +52,10 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
52
52
|
* @hidden
|
|
53
53
|
*/
|
|
54
54
|
_this.state = {};
|
|
55
|
+
_this._element = null;
|
|
55
56
|
_this.base = new DropDownBase_1.default(_this);
|
|
56
57
|
_this.searchState = { word: '', last: '' };
|
|
58
|
+
_this._select = null;
|
|
57
59
|
_this._skipFocusEvent = false;
|
|
58
60
|
_this._filterInput = null;
|
|
59
61
|
_this._navigated = false;
|
|
@@ -73,7 +75,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
73
75
|
var skip = virtual ? virtual.skip : 0;
|
|
74
76
|
var item = (index === -1 && defaultItem !== undefined) ?
|
|
75
77
|
defaultItem : data[index - skip];
|
|
76
|
-
var newSelected = !utils_1.areSame(item, _this.value, dataItemKey);
|
|
78
|
+
var newSelected = !(0, utils_1.areSame)(item, _this.value, dataItemKey);
|
|
77
79
|
_this.triggerOnChange(item, state);
|
|
78
80
|
if (newSelected) {
|
|
79
81
|
_this.base.triggerPageChangeCornerItems(item, state);
|
|
@@ -99,8 +101,8 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
99
101
|
dir: dir !== undefined ? dir : base.dirCalculated,
|
|
100
102
|
width: popupWidth,
|
|
101
103
|
popupSettings: {
|
|
102
|
-
popupClass: kendo_react_common_1.classNames(popupSettings.popupClass, 'k-list', (_a = {},
|
|
103
|
-
_a["k-list-"
|
|
104
|
+
popupClass: (0, kendo_react_common_1.classNames)(popupSettings.popupClass, 'k-list', (_a = {},
|
|
105
|
+
_a["k-list-".concat(sizeMap[size] || size)] = size,
|
|
104
106
|
_a['k-virtual-list'] = _this.base.vs.enabled,
|
|
105
107
|
_a)),
|
|
106
108
|
className: popupSettings.className,
|
|
@@ -126,7 +128,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
126
128
|
var skip = virtual.skip;
|
|
127
129
|
var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;
|
|
128
130
|
var popupSettings = _this.base.getPopupSettings();
|
|
129
|
-
var translate = "translateY("
|
|
131
|
+
var translate = "translateY(".concat(vs.translate, "px)");
|
|
130
132
|
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: function (e) {
|
|
131
133
|
vs.scrollHandler(e);
|
|
132
134
|
}, wrapperRef: vs.scrollerRef, scroller: _this.base.renderScrollElement() }));
|
|
@@ -137,7 +139,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
137
139
|
};
|
|
138
140
|
_this.renderDefaultItem = function () {
|
|
139
141
|
var _a = _this.props, textField = _a.textField, defaultItem = _a.defaultItem, dataItemKey = _a.dataItemKey;
|
|
140
|
-
return defaultItem !== undefined && (React.createElement(ListDefaultItem_1.default, { defaultItem: defaultItem, textField: textField, selected: utils_1.areSame(_this.value, defaultItem, dataItemKey), key: "defaultitemkey", onClick: _this.handleDefaultItemClick }));
|
|
142
|
+
return defaultItem !== undefined && (React.createElement(ListDefaultItem_1.default, { defaultItem: defaultItem, textField: textField, selected: (0, utils_1.areSame)(_this.value, defaultItem, dataItemKey), key: "defaultitemkey", onClick: _this.handleDefaultItemClick }));
|
|
141
143
|
};
|
|
142
144
|
_this.search = function (event) {
|
|
143
145
|
clearTimeout(_this._typingTimeout);
|
|
@@ -153,9 +155,9 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
153
155
|
});
|
|
154
156
|
var word = _this.searchState.word;
|
|
155
157
|
var last = _this.searchState.last;
|
|
156
|
-
var isInLoop = utils_1.sameCharsOnly(word, last);
|
|
158
|
+
var isInLoop = (0, utils_1.sameCharsOnly)(word, last);
|
|
157
159
|
var dataLength = mappedData.length;
|
|
158
|
-
var startIndex = Math.max(0, data.findIndex(function (i) { return utils_1.areSame(i, _this.value, dataItemKey); }));
|
|
160
|
+
var startIndex = Math.max(0, data.findIndex(function (i) { return (0, utils_1.areSame)(i, _this.value, dataItemKey); }));
|
|
159
161
|
var defaultItem;
|
|
160
162
|
if (_this.props.defaultItem) {
|
|
161
163
|
defaultItem = { item: _this.props.defaultItem, itemIndex: -1 };
|
|
@@ -163,13 +165,13 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
163
165
|
startIndex += 1;
|
|
164
166
|
}
|
|
165
167
|
startIndex += isInLoop ? 1 : 0;
|
|
166
|
-
mappedData = utils_1.shuffleData(mappedData, startIndex, defaultItem);
|
|
168
|
+
mappedData = (0, utils_1.shuffleData)(mappedData, startIndex, defaultItem);
|
|
167
169
|
var text, loopMatch, nextMatch, index = 0;
|
|
168
170
|
var _c = _this.props, textField = _c.textField, ignoreCase = _c.ignoreCase;
|
|
169
171
|
for (; index < dataLength; index++) {
|
|
170
|
-
text = utils_1.getItemValue(mappedData[index].item, textField);
|
|
171
|
-
loopMatch = isInLoop && utils_1.matchText(text, last, ignoreCase);
|
|
172
|
-
nextMatch = utils_1.matchText(text, word, ignoreCase);
|
|
172
|
+
text = (0, utils_1.getItemValue)(mappedData[index].item, textField);
|
|
173
|
+
loopMatch = isInLoop && (0, utils_1.matchText)(text, last, ignoreCase);
|
|
174
|
+
nextMatch = (0, utils_1.matchText)(text, word, ignoreCase);
|
|
173
175
|
if (loopMatch || nextMatch) {
|
|
174
176
|
index = mappedData[index].itemIndex;
|
|
175
177
|
break;
|
|
@@ -327,7 +329,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
327
329
|
: _this.props.validationMessage || VALIDATION_MESSAGE);
|
|
328
330
|
}
|
|
329
331
|
};
|
|
330
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
332
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
331
333
|
return _this;
|
|
332
334
|
}
|
|
333
335
|
Object.defineProperty(DropDownListWithoutContext.prototype, "element", {
|
|
@@ -358,7 +360,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
358
360
|
else if (this.props.defaultValue !== undefined) {
|
|
359
361
|
value = this.props.defaultValue;
|
|
360
362
|
}
|
|
361
|
-
if (!utils_1.isPresent(value) && this.props.defaultItem !== undefined) {
|
|
363
|
+
if (!(0, utils_1.isPresent)(value) && this.props.defaultItem !== undefined) {
|
|
362
364
|
value = this.props.defaultItem;
|
|
363
365
|
}
|
|
364
366
|
return value;
|
|
@@ -374,7 +376,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
374
376
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey;
|
|
375
377
|
var value = this.value;
|
|
376
378
|
// TO DO: deprecate it!
|
|
377
|
-
return data.findIndex(function (i) { return utils_1.areSame(i, value, dataItemKey); });
|
|
379
|
+
return data.findIndex(function (i) { return (0, utils_1.areSame)(i, value, dataItemKey); });
|
|
378
380
|
},
|
|
379
381
|
enumerable: false,
|
|
380
382
|
configurable: true
|
|
@@ -453,8 +455,8 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
453
455
|
else {
|
|
454
456
|
var selectedItem_1 = this.value;
|
|
455
457
|
var prevSelectedItem = prevProps.value !== undefined ? prevProps.value : prevState.value;
|
|
456
|
-
var selectedItemIndex = data.findIndex(function (i) { return utils_1.areSame(i, selectedItem_1, dataItemKey); });
|
|
457
|
-
var selectedItemChanged = !utils_1.areSame(prevSelectedItem, selectedItem_1, dataItemKey);
|
|
458
|
+
var selectedItemIndex = data.findIndex(function (i) { return (0, utils_1.areSame)(i, selectedItem_1, dataItemKey); });
|
|
459
|
+
var selectedItemChanged = !(0, utils_1.areSame)(prevSelectedItem, selectedItem_1, dataItemKey);
|
|
458
460
|
if (opening && virtual) {
|
|
459
461
|
this.base.scrollToVirtualItem(virtual, selectedItemIndex);
|
|
460
462
|
}
|
|
@@ -491,7 +493,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
491
493
|
var _c = this.props, style = _c.style, className = _c.className, label = _c.label, dir = _c.dir, virtual = _c.virtual, size = _c.size, rounded = _c.rounded, fillMode = _c.fillMode;
|
|
492
494
|
var opened = this.props.opened !== undefined ? this.props.opened : this.state.opened;
|
|
493
495
|
var value = this.value;
|
|
494
|
-
var text = utils_1.getItemValue(value, this.props.textField);
|
|
496
|
+
var text = (0, utils_1.getItemValue)(value, this.props.textField);
|
|
495
497
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
496
498
|
var base = this.base;
|
|
497
499
|
var vs = base.vs;
|
|
@@ -503,15 +505,15 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
503
505
|
}
|
|
504
506
|
var _d = this.props, dataItemKey = _d.dataItemKey, _e = _d.data, data = _e === void 0 ? [] : _e, disabled = _d.disabled, tabIndex = _d.tabIndex, loading = _d.loading, iconClassName = _d.iconClassName, valueRender = _d.valueRender;
|
|
505
507
|
var focused = this.state.focused;
|
|
506
|
-
var selectedIndex = data.findIndex(function (i) { return utils_1.areSame(i, value, dataItemKey); });
|
|
508
|
+
var selectedIndex = data.findIndex(function (i) { return (0, utils_1.areSame)(i, value, dataItemKey); });
|
|
507
509
|
var valueDefaultRendering = (React.createElement("span", { className: "k-input-inner" },
|
|
508
510
|
React.createElement("span", { className: "k-input-value-text" }, text)));
|
|
509
511
|
var valueElement = valueRender !== undefined ?
|
|
510
512
|
valueRender.call(undefined, valueDefaultRendering, value) : valueDefaultRendering;
|
|
511
|
-
var dropdownlist = (React.createElement("span", { ref: this.componentRef, className: kendo_react_common_1.classNames('k-dropdownlist k-picker', className, (_a = {},
|
|
512
|
-
_a["k-picker-"
|
|
513
|
-
_a["k-rounded-"
|
|
514
|
-
_a["k-picker-"
|
|
513
|
+
var dropdownlist = (React.createElement("span", { ref: this.componentRef, className: (0, kendo_react_common_1.classNames)('k-dropdownlist k-picker', className, (_a = {},
|
|
514
|
+
_a["k-picker-".concat(sizeMap[size] || size)] = size,
|
|
515
|
+
_a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded,
|
|
516
|
+
_a["k-picker-".concat(fillMode)] = fillMode,
|
|
515
517
|
_a['k-focus'] = focused,
|
|
516
518
|
_a['k-disabled'] = disabled,
|
|
517
519
|
_a['k-invalid'] = !isValid,
|
|
@@ -519,15 +521,15 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
519
521
|
_a['k-required'] = this.required,
|
|
520
522
|
_a)), style: !label
|
|
521
523
|
? style
|
|
522
|
-
: __assign(__assign({}, style), { width: undefined }), dir: dir, onMouseDown: opened ? utils_1.preventDefaultNonInputs : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, tabIndex: kendo_react_common_1.getTabIndex(tabIndex, disabled), accessKey: this.props.accessKey, onKeyDown: this.handleKeyDown, onKeyPress: this.handleKeyPress, onClick: disabled ? undefined : this.handleWrapperClick, role: 'listbox', "aria-required": this.required, "aria-disabled": disabled || undefined, "aria-haspopup": true, "aria-expanded": opened || false, "aria-owns": this.base.listBoxId, "aria-activedescendant": opened ? ('option-' + this.base.guid + '-' + (selectedIndex + (virtual ? virtual.skip : 0))) : undefined, "aria-label": this.props.ariaLabel || this.props.label, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, id: this.props.id, title: this.props.title },
|
|
524
|
+
: __assign(__assign({}, style), { width: undefined }), dir: dir, onMouseDown: opened ? utils_1.preventDefaultNonInputs : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, tabIndex: (0, kendo_react_common_1.getTabIndex)(tabIndex, disabled), accessKey: this.props.accessKey, onKeyDown: this.handleKeyDown, onKeyPress: this.handleKeyPress, onClick: disabled ? undefined : this.handleWrapperClick, role: 'listbox', "aria-required": this.required, "aria-disabled": disabled || undefined, "aria-haspopup": true, "aria-expanded": opened || false, "aria-owns": this.base.listBoxId, "aria-activedescendant": opened ? ('option-' + this.base.guid + '-' + (selectedIndex + (virtual ? virtual.skip : 0))) : undefined, "aria-label": this.props.ariaLabel || this.props.label, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, id: this.props.id, title: this.props.title },
|
|
523
525
|
valueElement,
|
|
524
526
|
loading && React.createElement("span", { className: "k-icon k-i-loading k-input-loading-icon", key: "loading" }),
|
|
525
|
-
React.createElement("button", { tabIndex: -1, type: "button", "aria-hidden": true, className: kendo_react_common_1.classNames('k-input-button k-button k-icon-button', (_b = {},
|
|
526
|
-
_b["k-button-"
|
|
527
|
-
_b["k-button-"
|
|
528
|
-
_b["k-button-"
|
|
527
|
+
React.createElement("button", { tabIndex: -1, type: "button", "aria-hidden": true, className: (0, kendo_react_common_1.classNames)('k-input-button k-button k-icon-button', (_b = {},
|
|
528
|
+
_b["k-button-".concat(sizeMap[size] || size)] = size,
|
|
529
|
+
_b["k-button-".concat(fillMode)] = fillMode,
|
|
530
|
+
_b["k-button-".concat(fillMode, "-base")] = fillMode,
|
|
529
531
|
_b)), onMouseDown: function (e) { return e.preventDefault(); } },
|
|
530
|
-
React.createElement("span", { className: kendo_react_common_1.classNames('k-button-icon k-icon k-i-arrow-s', iconClassName) })),
|
|
532
|
+
React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-button-icon k-icon k-i-arrow-s', iconClassName) })),
|
|
531
533
|
this.dummySelect(value),
|
|
532
534
|
this.renderListContainer()));
|
|
533
535
|
return label ? (React.createElement(kendo_react_labels_1.FloatingLabel, { label: label, editorValue: text, editorValid: isValid, editorDisabled: this.props.disabled, style: { width: style ? style.width : undefined }, children: dropdownlist })) : dropdownlist;
|
|
@@ -539,7 +541,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
539
541
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, defaultItem = _a.defaultItem, dataItemKey = _a.dataItemKey, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0, total: 0, pageSize: 0 } : _c;
|
|
540
542
|
var vs = this.base.vs;
|
|
541
543
|
var value = this.value;
|
|
542
|
-
var index = data.findIndex(function (i) { return utils_1.areSame(i, value, dataItemKey); });
|
|
544
|
+
var index = data.findIndex(function (i) { return (0, utils_1.areSame)(i, value, dataItemKey); });
|
|
543
545
|
var newIndex = this.base.navigation.navigate({
|
|
544
546
|
current: virtual.skip + index,
|
|
545
547
|
max: (vs.enabled ? virtual.total : data.length) - 1,
|
|
@@ -552,14 +554,14 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
552
554
|
this.applyState(state);
|
|
553
555
|
};
|
|
554
556
|
DropDownListWithoutContext.prototype.focusedIndex = function () {
|
|
555
|
-
var filterText = utils_1.isPresent(this.props.filter) ? this.props.filter : this.state.text;
|
|
557
|
+
var filterText = (0, utils_1.isPresent)(this.props.filter) ? this.props.filter : this.state.text;
|
|
556
558
|
var _a = this.props, _b = _a.data, data = _b === void 0 ? [] : _b, _c = _a.virtual, virtual = _c === void 0 ? { skip: 0 } : _c, dataItemKey = _a.dataItemKey, textField = _a.textField, focusedItemIndex = _a.focusedItemIndex;
|
|
557
559
|
var value = this.value;
|
|
558
|
-
var selectedIndex = data.findIndex(function (i) { return utils_1.areSame(i, value, dataItemKey); });
|
|
560
|
+
var selectedIndex = data.findIndex(function (i) { return (0, utils_1.areSame)(i, value, dataItemKey); });
|
|
559
561
|
var hasSelected = !(selectedIndex < 0 && !this.props.defaultItem);
|
|
560
562
|
if (!hasSelected && filterText && virtual.skip === 0) {
|
|
561
563
|
return focusedItemIndex ? focusedItemIndex(data, filterText, textField) :
|
|
562
|
-
data.indexOf(utils_1.getFocusedItem(data, filterText, textField));
|
|
564
|
+
data.indexOf((0, utils_1.getFocusedItem)(data, filterText, textField));
|
|
563
565
|
}
|
|
564
566
|
else {
|
|
565
567
|
return !hasSelected && virtual.skip === 0 ? 0 : undefined;
|
|
@@ -572,7 +574,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
572
574
|
window.setTimeout(function () { return _this._skipFocusEvent = false; }, 30);
|
|
573
575
|
};
|
|
574
576
|
DropDownListWithoutContext.prototype.triggerOnChange = function (item, state) {
|
|
575
|
-
if (utils_1.areSame(this.value, item, this.props.dataItemKey)) {
|
|
577
|
+
if ((0, utils_1.areSame)(this.value, item, this.props.dataItemKey)) {
|
|
576
578
|
return;
|
|
577
579
|
}
|
|
578
580
|
if (this.props.value === undefined) {
|
|
@@ -603,7 +605,7 @@ exports.DropDownListWithoutContext = DropDownListWithoutContext;
|
|
|
603
605
|
*
|
|
604
606
|
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
605
607
|
*/
|
|
606
|
-
exports.DropDownListPropsContext = kendo_react_common_1.createPropsContext();
|
|
608
|
+
exports.DropDownListPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
607
609
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
608
610
|
/**
|
|
609
611
|
* Represents the [KendoReact DropDownList component]({% slug overview_dropdownlist %}).
|
|
@@ -630,5 +632,5 @@ exports.DropDownListPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
630
632
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
631
633
|
* ```
|
|
632
634
|
*/
|
|
633
|
-
exports.DropDownList = kendo_react_common_1.withPropsContext(exports.DropDownListPropsContext, DropDownListWithoutContext);
|
|
635
|
+
exports.DropDownList = (0, kendo_react_common_1.withPropsContext)(exports.DropDownListPropsContext, DropDownListWithoutContext);
|
|
634
636
|
exports.DropDownList.displayName = 'KendoReactDropDownList';
|
|
@@ -13,4 +13,4 @@ export declare const DropDownTreePropsContext: React.Context<(p: DropDownTreePro
|
|
|
13
13
|
* Accepts properties of type [DropDownTreeProps]({% slug api_dropdowns_dropdowntreeprops %}).
|
|
14
14
|
* Obtaining the `ref` returns an object of type [DropDownTreeHandle]({% slug api_dropdowns_dropdowntreehandle %}).
|
|
15
15
|
*/
|
|
16
|
-
export declare const DropDownTree: React.ForwardRefExoticComponent<DropDownTreeProps & React.RefAttributes<DropDownTreeHandle>>;
|
|
16
|
+
export declare const DropDownTree: React.ForwardRefExoticComponent<DropDownTreeProps & React.RefAttributes<DropDownTreeHandle | null>>;
|