@syncfusion/ej2-dropdowns 25.1.39 → 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 +30 -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 +324 -179
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +327 -179
- 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 +9 -9
- package/src/auto-complete/auto-complete.js +2 -10
- package/src/combo-box/combo-box.js +2 -2
- 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 +51 -20
- package/src/multi-select/multi-select.d.ts +3 -1
- package/src/multi-select/multi-select.js +156 -68
|
@@ -439,9 +439,10 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
439
439
|
var query = this.parent.getForQuery(this.parent.value).clone();
|
|
440
440
|
query = query.skip(0).take(this.parent.itemCount - (this.parent.value.length - this.parent.viewPortInfo.startIndex));
|
|
441
441
|
this.parent.appendUncheckList = true;
|
|
442
|
+
this.parent.setCurrentView = false;
|
|
442
443
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
443
444
|
isListUpdated = false;
|
|
444
|
-
this.parent.appendUncheckList = false;
|
|
445
|
+
this.parent.appendUncheckList = this.parent.dataSource instanceof DataManager ? this.parent.appendUncheckList : false;
|
|
445
446
|
isListUpdated = false;
|
|
446
447
|
}
|
|
447
448
|
else {
|
|
@@ -464,9 +465,10 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
464
465
|
var query = this.parent.getForQuery(this.parent.value).clone();
|
|
465
466
|
query = query.skip(0).take(this.parent.itemCount - (this.parent.value.length - this.parent.viewPortInfo.startIndex));
|
|
466
467
|
this.parent.appendUncheckList = true;
|
|
468
|
+
this.parent.setCurrentView = false;
|
|
467
469
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
468
470
|
isListUpdated = false;
|
|
469
|
-
this.parent.appendUncheckList = false;
|
|
471
|
+
this.parent.appendUncheckList = this.parent.dataSource instanceof DataManager ? this.parent.appendUncheckList : false;
|
|
470
472
|
}
|
|
471
473
|
}
|
|
472
474
|
else {
|
|
@@ -477,6 +479,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
477
479
|
var query = this.parent.getForQuery(this.parent.value).clone();
|
|
478
480
|
var skipvalue = this.parent.viewPortInfo.startIndex - this.parent.value.length >= 0 ? this.parent.viewPortInfo.startIndex - this.parent.value.length : 0;
|
|
479
481
|
query = query.skip(skipvalue);
|
|
482
|
+
this.parent.setCurrentView = false;
|
|
480
483
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
481
484
|
isListUpdated = false;
|
|
482
485
|
}
|
|
@@ -498,6 +501,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
498
501
|
else {
|
|
499
502
|
query = query.skip(this.parent.viewPortInfo.startIndex);
|
|
500
503
|
}
|
|
504
|
+
this.parent.setCurrentView = false;
|
|
501
505
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
502
506
|
isResetListCalled = true;
|
|
503
507
|
break;
|
|
@@ -519,6 +523,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
519
523
|
else {
|
|
520
524
|
query = query.skip(this.parent.viewPortInfo.startIndex);
|
|
521
525
|
}
|
|
526
|
+
this.parent.setCurrentView = false;
|
|
522
527
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
523
528
|
isResetListCalled = true;
|
|
524
529
|
}
|
|
@@ -530,6 +535,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
530
535
|
currentData.push(alreadyAddedData[0]);
|
|
531
536
|
}
|
|
532
537
|
}
|
|
538
|
+
this.parent.setCurrentView = false;
|
|
533
539
|
}
|
|
534
540
|
}
|
|
535
541
|
if (!isResetListCalled && isListUpdated) {
|
|
@@ -597,6 +603,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
597
603
|
if (isStartIndexInitialised && !((this.parent.totalItemCount == queryStartIndex) && (this.parent.totalItemCount == queryEndIndex))) {
|
|
598
604
|
this.parent.virtualItemStartIndex = queryStartIndex;
|
|
599
605
|
this.parent.virtualItemEndIndex = queryEndIndex;
|
|
606
|
+
this.parent.setCurrentView = true;
|
|
600
607
|
this.generateAndExecuteQueryAsync(query, queryStartIndex, queryEndIndex);
|
|
601
608
|
if (this.component === 'multiselect' && this.parent.hideSelectedItem && this.parent.value && Array.isArray(this.parent.value) && this.parent.value.length > 0) {
|
|
602
609
|
this.parent.totalItemsCount();
|
|
@@ -606,7 +613,9 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
606
613
|
this.parent.virtualItemEndIndex = this.parent.viewPortInfo.endIndex;
|
|
607
614
|
}
|
|
608
615
|
}
|
|
609
|
-
this.
|
|
616
|
+
if (!(this.parent.dataSource instanceof DataManager) || (this.parent.dataSource instanceof DataManager && !this.parent.isRequesting)) {
|
|
617
|
+
this.setCurrentViewDataAsync();
|
|
618
|
+
}
|
|
610
619
|
};
|
|
611
620
|
VirtualScroll.prototype.dataProcessAsync = function (isOpenPopup) {
|
|
612
621
|
this.parent.selectedValueInfo = null;
|
|
@@ -639,7 +648,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
639
648
|
return [4 /*yield*/, this.dataProcessAsync()];
|
|
640
649
|
case 1:
|
|
641
650
|
_a.sent();
|
|
642
|
-
if (this.parent.keyboardEvent != null) {
|
|
651
|
+
if (this.parent.keyboardEvent != null && (!(this.parent.dataSource instanceof DataManager) || (this.parent.dataSource instanceof DataManager && !this.parent.isRequesting))) {
|
|
643
652
|
this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent, this.parent.pageCount);
|
|
644
653
|
}
|
|
645
654
|
if (!this.parent.customFilterQuery) {
|
|
@@ -879,9 +888,10 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
879
888
|
_this.isCheckBoxSelection = false;
|
|
880
889
|
_this.totalItemCount = 0;
|
|
881
890
|
_this.dataCount = 0;
|
|
891
|
+
_this.remoteDataCount = -1;
|
|
882
892
|
_this.isRemoteDataUpdated = false;
|
|
883
893
|
_this.isIncrementalRequest = false;
|
|
884
|
-
_this.itemCount =
|
|
894
|
+
_this.itemCount = 30;
|
|
885
895
|
_this.virtualListHeight = 0;
|
|
886
896
|
_this.isVirtualScrolling = false;
|
|
887
897
|
_this.isPreventScrollAction = false;
|
|
@@ -908,7 +918,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
908
918
|
_this.appendUncheckList = false;
|
|
909
919
|
_this.getInitialData = false;
|
|
910
920
|
_this.preventPopupOpen = true;
|
|
911
|
-
_this.customFilterQuery = new Query();
|
|
912
921
|
_this.virtualListInfo = {
|
|
913
922
|
currentPageNumber: null,
|
|
914
923
|
direction: null,
|
|
@@ -1184,10 +1193,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1184
1193
|
this.virtualListInfo = this.viewPortInfo;
|
|
1185
1194
|
};
|
|
1186
1195
|
DropDownBase.prototype.getFilteringSkeletonCount = function () {
|
|
1187
|
-
var difference = this.dataCount - this.viewPortInfo.endIndex;
|
|
1188
1196
|
var currentSkeletonCount = this.skeletonCount;
|
|
1189
1197
|
this.getSkeletonCount(true);
|
|
1190
|
-
this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount :
|
|
1198
|
+
this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : 0;
|
|
1191
1199
|
var skeletonUpdated = true;
|
|
1192
1200
|
if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'multiselect') && (this.totalItemCount < (this.itemCount * 2))) {
|
|
1193
1201
|
this.skeletonCount = 0;
|
|
@@ -1221,10 +1229,10 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1221
1229
|
DropDownBase.prototype.getSkeletonCount = function (retainSkeleton) {
|
|
1222
1230
|
this.virtualListHeight = this.listContainerHeight != null ? parseInt(this.listContainerHeight, 10) : this.virtualListHeight;
|
|
1223
1231
|
var actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
|
|
1224
|
-
this.skeletonCount = actualCount *
|
|
1232
|
+
this.skeletonCount = actualCount * 4 < this.itemCount ? this.itemCount : actualCount * 4;
|
|
1225
1233
|
this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
|
|
1226
1234
|
this.virtualItemCount = this.itemCount;
|
|
1227
|
-
this.skeletonCount = Math.floor(this.skeletonCount / 2)
|
|
1235
|
+
this.skeletonCount = Math.floor(this.skeletonCount / 2);
|
|
1228
1236
|
};
|
|
1229
1237
|
DropDownBase.prototype.GetVirtualTrackHeight = function () {
|
|
1230
1238
|
var height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
|
|
@@ -1449,41 +1457,53 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1449
1457
|
if (!eventArgs.cancel) {
|
|
1450
1458
|
_this.isRequesting = true;
|
|
1451
1459
|
_this.showSpinner();
|
|
1452
|
-
if (dataSource instanceof DataManager
|
|
1460
|
+
if (dataSource instanceof DataManager) {
|
|
1453
1461
|
_this.isRequested = true;
|
|
1462
|
+
var isWhereExist_1 = false;
|
|
1454
1463
|
if (_this.isDataFetched) {
|
|
1455
1464
|
_this.emptyDataRequest(fields);
|
|
1456
1465
|
return;
|
|
1457
1466
|
}
|
|
1458
1467
|
eventArgs.data.executeQuery(_this.getQuery(eventArgs.query)).then(function (e) {
|
|
1459
1468
|
_this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1469
|
+
var isReOrder = true;
|
|
1470
|
+
if (!_this.virtualSelectAll) {
|
|
1471
|
+
var newQuery = _this.getQuery(eventArgs.query);
|
|
1472
|
+
for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
1473
|
+
if (newQuery.queries[queryElements].fn === 'onWhere') {
|
|
1474
|
+
isWhereExist_1 = true;
|
|
1465
1475
|
}
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1476
|
+
}
|
|
1477
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1478
|
+
if (_this.isVirtualizationEnabled && (e.count != 0 && e.count < (_this.itemCount * 2))) {
|
|
1479
|
+
if (newQuery) {
|
|
1480
|
+
for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
1481
|
+
if (newQuery.queries[queryElements].fn === 'onTake') {
|
|
1482
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1483
|
+
newQuery.queries[queryElements].e.nos = e.count;
|
|
1484
|
+
}
|
|
1485
|
+
if (_this.getModuleName() === 'multiselect' && (newQuery.queries[queryElements].e.condition == 'or' || newQuery.queries[queryElements].e.operator == 'equal')) {
|
|
1486
|
+
isReOrder = false;
|
|
1487
|
+
}
|
|
1471
1488
|
}
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
else {
|
|
1492
|
+
_this.isVirtualTrackHeight = false;
|
|
1493
|
+
if (newQuery) {
|
|
1494
|
+
for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
1495
|
+
if (_this.getModuleName() === 'multiselect' && ((newQuery.queries[queryElements].e && newQuery.queries[queryElements].e.condition == 'or') || (newQuery.queries[queryElements].e && newQuery.queries[queryElements].e.operator == 'equal'))) {
|
|
1496
|
+
isReOrder = false;
|
|
1497
|
+
}
|
|
1479
1498
|
}
|
|
1480
1499
|
}
|
|
1481
|
-
_this.hideSpinner();
|
|
1482
|
-
_this.isRequested = false;
|
|
1483
|
-
_this.isRequesting = false;
|
|
1484
|
-
_this.updatePopupState();
|
|
1485
|
-
return;
|
|
1486
1500
|
}
|
|
1501
|
+
}
|
|
1502
|
+
if (isReOrder) {
|
|
1503
|
+
// eslint-disable @typescript-eslint/no-explicit-any
|
|
1504
|
+
_this.dataCount = _this.totalItemCount = e.count;
|
|
1505
|
+
}
|
|
1506
|
+
_this.trigger('actionComplete', e, function (e) {
|
|
1487
1507
|
if (!e.cancel) {
|
|
1488
1508
|
_this.isRequesting = false;
|
|
1489
1509
|
var listItems = e.result;
|
|
@@ -1491,12 +1511,16 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1491
1511
|
ulElement = _this.renderItems(listItems, fields);
|
|
1492
1512
|
return;
|
|
1493
1513
|
}
|
|
1494
|
-
if (listItems.length === 0) {
|
|
1514
|
+
if ((!_this.isVirtualizationEnabled && listItems.length === 0) || (_this.isVirtualizationEnabled && listItems.length === 0 && !isWhereExist_1)) {
|
|
1495
1515
|
_this.isDataFetched = true;
|
|
1496
1516
|
}
|
|
1517
|
+
if (!isWhereExist_1) {
|
|
1518
|
+
_this.remoteDataCount = e.count;
|
|
1519
|
+
}
|
|
1497
1520
|
_this.dataCount = e.count;
|
|
1498
1521
|
_this.totalItemCount = e.count;
|
|
1499
1522
|
ulElement = _this.renderItems(listItems, fields);
|
|
1523
|
+
_this.appendUncheckList = false;
|
|
1500
1524
|
_this.onActionComplete(ulElement, listItems, e);
|
|
1501
1525
|
if (_this.groupTemplate) {
|
|
1502
1526
|
_this.renderGroupTemplate(ulElement);
|
|
@@ -1509,6 +1533,17 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1509
1533
|
_this.preventPopupOpen = false;
|
|
1510
1534
|
return;
|
|
1511
1535
|
}
|
|
1536
|
+
if (_this.isVirtualizationEnabled && _this.setCurrentView) {
|
|
1537
|
+
_this.notify("setCurrentViewDataAsync", {
|
|
1538
|
+
module: "VirtualScroll",
|
|
1539
|
+
});
|
|
1540
|
+
}
|
|
1541
|
+
if (_this.keyboardEvent != null) {
|
|
1542
|
+
_this.handleVirtualKeyboardActions(_this.keyboardEvent, _this.pageCount);
|
|
1543
|
+
}
|
|
1544
|
+
if (_this.isVirtualizationEnabled) {
|
|
1545
|
+
_this.getFilteringSkeletonCount();
|
|
1546
|
+
}
|
|
1512
1547
|
}
|
|
1513
1548
|
});
|
|
1514
1549
|
}).catch(function (e) {
|
|
@@ -1545,7 +1580,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1545
1580
|
}
|
|
1546
1581
|
if (isReOrder) {
|
|
1547
1582
|
listItems = (newQuery).executeLocal(dataManager);
|
|
1548
|
-
_this.isVirtualTrackHeight = true;
|
|
1583
|
+
_this.isVirtualTrackHeight = (!(_this.dataSource instanceof DataManager) && !_this.isCustomDataUpdated) ? true : false;
|
|
1549
1584
|
}
|
|
1550
1585
|
}
|
|
1551
1586
|
}
|
|
@@ -1560,7 +1595,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1560
1595
|
}
|
|
1561
1596
|
}
|
|
1562
1597
|
}
|
|
1563
|
-
if (isReOrder) {
|
|
1598
|
+
if (isReOrder && (!(_this.dataSource instanceof DataManager) && !_this.isCustomDataUpdated)) {
|
|
1564
1599
|
// eslint-disable @typescript-eslint/no-explicit-any
|
|
1565
1600
|
_this.dataCount = _this.totalItemCount = _this.virtualSelectAll ? listItems.length : listItems.count;
|
|
1566
1601
|
}
|
|
@@ -1597,6 +1632,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1597
1632
|
});
|
|
1598
1633
|
}
|
|
1599
1634
|
};
|
|
1635
|
+
DropDownBase.prototype.handleVirtualKeyboardActions = function (e, pageCount) {
|
|
1636
|
+
// Used this method in component side.
|
|
1637
|
+
};
|
|
1600
1638
|
DropDownBase.prototype.updatePopupState = function () {
|
|
1601
1639
|
// Used this method in component side.
|
|
1602
1640
|
};
|
|
@@ -1708,6 +1746,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1708
1746
|
addClass([ulElement.children[i]], HIDE_GROUPLIST);
|
|
1709
1747
|
}
|
|
1710
1748
|
}
|
|
1749
|
+
if (ulElement.children[0].classList.contains('e-hide-group-header')) {
|
|
1750
|
+
setStyleAttribute(ulElement.children[1], { zIndex: 11 });
|
|
1751
|
+
}
|
|
1711
1752
|
}
|
|
1712
1753
|
}
|
|
1713
1754
|
if (!isNullOrUndefined(this.list)) {
|
|
@@ -1851,29 +1892,15 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1851
1892
|
var topIndex = Math.round(target.scrollTop / liHeight);
|
|
1852
1893
|
var liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
|
|
1853
1894
|
var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
|
|
1854
|
-
var count = 0;
|
|
1855
|
-
var isCount = false;
|
|
1856
1895
|
for (var i = topIndex; i > -1; i--) {
|
|
1857
1896
|
var index = this.isVirtualizationEnabled ? i + virtualListCount : i;
|
|
1858
1897
|
if (this.isVirtualizationEnabled) {
|
|
1859
|
-
var groupListLength = this.list.querySelectorAll('.e-list-group-item').length;
|
|
1860
|
-
var loadedGroupList = 0;
|
|
1861
|
-
if (isCount) {
|
|
1862
|
-
count++;
|
|
1863
|
-
}
|
|
1864
1898
|
if (this.fixedHeaderElement && this.updateGroupHeader(index, liCollections, target)) {
|
|
1865
|
-
|
|
1866
|
-
if (count >= this.getPageCount()) {
|
|
1867
|
-
break;
|
|
1868
|
-
}
|
|
1869
|
-
if (groupListLength <= loadedGroupList) {
|
|
1870
|
-
break;
|
|
1871
|
-
}
|
|
1899
|
+
break;
|
|
1872
1900
|
}
|
|
1873
1901
|
if (isDownkey) {
|
|
1874
1902
|
if ((!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.selected) && this.getModuleName() !== 'autocomplete') || (!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.focus) && this.getModuleName() === 'autocomplete')) {
|
|
1875
|
-
|
|
1876
|
-
isCount = true;
|
|
1903
|
+
|
|
1877
1904
|
}
|
|
1878
1905
|
}
|
|
1879
1906
|
}
|
|
@@ -3489,8 +3516,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3489
3516
|
var focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
3490
3517
|
if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
|
|
3491
3518
|
this.setSelection(focusEle, e);
|
|
3492
|
-
if (this.enableVirtualization
|
|
3519
|
+
if (this.enableVirtualization) {
|
|
3493
3520
|
var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
3521
|
+
if (this.fields.groupBy) {
|
|
3522
|
+
selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex == 0 ? this.selectedLI.offsetHeight - selectedLiOffsetTop : selectedLiOffsetTop - this.selectedLI.offsetHeight;
|
|
3523
|
+
}
|
|
3494
3524
|
this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
|
|
3495
3525
|
}
|
|
3496
3526
|
}
|
|
@@ -3527,7 +3557,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3527
3557
|
}
|
|
3528
3558
|
}
|
|
3529
3559
|
if (!isNullOrUndefined(nextItem)) {
|
|
3560
|
+
var focusAtFirstElement = this.liCollections[this.skeletonCount] && this.liCollections[this.skeletonCount].classList.contains('e-item-focus');
|
|
3530
3561
|
this.setSelection(nextItem, e);
|
|
3562
|
+
if (focusAtFirstElement && this.enableVirtualization && this.getModuleName() === 'autocomplete' && !isVirtualKeyAction) {
|
|
3563
|
+
var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
3564
|
+
selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex == 0 && this.fields.groupBy ? this.selectedLI.offsetHeight - selectedLiOffsetTop : selectedLiOffsetTop - this.selectedLI.offsetHeight;
|
|
3565
|
+
this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
|
|
3566
|
+
}
|
|
3531
3567
|
}
|
|
3532
3568
|
else if (this.enableVirtualization && !this.isPopupOpen && this.getModuleName() !== 'autocomplete' && ((this.viewPortInfo.endIndex !== this.totalItemCount && e.action === 'down') || (this.viewPortInfo.startIndex !== 0 && e.action === 'up'))) {
|
|
3533
3569
|
if (e.action === 'down') {
|
|
@@ -3654,14 +3690,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3654
3690
|
}
|
|
3655
3691
|
break;
|
|
3656
3692
|
case 'pageUp':
|
|
3657
|
-
|
|
3658
|
-
this.activeIndex = Math.round(count);
|
|
3693
|
+
this.activeIndex = this.getModuleName() === 'autocomplete' ? this.getIndexByValue(this.selectedLI.getAttribute('data-value')) + this.getPageCount() - 1 : this.getIndexByValue(this.previousValue);
|
|
3659
3694
|
this.pageUpSelection(this.activeIndex - this.getPageCount(), e, true);
|
|
3660
3695
|
e.preventDefault();
|
|
3661
3696
|
break;
|
|
3662
3697
|
case 'pageDown':
|
|
3663
|
-
this.activeIndex =
|
|
3664
|
-
this.pageDownSelection(this.activeIndex + this.getPageCount(), e, true);
|
|
3698
|
+
this.activeIndex = this.getModuleName() === 'autocomplete' ? this.getIndexByValue(this.selectedLI.getAttribute('data-value')) - this.getPageCount() : this.getIndexByValue(this.previousValue);
|
|
3699
|
+
this.pageDownSelection(!isNullOrUndefined(this.activeIndex) ? (this.activeIndex + this.getPageCount()) : (2 * this.getPageCount()), e, true);
|
|
3665
3700
|
e.preventDefault();
|
|
3666
3701
|
break;
|
|
3667
3702
|
case 'home':
|
|
@@ -3698,8 +3733,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3698
3733
|
};
|
|
3699
3734
|
DropDownList.prototype.pageUpSelection = function (steps, event, isVirtualKeyAction) {
|
|
3700
3735
|
var previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
|
|
3701
|
-
if ((this.enableVirtualization && this.activeIndex == null)
|
|
3702
|
-
previousItem = steps >= 0 ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
|
|
3736
|
+
if ((this.enableVirtualization && this.activeIndex == null)) {
|
|
3737
|
+
previousItem = (this.liCollections.length >= steps && steps >= 0) ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
|
|
3703
3738
|
}
|
|
3704
3739
|
if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
|
|
3705
3740
|
previousItem = this.liCollections[this.skeletonCount];
|
|
@@ -3731,7 +3766,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3731
3766
|
steps = this.getModuleName() === 'dropdownlist' && this.allowFiltering ? steps + 1 : steps;
|
|
3732
3767
|
previousItem = steps < list.length ? this.liCollections[steps] : this.liCollections[list.length - 1];
|
|
3733
3768
|
}
|
|
3734
|
-
if ((this.enableVirtualization && this.activeIndex == null)
|
|
3769
|
+
if ((this.enableVirtualization && this.activeIndex == null)) {
|
|
3735
3770
|
previousItem = steps <= list.length ? this.liCollections[steps + this.skeletonCount - 1] : this.liCollections[list.length - 1];
|
|
3736
3771
|
}
|
|
3737
3772
|
this.PageUpDownSelection(previousItem, event);
|
|
@@ -3917,6 +3952,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3917
3952
|
}
|
|
3918
3953
|
}
|
|
3919
3954
|
else {
|
|
3955
|
+
if (this.enableVirtualization && this.activeIndex == null && this.dataSource instanceof DataManager) {
|
|
3956
|
+
this.UpdateSkeleton();
|
|
3957
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
3958
|
+
this.ulElement = this.list.querySelector('ul');
|
|
3959
|
+
}
|
|
3920
3960
|
this.activeIndex = this.getIndexByValue(value);
|
|
3921
3961
|
}
|
|
3922
3962
|
};
|
|
@@ -3976,7 +4016,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3976
4016
|
if (this.enableVirtualization && this.value) {
|
|
3977
4017
|
var fields = (this.fields.value) ? this.fields.value : '';
|
|
3978
4018
|
var currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
|
|
3979
|
-
if (this.dataSource instanceof DataManager
|
|
4019
|
+
if (this.dataSource instanceof DataManager) {
|
|
3980
4020
|
var getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue)));
|
|
3981
4021
|
if (getItem && getItem.length > 0) {
|
|
3982
4022
|
this.itemData = getItem[0];
|
|
@@ -4321,7 +4361,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4321
4361
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
4322
4362
|
filterQuery.where('', filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
|
|
4323
4363
|
}
|
|
4324
|
-
else if (((this.getModuleName() !== 'combobox')
|
|
4364
|
+
else if (((this.getModuleName() !== 'combobox')) || (this.isFiltering() && this.getModuleName() === 'combobox' && this.typedString !== '')) {
|
|
4325
4365
|
var fields = (this.fields.text) ? this.fields.text : '';
|
|
4326
4366
|
filterQuery.where(fields, filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
|
|
4327
4367
|
}
|
|
@@ -4329,7 +4369,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4329
4369
|
else {
|
|
4330
4370
|
filterQuery = (this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery)) ? this.customFilterQuery.clone() : query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
4331
4371
|
}
|
|
4332
|
-
if (this.enableVirtualization &&
|
|
4372
|
+
if (this.enableVirtualization && this.viewPortInfo.endIndex != 0) {
|
|
4333
4373
|
var takeValue = this.getTakeValue();
|
|
4334
4374
|
var alreadySkipAdded = false;
|
|
4335
4375
|
if (filterQuery) {
|
|
@@ -4396,14 +4436,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4396
4436
|
}
|
|
4397
4437
|
filterQuery.requiresCount();
|
|
4398
4438
|
}
|
|
4399
|
-
else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
|
|
4400
|
-
for (var queryElements_4 = 0; queryElements_4 < filterQuery.queries.length; queryElements_4++) {
|
|
4401
|
-
if (filterQuery.queries[queryElements_4].fn === 'onSkip' || filterQuery.queries[queryElements_4].fn === 'onTake') {
|
|
4402
|
-
filterQuery.queries.splice(queryElements_4, 1);
|
|
4403
|
-
--queryElements_4;
|
|
4404
|
-
}
|
|
4405
|
-
}
|
|
4406
|
-
}
|
|
4407
4439
|
return filterQuery;
|
|
4408
4440
|
};
|
|
4409
4441
|
DropDownList.prototype.getSelectionPoints = function () {
|
|
@@ -4430,7 +4462,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4430
4462
|
return;
|
|
4431
4463
|
}
|
|
4432
4464
|
_this.isCustomFilter = true;
|
|
4433
|
-
_this.customFilterQuery = query;
|
|
4465
|
+
_this.customFilterQuery = query.clone();
|
|
4434
4466
|
_this.filteringAction(dataSource, query, fields);
|
|
4435
4467
|
},
|
|
4436
4468
|
baseEventArgs: e,
|
|
@@ -4736,6 +4768,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4736
4768
|
this.addNewItem(list, selectedItem);
|
|
4737
4769
|
}
|
|
4738
4770
|
if (!isNullOrUndefined(this.itemData) || (isNullOrUndefined(this.itemData) && this.enableVirtualization)) {
|
|
4771
|
+
this.getSkeletonCount();
|
|
4772
|
+
this.skeletonCount = this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2) ? 0 : this.skeletonCount;
|
|
4773
|
+
this.UpdateSkeleton();
|
|
4739
4774
|
this.focusIndexItem();
|
|
4740
4775
|
}
|
|
4741
4776
|
if (this.enableVirtualization) {
|
|
@@ -4838,7 +4873,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4838
4873
|
};
|
|
4839
4874
|
DropDownList.prototype.focusIndexItem = function () {
|
|
4840
4875
|
var value = this.getItemData().value;
|
|
4841
|
-
this.activeIndex = this.getIndexByValue(value);
|
|
4876
|
+
this.activeIndex = ((this.enableVirtualization && !isNullOrUndefined(value)) || !this.enableVirtualization) ? this.getIndexByValue(value) : this.activeIndex;
|
|
4842
4877
|
var element = this.findListElement(this.list, 'li', 'data-value', value);
|
|
4843
4878
|
this.selectedLI = element;
|
|
4844
4879
|
this.activeItem(element);
|
|
@@ -5258,7 +5293,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
5258
5293
|
}
|
|
5259
5294
|
else {
|
|
5260
5295
|
if (this.enableVirtualization) {
|
|
5261
|
-
liCount = keyAction == "pageDown" ? this.getPageCount() : liCount;
|
|
5296
|
+
liCount = keyAction == "pageDown" ? this.getPageCount() + 1 : liCount;
|
|
5262
5297
|
}
|
|
5263
5298
|
this.list.scrollTop += this.selectedLI.offsetHeight * liCount;
|
|
5264
5299
|
}
|
|
@@ -5277,7 +5312,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
5277
5312
|
this.isPreventKeyAction = false;
|
|
5278
5313
|
this.isKeyBoardAction = false;
|
|
5279
5314
|
this.isPreventScrollAction = false;
|
|
5280
|
-
nextOffset = nextOffset + (this.selectedLI.offsetHeight * liCount);
|
|
5281
5315
|
}
|
|
5282
5316
|
this.list.scrollTop = nextOffset;
|
|
5283
5317
|
}
|
|
@@ -5335,7 +5369,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
5335
5369
|
this.isPreventKeyAction = false;
|
|
5336
5370
|
this.isKeyBoardAction = false;
|
|
5337
5371
|
this.isPreventScrollAction = false;
|
|
5338
|
-
nextOffset = nextOffset - (this.selectedLI.offsetHeight * liCount);
|
|
5339
5372
|
}
|
|
5340
5373
|
this.list.scrollTop = this.list.scrollTop + nextOffset;
|
|
5341
5374
|
}
|
|
@@ -5530,7 +5563,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
5530
5563
|
sentinelInfo: {},
|
|
5531
5564
|
offsets: {},
|
|
5532
5565
|
startIndex: 0,
|
|
5533
|
-
endIndex:
|
|
5566
|
+
endIndex: this.itemCount,
|
|
5534
5567
|
};
|
|
5535
5568
|
if (this.getModuleName() === 'combobox') {
|
|
5536
5569
|
this.typedString = "";
|
|
@@ -5538,8 +5571,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
5538
5571
|
this.previousStartIndex = 0;
|
|
5539
5572
|
this.previousEndIndex = 0;
|
|
5540
5573
|
if (this.dataSource instanceof DataManager) {
|
|
5541
|
-
|
|
5542
|
-
|
|
5574
|
+
if (this.remoteDataCount >= 0) {
|
|
5575
|
+
this.totalItemCount = this.dataCount = this.remoteDataCount;
|
|
5576
|
+
}
|
|
5577
|
+
else {
|
|
5578
|
+
this.resetList(this.dataSource);
|
|
5579
|
+
}
|
|
5543
5580
|
}
|
|
5544
5581
|
else {
|
|
5545
5582
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -10010,7 +10047,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
10010
10047
|
if (this.enableVirtualization && this.value) {
|
|
10011
10048
|
var fields = (this.fields.value) ? this.fields.value : '';
|
|
10012
10049
|
var currentValue_1 = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
|
|
10013
|
-
if (this.dataSource instanceof DataManager
|
|
10050
|
+
if (this.dataSource instanceof DataManager) {
|
|
10014
10051
|
var getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue_1)));
|
|
10015
10052
|
if (getItem && getItem.length > 0) {
|
|
10016
10053
|
this.itemData = getItem[0];
|
|
@@ -10234,7 +10271,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
10234
10271
|
}
|
|
10235
10272
|
};
|
|
10236
10273
|
ComboBox.prototype.setValue = function (e) {
|
|
10237
|
-
if (e && e.type === 'keydown' && e.action === 'enter') {
|
|
10274
|
+
if ((e && e.type === 'keydown' && e.action === 'enter') || (e && e.type === 'click')) {
|
|
10238
10275
|
this.removeFillSelection();
|
|
10239
10276
|
}
|
|
10240
10277
|
if (this.autofill && this.getModuleName() === 'combobox' && e && e.type === 'keydown' && e.action !== 'enter') {
|
|
@@ -10941,7 +10978,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
10941
10978
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
10942
10979
|
filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
10943
10980
|
}
|
|
10944
|
-
else
|
|
10981
|
+
else {
|
|
10945
10982
|
var mapping = !isNullOrUndefined(this.fields.value) ? this.fields.value : '';
|
|
10946
10983
|
filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
10947
10984
|
}
|
|
@@ -10957,7 +10994,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
10957
10994
|
}
|
|
10958
10995
|
filterQuery.take(this.suggestionCount);
|
|
10959
10996
|
}
|
|
10960
|
-
if (this.enableVirtualization
|
|
10997
|
+
if (this.enableVirtualization) {
|
|
10961
10998
|
var queryTakeValue = 0;
|
|
10962
10999
|
var querySkipValue = 0;
|
|
10963
11000
|
var takeValue = this.getTakeValue();
|
|
@@ -11007,14 +11044,6 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
11007
11044
|
}
|
|
11008
11045
|
filterQuery.requiresCount();
|
|
11009
11046
|
}
|
|
11010
|
-
else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
|
|
11011
|
-
for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
11012
|
-
if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
|
|
11013
|
-
filterQuery.queries.splice(queryElements, 1);
|
|
11014
|
-
--queryElements;
|
|
11015
|
-
}
|
|
11016
|
-
}
|
|
11017
|
-
}
|
|
11018
11047
|
return filterQuery;
|
|
11019
11048
|
};
|
|
11020
11049
|
AutoComplete.prototype.searchLists = function (e) {
|
|
@@ -11814,10 +11843,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11814
11843
|
attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_popup', 'aria-controls': _this.element.id });
|
|
11815
11844
|
_this.updateAriaActiveDescendant();
|
|
11816
11845
|
if (_this.isFirstClick) {
|
|
11817
|
-
if (_this.enableVirtualization
|
|
11818
|
-
_this.
|
|
11846
|
+
if (!_this.enableVirtualization) {
|
|
11847
|
+
_this.loadTemplate();
|
|
11819
11848
|
}
|
|
11820
|
-
_this.loadTemplate();
|
|
11821
11849
|
}
|
|
11822
11850
|
if (_this.mode === 'CheckBox' && _this.showSelectAll) {
|
|
11823
11851
|
EventHandler.add(_this.popupObj.element, 'click', _this.clickHandler, _this);
|
|
@@ -11827,7 +11855,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11827
11855
|
};
|
|
11828
11856
|
MultiSelect.prototype.updateVirtualReOrderList = function (isCheckBoxUpdate) {
|
|
11829
11857
|
var query = this.getForQuery(this.value, true).clone();
|
|
11830
|
-
|
|
11858
|
+
if (this.enableVirtualization && this.dataSource instanceof DataManager) {
|
|
11859
|
+
this.resetList(this.selectedListData, this.fields, query);
|
|
11860
|
+
}
|
|
11861
|
+
else {
|
|
11862
|
+
this.resetList(this.dataSource, this.fields, query);
|
|
11863
|
+
}
|
|
11831
11864
|
this.UpdateSkeleton();
|
|
11832
11865
|
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
11833
11866
|
this.virtualItemCount = this.itemCount;
|
|
@@ -11884,6 +11917,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11884
11917
|
}
|
|
11885
11918
|
if (this.enableVirtualization) {
|
|
11886
11919
|
var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
11920
|
+
this.isKeyBoardAction = false;
|
|
11887
11921
|
this.scrollBottom(focusedItem);
|
|
11888
11922
|
}
|
|
11889
11923
|
};
|
|
@@ -12001,15 +12035,15 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12001
12035
|
MultiSelect.prototype.getForQuery = function (valuecheck, isCheckbox) {
|
|
12002
12036
|
var predicate;
|
|
12003
12037
|
var field = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
|
|
12004
|
-
if (this.enableVirtualization) {
|
|
12038
|
+
if (this.enableVirtualization && valuecheck) {
|
|
12005
12039
|
if (isCheckbox) {
|
|
12006
12040
|
for (var i = 0; i < valuecheck.length; i++) {
|
|
12007
12041
|
var value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', valuecheck[i]) : valuecheck[i];
|
|
12008
12042
|
if (i === 0) {
|
|
12009
|
-
predicate = new Predicate(field, 'equal', value);
|
|
12043
|
+
predicate = new Predicate(field, 'equal', (value));
|
|
12010
12044
|
}
|
|
12011
12045
|
else {
|
|
12012
|
-
predicate = predicate.or(field, 'equal', value);
|
|
12046
|
+
predicate = predicate.or(field, 'equal', (value));
|
|
12013
12047
|
}
|
|
12014
12048
|
}
|
|
12015
12049
|
return new Query().where(predicate);
|
|
@@ -12018,10 +12052,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12018
12052
|
for (var i = 0; i < valuecheck.length; i++) {
|
|
12019
12053
|
var value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', valuecheck[i]) : valuecheck[i];
|
|
12020
12054
|
if (i === 0) {
|
|
12021
|
-
predicate = new Predicate(field, 'notequal', value);
|
|
12055
|
+
predicate = new Predicate(field, 'notequal', (value));
|
|
12022
12056
|
}
|
|
12023
12057
|
else {
|
|
12024
|
-
predicate = predicate.and(field, 'notequal', value);
|
|
12058
|
+
predicate = predicate.and(field, 'notequal', (value));
|
|
12025
12059
|
}
|
|
12026
12060
|
}
|
|
12027
12061
|
return new Query().where(predicate);
|
|
@@ -12071,7 +12105,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12071
12105
|
valuecheck = this.presentItemValue(this.ulElement);
|
|
12072
12106
|
}
|
|
12073
12107
|
if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
|
|
12074
|
-
&& this.listData != null) {
|
|
12108
|
+
&& this.listData != null && !this.enableVirtualization) {
|
|
12075
12109
|
this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
|
|
12076
12110
|
}
|
|
12077
12111
|
else {
|
|
@@ -12082,6 +12116,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12082
12116
|
query = this.allowFiltering ? query.where(this.fields.text, 'startswith', this.inputElement.value, this.ignoreCase, this.ignoreAccent) : query;
|
|
12083
12117
|
this.checkForCustomValue(query, this.fields);
|
|
12084
12118
|
this.isCustomRendered = true;
|
|
12119
|
+
this.remoteCustomValue = this.enableVirtualization ? false : this.remoteCustomValue;
|
|
12085
12120
|
}
|
|
12086
12121
|
if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
|
|
12087
12122
|
this.removeFocus();
|
|
@@ -12126,7 +12161,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12126
12161
|
if (!isNullOrUndefined(this.text) && (isNullOrUndefined(this.value) || this.value.length === 0)) {
|
|
12127
12162
|
this.initialTextUpdate();
|
|
12128
12163
|
}
|
|
12129
|
-
this.
|
|
12164
|
+
if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
|
|
12165
|
+
this.initialValueUpdate();
|
|
12166
|
+
}
|
|
12130
12167
|
this.initialUpdate();
|
|
12131
12168
|
this.refreshPlaceHolder();
|
|
12132
12169
|
if (this.mode !== 'CheckBox' && this.changeOnBlur) {
|
|
@@ -12329,7 +12366,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12329
12366
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
12330
12367
|
filterQuery.where('', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);
|
|
12331
12368
|
}
|
|
12332
|
-
else {
|
|
12369
|
+
else if ((this.enableVirtualization && this.targetElement() !== "") || !this.enableVirtualization) {
|
|
12333
12370
|
var fields = this.fields;
|
|
12334
12371
|
filterQuery.where(!isNullOrUndefined(fields.text) ? fields.text : '', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);
|
|
12335
12372
|
}
|
|
@@ -12340,18 +12377,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12340
12377
|
return filterQuery;
|
|
12341
12378
|
}
|
|
12342
12379
|
else {
|
|
12343
|
-
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll
|
|
12380
|
+
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll) {
|
|
12344
12381
|
return this.virtualFilterQuery(filterQuery);
|
|
12345
12382
|
}
|
|
12346
|
-
else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
|
|
12347
|
-
for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
12348
|
-
if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
|
|
12349
|
-
filterQuery.queries.splice(queryElements, 1);
|
|
12350
|
-
--queryElements;
|
|
12351
|
-
}
|
|
12352
|
-
}
|
|
12353
|
-
return filterQuery;
|
|
12354
|
-
}
|
|
12355
12383
|
return query ? query : this.query ? this.query : new Query();
|
|
12356
12384
|
}
|
|
12357
12385
|
};
|
|
@@ -12514,7 +12542,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12514
12542
|
var dataItem_1 = {};
|
|
12515
12543
|
setValue(field.text, value, dataItem_1);
|
|
12516
12544
|
if (typeof getValue((this.fields.value ? this.fields.value : 'value'), customData)
|
|
12517
|
-
=== 'number') {
|
|
12545
|
+
=== 'number' && this.fields.value !== this.fields.text) {
|
|
12518
12546
|
setValue(field.value, Math.random(), dataItem_1);
|
|
12519
12547
|
}
|
|
12520
12548
|
else {
|
|
@@ -12531,17 +12559,19 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12531
12559
|
dataItem_1 = this.allowObjectBinding ? emptyObject_1 : dataItem_1;
|
|
12532
12560
|
if (this.enableVirtualization) {
|
|
12533
12561
|
this.virtualCustomData = dataItem_1;
|
|
12534
|
-
var tempData = this.
|
|
12562
|
+
var tempData = this.dataSource instanceof DataManager ? JSON.parse(JSON.stringify(this.listData)) : JSON.parse(JSON.stringify(this.dataSource));
|
|
12535
12563
|
var totalData = [];
|
|
12536
12564
|
if (this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
|
|
12537
12565
|
totalData = tempData.concat(this.virtualCustomSelectData);
|
|
12538
12566
|
}
|
|
12539
12567
|
tempData.splice(0, 0, dataItem_1);
|
|
12540
12568
|
this.isCustomDataUpdated = true;
|
|
12569
|
+
var tempCount = this.totalItemCount;
|
|
12541
12570
|
this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
|
|
12542
12571
|
this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.itemCount;
|
|
12543
12572
|
this.resetList(tempData, field, query);
|
|
12544
12573
|
this.isCustomDataUpdated = false;
|
|
12574
|
+
this.totalItemCount = this.enableVirtualization && this.dataSource instanceof DataManager ? tempCount : this.totalItemCount;
|
|
12545
12575
|
}
|
|
12546
12576
|
else {
|
|
12547
12577
|
var tempData = JSON.parse(JSON.stringify(this.listData));
|
|
@@ -12562,7 +12592,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12562
12592
|
else if (this.listData && this.mainData && !dataChecks && this.allowCustomValue) {
|
|
12563
12593
|
if (this.allowFiltering && this.isRemoteSelection && this.remoteCustomValue) {
|
|
12564
12594
|
this.isRemoteSelection = false;
|
|
12565
|
-
|
|
12595
|
+
if (!this.enableVirtualization) {
|
|
12596
|
+
this.resetList(this.listData, field, query);
|
|
12597
|
+
}
|
|
12566
12598
|
}
|
|
12567
12599
|
else if (!this.allowFiltering && this.list) {
|
|
12568
12600
|
var liCollections = this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-hide-listitem)');
|
|
@@ -12819,21 +12851,25 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12819
12851
|
+ dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
|
|
12820
12852
|
var previousItem = steps >= 0 ? collection[steps + 1] : collection[0];
|
|
12821
12853
|
if (this.enableVirtualization && isVirtualKeyAction) {
|
|
12822
|
-
previousItem =
|
|
12854
|
+
previousItem = (this.liCollections.length >= steps && steps >= 0) ? this.liCollections[steps] : this.liCollections[this.skeletonCount];
|
|
12823
12855
|
}
|
|
12824
12856
|
if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
|
|
12825
12857
|
previousItem = this.liCollections[this.skeletonCount];
|
|
12826
12858
|
}
|
|
12827
12859
|
if (this.enableVirtualization) {
|
|
12828
12860
|
if (!isNullOrUndefined(previousItem) && !previousItem.classList.contains('e-item-focus')) {
|
|
12861
|
+
this.isKeyBoardAction = true;
|
|
12829
12862
|
this.addListFocus(previousItem);
|
|
12830
12863
|
this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
|
|
12831
12864
|
}
|
|
12832
12865
|
else if (this.viewPortInfo.startIndex == 0) {
|
|
12866
|
+
this.isKeyBoardAction = true;
|
|
12833
12867
|
this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
|
|
12834
12868
|
}
|
|
12869
|
+
this.previousFocusItem = previousItem;
|
|
12835
12870
|
}
|
|
12836
12871
|
else {
|
|
12872
|
+
this.isKeyBoardAction = true;
|
|
12837
12873
|
this.addListFocus(previousItem);
|
|
12838
12874
|
this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
|
|
12839
12875
|
}
|
|
@@ -12850,7 +12886,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12850
12886
|
if (this.enableVirtualization && isVirtualKeyAction) {
|
|
12851
12887
|
previousItem = steps <= list.length ? this.liCollections[steps] : this.liCollections[list.length - 1];
|
|
12852
12888
|
}
|
|
12889
|
+
this.isKeyBoardAction = true;
|
|
12853
12890
|
this.addListFocus(previousItem);
|
|
12891
|
+
this.previousFocusItem = previousItem;
|
|
12854
12892
|
this.scrollBottom(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), false, this.keyboardEvent.keyCode);
|
|
12855
12893
|
};
|
|
12856
12894
|
MultiSelect.prototype.getItems = function () {
|
|
@@ -13039,18 +13077,16 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
13039
13077
|
case 33:
|
|
13040
13078
|
e.preventDefault();
|
|
13041
13079
|
if (focusedItem) {
|
|
13042
|
-
|
|
13043
|
-
activeIndex
|
|
13044
|
-
activeIndex = this.getIndexByValue(focusedItem.getAttribute('data-value'));
|
|
13045
|
-
this.pageUpSelection(activeIndex - this.getPageCount(), true);
|
|
13080
|
+
activeIndex = this.getIndexByValue(this.previousFocusItem.getAttribute('data-value')) - 1;
|
|
13081
|
+
this.pageUpSelection(activeIndex, true);
|
|
13046
13082
|
this.updateAriaAttribute();
|
|
13047
13083
|
}
|
|
13048
13084
|
break;
|
|
13049
13085
|
case 34:
|
|
13050
13086
|
e.preventDefault();
|
|
13051
13087
|
if (focusedItem) {
|
|
13052
|
-
activeIndex = this.getIndexByValue(
|
|
13053
|
-
this.pageDownSelection(activeIndex
|
|
13088
|
+
activeIndex = this.getIndexByValue(this.previousFocusItem.getAttribute('data-value'));
|
|
13089
|
+
this.pageDownSelection(activeIndex, true);
|
|
13054
13090
|
this.updateAriaAttribute();
|
|
13055
13091
|
}
|
|
13056
13092
|
break;
|
|
@@ -13086,11 +13122,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
13086
13122
|
else if (this.isPopupOpen()) {
|
|
13087
13123
|
var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
13088
13124
|
var activeIndex = void 0;
|
|
13089
|
-
this.isKeyBoardAction = true;
|
|
13090
13125
|
switch (e.keyCode) {
|
|
13091
13126
|
case 36:
|
|
13092
13127
|
case 35:
|
|
13093
13128
|
this.isMouseScrollAction = true;
|
|
13129
|
+
this.isKeyBoardAction = true;
|
|
13094
13130
|
this.homeNavigation((e.keyCode === 36) ? true : false);
|
|
13095
13131
|
break;
|
|
13096
13132
|
case 33:
|
|
@@ -13104,19 +13140,22 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
13104
13140
|
case 34:
|
|
13105
13141
|
e.preventDefault();
|
|
13106
13142
|
if (focusedItem) {
|
|
13107
|
-
this.getIndexByValue(focusedItem.getAttribute('data-value'));
|
|
13143
|
+
activeIndex = this.getIndexByValue(focusedItem.getAttribute('data-value'));
|
|
13108
13144
|
this.pageDownSelection(activeIndex + this.getPageCount());
|
|
13109
13145
|
this.updateAriaAttribute();
|
|
13110
13146
|
}
|
|
13111
13147
|
return;
|
|
13112
13148
|
case 38:
|
|
13149
|
+
this.isKeyBoardAction = true;
|
|
13113
13150
|
this.arrowUp(e);
|
|
13114
13151
|
break;
|
|
13115
13152
|
case 40:
|
|
13153
|
+
this.isKeyBoardAction = true;
|
|
13116
13154
|
this.arrowDown(e);
|
|
13117
13155
|
break;
|
|
13118
13156
|
case 27:
|
|
13119
13157
|
e.preventDefault();
|
|
13158
|
+
this.isKeyBoardAction = true;
|
|
13120
13159
|
this.hidePopup(e);
|
|
13121
13160
|
if (this.mode === 'CheckBox') {
|
|
13122
13161
|
this.inputElement.focus();
|
|
@@ -13124,16 +13163,19 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
13124
13163
|
return;
|
|
13125
13164
|
case 13:
|
|
13126
13165
|
e.preventDefault();
|
|
13166
|
+
this.isKeyBoardAction = true;
|
|
13127
13167
|
if (this.mode !== 'CheckBox') {
|
|
13128
13168
|
this.selectByKey(e);
|
|
13129
13169
|
}
|
|
13130
13170
|
this.checkPlaceholderSize();
|
|
13131
13171
|
return;
|
|
13132
13172
|
case 32:
|
|
13173
|
+
this.isKeyBoardAction = true;
|
|
13133
13174
|
this.spaceKeySelection(e);
|
|
13134
13175
|
return;
|
|
13135
13176
|
case 9:
|
|
13136
13177
|
e.preventDefault();
|
|
13178
|
+
this.isKeyBoardAction = true;
|
|
13137
13179
|
this.hidePopup(e);
|
|
13138
13180
|
this.inputElement.focus();
|
|
13139
13181
|
this.overAllWrapper.classList.add(FOCUS);
|
|
@@ -13334,7 +13376,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
13334
13376
|
this.isPreventKeyAction = false;
|
|
13335
13377
|
this.isKeyBoardAction = false;
|
|
13336
13378
|
this.isPreventScrollAction = false;
|
|
13337
|
-
nextOffset = nextOffset + (selectedLI.offsetHeight * liCount);
|
|
13338
13379
|
}
|
|
13339
13380
|
this.list.scrollTop = nextOffset;
|
|
13340
13381
|
}
|
|
@@ -13366,9 +13407,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
13366
13407
|
if (this.enableVirtualization && this.isKeyBoardAction && firstElementValue && currentElementValue === firstElementValue && keyCode != 36 && !this.isVirtualScrolling) {
|
|
13367
13408
|
this.isUpwardScrolling = true;
|
|
13368
13409
|
this.isPreventKeyAction = true;
|
|
13410
|
+
this.isKeyBoardAction = false;
|
|
13369
13411
|
this.list.scrollTop -= selectedLI.offsetHeight * liCount;
|
|
13370
13412
|
this.isPreventKeyAction = this.list.scrollTop != 0 ? this.isPreventKeyAction : false;
|
|
13371
|
-
this.isKeyBoardAction = false;
|
|
13372
13413
|
this.isPreventScrollAction = false;
|
|
13373
13414
|
}
|
|
13374
13415
|
else if (this.enableVirtualization && keyCode == 36) {
|
|
@@ -13382,7 +13423,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
13382
13423
|
this.isPreventKeyAction = false;
|
|
13383
13424
|
this.isKeyBoardAction = false;
|
|
13384
13425
|
this.isPreventScrollAction = false;
|
|
13385
|
-
nextOffset = nextOffset - (selectedLI.offsetHeight * liCount);
|
|
13386
13426
|
}
|
|
13387
13427
|
this.list.scrollTop = this.list.scrollTop + nextOffset;
|
|
13388
13428
|
}
|
|
@@ -13583,7 +13623,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
13583
13623
|
this.addListFocus(elements[temp]);
|
|
13584
13624
|
}
|
|
13585
13625
|
else {
|
|
13586
|
-
this.
|
|
13626
|
+
if (this.enableVirtualization && elements[temp + 1].classList.contains('e-virtual-list')) {
|
|
13627
|
+
this.addListFocus(elements[this.skeletonCount]);
|
|
13628
|
+
}
|
|
13629
|
+
else {
|
|
13630
|
+
this.addListFocus(elements[++temp]);
|
|
13631
|
+
}
|
|
13587
13632
|
}
|
|
13588
13633
|
if (temp > -1) {
|
|
13589
13634
|
this.updateCheck(elements[temp]);
|
|
@@ -13802,6 +13847,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
13802
13847
|
removeVal = [];
|
|
13803
13848
|
}
|
|
13804
13849
|
removeVal.splice(index, 1);
|
|
13850
|
+
if (_this.enableVirtualization && _this.mode === 'CheckBox') {
|
|
13851
|
+
_this.selectedListData.splice(index, 1);
|
|
13852
|
+
}
|
|
13805
13853
|
_this.setProperties({ value: [].concat([], removeVal) }, true);
|
|
13806
13854
|
if (_this.enableVirtualization) {
|
|
13807
13855
|
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], '');
|
|
@@ -14046,6 +14094,19 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14046
14094
|
_this.listData = list;
|
|
14047
14095
|
}
|
|
14048
14096
|
value = _this.allowObjectBinding ? _this.getDataByValue(value) : value;
|
|
14097
|
+
if (_this.enableVirtualization) {
|
|
14098
|
+
if (isNullOrUndefined(_this.selectedListData)) {
|
|
14099
|
+
_this.selectedListData = [(_this.getDataByValue(value))];
|
|
14100
|
+
}
|
|
14101
|
+
else {
|
|
14102
|
+
if (Array.isArray(_this.selectedListData)) {
|
|
14103
|
+
_this.selectedListData.push((_this.getDataByValue(value)));
|
|
14104
|
+
}
|
|
14105
|
+
else {
|
|
14106
|
+
_this.selectedListData = [_this.selectedListData, (_this.getDataByValue(value))];
|
|
14107
|
+
}
|
|
14108
|
+
}
|
|
14109
|
+
}
|
|
14049
14110
|
if ((_this.enableVirtualization && value) || !_this.enableVirtualization) {
|
|
14050
14111
|
_this.updateListSelectEventCallback(value, element, eve);
|
|
14051
14112
|
}
|
|
@@ -14237,7 +14298,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14237
14298
|
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
14238
14299
|
this.virtualItemCount = this.itemCount;
|
|
14239
14300
|
if (this.mode !== 'CheckBox') {
|
|
14240
|
-
this.
|
|
14301
|
+
this.totalItemsCount();
|
|
14241
14302
|
}
|
|
14242
14303
|
if (!this.list.querySelector('.e-virtual-ddl')) {
|
|
14243
14304
|
var virualElement = this.createElement('div', {
|
|
@@ -14330,6 +14391,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14330
14391
|
}
|
|
14331
14392
|
_this.isPreventScrollAction = true;
|
|
14332
14393
|
_this.setScrollPosition();
|
|
14394
|
+
if (!_this.list.classList.contains(dropDownBaseClasses.noData) && _this.getItems()[1] && _this.getItems()[1].offsetHeight !== 0) {
|
|
14395
|
+
_this.listItemHeight = _this.getItems()[1].offsetHeight;
|
|
14396
|
+
if (_this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
|
|
14397
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14398
|
+
_this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = _this.getTransformValues();
|
|
14399
|
+
}
|
|
14400
|
+
}
|
|
14333
14401
|
if (_this.allowFiltering) {
|
|
14334
14402
|
_this.notify('inputFocus', {
|
|
14335
14403
|
module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'focus'
|
|
@@ -14435,13 +14503,17 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14435
14503
|
sentinelInfo: {},
|
|
14436
14504
|
offsets: {},
|
|
14437
14505
|
startIndex: 0,
|
|
14438
|
-
endIndex:
|
|
14506
|
+
endIndex: this.itemCount,
|
|
14439
14507
|
};
|
|
14440
14508
|
this.previousStartIndex = 0;
|
|
14441
14509
|
this.previousEndIndex = 0;
|
|
14442
14510
|
if (this.dataSource instanceof DataManager) {
|
|
14443
|
-
|
|
14444
|
-
|
|
14511
|
+
if (this.remoteDataCount >= 0) {
|
|
14512
|
+
this.totalItemCount = this.dataCount = this.remoteDataCount;
|
|
14513
|
+
}
|
|
14514
|
+
else {
|
|
14515
|
+
this.resetList(this.dataSource);
|
|
14516
|
+
}
|
|
14445
14517
|
}
|
|
14446
14518
|
else {
|
|
14447
14519
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -14583,7 +14655,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14583
14655
|
EventHandler.add(formElement, 'reset', this.resetValueHandler, this);
|
|
14584
14656
|
}
|
|
14585
14657
|
EventHandler.add(this.componentWrapper, 'mouseout', this.mouseOut, this);
|
|
14586
|
-
EventHandler.add(this.overAllClear, '
|
|
14658
|
+
EventHandler.add(this.overAllClear, 'mousedown', this.clearAll, this);
|
|
14587
14659
|
EventHandler.add(this.inputElement, 'paste', this.pasteHandler, this);
|
|
14588
14660
|
};
|
|
14589
14661
|
MultiSelect.prototype.onInput = function (e) {
|
|
@@ -14627,9 +14699,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14627
14699
|
if (this.allowCustomValue) {
|
|
14628
14700
|
this.isRemoteSelection = true;
|
|
14629
14701
|
}
|
|
14630
|
-
|
|
14631
|
-
this.checkAndResetCache();
|
|
14632
|
-
}
|
|
14702
|
+
this.checkAndResetCache();
|
|
14633
14703
|
var eventArgs_1 = {
|
|
14634
14704
|
preventDefaultAction: false,
|
|
14635
14705
|
text: this.targetElement(),
|
|
@@ -14658,12 +14728,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14658
14728
|
var query = new Query();
|
|
14659
14729
|
query = this.allowFiltering && (text !== '') ? query.where(this.fields.text, 'startswith', text, this.ignoreCase, this.ignoreAccent) : query;
|
|
14660
14730
|
if (this.enableVirtualization) {
|
|
14661
|
-
|
|
14662
|
-
this.dataUpdater(this.virtualGroupDataSource, query, this.fields);
|
|
14663
|
-
}
|
|
14664
|
-
else {
|
|
14665
|
-
this.dataUpdater(this.dataSource, query, this.fields);
|
|
14666
|
-
}
|
|
14731
|
+
this.dataUpdater(this.dataSource, query, this.fields);
|
|
14667
14732
|
}
|
|
14668
14733
|
else {
|
|
14669
14734
|
this.dataUpdater(this.mainData, query, this.fields);
|
|
@@ -14891,7 +14956,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14891
14956
|
this.unwireListEvents();
|
|
14892
14957
|
this.wireListEvents();
|
|
14893
14958
|
};
|
|
14894
|
-
MultiSelect.prototype.initialValueUpdate = function (listItems) {
|
|
14959
|
+
MultiSelect.prototype.initialValueUpdate = function (listItems, isInitialVirtualData) {
|
|
14895
14960
|
if (this.list) {
|
|
14896
14961
|
var text = void 0;
|
|
14897
14962
|
var element = void 0;
|
|
@@ -14911,11 +14976,24 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14911
14976
|
for (var i = 0; i < listItems.length; i++) {
|
|
14912
14977
|
if (getValue((this.fields.value ? this.fields.value : 'value'), listItems[i]) === value) {
|
|
14913
14978
|
text = getValue(this.fields.text, listItems[i]);
|
|
14979
|
+
if (this.enableVirtualization) {
|
|
14980
|
+
if (isNullOrUndefined(this.selectedListData)) {
|
|
14981
|
+
this.selectedListData = [listItems[i]];
|
|
14982
|
+
}
|
|
14983
|
+
else {
|
|
14984
|
+
if (Array.isArray(this.selectedListData)) {
|
|
14985
|
+
this.selectedListData.push((listItems[i]));
|
|
14986
|
+
}
|
|
14987
|
+
else {
|
|
14988
|
+
this.selectedListData = [this.selectedListData, (listItems[i])];
|
|
14989
|
+
}
|
|
14990
|
+
}
|
|
14991
|
+
}
|
|
14914
14992
|
break;
|
|
14915
14993
|
}
|
|
14916
14994
|
}
|
|
14917
14995
|
}
|
|
14918
|
-
if (isNullOrUndefined(text) && this.allowCustomValue) {
|
|
14996
|
+
if ((isNullOrUndefined(text) && this.allowCustomValue) && ((!(this.dataSource instanceof DataManager)) || (this.dataSource instanceof DataManager && isInitialVirtualData))) {
|
|
14919
14997
|
text = this.getTextByValue(value);
|
|
14920
14998
|
isCustomData = true;
|
|
14921
14999
|
}
|
|
@@ -14933,13 +15011,15 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14933
15011
|
this.addChip(text, value);
|
|
14934
15012
|
this.addListSelection(element);
|
|
14935
15013
|
}
|
|
14936
|
-
else if (value && this.allowCustomValue) {
|
|
15014
|
+
else if ((!this.enableVirtualization && value && this.allowCustomValue) || ((this.enableVirtualization && value && this.allowCustomValue) && ((!(this.dataSource instanceof DataManager)) || (this.dataSource instanceof DataManager && isInitialVirtualData)))) {
|
|
14937
15015
|
var indexItem = this.listData.length;
|
|
14938
15016
|
var newValue = {};
|
|
14939
15017
|
setValue(this.fields.text, value, newValue);
|
|
14940
15018
|
setValue(this.fields.value, value, newValue);
|
|
14941
15019
|
var noDataEle = this.popupWrapper.querySelector('.' + dropDownBaseClasses.noData);
|
|
14942
|
-
this.
|
|
15020
|
+
if (!this.enableVirtualization) {
|
|
15021
|
+
this.addItem(newValue, indexItem);
|
|
15022
|
+
}
|
|
14943
15023
|
if (this.enableVirtualization) {
|
|
14944
15024
|
if (this.virtualCustomSelectData && this.virtualCustomSelectData.length >= 0) {
|
|
14945
15025
|
this.virtualCustomSelectData.push(newValue);
|
|
@@ -16277,8 +16357,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
16277
16357
|
MultiSelect.prototype.totalItemsCount = function () {
|
|
16278
16358
|
var dataSourceCount;
|
|
16279
16359
|
if (this.dataSource instanceof DataManager) {
|
|
16280
|
-
|
|
16281
|
-
|
|
16360
|
+
if (this.remoteDataCount >= 0) {
|
|
16361
|
+
dataSourceCount = this.totalItemCount = this.dataCount = this.remoteDataCount;
|
|
16362
|
+
}
|
|
16363
|
+
else {
|
|
16364
|
+
this.resetList(this.dataSource);
|
|
16365
|
+
}
|
|
16282
16366
|
}
|
|
16283
16367
|
else {
|
|
16284
16368
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -16288,7 +16372,26 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
16288
16372
|
this.totalItemCount = dataSourceCount != 0 ? dataSourceCount : this.totalItemCount;
|
|
16289
16373
|
}
|
|
16290
16374
|
else {
|
|
16291
|
-
|
|
16375
|
+
if (this.hideSelectedItem) {
|
|
16376
|
+
this.totalItemCount = dataSourceCount != 0 && this.value ? dataSourceCount - this.value.length : this.totalItemCount;
|
|
16377
|
+
if (this.allowCustomValue && this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
|
|
16378
|
+
for (var i = 0; i < this.virtualCustomSelectData.length; i++) {
|
|
16379
|
+
for (var j = 0; j < this.value.length; j++) {
|
|
16380
|
+
var value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[j]) : this.value[j];
|
|
16381
|
+
var customValue = getValue((this.fields.value) ? this.fields.value : '', this.virtualCustomSelectData[i]);
|
|
16382
|
+
if (value === customValue) {
|
|
16383
|
+
this.totalItemCount += 1;
|
|
16384
|
+
}
|
|
16385
|
+
}
|
|
16386
|
+
}
|
|
16387
|
+
}
|
|
16388
|
+
}
|
|
16389
|
+
else {
|
|
16390
|
+
this.totalItemCount = dataSourceCount != 0 ? dataSourceCount : this.totalItemCount;
|
|
16391
|
+
if (this.allowCustomValue && this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
|
|
16392
|
+
this.totalItemCount += this.virtualCustomSelectData.length;
|
|
16393
|
+
}
|
|
16394
|
+
}
|
|
16292
16395
|
}
|
|
16293
16396
|
};
|
|
16294
16397
|
MultiSelect.prototype.presentItemValue = function (ulElement) {
|
|
@@ -16327,7 +16430,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
16327
16430
|
valuecheck = this.presentItemValue(this.ulElement);
|
|
16328
16431
|
}
|
|
16329
16432
|
if (prop == 'value' && valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
|
|
16330
|
-
&& this.listData != null) {
|
|
16433
|
+
&& this.listData != null && !this.enableVirtualization) {
|
|
16331
16434
|
this.mainData = null;
|
|
16332
16435
|
this.setDynValue = true;
|
|
16333
16436
|
this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
|
|
@@ -16346,7 +16449,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
16346
16449
|
var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
|
|
16347
16450
|
this.onActionComplete(list, this.mainData);
|
|
16348
16451
|
}
|
|
16349
|
-
this.
|
|
16452
|
+
if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
|
|
16453
|
+
this.initialValueUpdate();
|
|
16454
|
+
}
|
|
16350
16455
|
if (this.mode !== 'Box' && !this.inputFocus) {
|
|
16351
16456
|
this.updateDelimView();
|
|
16352
16457
|
}
|
|
@@ -16399,6 +16504,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
16399
16504
|
}
|
|
16400
16505
|
_this.beforePopupOpen = false;
|
|
16401
16506
|
_this.overAllWrapper.classList.remove(iconAnimation);
|
|
16507
|
+
var typedValue = _this.mode == 'CheckBox' ? _this.targetElement() : null;
|
|
16402
16508
|
_this.popupObj.hide(new Animation(eventArgs.animation));
|
|
16403
16509
|
attributes(_this.inputElement, { 'aria-expanded': 'false' });
|
|
16404
16510
|
_this.inputElement.removeAttribute('aria-owns');
|
|
@@ -16412,22 +16518,27 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
16412
16518
|
if (_this.mode === 'CheckBox' && _this.showSelectAll) {
|
|
16413
16519
|
EventHandler.remove(_this.popupObj.element, 'click', _this.clickHandler);
|
|
16414
16520
|
}
|
|
16415
|
-
if (_this.enableVirtualization && _this.mode === 'CheckBox' && _this.enableSelectionOrder) {
|
|
16521
|
+
if (_this.enableVirtualization && _this.mode === 'CheckBox' && _this.value && _this.value.length > 0 && _this.enableSelectionOrder) {
|
|
16416
16522
|
_this.viewPortInfo.startIndex = _this.virtualItemStartIndex = 0;
|
|
16417
16523
|
_this.viewPortInfo.endIndex = _this.virtualItemEndIndex = _this.viewPortInfo.startIndex > 0 ? _this.viewPortInfo.endIndex : _this.itemCount;
|
|
16524
|
+
_this.virtualListInfo = _this.viewPortInfo;
|
|
16418
16525
|
_this.previousStartIndex = 0;
|
|
16419
16526
|
_this.previousEndIndex = 0;
|
|
16420
16527
|
}
|
|
16421
16528
|
var dataSourceCount = void 0;
|
|
16422
16529
|
if (_this.dataSource instanceof DataManager) {
|
|
16423
|
-
|
|
16424
|
-
|
|
16530
|
+
if (_this.remoteDataCount >= 0) {
|
|
16531
|
+
_this.totalItemCount = _this.dataCount = _this.remoteDataCount;
|
|
16532
|
+
}
|
|
16533
|
+
else {
|
|
16534
|
+
_this.resetList(_this.dataSource);
|
|
16535
|
+
}
|
|
16425
16536
|
}
|
|
16426
16537
|
else {
|
|
16427
16538
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16428
16539
|
dataSourceCount = _this.dataSource && _this.dataSource.length ? _this.dataSource.length : 0;
|
|
16429
16540
|
}
|
|
16430
|
-
if (_this.enableVirtualization && (_this.allowFiltering || _this.allowCustomValue) && _this.
|
|
16541
|
+
if (_this.enableVirtualization && (_this.allowFiltering || _this.allowCustomValue) && (_this.targetElement() || typedValue) && _this.totalItemCount !== dataSourceCount) {
|
|
16431
16542
|
_this.updateInitialData();
|
|
16432
16543
|
_this.checkAndResetCache();
|
|
16433
16544
|
}
|
|
@@ -16762,8 +16873,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
16762
16873
|
if (this.dataSource instanceof DataManager) {
|
|
16763
16874
|
this.dataSource.executeQuery(new Query().where(predicate))
|
|
16764
16875
|
.then(function (e) {
|
|
16765
|
-
if (e.result.
|
|
16766
|
-
listItems_2 = e.result
|
|
16876
|
+
if (e.result.length > 0) {
|
|
16877
|
+
listItems_2 = e.result;
|
|
16878
|
+
_this.initStatus = false;
|
|
16879
|
+
_this.initialValueUpdate(listItems_2, true);
|
|
16880
|
+
_this.initialUpdate();
|
|
16881
|
+
_this.initStatus = true;
|
|
16767
16882
|
}
|
|
16768
16883
|
});
|
|
16769
16884
|
}
|
|
@@ -16778,7 +16893,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
16778
16893
|
else {
|
|
16779
16894
|
this.setInitialValue = function () {
|
|
16780
16895
|
_this.initStatus = false;
|
|
16781
|
-
_this.
|
|
16896
|
+
if (!_this.enableVirtualization || (_this.enableVirtualization && (!(_this.dataSource instanceof DataManager)))) {
|
|
16897
|
+
_this.initialValueUpdate(listItems_2);
|
|
16898
|
+
}
|
|
16782
16899
|
_this.initialUpdate();
|
|
16783
16900
|
_this.setInitialValue = null;
|
|
16784
16901
|
_this.initStatus = true;
|
|
@@ -18146,12 +18263,14 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
18146
18263
|
else {
|
|
18147
18264
|
scrollParent = wrapper;
|
|
18148
18265
|
}
|
|
18149
|
-
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18266
|
+
if (scrollParent) {
|
|
18267
|
+
boundRect = scrollParent.getBoundingClientRect();
|
|
18268
|
+
if ((boundRect.y + scrollParent.offsetHeight) - (event.clientY + scrollMoved) < 1) {
|
|
18269
|
+
this.timer = window.setInterval(function () { _this.setScrollDown(scrollParent, scrollHeight, true); }, 70);
|
|
18270
|
+
}
|
|
18271
|
+
else if ((event.clientY - scrollMoved) - boundRect.y < 1) {
|
|
18272
|
+
this.timer = window.setInterval(function () { _this.setScrollDown(scrollParent, scrollHeight, false); }, 70);
|
|
18273
|
+
}
|
|
18155
18274
|
}
|
|
18156
18275
|
}
|
|
18157
18276
|
if (args.target === null) {
|
|
@@ -18574,6 +18693,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
18574
18693
|
if (this.listData.length === 0) {
|
|
18575
18694
|
this.l10nUpdate();
|
|
18576
18695
|
}
|
|
18696
|
+
if (this.listData.length !== this.sortedData.length) {
|
|
18697
|
+
this.sortedData = this.listData;
|
|
18698
|
+
}
|
|
18577
18699
|
this.value = [];
|
|
18578
18700
|
this.updateToolBarState();
|
|
18579
18701
|
};
|
|
@@ -19296,6 +19418,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
19296
19418
|
var jsonData = [].slice.call(tListBox.jsonData);
|
|
19297
19419
|
var isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
|
|
19298
19420
|
fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
|
|
19421
|
+
var tempLiColl = [];
|
|
19422
|
+
var tempData = [];
|
|
19423
|
+
var flistboxarray = [];
|
|
19299
19424
|
this.removeSelected(fListBox, fListBox.getSelectedItems());
|
|
19300
19425
|
var tempItems = [].slice.call(fListBox.listData);
|
|
19301
19426
|
var localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
|
|
@@ -19309,29 +19434,43 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
19309
19434
|
tListBox.ulElement.removeChild(noRecElem);
|
|
19310
19435
|
}
|
|
19311
19436
|
}
|
|
19312
|
-
if (
|
|
19313
|
-
|
|
19314
|
-
|
|
19315
|
-
|
|
19437
|
+
if (fListBox.listData.length > 0) {
|
|
19438
|
+
// eslint-disable-next-line prefer-spread
|
|
19439
|
+
flistboxarray = Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number);
|
|
19440
|
+
}
|
|
19441
|
+
var _loop_3 = function (i) {
|
|
19442
|
+
if (fListBox.ulElement.childNodes[i].classList.contains('e-disabled')) {
|
|
19443
|
+
flistboxarray = flistboxarray.filter(function (item) { return item !== i; });
|
|
19444
|
+
tempLiColl.push(fListBox.ulElement.childNodes[i]);
|
|
19445
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19446
|
+
tempData.push(fListBox.listData[i]);
|
|
19316
19447
|
}
|
|
19448
|
+
};
|
|
19449
|
+
for (var i = 0; i < fListBox.ulElement.childElementCount; i++) {
|
|
19450
|
+
_loop_3(i);
|
|
19317
19451
|
}
|
|
19318
|
-
moveTo(fListBox.ulElement, tListBox.ulElement,
|
|
19319
|
-
// eslint-disable-next-line prefer-spread
|
|
19320
|
-
Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number), index);
|
|
19452
|
+
moveTo(fListBox.ulElement, tListBox.ulElement, flistboxarray, index);
|
|
19321
19453
|
this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
19322
19454
|
if (isKey) {
|
|
19323
19455
|
this.list.focus();
|
|
19324
19456
|
}
|
|
19325
19457
|
index = (index) ? index : listData.length;
|
|
19326
|
-
for (var i = 0; i <
|
|
19327
|
-
listData.splice(index + i, 0, fListBox.listData[i]);
|
|
19458
|
+
for (var i = 0; i < flistboxarray.length; i++) {
|
|
19459
|
+
listData.splice(index + i, 0, fListBox.listData[flistboxarray[i]]);
|
|
19328
19460
|
}
|
|
19329
|
-
for (var i = 0; i <
|
|
19330
|
-
jsonData.splice(index + i, 0, fListBox.jsonData[i]);
|
|
19461
|
+
for (var i = 0; i < flistboxarray.length; i++) {
|
|
19462
|
+
jsonData.splice(index + i, 0, fListBox.jsonData[flistboxarray[i]]);
|
|
19463
|
+
}
|
|
19464
|
+
var fliCollections = [];
|
|
19465
|
+
if (tempLiColl.length > 0) {
|
|
19466
|
+
fListBox.liCollections = tempLiColl;
|
|
19467
|
+
fliCollections = [].slice.call(fListBox.liCollections);
|
|
19468
|
+
}
|
|
19469
|
+
else {
|
|
19470
|
+
fliCollections = [].slice.call(fListBox.liCollections);
|
|
19471
|
+
fListBox.liCollections = [];
|
|
19331
19472
|
}
|
|
19332
|
-
var fliCollections = [].slice.call(fListBox.liCollections);
|
|
19333
19473
|
var tliCollections = [].slice.call(tListBox.liCollections);
|
|
19334
|
-
fListBox.liCollections = [];
|
|
19335
19474
|
if (index) {
|
|
19336
19475
|
var toColl = tliCollections.splice(0, index);
|
|
19337
19476
|
tListBox.liCollections = toColl.concat(fliCollections).concat(tliCollections);
|
|
@@ -19340,6 +19479,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
19340
19479
|
tListBox.liCollections = tliCollections.concat(fliCollections);
|
|
19341
19480
|
}
|
|
19342
19481
|
fListBox.value = [];
|
|
19482
|
+
listData = listData.filter(function (data) { return (data !== undefined); });
|
|
19343
19483
|
listData = listData
|
|
19344
19484
|
.filter(function (data) { return data.isHeader !== true; });
|
|
19345
19485
|
var sortedData = listData.filter(function (val) {
|
|
@@ -19351,7 +19491,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
19351
19491
|
}
|
|
19352
19492
|
tListBox.listData = listData;
|
|
19353
19493
|
if (fListBox.listData.length === fListBox.jsonData.length) {
|
|
19354
|
-
fListBox.listData = fListBox.sortedData = fListBox.jsonData =
|
|
19494
|
+
fListBox.listData = fListBox.sortedData = fListBox.jsonData = tempData;
|
|
19355
19495
|
}
|
|
19356
19496
|
else if (fListBox.allowFiltering) {
|
|
19357
19497
|
for (var i = 0; i < fListBox.listData.length; i++) {
|
|
@@ -19372,6 +19512,11 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
19372
19512
|
tListBox.sortedData = listData;
|
|
19373
19513
|
}
|
|
19374
19514
|
fListBox.updateSelectedOptions();
|
|
19515
|
+
if (tempLiColl.length > 0) {
|
|
19516
|
+
var wrap = this.list.parentElement.getElementsByClassName('e-listbox-tool')[0];
|
|
19517
|
+
var btn = wrap.querySelector('[data-value="' + this.toolbarAction + '"]');
|
|
19518
|
+
btn.disabled = true;
|
|
19519
|
+
}
|
|
19375
19520
|
if (fListBox.listData.length === 0) {
|
|
19376
19521
|
fListBox.l10nUpdate();
|
|
19377
19522
|
}
|
|
@@ -19592,6 +19737,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
19592
19737
|
if (!args.cancel && !_this.isCustomFiltering && !args.preventDefaultAction) {
|
|
19593
19738
|
_this.inputString = _this.filterInput.value;
|
|
19594
19739
|
_this.filteringAction(_this.jsonData, new Query(), _this.fields);
|
|
19740
|
+
if (_this.toolbarSettings.items.length > 0) {
|
|
19741
|
+
_this.updateToolBarState();
|
|
19742
|
+
}
|
|
19595
19743
|
}
|
|
19596
19744
|
if (!_this.isFiltered && !_this.isCustomFiltering && !args.preventDefaultAction) {
|
|
19597
19745
|
_this.dataUpdater(_this.jsonData, new Query(), _this.fields);
|