@syncfusion/ej2-dropdowns 22.2.12 → 23.1.38

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 (264) hide show
  1. package/.eslintrc.json +260 -0
  2. package/CHANGELOG.md +4 -209
  3. package/dist/ej2-dropdowns.min.js +3 -3
  4. package/dist/ej2-dropdowns.umd.min.js +3 -3
  5. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es2015.js +1149 -70
  7. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  8. package/dist/es6/ej2-dropdowns.es5.js +1203 -66
  9. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  10. package/dist/global/ej2-dropdowns.min.js +3 -3
  11. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  12. package/dist/global/index.d.ts +2 -2
  13. package/package.json +13 -12
  14. package/src/auto-complete/auto-complete.js +40 -2
  15. package/src/combo-box/combo-box.js +9 -3
  16. package/src/common/index.d.ts +2 -0
  17. package/src/common/index.js +1 -0
  18. package/src/common/interface.d.ts +76 -0
  19. package/src/common/interface.js +1 -0
  20. package/src/common/virtual-scroll.d.ts +62 -0
  21. package/src/common/virtual-scroll.js +379 -0
  22. package/src/drop-down-base/drop-down-base.d.ts +10 -4
  23. package/src/drop-down-base/drop-down-base.js +72 -8
  24. package/src/drop-down-list/drop-down-list-model.d.ts +8 -1
  25. package/src/drop-down-list/drop-down-list.d.ts +56 -1
  26. package/src/drop-down-list/drop-down-list.js +661 -40
  27. package/src/drop-down-list/index.d.ts +1 -0
  28. package/src/drop-down-list/index.js +1 -0
  29. package/src/drop-down-tree/drop-down-tree.d.ts +1 -1
  30. package/src/global.js +3 -0
  31. package/src/mention/mention.js +8 -1
  32. package/src/multi-select/checkbox-selection.js +1 -1
  33. package/src/multi-select/multi-select.d.ts +1 -0
  34. package/src/multi-select/multi-select.js +36 -9
  35. package/styles/auto-complete/bootstrap-dark.scss +1 -1
  36. package/styles/auto-complete/bootstrap.scss +1 -1
  37. package/styles/auto-complete/bootstrap4.scss +1 -1
  38. package/styles/auto-complete/bootstrap5-dark.scss +1 -1
  39. package/styles/auto-complete/bootstrap5.scss +1 -1
  40. package/styles/auto-complete/fabric-dark.scss +1 -1
  41. package/styles/auto-complete/fabric.scss +1 -1
  42. package/styles/auto-complete/fluent-dark.scss +1 -1
  43. package/styles/auto-complete/fluent.scss +1 -1
  44. package/styles/auto-complete/highcontrast-light.scss +1 -1
  45. package/styles/auto-complete/highcontrast.scss +1 -1
  46. package/styles/auto-complete/material-dark.css +0 -1
  47. package/styles/auto-complete/material-dark.scss +1 -1
  48. package/styles/auto-complete/material.css +0 -1
  49. package/styles/auto-complete/material.scss +1 -1
  50. package/styles/auto-complete/material3-dark.css +0 -1
  51. package/styles/auto-complete/material3-dark.scss +1 -1
  52. package/styles/auto-complete/material3.css +0 -1
  53. package/styles/auto-complete/material3.scss +1 -1
  54. package/styles/auto-complete/tailwind-dark.css +0 -1
  55. package/styles/auto-complete/tailwind-dark.scss +1 -1
  56. package/styles/auto-complete/tailwind.css +0 -1
  57. package/styles/auto-complete/tailwind.scss +1 -1
  58. package/styles/bootstrap-dark.css +70 -15
  59. package/styles/bootstrap.css +70 -15
  60. package/styles/bootstrap4.css +71 -16
  61. package/styles/bootstrap5-dark.css +71 -16
  62. package/styles/bootstrap5.css +71 -16
  63. package/styles/combo-box/bootstrap-dark.scss +1 -1
  64. package/styles/combo-box/bootstrap.scss +1 -1
  65. package/styles/combo-box/bootstrap4.scss +1 -1
  66. package/styles/combo-box/bootstrap5-dark.scss +1 -1
  67. package/styles/combo-box/bootstrap5.scss +1 -1
  68. package/styles/combo-box/fabric-dark.scss +1 -1
  69. package/styles/combo-box/fabric.scss +1 -1
  70. package/styles/combo-box/fluent-dark.scss +1 -1
  71. package/styles/combo-box/fluent.scss +1 -1
  72. package/styles/combo-box/highcontrast-light.scss +1 -1
  73. package/styles/combo-box/highcontrast.scss +1 -1
  74. package/styles/combo-box/material-dark.css +0 -1
  75. package/styles/combo-box/material-dark.scss +1 -1
  76. package/styles/combo-box/material.css +0 -1
  77. package/styles/combo-box/material.scss +1 -1
  78. package/styles/combo-box/material3-dark.css +0 -1
  79. package/styles/combo-box/material3-dark.scss +1 -1
  80. package/styles/combo-box/material3.css +0 -1
  81. package/styles/combo-box/material3.scss +1 -1
  82. package/styles/combo-box/tailwind-dark.css +0 -1
  83. package/styles/combo-box/tailwind-dark.scss +1 -1
  84. package/styles/combo-box/tailwind.css +0 -1
  85. package/styles/combo-box/tailwind.scss +1 -1
  86. package/styles/drop-down-base/bootstrap-dark.scss +1 -1
  87. package/styles/drop-down-base/bootstrap.scss +1 -1
  88. package/styles/drop-down-base/bootstrap4.scss +1 -1
  89. package/styles/drop-down-base/bootstrap5-dark.scss +1 -1
  90. package/styles/drop-down-base/bootstrap5.scss +1 -1
  91. package/styles/drop-down-base/fabric-dark.scss +1 -1
  92. package/styles/drop-down-base/fabric.scss +1 -1
  93. package/styles/drop-down-base/fluent-dark.scss +1 -1
  94. package/styles/drop-down-base/fluent.scss +1 -1
  95. package/styles/drop-down-base/highcontrast-light.scss +1 -1
  96. package/styles/drop-down-base/highcontrast.scss +1 -1
  97. package/styles/drop-down-base/material-dark.css +0 -1
  98. package/styles/drop-down-base/material-dark.scss +1 -1
  99. package/styles/drop-down-base/material.css +0 -1
  100. package/styles/drop-down-base/material.scss +1 -1
  101. package/styles/drop-down-base/material3-dark.css +0 -1
  102. package/styles/drop-down-base/material3-dark.scss +1 -1
  103. package/styles/drop-down-base/material3.css +0 -1
  104. package/styles/drop-down-base/material3.scss +1 -1
  105. package/styles/drop-down-base/tailwind-dark.css +0 -1
  106. package/styles/drop-down-base/tailwind-dark.scss +1 -1
  107. package/styles/drop-down-base/tailwind.css +0 -1
  108. package/styles/drop-down-base/tailwind.scss +1 -1
  109. package/styles/drop-down-list/bootstrap-dark.scss +2 -1
  110. package/styles/drop-down-list/bootstrap.scss +2 -1
  111. package/styles/drop-down-list/bootstrap4.scss +2 -1
  112. package/styles/drop-down-list/bootstrap5-dark.scss +2 -1
  113. package/styles/drop-down-list/bootstrap5.scss +2 -1
  114. package/styles/drop-down-list/fabric-dark.scss +2 -1
  115. package/styles/drop-down-list/fabric.scss +2 -1
  116. package/styles/drop-down-list/fluent-dark.scss +2 -1
  117. package/styles/drop-down-list/fluent.scss +2 -1
  118. package/styles/drop-down-list/highcontrast-light.scss +2 -1
  119. package/styles/drop-down-list/highcontrast.scss +2 -1
  120. package/styles/drop-down-list/material-dark.css +0 -1
  121. package/styles/drop-down-list/material-dark.scss +2 -1
  122. package/styles/drop-down-list/material.css +0 -1
  123. package/styles/drop-down-list/material.scss +2 -1
  124. package/styles/drop-down-list/material3-dark.css +0 -1
  125. package/styles/drop-down-list/material3-dark.scss +2 -1
  126. package/styles/drop-down-list/material3.css +0 -1
  127. package/styles/drop-down-list/material3.scss +2 -1
  128. package/styles/drop-down-list/tailwind-dark.css +0 -1
  129. package/styles/drop-down-list/tailwind-dark.scss +2 -1
  130. package/styles/drop-down-list/tailwind.css +0 -1
  131. package/styles/drop-down-list/tailwind.scss +2 -1
  132. package/styles/drop-down-tree/bootstrap-dark.scss +1 -1
  133. package/styles/drop-down-tree/bootstrap.scss +1 -1
  134. package/styles/drop-down-tree/bootstrap4.scss +1 -1
  135. package/styles/drop-down-tree/bootstrap5-dark.scss +1 -1
  136. package/styles/drop-down-tree/bootstrap5.scss +1 -1
  137. package/styles/drop-down-tree/fabric-dark.scss +1 -1
  138. package/styles/drop-down-tree/fabric.scss +1 -1
  139. package/styles/drop-down-tree/fluent-dark.scss +1 -1
  140. package/styles/drop-down-tree/fluent.scss +1 -1
  141. package/styles/drop-down-tree/highcontrast-light.scss +1 -1
  142. package/styles/drop-down-tree/highcontrast.scss +1 -1
  143. package/styles/drop-down-tree/material-dark.css +0 -1
  144. package/styles/drop-down-tree/material-dark.scss +1 -1
  145. package/styles/drop-down-tree/material.css +0 -1
  146. package/styles/drop-down-tree/material.scss +1 -1
  147. package/styles/drop-down-tree/material3-dark.css +0 -1
  148. package/styles/drop-down-tree/material3-dark.scss +1 -1
  149. package/styles/drop-down-tree/material3.css +0 -1
  150. package/styles/drop-down-tree/material3.scss +1 -1
  151. package/styles/drop-down-tree/tailwind-dark.css +0 -1
  152. package/styles/drop-down-tree/tailwind-dark.scss +1 -1
  153. package/styles/drop-down-tree/tailwind.css +0 -1
  154. package/styles/drop-down-tree/tailwind.scss +1 -1
  155. package/styles/fabric-dark.css +70 -15
  156. package/styles/fabric.css +70 -15
  157. package/styles/fluent-dark.css +71 -16
  158. package/styles/fluent.css +71 -16
  159. package/styles/highcontrast-light.css +70 -15
  160. package/styles/highcontrast.css +70 -15
  161. package/styles/list-box/_bootstrap-dark-definition.scss +6 -2
  162. package/styles/list-box/_bootstrap-definition.scss +7 -3
  163. package/styles/list-box/_bootstrap4-definition.scss +10 -6
  164. package/styles/list-box/_bootstrap5-definition.scss +6 -4
  165. package/styles/list-box/_fabric-dark-definition.scss +6 -2
  166. package/styles/list-box/_fabric-definition.scss +6 -2
  167. package/styles/list-box/_fluent-definition.scss +10 -8
  168. package/styles/list-box/_highcontrast-definition.scss +6 -2
  169. package/styles/list-box/_highcontrast-light-definition.scss +6 -2
  170. package/styles/list-box/_layout.scss +0 -6
  171. package/styles/list-box/_material-dark-definition.scss +8 -4
  172. package/styles/list-box/_material-definition.scss +8 -4
  173. package/styles/list-box/_material3-definition.scss +10 -8
  174. package/styles/list-box/_tailwind-definition.scss +9 -7
  175. package/styles/list-box/_theme.scss +72 -7
  176. package/styles/list-box/bootstrap-dark.css +70 -15
  177. package/styles/list-box/bootstrap-dark.scss +1 -1
  178. package/styles/list-box/bootstrap.css +70 -15
  179. package/styles/list-box/bootstrap.scss +1 -1
  180. package/styles/list-box/bootstrap4.css +71 -16
  181. package/styles/list-box/bootstrap4.scss +1 -1
  182. package/styles/list-box/bootstrap5-dark.css +71 -16
  183. package/styles/list-box/bootstrap5-dark.scss +1 -1
  184. package/styles/list-box/bootstrap5.css +71 -16
  185. package/styles/list-box/bootstrap5.scss +1 -1
  186. package/styles/list-box/fabric-dark.css +70 -15
  187. package/styles/list-box/fabric-dark.scss +1 -1
  188. package/styles/list-box/fabric.css +70 -15
  189. package/styles/list-box/fabric.scss +1 -1
  190. package/styles/list-box/fluent-dark.css +71 -16
  191. package/styles/list-box/fluent-dark.scss +1 -1
  192. package/styles/list-box/fluent.css +71 -16
  193. package/styles/list-box/fluent.scss +1 -1
  194. package/styles/list-box/highcontrast-light.css +70 -15
  195. package/styles/list-box/highcontrast-light.scss +1 -1
  196. package/styles/list-box/highcontrast.css +70 -15
  197. package/styles/list-box/highcontrast.scss +1 -1
  198. package/styles/list-box/material-dark.css +71 -17
  199. package/styles/list-box/material-dark.scss +1 -1
  200. package/styles/list-box/material.css +71 -17
  201. package/styles/list-box/material.scss +1 -1
  202. package/styles/list-box/material3-dark.css +71 -17
  203. package/styles/list-box/material3-dark.scss +1 -1
  204. package/styles/list-box/material3.css +71 -17
  205. package/styles/list-box/material3.scss +1 -1
  206. package/styles/list-box/tailwind-dark.css +71 -17
  207. package/styles/list-box/tailwind-dark.scss +1 -1
  208. package/styles/list-box/tailwind.css +71 -17
  209. package/styles/list-box/tailwind.scss +1 -1
  210. package/styles/material-dark.css +71 -17
  211. package/styles/material.css +71 -17
  212. package/styles/material3-dark.css +71 -17
  213. package/styles/material3-dark.scss +1 -1
  214. package/styles/material3.css +71 -17
  215. package/styles/material3.scss +1 -1
  216. package/styles/mention/bootstrap-dark.scss +1 -1
  217. package/styles/mention/bootstrap.scss +1 -1
  218. package/styles/mention/bootstrap4.scss +1 -1
  219. package/styles/mention/bootstrap5-dark.scss +1 -1
  220. package/styles/mention/bootstrap5.scss +1 -1
  221. package/styles/mention/fabric-dark.scss +1 -1
  222. package/styles/mention/fabric.scss +1 -1
  223. package/styles/mention/fluent-dark.scss +1 -1
  224. package/styles/mention/fluent.scss +1 -1
  225. package/styles/mention/highcontrast-light.scss +1 -1
  226. package/styles/mention/highcontrast.scss +1 -1
  227. package/styles/mention/material-dark.css +0 -1
  228. package/styles/mention/material-dark.scss +1 -1
  229. package/styles/mention/material.css +0 -1
  230. package/styles/mention/material.scss +1 -1
  231. package/styles/mention/material3-dark.css +0 -1
  232. package/styles/mention/material3-dark.scss +1 -1
  233. package/styles/mention/material3.css +0 -1
  234. package/styles/mention/material3.scss +1 -1
  235. package/styles/mention/tailwind-dark.css +0 -1
  236. package/styles/mention/tailwind-dark.scss +1 -1
  237. package/styles/mention/tailwind.css +0 -1
  238. package/styles/mention/tailwind.scss +1 -1
  239. package/styles/multi-select/bootstrap-dark.scss +1 -1
  240. package/styles/multi-select/bootstrap.scss +1 -1
  241. package/styles/multi-select/bootstrap4.scss +1 -1
  242. package/styles/multi-select/bootstrap5-dark.scss +1 -1
  243. package/styles/multi-select/bootstrap5.scss +1 -1
  244. package/styles/multi-select/fabric-dark.scss +1 -1
  245. package/styles/multi-select/fabric.scss +1 -1
  246. package/styles/multi-select/fluent-dark.scss +1 -1
  247. package/styles/multi-select/fluent.scss +1 -1
  248. package/styles/multi-select/highcontrast-light.scss +1 -1
  249. package/styles/multi-select/highcontrast.scss +1 -1
  250. package/styles/multi-select/material-dark.css +0 -1
  251. package/styles/multi-select/material-dark.scss +1 -1
  252. package/styles/multi-select/material.css +0 -1
  253. package/styles/multi-select/material.scss +1 -1
  254. package/styles/multi-select/material3-dark.css +0 -1
  255. package/styles/multi-select/material3-dark.scss +1 -1
  256. package/styles/multi-select/material3.css +0 -1
  257. package/styles/multi-select/material3.scss +1 -1
  258. package/styles/multi-select/tailwind-dark.css +0 -1
  259. package/styles/multi-select/tailwind-dark.scss +1 -1
  260. package/styles/multi-select/tailwind.css +0 -1
  261. package/styles/multi-select/tailwind.scss +1 -1
  262. package/styles/tailwind-dark.css +71 -24
  263. package/styles/tailwind.css +71 -24
  264. package/tslint.json +111 -0
@@ -28,6 +28,8 @@ import { Input } from '@syncfusion/ej2-inputs';
28
28
  import { incrementalSearch, resetIncrementalSearchValues } from '../common/incremental-search';
29
29
  import { DropDownBase, dropDownBaseClasses } from '../drop-down-base/drop-down-base';
30
30
  import { DataManager, Query, Predicate } from '@syncfusion/ej2-data';
31
+ import { Skeleton } from '@syncfusion/ej2-notifications';
32
+ [];
31
33
  // don't use space in classnames
32
34
  export var dropDownListClasses = {
33
35
  root: 'e-dropdownlist',
@@ -38,6 +40,7 @@ export var dropDownListClasses = {
38
40
  disable: dropDownBaseClasses.disabled,
39
41
  base: dropDownBaseClasses.root,
40
42
  focus: dropDownBaseClasses.focus,
43
+ content: dropDownBaseClasses.content,
41
44
  input: 'e-input-group',
42
45
  inputFocus: 'e-input-focus',
43
46
  icon: 'e-input-group-icon e-ddl-icon',
@@ -55,7 +58,8 @@ export var dropDownListClasses = {
55
58
  clearIconHide: 'e-clear-icon-hide',
56
59
  popupFullScreen: 'e-popup-full-page',
57
60
  disableIcon: 'e-ddl-disable-icon',
58
- hiddenElement: 'e-ddl-hidden'
61
+ hiddenElement: 'e-ddl-hidden',
62
+ virtualList: 'e-list-item e-virtual-list',
59
63
  };
60
64
  var inputObject = {
61
65
  container: null,
@@ -83,9 +87,52 @@ var DropDownList = /** @class */ (function (_super) {
83
87
  */
84
88
  function DropDownList(options, element) {
85
89
  var _this = _super.call(this, options, element) || this;
90
+ _this.skeletonCount = 32;
86
91
  _this.isListSearched = false;
87
92
  _this.preventChange = false;
88
93
  _this.isAngular = false;
94
+ _this.itemCount = 10;
95
+ _this.virtualListHeight = 0;
96
+ _this.isVirtualScrolling = false;
97
+ _this.isPreventScrollAction = false;
98
+ _this.scrollPreStartIndex = 0;
99
+ _this.isScrollActionTriggered = false;
100
+ _this.previousStartIndex = 0;
101
+ _this.isMouseScrollAction = false;
102
+ _this.isKeyBoardAction = false;
103
+ _this.isUpwardScrolling = false;
104
+ _this.startIndex = 0;
105
+ _this.currentPageNumber = 0;
106
+ _this.pageCount = 0;
107
+ _this.isPreventKeyAction = false;
108
+ _this.generatedDataObject = {};
109
+ _this.virtualListInfo = {
110
+ currentPageNumber: null,
111
+ direction: null,
112
+ sentinelInfo: {},
113
+ offsets: {},
114
+ startIndex: 0,
115
+ endIndex: 0,
116
+ };
117
+ _this.viewPortInfo = {
118
+ currentPageNumber: null,
119
+ direction: null,
120
+ sentinelInfo: {},
121
+ offsets: {},
122
+ startIndex: 0,
123
+ endIndex: 0,
124
+ };
125
+ _this.selectedValueInfo = {
126
+ currentPageNumber: null,
127
+ direction: null,
128
+ sentinelInfo: {},
129
+ offsets: {},
130
+ startIndex: 0,
131
+ endIndex: 0,
132
+ };
133
+ _this.IsScrollerAtEnd = function () {
134
+ return this.list && this.list.scrollTop + this.list.clientHeight >= this.list.scrollHeight;
135
+ };
89
136
  return _this;
90
137
  }
91
138
  /**
@@ -144,14 +191,31 @@ var DropDownList = /** @class */ (function (_super) {
144
191
  hide: 'alt+38',
145
192
  space: '32'
146
193
  };
194
+ this.viewPortInfo = {
195
+ currentPageNumber: null,
196
+ direction: null,
197
+ sentinelInfo: {},
198
+ offsets: {},
199
+ startIndex: 0,
200
+ endIndex: this.itemCount,
201
+ };
147
202
  };
148
203
  DropDownList.prototype.setZIndex = function () {
149
204
  if (this.popupObj) {
150
205
  this.popupObj.setProperties({ 'zIndex': this.zIndex });
151
206
  }
152
207
  };
208
+ DropDownList.prototype.requiredModules = function () {
209
+ var modules = [];
210
+ if (this.enableVirtualization) {
211
+ modules.push({ args: [this], member: 'VirtualScroll' });
212
+ }
213
+ return modules;
214
+ };
153
215
  DropDownList.prototype.renderList = function (e, isEmptyData) {
154
216
  _super.prototype.render.call(this, e, isEmptyData);
217
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
218
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
155
219
  this.unWireListEvents();
156
220
  this.wireListEvents();
157
221
  };
@@ -169,6 +233,12 @@ var DropDownList = /** @class */ (function (_super) {
169
233
  DropDownList.prototype.resetHandler = function (e) {
170
234
  e.preventDefault();
171
235
  this.clearAll(e);
236
+ if (this.enableVirtualization) {
237
+ this.list.scrollTop = 0;
238
+ this.virtualListInfo = null;
239
+ this.previousStartIndex = 0;
240
+ this.previousEndIndex = 0;
241
+ }
172
242
  };
173
243
  DropDownList.prototype.resetFocusElement = function () {
174
244
  this.removeHover();
@@ -177,6 +247,9 @@ var DropDownList = /** @class */ (function (_super) {
177
247
  this.list.scrollTop = 0;
178
248
  if (this.getModuleName() !== 'autocomplete' && !isNullOrUndefined(this.ulElement)) {
179
249
  var li = this.ulElement.querySelector('.' + dropDownListClasses.li);
250
+ if (this.enableVirtualization) {
251
+ li = this.liCollections[this.skeletonCount];
252
+ }
180
253
  if (li) {
181
254
  li.classList.add(dropDownListClasses.focus);
182
255
  }
@@ -195,6 +268,10 @@ var DropDownList = /** @class */ (function (_super) {
195
268
  return;
196
269
  }
197
270
  this.onChangeEvent(e);
271
+ this.checkAndResetCache();
272
+ if (this.enableVirtualization) {
273
+ this.updateInitialData();
274
+ }
198
275
  };
199
276
  DropDownList.prototype.resetSelection = function (properties) {
200
277
  if (this.list) {
@@ -261,10 +338,10 @@ var DropDownList = /** @class */ (function (_super) {
261
338
  this.inputWrapper.container.setAttribute('style', this.htmlAttributes["" + htmlAttr]);
262
339
  }
263
340
  else if (htmlAttr === 'aria-label') {
264
- if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
341
+ if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') && !this.readonly) {
265
342
  this.inputElement.setAttribute('aria-label', this.htmlAttributes["" + htmlAttr]);
266
343
  }
267
- else {
344
+ else if (this.getModuleName() === 'dropdownlist') {
268
345
  this.inputWrapper.container.setAttribute('aria-label', this.htmlAttributes["" + htmlAttr]);
269
346
  }
270
347
  }
@@ -364,6 +441,8 @@ var DropDownList = /** @class */ (function (_super) {
364
441
  return item;
365
442
  };
366
443
  DropDownList.prototype.initValue = function () {
444
+ this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
445
+ this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.itemCount;
367
446
  this.renderList();
368
447
  if (this.dataSource instanceof DataManager) {
369
448
  this.initRemoteRender = true;
@@ -373,6 +452,7 @@ var DropDownList = /** @class */ (function (_super) {
373
452
  }
374
453
  };
375
454
  DropDownList.prototype.updateValues = function () {
455
+ this.selectedValueInfo = this.viewPortInfo;
376
456
  if (!isNullOrUndefined(this.value)) {
377
457
  this.setSelection(this.getElementByValue(this.value), null);
378
458
  }
@@ -561,6 +641,7 @@ var DropDownList = /** @class */ (function (_super) {
561
641
  };
562
642
  DropDownList.prototype.onMouseClick = function (e) {
563
643
  var target = e.target;
644
+ this.keyboardEvent = null;
564
645
  var li = closest(target, '.' + dropDownBaseClasses.li);
565
646
  if (!this.isValidLI(li)) {
566
647
  return;
@@ -641,6 +722,10 @@ var DropDownList = /** @class */ (function (_super) {
641
722
  if (!this.enabled) {
642
723
  return;
643
724
  }
725
+ this.keyboardEvent = e;
726
+ if (this.isPreventKeyAction && this.enableVirtualization) {
727
+ e.preventDefault();
728
+ }
644
729
  var preventAction = e.action === 'pageUp' || e.action === 'pageDown';
645
730
  var preventHomeEnd = this.getModuleName() !== 'dropdownlist' && (e.action === 'home' || e.action === 'end');
646
731
  this.isEscapeKey = e.action === 'escape';
@@ -680,9 +765,11 @@ var DropDownList = /** @class */ (function (_super) {
680
765
  e.preventDefault();
681
766
  break;
682
767
  case 'home':
768
+ this.isMouseScrollAction = true;
683
769
  this.updateHomeEndAction(e);
684
770
  break;
685
771
  case 'end':
772
+ this.isMouseScrollAction = true;
686
773
  this.updateHomeEndAction(e);
687
774
  break;
688
775
  case 'space':
@@ -716,13 +803,19 @@ var DropDownList = /** @class */ (function (_super) {
716
803
  }
717
804
  }
718
805
  };
719
- DropDownList.prototype.updateUpDownAction = function (e) {
806
+ DropDownList.prototype.updateUpDownAction = function (e, isVirtualKeyAction) {
720
807
  var focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
721
- if (this.isSelectFocusItem(focusEle)) {
808
+ if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
722
809
  this.setSelection(focusEle, e);
810
+ if (this.enableVirtualization) {
811
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
812
+ this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
813
+ }
723
814
  }
724
815
  else if (!isNullOrUndefined(this.liCollections)) {
816
+ var virtualIndex = this.activeIndex;
725
817
  var index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
818
+ index = isVirtualKeyAction ? virtualIndex : index;
726
819
  var startIndex = 0;
727
820
  if (this.getModuleName() === 'autocomplete') {
728
821
  startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
@@ -730,8 +823,26 @@ var DropDownList = /** @class */ (function (_super) {
730
823
  }
731
824
  var nextItem = void 0;
732
825
  if (this.getModuleName() !== 'autocomplete' || this.getModuleName() === 'autocomplete' && this.isPopupOpen) {
733
- nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
734
- : this.liCollections[index];
826
+ if (!this.enableVirtualization) {
827
+ nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
828
+ : this.liCollections[index];
829
+ }
830
+ else {
831
+ if (!isVirtualKeyAction) {
832
+ nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[this.skeletonCount]
833
+ : this.liCollections[index];
834
+ nextItem = !isNullOrUndefined(nextItem) && !nextItem.classList.contains('e-virtual-list') ? nextItem : null;
835
+ }
836
+ else {
837
+ if (this.getModuleName() === 'autocomplete') {
838
+ var value = this.selectedLI.dataset.value;
839
+ nextItem = this.getElementByValue(value);
840
+ }
841
+ else {
842
+ nextItem = this.getElementByValue(this.getItemData().value);
843
+ }
844
+ }
845
+ }
735
846
  }
736
847
  if (!isNullOrUndefined(nextItem)) {
737
848
  this.setSelection(nextItem, e);
@@ -739,17 +850,23 @@ var DropDownList = /** @class */ (function (_super) {
739
850
  }
740
851
  e.preventDefault();
741
852
  };
742
- DropDownList.prototype.updateHomeEndAction = function (e) {
853
+ DropDownList.prototype.updateHomeEndAction = function (e, isVirtualKeyAction) {
743
854
  if (this.getModuleName() === 'dropdownlist') {
744
855
  var findLi = 0;
745
856
  if (e.action === 'home') {
746
857
  findLi = 0;
858
+ if (this.enableVirtualization) {
859
+ findLi = this.skeletonCount;
860
+ }
747
861
  }
748
862
  else {
749
863
  findLi = this.getItems().length - 1;
750
864
  }
751
865
  e.preventDefault();
752
866
  if (this.activeIndex === findLi) {
867
+ if (isVirtualKeyAction) {
868
+ this.setSelection(this.liCollections[findLi], e);
869
+ }
753
870
  return;
754
871
  }
755
872
  this.setSelection(this.liCollections[findLi], e);
@@ -787,6 +904,36 @@ var DropDownList = /** @class */ (function (_super) {
787
904
  }
788
905
  }
789
906
  };
907
+ DropDownList.prototype.handleVirtualKeyboardActions = function (e, pageCount) {
908
+ switch (e.action) {
909
+ case 'down':
910
+ case 'up':
911
+ if (this.itemData != null || this.getModuleName() === 'autocomplete') {
912
+ this.updateUpDownAction(e, true);
913
+ }
914
+ break;
915
+ case 'pageUp':
916
+ var count = (pageCount * 2) - 4;
917
+ this.activeIndex = Math.round(count);
918
+ this.pageUpSelection(this.activeIndex - this.getPageCount(), e, true);
919
+ e.preventDefault();
920
+ break;
921
+ case 'pageDown':
922
+ this.activeIndex = 1;
923
+ this.pageDownSelection(this.activeIndex + this.getPageCount(), e, true);
924
+ e.preventDefault();
925
+ break;
926
+ case 'home':
927
+ this.isMouseScrollAction = true;
928
+ this.updateHomeEndAction(e, true);
929
+ break;
930
+ case 'end':
931
+ this.isMouseScrollAction = true;
932
+ this.updateHomeEndAction(e, true);
933
+ break;
934
+ }
935
+ this.keyboardEvent = null;
936
+ };
790
937
  DropDownList.prototype.selectCurrentItem = function (e) {
791
938
  if (this.isPopupOpen) {
792
939
  var li = this.list.querySelector('.' + dropDownListClasses.focus);
@@ -808,19 +955,39 @@ var DropDownList = /** @class */ (function (_super) {
808
955
  DropDownList.prototype.isSelectFocusItem = function (element) {
809
956
  return !isNullOrUndefined(element);
810
957
  };
811
- DropDownList.prototype.getPageCount = function () {
958
+ DropDownList.prototype.getPageCount = function (returnExactCount) {
812
959
  var liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
813
960
  getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
814
- return Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
961
+ var pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
962
+ return returnExactCount ? pageCount : Math.round(pageCount);
815
963
  };
816
- DropDownList.prototype.pageUpSelection = function (steps, event) {
964
+ DropDownList.prototype.pageUpSelection = function (steps, event, isVirtualKeyAction) {
817
965
  var previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
818
- this.setSelection(previousItem, event);
966
+ if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
967
+ previousItem = steps >= 0 ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
968
+ }
969
+ if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
970
+ previousItem = this.liCollections[this.skeletonCount];
971
+ }
972
+ this.PageUpDownSelection(previousItem, event);
819
973
  };
820
- DropDownList.prototype.pageDownSelection = function (steps, event) {
974
+ DropDownList.prototype.PageUpDownSelection = function (previousItem, event) {
975
+ if (this.enableVirtualization) {
976
+ if (!isNullOrUndefined(previousItem) && ((this.getModuleName() !== 'autocomplete' && !previousItem.classList.contains('e-active')) || (this.getModuleName() === 'autocomplete' && !previousItem.classList.contains('e-item-focus')))) {
977
+ this.setSelection(previousItem, event);
978
+ }
979
+ }
980
+ else {
981
+ this.setSelection(previousItem, event);
982
+ }
983
+ };
984
+ DropDownList.prototype.pageDownSelection = function (steps, event, isVirtualKeyAction) {
821
985
  var list = this.getItems();
822
986
  var previousItem = steps <= list.length ? this.liCollections[steps - 1] : this.liCollections[list.length - 1];
823
- this.setSelection(previousItem, event);
987
+ if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
988
+ previousItem = steps <= list.length ? this.liCollections[steps + this.skeletonCount - 1] : this.liCollections[list.length - 1];
989
+ }
990
+ this.PageUpDownSelection(previousItem, event);
824
991
  };
825
992
  DropDownList.prototype.unWireEvent = function () {
826
993
  if (!isNullOrUndefined(this.inputWrapper)) {
@@ -885,6 +1052,7 @@ var DropDownList = /** @class */ (function (_super) {
885
1052
  if (e.which === 3 || e.button === 2) {
886
1053
  return;
887
1054
  }
1055
+ this.keyboardEvent = null;
888
1056
  if (this.targetElement().classList.contains(dropDownListClasses.disable) || this.inputWrapper.clearButton === e.target) {
889
1057
  return;
890
1058
  }
@@ -1030,6 +1198,14 @@ var DropDownList = /** @class */ (function (_super) {
1030
1198
  }
1031
1199
  else {
1032
1200
  this.setSelectOptions(li, e);
1201
+ if (this.enableVirtualization) {
1202
+ var fields = (this.fields.value) ? this.fields.value : '';
1203
+ var getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
1204
+ if (getItem && getItem.length > 0) {
1205
+ this.itemData = getItem[0];
1206
+ this.setProperties({ 'text': getItem[0].text, 'value': getItem[0].value }, true);
1207
+ }
1208
+ }
1033
1209
  }
1034
1210
  };
1035
1211
  DropDownList.prototype.setSelectOptions = function (li, e) {
@@ -1288,6 +1464,9 @@ var DropDownList = /** @class */ (function (_super) {
1288
1464
  this.typedString = this.filterInput.value;
1289
1465
  this.preventAutoFill = false;
1290
1466
  this.searchLists(e);
1467
+ if (this.enableVirtualization) {
1468
+ this.getFilteringSkeletonCount();
1469
+ }
1291
1470
  break;
1292
1471
  }
1293
1472
  }
@@ -1295,6 +1474,33 @@ var DropDownList = /** @class */ (function (_super) {
1295
1474
  this.isValidKey = false;
1296
1475
  }
1297
1476
  };
1477
+ DropDownList.prototype.getFilteringSkeletonCount = function () {
1478
+ var difference = this.dataCount - this.viewPortInfo.endIndex;
1479
+ var currentSkeletonCount = this.skeletonCount;
1480
+ this.getSkeletonCount(true);
1481
+ this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
1482
+ if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
1483
+ var isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
1484
+ if (currentSkeletonCount !== this.skeletonCount) {
1485
+ this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
1486
+ }
1487
+ else {
1488
+ this.UpdateSkeleton();
1489
+ }
1490
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
1491
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1492
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
1493
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1494
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
1495
+ }
1496
+ };
1497
+ DropDownList.prototype.getSkeletonCount = function (retainSkeleton) {
1498
+ this.virtualListHeight = this.listHeight != null ? parseInt(this.listHeight, 10) : this.virtualListHeight;
1499
+ var actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
1500
+ this.skeletonCount = actualCount * 2 < this.itemCount ? this.itemCount : actualCount * 2;
1501
+ this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
1502
+ this.skeletonCount = Math.floor(this.skeletonCount / 2) + 2;
1503
+ };
1298
1504
  DropDownList.prototype.onFilterDown = function (e) {
1299
1505
  switch (e.keyCode) {
1300
1506
  case 13: //enter
@@ -1338,6 +1544,14 @@ var DropDownList = /** @class */ (function (_super) {
1338
1544
  else {
1339
1545
  filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
1340
1546
  }
1547
+ if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0)) {
1548
+ var takeValue = this.getTakeValue();
1549
+ if (this.allowFiltering) {
1550
+ filterQuery.skip(this.virtualItemStartIndex);
1551
+ }
1552
+ filterQuery.take(takeValue);
1553
+ filterQuery.requiresCount();
1554
+ }
1341
1555
  return filterQuery;
1342
1556
  };
1343
1557
  DropDownList.prototype.getSelectionPoints = function () {
@@ -1355,6 +1569,7 @@ var DropDownList = /** @class */ (function (_super) {
1355
1569
  }
1356
1570
  this.isDataFetched = false;
1357
1571
  if (this.isFiltering()) {
1572
+ this.checkAndResetCache();
1358
1573
  var eventArgs_1 = {
1359
1574
  preventDefaultAction: false,
1360
1575
  text: this.filterInput.value,
@@ -1392,10 +1607,30 @@ var DropDownList = /** @class */ (function (_super) {
1392
1607
  if (!isNullOrUndefined(this.filterInput)) {
1393
1608
  this.beforePopupOpen = (!this.isPopupOpen && this.getModuleName() === 'combobox' && this.filterInput.value === '') ?
1394
1609
  false : true;
1610
+ var isNoData = this.list.classList.contains(dropDownBaseClasses.noData);
1395
1611
  if (this.filterInput.value.trim() === '' && !this.itemTemplate) {
1396
1612
  this.actionCompleteData.isUpdated = false;
1397
1613
  this.isTyped = false;
1398
1614
  if (!isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {
1615
+ if (this.enableVirtualization) {
1616
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1617
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
1618
+ this.resetList(dataSource, fields, query);
1619
+ if (isNoData && !this.list.classList.contains(dropDownBaseClasses.noData)) {
1620
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
1621
+ this.list.appendChild(this.createElement('div', {
1622
+ className: 'e-virtual-ddl-content',
1623
+ styles: this.getTransformValues()
1624
+ })).appendChild(this.list.querySelector('.e-list-parent'));
1625
+ }
1626
+ if (!this.list.querySelector('.e-virtual-ddl')) {
1627
+ var virualElement = this.createElement('div', {
1628
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
1629
+ });
1630
+ document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
1631
+ }
1632
+ }
1633
+ }
1399
1634
  this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list);
1400
1635
  }
1401
1636
  this.isTyped = true;
@@ -1408,7 +1643,30 @@ var DropDownList = /** @class */ (function (_super) {
1408
1643
  else {
1409
1644
  this.isNotSearchList = false;
1410
1645
  query = (this.filterInput.value.trim() === '') ? null : query;
1646
+ if (this.enableVirtualization && this.isFiltering() && this.isTyped) {
1647
+ this.isPreventScrollAction = true;
1648
+ this.list.scrollTop = 0;
1649
+ this.previousStartIndex = 0;
1650
+ this.virtualListInfo = null;
1651
+ }
1411
1652
  this.resetList(dataSource, fields, query);
1653
+ if (this.enableVirtualization && isNoData && !this.list.classList.contains(dropDownBaseClasses.noData)) {
1654
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
1655
+ this.list.appendChild(this.createElement('div', {
1656
+ className: 'e-virtual-ddl-content',
1657
+ styles: this.getTransformValues()
1658
+ })).appendChild(this.list.querySelector('.e-list-parent'));
1659
+ }
1660
+ if (!this.list.querySelector('.e-virtual-ddl')) {
1661
+ var virualElement = this.createElement('div', {
1662
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
1663
+ });
1664
+ document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
1665
+ }
1666
+ }
1667
+ }
1668
+ if (this.enableVirtualization) {
1669
+ this.getFilteringSkeletonCount();
1412
1670
  }
1413
1671
  this.renderReactTemplates();
1414
1672
  }
@@ -1506,16 +1764,48 @@ var DropDownList = /** @class */ (function (_super) {
1506
1764
  this.renderPopup();
1507
1765
  }
1508
1766
  };
1767
+ DropDownList.prototype.UpdateSkeleton = function (isSkeletonCountChange, skeletonCount) {
1768
+ var isContainSkeleton = this.list.querySelector('.e-virtual-ddl-content');
1769
+ var isContainVirtualList = this.list.querySelector('.e-virtual-list');
1770
+ if (isContainSkeleton && (!isContainVirtualList || isSkeletonCountChange) && this.enableVirtualization) {
1771
+ var totalSkeletonCount = isSkeletonCountChange ? skeletonCount : this.skeletonCount;
1772
+ for (var i = 0; i < totalSkeletonCount; i++) {
1773
+ var liElement = this.createElement('li', { className: dropDownListClasses.virtualList, styles: 'overflow: inherit' });
1774
+ if (this.enableVirtualization && this.itemTemplate) {
1775
+ liElement.style.height = this.listItemHeight + 'px';
1776
+ }
1777
+ var skeleton = new Skeleton({
1778
+ shape: "Text",
1779
+ height: "10px",
1780
+ width: "95%",
1781
+ cssClass: "e-skeleton-text",
1782
+ });
1783
+ skeleton.appendTo(this.createElement('div'));
1784
+ liElement.appendChild(skeleton.element);
1785
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1786
+ isContainSkeleton.firstChild.insertBefore(liElement, isContainSkeleton.firstChild.children[0]);
1787
+ }
1788
+ }
1789
+ };
1790
+ DropDownList.prototype.getTakeValue = function () {
1791
+ return this.allowFiltering && this.getModuleName() === 'dropdownlist' && Browser.isDevice ? Math.round(window.outerHeight / this.listItemHeight) : this.itemCount;
1792
+ };
1509
1793
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1510
1794
  DropDownList.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
1511
1795
  var _this = this;
1512
- if (this.isNotSearchList) {
1796
+ if (this.dataSource instanceof DataManager && !isNullOrUndefined(e)) {
1797
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1798
+ this.totalItemCount = e.count;
1799
+ }
1800
+ if (this.isNotSearchList && !this.enableVirtualization) {
1513
1801
  this.isNotSearchList = false;
1514
1802
  return;
1515
1803
  }
1804
+ var tempItemCount = this.itemCount;
1516
1805
  if (this.isActive || !isNullOrUndefined(ulElement)) {
1517
1806
  var selectedItem = this.selectedLI ? this.selectedLI.cloneNode(true) : null;
1518
1807
  _super.prototype.onActionComplete.call(this, ulElement, list, e);
1808
+ this.skeletonCount = this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2) ? 0 : this.skeletonCount;
1519
1809
  this.updateSelectElementData(this.allowFiltering);
1520
1810
  if (this.isRequested && !isNullOrUndefined(this.searchKeyEvent) && this.searchKeyEvent.type === 'keydown') {
1521
1811
  this.isRequested = false;
@@ -1526,7 +1816,9 @@ var DropDownList = /** @class */ (function (_super) {
1526
1816
  this.incrementalSearch(this.searchKeyEvent);
1527
1817
  this.searchKeyEvent = null;
1528
1818
  }
1529
- this.list.scrollTop = 0;
1819
+ if (!this.enableVirtualization) {
1820
+ this.list.scrollTop = 0;
1821
+ }
1530
1822
  if (!isNullOrUndefined(ulElement)) {
1531
1823
  attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
1532
1824
  }
@@ -1580,13 +1872,36 @@ var DropDownList = /** @class */ (function (_super) {
1580
1872
  this.updateActionCompleteDataValues(ulElement, list);
1581
1873
  }
1582
1874
  }
1583
- this.addNewItem(list, selectedItem);
1584
- if (!isNullOrUndefined(this.itemData)) {
1875
+ if (!this.enableVirtualization) {
1876
+ this.addNewItem(list, selectedItem);
1877
+ }
1878
+ if (!isNullOrUndefined(this.itemData) || (isNullOrUndefined(this.itemData) && this.enableVirtualization)) {
1585
1879
  this.focusIndexItem();
1586
1880
  }
1881
+ if (this.enableVirtualization) {
1882
+ this.updateActionCompleteDataValues(ulElement, list);
1883
+ }
1884
+ }
1885
+ else if (this.enableVirtualization && this.getModuleName() !== 'autocomplete' && !this.isFiltering()) {
1886
+ var value = this.getItemData().value;
1887
+ this.activeIndex = this.getIndexByValue(value);
1888
+ var element = this.findListElement(this.list, 'li', 'data-value', value);
1889
+ this.selectedLI = element;
1890
+ }
1891
+ else if (this.enableVirtualization && this.getModuleName() === 'autocomplete') {
1892
+ this.activeIndex = this.skeletonCount;
1587
1893
  }
1588
1894
  if (this.beforePopupOpen) {
1589
1895
  this.renderPopup(e);
1896
+ if (this.enableVirtualization) {
1897
+ if (!this.list.querySelector('.e-virtual-list')) {
1898
+ this.UpdateSkeleton();
1899
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
1900
+ }
1901
+ }
1902
+ if (this.enableVirtualization && tempItemCount != this.itemCount) {
1903
+ this.resetList(this.dataSource, this.fields);
1904
+ }
1590
1905
  }
1591
1906
  }
1592
1907
  };
@@ -1649,7 +1964,9 @@ var DropDownList = /** @class */ (function (_super) {
1649
1964
  var element = this.findListElement(this.list, 'li', 'data-value', value);
1650
1965
  this.selectedLI = element;
1651
1966
  this.activeItem(element);
1652
- this.removeFocus();
1967
+ if (!(this.enableVirtualization && isNullOrUndefined(element))) {
1968
+ this.removeFocus();
1969
+ }
1653
1970
  };
1654
1971
  DropDownList.prototype.updateSelection = function () {
1655
1972
  var selectedItem = this.list.querySelector('.' + dropDownBaseClasses.selected);
@@ -1662,12 +1979,46 @@ var DropDownList = /** @class */ (function (_super) {
1662
1979
  this.list.querySelector('.' + dropDownBaseClasses.li).classList.add(dropDownListClasses.focus);
1663
1980
  }
1664
1981
  };
1982
+ DropDownList.prototype.updateSelectionList = function () {
1983
+ var selectedItem = this.list && this.list.querySelector('.' + 'e-active');
1984
+ if (!selectedItem && !isNullOrUndefined(this.value)) {
1985
+ var findEle = this.findListElement(this.list, 'li', 'data-value', this.value);
1986
+ if (findEle) {
1987
+ findEle.classList.add('e-active');
1988
+ }
1989
+ }
1990
+ };
1991
+ DropDownList.prototype.checkAndResetCache = function () {
1992
+ if (this.enableVirtualization) {
1993
+ this.generatedDataObject = {};
1994
+ this.virtualItemStartIndex = this.virtualItemEndIndex = 0;
1995
+ this.viewPortInfo = { currentPageNumber: null,
1996
+ direction: null,
1997
+ sentinelInfo: {},
1998
+ offsets: {},
1999
+ startIndex: 0,
2000
+ endIndex: this.itemCount, };
2001
+ this.selectedValueInfo = null;
2002
+ }
2003
+ };
1665
2004
  DropDownList.prototype.removeFocus = function () {
1666
2005
  var highlightedItem = this.list.querySelectorAll('.' + dropDownListClasses.focus);
1667
2006
  if (highlightedItem && highlightedItem.length) {
1668
2007
  removeClass(highlightedItem, dropDownListClasses.focus);
1669
2008
  }
1670
2009
  };
2010
+ DropDownList.prototype.getTransformValues = function () {
2011
+ var translateY = this.viewPortInfo.startIndex * this.listItemHeight;
2012
+ translateY = translateY - (this.skeletonCount * this.listItemHeight);
2013
+ translateY = this.viewPortInfo.startIndex === 0 && this.listData && this.listData.length === 0 ? 0 : translateY;
2014
+ var styleText = "transform: translate(0px, " + translateY + "px);";
2015
+ return styleText;
2016
+ };
2017
+ DropDownList.prototype.GetVirtualTrackHeight = function () {
2018
+ var height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
2019
+ var heightDimension = "height: " + (height - this.itemCount * this.listItemHeight) + "px;";
2020
+ return heightDimension;
2021
+ };
1671
2022
  DropDownList.prototype.renderPopup = function (e) {
1672
2023
  var _this = this;
1673
2024
  if (this.popupObj && document.body.contains(this.popupObj.element)) {
@@ -1690,10 +2041,39 @@ var DropDownList = /** @class */ (function (_super) {
1690
2041
  _this.setFooterTemplate(popupEle);
1691
2042
  }
1692
2043
  document.body.appendChild(popupEle);
2044
+ if (_this.enableVirtualization && _this.itemTemplate) {
2045
+ var listitems = popupEle.querySelectorAll('li.e-list-item:not(.e-virtual-list)');
2046
+ _this.listItemHeight = listitems.length > 0 ? Math.ceil(listitems[0].getBoundingClientRect().height) : 0;
2047
+ }
2048
+ if (_this.enableVirtualization && !_this.list.classList.contains(dropDownBaseClasses.noData)) {
2049
+ if (!_this.list.querySelector('.e-virtual-ddl-content')) {
2050
+ _this.list.appendChild(_this.createElement('div', {
2051
+ className: 'e-virtual-ddl-content',
2052
+ styles: _this.getTransformValues()
2053
+ })).appendChild(_this.list.querySelector('.e-list-parent'));
2054
+ }
2055
+ else {
2056
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2057
+ _this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = _this.getTransformValues();
2058
+ }
2059
+ _this.UpdateSkeleton();
2060
+ _this.liCollections = _this.list.querySelectorAll('.' + dropDownBaseClasses.li);
2061
+ _this.virtualItemCount = _this.itemCount;
2062
+ if (!_this.list.querySelector('.e-virtual-ddl')) {
2063
+ var virualElement = _this.createElement('div', {
2064
+ id: _this.element.id + '_popup', className: 'e-virtual-ddl', styles: _this.GetVirtualTrackHeight()
2065
+ });
2066
+ popupEle.querySelector('.e-dropdownbase').appendChild(virualElement);
2067
+ }
2068
+ else {
2069
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2070
+ _this.list.getElementsByClassName('e-virtual-ddl')[0].style = _this.GetVirtualTrackHeight();
2071
+ }
2072
+ }
1693
2073
  popupEle.style.visibility = 'hidden';
1694
2074
  if (_this.popupHeight !== 'auto') {
1695
2075
  _this.searchBoxHeight = 0;
1696
- if (!isNullOrUndefined(searchBox.container)) {
2076
+ if (!isNullOrUndefined(searchBox.container) && _this.getModuleName() !== 'combobox' && _this.getModuleName() !== 'autocomplete') {
1697
2077
  _this.searchBoxHeight = (searchBox.container.parentElement).getBoundingClientRect().height;
1698
2078
  _this.listHeight = (parseInt(_this.listHeight, 10) - (_this.searchBoxHeight)).toString() + 'px';
1699
2079
  }
@@ -1715,9 +2095,13 @@ var DropDownList = /** @class */ (function (_super) {
1715
2095
  }
1716
2096
  var offsetValue = 0;
1717
2097
  var left = void 0;
2098
+ _this.isPreventScrollAction = true;
1718
2099
  if (!isNullOrUndefined(_this.selectedLI) && (!isNullOrUndefined(_this.activeIndex) && _this.activeIndex >= 0)) {
1719
2100
  _this.setScrollPosition();
1720
2101
  }
2102
+ else if (_this.enableVirtualization) {
2103
+ _this.setScrollPosition();
2104
+ }
1721
2105
  else {
1722
2106
  _this.list.scrollTop = 0;
1723
2107
  }
@@ -1733,6 +2117,7 @@ var DropDownList = /** @class */ (function (_super) {
1733
2117
  }
1734
2118
  _this.getFocusElement();
1735
2119
  _this.createPopup(popupEle, offsetValue, left);
2120
+ _this.popupContentElement = _this.popupObj.element.querySelector('.e-content');
1736
2121
  _this.checkCollision(popupEle);
1737
2122
  if (Browser.isDevice) {
1738
2123
  _this.popupObj.element.classList.add(dropDownListClasses.device);
@@ -1765,6 +2150,24 @@ var DropDownList = /** @class */ (function (_super) {
1765
2150
  _this.wireListEvents();
1766
2151
  }
1767
2152
  _this.selectedElementID = _this.selectedLI ? _this.selectedLI.id : null;
2153
+ if (_this.enableVirtualization) {
2154
+ _this.notify("bindScrollEvent", {
2155
+ module: "VirtualScroll",
2156
+ component: _this.getModuleName(),
2157
+ enable: _this.enableVirtualization,
2158
+ });
2159
+ setTimeout(function () {
2160
+ if (_this.value) {
2161
+ _this.updateSelectionList();
2162
+ if (_this.selectedValueInfo && _this.viewPortInfo && _this.viewPortInfo.offsets.top) {
2163
+ _this.list.scrollTop = _this.viewPortInfo.offsets.top;
2164
+ }
2165
+ else {
2166
+ _this.scrollBottom(true, true);
2167
+ }
2168
+ }
2169
+ }, 5);
2170
+ }
1768
2171
  attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_options' });
1769
2172
  _this.inputElement.setAttribute('aria-expanded', 'true');
1770
2173
  var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
@@ -1813,7 +2216,8 @@ var DropDownList = /** @class */ (function (_super) {
1813
2216
  var _this = this;
1814
2217
  this.popupObj = new Popup(element, {
1815
2218
  width: this.setWidth(), targetType: 'relative',
1816
- relateTo: this.inputWrapper.container, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
2219
+ relateTo: this.inputWrapper.container,
2220
+ collision: this.enableRtl ? { X: 'fit', Y: 'flip' } : { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
1817
2221
  enableRtl: this.enableRtl, offsetX: left,
1818
2222
  position: this.enableRtl ? { X: 'right', Y: 'bottom' } : { X: 'left', Y: 'bottom' },
1819
2223
  zIndex: this.zIndex,
@@ -1899,6 +2303,7 @@ var DropDownList = /** @class */ (function (_super) {
1899
2303
  var firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
1900
2304
  var lastItem = this.isEmptyList() ? this.list : this.liCollections[this.getItems().length - 1];
1901
2305
  var liHeight = firstItem.getBoundingClientRect().height;
2306
+ this.listItemHeight = liHeight;
1902
2307
  var listHeight = this.list.offsetHeight / 2;
1903
2308
  var height = isNullOrUndefined(selectedLI) ? firstItem.offsetTop : selectedLI.offsetTop;
1904
2309
  var lastItemOffsetValue = lastItem.offsetTop;
@@ -1909,7 +2314,7 @@ var DropDownList = /** @class */ (function (_super) {
1909
2314
  offsetValue = (count - (this.liCollections.length - this.activeIndex)) * liHeight - popupOffset + paddingBottom;
1910
2315
  this.list.scrollTop = selectedLI.offsetTop;
1911
2316
  }
1912
- else if (height > listHeight) {
2317
+ else if (height > listHeight && !this.enableVirtualization) {
1913
2318
  offsetValue = listHeight - liHeight / 2;
1914
2319
  this.list.scrollTop = height - listHeight + liHeight / 2;
1915
2320
  }
@@ -1935,34 +2340,114 @@ var DropDownList = /** @class */ (function (_super) {
1935
2340
  }
1936
2341
  return width;
1937
2342
  };
1938
- DropDownList.prototype.scrollBottom = function (isInitial) {
2343
+ DropDownList.prototype.scrollBottom = function (isInitial, isInitialSelection, keyAction) {
2344
+ if (isInitialSelection === void 0) { isInitialSelection = false; }
2345
+ if (keyAction === void 0) { keyAction = null; }
2346
+ if (isNullOrUndefined(this.selectedLI) && this.enableVirtualization) {
2347
+ this.selectedLI = this.list.querySelector('.' + dropDownBaseClasses.li);
2348
+ if (!isNullOrUndefined(this.selectedLI) && this.selectedLI.classList.contains('e-virtual-list')) {
2349
+ this.selectedLI = this.liCollections[this.skeletonCount];
2350
+ }
2351
+ }
1939
2352
  if (!isNullOrUndefined(this.selectedLI)) {
2353
+ this.isUpwardScrolling = false;
2354
+ var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
2355
+ var lastElementValue = this.list.querySelector('li:last-of-type') ? this.list.querySelector('li:last-of-type').getAttribute('data-value') : null;
2356
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
1940
2357
  var currentOffset = this.list.offsetHeight;
1941
- var nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
2358
+ var nextBottom = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop;
1942
2359
  var nextOffset = this.list.scrollTop + nextBottom - currentOffset;
1943
- nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
1944
- var boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
2360
+ var isScrollerCHanged = false;
2361
+ var isScrollTopChanged = false;
2362
+ nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10);
2363
+ var boxRange = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop;
1945
2364
  boxRange = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
1946
2365
  boxRange - this.fixedHeaderElement.offsetHeight : boxRange;
1947
- if (this.activeIndex === 0) {
2366
+ if (this.activeIndex === 0 && !this.enableVirtualization) {
1948
2367
  this.list.scrollTop = 0;
2368
+ isScrollerCHanged = this.isKeyBoardAction;
1949
2369
  }
1950
2370
  else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
1951
- this.list.scrollTop = nextOffset;
2371
+ var currentElementValue = this.selectedLI ? this.selectedLI.getAttribute('data-value') : null;
2372
+ var liCount = keyAction == "pageDown" ? this.getPageCount() - 2 : 1;
2373
+ if (!this.enableVirtualization || this.isKeyBoardAction || isInitialSelection) {
2374
+ if (this.isKeyBoardAction && this.enableVirtualization && lastElementValue && currentElementValue === lastElementValue && keyAction != "end" && !this.isVirtualScrolling) {
2375
+ this.isPreventKeyAction = true;
2376
+ if (this.enableVirtualization && this.itemTemplate) {
2377
+ this.list.scrollTop += nextOffset;
2378
+ }
2379
+ else {
2380
+ this.list.scrollTop += this.selectedLI.offsetHeight * liCount;
2381
+ }
2382
+ this.isPreventKeyAction = this.IsScrollerAtEnd() ? false : this.isPreventKeyAction;
2383
+ this.isKeyBoardAction = false;
2384
+ this.isPreventScrollAction = false;
2385
+ }
2386
+ else if (this.enableVirtualization && keyAction == "end") {
2387
+ this.isPreventKeyAction = false;
2388
+ this.isKeyBoardAction = false;
2389
+ this.isPreventScrollAction = false;
2390
+ this.list.scrollTop = this.list.scrollHeight;
2391
+ }
2392
+ else {
2393
+ if (keyAction == "pageDown" && this.enableVirtualization && !this.isVirtualScrolling) {
2394
+ this.isPreventKeyAction = false;
2395
+ this.isKeyBoardAction = false;
2396
+ this.isPreventScrollAction = false;
2397
+ nextOffset = nextOffset + (this.selectedLI.offsetHeight * liCount);
2398
+ }
2399
+ this.list.scrollTop = nextOffset;
2400
+ }
2401
+ }
2402
+ else {
2403
+ this.list.scrollTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.virtualListInfo.startIndex * this.listItemHeight : 0;
2404
+ }
2405
+ isScrollerCHanged = this.isKeyBoardAction;
2406
+ isScrollTopChanged = true;
1952
2407
  }
2408
+ this.isKeyBoardAction = isScrollerCHanged;
1953
2409
  }
1954
2410
  };
1955
- DropDownList.prototype.scrollTop = function () {
2411
+ DropDownList.prototype.scrollTop = function (keyAction) {
2412
+ if (keyAction === void 0) { keyAction = null; }
1956
2413
  if (!isNullOrUndefined(this.selectedLI)) {
1957
- var nextOffset = this.selectedLI.offsetTop - this.list.scrollTop;
2414
+ var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
2415
+ var selectedLiOffsetTop = (this.virtualListInfo && this.virtualListInfo.startIndex) ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
2416
+ var nextOffset = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) - this.list.scrollTop;
2417
+ var firstElementValue = this.list.querySelector('li.e-list-item:not(.e-virtual-list)') ? this.list.querySelector('li.e-list-item:not(.e-virtual-list)').getAttribute('data-value') : null;
1958
2418
  nextOffset = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
1959
2419
  nextOffset - this.fixedHeaderElement.offsetHeight : nextOffset;
1960
- var boxRange = (this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop);
1961
- if (this.activeIndex === 0) {
2420
+ var boxRange = (selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop);
2421
+ var isPageUpKeyAction = this.enableVirtualization && this.getModuleName() === 'autocomplete' && nextOffset <= 0;
2422
+ if (this.activeIndex === 0 && !this.enableVirtualization) {
1962
2423
  this.list.scrollTop = 0;
1963
2424
  }
1964
- else if (nextOffset < 0) {
1965
- this.list.scrollTop = this.list.scrollTop + nextOffset;
2425
+ else if (nextOffset < 0 || isPageUpKeyAction) {
2426
+ var currentElementValue = this.selectedLI ? this.selectedLI.getAttribute('data-value') : null;
2427
+ var liCount = keyAction == "pageUp" ? this.getPageCount() - 2 : 1;
2428
+ if (this.enableVirtualization && this.isKeyBoardAction && firstElementValue && currentElementValue === firstElementValue && keyAction != "home" && !this.isVirtualScrolling) {
2429
+ this.isUpwardScrolling = true;
2430
+ this.isPreventKeyAction = true;
2431
+ this.list.scrollTop -= this.selectedLI.offsetHeight * liCount;
2432
+ this.isPreventKeyAction = this.list.scrollTop != 0 ? this.isPreventKeyAction : false;
2433
+ this.isKeyBoardAction = false;
2434
+ this.isPreventScrollAction = false;
2435
+ }
2436
+ else if (this.enableVirtualization && keyAction == "home") {
2437
+ this.isPreventScrollAction = false;
2438
+ this.isPreventKeyAction = true;
2439
+ this.isKeyBoardAction = false;
2440
+ this.list.scrollTo(0, 0);
2441
+ }
2442
+ else {
2443
+ if (keyAction == "pageUp" && this.enableVirtualization && !this.isVirtualScrolling) {
2444
+ this.isPreventKeyAction = false;
2445
+ this.isKeyBoardAction = false;
2446
+ this.isPreventScrollAction = false;
2447
+ nextOffset = nextOffset - (this.selectedLI.offsetHeight * liCount);
2448
+ }
2449
+ this.list.scrollTop = this.list.scrollTop + nextOffset;
2450
+ }
1966
2451
  }
1967
2452
  else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
1968
2453
  this.list.scrollTop = this.selectedLI.offsetTop - (this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
@@ -1980,25 +2465,47 @@ var DropDownList = /** @class */ (function (_super) {
1980
2465
  return true;
1981
2466
  };
1982
2467
  DropDownList.prototype.setScrollPosition = function (e) {
2468
+ this.isPreventScrollAction = true;
1983
2469
  if (!isNullOrUndefined(e)) {
1984
2470
  switch (e.action) {
1985
2471
  case 'pageDown':
1986
2472
  case 'down':
1987
2473
  case 'end':
1988
- this.scrollBottom();
2474
+ this.isKeyBoardAction = true;
2475
+ this.scrollBottom(false, false, e.action);
1989
2476
  break;
1990
2477
  default:
1991
- this.scrollTop();
2478
+ this.isKeyBoardAction = e.action == 'up' || e.action == 'pageUp' || e.action == 'open';
2479
+ this.scrollTop(e.action);
1992
2480
  break;
1993
2481
  }
1994
2482
  }
1995
2483
  else {
1996
2484
  this.scrollBottom(true);
1997
2485
  }
2486
+ this.isKeyBoardAction = false;
1998
2487
  };
1999
2488
  DropDownList.prototype.clearText = function () {
2000
2489
  this.filterInput.value = this.typedString = '';
2001
2490
  this.searchLists(null);
2491
+ if (this.enableVirtualization) {
2492
+ this.list.scrollTop = 0;
2493
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2494
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2495
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2496
+ if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
2497
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2498
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
2499
+ }
2500
+ this.getSkeletonCount();
2501
+ this.UpdateSkeleton();
2502
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
2503
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2504
+ if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
2505
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2506
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
2507
+ }
2508
+ }
2002
2509
  };
2003
2510
  DropDownList.prototype.setEleWidth = function (width) {
2004
2511
  if (!isNullOrUndefined(width)) {
@@ -2012,10 +2519,13 @@ var DropDownList = /** @class */ (function (_super) {
2012
2519
  };
2013
2520
  DropDownList.prototype.closePopup = function (delay, e) {
2014
2521
  var _this = this;
2522
+ var isFilterValue = !isNullOrUndefined(this.filterInput) && !isNullOrUndefined(this.filterInput.value) && this.filterInput.value !== '';
2523
+ var typedString = this.getModuleName() === 'combobox' ? this.typedString : null;
2015
2524
  this.isTyped = false;
2016
2525
  if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
2017
2526
  return;
2018
2527
  }
2528
+ this.keyboardEvent = null;
2019
2529
  EventHandler.remove(document, 'mousedown', this.onDocumentClick);
2020
2530
  this.isActive = false;
2021
2531
  this.filterInputObj = null;
@@ -2057,6 +2567,20 @@ var DropDownList = /** @class */ (function (_super) {
2057
2567
  if (this.isFiltering()) {
2058
2568
  this.actionCompleteData.isUpdated = false;
2059
2569
  }
2570
+ if (this.enableVirtualization) {
2571
+ if ((this.value == null || this.isTyped)) {
2572
+ this.viewPortInfo.endIndex = this.viewPortInfo && this.viewPortInfo.endIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
2573
+ if (this.getModuleName() === 'autocomplete' || (this.getModuleName() === 'dropdownlist' && !isNullOrUndefined(this.typedString) && this.typedString != "") || (this.getModuleName() === 'combobox' && this.allowFiltering && !isNullOrUndefined(this.typedString) && this.typedString != "")) {
2574
+ this.checkAndResetCache();
2575
+ }
2576
+ }
2577
+ else if (this.getModuleName() === 'autocomplete') {
2578
+ this.checkAndResetCache();
2579
+ }
2580
+ if ((this.getModuleName() === 'dropdownlist' || this.getModuleName() === 'combobox') && !(this.skeletonCount == 0)) {
2581
+ this.getSkeletonCount(true);
2582
+ }
2583
+ }
2060
2584
  this.beforePopupOpen = false;
2061
2585
  var animModel = {
2062
2586
  name: 'FadeOut',
@@ -2087,6 +2611,46 @@ var DropDownList = /** @class */ (function (_super) {
2087
2611
  if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
2088
2612
  this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
2089
2613
  }
2614
+ var dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2615
+ if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
2616
+ this.updateInitialData();
2617
+ this.checkAndResetCache();
2618
+ }
2619
+ };
2620
+ DropDownList.prototype.updateInitialData = function () {
2621
+ var currentData = this.selectData;
2622
+ var ulElement = this.renderItems(currentData, this.fields);
2623
+ this.list.scrollTop = 0;
2624
+ this.virtualListInfo = {
2625
+ currentPageNumber: null,
2626
+ direction: null,
2627
+ sentinelInfo: {},
2628
+ offsets: {},
2629
+ startIndex: 0,
2630
+ endIndex: 0,
2631
+ };
2632
+ if (this.getModuleName() === 'combobox') {
2633
+ this.typedString = "";
2634
+ }
2635
+ this.previousStartIndex = 0;
2636
+ this.previousEndIndex = 0;
2637
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2638
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2639
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2640
+ if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
2641
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2642
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
2643
+ }
2644
+ this.getSkeletonCount();
2645
+ this.UpdateSkeleton();
2646
+ this.listData = currentData;
2647
+ this.updateActionCompleteDataValues(ulElement, currentData);
2648
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
2649
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2650
+ if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
2651
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2652
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
2653
+ }
2090
2654
  };
2091
2655
  DropDownList.prototype.destroyPopup = function () {
2092
2656
  this.isPopupOpen = false;
@@ -2173,10 +2737,10 @@ var DropDownList = /** @class */ (function (_super) {
2173
2737
  this.element.id = id;
2174
2738
  this.hiddenElement.id = id + '_hidden';
2175
2739
  this.targetElement().setAttribute('tabindex', this.tabIndex);
2176
- if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
2740
+ if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') && !this.readonly) {
2177
2741
  this.inputElement.setAttribute('aria-label', this.getModuleName());
2178
2742
  }
2179
- else {
2743
+ else if (this.getModuleName() === 'dropdownlist') {
2180
2744
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
2181
2745
  }
2182
2746
  attributes(this.targetElement(), this.getAriaAttributes());
@@ -2186,7 +2750,16 @@ var DropDownList = /** @class */ (function (_super) {
2186
2750
  this.inputElement.removeAttribute('aria-labelledby');
2187
2751
  }
2188
2752
  if (this.value !== null || this.activeIndex !== null || this.text !== null) {
2753
+ if (this.enableVirtualization) {
2754
+ this.listItemHeight = this.getListHeight();
2755
+ this.getSkeletonCount();
2756
+ this.updateVirtualizationProperties(this.itemCount, this.allowFiltering);
2757
+ }
2189
2758
  this.initValue();
2759
+ this.selectedValueInfo = this.viewPortInfo;
2760
+ if (this.enableVirtualization) {
2761
+ this.activeIndex = this.activeIndex + this.skeletonCount;
2762
+ }
2190
2763
  }
2191
2764
  else if (this.element.tagName === 'SELECT' && this.element.options[0]) {
2192
2765
  var selectElement = this.element;
@@ -2222,6 +2795,29 @@ var DropDownList = /** @class */ (function (_super) {
2222
2795
  attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
2223
2796
  }
2224
2797
  this.renderComplete();
2798
+ this.listItemHeight = this.getListHeight();
2799
+ this.getSkeletonCount();
2800
+ if (this.enableVirtualization) {
2801
+ this.updateVirtualizationProperties(this.itemCount, this.allowFiltering);
2802
+ }
2803
+ this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
2804
+ this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.viewPortInfo.startIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
2805
+ };
2806
+ DropDownList.prototype.getListHeight = function () {
2807
+ var listParent = this.createElement('div', {
2808
+ className: 'e-dropdownbase'
2809
+ });
2810
+ var item = this.createElement('li', {
2811
+ className: 'e-list-item'
2812
+ });
2813
+ var listParentHeight = formatUnit(this.popupHeight);
2814
+ listParent.style.height = (parseInt(listParentHeight, 10)).toString() + 'px';
2815
+ listParent.appendChild(item);
2816
+ document.body.appendChild(listParent);
2817
+ this.virtualListHeight = listParent.getBoundingClientRect().height;
2818
+ var listItemHeight = Math.ceil(item.getBoundingClientRect().height);
2819
+ listParent.remove();
2820
+ return listItemHeight;
2225
2821
  };
2226
2822
  DropDownList.prototype.setFooterTemplate = function (popupEle) {
2227
2823
  var compiledString;
@@ -2365,7 +2961,10 @@ var DropDownList = /** @class */ (function (_super) {
2365
2961
  var _loop_1 = function (prop) {
2366
2962
  switch (prop) {
2367
2963
  case 'query':
2368
- case 'dataSource': break;
2964
+ case 'dataSource':
2965
+ this_1.getSkeletonCount();
2966
+ this_1.checkAndResetCache();
2967
+ break;
2369
2968
  case 'htmlAttributes':
2370
2969
  this_1.setHTMLAttributes();
2371
2970
  break;
@@ -2659,7 +3258,23 @@ var DropDownList = /** @class */ (function (_super) {
2659
3258
  this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
2660
3259
  this.renderList(e);
2661
3260
  }
3261
+ if (this.enableVirtualization && this.listData && this.listData.length) {
3262
+ if (!isNullOrUndefined(this.value) && (this.getModuleName() === 'dropdownlist' || this.getModuleName() === 'combobox')) {
3263
+ this.removeHover();
3264
+ }
3265
+ if (!this.beforePopupOpen) {
3266
+ this.notify("setCurrentViewDataAsync", {
3267
+ module: "VirtualScroll",
3268
+ });
3269
+ }
3270
+ }
2662
3271
  this.invokeRenderPopup(e);
3272
+ if (this.enableVirtualization && !this.allowFiltering && this.selectedValueInfo != null && this.selectedValueInfo.startIndex > 0 && this.value != null) {
3273
+ this.notify("dataProcessAsync", {
3274
+ module: "VirtualScroll",
3275
+ isOpen: true,
3276
+ });
3277
+ }
2663
3278
  };
2664
3279
  DropDownList.prototype.invokeRenderPopup = function (e) {
2665
3280
  if (Browser.isDevice && this.isFilterLayout()) {
@@ -2753,7 +3368,9 @@ var DropDownList = /** @class */ (function (_super) {
2753
3368
  if (!this.enabled) {
2754
3369
  return;
2755
3370
  }
2756
- this.isTyped = true;
3371
+ if (!this.enableVirtualization && this.getModuleName() === 'combobox') {
3372
+ this.isTyped = true;
3373
+ }
2757
3374
  this.hidePopup(e);
2758
3375
  if (this.targetElement()) {
2759
3376
  this.targetElement().blur();
@@ -2809,6 +3426,7 @@ var DropDownList = /** @class */ (function (_super) {
2809
3426
  this.ulElement = null;
2810
3427
  this.list = null;
2811
3428
  this.popupObj = null;
3429
+ this.popupContentElement = null;
2812
3430
  this.rippleFun = null;
2813
3431
  this.selectedLI = null;
2814
3432
  this.liCollections = null;
@@ -2905,6 +3523,9 @@ var DropDownList = /** @class */ (function (_super) {
2905
3523
  __decorate([
2906
3524
  Property(false)
2907
3525
  ], DropDownList.prototype, "readonly", void 0);
3526
+ __decorate([
3527
+ Property(false)
3528
+ ], DropDownList.prototype, "enableVirtualization", void 0);
2908
3529
  __decorate([
2909
3530
  Property(null)
2910
3531
  ], DropDownList.prototype, "text", void 0);