@progress/kendo-react-dropdowns 5.4.0-dev.202205271059 → 5.4.0-dev.202206061009
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 +15 -11
- 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 +14 -10
- package/dist/es/MultiSelectTree/utils.d.ts +1 -1
- package/dist/es/MultiSelectTree/utils.js +10 -6
- 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/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 +31 -27
- 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 +28 -24
- package/dist/npm/MultiSelectTree/utils.d.ts +1 -1
- package/dist/npm/MultiSelectTree/utils.js +17 -13
- 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/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
|
@@ -25,10 +25,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
25
|
};
|
|
26
26
|
return __assign.apply(this, arguments);
|
|
27
27
|
};
|
|
28
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
29
|
-
for (var i = 0,
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
29
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
30
|
+
if (ar || !(i in from)) {
|
|
31
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
32
|
+
ar[i] = from[i];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
32
36
|
};
|
|
33
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
38
|
exports.MultiSelect = exports.MultiSelectPropsContext = exports.MultiSelectWithoutContext = void 0;
|
|
@@ -67,10 +71,12 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
67
71
|
_this.state = {
|
|
68
72
|
activedescendant: settings_1.ActiveDescendant.PopupList
|
|
69
73
|
};
|
|
74
|
+
_this._element = null;
|
|
70
75
|
_this._valueItemsDuringOnChange = null;
|
|
71
|
-
_this._inputId = kendo_react_common_1.guid();
|
|
76
|
+
_this._inputId = (0, kendo_react_common_1.guid)();
|
|
72
77
|
_this.base = new DropDownBase_1.default(_this);
|
|
73
78
|
_this._tags = [];
|
|
79
|
+
_this._input = null;
|
|
74
80
|
_this._skipFocusEvent = false;
|
|
75
81
|
_this.scrollToFocused = false;
|
|
76
82
|
/**
|
|
@@ -88,14 +94,14 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
88
94
|
var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey, virtual = _a.virtual;
|
|
89
95
|
var skip = virtual ? virtual.skip : 0;
|
|
90
96
|
var dataItem = data[index - skip];
|
|
91
|
-
var indexInValue = _this.value.findIndex(function (i) { return utils_1.areSame(i, dataItem, dataItemKey); });
|
|
97
|
+
var indexInValue = _this.value.findIndex(function (i) { return (0, utils_1.areSame)(i, dataItem, dataItemKey); });
|
|
92
98
|
var newItems = [];
|
|
93
99
|
if (indexInValue !== -1) { // item is already selected
|
|
94
100
|
newItems = _this.value;
|
|
95
101
|
newItems.splice(indexInValue, 1);
|
|
96
102
|
}
|
|
97
103
|
else {
|
|
98
|
-
newItems = __spreadArray(__spreadArray([], _this.value), [dataItem]);
|
|
104
|
+
newItems = __spreadArray(__spreadArray([], _this.value, true), [dataItem], false);
|
|
99
105
|
}
|
|
100
106
|
var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;
|
|
101
107
|
if (text) {
|
|
@@ -125,7 +131,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
125
131
|
_this.focus();
|
|
126
132
|
}
|
|
127
133
|
var selected = _this.value;
|
|
128
|
-
utils_1.removeDataItems(selected, itemsToRemove, _this.props.dataItemKey);
|
|
134
|
+
(0, utils_1.removeDataItems)(selected, itemsToRemove, _this.props.dataItemKey);
|
|
129
135
|
_this.triggerOnChange(selected, state);
|
|
130
136
|
_this.applyState(state);
|
|
131
137
|
};
|
|
@@ -192,7 +198,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
192
198
|
_this.base.togglePopup(state);
|
|
193
199
|
}
|
|
194
200
|
var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;
|
|
195
|
-
if (utils_1.isPresent(text) && text !== '') {
|
|
201
|
+
if ((0, utils_1.isPresent)(text) && text !== '') {
|
|
196
202
|
_this.base.filterChanged('', state);
|
|
197
203
|
}
|
|
198
204
|
if (_this.state.text) {
|
|
@@ -255,8 +261,8 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
255
261
|
dir: dir !== undefined ? dir : base.dirCalculated,
|
|
256
262
|
width: popupWidth,
|
|
257
263
|
popupSettings: {
|
|
258
|
-
popupClass: kendo_react_common_1.classNames(popupSettings.popupClass, 'k-list', (_a = {},
|
|
259
|
-
_a["k-list-"
|
|
264
|
+
popupClass: (0, kendo_react_common_1.classNames)(popupSettings.popupClass, 'k-list', (_a = {},
|
|
265
|
+
_a["k-list-".concat(sizeMap[size] || size)] = size,
|
|
260
266
|
_a['k-virtual-list'] = _this.base.vs.enabled,
|
|
261
267
|
_a)),
|
|
262
268
|
className: popupSettings.className,
|
|
@@ -270,10 +276,10 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
270
276
|
itemsCount: [data.length, _this.value.length]
|
|
271
277
|
};
|
|
272
278
|
var focusedType = _this.getFocusedState().focusedType;
|
|
273
|
-
var customItem = allowCustom && text && (React.createElement("div", { className: kendo_react_common_1.classNames('k-list', (_b = {},
|
|
274
|
-
_b["k-list-"
|
|
279
|
+
var customItem = allowCustom && text && (React.createElement("div", { className: (0, kendo_react_common_1.classNames)('k-list', (_b = {},
|
|
280
|
+
_b["k-list-".concat(sizeMap[size] || size)] = size,
|
|
275
281
|
_b)), key: "customitem", onClick: _this.customItemSelect, onMouseDown: preventDefault },
|
|
276
|
-
React.createElement("div", { className: kendo_react_common_1.classNames('k-list-item k-custom-item', { 'k-focus': isCustom(focusedType) }), style: { fontStyle: 'italic' } },
|
|
282
|
+
React.createElement("div", { className: (0, kendo_react_common_1.classNames)('k-list-item k-custom-item', { 'k-focus': isCustom(focusedType) }), style: { fontStyle: 'italic' } },
|
|
277
283
|
text,
|
|
278
284
|
React.createElement("span", { className: "k-icon k-i-plus", style: { position: 'absolute', right: '0.5em' } }))));
|
|
279
285
|
return (React.createElement(ListContainer_1.default, __assign({}, listContainerProps),
|
|
@@ -289,7 +295,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
289
295
|
var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;
|
|
290
296
|
var focusedIndex = _this.getFocusedState().focusedIndex;
|
|
291
297
|
var popupSettings = _this.base.getPopupSettings();
|
|
292
|
-
var translate = "translateY("
|
|
298
|
+
var translate = "translateY(".concat(vs.translate, "px)");
|
|
293
299
|
return (React.createElement(List_1.default, { id: _this.base.listBoxId, show: opened, data: data.slice(), focusedIndex: focusedIndex - skip, value: _this.value, textField: textField, valueField: dataItemKey, optionsGuid: _this.base.guid, listRef: function (list) { 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, onMouseDown: preventDefault, onBlur: _this.handleBlur, onScroll: function (e) {
|
|
294
300
|
vs.scrollHandler(e);
|
|
295
301
|
}, wrapperRef: vs.scrollerRef, scroller: _this.base.renderScrollElement() }));
|
|
@@ -309,7 +315,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
309
315
|
}
|
|
310
316
|
state.data.focusedIndex = undefined;
|
|
311
317
|
_this.base.filterChanged('', state);
|
|
312
|
-
var newItems = __spreadArray(__spreadArray([], _this.value), [item]);
|
|
318
|
+
var newItems = __spreadArray(__spreadArray([], _this.value, true), [item], false);
|
|
313
319
|
_this.triggerOnChange(newItems, state);
|
|
314
320
|
_this.base.togglePopup(state);
|
|
315
321
|
_this.applyState(state);
|
|
@@ -385,7 +391,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
385
391
|
: _this.props.validationMessage || VALIDATION_MESSAGE);
|
|
386
392
|
}
|
|
387
393
|
};
|
|
388
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
394
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
389
395
|
return _this;
|
|
390
396
|
}
|
|
391
397
|
Object.defineProperty(MultiSelectWithoutContext.prototype, "element", {
|
|
@@ -560,7 +566,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
560
566
|
var tagsToRender = [];
|
|
561
567
|
if (tags === undefined) {
|
|
562
568
|
this.value.forEach(function (item) {
|
|
563
|
-
tagsToRender.push({ text: utils_1.getItemValue(item, textField), data: [item] });
|
|
569
|
+
tagsToRender.push({ text: (0, utils_1.getItemValue)(item, textField), data: [item] });
|
|
564
570
|
});
|
|
565
571
|
}
|
|
566
572
|
else {
|
|
@@ -569,10 +575,10 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
569
575
|
this.setItems(tagsToRender, this._tags);
|
|
570
576
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
571
577
|
var clearButton = Boolean(filter !== undefined ? filter : text) || this.value.length > 0;
|
|
572
|
-
var component = (React.createElement("div", { ref: this.componentRef, className: kendo_react_common_1.classNames('k-multiselect k-input', className, (_a = {},
|
|
573
|
-
_a["k-input-"
|
|
574
|
-
_a["k-rounded-"
|
|
575
|
-
_a["k-input-"
|
|
578
|
+
var component = (React.createElement("div", { ref: this.componentRef, className: (0, kendo_react_common_1.classNames)('k-multiselect k-input', className, (_a = {},
|
|
579
|
+
_a["k-input-".concat(sizeMap[size] || size)] = size,
|
|
580
|
+
_a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded,
|
|
581
|
+
_a["k-input-".concat(fillMode)] = fillMode,
|
|
576
582
|
_a['k-focus'] = focused && !disabled,
|
|
577
583
|
_a['k-invalid'] = !isValid,
|
|
578
584
|
_a['k-disabled'] = disabled,
|
|
@@ -581,15 +587,15 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
581
587
|
_a)), style: !label
|
|
582
588
|
? style
|
|
583
589
|
: __assign(__assign({}, style), { width: undefined }), dir: dir, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.handleWrapperClick, onMouseDown: utils_1.preventDefaultNonInputs },
|
|
584
|
-
React.createElement("div", { className: kendo_react_common_1.classNames('k-input-values k-chip-list k-selection-multiple', (_b = {},
|
|
585
|
-
_b["k-chip-list-"
|
|
590
|
+
React.createElement("div", { className: (0, kendo_react_common_1.classNames)('k-input-values k-chip-list k-selection-multiple', (_b = {},
|
|
591
|
+
_b["k-chip-list-".concat(sizeMap[size] || size)] = size,
|
|
586
592
|
_b)), role: "listbox", id: 'tagslist-' + this.base.guid },
|
|
587
|
-
tagsToRender.length > 0 && React.createElement(TagList_1.default, { tagRender: this.props.tagRender, onTagDelete: this.onTagDelete, data: tagsToRender, guid: this.base.guid, focused: focusedTag ? tagsToRender.find(function (t) { return utils_1.matchTags(t, focusedTag, dataItemKey); }) : undefined, size: size }),
|
|
593
|
+
tagsToRender.length > 0 && React.createElement(TagList_1.default, { tagRender: this.props.tagRender, onTagDelete: this.onTagDelete, data: tagsToRender, guid: this.base.guid, focused: focusedTag ? tagsToRender.find(function (t) { return (0, utils_1.matchTags)(t, focusedTag, dataItemKey); }) : undefined, size: size }),
|
|
588
594
|
this.renderSearchbar(id)),
|
|
589
595
|
loading && React.createElement("span", { className: "k-icon k-i-loading k-input-loading-icon" }),
|
|
590
596
|
clearButton && React.createElement(ClearButton_1.default, { onClick: this.clearButtonClick }),
|
|
591
597
|
this.renderListContainer()));
|
|
592
|
-
return label ? (React.createElement(kendo_react_labels_1.FloatingLabel, { label: label, editorId: id, editorValue: text || utils_1.getItemValue(this.value[0], textField), editorValid: isValid, editorDisabled: disabled, style: { width: style ? style.width : undefined }, children: component })) : component;
|
|
598
|
+
return label ? (React.createElement(kendo_react_labels_1.FloatingLabel, { label: label, editorId: id, editorValue: text || (0, utils_1.getItemValue)(this.value[0], textField), editorValid: isValid, editorDisabled: disabled, style: { width: style ? style.width : undefined }, children: component })) : component;
|
|
593
599
|
};
|
|
594
600
|
MultiSelectWithoutContext.prototype.renderSearchbar = function (id) {
|
|
595
601
|
var _a = this.state, activedescendant = _a.activedescendant, focusedTag = _a.focusedTag;
|
|
@@ -599,9 +605,9 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
599
605
|
var focusedIndex = this.getFocusedState().focusedIndex;
|
|
600
606
|
var placeholderToShow = this.value.length === 0 && !text ? placeholder : undefined;
|
|
601
607
|
var ariaActivedescendant = activedescendant === settings_1.ActiveDescendant.TagsList && focusedTag !== undefined ?
|
|
602
|
-
"tag-"
|
|
603
|
-
"option-"
|
|
604
|
-
return (React.createElement(SearchBar_1.default, { id: id, size: Math.max((placeholderToShow || '').length, text.length, 1), tabIndex: this.props.tabIndex, accessKey: this.props.accessKey, placeholder: placeholderToShow, value: text, onChange: this.onChangeHandler, onKeyDown: this.onInputKeyDown, ref: this.searchbarRef, disabled: disabled, expanded: opened, owns: this.base.listBoxId, activedescendant: ariaActivedescendant, ariaDescribedBy: "tagslist-"
|
|
608
|
+
"tag-".concat(this.base.guid, "-").concat(focusedTag.text.replace(/\s+/g, '-')) :
|
|
609
|
+
"option-".concat(this.base.guid, "-").concat(focusedIndex);
|
|
610
|
+
return (React.createElement(SearchBar_1.default, { id: id, size: Math.max((placeholderToShow || '').length, text.length, 1), tabIndex: this.props.tabIndex, accessKey: this.props.accessKey, placeholder: placeholderToShow, value: text, onChange: this.onChangeHandler, onKeyDown: this.onInputKeyDown, ref: this.searchbarRef, disabled: disabled, expanded: opened, owns: this.base.listBoxId, activedescendant: ariaActivedescendant, ariaDescribedBy: "tagslist-".concat(this.base.guid).concat(ariaDescribedBy ? (' ' + ariaDescribedBy) : ''), ariaLabelledBy: this.props.ariaLabelledBy }));
|
|
605
611
|
};
|
|
606
612
|
MultiSelectWithoutContext.prototype.onTagsNavigate = function (event, state) {
|
|
607
613
|
var keyCode = event.keyCode;
|
|
@@ -609,7 +615,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
609
615
|
var tags = this._tags;
|
|
610
616
|
var itemsKey = this.props.dataItemKey;
|
|
611
617
|
var focusedIndex = focusedTag ?
|
|
612
|
-
tags.findIndex(function (t) { return utils_1.matchTags(t, focusedTag, itemsKey); }) : -1;
|
|
618
|
+
tags.findIndex(function (t) { return (0, utils_1.matchTags)(t, focusedTag, itemsKey); }) : -1;
|
|
613
619
|
var newFocusedTag = undefined;
|
|
614
620
|
var hasFocused = focusedIndex !== -1;
|
|
615
621
|
if (keyCode === kendo_react_common_1.Keys.left) {
|
|
@@ -639,19 +645,19 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
639
645
|
else if (keyCode === kendo_react_common_1.Keys.delete) {
|
|
640
646
|
if (hasFocused) {
|
|
641
647
|
var items = this.value;
|
|
642
|
-
utils_1.removeDataItems(items, tags[focusedIndex].data, itemsKey);
|
|
648
|
+
(0, utils_1.removeDataItems)(items, tags[focusedIndex].data, itemsKey);
|
|
643
649
|
this.triggerOnChange(items, state);
|
|
644
650
|
}
|
|
645
651
|
}
|
|
646
652
|
else if (keyCode === kendo_react_common_1.Keys.backspace) {
|
|
647
653
|
var items = this.value;
|
|
648
654
|
if (hasFocused) {
|
|
649
|
-
utils_1.removeDataItems(items, tags[focusedIndex].data, itemsKey);
|
|
655
|
+
(0, utils_1.removeDataItems)(items, tags[focusedIndex].data, itemsKey);
|
|
650
656
|
this.triggerOnChange(items, state);
|
|
651
657
|
}
|
|
652
658
|
else if (!hasFocused && tags.length) {
|
|
653
659
|
var removed = tags.pop();
|
|
654
|
-
utils_1.removeDataItems(items, removed.data, itemsKey);
|
|
660
|
+
(0, utils_1.removeDataItems)(items, removed.data, itemsKey);
|
|
655
661
|
this.triggerOnChange(items, state);
|
|
656
662
|
}
|
|
657
663
|
}
|
|
@@ -663,7 +669,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
663
669
|
};
|
|
664
670
|
MultiSelectWithoutContext.prototype.triggerOnChange = function (items, state) {
|
|
665
671
|
if (this.props.value === undefined) {
|
|
666
|
-
state.data.value = __spreadArray([], items);
|
|
672
|
+
state.data.value = __spreadArray([], items, true);
|
|
667
673
|
}
|
|
668
674
|
this._valueItemsDuringOnChange = [];
|
|
669
675
|
this.setItems(items, this._valueItemsDuringOnChange);
|
|
@@ -708,7 +714,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
708
714
|
}
|
|
709
715
|
else if (selected.length) {
|
|
710
716
|
var last_1 = selected[selected.length - 1];
|
|
711
|
-
focusedInd = data.findIndex(function (i) { return utils_1.areSame(i, last_1, dataItemKey); });
|
|
717
|
+
focusedInd = data.findIndex(function (i) { return (0, utils_1.areSame)(i, last_1, dataItemKey); });
|
|
712
718
|
if (data[focusedInd] !== undefined) {
|
|
713
719
|
return {
|
|
714
720
|
focusedIndex: focusedInd + skip,
|
|
@@ -753,7 +759,7 @@ exports.MultiSelectWithoutContext = MultiSelectWithoutContext;
|
|
|
753
759
|
*
|
|
754
760
|
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
755
761
|
*/
|
|
756
|
-
exports.MultiSelectPropsContext = kendo_react_common_1.createPropsContext();
|
|
762
|
+
exports.MultiSelectPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
757
763
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
758
764
|
/**
|
|
759
765
|
* Represents the [KendoReact MultiSelect component]({% slug overview_multiselect %}).
|
|
@@ -780,5 +786,5 @@ exports.MultiSelectPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
780
786
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
781
787
|
* ```
|
|
782
788
|
*/
|
|
783
|
-
exports.MultiSelect = kendo_react_common_1.withPropsContext(exports.MultiSelectPropsContext, MultiSelectWithoutContext);
|
|
789
|
+
exports.MultiSelect = (0, kendo_react_common_1.withPropsContext)(exports.MultiSelectPropsContext, MultiSelectWithoutContext);
|
|
784
790
|
exports.MultiSelect.displayName = 'KendoReactMultiSelect';
|
|
@@ -31,7 +31,7 @@ var TagList = /** @class */ (function (_super) {
|
|
|
31
31
|
var _a = this.props, data = _a.data, guid = _a.guid, focused = _a.focused, tagRender = _a.tagRender, TagComponent = _a.tag, onTagDelete = _a.onTagDelete, size = _a.size;
|
|
32
32
|
return (React.createElement(React.Fragment, null,
|
|
33
33
|
data.map(function (tagData, index) {
|
|
34
|
-
var tag = TagComponent ? (React.createElement(TagComponent, { key: tagData.text + index, tagData: tagData, guid: guid, focusedTag: focused, onTagDelete: onTagDelete })) : (React.createElement(kendo_react_buttons_1.Chip, { id: "tag-"
|
|
34
|
+
var tag = TagComponent ? (React.createElement(TagComponent, { key: tagData.text + index, tagData: tagData, guid: guid, focusedTag: focused, onTagDelete: onTagDelete })) : (React.createElement(kendo_react_buttons_1.Chip, { id: "tag-".concat(guid, "-").concat(tagData.text.replace(/\s+/g, '-')), "aria-selected": true, role: "option", "aria-setsize": data.length, key: tagData.text + index, text: tagData.text, removable: true, removeIcon: 'k-i-close', onRemove: function (e) { return onTagDelete.call(undefined, tagData.data, e.syntheticEvent); }, onMouseDown: preventDefault, onClick: stopPropagation, className: tagData === focused ? 'k-focus' : undefined, size: size }));
|
|
35
35
|
return tagRender ? tagRender(tagData, tag) : tag;
|
|
36
36
|
}),
|
|
37
37
|
this.props.children));
|
|
@@ -13,4 +13,4 @@ export declare const MultiSelectTreePropsContext: React.Context<(p: MultiSelectT
|
|
|
13
13
|
* Accepts properties of type [MultiSelectTreeProps]({% slug api_dropdowns_multiselecttreeprops %}).
|
|
14
14
|
* Obtaining the `ref` returns an object of type [MultiSelectTreeHandle]({% slug api_dropdowns_multiselecttreehandle %}).
|
|
15
15
|
*/
|
|
16
|
-
export declare const MultiSelectTree: React.ForwardRefExoticComponent<MultiSelectTreeProps & React.RefAttributes<MultiSelectTreeHandle>>;
|
|
16
|
+
export declare const MultiSelectTree: React.ForwardRefExoticComponent<MultiSelectTreeProps & React.RefAttributes<MultiSelectTreeHandle | null>>;
|
|
@@ -10,10 +10,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
14
|
-
for (var i = 0,
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
+
if (ar || !(i in from)) {
|
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
+
ar[i] = from[i];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
17
21
|
};
|
|
18
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
23
|
exports.MultiSelectTree = exports.MultiSelectTreePropsContext = void 0;
|
|
@@ -67,7 +71,7 @@ var defaultProps = {
|
|
|
67
71
|
*
|
|
68
72
|
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
69
73
|
*/
|
|
70
|
-
exports.MultiSelectTreePropsContext = kendo_react_common_1.createPropsContext();
|
|
74
|
+
exports.MultiSelectTreePropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
71
75
|
/**
|
|
72
76
|
* Represents the MultiSelectTree component.
|
|
73
77
|
*
|
|
@@ -76,12 +80,12 @@ exports.MultiSelectTreePropsContext = kendo_react_common_1.createPropsContext();
|
|
|
76
80
|
*/
|
|
77
81
|
exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
78
82
|
var _a, _b;
|
|
79
|
-
var props = kendo_react_common_1.usePropsContext(exports.MultiSelectTreePropsContext, directProps);
|
|
80
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
81
|
-
var componentGuid = React.useMemo(function () { return kendo_react_common_1.guid(); }, []);
|
|
83
|
+
var props = (0, kendo_react_common_1.usePropsContext)(exports.MultiSelectTreePropsContext, directProps);
|
|
84
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
85
|
+
var componentGuid = React.useMemo(function () { return (0, kendo_react_common_1.guid)(); }, []);
|
|
82
86
|
var id = props.id || componentGuid;
|
|
83
87
|
var _c = props.data, data = _c === void 0 ? [] : _c, dataItemKey = props.dataItemKey, _d = props.popupSettings, popupSettings = _d === void 0 ? {} : _d, _e = props.style, style = _e === void 0 ? {} : _e, opened = props.opened, disabled = props.disabled, _f = props.onOpen, onOpen = _f === void 0 ? kendo_react_common_1.noop : _f, _g = props.onClose, onClose = _g === void 0 ? kendo_react_common_1.noop : _g, placeholder = props.placeholder, label = props.label, name = props.name, _h = props.checkField, checkField = _h === void 0 ? defaultProps.checkField : _h, _j = props.checkIndeterminateField, checkIndeterminateField = _j === void 0 ? defaultProps.checkIndeterminateField : _j, _k = props.subItemsField, subItemsField = _k === void 0 ? defaultProps.subItemsField : _k, validationMessage = props.validationMessage, valid = props.valid, tags = props.tags, value = props.value, _l = props.required, required = _l === void 0 ? defaultProps.required : _l, _m = props.validityStyles, validityStyles = _m === void 0 ? defaultProps.validityStyles : _m;
|
|
84
|
-
var tabIndex = kendo_react_common_1.getTabIndex(props.tabIndex, disabled);
|
|
88
|
+
var tabIndex = (0, kendo_react_common_1.getTabIndex)(props.tabIndex, disabled);
|
|
85
89
|
var targetRef = React.useRef(null);
|
|
86
90
|
var elementRef = React.useRef(null);
|
|
87
91
|
var inputRef = React.useRef(null);
|
|
@@ -97,14 +101,14 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
97
101
|
var isOpen = opened !== undefined ? opened : openState;
|
|
98
102
|
var hasValue = Boolean(Array.isArray(value) && value.length);
|
|
99
103
|
var validity = getValidity({ validationMessage: validationMessage, valid: valid, required: required }, hasValue);
|
|
100
|
-
var dir = kendo_react_common_1.useRtl(elementRef, props.dir);
|
|
104
|
+
var dir = (0, kendo_react_common_1.useRtl)(elementRef, props.dir);
|
|
101
105
|
var initialStyleWidth = popupSettings.width !== undefined ?
|
|
102
106
|
popupSettings.width : (style.width !== undefined ? style.width : defaultProps.popupSettings.width);
|
|
103
|
-
var popupWidth = useDropdownWidth_1.useDropdownWidth(elementRef, initialStyleWidth);
|
|
107
|
+
var popupWidth = (0, useDropdownWidth_1.useDropdownWidth)(elementRef, initialStyleWidth);
|
|
104
108
|
var popupStyles = __assign({ width: popupWidth }, (dir !== undefined ? { direction: dir } : {}));
|
|
105
109
|
var focus = React.useCallback(function () { return elementRef.current && elementRef.current.focus(); }, []);
|
|
106
110
|
tagsToRenderRef.current = tags === undefined ?
|
|
107
|
-
(value || []).map(function (item) { return ({ text: utils_1.getItemValue(item, props.textField), data: [item] }); }) : __spreadArray([], tags);
|
|
111
|
+
(value || []).map(function (item) { return ({ text: (0, utils_1.getItemValue)(item, props.textField), data: [item] }); }) : __spreadArray([], tags, true);
|
|
108
112
|
React.useImperativeHandle(targetRef, function () { return ({
|
|
109
113
|
props: props,
|
|
110
114
|
element: elementRef.current,
|
|
@@ -131,7 +135,7 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
131
135
|
}
|
|
132
136
|
}, [props.onChange]);
|
|
133
137
|
var onChange = React.useCallback(function (event) {
|
|
134
|
-
if (utils_1.areSame(event.item, value, dataItemKey) || !targetRef.current) {
|
|
138
|
+
if ((0, utils_1.areSame)(event.item, value, dataItemKey) || !targetRef.current) {
|
|
135
139
|
return;
|
|
136
140
|
}
|
|
137
141
|
var item = event.item, nativeEvent = event.nativeEvent, syntheticEvent = event.syntheticEvent;
|
|
@@ -257,7 +261,7 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
257
261
|
keyCode === kendo_react_common_1.Keys.delete)) {
|
|
258
262
|
var tagsToRender = tagsToRenderRef.current;
|
|
259
263
|
var focusedIndex = focusedTagState ?
|
|
260
|
-
tagsToRender.findIndex(function (t) { return utils_1.matchTags(t, focusedTagState, dataItemKey); }) : -1;
|
|
264
|
+
tagsToRender.findIndex(function (t) { return (0, utils_1.matchTags)(t, focusedTagState, dataItemKey); }) : -1;
|
|
261
265
|
var newFocusedTag = undefined;
|
|
262
266
|
var hasFocused = focusedIndex !== -1;
|
|
263
267
|
if (keyCode === kendo_react_common_1.Keys.left) {
|
|
@@ -304,7 +308,7 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
304
308
|
keyCode === kendo_react_common_1.Keys.home || keyCode === kendo_react_common_1.Keys.end)) {
|
|
305
309
|
if (keyCode === kendo_react_common_1.Keys.up && inputRef.current) {
|
|
306
310
|
var items = Array.from(treeviewElement.querySelectorAll('.k-treeview-item'));
|
|
307
|
-
var focusedItem = __spreadArray([], items).reverse().find(function (i) { return Boolean(i && i.querySelector('.k-focus')); });
|
|
311
|
+
var focusedItem = __spreadArray([], items, true).reverse().find(function (i) { return Boolean(i && i.querySelector('.k-focus')); });
|
|
308
312
|
if (focusedItem && items.indexOf(focusedItem) === 0) {
|
|
309
313
|
return switchFocus(function () { focusElement(inputRef.current); });
|
|
310
314
|
}
|
|
@@ -385,30 +389,30 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
385
389
|
}
|
|
386
390
|
}, [props.onFilterChange, props.filter, props.textField]);
|
|
387
391
|
var NoData = props.listNoData || ListNoData_1.ListNoData;
|
|
388
|
-
var localization = kendo_react_intl_1.useLocalization();
|
|
392
|
+
var localization = (0, kendo_react_intl_1.useLocalization)();
|
|
389
393
|
var isValid = !validityStyles || validity.valid;
|
|
390
394
|
var size = props.size, rounded = props.rounded, fillMode = props.fillMode;
|
|
391
|
-
var multiselecttree = (React.createElement("span", { className: kendo_react_common_1.classNames('k-multiselect k-input', props.className, (_a = {},
|
|
392
|
-
_a["k-input-"
|
|
393
|
-
_a["k-rounded-"
|
|
394
|
-
_a["k-input-"
|
|
395
|
+
var multiselecttree = (React.createElement("span", { className: (0, kendo_react_common_1.classNames)('k-multiselect k-input', props.className, (_a = {},
|
|
396
|
+
_a["k-input-".concat(sizeMap[size] || size)] = size,
|
|
397
|
+
_a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded,
|
|
398
|
+
_a["k-input-".concat(fillMode)] = fillMode,
|
|
395
399
|
_a['k-focus'] = focusedState && !disabled,
|
|
396
400
|
_a['k-invalid'] = !isValid,
|
|
397
401
|
_a['k-disabled'] = disabled,
|
|
398
402
|
_a['k-loading'] = props.loading,
|
|
399
403
|
_a['k-required'] = required,
|
|
400
404
|
_a)), tabIndex: tabIndex, accessKey: props.accessKey, id: id, style: label ? __assign(__assign({}, style), { width: undefined }) : style, dir: dir, ref: elementRef, onKeyDown: disabled ? undefined : onWrapperKeyDown, onMouseDown: onWrapperMouseDown, onFocus: onFocus, onBlur: onBlur, role: "listbox", "aria-haspopup": "true", "aria-expanded": isOpen, "aria-disabled": disabled, "aria-label": label, "aria-labelledby": props.ariaLabelledBy, "aria-describedby": props.ariaDescribedBy, onClick: disabled ? undefined : onWrapperClick },
|
|
401
|
-
tagsToRenderRef.current.length > 0 && (React.createElement("div", { className: kendo_react_common_1.classNames('k-input-values k-chip-list k-selection-multiple', (_b = {},
|
|
402
|
-
_b["k-chip-list-"
|
|
405
|
+
tagsToRenderRef.current.length > 0 && (React.createElement("div", { className: (0, kendo_react_common_1.classNames)('k-input-values k-chip-list k-selection-multiple', (_b = {},
|
|
406
|
+
_b["k-chip-list-".concat(sizeMap[size] || size)] = size,
|
|
403
407
|
_b)), role: "listbox", id: 'tagslist-' + id },
|
|
404
|
-
React.createElement(TagList_1.default, { tag: props.tag, onTagDelete: onTagDelete, data: tagsToRenderRef.current, guid: id, focused: focusedTagState ? tagsToRenderRef.current.find(function (t) { return utils_1.matchTags(t, focusedTagState, dataItemKey); }) : undefined, size: size }))),
|
|
408
|
+
React.createElement(TagList_1.default, { tag: props.tag, onTagDelete: onTagDelete, data: tagsToRenderRef.current, guid: id, focused: focusedTagState ? tagsToRenderRef.current.find(function (t) { return (0, utils_1.matchTags)(t, focusedTagState, dataItemKey); }) : undefined, size: size }))),
|
|
405
409
|
!hasValue && React.createElement("span", { className: "k-input-inner" },
|
|
406
410
|
React.createElement("span", { className: "k-input-value-text" }, "\u00A0")),
|
|
407
411
|
props.loading && React.createElement("span", { className: "k-icon k-i-loading k-input-loading-icon" }),
|
|
408
412
|
hasValue && !disabled && React.createElement(ClearButton_1.default, { onClick: onClear }),
|
|
409
413
|
React.createElement("select", { name: name, ref: selectRef, tabIndex: -1, "aria-hidden": true, title: label, style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: 'absolute', left: '50%' } },
|
|
410
414
|
React.createElement("option", { value: props.valueMap ? props.valueMap.call(undefined, value) : value })),
|
|
411
|
-
React.createElement(kendo_react_popup_1.Popup, { popupClass: popupSettings.popupClass, className: kendo_react_common_1.classNames(popupSettings.className, { 'k-rtl': dir === 'rtl' }), style: popupStyles, animate: popupSettings.animate, anchor: elementRef.current, show: isOpen, onOpen: onPopupOpened, onClose: onPopupClosed, appendTo: popupSettings.appendTo, ref: popupRef },
|
|
415
|
+
React.createElement(kendo_react_popup_1.Popup, { popupClass: popupSettings.popupClass, className: (0, kendo_react_common_1.classNames)(popupSettings.className, { 'k-rtl': dir === 'rtl' }), style: popupStyles, animate: popupSettings.animate, anchor: elementRef.current, show: isOpen, onOpen: onPopupOpened, onClose: onPopupClosed, appendTo: popupSettings.appendTo, ref: popupRef },
|
|
412
416
|
props.filterable && (React.createElement(ListFilter_1.default, { value: props.filter === undefined ? filterState : props.filter, inputRef: inputRef, onChange: onFilterChange, onKeyDown: onInputKeyDown, tabIndex: tabIndex, size: size, rounded: rounded, fillMode: fillMode })),
|
|
413
417
|
data.length > 0 ? (React.createElement(kendo_react_treeview_1.TreeView, { ref: treeViewRef, tabIndex: tabIndex, data: data, focusIdField: dataItemKey, textField: props.textField, checkField: checkField, checkIndeterminateField: checkIndeterminateField, expandField: props.expandField, childrenField: subItemsField, expandIcons: true, onItemClick: onChange, onCheckChange: onChange, onExpandChange: onExpand, checkboxes: true, size: size, item: props.item })) : (React.createElement(NoData, null, localization.toLanguageString(messages_1.nodata, messages_1.messages[messages_1.nodata]))))));
|
|
414
418
|
return label ? (React.createElement(kendo_react_labels_1.FloatingLabel, { label: label, editorValue: hasValue, editorPlaceholder: placeholder, editorValid: isValid, editorDisabled: disabled, editorId: id, style: { width: style ? style.width : undefined }, children: multiselecttree, dir: dir })) : multiselecttree;
|
|
@@ -9,7 +9,7 @@ export declare const getValueMap: (value: any, idGetter: any) => {};
|
|
|
9
9
|
* @returns {any[]}
|
|
10
10
|
*/
|
|
11
11
|
export declare const getMultiSelectTreeValue: (data: any, options: {
|
|
12
|
-
subItemsField?: string;
|
|
12
|
+
subItemsField?: string | undefined;
|
|
13
13
|
dataItemKey: string;
|
|
14
14
|
items: any;
|
|
15
15
|
value: Array<any>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
3
|
-
for (var i = 0,
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
6
10
|
};
|
|
7
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
12
|
exports.getMultiSelectTreeValue = exports.getValueMap = void 0;
|
|
@@ -27,20 +31,20 @@ exports.getValueMap = getValueMap;
|
|
|
27
31
|
*/
|
|
28
32
|
var getMultiSelectTreeValue = function (data, options) {
|
|
29
33
|
var items = options.items, dataItemKey = options.dataItemKey, value = options.value, _a = options.subItemsField, subItemsField = _a === void 0 ? 'items' : _a, operation = options.operation;
|
|
30
|
-
var idGetter = kendo_react_common_1.getter(dataItemKey);
|
|
31
|
-
var valueMap = exports.getValueMap(value, idGetter);
|
|
34
|
+
var idGetter = (0, kendo_react_common_1.getter)(dataItemKey);
|
|
35
|
+
var valueMap = (0, exports.getValueMap)(value, idGetter);
|
|
32
36
|
if (operation === 'clear') {
|
|
33
37
|
return [];
|
|
34
38
|
}
|
|
35
39
|
else if (operation === 'delete') {
|
|
36
|
-
var deletedItemsMap_1 = exports.getValueMap(items, idGetter);
|
|
40
|
+
var deletedItemsMap_1 = (0, exports.getValueMap)(items, idGetter);
|
|
37
41
|
return value.filter(function (item) { return !deletedItemsMap_1[idGetter(item)]; });
|
|
38
42
|
}
|
|
39
43
|
// operation === 'toggle'
|
|
40
44
|
var selectedItem = items[0];
|
|
41
45
|
var selectedId = idGetter(selectedItem);
|
|
42
|
-
var subItemGetter = kendo_react_common_1.getter(subItemsField);
|
|
43
|
-
var stack = __spreadArray([], data);
|
|
46
|
+
var subItemGetter = (0, kendo_react_common_1.getter)(subItemsField);
|
|
47
|
+
var stack = __spreadArray([], data, true);
|
|
44
48
|
var context = [];
|
|
45
49
|
var parents;
|
|
46
50
|
var foundItem;
|
|
@@ -64,7 +68,7 @@ var getMultiSelectTreeValue = function (data, options) {
|
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
70
|
}
|
|
67
|
-
var childrenStack = __spreadArray([], (subItemGetter(foundItem) || []));
|
|
71
|
+
var childrenStack = __spreadArray([], (subItemGetter(foundItem) || []), true);
|
|
68
72
|
var children = [];
|
|
69
73
|
while (childrenStack.length) {
|
|
70
74
|
var currentItem = childrenStack.pop();
|
|
@@ -81,7 +85,7 @@ var getMultiSelectTreeValue = function (data, options) {
|
|
|
81
85
|
newValue.push(foundItem);
|
|
82
86
|
newValue.push.apply(newValue, children.filter(function (item) { return !valueMap[idGetter(item)]; }));
|
|
83
87
|
var parentCandidates = parents.filter(function (item) { return !valueMap[idGetter(item)]; });
|
|
84
|
-
var newValueMap_1 = exports.getValueMap(newValue, idGetter);
|
|
88
|
+
var newValueMap_1 = (0, exports.getValueMap)(newValue, idGetter);
|
|
85
89
|
for (var i = parentCandidates.length - 1; i > -1; i--) {
|
|
86
90
|
var candidate = parentCandidates[i];
|
|
87
91
|
var subItems = subItemGetter(candidate);
|
|
@@ -97,8 +101,8 @@ var getMultiSelectTreeValue = function (data, options) {
|
|
|
97
101
|
}
|
|
98
102
|
else {
|
|
99
103
|
var foundId_1 = idGetter(foundItem);
|
|
100
|
-
var childrenMap_1 = exports.getValueMap(children, idGetter);
|
|
101
|
-
var parentsMap_1 = exports.getValueMap(parents, idGetter);
|
|
104
|
+
var childrenMap_1 = (0, exports.getValueMap)(children, idGetter);
|
|
105
|
+
var parentsMap_1 = (0, exports.getValueMap)(parents, idGetter);
|
|
102
106
|
newValue.push.apply(newValue, (value
|
|
103
107
|
.filter(function (item) {
|
|
104
108
|
var itemId = idGetter(item);
|
|
@@ -29,11 +29,11 @@ var ClearButton = /** @class */ (function (_super) {
|
|
|
29
29
|
return _this;
|
|
30
30
|
}
|
|
31
31
|
ClearButton.prototype.render = function () {
|
|
32
|
-
var title = kendo_react_intl_1.provideLocalizationService(this).toLanguageString(messages_1.clear, messages_1.messages[messages_1.clear]);
|
|
32
|
+
var title = (0, kendo_react_intl_1.provideLocalizationService)(this).toLanguageString(messages_1.clear, messages_1.messages[messages_1.clear]);
|
|
33
33
|
return (React.createElement("span", { className: "k-clear-value", role: "button", onClick: this.props.onClick, onMouseDown: this.onMouseDown, tabIndex: -1, title: title, key: "clearbutton" },
|
|
34
34
|
React.createElement("span", { className: "k-icon k-i-x" })));
|
|
35
35
|
};
|
|
36
36
|
return ClearButton;
|
|
37
37
|
}(React.Component));
|
|
38
38
|
exports.default = ClearButton;
|
|
39
|
-
kendo_react_intl_1.registerForLocalization(ClearButton);
|
|
39
|
+
(0, kendo_react_intl_1.registerForLocalization)(ClearButton);
|
|
@@ -158,6 +158,6 @@ export default class DropDownBase {
|
|
|
158
158
|
triggerOnPageChange(state: InternalState, skip: number, take: number): void;
|
|
159
159
|
triggerPageChangeCornerItems(item: any, state: InternalState): void;
|
|
160
160
|
scrollToVirtualItem: (virtual: VirtualizationSettings, selectedItemIndex: number) => void;
|
|
161
|
-
renderScrollElement: () => JSX.Element;
|
|
161
|
+
renderScrollElement: () => false | JSX.Element;
|
|
162
162
|
getPopupSettings(): DropDownsPopupSettings;
|
|
163
163
|
}
|
|
@@ -23,6 +23,8 @@ var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
|
23
23
|
var DropDownBase = /** @class */ (function () {
|
|
24
24
|
function DropDownBase(component) {
|
|
25
25
|
var _this = this;
|
|
26
|
+
this.wrapper = null;
|
|
27
|
+
this.list = null;
|
|
26
28
|
this.vs = new VirtualScroll_1.default();
|
|
27
29
|
this.navigation = new Navigation_1.Navigation();
|
|
28
30
|
this.handleItemClick = function (index, event) {
|
|
@@ -103,8 +105,8 @@ var DropDownBase = /** @class */ (function () {
|
|
|
103
105
|
var vs = _this.vs;
|
|
104
106
|
return vs.enabled && (React.createElement("div", { ref: function (element) { return vs.scrollElement = element; }, key: 'scrollElementKey' }));
|
|
105
107
|
};
|
|
106
|
-
this.listBoxId = kendo_react_common_1.guid();
|
|
107
|
-
this.guid = kendo_react_common_1.guid();
|
|
108
|
+
this.listBoxId = (0, kendo_react_common_1.guid)();
|
|
109
|
+
this.guid = (0, kendo_react_common_1.guid)();
|
|
108
110
|
this.component = component;
|
|
109
111
|
this.vs.PageChange = this.pageChange;
|
|
110
112
|
}
|
|
@@ -142,7 +144,7 @@ var DropDownBase = /** @class */ (function () {
|
|
|
142
144
|
var vs = this.vs;
|
|
143
145
|
var scrollElement = (vs.container || list.parentNode);
|
|
144
146
|
var virtualScroll = vsEnabled !== undefined ? vsEnabled : vs.enabled;
|
|
145
|
-
utils_1.scrollToItem(scrollElement, list, itemIndex, vs.translate, virtualScroll);
|
|
147
|
+
(0, utils_1.scrollToItem)(scrollElement, list, itemIndex, vs.translate, virtualScroll);
|
|
146
148
|
}
|
|
147
149
|
};
|
|
148
150
|
DropDownBase.prototype.initState = function () {
|
|
@@ -190,11 +192,11 @@ var DropDownBase = /** @class */ (function () {
|
|
|
190
192
|
var _a = props.data, data = _a === void 0 ? [] : _a, dataItemKey = props.dataItemKey, virtual = props.virtual;
|
|
191
193
|
var opened = props.opened !== undefined ? props.opened : this.component.state.opened;
|
|
192
194
|
if (item && virtual && this.vs.enabled) {
|
|
193
|
-
if (virtual.skip > 0 && utils_1.areSame(item, data[0], dataItemKey)) {
|
|
195
|
+
if (virtual.skip > 0 && (0, utils_1.areSame)(item, data[0], dataItemKey)) {
|
|
194
196
|
this.triggerOnPageChange(state, virtual.skip - 1, virtual.pageSize);
|
|
195
197
|
}
|
|
196
198
|
else if (!opened && virtual.skip + virtual.pageSize < virtual.total &&
|
|
197
|
-
utils_1.areSame(item, data[data.length - 1], dataItemKey)) {
|
|
199
|
+
(0, utils_1.areSame)(item, data[data.length - 1], dataItemKey)) {
|
|
198
200
|
this.triggerOnPageChange(state, virtual.skip + 1, virtual.pageSize);
|
|
199
201
|
}
|
|
200
202
|
}
|
|
@@ -36,6 +36,6 @@ export interface ListProps {
|
|
|
36
36
|
*/
|
|
37
37
|
export default class List extends React.Component<ListProps> {
|
|
38
38
|
renderItems(): JSX.Element[];
|
|
39
|
-
renderNoValueElement(localizationService: LocalizationService):
|
|
40
|
-
render():
|
|
39
|
+
renderNoValueElement(localizationService: LocalizationService): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
40
|
+
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
41
41
|
}
|
package/dist/npm/common/List.js
CHANGED
|
@@ -35,18 +35,18 @@ var List = /** @class */ (function (_super) {
|
|
|
35
35
|
return data.map(function (item, index) {
|
|
36
36
|
var realIndex = skip + index;
|
|
37
37
|
var selected = highlightSelected &&
|
|
38
|
-
((!isArray && utils_1.areSame(item, value, valueField)) ||
|
|
39
|
-
(isArray && value.findIndex(function (i) { return utils_1.areSame(i, item, valueField); }) !== -1));
|
|
38
|
+
((!isArray && (0, utils_1.areSame)(item, value, valueField)) ||
|
|
39
|
+
(isArray && value.findIndex(function (i) { return (0, utils_1.areSame)(i, item, valueField); }) !== -1));
|
|
40
40
|
var group = undefined;
|
|
41
41
|
var current, previous;
|
|
42
42
|
if (index > 0 && groupField !== undefined) {
|
|
43
|
-
current = utils_1.getItemValue(item, groupField);
|
|
44
|
-
previous = utils_1.getItemValue(data[index - 1], groupField);
|
|
43
|
+
current = (0, utils_1.getItemValue)(item, groupField);
|
|
44
|
+
previous = (0, utils_1.getItemValue)(data[index - 1], groupField);
|
|
45
45
|
if (current && previous && current !== previous) {
|
|
46
46
|
group = current;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
return (React.createElement(ListItem_1.default, { id: "option-"
|
|
49
|
+
return (React.createElement(ListItem_1.default, { id: "option-".concat(optionsGuid, "-").concat(realIndex), virtual: virtual, dataItem: item, selected: selected, focused: focusedIndex === index, index: realIndex, key: realIndex, onClick: _this.props.onClick, textField: textField, group: group, render: itemRender }));
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
52
|
List.prototype.renderNoValueElement = function (localizationService) {
|
|
@@ -57,7 +57,7 @@ var List = /** @class */ (function (_super) {
|
|
|
57
57
|
noDataRender.call(undefined, noDataElement) : noDataElement;
|
|
58
58
|
};
|
|
59
59
|
List.prototype.render = function () {
|
|
60
|
-
var localizationService = kendo_react_intl_1.provideLocalizationService(this);
|
|
60
|
+
var localizationService = (0, kendo_react_intl_1.provideLocalizationService)(this);
|
|
61
61
|
var _a = this.props, id = _a.id, show = _a.show, wrapperCssClass = _a.wrapperCssClass, wrapperStyle = _a.wrapperStyle, listStyle = _a.listStyle, listRef = _a.listRef, wrapperRef = _a.wrapperRef, _b = _a.listClassName, listClassName = _b === void 0 ? 'k-list-ul' : _b;
|
|
62
62
|
var items = this.renderItems();
|
|
63
63
|
return (items.length ? (React.createElement("div", { className: wrapperCssClass, style: wrapperStyle, ref: wrapperRef, onMouseDown: this.props.onMouseDown, onBlur: this.props.onBlur, onScroll: this.props.onScroll, unselectable: "on" },
|
|
@@ -67,4 +67,4 @@ var List = /** @class */ (function (_super) {
|
|
|
67
67
|
return List;
|
|
68
68
|
}(React.Component));
|
|
69
69
|
exports.default = List;
|
|
70
|
-
kendo_react_intl_1.registerForLocalization(List);
|
|
70
|
+
(0, kendo_react_intl_1.registerForLocalization)(List);
|