@syncfusion/ej2-dropdowns 23.2.7 → 24.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +26 -118
  2. package/dist/ej2-dropdowns.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-dropdowns.es2015.js +690 -117
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +694 -120
  8. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  9. package/dist/global/ej2-dropdowns.min.js +2 -2
  10. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/auto-complete/auto-complete.js +10 -5
  14. package/src/combo-box/combo-box.js +74 -2
  15. package/src/common/incremental-search.d.ts +1 -1
  16. package/src/common/incremental-search.js +50 -7
  17. package/src/common/interface.d.ts +2 -0
  18. package/src/common/virtual-scroll.js +22 -1
  19. package/src/drop-down-base/drop-down-base.d.ts +23 -3
  20. package/src/drop-down-base/drop-down-base.js +153 -40
  21. package/src/drop-down-list/drop-down-list.d.ts +10 -3
  22. package/src/drop-down-list/drop-down-list.js +332 -41
  23. package/src/drop-down-tree/drop-down-tree.js +24 -20
  24. package/src/list-box/list-box.d.ts +1 -0
  25. package/src/list-box/list-box.js +12 -1
  26. package/src/mention/mention.js +10 -1
  27. package/src/multi-select/checkbox-selection.js +4 -1
  28. package/src/multi-select/multi-select.js +4 -2
  29. package/styles/bootstrap-dark.css +0 -3
  30. package/styles/bootstrap.css +0 -3
  31. package/styles/bootstrap4.css +0 -3
  32. package/styles/bootstrap5-dark.css +0 -3
  33. package/styles/bootstrap5.css +0 -3
  34. package/styles/drop-down-base/_layout.scss +0 -3
  35. package/styles/drop-down-base/bootstrap-dark.css +0 -3
  36. package/styles/drop-down-base/bootstrap.css +0 -3
  37. package/styles/drop-down-base/bootstrap4.css +0 -3
  38. package/styles/drop-down-base/bootstrap5-dark.css +0 -3
  39. package/styles/drop-down-base/bootstrap5.css +0 -3
  40. package/styles/drop-down-base/fabric-dark.css +0 -3
  41. package/styles/drop-down-base/fabric.css +0 -3
  42. package/styles/drop-down-base/fluent-dark.css +0 -3
  43. package/styles/drop-down-base/fluent.css +0 -3
  44. package/styles/drop-down-base/highcontrast-light.css +0 -3
  45. package/styles/drop-down-base/highcontrast.css +0 -3
  46. package/styles/drop-down-base/material-dark.css +0 -3
  47. package/styles/drop-down-base/material.css +0 -3
  48. package/styles/drop-down-base/material3-dark.css +0 -3
  49. package/styles/drop-down-base/material3.css +0 -3
  50. package/styles/drop-down-base/tailwind-dark.css +0 -3
  51. package/styles/drop-down-base/tailwind.css +0 -3
  52. package/styles/drop-down-tree/_layout.scss +6 -0
  53. package/styles/drop-down-tree/fluent-dark.css +2 -0
  54. package/styles/drop-down-tree/fluent.css +2 -0
  55. package/styles/fabric-dark.css +0 -3
  56. package/styles/fabric.css +0 -3
  57. package/styles/fluent-dark.css +2 -3
  58. package/styles/fluent.css +2 -3
  59. package/styles/highcontrast-light.css +0 -3
  60. package/styles/highcontrast.css +0 -3
  61. package/styles/material-dark.css +0 -3
  62. package/styles/material.css +0 -3
  63. package/styles/material3-dark.css +0 -3
  64. package/styles/material3.css +0 -3
  65. package/styles/tailwind-dark.css +0 -3
  66. package/styles/tailwind.css +0 -3
@@ -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,83 @@ 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
  }
1033
+ if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
1034
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
1035
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
1036
+ }
1037
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
1038
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
1039
+ }
1040
+ }
869
1041
  e.preventDefault();
870
1042
  };
1043
+ DropDownList.prototype.updateVirtualItemIndex = function () {
1044
+ this.virtualItemStartIndex = this.viewPortInfo.startIndex;
1045
+ this.virtualItemEndIndex = this.viewPortInfo.endIndex;
1046
+ this.virtualListInfo = this.viewPortInfo;
1047
+ };
871
1048
  DropDownList.prototype.updateHomeEndAction = function (e, isVirtualKeyAction) {
872
1049
  if (this.getModuleName() === 'dropdownlist') {
873
1050
  var findLi = 0;
874
1051
  if (e.action === 'home') {
875
1052
  findLi = 0;
876
- if (this.enableVirtualization) {
1053
+ if (this.enableVirtualization && this.isPopupOpen) {
877
1054
  findLi = this.skeletonCount;
878
1055
  }
1056
+ else if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.startIndex !== 0) {
1057
+ this.viewPortInfo.startIndex = 0;
1058
+ this.viewPortInfo.endIndex = this.itemCount;
1059
+ this.updateVirtualItemIndex();
1060
+ this.resetList(this.dataSource, this.fields, this.query);
1061
+ }
879
1062
  }
880
1063
  else {
1064
+ if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.endIndex !== this.totalItemCount) {
1065
+ this.viewPortInfo.startIndex = this.totalItemCount - this.itemCount;
1066
+ this.viewPortInfo.endIndex = this.totalItemCount;
1067
+ this.updateVirtualItemIndex();
1068
+ this.resetList(this.dataSource, this.fields, this.query);
1069
+ }
881
1070
  findLi = this.getItems().length - 1;
882
1071
  }
883
1072
  e.preventDefault();
@@ -973,12 +1162,6 @@ var DropDownList = /** @class */ (function (_super) {
973
1162
  DropDownList.prototype.isSelectFocusItem = function (element) {
974
1163
  return !isNullOrUndefined(element);
975
1164
  };
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
1165
  DropDownList.prototype.pageUpSelection = function (steps, event, isVirtualKeyAction) {
983
1166
  var previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
984
1167
  if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
@@ -988,6 +1171,14 @@ var DropDownList = /** @class */ (function (_super) {
988
1171
  previousItem = this.liCollections[this.skeletonCount];
989
1172
  }
990
1173
  this.PageUpDownSelection(previousItem, event);
1174
+ if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
1175
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
1176
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
1177
+ }
1178
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
1179
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
1180
+ }
1181
+ }
991
1182
  };
992
1183
  DropDownList.prototype.PageUpDownSelection = function (previousItem, event) {
993
1184
  if (this.enableVirtualization) {
@@ -1006,6 +1197,14 @@ var DropDownList = /** @class */ (function (_super) {
1006
1197
  previousItem = steps <= list.length ? this.liCollections[steps + this.skeletonCount - 1] : this.liCollections[list.length - 1];
1007
1198
  }
1008
1199
  this.PageUpDownSelection(previousItem, event);
1200
+ if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
1201
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
1202
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
1203
+ }
1204
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
1205
+ attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
1206
+ }
1207
+ }
1009
1208
  };
1010
1209
  DropDownList.prototype.unWireEvent = function () {
1011
1210
  if (!isNullOrUndefined(this.inputWrapper)) {
@@ -1241,7 +1440,10 @@ var DropDownList = /** @class */ (function (_super) {
1241
1440
  .then(function (e) {
1242
1441
  if (e.result.length > 0) {
1243
1442
  _this.itemData = e.result[0];
1244
- _this.setProperties({ 'text': e.result[0].text, 'value': e.result[0].value }, true);
1443
+ var dataItem = _this.getItemData();
1444
+ if ((_this.value === dataItem.value && _this.text !== dataItem.text) || (_this.value !== dataItem.value && _this.text === dataItem.text)) {
1445
+ _this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
1446
+ }
1245
1447
  }
1246
1448
  });
1247
1449
  }
@@ -1249,7 +1451,10 @@ var DropDownList = /** @class */ (function (_super) {
1249
1451
  var getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
1250
1452
  if (getItem && getItem.length > 0) {
1251
1453
  this.itemData = getItem[0];
1252
- this.setProperties({ 'text': getItem[0].text, 'value': getItem[0].value }, true);
1454
+ var dataItem = this.getItemData();
1455
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
1456
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
1457
+ }
1253
1458
  }
1254
1459
  }
1255
1460
  }
@@ -1511,7 +1716,7 @@ var DropDownList = /** @class */ (function (_super) {
1511
1716
  this.typedString = this.filterInput.value;
1512
1717
  this.preventAutoFill = false;
1513
1718
  this.searchLists(e);
1514
- if (this.enableVirtualization) {
1719
+ if ((this.enableVirtualization && this.getModuleName() !== 'autocomplete') || (this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
1515
1720
  this.getFilteringSkeletonCount();
1516
1721
  }
1517
1722
  break;
@@ -1526,19 +1731,28 @@ var DropDownList = /** @class */ (function (_super) {
1526
1731
  var currentSkeletonCount = this.skeletonCount;
1527
1732
  this.getSkeletonCount(true);
1528
1733
  this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
1734
+ var skeletonUpdated = true;
1735
+ if (this.getModuleName() === 'autocomplete' && (this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2))) {
1736
+ this.skeletonCount = 0;
1737
+ skeletonUpdated = false;
1738
+ }
1529
1739
  if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
1530
1740
  var isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
1531
- if (currentSkeletonCount !== this.skeletonCount) {
1741
+ if (currentSkeletonCount !== this.skeletonCount && skeletonUpdated) {
1532
1742
  this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
1533
1743
  }
1534
1744
  else {
1535
1745
  this.UpdateSkeleton();
1536
1746
  }
1537
1747
  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();
1748
+ if ((this.list.getElementsByClassName('e-virtual-ddl').length > 0)) {
1749
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1750
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
1751
+ }
1752
+ if (this.list.getElementsByClassName('e-virtual-ddl-content').length > 0) {
1753
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1754
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
1755
+ }
1542
1756
  }
1543
1757
  };
1544
1758
  DropDownList.prototype.getSkeletonCount = function (retainSkeleton) {
@@ -1591,12 +1805,26 @@ var DropDownList = /** @class */ (function (_super) {
1591
1805
  else {
1592
1806
  filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
1593
1807
  }
1594
- if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0)) {
1808
+ if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
1595
1809
  var takeValue = this.getTakeValue();
1596
- if (this.allowFiltering) {
1810
+ var alreadySkipAdded = false;
1811
+ if (filterQuery) {
1812
+ for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
1813
+ if (filterQuery.queries[queryElements].fn === 'onSkip') {
1814
+ alreadySkipAdded = true;
1815
+ break;
1816
+ }
1817
+ }
1818
+ }
1819
+ if (this.allowFiltering || !this.isPopupOpen || !alreadySkipAdded) {
1597
1820
  filterQuery.skip(this.virtualItemStartIndex);
1598
1821
  }
1599
- filterQuery.take(takeValue);
1822
+ if (this.isIncrementalRequest) {
1823
+ filterQuery.take(this.incrementalEndIndex);
1824
+ }
1825
+ else {
1826
+ filterQuery.take(takeValue);
1827
+ }
1600
1828
  filterQuery.requiresCount();
1601
1829
  }
1602
1830
  return filterQuery;
@@ -1840,7 +2068,7 @@ var DropDownList = /** @class */ (function (_super) {
1840
2068
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1841
2069
  DropDownList.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
1842
2070
  var _this = this;
1843
- if (this.dataSource instanceof DataManager && !isNullOrUndefined(e)) {
2071
+ if (this.dataSource instanceof DataManager && !isNullOrUndefined(e) && !this.virtualGroupDataSource) {
1844
2072
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1845
2073
  this.totalItemCount = e.count;
1846
2074
  }
@@ -1867,7 +2095,7 @@ var DropDownList = /** @class */ (function (_super) {
1867
2095
  this.list.scrollTop = 0;
1868
2096
  }
1869
2097
  if (!isNullOrUndefined(ulElement)) {
1870
- attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
2098
+ attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'listbox' });
1871
2099
  }
1872
2100
  if (this.initRemoteRender) {
1873
2101
  this.initial = true;
@@ -1993,10 +2221,10 @@ var DropDownList = /** @class */ (function (_super) {
1993
2221
  DropDownList.prototype.addNewItem = function (listData, newElement) {
1994
2222
  var _this = this;
1995
2223
  if (!isNullOrUndefined(this.itemData) && !isNullOrUndefined(newElement)) {
1996
- var value_3 = this.getItemData().value;
2224
+ var value_5 = this.getItemData().value;
1997
2225
  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));
2226
+ return (((typeof data === 'string' || typeof data === 'number') && data === value_5) ||
2227
+ (getValue(_this.fields.value, data) === value_5));
2000
2228
  });
2001
2229
  if (!isExist) {
2002
2230
  this.addItem(this.itemData);
@@ -2087,6 +2315,9 @@ var DropDownList = /** @class */ (function (_super) {
2087
2315
  DropDownList.prototype.GetVirtualTrackHeight = function () {
2088
2316
  var height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
2089
2317
  var heightDimension = "height: " + (height - this.itemCount * this.listItemHeight) + "px;";
2318
+ if (this.getModuleName() === 'autocomplete' && this.skeletonCount === 0) {
2319
+ return "height: 0px;";
2320
+ }
2090
2321
  return heightDimension;
2091
2322
  };
2092
2323
  DropDownList.prototype.renderPopup = function (e) {
@@ -2101,6 +2332,8 @@ var DropDownList = /** @class */ (function (_super) {
2101
2332
  var popupEle = _this.createElement('div', {
2102
2333
  id: _this.element.id + '_popup', className: 'e-ddl e-popup ' + (_this.cssClass !== null ? _this.cssClass : '')
2103
2334
  });
2335
+ popupEle.setAttribute('aria-label', _this.element.id);
2336
+ popupEle.setAttribute('role', 'dialog');
2104
2337
  var searchBox = _this.setSearchBox(popupEle);
2105
2338
  _this.listHeight = formatUnit(_this.popupHeight);
2106
2339
  if (_this.headerTemplate) {
@@ -2185,9 +2418,9 @@ var DropDownList = /** @class */ (function (_super) {
2185
2418
  parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
2186
2419
  }
2187
2420
  }
2188
- _this.getFocusElement();
2189
2421
  _this.createPopup(popupEle, offsetValue, left);
2190
2422
  _this.popupContentElement = _this.popupObj.element.querySelector('.e-content');
2423
+ _this.getFocusElement();
2191
2424
  _this.checkCollision(popupEle);
2192
2425
  if (Browser.isDevice) {
2193
2426
  _this.popupObj.element.classList.add(dropDownListClasses.device);
@@ -2227,7 +2460,7 @@ var DropDownList = /** @class */ (function (_super) {
2227
2460
  enable: _this.enableVirtualization,
2228
2461
  });
2229
2462
  setTimeout(function () {
2230
- if (_this.value) {
2463
+ if (_this.value || _this.list.querySelector('.e-active')) {
2231
2464
  _this.updateSelectionList();
2232
2465
  if (_this.selectedValueInfo && _this.viewPortInfo && _this.viewPortInfo.offsets.top) {
2233
2466
  _this.list.scrollTop = _this.viewPortInfo.offsets.top;
@@ -2238,8 +2471,9 @@ var DropDownList = /** @class */ (function (_super) {
2238
2471
  }
2239
2472
  }, 5);
2240
2473
  }
2241
- attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_options' });
2474
+ attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_popup', 'aria-controls': _this.element.id });
2242
2475
  _this.inputElement.setAttribute('aria-expanded', 'true');
2476
+ _this.inputElement.setAttribute('aria-controls', _this.element.id);
2243
2477
  var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
2244
2478
  addClass([inputParent], [dropDownListClasses.inputFocus]);
2245
2479
  var animModel = { name: 'FadeIn', duration: 100 };
@@ -2304,7 +2538,12 @@ var DropDownList = /** @class */ (function (_super) {
2304
2538
  _this.destroyPopup();
2305
2539
  if (_this.isFiltering() && _this.actionCompleteData.list && _this.actionCompleteData.list[0]) {
2306
2540
  _this.isActive = true;
2307
- _this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);
2541
+ if (_this.enableVirtualization) {
2542
+ _this.onActionComplete(_this.ulElement, _this.listData, null, true);
2543
+ }
2544
+ else {
2545
+ _this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);
2546
+ }
2308
2547
  }
2309
2548
  },
2310
2549
  open: function () {
@@ -2411,6 +2650,7 @@ var DropDownList = /** @class */ (function (_super) {
2411
2650
  return width;
2412
2651
  };
2413
2652
  DropDownList.prototype.scrollBottom = function (isInitial, isInitialSelection, keyAction) {
2653
+ var _this = this;
2414
2654
  if (isInitialSelection === void 0) { isInitialSelection = false; }
2415
2655
  if (keyAction === void 0) { keyAction = null; }
2416
2656
  if (isNullOrUndefined(this.selectedLI) && this.enableVirtualization) {
@@ -2476,6 +2716,11 @@ var DropDownList = /** @class */ (function (_super) {
2476
2716
  isScrollTopChanged = true;
2477
2717
  }
2478
2718
  this.isKeyBoardAction = isScrollerCHanged;
2719
+ if (this.enableVirtualization && this.fields.groupBy && this.fixedHeaderElement && (keyAction == "down")) {
2720
+ setTimeout(function () {
2721
+ _this.scrollStop(null, true);
2722
+ }, 100);
2723
+ }
2479
2724
  }
2480
2725
  };
2481
2726
  DropDownList.prototype.scrollTop = function (keyAction) {
@@ -2627,6 +2872,9 @@ var DropDownList = /** @class */ (function (_super) {
2627
2872
  EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
2628
2873
  EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
2629
2874
  }
2875
+ if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
2876
+ this.filterInput.removeAttribute('aria-activedescendant');
2877
+ }
2630
2878
  this.filterInput = null;
2631
2879
  }
2632
2880
  attributes(this.targetElement(), { 'aria-expanded': 'false' });
@@ -2681,7 +2929,15 @@ var DropDownList = /** @class */ (function (_super) {
2681
2929
  if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
2682
2930
  this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
2683
2931
  }
2684
- var dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2932
+ var dataSourceCount;
2933
+ if (this.dataSource instanceof DataManager) {
2934
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2935
+ dataSourceCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
2936
+ }
2937
+ else {
2938
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2939
+ dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2940
+ }
2685
2941
  if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
2686
2942
  this.updateInitialData();
2687
2943
  this.checkAndResetCache();
@@ -2704,8 +2960,14 @@ var DropDownList = /** @class */ (function (_super) {
2704
2960
  }
2705
2961
  this.previousStartIndex = 0;
2706
2962
  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;
2963
+ if (this.dataSource instanceof DataManager) {
2964
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2965
+ this.totalItemCount = this.dataCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
2966
+ }
2967
+ else {
2968
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2969
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2970
+ }
2709
2971
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2710
2972
  if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
2711
2973
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -2815,6 +3077,9 @@ var DropDownList = /** @class */ (function (_super) {
2815
3077
  }
2816
3078
  else if (this.getModuleName() === 'dropdownlist') {
2817
3079
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
3080
+ this.inputElement.setAttribute('aria-label', this.getModuleName());
3081
+ this.inputElement.setAttribute('aria-expanded', 'false');
3082
+ this.inputElement.setAttribute('aria-controls', this.element.id + '_popups');
2818
3083
  }
2819
3084
  attributes(this.targetElement(), this.getAriaAttributes());
2820
3085
  this.updateDataAttribute(this.htmlAttributes);
@@ -3080,6 +3345,14 @@ var DropDownList = /** @class */ (function (_super) {
3080
3345
  this_1.clearAll();
3081
3346
  break;
3082
3347
  }
3348
+ if (this_1.enableVirtualization) {
3349
+ this_1.updateValues();
3350
+ this_1.updateInputFields();
3351
+ this_1.notify("setCurrentViewDataAsync", {
3352
+ module: "VirtualScroll",
3353
+ });
3354
+ break;
3355
+ }
3083
3356
  if (!this_1.list) {
3084
3357
  if (this_1.dataSource instanceof DataManager) {
3085
3358
  this_1.initRemoteRender = true;
@@ -3123,6 +3396,15 @@ var DropDownList = /** @class */ (function (_super) {
3123
3396
  this_1.clearAll();
3124
3397
  break;
3125
3398
  }
3399
+ if (this_1.enableVirtualization) {
3400
+ this_1.updateValues();
3401
+ this_1.updateInputFields();
3402
+ this_1.notify("setCurrentViewDataAsync", {
3403
+ module: "VirtualScroll",
3404
+ });
3405
+ this_1.preventChange = this_1.isAngular && this_1.preventChange ? !this_1.preventChange : this_1.preventChange;
3406
+ break;
3407
+ }
3126
3408
  this_1.notify('beforeValueChange', { newProp: newProp }); // gird component value type change
3127
3409
  if (!this_1.list) {
3128
3410
  if (this_1.dataSource instanceof DataManager) {
@@ -3272,6 +3554,12 @@ var DropDownList = /** @class */ (function (_super) {
3272
3554
  }
3273
3555
  };
3274
3556
  };
3557
+ DropDownList.prototype.updatePopupState = function () {
3558
+ if (this.beforePopupOpen) {
3559
+ this.beforePopupOpen = false;
3560
+ this.showPopup();
3561
+ }
3562
+ };
3275
3563
  DropDownList.prototype.setReadOnly = function () {
3276
3564
  if (this.readonly) {
3277
3565
  addClass([this.inputWrapper.container], ['e-readonly']);
@@ -3404,6 +3692,9 @@ var DropDownList = /** @class */ (function (_super) {
3404
3692
  this.closePopup(0, e);
3405
3693
  var dataItem = this.getItemData();
3406
3694
  var isSelectVal = !isNullOrUndefined(this.selectedLI);
3695
+ if (isSelectVal && this.enableVirtualization && this.selectedLI.classList) {
3696
+ isSelectVal = this.selectedLI.classList.contains('e-active');
3697
+ }
3407
3698
  if (this.inputElement && this.inputElement.value.trim() === '' && !this.isInteracted && (this.isSelectCustom ||
3408
3699
  isSelectVal && this.inputElement.value !== dataItem.text)) {
3409
3700
  this.isSelectCustom = false;