@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.
@@ -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.setCurrentViewDataAsync();
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 = 10;
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 : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
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 * 2 < this.itemCount ? this.itemCount : actualCount * 2;
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) + 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 && !this.virtualGroupDataSource) {
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
- this.trigger('actionComplete', e, (e) => {
1378
- if (!this.virtualGroupDataSource && this.isVirtualizationEnabled) {
1379
- this.isRemoteDataUpdated = true;
1380
- if ((this.getModuleName() === 'combobox' && !this.initialRemoteRender && this.isAllowFiltering && this.isVirtualizationEnabled && e.result)) {
1381
- e.result = e.result.result;
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
- if (e.result.length > 0) {
1384
- let dataSource = e.result;
1385
- if (this.isVirtualizationEnabled && this.fields.groupBy) {
1386
- let data = new DataManager(dataSource).executeLocal(new Query().group(this.fields.groupBy));
1387
- this.virtualGroupDataSource = data.records;
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
- else {
1390
- this.virtualGroupDataSource = dataSource;
1391
- this.hideSpinner();
1392
- this.isRequested = false;
1393
- this.isRequesting = false;
1394
- this.setListData(dataSource, fields, query, event);
1395
- return;
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
- loadedGroupList++;
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
- count++;
1792
- isCount = true;
1819
+
1793
1820
  }
1794
1821
  }
1795
1822
  }
@@ -3384,8 +3411,11 @@ let DropDownList = class DropDownList extends DropDownBase {
3384
3411
  const focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
3385
3412
  if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
3386
3413
  this.setSelection(focusEle, e);
3387
- if (this.enableVirtualization && !this.fields.groupBy && this.getModuleName() !== 'combobox') {
3414
+ if (this.enableVirtualization) {
3388
3415
  let selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
3416
+ if (this.fields.groupBy) {
3417
+ selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex == 0 ? this.selectedLI.offsetHeight - selectedLiOffsetTop : selectedLiOffsetTop - this.selectedLI.offsetHeight;
3418
+ }
3389
3419
  this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
3390
3420
  }
3391
3421
  }
@@ -3422,7 +3452,13 @@ let DropDownList = class DropDownList extends DropDownBase {
3422
3452
  }
3423
3453
  }
3424
3454
  if (!isNullOrUndefined(nextItem)) {
3455
+ const focusAtFirstElement = this.liCollections[this.skeletonCount] && this.liCollections[this.skeletonCount].classList.contains('e-item-focus');
3425
3456
  this.setSelection(nextItem, e);
3457
+ if (focusAtFirstElement && this.enableVirtualization && this.getModuleName() === 'autocomplete' && !isVirtualKeyAction) {
3458
+ let selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
3459
+ selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex == 0 && this.fields.groupBy ? this.selectedLI.offsetHeight - selectedLiOffsetTop : selectedLiOffsetTop - this.selectedLI.offsetHeight;
3460
+ this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
3461
+ }
3426
3462
  }
3427
3463
  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
3464
  if (e.action === 'down') {
@@ -3549,14 +3585,13 @@ let DropDownList = class DropDownList extends DropDownBase {
3549
3585
  }
3550
3586
  break;
3551
3587
  case 'pageUp':
3552
- let count = (pageCount * 2) - 4;
3553
- this.activeIndex = Math.round(count);
3588
+ this.activeIndex = this.getModuleName() === 'autocomplete' ? this.getIndexByValue(this.selectedLI.getAttribute('data-value')) + this.getPageCount() - 1 : this.getIndexByValue(this.previousValue);
3554
3589
  this.pageUpSelection(this.activeIndex - this.getPageCount(), e, true);
3555
3590
  e.preventDefault();
3556
3591
  break;
3557
3592
  case 'pageDown':
3558
- this.activeIndex = 1;
3559
- this.pageDownSelection(this.activeIndex + this.getPageCount(), e, true);
3593
+ this.activeIndex = this.getModuleName() === 'autocomplete' ? this.getIndexByValue(this.selectedLI.getAttribute('data-value')) - this.getPageCount() : this.getIndexByValue(this.previousValue);
3594
+ this.pageDownSelection(!isNullOrUndefined(this.activeIndex) ? (this.activeIndex + this.getPageCount()) : (2 * this.getPageCount()), e, true);
3560
3595
  e.preventDefault();
3561
3596
  break;
3562
3597
  case 'home':
@@ -3593,8 +3628,8 @@ let DropDownList = class DropDownList extends DropDownBase {
3593
3628
  }
3594
3629
  pageUpSelection(steps, event, isVirtualKeyAction) {
3595
3630
  let previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
3596
- if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
3597
- previousItem = steps >= 0 ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
3631
+ if ((this.enableVirtualization && this.activeIndex == null)) {
3632
+ previousItem = (this.liCollections.length >= steps && steps >= 0) ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
3598
3633
  }
3599
3634
  if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
3600
3635
  previousItem = this.liCollections[this.skeletonCount];
@@ -3626,7 +3661,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3626
3661
  steps = this.getModuleName() === 'dropdownlist' && this.allowFiltering ? steps + 1 : steps;
3627
3662
  previousItem = steps < list.length ? this.liCollections[steps] : this.liCollections[list.length - 1];
3628
3663
  }
3629
- if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
3664
+ if ((this.enableVirtualization && this.activeIndex == null)) {
3630
3665
  previousItem = steps <= list.length ? this.liCollections[steps + this.skeletonCount - 1] : this.liCollections[list.length - 1];
3631
3666
  }
3632
3667
  this.PageUpDownSelection(previousItem, event);
@@ -3811,6 +3846,11 @@ let DropDownList = class DropDownList extends DropDownBase {
3811
3846
  }
3812
3847
  }
3813
3848
  else {
3849
+ if (this.enableVirtualization && this.activeIndex == null && this.dataSource instanceof DataManager) {
3850
+ this.UpdateSkeleton();
3851
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
3852
+ this.ulElement = this.list.querySelector('ul');
3853
+ }
3814
3854
  this.activeIndex = this.getIndexByValue(value);
3815
3855
  }
3816
3856
  }
@@ -3870,7 +3910,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3870
3910
  if (this.enableVirtualization && this.value) {
3871
3911
  const fields = (this.fields.value) ? this.fields.value : '';
3872
3912
  let currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
3873
- if (this.dataSource instanceof DataManager && this.virtualGroupDataSource) {
3913
+ if (this.dataSource instanceof DataManager) {
3874
3914
  const getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue)));
3875
3915
  if (getItem && getItem.length > 0) {
3876
3916
  this.itemData = getItem[0];
@@ -4212,7 +4252,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4212
4252
  if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
4213
4253
  filterQuery.where('', filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
4214
4254
  }
4215
- else if (((this.getModuleName() !== 'combobox') || this.enableVirtualization) || (this.isFiltering() && this.getModuleName() === 'combobox' && this.typedString !== '')) {
4255
+ else if (((this.getModuleName() !== 'combobox')) || (this.isFiltering() && this.getModuleName() === 'combobox' && this.typedString !== '')) {
4216
4256
  const fields = (this.fields.text) ? this.fields.text : '';
4217
4257
  filterQuery.where(fields, filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
4218
4258
  }
@@ -4220,7 +4260,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4220
4260
  else {
4221
4261
  filterQuery = (this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery)) ? this.customFilterQuery.clone() : query ? query.clone() : this.query ? this.query.clone() : new Query();
4222
4262
  }
4223
- if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
4263
+ if (this.enableVirtualization && this.viewPortInfo.endIndex != 0) {
4224
4264
  var takeValue = this.getTakeValue();
4225
4265
  var alreadySkipAdded = false;
4226
4266
  if (filterQuery) {
@@ -4287,14 +4327,6 @@ let DropDownList = class DropDownList extends DropDownBase {
4287
4327
  }
4288
4328
  filterQuery.requiresCount();
4289
4329
  }
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
4330
  return filterQuery;
4299
4331
  }
4300
4332
  getSelectionPoints() {
@@ -4320,7 +4352,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4320
4352
  return;
4321
4353
  }
4322
4354
  this.isCustomFilter = true;
4323
- this.customFilterQuery = query;
4355
+ this.customFilterQuery = query.clone();
4324
4356
  this.filteringAction(dataSource, query, fields);
4325
4357
  },
4326
4358
  baseEventArgs: e,
@@ -4620,6 +4652,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4620
4652
  this.addNewItem(list, selectedItem);
4621
4653
  }
4622
4654
  if (!isNullOrUndefined(this.itemData) || (isNullOrUndefined(this.itemData) && this.enableVirtualization)) {
4655
+ this.getSkeletonCount();
4656
+ this.skeletonCount = this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2) ? 0 : this.skeletonCount;
4657
+ this.UpdateSkeleton();
4623
4658
  this.focusIndexItem();
4624
4659
  }
4625
4660
  if (this.enableVirtualization) {
@@ -4720,7 +4755,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4720
4755
  }
4721
4756
  focusIndexItem() {
4722
4757
  const value = this.getItemData().value;
4723
- this.activeIndex = this.getIndexByValue(value);
4758
+ this.activeIndex = ((this.enableVirtualization && !isNullOrUndefined(value)) || !this.enableVirtualization) ? this.getIndexByValue(value) : this.activeIndex;
4724
4759
  const element = this.findListElement(this.list, 'li', 'data-value', value);
4725
4760
  this.selectedLI = element;
4726
4761
  this.activeItem(element);
@@ -5134,7 +5169,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5134
5169
  }
5135
5170
  else {
5136
5171
  if (this.enableVirtualization) {
5137
- liCount = keyAction == "pageDown" ? this.getPageCount() : liCount;
5172
+ liCount = keyAction == "pageDown" ? this.getPageCount() + 1 : liCount;
5138
5173
  }
5139
5174
  this.list.scrollTop += this.selectedLI.offsetHeight * liCount;
5140
5175
  }
@@ -5153,7 +5188,6 @@ let DropDownList = class DropDownList extends DropDownBase {
5153
5188
  this.isPreventKeyAction = false;
5154
5189
  this.isKeyBoardAction = false;
5155
5190
  this.isPreventScrollAction = false;
5156
- nextOffset = nextOffset + (this.selectedLI.offsetHeight * liCount);
5157
5191
  }
5158
5192
  this.list.scrollTop = nextOffset;
5159
5193
  }
@@ -5210,7 +5244,6 @@ let DropDownList = class DropDownList extends DropDownBase {
5210
5244
  this.isPreventKeyAction = false;
5211
5245
  this.isKeyBoardAction = false;
5212
5246
  this.isPreventScrollAction = false;
5213
- nextOffset = nextOffset - (this.selectedLI.offsetHeight * liCount);
5214
5247
  }
5215
5248
  this.list.scrollTop = this.list.scrollTop + nextOffset;
5216
5249
  }
@@ -5403,7 +5436,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5403
5436
  sentinelInfo: {},
5404
5437
  offsets: {},
5405
5438
  startIndex: 0,
5406
- endIndex: 0,
5439
+ endIndex: this.itemCount,
5407
5440
  };
5408
5441
  if (this.getModuleName() === 'combobox') {
5409
5442
  this.typedString = "";
@@ -5411,8 +5444,12 @@ let DropDownList = class DropDownList extends DropDownBase {
5411
5444
  this.previousStartIndex = 0;
5412
5445
  this.previousEndIndex = 0;
5413
5446
  if (this.dataSource instanceof DataManager) {
5414
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5415
- this.totalItemCount = this.dataCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
5447
+ if (this.remoteDataCount >= 0) {
5448
+ this.totalItemCount = this.dataCount = this.remoteDataCount;
5449
+ }
5450
+ else {
5451
+ this.resetList(this.dataSource);
5452
+ }
5416
5453
  }
5417
5454
  else {
5418
5455
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -9817,7 +9854,7 @@ let ComboBox = class ComboBox extends DropDownList {
9817
9854
  if (this.enableVirtualization && this.value) {
9818
9855
  const fields = (this.fields.value) ? this.fields.value : '';
9819
9856
  let currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
9820
- if (this.dataSource instanceof DataManager && this.virtualGroupDataSource) {
9857
+ if (this.dataSource instanceof DataManager) {
9821
9858
  const getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue)));
9822
9859
  if (getItem && getItem.length > 0) {
9823
9860
  this.itemData = getItem[0];
@@ -10040,7 +10077,7 @@ let ComboBox = class ComboBox extends DropDownList {
10040
10077
  }
10041
10078
  }
10042
10079
  setValue(e) {
10043
- if (e && e.type === 'keydown' && e.action === 'enter') {
10080
+ if ((e && e.type === 'keydown' && e.action === 'enter') || (e && e.type === 'click')) {
10044
10081
  this.removeFillSelection();
10045
10082
  }
10046
10083
  if (this.autofill && this.getModuleName() === 'combobox' && e && e.type === 'keydown' && e.action !== 'enter') {
@@ -10727,7 +10764,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
10727
10764
  if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
10728
10765
  filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
10729
10766
  }
10730
- else if ((!this.enableVirtualization) || (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource)))) {
10767
+ else {
10731
10768
  const mapping = !isNullOrUndefined(this.fields.value) ? this.fields.value : '';
10732
10769
  filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
10733
10770
  }
@@ -10743,7 +10780,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
10743
10780
  }
10744
10781
  filterQuery.take(this.suggestionCount);
10745
10782
  }
10746
- if (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
10783
+ if (this.enableVirtualization) {
10747
10784
  let queryTakeValue = 0;
10748
10785
  let querySkipValue = 0;
10749
10786
  var takeValue = this.getTakeValue();
@@ -10793,14 +10830,6 @@ let AutoComplete = class AutoComplete extends ComboBox {
10793
10830
  }
10794
10831
  filterQuery.requiresCount();
10795
10832
  }
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
10833
  return filterQuery;
10805
10834
  }
10806
10835
  searchLists(e) {
@@ -11579,10 +11608,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11579
11608
  attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_popup', 'aria-controls': this.element.id });
11580
11609
  this.updateAriaActiveDescendant();
11581
11610
  if (this.isFirstClick) {
11582
- if (this.enableVirtualization && this.mode === 'CheckBox' && this.value && this.enableSelectionOrder) {
11583
- this.updateVirtualReOrderList();
11611
+ if (!this.enableVirtualization) {
11612
+ this.loadTemplate();
11584
11613
  }
11585
- this.loadTemplate();
11586
11614
  }
11587
11615
  if (this.mode === 'CheckBox' && this.showSelectAll) {
11588
11616
  EventHandler.add(this.popupObj.element, 'click', this.clickHandler, this);
@@ -11592,7 +11620,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11592
11620
  }
11593
11621
  updateVirtualReOrderList(isCheckBoxUpdate) {
11594
11622
  let query = this.getForQuery(this.value, true).clone();
11595
- this.resetList(this.dataSource, this.fields, query);
11623
+ if (this.enableVirtualization && this.dataSource instanceof DataManager) {
11624
+ this.resetList(this.selectedListData, this.fields, query);
11625
+ }
11626
+ else {
11627
+ this.resetList(this.dataSource, this.fields, query);
11628
+ }
11596
11629
  this.UpdateSkeleton();
11597
11630
  this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
11598
11631
  this.virtualItemCount = this.itemCount;
@@ -11649,6 +11682,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11649
11682
  }
11650
11683
  if (this.enableVirtualization) {
11651
11684
  const focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
11685
+ this.isKeyBoardAction = false;
11652
11686
  this.scrollBottom(focusedItem);
11653
11687
  }
11654
11688
  }
@@ -11766,15 +11800,15 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11766
11800
  getForQuery(valuecheck, isCheckbox) {
11767
11801
  let predicate;
11768
11802
  const field = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
11769
- if (this.enableVirtualization) {
11803
+ if (this.enableVirtualization && valuecheck) {
11770
11804
  if (isCheckbox) {
11771
11805
  for (let i = 0; i < valuecheck.length; i++) {
11772
11806
  const value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', valuecheck[i]) : valuecheck[i];
11773
11807
  if (i === 0) {
11774
- predicate = new Predicate(field, 'equal', value);
11808
+ predicate = new Predicate(field, 'equal', (value));
11775
11809
  }
11776
11810
  else {
11777
- predicate = predicate.or(field, 'equal', value);
11811
+ predicate = predicate.or(field, 'equal', (value));
11778
11812
  }
11779
11813
  }
11780
11814
  return new Query().where(predicate);
@@ -11783,10 +11817,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11783
11817
  for (let i = 0; i < valuecheck.length; i++) {
11784
11818
  const value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', valuecheck[i]) : valuecheck[i];
11785
11819
  if (i === 0) {
11786
- predicate = new Predicate(field, 'notequal', value);
11820
+ predicate = new Predicate(field, 'notequal', (value));
11787
11821
  }
11788
11822
  else {
11789
- predicate = predicate.and(field, 'notequal', value);
11823
+ predicate = predicate.and(field, 'notequal', (value));
11790
11824
  }
11791
11825
  }
11792
11826
  return new Query().where(predicate);
@@ -11836,7 +11870,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11836
11870
  valuecheck = this.presentItemValue(this.ulElement);
11837
11871
  }
11838
11872
  if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
11839
- && this.listData != null) {
11873
+ && this.listData != null && !this.enableVirtualization) {
11840
11874
  this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
11841
11875
  }
11842
11876
  else {
@@ -11847,6 +11881,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11847
11881
  query = this.allowFiltering ? query.where(this.fields.text, 'startswith', this.inputElement.value, this.ignoreCase, this.ignoreAccent) : query;
11848
11882
  this.checkForCustomValue(query, this.fields);
11849
11883
  this.isCustomRendered = true;
11884
+ this.remoteCustomValue = this.enableVirtualization ? false : this.remoteCustomValue;
11850
11885
  }
11851
11886
  if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
11852
11887
  this.removeFocus();
@@ -11891,7 +11926,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11891
11926
  if (!isNullOrUndefined(this.text) && (isNullOrUndefined(this.value) || this.value.length === 0)) {
11892
11927
  this.initialTextUpdate();
11893
11928
  }
11894
- this.initialValueUpdate();
11929
+ if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
11930
+ this.initialValueUpdate();
11931
+ }
11895
11932
  this.initialUpdate();
11896
11933
  this.refreshPlaceHolder();
11897
11934
  if (this.mode !== 'CheckBox' && this.changeOnBlur) {
@@ -12094,7 +12131,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12094
12131
  if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
12095
12132
  filterQuery.where('', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);
12096
12133
  }
12097
- else {
12134
+ else if ((this.enableVirtualization && this.targetElement() !== "") || !this.enableVirtualization) {
12098
12135
  const fields = this.fields;
12099
12136
  filterQuery.where(!isNullOrUndefined(fields.text) ? fields.text : '', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);
12100
12137
  }
@@ -12105,18 +12142,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12105
12142
  return filterQuery;
12106
12143
  }
12107
12144
  else {
12108
- if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
12145
+ if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll) {
12109
12146
  return this.virtualFilterQuery(filterQuery);
12110
12147
  }
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
12148
  return query ? query : this.query ? this.query : new Query();
12121
12149
  }
12122
12150
  }
@@ -12279,7 +12307,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12279
12307
  let dataItem = {};
12280
12308
  setValue(field.text, value, dataItem);
12281
12309
  if (typeof getValue((this.fields.value ? this.fields.value : 'value'), customData)
12282
- === 'number') {
12310
+ === 'number' && this.fields.value !== this.fields.text) {
12283
12311
  setValue(field.value, Math.random(), dataItem);
12284
12312
  }
12285
12313
  else {
@@ -12296,17 +12324,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12296
12324
  dataItem = this.allowObjectBinding ? emptyObject : dataItem;
12297
12325
  if (this.enableVirtualization) {
12298
12326
  this.virtualCustomData = dataItem;
12299
- let tempData = this.virtualGroupDataSource ? JSON.parse(JSON.stringify(this.virtualGroupDataSource)) : JSON.parse(JSON.stringify(this.dataSource));
12327
+ let tempData = this.dataSource instanceof DataManager ? JSON.parse(JSON.stringify(this.listData)) : JSON.parse(JSON.stringify(this.dataSource));
12300
12328
  let totalData = [];
12301
12329
  if (this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
12302
12330
  totalData = tempData.concat(this.virtualCustomSelectData);
12303
12331
  }
12304
12332
  tempData.splice(0, 0, dataItem);
12305
12333
  this.isCustomDataUpdated = true;
12334
+ let tempCount = this.totalItemCount;
12306
12335
  this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
12307
12336
  this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.itemCount;
12308
12337
  this.resetList(tempData, field, query);
12309
12338
  this.isCustomDataUpdated = false;
12339
+ this.totalItemCount = this.enableVirtualization && this.dataSource instanceof DataManager ? tempCount : this.totalItemCount;
12310
12340
  }
12311
12341
  else {
12312
12342
  const tempData = JSON.parse(JSON.stringify(this.listData));
@@ -12327,7 +12357,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12327
12357
  else if (this.listData && this.mainData && !dataChecks && this.allowCustomValue) {
12328
12358
  if (this.allowFiltering && this.isRemoteSelection && this.remoteCustomValue) {
12329
12359
  this.isRemoteSelection = false;
12330
- this.resetList(this.listData, field, query);
12360
+ if (!this.enableVirtualization) {
12361
+ this.resetList(this.listData, field, query);
12362
+ }
12331
12363
  }
12332
12364
  else if (!this.allowFiltering && this.list) {
12333
12365
  const liCollections = this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-hide-listitem)');
@@ -12584,21 +12616,25 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12584
12616
  + dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
12585
12617
  let previousItem = steps >= 0 ? collection[steps + 1] : collection[0];
12586
12618
  if (this.enableVirtualization && isVirtualKeyAction) {
12587
- previousItem = steps >= 0 && this.viewPortInfo.startIndex != 0 ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[this.skeletonCount];
12619
+ previousItem = (this.liCollections.length >= steps && steps >= 0) ? this.liCollections[steps] : this.liCollections[this.skeletonCount];
12588
12620
  }
12589
12621
  if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
12590
12622
  previousItem = this.liCollections[this.skeletonCount];
12591
12623
  }
12592
12624
  if (this.enableVirtualization) {
12593
12625
  if (!isNullOrUndefined(previousItem) && !previousItem.classList.contains('e-item-focus')) {
12626
+ this.isKeyBoardAction = true;
12594
12627
  this.addListFocus(previousItem);
12595
12628
  this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
12596
12629
  }
12597
12630
  else if (this.viewPortInfo.startIndex == 0) {
12631
+ this.isKeyBoardAction = true;
12598
12632
  this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
12599
12633
  }
12634
+ this.previousFocusItem = previousItem;
12600
12635
  }
12601
12636
  else {
12637
+ this.isKeyBoardAction = true;
12602
12638
  this.addListFocus(previousItem);
12603
12639
  this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
12604
12640
  }
@@ -12615,7 +12651,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12615
12651
  if (this.enableVirtualization && isVirtualKeyAction) {
12616
12652
  previousItem = steps <= list.length ? this.liCollections[steps] : this.liCollections[list.length - 1];
12617
12653
  }
12654
+ this.isKeyBoardAction = true;
12618
12655
  this.addListFocus(previousItem);
12656
+ this.previousFocusItem = previousItem;
12619
12657
  this.scrollBottom(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), false, this.keyboardEvent.keyCode);
12620
12658
  }
12621
12659
  getItems() {
@@ -12803,18 +12841,16 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12803
12841
  case 33:
12804
12842
  e.preventDefault();
12805
12843
  if (focusedItem) {
12806
- var count = (this.getPageCount() * 2) - 4;
12807
- activeIndex = Math.round(count);
12808
- activeIndex = this.getIndexByValue(focusedItem.getAttribute('data-value'));
12809
- this.pageUpSelection(activeIndex - this.getPageCount(), true);
12844
+ activeIndex = this.getIndexByValue(this.previousFocusItem.getAttribute('data-value')) - 1;
12845
+ this.pageUpSelection(activeIndex, true);
12810
12846
  this.updateAriaAttribute();
12811
12847
  }
12812
12848
  break;
12813
12849
  case 34:
12814
12850
  e.preventDefault();
12815
12851
  if (focusedItem) {
12816
- activeIndex = this.getIndexByValue(focusedItem.getAttribute('data-value'));
12817
- this.pageDownSelection(activeIndex + this.getPageCount() + 1, true);
12852
+ activeIndex = this.getIndexByValue(this.previousFocusItem.getAttribute('data-value'));
12853
+ this.pageDownSelection(activeIndex, true);
12818
12854
  this.updateAriaAttribute();
12819
12855
  }
12820
12856
  break;
@@ -12850,11 +12886,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12850
12886
  else if (this.isPopupOpen()) {
12851
12887
  const focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
12852
12888
  let activeIndex;
12853
- this.isKeyBoardAction = true;
12854
12889
  switch (e.keyCode) {
12855
12890
  case 36:
12856
12891
  case 35:
12857
12892
  this.isMouseScrollAction = true;
12893
+ this.isKeyBoardAction = true;
12858
12894
  this.homeNavigation((e.keyCode === 36) ? true : false);
12859
12895
  break;
12860
12896
  case 33:
@@ -12868,19 +12904,22 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12868
12904
  case 34:
12869
12905
  e.preventDefault();
12870
12906
  if (focusedItem) {
12871
- this.getIndexByValue(focusedItem.getAttribute('data-value'));
12907
+ activeIndex = this.getIndexByValue(focusedItem.getAttribute('data-value'));
12872
12908
  this.pageDownSelection(activeIndex + this.getPageCount());
12873
12909
  this.updateAriaAttribute();
12874
12910
  }
12875
12911
  return;
12876
12912
  case 38:
12913
+ this.isKeyBoardAction = true;
12877
12914
  this.arrowUp(e);
12878
12915
  break;
12879
12916
  case 40:
12917
+ this.isKeyBoardAction = true;
12880
12918
  this.arrowDown(e);
12881
12919
  break;
12882
12920
  case 27:
12883
12921
  e.preventDefault();
12922
+ this.isKeyBoardAction = true;
12884
12923
  this.hidePopup(e);
12885
12924
  if (this.mode === 'CheckBox') {
12886
12925
  this.inputElement.focus();
@@ -12888,16 +12927,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12888
12927
  return;
12889
12928
  case 13:
12890
12929
  e.preventDefault();
12930
+ this.isKeyBoardAction = true;
12891
12931
  if (this.mode !== 'CheckBox') {
12892
12932
  this.selectByKey(e);
12893
12933
  }
12894
12934
  this.checkPlaceholderSize();
12895
12935
  return;
12896
12936
  case 32:
12937
+ this.isKeyBoardAction = true;
12897
12938
  this.spaceKeySelection(e);
12898
12939
  return;
12899
12940
  case 9:
12900
12941
  e.preventDefault();
12942
+ this.isKeyBoardAction = true;
12901
12943
  this.hidePopup(e);
12902
12944
  this.inputElement.focus();
12903
12945
  this.overAllWrapper.classList.add(FOCUS);
@@ -13096,7 +13138,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13096
13138
  this.isPreventKeyAction = false;
13097
13139
  this.isKeyBoardAction = false;
13098
13140
  this.isPreventScrollAction = false;
13099
- nextOffset = nextOffset + (selectedLI.offsetHeight * liCount);
13100
13141
  }
13101
13142
  this.list.scrollTop = nextOffset;
13102
13143
  }
@@ -13127,9 +13168,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13127
13168
  if (this.enableVirtualization && this.isKeyBoardAction && firstElementValue && currentElementValue === firstElementValue && keyCode != 36 && !this.isVirtualScrolling) {
13128
13169
  this.isUpwardScrolling = true;
13129
13170
  this.isPreventKeyAction = true;
13171
+ this.isKeyBoardAction = false;
13130
13172
  this.list.scrollTop -= selectedLI.offsetHeight * liCount;
13131
13173
  this.isPreventKeyAction = this.list.scrollTop != 0 ? this.isPreventKeyAction : false;
13132
- this.isKeyBoardAction = false;
13133
13174
  this.isPreventScrollAction = false;
13134
13175
  }
13135
13176
  else if (this.enableVirtualization && keyCode == 36) {
@@ -13143,7 +13184,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13143
13184
  this.isPreventKeyAction = false;
13144
13185
  this.isKeyBoardAction = false;
13145
13186
  this.isPreventScrollAction = false;
13146
- nextOffset = nextOffset - (selectedLI.offsetHeight * liCount);
13147
13187
  }
13148
13188
  this.list.scrollTop = this.list.scrollTop + nextOffset;
13149
13189
  }
@@ -13344,7 +13384,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13344
13384
  this.addListFocus(elements[temp]);
13345
13385
  }
13346
13386
  else {
13347
- this.addListFocus(elements[++temp]);
13387
+ if (this.enableVirtualization && elements[temp + 1].classList.contains('e-virtual-list')) {
13388
+ this.addListFocus(elements[this.skeletonCount]);
13389
+ }
13390
+ else {
13391
+ this.addListFocus(elements[++temp]);
13392
+ }
13348
13393
  }
13349
13394
  if (temp > -1) {
13350
13395
  this.updateCheck(elements[temp]);
@@ -13561,6 +13606,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13561
13606
  removeVal = [];
13562
13607
  }
13563
13608
  removeVal.splice(index, 1);
13609
+ if (this.enableVirtualization && this.mode === 'CheckBox') {
13610
+ this.selectedListData.splice(index, 1);
13611
+ }
13564
13612
  this.setProperties({ value: [].concat([], removeVal) }, true);
13565
13613
  if (this.enableVirtualization) {
13566
13614
  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 +13847,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13799
13847
  this.listData = list;
13800
13848
  }
13801
13849
  value = this.allowObjectBinding ? this.getDataByValue(value) : value;
13850
+ if (this.enableVirtualization) {
13851
+ if (isNullOrUndefined(this.selectedListData)) {
13852
+ this.selectedListData = [(this.getDataByValue(value))];
13853
+ }
13854
+ else {
13855
+ if (Array.isArray(this.selectedListData)) {
13856
+ this.selectedListData.push((this.getDataByValue(value)));
13857
+ }
13858
+ else {
13859
+ this.selectedListData = [this.selectedListData, (this.getDataByValue(value))];
13860
+ }
13861
+ }
13862
+ }
13802
13863
  if ((this.enableVirtualization && value) || !this.enableVirtualization) {
13803
13864
  this.updateListSelectEventCallback(value, element, eve);
13804
13865
  }
@@ -13988,7 +14049,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13988
14049
  this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
13989
14050
  this.virtualItemCount = this.itemCount;
13990
14051
  if (this.mode !== 'CheckBox') {
13991
- this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length : this.totalItemCount;
14052
+ this.totalItemsCount();
13992
14053
  }
13993
14054
  if (!this.list.querySelector('.e-virtual-ddl')) {
13994
14055
  var virualElement = this.createElement('div', {
@@ -14081,6 +14142,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14081
14142
  }
14082
14143
  this.isPreventScrollAction = true;
14083
14144
  this.setScrollPosition();
14145
+ if (!this.list.classList.contains(dropDownBaseClasses.noData) && this.getItems()[1] && this.getItems()[1].offsetHeight !== 0) {
14146
+ this.listItemHeight = this.getItems()[1].offsetHeight;
14147
+ if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
14148
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14149
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
14150
+ }
14151
+ }
14084
14152
  if (this.allowFiltering) {
14085
14153
  this.notify('inputFocus', {
14086
14154
  module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'focus'
@@ -14186,13 +14254,17 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14186
14254
  sentinelInfo: {},
14187
14255
  offsets: {},
14188
14256
  startIndex: 0,
14189
- endIndex: 0,
14257
+ endIndex: this.itemCount,
14190
14258
  };
14191
14259
  this.previousStartIndex = 0;
14192
14260
  this.previousEndIndex = 0;
14193
14261
  if (this.dataSource instanceof DataManager) {
14194
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14195
- this.totalItemCount = this.dataCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
14262
+ if (this.remoteDataCount >= 0) {
14263
+ this.totalItemCount = this.dataCount = this.remoteDataCount;
14264
+ }
14265
+ else {
14266
+ this.resetList(this.dataSource);
14267
+ }
14196
14268
  }
14197
14269
  else {
14198
14270
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -14334,7 +14406,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14334
14406
  EventHandler.add(formElement, 'reset', this.resetValueHandler, this);
14335
14407
  }
14336
14408
  EventHandler.add(this.componentWrapper, 'mouseout', this.mouseOut, this);
14337
- EventHandler.add(this.overAllClear, 'mouseup', this.clearAll, this);
14409
+ EventHandler.add(this.overAllClear, 'mousedown', this.clearAll, this);
14338
14410
  EventHandler.add(this.inputElement, 'paste', this.pasteHandler, this);
14339
14411
  }
14340
14412
  onInput(e) {
@@ -14376,9 +14448,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14376
14448
  if (this.allowCustomValue) {
14377
14449
  this.isRemoteSelection = true;
14378
14450
  }
14379
- if (!this.backCommand) {
14380
- this.checkAndResetCache();
14381
- }
14451
+ this.checkAndResetCache();
14382
14452
  const eventArgs = {
14383
14453
  preventDefaultAction: false,
14384
14454
  text: this.targetElement(),
@@ -14407,12 +14477,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14407
14477
  let query = new Query();
14408
14478
  query = this.allowFiltering && (text !== '') ? query.where(this.fields.text, 'startswith', text, this.ignoreCase, this.ignoreAccent) : query;
14409
14479
  if (this.enableVirtualization) {
14410
- if (this.dataSource instanceof DataManager) {
14411
- this.dataUpdater(this.virtualGroupDataSource, query, this.fields);
14412
- }
14413
- else {
14414
- this.dataUpdater(this.dataSource, query, this.fields);
14415
- }
14480
+ this.dataUpdater(this.dataSource, query, this.fields);
14416
14481
  }
14417
14482
  else {
14418
14483
  this.dataUpdater(this.mainData, query, this.fields);
@@ -14640,7 +14705,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14640
14705
  this.unwireListEvents();
14641
14706
  this.wireListEvents();
14642
14707
  }
14643
- initialValueUpdate(listItems) {
14708
+ initialValueUpdate(listItems, isInitialVirtualData) {
14644
14709
  if (this.list) {
14645
14710
  let text;
14646
14711
  let element;
@@ -14660,11 +14725,24 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14660
14725
  for (let i = 0; i < listItems.length; i++) {
14661
14726
  if (getValue((this.fields.value ? this.fields.value : 'value'), listItems[i]) === value) {
14662
14727
  text = getValue(this.fields.text, listItems[i]);
14728
+ if (this.enableVirtualization) {
14729
+ if (isNullOrUndefined(this.selectedListData)) {
14730
+ this.selectedListData = [listItems[i]];
14731
+ }
14732
+ else {
14733
+ if (Array.isArray(this.selectedListData)) {
14734
+ this.selectedListData.push((listItems[i]));
14735
+ }
14736
+ else {
14737
+ this.selectedListData = [this.selectedListData, (listItems[i])];
14738
+ }
14739
+ }
14740
+ }
14663
14741
  break;
14664
14742
  }
14665
14743
  }
14666
14744
  }
14667
- if (isNullOrUndefined(text) && this.allowCustomValue) {
14745
+ if ((isNullOrUndefined(text) && this.allowCustomValue) && ((!(this.dataSource instanceof DataManager)) || (this.dataSource instanceof DataManager && isInitialVirtualData))) {
14668
14746
  text = this.getTextByValue(value);
14669
14747
  isCustomData = true;
14670
14748
  }
@@ -14682,13 +14760,15 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14682
14760
  this.addChip(text, value);
14683
14761
  this.addListSelection(element);
14684
14762
  }
14685
- else if (value && this.allowCustomValue) {
14763
+ else if ((!this.enableVirtualization && value && this.allowCustomValue) || ((this.enableVirtualization && value && this.allowCustomValue) && ((!(this.dataSource instanceof DataManager)) || (this.dataSource instanceof DataManager && isInitialVirtualData)))) {
14686
14764
  const indexItem = this.listData.length;
14687
14765
  const newValue = {};
14688
14766
  setValue(this.fields.text, value, newValue);
14689
14767
  setValue(this.fields.value, value, newValue);
14690
14768
  const noDataEle = this.popupWrapper.querySelector('.' + dropDownBaseClasses.noData);
14691
- this.addItem(newValue, indexItem);
14769
+ if (!this.enableVirtualization) {
14770
+ this.addItem(newValue, indexItem);
14771
+ }
14692
14772
  if (this.enableVirtualization) {
14693
14773
  if (this.virtualCustomSelectData && this.virtualCustomSelectData.length >= 0) {
14694
14774
  this.virtualCustomSelectData.push(newValue);
@@ -16020,8 +16100,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16020
16100
  totalItemsCount() {
16021
16101
  let dataSourceCount;
16022
16102
  if (this.dataSource instanceof DataManager) {
16023
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16024
- dataSourceCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
16103
+ if (this.remoteDataCount >= 0) {
16104
+ dataSourceCount = this.totalItemCount = this.dataCount = this.remoteDataCount;
16105
+ }
16106
+ else {
16107
+ this.resetList(this.dataSource);
16108
+ }
16025
16109
  }
16026
16110
  else {
16027
16111
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -16031,7 +16115,26 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16031
16115
  this.totalItemCount = dataSourceCount != 0 ? dataSourceCount : this.totalItemCount;
16032
16116
  }
16033
16117
  else {
16034
- this.totalItemCount = dataSourceCount != 0 ? dataSourceCount - this.value.length : this.totalItemCount;
16118
+ if (this.hideSelectedItem) {
16119
+ this.totalItemCount = dataSourceCount != 0 && this.value ? dataSourceCount - this.value.length : this.totalItemCount;
16120
+ if (this.allowCustomValue && this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
16121
+ for (let i = 0; i < this.virtualCustomSelectData.length; i++) {
16122
+ for (let j = 0; j < this.value.length; j++) {
16123
+ const value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[j]) : this.value[j];
16124
+ const customValue = getValue((this.fields.value) ? this.fields.value : '', this.virtualCustomSelectData[i]);
16125
+ if (value === customValue) {
16126
+ this.totalItemCount += 1;
16127
+ }
16128
+ }
16129
+ }
16130
+ }
16131
+ }
16132
+ else {
16133
+ this.totalItemCount = dataSourceCount != 0 ? dataSourceCount : this.totalItemCount;
16134
+ if (this.allowCustomValue && this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
16135
+ this.totalItemCount += this.virtualCustomSelectData.length;
16136
+ }
16137
+ }
16035
16138
  }
16036
16139
  }
16037
16140
  presentItemValue(ulElement) {
@@ -16069,7 +16172,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16069
16172
  valuecheck = this.presentItemValue(this.ulElement);
16070
16173
  }
16071
16174
  if (prop == 'value' && valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
16072
- && this.listData != null) {
16175
+ && this.listData != null && !this.enableVirtualization) {
16073
16176
  this.mainData = null;
16074
16177
  this.setDynValue = true;
16075
16178
  this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
@@ -16088,7 +16191,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16088
16191
  const list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
16089
16192
  this.onActionComplete(list, this.mainData);
16090
16193
  }
16091
- this.initialValueUpdate();
16194
+ if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
16195
+ this.initialValueUpdate();
16196
+ }
16092
16197
  if (this.mode !== 'Box' && !this.inputFocus) {
16093
16198
  this.updateDelimView();
16094
16199
  }
@@ -16140,6 +16245,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16140
16245
  }
16141
16246
  this.beforePopupOpen = false;
16142
16247
  this.overAllWrapper.classList.remove(iconAnimation);
16248
+ const typedValue = this.mode == 'CheckBox' ? this.targetElement() : null;
16143
16249
  this.popupObj.hide(new Animation(eventArgs.animation));
16144
16250
  attributes(this.inputElement, { 'aria-expanded': 'false' });
16145
16251
  this.inputElement.removeAttribute('aria-owns');
@@ -16153,22 +16259,27 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16153
16259
  if (this.mode === 'CheckBox' && this.showSelectAll) {
16154
16260
  EventHandler.remove(this.popupObj.element, 'click', this.clickHandler);
16155
16261
  }
16156
- if (this.enableVirtualization && this.mode === 'CheckBox' && this.enableSelectionOrder) {
16262
+ if (this.enableVirtualization && this.mode === 'CheckBox' && this.value && this.value.length > 0 && this.enableSelectionOrder) {
16157
16263
  this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
16158
16264
  this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.viewPortInfo.startIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
16265
+ this.virtualListInfo = this.viewPortInfo;
16159
16266
  this.previousStartIndex = 0;
16160
16267
  this.previousEndIndex = 0;
16161
16268
  }
16162
16269
  let dataSourceCount;
16163
16270
  if (this.dataSource instanceof DataManager) {
16164
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16165
- dataSourceCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
16271
+ if (this.remoteDataCount >= 0) {
16272
+ this.totalItemCount = this.dataCount = this.remoteDataCount;
16273
+ }
16274
+ else {
16275
+ this.resetList(this.dataSource);
16276
+ }
16166
16277
  }
16167
16278
  else {
16168
16279
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16169
16280
  dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
16170
16281
  }
16171
- if (this.enableVirtualization && (this.allowFiltering || this.allowCustomValue) && this.value != null && this.targetElement() && this.totalItemCount !== dataSourceCount) {
16282
+ if (this.enableVirtualization && (this.allowFiltering || this.allowCustomValue) && (this.targetElement() || typedValue) && this.totalItemCount !== dataSourceCount) {
16172
16283
  this.updateInitialData();
16173
16284
  this.checkAndResetCache();
16174
16285
  }
@@ -16499,8 +16610,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16499
16610
  if (this.dataSource instanceof DataManager) {
16500
16611
  this.dataSource.executeQuery(new Query().where(predicate))
16501
16612
  .then((e) => {
16502
- if (e.result.result.length > 0) {
16503
- listItems = e.result.result;
16613
+ if (e.result.length > 0) {
16614
+ listItems = e.result;
16615
+ this.initStatus = false;
16616
+ this.initialValueUpdate(listItems, true);
16617
+ this.initialUpdate();
16618
+ this.initStatus = true;
16504
16619
  }
16505
16620
  });
16506
16621
  }
@@ -16515,7 +16630,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16515
16630
  else {
16516
16631
  this.setInitialValue = () => {
16517
16632
  this.initStatus = false;
16518
- this.initialValueUpdate(listItems);
16633
+ if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
16634
+ this.initialValueUpdate(listItems);
16635
+ }
16519
16636
  this.initialUpdate();
16520
16637
  this.setInitialValue = null;
16521
16638
  this.initStatus = true;
@@ -17849,12 +17966,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
17849
17966
  else {
17850
17967
  scrollParent = wrapper;
17851
17968
  }
17852
- boundRect = scrollParent.getBoundingClientRect();
17853
- if ((boundRect.y + scrollParent.offsetHeight) - (event.clientY + scrollMoved) < 1) {
17854
- this.timer = window.setInterval(() => { this.setScrollDown(scrollParent, scrollHeight, true); }, 70);
17855
- }
17856
- else if ((event.clientY - scrollMoved) - boundRect.y < 1) {
17857
- this.timer = window.setInterval(() => { this.setScrollDown(scrollParent, scrollHeight, false); }, 70);
17969
+ if (scrollParent) {
17970
+ boundRect = scrollParent.getBoundingClientRect();
17971
+ if ((boundRect.y + scrollParent.offsetHeight) - (event.clientY + scrollMoved) < 1) {
17972
+ this.timer = window.setInterval(() => { this.setScrollDown(scrollParent, scrollHeight, true); }, 70);
17973
+ }
17974
+ else if ((event.clientY - scrollMoved) - boundRect.y < 1) {
17975
+ this.timer = window.setInterval(() => { this.setScrollDown(scrollParent, scrollHeight, false); }, 70);
17976
+ }
17858
17977
  }
17859
17978
  }
17860
17979
  if (args.target === null) {
@@ -18272,6 +18391,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18272
18391
  if (this.listData.length === 0) {
18273
18392
  this.l10nUpdate();
18274
18393
  }
18394
+ if (this.listData.length !== this.sortedData.length) {
18395
+ this.sortedData = this.listData;
18396
+ }
18275
18397
  this.value = [];
18276
18398
  this.updateToolBarState();
18277
18399
  }
@@ -18980,6 +19102,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18980
19102
  const jsonData = [].slice.call(tListBox.jsonData);
18981
19103
  const isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
18982
19104
  fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
19105
+ const tempLiColl = [];
19106
+ const tempData = [];
19107
+ let flistboxarray = [];
18983
19108
  this.removeSelected(fListBox, fListBox.getSelectedItems());
18984
19109
  const tempItems = [].slice.call(fListBox.listData);
18985
19110
  const localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
@@ -18993,29 +19118,40 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18993
19118
  tListBox.ulElement.removeChild(noRecElem);
18994
19119
  }
18995
19120
  }
18996
- if (isRefresh) {
18997
- const noRecElem = fListBox.ulElement.childNodes[0];
18998
- if (noRecElem) {
18999
- fListBox.ulElement.removeChild(noRecElem);
19121
+ if (fListBox.listData.length > 0) {
19122
+ // eslint-disable-next-line prefer-spread
19123
+ flistboxarray = Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number);
19124
+ }
19125
+ for (let i = 0; i < fListBox.ulElement.childElementCount; i++) {
19126
+ if (fListBox.ulElement.childNodes[i].classList.contains('e-disabled')) {
19127
+ flistboxarray = flistboxarray.filter(function (item) { return item !== i; });
19128
+ tempLiColl.push(fListBox.ulElement.childNodes[i]);
19129
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19130
+ tempData.push(fListBox.listData[i]);
19000
19131
  }
19001
19132
  }
19002
- moveTo(fListBox.ulElement, tListBox.ulElement,
19003
- // eslint-disable-next-line prefer-spread
19004
- Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number), index);
19133
+ moveTo(fListBox.ulElement, tListBox.ulElement, flistboxarray, index);
19005
19134
  this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
19006
19135
  if (isKey) {
19007
19136
  this.list.focus();
19008
19137
  }
19009
19138
  index = (index) ? index : listData.length;
19010
- for (let i = 0; i < fListBox.listData.length; i++) {
19011
- listData.splice(index + i, 0, fListBox.listData[i]);
19139
+ for (let i = 0; i < flistboxarray.length; i++) {
19140
+ listData.splice(index + i, 0, fListBox.listData[flistboxarray[i]]);
19012
19141
  }
19013
- for (let i = 0; i < fListBox.jsonData.length; i++) {
19014
- jsonData.splice(index + i, 0, fListBox.jsonData[i]);
19142
+ for (let i = 0; i < flistboxarray.length; i++) {
19143
+ jsonData.splice(index + i, 0, fListBox.jsonData[flistboxarray[i]]);
19144
+ }
19145
+ let fliCollections = [];
19146
+ if (tempLiColl.length > 0) {
19147
+ fListBox.liCollections = tempLiColl;
19148
+ fliCollections = [].slice.call(fListBox.liCollections);
19149
+ }
19150
+ else {
19151
+ fliCollections = [].slice.call(fListBox.liCollections);
19152
+ fListBox.liCollections = [];
19015
19153
  }
19016
- const fliCollections = [].slice.call(fListBox.liCollections);
19017
19154
  const tliCollections = [].slice.call(tListBox.liCollections);
19018
- fListBox.liCollections = [];
19019
19155
  if (index) {
19020
19156
  const toColl = tliCollections.splice(0, index);
19021
19157
  tListBox.liCollections = toColl.concat(fliCollections).concat(tliCollections);
@@ -19024,6 +19160,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
19024
19160
  tListBox.liCollections = tliCollections.concat(fliCollections);
19025
19161
  }
19026
19162
  fListBox.value = [];
19163
+ listData = listData.filter((data) => (data !== undefined));
19027
19164
  listData = listData
19028
19165
  .filter((data) => data.isHeader !== true);
19029
19166
  const sortedData = listData.filter(function (val) {
@@ -19035,7 +19172,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
19035
19172
  }
19036
19173
  tListBox.listData = listData;
19037
19174
  if (fListBox.listData.length === fListBox.jsonData.length) {
19038
- fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
19175
+ fListBox.listData = fListBox.sortedData = fListBox.jsonData = tempData;
19039
19176
  }
19040
19177
  else if (fListBox.allowFiltering) {
19041
19178
  for (let i = 0; i < fListBox.listData.length; i++) {
@@ -19056,6 +19193,11 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
19056
19193
  tListBox.sortedData = listData;
19057
19194
  }
19058
19195
  fListBox.updateSelectedOptions();
19196
+ if (tempLiColl.length > 0) {
19197
+ const wrap = this.list.parentElement.getElementsByClassName('e-listbox-tool')[0];
19198
+ const btn = wrap.querySelector('[data-value="' + this.toolbarAction + '"]');
19199
+ btn.disabled = true;
19200
+ }
19059
19201
  if (fListBox.listData.length === 0) {
19060
19202
  fListBox.l10nUpdate();
19061
19203
  }
@@ -19274,6 +19416,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
19274
19416
  if (!args.cancel && !this.isCustomFiltering && !args.preventDefaultAction) {
19275
19417
  this.inputString = this.filterInput.value;
19276
19418
  this.filteringAction(this.jsonData, new Query(), this.fields);
19419
+ if (this.toolbarSettings.items.length > 0) {
19420
+ this.updateToolBarState();
19421
+ }
19277
19422
  }
19278
19423
  if (!this.isFiltered && !this.isCustomFiltering && !args.preventDefaultAction) {
19279
19424
  this.dataUpdater(this.jsonData, new Query(), this.fields);