@syncfusion/ej2-dropdowns 23.2.7 → 24.1.43

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +26 -118
  2. package/dist/ej2-dropdowns.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-dropdowns.es2015.js +690 -117
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +694 -120
  8. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  9. package/dist/global/ej2-dropdowns.min.js +2 -2
  10. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/auto-complete/auto-complete.js +10 -5
  14. package/src/combo-box/combo-box.js +74 -2
  15. package/src/common/incremental-search.d.ts +1 -1
  16. package/src/common/incremental-search.js +50 -7
  17. package/src/common/interface.d.ts +2 -0
  18. package/src/common/virtual-scroll.js +22 -1
  19. package/src/drop-down-base/drop-down-base.d.ts +23 -3
  20. package/src/drop-down-base/drop-down-base.js +153 -40
  21. package/src/drop-down-list/drop-down-list.d.ts +10 -3
  22. package/src/drop-down-list/drop-down-list.js +332 -41
  23. package/src/drop-down-tree/drop-down-tree.js +24 -20
  24. package/src/list-box/list-box.d.ts +1 -0
  25. package/src/list-box/list-box.js +12 -1
  26. package/src/mention/mention.js +10 -1
  27. package/src/multi-select/checkbox-selection.js +4 -1
  28. package/src/multi-select/multi-select.js +4 -2
  29. package/styles/bootstrap-dark.css +0 -3
  30. package/styles/bootstrap.css +0 -3
  31. package/styles/bootstrap4.css +0 -3
  32. package/styles/bootstrap5-dark.css +0 -3
  33. package/styles/bootstrap5.css +0 -3
  34. package/styles/drop-down-base/_layout.scss +0 -3
  35. package/styles/drop-down-base/bootstrap-dark.css +0 -3
  36. package/styles/drop-down-base/bootstrap.css +0 -3
  37. package/styles/drop-down-base/bootstrap4.css +0 -3
  38. package/styles/drop-down-base/bootstrap5-dark.css +0 -3
  39. package/styles/drop-down-base/bootstrap5.css +0 -3
  40. package/styles/drop-down-base/fabric-dark.css +0 -3
  41. package/styles/drop-down-base/fabric.css +0 -3
  42. package/styles/drop-down-base/fluent-dark.css +0 -3
  43. package/styles/drop-down-base/fluent.css +0 -3
  44. package/styles/drop-down-base/highcontrast-light.css +0 -3
  45. package/styles/drop-down-base/highcontrast.css +0 -3
  46. package/styles/drop-down-base/material-dark.css +0 -3
  47. package/styles/drop-down-base/material.css +0 -3
  48. package/styles/drop-down-base/material3-dark.css +0 -3
  49. package/styles/drop-down-base/material3.css +0 -3
  50. package/styles/drop-down-base/tailwind-dark.css +0 -3
  51. package/styles/drop-down-base/tailwind.css +0 -3
  52. package/styles/drop-down-tree/_layout.scss +6 -0
  53. package/styles/drop-down-tree/fluent-dark.css +2 -0
  54. package/styles/drop-down-tree/fluent.css +2 -0
  55. package/styles/fabric-dark.css +0 -3
  56. package/styles/fabric.css +0 -3
  57. package/styles/fluent-dark.css +2 -3
  58. package/styles/fluent.css +2 -3
  59. package/styles/highcontrast-light.css +0 -3
  60. package/styles/highcontrast.css +0 -3
  61. package/styles/material-dark.css +0 -3
  62. package/styles/material.css +0 -3
  63. package/styles/material3-dark.css +0 -3
  64. package/styles/material3.css +0 -3
  65. package/styles/tailwind-dark.css +0 -3
  66. package/styles/tailwind.css +0 -3
@@ -12,6 +12,7 @@ import { TreeView } from '@syncfusion/ej2-navigations';
12
12
  */
13
13
  let queryString = '';
14
14
  let prevString = '';
15
+ let tempQueryString = '';
15
16
  let matches$1 = [];
16
17
  const activeClass = 'e-active';
17
18
  let prevElementId = '';
@@ -26,21 +27,49 @@ let prevElementId = '';
26
27
  * @param {string} elementId - Specifies the list element ID.
27
28
  * @returns {Element} Returns list item based on key code matches with list text content.
28
29
  */
29
- function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId) {
30
- queryString += String.fromCharCode(keyCode);
31
- setTimeout(() => {
32
- queryString = '';
33
- }, 1000);
30
+ function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId, queryStringUpdated, currentValue, isVirtual, refresh) {
31
+ if (!queryStringUpdated || queryString === '') {
32
+ if (tempQueryString != '') {
33
+ queryString = tempQueryString + String.fromCharCode(keyCode);
34
+ tempQueryString = '';
35
+ }
36
+ else {
37
+ queryString += String.fromCharCode(keyCode);
38
+ }
39
+ }
40
+ else if (queryString == prevString) {
41
+ tempQueryString = String.fromCharCode(keyCode);
42
+ }
43
+ if (isVirtual) {
44
+ setTimeout(function () {
45
+ tempQueryString = '';
46
+ }, 700);
47
+ setTimeout(function () {
48
+ queryString = '';
49
+ }, 3000);
50
+ }
51
+ else {
52
+ setTimeout(function () {
53
+ queryString = '';
54
+ }, 1000);
55
+ }
34
56
  let index;
35
57
  queryString = ignoreCase ? queryString.toLowerCase() : queryString;
36
- if (prevElementId === elementId && prevString === queryString) {
58
+ if (prevElementId === elementId && prevString === queryString && !refresh) {
37
59
  for (let i = 0; i < matches$1.length; i++) {
38
60
  if (matches$1[i].classList.contains(activeClass)) {
39
61
  index = i;
40
62
  break;
41
63
  }
64
+ if (currentValue && matches$1[i].textContent.toLowerCase() === currentValue.toLowerCase()) {
65
+ index = i;
66
+ break;
67
+ }
42
68
  }
43
69
  index = index + 1;
70
+ if (isVirtual) {
71
+ return matches$1[index] && matches$1.length - 1 != index ? matches$1[index] : matches$1[matches$1.length];
72
+ }
44
73
  return matches$1[index] ? matches$1[index] : matches$1[0];
45
74
  }
46
75
  else {
@@ -70,6 +99,20 @@ function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId)
70
99
  } while (i !== selectedIndex);
71
100
  prevString = queryString;
72
101
  prevElementId = elementId;
102
+ if (isVirtual) {
103
+ var indexUpdated = false;
104
+ for (let i = 0; i < matches$1.length; i++) {
105
+ if (currentValue && matches$1[i].textContent.toLowerCase() === currentValue.toLowerCase()) {
106
+ index = i;
107
+ indexUpdated = true;
108
+ break;
109
+ }
110
+ }
111
+ if (currentValue && indexUpdated) {
112
+ index = index + 1;
113
+ }
114
+ return matches$1[index] ? matches$1[index] : matches$1[0];
115
+ }
73
116
  return matches$1[0];
74
117
  }
75
118
  }
@@ -106,7 +149,7 @@ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, typ
106
149
  });
107
150
  });
108
151
  }
109
- text = dataSource && filterValue ? (ignoreCase ? filterValue.toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
152
+ text = dataSource && filterValue ? (ignoreCase ? filterValue.toString().toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
110
153
  /* eslint-disable security/detect-non-literal-regexp */
111
154
  if ((searchType === 'Equal' && text === queryStr) || (searchType === 'StartsWith' && text.substr(0, strLength) === queryStr) || (searchType === 'EndsWith' && text.substr(text.length - queryStr.length) === queryStr) || (searchType === 'Contains' && new RegExp(queryStr, "g").test(text))) {
112
155
  itemData.item = item;
@@ -296,9 +339,24 @@ class VirtualScroll {
296
339
  query = this.getPageQuery(query, virtualItemStartIndex, virtualItemEndIndex);
297
340
  }
298
341
  }
342
+ const tempCustomFilter = this.parent.isCustomFilter;
343
+ if (this.component === 'combobox') {
344
+ let totalData = 0;
345
+ if (this.parent.dataSource instanceof DataManager) {
346
+ totalData = this.parent.dataSource.dataSource.json.length;
347
+ }
348
+ else if (this.parent.dataSource && this.parent.dataSource.length > 0) {
349
+ totalData = this.parent.dataSource.length;
350
+ }
351
+ if (totalData > 0) {
352
+ this.parent.isCustomFilter = (totalData == this.parent.totalItemCount && this.parent.queryString != this.parent.typedString) ? true : this.parent.isCustomFilter;
353
+ }
354
+ }
299
355
  this.parent.resetList(dataSource, this.parent.fields, query);
356
+ this.parent.isCustomFilter = tempCustomFilter;
300
357
  }
301
358
  removeSkipAndTakeEvents(query) {
359
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
302
360
  query.queries = query.queries.filter(function (event) {
303
361
  return event.fn !== 'onSkip' && event.fn !== 'onTake';
304
362
  });
@@ -327,6 +385,9 @@ class VirtualScroll {
327
385
  if (virtualContentElement) {
328
386
  (virtualContentElement).style = this.parent.getTransformValues();
329
387
  }
388
+ if (this.parent.fields.groupBy) {
389
+ this.parent.scrollStop();
390
+ }
330
391
  }
331
392
  generateQueryAndSetQueryIndexAsync(query, isPopupOpen) {
332
393
  let isStartIndexInitialised = false;
@@ -374,6 +435,9 @@ class VirtualScroll {
374
435
  }
375
436
  else {
376
437
  this.parent.getSkeletonCount(true);
438
+ if (this.component === 'combobox') {
439
+ this.parent.skeletonCount = this.parent.totalItemCount != 0 && this.parent.totalItemCount < (this.parent.itemCount * 2) ? 0 : this.parent.skeletonCount;
440
+ }
377
441
  }
378
442
  }
379
443
  yield this.dataProcessAsync();
@@ -599,6 +663,9 @@ let DropDownBase = class DropDownBase extends Component {
599
663
  this.virtualizedItemsCount = 0;
600
664
  this.totalItemCount = 0;
601
665
  this.dataCount = 0;
666
+ this.isRemoteDataUpdated = false;
667
+ this.isIncrementalRequest = false;
668
+ this.itemCount = 10;
602
669
  }
603
670
  getPropObject(prop, newProp, oldProp) {
604
671
  const newProperty = new Object();
@@ -990,7 +1057,7 @@ let DropDownBase = class DropDownBase extends Component {
990
1057
  if (!eventArgs.cancel) {
991
1058
  this.isRequesting = true;
992
1059
  this.showSpinner();
993
- if (dataSource instanceof DataManager) {
1060
+ if (dataSource instanceof DataManager && !this.virtualGroupDataSource) {
994
1061
  this.isRequested = true;
995
1062
  if (this.isDataFetched) {
996
1063
  this.emptyDataRequest(fields);
@@ -999,8 +1066,39 @@ let DropDownBase = class DropDownBase extends Component {
999
1066
  eventArgs.data.executeQuery(this.getQuery(eventArgs.query)).then((e) => {
1000
1067
  this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
1001
1068
  this.trigger('actionComplete', e, (e) => {
1069
+ if (!this.virtualGroupDataSource && this.isVirtualizationEnabled) {
1070
+ this.isRemoteDataUpdated = true;
1071
+ if ((this.getModuleName() === 'combobox' && this.isAllowFiltering && this.isVirtualizationEnabled && e.result)) {
1072
+ e.result = e.result.result;
1073
+ }
1074
+ if (e.result.length > 0) {
1075
+ let dataSource = e.result;
1076
+ if (this.isVirtualizationEnabled && this.fields.groupBy) {
1077
+ let data = new DataManager(dataSource).executeLocal(new Query().group(this.fields.groupBy));
1078
+ this.virtualGroupDataSource = data.records;
1079
+ }
1080
+ else {
1081
+ this.virtualGroupDataSource = dataSource;
1082
+ this.hideSpinner();
1083
+ this.isRequested = false;
1084
+ this.isRequesting = false;
1085
+ this.setListData(dataSource, fields, query, event);
1086
+ return;
1087
+ }
1088
+ }
1089
+ this.hideSpinner();
1090
+ this.isRequested = false;
1091
+ this.isRequesting = false;
1092
+ this.updatePopupState();
1093
+ return;
1094
+ }
1002
1095
  if (!e.cancel) {
1096
+ this.isRequesting = false;
1003
1097
  const listItems = e.result;
1098
+ if (this.isIncrementalRequest) {
1099
+ ulElement = this.renderItems(listItems, fields);
1100
+ return;
1101
+ }
1004
1102
  if (listItems.length === 0) {
1005
1103
  this.isDataFetched = true;
1006
1104
  }
@@ -1014,7 +1112,6 @@ let DropDownBase = class DropDownBase extends Component {
1014
1112
  this.isRequested = false;
1015
1113
  this.bindChildItems(listItems, ulElement, fields, e);
1016
1114
  }
1017
- this.isRequesting = false;
1018
1115
  });
1019
1116
  }).catch((e) => {
1020
1117
  this.isRequested = false;
@@ -1025,8 +1122,25 @@ let DropDownBase = class DropDownBase extends Component {
1025
1122
  }
1026
1123
  else {
1027
1124
  this.isRequesting = false;
1028
- const dataManager = new DataManager(eventArgs.data);
1029
- let listItems = (this.getQuery(eventArgs.query)).executeLocal(dataManager);
1125
+ let listItems;
1126
+ if (this.isVirtualizationEnabled && !this.virtualGroupDataSource && this.fields.groupBy) {
1127
+ let data = new DataManager(this.dataSource).executeLocal(new Query().group(this.fields.groupBy));
1128
+ this.virtualGroupDataSource = data.records;
1129
+ }
1130
+ let dataManager = this.isVirtualizationEnabled && this.virtualGroupDataSource ? new DataManager(this.virtualGroupDataSource) : new DataManager(eventArgs.data);
1131
+ listItems = (this.getQuery(eventArgs.query)).executeLocal(dataManager);
1132
+ if (this.isVirtualizationEnabled && this.getModuleName() === 'autocomplete' && (listItems.count != 0 && listItems.count < (this.itemCount * 2))) {
1133
+ let newQuery = this.getQuery(eventArgs.query);
1134
+ if (newQuery) {
1135
+ for (let queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
1136
+ if (newQuery.queries[queryElements].fn === 'onTake') {
1137
+ newQuery.queries[queryElements].e.nos = listItems.count;
1138
+ listItems = (newQuery).executeLocal(dataManager);
1139
+ break;
1140
+ }
1141
+ }
1142
+ }
1143
+ }
1030
1144
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1031
1145
  this.dataCount = listItems.count;
1032
1146
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1036,6 +1150,10 @@ let DropDownBase = class DropDownBase extends Component {
1036
1150
  const localDataArgs = { cancel: false, result: listItems };
1037
1151
  this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
1038
1152
  this.trigger('actionComplete', localDataArgs, (localDataArgs) => {
1153
+ if (this.isIncrementalRequest) {
1154
+ ulElement = this.renderItems(localDataArgs.result, fields);
1155
+ return;
1156
+ }
1039
1157
  if (!localDataArgs.cancel) {
1040
1158
  ulElement = this.renderItems(localDataArgs.result, fields);
1041
1159
  this.onActionComplete(ulElement, localDataArgs.result, event);
@@ -1055,6 +1173,12 @@ let DropDownBase = class DropDownBase extends Component {
1055
1173
  });
1056
1174
  }
1057
1175
  }
1176
+ updatePopupState() {
1177
+ // Used this method in component side.
1178
+ }
1179
+ updateRemoteData() {
1180
+ this.setListData(this.dataSource, this.fields, this.query);
1181
+ }
1058
1182
  bindChildItems(listItems, ulElement, fields, e) {
1059
1183
  if (listItems.length >= 100 && this.getModuleName() === 'autocomplete') {
1060
1184
  setTimeout(() => {
@@ -1141,7 +1265,9 @@ let DropDownBase = class DropDownBase extends Component {
1141
1265
  if (this.isReact) {
1142
1266
  this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);
1143
1267
  }
1144
- this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
1268
+ if (!this.isVirtualizationEnabled) {
1269
+ this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
1270
+ }
1145
1271
  if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
1146
1272
  for (let i = 0; i < ulElement.childElementCount; i++) {
1147
1273
  if (ulElement.children[i].classList.contains('e-list-group-item')) {
@@ -1282,25 +1408,67 @@ let DropDownBase = class DropDownBase extends Component {
1282
1408
  this.scrollStop(e);
1283
1409
  }
1284
1410
  }
1285
- scrollStop(e) {
1411
+ scrollStop(e, isDownkey) {
1286
1412
  const target = !isNullOrUndefined(e) ? e.target : this.list;
1287
1413
  const liHeight = parseInt(getComputedStyle(this.getValidLi(), null).getPropertyValue('height'), 10);
1288
1414
  const topIndex = Math.round(target.scrollTop / liHeight);
1289
1415
  const liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
1416
+ let virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
1417
+ let count = 0;
1418
+ let isCount = false;
1290
1419
  for (let i = topIndex; i > -1; i--) {
1291
- if (!isNullOrUndefined(liCollections[i]) && liCollections[i].classList.contains(dropDownBaseClasses.group)) {
1292
- const currentLi = liCollections[i];
1293
- this.fixedHeaderElement.innerHTML = currentLi.innerHTML;
1294
- this.fixedHeaderElement.style.top = target.scrollTop + 'px';
1295
- this.fixedHeaderElement.style.display = 'block';
1296
- break;
1420
+ const index = this.isVirtualizationEnabled ? i + virtualListCount : i;
1421
+ if (this.isVirtualizationEnabled) {
1422
+ const groupListLength = this.list.querySelectorAll('.e-list-group-item').length;
1423
+ let loadedGroupList = 0;
1424
+ if (isCount) {
1425
+ count++;
1426
+ }
1427
+ if (this.updateGroupHeader(index, liCollections, target)) {
1428
+ loadedGroupList++;
1429
+ if (count >= this.getPageCount()) {
1430
+ break;
1431
+ }
1432
+ if (groupListLength <= loadedGroupList) {
1433
+ break;
1434
+ }
1435
+ }
1436
+ if (isDownkey) {
1437
+ 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')) {
1438
+ count++;
1439
+ isCount = true;
1440
+ }
1441
+ }
1297
1442
  }
1298
1443
  else {
1299
- this.fixedHeaderElement.style.display = 'none';
1300
- this.fixedHeaderElement.style.top = 'none';
1444
+ if (this.updateGroupHeader(index, liCollections, target)) {
1445
+ break;
1446
+ }
1301
1447
  }
1302
1448
  }
1303
1449
  }
1450
+ getPageCount(returnExactCount) {
1451
+ const liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
1452
+ getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
1453
+ let pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
1454
+ return returnExactCount ? pageCount : Math.round(pageCount);
1455
+ }
1456
+ updateGroupHeader(index, liCollections, target) {
1457
+ if (!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.group)) {
1458
+ this.updateGroupFixedHeader(liCollections[index], target);
1459
+ return true;
1460
+ }
1461
+ else {
1462
+ this.fixedHeaderElement.style.display = 'none';
1463
+ this.fixedHeaderElement.style.top = 'none';
1464
+ return false;
1465
+ }
1466
+ }
1467
+ updateGroupFixedHeader(element, target) {
1468
+ this.fixedHeaderElement.innerHTML = element.innerHTML;
1469
+ this.fixedHeaderElement.style.top = target.scrollTop + 'px';
1470
+ this.fixedHeaderElement.style.display = 'block';
1471
+ }
1304
1472
  getValidLi() {
1305
1473
  return this.liCollections[0];
1306
1474
  }
@@ -1334,45 +1502,54 @@ let DropDownBase = class DropDownBase extends Component {
1334
1502
  var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
1335
1503
  if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
1336
1504
  virtualUlElement.replaceChild(ulElement, oldUlElement);
1337
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1338
- this.ulElement = this.list.querySelector('ul');
1339
- this.listData = listData;
1340
- this.postRender(this.list, listData, this.bindEvent);
1505
+ this.updateListElements(listData);
1341
1506
  }
1342
1507
  else if ((!virtualUlElement)) {
1343
1508
  this.list.innerHTML = '';
1344
- this.list.appendChild(ulElement);
1345
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1346
- this.ulElement = this.list.querySelector('ul');
1347
- this.listData = listData;
1348
- this.postRender(this.list, listData, this.bindEvent);
1509
+ this.createVirtualContent();
1510
+ this.list.querySelector('.e-virtual-ddl-content').appendChild(ulElement);
1511
+ this.updateListElements(listData);
1349
1512
  }
1350
1513
  }
1351
1514
  }
1352
1515
  else {
1353
1516
  ulElement = this.createListItems(listData, fields);
1517
+ if (this.isIncrementalRequest) {
1518
+ this.incrementalLiCollections = ulElement.querySelectorAll('.' + dropDownBaseClasses.li);
1519
+ this.incrementalUlElement = ulElement;
1520
+ this.incrementalListData = listData;
1521
+ return ulElement;
1522
+ }
1354
1523
  if (this.isVirtualizationEnabled) {
1355
1524
  var oldUlElement = this.list.querySelector('.e-list-parent');
1356
1525
  var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
1357
1526
  if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
1358
1527
  virtualUlElement.replaceChild(ulElement, oldUlElement);
1359
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1360
- this.ulElement = this.list.querySelector('ul');
1361
- this.listData = listData;
1362
- this.postRender(this.list, listData, this.bindEvent);
1528
+ this.updateListElements(listData);
1363
1529
  }
1364
1530
  else if ((!virtualUlElement)) {
1365
1531
  this.list.innerHTML = '';
1366
- this.list.appendChild(ulElement);
1367
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1368
- this.ulElement = this.list.querySelector('ul');
1369
- this.listData = listData;
1370
- this.postRender(this.list, listData, this.bindEvent);
1532
+ this.createVirtualContent();
1533
+ this.list.querySelector('.e-virtual-ddl-content').appendChild(ulElement);
1534
+ this.updateListElements(listData);
1371
1535
  }
1372
1536
  }
1373
1537
  }
1374
1538
  return ulElement;
1375
1539
  }
1540
+ createVirtualContent() {
1541
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
1542
+ this.list.appendChild(this.createElement('div', {
1543
+ className: 'e-virtual-ddl-content',
1544
+ }));
1545
+ }
1546
+ }
1547
+ updateListElements(listData) {
1548
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1549
+ this.ulElement = this.list.querySelector('ul');
1550
+ this.listData = listData;
1551
+ this.postRender(this.list, listData, this.bindEvent);
1552
+ }
1376
1553
  templateListItem(dataSource, fields) {
1377
1554
  const option = this.listOption(dataSource, fields);
1378
1555
  option.templateID = this.itemTemplateId;
@@ -1444,11 +1621,11 @@ let DropDownBase = class DropDownBase extends Component {
1444
1621
  * @param {string | number | boolean} value - Specifies given value.
1445
1622
  * @returns {number} Returns the index of the item.
1446
1623
  */
1447
- getIndexByValueFilter(value) {
1624
+ getIndexByValue(value) {
1448
1625
  let index;
1449
- const listItems = this.renderItems(this.selectData, this.fields);
1450
- for (let i = 0; i < listItems.children.length; i++) {
1451
- if (!isNullOrUndefined(value) && listItems.children[i].getAttribute('data-value') === value.toString()) {
1626
+ const listItems = this.getItems();
1627
+ for (let i = 0; i < listItems.length; i++) {
1628
+ if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
1452
1629
  index = i;
1453
1630
  break;
1454
1631
  }
@@ -1461,11 +1638,11 @@ let DropDownBase = class DropDownBase extends Component {
1461
1638
  * @param {string | number | boolean} value - Specifies given value.
1462
1639
  * @returns {number} Returns the index of the item.
1463
1640
  */
1464
- getIndexByValue(value) {
1641
+ getIndexByValueFilter(value) {
1465
1642
  let index;
1466
- const listItems = this.getItems();
1467
- for (let i = 0; i < listItems.length; i++) {
1468
- if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
1643
+ const listItems = this.renderItems(this.selectData, this.fields);
1644
+ for (let i = 0; i < listItems.children.length; i++) {
1645
+ if (!isNullOrUndefined(value) && listItems.children[i].getAttribute('data-value') === value.toString()) {
1469
1646
  index = i;
1470
1647
  break;
1471
1648
  }
@@ -2012,7 +2189,6 @@ let DropDownList = class DropDownList extends DropDownBase {
2012
2189
  this.isListSearched = false;
2013
2190
  this.preventChange = false;
2014
2191
  this.isAngular = false;
2015
- this.itemCount = 10;
2016
2192
  this.virtualListHeight = 0;
2017
2193
  this.isVirtualScrolling = false;
2018
2194
  this.isPreventScrollAction = false;
@@ -2027,6 +2203,10 @@ let DropDownList = class DropDownList extends DropDownBase {
2027
2203
  this.pageCount = 0;
2028
2204
  this.isPreventKeyAction = false;
2029
2205
  this.generatedDataObject = {};
2206
+ this.incrementalQueryString = '';
2207
+ this.incrementalEndIndex = 0;
2208
+ this.incrementalStartIndex = 0;
2209
+ this.incrementalPreQueryString = '';
2030
2210
  this.isTouched = false;
2031
2211
  this.virtualListInfo = {
2032
2212
  currentPageNumber: null,
@@ -2135,8 +2315,10 @@ let DropDownList = class DropDownList extends DropDownBase {
2135
2315
  }
2136
2316
  renderList(e, isEmptyData) {
2137
2317
  super.render(e, isEmptyData);
2138
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2139
- this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2318
+ if (!(this.dataSource instanceof DataManager)) {
2319
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2320
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2321
+ }
2140
2322
  this.unWireListEvents();
2141
2323
  this.wireListEvents();
2142
2324
  }
@@ -2598,12 +2780,136 @@ let DropDownList = class DropDownList extends DropDownBase {
2598
2780
  isValidLI(li) {
2599
2781
  return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
2600
2782
  }
2783
+ updateIncrementalInfo(startIndex, endIndex) {
2784
+ this.viewPortInfo.startIndex = startIndex;
2785
+ this.viewPortInfo.endIndex = endIndex;
2786
+ this.updateVirtualItemIndex();
2787
+ this.isIncrementalRequest = true;
2788
+ this.resetList(this.dataSource, this.fields, this.query);
2789
+ this.isIncrementalRequest = false;
2790
+ }
2791
+ updateIncrementalView(startIndex, endIndex) {
2792
+ this.viewPortInfo.startIndex = startIndex;
2793
+ this.viewPortInfo.endIndex = endIndex;
2794
+ this.updateVirtualItemIndex();
2795
+ this.resetList(this.dataSource, this.fields, this.query);
2796
+ this.UpdateSkeleton();
2797
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
2798
+ this.ulElement = this.list.querySelector('ul');
2799
+ }
2800
+ updateIncrementalItemIndex(startIndex, endIndex) {
2801
+ this.incrementalStartIndex = startIndex;
2802
+ this.incrementalEndIndex = endIndex;
2803
+ }
2601
2804
  incrementalSearch(e) {
2602
2805
  if (this.liCollections.length > 0) {
2603
- const li = incrementalSearch(e.charCode, this.liCollections, this.activeIndex, true, this.element.id);
2604
- if (!isNullOrUndefined(li)) {
2605
- this.setSelection(li, e);
2606
- this.setScrollPosition();
2806
+ if (this.enableVirtualization) {
2807
+ var updatingincrementalindex = false;
2808
+ var queryStringUpdated = false;
2809
+ var activeElement = this.ulElement.getElementsByClassName('e-active')[0];
2810
+ var currentValue = activeElement ? activeElement.textContent : null;
2811
+ if (this.incrementalQueryString == '') {
2812
+ this.incrementalQueryString = String.fromCharCode(e.charCode);
2813
+ this.incrementalPreQueryString = this.incrementalQueryString;
2814
+ }
2815
+ else if (String.fromCharCode(e.charCode).toLocaleLowerCase() == this.incrementalPreQueryString.toLocaleLowerCase()) {
2816
+ queryStringUpdated = true;
2817
+ }
2818
+ else {
2819
+ this.incrementalQueryString = String.fromCharCode(e.charCode);
2820
+ }
2821
+ if ((this.viewPortInfo.endIndex >= this.incrementalEndIndex && this.incrementalEndIndex <= this.totalItemCount) || this.incrementalEndIndex == 0) {
2822
+ updatingincrementalindex = true;
2823
+ this.incrementalStartIndex = this.incrementalEndIndex;
2824
+ if (this.incrementalEndIndex == 0) {
2825
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
2826
+ }
2827
+ else {
2828
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
2829
+ }
2830
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
2831
+ updatingincrementalindex = true;
2832
+ }
2833
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
2834
+ this.updateIncrementalView(0, this.itemCount);
2835
+ }
2836
+ let li = incrementalSearch(e.charCode, this.incrementalLiCollections, this.activeIndex, true, this.element.id, queryStringUpdated, currentValue, true);
2837
+ while (isNullOrUndefined(li) && this.incrementalEndIndex < this.totalItemCount) {
2838
+ this.updateIncrementalItemIndex(this.incrementalEndIndex, this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100);
2839
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
2840
+ updatingincrementalindex = true;
2841
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
2842
+ this.updateIncrementalView(0, this.itemCount);
2843
+ }
2844
+ li = incrementalSearch(e.charCode, this.incrementalLiCollections, 0, true, this.element.id, queryStringUpdated, currentValue, true, true);
2845
+ if (!isNullOrUndefined(li)) {
2846
+ break;
2847
+ }
2848
+ if (isNullOrUndefined(li) && this.incrementalEndIndex >= this.totalItemCount) {
2849
+ this.updateIncrementalItemIndex(0, 100 > this.totalItemCount ? this.totalItemCount : 100);
2850
+ break;
2851
+ }
2852
+ }
2853
+ if (isNullOrUndefined(li) && this.incrementalEndIndex >= this.totalItemCount) {
2854
+ this.updateIncrementalItemIndex(0, 100 > this.totalItemCount ? this.totalItemCount : 100);
2855
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
2856
+ updatingincrementalindex = true;
2857
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
2858
+ this.updateIncrementalView(0, this.itemCount);
2859
+ }
2860
+ li = incrementalSearch(e.charCode, this.incrementalLiCollections, 0, true, this.element.id, queryStringUpdated, currentValue, true, true);
2861
+ }
2862
+ var index = li && this.getIndexByValue(li.getAttribute('data-value'));
2863
+ if (!index) {
2864
+ for (var i = 0; i < this.incrementalLiCollections.length; i++) {
2865
+ if (!isNullOrUndefined(li) && !isNullOrUndefined(li.getAttribute('data-value')) && this.incrementalLiCollections[i].getAttribute('data-value') === li.getAttribute('data-value').toString()) {
2866
+ index = i;
2867
+ index = this.incrementalStartIndex + index;
2868
+ break;
2869
+ }
2870
+ }
2871
+ }
2872
+ else {
2873
+ index = index - this.skeletonCount;
2874
+ }
2875
+ if (index) {
2876
+ if ((!(this.viewPortInfo.startIndex >= index)) || (!(index >= this.viewPortInfo.endIndex))) {
2877
+ let startIndex = index - ((this.itemCount / 2) - 2) > 0 ? index - ((this.itemCount / 2) - 2) : 0;
2878
+ let endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
2879
+ this.updateIncrementalView(startIndex, endIndex);
2880
+ }
2881
+ }
2882
+ if (!isNullOrUndefined(li)) {
2883
+ let index = this.getIndexByValue(li.getAttribute('data-value')) - this.skeletonCount;
2884
+ if (index > this.itemCount / 2) {
2885
+ let startIndex = this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) < this.totalItemCount ? this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) : this.totalItemCount;
2886
+ let endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
2887
+ this.updateIncrementalView(startIndex, endIndex);
2888
+ }
2889
+ li = this.getElementByValue(li.getAttribute('data-value'));
2890
+ this.setSelection(li, e);
2891
+ this.setScrollPosition();
2892
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2893
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
2894
+ if (this.enableVirtualization && !this.fields.groupBy) {
2895
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
2896
+ this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
2897
+ }
2898
+ this.incrementalPreQueryString = this.incrementalQueryString;
2899
+ }
2900
+ else {
2901
+ this.updateIncrementalView(0, this.itemCount);
2902
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2903
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
2904
+ this.list.scrollTop = 0;
2905
+ }
2906
+ }
2907
+ else {
2908
+ const li = incrementalSearch(e.charCode, this.liCollections, this.activeIndex, true, this.element.id);
2909
+ if (!isNullOrUndefined(li)) {
2910
+ this.setSelection(li, e);
2911
+ this.setScrollPosition();
2912
+ }
2607
2913
  }
2608
2914
  }
2609
2915
  }
@@ -2659,6 +2965,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2659
2965
  if (isNullOrUndefined(this.list) && !this.isRequested && !isTabAction && e.action !== 'escape') {
2660
2966
  this.searchKeyEvent = e;
2661
2967
  this.renderList(e);
2968
+ this.UpdateSkeleton();
2969
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
2970
+ this.ulElement = this.list.querySelector('ul');
2662
2971
  }
2663
2972
  if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
2664
2973
  isNavigation && this.liCollections.length === 0) || this.isRequested) {
@@ -2736,7 +3045,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2736
3045
  const focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
2737
3046
  if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
2738
3047
  this.setSelection(focusEle, e);
2739
- if (this.enableVirtualization) {
3048
+ if (this.enableVirtualization && !this.fields.groupBy && this.getModuleName() !== 'combobox') {
2740
3049
  let selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
2741
3050
  this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
2742
3051
  }
@@ -2764,7 +3073,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2764
3073
  }
2765
3074
  else {
2766
3075
  if (this.getModuleName() === 'autocomplete') {
2767
- var value = this.selectedLI.dataset.value;
3076
+ var value = this.getFormattedValue(this.selectedLI.getAttribute('data-value'));
2768
3077
  nextItem = this.getElementByValue(value);
2769
3078
  }
2770
3079
  else {
@@ -2776,6 +3085,38 @@ let DropDownList = class DropDownList extends DropDownBase {
2776
3085
  if (!isNullOrUndefined(nextItem)) {
2777
3086
  this.setSelection(nextItem, e);
2778
3087
  }
3088
+ else if (this.enableVirtualization && !this.isPopupOpen && this.getModuleName() !== 'autocomplete' && ((this.viewPortInfo.endIndex !== this.totalItemCount && e.action === 'down') || (this.viewPortInfo.startIndex !== 0 && e.action === 'up'))) {
3089
+ if (e.action === 'down') {
3090
+ this.viewPortInfo.startIndex = (this.viewPortInfo.startIndex + this.itemCount) < (this.totalItemCount - this.itemCount) ? this.viewPortInfo.startIndex + this.itemCount : this.totalItemCount - this.itemCount;
3091
+ this.viewPortInfo.endIndex = this.viewPortInfo.startIndex + this.itemCount;
3092
+ this.updateVirtualItemIndex();
3093
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? true : this.isCustomFilter;
3094
+ this.resetList(this.dataSource, this.fields, this.query);
3095
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? false : this.isCustomFilter;
3096
+ const value = this.liCollections[0].getAttribute('data-value') !== "null" ? this.getFormattedValue(this.liCollections[0].getAttribute('data-value')) : null;
3097
+ const selectedData = this.getDataByValue(value);
3098
+ if (selectedData) {
3099
+ this.itemData = selectedData;
3100
+ }
3101
+ }
3102
+ else if (e.action === 'up') {
3103
+ this.viewPortInfo.startIndex = (this.viewPortInfo.startIndex - this.itemCount) > 0 ? this.viewPortInfo.startIndex - this.itemCount : 0;
3104
+ this.viewPortInfo.endIndex = this.viewPortInfo.startIndex + this.itemCount;
3105
+ this.updateVirtualItemIndex();
3106
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? true : this.isCustomFilter;
3107
+ this.resetList(this.dataSource, this.fields, this.query);
3108
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? false : this.isCustomFilter;
3109
+ const value = this.liCollections[this.liCollections.length - 1].getAttribute('data-value') !== "null" ? this.getFormattedValue(this.liCollections[this.liCollections.length - 1].getAttribute('data-value')) : null;
3110
+ const selectedData = this.getDataByValue(value);
3111
+ if (selectedData) {
3112
+ this.itemData = selectedData;
3113
+ }
3114
+ }
3115
+ this.UpdateSkeleton();
3116
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
3117
+ this.ulElement = this.list.querySelector('ul');
3118
+ this.handleVirtualKeyboardActions(e, this.pageCount);
3119
+ }
2779
3120
  }
2780
3121
  if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
2781
3122
  let value = this.getItemData().value;
@@ -2784,18 +3125,43 @@ let DropDownList = class DropDownList extends DropDownBase {
2784
3125
  this.activeIndex = filterIndex;
2785
3126
  }
2786
3127
  }
3128
+ if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
3129
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
3130
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
3131
+ }
3132
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
3133
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
3134
+ }
3135
+ }
2787
3136
  e.preventDefault();
2788
3137
  }
3138
+ updateVirtualItemIndex() {
3139
+ this.virtualItemStartIndex = this.viewPortInfo.startIndex;
3140
+ this.virtualItemEndIndex = this.viewPortInfo.endIndex;
3141
+ this.virtualListInfo = this.viewPortInfo;
3142
+ }
2789
3143
  updateHomeEndAction(e, isVirtualKeyAction) {
2790
3144
  if (this.getModuleName() === 'dropdownlist') {
2791
3145
  let findLi = 0;
2792
3146
  if (e.action === 'home') {
2793
3147
  findLi = 0;
2794
- if (this.enableVirtualization) {
3148
+ if (this.enableVirtualization && this.isPopupOpen) {
2795
3149
  findLi = this.skeletonCount;
2796
3150
  }
3151
+ else if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.startIndex !== 0) {
3152
+ this.viewPortInfo.startIndex = 0;
3153
+ this.viewPortInfo.endIndex = this.itemCount;
3154
+ this.updateVirtualItemIndex();
3155
+ this.resetList(this.dataSource, this.fields, this.query);
3156
+ }
2797
3157
  }
2798
3158
  else {
3159
+ if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.endIndex !== this.totalItemCount) {
3160
+ this.viewPortInfo.startIndex = this.totalItemCount - this.itemCount;
3161
+ this.viewPortInfo.endIndex = this.totalItemCount;
3162
+ this.updateVirtualItemIndex();
3163
+ this.resetList(this.dataSource, this.fields, this.query);
3164
+ }
2799
3165
  findLi = this.getItems().length - 1;
2800
3166
  }
2801
3167
  e.preventDefault();
@@ -2891,12 +3257,6 @@ let DropDownList = class DropDownList extends DropDownBase {
2891
3257
  isSelectFocusItem(element) {
2892
3258
  return !isNullOrUndefined(element);
2893
3259
  }
2894
- getPageCount(returnExactCount) {
2895
- const liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
2896
- getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
2897
- let pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
2898
- return returnExactCount ? pageCount : Math.round(pageCount);
2899
- }
2900
3260
  pageUpSelection(steps, event, isVirtualKeyAction) {
2901
3261
  let previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
2902
3262
  if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
@@ -2906,6 +3266,14 @@ let DropDownList = class DropDownList extends DropDownBase {
2906
3266
  previousItem = this.liCollections[this.skeletonCount];
2907
3267
  }
2908
3268
  this.PageUpDownSelection(previousItem, event);
3269
+ if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
3270
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
3271
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
3272
+ }
3273
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
3274
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
3275
+ }
3276
+ }
2909
3277
  }
2910
3278
  PageUpDownSelection(previousItem, event) {
2911
3279
  if (this.enableVirtualization) {
@@ -2924,6 +3292,14 @@ let DropDownList = class DropDownList extends DropDownBase {
2924
3292
  previousItem = steps <= list.length ? this.liCollections[steps + this.skeletonCount - 1] : this.liCollections[list.length - 1];
2925
3293
  }
2926
3294
  this.PageUpDownSelection(previousItem, event);
3295
+ if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
3296
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
3297
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
3298
+ }
3299
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
3300
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
3301
+ }
3302
+ }
2927
3303
  }
2928
3304
  unWireEvent() {
2929
3305
  if (!isNullOrUndefined(this.inputWrapper)) {
@@ -3157,7 +3533,10 @@ let DropDownList = class DropDownList extends DropDownBase {
3157
3533
  .then((e) => {
3158
3534
  if (e.result.length > 0) {
3159
3535
  this.itemData = e.result[0];
3160
- this.setProperties({ 'text': e.result[0].text, 'value': e.result[0].value }, true);
3536
+ const dataItem = this.getItemData();
3537
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
3538
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
3539
+ }
3161
3540
  }
3162
3541
  });
3163
3542
  }
@@ -3165,7 +3544,10 @@ let DropDownList = class DropDownList extends DropDownBase {
3165
3544
  const getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
3166
3545
  if (getItem && getItem.length > 0) {
3167
3546
  this.itemData = getItem[0];
3168
- this.setProperties({ 'text': getItem[0].text, 'value': getItem[0].value }, true);
3547
+ const dataItem = this.getItemData();
3548
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
3549
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
3550
+ }
3169
3551
  }
3170
3552
  }
3171
3553
  }
@@ -3427,7 +3809,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3427
3809
  this.typedString = this.filterInput.value;
3428
3810
  this.preventAutoFill = false;
3429
3811
  this.searchLists(e);
3430
- if (this.enableVirtualization) {
3812
+ if ((this.enableVirtualization && this.getModuleName() !== 'autocomplete') || (this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
3431
3813
  this.getFilteringSkeletonCount();
3432
3814
  }
3433
3815
  break;
@@ -3442,19 +3824,28 @@ let DropDownList = class DropDownList extends DropDownBase {
3442
3824
  const currentSkeletonCount = this.skeletonCount;
3443
3825
  this.getSkeletonCount(true);
3444
3826
  this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
3827
+ let skeletonUpdated = true;
3828
+ if (this.getModuleName() === 'autocomplete' && (this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2))) {
3829
+ this.skeletonCount = 0;
3830
+ skeletonUpdated = false;
3831
+ }
3445
3832
  if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
3446
3833
  const isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
3447
- if (currentSkeletonCount !== this.skeletonCount) {
3834
+ if (currentSkeletonCount !== this.skeletonCount && skeletonUpdated) {
3448
3835
  this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
3449
3836
  }
3450
3837
  else {
3451
3838
  this.UpdateSkeleton();
3452
3839
  }
3453
3840
  this.liCollections = this.list.querySelectorAll('.e-list-item');
3454
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3455
- this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
3456
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3457
- this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3841
+ if ((this.list.getElementsByClassName('e-virtual-ddl').length > 0)) {
3842
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3843
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
3844
+ }
3845
+ if (this.list.getElementsByClassName('e-virtual-ddl-content').length > 0) {
3846
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3847
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3848
+ }
3458
3849
  }
3459
3850
  }
3460
3851
  getSkeletonCount(retainSkeleton) {
@@ -3507,12 +3898,26 @@ let DropDownList = class DropDownList extends DropDownBase {
3507
3898
  else {
3508
3899
  filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
3509
3900
  }
3510
- if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0)) {
3901
+ if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
3511
3902
  var takeValue = this.getTakeValue();
3512
- if (this.allowFiltering) {
3903
+ var alreadySkipAdded = false;
3904
+ if (filterQuery) {
3905
+ for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
3906
+ if (filterQuery.queries[queryElements].fn === 'onSkip') {
3907
+ alreadySkipAdded = true;
3908
+ break;
3909
+ }
3910
+ }
3911
+ }
3912
+ if (this.allowFiltering || !this.isPopupOpen || !alreadySkipAdded) {
3513
3913
  filterQuery.skip(this.virtualItemStartIndex);
3514
3914
  }
3515
- filterQuery.take(takeValue);
3915
+ if (this.isIncrementalRequest) {
3916
+ filterQuery.take(this.incrementalEndIndex);
3917
+ }
3918
+ else {
3919
+ filterQuery.take(takeValue);
3920
+ }
3516
3921
  filterQuery.requiresCount();
3517
3922
  }
3518
3923
  return filterQuery;
@@ -3753,7 +4158,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3753
4158
  }
3754
4159
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3755
4160
  onActionComplete(ulElement, list, e, isUpdated) {
3756
- if (this.dataSource instanceof DataManager && !isNullOrUndefined(e)) {
4161
+ if (this.dataSource instanceof DataManager && !isNullOrUndefined(e) && !this.virtualGroupDataSource) {
3757
4162
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3758
4163
  this.totalItemCount = e.count;
3759
4164
  }
@@ -3780,7 +4185,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3780
4185
  this.list.scrollTop = 0;
3781
4186
  }
3782
4187
  if (!isNullOrUndefined(ulElement)) {
3783
- attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
4188
+ attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'listbox' });
3784
4189
  }
3785
4190
  if (this.initRemoteRender) {
3786
4191
  this.initial = true;
@@ -3996,6 +4401,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3996
4401
  GetVirtualTrackHeight() {
3997
4402
  const height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
3998
4403
  const heightDimension = `height: ${height - this.itemCount * this.listItemHeight}px;`;
4404
+ if (this.getModuleName() === 'autocomplete' && this.skeletonCount === 0) {
4405
+ return "height: 0px;";
4406
+ }
3999
4407
  return heightDimension;
4000
4408
  }
4001
4409
  renderPopup(e) {
@@ -4009,6 +4417,8 @@ let DropDownList = class DropDownList extends DropDownBase {
4009
4417
  const popupEle = this.createElement('div', {
4010
4418
  id: this.element.id + '_popup', className: 'e-ddl e-popup ' + (this.cssClass !== null ? this.cssClass : '')
4011
4419
  });
4420
+ popupEle.setAttribute('aria-label', this.element.id);
4421
+ popupEle.setAttribute('role', 'dialog');
4012
4422
  const searchBox = this.setSearchBox(popupEle);
4013
4423
  this.listHeight = formatUnit(this.popupHeight);
4014
4424
  if (this.headerTemplate) {
@@ -4093,9 +4503,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4093
4503
  parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10));
4094
4504
  }
4095
4505
  }
4096
- this.getFocusElement();
4097
4506
  this.createPopup(popupEle, offsetValue, left);
4098
4507
  this.popupContentElement = this.popupObj.element.querySelector('.e-content');
4508
+ this.getFocusElement();
4099
4509
  this.checkCollision(popupEle);
4100
4510
  if (Browser.isDevice) {
4101
4511
  this.popupObj.element.classList.add(dropDownListClasses.device);
@@ -4134,7 +4544,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4134
4544
  enable: this.enableVirtualization,
4135
4545
  });
4136
4546
  setTimeout(() => {
4137
- if (this.value) {
4547
+ if (this.value || this.list.querySelector('.e-active')) {
4138
4548
  this.updateSelectionList();
4139
4549
  if (this.selectedValueInfo && this.viewPortInfo && this.viewPortInfo.offsets.top) {
4140
4550
  this.list.scrollTop = this.viewPortInfo.offsets.top;
@@ -4145,8 +4555,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4145
4555
  }
4146
4556
  }, 5);
4147
4557
  }
4148
- attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_options' });
4558
+ attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_popup', 'aria-controls': this.element.id });
4149
4559
  this.inputElement.setAttribute('aria-expanded', 'true');
4560
+ this.inputElement.setAttribute('aria-controls', this.element.id);
4150
4561
  const inputParent = this.isFiltering() ? this.filterInput.parentElement : this.inputWrapper.container;
4151
4562
  addClass([inputParent], [dropDownListClasses.inputFocus]);
4152
4563
  const animModel = { name: 'FadeIn', duration: 100 };
@@ -4210,7 +4621,12 @@ let DropDownList = class DropDownList extends DropDownBase {
4210
4621
  this.destroyPopup();
4211
4622
  if (this.isFiltering() && this.actionCompleteData.list && this.actionCompleteData.list[0]) {
4212
4623
  this.isActive = true;
4213
- this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
4624
+ if (this.enableVirtualization) {
4625
+ this.onActionComplete(this.ulElement, this.listData, null, true);
4626
+ }
4627
+ else {
4628
+ this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
4629
+ }
4214
4630
  }
4215
4631
  },
4216
4632
  open: () => {
@@ -4379,6 +4795,11 @@ let DropDownList = class DropDownList extends DropDownBase {
4379
4795
 
4380
4796
  }
4381
4797
  this.isKeyBoardAction = isScrollerCHanged;
4798
+ if (this.enableVirtualization && this.fields.groupBy && this.fixedHeaderElement && (keyAction == "down")) {
4799
+ setTimeout(() => {
4800
+ this.scrollStop(null, true);
4801
+ }, 100);
4802
+ }
4382
4803
  }
4383
4804
  }
4384
4805
  scrollTop(keyAction = null) {
@@ -4527,6 +4948,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4527
4948
  EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
4528
4949
  EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
4529
4950
  }
4951
+ if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
4952
+ this.filterInput.removeAttribute('aria-activedescendant');
4953
+ }
4530
4954
  this.filterInput = null;
4531
4955
  }
4532
4956
  attributes(this.targetElement(), { 'aria-expanded': 'false' });
@@ -4581,7 +5005,15 @@ let DropDownList = class DropDownList extends DropDownBase {
4581
5005
  if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
4582
5006
  this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
4583
5007
  }
4584
- const dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
5008
+ let dataSourceCount;
5009
+ if (this.dataSource instanceof DataManager) {
5010
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5011
+ dataSourceCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
5012
+ }
5013
+ else {
5014
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5015
+ dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
5016
+ }
4585
5017
  if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
4586
5018
  this.updateInitialData();
4587
5019
  this.checkAndResetCache();
@@ -4604,8 +5036,14 @@ let DropDownList = class DropDownList extends DropDownBase {
4604
5036
  }
4605
5037
  this.previousStartIndex = 0;
4606
5038
  this.previousEndIndex = 0;
4607
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4608
- this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
5039
+ if (this.dataSource instanceof DataManager) {
5040
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5041
+ this.totalItemCount = this.dataCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
5042
+ }
5043
+ else {
5044
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5045
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
5046
+ }
4609
5047
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4610
5048
  if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
4611
5049
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -4715,6 +5153,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4715
5153
  }
4716
5154
  else if (this.getModuleName() === 'dropdownlist') {
4717
5155
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
5156
+ this.inputElement.setAttribute('aria-label', this.getModuleName());
5157
+ this.inputElement.setAttribute('aria-expanded', 'false');
5158
+ this.inputElement.setAttribute('aria-controls', this.element.id + '_popups');
4718
5159
  }
4719
5160
  attributes(this.targetElement(), this.getAriaAttributes());
4720
5161
  this.updateDataAttribute(this.htmlAttributes);
@@ -4979,6 +5420,14 @@ let DropDownList = class DropDownList extends DropDownBase {
4979
5420
  this.clearAll();
4980
5421
  break;
4981
5422
  }
5423
+ if (this.enableVirtualization) {
5424
+ this.updateValues();
5425
+ this.updateInputFields();
5426
+ this.notify("setCurrentViewDataAsync", {
5427
+ module: "VirtualScroll",
5428
+ });
5429
+ break;
5430
+ }
4982
5431
  if (!this.list) {
4983
5432
  if (this.dataSource instanceof DataManager) {
4984
5433
  this.initRemoteRender = true;
@@ -5022,6 +5471,15 @@ let DropDownList = class DropDownList extends DropDownBase {
5022
5471
  this.clearAll();
5023
5472
  break;
5024
5473
  }
5474
+ if (this.enableVirtualization) {
5475
+ this.updateValues();
5476
+ this.updateInputFields();
5477
+ this.notify("setCurrentViewDataAsync", {
5478
+ module: "VirtualScroll",
5479
+ });
5480
+ this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
5481
+ break;
5482
+ }
5025
5483
  this.notify('beforeValueChange', { newProp: newProp }); // gird component value type change
5026
5484
  if (!this.list) {
5027
5485
  if (this.dataSource instanceof DataManager) {
@@ -5165,6 +5623,12 @@ let DropDownList = class DropDownList extends DropDownBase {
5165
5623
  }
5166
5624
  };
5167
5625
  }
5626
+ updatePopupState() {
5627
+ if (this.beforePopupOpen) {
5628
+ this.beforePopupOpen = false;
5629
+ this.showPopup();
5630
+ }
5631
+ }
5168
5632
  setReadOnly() {
5169
5633
  if (this.readonly) {
5170
5634
  addClass([this.inputWrapper.container], ['e-readonly']);
@@ -5296,7 +5760,10 @@ let DropDownList = class DropDownList extends DropDownBase {
5296
5760
  }
5297
5761
  this.closePopup(0, e);
5298
5762
  const dataItem = this.getItemData();
5299
- const isSelectVal = !isNullOrUndefined(this.selectedLI);
5763
+ let isSelectVal = !isNullOrUndefined(this.selectedLI);
5764
+ if (isSelectVal && this.enableVirtualization && this.selectedLI.classList) {
5765
+ isSelectVal = this.selectedLI.classList.contains('e-active');
5766
+ }
5300
5767
  if (this.inputElement && this.inputElement.value.trim() === '' && !this.isInteracted && (this.isSelectCustom ||
5301
5768
  isSelectVal && this.inputElement.value !== dataItem.text)) {
5302
5769
  this.isSelectCustom = false;
@@ -5764,14 +6231,17 @@ let DropDownTree = class DropDownTree extends Component {
5764
6231
  render() {
5765
6232
  const isTree = select('#' + this.element.id + '_tree', document);
5766
6233
  if (isTree) {
5767
- const popupDiv = select('#' + this.element.id + '_popup', document);
6234
+ const popupDiv = select('#' + this.element.id + '_options', document);
5768
6235
  detach(popupDiv ? popupDiv : isTree.parentElement);
5769
6236
  }
5770
6237
  this.ensureAutoCheck();
5771
6238
  if (this.element.tagName === 'INPUT') {
5772
6239
  this.inputEle = this.element;
5773
6240
  if (isNullOrUndefined(this.inputEle.getAttribute('role'))) {
5774
- this.inputEle.setAttribute('role', 'textbox');
6241
+ this.inputEle.setAttribute('aria-expanded', 'false');
6242
+ this.inputEle.setAttribute('role', 'combobox');
6243
+ this.inputEle.setAttribute('aria-haspopup', 'tree');
6244
+ this.inputEle.setAttribute('aria-controls', this.element.id + "_options");
5775
6245
  }
5776
6246
  if (isNullOrUndefined(this.inputEle.getAttribute('type'))) {
5777
6247
  this.inputEle.setAttribute('type', 'text');
@@ -5937,8 +6407,12 @@ let DropDownTree = class DropDownTree extends Component {
5937
6407
  }
5938
6408
  this.treeObj.fields = this.getTreeFields(fields);
5939
6409
  this.treeObj.dataBind();
5940
- if (this.hasTemplate && this.portals) {
5941
- this.portals = [].concat(this.treeObj.portals);
6410
+ if (this.hasTemplate && this.portals && this.treeObj.portals) {
6411
+ for (let i = 0; i < this.treeObj.portals.length; i++) {
6412
+ if (this.portals.indexOf(this.treeObj.portals[i]) == -1) {
6413
+ this.portals.push(this.treeObj.portals[i]);
6414
+ }
6415
+ }
5942
6416
  if (this.isReact) {
5943
6417
  this.renderReactTemplates();
5944
6418
  }
@@ -6395,16 +6869,7 @@ let DropDownTree = class DropDownTree extends Component {
6395
6869
  }
6396
6870
  }
6397
6871
  getAriaAttributes() {
6398
- const disable = this.enabled ? 'false' : 'true';
6399
- return {
6400
- 'aria-disabled': disable,
6401
- 'aria-owns': this.element.id + '_options',
6402
- 'role': 'listbox',
6403
- 'aria-haspopup': 'true',
6404
- 'aria-expanded': 'false',
6405
- 'aria-activedescendant': 'null',
6406
- 'aria-labelledby': this.hiddenElement.id
6407
- };
6872
+ return {};
6408
6873
  }
6409
6874
  updateOverFlowView() {
6410
6875
  this.overFlowWrapper.classList.remove(TOTAL_COUNT_WRAPPER);
@@ -6753,7 +7218,7 @@ let DropDownTree = class DropDownTree extends Component {
6753
7218
  }
6754
7219
  }
6755
7220
  else {
6756
- this.inputWrapper.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
7221
+ this.inputEle.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
6757
7222
  }
6758
7223
  }
6759
7224
  }
@@ -7005,8 +7470,10 @@ let DropDownTree = class DropDownTree extends Component {
7005
7470
  addClass([this.inputWrapper], [ICONANIMATION]);
7006
7471
  if (this.isFirstRender) {
7007
7472
  this.popupEle = this.createElement('div', {
7008
- id: this.element.id + '_popup', className: POPUP_CLASS + ' ' + (this.cssClass != null ? this.cssClass : '')
7473
+ id: this.element.id + '_options', className: POPUP_CLASS + ' ' + (this.cssClass != null ? this.cssClass : '')
7009
7474
  });
7475
+ this.popupEle.setAttribute('role', 'region');
7476
+ this.popupEle.setAttribute('aria-label', this.element.id);
7010
7477
  document.body.appendChild(this.popupEle);
7011
7478
  this.createPopup(this.popupEle);
7012
7479
  }
@@ -7042,7 +7509,7 @@ let DropDownTree = class DropDownTree extends Component {
7042
7509
  }
7043
7510
  }
7044
7511
  if (!isCancelled) {
7045
- attributes(this.inputWrapper, { 'aria-expanded': 'true' });
7512
+ attributes(this.inputEle, { 'aria-expanded': 'true' });
7046
7513
  this.popupObj.show(null, (this.zIndex === 1000) ? this.inputEle : null);
7047
7514
  removeClass([this.popupEle], DDTHIDEICON);
7048
7515
  this.updatePopupHeight();
@@ -7493,8 +7960,12 @@ let DropDownTree = class DropDownTree extends Component {
7493
7960
  }
7494
7961
  }
7495
7962
  onNodeExpanded(args) {
7496
- if (this.hasTemplate && this.portals) {
7497
- this.portals = [].concat(this.treeObj.portals);
7963
+ if (this.hasTemplate && this.portals && this.treeObj.portals) {
7964
+ for (let i = 0; i < this.treeObj.portals.length; i++) {
7965
+ if (this.portals.indexOf(this.treeObj.portals[i]) == -1) {
7966
+ this.portals.push(this.treeObj.portals[i]);
7967
+ }
7968
+ }
7498
7969
  /* eslint-enable */
7499
7970
  this.renderReactTemplates();
7500
7971
  }
@@ -8526,7 +8997,7 @@ let DropDownTree = class DropDownTree extends Component {
8526
8997
  if (this.popupEle) {
8527
8998
  addClass([this.popupEle], DDTHIDEICON);
8528
8999
  }
8529
- attributes(this.inputWrapper, { 'aria-expanded': 'false' });
9000
+ attributes(this.inputEle, { 'aria-expanded': 'false' });
8530
9001
  if (this.popupObj && this.isPopupOpen) {
8531
9002
  this.popupObj.hide();
8532
9003
  if (this.inputFocus) {
@@ -8932,7 +9403,7 @@ let ComboBox = class ComboBox extends DropDownList {
8932
9403
  if (this.isSelectCustom) {
8933
9404
  this.removeSelection();
8934
9405
  }
8935
- if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped) {
9406
+ if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped && !this.enableVirtualization) {
8936
9407
  setTimeout(() => {
8937
9408
  this.inlineSearch();
8938
9409
  });
@@ -8941,7 +9412,7 @@ let ComboBox = class ComboBox extends DropDownList {
8941
9412
  getFocusElement() {
8942
9413
  const dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
8943
9414
  const selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
8944
- const isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
9415
+ const isSelected = dataItem.text && dataItem.text.toString() === this.inputElement.value && !isNullOrUndefined(selected);
8945
9416
  if (isSelected) {
8946
9417
  return selected;
8947
9418
  }
@@ -8950,7 +9421,71 @@ let ComboBox = class ComboBox extends DropDownList {
8950
9421
  const inputValue = this.inputElement.value;
8951
9422
  const dataSource = this.sortedData;
8952
9423
  const type = this.typeOfData(dataSource).typeof;
8953
- const activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
9424
+ let activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
9425
+ if (this.enableVirtualization && inputValue !== '' && this.getModuleName() !== 'autocomplete' && this.isTyped && !this.allowFiltering) {
9426
+ var updatingincrementalindex = false;
9427
+ if ((this.viewPortInfo.endIndex >= this.incrementalEndIndex && this.incrementalEndIndex <= this.totalItemCount) || this.incrementalEndIndex == 0) {
9428
+ updatingincrementalindex = true;
9429
+ this.incrementalStartIndex = this.incrementalEndIndex;
9430
+ if (this.incrementalEndIndex == 0) {
9431
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
9432
+ }
9433
+ else {
9434
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
9435
+ }
9436
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
9437
+ updatingincrementalindex = true;
9438
+ }
9439
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
9440
+ this.updateIncrementalView(0, this.itemCount);
9441
+ }
9442
+ activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
9443
+ while (isNullOrUndefined(activeItem) && this.incrementalEndIndex < this.totalItemCount) {
9444
+ this.incrementalStartIndex = this.incrementalEndIndex;
9445
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
9446
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
9447
+ updatingincrementalindex = true;
9448
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
9449
+ this.updateIncrementalView(0, this.itemCount);
9450
+ }
9451
+ activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
9452
+ if (!isNullOrUndefined(activeItem)) {
9453
+ break;
9454
+ }
9455
+ if (isNullOrUndefined(activeItem) && this.incrementalEndIndex >= this.totalItemCount) {
9456
+ this.incrementalStartIndex = 0;
9457
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
9458
+ break;
9459
+ }
9460
+ }
9461
+ if (activeItem.index) {
9462
+ if ((!(this.viewPortInfo.startIndex >= activeItem.index)) || (!(activeItem.index >= this.viewPortInfo.endIndex))) {
9463
+ var startIndex = activeItem.index - ((this.itemCount / 2) - 2) > 0 ? activeItem.index - ((this.itemCount / 2) - 2) : 0;
9464
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
9465
+ if (startIndex != this.viewPortInfo.startIndex) {
9466
+ this.updateIncrementalView(startIndex, endIndex);
9467
+ }
9468
+ }
9469
+ }
9470
+ if (!isNullOrUndefined(activeItem.item)) {
9471
+ var index_1 = this.getIndexByValue(activeItem.item.getAttribute('data-value')) - this.skeletonCount;
9472
+ if (index_1 > this.itemCount / 2) {
9473
+ var startIndex = this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) < this.totalItemCount ? this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) : this.totalItemCount;
9474
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
9475
+ this.updateIncrementalView(startIndex, endIndex);
9476
+ }
9477
+ activeItem.item = this.getElementByValue(activeItem.item.getAttribute('data-value'));
9478
+ }
9479
+ else {
9480
+ this.updateIncrementalView(0, this.itemCount);
9481
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9482
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
9483
+ this.list.scrollTop = 0;
9484
+ }
9485
+ if (activeItem && activeItem.item) {
9486
+ activeItem.item = this.getElementByValue(activeItem.item.getAttribute('data-value'));
9487
+ }
9488
+ }
8954
9489
  const activeElement = activeItem.item;
8955
9490
  if (!isNullOrUndefined(activeElement)) {
8956
9491
  const count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
@@ -8961,6 +9496,14 @@ let ComboBox = class ComboBox extends DropDownList {
8961
9496
  if (!this.enableVirtualization) {
8962
9497
  this.list.scrollTop = count * height + fixedHead;
8963
9498
  }
9499
+ else {
9500
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9501
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
9502
+ if (this.enableVirtualization && !this.fields.groupBy) {
9503
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? activeElement.offsetTop + (this.virtualListInfo.startIndex * activeElement.offsetHeight) : activeElement.offsetTop;
9504
+ this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * activeElement.offsetHeight);
9505
+ }
9506
+ }
8964
9507
  addClass([activeElement], dropDownListClasses.focus);
8965
9508
  }
8966
9509
  }
@@ -9641,7 +10184,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
9641
10184
  if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
9642
10185
  filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
9643
10186
  }
9644
- else {
10187
+ else if ((!this.enableVirtualization) || (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource)))) {
9645
10188
  const mapping = !isNullOrUndefined(this.fields.value) ? this.fields.value : '';
9646
10189
  filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
9647
10190
  }
@@ -9657,7 +10200,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
9657
10200
  }
9658
10201
  filterQuery.take(this.suggestionCount);
9659
10202
  }
9660
- if (this.enableVirtualization) {
10203
+ if (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
9661
10204
  var takeValue = this.getTakeValue();
9662
10205
  filterQuery.skip(this.virtualItemStartIndex);
9663
10206
  filterQuery.take(takeValue);
@@ -9738,7 +10281,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
9738
10281
  document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
9739
10282
  }
9740
10283
  }
9741
- if (this.enableVirtualization) {
10284
+ if ((this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
9742
10285
  this.getFilteringSkeletonCount();
9743
10286
  }
9744
10287
  }
@@ -9759,7 +10302,12 @@ let AutoComplete = class AutoComplete extends ComboBox {
9759
10302
  }
9760
10303
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
9761
10304
  onActionComplete(ulElement, list, e, isUpdated) {
9762
- this.fixedHeaderElement = null;
10305
+ if (!this.enableVirtualization) {
10306
+ this.fixedHeaderElement = null;
10307
+ }
10308
+ if ((this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
10309
+ this.getFilteringSkeletonCount();
10310
+ }
9763
10311
  super.onActionComplete(ulElement, list, e);
9764
10312
  const item = this.list.querySelector('.' + dropDownListClasses.li);
9765
10313
  if (!isNullOrUndefined(item)) {
@@ -9843,7 +10391,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
9843
10391
  super.renderPopup(e);
9844
10392
  }
9845
10393
  isEditTextBox() {
9846
- return true && this.inputElement.value.trim() !== '';
10394
+ return false;
9847
10395
  }
9848
10396
  isPopupButton() {
9849
10397
  return this.showPopupButton;
@@ -10423,7 +10971,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10423
10971
  if (this.popupObj) {
10424
10972
  this.popupObj.show(eventArgs.animation, (this.zIndex === 1000) ? this.element : null);
10425
10973
  }
10426
- attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options' });
10974
+ attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_popup', 'aria-controls': this.element.id });
10427
10975
  this.updateAriaActiveDescendant();
10428
10976
  if (this.isFirstClick) {
10429
10977
  this.loadTemplate();
@@ -10504,7 +11052,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10504
11052
  }
10505
11053
  updateListARIA() {
10506
11054
  if (!isNullOrUndefined(this.ulElement)) {
10507
- attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
11055
+ attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'list' });
10508
11056
  }
10509
11057
  const disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
10510
11058
  if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
@@ -14084,6 +14632,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14084
14632
  this.setWidth(this.width);
14085
14633
  this.overAllWrapper.appendChild(this.componentWrapper);
14086
14634
  this.popupWrapper = this.createElement('div', { id: this.element.id + '_popup', className: POPUP_WRAPPER });
14635
+ this.popupWrapper.setAttribute('aria-label', this.element.id);
14636
+ this.popupWrapper.setAttribute('role', 'dialog');
14087
14637
  if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {
14088
14638
  this.delimiterWrapper = this.createElement('span', { className: DELIMITER_WRAPPER, styles: 'display:none' });
14089
14639
  this.componentWrapper.appendChild(this.delimiterWrapper);
@@ -14811,7 +15361,10 @@ class CheckBoxSelection {
14811
15361
  'role': 'combobox',
14812
15362
  'autocomplete': 'off',
14813
15363
  'autocapitalize': 'off',
14814
- 'spellcheck': 'false'
15364
+ 'spellcheck': 'false',
15365
+ 'aria-label': 'multiselect',
15366
+ 'aria-expanded': 'true',
15367
+ 'aria-controls': args.popupElement.id
14815
15368
  });
14816
15369
  this.clearIconElement = this.filterInput.parentElement.querySelector('.' + clearIcon);
14817
15370
  if (!Browser.isDevice && this.clearIconElement) {
@@ -15141,6 +15694,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
15141
15694
  this.initLoad = true;
15142
15695
  this.isCustomFiltering = false;
15143
15696
  this.initialSelectedOptions = this.value;
15697
+ this.inputFormName = this.element.getAttribute('name');
15144
15698
  super.render();
15145
15699
  this.setEnabled();
15146
15700
  this.renderComplete();
@@ -15149,6 +15703,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
15149
15703
  const hiddenSelect = this.createElement('select', { className: 'e-hidden-select', attrs: { 'multiple': '' } });
15150
15704
  hiddenSelect.style.visibility = 'hidden';
15151
15705
  this.list.classList.add('e-listbox-wrapper');
15706
+ this.list.querySelector('.e-list-parent').setAttribute('role', 'presentation');
15707
+ const groupHdrs = this.list.querySelectorAll('.e-list-group-item');
15708
+ for (let i = 0; i < groupHdrs.length; i++) {
15709
+ groupHdrs[i].removeAttribute('tabindex');
15710
+ groupHdrs[i].setAttribute('role', 'option');
15711
+ }
15152
15712
  if (this.itemTemplate) {
15153
15713
  this.list.classList.add('e-list-template');
15154
15714
  }
@@ -15281,6 +15841,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
15281
15841
  });
15282
15842
  }
15283
15843
  validationAttribute(input, hiddenSelect) {
15844
+ if (this.inputFormName) {
15845
+ input.setAttribute('name', this.inputFormName);
15846
+ }
15284
15847
  super.validationAttribute(input, hiddenSelect);
15285
15848
  hiddenSelect.required = input.required;
15286
15849
  input.required = false;
@@ -16195,7 +16758,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
16195
16758
  'autocomplete': 'off',
16196
16759
  'autocorrect': 'off',
16197
16760
  'autocapitalize': 'off',
16198
- 'spellcheck': 'false'
16761
+ 'spellcheck': 'false',
16762
+ 'role': 'textbox'
16199
16763
  });
16200
16764
  if (this.height.toString().indexOf('%') < 0) {
16201
16765
  addClass([this.list], 'e-filter-list');
@@ -17569,6 +18133,7 @@ let Mention = class Mention extends DropDownBase {
17569
18133
  }
17570
18134
  }
17571
18135
  this.inputElement.setAttribute('role', 'textbox');
18136
+ this.inputElement.setAttribute('aria-label', 'mention');
17572
18137
  this.queryString = this.elementValue();
17573
18138
  this.wireEvent();
17574
18139
  }
@@ -17733,12 +18298,17 @@ let Mention = class Mention extends DropDownBase {
17733
18298
  }
17734
18299
  let currentRange = this.getTextRange();
17735
18300
  const lastWordRange = this.getLastLetter(currentRange);
18301
+ const lastTwoLetters = this.mentionChar.toString() + this.mentionChar.toString();
17736
18302
  // eslint-disable-next-line security/detect-non-literal-regexp
17737
18303
  const Regex = new RegExp(this.mentionChar.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'g');
17738
18304
  const charRegex = new RegExp('[a-zA-Z]', 'g');
17739
18305
  if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
17740
18306
  return;
17741
18307
  }
18308
+ if (this.beforePopupOpen && this.isPopupOpen && lastWordRange == lastTwoLetters) {
18309
+ this.hidePopup();
18310
+ return;
18311
+ }
17742
18312
  if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
17743
18313
  (lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
17744
18314
  (this.isContentEditable(this.inputElement) && this.range.startContainer &&
@@ -17878,7 +18448,10 @@ let Mention = class Mention extends DropDownBase {
17878
18448
  const value = this.getFormattedValue(focusItem.getAttribute('data-value'));
17879
18449
  this.selectEventCallback(focusItem, this.getDataByValue(value), value, true);
17880
18450
  }
17881
- if (this.beforePopupOpen) {
18451
+ if (this.beforePopupOpen && this.isPopupOpen) {
18452
+ if (!isNullOrUndefined(this.popupObj.element)) {
18453
+ this.popupObj.element.remove();
18454
+ }
17882
18455
  this.renderPopup();
17883
18456
  }
17884
18457
  }