@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
|
@@ -2,10 +2,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
2
2
|
var extendStatics = function (d, b) {
|
|
3
3
|
extendStatics = Object.setPrototypeOf ||
|
|
4
4
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
6
|
return extendStatics(d, b);
|
|
7
7
|
};
|
|
8
8
|
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
9
11
|
extendStatics(d, b);
|
|
10
12
|
function __() { this.constructor = d; }
|
|
11
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -47,8 +49,10 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
47
49
|
* @hidden
|
|
48
50
|
*/
|
|
49
51
|
_this.state = {};
|
|
52
|
+
_this._element = null;
|
|
50
53
|
_this.base = new DropDownBase(_this);
|
|
51
54
|
_this.searchState = { word: '', last: '' };
|
|
55
|
+
_this._select = null;
|
|
52
56
|
_this._skipFocusEvent = false;
|
|
53
57
|
_this._filterInput = null;
|
|
54
58
|
_this._navigated = false;
|
|
@@ -95,7 +99,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
95
99
|
width: popupWidth,
|
|
96
100
|
popupSettings: {
|
|
97
101
|
popupClass: classNames(popupSettings.popupClass, 'k-list', (_a = {},
|
|
98
|
-
_a["k-list-"
|
|
102
|
+
_a["k-list-".concat(sizeMap[size] || size)] = size,
|
|
99
103
|
_a['k-virtual-list'] = _this.base.vs.enabled,
|
|
100
104
|
_a)),
|
|
101
105
|
className: popupSettings.className,
|
|
@@ -121,7 +125,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
121
125
|
var skip = virtual.skip;
|
|
122
126
|
var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;
|
|
123
127
|
var popupSettings = _this.base.getPopupSettings();
|
|
124
|
-
var translate = "translateY("
|
|
128
|
+
var translate = "translateY(".concat(vs.translate, "px)");
|
|
125
129
|
return (React.createElement(List, { id: _this.base.listBoxId, show: opened, data: data.slice(), focusedIndex: _this.focusedIndex(), value: _this.value, textField: textField, valueField: dataItemKey, optionsGuid: _this.base.guid, listRef: function (list) { return vs.list = _this.base.list = list; }, wrapperStyle: { maxHeight: popupSettings.height }, wrapperCssClass: "k-list-content", listStyle: vs.enabled ? { transform: translate } : undefined, key: "listkey", skip: skip, onClick: _this.handleItemClick, itemRender: itemRender, noDataRender: listNoDataRender, onScroll: function (e) {
|
|
126
130
|
vs.scrollHandler(e);
|
|
127
131
|
}, wrapperRef: vs.scrollerRef, scroller: _this.base.renderScrollElement() }));
|
|
@@ -332,7 +336,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
332
336
|
get: function () {
|
|
333
337
|
return this._element;
|
|
334
338
|
},
|
|
335
|
-
enumerable:
|
|
339
|
+
enumerable: false,
|
|
336
340
|
configurable: true
|
|
337
341
|
});
|
|
338
342
|
Object.defineProperty(DropDownListWithoutContext.prototype, "value", {
|
|
@@ -358,7 +362,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
358
362
|
}
|
|
359
363
|
return value;
|
|
360
364
|
},
|
|
361
|
-
enumerable:
|
|
365
|
+
enumerable: false,
|
|
362
366
|
configurable: true
|
|
363
367
|
});
|
|
364
368
|
Object.defineProperty(DropDownListWithoutContext.prototype, "index", {
|
|
@@ -371,7 +375,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
371
375
|
// TO DO: deprecate it!
|
|
372
376
|
return data.findIndex(function (i) { return areSame(i, value, dataItemKey); });
|
|
373
377
|
},
|
|
374
|
-
enumerable:
|
|
378
|
+
enumerable: false,
|
|
375
379
|
configurable: true
|
|
376
380
|
});
|
|
377
381
|
Object.defineProperty(DropDownListWithoutContext.prototype, "name", {
|
|
@@ -381,7 +385,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
381
385
|
get: function () {
|
|
382
386
|
return this.props.name;
|
|
383
387
|
},
|
|
384
|
-
enumerable:
|
|
388
|
+
enumerable: false,
|
|
385
389
|
configurable: true
|
|
386
390
|
});
|
|
387
391
|
Object.defineProperty(DropDownListWithoutContext.prototype, "validity", {
|
|
@@ -399,7 +403,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
399
403
|
valueMissing: this.value === null
|
|
400
404
|
};
|
|
401
405
|
},
|
|
402
|
-
enumerable:
|
|
406
|
+
enumerable: false,
|
|
403
407
|
configurable: true
|
|
404
408
|
});
|
|
405
409
|
Object.defineProperty(DropDownListWithoutContext.prototype, "validityStyles", {
|
|
@@ -408,7 +412,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
408
412
|
? this.props.validityStyles
|
|
409
413
|
: DropDownListWithoutContext.defaultProps.validityStyles;
|
|
410
414
|
},
|
|
411
|
-
enumerable:
|
|
415
|
+
enumerable: false,
|
|
412
416
|
configurable: true
|
|
413
417
|
});
|
|
414
418
|
Object.defineProperty(DropDownListWithoutContext.prototype, "required", {
|
|
@@ -420,7 +424,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
420
424
|
? this.props.required
|
|
421
425
|
: DropDownListWithoutContext.defaultProps.required;
|
|
422
426
|
},
|
|
423
|
-
enumerable:
|
|
427
|
+
enumerable: false,
|
|
424
428
|
configurable: true
|
|
425
429
|
});
|
|
426
430
|
/**
|
|
@@ -504,9 +508,9 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
504
508
|
var valueElement = valueRender !== undefined ?
|
|
505
509
|
valueRender.call(undefined, valueDefaultRendering, value) : valueDefaultRendering;
|
|
506
510
|
var dropdownlist = (React.createElement("span", { ref: this.componentRef, className: classNames('k-dropdownlist k-picker', className, (_a = {},
|
|
507
|
-
_a["k-picker-"
|
|
508
|
-
_a["k-rounded-"
|
|
509
|
-
_a["k-picker-"
|
|
511
|
+
_a["k-picker-".concat(sizeMap[size] || size)] = size,
|
|
512
|
+
_a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded,
|
|
513
|
+
_a["k-picker-".concat(fillMode)] = fillMode,
|
|
510
514
|
_a['k-focus'] = focused,
|
|
511
515
|
_a['k-disabled'] = disabled,
|
|
512
516
|
_a['k-invalid'] = !isValid,
|
|
@@ -514,13 +518,13 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
514
518
|
_a['k-required'] = this.required,
|
|
515
519
|
_a)), style: !label
|
|
516
520
|
? style
|
|
517
|
-
: __assign({}, style, { width: undefined }), dir: dir, onMouseDown: opened ? preventDefaultNonInputs : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, tabIndex: getTabIndex(tabIndex, disabled), accessKey: this.props.accessKey, onKeyDown: this.handleKeyDown, onKeyPress: this.handleKeyPress, onClick: disabled ? undefined : this.handleWrapperClick, role: 'listbox', "aria-disabled": disabled || undefined, "aria-haspopup": true, "aria-expanded": opened || false, "aria-owns": this.base.listBoxId, "aria-activedescendant": opened ? ('option-' + this.base.guid + '-' + (selectedIndex + (virtual ? virtual.skip : 0))) : undefined, "aria-label": this.props.ariaLabel || this.props.label, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, id: this.props.id, title: this.props.title },
|
|
521
|
+
: __assign(__assign({}, style), { width: undefined }), dir: dir, onMouseDown: opened ? preventDefaultNonInputs : undefined, onFocus: this.handleFocus, onBlur: this.handleBlur, tabIndex: getTabIndex(tabIndex, disabled), accessKey: this.props.accessKey, onKeyDown: this.handleKeyDown, onKeyPress: this.handleKeyPress, onClick: disabled ? undefined : this.handleWrapperClick, role: 'listbox', "aria-required": this.required, "aria-disabled": disabled || undefined, "aria-haspopup": true, "aria-expanded": opened || false, "aria-owns": this.base.listBoxId, "aria-activedescendant": opened ? ('option-' + this.base.guid + '-' + (selectedIndex + (virtual ? virtual.skip : 0))) : undefined, "aria-label": this.props.ariaLabel || this.props.label, "aria-labelledby": this.props.ariaLabelledBy, "aria-describedby": this.props.ariaDescribedBy, id: this.props.id, title: this.props.title },
|
|
518
522
|
valueElement,
|
|
519
523
|
loading && React.createElement("span", { className: "k-icon k-i-loading k-input-loading-icon", key: "loading" }),
|
|
520
524
|
React.createElement("button", { tabIndex: -1, type: "button", "aria-hidden": true, className: classNames('k-input-button k-button k-icon-button', (_b = {},
|
|
521
|
-
_b["k-button-"
|
|
522
|
-
_b["k-button-"
|
|
523
|
-
_b["k-button-"
|
|
525
|
+
_b["k-button-".concat(sizeMap[size] || size)] = size,
|
|
526
|
+
_b["k-button-".concat(fillMode)] = fillMode,
|
|
527
|
+
_b["k-button-".concat(fillMode, "-base")] = fillMode,
|
|
524
528
|
_b)), onMouseDown: function (e) { return e.preventDefault(); } },
|
|
525
529
|
React.createElement("span", { className: classNames('k-button-icon k-icon k-i-arrow-s', iconClassName) })),
|
|
526
530
|
this.dummySelect(value),
|
|
@@ -588,7 +592,7 @@ var DropDownListWithoutContext = /** @class */ (function (_super) {
|
|
|
588
592
|
/**
|
|
589
593
|
* @hidden
|
|
590
594
|
*/
|
|
591
|
-
DropDownListWithoutContext.defaultProps = __assign({ delay: 500, tabIndex: 0, ignoreCase: true }, DropDownBase.defaultProps, { required: false, size: 'medium', rounded: 'medium', fillMode: 'solid' });
|
|
595
|
+
DropDownListWithoutContext.defaultProps = __assign(__assign({ delay: 500, tabIndex: 0, ignoreCase: true }, DropDownBase.defaultProps), { required: false, size: 'medium', rounded: 'medium', fillMode: 'solid' });
|
|
592
596
|
return DropDownListWithoutContext;
|
|
593
597
|
}(React.Component));
|
|
594
598
|
export { DropDownListWithoutContext };
|
|
@@ -13,4 +13,4 @@ export declare const DropDownTreePropsContext: React.Context<(p: DropDownTreePro
|
|
|
13
13
|
* Accepts properties of type [DropDownTreeProps]({% slug api_dropdowns_dropdowntreeprops %}).
|
|
14
14
|
* Obtaining the `ref` returns an object of type [DropDownTreeHandle]({% slug api_dropdowns_dropdowntreehandle %}).
|
|
15
15
|
*/
|
|
16
|
-
export declare const DropDownTree: React.ForwardRefExoticComponent<DropDownTreeProps & React.RefAttributes<DropDownTreeHandle>>;
|
|
16
|
+
export declare const DropDownTree: React.ForwardRefExoticComponent<DropDownTreeProps & React.RefAttributes<DropDownTreeHandle | null>>;
|
|
@@ -9,6 +9,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
12
21
|
import * as React from 'react';
|
|
13
22
|
import * as PropTypes from 'prop-types';
|
|
14
23
|
import { classNames, noop, useRtl, getTabIndex, Keys, mapTree, extendDataItem, guid, createPropsContext, kendoThemeMaps, usePropsContext } from '@progress/kendo-react-common';
|
|
@@ -170,7 +179,7 @@ export var DropDownTree = React.forwardRef(function (directProps, ref) {
|
|
|
170
179
|
keyCode === Keys.home || keyCode === Keys.end)) {
|
|
171
180
|
if (keyCode === Keys.up && inputRef.current) {
|
|
172
181
|
var items = Array.from(treeview.querySelectorAll('.k-treeview-item'));
|
|
173
|
-
var focusedItem = items
|
|
182
|
+
var focusedItem = __spreadArray([], items, true).reverse().find(function (i) { return Boolean(i && i.querySelector('.k-focus')); });
|
|
174
183
|
if (focusedItem && items.indexOf(focusedItem) === 0) {
|
|
175
184
|
return switchFocus(function () { focusElement(inputRef.current); });
|
|
176
185
|
}
|
|
@@ -297,7 +306,10 @@ export var DropDownTree = React.forwardRef(function (directProps, ref) {
|
|
|
297
306
|
var item = event.item, itemHierarchicalIndex = event.itemHierarchicalIndex, nativeEvent = event.nativeEvent, syntheticEvent = event.syntheticEvent;
|
|
298
307
|
var expandEvent = {
|
|
299
308
|
level: toLevel(itemHierarchicalIndex),
|
|
300
|
-
item: item,
|
|
309
|
+
item: item,
|
|
310
|
+
nativeEvent: nativeEvent,
|
|
311
|
+
syntheticEvent: syntheticEvent,
|
|
312
|
+
target: target.current
|
|
301
313
|
};
|
|
302
314
|
props.onExpandChange.call(undefined, expandEvent);
|
|
303
315
|
}
|
|
@@ -330,24 +342,24 @@ export var DropDownTree = React.forwardRef(function (directProps, ref) {
|
|
|
330
342
|
var isValid = !validityStyles || validity.valid;
|
|
331
343
|
var size = props.size, rounded = props.rounded, fillMode = props.fillMode;
|
|
332
344
|
var dropdowntree = (React.createElement("span", { className: classNames('k-dropdowntree k-picker', props.className, (_a = {},
|
|
333
|
-
_a["k-picker-"
|
|
334
|
-
_a["k-rounded-"
|
|
335
|
-
_a["k-picker-"
|
|
345
|
+
_a["k-picker-".concat(sizeMap[size] || size)] = size,
|
|
346
|
+
_a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded,
|
|
347
|
+
_a["k-picker-".concat(fillMode)] = fillMode,
|
|
336
348
|
_a['k-focus'] = focused,
|
|
337
349
|
_a['k-invalid'] = !isValid,
|
|
338
350
|
_a['k-loading'] = props.loading,
|
|
339
351
|
_a['k-required'] = required,
|
|
340
352
|
_a['k-disabled'] = props.disabled,
|
|
341
|
-
_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, onClick: disabled ? undefined : onWrapperClick, 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 },
|
|
353
|
+
_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, onClick: disabled ? undefined : onWrapperClick, 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 },
|
|
342
354
|
React.createElement("span", { className: "k-input-inner" },
|
|
343
355
|
React.createElement(ValueComponent, { item: value }, currentValueText || placeholder)),
|
|
344
356
|
props.loading && React.createElement("span", { className: "k-icon k-i-loading k-input-loading-icon" }),
|
|
345
357
|
hasValue && !disabled && (React.createElement("span", { onClick: onClear, className: "k-clear-value", title: localization.toLanguageString(clear, messages[clear]), role: "button", tabIndex: -1, onMouseDown: function (e) { return e.preventDefault(); } },
|
|
346
358
|
React.createElement("span", { className: "k-icon k-i-x" }))),
|
|
347
359
|
React.createElement("button", { tabIndex: -1, type: "button", "aria-label": "select", className: classNames('k-input-button k-button k-icon-button', (_b = {},
|
|
348
|
-
_b["k-button-"
|
|
349
|
-
_b["k-button-"
|
|
350
|
-
_b["k-button-"
|
|
360
|
+
_b["k-button-".concat(sizeMap[size] || size)] = size,
|
|
361
|
+
_b["k-button-".concat(fillMode)] = fillMode,
|
|
362
|
+
_b["k-button-".concat(fillMode, "-base")] = fillMode,
|
|
351
363
|
_b)) },
|
|
352
364
|
React.createElement("span", { className: "k-button-icon k-icon k-i-arrow-s" })),
|
|
353
365
|
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%' } },
|
|
@@ -393,7 +405,7 @@ var propTypes = {
|
|
|
393
405
|
})]),
|
|
394
406
|
popupClass: PropTypes.string,
|
|
395
407
|
className: PropTypes.string,
|
|
396
|
-
appendTo: PropTypes.
|
|
408
|
+
appendTo: PropTypes.instanceOf(Element),
|
|
397
409
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
398
410
|
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
399
411
|
}),
|
|
@@ -143,7 +143,7 @@ export interface MultiColumnComboBoxProps extends ComboBoxProps {
|
|
|
143
143
|
* @hidden
|
|
144
144
|
*/
|
|
145
145
|
onGroupScroll?: (event: {
|
|
146
|
-
group
|
|
146
|
+
group?: string;
|
|
147
147
|
}) => void;
|
|
148
148
|
/**
|
|
149
149
|
* Fires when a MultiColumnComboBox list item is about to be rendered. Used to override the default appearance of the list items.
|
|
@@ -247,4 +247,4 @@ export declare const MultiColumnComboBoxPropsContext: React.Context<(p: MultiCol
|
|
|
247
247
|
* Obtaining the `ref` returns an object of type [MultiColumnComboBoxHandle]({% slug api_dropdowns_multicolumncomboboxhandle %}).
|
|
248
248
|
*
|
|
249
249
|
*/
|
|
250
|
-
export declare const MultiColumnComboBox: React.ForwardRefExoticComponent<MultiColumnComboBoxProps & React.RefAttributes<MultiColumnComboBoxHandle>>;
|
|
250
|
+
export declare const MultiColumnComboBox: React.ForwardRefExoticComponent<MultiColumnComboBoxProps & React.RefAttributes<MultiColumnComboBoxHandle | null>>;
|
|
@@ -14,8 +14,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
14
14
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
15
|
t[p] = s[p];
|
|
16
16
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
18
|
-
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
19
21
|
return t;
|
|
20
22
|
};
|
|
21
23
|
import * as React from 'react';
|
|
@@ -49,7 +51,7 @@ export var MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
|
49
51
|
var target = React.useRef(null);
|
|
50
52
|
var comboBoxRef = React.useRef(null);
|
|
51
53
|
var scrollbarWidth = getScrollbarWidth();
|
|
52
|
-
var _a = props.columns, columns = _a === void 0 ? defaultProps.columns : _a, _b = props.popupSettings, popupSettings = _b === void 0 ? defaultProps.popupSettings : _b, size = props.size, onOpen = props.onOpen, onClose = props.onClose, onFocus = props.onFocus, onBlur = props.onBlur, onChange = props.onChange, onFilterChange = props.onFilterChange, onPageChange = props.onPageChange, other = __rest(props, ["columns", "popupSettings", "size", "onOpen", "onClose", "onFocus", "onBlur", "onChange", "onFilterChange", "onPageChange"]);
|
|
54
|
+
var _a = props.columns, columns = _a === void 0 ? defaultProps.columns : _a, _b = props.popupSettings, popupSettings = _b === void 0 ? defaultProps.popupSettings : _b, className = props.className, size = props.size, onOpen = props.onOpen, onClose = props.onClose, onFocus = props.onFocus, onBlur = props.onBlur, onChange = props.onChange, onFilterChange = props.onFilterChange, onPageChange = props.onPageChange, other = __rest(props, ["columns", "popupSettings", "className", "size", "onOpen", "onClose", "onFocus", "onBlur", "onChange", "onFilterChange", "onPageChange"]);
|
|
53
55
|
React.useImperativeHandle(target, function () {
|
|
54
56
|
return ({
|
|
55
57
|
element: comboBoxRef.current && comboBoxRef.current.element,
|
|
@@ -87,7 +89,7 @@ export var MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
|
87
89
|
}, [props.header, columns, groupHeader]);
|
|
88
90
|
var popupWidth = React.useMemo(function () {
|
|
89
91
|
// These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
|
|
90
|
-
return "calc("
|
|
92
|
+
return "calc(".concat(columns.map(function (column) { return columnWidth(column.width, defaultProps.width); }).filter(Boolean).join(' + '), " + ").concat(scrollbarWidth, "px + 4px)");
|
|
91
93
|
}, [columns, scrollbarWidth]);
|
|
92
94
|
var skip = props.virtual ? props.virtual.skip : 0;
|
|
93
95
|
var itemRender = React.useCallback(function (li, liProps) {
|
|
@@ -107,7 +109,7 @@ export var MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
|
107
109
|
children.push(React.createElement("div", { key: "group", className: "k-table-td k-table-group-td" },
|
|
108
110
|
React.createElement("span", null, group)));
|
|
109
111
|
}
|
|
110
|
-
var rendering = React.cloneElement(li, __assign({}, li.props, { className: classNames('k-table-row', {
|
|
112
|
+
var rendering = React.cloneElement(li, __assign(__assign({}, li.props), { className: classNames('k-table-row', {
|
|
111
113
|
'k-table-alt-row': liProps.index % 2 !== 0,
|
|
112
114
|
'k-focus': liProps.focused,
|
|
113
115
|
'k-selected': liProps.selected,
|
|
@@ -117,7 +119,7 @@ export var MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
|
117
119
|
}, [columns, props.groupField, props.itemRender, props.data, skip]);
|
|
118
120
|
var handleEvent = React.useCallback(function (handler, event) {
|
|
119
121
|
if (handler) {
|
|
120
|
-
handler.call(undefined, __assign({}, event, { target: target.current }));
|
|
122
|
+
handler.call(undefined, __assign(__assign({}, event), { target: target.current }));
|
|
121
123
|
}
|
|
122
124
|
}, []);
|
|
123
125
|
var onOpenHandler = React.useCallback(function (event) { return handleEvent(onOpen, event); }, [onOpen]);
|
|
@@ -132,9 +134,9 @@ export var MultiColumnComboBox = React.forwardRef(function (directProps, ref) {
|
|
|
132
134
|
}, []);
|
|
133
135
|
React.useEffect(function () { setScrollbarWidth(); });
|
|
134
136
|
var List = React.useCallback(function (listProps) { return React.createElement(MultiColumnList, __assign({}, listProps)); }, []);
|
|
135
|
-
return (React.createElement(ComboBox, __assign({}, other, { list: List, popupSettings: __assign({ width: popupWidth }, popupSettings, { popupClass: 'k-dropdowngrid-popup k-reset', className: popupSettings.className }), ref: comboBoxRef, header: header, itemRender: itemRender, size: props.size, rounded: props.rounded, fillMode: props.fillMode, onOpen: onOpenHandler, onClose: onCloseHandler, onFocus: onFocusHandler, onBlur: onBlurHandler, onChange: onChangeHandler, onFilterChange: onFilterChangeHandler, onPageChange: onPageChangeHandler, onGroupScroll: onGroupScroll, className: 'k-dropdowngrid' })));
|
|
137
|
+
return (React.createElement(ComboBox, __assign({}, other, { list: List, popupSettings: __assign(__assign({ width: popupWidth }, popupSettings), { popupClass: 'k-dropdowngrid-popup k-reset', className: popupSettings.className }), ref: comboBoxRef, header: header, itemRender: itemRender, size: props.size, rounded: props.rounded, fillMode: props.fillMode, onOpen: onOpenHandler, onClose: onCloseHandler, onFocus: onFocusHandler, onBlur: onBlurHandler, onChange: onChangeHandler, onFilterChange: onFilterChangeHandler, onPageChange: onPageChangeHandler, onGroupScroll: onGroupScroll, className: classNames('k-dropdowngrid', className) })));
|
|
136
138
|
});
|
|
137
|
-
var propTypes = __assign({}, ComboBoxWithoutContext.propTypes, { columns: PropTypes.any.isRequired });
|
|
139
|
+
var propTypes = __assign(__assign({}, ComboBoxWithoutContext.propTypes), { columns: PropTypes.any.isRequired });
|
|
138
140
|
var defaultProps = {
|
|
139
141
|
columns: [],
|
|
140
142
|
popupSettings: {},
|
|
@@ -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
|
*/
|
|
@@ -2,10 +2,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
2
2
|
var extendStatics = function (d, b) {
|
|
3
3
|
extendStatics = Object.setPrototypeOf ||
|
|
4
4
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
6
|
return extendStatics(d, b);
|
|
7
7
|
};
|
|
8
8
|
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
9
11
|
extendStatics(d, b);
|
|
10
12
|
function __() { this.constructor = d; }
|
|
11
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -22,6 +24,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
22
24
|
};
|
|
23
25
|
return __assign.apply(this, arguments);
|
|
24
26
|
};
|
|
27
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
28
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
29
|
+
if (ar || !(i in from)) {
|
|
30
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
31
|
+
ar[i] = from[i];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
35
|
+
};
|
|
25
36
|
import * as React from 'react';
|
|
26
37
|
import * as PropTypes from 'prop-types';
|
|
27
38
|
import { classNames, Keys, guid, createPropsContext, kendoThemeMaps, withPropsContext } from '@progress/kendo-react-common';
|
|
@@ -57,10 +68,12 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
57
68
|
_this.state = {
|
|
58
69
|
activedescendant: ActiveDescendant.PopupList
|
|
59
70
|
};
|
|
71
|
+
_this._element = null;
|
|
60
72
|
_this._valueItemsDuringOnChange = null;
|
|
61
73
|
_this._inputId = guid();
|
|
62
74
|
_this.base = new DropDownBase(_this);
|
|
63
75
|
_this._tags = [];
|
|
76
|
+
_this._input = null;
|
|
64
77
|
_this._skipFocusEvent = false;
|
|
65
78
|
_this.scrollToFocused = false;
|
|
66
79
|
/**
|
|
@@ -85,7 +98,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
85
98
|
newItems.splice(indexInValue, 1);
|
|
86
99
|
}
|
|
87
100
|
else {
|
|
88
|
-
newItems = _this.value
|
|
101
|
+
newItems = __spreadArray(__spreadArray([], _this.value, true), [dataItem], false);
|
|
89
102
|
}
|
|
90
103
|
var text = _this.props.filter !== undefined ? _this.props.filter : _this.state.text;
|
|
91
104
|
if (text) {
|
|
@@ -246,7 +259,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
246
259
|
width: popupWidth,
|
|
247
260
|
popupSettings: {
|
|
248
261
|
popupClass: classNames(popupSettings.popupClass, 'k-list', (_a = {},
|
|
249
|
-
_a["k-list-"
|
|
262
|
+
_a["k-list-".concat(sizeMap[size] || size)] = size,
|
|
250
263
|
_a['k-virtual-list'] = _this.base.vs.enabled,
|
|
251
264
|
_a)),
|
|
252
265
|
className: popupSettings.className,
|
|
@@ -261,7 +274,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
261
274
|
};
|
|
262
275
|
var focusedType = _this.getFocusedState().focusedType;
|
|
263
276
|
var customItem = allowCustom && text && (React.createElement("div", { className: classNames('k-list', (_b = {},
|
|
264
|
-
_b["k-list-"
|
|
277
|
+
_b["k-list-".concat(sizeMap[size] || size)] = size,
|
|
265
278
|
_b)), key: "customitem", onClick: _this.customItemSelect, onMouseDown: preventDefault },
|
|
266
279
|
React.createElement("div", { className: classNames('k-list-item k-custom-item', { 'k-focus': isCustom(focusedType) }), style: { fontStyle: 'italic' } },
|
|
267
280
|
text,
|
|
@@ -279,7 +292,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
279
292
|
var opened = _this.props.opened !== undefined ? _this.props.opened : _this.state.opened;
|
|
280
293
|
var focusedIndex = _this.getFocusedState().focusedIndex;
|
|
281
294
|
var popupSettings = _this.base.getPopupSettings();
|
|
282
|
-
var translate = "translateY("
|
|
295
|
+
var translate = "translateY(".concat(vs.translate, "px)");
|
|
283
296
|
return (React.createElement(List, { 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) {
|
|
284
297
|
vs.scrollHandler(e);
|
|
285
298
|
}, wrapperRef: vs.scrollerRef, scroller: _this.base.renderScrollElement() }));
|
|
@@ -299,7 +312,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
299
312
|
}
|
|
300
313
|
state.data.focusedIndex = undefined;
|
|
301
314
|
_this.base.filterChanged('', state);
|
|
302
|
-
var newItems = _this.value
|
|
315
|
+
var newItems = __spreadArray(__spreadArray([], _this.value, true), [item], false);
|
|
303
316
|
_this.triggerOnChange(newItems, state);
|
|
304
317
|
_this.base.togglePopup(state);
|
|
305
318
|
_this.applyState(state);
|
|
@@ -385,7 +398,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
385
398
|
get: function () {
|
|
386
399
|
return this._element;
|
|
387
400
|
},
|
|
388
|
-
enumerable:
|
|
401
|
+
enumerable: false,
|
|
389
402
|
configurable: true
|
|
390
403
|
});
|
|
391
404
|
Object.defineProperty(MultiSelectWithoutContext.prototype, "value", {
|
|
@@ -408,7 +421,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
408
421
|
}
|
|
409
422
|
return result;
|
|
410
423
|
},
|
|
411
|
-
enumerable:
|
|
424
|
+
enumerable: false,
|
|
412
425
|
configurable: true
|
|
413
426
|
});
|
|
414
427
|
Object.defineProperty(MultiSelectWithoutContext.prototype, "name", {
|
|
@@ -418,7 +431,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
418
431
|
get: function () {
|
|
419
432
|
return this.props.name;
|
|
420
433
|
},
|
|
421
|
-
enumerable:
|
|
434
|
+
enumerable: false,
|
|
422
435
|
configurable: true
|
|
423
436
|
});
|
|
424
437
|
Object.defineProperty(MultiSelectWithoutContext.prototype, "validity", {
|
|
@@ -436,7 +449,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
436
449
|
valueMissing: this.value === null
|
|
437
450
|
};
|
|
438
451
|
},
|
|
439
|
-
enumerable:
|
|
452
|
+
enumerable: false,
|
|
440
453
|
configurable: true
|
|
441
454
|
});
|
|
442
455
|
Object.defineProperty(MultiSelectWithoutContext.prototype, "required", {
|
|
@@ -448,7 +461,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
448
461
|
? this.props.required
|
|
449
462
|
: MultiSelectWithoutContext.defaultProps.required;
|
|
450
463
|
},
|
|
451
|
-
enumerable:
|
|
464
|
+
enumerable: false,
|
|
452
465
|
configurable: true
|
|
453
466
|
});
|
|
454
467
|
Object.defineProperty(MultiSelectWithoutContext.prototype, "validityStyles", {
|
|
@@ -457,7 +470,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
457
470
|
? this.props.validityStyles
|
|
458
471
|
: MultiSelectWithoutContext.defaultProps.validityStyles;
|
|
459
472
|
},
|
|
460
|
-
enumerable:
|
|
473
|
+
enumerable: false,
|
|
461
474
|
configurable: true
|
|
462
475
|
});
|
|
463
476
|
/**
|
|
@@ -560,9 +573,9 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
560
573
|
var isValid = !this.validityStyles || this.validity.valid;
|
|
561
574
|
var clearButton = Boolean(filter !== undefined ? filter : text) || this.value.length > 0;
|
|
562
575
|
var component = (React.createElement("div", { ref: this.componentRef, className: classNames('k-multiselect k-input', className, (_a = {},
|
|
563
|
-
_a["k-input-"
|
|
564
|
-
_a["k-rounded-"
|
|
565
|
-
_a["k-input-"
|
|
576
|
+
_a["k-input-".concat(sizeMap[size] || size)] = size,
|
|
577
|
+
_a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded,
|
|
578
|
+
_a["k-input-".concat(fillMode)] = fillMode,
|
|
566
579
|
_a['k-focus'] = focused && !disabled,
|
|
567
580
|
_a['k-invalid'] = !isValid,
|
|
568
581
|
_a['k-disabled'] = disabled,
|
|
@@ -570,9 +583,9 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
570
583
|
_a['k-required'] = this.required,
|
|
571
584
|
_a)), style: !label
|
|
572
585
|
? style
|
|
573
|
-
: __assign({}, style, { width: undefined }), dir: dir, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.handleWrapperClick, onMouseDown: preventDefaultNonInputs },
|
|
586
|
+
: __assign(__assign({}, style), { width: undefined }), dir: dir, onFocus: this.handleFocus, onBlur: this.handleBlur, onClick: this.handleWrapperClick, onMouseDown: preventDefaultNonInputs },
|
|
574
587
|
React.createElement("div", { className: classNames('k-input-values k-chip-list k-selection-multiple', (_b = {},
|
|
575
|
-
_b["k-chip-list-"
|
|
588
|
+
_b["k-chip-list-".concat(sizeMap[size] || size)] = size,
|
|
576
589
|
_b)), role: "listbox", id: 'tagslist-' + this.base.guid },
|
|
577
590
|
tagsToRender.length > 0 && React.createElement(TagList, { tagRender: this.props.tagRender, onTagDelete: this.onTagDelete, data: tagsToRender, guid: this.base.guid, focused: focusedTag ? tagsToRender.find(function (t) { return matchTags(t, focusedTag, dataItemKey); }) : undefined, size: size }),
|
|
578
591
|
this.renderSearchbar(id)),
|
|
@@ -589,9 +602,9 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
589
602
|
var focusedIndex = this.getFocusedState().focusedIndex;
|
|
590
603
|
var placeholderToShow = this.value.length === 0 && !text ? placeholder : undefined;
|
|
591
604
|
var ariaActivedescendant = activedescendant === ActiveDescendant.TagsList && focusedTag !== undefined ?
|
|
592
|
-
"tag-"
|
|
593
|
-
"option-"
|
|
594
|
-
return (React.createElement(SearchBar, { 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-"
|
|
605
|
+
"tag-".concat(this.base.guid, "-").concat(focusedTag.text.replace(/\s+/g, '-')) :
|
|
606
|
+
"option-".concat(this.base.guid, "-").concat(focusedIndex);
|
|
607
|
+
return (React.createElement(SearchBar, { 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 }));
|
|
595
608
|
};
|
|
596
609
|
MultiSelectWithoutContext.prototype.onTagsNavigate = function (event, state) {
|
|
597
610
|
var keyCode = event.keyCode;
|
|
@@ -653,7 +666,7 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
653
666
|
};
|
|
654
667
|
MultiSelectWithoutContext.prototype.triggerOnChange = function (items, state) {
|
|
655
668
|
if (this.props.value === undefined) {
|
|
656
|
-
state.data.value = items
|
|
669
|
+
state.data.value = __spreadArray([], items, true);
|
|
657
670
|
}
|
|
658
671
|
this._valueItemsDuringOnChange = [];
|
|
659
672
|
this.setItems(items, this._valueItemsDuringOnChange);
|
|
@@ -726,14 +739,14 @@ var MultiSelectWithoutContext = /** @class */ (function (_super) {
|
|
|
726
739
|
/**
|
|
727
740
|
* @hidden
|
|
728
741
|
*/
|
|
729
|
-
MultiSelectWithoutContext.propTypes = __assign({}, DropDownBase.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({
|
|
742
|
+
MultiSelectWithoutContext.propTypes = __assign(__assign({}, DropDownBase.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({
|
|
730
743
|
text: PropTypes.string,
|
|
731
744
|
data: PropTypes.arrayOf(PropTypes.any)
|
|
732
745
|
})), tagRender: PropTypes.func, id: PropTypes.string, ariaLabelledBy: PropTypes.string, ariaDescribedBy: PropTypes.string });
|
|
733
746
|
/**
|
|
734
747
|
* @hidden
|
|
735
748
|
*/
|
|
736
|
-
MultiSelectWithoutContext.defaultProps = __assign({}, DropDownBase.defaultProps, { autoClose: true, required: false, size: 'medium', rounded: 'medium', fillMode: 'solid' });
|
|
749
|
+
MultiSelectWithoutContext.defaultProps = __assign(__assign({}, DropDownBase.defaultProps), { autoClose: true, required: false, size: 'medium', rounded: 'medium', fillMode: 'solid' });
|
|
737
750
|
return MultiSelectWithoutContext;
|
|
738
751
|
}(React.Component));
|
|
739
752
|
export { MultiSelectWithoutContext };
|