@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
@@ -1,8 +1,9 @@
1
- import { Animation, Browser, ChildProperty, Complex, Component, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, addClass, append, attributes, classList, closest, compile, createElement, detach, extend, formatUnit, getComponent, getUniqueID, getValue, isNullOrUndefined, isUndefined, matches, prepend, remove, removeClass, rippleEffect, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
1
+ import { Animation, Browser, ChildProperty, Complex, Component, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, append, attributes, classList, closest, compile, createElement, debounce, detach, extend, formatUnit, getComponent, getUniqueID, getValue, isNullOrUndefined, isUndefined, matches, prepend, remove, removeClass, rippleEffect, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
2
2
  import { DataManager, DataUtil, JsonAdaptor, Predicate, Query } from '@syncfusion/ej2-data';
3
3
  import { ListBase, Sortable, cssClass, moveTo } from '@syncfusion/ej2-lists';
4
4
  import { Popup, createSpinner, getZindexPartial, hideSpinner, isCollide, showSpinner } from '@syncfusion/ej2-popups';
5
5
  import { Input, TextBox } from '@syncfusion/ej2-inputs';
6
+ import { Skeleton } from '@syncfusion/ej2-notifications';
6
7
  import { Button, createCheckBox } from '@syncfusion/ej2-buttons';
7
8
  import { TreeView } from '@syncfusion/ej2-navigations';
8
9
 
@@ -194,6 +195,382 @@ function revertHighlightSearch(content) {
194
195
  }
195
196
  }
196
197
 
198
+ var __assign = (undefined && undefined.__assign) || function () {
199
+ __assign = Object.assign || function(t) {
200
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
201
+ s = arguments[i];
202
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
203
+ t[p] = s[p];
204
+ }
205
+ return t;
206
+ };
207
+ return __assign.apply(this, arguments);
208
+ };
209
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
210
+ return new (P || (P = Promise))(function (resolve, reject) {
211
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
212
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
213
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
214
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
215
+ });
216
+ };
217
+ var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
218
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
219
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
220
+ function verb(n) { return function (v) { return step([n, v]); }; }
221
+ function step(op) {
222
+ if (f) throw new TypeError("Generator is already executing.");
223
+ while (_) try {
224
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
225
+ if (y = 0, t) op = [op[0] & 2, t.value];
226
+ switch (op[0]) {
227
+ case 0: case 1: t = op; break;
228
+ case 4: _.label++; return { value: op[1], done: false };
229
+ case 5: _.label++; y = op[1]; op = [0]; continue;
230
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
231
+ default:
232
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
233
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
234
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
235
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
236
+ if (t[2]) _.ops.pop();
237
+ _.trys.pop(); continue;
238
+ }
239
+ op = body.call(thisArg, _);
240
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
241
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
242
+ }
243
+ };
244
+ var VirtualScroll = /** @__PURE__ @class */ (function () {
245
+ function VirtualScroll(parent) {
246
+ var _this = this;
247
+ this.sentinelInfo = {
248
+ 'up': {
249
+ check: function (rect, info) {
250
+ var top = rect.top - _this.containerElementRect.top;
251
+ info.entered = top >= 0;
252
+ return top + (_this.parent.listItemHeight * _this.parent.virtualItemCount / 2) >= 0;
253
+ },
254
+ axis: 'Y'
255
+ },
256
+ 'down': {
257
+ check: function (rect, info) {
258
+ var cHeight = _this.parent.popupContentElement.clientHeight;
259
+ var top = rect.bottom;
260
+ info.entered = rect.bottom <= _this.containerElementRect.bottom;
261
+ return top - (_this.parent.listItemHeight * _this.parent.virtualItemCount / 2) <= _this.parent.listItemHeight * _this.parent.virtualItemCount / 2;
262
+ }, axis: 'Y'
263
+ }
264
+ };
265
+ this.parent = parent;
266
+ this.removeEventListener();
267
+ this.addEventListener();
268
+ }
269
+ VirtualScroll.prototype.addEventListener = function () {
270
+ if (this.parent.isDestroyed) {
271
+ return;
272
+ }
273
+ this.parent.on('observe', this.observe, this);
274
+ this.parent.on('setGeneratedData', this.setGeneratedData, this);
275
+ this.parent.on('dataProcessAsync', this.dataProcessAsync, this);
276
+ this.parent.on('setCurrentViewDataAsync', this.setCurrentViewDataAsync, this);
277
+ this.parent.on('bindScrollEvent', this.bindScrollEvent, this);
278
+ };
279
+ VirtualScroll.prototype.removeEventListener = function () {
280
+ if (this.parent.isDestroyed) {
281
+ return;
282
+ }
283
+ this.parent.off('observe', this.observe);
284
+ this.parent.off('setGeneratedData', this.setGeneratedData);
285
+ this.parent.off('dataProcessAsync', this.dataProcessAsync);
286
+ this.parent.off('setCurrentViewDataAsync', this.setCurrentViewDataAsync);
287
+ this.parent.off('bindScrollEvent', this.bindScrollEvent);
288
+ };
289
+ VirtualScroll.prototype.bindScrollEvent = function (component) {
290
+ var _this = this;
291
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
292
+ this.component = component.component;
293
+ this.observe(function (scrollArgs) { return _this.scrollListener(scrollArgs); });
294
+ };
295
+ VirtualScroll.prototype.observe = function (callback) {
296
+ this.containerElementRect = this.parent.popupContentElement.getBoundingClientRect();
297
+ EventHandler.add(this.parent.popupContentElement, 'wheel mousedown', this.popupScrollHandler, this);
298
+ this.touchModule = new Touch(this.parent.popupContentElement, {
299
+ scroll: this.popupScrollHandler.bind(this)
300
+ });
301
+ EventHandler.add(this.parent.popupContentElement, 'scroll', this.virtualScrollHandler(callback), this);
302
+ };
303
+ VirtualScroll.prototype.getModuleName = function () {
304
+ return 'VirtualScroll';
305
+ };
306
+ VirtualScroll.prototype.popupScrollHandler = function (e) {
307
+ this.parent.isMouseScrollAction = true;
308
+ this.parent.isPreventScrollAction = false;
309
+ };
310
+ VirtualScroll.prototype.getPageQuery = function (query, virtualStartIndex, virtualEndIndex) {
311
+ if (virtualEndIndex !== 0 && !this.parent.allowFiltering && this.component !== 'autocomplete') {
312
+ query = query.skip(virtualStartIndex);
313
+ }
314
+ return query;
315
+ };
316
+ VirtualScroll.prototype.setGeneratedData = function (qStartIndex, recentlyGeneratedData) {
317
+ var loopIteration = 0;
318
+ var endIndex = this.parent.listData.length + this.parent.virtualItemStartIndex;
319
+ for (var i = this.parent.virtualItemStartIndex; i < endIndex; i++) {
320
+ var alreadyAddedData = this.parent.generatedDataObject[i];
321
+ if (!alreadyAddedData) {
322
+ if (recentlyGeneratedData !== null && this.parent.listData.slice(loopIteration, loopIteration + 1).length > 0) {
323
+ var slicedData = this.parent.listData.slice(loopIteration, loopIteration + 1);
324
+ if (slicedData.length > 0) {
325
+ // Safely assign slicedData to this.parent.generatedDataObject[i]
326
+ this.parent.generatedDataObject[i] = slicedData;
327
+ }
328
+ }
329
+ }
330
+ loopIteration++;
331
+ }
332
+ };
333
+ VirtualScroll.prototype.generateAndExecuteQueryAsync = function (query, virtualItemStartIndex, virtualItemEndIndex, isQueryGenerated) {
334
+ if (virtualItemStartIndex === void 0) { virtualItemStartIndex = 0; }
335
+ if (virtualItemEndIndex === void 0) { virtualItemEndIndex = 0; }
336
+ if (isQueryGenerated === void 0) { isQueryGenerated = false; }
337
+ var dataSource = this.parent.dataSource;
338
+ if (!isQueryGenerated) {
339
+ query = this.getPageQuery(query, virtualItemStartIndex, virtualItemEndIndex);
340
+ }
341
+ this.parent.resetList(dataSource, this.parent.fields, query);
342
+ };
343
+ VirtualScroll.prototype.setCurrentViewDataAsync = function () {
344
+ // eslint-disable-next-line
345
+ var currentData = [];
346
+ for (var i = this.parent.viewPortInfo.startIndex; i < this.parent.viewPortInfo.endIndex; i++) {
347
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
348
+ var alreadyAddedData = this.parent.generatedDataObject[i];
349
+ if (alreadyAddedData) {
350
+ currentData.push(alreadyAddedData[0]);
351
+ }
352
+ }
353
+ this.parent.renderItems(currentData, this.parent.fields);
354
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
355
+ var virtualTrackElement = this.parent.list.getElementsByClassName('e-virtual-ddl')[0];
356
+ if (virtualTrackElement) {
357
+ (virtualTrackElement).style = this.parent.GetVirtualTrackHeight();
358
+ }
359
+ this.parent.UpdateSkeleton();
360
+ this.parent.liCollections = this.parent.list.querySelectorAll('.e-list-item');
361
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
362
+ var virtualContentElement = this.parent.list.getElementsByClassName('e-virtual-ddl-content')[0];
363
+ if (virtualContentElement) {
364
+ (virtualContentElement).style = this.parent.getTransformValues();
365
+ }
366
+ };
367
+ VirtualScroll.prototype.generateQueryAndSetQueryIndexAsync = function (query, isPopupOpen) {
368
+ var isStartIndexInitialised = false;
369
+ var queryStartIndex = 0;
370
+ var queryEndIndex = 0;
371
+ var sortedDataStartIndex = 0;
372
+ var vEndIndex = this.parent && this.parent.viewPortInfo.endIndex !== 0 ? this.parent.viewPortInfo.endIndex : sortedDataStartIndex + this.parent.getItems().length;
373
+ if (!isPopupOpen && vEndIndex !== 0) {
374
+ for (var i = this.parent.viewPortInfo.startIndex; i <= vEndIndex; i++) {
375
+ if (!(i in this.parent.generatedDataObject)) {
376
+ if (!isStartIndexInitialised) {
377
+ isStartIndexInitialised = true;
378
+ queryStartIndex = queryEndIndex = i;
379
+ }
380
+ else {
381
+ queryEndIndex = i === vEndIndex ? i : i + 1;
382
+ }
383
+ }
384
+ }
385
+ }
386
+ if (isStartIndexInitialised && !((this.parent.totalItemCount == queryStartIndex) && (this.parent.totalItemCount == queryEndIndex))) {
387
+ this.parent.virtualItemStartIndex = queryStartIndex;
388
+ this.parent.virtualItemEndIndex = queryEndIndex;
389
+ this.generateAndExecuteQueryAsync(query, queryStartIndex, queryEndIndex);
390
+ }
391
+ this.setCurrentViewDataAsync();
392
+ };
393
+ VirtualScroll.prototype.dataProcessAsync = function (isOpenPopup) {
394
+ this.parent.selectedValueInfo = null;
395
+ this.parent.virtualItemStartIndex = this.parent.viewPortInfo.startIndex;
396
+ this.parent.virtualItemEndIndex = this.parent.viewPortInfo.endIndex;
397
+ this.generateQueryAndSetQueryIndexAsync(new Query(), isOpenPopup);
398
+ };
399
+ VirtualScroll.prototype.virtualScrollRefreshAsync = function () {
400
+ return __awaiter(this, void 0, void 0, function () {
401
+ return __generator(this, function (_a) {
402
+ switch (_a.label) {
403
+ case 0:
404
+ this.parent.isCustomFilter = (!(this.parent.isTyped || (this.component === 'combobox' && this.parent.allowFiltering && this.parent.queryString != this.parent.typedString) || (!isNullOrUndefined(this.parent.filterInput) && !isNullOrUndefined(this.parent.filterInput.value) && this.parent.filterInput.value !== '') && this.component !== 'combobox') && !(this.component === 'autocomplete' && this.parent.value != null)) || this.parent.isCustomFilter;
405
+ if (this.parent.allowFiltering || this.component === 'autocomplete') {
406
+ if (!isNullOrUndefined(this.parent.typedString) && !(this.component === 'combobox' && !isNullOrUndefined(this.parent.typedString) && this.parent.allowFiltering)) {
407
+ if (this.parent.viewPortInfo.endIndex >= this.parent.dataCount) {
408
+ this.parent.viewPortInfo.endIndex = this.parent.dataCount;
409
+ }
410
+ if (this.parent.viewPortInfo.startIndex >= this.parent.dataCount) {
411
+ this.parent.viewPortInfo.startIndex = this.parent.dataCount - this.parent.itemCount;
412
+ }
413
+ }
414
+ else {
415
+ this.parent.getSkeletonCount(true);
416
+ }
417
+ }
418
+ return [4 /*yield*/, this.dataProcessAsync()];
419
+ case 1:
420
+ _a.sent();
421
+ if (this.parent.keyboardEvent != null) {
422
+ this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent, this.parent.pageCount);
423
+ }
424
+ this.parent.isCustomFilter = false;
425
+ return [2 /*return*/];
426
+ }
427
+ });
428
+ });
429
+ };
430
+ VirtualScroll.prototype.scrollListener = function (scrollArgs) {
431
+ var _this = this;
432
+ if (!this.parent.isPreventScrollAction) {
433
+ var info = scrollArgs.sentinel;
434
+ var pStartIndex = this.parent.previousStartIndex;
435
+ this.parent.viewPortInfo = this.getInfoFromView(scrollArgs.direction, info, scrollArgs.offset, false);
436
+ this.parent.isUpwardScrolling = false;
437
+ if (this.parent.previousStartIndex !== pStartIndex && !this.parent.isKeyBoardAction) {
438
+ this.parent.isScrollActionTriggered = false;
439
+ this.parent.currentPageNumber = this.parent.viewPortInfo.currentPageNumber;
440
+ this.parent.virtualListInfo = __assign({}, this.parent.viewPortInfo);
441
+ this.parent.isPreventKeyAction = true;
442
+ this.parent.isVirtualScrolling = true;
443
+ setTimeout(function () {
444
+ _this.parent.pageCount = _this.parent.getPageCount();
445
+ _this.virtualScrollRefreshAsync().then(function () {
446
+ if (_this.parent.popupObj) {
447
+ _this.parent.list = _this.parent.popupObj.element.querySelector('.' + 'e-content') || select('.' + 'e-content');
448
+ _this.parent.updateSelectionList();
449
+ _this.parent.liCollections = _this.parent.getItems();
450
+ }
451
+ _this.parent.isKeyBoardAction = false;
452
+ _this.parent.isVirtualScrolling = false;
453
+ _this.parent.isPreventKeyAction = false;
454
+ });
455
+ }, 5);
456
+ }
457
+ else if (this.parent.isScrollActionTriggered) {
458
+ this.parent.isPreventKeyAction = false;
459
+ this.parent.isScrollActionTriggered = false;
460
+ var virtualListCount = this.parent.list.querySelectorAll('.e-virtual-list').length;
461
+ var listElement = this.parent.list.querySelector('.' + 'e-list-item');
462
+ var translateY = scrollArgs.offset.top - (listElement.offsetHeight * virtualListCount);
463
+ this.parent.list.getElementsByClassName('e-virtual-ddl-content')[0].style.transform = "translate(0px," + translateY + "px)";
464
+ }
465
+ this.parent.previousInfo = this.parent.viewPortInfo;
466
+ }
467
+ };
468
+ VirtualScroll.prototype.getPageCount = function (popupElement, returnExactCount) {
469
+ if (returnExactCount === void 0) { returnExactCount = false; }
470
+ var list = popupElement && popupElement.querySelector('.e-content');
471
+ if (list) {
472
+ var liHeight = list.classList.contains('e-nodata') ? null : getComputedStyle(list.querySelectorAll('.e-list-item')[0], null).getPropertyValue('height');
473
+ var pageCount = list.getBoundingClientRect().height / parseInt(liHeight, 10);
474
+ return returnExactCount ? pageCount : Math.round(pageCount);
475
+ }
476
+ return 0;
477
+ };
478
+
479
+ VirtualScroll.prototype.getRowHeight = function () {
480
+ return (isNullOrUndefined(this.parent.liCollections) || this.parent.liCollections.length == 0) ? 0 : Math.ceil(this.parent.liCollections[0].getBoundingClientRect().height);
481
+ };
482
+ VirtualScroll.prototype.getInfoFromView = function (direction, info, e, isscrollAction) {
483
+ var infoType = {
484
+ direction: direction, sentinelInfo: info, offsets: e,
485
+ startIndex: this.parent.previousStartIndex, endIndex: this.parent.previousEndIndex
486
+ };
487
+ var vHeight = this.parent.popupContentElement.getBoundingClientRect().height;
488
+ //Row Start and End Index calculation
489
+ var rowHeight = this.parent.listItemHeight;
490
+ var exactTopIndex = e.top / rowHeight;
491
+ var infoViewIndices = vHeight / rowHeight;
492
+ var exactEndIndex = exactTopIndex + infoViewIndices;
493
+ var pageSizeBy4 = this.parent.virtualItemCount / 4;
494
+ var totalItemCount = this.parent.totalItemCount;
495
+ if (infoType.direction === 'down') {
496
+ var sIndex = Math.round(exactEndIndex) - Math.round((pageSizeBy4));
497
+ if (isNullOrUndefined(infoType.startIndex) || (exactEndIndex >
498
+ (infoType.startIndex + Math.round((this.parent.virtualItemCount / 2 + pageSizeBy4)))
499
+ && infoType.endIndex !== totalItemCount)) {
500
+ infoType.startIndex = sIndex >= 0 ? Math.round(sIndex) : 0;
501
+ infoType.startIndex = infoType.startIndex > exactTopIndex ? Math.floor(exactTopIndex) : infoType.startIndex;
502
+ var eIndex = infoType.startIndex + this.parent.virtualItemCount;
503
+ infoType.startIndex = eIndex < exactEndIndex ? (Math.ceil(exactEndIndex) - this.parent.virtualItemCount)
504
+ : infoType.startIndex;
505
+ infoType.endIndex = eIndex < totalItemCount ? eIndex : totalItemCount;
506
+ infoType.startIndex = eIndex >= totalItemCount ? (infoType.endIndex - this.parent.virtualItemCount > 0 ? infoType.endIndex - this.parent.virtualItemCount : 0) : infoType.startIndex;
507
+ infoType.currentPageNumber = Math.ceil(infoType.endIndex / this.parent.virtualItemCount);
508
+ }
509
+ }
510
+ else if (infoType.direction === 'up') {
511
+ if (infoType.startIndex && infoType.endIndex) {
512
+ var loadAtIndex = Math.round(((infoType.startIndex * rowHeight) + (pageSizeBy4 * rowHeight)) / rowHeight);
513
+ if (exactTopIndex < loadAtIndex) {
514
+ var idxAddedToExactTop = (pageSizeBy4) > infoViewIndices ? pageSizeBy4 :
515
+ (infoViewIndices + infoViewIndices / 4);
516
+ var eIndex = Math.round(exactTopIndex + idxAddedToExactTop);
517
+ infoType.endIndex = eIndex < totalItemCount ? eIndex : totalItemCount;
518
+ var sIndex = infoType.endIndex - this.parent.virtualItemCount;
519
+ infoType.startIndex = sIndex > 0 ? sIndex : 0;
520
+ infoType.endIndex = sIndex < 0 ? this.parent.virtualItemCount : infoType.endIndex;
521
+ infoType.currentPageNumber = Math.ceil(infoType.startIndex / this.parent.virtualItemCount);
522
+ }
523
+ }
524
+ }
525
+ if (!isscrollAction) {
526
+ this.parent.previousStartIndex = infoType.startIndex;
527
+ this.parent.startIndex = infoType.startIndex;
528
+ this.parent.previousEndIndex = infoType.endIndex;
529
+ }
530
+ else {
531
+ this.parent.scrollPreStartIndex = infoType.startIndex;
532
+ }
533
+ return infoType;
534
+ };
535
+ VirtualScroll.prototype.virtualScrollHandler = function (callback) {
536
+ var _this = this;
537
+ var delay = Browser.info.name === 'chrome' ? 200 : 100;
538
+ var prevTop = 0;
539
+ var debounced100 = debounce(callback, delay);
540
+ var debounced50 = debounce(callback, 50);
541
+ return function (e) {
542
+ var top = e.target.scrollTop;
543
+ var left = e.target.scrollLeft;
544
+ var direction = prevTop < top && !_this.parent.isUpwardScrolling ? 'down' : 'up';
545
+ prevTop = top;
546
+ var current = _this.sentinelInfo[direction];
547
+ var pstartIndex = _this.parent.scrollPreStartIndex;
548
+ var scrollOffsetargs = {
549
+ top: top,
550
+ left: left
551
+ };
552
+ if (_this.parent.list.querySelectorAll('.e-virtual-list').length > 0) {
553
+ var infoview = _this.getInfoFromView(direction, current, scrollOffsetargs, true);
554
+ if (_this.parent.scrollPreStartIndex != pstartIndex && !_this.parent.isPreventScrollAction) {
555
+ _this.parent.isScrollActionTriggered = true;
556
+ var virtualPoup = (_this.parent.list.querySelector('.e-virtual-ddl-content'));
557
+ virtualPoup.style.transform = "translate(0px," + top + "px)";
558
+ }
559
+ }
560
+ var debounceFunction = debounced100;
561
+ if (current.axis === 'X') {
562
+ debounceFunction = debounced50;
563
+ }
564
+ debounceFunction({ direction: direction, sentinel: current, offset: { top: top, left: left },
565
+ focusElement: document.activeElement });
566
+ };
567
+ };
568
+ VirtualScroll.prototype.destroy = function () {
569
+ this.removeEventListener();
570
+ };
571
+ return VirtualScroll;
572
+ }());
573
+
197
574
  /**
198
575
  * Common source
199
576
  */
@@ -284,6 +661,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
284
661
  _this.addedNewItem = false;
285
662
  _this.isAddNewItemTemplate = false;
286
663
  _this.isRequesting = false;
664
+ _this.isVirtualizationEnabled = false;
665
+ _this.isAllowFiltering = false;
666
+ _this.virtualizedItemsCount = 0;
667
+ _this.totalItemCount = 0;
668
+ _this.dataCount = 0;
287
669
  return _this;
288
670
  }
289
671
  DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
@@ -688,11 +1070,12 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
688
1070
  _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
689
1071
  _this.trigger('actionComplete', e, function (e) {
690
1072
  if (!e.cancel) {
691
- _this.isRequesting = false;
692
1073
  var listItems = e.result;
693
1074
  if (listItems.length === 0) {
694
1075
  _this.isDataFetched = true;
695
1076
  }
1077
+ _this.dataCount = e.count;
1078
+ _this.totalItemCount = e.count;
696
1079
  ulElement = _this.renderItems(listItems, fields);
697
1080
  _this.onActionComplete(ulElement, listItems, e);
698
1081
  if (_this.groupTemplate) {
@@ -701,6 +1084,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
701
1084
  _this.isRequested = false;
702
1085
  _this.bindChildItems(listItems, ulElement, fields, e);
703
1086
  }
1087
+ _this.isRequesting = false;
704
1088
  });
705
1089
  }).catch(function (e) {
706
1090
  _this.isRequested = false;
@@ -710,13 +1094,19 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
710
1094
  });
711
1095
  }
712
1096
  else {
1097
+ _this.isRequesting = false;
713
1098
  var dataManager = new DataManager(eventArgs.data);
714
1099
  var listItems = (_this.getQuery(eventArgs.query)).executeLocal(dataManager);
1100
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1101
+ _this.dataCount = listItems.count;
1102
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1103
+ _this.totalItemCount = listItems.count;
1104
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1105
+ listItems = _this.isVirtualizationEnabled ? listItems.result : listItems;
715
1106
  var localDataArgs = { cancel: false, result: listItems };
716
1107
  _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
717
1108
  _this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
718
1109
  if (!localDataArgs.cancel) {
719
- _this.isRequesting = false;
720
1110
  ulElement = _this.renderItems(localDataArgs.result, fields);
721
1111
  _this.onActionComplete(ulElement, localDataArgs.result, event);
722
1112
  if (_this.groupTemplate) {
@@ -810,6 +1200,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
810
1200
  DropDownBase.prototype.onActionComplete = function (ulElement, list, e) {
811
1201
  /* eslint-enable @typescript-eslint/no-unused-vars */
812
1202
  this.listData = list;
1203
+ if (this.isVirtualizationEnabled) {
1204
+ this.notify("setGeneratedData", {
1205
+ module: "VirtualScroll",
1206
+ });
1207
+ }
813
1208
  if (this.getModuleName() !== 'listbox') {
814
1209
  ulElement.setAttribute('tabindex', '0');
815
1210
  }
@@ -828,11 +1223,13 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
828
1223
  }
829
1224
  }
830
1225
  if (!isNullOrUndefined(this.list)) {
831
- this.list.innerHTML = '';
832
- this.list.appendChild(ulElement);
833
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
834
- this.ulElement = this.list.querySelector('ul');
835
- this.postRender(this.list, list, this.bindEvent);
1226
+ if (!this.isVirtualizationEnabled) {
1227
+ this.list.innerHTML = '';
1228
+ this.list.appendChild(ulElement);
1229
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1230
+ this.ulElement = this.list.querySelector('ul');
1231
+ this.postRender(this.list, list, this.bindEvent);
1232
+ }
836
1233
  }
837
1234
  };
838
1235
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -860,6 +1257,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
860
1257
  DropDownBase.prototype.getQuery = function (query) {
861
1258
  return query ? query : this.query ? this.query : new Query();
862
1259
  };
1260
+ DropDownBase.prototype.updateVirtualizationProperties = function (itemCount, filtering) {
1261
+ this.isVirtualizationEnabled = true;
1262
+ this.virtualizedItemsCount = itemCount;
1263
+ this.isAllowFiltering = filtering;
1264
+ };
863
1265
  /**
864
1266
  * To render the template content for group header element.
865
1267
  *
@@ -998,9 +1400,47 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
998
1400
  new DataManager(dataSource).executeLocal(new Query().take(100))
999
1401
  : dataSource;
1000
1402
  ulElement = this.templateListItem((this.getModuleName() === 'autocomplete') ? spliceData : dataSource, fields);
1403
+ if (this.isVirtualizationEnabled) {
1404
+ var oldUlElement = this.list.querySelector('.e-list-parent');
1405
+ var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
1406
+ if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
1407
+ virtualUlElement.replaceChild(ulElement, oldUlElement);
1408
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1409
+ this.ulElement = this.list.querySelector('ul');
1410
+ this.listData = listData;
1411
+ this.postRender(this.list, listData, this.bindEvent);
1412
+ }
1413
+ else if ((!virtualUlElement)) {
1414
+ this.list.innerHTML = '';
1415
+ this.list.appendChild(ulElement);
1416
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1417
+ this.ulElement = this.list.querySelector('ul');
1418
+ this.listData = listData;
1419
+ this.postRender(this.list, listData, this.bindEvent);
1420
+ }
1421
+ }
1001
1422
  }
1002
1423
  else {
1003
1424
  ulElement = this.createListItems(listData, fields);
1425
+ if (this.isVirtualizationEnabled) {
1426
+ var oldUlElement = this.list.querySelector('.e-list-parent');
1427
+ var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
1428
+ if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
1429
+ virtualUlElement.replaceChild(ulElement, oldUlElement);
1430
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1431
+ this.ulElement = this.list.querySelector('ul');
1432
+ this.listData = listData;
1433
+ this.postRender(this.list, listData, this.bindEvent);
1434
+ }
1435
+ else if ((!virtualUlElement)) {
1436
+ this.list.innerHTML = '';
1437
+ this.list.appendChild(ulElement);
1438
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1439
+ this.ulElement = this.list.querySelector('ul');
1440
+ this.listData = listData;
1441
+ this.postRender(this.list, listData, this.bindEvent);
1442
+ }
1443
+ }
1004
1444
  }
1005
1445
  return ulElement;
1006
1446
  };
@@ -1140,7 +1580,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1140
1580
  }
1141
1581
  };
1142
1582
  DropDownBase.prototype.updateSelectElementData = function (isFiltering) {
1143
- if (isFiltering && isNullOrUndefined(this.selectData) && this.listData && this.listData.length > 0) {
1583
+ if ((isFiltering || this.isVirtualizationEnabled) && isNullOrUndefined(this.selectData) && this.listData && this.listData.length > 0) {
1144
1584
  this.selectData = this.listData;
1145
1585
  }
1146
1586
  };
@@ -1154,6 +1594,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1154
1594
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1155
1595
  DropDownBase.prototype.updateDataSource = function (props) {
1156
1596
  this.resetList(this.dataSource);
1597
+ this.totalItemCount = this.dataSource instanceof DataManager ? this.dataSource.dataSource.json.length : 0;
1157
1598
  };
1158
1599
  DropDownBase.prototype.setUpdateInitial = function (props, newProp) {
1159
1600
  this.isDataFetched = false;
@@ -1587,6 +2028,7 @@ var dropDownListClasses = {
1587
2028
  disable: dropDownBaseClasses.disabled,
1588
2029
  base: dropDownBaseClasses.root,
1589
2030
  focus: dropDownBaseClasses.focus,
2031
+ content: dropDownBaseClasses.content,
1590
2032
  input: 'e-input-group',
1591
2033
  inputFocus: 'e-input-focus',
1592
2034
  icon: 'e-input-group-icon e-ddl-icon',
@@ -1604,7 +2046,8 @@ var dropDownListClasses = {
1604
2046
  clearIconHide: 'e-clear-icon-hide',
1605
2047
  popupFullScreen: 'e-popup-full-page',
1606
2048
  disableIcon: 'e-ddl-disable-icon',
1607
- hiddenElement: 'e-ddl-hidden'
2049
+ hiddenElement: 'e-ddl-hidden',
2050
+ virtualList: 'e-list-item e-virtual-list',
1608
2051
  };
1609
2052
  var inputObject = {
1610
2053
  container: null,
@@ -1632,9 +2075,52 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1632
2075
  */
1633
2076
  function DropDownList(options, element) {
1634
2077
  var _this = _super.call(this, options, element) || this;
2078
+ _this.skeletonCount = 32;
1635
2079
  _this.isListSearched = false;
1636
2080
  _this.preventChange = false;
1637
2081
  _this.isAngular = false;
2082
+ _this.itemCount = 10;
2083
+ _this.virtualListHeight = 0;
2084
+ _this.isVirtualScrolling = false;
2085
+ _this.isPreventScrollAction = false;
2086
+ _this.scrollPreStartIndex = 0;
2087
+ _this.isScrollActionTriggered = false;
2088
+ _this.previousStartIndex = 0;
2089
+ _this.isMouseScrollAction = false;
2090
+ _this.isKeyBoardAction = false;
2091
+ _this.isUpwardScrolling = false;
2092
+ _this.startIndex = 0;
2093
+ _this.currentPageNumber = 0;
2094
+ _this.pageCount = 0;
2095
+ _this.isPreventKeyAction = false;
2096
+ _this.generatedDataObject = {};
2097
+ _this.virtualListInfo = {
2098
+ currentPageNumber: null,
2099
+ direction: null,
2100
+ sentinelInfo: {},
2101
+ offsets: {},
2102
+ startIndex: 0,
2103
+ endIndex: 0,
2104
+ };
2105
+ _this.viewPortInfo = {
2106
+ currentPageNumber: null,
2107
+ direction: null,
2108
+ sentinelInfo: {},
2109
+ offsets: {},
2110
+ startIndex: 0,
2111
+ endIndex: 0,
2112
+ };
2113
+ _this.selectedValueInfo = {
2114
+ currentPageNumber: null,
2115
+ direction: null,
2116
+ sentinelInfo: {},
2117
+ offsets: {},
2118
+ startIndex: 0,
2119
+ endIndex: 0,
2120
+ };
2121
+ _this.IsScrollerAtEnd = function () {
2122
+ return this.list && this.list.scrollTop + this.list.clientHeight >= this.list.scrollHeight;
2123
+ };
1638
2124
  return _this;
1639
2125
  }
1640
2126
  /**
@@ -1693,14 +2179,31 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1693
2179
  hide: 'alt+38',
1694
2180
  space: '32'
1695
2181
  };
2182
+ this.viewPortInfo = {
2183
+ currentPageNumber: null,
2184
+ direction: null,
2185
+ sentinelInfo: {},
2186
+ offsets: {},
2187
+ startIndex: 0,
2188
+ endIndex: this.itemCount,
2189
+ };
1696
2190
  };
1697
2191
  DropDownList.prototype.setZIndex = function () {
1698
2192
  if (this.popupObj) {
1699
2193
  this.popupObj.setProperties({ 'zIndex': this.zIndex });
1700
2194
  }
1701
2195
  };
2196
+ DropDownList.prototype.requiredModules = function () {
2197
+ var modules = [];
2198
+ if (this.enableVirtualization) {
2199
+ modules.push({ args: [this], member: 'VirtualScroll' });
2200
+ }
2201
+ return modules;
2202
+ };
1702
2203
  DropDownList.prototype.renderList = function (e, isEmptyData) {
1703
2204
  _super.prototype.render.call(this, e, isEmptyData);
2205
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2206
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
1704
2207
  this.unWireListEvents();
1705
2208
  this.wireListEvents();
1706
2209
  };
@@ -1718,6 +2221,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1718
2221
  DropDownList.prototype.resetHandler = function (e) {
1719
2222
  e.preventDefault();
1720
2223
  this.clearAll(e);
2224
+ if (this.enableVirtualization) {
2225
+ this.list.scrollTop = 0;
2226
+ this.virtualListInfo = null;
2227
+ this.previousStartIndex = 0;
2228
+ this.previousEndIndex = 0;
2229
+ }
1721
2230
  };
1722
2231
  DropDownList.prototype.resetFocusElement = function () {
1723
2232
  this.removeHover();
@@ -1726,6 +2235,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1726
2235
  this.list.scrollTop = 0;
1727
2236
  if (this.getModuleName() !== 'autocomplete' && !isNullOrUndefined(this.ulElement)) {
1728
2237
  var li = this.ulElement.querySelector('.' + dropDownListClasses.li);
2238
+ if (this.enableVirtualization) {
2239
+ li = this.liCollections[this.skeletonCount];
2240
+ }
1729
2241
  if (li) {
1730
2242
  li.classList.add(dropDownListClasses.focus);
1731
2243
  }
@@ -1744,6 +2256,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1744
2256
  return;
1745
2257
  }
1746
2258
  this.onChangeEvent(e);
2259
+ this.checkAndResetCache();
2260
+ if (this.enableVirtualization) {
2261
+ this.updateInitialData();
2262
+ }
1747
2263
  };
1748
2264
  DropDownList.prototype.resetSelection = function (properties) {
1749
2265
  if (this.list) {
@@ -1810,10 +2326,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1810
2326
  this.inputWrapper.container.setAttribute('style', this.htmlAttributes["" + htmlAttr]);
1811
2327
  }
1812
2328
  else if (htmlAttr === 'aria-label') {
1813
- if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
2329
+ if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') && !this.readonly) {
1814
2330
  this.inputElement.setAttribute('aria-label', this.htmlAttributes["" + htmlAttr]);
1815
2331
  }
1816
- else {
2332
+ else if (this.getModuleName() === 'dropdownlist') {
1817
2333
  this.inputWrapper.container.setAttribute('aria-label', this.htmlAttributes["" + htmlAttr]);
1818
2334
  }
1819
2335
  }
@@ -1913,6 +2429,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1913
2429
  return item;
1914
2430
  };
1915
2431
  DropDownList.prototype.initValue = function () {
2432
+ this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
2433
+ this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.itemCount;
1916
2434
  this.renderList();
1917
2435
  if (this.dataSource instanceof DataManager) {
1918
2436
  this.initRemoteRender = true;
@@ -1922,6 +2440,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1922
2440
  }
1923
2441
  };
1924
2442
  DropDownList.prototype.updateValues = function () {
2443
+ this.selectedValueInfo = this.viewPortInfo;
1925
2444
  if (!isNullOrUndefined(this.value)) {
1926
2445
  this.setSelection(this.getElementByValue(this.value), null);
1927
2446
  }
@@ -2110,6 +2629,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2110
2629
  };
2111
2630
  DropDownList.prototype.onMouseClick = function (e) {
2112
2631
  var target = e.target;
2632
+ this.keyboardEvent = null;
2113
2633
  var li = closest(target, '.' + dropDownBaseClasses.li);
2114
2634
  if (!this.isValidLI(li)) {
2115
2635
  return;
@@ -2190,6 +2710,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2190
2710
  if (!this.enabled) {
2191
2711
  return;
2192
2712
  }
2713
+ this.keyboardEvent = e;
2714
+ if (this.isPreventKeyAction && this.enableVirtualization) {
2715
+ e.preventDefault();
2716
+ }
2193
2717
  var preventAction = e.action === 'pageUp' || e.action === 'pageDown';
2194
2718
  var preventHomeEnd = this.getModuleName() !== 'dropdownlist' && (e.action === 'home' || e.action === 'end');
2195
2719
  this.isEscapeKey = e.action === 'escape';
@@ -2229,9 +2753,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2229
2753
  e.preventDefault();
2230
2754
  break;
2231
2755
  case 'home':
2756
+ this.isMouseScrollAction = true;
2232
2757
  this.updateHomeEndAction(e);
2233
2758
  break;
2234
2759
  case 'end':
2760
+ this.isMouseScrollAction = true;
2235
2761
  this.updateHomeEndAction(e);
2236
2762
  break;
2237
2763
  case 'space':
@@ -2265,13 +2791,19 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2265
2791
  }
2266
2792
  }
2267
2793
  };
2268
- DropDownList.prototype.updateUpDownAction = function (e) {
2794
+ DropDownList.prototype.updateUpDownAction = function (e, isVirtualKeyAction) {
2269
2795
  var focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
2270
- if (this.isSelectFocusItem(focusEle)) {
2796
+ if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
2271
2797
  this.setSelection(focusEle, e);
2798
+ if (this.enableVirtualization) {
2799
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
2800
+ this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
2801
+ }
2272
2802
  }
2273
2803
  else if (!isNullOrUndefined(this.liCollections)) {
2804
+ var virtualIndex = this.activeIndex;
2274
2805
  var index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
2806
+ index = isVirtualKeyAction ? virtualIndex : index;
2275
2807
  var startIndex = 0;
2276
2808
  if (this.getModuleName() === 'autocomplete') {
2277
2809
  startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
@@ -2279,8 +2811,26 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2279
2811
  }
2280
2812
  var nextItem = void 0;
2281
2813
  if (this.getModuleName() !== 'autocomplete' || this.getModuleName() === 'autocomplete' && this.isPopupOpen) {
2282
- nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
2283
- : this.liCollections[index];
2814
+ if (!this.enableVirtualization) {
2815
+ nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
2816
+ : this.liCollections[index];
2817
+ }
2818
+ else {
2819
+ if (!isVirtualKeyAction) {
2820
+ nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[this.skeletonCount]
2821
+ : this.liCollections[index];
2822
+ nextItem = !isNullOrUndefined(nextItem) && !nextItem.classList.contains('e-virtual-list') ? nextItem : null;
2823
+ }
2824
+ else {
2825
+ if (this.getModuleName() === 'autocomplete') {
2826
+ var value = this.selectedLI.dataset.value;
2827
+ nextItem = this.getElementByValue(value);
2828
+ }
2829
+ else {
2830
+ nextItem = this.getElementByValue(this.getItemData().value);
2831
+ }
2832
+ }
2833
+ }
2284
2834
  }
2285
2835
  if (!isNullOrUndefined(nextItem)) {
2286
2836
  this.setSelection(nextItem, e);
@@ -2288,17 +2838,23 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2288
2838
  }
2289
2839
  e.preventDefault();
2290
2840
  };
2291
- DropDownList.prototype.updateHomeEndAction = function (e) {
2841
+ DropDownList.prototype.updateHomeEndAction = function (e, isVirtualKeyAction) {
2292
2842
  if (this.getModuleName() === 'dropdownlist') {
2293
2843
  var findLi = 0;
2294
2844
  if (e.action === 'home') {
2295
2845
  findLi = 0;
2846
+ if (this.enableVirtualization) {
2847
+ findLi = this.skeletonCount;
2848
+ }
2296
2849
  }
2297
2850
  else {
2298
2851
  findLi = this.getItems().length - 1;
2299
2852
  }
2300
2853
  e.preventDefault();
2301
2854
  if (this.activeIndex === findLi) {
2855
+ if (isVirtualKeyAction) {
2856
+ this.setSelection(this.liCollections[findLi], e);
2857
+ }
2302
2858
  return;
2303
2859
  }
2304
2860
  this.setSelection(this.liCollections[findLi], e);
@@ -2336,6 +2892,36 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2336
2892
  }
2337
2893
  }
2338
2894
  };
2895
+ DropDownList.prototype.handleVirtualKeyboardActions = function (e, pageCount) {
2896
+ switch (e.action) {
2897
+ case 'down':
2898
+ case 'up':
2899
+ if (this.itemData != null || this.getModuleName() === 'autocomplete') {
2900
+ this.updateUpDownAction(e, true);
2901
+ }
2902
+ break;
2903
+ case 'pageUp':
2904
+ var count = (pageCount * 2) - 4;
2905
+ this.activeIndex = Math.round(count);
2906
+ this.pageUpSelection(this.activeIndex - this.getPageCount(), e, true);
2907
+ e.preventDefault();
2908
+ break;
2909
+ case 'pageDown':
2910
+ this.activeIndex = 1;
2911
+ this.pageDownSelection(this.activeIndex + this.getPageCount(), e, true);
2912
+ e.preventDefault();
2913
+ break;
2914
+ case 'home':
2915
+ this.isMouseScrollAction = true;
2916
+ this.updateHomeEndAction(e, true);
2917
+ break;
2918
+ case 'end':
2919
+ this.isMouseScrollAction = true;
2920
+ this.updateHomeEndAction(e, true);
2921
+ break;
2922
+ }
2923
+ this.keyboardEvent = null;
2924
+ };
2339
2925
  DropDownList.prototype.selectCurrentItem = function (e) {
2340
2926
  if (this.isPopupOpen) {
2341
2927
  var li = this.list.querySelector('.' + dropDownListClasses.focus);
@@ -2357,19 +2943,39 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2357
2943
  DropDownList.prototype.isSelectFocusItem = function (element) {
2358
2944
  return !isNullOrUndefined(element);
2359
2945
  };
2360
- DropDownList.prototype.getPageCount = function () {
2946
+ DropDownList.prototype.getPageCount = function (returnExactCount) {
2361
2947
  var liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
2362
2948
  getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
2363
- return Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
2949
+ var pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
2950
+ return returnExactCount ? pageCount : Math.round(pageCount);
2364
2951
  };
2365
- DropDownList.prototype.pageUpSelection = function (steps, event) {
2952
+ DropDownList.prototype.pageUpSelection = function (steps, event, isVirtualKeyAction) {
2366
2953
  var previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
2367
- this.setSelection(previousItem, event);
2954
+ if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
2955
+ previousItem = steps >= 0 ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
2956
+ }
2957
+ if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
2958
+ previousItem = this.liCollections[this.skeletonCount];
2959
+ }
2960
+ this.PageUpDownSelection(previousItem, event);
2961
+ };
2962
+ DropDownList.prototype.PageUpDownSelection = function (previousItem, event) {
2963
+ if (this.enableVirtualization) {
2964
+ if (!isNullOrUndefined(previousItem) && ((this.getModuleName() !== 'autocomplete' && !previousItem.classList.contains('e-active')) || (this.getModuleName() === 'autocomplete' && !previousItem.classList.contains('e-item-focus')))) {
2965
+ this.setSelection(previousItem, event);
2966
+ }
2967
+ }
2968
+ else {
2969
+ this.setSelection(previousItem, event);
2970
+ }
2368
2971
  };
2369
- DropDownList.prototype.pageDownSelection = function (steps, event) {
2972
+ DropDownList.prototype.pageDownSelection = function (steps, event, isVirtualKeyAction) {
2370
2973
  var list = this.getItems();
2371
2974
  var previousItem = steps <= list.length ? this.liCollections[steps - 1] : this.liCollections[list.length - 1];
2372
- this.setSelection(previousItem, event);
2975
+ if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
2976
+ previousItem = steps <= list.length ? this.liCollections[steps + this.skeletonCount - 1] : this.liCollections[list.length - 1];
2977
+ }
2978
+ this.PageUpDownSelection(previousItem, event);
2373
2979
  };
2374
2980
  DropDownList.prototype.unWireEvent = function () {
2375
2981
  if (!isNullOrUndefined(this.inputWrapper)) {
@@ -2434,6 +3040,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2434
3040
  if (e.which === 3 || e.button === 2) {
2435
3041
  return;
2436
3042
  }
3043
+ this.keyboardEvent = null;
2437
3044
  if (this.targetElement().classList.contains(dropDownListClasses.disable) || this.inputWrapper.clearButton === e.target) {
2438
3045
  return;
2439
3046
  }
@@ -2579,6 +3186,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2579
3186
  }
2580
3187
  else {
2581
3188
  this.setSelectOptions(li, e);
3189
+ if (this.enableVirtualization) {
3190
+ var fields = (this.fields.value) ? this.fields.value : '';
3191
+ var getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
3192
+ if (getItem && getItem.length > 0) {
3193
+ this.itemData = getItem[0];
3194
+ this.setProperties({ 'text': getItem[0].text, 'value': getItem[0].value }, true);
3195
+ }
3196
+ }
2582
3197
  }
2583
3198
  };
2584
3199
  DropDownList.prototype.setSelectOptions = function (li, e) {
@@ -2837,6 +3452,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2837
3452
  this.typedString = this.filterInput.value;
2838
3453
  this.preventAutoFill = false;
2839
3454
  this.searchLists(e);
3455
+ if (this.enableVirtualization) {
3456
+ this.getFilteringSkeletonCount();
3457
+ }
2840
3458
  break;
2841
3459
  }
2842
3460
  }
@@ -2844,6 +3462,33 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2844
3462
  this.isValidKey = false;
2845
3463
  }
2846
3464
  };
3465
+ DropDownList.prototype.getFilteringSkeletonCount = function () {
3466
+ var difference = this.dataCount - this.viewPortInfo.endIndex;
3467
+ var currentSkeletonCount = this.skeletonCount;
3468
+ this.getSkeletonCount(true);
3469
+ this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
3470
+ if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
3471
+ var isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
3472
+ if (currentSkeletonCount !== this.skeletonCount) {
3473
+ this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
3474
+ }
3475
+ else {
3476
+ this.UpdateSkeleton();
3477
+ }
3478
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
3479
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3480
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
3481
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3482
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3483
+ }
3484
+ };
3485
+ DropDownList.prototype.getSkeletonCount = function (retainSkeleton) {
3486
+ this.virtualListHeight = this.listHeight != null ? parseInt(this.listHeight, 10) : this.virtualListHeight;
3487
+ var actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
3488
+ this.skeletonCount = actualCount * 2 < this.itemCount ? this.itemCount : actualCount * 2;
3489
+ this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
3490
+ this.skeletonCount = Math.floor(this.skeletonCount / 2) + 2;
3491
+ };
2847
3492
  DropDownList.prototype.onFilterDown = function (e) {
2848
3493
  switch (e.keyCode) {
2849
3494
  case 13: //enter
@@ -2887,6 +3532,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2887
3532
  else {
2888
3533
  filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
2889
3534
  }
3535
+ if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0)) {
3536
+ var takeValue = this.getTakeValue();
3537
+ if (this.allowFiltering) {
3538
+ filterQuery.skip(this.virtualItemStartIndex);
3539
+ }
3540
+ filterQuery.take(takeValue);
3541
+ filterQuery.requiresCount();
3542
+ }
2890
3543
  return filterQuery;
2891
3544
  };
2892
3545
  DropDownList.prototype.getSelectionPoints = function () {
@@ -2904,6 +3557,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2904
3557
  }
2905
3558
  this.isDataFetched = false;
2906
3559
  if (this.isFiltering()) {
3560
+ this.checkAndResetCache();
2907
3561
  var eventArgs_1 = {
2908
3562
  preventDefaultAction: false,
2909
3563
  text: this.filterInput.value,
@@ -2941,10 +3595,30 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2941
3595
  if (!isNullOrUndefined(this.filterInput)) {
2942
3596
  this.beforePopupOpen = (!this.isPopupOpen && this.getModuleName() === 'combobox' && this.filterInput.value === '') ?
2943
3597
  false : true;
3598
+ var isNoData = this.list.classList.contains(dropDownBaseClasses.noData);
2944
3599
  if (this.filterInput.value.trim() === '' && !this.itemTemplate) {
2945
3600
  this.actionCompleteData.isUpdated = false;
2946
3601
  this.isTyped = false;
2947
3602
  if (!isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {
3603
+ if (this.enableVirtualization) {
3604
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3605
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
3606
+ this.resetList(dataSource, fields, query);
3607
+ if (isNoData && !this.list.classList.contains(dropDownBaseClasses.noData)) {
3608
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
3609
+ this.list.appendChild(this.createElement('div', {
3610
+ className: 'e-virtual-ddl-content',
3611
+ styles: this.getTransformValues()
3612
+ })).appendChild(this.list.querySelector('.e-list-parent'));
3613
+ }
3614
+ if (!this.list.querySelector('.e-virtual-ddl')) {
3615
+ var virualElement = this.createElement('div', {
3616
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
3617
+ });
3618
+ document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
3619
+ }
3620
+ }
3621
+ }
2948
3622
  this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list);
2949
3623
  }
2950
3624
  this.isTyped = true;
@@ -2957,7 +3631,30 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2957
3631
  else {
2958
3632
  this.isNotSearchList = false;
2959
3633
  query = (this.filterInput.value.trim() === '') ? null : query;
3634
+ if (this.enableVirtualization && this.isFiltering() && this.isTyped) {
3635
+ this.isPreventScrollAction = true;
3636
+ this.list.scrollTop = 0;
3637
+ this.previousStartIndex = 0;
3638
+ this.virtualListInfo = null;
3639
+ }
2960
3640
  this.resetList(dataSource, fields, query);
3641
+ if (this.enableVirtualization && isNoData && !this.list.classList.contains(dropDownBaseClasses.noData)) {
3642
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
3643
+ this.list.appendChild(this.createElement('div', {
3644
+ className: 'e-virtual-ddl-content',
3645
+ styles: this.getTransformValues()
3646
+ })).appendChild(this.list.querySelector('.e-list-parent'));
3647
+ }
3648
+ if (!this.list.querySelector('.e-virtual-ddl')) {
3649
+ var virualElement = this.createElement('div', {
3650
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
3651
+ });
3652
+ document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
3653
+ }
3654
+ }
3655
+ }
3656
+ if (this.enableVirtualization) {
3657
+ this.getFilteringSkeletonCount();
2961
3658
  }
2962
3659
  this.renderReactTemplates();
2963
3660
  }
@@ -3055,16 +3752,48 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3055
3752
  this.renderPopup();
3056
3753
  }
3057
3754
  };
3755
+ DropDownList.prototype.UpdateSkeleton = function (isSkeletonCountChange, skeletonCount) {
3756
+ var isContainSkeleton = this.list.querySelector('.e-virtual-ddl-content');
3757
+ var isContainVirtualList = this.list.querySelector('.e-virtual-list');
3758
+ if (isContainSkeleton && (!isContainVirtualList || isSkeletonCountChange) && this.enableVirtualization) {
3759
+ var totalSkeletonCount = isSkeletonCountChange ? skeletonCount : this.skeletonCount;
3760
+ for (var i = 0; i < totalSkeletonCount; i++) {
3761
+ var liElement = this.createElement('li', { className: dropDownListClasses.virtualList, styles: 'overflow: inherit' });
3762
+ if (this.enableVirtualization && this.itemTemplate) {
3763
+ liElement.style.height = this.listItemHeight + 'px';
3764
+ }
3765
+ var skeleton = new Skeleton({
3766
+ shape: "Text",
3767
+ height: "10px",
3768
+ width: "95%",
3769
+ cssClass: "e-skeleton-text",
3770
+ });
3771
+ skeleton.appendTo(this.createElement('div'));
3772
+ liElement.appendChild(skeleton.element);
3773
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3774
+ isContainSkeleton.firstChild.insertBefore(liElement, isContainSkeleton.firstChild.children[0]);
3775
+ }
3776
+ }
3777
+ };
3778
+ DropDownList.prototype.getTakeValue = function () {
3779
+ return this.allowFiltering && this.getModuleName() === 'dropdownlist' && Browser.isDevice ? Math.round(window.outerHeight / this.listItemHeight) : this.itemCount;
3780
+ };
3058
3781
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3059
3782
  DropDownList.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
3060
3783
  var _this = this;
3061
- if (this.isNotSearchList) {
3784
+ if (this.dataSource instanceof DataManager && !isNullOrUndefined(e)) {
3785
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3786
+ this.totalItemCount = e.count;
3787
+ }
3788
+ if (this.isNotSearchList && !this.enableVirtualization) {
3062
3789
  this.isNotSearchList = false;
3063
3790
  return;
3064
3791
  }
3792
+ var tempItemCount = this.itemCount;
3065
3793
  if (this.isActive || !isNullOrUndefined(ulElement)) {
3066
3794
  var selectedItem = this.selectedLI ? this.selectedLI.cloneNode(true) : null;
3067
3795
  _super.prototype.onActionComplete.call(this, ulElement, list, e);
3796
+ this.skeletonCount = this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2) ? 0 : this.skeletonCount;
3068
3797
  this.updateSelectElementData(this.allowFiltering);
3069
3798
  if (this.isRequested && !isNullOrUndefined(this.searchKeyEvent) && this.searchKeyEvent.type === 'keydown') {
3070
3799
  this.isRequested = false;
@@ -3075,7 +3804,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3075
3804
  this.incrementalSearch(this.searchKeyEvent);
3076
3805
  this.searchKeyEvent = null;
3077
3806
  }
3078
- this.list.scrollTop = 0;
3807
+ if (!this.enableVirtualization) {
3808
+ this.list.scrollTop = 0;
3809
+ }
3079
3810
  if (!isNullOrUndefined(ulElement)) {
3080
3811
  attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
3081
3812
  }
@@ -3129,13 +3860,36 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3129
3860
  this.updateActionCompleteDataValues(ulElement, list);
3130
3861
  }
3131
3862
  }
3132
- this.addNewItem(list, selectedItem);
3133
- if (!isNullOrUndefined(this.itemData)) {
3863
+ if (!this.enableVirtualization) {
3864
+ this.addNewItem(list, selectedItem);
3865
+ }
3866
+ if (!isNullOrUndefined(this.itemData) || (isNullOrUndefined(this.itemData) && this.enableVirtualization)) {
3134
3867
  this.focusIndexItem();
3135
3868
  }
3869
+ if (this.enableVirtualization) {
3870
+ this.updateActionCompleteDataValues(ulElement, list);
3871
+ }
3872
+ }
3873
+ else if (this.enableVirtualization && this.getModuleName() !== 'autocomplete' && !this.isFiltering()) {
3874
+ var value = this.getItemData().value;
3875
+ this.activeIndex = this.getIndexByValue(value);
3876
+ var element = this.findListElement(this.list, 'li', 'data-value', value);
3877
+ this.selectedLI = element;
3878
+ }
3879
+ else if (this.enableVirtualization && this.getModuleName() === 'autocomplete') {
3880
+ this.activeIndex = this.skeletonCount;
3136
3881
  }
3137
3882
  if (this.beforePopupOpen) {
3138
3883
  this.renderPopup(e);
3884
+ if (this.enableVirtualization) {
3885
+ if (!this.list.querySelector('.e-virtual-list')) {
3886
+ this.UpdateSkeleton();
3887
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
3888
+ }
3889
+ }
3890
+ if (this.enableVirtualization && tempItemCount != this.itemCount) {
3891
+ this.resetList(this.dataSource, this.fields);
3892
+ }
3139
3893
  }
3140
3894
  }
3141
3895
  };
@@ -3198,7 +3952,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3198
3952
  var element = this.findListElement(this.list, 'li', 'data-value', value);
3199
3953
  this.selectedLI = element;
3200
3954
  this.activeItem(element);
3201
- this.removeFocus();
3955
+ if (!(this.enableVirtualization && isNullOrUndefined(element))) {
3956
+ this.removeFocus();
3957
+ }
3202
3958
  };
3203
3959
  DropDownList.prototype.updateSelection = function () {
3204
3960
  var selectedItem = this.list.querySelector('.' + dropDownBaseClasses.selected);
@@ -3211,12 +3967,46 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3211
3967
  this.list.querySelector('.' + dropDownBaseClasses.li).classList.add(dropDownListClasses.focus);
3212
3968
  }
3213
3969
  };
3970
+ DropDownList.prototype.updateSelectionList = function () {
3971
+ var selectedItem = this.list && this.list.querySelector('.' + 'e-active');
3972
+ if (!selectedItem && !isNullOrUndefined(this.value)) {
3973
+ var findEle = this.findListElement(this.list, 'li', 'data-value', this.value);
3974
+ if (findEle) {
3975
+ findEle.classList.add('e-active');
3976
+ }
3977
+ }
3978
+ };
3979
+ DropDownList.prototype.checkAndResetCache = function () {
3980
+ if (this.enableVirtualization) {
3981
+ this.generatedDataObject = {};
3982
+ this.virtualItemStartIndex = this.virtualItemEndIndex = 0;
3983
+ this.viewPortInfo = { currentPageNumber: null,
3984
+ direction: null,
3985
+ sentinelInfo: {},
3986
+ offsets: {},
3987
+ startIndex: 0,
3988
+ endIndex: this.itemCount, };
3989
+ this.selectedValueInfo = null;
3990
+ }
3991
+ };
3214
3992
  DropDownList.prototype.removeFocus = function () {
3215
3993
  var highlightedItem = this.list.querySelectorAll('.' + dropDownListClasses.focus);
3216
3994
  if (highlightedItem && highlightedItem.length) {
3217
3995
  removeClass(highlightedItem, dropDownListClasses.focus);
3218
3996
  }
3219
3997
  };
3998
+ DropDownList.prototype.getTransformValues = function () {
3999
+ var translateY = this.viewPortInfo.startIndex * this.listItemHeight;
4000
+ translateY = translateY - (this.skeletonCount * this.listItemHeight);
4001
+ translateY = this.viewPortInfo.startIndex === 0 && this.listData && this.listData.length === 0 ? 0 : translateY;
4002
+ var styleText = "transform: translate(0px, " + translateY + "px);";
4003
+ return styleText;
4004
+ };
4005
+ DropDownList.prototype.GetVirtualTrackHeight = function () {
4006
+ var height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
4007
+ var heightDimension = "height: " + (height - this.itemCount * this.listItemHeight) + "px;";
4008
+ return heightDimension;
4009
+ };
3220
4010
  DropDownList.prototype.renderPopup = function (e) {
3221
4011
  var _this = this;
3222
4012
  if (this.popupObj && document.body.contains(this.popupObj.element)) {
@@ -3239,10 +4029,39 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3239
4029
  _this.setFooterTemplate(popupEle);
3240
4030
  }
3241
4031
  document.body.appendChild(popupEle);
4032
+ if (_this.enableVirtualization && _this.itemTemplate) {
4033
+ var listitems = popupEle.querySelectorAll('li.e-list-item:not(.e-virtual-list)');
4034
+ _this.listItemHeight = listitems.length > 0 ? Math.ceil(listitems[0].getBoundingClientRect().height) : 0;
4035
+ }
4036
+ if (_this.enableVirtualization && !_this.list.classList.contains(dropDownBaseClasses.noData)) {
4037
+ if (!_this.list.querySelector('.e-virtual-ddl-content')) {
4038
+ _this.list.appendChild(_this.createElement('div', {
4039
+ className: 'e-virtual-ddl-content',
4040
+ styles: _this.getTransformValues()
4041
+ })).appendChild(_this.list.querySelector('.e-list-parent'));
4042
+ }
4043
+ else {
4044
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4045
+ _this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = _this.getTransformValues();
4046
+ }
4047
+ _this.UpdateSkeleton();
4048
+ _this.liCollections = _this.list.querySelectorAll('.' + dropDownBaseClasses.li);
4049
+ _this.virtualItemCount = _this.itemCount;
4050
+ if (!_this.list.querySelector('.e-virtual-ddl')) {
4051
+ var virualElement = _this.createElement('div', {
4052
+ id: _this.element.id + '_popup', className: 'e-virtual-ddl', styles: _this.GetVirtualTrackHeight()
4053
+ });
4054
+ popupEle.querySelector('.e-dropdownbase').appendChild(virualElement);
4055
+ }
4056
+ else {
4057
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4058
+ _this.list.getElementsByClassName('e-virtual-ddl')[0].style = _this.GetVirtualTrackHeight();
4059
+ }
4060
+ }
3242
4061
  popupEle.style.visibility = 'hidden';
3243
4062
  if (_this.popupHeight !== 'auto') {
3244
4063
  _this.searchBoxHeight = 0;
3245
- if (!isNullOrUndefined(searchBox.container)) {
4064
+ if (!isNullOrUndefined(searchBox.container) && _this.getModuleName() !== 'combobox' && _this.getModuleName() !== 'autocomplete') {
3246
4065
  _this.searchBoxHeight = (searchBox.container.parentElement).getBoundingClientRect().height;
3247
4066
  _this.listHeight = (parseInt(_this.listHeight, 10) - (_this.searchBoxHeight)).toString() + 'px';
3248
4067
  }
@@ -3264,9 +4083,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3264
4083
  }
3265
4084
  var offsetValue = 0;
3266
4085
  var left = void 0;
4086
+ _this.isPreventScrollAction = true;
3267
4087
  if (!isNullOrUndefined(_this.selectedLI) && (!isNullOrUndefined(_this.activeIndex) && _this.activeIndex >= 0)) {
3268
4088
  _this.setScrollPosition();
3269
4089
  }
4090
+ else if (_this.enableVirtualization) {
4091
+ _this.setScrollPosition();
4092
+ }
3270
4093
  else {
3271
4094
  _this.list.scrollTop = 0;
3272
4095
  }
@@ -3282,6 +4105,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3282
4105
  }
3283
4106
  _this.getFocusElement();
3284
4107
  _this.createPopup(popupEle, offsetValue, left);
4108
+ _this.popupContentElement = _this.popupObj.element.querySelector('.e-content');
3285
4109
  _this.checkCollision(popupEle);
3286
4110
  if (Browser.isDevice) {
3287
4111
  _this.popupObj.element.classList.add(dropDownListClasses.device);
@@ -3314,6 +4138,24 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3314
4138
  _this.wireListEvents();
3315
4139
  }
3316
4140
  _this.selectedElementID = _this.selectedLI ? _this.selectedLI.id : null;
4141
+ if (_this.enableVirtualization) {
4142
+ _this.notify("bindScrollEvent", {
4143
+ module: "VirtualScroll",
4144
+ component: _this.getModuleName(),
4145
+ enable: _this.enableVirtualization,
4146
+ });
4147
+ setTimeout(function () {
4148
+ if (_this.value) {
4149
+ _this.updateSelectionList();
4150
+ if (_this.selectedValueInfo && _this.viewPortInfo && _this.viewPortInfo.offsets.top) {
4151
+ _this.list.scrollTop = _this.viewPortInfo.offsets.top;
4152
+ }
4153
+ else {
4154
+ _this.scrollBottom(true, true);
4155
+ }
4156
+ }
4157
+ }, 5);
4158
+ }
3317
4159
  attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_options' });
3318
4160
  _this.inputElement.setAttribute('aria-expanded', 'true');
3319
4161
  var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
@@ -3362,7 +4204,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3362
4204
  var _this = this;
3363
4205
  this.popupObj = new Popup(element, {
3364
4206
  width: this.setWidth(), targetType: 'relative',
3365
- relateTo: this.inputWrapper.container, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
4207
+ relateTo: this.inputWrapper.container,
4208
+ collision: this.enableRtl ? { X: 'fit', Y: 'flip' } : { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
3366
4209
  enableRtl: this.enableRtl, offsetX: left,
3367
4210
  position: this.enableRtl ? { X: 'right', Y: 'bottom' } : { X: 'left', Y: 'bottom' },
3368
4211
  zIndex: this.zIndex,
@@ -3448,6 +4291,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3448
4291
  var firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
3449
4292
  var lastItem = this.isEmptyList() ? this.list : this.liCollections[this.getItems().length - 1];
3450
4293
  var liHeight = firstItem.getBoundingClientRect().height;
4294
+ this.listItemHeight = liHeight;
3451
4295
  var listHeight = this.list.offsetHeight / 2;
3452
4296
  var height = isNullOrUndefined(selectedLI) ? firstItem.offsetTop : selectedLI.offsetTop;
3453
4297
  var lastItemOffsetValue = lastItem.offsetTop;
@@ -3458,7 +4302,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3458
4302
  offsetValue = (count - (this.liCollections.length - this.activeIndex)) * liHeight - popupOffset + paddingBottom;
3459
4303
  this.list.scrollTop = selectedLI.offsetTop;
3460
4304
  }
3461
- else if (height > listHeight) {
4305
+ else if (height > listHeight && !this.enableVirtualization) {
3462
4306
  offsetValue = listHeight - liHeight / 2;
3463
4307
  this.list.scrollTop = height - listHeight + liHeight / 2;
3464
4308
  }
@@ -3484,34 +4328,113 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3484
4328
  }
3485
4329
  return width;
3486
4330
  };
3487
- DropDownList.prototype.scrollBottom = function (isInitial) {
4331
+ DropDownList.prototype.scrollBottom = function (isInitial, isInitialSelection, keyAction) {
4332
+ if (isInitialSelection === void 0) { isInitialSelection = false; }
4333
+ if (keyAction === void 0) { keyAction = null; }
4334
+ if (isNullOrUndefined(this.selectedLI) && this.enableVirtualization) {
4335
+ this.selectedLI = this.list.querySelector('.' + dropDownBaseClasses.li);
4336
+ if (!isNullOrUndefined(this.selectedLI) && this.selectedLI.classList.contains('e-virtual-list')) {
4337
+ this.selectedLI = this.liCollections[this.skeletonCount];
4338
+ }
4339
+ }
3488
4340
  if (!isNullOrUndefined(this.selectedLI)) {
4341
+ this.isUpwardScrolling = false;
4342
+ var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
4343
+ var lastElementValue = this.list.querySelector('li:last-of-type') ? this.list.querySelector('li:last-of-type').getAttribute('data-value') : null;
4344
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
3489
4345
  var currentOffset = this.list.offsetHeight;
3490
- var nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
4346
+ var nextBottom = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop;
3491
4347
  var nextOffset = this.list.scrollTop + nextBottom - currentOffset;
3492
- nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
3493
- var boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
4348
+ var isScrollerCHanged = false;
4349
+ nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10);
4350
+ var boxRange = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop;
3494
4351
  boxRange = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
3495
4352
  boxRange - this.fixedHeaderElement.offsetHeight : boxRange;
3496
- if (this.activeIndex === 0) {
4353
+ if (this.activeIndex === 0 && !this.enableVirtualization) {
3497
4354
  this.list.scrollTop = 0;
4355
+ isScrollerCHanged = this.isKeyBoardAction;
3498
4356
  }
3499
4357
  else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
3500
- this.list.scrollTop = nextOffset;
4358
+ var currentElementValue = this.selectedLI ? this.selectedLI.getAttribute('data-value') : null;
4359
+ var liCount = keyAction == "pageDown" ? this.getPageCount() - 2 : 1;
4360
+ if (!this.enableVirtualization || this.isKeyBoardAction || isInitialSelection) {
4361
+ if (this.isKeyBoardAction && this.enableVirtualization && lastElementValue && currentElementValue === lastElementValue && keyAction != "end" && !this.isVirtualScrolling) {
4362
+ this.isPreventKeyAction = true;
4363
+ if (this.enableVirtualization && this.itemTemplate) {
4364
+ this.list.scrollTop += nextOffset;
4365
+ }
4366
+ else {
4367
+ this.list.scrollTop += this.selectedLI.offsetHeight * liCount;
4368
+ }
4369
+ this.isPreventKeyAction = this.IsScrollerAtEnd() ? false : this.isPreventKeyAction;
4370
+ this.isKeyBoardAction = false;
4371
+ this.isPreventScrollAction = false;
4372
+ }
4373
+ else if (this.enableVirtualization && keyAction == "end") {
4374
+ this.isPreventKeyAction = false;
4375
+ this.isKeyBoardAction = false;
4376
+ this.isPreventScrollAction = false;
4377
+ this.list.scrollTop = this.list.scrollHeight;
4378
+ }
4379
+ else {
4380
+ if (keyAction == "pageDown" && this.enableVirtualization && !this.isVirtualScrolling) {
4381
+ this.isPreventKeyAction = false;
4382
+ this.isKeyBoardAction = false;
4383
+ this.isPreventScrollAction = false;
4384
+ nextOffset = nextOffset + (this.selectedLI.offsetHeight * liCount);
4385
+ }
4386
+ this.list.scrollTop = nextOffset;
4387
+ }
4388
+ }
4389
+ else {
4390
+ this.list.scrollTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.virtualListInfo.startIndex * this.listItemHeight : 0;
4391
+ }
4392
+ isScrollerCHanged = this.isKeyBoardAction;
4393
+
3501
4394
  }
4395
+ this.isKeyBoardAction = isScrollerCHanged;
3502
4396
  }
3503
4397
  };
3504
- DropDownList.prototype.scrollTop = function () {
4398
+ DropDownList.prototype.scrollTop = function (keyAction) {
4399
+ if (keyAction === void 0) { keyAction = null; }
3505
4400
  if (!isNullOrUndefined(this.selectedLI)) {
3506
- var nextOffset = this.selectedLI.offsetTop - this.list.scrollTop;
4401
+ var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
4402
+ var selectedLiOffsetTop = (this.virtualListInfo && this.virtualListInfo.startIndex) ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
4403
+ var nextOffset = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) - this.list.scrollTop;
4404
+ 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;
3507
4405
  nextOffset = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
3508
4406
  nextOffset - this.fixedHeaderElement.offsetHeight : nextOffset;
3509
- var boxRange = (this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop);
3510
- if (this.activeIndex === 0) {
4407
+ var boxRange = (selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop);
4408
+ var isPageUpKeyAction = this.enableVirtualization && this.getModuleName() === 'autocomplete' && nextOffset <= 0;
4409
+ if (this.activeIndex === 0 && !this.enableVirtualization) {
3511
4410
  this.list.scrollTop = 0;
3512
4411
  }
3513
- else if (nextOffset < 0) {
3514
- this.list.scrollTop = this.list.scrollTop + nextOffset;
4412
+ else if (nextOffset < 0 || isPageUpKeyAction) {
4413
+ var currentElementValue = this.selectedLI ? this.selectedLI.getAttribute('data-value') : null;
4414
+ var liCount = keyAction == "pageUp" ? this.getPageCount() - 2 : 1;
4415
+ if (this.enableVirtualization && this.isKeyBoardAction && firstElementValue && currentElementValue === firstElementValue && keyAction != "home" && !this.isVirtualScrolling) {
4416
+ this.isUpwardScrolling = true;
4417
+ this.isPreventKeyAction = true;
4418
+ this.list.scrollTop -= this.selectedLI.offsetHeight * liCount;
4419
+ this.isPreventKeyAction = this.list.scrollTop != 0 ? this.isPreventKeyAction : false;
4420
+ this.isKeyBoardAction = false;
4421
+ this.isPreventScrollAction = false;
4422
+ }
4423
+ else if (this.enableVirtualization && keyAction == "home") {
4424
+ this.isPreventScrollAction = false;
4425
+ this.isPreventKeyAction = true;
4426
+ this.isKeyBoardAction = false;
4427
+ this.list.scrollTo(0, 0);
4428
+ }
4429
+ else {
4430
+ if (keyAction == "pageUp" && this.enableVirtualization && !this.isVirtualScrolling) {
4431
+ this.isPreventKeyAction = false;
4432
+ this.isKeyBoardAction = false;
4433
+ this.isPreventScrollAction = false;
4434
+ nextOffset = nextOffset - (this.selectedLI.offsetHeight * liCount);
4435
+ }
4436
+ this.list.scrollTop = this.list.scrollTop + nextOffset;
4437
+ }
3515
4438
  }
3516
4439
  else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
3517
4440
  this.list.scrollTop = this.selectedLI.offsetTop - (this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
@@ -3529,25 +4452,47 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3529
4452
  return true;
3530
4453
  };
3531
4454
  DropDownList.prototype.setScrollPosition = function (e) {
4455
+ this.isPreventScrollAction = true;
3532
4456
  if (!isNullOrUndefined(e)) {
3533
4457
  switch (e.action) {
3534
4458
  case 'pageDown':
3535
4459
  case 'down':
3536
4460
  case 'end':
3537
- this.scrollBottom();
4461
+ this.isKeyBoardAction = true;
4462
+ this.scrollBottom(false, false, e.action);
3538
4463
  break;
3539
4464
  default:
3540
- this.scrollTop();
4465
+ this.isKeyBoardAction = e.action == 'up' || e.action == 'pageUp' || e.action == 'open';
4466
+ this.scrollTop(e.action);
3541
4467
  break;
3542
4468
  }
3543
4469
  }
3544
4470
  else {
3545
4471
  this.scrollBottom(true);
3546
4472
  }
4473
+ this.isKeyBoardAction = false;
3547
4474
  };
3548
4475
  DropDownList.prototype.clearText = function () {
3549
4476
  this.filterInput.value = this.typedString = '';
3550
4477
  this.searchLists(null);
4478
+ if (this.enableVirtualization) {
4479
+ this.list.scrollTop = 0;
4480
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4481
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
4482
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4483
+ if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
4484
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4485
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
4486
+ }
4487
+ this.getSkeletonCount();
4488
+ this.UpdateSkeleton();
4489
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
4490
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4491
+ if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
4492
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4493
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
4494
+ }
4495
+ }
3551
4496
  };
3552
4497
  DropDownList.prototype.setEleWidth = function (width) {
3553
4498
  if (!isNullOrUndefined(width)) {
@@ -3561,10 +4506,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3561
4506
  };
3562
4507
  DropDownList.prototype.closePopup = function (delay, e) {
3563
4508
  var _this = this;
4509
+ var isFilterValue = !isNullOrUndefined(this.filterInput) && !isNullOrUndefined(this.filterInput.value) && this.filterInput.value !== '';
4510
+ var typedString = this.getModuleName() === 'combobox' ? this.typedString : null;
3564
4511
  this.isTyped = false;
3565
4512
  if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
3566
4513
  return;
3567
4514
  }
4515
+ this.keyboardEvent = null;
3568
4516
  EventHandler.remove(document, 'mousedown', this.onDocumentClick);
3569
4517
  this.isActive = false;
3570
4518
  this.filterInputObj = null;
@@ -3606,6 +4554,20 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3606
4554
  if (this.isFiltering()) {
3607
4555
  this.actionCompleteData.isUpdated = false;
3608
4556
  }
4557
+ if (this.enableVirtualization) {
4558
+ if ((this.value == null || this.isTyped)) {
4559
+ this.viewPortInfo.endIndex = this.viewPortInfo && this.viewPortInfo.endIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
4560
+ if (this.getModuleName() === 'autocomplete' || (this.getModuleName() === 'dropdownlist' && !isNullOrUndefined(this.typedString) && this.typedString != "") || (this.getModuleName() === 'combobox' && this.allowFiltering && !isNullOrUndefined(this.typedString) && this.typedString != "")) {
4561
+ this.checkAndResetCache();
4562
+ }
4563
+ }
4564
+ else if (this.getModuleName() === 'autocomplete') {
4565
+ this.checkAndResetCache();
4566
+ }
4567
+ if ((this.getModuleName() === 'dropdownlist' || this.getModuleName() === 'combobox') && !(this.skeletonCount == 0)) {
4568
+ this.getSkeletonCount(true);
4569
+ }
4570
+ }
3609
4571
  this.beforePopupOpen = false;
3610
4572
  var animModel = {
3611
4573
  name: 'FadeOut',
@@ -3636,6 +4598,46 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3636
4598
  if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
3637
4599
  this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
3638
4600
  }
4601
+ var dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
4602
+ if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
4603
+ this.updateInitialData();
4604
+ this.checkAndResetCache();
4605
+ }
4606
+ };
4607
+ DropDownList.prototype.updateInitialData = function () {
4608
+ var currentData = this.selectData;
4609
+ var ulElement = this.renderItems(currentData, this.fields);
4610
+ this.list.scrollTop = 0;
4611
+ this.virtualListInfo = {
4612
+ currentPageNumber: null,
4613
+ direction: null,
4614
+ sentinelInfo: {},
4615
+ offsets: {},
4616
+ startIndex: 0,
4617
+ endIndex: 0,
4618
+ };
4619
+ if (this.getModuleName() === 'combobox') {
4620
+ this.typedString = "";
4621
+ }
4622
+ this.previousStartIndex = 0;
4623
+ this.previousEndIndex = 0;
4624
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4625
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
4626
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4627
+ if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
4628
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4629
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
4630
+ }
4631
+ this.getSkeletonCount();
4632
+ this.UpdateSkeleton();
4633
+ this.listData = currentData;
4634
+ this.updateActionCompleteDataValues(ulElement, currentData);
4635
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
4636
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4637
+ if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
4638
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4639
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
4640
+ }
3639
4641
  };
3640
4642
  DropDownList.prototype.destroyPopup = function () {
3641
4643
  this.isPopupOpen = false;
@@ -3722,10 +4724,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3722
4724
  this.element.id = id;
3723
4725
  this.hiddenElement.id = id + '_hidden';
3724
4726
  this.targetElement().setAttribute('tabindex', this.tabIndex);
3725
- if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
4727
+ if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') && !this.readonly) {
3726
4728
  this.inputElement.setAttribute('aria-label', this.getModuleName());
3727
4729
  }
3728
- else {
4730
+ else if (this.getModuleName() === 'dropdownlist') {
3729
4731
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
3730
4732
  }
3731
4733
  attributes(this.targetElement(), this.getAriaAttributes());
@@ -3735,7 +4737,16 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3735
4737
  this.inputElement.removeAttribute('aria-labelledby');
3736
4738
  }
3737
4739
  if (this.value !== null || this.activeIndex !== null || this.text !== null) {
4740
+ if (this.enableVirtualization) {
4741
+ this.listItemHeight = this.getListHeight();
4742
+ this.getSkeletonCount();
4743
+ this.updateVirtualizationProperties(this.itemCount, this.allowFiltering);
4744
+ }
3738
4745
  this.initValue();
4746
+ this.selectedValueInfo = this.viewPortInfo;
4747
+ if (this.enableVirtualization) {
4748
+ this.activeIndex = this.activeIndex + this.skeletonCount;
4749
+ }
3739
4750
  }
3740
4751
  else if (this.element.tagName === 'SELECT' && this.element.options[0]) {
3741
4752
  var selectElement = this.element;
@@ -3771,6 +4782,29 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3771
4782
  attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
3772
4783
  }
3773
4784
  this.renderComplete();
4785
+ this.listItemHeight = this.getListHeight();
4786
+ this.getSkeletonCount();
4787
+ if (this.enableVirtualization) {
4788
+ this.updateVirtualizationProperties(this.itemCount, this.allowFiltering);
4789
+ }
4790
+ this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
4791
+ this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.viewPortInfo.startIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
4792
+ };
4793
+ DropDownList.prototype.getListHeight = function () {
4794
+ var listParent = this.createElement('div', {
4795
+ className: 'e-dropdownbase'
4796
+ });
4797
+ var item = this.createElement('li', {
4798
+ className: 'e-list-item'
4799
+ });
4800
+ var listParentHeight = formatUnit(this.popupHeight);
4801
+ listParent.style.height = (parseInt(listParentHeight, 10)).toString() + 'px';
4802
+ listParent.appendChild(item);
4803
+ document.body.appendChild(listParent);
4804
+ this.virtualListHeight = listParent.getBoundingClientRect().height;
4805
+ var listItemHeight = Math.ceil(item.getBoundingClientRect().height);
4806
+ listParent.remove();
4807
+ return listItemHeight;
3774
4808
  };
3775
4809
  DropDownList.prototype.setFooterTemplate = function (popupEle) {
3776
4810
  var compiledString;
@@ -3914,7 +4948,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3914
4948
  var _loop_1 = function (prop) {
3915
4949
  switch (prop) {
3916
4950
  case 'query':
3917
- case 'dataSource': break;
4951
+ case 'dataSource':
4952
+ this_1.getSkeletonCount();
4953
+ this_1.checkAndResetCache();
4954
+ break;
3918
4955
  case 'htmlAttributes':
3919
4956
  this_1.setHTMLAttributes();
3920
4957
  break;
@@ -4208,7 +5245,23 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4208
5245
  this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
4209
5246
  this.renderList(e);
4210
5247
  }
5248
+ if (this.enableVirtualization && this.listData && this.listData.length) {
5249
+ if (!isNullOrUndefined(this.value) && (this.getModuleName() === 'dropdownlist' || this.getModuleName() === 'combobox')) {
5250
+ this.removeHover();
5251
+ }
5252
+ if (!this.beforePopupOpen) {
5253
+ this.notify("setCurrentViewDataAsync", {
5254
+ module: "VirtualScroll",
5255
+ });
5256
+ }
5257
+ }
4211
5258
  this.invokeRenderPopup(e);
5259
+ if (this.enableVirtualization && !this.allowFiltering && this.selectedValueInfo != null && this.selectedValueInfo.startIndex > 0 && this.value != null) {
5260
+ this.notify("dataProcessAsync", {
5261
+ module: "VirtualScroll",
5262
+ isOpen: true,
5263
+ });
5264
+ }
4212
5265
  };
4213
5266
  DropDownList.prototype.invokeRenderPopup = function (e) {
4214
5267
  if (Browser.isDevice && this.isFilterLayout()) {
@@ -4302,7 +5355,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4302
5355
  if (!this.enabled) {
4303
5356
  return;
4304
5357
  }
4305
- this.isTyped = true;
5358
+ if (!this.enableVirtualization && this.getModuleName() === 'combobox') {
5359
+ this.isTyped = true;
5360
+ }
4306
5361
  this.hidePopup(e);
4307
5362
  if (this.targetElement()) {
4308
5363
  this.targetElement().blur();
@@ -4358,6 +5413,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4358
5413
  this.ulElement = null;
4359
5414
  this.list = null;
4360
5415
  this.popupObj = null;
5416
+ this.popupContentElement = null;
4361
5417
  this.rippleFun = null;
4362
5418
  this.selectedLI = null;
4363
5419
  this.liCollections = null;
@@ -4454,6 +5510,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4454
5510
  __decorate$1([
4455
5511
  Property(false)
4456
5512
  ], DropDownList.prototype, "readonly", void 0);
5513
+ __decorate$1([
5514
+ Property(false)
5515
+ ], DropDownList.prototype, "enableVirtualization", void 0);
4457
5516
  __decorate$1([
4458
5517
  Property(null)
4459
5518
  ], DropDownList.prototype, "text", void 0);
@@ -7963,14 +9022,18 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7963
9022
  if (!isNaN(height) && this.getModuleName() !== 'autocomplete') {
7964
9023
  this.removeFocus();
7965
9024
  var fixedHead = this.fields.groupBy ? this.liCollections[0].offsetHeight : 0;
7966
- this.list.scrollTop = count * height + fixedHead;
9025
+ if (!this.enableVirtualization) {
9026
+ this.list.scrollTop = count * height + fixedHead;
9027
+ }
7967
9028
  addClass([activeElement], dropDownListClasses.focus);
7968
9029
  }
7969
9030
  }
7970
9031
  else {
7971
9032
  if (this.isSelectCustom && this.inputElement.value.trim() !== '') {
7972
9033
  this.removeFocus();
7973
- this.list.scrollTop = 0;
9034
+ if (!this.enableVirtualization) {
9035
+ this.list.scrollTop = 0;
9036
+ }
7974
9037
  }
7975
9038
  }
7976
9039
  return activeElement;
@@ -8106,7 +9169,9 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
8106
9169
  else if (this.inputElement.value === '') {
8107
9170
  this.activeIndex = null;
8108
9171
  if (!isNullOrUndefined(this.list)) {
8109
- this.list.scrollTop = 0;
9172
+ if (!this.enableVirtualization) {
9173
+ this.list.scrollTop = 0;
9174
+ }
8110
9175
  var focusItem = this.list.querySelector('.' + dropDownListClasses.li);
8111
9176
  this.setHoverList(focusItem);
8112
9177
  }
@@ -8664,7 +9729,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8664
9729
  filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
8665
9730
  }
8666
9731
  }
8667
- if (!isNullOrUndefined(this.suggestionCount)) {
9732
+ if (!isNullOrUndefined(this.suggestionCount) && !this.enableVirtualization) {
8668
9733
  // Since defualt value of suggestioncount is 20, checked the condition
8669
9734
  if (this.suggestionCount !== 20) {
8670
9735
  for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
@@ -8675,12 +9740,19 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8675
9740
  }
8676
9741
  filterQuery.take(this.suggestionCount);
8677
9742
  }
9743
+ if (this.enableVirtualization) {
9744
+ var takeValue = this.getTakeValue();
9745
+ filterQuery.skip(this.virtualItemStartIndex);
9746
+ filterQuery.take(takeValue);
9747
+ filterQuery.requiresCount();
9748
+ }
8678
9749
  return filterQuery;
8679
9750
  };
8680
9751
  AutoComplete.prototype.searchLists = function (e) {
8681
9752
  var _this_1 = this;
8682
9753
  this.isTyped = true;
8683
9754
  this.isDataFetched = this.isSelectCustom = false;
9755
+ this.checkAndResetCache();
8684
9756
  if (isNullOrUndefined(this.list)) {
8685
9757
  _super.prototype.renderList.call(this, e, true);
8686
9758
  }
@@ -8727,8 +9799,32 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8727
9799
  };
8728
9800
  AutoComplete.prototype.filterAction = function (dataSource, query, fields, e) {
8729
9801
  this.beforePopupOpen = true;
9802
+ var isNoDataElement = this.list.classList.contains('e-nodata');
8730
9803
  if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
9804
+ if (this.enableVirtualization && this.isFiltering() && this.isTyped) {
9805
+ this.isPreventScrollAction = true;
9806
+ this.list.scrollTop = 0;
9807
+ this.previousStartIndex = 0;
9808
+ this.virtualListInfo = null;
9809
+ }
8731
9810
  this.resetList(dataSource, fields, query, e);
9811
+ if (this.enableVirtualization && isNoDataElement && !this.list.classList.contains('e-nodata')) {
9812
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
9813
+ this.list.appendChild(this.createElement('div', {
9814
+ className: 'e-virtual-ddl-content',
9815
+ styles: this.getTransformValues()
9816
+ })).appendChild(this.list.querySelector('.e-list-parent'));
9817
+ }
9818
+ if (!this.list.querySelector('.e-virtual-ddl')) {
9819
+ var virualElement = this.createElement('div', {
9820
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
9821
+ });
9822
+ document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
9823
+ }
9824
+ }
9825
+ if (this.enableVirtualization) {
9826
+ this.getFilteringSkeletonCount();
9827
+ }
8732
9828
  }
8733
9829
  else {
8734
9830
  this.hidePopup(e);
@@ -8739,6 +9835,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8739
9835
  AutoComplete.prototype.clearAll = function (e, property) {
8740
9836
  if (isNullOrUndefined(property) || (!isNullOrUndefined(property) && isNullOrUndefined(property.dataSource))) {
8741
9837
  _super.prototype.clearAll.call(this, e);
9838
+ this.checkAndResetCache();
8742
9839
  }
8743
9840
  if (this.beforePopupOpen) {
8744
9841
  this.hidePopup();
@@ -8821,7 +9918,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8821
9918
  return true;
8822
9919
  };
8823
9920
  AutoComplete.prototype.renderPopup = function (e) {
8824
- this.list.scrollTop = 0;
9921
+ if (!this.enableVirtualization) {
9922
+ this.list.scrollTop = 0;
9923
+ }
8825
9924
  _super.prototype.renderPopup.call(this, e);
8826
9925
  };
8827
9926
  AutoComplete.prototype.isEditTextBox = function () {
@@ -8889,6 +9988,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8889
9988
  AutoComplete.prototype.hidePopup = function (e) {
8890
9989
  _super.prototype.hidePopup.call(this, e);
8891
9990
  this.activeIndex = null;
9991
+ this.virtualListInfo = this.viewPortInfo;
9992
+ this.previousStartIndex = this.viewPortInfo.startIndex;
9993
+ this.startIndex = this.viewPortInfo.startIndex;
9994
+ this.previousEndIndex = this.viewPortInfo.endIndex;
8892
9995
  };
8893
9996
  /**
8894
9997
  * Dynamically change the value of properties.
@@ -9425,6 +10528,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9425
10528
  if (_this.isFirstClick) {
9426
10529
  _this.loadTemplate();
9427
10530
  }
10531
+ if (_this.mode === 'CheckBox' && _this.showSelectAll) {
10532
+ EventHandler.add(_this.popupObj.element, 'click', _this.clickHandler, _this);
10533
+ }
9428
10534
  }
9429
10535
  });
9430
10536
  };
@@ -10431,11 +11537,19 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10431
11537
  };
10432
11538
  MultiSelect.prototype.spaceKeySelection = function (e) {
10433
11539
  if (this.mode === 'CheckBox') {
10434
- if (!document.activeElement.classList.contains(FILTERINPUT)) {
11540
+ var li = this.list.querySelector('li.' + dropDownBaseClasses.focus);
11541
+ var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
11542
+ if (!isNullOrUndefined(li) || (selectAllParent && selectAllParent.classList.contains('e-item-focus'))) {
10435
11543
  e.preventDefault();
10436
11544
  this.keyAction = true;
10437
11545
  }
10438
11546
  this.selectByKey(e);
11547
+ if (this.keyAction) {
11548
+ var li_1 = this.list.querySelector('li.' + dropDownBaseClasses.focus);
11549
+ if (!isNullOrUndefined(li_1) && selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
11550
+ li_1.classList.remove('e-item-focus');
11551
+ }
11552
+ }
10439
11553
  }
10440
11554
  this.checkPlaceholderSize();
10441
11555
  };
@@ -10591,9 +11705,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10591
11705
  }
10592
11706
  }
10593
11707
  var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
10594
- if (selectAllParent && !selectAllParent.classList.contains('e-item-focus')) {
10595
- e.preventDefault();
10596
- }
10597
11708
  if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
10598
11709
  var selectAllCheckBox = selectAllParent.childNodes[0];
10599
11710
  if (!selectAllCheckBox.classList.contains('e-check')) {
@@ -10666,6 +11777,14 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10666
11777
  }
10667
11778
  this.updateAriaAttribute();
10668
11779
  };
11780
+ MultiSelect.prototype.clickHandler = function (e) {
11781
+ var targetElement = e.target;
11782
+ var filterInputClassName = targetElement.className;
11783
+ var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
11784
+ if ((filterInputClassName === 'e-input-filter e-input' || filterInputClassName === 'e-input-group e-control-wrapper e-input-focus') && selectAllParent.classList.contains('e-item-focus')) {
11785
+ selectAllParent.classList.remove('e-item-focus');
11786
+ }
11787
+ };
10669
11788
  MultiSelect.prototype.moveByList = function (position) {
10670
11789
  if (this.list) {
10671
11790
  var elements = this.list.querySelectorAll('li.'
@@ -10680,12 +11799,19 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10680
11799
  var temp = -1;
10681
11800
  var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
10682
11801
  if (this.mode === 'CheckBox' && this.showSelectAll && position == 1 && !isNullOrUndefined(selectAllParent) && !selectAllParent.classList.contains('e-item-focus') && this.list.getElementsByClassName('e-item-focus').length == 0 && this.liCollections.length > 1) {
10683
- selectAllParent.classList.add('e-item-focus');
11802
+ if (!this.focusFirstListItem && selectAllParent.classList.contains('e-item-focus')) {
11803
+ selectAllParent.classList.remove('e-item-focus');
11804
+ }
11805
+ else if (!selectAllParent.classList.contains('e-item-focus')) {
11806
+ selectAllParent.classList.add('e-item-focus');
11807
+ }
10684
11808
  }
10685
11809
  else if (elements.length) {
10686
- if (this.mode === 'CheckBox' && this.showSelectAll && !isNullOrUndefined(selectAllParent)) {
10687
- selectAllParent.classList.remove('e-item-focus');
10688
- if (this.showSelectAll && position == -1 && !isNullOrUndefined(selectAllParent) && this.liCollections.length > 1 && (this.focusFirstListItem || this.list.getElementsByClassName('e-item-focus').length == 0)) {
11810
+ if (this.mode === 'CheckBox' && this.showSelectAll && !isNullOrUndefined(selectAllParent && position == -1)) {
11811
+ if (!this.focusFirstListItem && selectAllParent.classList.contains('e-item-focus')) {
11812
+ selectAllParent.classList.remove('e-item-focus');
11813
+ }
11814
+ else if (this.focusFirstListItem && !selectAllParent.classList.contains('e-item-focus')) {
10689
11815
  selectAllParent.classList.add('e-item-focus');
10690
11816
  }
10691
11817
  }
@@ -11284,7 +12410,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11284
12410
  this.popupObj = new Popup(this.popupWrapper, {
11285
12411
  width: this.calcPopupWidth(), targetType: 'relative',
11286
12412
  position: this.enableRtl ? { X: 'right', Y: 'bottom' } : { X: 'left', Y: 'bottom' },
11287
- relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
12413
+ relateTo: this.overAllWrapper,
12414
+ collision: this.enableRtl ? { X: 'fit', Y: 'flip' } : { X: 'flip', Y: 'flip' }, offsetY: 1,
11288
12415
  enableRtl: this.enableRtl, zIndex: this.zIndex,
11289
12416
  close: function () {
11290
12417
  if (_this.popupObj.element.parentElement) {
@@ -12958,6 +14085,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12958
14085
  _this.popupObj.hide();
12959
14086
  removeClass([document.body, _this.popupObj.element], 'e-popup-full-page');
12960
14087
  EventHandler.remove(_this.list, 'keydown', _this.onKeyDown);
14088
+ if (_this.mode === 'CheckBox' && _this.showSelectAll) {
14089
+ EventHandler.remove(_this.popupObj.element, 'click', _this.clickHandler);
14090
+ }
12961
14091
  }
12962
14092
  });
12963
14093
  }
@@ -13721,7 +14851,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13721
14851
  };
13722
14852
  CheckBoxSelection.prototype.clickHandler = function (e) {
13723
14853
  var target;
13724
- if (e.currentTarget.classList.contains(this.checkAllParent.className)) {
14854
+ if (e.currentTarget.classList.contains(this.checkAllParent.className) || (e.currentTarget.classList.value === this.checkAllParent.className)) {
13725
14855
  target = e.currentTarget.firstElementChild.lastElementChild;
13726
14856
  }
13727
14857
  else {
@@ -17176,7 +18306,9 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17176
18306
  _this.trigger('opened', eventArgs, function (eventArgs) {
17177
18307
  if (!eventArgs.cancel) {
17178
18308
  _this.renderReactTemplates();
17179
- _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.inputElement : null);
18309
+ if (_this.popupObj) {
18310
+ _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.inputElement : null);
18311
+ }
17180
18312
  if (isNullOrUndefined(_this.getTriggerCharPosition())) {
17181
18313
  return;
17182
18314
  }
@@ -17889,6 +19021,11 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17889
19021
  if (this.inputElement && !this.inputElement.classList.contains('e-' + this.getModuleName())) {
17890
19022
  return;
17891
19023
  }
19024
+ this.previousSelectedLI = null;
19025
+ this.item = null;
19026
+ this.selectedLI = null;
19027
+ this.inputElement.innerText = null;
19028
+ this.popupObj = null;
17892
19029
  _super.prototype.destroy.call(this);
17893
19030
  };
17894
19031
  Mention.prototype.getLocaleName = function () {
@@ -18019,5 +19156,5 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18019
19156
  * export all modules from current location
18020
19157
  */
18021
19158
 
18022
- export { incrementalSearch, Search, escapeCharRegExp, resetIncrementalSearchValues, highlightSearch, revertHighlightSearch, FieldSettings, dropDownBaseClasses, DropDownBase, dropDownListClasses, DropDownList, Fields, TreeSettings, DropDownTree, ComboBox, AutoComplete, MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur, encodePlaceholder, SelectionSettings, ToolbarSettings, ListBox, Mention };
19159
+ export { incrementalSearch, Search, escapeCharRegExp, resetIncrementalSearchValues, highlightSearch, revertHighlightSearch, VirtualScroll, FieldSettings, dropDownBaseClasses, DropDownBase, dropDownListClasses, DropDownList, Fields, TreeSettings, DropDownTree, ComboBox, AutoComplete, MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur, encodePlaceholder, SelectionSettings, ToolbarSettings, ListBox, Mention };
18023
19160
  //# sourceMappingURL=ej2-dropdowns.es5.js.map