@syncfusion/ej2-dropdowns 23.2.7 → 24.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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;
@@ -2786,16 +3127,33 @@ let DropDownList = class DropDownList extends DropDownBase {
2786
3127
  }
2787
3128
  e.preventDefault();
2788
3129
  }
3130
+ updateVirtualItemIndex() {
3131
+ this.virtualItemStartIndex = this.viewPortInfo.startIndex;
3132
+ this.virtualItemEndIndex = this.viewPortInfo.endIndex;
3133
+ this.virtualListInfo = this.viewPortInfo;
3134
+ }
2789
3135
  updateHomeEndAction(e, isVirtualKeyAction) {
2790
3136
  if (this.getModuleName() === 'dropdownlist') {
2791
3137
  let findLi = 0;
2792
3138
  if (e.action === 'home') {
2793
3139
  findLi = 0;
2794
- if (this.enableVirtualization) {
3140
+ if (this.enableVirtualization && this.isPopupOpen) {
2795
3141
  findLi = this.skeletonCount;
2796
3142
  }
3143
+ else if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.startIndex !== 0) {
3144
+ this.viewPortInfo.startIndex = 0;
3145
+ this.viewPortInfo.endIndex = this.itemCount;
3146
+ this.updateVirtualItemIndex();
3147
+ this.resetList(this.dataSource, this.fields, this.query);
3148
+ }
2797
3149
  }
2798
3150
  else {
3151
+ if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.endIndex !== this.totalItemCount) {
3152
+ this.viewPortInfo.startIndex = this.totalItemCount - this.itemCount;
3153
+ this.viewPortInfo.endIndex = this.totalItemCount;
3154
+ this.updateVirtualItemIndex();
3155
+ this.resetList(this.dataSource, this.fields, this.query);
3156
+ }
2799
3157
  findLi = this.getItems().length - 1;
2800
3158
  }
2801
3159
  e.preventDefault();
@@ -2891,12 +3249,6 @@ let DropDownList = class DropDownList extends DropDownBase {
2891
3249
  isSelectFocusItem(element) {
2892
3250
  return !isNullOrUndefined(element);
2893
3251
  }
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
3252
  pageUpSelection(steps, event, isVirtualKeyAction) {
2901
3253
  let previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
2902
3254
  if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
@@ -3157,7 +3509,10 @@ let DropDownList = class DropDownList extends DropDownBase {
3157
3509
  .then((e) => {
3158
3510
  if (e.result.length > 0) {
3159
3511
  this.itemData = e.result[0];
3160
- this.setProperties({ 'text': e.result[0].text, 'value': e.result[0].value }, true);
3512
+ const dataItem = this.getItemData();
3513
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
3514
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
3515
+ }
3161
3516
  }
3162
3517
  });
3163
3518
  }
@@ -3165,7 +3520,10 @@ let DropDownList = class DropDownList extends DropDownBase {
3165
3520
  const getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
3166
3521
  if (getItem && getItem.length > 0) {
3167
3522
  this.itemData = getItem[0];
3168
- this.setProperties({ 'text': getItem[0].text, 'value': getItem[0].value }, true);
3523
+ const dataItem = this.getItemData();
3524
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
3525
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
3526
+ }
3169
3527
  }
3170
3528
  }
3171
3529
  }
@@ -3427,7 +3785,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3427
3785
  this.typedString = this.filterInput.value;
3428
3786
  this.preventAutoFill = false;
3429
3787
  this.searchLists(e);
3430
- if (this.enableVirtualization) {
3788
+ if ((this.enableVirtualization && this.getModuleName() !== 'autocomplete') || (this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
3431
3789
  this.getFilteringSkeletonCount();
3432
3790
  }
3433
3791
  break;
@@ -3442,19 +3800,28 @@ let DropDownList = class DropDownList extends DropDownBase {
3442
3800
  const currentSkeletonCount = this.skeletonCount;
3443
3801
  this.getSkeletonCount(true);
3444
3802
  this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
3803
+ let skeletonUpdated = true;
3804
+ if (this.getModuleName() === 'autocomplete' && (this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2))) {
3805
+ this.skeletonCount = 0;
3806
+ skeletonUpdated = false;
3807
+ }
3445
3808
  if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
3446
3809
  const isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
3447
- if (currentSkeletonCount !== this.skeletonCount) {
3810
+ if (currentSkeletonCount !== this.skeletonCount && skeletonUpdated) {
3448
3811
  this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
3449
3812
  }
3450
3813
  else {
3451
3814
  this.UpdateSkeleton();
3452
3815
  }
3453
3816
  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();
3817
+ if ((this.list.getElementsByClassName('e-virtual-ddl').length > 0)) {
3818
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3819
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
3820
+ }
3821
+ if (this.list.getElementsByClassName('e-virtual-ddl-content').length > 0) {
3822
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3823
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3824
+ }
3458
3825
  }
3459
3826
  }
3460
3827
  getSkeletonCount(retainSkeleton) {
@@ -3507,12 +3874,26 @@ let DropDownList = class DropDownList extends DropDownBase {
3507
3874
  else {
3508
3875
  filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
3509
3876
  }
3510
- if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0)) {
3877
+ if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
3511
3878
  var takeValue = this.getTakeValue();
3512
- if (this.allowFiltering) {
3879
+ var alreadySkipAdded = false;
3880
+ if (filterQuery) {
3881
+ for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
3882
+ if (filterQuery.queries[queryElements].fn === 'onSkip') {
3883
+ alreadySkipAdded = true;
3884
+ break;
3885
+ }
3886
+ }
3887
+ }
3888
+ if (this.allowFiltering || !this.isPopupOpen || !alreadySkipAdded) {
3513
3889
  filterQuery.skip(this.virtualItemStartIndex);
3514
3890
  }
3515
- filterQuery.take(takeValue);
3891
+ if (this.isIncrementalRequest) {
3892
+ filterQuery.take(this.incrementalEndIndex);
3893
+ }
3894
+ else {
3895
+ filterQuery.take(takeValue);
3896
+ }
3516
3897
  filterQuery.requiresCount();
3517
3898
  }
3518
3899
  return filterQuery;
@@ -3753,7 +4134,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3753
4134
  }
3754
4135
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3755
4136
  onActionComplete(ulElement, list, e, isUpdated) {
3756
- if (this.dataSource instanceof DataManager && !isNullOrUndefined(e)) {
4137
+ if (this.dataSource instanceof DataManager && !isNullOrUndefined(e) && !this.virtualGroupDataSource) {
3757
4138
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3758
4139
  this.totalItemCount = e.count;
3759
4140
  }
@@ -3780,7 +4161,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3780
4161
  this.list.scrollTop = 0;
3781
4162
  }
3782
4163
  if (!isNullOrUndefined(ulElement)) {
3783
- attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
4164
+ attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'listbox' });
3784
4165
  }
3785
4166
  if (this.initRemoteRender) {
3786
4167
  this.initial = true;
@@ -3996,6 +4377,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3996
4377
  GetVirtualTrackHeight() {
3997
4378
  const height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
3998
4379
  const heightDimension = `height: ${height - this.itemCount * this.listItemHeight}px;`;
4380
+ if (this.getModuleName() === 'autocomplete' && this.skeletonCount === 0) {
4381
+ return "height: 0px;";
4382
+ }
3999
4383
  return heightDimension;
4000
4384
  }
4001
4385
  renderPopup(e) {
@@ -4009,6 +4393,8 @@ let DropDownList = class DropDownList extends DropDownBase {
4009
4393
  const popupEle = this.createElement('div', {
4010
4394
  id: this.element.id + '_popup', className: 'e-ddl e-popup ' + (this.cssClass !== null ? this.cssClass : '')
4011
4395
  });
4396
+ popupEle.setAttribute('aria-label', this.element.id);
4397
+ popupEle.setAttribute('role', 'dialog');
4012
4398
  const searchBox = this.setSearchBox(popupEle);
4013
4399
  this.listHeight = formatUnit(this.popupHeight);
4014
4400
  if (this.headerTemplate) {
@@ -4093,9 +4479,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4093
4479
  parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10));
4094
4480
  }
4095
4481
  }
4096
- this.getFocusElement();
4097
4482
  this.createPopup(popupEle, offsetValue, left);
4098
4483
  this.popupContentElement = this.popupObj.element.querySelector('.e-content');
4484
+ this.getFocusElement();
4099
4485
  this.checkCollision(popupEle);
4100
4486
  if (Browser.isDevice) {
4101
4487
  this.popupObj.element.classList.add(dropDownListClasses.device);
@@ -4134,7 +4520,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4134
4520
  enable: this.enableVirtualization,
4135
4521
  });
4136
4522
  setTimeout(() => {
4137
- if (this.value) {
4523
+ if (this.value || this.list.querySelector('.e-active')) {
4138
4524
  this.updateSelectionList();
4139
4525
  if (this.selectedValueInfo && this.viewPortInfo && this.viewPortInfo.offsets.top) {
4140
4526
  this.list.scrollTop = this.viewPortInfo.offsets.top;
@@ -4145,8 +4531,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4145
4531
  }
4146
4532
  }, 5);
4147
4533
  }
4148
- attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_options' });
4534
+ attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_popup', 'aria-controls': this.element.id });
4149
4535
  this.inputElement.setAttribute('aria-expanded', 'true');
4536
+ this.inputElement.setAttribute('aria-controls', this.element.id);
4150
4537
  const inputParent = this.isFiltering() ? this.filterInput.parentElement : this.inputWrapper.container;
4151
4538
  addClass([inputParent], [dropDownListClasses.inputFocus]);
4152
4539
  const animModel = { name: 'FadeIn', duration: 100 };
@@ -4210,7 +4597,12 @@ let DropDownList = class DropDownList extends DropDownBase {
4210
4597
  this.destroyPopup();
4211
4598
  if (this.isFiltering() && this.actionCompleteData.list && this.actionCompleteData.list[0]) {
4212
4599
  this.isActive = true;
4213
- this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
4600
+ if (this.enableVirtualization) {
4601
+ this.onActionComplete(this.ulElement, this.listData, null, true);
4602
+ }
4603
+ else {
4604
+ this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
4605
+ }
4214
4606
  }
4215
4607
  },
4216
4608
  open: () => {
@@ -4379,6 +4771,11 @@ let DropDownList = class DropDownList extends DropDownBase {
4379
4771
 
4380
4772
  }
4381
4773
  this.isKeyBoardAction = isScrollerCHanged;
4774
+ if (this.enableVirtualization && this.fields.groupBy && this.fixedHeaderElement && (keyAction == "down")) {
4775
+ setTimeout(() => {
4776
+ this.scrollStop(null, true);
4777
+ }, 100);
4778
+ }
4382
4779
  }
4383
4780
  }
4384
4781
  scrollTop(keyAction = null) {
@@ -4581,7 +4978,15 @@ let DropDownList = class DropDownList extends DropDownBase {
4581
4978
  if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
4582
4979
  this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
4583
4980
  }
4584
- const dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
4981
+ let dataSourceCount;
4982
+ if (this.dataSource instanceof DataManager) {
4983
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4984
+ dataSourceCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
4985
+ }
4986
+ else {
4987
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4988
+ dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
4989
+ }
4585
4990
  if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
4586
4991
  this.updateInitialData();
4587
4992
  this.checkAndResetCache();
@@ -4604,8 +5009,14 @@ let DropDownList = class DropDownList extends DropDownBase {
4604
5009
  }
4605
5010
  this.previousStartIndex = 0;
4606
5011
  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;
5012
+ if (this.dataSource instanceof DataManager) {
5013
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5014
+ this.totalItemCount = this.dataCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
5015
+ }
5016
+ else {
5017
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5018
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
5019
+ }
4609
5020
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4610
5021
  if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
4611
5022
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -4715,6 +5126,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4715
5126
  }
4716
5127
  else if (this.getModuleName() === 'dropdownlist') {
4717
5128
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
5129
+ this.inputElement.setAttribute('aria-label', this.getModuleName());
5130
+ this.inputElement.setAttribute('aria-expanded', 'false');
5131
+ this.inputElement.setAttribute('aria-controls', this.element.id + '_popups');
4718
5132
  }
4719
5133
  attributes(this.targetElement(), this.getAriaAttributes());
4720
5134
  this.updateDataAttribute(this.htmlAttributes);
@@ -4979,6 +5393,14 @@ let DropDownList = class DropDownList extends DropDownBase {
4979
5393
  this.clearAll();
4980
5394
  break;
4981
5395
  }
5396
+ if (this.enableVirtualization) {
5397
+ this.updateValues();
5398
+ this.updateInputFields();
5399
+ this.notify("setCurrentViewDataAsync", {
5400
+ module: "VirtualScroll",
5401
+ });
5402
+ break;
5403
+ }
4982
5404
  if (!this.list) {
4983
5405
  if (this.dataSource instanceof DataManager) {
4984
5406
  this.initRemoteRender = true;
@@ -5022,6 +5444,15 @@ let DropDownList = class DropDownList extends DropDownBase {
5022
5444
  this.clearAll();
5023
5445
  break;
5024
5446
  }
5447
+ if (this.enableVirtualization) {
5448
+ this.updateValues();
5449
+ this.updateInputFields();
5450
+ this.notify("setCurrentViewDataAsync", {
5451
+ module: "VirtualScroll",
5452
+ });
5453
+ this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
5454
+ break;
5455
+ }
5025
5456
  this.notify('beforeValueChange', { newProp: newProp }); // gird component value type change
5026
5457
  if (!this.list) {
5027
5458
  if (this.dataSource instanceof DataManager) {
@@ -5165,6 +5596,12 @@ let DropDownList = class DropDownList extends DropDownBase {
5165
5596
  }
5166
5597
  };
5167
5598
  }
5599
+ updatePopupState() {
5600
+ if (this.beforePopupOpen) {
5601
+ this.beforePopupOpen = false;
5602
+ this.showPopup();
5603
+ }
5604
+ }
5168
5605
  setReadOnly() {
5169
5606
  if (this.readonly) {
5170
5607
  addClass([this.inputWrapper.container], ['e-readonly']);
@@ -5296,7 +5733,10 @@ let DropDownList = class DropDownList extends DropDownBase {
5296
5733
  }
5297
5734
  this.closePopup(0, e);
5298
5735
  const dataItem = this.getItemData();
5299
- const isSelectVal = !isNullOrUndefined(this.selectedLI);
5736
+ let isSelectVal = !isNullOrUndefined(this.selectedLI);
5737
+ if (isSelectVal && this.enableVirtualization && this.selectedLI.classList) {
5738
+ isSelectVal = this.selectedLI.classList.contains('e-active');
5739
+ }
5300
5740
  if (this.inputElement && this.inputElement.value.trim() === '' && !this.isInteracted && (this.isSelectCustom ||
5301
5741
  isSelectVal && this.inputElement.value !== dataItem.text)) {
5302
5742
  this.isSelectCustom = false;
@@ -5764,14 +6204,17 @@ let DropDownTree = class DropDownTree extends Component {
5764
6204
  render() {
5765
6205
  const isTree = select('#' + this.element.id + '_tree', document);
5766
6206
  if (isTree) {
5767
- const popupDiv = select('#' + this.element.id + '_popup', document);
6207
+ const popupDiv = select('#' + this.element.id + '_options', document);
5768
6208
  detach(popupDiv ? popupDiv : isTree.parentElement);
5769
6209
  }
5770
6210
  this.ensureAutoCheck();
5771
6211
  if (this.element.tagName === 'INPUT') {
5772
6212
  this.inputEle = this.element;
5773
6213
  if (isNullOrUndefined(this.inputEle.getAttribute('role'))) {
5774
- this.inputEle.setAttribute('role', 'textbox');
6214
+ this.inputEle.setAttribute('aria-expanded', 'false');
6215
+ this.inputEle.setAttribute('role', 'combobox');
6216
+ this.inputEle.setAttribute('aria-haspopup', 'tree');
6217
+ this.inputEle.setAttribute('aria-controls', this.element.id + "_options");
5775
6218
  }
5776
6219
  if (isNullOrUndefined(this.inputEle.getAttribute('type'))) {
5777
6220
  this.inputEle.setAttribute('type', 'text');
@@ -5937,8 +6380,12 @@ let DropDownTree = class DropDownTree extends Component {
5937
6380
  }
5938
6381
  this.treeObj.fields = this.getTreeFields(fields);
5939
6382
  this.treeObj.dataBind();
5940
- if (this.hasTemplate && this.portals) {
5941
- this.portals = [].concat(this.treeObj.portals);
6383
+ if (this.hasTemplate && this.portals && this.treeObj.portals) {
6384
+ for (let i = 0; i < this.treeObj.portals.length; i++) {
6385
+ if (this.portals.indexOf(this.treeObj.portals[i]) == -1) {
6386
+ this.portals.push(this.treeObj.portals[i]);
6387
+ }
6388
+ }
5942
6389
  if (this.isReact) {
5943
6390
  this.renderReactTemplates();
5944
6391
  }
@@ -6395,16 +6842,7 @@ let DropDownTree = class DropDownTree extends Component {
6395
6842
  }
6396
6843
  }
6397
6844
  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
- };
6845
+ return {};
6408
6846
  }
6409
6847
  updateOverFlowView() {
6410
6848
  this.overFlowWrapper.classList.remove(TOTAL_COUNT_WRAPPER);
@@ -6753,7 +7191,7 @@ let DropDownTree = class DropDownTree extends Component {
6753
7191
  }
6754
7192
  }
6755
7193
  else {
6756
- this.inputWrapper.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
7194
+ this.inputEle.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
6757
7195
  }
6758
7196
  }
6759
7197
  }
@@ -7005,8 +7443,10 @@ let DropDownTree = class DropDownTree extends Component {
7005
7443
  addClass([this.inputWrapper], [ICONANIMATION]);
7006
7444
  if (this.isFirstRender) {
7007
7445
  this.popupEle = this.createElement('div', {
7008
- id: this.element.id + '_popup', className: POPUP_CLASS + ' ' + (this.cssClass != null ? this.cssClass : '')
7446
+ id: this.element.id + '_options', className: POPUP_CLASS + ' ' + (this.cssClass != null ? this.cssClass : '')
7009
7447
  });
7448
+ this.popupEle.setAttribute('role', 'region');
7449
+ this.popupEle.setAttribute('aria-label', this.element.id);
7010
7450
  document.body.appendChild(this.popupEle);
7011
7451
  this.createPopup(this.popupEle);
7012
7452
  }
@@ -7042,7 +7482,7 @@ let DropDownTree = class DropDownTree extends Component {
7042
7482
  }
7043
7483
  }
7044
7484
  if (!isCancelled) {
7045
- attributes(this.inputWrapper, { 'aria-expanded': 'true' });
7485
+ attributes(this.inputEle, { 'aria-expanded': 'true' });
7046
7486
  this.popupObj.show(null, (this.zIndex === 1000) ? this.inputEle : null);
7047
7487
  removeClass([this.popupEle], DDTHIDEICON);
7048
7488
  this.updatePopupHeight();
@@ -7493,8 +7933,12 @@ let DropDownTree = class DropDownTree extends Component {
7493
7933
  }
7494
7934
  }
7495
7935
  onNodeExpanded(args) {
7496
- if (this.hasTemplate && this.portals) {
7497
- this.portals = [].concat(this.treeObj.portals);
7936
+ if (this.hasTemplate && this.portals && this.treeObj.portals) {
7937
+ for (let i = 0; i < this.treeObj.portals.length; i++) {
7938
+ if (this.portals.indexOf(this.treeObj.portals[i]) == -1) {
7939
+ this.portals.push(this.treeObj.portals[i]);
7940
+ }
7941
+ }
7498
7942
  /* eslint-enable */
7499
7943
  this.renderReactTemplates();
7500
7944
  }
@@ -8526,7 +8970,7 @@ let DropDownTree = class DropDownTree extends Component {
8526
8970
  if (this.popupEle) {
8527
8971
  addClass([this.popupEle], DDTHIDEICON);
8528
8972
  }
8529
- attributes(this.inputWrapper, { 'aria-expanded': 'false' });
8973
+ attributes(this.inputEle, { 'aria-expanded': 'false' });
8530
8974
  if (this.popupObj && this.isPopupOpen) {
8531
8975
  this.popupObj.hide();
8532
8976
  if (this.inputFocus) {
@@ -8932,7 +9376,7 @@ let ComboBox = class ComboBox extends DropDownList {
8932
9376
  if (this.isSelectCustom) {
8933
9377
  this.removeSelection();
8934
9378
  }
8935
- if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped) {
9379
+ if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped && !this.enableVirtualization) {
8936
9380
  setTimeout(() => {
8937
9381
  this.inlineSearch();
8938
9382
  });
@@ -8941,7 +9385,7 @@ let ComboBox = class ComboBox extends DropDownList {
8941
9385
  getFocusElement() {
8942
9386
  const dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
8943
9387
  const selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
8944
- const isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
9388
+ const isSelected = dataItem.text && dataItem.text.toString() === this.inputElement.value && !isNullOrUndefined(selected);
8945
9389
  if (isSelected) {
8946
9390
  return selected;
8947
9391
  }
@@ -8950,7 +9394,71 @@ let ComboBox = class ComboBox extends DropDownList {
8950
9394
  const inputValue = this.inputElement.value;
8951
9395
  const dataSource = this.sortedData;
8952
9396
  const type = this.typeOfData(dataSource).typeof;
8953
- const activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
9397
+ let activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
9398
+ if (this.enableVirtualization && inputValue !== '' && this.getModuleName() !== 'autocomplete' && this.isTyped && !this.allowFiltering) {
9399
+ var updatingincrementalindex = false;
9400
+ if ((this.viewPortInfo.endIndex >= this.incrementalEndIndex && this.incrementalEndIndex <= this.totalItemCount) || this.incrementalEndIndex == 0) {
9401
+ updatingincrementalindex = true;
9402
+ this.incrementalStartIndex = this.incrementalEndIndex;
9403
+ if (this.incrementalEndIndex == 0) {
9404
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
9405
+ }
9406
+ else {
9407
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
9408
+ }
9409
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
9410
+ updatingincrementalindex = true;
9411
+ }
9412
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
9413
+ this.updateIncrementalView(0, this.itemCount);
9414
+ }
9415
+ activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
9416
+ while (isNullOrUndefined(activeItem) && this.incrementalEndIndex < this.totalItemCount) {
9417
+ this.incrementalStartIndex = this.incrementalEndIndex;
9418
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
9419
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
9420
+ updatingincrementalindex = true;
9421
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
9422
+ this.updateIncrementalView(0, this.itemCount);
9423
+ }
9424
+ activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
9425
+ if (!isNullOrUndefined(activeItem)) {
9426
+ break;
9427
+ }
9428
+ if (isNullOrUndefined(activeItem) && this.incrementalEndIndex >= this.totalItemCount) {
9429
+ this.incrementalStartIndex = 0;
9430
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
9431
+ break;
9432
+ }
9433
+ }
9434
+ if (activeItem.index) {
9435
+ if ((!(this.viewPortInfo.startIndex >= activeItem.index)) || (!(activeItem.index >= this.viewPortInfo.endIndex))) {
9436
+ var startIndex = activeItem.index - ((this.itemCount / 2) - 2) > 0 ? activeItem.index - ((this.itemCount / 2) - 2) : 0;
9437
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
9438
+ if (startIndex != this.viewPortInfo.startIndex) {
9439
+ this.updateIncrementalView(startIndex, endIndex);
9440
+ }
9441
+ }
9442
+ }
9443
+ if (!isNullOrUndefined(activeItem.item)) {
9444
+ var index_1 = this.getIndexByValue(activeItem.item.getAttribute('data-value')) - this.skeletonCount;
9445
+ if (index_1 > this.itemCount / 2) {
9446
+ var startIndex = this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) < this.totalItemCount ? this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) : this.totalItemCount;
9447
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
9448
+ this.updateIncrementalView(startIndex, endIndex);
9449
+ }
9450
+ activeItem.item = this.getElementByValue(activeItem.item.getAttribute('data-value'));
9451
+ }
9452
+ else {
9453
+ this.updateIncrementalView(0, this.itemCount);
9454
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9455
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
9456
+ this.list.scrollTop = 0;
9457
+ }
9458
+ if (activeItem && activeItem.item) {
9459
+ activeItem.item = this.getElementByValue(activeItem.item.getAttribute('data-value'));
9460
+ }
9461
+ }
8954
9462
  const activeElement = activeItem.item;
8955
9463
  if (!isNullOrUndefined(activeElement)) {
8956
9464
  const count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
@@ -8961,6 +9469,14 @@ let ComboBox = class ComboBox extends DropDownList {
8961
9469
  if (!this.enableVirtualization) {
8962
9470
  this.list.scrollTop = count * height + fixedHead;
8963
9471
  }
9472
+ else {
9473
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9474
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
9475
+ if (this.enableVirtualization && !this.fields.groupBy) {
9476
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? activeElement.offsetTop + (this.virtualListInfo.startIndex * activeElement.offsetHeight) : activeElement.offsetTop;
9477
+ this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * activeElement.offsetHeight);
9478
+ }
9479
+ }
8964
9480
  addClass([activeElement], dropDownListClasses.focus);
8965
9481
  }
8966
9482
  }
@@ -9641,7 +10157,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
9641
10157
  if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
9642
10158
  filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
9643
10159
  }
9644
- else {
10160
+ else if ((!this.enableVirtualization) || (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource)))) {
9645
10161
  const mapping = !isNullOrUndefined(this.fields.value) ? this.fields.value : '';
9646
10162
  filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
9647
10163
  }
@@ -9657,7 +10173,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
9657
10173
  }
9658
10174
  filterQuery.take(this.suggestionCount);
9659
10175
  }
9660
- if (this.enableVirtualization) {
10176
+ if (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
9661
10177
  var takeValue = this.getTakeValue();
9662
10178
  filterQuery.skip(this.virtualItemStartIndex);
9663
10179
  filterQuery.take(takeValue);
@@ -9738,7 +10254,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
9738
10254
  document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
9739
10255
  }
9740
10256
  }
9741
- if (this.enableVirtualization) {
10257
+ if ((this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
9742
10258
  this.getFilteringSkeletonCount();
9743
10259
  }
9744
10260
  }
@@ -9759,7 +10275,12 @@ let AutoComplete = class AutoComplete extends ComboBox {
9759
10275
  }
9760
10276
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
9761
10277
  onActionComplete(ulElement, list, e, isUpdated) {
9762
- this.fixedHeaderElement = null;
10278
+ if (!this.enableVirtualization) {
10279
+ this.fixedHeaderElement = null;
10280
+ }
10281
+ if ((this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
10282
+ this.getFilteringSkeletonCount();
10283
+ }
9763
10284
  super.onActionComplete(ulElement, list, e);
9764
10285
  const item = this.list.querySelector('.' + dropDownListClasses.li);
9765
10286
  if (!isNullOrUndefined(item)) {
@@ -10423,7 +10944,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10423
10944
  if (this.popupObj) {
10424
10945
  this.popupObj.show(eventArgs.animation, (this.zIndex === 1000) ? this.element : null);
10425
10946
  }
10426
- attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options' });
10947
+ attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_popup', 'aria-controls': this.element.id });
10427
10948
  this.updateAriaActiveDescendant();
10428
10949
  if (this.isFirstClick) {
10429
10950
  this.loadTemplate();
@@ -10504,7 +11025,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10504
11025
  }
10505
11026
  updateListARIA() {
10506
11027
  if (!isNullOrUndefined(this.ulElement)) {
10507
- attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
11028
+ attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'list' });
10508
11029
  }
10509
11030
  const disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
10510
11031
  if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
@@ -14084,6 +14605,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14084
14605
  this.setWidth(this.width);
14085
14606
  this.overAllWrapper.appendChild(this.componentWrapper);
14086
14607
  this.popupWrapper = this.createElement('div', { id: this.element.id + '_popup', className: POPUP_WRAPPER });
14608
+ this.popupWrapper.setAttribute('aria-label', this.element.id);
14609
+ this.popupWrapper.setAttribute('role', 'dialog');
14087
14610
  if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {
14088
14611
  this.delimiterWrapper = this.createElement('span', { className: DELIMITER_WRAPPER, styles: 'display:none' });
14089
14612
  this.componentWrapper.appendChild(this.delimiterWrapper);
@@ -14811,7 +15334,10 @@ class CheckBoxSelection {
14811
15334
  'role': 'combobox',
14812
15335
  'autocomplete': 'off',
14813
15336
  'autocapitalize': 'off',
14814
- 'spellcheck': 'false'
15337
+ 'spellcheck': 'false',
15338
+ 'aria-label': 'multiselect',
15339
+ 'aria-expanded': 'true',
15340
+ 'aria-controls': args.popupElement.id
14815
15341
  });
14816
15342
  this.clearIconElement = this.filterInput.parentElement.querySelector('.' + clearIcon);
14817
15343
  if (!Browser.isDevice && this.clearIconElement) {
@@ -15149,6 +15675,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
15149
15675
  const hiddenSelect = this.createElement('select', { className: 'e-hidden-select', attrs: { 'multiple': '' } });
15150
15676
  hiddenSelect.style.visibility = 'hidden';
15151
15677
  this.list.classList.add('e-listbox-wrapper');
15678
+ this.list.querySelector('.e-list-parent').setAttribute('role', 'presentation');
15679
+ const groupHdrs = this.list.querySelectorAll('.e-list-group-item');
15680
+ for (let i = 0; i < groupHdrs.length; i++) {
15681
+ groupHdrs[i].removeAttribute('tabindex');
15682
+ groupHdrs[i].setAttribute('role', 'option');
15683
+ }
15152
15684
  if (this.itemTemplate) {
15153
15685
  this.list.classList.add('e-list-template');
15154
15686
  }
@@ -16195,7 +16727,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
16195
16727
  'autocomplete': 'off',
16196
16728
  'autocorrect': 'off',
16197
16729
  'autocapitalize': 'off',
16198
- 'spellcheck': 'false'
16730
+ 'spellcheck': 'false',
16731
+ 'role': 'textbox'
16199
16732
  });
16200
16733
  if (this.height.toString().indexOf('%') < 0) {
16201
16734
  addClass([this.list], 'e-filter-list');
@@ -17569,6 +18102,7 @@ let Mention = class Mention extends DropDownBase {
17569
18102
  }
17570
18103
  }
17571
18104
  this.inputElement.setAttribute('role', 'textbox');
18105
+ this.inputElement.setAttribute('aria-label', 'mention');
17572
18106
  this.queryString = this.elementValue();
17573
18107
  this.wireEvent();
17574
18108
  }
@@ -17878,7 +18412,10 @@ let Mention = class Mention extends DropDownBase {
17878
18412
  const value = this.getFormattedValue(focusItem.getAttribute('data-value'));
17879
18413
  this.selectEventCallback(focusItem, this.getDataByValue(value), value, true);
17880
18414
  }
17881
- if (this.beforePopupOpen) {
18415
+ if (this.beforePopupOpen && this.isPopupOpen) {
18416
+ if (this.initRemoteRender && !isNullOrUndefined(this.popupObj.element)) {
18417
+ this.popupObj.element.remove();
18418
+ }
17882
18419
  this.renderPopup();
17883
18420
  }
17884
18421
  }