@syncfusion/ej2-dropdowns 25.1.40 → 25.2.3
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 +22 -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 +280 -166
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +279 -165
- 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 +12 -12
- 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 +67 -42
- 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 +157 -68
|
@@ -391,9 +391,10 @@ class VirtualScroll {
|
|
|
391
391
|
var query = this.parent.getForQuery(this.parent.value).clone();
|
|
392
392
|
query = query.skip(0).take(this.parent.itemCount - (this.parent.value.length - this.parent.viewPortInfo.startIndex));
|
|
393
393
|
this.parent.appendUncheckList = true;
|
|
394
|
+
this.parent.setCurrentView = false;
|
|
394
395
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
395
396
|
isListUpdated = false;
|
|
396
|
-
this.parent.appendUncheckList = false;
|
|
397
|
+
this.parent.appendUncheckList = this.parent.dataSource instanceof DataManager ? this.parent.appendUncheckList : false;
|
|
397
398
|
isListUpdated = false;
|
|
398
399
|
}
|
|
399
400
|
else {
|
|
@@ -416,9 +417,10 @@ class VirtualScroll {
|
|
|
416
417
|
var query = this.parent.getForQuery(this.parent.value).clone();
|
|
417
418
|
query = query.skip(0).take(this.parent.itemCount - (this.parent.value.length - this.parent.viewPortInfo.startIndex));
|
|
418
419
|
this.parent.appendUncheckList = true;
|
|
420
|
+
this.parent.setCurrentView = false;
|
|
419
421
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
420
422
|
isListUpdated = false;
|
|
421
|
-
this.parent.appendUncheckList = false;
|
|
423
|
+
this.parent.appendUncheckList = this.parent.dataSource instanceof DataManager ? this.parent.appendUncheckList : false;
|
|
422
424
|
}
|
|
423
425
|
}
|
|
424
426
|
else {
|
|
@@ -429,6 +431,7 @@ class VirtualScroll {
|
|
|
429
431
|
var query = this.parent.getForQuery(this.parent.value).clone();
|
|
430
432
|
var skipvalue = this.parent.viewPortInfo.startIndex - this.parent.value.length >= 0 ? this.parent.viewPortInfo.startIndex - this.parent.value.length : 0;
|
|
431
433
|
query = query.skip(skipvalue);
|
|
434
|
+
this.parent.setCurrentView = false;
|
|
432
435
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
433
436
|
isListUpdated = false;
|
|
434
437
|
}
|
|
@@ -450,6 +453,7 @@ class VirtualScroll {
|
|
|
450
453
|
else {
|
|
451
454
|
query = query.skip(this.parent.viewPortInfo.startIndex);
|
|
452
455
|
}
|
|
456
|
+
this.parent.setCurrentView = false;
|
|
453
457
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
454
458
|
isResetListCalled = true;
|
|
455
459
|
break;
|
|
@@ -471,6 +475,7 @@ class VirtualScroll {
|
|
|
471
475
|
else {
|
|
472
476
|
query = query.skip(this.parent.viewPortInfo.startIndex);
|
|
473
477
|
}
|
|
478
|
+
this.parent.setCurrentView = false;
|
|
474
479
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
475
480
|
isResetListCalled = true;
|
|
476
481
|
}
|
|
@@ -482,6 +487,7 @@ class VirtualScroll {
|
|
|
482
487
|
currentData.push(alreadyAddedData[0]);
|
|
483
488
|
}
|
|
484
489
|
}
|
|
490
|
+
this.parent.setCurrentView = false;
|
|
485
491
|
}
|
|
486
492
|
}
|
|
487
493
|
if (!isResetListCalled && isListUpdated) {
|
|
@@ -549,6 +555,7 @@ class VirtualScroll {
|
|
|
549
555
|
if (isStartIndexInitialised && !((this.parent.totalItemCount == queryStartIndex) && (this.parent.totalItemCount == queryEndIndex))) {
|
|
550
556
|
this.parent.virtualItemStartIndex = queryStartIndex;
|
|
551
557
|
this.parent.virtualItemEndIndex = queryEndIndex;
|
|
558
|
+
this.parent.setCurrentView = true;
|
|
552
559
|
this.generateAndExecuteQueryAsync(query, queryStartIndex, queryEndIndex);
|
|
553
560
|
if (this.component === 'multiselect' && this.parent.hideSelectedItem && this.parent.value && Array.isArray(this.parent.value) && this.parent.value.length > 0) {
|
|
554
561
|
this.parent.totalItemsCount();
|
|
@@ -558,7 +565,9 @@ class VirtualScroll {
|
|
|
558
565
|
this.parent.virtualItemEndIndex = this.parent.viewPortInfo.endIndex;
|
|
559
566
|
}
|
|
560
567
|
}
|
|
561
|
-
this.
|
|
568
|
+
if (!(this.parent.dataSource instanceof DataManager) || (this.parent.dataSource instanceof DataManager && !this.parent.isRequesting)) {
|
|
569
|
+
this.setCurrentViewDataAsync();
|
|
570
|
+
}
|
|
562
571
|
}
|
|
563
572
|
dataProcessAsync(isOpenPopup) {
|
|
564
573
|
this.parent.selectedValueInfo = null;
|
|
@@ -586,7 +595,7 @@ class VirtualScroll {
|
|
|
586
595
|
}
|
|
587
596
|
}
|
|
588
597
|
yield this.dataProcessAsync();
|
|
589
|
-
if (this.parent.keyboardEvent != null) {
|
|
598
|
+
if (this.parent.keyboardEvent != null && (!(this.parent.dataSource instanceof DataManager) || (this.parent.dataSource instanceof DataManager && !this.parent.isRequesting))) {
|
|
590
599
|
this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent, this.parent.pageCount);
|
|
591
600
|
}
|
|
592
601
|
if (!this.parent.customFilterQuery) {
|
|
@@ -801,9 +810,10 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
801
810
|
this.isCheckBoxSelection = false;
|
|
802
811
|
this.totalItemCount = 0;
|
|
803
812
|
this.dataCount = 0;
|
|
813
|
+
this.remoteDataCount = -1;
|
|
804
814
|
this.isRemoteDataUpdated = false;
|
|
805
815
|
this.isIncrementalRequest = false;
|
|
806
|
-
this.itemCount =
|
|
816
|
+
this.itemCount = 30;
|
|
807
817
|
this.virtualListHeight = 0;
|
|
808
818
|
this.isVirtualScrolling = false;
|
|
809
819
|
this.isPreventScrollAction = false;
|
|
@@ -830,7 +840,6 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
830
840
|
this.appendUncheckList = false;
|
|
831
841
|
this.getInitialData = false;
|
|
832
842
|
this.preventPopupOpen = true;
|
|
833
|
-
this.customFilterQuery = new Query();
|
|
834
843
|
this.virtualListInfo = {
|
|
835
844
|
currentPageNumber: null,
|
|
836
845
|
direction: null,
|
|
@@ -1103,10 +1112,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1103
1112
|
this.virtualListInfo = this.viewPortInfo;
|
|
1104
1113
|
}
|
|
1105
1114
|
getFilteringSkeletonCount() {
|
|
1106
|
-
const difference = this.dataCount - this.viewPortInfo.endIndex;
|
|
1107
1115
|
const currentSkeletonCount = this.skeletonCount;
|
|
1108
1116
|
this.getSkeletonCount(true);
|
|
1109
|
-
this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount :
|
|
1117
|
+
this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : 0;
|
|
1110
1118
|
let skeletonUpdated = true;
|
|
1111
1119
|
if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'multiselect') && (this.totalItemCount < (this.itemCount * 2))) {
|
|
1112
1120
|
this.skeletonCount = 0;
|
|
@@ -1140,10 +1148,10 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1140
1148
|
getSkeletonCount(retainSkeleton) {
|
|
1141
1149
|
this.virtualListHeight = this.listContainerHeight != null ? parseInt(this.listContainerHeight, 10) : this.virtualListHeight;
|
|
1142
1150
|
const actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
|
|
1143
|
-
this.skeletonCount = actualCount *
|
|
1151
|
+
this.skeletonCount = actualCount * 4 < this.itemCount ? this.itemCount : actualCount * 4;
|
|
1144
1152
|
this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
|
|
1145
1153
|
this.virtualItemCount = this.itemCount;
|
|
1146
|
-
this.skeletonCount = Math.floor(this.skeletonCount / 2)
|
|
1154
|
+
this.skeletonCount = Math.floor(this.skeletonCount / 2);
|
|
1147
1155
|
}
|
|
1148
1156
|
GetVirtualTrackHeight() {
|
|
1149
1157
|
let height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
|
|
@@ -1366,41 +1374,53 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1366
1374
|
if (!eventArgs.cancel) {
|
|
1367
1375
|
this.isRequesting = true;
|
|
1368
1376
|
this.showSpinner();
|
|
1369
|
-
if (dataSource instanceof DataManager
|
|
1377
|
+
if (dataSource instanceof DataManager) {
|
|
1370
1378
|
this.isRequested = true;
|
|
1379
|
+
let isWhereExist = false;
|
|
1371
1380
|
if (this.isDataFetched) {
|
|
1372
1381
|
this.emptyDataRequest(fields);
|
|
1373
1382
|
return;
|
|
1374
1383
|
}
|
|
1375
1384
|
eventArgs.data.executeQuery(this.getQuery(eventArgs.query)).then((e) => {
|
|
1376
1385
|
this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1386
|
+
let isReOrder = true;
|
|
1387
|
+
if (!this.virtualSelectAll) {
|
|
1388
|
+
let newQuery = this.getQuery(eventArgs.query);
|
|
1389
|
+
for (let queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
1390
|
+
if (newQuery.queries[queryElements].fn === 'onWhere') {
|
|
1391
|
+
isWhereExist = true;
|
|
1382
1392
|
}
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1393
|
+
}
|
|
1394
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1395
|
+
if (this.isVirtualizationEnabled && (e.count != 0 && e.count < (this.itemCount * 2))) {
|
|
1396
|
+
if (newQuery) {
|
|
1397
|
+
for (let queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
1398
|
+
if (newQuery.queries[queryElements].fn === 'onTake') {
|
|
1399
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1400
|
+
newQuery.queries[queryElements].e.nos = e.count;
|
|
1401
|
+
}
|
|
1402
|
+
if (this.getModuleName() === 'multiselect' && (newQuery.queries[queryElements].e.condition == 'or' || newQuery.queries[queryElements].e.operator == 'equal')) {
|
|
1403
|
+
isReOrder = false;
|
|
1404
|
+
}
|
|
1388
1405
|
}
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
else {
|
|
1409
|
+
this.isVirtualTrackHeight = false;
|
|
1410
|
+
if (newQuery) {
|
|
1411
|
+
for (let queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
1412
|
+
if (this.getModuleName() === 'multiselect' && ((newQuery.queries[queryElements].e && newQuery.queries[queryElements].e.condition == 'or') || (newQuery.queries[queryElements].e && newQuery.queries[queryElements].e.operator == 'equal'))) {
|
|
1413
|
+
isReOrder = false;
|
|
1414
|
+
}
|
|
1396
1415
|
}
|
|
1397
1416
|
}
|
|
1398
|
-
this.hideSpinner();
|
|
1399
|
-
this.isRequested = false;
|
|
1400
|
-
this.isRequesting = false;
|
|
1401
|
-
this.updatePopupState();
|
|
1402
|
-
return;
|
|
1403
1417
|
}
|
|
1418
|
+
}
|
|
1419
|
+
if (isReOrder) {
|
|
1420
|
+
// eslint-disable @typescript-eslint/no-explicit-any
|
|
1421
|
+
this.dataCount = this.totalItemCount = e.count;
|
|
1422
|
+
}
|
|
1423
|
+
this.trigger('actionComplete', e, (e) => {
|
|
1404
1424
|
if (!e.cancel) {
|
|
1405
1425
|
this.isRequesting = false;
|
|
1406
1426
|
const listItems = e.result;
|
|
@@ -1408,12 +1428,16 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1408
1428
|
ulElement = this.renderItems(listItems, fields);
|
|
1409
1429
|
return;
|
|
1410
1430
|
}
|
|
1411
|
-
if (listItems.length === 0) {
|
|
1431
|
+
if ((!this.isVirtualizationEnabled && listItems.length === 0) || (this.isVirtualizationEnabled && listItems.length === 0 && !isWhereExist)) {
|
|
1412
1432
|
this.isDataFetched = true;
|
|
1413
1433
|
}
|
|
1434
|
+
if (!isWhereExist) {
|
|
1435
|
+
this.remoteDataCount = e.count;
|
|
1436
|
+
}
|
|
1414
1437
|
this.dataCount = e.count;
|
|
1415
1438
|
this.totalItemCount = e.count;
|
|
1416
1439
|
ulElement = this.renderItems(listItems, fields);
|
|
1440
|
+
this.appendUncheckList = false;
|
|
1417
1441
|
this.onActionComplete(ulElement, listItems, e);
|
|
1418
1442
|
if (this.groupTemplate) {
|
|
1419
1443
|
this.renderGroupTemplate(ulElement);
|
|
@@ -1426,6 +1450,17 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1426
1450
|
this.preventPopupOpen = false;
|
|
1427
1451
|
return;
|
|
1428
1452
|
}
|
|
1453
|
+
if (this.isVirtualizationEnabled && this.setCurrentView) {
|
|
1454
|
+
this.notify("setCurrentViewDataAsync", {
|
|
1455
|
+
module: "VirtualScroll",
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
if (this.keyboardEvent != null) {
|
|
1459
|
+
this.handleVirtualKeyboardActions(this.keyboardEvent, this.pageCount);
|
|
1460
|
+
}
|
|
1461
|
+
if (this.isVirtualizationEnabled) {
|
|
1462
|
+
this.getFilteringSkeletonCount();
|
|
1463
|
+
}
|
|
1429
1464
|
}
|
|
1430
1465
|
});
|
|
1431
1466
|
}).catch((e) => {
|
|
@@ -1462,7 +1497,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1462
1497
|
}
|
|
1463
1498
|
if (isReOrder) {
|
|
1464
1499
|
listItems = (newQuery).executeLocal(dataManager);
|
|
1465
|
-
this.isVirtualTrackHeight = true;
|
|
1500
|
+
this.isVirtualTrackHeight = (!(this.dataSource instanceof DataManager) && !this.isCustomDataUpdated) ? true : false;
|
|
1466
1501
|
}
|
|
1467
1502
|
}
|
|
1468
1503
|
}
|
|
@@ -1477,7 +1512,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1477
1512
|
}
|
|
1478
1513
|
}
|
|
1479
1514
|
}
|
|
1480
|
-
if (isReOrder) {
|
|
1515
|
+
if (isReOrder && (!(this.dataSource instanceof DataManager) && !this.isCustomDataUpdated)) {
|
|
1481
1516
|
// eslint-disable @typescript-eslint/no-explicit-any
|
|
1482
1517
|
this.dataCount = this.totalItemCount = this.virtualSelectAll ? listItems.length : listItems.count;
|
|
1483
1518
|
}
|
|
@@ -1514,6 +1549,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1514
1549
|
});
|
|
1515
1550
|
}
|
|
1516
1551
|
}
|
|
1552
|
+
handleVirtualKeyboardActions(e, pageCount) {
|
|
1553
|
+
// Used this method in component side.
|
|
1554
|
+
}
|
|
1517
1555
|
updatePopupState() {
|
|
1518
1556
|
// Used this method in component side.
|
|
1519
1557
|
}
|
|
@@ -1624,6 +1662,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1624
1662
|
addClass([ulElement.children[i]], HIDE_GROUPLIST);
|
|
1625
1663
|
}
|
|
1626
1664
|
}
|
|
1665
|
+
if (ulElement.children[0].classList.contains('e-hide-group-header')) {
|
|
1666
|
+
setStyleAttribute(ulElement.children[1], { zIndex: 11 });
|
|
1667
|
+
}
|
|
1627
1668
|
}
|
|
1628
1669
|
}
|
|
1629
1670
|
if (!isNullOrUndefined(this.list)) {
|
|
@@ -1767,29 +1808,15 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1767
1808
|
const topIndex = Math.round(target.scrollTop / liHeight);
|
|
1768
1809
|
const liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
|
|
1769
1810
|
let virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
|
|
1770
|
-
let count = 0;
|
|
1771
|
-
let isCount = false;
|
|
1772
1811
|
for (let i = topIndex; i > -1; i--) {
|
|
1773
1812
|
const index = this.isVirtualizationEnabled ? i + virtualListCount : i;
|
|
1774
1813
|
if (this.isVirtualizationEnabled) {
|
|
1775
|
-
const groupListLength = this.list.querySelectorAll('.e-list-group-item').length;
|
|
1776
|
-
let loadedGroupList = 0;
|
|
1777
|
-
if (isCount) {
|
|
1778
|
-
count++;
|
|
1779
|
-
}
|
|
1780
1814
|
if (this.fixedHeaderElement && this.updateGroupHeader(index, liCollections, target)) {
|
|
1781
|
-
|
|
1782
|
-
if (count >= this.getPageCount()) {
|
|
1783
|
-
break;
|
|
1784
|
-
}
|
|
1785
|
-
if (groupListLength <= loadedGroupList) {
|
|
1786
|
-
break;
|
|
1787
|
-
}
|
|
1815
|
+
break;
|
|
1788
1816
|
}
|
|
1789
1817
|
if (isDownkey) {
|
|
1790
1818
|
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')) {
|
|
1791
|
-
|
|
1792
|
-
isCount = true;
|
|
1819
|
+
|
|
1793
1820
|
}
|
|
1794
1821
|
}
|
|
1795
1822
|
}
|
|
@@ -2245,7 +2272,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2245
2272
|
}
|
|
2246
2273
|
}
|
|
2247
2274
|
const itemsCount = this.getItems().length;
|
|
2248
|
-
|
|
2275
|
+
let isListboxEmpty = itemsCount === 0;
|
|
2249
2276
|
const selectedItemValue = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
2250
2277
|
items = (items instanceof Array ? items : [items]);
|
|
2251
2278
|
let index;
|
|
@@ -2294,6 +2321,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2294
2321
|
}
|
|
2295
2322
|
if (this.getModuleName() === 'listbox') {
|
|
2296
2323
|
this.updateActionCompleteData(li, item, isListboxEmpty ? null : index);
|
|
2324
|
+
isListboxEmpty = true;
|
|
2297
2325
|
}
|
|
2298
2326
|
else {
|
|
2299
2327
|
this.updateActionCompleteData(li, item, index);
|
|
@@ -2341,7 +2369,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2341
2369
|
}
|
|
2342
2370
|
}
|
|
2343
2371
|
else {
|
|
2344
|
-
if (this.liCollections[index]) {
|
|
2372
|
+
if (this.liCollections[index] && this.liCollections[index].parentNode) {
|
|
2345
2373
|
this.liCollections[index].parentNode.insertBefore(liCollections[i], this.liCollections[index]);
|
|
2346
2374
|
}
|
|
2347
2375
|
else {
|
|
@@ -3384,8 +3412,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3384
3412
|
const focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
3385
3413
|
if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
|
|
3386
3414
|
this.setSelection(focusEle, e);
|
|
3387
|
-
if (this.enableVirtualization
|
|
3415
|
+
if (this.enableVirtualization) {
|
|
3388
3416
|
let selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
3417
|
+
if (this.fields.groupBy) {
|
|
3418
|
+
selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex == 0 ? this.selectedLI.offsetHeight - selectedLiOffsetTop : selectedLiOffsetTop - this.selectedLI.offsetHeight;
|
|
3419
|
+
}
|
|
3389
3420
|
this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
|
|
3390
3421
|
}
|
|
3391
3422
|
}
|
|
@@ -3422,7 +3453,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3422
3453
|
}
|
|
3423
3454
|
}
|
|
3424
3455
|
if (!isNullOrUndefined(nextItem)) {
|
|
3456
|
+
const focusAtFirstElement = this.liCollections[this.skeletonCount] && this.liCollections[this.skeletonCount].classList.contains('e-item-focus');
|
|
3425
3457
|
this.setSelection(nextItem, e);
|
|
3458
|
+
if (focusAtFirstElement && this.enableVirtualization && this.getModuleName() === 'autocomplete' && !isVirtualKeyAction) {
|
|
3459
|
+
let selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
3460
|
+
selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex == 0 && this.fields.groupBy ? this.selectedLI.offsetHeight - selectedLiOffsetTop : selectedLiOffsetTop - this.selectedLI.offsetHeight;
|
|
3461
|
+
this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
|
|
3462
|
+
}
|
|
3426
3463
|
}
|
|
3427
3464
|
else if (this.enableVirtualization && !this.isPopupOpen && this.getModuleName() !== 'autocomplete' && ((this.viewPortInfo.endIndex !== this.totalItemCount && e.action === 'down') || (this.viewPortInfo.startIndex !== 0 && e.action === 'up'))) {
|
|
3428
3465
|
if (e.action === 'down') {
|
|
@@ -3549,14 +3586,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3549
3586
|
}
|
|
3550
3587
|
break;
|
|
3551
3588
|
case 'pageUp':
|
|
3552
|
-
|
|
3553
|
-
this.activeIndex = Math.round(count);
|
|
3589
|
+
this.activeIndex = this.getModuleName() === 'autocomplete' ? this.getIndexByValue(this.selectedLI.getAttribute('data-value')) + this.getPageCount() - 1 : this.getIndexByValue(this.previousValue);
|
|
3554
3590
|
this.pageUpSelection(this.activeIndex - this.getPageCount(), e, true);
|
|
3555
3591
|
e.preventDefault();
|
|
3556
3592
|
break;
|
|
3557
3593
|
case 'pageDown':
|
|
3558
|
-
this.activeIndex =
|
|
3559
|
-
this.pageDownSelection(this.activeIndex + this.getPageCount(), e, true);
|
|
3594
|
+
this.activeIndex = this.getModuleName() === 'autocomplete' ? this.getIndexByValue(this.selectedLI.getAttribute('data-value')) - this.getPageCount() : this.getIndexByValue(this.previousValue);
|
|
3595
|
+
this.pageDownSelection(!isNullOrUndefined(this.activeIndex) ? (this.activeIndex + this.getPageCount()) : (2 * this.getPageCount()), e, true);
|
|
3560
3596
|
e.preventDefault();
|
|
3561
3597
|
break;
|
|
3562
3598
|
case 'home':
|
|
@@ -3593,8 +3629,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3593
3629
|
}
|
|
3594
3630
|
pageUpSelection(steps, event, isVirtualKeyAction) {
|
|
3595
3631
|
let previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
|
|
3596
|
-
if ((this.enableVirtualization && this.activeIndex == null)
|
|
3597
|
-
previousItem = steps >= 0 ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
|
|
3632
|
+
if ((this.enableVirtualization && this.activeIndex == null)) {
|
|
3633
|
+
previousItem = (this.liCollections.length >= steps && steps >= 0) ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
|
|
3598
3634
|
}
|
|
3599
3635
|
if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
|
|
3600
3636
|
previousItem = this.liCollections[this.skeletonCount];
|
|
@@ -3626,7 +3662,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3626
3662
|
steps = this.getModuleName() === 'dropdownlist' && this.allowFiltering ? steps + 1 : steps;
|
|
3627
3663
|
previousItem = steps < list.length ? this.liCollections[steps] : this.liCollections[list.length - 1];
|
|
3628
3664
|
}
|
|
3629
|
-
if ((this.enableVirtualization && this.activeIndex == null)
|
|
3665
|
+
if ((this.enableVirtualization && this.activeIndex == null)) {
|
|
3630
3666
|
previousItem = steps <= list.length ? this.liCollections[steps + this.skeletonCount - 1] : this.liCollections[list.length - 1];
|
|
3631
3667
|
}
|
|
3632
3668
|
this.PageUpDownSelection(previousItem, event);
|
|
@@ -3811,6 +3847,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3811
3847
|
}
|
|
3812
3848
|
}
|
|
3813
3849
|
else {
|
|
3850
|
+
if (this.enableVirtualization && this.activeIndex == null && this.dataSource instanceof DataManager) {
|
|
3851
|
+
this.UpdateSkeleton();
|
|
3852
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
3853
|
+
this.ulElement = this.list.querySelector('ul');
|
|
3854
|
+
}
|
|
3814
3855
|
this.activeIndex = this.getIndexByValue(value);
|
|
3815
3856
|
}
|
|
3816
3857
|
}
|
|
@@ -3870,7 +3911,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3870
3911
|
if (this.enableVirtualization && this.value) {
|
|
3871
3912
|
const fields = (this.fields.value) ? this.fields.value : '';
|
|
3872
3913
|
let currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
|
|
3873
|
-
if (this.dataSource instanceof DataManager
|
|
3914
|
+
if (this.dataSource instanceof DataManager) {
|
|
3874
3915
|
const getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue)));
|
|
3875
3916
|
if (getItem && getItem.length > 0) {
|
|
3876
3917
|
this.itemData = getItem[0];
|
|
@@ -4212,7 +4253,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4212
4253
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
4213
4254
|
filterQuery.where('', filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
|
|
4214
4255
|
}
|
|
4215
|
-
else if (((this.getModuleName() !== 'combobox')
|
|
4256
|
+
else if (((this.getModuleName() !== 'combobox')) || (this.isFiltering() && this.getModuleName() === 'combobox' && this.typedString !== '')) {
|
|
4216
4257
|
const fields = (this.fields.text) ? this.fields.text : '';
|
|
4217
4258
|
filterQuery.where(fields, filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
|
|
4218
4259
|
}
|
|
@@ -4220,7 +4261,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4220
4261
|
else {
|
|
4221
4262
|
filterQuery = (this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery)) ? this.customFilterQuery.clone() : query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
4222
4263
|
}
|
|
4223
|
-
if (this.enableVirtualization &&
|
|
4264
|
+
if (this.enableVirtualization && this.viewPortInfo.endIndex != 0) {
|
|
4224
4265
|
var takeValue = this.getTakeValue();
|
|
4225
4266
|
var alreadySkipAdded = false;
|
|
4226
4267
|
if (filterQuery) {
|
|
@@ -4287,14 +4328,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4287
4328
|
}
|
|
4288
4329
|
filterQuery.requiresCount();
|
|
4289
4330
|
}
|
|
4290
|
-
else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
|
|
4291
|
-
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
4292
|
-
if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
|
|
4293
|
-
filterQuery.queries.splice(queryElements, 1);
|
|
4294
|
-
--queryElements;
|
|
4295
|
-
}
|
|
4296
|
-
}
|
|
4297
|
-
}
|
|
4298
4331
|
return filterQuery;
|
|
4299
4332
|
}
|
|
4300
4333
|
getSelectionPoints() {
|
|
@@ -4320,7 +4353,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4320
4353
|
return;
|
|
4321
4354
|
}
|
|
4322
4355
|
this.isCustomFilter = true;
|
|
4323
|
-
this.customFilterQuery = query;
|
|
4356
|
+
this.customFilterQuery = query.clone();
|
|
4324
4357
|
this.filteringAction(dataSource, query, fields);
|
|
4325
4358
|
},
|
|
4326
4359
|
baseEventArgs: e,
|
|
@@ -4620,6 +4653,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4620
4653
|
this.addNewItem(list, selectedItem);
|
|
4621
4654
|
}
|
|
4622
4655
|
if (!isNullOrUndefined(this.itemData) || (isNullOrUndefined(this.itemData) && this.enableVirtualization)) {
|
|
4656
|
+
this.getSkeletonCount();
|
|
4657
|
+
this.skeletonCount = this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2) ? 0 : this.skeletonCount;
|
|
4658
|
+
this.UpdateSkeleton();
|
|
4623
4659
|
this.focusIndexItem();
|
|
4624
4660
|
}
|
|
4625
4661
|
if (this.enableVirtualization) {
|
|
@@ -4720,7 +4756,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4720
4756
|
}
|
|
4721
4757
|
focusIndexItem() {
|
|
4722
4758
|
const value = this.getItemData().value;
|
|
4723
|
-
this.activeIndex = this.getIndexByValue(value);
|
|
4759
|
+
this.activeIndex = ((this.enableVirtualization && !isNullOrUndefined(value)) || !this.enableVirtualization) ? this.getIndexByValue(value) : this.activeIndex;
|
|
4724
4760
|
const element = this.findListElement(this.list, 'li', 'data-value', value);
|
|
4725
4761
|
this.selectedLI = element;
|
|
4726
4762
|
this.activeItem(element);
|
|
@@ -5134,7 +5170,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5134
5170
|
}
|
|
5135
5171
|
else {
|
|
5136
5172
|
if (this.enableVirtualization) {
|
|
5137
|
-
liCount = keyAction == "pageDown" ? this.getPageCount() : liCount;
|
|
5173
|
+
liCount = keyAction == "pageDown" ? this.getPageCount() + 1 : liCount;
|
|
5138
5174
|
}
|
|
5139
5175
|
this.list.scrollTop += this.selectedLI.offsetHeight * liCount;
|
|
5140
5176
|
}
|
|
@@ -5153,7 +5189,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5153
5189
|
this.isPreventKeyAction = false;
|
|
5154
5190
|
this.isKeyBoardAction = false;
|
|
5155
5191
|
this.isPreventScrollAction = false;
|
|
5156
|
-
nextOffset = nextOffset + (this.selectedLI.offsetHeight * liCount);
|
|
5157
5192
|
}
|
|
5158
5193
|
this.list.scrollTop = nextOffset;
|
|
5159
5194
|
}
|
|
@@ -5210,7 +5245,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5210
5245
|
this.isPreventKeyAction = false;
|
|
5211
5246
|
this.isKeyBoardAction = false;
|
|
5212
5247
|
this.isPreventScrollAction = false;
|
|
5213
|
-
nextOffset = nextOffset - (this.selectedLI.offsetHeight * liCount);
|
|
5214
5248
|
}
|
|
5215
5249
|
this.list.scrollTop = this.list.scrollTop + nextOffset;
|
|
5216
5250
|
}
|
|
@@ -5403,7 +5437,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5403
5437
|
sentinelInfo: {},
|
|
5404
5438
|
offsets: {},
|
|
5405
5439
|
startIndex: 0,
|
|
5406
|
-
endIndex:
|
|
5440
|
+
endIndex: this.itemCount,
|
|
5407
5441
|
};
|
|
5408
5442
|
if (this.getModuleName() === 'combobox') {
|
|
5409
5443
|
this.typedString = "";
|
|
@@ -5411,8 +5445,12 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5411
5445
|
this.previousStartIndex = 0;
|
|
5412
5446
|
this.previousEndIndex = 0;
|
|
5413
5447
|
if (this.dataSource instanceof DataManager) {
|
|
5414
|
-
|
|
5415
|
-
|
|
5448
|
+
if (this.remoteDataCount >= 0) {
|
|
5449
|
+
this.totalItemCount = this.dataCount = this.remoteDataCount;
|
|
5450
|
+
}
|
|
5451
|
+
else {
|
|
5452
|
+
this.resetList(this.dataSource);
|
|
5453
|
+
}
|
|
5416
5454
|
}
|
|
5417
5455
|
else {
|
|
5418
5456
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -9817,7 +9855,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
9817
9855
|
if (this.enableVirtualization && this.value) {
|
|
9818
9856
|
const fields = (this.fields.value) ? this.fields.value : '';
|
|
9819
9857
|
let currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
|
|
9820
|
-
if (this.dataSource instanceof DataManager
|
|
9858
|
+
if (this.dataSource instanceof DataManager) {
|
|
9821
9859
|
const getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue)));
|
|
9822
9860
|
if (getItem && getItem.length > 0) {
|
|
9823
9861
|
this.itemData = getItem[0];
|
|
@@ -10727,7 +10765,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
10727
10765
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
10728
10766
|
filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
10729
10767
|
}
|
|
10730
|
-
else
|
|
10768
|
+
else {
|
|
10731
10769
|
const mapping = !isNullOrUndefined(this.fields.value) ? this.fields.value : '';
|
|
10732
10770
|
filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
10733
10771
|
}
|
|
@@ -10743,7 +10781,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
10743
10781
|
}
|
|
10744
10782
|
filterQuery.take(this.suggestionCount);
|
|
10745
10783
|
}
|
|
10746
|
-
if (this.enableVirtualization
|
|
10784
|
+
if (this.enableVirtualization) {
|
|
10747
10785
|
let queryTakeValue = 0;
|
|
10748
10786
|
let querySkipValue = 0;
|
|
10749
10787
|
var takeValue = this.getTakeValue();
|
|
@@ -10793,14 +10831,6 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
10793
10831
|
}
|
|
10794
10832
|
filterQuery.requiresCount();
|
|
10795
10833
|
}
|
|
10796
|
-
else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
|
|
10797
|
-
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
10798
|
-
if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
|
|
10799
|
-
filterQuery.queries.splice(queryElements, 1);
|
|
10800
|
-
--queryElements;
|
|
10801
|
-
}
|
|
10802
|
-
}
|
|
10803
|
-
}
|
|
10804
10834
|
return filterQuery;
|
|
10805
10835
|
}
|
|
10806
10836
|
searchLists(e) {
|
|
@@ -11579,10 +11609,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11579
11609
|
attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_popup', 'aria-controls': this.element.id });
|
|
11580
11610
|
this.updateAriaActiveDescendant();
|
|
11581
11611
|
if (this.isFirstClick) {
|
|
11582
|
-
if (this.enableVirtualization
|
|
11583
|
-
this.
|
|
11612
|
+
if (!this.enableVirtualization) {
|
|
11613
|
+
this.loadTemplate();
|
|
11584
11614
|
}
|
|
11585
|
-
this.loadTemplate();
|
|
11586
11615
|
}
|
|
11587
11616
|
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
11588
11617
|
EventHandler.add(this.popupObj.element, 'click', this.clickHandler, this);
|
|
@@ -11592,7 +11621,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11592
11621
|
}
|
|
11593
11622
|
updateVirtualReOrderList(isCheckBoxUpdate) {
|
|
11594
11623
|
let query = this.getForQuery(this.value, true).clone();
|
|
11595
|
-
|
|
11624
|
+
if (this.enableVirtualization && this.dataSource instanceof DataManager) {
|
|
11625
|
+
this.resetList(this.selectedListData, this.fields, query);
|
|
11626
|
+
}
|
|
11627
|
+
else {
|
|
11628
|
+
this.resetList(this.dataSource, this.fields, query);
|
|
11629
|
+
}
|
|
11596
11630
|
this.UpdateSkeleton();
|
|
11597
11631
|
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
11598
11632
|
this.virtualItemCount = this.itemCount;
|
|
@@ -11649,6 +11683,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11649
11683
|
}
|
|
11650
11684
|
if (this.enableVirtualization) {
|
|
11651
11685
|
const focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
11686
|
+
this.isKeyBoardAction = false;
|
|
11652
11687
|
this.scrollBottom(focusedItem);
|
|
11653
11688
|
}
|
|
11654
11689
|
}
|
|
@@ -11766,15 +11801,15 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11766
11801
|
getForQuery(valuecheck, isCheckbox) {
|
|
11767
11802
|
let predicate;
|
|
11768
11803
|
const field = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
|
|
11769
|
-
if (this.enableVirtualization) {
|
|
11804
|
+
if (this.enableVirtualization && valuecheck) {
|
|
11770
11805
|
if (isCheckbox) {
|
|
11771
11806
|
for (let i = 0; i < valuecheck.length; i++) {
|
|
11772
11807
|
const value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', valuecheck[i]) : valuecheck[i];
|
|
11773
11808
|
if (i === 0) {
|
|
11774
|
-
predicate = new Predicate(field, 'equal', value);
|
|
11809
|
+
predicate = new Predicate(field, 'equal', (value));
|
|
11775
11810
|
}
|
|
11776
11811
|
else {
|
|
11777
|
-
predicate = predicate.or(field, 'equal', value);
|
|
11812
|
+
predicate = predicate.or(field, 'equal', (value));
|
|
11778
11813
|
}
|
|
11779
11814
|
}
|
|
11780
11815
|
return new Query().where(predicate);
|
|
@@ -11783,10 +11818,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11783
11818
|
for (let i = 0; i < valuecheck.length; i++) {
|
|
11784
11819
|
const value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', valuecheck[i]) : valuecheck[i];
|
|
11785
11820
|
if (i === 0) {
|
|
11786
|
-
predicate = new Predicate(field, 'notequal', value);
|
|
11821
|
+
predicate = new Predicate(field, 'notequal', (value));
|
|
11787
11822
|
}
|
|
11788
11823
|
else {
|
|
11789
|
-
predicate = predicate.and(field, 'notequal', value);
|
|
11824
|
+
predicate = predicate.and(field, 'notequal', (value));
|
|
11790
11825
|
}
|
|
11791
11826
|
}
|
|
11792
11827
|
return new Query().where(predicate);
|
|
@@ -11836,7 +11871,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11836
11871
|
valuecheck = this.presentItemValue(this.ulElement);
|
|
11837
11872
|
}
|
|
11838
11873
|
if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
|
|
11839
|
-
&& this.listData != null) {
|
|
11874
|
+
&& this.listData != null && !this.enableVirtualization) {
|
|
11840
11875
|
this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
|
|
11841
11876
|
}
|
|
11842
11877
|
else {
|
|
@@ -11847,6 +11882,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11847
11882
|
query = this.allowFiltering ? query.where(this.fields.text, 'startswith', this.inputElement.value, this.ignoreCase, this.ignoreAccent) : query;
|
|
11848
11883
|
this.checkForCustomValue(query, this.fields);
|
|
11849
11884
|
this.isCustomRendered = true;
|
|
11885
|
+
this.remoteCustomValue = this.enableVirtualization ? false : this.remoteCustomValue;
|
|
11850
11886
|
}
|
|
11851
11887
|
if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
|
|
11852
11888
|
this.removeFocus();
|
|
@@ -11891,7 +11927,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11891
11927
|
if (!isNullOrUndefined(this.text) && (isNullOrUndefined(this.value) || this.value.length === 0)) {
|
|
11892
11928
|
this.initialTextUpdate();
|
|
11893
11929
|
}
|
|
11894
|
-
this.
|
|
11930
|
+
if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
|
|
11931
|
+
this.initialValueUpdate();
|
|
11932
|
+
}
|
|
11895
11933
|
this.initialUpdate();
|
|
11896
11934
|
this.refreshPlaceHolder();
|
|
11897
11935
|
if (this.mode !== 'CheckBox' && this.changeOnBlur) {
|
|
@@ -12094,7 +12132,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12094
12132
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
12095
12133
|
filterQuery.where('', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);
|
|
12096
12134
|
}
|
|
12097
|
-
else {
|
|
12135
|
+
else if ((this.enableVirtualization && this.targetElement() !== "") || !this.enableVirtualization) {
|
|
12098
12136
|
const fields = this.fields;
|
|
12099
12137
|
filterQuery.where(!isNullOrUndefined(fields.text) ? fields.text : '', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);
|
|
12100
12138
|
}
|
|
@@ -12105,18 +12143,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12105
12143
|
return filterQuery;
|
|
12106
12144
|
}
|
|
12107
12145
|
else {
|
|
12108
|
-
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll
|
|
12146
|
+
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll) {
|
|
12109
12147
|
return this.virtualFilterQuery(filterQuery);
|
|
12110
12148
|
}
|
|
12111
|
-
else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
|
|
12112
|
-
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
12113
|
-
if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
|
|
12114
|
-
filterQuery.queries.splice(queryElements, 1);
|
|
12115
|
-
--queryElements;
|
|
12116
|
-
}
|
|
12117
|
-
}
|
|
12118
|
-
return filterQuery;
|
|
12119
|
-
}
|
|
12120
12149
|
return query ? query : this.query ? this.query : new Query();
|
|
12121
12150
|
}
|
|
12122
12151
|
}
|
|
@@ -12279,7 +12308,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12279
12308
|
let dataItem = {};
|
|
12280
12309
|
setValue(field.text, value, dataItem);
|
|
12281
12310
|
if (typeof getValue((this.fields.value ? this.fields.value : 'value'), customData)
|
|
12282
|
-
=== 'number') {
|
|
12311
|
+
=== 'number' && this.fields.value !== this.fields.text) {
|
|
12283
12312
|
setValue(field.value, Math.random(), dataItem);
|
|
12284
12313
|
}
|
|
12285
12314
|
else {
|
|
@@ -12296,17 +12325,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12296
12325
|
dataItem = this.allowObjectBinding ? emptyObject : dataItem;
|
|
12297
12326
|
if (this.enableVirtualization) {
|
|
12298
12327
|
this.virtualCustomData = dataItem;
|
|
12299
|
-
let tempData = this.
|
|
12328
|
+
let tempData = this.dataSource instanceof DataManager ? JSON.parse(JSON.stringify(this.listData)) : JSON.parse(JSON.stringify(this.dataSource));
|
|
12300
12329
|
let totalData = [];
|
|
12301
12330
|
if (this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
|
|
12302
12331
|
totalData = tempData.concat(this.virtualCustomSelectData);
|
|
12303
12332
|
}
|
|
12304
12333
|
tempData.splice(0, 0, dataItem);
|
|
12305
12334
|
this.isCustomDataUpdated = true;
|
|
12335
|
+
let tempCount = this.totalItemCount;
|
|
12306
12336
|
this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
|
|
12307
12337
|
this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.itemCount;
|
|
12308
12338
|
this.resetList(tempData, field, query);
|
|
12309
12339
|
this.isCustomDataUpdated = false;
|
|
12340
|
+
this.totalItemCount = this.enableVirtualization && this.dataSource instanceof DataManager ? tempCount : this.totalItemCount;
|
|
12310
12341
|
}
|
|
12311
12342
|
else {
|
|
12312
12343
|
const tempData = JSON.parse(JSON.stringify(this.listData));
|
|
@@ -12327,7 +12358,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12327
12358
|
else if (this.listData && this.mainData && !dataChecks && this.allowCustomValue) {
|
|
12328
12359
|
if (this.allowFiltering && this.isRemoteSelection && this.remoteCustomValue) {
|
|
12329
12360
|
this.isRemoteSelection = false;
|
|
12330
|
-
|
|
12361
|
+
if (!this.enableVirtualization) {
|
|
12362
|
+
this.resetList(this.listData, field, query);
|
|
12363
|
+
}
|
|
12331
12364
|
}
|
|
12332
12365
|
else if (!this.allowFiltering && this.list) {
|
|
12333
12366
|
const liCollections = this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-hide-listitem)');
|
|
@@ -12584,21 +12617,25 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12584
12617
|
+ dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
|
|
12585
12618
|
let previousItem = steps >= 0 ? collection[steps + 1] : collection[0];
|
|
12586
12619
|
if (this.enableVirtualization && isVirtualKeyAction) {
|
|
12587
|
-
previousItem =
|
|
12620
|
+
previousItem = (this.liCollections.length >= steps && steps >= 0) ? this.liCollections[steps] : this.liCollections[this.skeletonCount];
|
|
12588
12621
|
}
|
|
12589
12622
|
if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
|
|
12590
12623
|
previousItem = this.liCollections[this.skeletonCount];
|
|
12591
12624
|
}
|
|
12592
12625
|
if (this.enableVirtualization) {
|
|
12593
12626
|
if (!isNullOrUndefined(previousItem) && !previousItem.classList.contains('e-item-focus')) {
|
|
12627
|
+
this.isKeyBoardAction = true;
|
|
12594
12628
|
this.addListFocus(previousItem);
|
|
12595
12629
|
this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
|
|
12596
12630
|
}
|
|
12597
12631
|
else if (this.viewPortInfo.startIndex == 0) {
|
|
12632
|
+
this.isKeyBoardAction = true;
|
|
12598
12633
|
this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
|
|
12599
12634
|
}
|
|
12635
|
+
this.previousFocusItem = previousItem;
|
|
12600
12636
|
}
|
|
12601
12637
|
else {
|
|
12638
|
+
this.isKeyBoardAction = true;
|
|
12602
12639
|
this.addListFocus(previousItem);
|
|
12603
12640
|
this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
|
|
12604
12641
|
}
|
|
@@ -12615,7 +12652,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12615
12652
|
if (this.enableVirtualization && isVirtualKeyAction) {
|
|
12616
12653
|
previousItem = steps <= list.length ? this.liCollections[steps] : this.liCollections[list.length - 1];
|
|
12617
12654
|
}
|
|
12655
|
+
this.isKeyBoardAction = true;
|
|
12618
12656
|
this.addListFocus(previousItem);
|
|
12657
|
+
this.previousFocusItem = previousItem;
|
|
12619
12658
|
this.scrollBottom(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), false, this.keyboardEvent.keyCode);
|
|
12620
12659
|
}
|
|
12621
12660
|
getItems() {
|
|
@@ -12803,18 +12842,16 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12803
12842
|
case 33:
|
|
12804
12843
|
e.preventDefault();
|
|
12805
12844
|
if (focusedItem) {
|
|
12806
|
-
|
|
12807
|
-
activeIndex
|
|
12808
|
-
activeIndex = this.getIndexByValue(focusedItem.getAttribute('data-value'));
|
|
12809
|
-
this.pageUpSelection(activeIndex - this.getPageCount(), true);
|
|
12845
|
+
activeIndex = this.getIndexByValue(this.previousFocusItem.getAttribute('data-value')) - 1;
|
|
12846
|
+
this.pageUpSelection(activeIndex, true);
|
|
12810
12847
|
this.updateAriaAttribute();
|
|
12811
12848
|
}
|
|
12812
12849
|
break;
|
|
12813
12850
|
case 34:
|
|
12814
12851
|
e.preventDefault();
|
|
12815
12852
|
if (focusedItem) {
|
|
12816
|
-
activeIndex = this.getIndexByValue(
|
|
12817
|
-
this.pageDownSelection(activeIndex
|
|
12853
|
+
activeIndex = this.getIndexByValue(this.previousFocusItem.getAttribute('data-value'));
|
|
12854
|
+
this.pageDownSelection(activeIndex, true);
|
|
12818
12855
|
this.updateAriaAttribute();
|
|
12819
12856
|
}
|
|
12820
12857
|
break;
|
|
@@ -12850,11 +12887,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12850
12887
|
else if (this.isPopupOpen()) {
|
|
12851
12888
|
const focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
12852
12889
|
let activeIndex;
|
|
12853
|
-
this.isKeyBoardAction = true;
|
|
12854
12890
|
switch (e.keyCode) {
|
|
12855
12891
|
case 36:
|
|
12856
12892
|
case 35:
|
|
12857
12893
|
this.isMouseScrollAction = true;
|
|
12894
|
+
this.isKeyBoardAction = true;
|
|
12858
12895
|
this.homeNavigation((e.keyCode === 36) ? true : false);
|
|
12859
12896
|
break;
|
|
12860
12897
|
case 33:
|
|
@@ -12868,19 +12905,22 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12868
12905
|
case 34:
|
|
12869
12906
|
e.preventDefault();
|
|
12870
12907
|
if (focusedItem) {
|
|
12871
|
-
this.getIndexByValue(focusedItem.getAttribute('data-value'));
|
|
12908
|
+
activeIndex = this.getIndexByValue(focusedItem.getAttribute('data-value'));
|
|
12872
12909
|
this.pageDownSelection(activeIndex + this.getPageCount());
|
|
12873
12910
|
this.updateAriaAttribute();
|
|
12874
12911
|
}
|
|
12875
12912
|
return;
|
|
12876
12913
|
case 38:
|
|
12914
|
+
this.isKeyBoardAction = true;
|
|
12877
12915
|
this.arrowUp(e);
|
|
12878
12916
|
break;
|
|
12879
12917
|
case 40:
|
|
12918
|
+
this.isKeyBoardAction = true;
|
|
12880
12919
|
this.arrowDown(e);
|
|
12881
12920
|
break;
|
|
12882
12921
|
case 27:
|
|
12883
12922
|
e.preventDefault();
|
|
12923
|
+
this.isKeyBoardAction = true;
|
|
12884
12924
|
this.hidePopup(e);
|
|
12885
12925
|
if (this.mode === 'CheckBox') {
|
|
12886
12926
|
this.inputElement.focus();
|
|
@@ -12888,16 +12928,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12888
12928
|
return;
|
|
12889
12929
|
case 13:
|
|
12890
12930
|
e.preventDefault();
|
|
12931
|
+
this.isKeyBoardAction = true;
|
|
12891
12932
|
if (this.mode !== 'CheckBox') {
|
|
12892
12933
|
this.selectByKey(e);
|
|
12893
12934
|
}
|
|
12894
12935
|
this.checkPlaceholderSize();
|
|
12895
12936
|
return;
|
|
12896
12937
|
case 32:
|
|
12938
|
+
this.isKeyBoardAction = true;
|
|
12897
12939
|
this.spaceKeySelection(e);
|
|
12898
12940
|
return;
|
|
12899
12941
|
case 9:
|
|
12900
12942
|
e.preventDefault();
|
|
12943
|
+
this.isKeyBoardAction = true;
|
|
12901
12944
|
this.hidePopup(e);
|
|
12902
12945
|
this.inputElement.focus();
|
|
12903
12946
|
this.overAllWrapper.classList.add(FOCUS);
|
|
@@ -13096,7 +13139,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13096
13139
|
this.isPreventKeyAction = false;
|
|
13097
13140
|
this.isKeyBoardAction = false;
|
|
13098
13141
|
this.isPreventScrollAction = false;
|
|
13099
|
-
nextOffset = nextOffset + (selectedLI.offsetHeight * liCount);
|
|
13100
13142
|
}
|
|
13101
13143
|
this.list.scrollTop = nextOffset;
|
|
13102
13144
|
}
|
|
@@ -13127,9 +13169,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13127
13169
|
if (this.enableVirtualization && this.isKeyBoardAction && firstElementValue && currentElementValue === firstElementValue && keyCode != 36 && !this.isVirtualScrolling) {
|
|
13128
13170
|
this.isUpwardScrolling = true;
|
|
13129
13171
|
this.isPreventKeyAction = true;
|
|
13172
|
+
this.isKeyBoardAction = false;
|
|
13130
13173
|
this.list.scrollTop -= selectedLI.offsetHeight * liCount;
|
|
13131
13174
|
this.isPreventKeyAction = this.list.scrollTop != 0 ? this.isPreventKeyAction : false;
|
|
13132
|
-
this.isKeyBoardAction = false;
|
|
13133
13175
|
this.isPreventScrollAction = false;
|
|
13134
13176
|
}
|
|
13135
13177
|
else if (this.enableVirtualization && keyCode == 36) {
|
|
@@ -13143,7 +13185,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13143
13185
|
this.isPreventKeyAction = false;
|
|
13144
13186
|
this.isKeyBoardAction = false;
|
|
13145
13187
|
this.isPreventScrollAction = false;
|
|
13146
|
-
nextOffset = nextOffset - (selectedLI.offsetHeight * liCount);
|
|
13147
13188
|
}
|
|
13148
13189
|
this.list.scrollTop = this.list.scrollTop + nextOffset;
|
|
13149
13190
|
}
|
|
@@ -13344,7 +13385,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13344
13385
|
this.addListFocus(elements[temp]);
|
|
13345
13386
|
}
|
|
13346
13387
|
else {
|
|
13347
|
-
this.
|
|
13388
|
+
if (this.enableVirtualization && elements[temp + 1].classList.contains('e-virtual-list')) {
|
|
13389
|
+
this.addListFocus(elements[this.skeletonCount]);
|
|
13390
|
+
}
|
|
13391
|
+
else {
|
|
13392
|
+
this.addListFocus(elements[++temp]);
|
|
13393
|
+
}
|
|
13348
13394
|
}
|
|
13349
13395
|
if (temp > -1) {
|
|
13350
13396
|
this.updateCheck(elements[temp]);
|
|
@@ -13561,6 +13607,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13561
13607
|
removeVal = [];
|
|
13562
13608
|
}
|
|
13563
13609
|
removeVal.splice(index, 1);
|
|
13610
|
+
if (this.enableVirtualization && this.mode === 'CheckBox') {
|
|
13611
|
+
this.selectedListData.splice(index, 1);
|
|
13612
|
+
}
|
|
13564
13613
|
this.setProperties({ value: [].concat([], removeVal) }, true);
|
|
13565
13614
|
if (this.enableVirtualization) {
|
|
13566
13615
|
let 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], '');
|
|
@@ -13799,6 +13848,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13799
13848
|
this.listData = list;
|
|
13800
13849
|
}
|
|
13801
13850
|
value = this.allowObjectBinding ? this.getDataByValue(value) : value;
|
|
13851
|
+
if (this.enableVirtualization) {
|
|
13852
|
+
if (isNullOrUndefined(this.selectedListData)) {
|
|
13853
|
+
this.selectedListData = [(this.getDataByValue(value))];
|
|
13854
|
+
}
|
|
13855
|
+
else {
|
|
13856
|
+
if (Array.isArray(this.selectedListData)) {
|
|
13857
|
+
this.selectedListData.push((this.getDataByValue(value)));
|
|
13858
|
+
}
|
|
13859
|
+
else {
|
|
13860
|
+
this.selectedListData = [this.selectedListData, (this.getDataByValue(value))];
|
|
13861
|
+
}
|
|
13862
|
+
}
|
|
13863
|
+
}
|
|
13802
13864
|
if ((this.enableVirtualization && value) || !this.enableVirtualization) {
|
|
13803
13865
|
this.updateListSelectEventCallback(value, element, eve);
|
|
13804
13866
|
}
|
|
@@ -13988,7 +14050,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13988
14050
|
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
13989
14051
|
this.virtualItemCount = this.itemCount;
|
|
13990
14052
|
if (this.mode !== 'CheckBox') {
|
|
13991
|
-
this.
|
|
14053
|
+
this.totalItemsCount();
|
|
13992
14054
|
}
|
|
13993
14055
|
if (!this.list.querySelector('.e-virtual-ddl')) {
|
|
13994
14056
|
var virualElement = this.createElement('div', {
|
|
@@ -14081,6 +14143,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14081
14143
|
}
|
|
14082
14144
|
this.isPreventScrollAction = true;
|
|
14083
14145
|
this.setScrollPosition();
|
|
14146
|
+
if (!this.list.classList.contains(dropDownBaseClasses.noData) && this.getItems()[1] && this.getItems()[1].offsetHeight !== 0) {
|
|
14147
|
+
this.listItemHeight = this.getItems()[1].offsetHeight;
|
|
14148
|
+
if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
|
|
14149
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14150
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
14151
|
+
}
|
|
14152
|
+
}
|
|
14084
14153
|
if (this.allowFiltering) {
|
|
14085
14154
|
this.notify('inputFocus', {
|
|
14086
14155
|
module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'focus'
|
|
@@ -14186,13 +14255,17 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14186
14255
|
sentinelInfo: {},
|
|
14187
14256
|
offsets: {},
|
|
14188
14257
|
startIndex: 0,
|
|
14189
|
-
endIndex:
|
|
14258
|
+
endIndex: this.itemCount,
|
|
14190
14259
|
};
|
|
14191
14260
|
this.previousStartIndex = 0;
|
|
14192
14261
|
this.previousEndIndex = 0;
|
|
14193
14262
|
if (this.dataSource instanceof DataManager) {
|
|
14194
|
-
|
|
14195
|
-
|
|
14263
|
+
if (this.remoteDataCount >= 0) {
|
|
14264
|
+
this.totalItemCount = this.dataCount = this.remoteDataCount;
|
|
14265
|
+
}
|
|
14266
|
+
else {
|
|
14267
|
+
this.resetList(this.dataSource);
|
|
14268
|
+
}
|
|
14196
14269
|
}
|
|
14197
14270
|
else {
|
|
14198
14271
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -14334,7 +14407,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14334
14407
|
EventHandler.add(formElement, 'reset', this.resetValueHandler, this);
|
|
14335
14408
|
}
|
|
14336
14409
|
EventHandler.add(this.componentWrapper, 'mouseout', this.mouseOut, this);
|
|
14337
|
-
EventHandler.add(this.overAllClear, '
|
|
14410
|
+
EventHandler.add(this.overAllClear, 'mousedown', this.clearAll, this);
|
|
14338
14411
|
EventHandler.add(this.inputElement, 'paste', this.pasteHandler, this);
|
|
14339
14412
|
}
|
|
14340
14413
|
onInput(e) {
|
|
@@ -14376,9 +14449,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14376
14449
|
if (this.allowCustomValue) {
|
|
14377
14450
|
this.isRemoteSelection = true;
|
|
14378
14451
|
}
|
|
14379
|
-
|
|
14380
|
-
this.checkAndResetCache();
|
|
14381
|
-
}
|
|
14452
|
+
this.checkAndResetCache();
|
|
14382
14453
|
const eventArgs = {
|
|
14383
14454
|
preventDefaultAction: false,
|
|
14384
14455
|
text: this.targetElement(),
|
|
@@ -14407,12 +14478,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14407
14478
|
let query = new Query();
|
|
14408
14479
|
query = this.allowFiltering && (text !== '') ? query.where(this.fields.text, 'startswith', text, this.ignoreCase, this.ignoreAccent) : query;
|
|
14409
14480
|
if (this.enableVirtualization) {
|
|
14410
|
-
|
|
14411
|
-
this.dataUpdater(this.virtualGroupDataSource, query, this.fields);
|
|
14412
|
-
}
|
|
14413
|
-
else {
|
|
14414
|
-
this.dataUpdater(this.dataSource, query, this.fields);
|
|
14415
|
-
}
|
|
14481
|
+
this.dataUpdater(this.dataSource, query, this.fields);
|
|
14416
14482
|
}
|
|
14417
14483
|
else {
|
|
14418
14484
|
this.dataUpdater(this.mainData, query, this.fields);
|
|
@@ -14571,6 +14637,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14571
14637
|
let textValues = this.text != null && this.text != "" ? this.text + ',' + temp : temp;
|
|
14572
14638
|
data += temp + delimiterChar + ' ';
|
|
14573
14639
|
text.push(textValues);
|
|
14640
|
+
hiddenElementContent += `<option selected value="${valueItem}">${index}</option>`;
|
|
14574
14641
|
break;
|
|
14575
14642
|
}
|
|
14576
14643
|
else {
|
|
@@ -14640,7 +14707,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14640
14707
|
this.unwireListEvents();
|
|
14641
14708
|
this.wireListEvents();
|
|
14642
14709
|
}
|
|
14643
|
-
initialValueUpdate(listItems) {
|
|
14710
|
+
initialValueUpdate(listItems, isInitialVirtualData) {
|
|
14644
14711
|
if (this.list) {
|
|
14645
14712
|
let text;
|
|
14646
14713
|
let element;
|
|
@@ -14660,11 +14727,24 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14660
14727
|
for (let i = 0; i < listItems.length; i++) {
|
|
14661
14728
|
if (getValue((this.fields.value ? this.fields.value : 'value'), listItems[i]) === value) {
|
|
14662
14729
|
text = getValue(this.fields.text, listItems[i]);
|
|
14730
|
+
if (this.enableVirtualization) {
|
|
14731
|
+
if (isNullOrUndefined(this.selectedListData)) {
|
|
14732
|
+
this.selectedListData = [listItems[i]];
|
|
14733
|
+
}
|
|
14734
|
+
else {
|
|
14735
|
+
if (Array.isArray(this.selectedListData)) {
|
|
14736
|
+
this.selectedListData.push((listItems[i]));
|
|
14737
|
+
}
|
|
14738
|
+
else {
|
|
14739
|
+
this.selectedListData = [this.selectedListData, (listItems[i])];
|
|
14740
|
+
}
|
|
14741
|
+
}
|
|
14742
|
+
}
|
|
14663
14743
|
break;
|
|
14664
14744
|
}
|
|
14665
14745
|
}
|
|
14666
14746
|
}
|
|
14667
|
-
if (isNullOrUndefined(text) && this.allowCustomValue) {
|
|
14747
|
+
if ((isNullOrUndefined(text) && this.allowCustomValue) && ((!(this.dataSource instanceof DataManager)) || (this.dataSource instanceof DataManager && isInitialVirtualData))) {
|
|
14668
14748
|
text = this.getTextByValue(value);
|
|
14669
14749
|
isCustomData = true;
|
|
14670
14750
|
}
|
|
@@ -14682,13 +14762,15 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14682
14762
|
this.addChip(text, value);
|
|
14683
14763
|
this.addListSelection(element);
|
|
14684
14764
|
}
|
|
14685
|
-
else if (value && this.allowCustomValue) {
|
|
14765
|
+
else if ((!this.enableVirtualization && value && this.allowCustomValue) || ((this.enableVirtualization && value && this.allowCustomValue) && ((!(this.dataSource instanceof DataManager)) || (this.dataSource instanceof DataManager && isInitialVirtualData)))) {
|
|
14686
14766
|
const indexItem = this.listData.length;
|
|
14687
14767
|
const newValue = {};
|
|
14688
14768
|
setValue(this.fields.text, value, newValue);
|
|
14689
14769
|
setValue(this.fields.value, value, newValue);
|
|
14690
14770
|
const noDataEle = this.popupWrapper.querySelector('.' + dropDownBaseClasses.noData);
|
|
14691
|
-
this.
|
|
14771
|
+
if (!this.enableVirtualization) {
|
|
14772
|
+
this.addItem(newValue, indexItem);
|
|
14773
|
+
}
|
|
14692
14774
|
if (this.enableVirtualization) {
|
|
14693
14775
|
if (this.virtualCustomSelectData && this.virtualCustomSelectData.length >= 0) {
|
|
14694
14776
|
this.virtualCustomSelectData.push(newValue);
|
|
@@ -16020,8 +16102,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16020
16102
|
totalItemsCount() {
|
|
16021
16103
|
let dataSourceCount;
|
|
16022
16104
|
if (this.dataSource instanceof DataManager) {
|
|
16023
|
-
|
|
16024
|
-
|
|
16105
|
+
if (this.remoteDataCount >= 0) {
|
|
16106
|
+
dataSourceCount = this.totalItemCount = this.dataCount = this.remoteDataCount;
|
|
16107
|
+
}
|
|
16108
|
+
else {
|
|
16109
|
+
this.resetList(this.dataSource);
|
|
16110
|
+
}
|
|
16025
16111
|
}
|
|
16026
16112
|
else {
|
|
16027
16113
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -16031,7 +16117,26 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16031
16117
|
this.totalItemCount = dataSourceCount != 0 ? dataSourceCount : this.totalItemCount;
|
|
16032
16118
|
}
|
|
16033
16119
|
else {
|
|
16034
|
-
|
|
16120
|
+
if (this.hideSelectedItem) {
|
|
16121
|
+
this.totalItemCount = dataSourceCount != 0 && this.value ? dataSourceCount - this.value.length : this.totalItemCount;
|
|
16122
|
+
if (this.allowCustomValue && this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
|
|
16123
|
+
for (let i = 0; i < this.virtualCustomSelectData.length; i++) {
|
|
16124
|
+
for (let j = 0; j < this.value.length; j++) {
|
|
16125
|
+
const value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[j]) : this.value[j];
|
|
16126
|
+
const customValue = getValue((this.fields.value) ? this.fields.value : '', this.virtualCustomSelectData[i]);
|
|
16127
|
+
if (value === customValue) {
|
|
16128
|
+
this.totalItemCount += 1;
|
|
16129
|
+
}
|
|
16130
|
+
}
|
|
16131
|
+
}
|
|
16132
|
+
}
|
|
16133
|
+
}
|
|
16134
|
+
else {
|
|
16135
|
+
this.totalItemCount = dataSourceCount != 0 ? dataSourceCount : this.totalItemCount;
|
|
16136
|
+
if (this.allowCustomValue && this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
|
|
16137
|
+
this.totalItemCount += this.virtualCustomSelectData.length;
|
|
16138
|
+
}
|
|
16139
|
+
}
|
|
16035
16140
|
}
|
|
16036
16141
|
}
|
|
16037
16142
|
presentItemValue(ulElement) {
|
|
@@ -16069,7 +16174,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16069
16174
|
valuecheck = this.presentItemValue(this.ulElement);
|
|
16070
16175
|
}
|
|
16071
16176
|
if (prop == 'value' && valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
|
|
16072
|
-
&& this.listData != null) {
|
|
16177
|
+
&& this.listData != null && !this.enableVirtualization) {
|
|
16073
16178
|
this.mainData = null;
|
|
16074
16179
|
this.setDynValue = true;
|
|
16075
16180
|
this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
|
|
@@ -16088,7 +16193,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16088
16193
|
const list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
|
|
16089
16194
|
this.onActionComplete(list, this.mainData);
|
|
16090
16195
|
}
|
|
16091
|
-
this.
|
|
16196
|
+
if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
|
|
16197
|
+
this.initialValueUpdate();
|
|
16198
|
+
}
|
|
16092
16199
|
if (this.mode !== 'Box' && !this.inputFocus) {
|
|
16093
16200
|
this.updateDelimView();
|
|
16094
16201
|
}
|
|
@@ -16140,6 +16247,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16140
16247
|
}
|
|
16141
16248
|
this.beforePopupOpen = false;
|
|
16142
16249
|
this.overAllWrapper.classList.remove(iconAnimation);
|
|
16250
|
+
const typedValue = this.mode == 'CheckBox' ? this.targetElement() : null;
|
|
16143
16251
|
this.popupObj.hide(new Animation(eventArgs.animation));
|
|
16144
16252
|
attributes(this.inputElement, { 'aria-expanded': 'false' });
|
|
16145
16253
|
this.inputElement.removeAttribute('aria-owns');
|
|
@@ -16153,22 +16261,27 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16153
16261
|
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
16154
16262
|
EventHandler.remove(this.popupObj.element, 'click', this.clickHandler);
|
|
16155
16263
|
}
|
|
16156
|
-
if (this.enableVirtualization && this.mode === 'CheckBox' && this.enableSelectionOrder) {
|
|
16264
|
+
if (this.enableVirtualization && this.mode === 'CheckBox' && this.value && this.value.length > 0 && this.enableSelectionOrder) {
|
|
16157
16265
|
this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
|
|
16158
16266
|
this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.viewPortInfo.startIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
|
|
16267
|
+
this.virtualListInfo = this.viewPortInfo;
|
|
16159
16268
|
this.previousStartIndex = 0;
|
|
16160
16269
|
this.previousEndIndex = 0;
|
|
16161
16270
|
}
|
|
16162
16271
|
let dataSourceCount;
|
|
16163
16272
|
if (this.dataSource instanceof DataManager) {
|
|
16164
|
-
|
|
16165
|
-
|
|
16273
|
+
if (this.remoteDataCount >= 0) {
|
|
16274
|
+
this.totalItemCount = this.dataCount = this.remoteDataCount;
|
|
16275
|
+
}
|
|
16276
|
+
else {
|
|
16277
|
+
this.resetList(this.dataSource);
|
|
16278
|
+
}
|
|
16166
16279
|
}
|
|
16167
16280
|
else {
|
|
16168
16281
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16169
16282
|
dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
16170
16283
|
}
|
|
16171
|
-
if (this.enableVirtualization && (this.allowFiltering || this.allowCustomValue) && this.
|
|
16284
|
+
if (this.enableVirtualization && (this.allowFiltering || this.allowCustomValue) && (this.targetElement() || typedValue) && this.totalItemCount !== dataSourceCount) {
|
|
16172
16285
|
this.updateInitialData();
|
|
16173
16286
|
this.checkAndResetCache();
|
|
16174
16287
|
}
|
|
@@ -16499,8 +16612,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16499
16612
|
if (this.dataSource instanceof DataManager) {
|
|
16500
16613
|
this.dataSource.executeQuery(new Query().where(predicate))
|
|
16501
16614
|
.then((e) => {
|
|
16502
|
-
if (e.result.
|
|
16503
|
-
listItems = e.result
|
|
16615
|
+
if (e.result.length > 0) {
|
|
16616
|
+
listItems = e.result;
|
|
16617
|
+
this.initStatus = false;
|
|
16618
|
+
this.initialValueUpdate(listItems, true);
|
|
16619
|
+
this.initialUpdate();
|
|
16620
|
+
this.initStatus = true;
|
|
16504
16621
|
}
|
|
16505
16622
|
});
|
|
16506
16623
|
}
|
|
@@ -16515,7 +16632,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16515
16632
|
else {
|
|
16516
16633
|
this.setInitialValue = () => {
|
|
16517
16634
|
this.initStatus = false;
|
|
16518
|
-
this.
|
|
16635
|
+
if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
|
|
16636
|
+
this.initialValueUpdate(listItems);
|
|
16637
|
+
}
|
|
16519
16638
|
this.initialUpdate();
|
|
16520
16639
|
this.setInitialValue = null;
|
|
16521
16640
|
this.initStatus = true;
|
|
@@ -19001,12 +19120,6 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
19001
19120
|
tListBox.ulElement.removeChild(noRecElem);
|
|
19002
19121
|
}
|
|
19003
19122
|
}
|
|
19004
|
-
if (isRefresh) {
|
|
19005
|
-
const noRecElem = fListBox.ulElement.childNodes[0];
|
|
19006
|
-
if (noRecElem) {
|
|
19007
|
-
fListBox.ulElement.removeChild(noRecElem);
|
|
19008
|
-
}
|
|
19009
|
-
}
|
|
19010
19123
|
if (fListBox.listData.length > 0) {
|
|
19011
19124
|
// eslint-disable-next-line prefer-spread
|
|
19012
19125
|
flistboxarray = Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number);
|
|
@@ -19049,6 +19162,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
19049
19162
|
tListBox.liCollections = tliCollections.concat(fliCollections);
|
|
19050
19163
|
}
|
|
19051
19164
|
fListBox.value = [];
|
|
19165
|
+
listData = listData.filter((data) => (data !== undefined));
|
|
19052
19166
|
listData = listData
|
|
19053
19167
|
.filter((data) => data.isHeader !== true);
|
|
19054
19168
|
const sortedData = listData.filter(function (val) {
|