@syncfusion/ej2-dropdowns 23.2.7-52849 → 24.1.41-566987

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 (127) hide show
  1. package/CHANGELOG.md +20 -132
  2. package/dist/ej2-dropdowns.umd.min.js +1 -1
  3. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-dropdowns.es2015.js +654 -116
  5. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es5.js +658 -119
  7. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  8. package/package.json +13 -13
  9. package/src/auto-complete/auto-complete.js +9 -4
  10. package/src/combo-box/combo-box.js +74 -2
  11. package/src/common/incremental-search.d.ts +1 -1
  12. package/src/common/incremental-search.js +50 -7
  13. package/src/common/interface.d.ts +2 -0
  14. package/src/common/virtual-scroll.js +22 -1
  15. package/src/drop-down-base/drop-down-base.d.ts +23 -3
  16. package/src/drop-down-base/drop-down-base.js +154 -40
  17. package/src/drop-down-list/drop-down-list.d.ts +10 -3
  18. package/src/drop-down-list/drop-down-list.js +305 -41
  19. package/src/drop-down-tree/drop-down-tree.js +24 -20
  20. package/src/list-box/list-box.js +8 -1
  21. package/src/mention/mention.js +5 -1
  22. package/src/multi-select/checkbox-selection.js +4 -1
  23. package/src/multi-select/multi-select.js +4 -2
  24. package/styles/auto-complete/_bds-definition.scss +2 -0
  25. package/styles/bootstrap-dark.css +16 -9
  26. package/styles/bootstrap.css +16 -9
  27. package/styles/bootstrap4.css +11 -9
  28. package/styles/bootstrap5-dark.css +11 -9
  29. package/styles/bootstrap5.css +11 -9
  30. package/styles/combo-box/_bds-definition.scss +2 -0
  31. package/styles/drop-down-base/_bds-definition.scss +134 -0
  32. package/styles/drop-down-base/_layout.scss +0 -8
  33. package/styles/drop-down-base/bootstrap-dark.css +0 -8
  34. package/styles/drop-down-base/bootstrap.css +0 -8
  35. package/styles/drop-down-base/bootstrap4.css +0 -8
  36. package/styles/drop-down-base/bootstrap5-dark.css +0 -8
  37. package/styles/drop-down-base/bootstrap5.css +0 -8
  38. package/styles/drop-down-base/fabric-dark.css +0 -8
  39. package/styles/drop-down-base/fabric.css +0 -8
  40. package/styles/drop-down-base/fluent-dark.css +0 -8
  41. package/styles/drop-down-base/fluent.css +0 -8
  42. package/styles/drop-down-base/highcontrast-light.css +0 -8
  43. package/styles/drop-down-base/highcontrast.css +0 -8
  44. package/styles/drop-down-base/material-dark.css +0 -8
  45. package/styles/drop-down-base/material.css +0 -8
  46. package/styles/drop-down-base/material3-dark.css +0 -8
  47. package/styles/drop-down-base/material3.css +0 -8
  48. package/styles/drop-down-base/tailwind-dark.css +0 -8
  49. package/styles/drop-down-base/tailwind.css +0 -8
  50. package/styles/drop-down-list/_bds-definition.scss +134 -0
  51. package/styles/drop-down-list/_layout.scss +5 -0
  52. package/styles/drop-down-list/bootstrap-dark.css +5 -0
  53. package/styles/drop-down-list/bootstrap.css +5 -0
  54. package/styles/drop-down-list/bootstrap4.css +5 -0
  55. package/styles/drop-down-list/bootstrap5-dark.css +5 -0
  56. package/styles/drop-down-list/bootstrap5.css +5 -0
  57. package/styles/drop-down-list/fabric-dark.css +5 -0
  58. package/styles/drop-down-list/fabric.css +5 -0
  59. package/styles/drop-down-list/fluent-dark.css +5 -0
  60. package/styles/drop-down-list/fluent.css +5 -0
  61. package/styles/drop-down-list/highcontrast-light.css +5 -0
  62. package/styles/drop-down-list/highcontrast.css +5 -0
  63. package/styles/drop-down-list/icons/_bds.scss +14 -0
  64. package/styles/drop-down-list/material-dark.css +5 -0
  65. package/styles/drop-down-list/material.css +5 -0
  66. package/styles/drop-down-list/material3-dark.css +5 -0
  67. package/styles/drop-down-list/material3.css +5 -0
  68. package/styles/drop-down-list/tailwind-dark.css +5 -0
  69. package/styles/drop-down-list/tailwind.css +5 -0
  70. package/styles/drop-down-tree/_bds-definition.scss +61 -0
  71. package/styles/drop-down-tree/_layout.scss +5 -0
  72. package/styles/drop-down-tree/bootstrap-dark.css +4 -0
  73. package/styles/drop-down-tree/bootstrap.css +4 -0
  74. package/styles/drop-down-tree/bootstrap4.css +4 -0
  75. package/styles/drop-down-tree/bootstrap5-dark.css +4 -0
  76. package/styles/drop-down-tree/bootstrap5.css +4 -0
  77. package/styles/drop-down-tree/fabric-dark.css +4 -0
  78. package/styles/drop-down-tree/fabric.css +4 -0
  79. package/styles/drop-down-tree/fluent-dark.css +4 -0
  80. package/styles/drop-down-tree/fluent.css +4 -0
  81. package/styles/drop-down-tree/highcontrast-light.css +4 -0
  82. package/styles/drop-down-tree/highcontrast.css +4 -0
  83. package/styles/drop-down-tree/icons/_bds.scss +11 -0
  84. package/styles/drop-down-tree/material-dark.css +4 -0
  85. package/styles/drop-down-tree/material.css +4 -0
  86. package/styles/drop-down-tree/material3-dark.css +4 -0
  87. package/styles/drop-down-tree/material3.css +4 -0
  88. package/styles/drop-down-tree/tailwind-dark.css +4 -0
  89. package/styles/drop-down-tree/tailwind.css +4 -0
  90. package/styles/fabric-dark.css +12 -9
  91. package/styles/fabric.css +12 -9
  92. package/styles/fluent-dark.css +16 -9
  93. package/styles/fluent.css +16 -9
  94. package/styles/highcontrast-light.css +12 -9
  95. package/styles/highcontrast.css +12 -9
  96. package/styles/list-box/_bds-definition.scss +136 -0
  97. package/styles/list-box/icons/_bds.scss +25 -0
  98. package/styles/material-dark.css +11 -9
  99. package/styles/material.css +11 -9
  100. package/styles/material3-dark.css +11 -9
  101. package/styles/material3.css +11 -9
  102. package/styles/mention/_bds-definition.scss +1 -0
  103. package/styles/multi-select/_bds-definition.scss +235 -0
  104. package/styles/multi-select/_bootstrap-dark-definition.scss +4 -0
  105. package/styles/multi-select/_bootstrap-definition.scss +4 -0
  106. package/styles/multi-select/_fluent-definition.scss +5 -0
  107. package/styles/multi-select/_layout.scss +8 -1
  108. package/styles/multi-select/bootstrap-dark.css +7 -1
  109. package/styles/multi-select/bootstrap.css +7 -1
  110. package/styles/multi-select/bootstrap4.css +2 -1
  111. package/styles/multi-select/bootstrap5-dark.css +2 -1
  112. package/styles/multi-select/bootstrap5.css +2 -1
  113. package/styles/multi-select/fabric-dark.css +3 -1
  114. package/styles/multi-select/fabric.css +3 -1
  115. package/styles/multi-select/fluent-dark.css +7 -1
  116. package/styles/multi-select/fluent.css +7 -1
  117. package/styles/multi-select/highcontrast-light.css +3 -1
  118. package/styles/multi-select/highcontrast.css +3 -1
  119. package/styles/multi-select/icons/_bds.scss +26 -0
  120. package/styles/multi-select/material-dark.css +2 -1
  121. package/styles/multi-select/material.css +2 -1
  122. package/styles/multi-select/material3-dark.css +2 -1
  123. package/styles/multi-select/material3.css +2 -1
  124. package/styles/multi-select/tailwind-dark.css +2 -1
  125. package/styles/multi-select/tailwind.css +2 -1
  126. package/styles/tailwind-dark.css +11 -9
  127. package/styles/tailwind.css +11 -9
@@ -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,12 +1066,42 @@ 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
  }
1007
- this.isRequesting = false;
1008
1105
  this.dataCount = e.count;
1009
1106
  this.totalItemCount = e.count;
1010
1107
  ulElement = this.renderItems(listItems, fields);
@@ -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(() => {
@@ -1109,6 +1233,7 @@ let DropDownBase = class DropDownBase extends Component {
1109
1233
  const listItems = [];
1110
1234
  this.onActionComplete(this.renderItems(listItems, fields), listItems);
1111
1235
  this.isRequested = false;
1236
+ this.isRequesting = false;
1112
1237
  this.hideSpinner();
1113
1238
  }
1114
1239
  showSpinner() {
@@ -1141,7 +1266,9 @@ let DropDownBase = class DropDownBase extends Component {
1141
1266
  if (this.isReact) {
1142
1267
  this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);
1143
1268
  }
1144
- this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
1269
+ if (!this.isVirtualizationEnabled) {
1270
+ this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
1271
+ }
1145
1272
  if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
1146
1273
  for (let i = 0; i < ulElement.childElementCount; i++) {
1147
1274
  if (ulElement.children[i].classList.contains('e-list-group-item')) {
@@ -1282,25 +1409,67 @@ let DropDownBase = class DropDownBase extends Component {
1282
1409
  this.scrollStop(e);
1283
1410
  }
1284
1411
  }
1285
- scrollStop(e) {
1412
+ scrollStop(e, isDownkey) {
1286
1413
  const target = !isNullOrUndefined(e) ? e.target : this.list;
1287
1414
  const liHeight = parseInt(getComputedStyle(this.getValidLi(), null).getPropertyValue('height'), 10);
1288
1415
  const topIndex = Math.round(target.scrollTop / liHeight);
1289
1416
  const liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
1417
+ let virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
1418
+ let count = 0;
1419
+ let isCount = false;
1290
1420
  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;
1421
+ const index = this.isVirtualizationEnabled ? i + virtualListCount : i;
1422
+ if (this.isVirtualizationEnabled) {
1423
+ const groupListLength = this.list.querySelectorAll('.e-list-group-item').length;
1424
+ let loadedGroupList = 0;
1425
+ if (isCount) {
1426
+ count++;
1427
+ }
1428
+ if (this.updateGroupHeader(index, liCollections, target)) {
1429
+ loadedGroupList++;
1430
+ if (count >= this.getPageCount()) {
1431
+ break;
1432
+ }
1433
+ if (groupListLength <= loadedGroupList) {
1434
+ break;
1435
+ }
1436
+ }
1437
+ if (isDownkey) {
1438
+ 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')) {
1439
+ count++;
1440
+ isCount = true;
1441
+ }
1442
+ }
1297
1443
  }
1298
1444
  else {
1299
- this.fixedHeaderElement.style.display = 'none';
1300
- this.fixedHeaderElement.style.top = 'none';
1445
+ if (this.updateGroupHeader(index, liCollections, target)) {
1446
+ break;
1447
+ }
1301
1448
  }
1302
1449
  }
1303
1450
  }
1451
+ getPageCount(returnExactCount) {
1452
+ const liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
1453
+ getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
1454
+ let pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
1455
+ return returnExactCount ? pageCount : Math.round(pageCount);
1456
+ }
1457
+ updateGroupHeader(index, liCollections, target) {
1458
+ if (!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.group)) {
1459
+ this.updateGroupFixedHeader(liCollections[index], target);
1460
+ return true;
1461
+ }
1462
+ else {
1463
+ this.fixedHeaderElement.style.display = 'none';
1464
+ this.fixedHeaderElement.style.top = 'none';
1465
+ return false;
1466
+ }
1467
+ }
1468
+ updateGroupFixedHeader(element, target) {
1469
+ this.fixedHeaderElement.innerHTML = element.innerHTML;
1470
+ this.fixedHeaderElement.style.top = target.scrollTop + 'px';
1471
+ this.fixedHeaderElement.style.display = 'block';
1472
+ }
1304
1473
  getValidLi() {
1305
1474
  return this.liCollections[0];
1306
1475
  }
@@ -1334,45 +1503,54 @@ let DropDownBase = class DropDownBase extends Component {
1334
1503
  var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
1335
1504
  if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
1336
1505
  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);
1506
+ this.updateListElements(listData);
1341
1507
  }
1342
1508
  else if ((!virtualUlElement)) {
1343
1509
  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);
1510
+ this.createVirtualContent();
1511
+ this.list.querySelector('.e-virtual-ddl-content').appendChild(ulElement);
1512
+ this.updateListElements(listData);
1349
1513
  }
1350
1514
  }
1351
1515
  }
1352
1516
  else {
1353
1517
  ulElement = this.createListItems(listData, fields);
1518
+ if (this.isIncrementalRequest) {
1519
+ this.incrementalLiCollections = ulElement.querySelectorAll('.' + dropDownBaseClasses.li);
1520
+ this.incrementalUlElement = ulElement;
1521
+ this.incrementalListData = listData;
1522
+ return ulElement;
1523
+ }
1354
1524
  if (this.isVirtualizationEnabled) {
1355
1525
  var oldUlElement = this.list.querySelector('.e-list-parent');
1356
1526
  var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
1357
1527
  if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
1358
1528
  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);
1529
+ this.updateListElements(listData);
1363
1530
  }
1364
1531
  else if ((!virtualUlElement)) {
1365
1532
  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);
1533
+ this.createVirtualContent();
1534
+ this.list.querySelector('.e-virtual-ddl-content').appendChild(ulElement);
1535
+ this.updateListElements(listData);
1371
1536
  }
1372
1537
  }
1373
1538
  }
1374
1539
  return ulElement;
1375
1540
  }
1541
+ createVirtualContent() {
1542
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
1543
+ this.list.appendChild(this.createElement('div', {
1544
+ className: 'e-virtual-ddl-content',
1545
+ }));
1546
+ }
1547
+ }
1548
+ updateListElements(listData) {
1549
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1550
+ this.ulElement = this.list.querySelector('ul');
1551
+ this.listData = listData;
1552
+ this.postRender(this.list, listData, this.bindEvent);
1553
+ }
1376
1554
  templateListItem(dataSource, fields) {
1377
1555
  const option = this.listOption(dataSource, fields);
1378
1556
  option.templateID = this.itemTemplateId;
@@ -1444,11 +1622,11 @@ let DropDownBase = class DropDownBase extends Component {
1444
1622
  * @param {string | number | boolean} value - Specifies given value.
1445
1623
  * @returns {number} Returns the index of the item.
1446
1624
  */
1447
- getIndexByValueFilter(value) {
1625
+ getIndexByValue(value) {
1448
1626
  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()) {
1627
+ const listItems = this.getItems();
1628
+ for (let i = 0; i < listItems.length; i++) {
1629
+ if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
1452
1630
  index = i;
1453
1631
  break;
1454
1632
  }
@@ -1461,11 +1639,11 @@ let DropDownBase = class DropDownBase extends Component {
1461
1639
  * @param {string | number | boolean} value - Specifies given value.
1462
1640
  * @returns {number} Returns the index of the item.
1463
1641
  */
1464
- getIndexByValue(value) {
1642
+ getIndexByValueFilter(value) {
1465
1643
  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()) {
1644
+ const listItems = this.renderItems(this.selectData, this.fields);
1645
+ for (let i = 0; i < listItems.children.length; i++) {
1646
+ if (!isNullOrUndefined(value) && listItems.children[i].getAttribute('data-value') === value.toString()) {
1469
1647
  index = i;
1470
1648
  break;
1471
1649
  }
@@ -2012,7 +2190,6 @@ let DropDownList = class DropDownList extends DropDownBase {
2012
2190
  this.isListSearched = false;
2013
2191
  this.preventChange = false;
2014
2192
  this.isAngular = false;
2015
- this.itemCount = 10;
2016
2193
  this.virtualListHeight = 0;
2017
2194
  this.isVirtualScrolling = false;
2018
2195
  this.isPreventScrollAction = false;
@@ -2027,6 +2204,10 @@ let DropDownList = class DropDownList extends DropDownBase {
2027
2204
  this.pageCount = 0;
2028
2205
  this.isPreventKeyAction = false;
2029
2206
  this.generatedDataObject = {};
2207
+ this.incrementalQueryString = '';
2208
+ this.incrementalEndIndex = 0;
2209
+ this.incrementalStartIndex = 0;
2210
+ this.incrementalPreQueryString = '';
2030
2211
  this.isTouched = false;
2031
2212
  this.virtualListInfo = {
2032
2213
  currentPageNumber: null,
@@ -2135,8 +2316,10 @@ let DropDownList = class DropDownList extends DropDownBase {
2135
2316
  }
2136
2317
  renderList(e, isEmptyData) {
2137
2318
  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;
2319
+ if (!(this.dataSource instanceof DataManager)) {
2320
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2321
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2322
+ }
2140
2323
  this.unWireListEvents();
2141
2324
  this.wireListEvents();
2142
2325
  }
@@ -2598,12 +2781,136 @@ let DropDownList = class DropDownList extends DropDownBase {
2598
2781
  isValidLI(li) {
2599
2782
  return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
2600
2783
  }
2784
+ updateIncrementalInfo(startIndex, endIndex) {
2785
+ this.viewPortInfo.startIndex = startIndex;
2786
+ this.viewPortInfo.endIndex = endIndex;
2787
+ this.updateVirtualItemIndex();
2788
+ this.isIncrementalRequest = true;
2789
+ this.resetList(this.dataSource, this.fields, this.query);
2790
+ this.isIncrementalRequest = false;
2791
+ }
2792
+ updateIncrementalView(startIndex, endIndex) {
2793
+ this.viewPortInfo.startIndex = startIndex;
2794
+ this.viewPortInfo.endIndex = endIndex;
2795
+ this.updateVirtualItemIndex();
2796
+ this.resetList(this.dataSource, this.fields, this.query);
2797
+ this.UpdateSkeleton();
2798
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
2799
+ this.ulElement = this.list.querySelector('ul');
2800
+ }
2801
+ updateIncrementalItemIndex(startIndex, endIndex) {
2802
+ this.incrementalStartIndex = startIndex;
2803
+ this.incrementalEndIndex = endIndex;
2804
+ }
2601
2805
  incrementalSearch(e) {
2602
2806
  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();
2807
+ if (this.enableVirtualization) {
2808
+ var updatingincrementalindex = false;
2809
+ var queryStringUpdated = false;
2810
+ var activeElement = this.ulElement.getElementsByClassName('e-active')[0];
2811
+ var currentValue = activeElement ? activeElement.textContent : null;
2812
+ if (this.incrementalQueryString == '') {
2813
+ this.incrementalQueryString = String.fromCharCode(e.charCode);
2814
+ this.incrementalPreQueryString = this.incrementalQueryString;
2815
+ }
2816
+ else if (String.fromCharCode(e.charCode).toLocaleLowerCase() == this.incrementalPreQueryString.toLocaleLowerCase()) {
2817
+ queryStringUpdated = true;
2818
+ }
2819
+ else {
2820
+ this.incrementalQueryString = String.fromCharCode(e.charCode);
2821
+ }
2822
+ if ((this.viewPortInfo.endIndex >= this.incrementalEndIndex && this.incrementalEndIndex <= this.totalItemCount) || this.incrementalEndIndex == 0) {
2823
+ updatingincrementalindex = true;
2824
+ this.incrementalStartIndex = this.incrementalEndIndex;
2825
+ if (this.incrementalEndIndex == 0) {
2826
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
2827
+ }
2828
+ else {
2829
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
2830
+ }
2831
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
2832
+ updatingincrementalindex = true;
2833
+ }
2834
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
2835
+ this.updateIncrementalView(0, this.itemCount);
2836
+ }
2837
+ let li = incrementalSearch(e.charCode, this.incrementalLiCollections, this.activeIndex, true, this.element.id, queryStringUpdated, currentValue, true);
2838
+ while (isNullOrUndefined(li) && this.incrementalEndIndex < this.totalItemCount) {
2839
+ this.updateIncrementalItemIndex(this.incrementalEndIndex, this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100);
2840
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
2841
+ updatingincrementalindex = true;
2842
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
2843
+ this.updateIncrementalView(0, this.itemCount);
2844
+ }
2845
+ li = incrementalSearch(e.charCode, this.incrementalLiCollections, 0, true, this.element.id, queryStringUpdated, currentValue, true, true);
2846
+ if (!isNullOrUndefined(li)) {
2847
+ break;
2848
+ }
2849
+ if (isNullOrUndefined(li) && this.incrementalEndIndex >= this.totalItemCount) {
2850
+ this.updateIncrementalItemIndex(0, 100 > this.totalItemCount ? this.totalItemCount : 100);
2851
+ break;
2852
+ }
2853
+ }
2854
+ if (isNullOrUndefined(li) && this.incrementalEndIndex >= this.totalItemCount) {
2855
+ this.updateIncrementalItemIndex(0, 100 > this.totalItemCount ? this.totalItemCount : 100);
2856
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
2857
+ updatingincrementalindex = true;
2858
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
2859
+ this.updateIncrementalView(0, this.itemCount);
2860
+ }
2861
+ li = incrementalSearch(e.charCode, this.incrementalLiCollections, 0, true, this.element.id, queryStringUpdated, currentValue, true, true);
2862
+ }
2863
+ var index = li && this.getIndexByValue(li.getAttribute('data-value'));
2864
+ if (!index) {
2865
+ for (var i = 0; i < this.incrementalLiCollections.length; i++) {
2866
+ if (!isNullOrUndefined(li) && !isNullOrUndefined(li.getAttribute('data-value')) && this.incrementalLiCollections[i].getAttribute('data-value') === li.getAttribute('data-value').toString()) {
2867
+ index = i;
2868
+ index = this.incrementalStartIndex + index;
2869
+ break;
2870
+ }
2871
+ }
2872
+ }
2873
+ else {
2874
+ index = index - this.skeletonCount;
2875
+ }
2876
+ if (index) {
2877
+ if ((!(this.viewPortInfo.startIndex >= index)) || (!(index >= this.viewPortInfo.endIndex))) {
2878
+ let startIndex = index - ((this.itemCount / 2) - 2) > 0 ? index - ((this.itemCount / 2) - 2) : 0;
2879
+ let endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
2880
+ this.updateIncrementalView(startIndex, endIndex);
2881
+ }
2882
+ }
2883
+ if (!isNullOrUndefined(li)) {
2884
+ let index = this.getIndexByValue(li.getAttribute('data-value')) - this.skeletonCount;
2885
+ if (index > this.itemCount / 2) {
2886
+ let startIndex = this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) < this.totalItemCount ? this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) : this.totalItemCount;
2887
+ let endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
2888
+ this.updateIncrementalView(startIndex, endIndex);
2889
+ }
2890
+ li = this.getElementByValue(li.getAttribute('data-value'));
2891
+ this.setSelection(li, e);
2892
+ this.setScrollPosition();
2893
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2894
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
2895
+ if (this.enableVirtualization && !this.fields.groupBy) {
2896
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
2897
+ this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
2898
+ }
2899
+ this.incrementalPreQueryString = this.incrementalQueryString;
2900
+ }
2901
+ else {
2902
+ this.updateIncrementalView(0, this.itemCount);
2903
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2904
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
2905
+ this.list.scrollTop = 0;
2906
+ }
2907
+ }
2908
+ else {
2909
+ const li = incrementalSearch(e.charCode, this.liCollections, this.activeIndex, true, this.element.id);
2910
+ if (!isNullOrUndefined(li)) {
2911
+ this.setSelection(li, e);
2912
+ this.setScrollPosition();
2913
+ }
2607
2914
  }
2608
2915
  }
2609
2916
  }
@@ -2659,6 +2966,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2659
2966
  if (isNullOrUndefined(this.list) && !this.isRequested && !isTabAction && e.action !== 'escape') {
2660
2967
  this.searchKeyEvent = e;
2661
2968
  this.renderList(e);
2969
+ this.UpdateSkeleton();
2970
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
2971
+ this.ulElement = this.list.querySelector('ul');
2662
2972
  }
2663
2973
  if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
2664
2974
  isNavigation && this.liCollections.length === 0) || this.isRequested) {
@@ -2736,7 +3046,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2736
3046
  const focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
2737
3047
  if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
2738
3048
  this.setSelection(focusEle, e);
2739
- if (this.enableVirtualization) {
3049
+ if (this.enableVirtualization && !this.fields.groupBy && this.getModuleName() !== 'combobox') {
2740
3050
  let selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
2741
3051
  this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
2742
3052
  }
@@ -2764,7 +3074,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2764
3074
  }
2765
3075
  else {
2766
3076
  if (this.getModuleName() === 'autocomplete') {
2767
- var value = this.selectedLI.dataset.value;
3077
+ var value = this.getFormattedValue(this.selectedLI.getAttribute('data-value'));
2768
3078
  nextItem = this.getElementByValue(value);
2769
3079
  }
2770
3080
  else {
@@ -2776,6 +3086,38 @@ let DropDownList = class DropDownList extends DropDownBase {
2776
3086
  if (!isNullOrUndefined(nextItem)) {
2777
3087
  this.setSelection(nextItem, e);
2778
3088
  }
3089
+ else if (this.enableVirtualization && !this.isPopupOpen && this.getModuleName() !== 'autocomplete' && ((this.viewPortInfo.endIndex !== this.totalItemCount && e.action === 'down') || (this.viewPortInfo.startIndex !== 0 && e.action === 'up'))) {
3090
+ if (e.action === 'down') {
3091
+ this.viewPortInfo.startIndex = (this.viewPortInfo.startIndex + this.itemCount) < (this.totalItemCount - this.itemCount) ? this.viewPortInfo.startIndex + this.itemCount : this.totalItemCount - this.itemCount;
3092
+ this.viewPortInfo.endIndex = this.viewPortInfo.startIndex + this.itemCount;
3093
+ this.updateVirtualItemIndex();
3094
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? true : this.isCustomFilter;
3095
+ this.resetList(this.dataSource, this.fields, this.query);
3096
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? false : this.isCustomFilter;
3097
+ const value = this.liCollections[0].getAttribute('data-value') !== "null" ? this.getFormattedValue(this.liCollections[0].getAttribute('data-value')) : null;
3098
+ const selectedData = this.getDataByValue(value);
3099
+ if (selectedData) {
3100
+ this.itemData = selectedData;
3101
+ }
3102
+ }
3103
+ else if (e.action === 'up') {
3104
+ this.viewPortInfo.startIndex = (this.viewPortInfo.startIndex - this.itemCount) > 0 ? this.viewPortInfo.startIndex - this.itemCount : 0;
3105
+ this.viewPortInfo.endIndex = this.viewPortInfo.startIndex + this.itemCount;
3106
+ this.updateVirtualItemIndex();
3107
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? true : this.isCustomFilter;
3108
+ this.resetList(this.dataSource, this.fields, this.query);
3109
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? false : this.isCustomFilter;
3110
+ const value = this.liCollections[this.liCollections.length - 1].getAttribute('data-value') !== "null" ? this.getFormattedValue(this.liCollections[this.liCollections.length - 1].getAttribute('data-value')) : null;
3111
+ const selectedData = this.getDataByValue(value);
3112
+ if (selectedData) {
3113
+ this.itemData = selectedData;
3114
+ }
3115
+ }
3116
+ this.UpdateSkeleton();
3117
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
3118
+ this.ulElement = this.list.querySelector('ul');
3119
+ this.handleVirtualKeyboardActions(e, this.pageCount);
3120
+ }
2779
3121
  }
2780
3122
  if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
2781
3123
  let value = this.getItemData().value;
@@ -2786,16 +3128,33 @@ let DropDownList = class DropDownList extends DropDownBase {
2786
3128
  }
2787
3129
  e.preventDefault();
2788
3130
  }
3131
+ updateVirtualItemIndex() {
3132
+ this.virtualItemStartIndex = this.viewPortInfo.startIndex;
3133
+ this.virtualItemEndIndex = this.viewPortInfo.endIndex;
3134
+ this.virtualListInfo = this.viewPortInfo;
3135
+ }
2789
3136
  updateHomeEndAction(e, isVirtualKeyAction) {
2790
3137
  if (this.getModuleName() === 'dropdownlist') {
2791
3138
  let findLi = 0;
2792
3139
  if (e.action === 'home') {
2793
3140
  findLi = 0;
2794
- if (this.enableVirtualization) {
3141
+ if (this.enableVirtualization && this.isPopupOpen) {
2795
3142
  findLi = this.skeletonCount;
2796
3143
  }
3144
+ else if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.startIndex !== 0) {
3145
+ this.viewPortInfo.startIndex = 0;
3146
+ this.viewPortInfo.endIndex = this.itemCount;
3147
+ this.updateVirtualItemIndex();
3148
+ this.resetList(this.dataSource, this.fields, this.query);
3149
+ }
2797
3150
  }
2798
3151
  else {
3152
+ if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.endIndex !== this.totalItemCount) {
3153
+ this.viewPortInfo.startIndex = this.totalItemCount - this.itemCount;
3154
+ this.viewPortInfo.endIndex = this.totalItemCount;
3155
+ this.updateVirtualItemIndex();
3156
+ this.resetList(this.dataSource, this.fields, this.query);
3157
+ }
2799
3158
  findLi = this.getItems().length - 1;
2800
3159
  }
2801
3160
  e.preventDefault();
@@ -2891,12 +3250,6 @@ let DropDownList = class DropDownList extends DropDownBase {
2891
3250
  isSelectFocusItem(element) {
2892
3251
  return !isNullOrUndefined(element);
2893
3252
  }
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
3253
  pageUpSelection(steps, event, isVirtualKeyAction) {
2901
3254
  let previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
2902
3255
  if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
@@ -3157,7 +3510,10 @@ let DropDownList = class DropDownList extends DropDownBase {
3157
3510
  .then((e) => {
3158
3511
  if (e.result.length > 0) {
3159
3512
  this.itemData = e.result[0];
3160
- this.setProperties({ 'text': e.result[0].text, 'value': e.result[0].value }, true);
3513
+ const dataItem = this.getItemData();
3514
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
3515
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
3516
+ }
3161
3517
  }
3162
3518
  });
3163
3519
  }
@@ -3165,7 +3521,10 @@ let DropDownList = class DropDownList extends DropDownBase {
3165
3521
  const getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
3166
3522
  if (getItem && getItem.length > 0) {
3167
3523
  this.itemData = getItem[0];
3168
- this.setProperties({ 'text': getItem[0].text, 'value': getItem[0].value }, true);
3524
+ const dataItem = this.getItemData();
3525
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
3526
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
3527
+ }
3169
3528
  }
3170
3529
  }
3171
3530
  }
@@ -3427,7 +3786,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3427
3786
  this.typedString = this.filterInput.value;
3428
3787
  this.preventAutoFill = false;
3429
3788
  this.searchLists(e);
3430
- if (this.enableVirtualization) {
3789
+ if ((this.enableVirtualization && this.getModuleName() !== 'autocomplete') || (this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
3431
3790
  this.getFilteringSkeletonCount();
3432
3791
  }
3433
3792
  break;
@@ -3442,19 +3801,28 @@ let DropDownList = class DropDownList extends DropDownBase {
3442
3801
  const currentSkeletonCount = this.skeletonCount;
3443
3802
  this.getSkeletonCount(true);
3444
3803
  this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
3804
+ let skeletonUpdated = true;
3805
+ if (this.getModuleName() === 'autocomplete' && (this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2))) {
3806
+ this.skeletonCount = 0;
3807
+ skeletonUpdated = false;
3808
+ }
3445
3809
  if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
3446
3810
  const isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
3447
- if (currentSkeletonCount !== this.skeletonCount) {
3811
+ if (currentSkeletonCount !== this.skeletonCount && skeletonUpdated) {
3448
3812
  this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
3449
3813
  }
3450
3814
  else {
3451
3815
  this.UpdateSkeleton();
3452
3816
  }
3453
3817
  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();
3818
+ if ((this.list.getElementsByClassName('e-virtual-ddl').length > 0)) {
3819
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3820
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
3821
+ }
3822
+ if (this.list.getElementsByClassName('e-virtual-ddl-content').length > 0) {
3823
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3824
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3825
+ }
3458
3826
  }
3459
3827
  }
3460
3828
  getSkeletonCount(retainSkeleton) {
@@ -3507,12 +3875,26 @@ let DropDownList = class DropDownList extends DropDownBase {
3507
3875
  else {
3508
3876
  filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
3509
3877
  }
3510
- if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0)) {
3878
+ if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
3511
3879
  var takeValue = this.getTakeValue();
3512
- if (this.allowFiltering) {
3880
+ var alreadySkipAdded = false;
3881
+ if (filterQuery) {
3882
+ for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
3883
+ if (filterQuery.queries[queryElements].fn === 'onSkip') {
3884
+ alreadySkipAdded = true;
3885
+ break;
3886
+ }
3887
+ }
3888
+ }
3889
+ if (this.allowFiltering || !this.isPopupOpen || !alreadySkipAdded) {
3513
3890
  filterQuery.skip(this.virtualItemStartIndex);
3514
3891
  }
3515
- filterQuery.take(takeValue);
3892
+ if (this.isIncrementalRequest) {
3893
+ filterQuery.take(this.incrementalEndIndex);
3894
+ }
3895
+ else {
3896
+ filterQuery.take(takeValue);
3897
+ }
3516
3898
  filterQuery.requiresCount();
3517
3899
  }
3518
3900
  return filterQuery;
@@ -3753,7 +4135,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3753
4135
  }
3754
4136
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3755
4137
  onActionComplete(ulElement, list, e, isUpdated) {
3756
- if (this.dataSource instanceof DataManager && !isNullOrUndefined(e)) {
4138
+ if (this.dataSource instanceof DataManager && !isNullOrUndefined(e) && !this.virtualGroupDataSource) {
3757
4139
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3758
4140
  this.totalItemCount = e.count;
3759
4141
  }
@@ -3780,7 +4162,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3780
4162
  this.list.scrollTop = 0;
3781
4163
  }
3782
4164
  if (!isNullOrUndefined(ulElement)) {
3783
- attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
4165
+ attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'listbox' });
3784
4166
  }
3785
4167
  if (this.initRemoteRender) {
3786
4168
  this.initial = true;
@@ -3996,6 +4378,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3996
4378
  GetVirtualTrackHeight() {
3997
4379
  const height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
3998
4380
  const heightDimension = `height: ${height - this.itemCount * this.listItemHeight}px;`;
4381
+ if (this.getModuleName() === 'autocomplete' && this.skeletonCount === 0) {
4382
+ return "height: 0px;";
4383
+ }
3999
4384
  return heightDimension;
4000
4385
  }
4001
4386
  renderPopup(e) {
@@ -4009,6 +4394,8 @@ let DropDownList = class DropDownList extends DropDownBase {
4009
4394
  const popupEle = this.createElement('div', {
4010
4395
  id: this.element.id + '_popup', className: 'e-ddl e-popup ' + (this.cssClass !== null ? this.cssClass : '')
4011
4396
  });
4397
+ popupEle.setAttribute('aria-label', this.element.id);
4398
+ popupEle.setAttribute('role', 'dialog');
4012
4399
  const searchBox = this.setSearchBox(popupEle);
4013
4400
  this.listHeight = formatUnit(this.popupHeight);
4014
4401
  if (this.headerTemplate) {
@@ -4093,9 +4480,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4093
4480
  parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10));
4094
4481
  }
4095
4482
  }
4096
- this.getFocusElement();
4097
4483
  this.createPopup(popupEle, offsetValue, left);
4098
4484
  this.popupContentElement = this.popupObj.element.querySelector('.e-content');
4485
+ this.getFocusElement();
4099
4486
  this.checkCollision(popupEle);
4100
4487
  if (Browser.isDevice) {
4101
4488
  this.popupObj.element.classList.add(dropDownListClasses.device);
@@ -4134,7 +4521,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4134
4521
  enable: this.enableVirtualization,
4135
4522
  });
4136
4523
  setTimeout(() => {
4137
- if (this.value) {
4524
+ if (this.value || this.list.querySelector('.e-active')) {
4138
4525
  this.updateSelectionList();
4139
4526
  if (this.selectedValueInfo && this.viewPortInfo && this.viewPortInfo.offsets.top) {
4140
4527
  this.list.scrollTop = this.viewPortInfo.offsets.top;
@@ -4145,8 +4532,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4145
4532
  }
4146
4533
  }, 5);
4147
4534
  }
4148
- attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_options' });
4535
+ attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_popup', 'aria-controls': this.element.id });
4149
4536
  this.inputElement.setAttribute('aria-expanded', 'true');
4537
+ this.inputElement.setAttribute('aria-controls', this.element.id);
4150
4538
  const inputParent = this.isFiltering() ? this.filterInput.parentElement : this.inputWrapper.container;
4151
4539
  addClass([inputParent], [dropDownListClasses.inputFocus]);
4152
4540
  const animModel = { name: 'FadeIn', duration: 100 };
@@ -4210,7 +4598,12 @@ let DropDownList = class DropDownList extends DropDownBase {
4210
4598
  this.destroyPopup();
4211
4599
  if (this.isFiltering() && this.actionCompleteData.list && this.actionCompleteData.list[0]) {
4212
4600
  this.isActive = true;
4213
- this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
4601
+ if (this.enableVirtualization) {
4602
+ this.onActionComplete(this.ulElement, this.listData, null, true);
4603
+ }
4604
+ else {
4605
+ this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
4606
+ }
4214
4607
  }
4215
4608
  },
4216
4609
  open: () => {
@@ -4379,6 +4772,11 @@ let DropDownList = class DropDownList extends DropDownBase {
4379
4772
 
4380
4773
  }
4381
4774
  this.isKeyBoardAction = isScrollerCHanged;
4775
+ if (this.enableVirtualization && this.fields.groupBy && this.fixedHeaderElement && (keyAction == "down")) {
4776
+ setTimeout(() => {
4777
+ this.scrollStop(null, true);
4778
+ }, 100);
4779
+ }
4382
4780
  }
4383
4781
  }
4384
4782
  scrollTop(keyAction = null) {
@@ -4581,7 +4979,15 @@ let DropDownList = class DropDownList extends DropDownBase {
4581
4979
  if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
4582
4980
  this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
4583
4981
  }
4584
- const dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
4982
+ let dataSourceCount;
4983
+ if (this.dataSource instanceof DataManager) {
4984
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4985
+ dataSourceCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
4986
+ }
4987
+ else {
4988
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4989
+ dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
4990
+ }
4585
4991
  if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
4586
4992
  this.updateInitialData();
4587
4993
  this.checkAndResetCache();
@@ -4604,8 +5010,14 @@ let DropDownList = class DropDownList extends DropDownBase {
4604
5010
  }
4605
5011
  this.previousStartIndex = 0;
4606
5012
  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;
5013
+ if (this.dataSource instanceof DataManager) {
5014
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5015
+ this.totalItemCount = this.dataCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
5016
+ }
5017
+ else {
5018
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5019
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
5020
+ }
4609
5021
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4610
5022
  if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
4611
5023
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -4715,6 +5127,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4715
5127
  }
4716
5128
  else if (this.getModuleName() === 'dropdownlist') {
4717
5129
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
5130
+ this.inputElement.setAttribute('aria-label', this.getModuleName());
5131
+ this.inputElement.setAttribute('aria-expanded', 'false');
5132
+ this.inputElement.setAttribute('aria-controls', this.element.id + '_popups');
4718
5133
  }
4719
5134
  attributes(this.targetElement(), this.getAriaAttributes());
4720
5135
  this.updateDataAttribute(this.htmlAttributes);
@@ -4979,6 +5394,14 @@ let DropDownList = class DropDownList extends DropDownBase {
4979
5394
  this.clearAll();
4980
5395
  break;
4981
5396
  }
5397
+ if (this.enableVirtualization) {
5398
+ this.updateValues();
5399
+ this.updateInputFields();
5400
+ this.notify("setCurrentViewDataAsync", {
5401
+ module: "VirtualScroll",
5402
+ });
5403
+ break;
5404
+ }
4982
5405
  if (!this.list) {
4983
5406
  if (this.dataSource instanceof DataManager) {
4984
5407
  this.initRemoteRender = true;
@@ -5022,6 +5445,15 @@ let DropDownList = class DropDownList extends DropDownBase {
5022
5445
  this.clearAll();
5023
5446
  break;
5024
5447
  }
5448
+ if (this.enableVirtualization) {
5449
+ this.updateValues();
5450
+ this.updateInputFields();
5451
+ this.notify("setCurrentViewDataAsync", {
5452
+ module: "VirtualScroll",
5453
+ });
5454
+ this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
5455
+ break;
5456
+ }
5025
5457
  this.notify('beforeValueChange', { newProp: newProp }); // gird component value type change
5026
5458
  if (!this.list) {
5027
5459
  if (this.dataSource instanceof DataManager) {
@@ -5165,6 +5597,12 @@ let DropDownList = class DropDownList extends DropDownBase {
5165
5597
  }
5166
5598
  };
5167
5599
  }
5600
+ updatePopupState() {
5601
+ if (this.beforePopupOpen) {
5602
+ this.beforePopupOpen = false;
5603
+ this.showPopup();
5604
+ }
5605
+ }
5168
5606
  setReadOnly() {
5169
5607
  if (this.readonly) {
5170
5608
  addClass([this.inputWrapper.container], ['e-readonly']);
@@ -5296,7 +5734,10 @@ let DropDownList = class DropDownList extends DropDownBase {
5296
5734
  }
5297
5735
  this.closePopup(0, e);
5298
5736
  const dataItem = this.getItemData();
5299
- const isSelectVal = !isNullOrUndefined(this.selectedLI);
5737
+ let isSelectVal = !isNullOrUndefined(this.selectedLI);
5738
+ if (isSelectVal && this.enableVirtualization && this.selectedLI.classList) {
5739
+ isSelectVal = this.selectedLI.classList.contains('e-active');
5740
+ }
5300
5741
  if (this.inputElement && this.inputElement.value.trim() === '' && !this.isInteracted && (this.isSelectCustom ||
5301
5742
  isSelectVal && this.inputElement.value !== dataItem.text)) {
5302
5743
  this.isSelectCustom = false;
@@ -5764,14 +6205,17 @@ let DropDownTree = class DropDownTree extends Component {
5764
6205
  render() {
5765
6206
  const isTree = select('#' + this.element.id + '_tree', document);
5766
6207
  if (isTree) {
5767
- const popupDiv = select('#' + this.element.id + '_popup', document);
6208
+ const popupDiv = select('#' + this.element.id + '_options', document);
5768
6209
  detach(popupDiv ? popupDiv : isTree.parentElement);
5769
6210
  }
5770
6211
  this.ensureAutoCheck();
5771
6212
  if (this.element.tagName === 'INPUT') {
5772
6213
  this.inputEle = this.element;
5773
6214
  if (isNullOrUndefined(this.inputEle.getAttribute('role'))) {
5774
- this.inputEle.setAttribute('role', 'textbox');
6215
+ this.inputEle.setAttribute('aria-expanded', 'false');
6216
+ this.inputEle.setAttribute('role', 'combobox');
6217
+ this.inputEle.setAttribute('aria-haspopup', 'tree');
6218
+ this.inputEle.setAttribute('aria-controls', this.element.id + "_options");
5775
6219
  }
5776
6220
  if (isNullOrUndefined(this.inputEle.getAttribute('type'))) {
5777
6221
  this.inputEle.setAttribute('type', 'text');
@@ -5937,8 +6381,12 @@ let DropDownTree = class DropDownTree extends Component {
5937
6381
  }
5938
6382
  this.treeObj.fields = this.getTreeFields(fields);
5939
6383
  this.treeObj.dataBind();
5940
- if (this.hasTemplate && this.portals) {
5941
- this.portals = [].concat(this.treeObj.portals);
6384
+ if (this.hasTemplate && this.portals && this.treeObj.portals) {
6385
+ for (let i = 0; i < this.treeObj.portals.length; i++) {
6386
+ if (this.portals.indexOf(this.treeObj.portals[i]) == -1) {
6387
+ this.portals.push(this.treeObj.portals[i]);
6388
+ }
6389
+ }
5942
6390
  if (this.isReact) {
5943
6391
  this.renderReactTemplates();
5944
6392
  }
@@ -6395,16 +6843,7 @@ let DropDownTree = class DropDownTree extends Component {
6395
6843
  }
6396
6844
  }
6397
6845
  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
- };
6846
+ return {};
6408
6847
  }
6409
6848
  updateOverFlowView() {
6410
6849
  this.overFlowWrapper.classList.remove(TOTAL_COUNT_WRAPPER);
@@ -6753,7 +7192,7 @@ let DropDownTree = class DropDownTree extends Component {
6753
7192
  }
6754
7193
  }
6755
7194
  else {
6756
- this.inputWrapper.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
7195
+ this.inputEle.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
6757
7196
  }
6758
7197
  }
6759
7198
  }
@@ -7005,8 +7444,10 @@ let DropDownTree = class DropDownTree extends Component {
7005
7444
  addClass([this.inputWrapper], [ICONANIMATION]);
7006
7445
  if (this.isFirstRender) {
7007
7446
  this.popupEle = this.createElement('div', {
7008
- id: this.element.id + '_popup', className: POPUP_CLASS + ' ' + (this.cssClass != null ? this.cssClass : '')
7447
+ id: this.element.id + '_options', className: POPUP_CLASS + ' ' + (this.cssClass != null ? this.cssClass : '')
7009
7448
  });
7449
+ this.popupEle.setAttribute('role', 'region');
7450
+ this.popupEle.setAttribute('aria-label', this.element.id);
7010
7451
  document.body.appendChild(this.popupEle);
7011
7452
  this.createPopup(this.popupEle);
7012
7453
  }
@@ -7042,7 +7483,7 @@ let DropDownTree = class DropDownTree extends Component {
7042
7483
  }
7043
7484
  }
7044
7485
  if (!isCancelled) {
7045
- attributes(this.inputWrapper, { 'aria-expanded': 'true' });
7486
+ attributes(this.inputEle, { 'aria-expanded': 'true' });
7046
7487
  this.popupObj.show(null, (this.zIndex === 1000) ? this.inputEle : null);
7047
7488
  removeClass([this.popupEle], DDTHIDEICON);
7048
7489
  this.updatePopupHeight();
@@ -7493,8 +7934,12 @@ let DropDownTree = class DropDownTree extends Component {
7493
7934
  }
7494
7935
  }
7495
7936
  onNodeExpanded(args) {
7496
- if (this.hasTemplate && this.portals) {
7497
- this.portals = [].concat(this.treeObj.portals);
7937
+ if (this.hasTemplate && this.portals && this.treeObj.portals) {
7938
+ for (let i = 0; i < this.treeObj.portals.length; i++) {
7939
+ if (this.portals.indexOf(this.treeObj.portals[i]) == -1) {
7940
+ this.portals.push(this.treeObj.portals[i]);
7941
+ }
7942
+ }
7498
7943
  /* eslint-enable */
7499
7944
  this.renderReactTemplates();
7500
7945
  }
@@ -8526,7 +8971,7 @@ let DropDownTree = class DropDownTree extends Component {
8526
8971
  if (this.popupEle) {
8527
8972
  addClass([this.popupEle], DDTHIDEICON);
8528
8973
  }
8529
- attributes(this.inputWrapper, { 'aria-expanded': 'false' });
8974
+ attributes(this.inputEle, { 'aria-expanded': 'false' });
8530
8975
  if (this.popupObj && this.isPopupOpen) {
8531
8976
  this.popupObj.hide();
8532
8977
  if (this.inputFocus) {
@@ -8932,7 +9377,7 @@ let ComboBox = class ComboBox extends DropDownList {
8932
9377
  if (this.isSelectCustom) {
8933
9378
  this.removeSelection();
8934
9379
  }
8935
- if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped) {
9380
+ if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped && !this.enableVirtualization) {
8936
9381
  setTimeout(() => {
8937
9382
  this.inlineSearch();
8938
9383
  });
@@ -8941,7 +9386,7 @@ let ComboBox = class ComboBox extends DropDownList {
8941
9386
  getFocusElement() {
8942
9387
  const dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
8943
9388
  const selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
8944
- const isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
9389
+ const isSelected = dataItem.text && dataItem.text.toString() === this.inputElement.value && !isNullOrUndefined(selected);
8945
9390
  if (isSelected) {
8946
9391
  return selected;
8947
9392
  }
@@ -8950,7 +9395,71 @@ let ComboBox = class ComboBox extends DropDownList {
8950
9395
  const inputValue = this.inputElement.value;
8951
9396
  const dataSource = this.sortedData;
8952
9397
  const type = this.typeOfData(dataSource).typeof;
8953
- const activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
9398
+ let activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
9399
+ if (this.enableVirtualization && inputValue !== '' && this.getModuleName() !== 'autocomplete' && this.isTyped && !this.allowFiltering) {
9400
+ var updatingincrementalindex = false;
9401
+ if ((this.viewPortInfo.endIndex >= this.incrementalEndIndex && this.incrementalEndIndex <= this.totalItemCount) || this.incrementalEndIndex == 0) {
9402
+ updatingincrementalindex = true;
9403
+ this.incrementalStartIndex = this.incrementalEndIndex;
9404
+ if (this.incrementalEndIndex == 0) {
9405
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
9406
+ }
9407
+ else {
9408
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
9409
+ }
9410
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
9411
+ updatingincrementalindex = true;
9412
+ }
9413
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
9414
+ this.updateIncrementalView(0, this.itemCount);
9415
+ }
9416
+ activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
9417
+ while (isNullOrUndefined(activeItem) && this.incrementalEndIndex < this.totalItemCount) {
9418
+ this.incrementalStartIndex = this.incrementalEndIndex;
9419
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
9420
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
9421
+ updatingincrementalindex = true;
9422
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
9423
+ this.updateIncrementalView(0, this.itemCount);
9424
+ }
9425
+ activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
9426
+ if (!isNullOrUndefined(activeItem)) {
9427
+ break;
9428
+ }
9429
+ if (isNullOrUndefined(activeItem) && this.incrementalEndIndex >= this.totalItemCount) {
9430
+ this.incrementalStartIndex = 0;
9431
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
9432
+ break;
9433
+ }
9434
+ }
9435
+ if (activeItem.index) {
9436
+ if ((!(this.viewPortInfo.startIndex >= activeItem.index)) || (!(activeItem.index >= this.viewPortInfo.endIndex))) {
9437
+ var startIndex = activeItem.index - ((this.itemCount / 2) - 2) > 0 ? activeItem.index - ((this.itemCount / 2) - 2) : 0;
9438
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
9439
+ if (startIndex != this.viewPortInfo.startIndex) {
9440
+ this.updateIncrementalView(startIndex, endIndex);
9441
+ }
9442
+ }
9443
+ }
9444
+ if (!isNullOrUndefined(activeItem.item)) {
9445
+ var index_1 = this.getIndexByValue(activeItem.item.getAttribute('data-value')) - this.skeletonCount;
9446
+ if (index_1 > this.itemCount / 2) {
9447
+ var startIndex = this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) < this.totalItemCount ? this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) : this.totalItemCount;
9448
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
9449
+ this.updateIncrementalView(startIndex, endIndex);
9450
+ }
9451
+ activeItem.item = this.getElementByValue(activeItem.item.getAttribute('data-value'));
9452
+ }
9453
+ else {
9454
+ this.updateIncrementalView(0, this.itemCount);
9455
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9456
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
9457
+ this.list.scrollTop = 0;
9458
+ }
9459
+ if (activeItem && activeItem.item) {
9460
+ activeItem.item = this.getElementByValue(activeItem.item.getAttribute('data-value'));
9461
+ }
9462
+ }
8954
9463
  const activeElement = activeItem.item;
8955
9464
  if (!isNullOrUndefined(activeElement)) {
8956
9465
  const count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
@@ -8961,6 +9470,14 @@ let ComboBox = class ComboBox extends DropDownList {
8961
9470
  if (!this.enableVirtualization) {
8962
9471
  this.list.scrollTop = count * height + fixedHead;
8963
9472
  }
9473
+ else {
9474
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9475
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
9476
+ if (this.enableVirtualization && !this.fields.groupBy) {
9477
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? activeElement.offsetTop + (this.virtualListInfo.startIndex * activeElement.offsetHeight) : activeElement.offsetTop;
9478
+ this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * activeElement.offsetHeight);
9479
+ }
9480
+ }
8964
9481
  addClass([activeElement], dropDownListClasses.focus);
8965
9482
  }
8966
9483
  }
@@ -9641,7 +10158,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
9641
10158
  if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
9642
10159
  filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
9643
10160
  }
9644
- else {
10161
+ else if ((!this.enableVirtualization) || (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource)))) {
9645
10162
  const mapping = !isNullOrUndefined(this.fields.value) ? this.fields.value : '';
9646
10163
  filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
9647
10164
  }
@@ -9657,7 +10174,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
9657
10174
  }
9658
10175
  filterQuery.take(this.suggestionCount);
9659
10176
  }
9660
- if (this.enableVirtualization) {
10177
+ if (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
9661
10178
  var takeValue = this.getTakeValue();
9662
10179
  filterQuery.skip(this.virtualItemStartIndex);
9663
10180
  filterQuery.take(takeValue);
@@ -9738,7 +10255,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
9738
10255
  document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
9739
10256
  }
9740
10257
  }
9741
- if (this.enableVirtualization) {
10258
+ if ((this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
9742
10259
  this.getFilteringSkeletonCount();
9743
10260
  }
9744
10261
  }
@@ -9759,7 +10276,12 @@ let AutoComplete = class AutoComplete extends ComboBox {
9759
10276
  }
9760
10277
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
9761
10278
  onActionComplete(ulElement, list, e, isUpdated) {
9762
- this.fixedHeaderElement = null;
10279
+ if (!this.enableVirtualization) {
10280
+ this.fixedHeaderElement = null;
10281
+ }
10282
+ if ((this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
10283
+ this.getFilteringSkeletonCount();
10284
+ }
9763
10285
  super.onActionComplete(ulElement, list, e);
9764
10286
  const item = this.list.querySelector('.' + dropDownListClasses.li);
9765
10287
  if (!isNullOrUndefined(item)) {
@@ -10423,7 +10945,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10423
10945
  if (this.popupObj) {
10424
10946
  this.popupObj.show(eventArgs.animation, (this.zIndex === 1000) ? this.element : null);
10425
10947
  }
10426
- attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options' });
10948
+ attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_popup', 'aria-controls': this.element.id });
10427
10949
  this.updateAriaActiveDescendant();
10428
10950
  if (this.isFirstClick) {
10429
10951
  this.loadTemplate();
@@ -10504,7 +11026,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10504
11026
  }
10505
11027
  updateListARIA() {
10506
11028
  if (!isNullOrUndefined(this.ulElement)) {
10507
- attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
11029
+ attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'list' });
10508
11030
  }
10509
11031
  const disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
10510
11032
  if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
@@ -14084,6 +14606,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14084
14606
  this.setWidth(this.width);
14085
14607
  this.overAllWrapper.appendChild(this.componentWrapper);
14086
14608
  this.popupWrapper = this.createElement('div', { id: this.element.id + '_popup', className: POPUP_WRAPPER });
14609
+ this.popupWrapper.setAttribute('aria-label', this.element.id);
14610
+ this.popupWrapper.setAttribute('role', 'dialog');
14087
14611
  if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {
14088
14612
  this.delimiterWrapper = this.createElement('span', { className: DELIMITER_WRAPPER, styles: 'display:none' });
14089
14613
  this.componentWrapper.appendChild(this.delimiterWrapper);
@@ -14811,7 +15335,10 @@ class CheckBoxSelection {
14811
15335
  'role': 'combobox',
14812
15336
  'autocomplete': 'off',
14813
15337
  'autocapitalize': 'off',
14814
- 'spellcheck': 'false'
15338
+ 'spellcheck': 'false',
15339
+ 'aria-label': 'multiselect',
15340
+ 'aria-expanded': 'true',
15341
+ 'aria-controls': args.popupElement.id
14815
15342
  });
14816
15343
  this.clearIconElement = this.filterInput.parentElement.querySelector('.' + clearIcon);
14817
15344
  if (!Browser.isDevice && this.clearIconElement) {
@@ -15149,6 +15676,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
15149
15676
  const hiddenSelect = this.createElement('select', { className: 'e-hidden-select', attrs: { 'multiple': '' } });
15150
15677
  hiddenSelect.style.visibility = 'hidden';
15151
15678
  this.list.classList.add('e-listbox-wrapper');
15679
+ this.list.querySelector('.e-list-parent').setAttribute('role', 'presentation');
15680
+ const groupHdrs = this.list.querySelectorAll('.e-list-group-item');
15681
+ for (let i = 0; i < groupHdrs.length; i++) {
15682
+ groupHdrs[i].removeAttribute('tabindex');
15683
+ groupHdrs[i].setAttribute('role', 'option');
15684
+ }
15152
15685
  if (this.itemTemplate) {
15153
15686
  this.list.classList.add('e-list-template');
15154
15687
  }
@@ -16195,7 +16728,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
16195
16728
  'autocomplete': 'off',
16196
16729
  'autocorrect': 'off',
16197
16730
  'autocapitalize': 'off',
16198
- 'spellcheck': 'false'
16731
+ 'spellcheck': 'false',
16732
+ 'role': 'textbox'
16199
16733
  });
16200
16734
  if (this.height.toString().indexOf('%') < 0) {
16201
16735
  addClass([this.list], 'e-filter-list');
@@ -17569,6 +18103,7 @@ let Mention = class Mention extends DropDownBase {
17569
18103
  }
17570
18104
  }
17571
18105
  this.inputElement.setAttribute('role', 'textbox');
18106
+ this.inputElement.setAttribute('aria-label', 'mention');
17572
18107
  this.queryString = this.elementValue();
17573
18108
  this.wireEvent();
17574
18109
  }
@@ -17878,7 +18413,10 @@ let Mention = class Mention extends DropDownBase {
17878
18413
  const value = this.getFormattedValue(focusItem.getAttribute('data-value'));
17879
18414
  this.selectEventCallback(focusItem, this.getDataByValue(value), value, true);
17880
18415
  }
17881
- if (this.beforePopupOpen) {
18416
+ if (this.beforePopupOpen && this.isPopupOpen) {
18417
+ if (this.initRemoteRender && !isNullOrUndefined(this.popupObj.element)) {
18418
+ this.popupObj.element.remove();
18419
+ }
17882
18420
  this.renderPopup();
17883
18421
  }
17884
18422
  }