@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.
@@ -91,7 +91,6 @@ var DropDownList = /** @class */ (function (_super) {
91
91
  _this.isListSearched = false;
92
92
  _this.preventChange = false;
93
93
  _this.isAngular = false;
94
- _this.itemCount = 10;
95
94
  _this.virtualListHeight = 0;
96
95
  _this.isVirtualScrolling = false;
97
96
  _this.isPreventScrollAction = false;
@@ -106,6 +105,10 @@ var DropDownList = /** @class */ (function (_super) {
106
105
  _this.pageCount = 0;
107
106
  _this.isPreventKeyAction = false;
108
107
  _this.generatedDataObject = {};
108
+ _this.incrementalQueryString = '';
109
+ _this.incrementalEndIndex = 0;
110
+ _this.incrementalStartIndex = 0;
111
+ _this.incrementalPreQueryString = '';
109
112
  _this.isTouched = false;
110
113
  _this.virtualListInfo = {
111
114
  currentPageNumber: null,
@@ -215,8 +218,10 @@ var DropDownList = /** @class */ (function (_super) {
215
218
  };
216
219
  DropDownList.prototype.renderList = function (e, isEmptyData) {
217
220
  _super.prototype.render.call(this, e, isEmptyData);
218
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
219
- this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
221
+ if (!(this.dataSource instanceof DataManager)) {
222
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
223
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
224
+ }
220
225
  this.unWireListEvents();
221
226
  this.wireListEvents();
222
227
  };
@@ -680,12 +685,136 @@ var DropDownList = /** @class */ (function (_super) {
680
685
  DropDownList.prototype.isValidLI = function (li) {
681
686
  return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
682
687
  };
688
+ DropDownList.prototype.updateIncrementalInfo = function (startIndex, endIndex) {
689
+ this.viewPortInfo.startIndex = startIndex;
690
+ this.viewPortInfo.endIndex = endIndex;
691
+ this.updateVirtualItemIndex();
692
+ this.isIncrementalRequest = true;
693
+ this.resetList(this.dataSource, this.fields, this.query);
694
+ this.isIncrementalRequest = false;
695
+ };
696
+ DropDownList.prototype.updateIncrementalView = function (startIndex, endIndex) {
697
+ this.viewPortInfo.startIndex = startIndex;
698
+ this.viewPortInfo.endIndex = endIndex;
699
+ this.updateVirtualItemIndex();
700
+ this.resetList(this.dataSource, this.fields, this.query);
701
+ this.UpdateSkeleton();
702
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
703
+ this.ulElement = this.list.querySelector('ul');
704
+ };
705
+ DropDownList.prototype.updateIncrementalItemIndex = function (startIndex, endIndex) {
706
+ this.incrementalStartIndex = startIndex;
707
+ this.incrementalEndIndex = endIndex;
708
+ };
683
709
  DropDownList.prototype.incrementalSearch = function (e) {
684
710
  if (this.liCollections.length > 0) {
685
- var li = incrementalSearch(e.charCode, this.liCollections, this.activeIndex, true, this.element.id);
686
- if (!isNullOrUndefined(li)) {
687
- this.setSelection(li, e);
688
- this.setScrollPosition();
711
+ if (this.enableVirtualization) {
712
+ var updatingincrementalindex = false;
713
+ var queryStringUpdated = false;
714
+ var activeElement = this.ulElement.getElementsByClassName('e-active')[0];
715
+ var currentValue = activeElement ? activeElement.textContent : null;
716
+ if (this.incrementalQueryString == '') {
717
+ this.incrementalQueryString = String.fromCharCode(e.charCode);
718
+ this.incrementalPreQueryString = this.incrementalQueryString;
719
+ }
720
+ else if (String.fromCharCode(e.charCode).toLocaleLowerCase() == this.incrementalPreQueryString.toLocaleLowerCase()) {
721
+ queryStringUpdated = true;
722
+ }
723
+ else {
724
+ this.incrementalQueryString = String.fromCharCode(e.charCode);
725
+ }
726
+ if ((this.viewPortInfo.endIndex >= this.incrementalEndIndex && this.incrementalEndIndex <= this.totalItemCount) || this.incrementalEndIndex == 0) {
727
+ updatingincrementalindex = true;
728
+ this.incrementalStartIndex = this.incrementalEndIndex;
729
+ if (this.incrementalEndIndex == 0) {
730
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
731
+ }
732
+ else {
733
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
734
+ }
735
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
736
+ updatingincrementalindex = true;
737
+ }
738
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
739
+ this.updateIncrementalView(0, this.itemCount);
740
+ }
741
+ var li = incrementalSearch(e.charCode, this.incrementalLiCollections, this.activeIndex, true, this.element.id, queryStringUpdated, currentValue, true);
742
+ while (isNullOrUndefined(li) && this.incrementalEndIndex < this.totalItemCount) {
743
+ this.updateIncrementalItemIndex(this.incrementalEndIndex, this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100);
744
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
745
+ updatingincrementalindex = true;
746
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
747
+ this.updateIncrementalView(0, this.itemCount);
748
+ }
749
+ li = incrementalSearch(e.charCode, this.incrementalLiCollections, 0, true, this.element.id, queryStringUpdated, currentValue, true, true);
750
+ if (!isNullOrUndefined(li)) {
751
+ break;
752
+ }
753
+ if (isNullOrUndefined(li) && this.incrementalEndIndex >= this.totalItemCount) {
754
+ this.updateIncrementalItemIndex(0, 100 > this.totalItemCount ? this.totalItemCount : 100);
755
+ break;
756
+ }
757
+ }
758
+ if (isNullOrUndefined(li) && this.incrementalEndIndex >= this.totalItemCount) {
759
+ this.updateIncrementalItemIndex(0, 100 > this.totalItemCount ? this.totalItemCount : 100);
760
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
761
+ updatingincrementalindex = true;
762
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
763
+ this.updateIncrementalView(0, this.itemCount);
764
+ }
765
+ li = incrementalSearch(e.charCode, this.incrementalLiCollections, 0, true, this.element.id, queryStringUpdated, currentValue, true, true);
766
+ }
767
+ var index = li && this.getIndexByValue(li.getAttribute('data-value'));
768
+ if (!index) {
769
+ for (var i = 0; i < this.incrementalLiCollections.length; i++) {
770
+ if (!isNullOrUndefined(li) && !isNullOrUndefined(li.getAttribute('data-value')) && this.incrementalLiCollections[i].getAttribute('data-value') === li.getAttribute('data-value').toString()) {
771
+ index = i;
772
+ index = this.incrementalStartIndex + index;
773
+ break;
774
+ }
775
+ }
776
+ }
777
+ else {
778
+ index = index - this.skeletonCount;
779
+ }
780
+ if (index) {
781
+ if ((!(this.viewPortInfo.startIndex >= index)) || (!(index >= this.viewPortInfo.endIndex))) {
782
+ var startIndex = index - ((this.itemCount / 2) - 2) > 0 ? index - ((this.itemCount / 2) - 2) : 0;
783
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
784
+ this.updateIncrementalView(startIndex, endIndex);
785
+ }
786
+ }
787
+ if (!isNullOrUndefined(li)) {
788
+ var index_1 = this.getIndexByValue(li.getAttribute('data-value')) - this.skeletonCount;
789
+ if (index_1 > this.itemCount / 2) {
790
+ var startIndex = this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) < this.totalItemCount ? this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) : this.totalItemCount;
791
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
792
+ this.updateIncrementalView(startIndex, endIndex);
793
+ }
794
+ li = this.getElementByValue(li.getAttribute('data-value'));
795
+ this.setSelection(li, e);
796
+ this.setScrollPosition();
797
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
798
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
799
+ if (this.enableVirtualization && !this.fields.groupBy) {
800
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
801
+ this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
802
+ }
803
+ this.incrementalPreQueryString = this.incrementalQueryString;
804
+ }
805
+ else {
806
+ this.updateIncrementalView(0, this.itemCount);
807
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
808
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
809
+ this.list.scrollTop = 0;
810
+ }
811
+ }
812
+ else {
813
+ var li = incrementalSearch(e.charCode, this.liCollections, this.activeIndex, true, this.element.id);
814
+ if (!isNullOrUndefined(li)) {
815
+ this.setSelection(li, e);
816
+ this.setScrollPosition();
817
+ }
689
818
  }
690
819
  }
691
820
  };
@@ -741,6 +870,9 @@ var DropDownList = /** @class */ (function (_super) {
741
870
  if (isNullOrUndefined(this.list) && !this.isRequested && !isTabAction && e.action !== 'escape') {
742
871
  this.searchKeyEvent = e;
743
872
  this.renderList(e);
873
+ this.UpdateSkeleton();
874
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
875
+ this.ulElement = this.list.querySelector('ul');
744
876
  }
745
877
  if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
746
878
  isNavigation && this.liCollections.length === 0) || this.isRequested) {
@@ -818,7 +950,7 @@ var DropDownList = /** @class */ (function (_super) {
818
950
  var focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
819
951
  if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
820
952
  this.setSelection(focusEle, e);
821
- if (this.enableVirtualization) {
953
+ if (this.enableVirtualization && !this.fields.groupBy && this.getModuleName() !== 'combobox') {
822
954
  var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
823
955
  this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
824
956
  }
@@ -846,7 +978,7 @@ var DropDownList = /** @class */ (function (_super) {
846
978
  }
847
979
  else {
848
980
  if (this.getModuleName() === 'autocomplete') {
849
- var value = this.selectedLI.dataset.value;
981
+ var value = this.getFormattedValue(this.selectedLI.getAttribute('data-value'));
850
982
  nextItem = this.getElementByValue(value);
851
983
  }
852
984
  else {
@@ -858,26 +990,75 @@ var DropDownList = /** @class */ (function (_super) {
858
990
  if (!isNullOrUndefined(nextItem)) {
859
991
  this.setSelection(nextItem, e);
860
992
  }
993
+ else if (this.enableVirtualization && !this.isPopupOpen && this.getModuleName() !== 'autocomplete' && ((this.viewPortInfo.endIndex !== this.totalItemCount && e.action === 'down') || (this.viewPortInfo.startIndex !== 0 && e.action === 'up'))) {
994
+ if (e.action === 'down') {
995
+ this.viewPortInfo.startIndex = (this.viewPortInfo.startIndex + this.itemCount) < (this.totalItemCount - this.itemCount) ? this.viewPortInfo.startIndex + this.itemCount : this.totalItemCount - this.itemCount;
996
+ this.viewPortInfo.endIndex = this.viewPortInfo.startIndex + this.itemCount;
997
+ this.updateVirtualItemIndex();
998
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? true : this.isCustomFilter;
999
+ this.resetList(this.dataSource, this.fields, this.query);
1000
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? false : this.isCustomFilter;
1001
+ var value_2 = this.liCollections[0].getAttribute('data-value') !== "null" ? this.getFormattedValue(this.liCollections[0].getAttribute('data-value')) : null;
1002
+ var selectedData = this.getDataByValue(value_2);
1003
+ if (selectedData) {
1004
+ this.itemData = selectedData;
1005
+ }
1006
+ }
1007
+ else if (e.action === 'up') {
1008
+ this.viewPortInfo.startIndex = (this.viewPortInfo.startIndex - this.itemCount) > 0 ? this.viewPortInfo.startIndex - this.itemCount : 0;
1009
+ this.viewPortInfo.endIndex = this.viewPortInfo.startIndex + this.itemCount;
1010
+ this.updateVirtualItemIndex();
1011
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? true : this.isCustomFilter;
1012
+ this.resetList(this.dataSource, this.fields, this.query);
1013
+ this.isCustomFilter = this.getModuleName() === 'combobox' ? false : this.isCustomFilter;
1014
+ var value_3 = this.liCollections[this.liCollections.length - 1].getAttribute('data-value') !== "null" ? this.getFormattedValue(this.liCollections[this.liCollections.length - 1].getAttribute('data-value')) : null;
1015
+ var selectedData = this.getDataByValue(value_3);
1016
+ if (selectedData) {
1017
+ this.itemData = selectedData;
1018
+ }
1019
+ }
1020
+ this.UpdateSkeleton();
1021
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1022
+ this.ulElement = this.list.querySelector('ul');
1023
+ this.handleVirtualKeyboardActions(e, this.pageCount);
1024
+ }
861
1025
  }
862
1026
  if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
863
- var value_2 = this.getItemData().value;
864
- var filterIndex = this.getIndexByValueFilter(value_2);
1027
+ var value_4 = this.getItemData().value;
1028
+ var filterIndex = this.getIndexByValueFilter(value_4);
865
1029
  if (!isNullOrUndefined(filterIndex)) {
866
1030
  this.activeIndex = filterIndex;
867
1031
  }
868
1032
  }
869
1033
  e.preventDefault();
870
1034
  };
1035
+ DropDownList.prototype.updateVirtualItemIndex = function () {
1036
+ this.virtualItemStartIndex = this.viewPortInfo.startIndex;
1037
+ this.virtualItemEndIndex = this.viewPortInfo.endIndex;
1038
+ this.virtualListInfo = this.viewPortInfo;
1039
+ };
871
1040
  DropDownList.prototype.updateHomeEndAction = function (e, isVirtualKeyAction) {
872
1041
  if (this.getModuleName() === 'dropdownlist') {
873
1042
  var findLi = 0;
874
1043
  if (e.action === 'home') {
875
1044
  findLi = 0;
876
- if (this.enableVirtualization) {
1045
+ if (this.enableVirtualization && this.isPopupOpen) {
877
1046
  findLi = this.skeletonCount;
878
1047
  }
1048
+ else if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.startIndex !== 0) {
1049
+ this.viewPortInfo.startIndex = 0;
1050
+ this.viewPortInfo.endIndex = this.itemCount;
1051
+ this.updateVirtualItemIndex();
1052
+ this.resetList(this.dataSource, this.fields, this.query);
1053
+ }
879
1054
  }
880
1055
  else {
1056
+ if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.endIndex !== this.totalItemCount) {
1057
+ this.viewPortInfo.startIndex = this.totalItemCount - this.itemCount;
1058
+ this.viewPortInfo.endIndex = this.totalItemCount;
1059
+ this.updateVirtualItemIndex();
1060
+ this.resetList(this.dataSource, this.fields, this.query);
1061
+ }
881
1062
  findLi = this.getItems().length - 1;
882
1063
  }
883
1064
  e.preventDefault();
@@ -973,12 +1154,6 @@ var DropDownList = /** @class */ (function (_super) {
973
1154
  DropDownList.prototype.isSelectFocusItem = function (element) {
974
1155
  return !isNullOrUndefined(element);
975
1156
  };
976
- DropDownList.prototype.getPageCount = function (returnExactCount) {
977
- var liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
978
- getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
979
- var pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
980
- return returnExactCount ? pageCount : Math.round(pageCount);
981
- };
982
1157
  DropDownList.prototype.pageUpSelection = function (steps, event, isVirtualKeyAction) {
983
1158
  var previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
984
1159
  if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
@@ -1241,7 +1416,10 @@ var DropDownList = /** @class */ (function (_super) {
1241
1416
  .then(function (e) {
1242
1417
  if (e.result.length > 0) {
1243
1418
  _this.itemData = e.result[0];
1244
- _this.setProperties({ 'text': e.result[0].text, 'value': e.result[0].value }, true);
1419
+ var dataItem = _this.getItemData();
1420
+ if ((_this.value === dataItem.value && _this.text !== dataItem.text) || (_this.value !== dataItem.value && _this.text === dataItem.text)) {
1421
+ _this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
1422
+ }
1245
1423
  }
1246
1424
  });
1247
1425
  }
@@ -1249,7 +1427,10 @@ var DropDownList = /** @class */ (function (_super) {
1249
1427
  var getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
1250
1428
  if (getItem && getItem.length > 0) {
1251
1429
  this.itemData = getItem[0];
1252
- this.setProperties({ 'text': getItem[0].text, 'value': getItem[0].value }, true);
1430
+ var dataItem = this.getItemData();
1431
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
1432
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
1433
+ }
1253
1434
  }
1254
1435
  }
1255
1436
  }
@@ -1511,7 +1692,7 @@ var DropDownList = /** @class */ (function (_super) {
1511
1692
  this.typedString = this.filterInput.value;
1512
1693
  this.preventAutoFill = false;
1513
1694
  this.searchLists(e);
1514
- if (this.enableVirtualization) {
1695
+ if ((this.enableVirtualization && this.getModuleName() !== 'autocomplete') || (this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
1515
1696
  this.getFilteringSkeletonCount();
1516
1697
  }
1517
1698
  break;
@@ -1526,19 +1707,28 @@ var DropDownList = /** @class */ (function (_super) {
1526
1707
  var currentSkeletonCount = this.skeletonCount;
1527
1708
  this.getSkeletonCount(true);
1528
1709
  this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
1710
+ var skeletonUpdated = true;
1711
+ if (this.getModuleName() === 'autocomplete' && (this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2))) {
1712
+ this.skeletonCount = 0;
1713
+ skeletonUpdated = false;
1714
+ }
1529
1715
  if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
1530
1716
  var isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
1531
- if (currentSkeletonCount !== this.skeletonCount) {
1717
+ if (currentSkeletonCount !== this.skeletonCount && skeletonUpdated) {
1532
1718
  this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
1533
1719
  }
1534
1720
  else {
1535
1721
  this.UpdateSkeleton();
1536
1722
  }
1537
1723
  this.liCollections = this.list.querySelectorAll('.e-list-item');
1538
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1539
- this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
1540
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1541
- this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
1724
+ if ((this.list.getElementsByClassName('e-virtual-ddl').length > 0)) {
1725
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1726
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
1727
+ }
1728
+ if (this.list.getElementsByClassName('e-virtual-ddl-content').length > 0) {
1729
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1730
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
1731
+ }
1542
1732
  }
1543
1733
  };
1544
1734
  DropDownList.prototype.getSkeletonCount = function (retainSkeleton) {
@@ -1591,12 +1781,26 @@ var DropDownList = /** @class */ (function (_super) {
1591
1781
  else {
1592
1782
  filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
1593
1783
  }
1594
- if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0)) {
1784
+ if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
1595
1785
  var takeValue = this.getTakeValue();
1596
- if (this.allowFiltering) {
1786
+ var alreadySkipAdded = false;
1787
+ if (filterQuery) {
1788
+ for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
1789
+ if (filterQuery.queries[queryElements].fn === 'onSkip') {
1790
+ alreadySkipAdded = true;
1791
+ break;
1792
+ }
1793
+ }
1794
+ }
1795
+ if (this.allowFiltering || !this.isPopupOpen || !alreadySkipAdded) {
1597
1796
  filterQuery.skip(this.virtualItemStartIndex);
1598
1797
  }
1599
- filterQuery.take(takeValue);
1798
+ if (this.isIncrementalRequest) {
1799
+ filterQuery.take(this.incrementalEndIndex);
1800
+ }
1801
+ else {
1802
+ filterQuery.take(takeValue);
1803
+ }
1600
1804
  filterQuery.requiresCount();
1601
1805
  }
1602
1806
  return filterQuery;
@@ -1840,7 +2044,7 @@ var DropDownList = /** @class */ (function (_super) {
1840
2044
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1841
2045
  DropDownList.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
1842
2046
  var _this = this;
1843
- if (this.dataSource instanceof DataManager && !isNullOrUndefined(e)) {
2047
+ if (this.dataSource instanceof DataManager && !isNullOrUndefined(e) && !this.virtualGroupDataSource) {
1844
2048
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1845
2049
  this.totalItemCount = e.count;
1846
2050
  }
@@ -1867,7 +2071,7 @@ var DropDownList = /** @class */ (function (_super) {
1867
2071
  this.list.scrollTop = 0;
1868
2072
  }
1869
2073
  if (!isNullOrUndefined(ulElement)) {
1870
- attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
2074
+ attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'listbox' });
1871
2075
  }
1872
2076
  if (this.initRemoteRender) {
1873
2077
  this.initial = true;
@@ -1993,10 +2197,10 @@ var DropDownList = /** @class */ (function (_super) {
1993
2197
  DropDownList.prototype.addNewItem = function (listData, newElement) {
1994
2198
  var _this = this;
1995
2199
  if (!isNullOrUndefined(this.itemData) && !isNullOrUndefined(newElement)) {
1996
- var value_3 = this.getItemData().value;
2200
+ var value_5 = this.getItemData().value;
1997
2201
  var isExist = listData.some(function (data) {
1998
- return (((typeof data === 'string' || typeof data === 'number') && data === value_3) ||
1999
- (getValue(_this.fields.value, data) === value_3));
2202
+ return (((typeof data === 'string' || typeof data === 'number') && data === value_5) ||
2203
+ (getValue(_this.fields.value, data) === value_5));
2000
2204
  });
2001
2205
  if (!isExist) {
2002
2206
  this.addItem(this.itemData);
@@ -2087,6 +2291,9 @@ var DropDownList = /** @class */ (function (_super) {
2087
2291
  DropDownList.prototype.GetVirtualTrackHeight = function () {
2088
2292
  var height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
2089
2293
  var heightDimension = "height: " + (height - this.itemCount * this.listItemHeight) + "px;";
2294
+ if (this.getModuleName() === 'autocomplete' && this.skeletonCount === 0) {
2295
+ return "height: 0px;";
2296
+ }
2090
2297
  return heightDimension;
2091
2298
  };
2092
2299
  DropDownList.prototype.renderPopup = function (e) {
@@ -2101,6 +2308,8 @@ var DropDownList = /** @class */ (function (_super) {
2101
2308
  var popupEle = _this.createElement('div', {
2102
2309
  id: _this.element.id + '_popup', className: 'e-ddl e-popup ' + (_this.cssClass !== null ? _this.cssClass : '')
2103
2310
  });
2311
+ popupEle.setAttribute('aria-label', _this.element.id);
2312
+ popupEle.setAttribute('role', 'dialog');
2104
2313
  var searchBox = _this.setSearchBox(popupEle);
2105
2314
  _this.listHeight = formatUnit(_this.popupHeight);
2106
2315
  if (_this.headerTemplate) {
@@ -2185,9 +2394,9 @@ var DropDownList = /** @class */ (function (_super) {
2185
2394
  parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
2186
2395
  }
2187
2396
  }
2188
- _this.getFocusElement();
2189
2397
  _this.createPopup(popupEle, offsetValue, left);
2190
2398
  _this.popupContentElement = _this.popupObj.element.querySelector('.e-content');
2399
+ _this.getFocusElement();
2191
2400
  _this.checkCollision(popupEle);
2192
2401
  if (Browser.isDevice) {
2193
2402
  _this.popupObj.element.classList.add(dropDownListClasses.device);
@@ -2227,7 +2436,7 @@ var DropDownList = /** @class */ (function (_super) {
2227
2436
  enable: _this.enableVirtualization,
2228
2437
  });
2229
2438
  setTimeout(function () {
2230
- if (_this.value) {
2439
+ if (_this.value || _this.list.querySelector('.e-active')) {
2231
2440
  _this.updateSelectionList();
2232
2441
  if (_this.selectedValueInfo && _this.viewPortInfo && _this.viewPortInfo.offsets.top) {
2233
2442
  _this.list.scrollTop = _this.viewPortInfo.offsets.top;
@@ -2238,8 +2447,9 @@ var DropDownList = /** @class */ (function (_super) {
2238
2447
  }
2239
2448
  }, 5);
2240
2449
  }
2241
- attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_options' });
2450
+ attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_popup', 'aria-controls': _this.element.id });
2242
2451
  _this.inputElement.setAttribute('aria-expanded', 'true');
2452
+ _this.inputElement.setAttribute('aria-controls', _this.element.id);
2243
2453
  var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
2244
2454
  addClass([inputParent], [dropDownListClasses.inputFocus]);
2245
2455
  var animModel = { name: 'FadeIn', duration: 100 };
@@ -2304,7 +2514,12 @@ var DropDownList = /** @class */ (function (_super) {
2304
2514
  _this.destroyPopup();
2305
2515
  if (_this.isFiltering() && _this.actionCompleteData.list && _this.actionCompleteData.list[0]) {
2306
2516
  _this.isActive = true;
2307
- _this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);
2517
+ if (_this.enableVirtualization) {
2518
+ _this.onActionComplete(_this.ulElement, _this.listData, null, true);
2519
+ }
2520
+ else {
2521
+ _this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);
2522
+ }
2308
2523
  }
2309
2524
  },
2310
2525
  open: function () {
@@ -2411,6 +2626,7 @@ var DropDownList = /** @class */ (function (_super) {
2411
2626
  return width;
2412
2627
  };
2413
2628
  DropDownList.prototype.scrollBottom = function (isInitial, isInitialSelection, keyAction) {
2629
+ var _this = this;
2414
2630
  if (isInitialSelection === void 0) { isInitialSelection = false; }
2415
2631
  if (keyAction === void 0) { keyAction = null; }
2416
2632
  if (isNullOrUndefined(this.selectedLI) && this.enableVirtualization) {
@@ -2476,6 +2692,11 @@ var DropDownList = /** @class */ (function (_super) {
2476
2692
  isScrollTopChanged = true;
2477
2693
  }
2478
2694
  this.isKeyBoardAction = isScrollerCHanged;
2695
+ if (this.enableVirtualization && this.fields.groupBy && this.fixedHeaderElement && (keyAction == "down")) {
2696
+ setTimeout(function () {
2697
+ _this.scrollStop(null, true);
2698
+ }, 100);
2699
+ }
2479
2700
  }
2480
2701
  };
2481
2702
  DropDownList.prototype.scrollTop = function (keyAction) {
@@ -2681,7 +2902,15 @@ var DropDownList = /** @class */ (function (_super) {
2681
2902
  if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
2682
2903
  this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
2683
2904
  }
2684
- var dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2905
+ var dataSourceCount;
2906
+ if (this.dataSource instanceof DataManager) {
2907
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2908
+ dataSourceCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
2909
+ }
2910
+ else {
2911
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2912
+ dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2913
+ }
2685
2914
  if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
2686
2915
  this.updateInitialData();
2687
2916
  this.checkAndResetCache();
@@ -2704,8 +2933,14 @@ var DropDownList = /** @class */ (function (_super) {
2704
2933
  }
2705
2934
  this.previousStartIndex = 0;
2706
2935
  this.previousEndIndex = 0;
2707
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2708
- this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2936
+ if (this.dataSource instanceof DataManager) {
2937
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2938
+ this.totalItemCount = this.dataCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
2939
+ }
2940
+ else {
2941
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2942
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2943
+ }
2709
2944
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2710
2945
  if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
2711
2946
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -2815,6 +3050,9 @@ var DropDownList = /** @class */ (function (_super) {
2815
3050
  }
2816
3051
  else if (this.getModuleName() === 'dropdownlist') {
2817
3052
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
3053
+ this.inputElement.setAttribute('aria-label', this.getModuleName());
3054
+ this.inputElement.setAttribute('aria-expanded', 'false');
3055
+ this.inputElement.setAttribute('aria-controls', this.element.id + '_popups');
2818
3056
  }
2819
3057
  attributes(this.targetElement(), this.getAriaAttributes());
2820
3058
  this.updateDataAttribute(this.htmlAttributes);
@@ -3080,6 +3318,14 @@ var DropDownList = /** @class */ (function (_super) {
3080
3318
  this_1.clearAll();
3081
3319
  break;
3082
3320
  }
3321
+ if (this_1.enableVirtualization) {
3322
+ this_1.updateValues();
3323
+ this_1.updateInputFields();
3324
+ this_1.notify("setCurrentViewDataAsync", {
3325
+ module: "VirtualScroll",
3326
+ });
3327
+ break;
3328
+ }
3083
3329
  if (!this_1.list) {
3084
3330
  if (this_1.dataSource instanceof DataManager) {
3085
3331
  this_1.initRemoteRender = true;
@@ -3123,6 +3369,15 @@ var DropDownList = /** @class */ (function (_super) {
3123
3369
  this_1.clearAll();
3124
3370
  break;
3125
3371
  }
3372
+ if (this_1.enableVirtualization) {
3373
+ this_1.updateValues();
3374
+ this_1.updateInputFields();
3375
+ this_1.notify("setCurrentViewDataAsync", {
3376
+ module: "VirtualScroll",
3377
+ });
3378
+ this_1.preventChange = this_1.isAngular && this_1.preventChange ? !this_1.preventChange : this_1.preventChange;
3379
+ break;
3380
+ }
3126
3381
  this_1.notify('beforeValueChange', { newProp: newProp }); // gird component value type change
3127
3382
  if (!this_1.list) {
3128
3383
  if (this_1.dataSource instanceof DataManager) {
@@ -3272,6 +3527,12 @@ var DropDownList = /** @class */ (function (_super) {
3272
3527
  }
3273
3528
  };
3274
3529
  };
3530
+ DropDownList.prototype.updatePopupState = function () {
3531
+ if (this.beforePopupOpen) {
3532
+ this.beforePopupOpen = false;
3533
+ this.showPopup();
3534
+ }
3535
+ };
3275
3536
  DropDownList.prototype.setReadOnly = function () {
3276
3537
  if (this.readonly) {
3277
3538
  addClass([this.inputWrapper.container], ['e-readonly']);
@@ -3404,6 +3665,9 @@ var DropDownList = /** @class */ (function (_super) {
3404
3665
  this.closePopup(0, e);
3405
3666
  var dataItem = this.getItemData();
3406
3667
  var isSelectVal = !isNullOrUndefined(this.selectedLI);
3668
+ if (isSelectVal && this.enableVirtualization && this.selectedLI.classList) {
3669
+ isSelectVal = this.selectedLI.classList.contains('e-active');
3670
+ }
3407
3671
  if (this.inputElement && this.inputElement.value.trim() === '' && !this.isInteracted && (this.isSelectCustom ||
3408
3672
  isSelectVal && this.inputElement.value !== dataItem.text)) {
3409
3673
  this.isSelectCustom = false;