@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
  var queryString = '';
14
14
  var prevString = '';
15
+ var tempQueryString = '';
15
16
  var matches$1 = [];
16
17
  var activeClass = 'e-active';
17
18
  var prevElementId = '';
@@ -26,21 +27,49 @@ var 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(function () {
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
  var index;
35
57
  queryString = ignoreCase ? queryString.toLowerCase() : queryString;
36
- if (prevElementId === elementId && prevString === queryString) {
58
+ if (prevElementId === elementId && prevString === queryString && !refresh) {
37
59
  for (var 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 (var i_1 = 0; i_1 < matches$1.length; i_1++) {
105
+ if (currentValue && matches$1[i_1].textContent.toLowerCase() === currentValue.toLowerCase()) {
106
+ index = i_1;
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;
@@ -344,9 +387,24 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
344
387
  query = this.getPageQuery(query, virtualItemStartIndex, virtualItemEndIndex);
345
388
  }
346
389
  }
390
+ var tempCustomFilter = this.parent.isCustomFilter;
391
+ if (this.component === 'combobox') {
392
+ var totalData = 0;
393
+ if (this.parent.dataSource instanceof DataManager) {
394
+ totalData = this.parent.dataSource.dataSource.json.length;
395
+ }
396
+ else if (this.parent.dataSource && this.parent.dataSource.length > 0) {
397
+ totalData = this.parent.dataSource.length;
398
+ }
399
+ if (totalData > 0) {
400
+ this.parent.isCustomFilter = (totalData == this.parent.totalItemCount && this.parent.queryString != this.parent.typedString) ? true : this.parent.isCustomFilter;
401
+ }
402
+ }
347
403
  this.parent.resetList(dataSource, this.parent.fields, query);
404
+ this.parent.isCustomFilter = tempCustomFilter;
348
405
  };
349
406
  VirtualScroll.prototype.removeSkipAndTakeEvents = function (query) {
407
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
350
408
  query.queries = query.queries.filter(function (event) {
351
409
  return event.fn !== 'onSkip' && event.fn !== 'onTake';
352
410
  });
@@ -375,6 +433,9 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
375
433
  if (virtualContentElement) {
376
434
  (virtualContentElement).style = this.parent.getTransformValues();
377
435
  }
436
+ if (this.parent.fields.groupBy) {
437
+ this.parent.scrollStop();
438
+ }
378
439
  };
379
440
  VirtualScroll.prototype.generateQueryAndSetQueryIndexAsync = function (query, isPopupOpen) {
380
441
  var isStartIndexInitialised = false;
@@ -425,6 +486,9 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
425
486
  }
426
487
  else {
427
488
  this.parent.getSkeletonCount(true);
489
+ if (this.component === 'combobox') {
490
+ this.parent.skeletonCount = this.parent.totalItemCount != 0 && this.parent.totalItemCount < (this.parent.itemCount * 2) ? 0 : this.parent.skeletonCount;
491
+ }
428
492
  }
429
493
  }
430
494
  return [4 /*yield*/, this.dataProcessAsync()];
@@ -678,6 +742,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
678
742
  _this.virtualizedItemsCount = 0;
679
743
  _this.totalItemCount = 0;
680
744
  _this.dataCount = 0;
745
+ _this.isRemoteDataUpdated = false;
746
+ _this.isIncrementalRequest = false;
747
+ _this.itemCount = 10;
681
748
  return _this;
682
749
  }
683
750
  DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
@@ -1074,7 +1141,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1074
1141
  if (!eventArgs.cancel) {
1075
1142
  _this.isRequesting = true;
1076
1143
  _this.showSpinner();
1077
- if (dataSource instanceof DataManager) {
1144
+ if (dataSource instanceof DataManager && !_this.virtualGroupDataSource) {
1078
1145
  _this.isRequested = true;
1079
1146
  if (_this.isDataFetched) {
1080
1147
  _this.emptyDataRequest(fields);
@@ -1083,8 +1150,39 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1083
1150
  eventArgs.data.executeQuery(_this.getQuery(eventArgs.query)).then(function (e) {
1084
1151
  _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
1085
1152
  _this.trigger('actionComplete', e, function (e) {
1153
+ if (!_this.virtualGroupDataSource && _this.isVirtualizationEnabled) {
1154
+ _this.isRemoteDataUpdated = true;
1155
+ if ((_this.getModuleName() === 'combobox' && _this.isAllowFiltering && _this.isVirtualizationEnabled && e.result)) {
1156
+ e.result = e.result.result;
1157
+ }
1158
+ if (e.result.length > 0) {
1159
+ var dataSource_2 = e.result;
1160
+ if (_this.isVirtualizationEnabled && _this.fields.groupBy) {
1161
+ var data = new DataManager(dataSource_2).executeLocal(new Query().group(_this.fields.groupBy));
1162
+ _this.virtualGroupDataSource = data.records;
1163
+ }
1164
+ else {
1165
+ _this.virtualGroupDataSource = dataSource_2;
1166
+ _this.hideSpinner();
1167
+ _this.isRequested = false;
1168
+ _this.isRequesting = false;
1169
+ _this.setListData(dataSource_2, fields, query, event);
1170
+ return;
1171
+ }
1172
+ }
1173
+ _this.hideSpinner();
1174
+ _this.isRequested = false;
1175
+ _this.isRequesting = false;
1176
+ _this.updatePopupState();
1177
+ return;
1178
+ }
1086
1179
  if (!e.cancel) {
1180
+ _this.isRequesting = false;
1087
1181
  var listItems = e.result;
1182
+ if (_this.isIncrementalRequest) {
1183
+ ulElement = _this.renderItems(listItems, fields);
1184
+ return;
1185
+ }
1088
1186
  if (listItems.length === 0) {
1089
1187
  _this.isDataFetched = true;
1090
1188
  }
@@ -1098,7 +1196,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1098
1196
  _this.isRequested = false;
1099
1197
  _this.bindChildItems(listItems, ulElement, fields, e);
1100
1198
  }
1101
- _this.isRequesting = false;
1102
1199
  });
1103
1200
  }).catch(function (e) {
1104
1201
  _this.isRequested = false;
@@ -1109,8 +1206,25 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1109
1206
  }
1110
1207
  else {
1111
1208
  _this.isRequesting = false;
1112
- var dataManager = new DataManager(eventArgs.data);
1113
- var listItems = (_this.getQuery(eventArgs.query)).executeLocal(dataManager);
1209
+ var listItems = void 0;
1210
+ if (_this.isVirtualizationEnabled && !_this.virtualGroupDataSource && _this.fields.groupBy) {
1211
+ var data = new DataManager(_this.dataSource).executeLocal(new Query().group(_this.fields.groupBy));
1212
+ _this.virtualGroupDataSource = data.records;
1213
+ }
1214
+ var dataManager = _this.isVirtualizationEnabled && _this.virtualGroupDataSource ? new DataManager(_this.virtualGroupDataSource) : new DataManager(eventArgs.data);
1215
+ listItems = (_this.getQuery(eventArgs.query)).executeLocal(dataManager);
1216
+ if (_this.isVirtualizationEnabled && _this.getModuleName() === 'autocomplete' && (listItems.count != 0 && listItems.count < (_this.itemCount * 2))) {
1217
+ var newQuery = _this.getQuery(eventArgs.query);
1218
+ if (newQuery) {
1219
+ for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
1220
+ if (newQuery.queries[queryElements].fn === 'onTake') {
1221
+ newQuery.queries[queryElements].e.nos = listItems.count;
1222
+ listItems = (newQuery).executeLocal(dataManager);
1223
+ break;
1224
+ }
1225
+ }
1226
+ }
1227
+ }
1114
1228
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1115
1229
  _this.dataCount = listItems.count;
1116
1230
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1120,6 +1234,10 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1120
1234
  var localDataArgs = { cancel: false, result: listItems };
1121
1235
  _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
1122
1236
  _this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
1237
+ if (_this.isIncrementalRequest) {
1238
+ ulElement = _this.renderItems(localDataArgs.result, fields);
1239
+ return;
1240
+ }
1123
1241
  if (!localDataArgs.cancel) {
1124
1242
  ulElement = _this.renderItems(localDataArgs.result, fields);
1125
1243
  _this.onActionComplete(ulElement, localDataArgs.result, event);
@@ -1139,6 +1257,12 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1139
1257
  });
1140
1258
  }
1141
1259
  };
1260
+ DropDownBase.prototype.updatePopupState = function () {
1261
+ // Used this method in component side.
1262
+ };
1263
+ DropDownBase.prototype.updateRemoteData = function () {
1264
+ this.setListData(this.dataSource, this.fields, this.query);
1265
+ };
1142
1266
  DropDownBase.prototype.bindChildItems = function (listItems, ulElement, fields, e) {
1143
1267
  var _this = this;
1144
1268
  if (listItems.length >= 100 && this.getModuleName() === 'autocomplete') {
@@ -1226,7 +1350,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1226
1350
  if (this.isReact) {
1227
1351
  this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);
1228
1352
  }
1229
- this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
1353
+ if (!this.isVirtualizationEnabled) {
1354
+ this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
1355
+ }
1230
1356
  if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
1231
1357
  for (var i = 0; i < ulElement.childElementCount; i++) {
1232
1358
  if (ulElement.children[i].classList.contains('e-list-group-item')) {
@@ -1367,25 +1493,67 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1367
1493
  this.scrollStop(e);
1368
1494
  }
1369
1495
  };
1370
- DropDownBase.prototype.scrollStop = function (e) {
1496
+ DropDownBase.prototype.scrollStop = function (e, isDownkey) {
1371
1497
  var target = !isNullOrUndefined(e) ? e.target : this.list;
1372
1498
  var liHeight = parseInt(getComputedStyle(this.getValidLi(), null).getPropertyValue('height'), 10);
1373
1499
  var topIndex = Math.round(target.scrollTop / liHeight);
1374
1500
  var liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
1501
+ var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
1502
+ var count = 0;
1503
+ var isCount = false;
1375
1504
  for (var i = topIndex; i > -1; i--) {
1376
- if (!isNullOrUndefined(liCollections[i]) && liCollections[i].classList.contains(dropDownBaseClasses.group)) {
1377
- var currentLi = liCollections[i];
1378
- this.fixedHeaderElement.innerHTML = currentLi.innerHTML;
1379
- this.fixedHeaderElement.style.top = target.scrollTop + 'px';
1380
- this.fixedHeaderElement.style.display = 'block';
1381
- break;
1505
+ var index = this.isVirtualizationEnabled ? i + virtualListCount : i;
1506
+ if (this.isVirtualizationEnabled) {
1507
+ var groupListLength = this.list.querySelectorAll('.e-list-group-item').length;
1508
+ var loadedGroupList = 0;
1509
+ if (isCount) {
1510
+ count++;
1511
+ }
1512
+ if (this.updateGroupHeader(index, liCollections, target)) {
1513
+ loadedGroupList++;
1514
+ if (count >= this.getPageCount()) {
1515
+ break;
1516
+ }
1517
+ if (groupListLength <= loadedGroupList) {
1518
+ break;
1519
+ }
1520
+ }
1521
+ if (isDownkey) {
1522
+ 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')) {
1523
+ count++;
1524
+ isCount = true;
1525
+ }
1526
+ }
1382
1527
  }
1383
1528
  else {
1384
- this.fixedHeaderElement.style.display = 'none';
1385
- this.fixedHeaderElement.style.top = 'none';
1529
+ if (this.updateGroupHeader(index, liCollections, target)) {
1530
+ break;
1531
+ }
1386
1532
  }
1387
1533
  }
1388
1534
  };
1535
+ DropDownBase.prototype.getPageCount = function (returnExactCount) {
1536
+ var liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
1537
+ getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
1538
+ var pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
1539
+ return returnExactCount ? pageCount : Math.round(pageCount);
1540
+ };
1541
+ DropDownBase.prototype.updateGroupHeader = function (index, liCollections, target) {
1542
+ if (!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.group)) {
1543
+ this.updateGroupFixedHeader(liCollections[index], target);
1544
+ return true;
1545
+ }
1546
+ else {
1547
+ this.fixedHeaderElement.style.display = 'none';
1548
+ this.fixedHeaderElement.style.top = 'none';
1549
+ return false;
1550
+ }
1551
+ };
1552
+ DropDownBase.prototype.updateGroupFixedHeader = function (element, target) {
1553
+ this.fixedHeaderElement.innerHTML = element.innerHTML;
1554
+ this.fixedHeaderElement.style.top = target.scrollTop + 'px';
1555
+ this.fixedHeaderElement.style.display = 'block';
1556
+ };
1389
1557
  DropDownBase.prototype.getValidLi = function () {
1390
1558
  return this.liCollections[0];
1391
1559
  };
@@ -1419,45 +1587,54 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1419
1587
  var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
1420
1588
  if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
1421
1589
  virtualUlElement.replaceChild(ulElement, oldUlElement);
1422
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1423
- this.ulElement = this.list.querySelector('ul');
1424
- this.listData = listData;
1425
- this.postRender(this.list, listData, this.bindEvent);
1590
+ this.updateListElements(listData);
1426
1591
  }
1427
1592
  else if ((!virtualUlElement)) {
1428
1593
  this.list.innerHTML = '';
1429
- this.list.appendChild(ulElement);
1430
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1431
- this.ulElement = this.list.querySelector('ul');
1432
- this.listData = listData;
1433
- this.postRender(this.list, listData, this.bindEvent);
1594
+ this.createVirtualContent();
1595
+ this.list.querySelector('.e-virtual-ddl-content').appendChild(ulElement);
1596
+ this.updateListElements(listData);
1434
1597
  }
1435
1598
  }
1436
1599
  }
1437
1600
  else {
1438
1601
  ulElement = this.createListItems(listData, fields);
1602
+ if (this.isIncrementalRequest) {
1603
+ this.incrementalLiCollections = ulElement.querySelectorAll('.' + dropDownBaseClasses.li);
1604
+ this.incrementalUlElement = ulElement;
1605
+ this.incrementalListData = listData;
1606
+ return ulElement;
1607
+ }
1439
1608
  if (this.isVirtualizationEnabled) {
1440
1609
  var oldUlElement = this.list.querySelector('.e-list-parent');
1441
1610
  var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
1442
1611
  if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
1443
1612
  virtualUlElement.replaceChild(ulElement, oldUlElement);
1444
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1445
- this.ulElement = this.list.querySelector('ul');
1446
- this.listData = listData;
1447
- this.postRender(this.list, listData, this.bindEvent);
1613
+ this.updateListElements(listData);
1448
1614
  }
1449
1615
  else if ((!virtualUlElement)) {
1450
1616
  this.list.innerHTML = '';
1451
- this.list.appendChild(ulElement);
1452
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1453
- this.ulElement = this.list.querySelector('ul');
1454
- this.listData = listData;
1455
- this.postRender(this.list, listData, this.bindEvent);
1617
+ this.createVirtualContent();
1618
+ this.list.querySelector('.e-virtual-ddl-content').appendChild(ulElement);
1619
+ this.updateListElements(listData);
1456
1620
  }
1457
1621
  }
1458
1622
  }
1459
1623
  return ulElement;
1460
1624
  };
1625
+ DropDownBase.prototype.createVirtualContent = function () {
1626
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
1627
+ this.list.appendChild(this.createElement('div', {
1628
+ className: 'e-virtual-ddl-content',
1629
+ }));
1630
+ }
1631
+ };
1632
+ DropDownBase.prototype.updateListElements = function (listData) {
1633
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1634
+ this.ulElement = this.list.querySelector('ul');
1635
+ this.listData = listData;
1636
+ this.postRender(this.list, listData, this.bindEvent);
1637
+ };
1461
1638
  DropDownBase.prototype.templateListItem = function (dataSource, fields) {
1462
1639
  var option = this.listOption(dataSource, fields);
1463
1640
  option.templateID = this.itemTemplateId;
@@ -1529,11 +1706,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1529
1706
  * @param {string | number | boolean} value - Specifies given value.
1530
1707
  * @returns {number} Returns the index of the item.
1531
1708
  */
1532
- DropDownBase.prototype.getIndexByValueFilter = function (value) {
1709
+ DropDownBase.prototype.getIndexByValue = function (value) {
1533
1710
  var index;
1534
- var listItems = this.renderItems(this.selectData, this.fields);
1535
- for (var i = 0; i < listItems.children.length; i++) {
1536
- if (!isNullOrUndefined(value) && listItems.children[i].getAttribute('data-value') === value.toString()) {
1711
+ var listItems = this.getItems();
1712
+ for (var i = 0; i < listItems.length; i++) {
1713
+ if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
1537
1714
  index = i;
1538
1715
  break;
1539
1716
  }
@@ -1546,11 +1723,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1546
1723
  * @param {string | number | boolean} value - Specifies given value.
1547
1724
  * @returns {number} Returns the index of the item.
1548
1725
  */
1549
- DropDownBase.prototype.getIndexByValue = function (value) {
1726
+ DropDownBase.prototype.getIndexByValueFilter = function (value) {
1550
1727
  var index;
1551
- var listItems = this.getItems();
1552
- for (var i = 0; i < listItems.length; i++) {
1553
- if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
1728
+ var listItems = this.renderItems(this.selectData, this.fields);
1729
+ for (var i = 0; i < listItems.children.length; i++) {
1730
+ if (!isNullOrUndefined(value) && listItems.children[i].getAttribute('data-value') === value.toString()) {
1554
1731
  index = i;
1555
1732
  break;
1556
1733
  }
@@ -2115,7 +2292,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2115
2292
  _this.isListSearched = false;
2116
2293
  _this.preventChange = false;
2117
2294
  _this.isAngular = false;
2118
- _this.itemCount = 10;
2119
2295
  _this.virtualListHeight = 0;
2120
2296
  _this.isVirtualScrolling = false;
2121
2297
  _this.isPreventScrollAction = false;
@@ -2130,6 +2306,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2130
2306
  _this.pageCount = 0;
2131
2307
  _this.isPreventKeyAction = false;
2132
2308
  _this.generatedDataObject = {};
2309
+ _this.incrementalQueryString = '';
2310
+ _this.incrementalEndIndex = 0;
2311
+ _this.incrementalStartIndex = 0;
2312
+ _this.incrementalPreQueryString = '';
2133
2313
  _this.isTouched = false;
2134
2314
  _this.virtualListInfo = {
2135
2315
  currentPageNumber: null,
@@ -2239,8 +2419,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2239
2419
  };
2240
2420
  DropDownList.prototype.renderList = function (e, isEmptyData) {
2241
2421
  _super.prototype.render.call(this, e, isEmptyData);
2242
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2243
- this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2422
+ if (!(this.dataSource instanceof DataManager)) {
2423
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2424
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2425
+ }
2244
2426
  this.unWireListEvents();
2245
2427
  this.wireListEvents();
2246
2428
  };
@@ -2704,12 +2886,136 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2704
2886
  DropDownList.prototype.isValidLI = function (li) {
2705
2887
  return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
2706
2888
  };
2889
+ DropDownList.prototype.updateIncrementalInfo = function (startIndex, endIndex) {
2890
+ this.viewPortInfo.startIndex = startIndex;
2891
+ this.viewPortInfo.endIndex = endIndex;
2892
+ this.updateVirtualItemIndex();
2893
+ this.isIncrementalRequest = true;
2894
+ this.resetList(this.dataSource, this.fields, this.query);
2895
+ this.isIncrementalRequest = false;
2896
+ };
2897
+ DropDownList.prototype.updateIncrementalView = function (startIndex, endIndex) {
2898
+ this.viewPortInfo.startIndex = startIndex;
2899
+ this.viewPortInfo.endIndex = endIndex;
2900
+ this.updateVirtualItemIndex();
2901
+ this.resetList(this.dataSource, this.fields, this.query);
2902
+ this.UpdateSkeleton();
2903
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
2904
+ this.ulElement = this.list.querySelector('ul');
2905
+ };
2906
+ DropDownList.prototype.updateIncrementalItemIndex = function (startIndex, endIndex) {
2907
+ this.incrementalStartIndex = startIndex;
2908
+ this.incrementalEndIndex = endIndex;
2909
+ };
2707
2910
  DropDownList.prototype.incrementalSearch = function (e) {
2708
2911
  if (this.liCollections.length > 0) {
2709
- var li = incrementalSearch(e.charCode, this.liCollections, this.activeIndex, true, this.element.id);
2710
- if (!isNullOrUndefined(li)) {
2711
- this.setSelection(li, e);
2712
- this.setScrollPosition();
2912
+ if (this.enableVirtualization) {
2913
+ var updatingincrementalindex = false;
2914
+ var queryStringUpdated = false;
2915
+ var activeElement = this.ulElement.getElementsByClassName('e-active')[0];
2916
+ var currentValue = activeElement ? activeElement.textContent : null;
2917
+ if (this.incrementalQueryString == '') {
2918
+ this.incrementalQueryString = String.fromCharCode(e.charCode);
2919
+ this.incrementalPreQueryString = this.incrementalQueryString;
2920
+ }
2921
+ else if (String.fromCharCode(e.charCode).toLocaleLowerCase() == this.incrementalPreQueryString.toLocaleLowerCase()) {
2922
+ queryStringUpdated = true;
2923
+ }
2924
+ else {
2925
+ this.incrementalQueryString = String.fromCharCode(e.charCode);
2926
+ }
2927
+ if ((this.viewPortInfo.endIndex >= this.incrementalEndIndex && this.incrementalEndIndex <= this.totalItemCount) || this.incrementalEndIndex == 0) {
2928
+ updatingincrementalindex = true;
2929
+ this.incrementalStartIndex = this.incrementalEndIndex;
2930
+ if (this.incrementalEndIndex == 0) {
2931
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
2932
+ }
2933
+ else {
2934
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
2935
+ }
2936
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
2937
+ updatingincrementalindex = true;
2938
+ }
2939
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
2940
+ this.updateIncrementalView(0, this.itemCount);
2941
+ }
2942
+ var li = incrementalSearch(e.charCode, this.incrementalLiCollections, this.activeIndex, true, this.element.id, queryStringUpdated, currentValue, true);
2943
+ while (isNullOrUndefined(li) && this.incrementalEndIndex < this.totalItemCount) {
2944
+ this.updateIncrementalItemIndex(this.incrementalEndIndex, this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100);
2945
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
2946
+ updatingincrementalindex = true;
2947
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
2948
+ this.updateIncrementalView(0, this.itemCount);
2949
+ }
2950
+ li = incrementalSearch(e.charCode, this.incrementalLiCollections, 0, true, this.element.id, queryStringUpdated, currentValue, true, true);
2951
+ if (!isNullOrUndefined(li)) {
2952
+ break;
2953
+ }
2954
+ if (isNullOrUndefined(li) && this.incrementalEndIndex >= this.totalItemCount) {
2955
+ this.updateIncrementalItemIndex(0, 100 > this.totalItemCount ? this.totalItemCount : 100);
2956
+ break;
2957
+ }
2958
+ }
2959
+ if (isNullOrUndefined(li) && this.incrementalEndIndex >= this.totalItemCount) {
2960
+ this.updateIncrementalItemIndex(0, 100 > this.totalItemCount ? this.totalItemCount : 100);
2961
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
2962
+ updatingincrementalindex = true;
2963
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
2964
+ this.updateIncrementalView(0, this.itemCount);
2965
+ }
2966
+ li = incrementalSearch(e.charCode, this.incrementalLiCollections, 0, true, this.element.id, queryStringUpdated, currentValue, true, true);
2967
+ }
2968
+ var index = li && this.getIndexByValue(li.getAttribute('data-value'));
2969
+ if (!index) {
2970
+ for (var i = 0; i < this.incrementalLiCollections.length; i++) {
2971
+ if (!isNullOrUndefined(li) && !isNullOrUndefined(li.getAttribute('data-value')) && this.incrementalLiCollections[i].getAttribute('data-value') === li.getAttribute('data-value').toString()) {
2972
+ index = i;
2973
+ index = this.incrementalStartIndex + index;
2974
+ break;
2975
+ }
2976
+ }
2977
+ }
2978
+ else {
2979
+ index = index - this.skeletonCount;
2980
+ }
2981
+ if (index) {
2982
+ if ((!(this.viewPortInfo.startIndex >= index)) || (!(index >= this.viewPortInfo.endIndex))) {
2983
+ var startIndex = index - ((this.itemCount / 2) - 2) > 0 ? index - ((this.itemCount / 2) - 2) : 0;
2984
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
2985
+ this.updateIncrementalView(startIndex, endIndex);
2986
+ }
2987
+ }
2988
+ if (!isNullOrUndefined(li)) {
2989
+ var index_1 = this.getIndexByValue(li.getAttribute('data-value')) - this.skeletonCount;
2990
+ if (index_1 > this.itemCount / 2) {
2991
+ var startIndex = this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) < this.totalItemCount ? this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) : this.totalItemCount;
2992
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
2993
+ this.updateIncrementalView(startIndex, endIndex);
2994
+ }
2995
+ li = this.getElementByValue(li.getAttribute('data-value'));
2996
+ this.setSelection(li, e);
2997
+ this.setScrollPosition();
2998
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2999
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3000
+ if (this.enableVirtualization && !this.fields.groupBy) {
3001
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
3002
+ this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
3003
+ }
3004
+ this.incrementalPreQueryString = this.incrementalQueryString;
3005
+ }
3006
+ else {
3007
+ this.updateIncrementalView(0, this.itemCount);
3008
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3009
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3010
+ this.list.scrollTop = 0;
3011
+ }
3012
+ }
3013
+ else {
3014
+ var li = incrementalSearch(e.charCode, this.liCollections, this.activeIndex, true, this.element.id);
3015
+ if (!isNullOrUndefined(li)) {
3016
+ this.setSelection(li, e);
3017
+ this.setScrollPosition();
3018
+ }
2713
3019
  }
2714
3020
  }
2715
3021
  };
@@ -2765,6 +3071,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2765
3071
  if (isNullOrUndefined(this.list) && !this.isRequested && !isTabAction && e.action !== 'escape') {
2766
3072
  this.searchKeyEvent = e;
2767
3073
  this.renderList(e);
3074
+ this.UpdateSkeleton();
3075
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
3076
+ this.ulElement = this.list.querySelector('ul');
2768
3077
  }
2769
3078
  if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
2770
3079
  isNavigation && this.liCollections.length === 0) || this.isRequested) {
@@ -2842,7 +3151,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2842
3151
  var focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
2843
3152
  if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
2844
3153
  this.setSelection(focusEle, e);
2845
- if (this.enableVirtualization) {
3154
+ if (this.enableVirtualization && !this.fields.groupBy && this.getModuleName() !== 'combobox') {
2846
3155
  var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
2847
3156
  this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
2848
3157
  }
@@ -2870,7 +3179,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2870
3179
  }
2871
3180
  else {
2872
3181
  if (this.getModuleName() === 'autocomplete') {
2873
- var value = this.selectedLI.dataset.value;
3182
+ var value = this.getFormattedValue(this.selectedLI.getAttribute('data-value'));
2874
3183
  nextItem = this.getElementByValue(value);
2875
3184
  }
2876
3185
  else {
@@ -2882,26 +3191,83 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2882
3191
  if (!isNullOrUndefined(nextItem)) {
2883
3192
  this.setSelection(nextItem, e);
2884
3193
  }
3194
+ else if (this.enableVirtualization && !this.isPopupOpen && this.getModuleName() !== 'autocomplete' && ((this.viewPortInfo.endIndex !== this.totalItemCount && e.action === 'down') || (this.viewPortInfo.startIndex !== 0 && e.action === 'up'))) {
3195
+ if (e.action === 'down') {
3196
+ this.viewPortInfo.startIndex = (this.viewPortInfo.startIndex + this.itemCount) < (this.totalItemCount - this.itemCount) ? this.viewPortInfo.startIndex + this.itemCount : this.totalItemCount - this.itemCount;
3197
+ this.viewPortInfo.endIndex = this.viewPortInfo.startIndex + this.itemCount;
3198
+ this.updateVirtualItemIndex();
3199
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? true : this.isCustomFilter;
3200
+ this.resetList(this.dataSource, this.fields, this.query);
3201
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? false : this.isCustomFilter;
3202
+ var value_2 = this.liCollections[0].getAttribute('data-value') !== "null" ? this.getFormattedValue(this.liCollections[0].getAttribute('data-value')) : null;
3203
+ var selectedData = this.getDataByValue(value_2);
3204
+ if (selectedData) {
3205
+ this.itemData = selectedData;
3206
+ }
3207
+ }
3208
+ else if (e.action === 'up') {
3209
+ this.viewPortInfo.startIndex = (this.viewPortInfo.startIndex - this.itemCount) > 0 ? this.viewPortInfo.startIndex - this.itemCount : 0;
3210
+ this.viewPortInfo.endIndex = this.viewPortInfo.startIndex + this.itemCount;
3211
+ this.updateVirtualItemIndex();
3212
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? true : this.isCustomFilter;
3213
+ this.resetList(this.dataSource, this.fields, this.query);
3214
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? false : this.isCustomFilter;
3215
+ var value_3 = this.liCollections[this.liCollections.length - 1].getAttribute('data-value') !== "null" ? this.getFormattedValue(this.liCollections[this.liCollections.length - 1].getAttribute('data-value')) : null;
3216
+ var selectedData = this.getDataByValue(value_3);
3217
+ if (selectedData) {
3218
+ this.itemData = selectedData;
3219
+ }
3220
+ }
3221
+ this.UpdateSkeleton();
3222
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
3223
+ this.ulElement = this.list.querySelector('ul');
3224
+ this.handleVirtualKeyboardActions(e, this.pageCount);
3225
+ }
2885
3226
  }
2886
3227
  if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
2887
- var value_2 = this.getItemData().value;
2888
- var filterIndex = this.getIndexByValueFilter(value_2);
3228
+ var value_4 = this.getItemData().value;
3229
+ var filterIndex = this.getIndexByValueFilter(value_4);
2889
3230
  if (!isNullOrUndefined(filterIndex)) {
2890
3231
  this.activeIndex = filterIndex;
2891
3232
  }
2892
3233
  }
3234
+ if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
3235
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
3236
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
3237
+ }
3238
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
3239
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
3240
+ }
3241
+ }
2893
3242
  e.preventDefault();
2894
3243
  };
3244
+ DropDownList.prototype.updateVirtualItemIndex = function () {
3245
+ this.virtualItemStartIndex = this.viewPortInfo.startIndex;
3246
+ this.virtualItemEndIndex = this.viewPortInfo.endIndex;
3247
+ this.virtualListInfo = this.viewPortInfo;
3248
+ };
2895
3249
  DropDownList.prototype.updateHomeEndAction = function (e, isVirtualKeyAction) {
2896
3250
  if (this.getModuleName() === 'dropdownlist') {
2897
3251
  var findLi = 0;
2898
3252
  if (e.action === 'home') {
2899
3253
  findLi = 0;
2900
- if (this.enableVirtualization) {
3254
+ if (this.enableVirtualization && this.isPopupOpen) {
2901
3255
  findLi = this.skeletonCount;
2902
3256
  }
3257
+ else if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.startIndex !== 0) {
3258
+ this.viewPortInfo.startIndex = 0;
3259
+ this.viewPortInfo.endIndex = this.itemCount;
3260
+ this.updateVirtualItemIndex();
3261
+ this.resetList(this.dataSource, this.fields, this.query);
3262
+ }
2903
3263
  }
2904
3264
  else {
3265
+ if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.endIndex !== this.totalItemCount) {
3266
+ this.viewPortInfo.startIndex = this.totalItemCount - this.itemCount;
3267
+ this.viewPortInfo.endIndex = this.totalItemCount;
3268
+ this.updateVirtualItemIndex();
3269
+ this.resetList(this.dataSource, this.fields, this.query);
3270
+ }
2905
3271
  findLi = this.getItems().length - 1;
2906
3272
  }
2907
3273
  e.preventDefault();
@@ -2997,12 +3363,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2997
3363
  DropDownList.prototype.isSelectFocusItem = function (element) {
2998
3364
  return !isNullOrUndefined(element);
2999
3365
  };
3000
- DropDownList.prototype.getPageCount = function (returnExactCount) {
3001
- var liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
3002
- getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
3003
- var pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
3004
- return returnExactCount ? pageCount : Math.round(pageCount);
3005
- };
3006
3366
  DropDownList.prototype.pageUpSelection = function (steps, event, isVirtualKeyAction) {
3007
3367
  var previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
3008
3368
  if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
@@ -3012,6 +3372,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3012
3372
  previousItem = this.liCollections[this.skeletonCount];
3013
3373
  }
3014
3374
  this.PageUpDownSelection(previousItem, event);
3375
+ if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
3376
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
3377
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
3378
+ }
3379
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
3380
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
3381
+ }
3382
+ }
3015
3383
  };
3016
3384
  DropDownList.prototype.PageUpDownSelection = function (previousItem, event) {
3017
3385
  if (this.enableVirtualization) {
@@ -3030,6 +3398,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3030
3398
  previousItem = steps <= list.length ? this.liCollections[steps + this.skeletonCount - 1] : this.liCollections[list.length - 1];
3031
3399
  }
3032
3400
  this.PageUpDownSelection(previousItem, event);
3401
+ if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
3402
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
3403
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
3404
+ }
3405
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
3406
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
3407
+ }
3408
+ }
3033
3409
  };
3034
3410
  DropDownList.prototype.unWireEvent = function () {
3035
3411
  if (!isNullOrUndefined(this.inputWrapper)) {
@@ -3265,7 +3641,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3265
3641
  .then(function (e) {
3266
3642
  if (e.result.length > 0) {
3267
3643
  _this.itemData = e.result[0];
3268
- _this.setProperties({ 'text': e.result[0].text, 'value': e.result[0].value }, true);
3644
+ var dataItem = _this.getItemData();
3645
+ if ((_this.value === dataItem.value && _this.text !== dataItem.text) || (_this.value !== dataItem.value && _this.text === dataItem.text)) {
3646
+ _this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
3647
+ }
3269
3648
  }
3270
3649
  });
3271
3650
  }
@@ -3273,7 +3652,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3273
3652
  var getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
3274
3653
  if (getItem && getItem.length > 0) {
3275
3654
  this.itemData = getItem[0];
3276
- this.setProperties({ 'text': getItem[0].text, 'value': getItem[0].value }, true);
3655
+ var dataItem = this.getItemData();
3656
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
3657
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
3658
+ }
3277
3659
  }
3278
3660
  }
3279
3661
  }
@@ -3535,7 +3917,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3535
3917
  this.typedString = this.filterInput.value;
3536
3918
  this.preventAutoFill = false;
3537
3919
  this.searchLists(e);
3538
- if (this.enableVirtualization) {
3920
+ if ((this.enableVirtualization && this.getModuleName() !== 'autocomplete') || (this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
3539
3921
  this.getFilteringSkeletonCount();
3540
3922
  }
3541
3923
  break;
@@ -3550,19 +3932,28 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3550
3932
  var currentSkeletonCount = this.skeletonCount;
3551
3933
  this.getSkeletonCount(true);
3552
3934
  this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
3935
+ var skeletonUpdated = true;
3936
+ if (this.getModuleName() === 'autocomplete' && (this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2))) {
3937
+ this.skeletonCount = 0;
3938
+ skeletonUpdated = false;
3939
+ }
3553
3940
  if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
3554
3941
  var isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
3555
- if (currentSkeletonCount !== this.skeletonCount) {
3942
+ if (currentSkeletonCount !== this.skeletonCount && skeletonUpdated) {
3556
3943
  this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
3557
3944
  }
3558
3945
  else {
3559
3946
  this.UpdateSkeleton();
3560
3947
  }
3561
3948
  this.liCollections = this.list.querySelectorAll('.e-list-item');
3562
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3563
- this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
3564
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3565
- this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3949
+ if ((this.list.getElementsByClassName('e-virtual-ddl').length > 0)) {
3950
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3951
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
3952
+ }
3953
+ if (this.list.getElementsByClassName('e-virtual-ddl-content').length > 0) {
3954
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3955
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3956
+ }
3566
3957
  }
3567
3958
  };
3568
3959
  DropDownList.prototype.getSkeletonCount = function (retainSkeleton) {
@@ -3615,12 +4006,26 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3615
4006
  else {
3616
4007
  filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
3617
4008
  }
3618
- if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0)) {
4009
+ if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
3619
4010
  var takeValue = this.getTakeValue();
3620
- if (this.allowFiltering) {
4011
+ var alreadySkipAdded = false;
4012
+ if (filterQuery) {
4013
+ for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
4014
+ if (filterQuery.queries[queryElements].fn === 'onSkip') {
4015
+ alreadySkipAdded = true;
4016
+ break;
4017
+ }
4018
+ }
4019
+ }
4020
+ if (this.allowFiltering || !this.isPopupOpen || !alreadySkipAdded) {
3621
4021
  filterQuery.skip(this.virtualItemStartIndex);
3622
4022
  }
3623
- filterQuery.take(takeValue);
4023
+ if (this.isIncrementalRequest) {
4024
+ filterQuery.take(this.incrementalEndIndex);
4025
+ }
4026
+ else {
4027
+ filterQuery.take(takeValue);
4028
+ }
3624
4029
  filterQuery.requiresCount();
3625
4030
  }
3626
4031
  return filterQuery;
@@ -3864,7 +4269,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3864
4269
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3865
4270
  DropDownList.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
3866
4271
  var _this = this;
3867
- if (this.dataSource instanceof DataManager && !isNullOrUndefined(e)) {
4272
+ if (this.dataSource instanceof DataManager && !isNullOrUndefined(e) && !this.virtualGroupDataSource) {
3868
4273
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3869
4274
  this.totalItemCount = e.count;
3870
4275
  }
@@ -3891,7 +4296,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3891
4296
  this.list.scrollTop = 0;
3892
4297
  }
3893
4298
  if (!isNullOrUndefined(ulElement)) {
3894
- attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
4299
+ attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'listbox' });
3895
4300
  }
3896
4301
  if (this.initRemoteRender) {
3897
4302
  this.initial = true;
@@ -4017,10 +4422,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4017
4422
  DropDownList.prototype.addNewItem = function (listData, newElement) {
4018
4423
  var _this = this;
4019
4424
  if (!isNullOrUndefined(this.itemData) && !isNullOrUndefined(newElement)) {
4020
- var value_3 = this.getItemData().value;
4425
+ var value_5 = this.getItemData().value;
4021
4426
  var isExist = listData.some(function (data) {
4022
- return (((typeof data === 'string' || typeof data === 'number') && data === value_3) ||
4023
- (getValue(_this.fields.value, data) === value_3));
4427
+ return (((typeof data === 'string' || typeof data === 'number') && data === value_5) ||
4428
+ (getValue(_this.fields.value, data) === value_5));
4024
4429
  });
4025
4430
  if (!isExist) {
4026
4431
  this.addItem(this.itemData);
@@ -4111,6 +4516,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4111
4516
  DropDownList.prototype.GetVirtualTrackHeight = function () {
4112
4517
  var height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
4113
4518
  var heightDimension = "height: " + (height - this.itemCount * this.listItemHeight) + "px;";
4519
+ if (this.getModuleName() === 'autocomplete' && this.skeletonCount === 0) {
4520
+ return "height: 0px;";
4521
+ }
4114
4522
  return heightDimension;
4115
4523
  };
4116
4524
  DropDownList.prototype.renderPopup = function (e) {
@@ -4125,6 +4533,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4125
4533
  var popupEle = _this.createElement('div', {
4126
4534
  id: _this.element.id + '_popup', className: 'e-ddl e-popup ' + (_this.cssClass !== null ? _this.cssClass : '')
4127
4535
  });
4536
+ popupEle.setAttribute('aria-label', _this.element.id);
4537
+ popupEle.setAttribute('role', 'dialog');
4128
4538
  var searchBox = _this.setSearchBox(popupEle);
4129
4539
  _this.listHeight = formatUnit(_this.popupHeight);
4130
4540
  if (_this.headerTemplate) {
@@ -4209,9 +4619,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4209
4619
  parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
4210
4620
  }
4211
4621
  }
4212
- _this.getFocusElement();
4213
4622
  _this.createPopup(popupEle, offsetValue, left);
4214
4623
  _this.popupContentElement = _this.popupObj.element.querySelector('.e-content');
4624
+ _this.getFocusElement();
4215
4625
  _this.checkCollision(popupEle);
4216
4626
  if (Browser.isDevice) {
4217
4627
  _this.popupObj.element.classList.add(dropDownListClasses.device);
@@ -4251,7 +4661,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4251
4661
  enable: _this.enableVirtualization,
4252
4662
  });
4253
4663
  setTimeout(function () {
4254
- if (_this.value) {
4664
+ if (_this.value || _this.list.querySelector('.e-active')) {
4255
4665
  _this.updateSelectionList();
4256
4666
  if (_this.selectedValueInfo && _this.viewPortInfo && _this.viewPortInfo.offsets.top) {
4257
4667
  _this.list.scrollTop = _this.viewPortInfo.offsets.top;
@@ -4262,8 +4672,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4262
4672
  }
4263
4673
  }, 5);
4264
4674
  }
4265
- attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_options' });
4675
+ attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_popup', 'aria-controls': _this.element.id });
4266
4676
  _this.inputElement.setAttribute('aria-expanded', 'true');
4677
+ _this.inputElement.setAttribute('aria-controls', _this.element.id);
4267
4678
  var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
4268
4679
  addClass([inputParent], [dropDownListClasses.inputFocus]);
4269
4680
  var animModel = { name: 'FadeIn', duration: 100 };
@@ -4328,7 +4739,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4328
4739
  _this.destroyPopup();
4329
4740
  if (_this.isFiltering() && _this.actionCompleteData.list && _this.actionCompleteData.list[0]) {
4330
4741
  _this.isActive = true;
4331
- _this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);
4742
+ if (_this.enableVirtualization) {
4743
+ _this.onActionComplete(_this.ulElement, _this.listData, null, true);
4744
+ }
4745
+ else {
4746
+ _this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);
4747
+ }
4332
4748
  }
4333
4749
  },
4334
4750
  open: function () {
@@ -4435,6 +4851,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4435
4851
  return width;
4436
4852
  };
4437
4853
  DropDownList.prototype.scrollBottom = function (isInitial, isInitialSelection, keyAction) {
4854
+ var _this = this;
4438
4855
  if (isInitialSelection === void 0) { isInitialSelection = false; }
4439
4856
  if (keyAction === void 0) { keyAction = null; }
4440
4857
  if (isNullOrUndefined(this.selectedLI) && this.enableVirtualization) {
@@ -4499,6 +4916,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4499
4916
 
4500
4917
  }
4501
4918
  this.isKeyBoardAction = isScrollerCHanged;
4919
+ if (this.enableVirtualization && this.fields.groupBy && this.fixedHeaderElement && (keyAction == "down")) {
4920
+ setTimeout(function () {
4921
+ _this.scrollStop(null, true);
4922
+ }, 100);
4923
+ }
4502
4924
  }
4503
4925
  };
4504
4926
  DropDownList.prototype.scrollTop = function (keyAction) {
@@ -4650,6 +5072,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4650
5072
  EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
4651
5073
  EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
4652
5074
  }
5075
+ if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
5076
+ this.filterInput.removeAttribute('aria-activedescendant');
5077
+ }
4653
5078
  this.filterInput = null;
4654
5079
  }
4655
5080
  attributes(this.targetElement(), { 'aria-expanded': 'false' });
@@ -4704,7 +5129,15 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4704
5129
  if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
4705
5130
  this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
4706
5131
  }
4707
- var dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
5132
+ var dataSourceCount;
5133
+ if (this.dataSource instanceof DataManager) {
5134
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5135
+ dataSourceCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
5136
+ }
5137
+ else {
5138
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5139
+ dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
5140
+ }
4708
5141
  if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
4709
5142
  this.updateInitialData();
4710
5143
  this.checkAndResetCache();
@@ -4727,8 +5160,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4727
5160
  }
4728
5161
  this.previousStartIndex = 0;
4729
5162
  this.previousEndIndex = 0;
4730
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4731
- this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
5163
+ if (this.dataSource instanceof DataManager) {
5164
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5165
+ this.totalItemCount = this.dataCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
5166
+ }
5167
+ else {
5168
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5169
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
5170
+ }
4732
5171
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4733
5172
  if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
4734
5173
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -4838,6 +5277,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4838
5277
  }
4839
5278
  else if (this.getModuleName() === 'dropdownlist') {
4840
5279
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
5280
+ this.inputElement.setAttribute('aria-label', this.getModuleName());
5281
+ this.inputElement.setAttribute('aria-expanded', 'false');
5282
+ this.inputElement.setAttribute('aria-controls', this.element.id + '_popups');
4841
5283
  }
4842
5284
  attributes(this.targetElement(), this.getAriaAttributes());
4843
5285
  this.updateDataAttribute(this.htmlAttributes);
@@ -5103,6 +5545,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5103
5545
  this_1.clearAll();
5104
5546
  break;
5105
5547
  }
5548
+ if (this_1.enableVirtualization) {
5549
+ this_1.updateValues();
5550
+ this_1.updateInputFields();
5551
+ this_1.notify("setCurrentViewDataAsync", {
5552
+ module: "VirtualScroll",
5553
+ });
5554
+ break;
5555
+ }
5106
5556
  if (!this_1.list) {
5107
5557
  if (this_1.dataSource instanceof DataManager) {
5108
5558
  this_1.initRemoteRender = true;
@@ -5146,6 +5596,15 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5146
5596
  this_1.clearAll();
5147
5597
  break;
5148
5598
  }
5599
+ if (this_1.enableVirtualization) {
5600
+ this_1.updateValues();
5601
+ this_1.updateInputFields();
5602
+ this_1.notify("setCurrentViewDataAsync", {
5603
+ module: "VirtualScroll",
5604
+ });
5605
+ this_1.preventChange = this_1.isAngular && this_1.preventChange ? !this_1.preventChange : this_1.preventChange;
5606
+ break;
5607
+ }
5149
5608
  this_1.notify('beforeValueChange', { newProp: newProp }); // gird component value type change
5150
5609
  if (!this_1.list) {
5151
5610
  if (this_1.dataSource instanceof DataManager) {
@@ -5295,6 +5754,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5295
5754
  }
5296
5755
  };
5297
5756
  };
5757
+ DropDownList.prototype.updatePopupState = function () {
5758
+ if (this.beforePopupOpen) {
5759
+ this.beforePopupOpen = false;
5760
+ this.showPopup();
5761
+ }
5762
+ };
5298
5763
  DropDownList.prototype.setReadOnly = function () {
5299
5764
  if (this.readonly) {
5300
5765
  addClass([this.inputWrapper.container], ['e-readonly']);
@@ -5427,6 +5892,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5427
5892
  this.closePopup(0, e);
5428
5893
  var dataItem = this.getItemData();
5429
5894
  var isSelectVal = !isNullOrUndefined(this.selectedLI);
5895
+ if (isSelectVal && this.enableVirtualization && this.selectedLI.classList) {
5896
+ isSelectVal = this.selectedLI.classList.contains('e-active');
5897
+ }
5430
5898
  if (this.inputElement && this.inputElement.value.trim() === '' && !this.isInteracted && (this.isSelectCustom ||
5431
5899
  isSelectVal && this.inputElement.value !== dataItem.text)) {
5432
5900
  this.isSelectCustom = false;
@@ -5920,14 +6388,17 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5920
6388
  DropDownTree.prototype.render = function () {
5921
6389
  var isTree = select('#' + this.element.id + '_tree', document);
5922
6390
  if (isTree) {
5923
- var popupDiv = select('#' + this.element.id + '_popup', document);
6391
+ var popupDiv = select('#' + this.element.id + '_options', document);
5924
6392
  detach(popupDiv ? popupDiv : isTree.parentElement);
5925
6393
  }
5926
6394
  this.ensureAutoCheck();
5927
6395
  if (this.element.tagName === 'INPUT') {
5928
6396
  this.inputEle = this.element;
5929
6397
  if (isNullOrUndefined(this.inputEle.getAttribute('role'))) {
5930
- this.inputEle.setAttribute('role', 'textbox');
6398
+ this.inputEle.setAttribute('aria-expanded', 'false');
6399
+ this.inputEle.setAttribute('role', 'combobox');
6400
+ this.inputEle.setAttribute('aria-haspopup', 'tree');
6401
+ this.inputEle.setAttribute('aria-controls', this.element.id + "_options");
5931
6402
  }
5932
6403
  if (isNullOrUndefined(this.inputEle.getAttribute('type'))) {
5933
6404
  this.inputEle.setAttribute('type', 'text');
@@ -6095,8 +6566,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6095
6566
  }
6096
6567
  _this.treeObj.fields = _this.getTreeFields(fields);
6097
6568
  _this.treeObj.dataBind();
6098
- if (_this.hasTemplate && _this.portals) {
6099
- _this.portals = [].concat(_this.treeObj.portals);
6569
+ if (_this.hasTemplate && _this.portals && _this.treeObj.portals) {
6570
+ for (var i = 0; i < _this.treeObj.portals.length; i++) {
6571
+ if (_this.portals.indexOf(_this.treeObj.portals[i]) == -1) {
6572
+ _this.portals.push(_this.treeObj.portals[i]);
6573
+ }
6574
+ }
6100
6575
  if (_this.isReact) {
6101
6576
  _this.renderReactTemplates();
6102
6577
  }
@@ -6556,16 +7031,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6556
7031
  }
6557
7032
  };
6558
7033
  DropDownTree.prototype.getAriaAttributes = function () {
6559
- var disable = this.enabled ? 'false' : 'true';
6560
- return {
6561
- 'aria-disabled': disable,
6562
- 'aria-owns': this.element.id + '_options',
6563
- 'role': 'listbox',
6564
- 'aria-haspopup': 'true',
6565
- 'aria-expanded': 'false',
6566
- 'aria-activedescendant': 'null',
6567
- 'aria-labelledby': this.hiddenElement.id
6568
- };
7034
+ return {};
6569
7035
  };
6570
7036
  DropDownTree.prototype.updateOverFlowView = function () {
6571
7037
  this.overFlowWrapper.classList.remove(TOTAL_COUNT_WRAPPER);
@@ -6916,7 +7382,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6916
7382
  }
6917
7383
  }
6918
7384
  else {
6919
- this.inputWrapper.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
7385
+ this.inputEle.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
6920
7386
  }
6921
7387
  }
6922
7388
  }
@@ -7170,8 +7636,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
7170
7636
  addClass([_this.inputWrapper], [ICONANIMATION]);
7171
7637
  if (_this.isFirstRender) {
7172
7638
  _this.popupEle = _this.createElement('div', {
7173
- id: _this.element.id + '_popup', className: POPUP_CLASS + ' ' + (_this.cssClass != null ? _this.cssClass : '')
7639
+ id: _this.element.id + '_options', className: POPUP_CLASS + ' ' + (_this.cssClass != null ? _this.cssClass : '')
7174
7640
  });
7641
+ _this.popupEle.setAttribute('role', 'region');
7642
+ _this.popupEle.setAttribute('aria-label', _this.element.id);
7175
7643
  document.body.appendChild(_this.popupEle);
7176
7644
  _this.createPopup(_this.popupEle);
7177
7645
  }
@@ -7207,7 +7675,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
7207
7675
  }
7208
7676
  }
7209
7677
  if (!isCancelled) {
7210
- attributes(_this.inputWrapper, { 'aria-expanded': 'true' });
7678
+ attributes(_this.inputEle, { 'aria-expanded': 'true' });
7211
7679
  _this.popupObj.show(null, (_this.zIndex === 1000) ? _this.inputEle : null);
7212
7680
  removeClass([_this.popupEle], DDTHIDEICON);
7213
7681
  _this.updatePopupHeight();
@@ -7659,8 +8127,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
7659
8127
  }
7660
8128
  };
7661
8129
  DropDownTree.prototype.onNodeExpanded = function (args) {
7662
- if (this.hasTemplate && this.portals) {
7663
- this.portals = [].concat(this.treeObj.portals);
8130
+ if (this.hasTemplate && this.portals && this.treeObj.portals) {
8131
+ for (var i = 0; i < this.treeObj.portals.length; i++) {
8132
+ if (this.portals.indexOf(this.treeObj.portals[i]) == -1) {
8133
+ this.portals.push(this.treeObj.portals[i]);
8134
+ }
8135
+ }
7664
8136
  /* eslint-enable */
7665
8137
  this.renderReactTemplates();
7666
8138
  }
@@ -8693,7 +9165,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8693
9165
  if (this.popupEle) {
8694
9166
  addClass([this.popupEle], DDTHIDEICON);
8695
9167
  }
8696
- attributes(this.inputWrapper, { 'aria-expanded': 'false' });
9168
+ attributes(this.inputEle, { 'aria-expanded': 'false' });
8697
9169
  if (this.popupObj && this.isPopupOpen) {
8698
9170
  this.popupObj.hide();
8699
9171
  if (this.inputFocus) {
@@ -9115,7 +9587,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
9115
9587
  if (this.isSelectCustom) {
9116
9588
  this.removeSelection();
9117
9589
  }
9118
- if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped) {
9590
+ if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped && !this.enableVirtualization) {
9119
9591
  setTimeout(function () {
9120
9592
  _this.inlineSearch();
9121
9593
  });
@@ -9124,7 +9596,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
9124
9596
  ComboBox.prototype.getFocusElement = function () {
9125
9597
  var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
9126
9598
  var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
9127
- var isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
9599
+ var isSelected = dataItem.text && dataItem.text.toString() === this.inputElement.value && !isNullOrUndefined(selected);
9128
9600
  if (isSelected) {
9129
9601
  return selected;
9130
9602
  }
@@ -9134,6 +9606,70 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
9134
9606
  var dataSource = this.sortedData;
9135
9607
  var type = this.typeOfData(dataSource).typeof;
9136
9608
  var activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
9609
+ if (this.enableVirtualization && inputValue !== '' && this.getModuleName() !== 'autocomplete' && this.isTyped && !this.allowFiltering) {
9610
+ var updatingincrementalindex = false;
9611
+ if ((this.viewPortInfo.endIndex >= this.incrementalEndIndex && this.incrementalEndIndex <= this.totalItemCount) || this.incrementalEndIndex == 0) {
9612
+ updatingincrementalindex = true;
9613
+ this.incrementalStartIndex = this.incrementalEndIndex;
9614
+ if (this.incrementalEndIndex == 0) {
9615
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
9616
+ }
9617
+ else {
9618
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
9619
+ }
9620
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
9621
+ updatingincrementalindex = true;
9622
+ }
9623
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
9624
+ this.updateIncrementalView(0, this.itemCount);
9625
+ }
9626
+ activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
9627
+ while (isNullOrUndefined(activeItem) && this.incrementalEndIndex < this.totalItemCount) {
9628
+ this.incrementalStartIndex = this.incrementalEndIndex;
9629
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
9630
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
9631
+ updatingincrementalindex = true;
9632
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
9633
+ this.updateIncrementalView(0, this.itemCount);
9634
+ }
9635
+ activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
9636
+ if (!isNullOrUndefined(activeItem)) {
9637
+ break;
9638
+ }
9639
+ if (isNullOrUndefined(activeItem) && this.incrementalEndIndex >= this.totalItemCount) {
9640
+ this.incrementalStartIndex = 0;
9641
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
9642
+ break;
9643
+ }
9644
+ }
9645
+ if (activeItem.index) {
9646
+ if ((!(this.viewPortInfo.startIndex >= activeItem.index)) || (!(activeItem.index >= this.viewPortInfo.endIndex))) {
9647
+ var startIndex = activeItem.index - ((this.itemCount / 2) - 2) > 0 ? activeItem.index - ((this.itemCount / 2) - 2) : 0;
9648
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
9649
+ if (startIndex != this.viewPortInfo.startIndex) {
9650
+ this.updateIncrementalView(startIndex, endIndex);
9651
+ }
9652
+ }
9653
+ }
9654
+ if (!isNullOrUndefined(activeItem.item)) {
9655
+ var index_1 = this.getIndexByValue(activeItem.item.getAttribute('data-value')) - this.skeletonCount;
9656
+ if (index_1 > this.itemCount / 2) {
9657
+ var startIndex = this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) < this.totalItemCount ? this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) : this.totalItemCount;
9658
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
9659
+ this.updateIncrementalView(startIndex, endIndex);
9660
+ }
9661
+ activeItem.item = this.getElementByValue(activeItem.item.getAttribute('data-value'));
9662
+ }
9663
+ else {
9664
+ this.updateIncrementalView(0, this.itemCount);
9665
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9666
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
9667
+ this.list.scrollTop = 0;
9668
+ }
9669
+ if (activeItem && activeItem.item) {
9670
+ activeItem.item = this.getElementByValue(activeItem.item.getAttribute('data-value'));
9671
+ }
9672
+ }
9137
9673
  var activeElement = activeItem.item;
9138
9674
  if (!isNullOrUndefined(activeElement)) {
9139
9675
  var count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
@@ -9144,6 +9680,14 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
9144
9680
  if (!this.enableVirtualization) {
9145
9681
  this.list.scrollTop = count * height + fixedHead;
9146
9682
  }
9683
+ else {
9684
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9685
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
9686
+ if (this.enableVirtualization && !this.fields.groupBy) {
9687
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? activeElement.offsetTop + (this.virtualListInfo.startIndex * activeElement.offsetHeight) : activeElement.offsetTop;
9688
+ this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * activeElement.offsetHeight);
9689
+ }
9690
+ }
9147
9691
  addClass([activeElement], dropDownListClasses.focus);
9148
9692
  }
9149
9693
  }
@@ -9843,7 +10387,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
9843
10387
  if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
9844
10388
  filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
9845
10389
  }
9846
- else {
10390
+ else if ((!this.enableVirtualization) || (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource)))) {
9847
10391
  var mapping = !isNullOrUndefined(this.fields.value) ? this.fields.value : '';
9848
10392
  filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
9849
10393
  }
@@ -9859,7 +10403,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
9859
10403
  }
9860
10404
  filterQuery.take(this.suggestionCount);
9861
10405
  }
9862
- if (this.enableVirtualization) {
10406
+ if (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
9863
10407
  var takeValue = this.getTakeValue();
9864
10408
  filterQuery.skip(this.virtualItemStartIndex);
9865
10409
  filterQuery.take(takeValue);
@@ -9941,7 +10485,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
9941
10485
  document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
9942
10486
  }
9943
10487
  }
9944
- if (this.enableVirtualization) {
10488
+ if ((this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
9945
10489
  this.getFilteringSkeletonCount();
9946
10490
  }
9947
10491
  }
@@ -9962,7 +10506,12 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
9962
10506
  };
9963
10507
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
9964
10508
  AutoComplete.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
9965
- this.fixedHeaderElement = null;
10509
+ if (!this.enableVirtualization) {
10510
+ this.fixedHeaderElement = null;
10511
+ }
10512
+ if ((this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
10513
+ this.getFilteringSkeletonCount();
10514
+ }
9966
10515
  _super.prototype.onActionComplete.call(this, ulElement, list, e);
9967
10516
  var item = this.list.querySelector('.' + dropDownListClasses.li);
9968
10517
  if (!isNullOrUndefined(item)) {
@@ -10047,7 +10596,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
10047
10596
  _super.prototype.renderPopup.call(this, e);
10048
10597
  };
10049
10598
  AutoComplete.prototype.isEditTextBox = function () {
10050
- return true && this.inputElement.value.trim() !== '';
10599
+ return false;
10051
10600
  };
10052
10601
  AutoComplete.prototype.isPopupButton = function () {
10053
10602
  return this.showPopupButton;
@@ -10646,7 +11195,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10646
11195
  if (_this.popupObj) {
10647
11196
  _this.popupObj.show(eventArgs.animation, (_this.zIndex === 1000) ? _this.element : null);
10648
11197
  }
10649
- attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.inputElement.id + '_options' });
11198
+ attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_popup', 'aria-controls': _this.element.id });
10650
11199
  _this.updateAriaActiveDescendant();
10651
11200
  if (_this.isFirstClick) {
10652
11201
  _this.loadTemplate();
@@ -10727,7 +11276,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10727
11276
  };
10728
11277
  MultiSelect.prototype.updateListARIA = function () {
10729
11278
  if (!isNullOrUndefined(this.ulElement)) {
10730
- attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
11279
+ attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'list' });
10731
11280
  }
10732
11281
  var disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
10733
11282
  if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
@@ -14324,6 +14873,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14324
14873
  this.setWidth(this.width);
14325
14874
  this.overAllWrapper.appendChild(this.componentWrapper);
14326
14875
  this.popupWrapper = this.createElement('div', { id: this.element.id + '_popup', className: POPUP_WRAPPER });
14876
+ this.popupWrapper.setAttribute('aria-label', this.element.id);
14877
+ this.popupWrapper.setAttribute('role', 'dialog');
14327
14878
  if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {
14328
14879
  this.delimiterWrapper = this.createElement('span', { className: DELIMITER_WRAPPER, styles: 'display:none' });
14329
14880
  this.componentWrapper.appendChild(this.delimiterWrapper);
@@ -15054,7 +15605,10 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
15054
15605
  'role': 'combobox',
15055
15606
  'autocomplete': 'off',
15056
15607
  'autocapitalize': 'off',
15057
- 'spellcheck': 'false'
15608
+ 'spellcheck': 'false',
15609
+ 'aria-label': 'multiselect',
15610
+ 'aria-expanded': 'true',
15611
+ 'aria-controls': args.popupElement.id
15058
15612
  });
15059
15613
  this.clearIconElement = this.filterInput.parentElement.querySelector('.' + clearIcon);
15060
15614
  if (!Browser.isDevice && this.clearIconElement) {
@@ -15411,6 +15965,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15411
15965
  this.initLoad = true;
15412
15966
  this.isCustomFiltering = false;
15413
15967
  this.initialSelectedOptions = this.value;
15968
+ this.inputFormName = this.element.getAttribute('name');
15414
15969
  _super.prototype.render.call(this);
15415
15970
  this.setEnabled();
15416
15971
  this.renderComplete();
@@ -15419,6 +15974,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15419
15974
  var hiddenSelect = this.createElement('select', { className: 'e-hidden-select', attrs: { 'multiple': '' } });
15420
15975
  hiddenSelect.style.visibility = 'hidden';
15421
15976
  this.list.classList.add('e-listbox-wrapper');
15977
+ this.list.querySelector('.e-list-parent').setAttribute('role', 'presentation');
15978
+ var groupHdrs = this.list.querySelectorAll('.e-list-group-item');
15979
+ for (var i = 0; i < groupHdrs.length; i++) {
15980
+ groupHdrs[i].removeAttribute('tabindex');
15981
+ groupHdrs[i].setAttribute('role', 'option');
15982
+ }
15422
15983
  if (this.itemTemplate) {
15423
15984
  this.list.classList.add('e-list-template');
15424
15985
  }
@@ -15553,6 +16114,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15553
16114
  });
15554
16115
  };
15555
16116
  ListBox.prototype.validationAttribute = function (input, hiddenSelect) {
16117
+ if (this.inputFormName) {
16118
+ input.setAttribute('name', this.inputFormName);
16119
+ }
15556
16120
  _super.prototype.validationAttribute.call(this, input, hiddenSelect);
15557
16121
  hiddenSelect.required = input.required;
15558
16122
  input.required = false;
@@ -16483,7 +17047,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
16483
17047
  'autocomplete': 'off',
16484
17048
  'autocorrect': 'off',
16485
17049
  'autocapitalize': 'off',
16486
- 'spellcheck': 'false'
17050
+ 'spellcheck': 'false',
17051
+ 'role': 'textbox'
16487
17052
  });
16488
17053
  if (this.height.toString().indexOf('%') < 0) {
16489
17054
  addClass([this.list], 'e-filter-list');
@@ -17890,6 +18455,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17890
18455
  }
17891
18456
  }
17892
18457
  this.inputElement.setAttribute('role', 'textbox');
18458
+ this.inputElement.setAttribute('aria-label', 'mention');
17893
18459
  this.queryString = this.elementValue();
17894
18460
  this.wireEvent();
17895
18461
  };
@@ -18054,12 +18620,17 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18054
18620
  }
18055
18621
  var currentRange = this.getTextRange();
18056
18622
  var lastWordRange = this.getLastLetter(currentRange);
18623
+ var lastTwoLetters = this.mentionChar.toString() + this.mentionChar.toString();
18057
18624
  // eslint-disable-next-line security/detect-non-literal-regexp
18058
18625
  var Regex = new RegExp(this.mentionChar.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'g');
18059
18626
  var charRegex = new RegExp('[a-zA-Z]', 'g');
18060
18627
  if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
18061
18628
  return;
18062
18629
  }
18630
+ if (this.beforePopupOpen && this.isPopupOpen && lastWordRange == lastTwoLetters) {
18631
+ this.hidePopup();
18632
+ return;
18633
+ }
18063
18634
  if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
18064
18635
  (lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
18065
18636
  (this.isContentEditable(this.inputElement) && this.range.startContainer &&
@@ -18200,7 +18771,10 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18200
18771
  var value = this.getFormattedValue(focusItem.getAttribute('data-value'));
18201
18772
  this.selectEventCallback(focusItem, this.getDataByValue(value), value, true);
18202
18773
  }
18203
- if (this.beforePopupOpen) {
18774
+ if (this.beforePopupOpen && this.isPopupOpen) {
18775
+ if (!isNullOrUndefined(this.popupObj.element)) {
18776
+ this.popupObj.element.remove();
18777
+ }
18204
18778
  this.renderPopup();
18205
18779
  }
18206
18780
  }