@progress/kendo-react-dropdowns 5.4.0-dev.202205200719 → 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 +16 -14
- package/dist/es/AutoComplete/AutoComplete.js +19 -15
- package/dist/es/AutoComplete/AutoCompleteProps.js +1 -0
- package/dist/es/ComboBox/ComboBox.d.ts +14 -14
- package/dist/es/ComboBox/ComboBox.js +26 -22
- package/dist/es/ComboBox/ComboBoxProps.js +1 -0
- package/dist/es/DropDownList/DropDownList.d.ts +12 -14
- package/dist/es/DropDownList/DropDownList.js +22 -18
- package/dist/es/DropDownList/DropDownListProps.js +1 -0
- package/dist/es/DropDownTree/DropDownTree.d.ts +1 -1
- package/dist/es/DropDownTree/DropDownTree.js +22 -10
- package/dist/es/DropDownTree/DropDownTreeProps.js +1 -0
- package/dist/es/MultiColumnComboBox/MultiColumnComboBox.d.ts +2 -2
- package/dist/es/MultiColumnComboBox/MultiColumnComboBox.js +10 -8
- package/dist/es/MultiSelect/MultiSelect.d.ts +14 -16
- package/dist/es/MultiSelect/MultiSelect.js +36 -23
- package/dist/es/MultiSelect/MultiSelectProps.js +1 -0
- package/dist/es/MultiSelect/TagList.d.ts +1 -0
- package/dist/es/MultiSelect/TagList.js +4 -2
- package/dist/es/MultiSelectTree/MultiSelectTree.d.ts +1 -1
- package/dist/es/MultiSelectTree/MultiSelectTree.js +21 -9
- package/dist/es/MultiSelectTree/MultiSelectTreeProps.js +1 -0
- package/dist/es/MultiSelectTree/utils.d.ts +2 -2
- package/dist/es/MultiSelectTree/utils.js +11 -2
- package/dist/es/common/ClearButton.js +3 -1
- package/dist/es/common/DropDownBase.d.ts +6 -6
- package/dist/es/common/DropDownBase.js +5 -3
- package/dist/es/common/List.d.ts +2 -2
- package/dist/es/common/List.js +4 -2
- package/dist/es/common/ListContainer.d.ts +1 -0
- package/dist/es/common/ListContainer.js +3 -1
- package/dist/es/common/ListDefaultItem.js +3 -1
- package/dist/es/common/ListFilter.js +10 -6
- package/dist/es/common/ListItem.d.ts +1 -1
- package/dist/es/common/ListItem.js +3 -1
- package/dist/es/common/Navigation.d.ts +1 -1
- package/dist/es/common/SearchBar.d.ts +2 -2
- package/dist/es/common/SearchBar.js +7 -3
- package/dist/es/common/VirtualScroll.d.ts +3 -3
- package/dist/es/common/VirtualScroll.js +6 -2
- package/dist/es/common/events.js +1 -0
- package/dist/es/common/filterDescriptor.js +1 -0
- package/dist/es/common/settings.d.ts +1 -1
- package/dist/es/common/utils.d.ts +6 -6
- package/dist/es/main.js +2 -0
- package/dist/es/messages/index.d.ts +2 -2
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/AutoComplete/AutoComplete.d.ts +16 -14
- package/dist/npm/AutoComplete/AutoComplete.js +35 -30
- package/dist/npm/ComboBox/ComboBox.d.ts +14 -14
- package/dist/npm/ComboBox/ComboBox.js +61 -56
- package/dist/npm/DropDownList/DropDownList.d.ts +12 -14
- package/dist/npm/DropDownList/DropDownList.js +49 -44
- package/dist/npm/DropDownTree/DropDownTree.d.ts +1 -1
- package/dist/npm/DropDownTree/DropDownTree.js +39 -26
- package/dist/npm/DropDownTree/ListNoData.js +3 -1
- package/dist/npm/DropDownTree/useDropdownWidth.js +1 -0
- package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.d.ts +2 -2
- package/dist/npm/MultiColumnComboBox/MultiColumnComboBox.js +18 -15
- package/dist/npm/MultiSelect/MultiSelect.d.ts +14 -16
- package/dist/npm/MultiSelect/MultiSelect.js +57 -43
- package/dist/npm/MultiSelect/TagList.d.ts +1 -0
- package/dist/npm/MultiSelect/TagList.js +4 -2
- package/dist/npm/MultiSelectTree/MultiSelectTree.d.ts +1 -1
- package/dist/npm/MultiSelectTree/MultiSelectTree.js +36 -23
- package/dist/npm/MultiSelectTree/utils.d.ts +2 -2
- package/dist/npm/MultiSelectTree/utils.js +23 -11
- package/dist/npm/common/ClearButton.js +5 -3
- package/dist/npm/common/DropDownBase.d.ts +6 -6
- package/dist/npm/common/DropDownBase.js +10 -8
- package/dist/npm/common/List.d.ts +2 -2
- package/dist/npm/common/List.js +10 -8
- package/dist/npm/common/ListContainer.d.ts +1 -0
- package/dist/npm/common/ListContainer.js +3 -1
- package/dist/npm/common/ListDefaultItem.js +5 -3
- package/dist/npm/common/ListFilter.js +11 -7
- package/dist/npm/common/ListItem.d.ts +1 -1
- package/dist/npm/common/ListItem.js +5 -3
- package/dist/npm/common/MultiColumnList.js +3 -1
- package/dist/npm/common/Navigation.d.ts +1 -1
- package/dist/npm/common/Navigation.js +2 -1
- package/dist/npm/common/SearchBar.d.ts +2 -2
- package/dist/npm/common/SearchBar.js +7 -3
- package/dist/npm/common/VirtualScroll.d.ts +3 -3
- package/dist/npm/common/VirtualScroll.js +6 -2
- package/dist/npm/common/settings.d.ts +1 -1
- package/dist/npm/common/settings.js +1 -0
- package/dist/npm/common/utils.d.ts +6 -6
- package/dist/npm/common/utils.js +1 -0
- package/dist/npm/main.js +32 -18
- package/dist/npm/messages/index.d.ts +2 -2
- package/dist/npm/messages/index.js +2 -1
- package/dist/npm/package-metadata.js +2 -1
- package/dist/systemjs/kendo-react-dropdowns.js +1 -1
- package/package.json +13 -13
|
@@ -33,10 +33,10 @@ export declare class MultiSelectWithoutContext extends React.Component<MultiSele
|
|
|
33
33
|
defaultValue: PropTypes.Requireable<any[]>;
|
|
34
34
|
dataItemKey: PropTypes.Requireable<string>;
|
|
35
35
|
placeholder: PropTypes.Requireable<string>;
|
|
36
|
-
tags: PropTypes.Requireable<PropTypes.InferProps<{
|
|
36
|
+
tags: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
37
37
|
text: PropTypes.Requireable<string>;
|
|
38
38
|
data: PropTypes.Requireable<any[]>;
|
|
39
|
-
}>[]>;
|
|
39
|
+
}> | null)[]>;
|
|
40
40
|
tagRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
41
41
|
id: PropTypes.Requireable<string>;
|
|
42
42
|
ariaLabelledBy: PropTypes.Requireable<string>;
|
|
@@ -67,14 +67,12 @@ export declare class MultiSelectWithoutContext extends React.Component<MultiSele
|
|
|
67
67
|
}>>;
|
|
68
68
|
popupClass: PropTypes.Requireable<string>;
|
|
69
69
|
className: PropTypes.Requireable<string>;
|
|
70
|
-
appendTo: PropTypes.Requireable<
|
|
70
|
+
appendTo: PropTypes.Requireable<Element>;
|
|
71
71
|
width: PropTypes.Requireable<string | number>;
|
|
72
72
|
height: PropTypes.Requireable<string | number>;
|
|
73
73
|
}>>;
|
|
74
74
|
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
75
|
-
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
76
|
-
* @hidden
|
|
77
|
-
*/
|
|
75
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
78
76
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
79
77
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
80
78
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -90,9 +88,9 @@ export declare class MultiSelectWithoutContext extends React.Component<MultiSele
|
|
|
90
88
|
static defaultProps: {
|
|
91
89
|
autoClose: boolean;
|
|
92
90
|
required: boolean;
|
|
93
|
-
size: "small" | "medium" | "large";
|
|
94
|
-
rounded: "small" | "medium" | "
|
|
95
|
-
fillMode: "
|
|
91
|
+
size: "small" | "medium" | "large" | null | undefined;
|
|
92
|
+
rounded: "small" | "medium" | "full" | "large" | null | undefined;
|
|
93
|
+
fillMode: "flat" | "outline" | "solid" | null | undefined;
|
|
96
94
|
popupSettings: {
|
|
97
95
|
height: string;
|
|
98
96
|
};
|
|
@@ -118,24 +116,24 @@ export declare class MultiSelectWithoutContext extends React.Component<MultiSele
|
|
|
118
116
|
/**
|
|
119
117
|
* @hidden
|
|
120
118
|
*/
|
|
121
|
-
|
|
119
|
+
get element(): HTMLSpanElement | null;
|
|
122
120
|
/**
|
|
123
121
|
* Represents the value of the MultiSelect.
|
|
124
122
|
*/
|
|
125
|
-
|
|
123
|
+
get value(): Array<any>;
|
|
126
124
|
/**
|
|
127
125
|
* Gets the `name` property of the MultiSelect.
|
|
128
126
|
*/
|
|
129
|
-
|
|
127
|
+
get name(): string | undefined;
|
|
130
128
|
/**
|
|
131
129
|
* Represents the validity state into which the MultiSelect is set.
|
|
132
130
|
*/
|
|
133
|
-
|
|
131
|
+
get validity(): FormComponentValidity;
|
|
134
132
|
/**
|
|
135
133
|
* @hidden
|
|
136
134
|
*/
|
|
137
|
-
protected
|
|
138
|
-
protected
|
|
135
|
+
protected get required(): boolean;
|
|
136
|
+
protected get validityStyles(): boolean;
|
|
139
137
|
/**
|
|
140
138
|
* @hidden
|
|
141
139
|
*/
|
|
@@ -151,7 +149,7 @@ export declare class MultiSelectWithoutContext extends React.Component<MultiSele
|
|
|
151
149
|
/**
|
|
152
150
|
* @hidden
|
|
153
151
|
*/
|
|
154
|
-
onTagDelete: (itemsToRemove: any
|
|
152
|
+
onTagDelete: (itemsToRemove: Array<any>, event: React.MouseEvent<HTMLSpanElement>) => void;
|
|
155
153
|
/**
|
|
156
154
|
* @hidden
|
|
157
155
|
*/
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -23,7 +25,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
23
25
|
};
|
|
24
26
|
return __assign.apply(this, arguments);
|
|
25
27
|
};
|
|
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));
|
|
36
|
+
};
|
|
26
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.MultiSelect = exports.MultiSelectPropsContext = exports.MultiSelectWithoutContext = void 0;
|
|
27
39
|
var React = require("react");
|
|
28
40
|
var PropTypes = require("prop-types");
|
|
29
41
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -59,10 +71,12 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
59
71
|
_this.state = {
|
|
60
72
|
activedescendant: settings_1.ActiveDescendant.PopupList
|
|
61
73
|
};
|
|
74
|
+
_this._element = null;
|
|
62
75
|
_this._valueItemsDuringOnChange = null;
|
|
63
|
-
_this._inputId = kendo_react_common_1.guid();
|
|
76
|
+
_this._inputId = (0, kendo_react_common_1.guid)();
|
|
64
77
|
_this.base = new DropDownBase_1.default(_this);
|
|
65
78
|
_this._tags = [];
|
|
79
|
+
_this._input = null;
|
|
66
80
|
_this._skipFocusEvent = false;
|
|
67
81
|
_this.scrollToFocused = false;
|
|
68
82
|
/**
|
|
@@ -80,14 +94,14 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
80
94
|
var _a = _this.props, _b = _a.data, data = _b === void 0 ? [] : _b, dataItemKey = _a.dataItemKey, virtual = _a.virtual;
|
|
81
95
|
var skip = virtual ? virtual.skip : 0;
|
|
82
96
|
var dataItem = data[index - skip];
|
|
83
|
-
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); });
|
|
84
98
|
var newItems = [];
|
|
85
99
|
if (indexInValue !== -1) { // item is already selected
|
|
86
100
|
newItems = _this.value;
|
|
87
101
|
newItems.splice(indexInValue, 1);
|
|
88
102
|
}
|
|
89
103
|
else {
|
|
90
|
-
newItems = _this.value
|
|
104
|
+
newItems = __spreadArray(__spreadArray([], _this.value, true), [dataItem], false);
|
|
91
105
|
}
|
|
92
106
|
var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;
|
|
93
107
|
if (text) {
|
|
@@ -117,7 +131,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
117
131
|
_this.focus();
|
|
118
132
|
}
|
|
119
133
|
var selected = _this.value;
|
|
120
|
-
utils_1.removeDataItems(selected, itemsToRemove, _this.props.dataItemKey);
|
|
134
|
+
(0, utils_1.removeDataItems)(selected, itemsToRemove, _this.props.dataItemKey);
|
|
121
135
|
_this.triggerOnChange(selected, state);
|
|
122
136
|
_this.applyState(state);
|
|
123
137
|
};
|
|
@@ -184,7 +198,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
184
198
|
_this.base.togglePopup(state);
|
|
185
199
|
}
|
|
186
200
|
var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;
|
|
187
|
-
if (utils_1.isPresent(text) && text !== '') {
|
|
201
|
+
if ((0, utils_1.isPresent)(text) && text !== '') {
|
|
188
202
|
_this.base.filterChanged('', state);
|
|
189
203
|
}
|
|
190
204
|
if (_this.state.text) {
|
|
@@ -247,8 +261,8 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
247
261
|
dir: dir !== undefined ? dir : base.dirCalculated,
|
|
248
262
|
width: popupWidth,
|
|
249
263
|
popupSettings: {
|
|
250
|
-
popupClass: kendo_react_common_1.classNames(popupSettings.popupClass, 'k-list', (_a = {},
|
|
251
|
-
_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,
|
|
252
266
|
_a['k-virtual-list'] = _this.base.vs.enabled,
|
|
253
267
|
_a)),
|
|
254
268
|
className: popupSettings.className,
|
|
@@ -262,10 +276,10 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
262
276
|
itemsCount: [data.length, _this.value.length]
|
|
263
277
|
};
|
|
264
278
|
var focusedType = _this.getFocusedState().focusedType;
|
|
265
|
-
var customItem = allowCustom && text && (React.createElement("div", { className: kendo_react_common_1.classNames('k-list', (_b = {},
|
|
266
|
-
_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,
|
|
267
281
|
_b)), key: "customitem", onClick: _this.customItemSelect, onMouseDown: preventDefault },
|
|
268
|
-
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' } },
|
|
269
283
|
text,
|
|
270
284
|
React.createElement("span", { className: "k-icon k-i-plus", style: { position: 'absolute', right: '0.5em' } }))));
|
|
271
285
|
return (React.createElement(ListContainer_1.default, __assign({}, listContainerProps),
|
|
@@ -281,7 +295,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
281
295
|
var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;
|
|
282
296
|
var focusedIndex = _this.getFocusedState().focusedIndex;
|
|
283
297
|
var popupSettings = _this.base.getPopupSettings();
|
|
284
|
-
var translate = "translateY("
|
|
298
|
+
var translate = "translateY(".concat(vs.translate, "px)");
|
|
285
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) {
|
|
286
300
|
vs.scrollHandler(e);
|
|
287
301
|
}, wrapperRef: vs.scrollerRef, scroller: _this.base.renderScrollElement() }));
|
|
@@ -301,7 +315,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
301
315
|
}
|
|
302
316
|
state.data.focusedIndex = undefined;
|
|
303
317
|
_this.base.filterChanged('', state);
|
|
304
|
-
var newItems = _this.value
|
|
318
|
+
var newItems = __spreadArray(__spreadArray([], _this.value, true), [item], false);
|
|
305
319
|
_this.triggerOnChange(newItems, state);
|
|
306
320
|
_this.base.togglePopup(state);
|
|
307
321
|
_this.applyState(state);
|
|
@@ -377,7 +391,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
377
391
|
: _this.props.validationMessage || VALIDATION_MESSAGE);
|
|
378
392
|
}
|
|
379
393
|
};
|
|
380
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
394
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
381
395
|
return _this;
|
|
382
396
|
}
|
|
383
397
|
Object.defineProperty(MultiSelectWithoutContext.prototype, "element", {
|
|
@@ -387,7 +401,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
387
401
|
get: function () {
|
|
388
402
|
return this._element;
|
|
389
403
|
},
|
|
390
|
-
enumerable:
|
|
404
|
+
enumerable: false,
|
|
391
405
|
configurable: true
|
|
392
406
|
});
|
|
393
407
|
Object.defineProperty(MultiSelectWithoutContext.prototype, "value", {
|
|
@@ -410,7 +424,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
410
424
|
}
|
|
411
425
|
return result;
|
|
412
426
|
},
|
|
413
|
-
enumerable:
|
|
427
|
+
enumerable: false,
|
|
414
428
|
configurable: true
|
|
415
429
|
});
|
|
416
430
|
Object.defineProperty(MultiSelectWithoutContext.prototype, "name", {
|
|
@@ -420,7 +434,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
420
434
|
get: function () {
|
|
421
435
|
return this.props.name;
|
|
422
436
|
},
|
|
423
|
-
enumerable:
|
|
437
|
+
enumerable: false,
|
|
424
438
|
configurable: true
|
|
425
439
|
});
|
|
426
440
|
Object.defineProperty(MultiSelectWithoutContext.prototype, "validity", {
|
|
@@ -438,7 +452,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
438
452
|
valueMissing: this.value === null
|
|
439
453
|
};
|
|
440
454
|
},
|
|
441
|
-
enumerable:
|
|
455
|
+
enumerable: false,
|
|
442
456
|
configurable: true
|
|
443
457
|
});
|
|
444
458
|
Object.defineProperty(MultiSelectWithoutContext.prototype, "required", {
|
|
@@ -450,7 +464,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
450
464
|
? this.props.required
|
|
451
465
|
: MultiSelectWithoutContext.defaultProps.required;
|
|
452
466
|
},
|
|
453
|
-
enumerable:
|
|
467
|
+
enumerable: false,
|
|
454
468
|
configurable: true
|
|
455
469
|
});
|
|
456
470
|
Object.defineProperty(MultiSelectWithoutContext.prototype, "validityStyles", {
|
|
@@ -459,7 +473,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
459
473
|
? this.props.validityStyles
|
|
460
474
|
: MultiSelectWithoutContext.defaultProps.validityStyles;
|
|
461
475
|
},
|
|
462
|
-
enumerable:
|
|
476
|
+
enumerable: false,
|
|
463
477
|
configurable: true
|
|
464
478
|
});
|
|
465
479
|
/**
|
|
@@ -552,7 +566,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
552
566
|
var tagsToRender = [];
|
|
553
567
|
if (tags === undefined) {
|
|
554
568
|
this.value.forEach(function (item) {
|
|
555
|
-
tagsToRender.push({ text: utils_1.getItemValue(item, textField), data: [item] });
|
|
569
|
+
tagsToRender.push({ text: (0, utils_1.getItemValue)(item, textField), data: [item] });
|
|
556
570
|
});
|
|
557
571
|
}
|
|
558
572
|
else {
|
|
@@ -561,10 +575,10 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
561
575
|
this.setItems(tagsToRender, this._tags);
|
|
562
576
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
563
577
|
var clearButton = Boolean(filter !== undefined ? filter : text) || this.value.length > 0;
|
|
564
|
-
var component = (React.createElement("div", { ref: this.componentRef, className: kendo_react_common_1.classNames('k-multiselect k-input', className, (_a = {},
|
|
565
|
-
_a["k-input-"
|
|
566
|
-
_a["k-rounded-"
|
|
567
|
-
_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,
|
|
568
582
|
_a['k-focus'] = focused && !disabled,
|
|
569
583
|
_a['k-invalid'] = !isValid,
|
|
570
584
|
_a['k-disabled'] = disabled,
|
|
@@ -572,16 +586,16 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
572
586
|
_a['k-required'] = this.required,
|
|
573
587
|
_a)), style: !label
|
|
574
588
|
? style
|
|
575
|
-
: __assign({}, style, { width: undefined }), dir: dir, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.handleWrapperClick, onMouseDown: utils_1.preventDefaultNonInputs },
|
|
576
|
-
React.createElement("div", { className: kendo_react_common_1.classNames('k-input-values k-chip-list k-selection-multiple', (_b = {},
|
|
577
|
-
_b["k-chip-list-"
|
|
589
|
+
: __assign(__assign({}, style), { width: undefined }), dir: dir, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.handleWrapperClick, onMouseDown: utils_1.preventDefaultNonInputs },
|
|
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,
|
|
578
592
|
_b)), role: "listbox", id: 'tagslist-' + this.base.guid },
|
|
579
|
-
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 }),
|
|
580
594
|
this.renderSearchbar(id)),
|
|
581
595
|
loading && React.createElement("span", { className: "k-icon k-i-loading k-input-loading-icon" }),
|
|
582
596
|
clearButton && React.createElement(ClearButton_1.default, { onClick: this.clearButtonClick }),
|
|
583
597
|
this.renderListContainer()));
|
|
584
|
-
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;
|
|
585
599
|
};
|
|
586
600
|
MultiSelectWithoutContext.prototype.renderSearchbar = function (id) {
|
|
587
601
|
var _a = this.state, activedescendant = _a.activedescendant, focusedTag = _a.focusedTag;
|
|
@@ -591,9 +605,9 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
591
605
|
var focusedIndex = this.getFocusedState().focusedIndex;
|
|
592
606
|
var placeholderToShow = this.value.length === 0 && !text ? placeholder : undefined;
|
|
593
607
|
var ariaActivedescendant = activedescendant === settings_1.ActiveDescendant.TagsList && focusedTag !== undefined ?
|
|
594
|
-
"tag-"
|
|
595
|
-
"option-"
|
|
596
|
-
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 }));
|
|
597
611
|
};
|
|
598
612
|
MultiSelectWithoutContext.prototype.onTagsNavigate = function (event, state) {
|
|
599
613
|
var keyCode = event.keyCode;
|
|
@@ -601,7 +615,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
601
615
|
var tags = this._tags;
|
|
602
616
|
var itemsKey = this.props.dataItemKey;
|
|
603
617
|
var focusedIndex = focusedTag ?
|
|
604
|
-
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;
|
|
605
619
|
var newFocusedTag = undefined;
|
|
606
620
|
var hasFocused = focusedIndex !== -1;
|
|
607
621
|
if (keyCode === kendo_react_common_1.Keys.left) {
|
|
@@ -631,19 +645,19 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
631
645
|
else if (keyCode === kendo_react_common_1.Keys.delete) {
|
|
632
646
|
if (hasFocused) {
|
|
633
647
|
var items = this.value;
|
|
634
|
-
utils_1.removeDataItems(items, tags[focusedIndex].data, itemsKey);
|
|
648
|
+
(0, utils_1.removeDataItems)(items, tags[focusedIndex].data, itemsKey);
|
|
635
649
|
this.triggerOnChange(items, state);
|
|
636
650
|
}
|
|
637
651
|
}
|
|
638
652
|
else if (keyCode === kendo_react_common_1.Keys.backspace) {
|
|
639
653
|
var items = this.value;
|
|
640
654
|
if (hasFocused) {
|
|
641
|
-
utils_1.removeDataItems(items, tags[focusedIndex].data, itemsKey);
|
|
655
|
+
(0, utils_1.removeDataItems)(items, tags[focusedIndex].data, itemsKey);
|
|
642
656
|
this.triggerOnChange(items, state);
|
|
643
657
|
}
|
|
644
658
|
else if (!hasFocused && tags.length) {
|
|
645
659
|
var removed = tags.pop();
|
|
646
|
-
utils_1.removeDataItems(items, removed.data, itemsKey);
|
|
660
|
+
(0, utils_1.removeDataItems)(items, removed.data, itemsKey);
|
|
647
661
|
this.triggerOnChange(items, state);
|
|
648
662
|
}
|
|
649
663
|
}
|
|
@@ -655,7 +669,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
655
669
|
};
|
|
656
670
|
MultiSelectWithoutContext.prototype.triggerOnChange = function (items, state) {
|
|
657
671
|
if (this.props.value === undefined) {
|
|
658
|
-
state.data.value = items
|
|
672
|
+
state.data.value = __spreadArray([], items, true);
|
|
659
673
|
}
|
|
660
674
|
this._valueItemsDuringOnChange = [];
|
|
661
675
|
this.setItems(items, this._valueItemsDuringOnChange);
|
|
@@ -700,7 +714,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
700
714
|
}
|
|
701
715
|
else if (selected.length) {
|
|
702
716
|
var last_1 = selected[selected.length - 1];
|
|
703
|
-
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); });
|
|
704
718
|
if (data[focusedInd] !== undefined) {
|
|
705
719
|
return {
|
|
706
720
|
focusedIndex: focusedInd + skip,
|
|
@@ -728,14 +742,14 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
728
742
|
/**
|
|
729
743
|
* @hidden
|
|
730
744
|
*/
|
|
731
|
-
MultiSelectWithoutContext.propTypes = __assign({}, DropDownBase_1.default.propTypes, { autoClose: PropTypes.bool, value: PropTypes.arrayOf(PropTypes.any), defaultValue: PropTypes.arrayOf(PropTypes.any), dataItemKey: PropTypes.string, placeholder: PropTypes.string, tags: PropTypes.arrayOf(PropTypes.shape({
|
|
745
|
+
MultiSelectWithoutContext.propTypes = __assign(__assign({}, DropDownBase_1.default.propTypes), { autoClose: PropTypes.bool, value: PropTypes.arrayOf(PropTypes.any), defaultValue: PropTypes.arrayOf(PropTypes.any), dataItemKey: PropTypes.string, placeholder: PropTypes.string, tags: PropTypes.arrayOf(PropTypes.shape({
|
|
732
746
|
text: PropTypes.string,
|
|
733
747
|
data: PropTypes.arrayOf(PropTypes.any)
|
|
734
748
|
})), tagRender: PropTypes.func, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string });
|
|
735
749
|
/**
|
|
736
750
|
* @hidden
|
|
737
751
|
*/
|
|
738
|
-
MultiSelectWithoutContext.defaultProps = __assign({}, DropDownBase_1.default.defaultProps, { autoClose: true, required: false, size: 'medium', rounded: 'medium', fillMode: 'solid' });
|
|
752
|
+
MultiSelectWithoutContext.defaultProps = __assign(__assign({}, DropDownBase_1.default.defaultProps), { autoClose: true, required: false, size: 'medium', rounded: 'medium', fillMode: 'solid' });
|
|
739
753
|
return MultiSelectWithoutContext;
|
|
740
754
|
}(React.Component));
|
|
741
755
|
exports.MultiSelectWithoutContext = MultiSelectWithoutContext;
|
|
@@ -745,7 +759,7 @@ exports.MultiSelectWithoutContext = MultiSelectWithoutContext;
|
|
|
745
759
|
*
|
|
746
760
|
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
747
761
|
*/
|
|
748
|
-
exports.MultiSelectPropsContext = kendo_react_common_1.createPropsContext();
|
|
762
|
+
exports.MultiSelectPropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
749
763
|
/* eslint-disable @typescript-eslint/no-redeclare -- intentionally naming the component the same as the type */
|
|
750
764
|
/**
|
|
751
765
|
* Represents the [KendoReact MultiSelect component]({% slug overview_multiselect %}).
|
|
@@ -772,5 +786,5 @@ exports.MultiSelectPropsContext = kendo_react_common_1.createPropsContext();
|
|
|
772
786
|
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
773
787
|
* ```
|
|
774
788
|
*/
|
|
775
|
-
exports.MultiSelect = kendo_react_common_1.withPropsContext(exports.MultiSelectPropsContext, MultiSelectWithoutContext);
|
|
789
|
+
exports.MultiSelect = (0, kendo_react_common_1.withPropsContext)(exports.MultiSelectPropsContext, MultiSelectWithoutContext);
|
|
776
790
|
exports.MultiSelect.displayName = 'KendoReactMultiSelect';
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -29,7 +31,7 @@ var TagList = /** @class */ (function (_super) {
|
|
|
29
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;
|
|
30
32
|
return (React.createElement(React.Fragment, null,
|
|
31
33
|
data.map(function (tagData, index) {
|
|
32
|
-
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 }));
|
|
33
35
|
return tagRender ? tagRender(tagData, tag) : tag;
|
|
34
36
|
}),
|
|
35
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,7 +10,17 @@ 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, 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));
|
|
21
|
+
};
|
|
13
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.MultiSelectTree = exports.MultiSelectTreePropsContext = void 0;
|
|
14
24
|
var React = require("react");
|
|
15
25
|
var PropTypes = require("prop-types");
|
|
16
26
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
@@ -61,7 +71,7 @@ var defaultProps = {
|
|
|
61
71
|
*
|
|
62
72
|
* For more information, refer to the [Dropdowns Props Context]({% slug props-context_dropdowns %}) article.
|
|
63
73
|
*/
|
|
64
|
-
exports.MultiSelectTreePropsContext = kendo_react_common_1.createPropsContext();
|
|
74
|
+
exports.MultiSelectTreePropsContext = (0, kendo_react_common_1.createPropsContext)();
|
|
65
75
|
/**
|
|
66
76
|
* Represents the MultiSelectTree component.
|
|
67
77
|
*
|
|
@@ -70,12 +80,12 @@ exports.MultiSelectTreePropsContext = kendo_react_common_1.createPropsContext();
|
|
|
70
80
|
*/
|
|
71
81
|
exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
72
82
|
var _a, _b;
|
|
73
|
-
var props = kendo_react_common_1.usePropsContext(exports.MultiSelectTreePropsContext, directProps);
|
|
74
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
75
|
-
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)(); }, []);
|
|
76
86
|
var id = props.id || componentGuid;
|
|
77
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;
|
|
78
|
-
var tabIndex = kendo_react_common_1.getTabIndex(props.tabIndex, disabled);
|
|
88
|
+
var tabIndex = (0, kendo_react_common_1.getTabIndex)(props.tabIndex, disabled);
|
|
79
89
|
var targetRef = React.useRef(null);
|
|
80
90
|
var elementRef = React.useRef(null);
|
|
81
91
|
var inputRef = React.useRef(null);
|
|
@@ -91,14 +101,14 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
91
101
|
var isOpen = opened !== undefined ? opened : openState;
|
|
92
102
|
var hasValue = Boolean(Array.isArray(value) && value.length);
|
|
93
103
|
var validity = getValidity({ validationMessage: validationMessage, valid: valid, required: required }, hasValue);
|
|
94
|
-
var dir = kendo_react_common_1.useRtl(elementRef, props.dir);
|
|
104
|
+
var dir = (0, kendo_react_common_1.useRtl)(elementRef, props.dir);
|
|
95
105
|
var initialStyleWidth = popupSettings.width !== undefined ?
|
|
96
106
|
popupSettings.width : (style.width !== undefined ? style.width : defaultProps.popupSettings.width);
|
|
97
|
-
var popupWidth = useDropdownWidth_1.useDropdownWidth(elementRef, initialStyleWidth);
|
|
107
|
+
var popupWidth = (0, useDropdownWidth_1.useDropdownWidth)(elementRef, initialStyleWidth);
|
|
98
108
|
var popupStyles = __assign({ width: popupWidth }, (dir !== undefined ? { direction: dir } : {}));
|
|
99
109
|
var focus = React.useCallback(function () { return elementRef.current && elementRef.current.focus(); }, []);
|
|
100
110
|
tagsToRenderRef.current = tags === undefined ?
|
|
101
|
-
(value || []).map(function (item) { return ({ text: utils_1.getItemValue(item, props.textField), data: [item] }); }) : tags
|
|
111
|
+
(value || []).map(function (item) { return ({ text: (0, utils_1.getItemValue)(item, props.textField), data: [item] }); }) : __spreadArray([], tags, true);
|
|
102
112
|
React.useImperativeHandle(targetRef, function () { return ({
|
|
103
113
|
props: props,
|
|
104
114
|
element: elementRef.current,
|
|
@@ -125,7 +135,7 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
125
135
|
}
|
|
126
136
|
}, [props.onChange]);
|
|
127
137
|
var onChange = React.useCallback(function (event) {
|
|
128
|
-
if (utils_1.areSame(event.item, value, dataItemKey) || !targetRef.current) {
|
|
138
|
+
if ((0, utils_1.areSame)(event.item, value, dataItemKey) || !targetRef.current) {
|
|
129
139
|
return;
|
|
130
140
|
}
|
|
131
141
|
var item = event.item, nativeEvent = event.nativeEvent, syntheticEvent = event.syntheticEvent;
|
|
@@ -251,7 +261,7 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
251
261
|
keyCode === kendo_react_common_1.Keys.delete)) {
|
|
252
262
|
var tagsToRender = tagsToRenderRef.current;
|
|
253
263
|
var focusedIndex = focusedTagState ?
|
|
254
|
-
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;
|
|
255
265
|
var newFocusedTag = undefined;
|
|
256
266
|
var hasFocused = focusedIndex !== -1;
|
|
257
267
|
if (keyCode === kendo_react_common_1.Keys.left) {
|
|
@@ -298,7 +308,7 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
298
308
|
keyCode === kendo_react_common_1.Keys.home || keyCode === kendo_react_common_1.Keys.end)) {
|
|
299
309
|
if (keyCode === kendo_react_common_1.Keys.up && inputRef.current) {
|
|
300
310
|
var items = Array.from(treeviewElement.querySelectorAll('.k-treeview-item'));
|
|
301
|
-
var focusedItem = items
|
|
311
|
+
var focusedItem = __spreadArray([], items, true).reverse().find(function (i) { return Boolean(i && i.querySelector('.k-focus')); });
|
|
302
312
|
if (focusedItem && items.indexOf(focusedItem) === 0) {
|
|
303
313
|
return switchFocus(function () { focusElement(inputRef.current); });
|
|
304
314
|
}
|
|
@@ -355,7 +365,10 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
355
365
|
var item = event.item, itemHierarchicalIndex = event.itemHierarchicalIndex, nativeEvent = event.nativeEvent, syntheticEvent = event.syntheticEvent;
|
|
356
366
|
var expandEvent = {
|
|
357
367
|
level: toLevel(itemHierarchicalIndex),
|
|
358
|
-
item: item,
|
|
368
|
+
item: item,
|
|
369
|
+
nativeEvent: nativeEvent,
|
|
370
|
+
syntheticEvent: syntheticEvent,
|
|
371
|
+
target: targetRef.current
|
|
359
372
|
};
|
|
360
373
|
props.onExpandChange.call(undefined, expandEvent);
|
|
361
374
|
}
|
|
@@ -376,30 +389,30 @@ exports.MultiSelectTree = React.forwardRef(function (directProps, ref) {
|
|
|
376
389
|
}
|
|
377
390
|
}, [props.onFilterChange, props.filter, props.textField]);
|
|
378
391
|
var NoData = props.listNoData || ListNoData_1.ListNoData;
|
|
379
|
-
var localization = kendo_react_intl_1.useLocalization();
|
|
392
|
+
var localization = (0, kendo_react_intl_1.useLocalization)();
|
|
380
393
|
var isValid = !validityStyles || validity.valid;
|
|
381
394
|
var size = props.size, rounded = props.rounded, fillMode = props.fillMode;
|
|
382
|
-
var multiselecttree = (React.createElement("span", { className: kendo_react_common_1.classNames('k-multiselect k-input', props.className, (_a = {},
|
|
383
|
-
_a["k-input-"
|
|
384
|
-
_a["k-rounded-"
|
|
385
|
-
_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,
|
|
386
399
|
_a['k-focus'] = focusedState && !disabled,
|
|
387
400
|
_a['k-invalid'] = !isValid,
|
|
388
401
|
_a['k-disabled'] = disabled,
|
|
389
402
|
_a['k-loading'] = props.loading,
|
|
390
403
|
_a['k-required'] = required,
|
|
391
|
-
_a)), tabIndex: tabIndex, accessKey: props.accessKey, id: id, style: label ? __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 },
|
|
392
|
-
tagsToRenderRef.current.length > 0 && (React.createElement("div", { className: kendo_react_common_1.classNames('k-input-values k-chip-list k-selection-multiple', (_b = {},
|
|
393
|
-
_b["k-chip-list-"
|
|
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 },
|
|
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,
|
|
394
407
|
_b)), role: "listbox", id: 'tagslist-' + id },
|
|
395
|
-
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 }))),
|
|
396
409
|
!hasValue && React.createElement("span", { className: "k-input-inner" },
|
|
397
410
|
React.createElement("span", { className: "k-input-value-text" }, "\u00A0")),
|
|
398
411
|
props.loading && React.createElement("span", { className: "k-icon k-i-loading k-input-loading-icon" }),
|
|
399
412
|
hasValue && !disabled && React.createElement(ClearButton_1.default, { onClick: onClear }),
|
|
400
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%' } },
|
|
401
414
|
React.createElement("option", { value: props.valueMap ? props.valueMap.call(undefined, value) : value })),
|
|
402
|
-
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 },
|
|
403
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 })),
|
|
404
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]))))));
|
|
405
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;
|
|
@@ -445,7 +458,7 @@ var propTypes = {
|
|
|
445
458
|
})]),
|
|
446
459
|
popupClass: PropTypes.string,
|
|
447
460
|
className: PropTypes.string,
|
|
448
|
-
appendTo: PropTypes.
|
|
461
|
+
appendTo: PropTypes.instanceOf(Element),
|
|
449
462
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
450
463
|
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
451
464
|
}),
|
|
@@ -9,9 +9,9 @@ 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
|
-
value: any
|
|
15
|
+
value: Array<any>;
|
|
16
16
|
operation: MultiSelectTreeChangeEventOperation;
|
|
17
17
|
}) => any[];
|