@syncfusion/ej2-dropdowns 25.1.40 → 25.1.41
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/CHANGELOG.md +14 -0
- package/dist/ej2-dropdowns.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +276 -164
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +276 -164
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +2 -2
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +8 -8
- package/src/auto-complete/auto-complete.js +2 -10
- package/src/combo-box/combo-box.js +1 -1
- package/src/common/interface.d.ts +2 -0
- package/src/common/virtual-scroll.js +13 -4
- package/src/drop-down-base/drop-down-base.d.ts +3 -0
- package/src/drop-down-base/drop-down-base.js +65 -41
- package/src/drop-down-list/drop-down-list.d.ts +1 -1
- package/src/drop-down-list/drop-down-list.js +37 -27
- package/src/list-box/list-box.js +1 -6
- package/src/multi-select/multi-select.d.ts +3 -1
- package/src/multi-select/multi-select.js +156 -68
- package/.eslintrc.json +0 -260
- package/tslint.json +0 -111
package/src/list-box/list-box.js
CHANGED
|
@@ -1668,12 +1668,6 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1668
1668
|
tListBox.ulElement.removeChild(noRecElem);
|
|
1669
1669
|
}
|
|
1670
1670
|
}
|
|
1671
|
-
if (isRefresh) {
|
|
1672
|
-
var noRecElem = fListBox.ulElement.childNodes[0];
|
|
1673
|
-
if (noRecElem) {
|
|
1674
|
-
fListBox.ulElement.removeChild(noRecElem);
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
1671
|
if (fListBox.listData.length > 0) {
|
|
1678
1672
|
// eslint-disable-next-line prefer-spread
|
|
1679
1673
|
flistboxarray = Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number);
|
|
@@ -1719,6 +1713,7 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1719
1713
|
tListBox.liCollections = tliCollections.concat(fliCollections);
|
|
1720
1714
|
}
|
|
1721
1715
|
fListBox.value = [];
|
|
1716
|
+
listData = listData.filter(function (data) { return (data !== undefined); });
|
|
1722
1717
|
listData = listData
|
|
1723
1718
|
.filter(function (data) { return data.isHeader !== true; });
|
|
1724
1719
|
var sortedData = listData.filter(function (val) {
|
|
@@ -53,6 +53,8 @@ export declare class MultiSelect extends DropDownBase implements IInput {
|
|
|
53
53
|
private isCustomRendered;
|
|
54
54
|
private isRemoteSelection;
|
|
55
55
|
private isSelectAllTarget;
|
|
56
|
+
private previousFocusItem;
|
|
57
|
+
private selectedListData;
|
|
56
58
|
/**
|
|
57
59
|
* The `fields` property maps the columns of the data table and binds the data to the component.
|
|
58
60
|
* * text - Maps the text column from data table for each list item.
|
|
@@ -687,7 +689,7 @@ export declare class MultiSelect extends DropDownBase implements IInput {
|
|
|
687
689
|
private updateAriaAttribute;
|
|
688
690
|
private homeNavigation;
|
|
689
691
|
private updateSelectionList;
|
|
690
|
-
|
|
692
|
+
protected handleVirtualKeyboardActions(e: KeyboardEventArgs, pageCount: number): void;
|
|
691
693
|
private onKeyDown;
|
|
692
694
|
private arrowDown;
|
|
693
695
|
private arrowUp;
|
|
@@ -269,10 +269,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
269
269
|
attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_popup', 'aria-controls': _this.element.id });
|
|
270
270
|
_this.updateAriaActiveDescendant();
|
|
271
271
|
if (_this.isFirstClick) {
|
|
272
|
-
if (_this.enableVirtualization
|
|
273
|
-
_this.
|
|
272
|
+
if (!_this.enableVirtualization) {
|
|
273
|
+
_this.loadTemplate();
|
|
274
274
|
}
|
|
275
|
-
_this.loadTemplate();
|
|
276
275
|
}
|
|
277
276
|
if (_this.mode === 'CheckBox' && _this.showSelectAll) {
|
|
278
277
|
EventHandler.add(_this.popupObj.element, 'click', _this.clickHandler, _this);
|
|
@@ -282,7 +281,12 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
282
281
|
};
|
|
283
282
|
MultiSelect.prototype.updateVirtualReOrderList = function (isCheckBoxUpdate) {
|
|
284
283
|
var query = this.getForQuery(this.value, true).clone();
|
|
285
|
-
|
|
284
|
+
if (this.enableVirtualization && this.dataSource instanceof DataManager) {
|
|
285
|
+
this.resetList(this.selectedListData, this.fields, query);
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
this.resetList(this.dataSource, this.fields, query);
|
|
289
|
+
}
|
|
286
290
|
this.UpdateSkeleton();
|
|
287
291
|
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
288
292
|
this.virtualItemCount = this.itemCount;
|
|
@@ -339,6 +343,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
339
343
|
}
|
|
340
344
|
if (this.enableVirtualization) {
|
|
341
345
|
var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
346
|
+
this.isKeyBoardAction = false;
|
|
342
347
|
this.scrollBottom(focusedItem);
|
|
343
348
|
}
|
|
344
349
|
};
|
|
@@ -456,15 +461,15 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
456
461
|
MultiSelect.prototype.getForQuery = function (valuecheck, isCheckbox) {
|
|
457
462
|
var predicate;
|
|
458
463
|
var field = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
|
|
459
|
-
if (this.enableVirtualization) {
|
|
464
|
+
if (this.enableVirtualization && valuecheck) {
|
|
460
465
|
if (isCheckbox) {
|
|
461
466
|
for (var i = 0; i < valuecheck.length; i++) {
|
|
462
467
|
var value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', valuecheck[i]) : valuecheck[i];
|
|
463
468
|
if (i === 0) {
|
|
464
|
-
predicate = new Predicate(field, 'equal', value);
|
|
469
|
+
predicate = new Predicate(field, 'equal', (value));
|
|
465
470
|
}
|
|
466
471
|
else {
|
|
467
|
-
predicate = predicate.or(field, 'equal', value);
|
|
472
|
+
predicate = predicate.or(field, 'equal', (value));
|
|
468
473
|
}
|
|
469
474
|
}
|
|
470
475
|
return new Query().where(predicate);
|
|
@@ -473,10 +478,10 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
473
478
|
for (var i = 0; i < valuecheck.length; i++) {
|
|
474
479
|
var value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', valuecheck[i]) : valuecheck[i];
|
|
475
480
|
if (i === 0) {
|
|
476
|
-
predicate = new Predicate(field, 'notequal', value);
|
|
481
|
+
predicate = new Predicate(field, 'notequal', (value));
|
|
477
482
|
}
|
|
478
483
|
else {
|
|
479
|
-
predicate = predicate.and(field, 'notequal', value);
|
|
484
|
+
predicate = predicate.and(field, 'notequal', (value));
|
|
480
485
|
}
|
|
481
486
|
}
|
|
482
487
|
return new Query().where(predicate);
|
|
@@ -526,7 +531,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
526
531
|
valuecheck = this.presentItemValue(this.ulElement);
|
|
527
532
|
}
|
|
528
533
|
if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
|
|
529
|
-
&& this.listData != null) {
|
|
534
|
+
&& this.listData != null && !this.enableVirtualization) {
|
|
530
535
|
this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
|
|
531
536
|
}
|
|
532
537
|
else {
|
|
@@ -537,6 +542,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
537
542
|
query = this.allowFiltering ? query.where(this.fields.text, 'startswith', this.inputElement.value, this.ignoreCase, this.ignoreAccent) : query;
|
|
538
543
|
this.checkForCustomValue(query, this.fields);
|
|
539
544
|
this.isCustomRendered = true;
|
|
545
|
+
this.remoteCustomValue = this.enableVirtualization ? false : this.remoteCustomValue;
|
|
540
546
|
}
|
|
541
547
|
if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
|
|
542
548
|
this.removeFocus();
|
|
@@ -581,7 +587,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
581
587
|
if (!isNullOrUndefined(this.text) && (isNullOrUndefined(this.value) || this.value.length === 0)) {
|
|
582
588
|
this.initialTextUpdate();
|
|
583
589
|
}
|
|
584
|
-
this.
|
|
590
|
+
if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
|
|
591
|
+
this.initialValueUpdate();
|
|
592
|
+
}
|
|
585
593
|
this.initialUpdate();
|
|
586
594
|
this.refreshPlaceHolder();
|
|
587
595
|
if (this.mode !== 'CheckBox' && this.changeOnBlur) {
|
|
@@ -784,7 +792,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
784
792
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
785
793
|
filterQuery.where('', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);
|
|
786
794
|
}
|
|
787
|
-
else {
|
|
795
|
+
else if ((this.enableVirtualization && this.targetElement() !== "") || !this.enableVirtualization) {
|
|
788
796
|
var fields = this.fields;
|
|
789
797
|
filterQuery.where(!isNullOrUndefined(fields.text) ? fields.text : '', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);
|
|
790
798
|
}
|
|
@@ -795,18 +803,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
795
803
|
return filterQuery;
|
|
796
804
|
}
|
|
797
805
|
else {
|
|
798
|
-
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll
|
|
806
|
+
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll) {
|
|
799
807
|
return this.virtualFilterQuery(filterQuery);
|
|
800
808
|
}
|
|
801
|
-
else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
|
|
802
|
-
for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
803
|
-
if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
|
|
804
|
-
filterQuery.queries.splice(queryElements, 1);
|
|
805
|
-
--queryElements;
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
return filterQuery;
|
|
809
|
-
}
|
|
810
809
|
return query ? query : this.query ? this.query : new Query();
|
|
811
810
|
}
|
|
812
811
|
};
|
|
@@ -970,7 +969,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
970
969
|
var dataItem_1 = {};
|
|
971
970
|
setValue(field.text, value, dataItem_1);
|
|
972
971
|
if (typeof getValue((this.fields.value ? this.fields.value : 'value'), customData)
|
|
973
|
-
=== 'number') {
|
|
972
|
+
=== 'number' && this.fields.value !== this.fields.text) {
|
|
974
973
|
setValue(field.value, Math.random(), dataItem_1);
|
|
975
974
|
}
|
|
976
975
|
else {
|
|
@@ -987,17 +986,19 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
987
986
|
dataItem_1 = this.allowObjectBinding ? emptyObject_1 : dataItem_1;
|
|
988
987
|
if (this.enableVirtualization) {
|
|
989
988
|
this.virtualCustomData = dataItem_1;
|
|
990
|
-
var tempData = this.
|
|
989
|
+
var tempData = this.dataSource instanceof DataManager ? JSON.parse(JSON.stringify(this.listData)) : JSON.parse(JSON.stringify(this.dataSource));
|
|
991
990
|
var totalData = [];
|
|
992
991
|
if (this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
|
|
993
992
|
totalData = tempData.concat(this.virtualCustomSelectData);
|
|
994
993
|
}
|
|
995
994
|
tempData.splice(0, 0, dataItem_1);
|
|
996
995
|
this.isCustomDataUpdated = true;
|
|
996
|
+
var tempCount = this.totalItemCount;
|
|
997
997
|
this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
|
|
998
998
|
this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.itemCount;
|
|
999
999
|
this.resetList(tempData, field, query);
|
|
1000
1000
|
this.isCustomDataUpdated = false;
|
|
1001
|
+
this.totalItemCount = this.enableVirtualization && this.dataSource instanceof DataManager ? tempCount : this.totalItemCount;
|
|
1001
1002
|
}
|
|
1002
1003
|
else {
|
|
1003
1004
|
var tempData = JSON.parse(JSON.stringify(this.listData));
|
|
@@ -1018,7 +1019,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
1018
1019
|
else if (this.listData && this.mainData && !dataChecks && this.allowCustomValue) {
|
|
1019
1020
|
if (this.allowFiltering && this.isRemoteSelection && this.remoteCustomValue) {
|
|
1020
1021
|
this.isRemoteSelection = false;
|
|
1021
|
-
|
|
1022
|
+
if (!this.enableVirtualization) {
|
|
1023
|
+
this.resetList(this.listData, field, query);
|
|
1024
|
+
}
|
|
1022
1025
|
}
|
|
1023
1026
|
else if (!this.allowFiltering && this.list) {
|
|
1024
1027
|
var liCollections = this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-hide-listitem)');
|
|
@@ -1275,21 +1278,25 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
1275
1278
|
+ dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
|
|
1276
1279
|
var previousItem = steps >= 0 ? collection[steps + 1] : collection[0];
|
|
1277
1280
|
if (this.enableVirtualization && isVirtualKeyAction) {
|
|
1278
|
-
previousItem =
|
|
1281
|
+
previousItem = (this.liCollections.length >= steps && steps >= 0) ? this.liCollections[steps] : this.liCollections[this.skeletonCount];
|
|
1279
1282
|
}
|
|
1280
1283
|
if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
|
|
1281
1284
|
previousItem = this.liCollections[this.skeletonCount];
|
|
1282
1285
|
}
|
|
1283
1286
|
if (this.enableVirtualization) {
|
|
1284
1287
|
if (!isNullOrUndefined(previousItem) && !previousItem.classList.contains('e-item-focus')) {
|
|
1288
|
+
this.isKeyBoardAction = true;
|
|
1285
1289
|
this.addListFocus(previousItem);
|
|
1286
1290
|
this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
|
|
1287
1291
|
}
|
|
1288
1292
|
else if (this.viewPortInfo.startIndex == 0) {
|
|
1293
|
+
this.isKeyBoardAction = true;
|
|
1289
1294
|
this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
|
|
1290
1295
|
}
|
|
1296
|
+
this.previousFocusItem = previousItem;
|
|
1291
1297
|
}
|
|
1292
1298
|
else {
|
|
1299
|
+
this.isKeyBoardAction = true;
|
|
1293
1300
|
this.addListFocus(previousItem);
|
|
1294
1301
|
this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
|
|
1295
1302
|
}
|
|
@@ -1306,7 +1313,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
1306
1313
|
if (this.enableVirtualization && isVirtualKeyAction) {
|
|
1307
1314
|
previousItem = steps <= list.length ? this.liCollections[steps] : this.liCollections[list.length - 1];
|
|
1308
1315
|
}
|
|
1316
|
+
this.isKeyBoardAction = true;
|
|
1309
1317
|
this.addListFocus(previousItem);
|
|
1318
|
+
this.previousFocusItem = previousItem;
|
|
1310
1319
|
this.scrollBottom(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), false, this.keyboardEvent.keyCode);
|
|
1311
1320
|
};
|
|
1312
1321
|
MultiSelect.prototype.getItems = function () {
|
|
@@ -1495,18 +1504,16 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
1495
1504
|
case 33:
|
|
1496
1505
|
e.preventDefault();
|
|
1497
1506
|
if (focusedItem) {
|
|
1498
|
-
|
|
1499
|
-
activeIndex
|
|
1500
|
-
activeIndex = this.getIndexByValue(focusedItem.getAttribute('data-value'));
|
|
1501
|
-
this.pageUpSelection(activeIndex - this.getPageCount(), true);
|
|
1507
|
+
activeIndex = this.getIndexByValue(this.previousFocusItem.getAttribute('data-value')) - 1;
|
|
1508
|
+
this.pageUpSelection(activeIndex, true);
|
|
1502
1509
|
this.updateAriaAttribute();
|
|
1503
1510
|
}
|
|
1504
1511
|
break;
|
|
1505
1512
|
case 34:
|
|
1506
1513
|
e.preventDefault();
|
|
1507
1514
|
if (focusedItem) {
|
|
1508
|
-
activeIndex = this.getIndexByValue(
|
|
1509
|
-
this.pageDownSelection(activeIndex
|
|
1515
|
+
activeIndex = this.getIndexByValue(this.previousFocusItem.getAttribute('data-value'));
|
|
1516
|
+
this.pageDownSelection(activeIndex, true);
|
|
1510
1517
|
this.updateAriaAttribute();
|
|
1511
1518
|
}
|
|
1512
1519
|
break;
|
|
@@ -1542,11 +1549,11 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
1542
1549
|
else if (this.isPopupOpen()) {
|
|
1543
1550
|
var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
1544
1551
|
var activeIndex = void 0;
|
|
1545
|
-
this.isKeyBoardAction = true;
|
|
1546
1552
|
switch (e.keyCode) {
|
|
1547
1553
|
case 36:
|
|
1548
1554
|
case 35:
|
|
1549
1555
|
this.isMouseScrollAction = true;
|
|
1556
|
+
this.isKeyBoardAction = true;
|
|
1550
1557
|
this.homeNavigation((e.keyCode === 36) ? true : false);
|
|
1551
1558
|
break;
|
|
1552
1559
|
case 33:
|
|
@@ -1560,19 +1567,22 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
1560
1567
|
case 34:
|
|
1561
1568
|
e.preventDefault();
|
|
1562
1569
|
if (focusedItem) {
|
|
1563
|
-
this.getIndexByValue(focusedItem.getAttribute('data-value'));
|
|
1570
|
+
activeIndex = this.getIndexByValue(focusedItem.getAttribute('data-value'));
|
|
1564
1571
|
this.pageDownSelection(activeIndex + this.getPageCount());
|
|
1565
1572
|
this.updateAriaAttribute();
|
|
1566
1573
|
}
|
|
1567
1574
|
return;
|
|
1568
1575
|
case 38:
|
|
1576
|
+
this.isKeyBoardAction = true;
|
|
1569
1577
|
this.arrowUp(e);
|
|
1570
1578
|
break;
|
|
1571
1579
|
case 40:
|
|
1580
|
+
this.isKeyBoardAction = true;
|
|
1572
1581
|
this.arrowDown(e);
|
|
1573
1582
|
break;
|
|
1574
1583
|
case 27:
|
|
1575
1584
|
e.preventDefault();
|
|
1585
|
+
this.isKeyBoardAction = true;
|
|
1576
1586
|
this.hidePopup(e);
|
|
1577
1587
|
if (this.mode === 'CheckBox') {
|
|
1578
1588
|
this.inputElement.focus();
|
|
@@ -1580,16 +1590,19 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
1580
1590
|
return;
|
|
1581
1591
|
case 13:
|
|
1582
1592
|
e.preventDefault();
|
|
1593
|
+
this.isKeyBoardAction = true;
|
|
1583
1594
|
if (this.mode !== 'CheckBox') {
|
|
1584
1595
|
this.selectByKey(e);
|
|
1585
1596
|
}
|
|
1586
1597
|
this.checkPlaceholderSize();
|
|
1587
1598
|
return;
|
|
1588
1599
|
case 32:
|
|
1600
|
+
this.isKeyBoardAction = true;
|
|
1589
1601
|
this.spaceKeySelection(e);
|
|
1590
1602
|
return;
|
|
1591
1603
|
case 9:
|
|
1592
1604
|
e.preventDefault();
|
|
1605
|
+
this.isKeyBoardAction = true;
|
|
1593
1606
|
this.hidePopup(e);
|
|
1594
1607
|
this.inputElement.focus();
|
|
1595
1608
|
this.overAllWrapper.classList.add(FOCUS);
|
|
@@ -1791,7 +1804,6 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
1791
1804
|
this.isPreventKeyAction = false;
|
|
1792
1805
|
this.isKeyBoardAction = false;
|
|
1793
1806
|
this.isPreventScrollAction = false;
|
|
1794
|
-
nextOffset = nextOffset + (selectedLI.offsetHeight * liCount);
|
|
1795
1807
|
}
|
|
1796
1808
|
this.list.scrollTop = nextOffset;
|
|
1797
1809
|
}
|
|
@@ -1823,9 +1835,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
1823
1835
|
if (this.enableVirtualization && this.isKeyBoardAction && firstElementValue && currentElementValue === firstElementValue && keyCode != 36 && !this.isVirtualScrolling) {
|
|
1824
1836
|
this.isUpwardScrolling = true;
|
|
1825
1837
|
this.isPreventKeyAction = true;
|
|
1838
|
+
this.isKeyBoardAction = false;
|
|
1826
1839
|
this.list.scrollTop -= selectedLI.offsetHeight * liCount;
|
|
1827
1840
|
this.isPreventKeyAction = this.list.scrollTop != 0 ? this.isPreventKeyAction : false;
|
|
1828
|
-
this.isKeyBoardAction = false;
|
|
1829
1841
|
this.isPreventScrollAction = false;
|
|
1830
1842
|
}
|
|
1831
1843
|
else if (this.enableVirtualization && keyCode == 36) {
|
|
@@ -1839,7 +1851,6 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
1839
1851
|
this.isPreventKeyAction = false;
|
|
1840
1852
|
this.isKeyBoardAction = false;
|
|
1841
1853
|
this.isPreventScrollAction = false;
|
|
1842
|
-
nextOffset = nextOffset - (selectedLI.offsetHeight * liCount);
|
|
1843
1854
|
}
|
|
1844
1855
|
this.list.scrollTop = this.list.scrollTop + nextOffset;
|
|
1845
1856
|
}
|
|
@@ -2040,7 +2051,12 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
2040
2051
|
this.addListFocus(elements[temp]);
|
|
2041
2052
|
}
|
|
2042
2053
|
else {
|
|
2043
|
-
this.
|
|
2054
|
+
if (this.enableVirtualization && elements[temp + 1].classList.contains('e-virtual-list')) {
|
|
2055
|
+
this.addListFocus(elements[this.skeletonCount]);
|
|
2056
|
+
}
|
|
2057
|
+
else {
|
|
2058
|
+
this.addListFocus(elements[++temp]);
|
|
2059
|
+
}
|
|
2044
2060
|
}
|
|
2045
2061
|
if (temp > -1) {
|
|
2046
2062
|
this.updateCheck(elements[temp]);
|
|
@@ -2259,6 +2275,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
2259
2275
|
removeVal = [];
|
|
2260
2276
|
}
|
|
2261
2277
|
removeVal.splice(index, 1);
|
|
2278
|
+
if (_this.enableVirtualization && _this.mode === 'CheckBox') {
|
|
2279
|
+
_this.selectedListData.splice(index, 1);
|
|
2280
|
+
}
|
|
2262
2281
|
_this.setProperties({ value: [].concat([], removeVal) }, true);
|
|
2263
2282
|
if (_this.enableVirtualization) {
|
|
2264
2283
|
var currentText = index == 0 ? _this.text.replace(_this.text.split(_this.delimiterChar)[index] + _this.delimiterChar, '') : _this.text.replace(_this.delimiterChar + _this.text.split(_this.delimiterChar)[index], '');
|
|
@@ -2503,6 +2522,19 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
2503
2522
|
_this.listData = list;
|
|
2504
2523
|
}
|
|
2505
2524
|
value = _this.allowObjectBinding ? _this.getDataByValue(value) : value;
|
|
2525
|
+
if (_this.enableVirtualization) {
|
|
2526
|
+
if (isNullOrUndefined(_this.selectedListData)) {
|
|
2527
|
+
_this.selectedListData = [(_this.getDataByValue(value))];
|
|
2528
|
+
}
|
|
2529
|
+
else {
|
|
2530
|
+
if (Array.isArray(_this.selectedListData)) {
|
|
2531
|
+
_this.selectedListData.push((_this.getDataByValue(value)));
|
|
2532
|
+
}
|
|
2533
|
+
else {
|
|
2534
|
+
_this.selectedListData = [_this.selectedListData, (_this.getDataByValue(value))];
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2506
2538
|
if ((_this.enableVirtualization && value) || !_this.enableVirtualization) {
|
|
2507
2539
|
_this.updateListSelectEventCallback(value, element, eve);
|
|
2508
2540
|
}
|
|
@@ -2694,7 +2726,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
2694
2726
|
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
2695
2727
|
this.virtualItemCount = this.itemCount;
|
|
2696
2728
|
if (this.mode !== 'CheckBox') {
|
|
2697
|
-
this.
|
|
2729
|
+
this.totalItemsCount();
|
|
2698
2730
|
}
|
|
2699
2731
|
if (!this.list.querySelector('.e-virtual-ddl')) {
|
|
2700
2732
|
var virualElement = this.createElement('div', {
|
|
@@ -2787,6 +2819,13 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
2787
2819
|
}
|
|
2788
2820
|
_this.isPreventScrollAction = true;
|
|
2789
2821
|
_this.setScrollPosition();
|
|
2822
|
+
if (!_this.list.classList.contains(dropDownBaseClasses.noData) && _this.getItems()[1] && _this.getItems()[1].offsetHeight !== 0) {
|
|
2823
|
+
_this.listItemHeight = _this.getItems()[1].offsetHeight;
|
|
2824
|
+
if (_this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
|
|
2825
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2826
|
+
_this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = _this.getTransformValues();
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2790
2829
|
if (_this.allowFiltering) {
|
|
2791
2830
|
_this.notify('inputFocus', {
|
|
2792
2831
|
module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'focus'
|
|
@@ -2892,13 +2931,17 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
2892
2931
|
sentinelInfo: {},
|
|
2893
2932
|
offsets: {},
|
|
2894
2933
|
startIndex: 0,
|
|
2895
|
-
endIndex:
|
|
2934
|
+
endIndex: this.itemCount,
|
|
2896
2935
|
};
|
|
2897
2936
|
this.previousStartIndex = 0;
|
|
2898
2937
|
this.previousEndIndex = 0;
|
|
2899
2938
|
if (this.dataSource instanceof DataManager) {
|
|
2900
|
-
|
|
2901
|
-
|
|
2939
|
+
if (this.remoteDataCount >= 0) {
|
|
2940
|
+
this.totalItemCount = this.dataCount = this.remoteDataCount;
|
|
2941
|
+
}
|
|
2942
|
+
else {
|
|
2943
|
+
this.resetList(this.dataSource);
|
|
2944
|
+
}
|
|
2902
2945
|
}
|
|
2903
2946
|
else {
|
|
2904
2947
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -3040,7 +3083,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
3040
3083
|
EventHandler.add(formElement, 'reset', this.resetValueHandler, this);
|
|
3041
3084
|
}
|
|
3042
3085
|
EventHandler.add(this.componentWrapper, 'mouseout', this.mouseOut, this);
|
|
3043
|
-
EventHandler.add(this.overAllClear, '
|
|
3086
|
+
EventHandler.add(this.overAllClear, 'mousedown', this.clearAll, this);
|
|
3044
3087
|
EventHandler.add(this.inputElement, 'paste', this.pasteHandler, this);
|
|
3045
3088
|
};
|
|
3046
3089
|
MultiSelect.prototype.onInput = function (e) {
|
|
@@ -3084,9 +3127,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
3084
3127
|
if (this.allowCustomValue) {
|
|
3085
3128
|
this.isRemoteSelection = true;
|
|
3086
3129
|
}
|
|
3087
|
-
|
|
3088
|
-
this.checkAndResetCache();
|
|
3089
|
-
}
|
|
3130
|
+
this.checkAndResetCache();
|
|
3090
3131
|
var eventArgs_1 = {
|
|
3091
3132
|
preventDefaultAction: false,
|
|
3092
3133
|
text: this.targetElement(),
|
|
@@ -3115,12 +3156,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
3115
3156
|
var query = new Query();
|
|
3116
3157
|
query = this.allowFiltering && (text !== '') ? query.where(this.fields.text, 'startswith', text, this.ignoreCase, this.ignoreAccent) : query;
|
|
3117
3158
|
if (this.enableVirtualization) {
|
|
3118
|
-
|
|
3119
|
-
this.dataUpdater(this.virtualGroupDataSource, query, this.fields);
|
|
3120
|
-
}
|
|
3121
|
-
else {
|
|
3122
|
-
this.dataUpdater(this.dataSource, query, this.fields);
|
|
3123
|
-
}
|
|
3159
|
+
this.dataUpdater(this.dataSource, query, this.fields);
|
|
3124
3160
|
}
|
|
3125
3161
|
else {
|
|
3126
3162
|
this.dataUpdater(this.mainData, query, this.fields);
|
|
@@ -3348,7 +3384,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
3348
3384
|
this.unwireListEvents();
|
|
3349
3385
|
this.wireListEvents();
|
|
3350
3386
|
};
|
|
3351
|
-
MultiSelect.prototype.initialValueUpdate = function (listItems) {
|
|
3387
|
+
MultiSelect.prototype.initialValueUpdate = function (listItems, isInitialVirtualData) {
|
|
3352
3388
|
if (this.list) {
|
|
3353
3389
|
var text = void 0;
|
|
3354
3390
|
var element = void 0;
|
|
@@ -3368,11 +3404,24 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
3368
3404
|
for (var i = 0; i < listItems.length; i++) {
|
|
3369
3405
|
if (getValue((this.fields.value ? this.fields.value : 'value'), listItems[i]) === value) {
|
|
3370
3406
|
text = getValue(this.fields.text, listItems[i]);
|
|
3407
|
+
if (this.enableVirtualization) {
|
|
3408
|
+
if (isNullOrUndefined(this.selectedListData)) {
|
|
3409
|
+
this.selectedListData = [listItems[i]];
|
|
3410
|
+
}
|
|
3411
|
+
else {
|
|
3412
|
+
if (Array.isArray(this.selectedListData)) {
|
|
3413
|
+
this.selectedListData.push((listItems[i]));
|
|
3414
|
+
}
|
|
3415
|
+
else {
|
|
3416
|
+
this.selectedListData = [this.selectedListData, (listItems[i])];
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3371
3420
|
break;
|
|
3372
3421
|
}
|
|
3373
3422
|
}
|
|
3374
3423
|
}
|
|
3375
|
-
if (isNullOrUndefined(text) && this.allowCustomValue) {
|
|
3424
|
+
if ((isNullOrUndefined(text) && this.allowCustomValue) && ((!(this.dataSource instanceof DataManager)) || (this.dataSource instanceof DataManager && isInitialVirtualData))) {
|
|
3376
3425
|
text = this.getTextByValue(value);
|
|
3377
3426
|
isCustomData = true;
|
|
3378
3427
|
}
|
|
@@ -3390,13 +3439,15 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
3390
3439
|
this.addChip(text, value);
|
|
3391
3440
|
this.addListSelection(element);
|
|
3392
3441
|
}
|
|
3393
|
-
else if (value && this.allowCustomValue) {
|
|
3442
|
+
else if ((!this.enableVirtualization && value && this.allowCustomValue) || ((this.enableVirtualization && value && this.allowCustomValue) && ((!(this.dataSource instanceof DataManager)) || (this.dataSource instanceof DataManager && isInitialVirtualData)))) {
|
|
3394
3443
|
var indexItem = this.listData.length;
|
|
3395
3444
|
var newValue = {};
|
|
3396
3445
|
setValue(this.fields.text, value, newValue);
|
|
3397
3446
|
setValue(this.fields.value, value, newValue);
|
|
3398
3447
|
var noDataEle = this.popupWrapper.querySelector('.' + dropDownBaseClasses.noData);
|
|
3399
|
-
this.
|
|
3448
|
+
if (!this.enableVirtualization) {
|
|
3449
|
+
this.addItem(newValue, indexItem);
|
|
3450
|
+
}
|
|
3400
3451
|
if (this.enableVirtualization) {
|
|
3401
3452
|
if (this.virtualCustomSelectData && this.virtualCustomSelectData.length >= 0) {
|
|
3402
3453
|
this.virtualCustomSelectData.push(newValue);
|
|
@@ -4734,8 +4785,12 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4734
4785
|
MultiSelect.prototype.totalItemsCount = function () {
|
|
4735
4786
|
var dataSourceCount;
|
|
4736
4787
|
if (this.dataSource instanceof DataManager) {
|
|
4737
|
-
|
|
4738
|
-
|
|
4788
|
+
if (this.remoteDataCount >= 0) {
|
|
4789
|
+
dataSourceCount = this.totalItemCount = this.dataCount = this.remoteDataCount;
|
|
4790
|
+
}
|
|
4791
|
+
else {
|
|
4792
|
+
this.resetList(this.dataSource);
|
|
4793
|
+
}
|
|
4739
4794
|
}
|
|
4740
4795
|
else {
|
|
4741
4796
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -4745,7 +4800,26 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4745
4800
|
this.totalItemCount = dataSourceCount != 0 ? dataSourceCount : this.totalItemCount;
|
|
4746
4801
|
}
|
|
4747
4802
|
else {
|
|
4748
|
-
|
|
4803
|
+
if (this.hideSelectedItem) {
|
|
4804
|
+
this.totalItemCount = dataSourceCount != 0 && this.value ? dataSourceCount - this.value.length : this.totalItemCount;
|
|
4805
|
+
if (this.allowCustomValue && this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
|
|
4806
|
+
for (var i = 0; i < this.virtualCustomSelectData.length; i++) {
|
|
4807
|
+
for (var j = 0; j < this.value.length; j++) {
|
|
4808
|
+
var value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[j]) : this.value[j];
|
|
4809
|
+
var customValue = getValue((this.fields.value) ? this.fields.value : '', this.virtualCustomSelectData[i]);
|
|
4810
|
+
if (value === customValue) {
|
|
4811
|
+
this.totalItemCount += 1;
|
|
4812
|
+
}
|
|
4813
|
+
}
|
|
4814
|
+
}
|
|
4815
|
+
}
|
|
4816
|
+
}
|
|
4817
|
+
else {
|
|
4818
|
+
this.totalItemCount = dataSourceCount != 0 ? dataSourceCount : this.totalItemCount;
|
|
4819
|
+
if (this.allowCustomValue && this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
|
|
4820
|
+
this.totalItemCount += this.virtualCustomSelectData.length;
|
|
4821
|
+
}
|
|
4822
|
+
}
|
|
4749
4823
|
}
|
|
4750
4824
|
};
|
|
4751
4825
|
MultiSelect.prototype.presentItemValue = function (ulElement) {
|
|
@@ -4784,7 +4858,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4784
4858
|
valuecheck = this.presentItemValue(this.ulElement);
|
|
4785
4859
|
}
|
|
4786
4860
|
if (prop == 'value' && valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
|
|
4787
|
-
&& this.listData != null) {
|
|
4861
|
+
&& this.listData != null && !this.enableVirtualization) {
|
|
4788
4862
|
this.mainData = null;
|
|
4789
4863
|
this.setDynValue = true;
|
|
4790
4864
|
this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
|
|
@@ -4803,7 +4877,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4803
4877
|
var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
|
|
4804
4878
|
this.onActionComplete(list, this.mainData);
|
|
4805
4879
|
}
|
|
4806
|
-
this.
|
|
4880
|
+
if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
|
|
4881
|
+
this.initialValueUpdate();
|
|
4882
|
+
}
|
|
4807
4883
|
if (this.mode !== 'Box' && !this.inputFocus) {
|
|
4808
4884
|
this.updateDelimView();
|
|
4809
4885
|
}
|
|
@@ -4856,6 +4932,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4856
4932
|
}
|
|
4857
4933
|
_this.beforePopupOpen = false;
|
|
4858
4934
|
_this.overAllWrapper.classList.remove(iconAnimation);
|
|
4935
|
+
var typedValue = _this.mode == 'CheckBox' ? _this.targetElement() : null;
|
|
4859
4936
|
_this.popupObj.hide(new Animation(eventArgs.animation));
|
|
4860
4937
|
attributes(_this.inputElement, { 'aria-expanded': 'false' });
|
|
4861
4938
|
_this.inputElement.removeAttribute('aria-owns');
|
|
@@ -4869,22 +4946,27 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4869
4946
|
if (_this.mode === 'CheckBox' && _this.showSelectAll) {
|
|
4870
4947
|
EventHandler.remove(_this.popupObj.element, 'click', _this.clickHandler);
|
|
4871
4948
|
}
|
|
4872
|
-
if (_this.enableVirtualization && _this.mode === 'CheckBox' && _this.enableSelectionOrder) {
|
|
4949
|
+
if (_this.enableVirtualization && _this.mode === 'CheckBox' && _this.value && _this.value.length > 0 && _this.enableSelectionOrder) {
|
|
4873
4950
|
_this.viewPortInfo.startIndex = _this.virtualItemStartIndex = 0;
|
|
4874
4951
|
_this.viewPortInfo.endIndex = _this.virtualItemEndIndex = _this.viewPortInfo.startIndex > 0 ? _this.viewPortInfo.endIndex : _this.itemCount;
|
|
4952
|
+
_this.virtualListInfo = _this.viewPortInfo;
|
|
4875
4953
|
_this.previousStartIndex = 0;
|
|
4876
4954
|
_this.previousEndIndex = 0;
|
|
4877
4955
|
}
|
|
4878
4956
|
var dataSourceCount = void 0;
|
|
4879
4957
|
if (_this.dataSource instanceof DataManager) {
|
|
4880
|
-
|
|
4881
|
-
|
|
4958
|
+
if (_this.remoteDataCount >= 0) {
|
|
4959
|
+
_this.totalItemCount = _this.dataCount = _this.remoteDataCount;
|
|
4960
|
+
}
|
|
4961
|
+
else {
|
|
4962
|
+
_this.resetList(_this.dataSource);
|
|
4963
|
+
}
|
|
4882
4964
|
}
|
|
4883
4965
|
else {
|
|
4884
4966
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4885
4967
|
dataSourceCount = _this.dataSource && _this.dataSource.length ? _this.dataSource.length : 0;
|
|
4886
4968
|
}
|
|
4887
|
-
if (_this.enableVirtualization && (_this.allowFiltering || _this.allowCustomValue) && _this.
|
|
4969
|
+
if (_this.enableVirtualization && (_this.allowFiltering || _this.allowCustomValue) && (_this.targetElement() || typedValue) && _this.totalItemCount !== dataSourceCount) {
|
|
4888
4970
|
_this.updateInitialData();
|
|
4889
4971
|
_this.checkAndResetCache();
|
|
4890
4972
|
}
|
|
@@ -5219,8 +5301,12 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
5219
5301
|
if (this.dataSource instanceof DataManager) {
|
|
5220
5302
|
this.dataSource.executeQuery(new Query().where(predicate))
|
|
5221
5303
|
.then(function (e) {
|
|
5222
|
-
if (e.result.
|
|
5223
|
-
listItems_2 = e.result
|
|
5304
|
+
if (e.result.length > 0) {
|
|
5305
|
+
listItems_2 = e.result;
|
|
5306
|
+
_this.initStatus = false;
|
|
5307
|
+
_this.initialValueUpdate(listItems_2, true);
|
|
5308
|
+
_this.initialUpdate();
|
|
5309
|
+
_this.initStatus = true;
|
|
5224
5310
|
}
|
|
5225
5311
|
});
|
|
5226
5312
|
}
|
|
@@ -5235,7 +5321,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
5235
5321
|
else {
|
|
5236
5322
|
this.setInitialValue = function () {
|
|
5237
5323
|
_this.initStatus = false;
|
|
5238
|
-
_this.
|
|
5324
|
+
if (!_this.enableVirtualization || (_this.enableVirtualization && (!(_this.dataSource instanceof DataManager)))) {
|
|
5325
|
+
_this.initialValueUpdate(listItems_2);
|
|
5326
|
+
}
|
|
5239
5327
|
_this.initialUpdate();
|
|
5240
5328
|
_this.setInitialValue = null;
|
|
5241
5329
|
_this.initStatus = true;
|