@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
 
@@ -189,6 +190,327 @@ function revertHighlightSearch(content) {
189
190
  }
190
191
  }
191
192
 
193
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
194
+ return new (P || (P = Promise))(function (resolve, reject) {
195
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
196
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
197
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
198
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
199
+ });
200
+ };
201
+ class VirtualScroll {
202
+ constructor(parent) {
203
+ this.sentinelInfo = {
204
+ 'up': {
205
+ check: (rect, info) => {
206
+ let top = rect.top - this.containerElementRect.top;
207
+ info.entered = top >= 0;
208
+ return top + (this.parent.listItemHeight * this.parent.virtualItemCount / 2) >= 0;
209
+ },
210
+ axis: 'Y'
211
+ },
212
+ 'down': {
213
+ check: (rect, info) => {
214
+ let cHeight = this.parent.popupContentElement.clientHeight;
215
+ let top = rect.bottom;
216
+ info.entered = rect.bottom <= this.containerElementRect.bottom;
217
+ return top - (this.parent.listItemHeight * this.parent.virtualItemCount / 2) <= this.parent.listItemHeight * this.parent.virtualItemCount / 2;
218
+ }, axis: 'Y'
219
+ }
220
+ };
221
+ this.parent = parent;
222
+ this.removeEventListener();
223
+ this.addEventListener();
224
+ }
225
+ addEventListener() {
226
+ if (this.parent.isDestroyed) {
227
+ return;
228
+ }
229
+ this.parent.on('observe', this.observe, this);
230
+ this.parent.on('setGeneratedData', this.setGeneratedData, this);
231
+ this.parent.on('dataProcessAsync', this.dataProcessAsync, this);
232
+ this.parent.on('setCurrentViewDataAsync', this.setCurrentViewDataAsync, this);
233
+ this.parent.on('bindScrollEvent', this.bindScrollEvent, this);
234
+ }
235
+ removeEventListener() {
236
+ if (this.parent.isDestroyed) {
237
+ return;
238
+ }
239
+ this.parent.off('observe', this.observe);
240
+ this.parent.off('setGeneratedData', this.setGeneratedData);
241
+ this.parent.off('dataProcessAsync', this.dataProcessAsync);
242
+ this.parent.off('setCurrentViewDataAsync', this.setCurrentViewDataAsync);
243
+ this.parent.off('bindScrollEvent', this.bindScrollEvent);
244
+ }
245
+ bindScrollEvent(component) {
246
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
247
+ this.component = component.component;
248
+ this.observe((scrollArgs) => this.scrollListener(scrollArgs));
249
+ }
250
+ observe(callback) {
251
+ this.containerElementRect = this.parent.popupContentElement.getBoundingClientRect();
252
+ EventHandler.add(this.parent.popupContentElement, 'wheel mousedown', this.popupScrollHandler, this);
253
+ this.touchModule = new Touch(this.parent.popupContentElement, {
254
+ scroll: this.popupScrollHandler.bind(this)
255
+ });
256
+ EventHandler.add(this.parent.popupContentElement, 'scroll', this.virtualScrollHandler(callback), this);
257
+ }
258
+ getModuleName() {
259
+ return 'VirtualScroll';
260
+ }
261
+ popupScrollHandler(e) {
262
+ this.parent.isMouseScrollAction = true;
263
+ this.parent.isPreventScrollAction = false;
264
+ }
265
+ getPageQuery(query, virtualStartIndex, virtualEndIndex) {
266
+ if (virtualEndIndex !== 0 && !this.parent.allowFiltering && this.component !== 'autocomplete') {
267
+ query = query.skip(virtualStartIndex);
268
+ }
269
+ return query;
270
+ }
271
+ setGeneratedData(qStartIndex, recentlyGeneratedData) {
272
+ let loopIteration = 0;
273
+ let endIndex = this.parent.listData.length + this.parent.virtualItemStartIndex;
274
+ for (let i = this.parent.virtualItemStartIndex; i < endIndex; i++) {
275
+ const alreadyAddedData = this.parent.generatedDataObject[i];
276
+ if (!alreadyAddedData) {
277
+ if (recentlyGeneratedData !== null && this.parent.listData.slice(loopIteration, loopIteration + 1).length > 0) {
278
+ const slicedData = this.parent.listData.slice(loopIteration, loopIteration + 1);
279
+ if (slicedData.length > 0) {
280
+ // Safely assign slicedData to this.parent.generatedDataObject[i]
281
+ this.parent.generatedDataObject[i] = slicedData;
282
+ }
283
+ }
284
+ }
285
+ loopIteration++;
286
+ }
287
+ }
288
+ generateAndExecuteQueryAsync(query, virtualItemStartIndex = 0, virtualItemEndIndex = 0, isQueryGenerated = false) {
289
+ let dataSource = this.parent.dataSource;
290
+ if (!isQueryGenerated) {
291
+ query = this.getPageQuery(query, virtualItemStartIndex, virtualItemEndIndex);
292
+ }
293
+ this.parent.resetList(dataSource, this.parent.fields, query);
294
+ }
295
+ setCurrentViewDataAsync() {
296
+ // eslint-disable-next-line
297
+ let currentData = [];
298
+ for (let i = this.parent.viewPortInfo.startIndex; i < this.parent.viewPortInfo.endIndex; i++) {
299
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
300
+ const alreadyAddedData = this.parent.generatedDataObject[i];
301
+ if (alreadyAddedData) {
302
+ currentData.push(alreadyAddedData[0]);
303
+ }
304
+ }
305
+ this.parent.renderItems(currentData, this.parent.fields);
306
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
307
+ const virtualTrackElement = this.parent.list.getElementsByClassName('e-virtual-ddl')[0];
308
+ if (virtualTrackElement) {
309
+ (virtualTrackElement).style = this.parent.GetVirtualTrackHeight();
310
+ }
311
+ this.parent.UpdateSkeleton();
312
+ this.parent.liCollections = this.parent.list.querySelectorAll('.e-list-item');
313
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
314
+ const virtualContentElement = this.parent.list.getElementsByClassName('e-virtual-ddl-content')[0];
315
+ if (virtualContentElement) {
316
+ (virtualContentElement).style = this.parent.getTransformValues();
317
+ }
318
+ }
319
+ generateQueryAndSetQueryIndexAsync(query, isPopupOpen) {
320
+ let isStartIndexInitialised = false;
321
+ let queryStartIndex = 0;
322
+ let queryEndIndex = 0;
323
+ let sortedDataStartIndex = 0;
324
+ let vEndIndex = this.parent && this.parent.viewPortInfo.endIndex !== 0 ? this.parent.viewPortInfo.endIndex : sortedDataStartIndex + this.parent.getItems().length;
325
+ if (!isPopupOpen && vEndIndex !== 0) {
326
+ for (let i = this.parent.viewPortInfo.startIndex; i <= vEndIndex; i++) {
327
+ if (!(i in this.parent.generatedDataObject)) {
328
+ if (!isStartIndexInitialised) {
329
+ isStartIndexInitialised = true;
330
+ queryStartIndex = queryEndIndex = i;
331
+ }
332
+ else {
333
+ queryEndIndex = i === vEndIndex ? i : i + 1;
334
+ }
335
+ }
336
+ }
337
+ }
338
+ if (isStartIndexInitialised && !((this.parent.totalItemCount == queryStartIndex) && (this.parent.totalItemCount == queryEndIndex))) {
339
+ this.parent.virtualItemStartIndex = queryStartIndex;
340
+ this.parent.virtualItemEndIndex = queryEndIndex;
341
+ this.generateAndExecuteQueryAsync(query, queryStartIndex, queryEndIndex);
342
+ }
343
+ this.setCurrentViewDataAsync();
344
+ }
345
+ dataProcessAsync(isOpenPopup) {
346
+ this.parent.selectedValueInfo = null;
347
+ this.parent.virtualItemStartIndex = this.parent.viewPortInfo.startIndex;
348
+ this.parent.virtualItemEndIndex = this.parent.viewPortInfo.endIndex;
349
+ this.generateQueryAndSetQueryIndexAsync(new Query(), isOpenPopup);
350
+ }
351
+ virtualScrollRefreshAsync() {
352
+ return __awaiter(this, void 0, void 0, function* () {
353
+ 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;
354
+ if (this.parent.allowFiltering || this.component === 'autocomplete') {
355
+ if (!isNullOrUndefined(this.parent.typedString) && !(this.component === 'combobox' && !isNullOrUndefined(this.parent.typedString) && this.parent.allowFiltering)) {
356
+ if (this.parent.viewPortInfo.endIndex >= this.parent.dataCount) {
357
+ this.parent.viewPortInfo.endIndex = this.parent.dataCount;
358
+ }
359
+ if (this.parent.viewPortInfo.startIndex >= this.parent.dataCount) {
360
+ this.parent.viewPortInfo.startIndex = this.parent.dataCount - this.parent.itemCount;
361
+ }
362
+ }
363
+ else {
364
+ this.parent.getSkeletonCount(true);
365
+ }
366
+ }
367
+ yield this.dataProcessAsync();
368
+ if (this.parent.keyboardEvent != null) {
369
+ this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent, this.parent.pageCount);
370
+ }
371
+ this.parent.isCustomFilter = false;
372
+ });
373
+ }
374
+ scrollListener(scrollArgs) {
375
+ if (!this.parent.isPreventScrollAction) {
376
+ let info = scrollArgs.sentinel;
377
+ let pStartIndex = this.parent.previousStartIndex;
378
+ this.parent.viewPortInfo = this.getInfoFromView(scrollArgs.direction, info, scrollArgs.offset, false);
379
+ this.parent.isUpwardScrolling = false;
380
+ if (this.parent.previousStartIndex !== pStartIndex && !this.parent.isKeyBoardAction) {
381
+ this.parent.isScrollActionTriggered = false;
382
+ this.parent.currentPageNumber = this.parent.viewPortInfo.currentPageNumber;
383
+ this.parent.virtualListInfo = Object.assign({}, this.parent.viewPortInfo);
384
+ this.parent.isPreventKeyAction = true;
385
+ this.parent.isVirtualScrolling = true;
386
+ setTimeout(() => {
387
+ this.parent.pageCount = this.parent.getPageCount();
388
+ this.virtualScrollRefreshAsync().then(() => {
389
+ if (this.parent.popupObj) {
390
+ this.parent.list = this.parent.popupObj.element.querySelector('.' + 'e-content') || select('.' + 'e-content');
391
+ this.parent.updateSelectionList();
392
+ this.parent.liCollections = this.parent.getItems();
393
+ }
394
+ this.parent.isKeyBoardAction = false;
395
+ this.parent.isVirtualScrolling = false;
396
+ this.parent.isPreventKeyAction = false;
397
+ });
398
+ }, 5);
399
+ }
400
+ else if (this.parent.isScrollActionTriggered) {
401
+ this.parent.isPreventKeyAction = false;
402
+ this.parent.isScrollActionTriggered = false;
403
+ let virtualListCount = this.parent.list.querySelectorAll('.e-virtual-list').length;
404
+ let listElement = this.parent.list.querySelector('.' + 'e-list-item');
405
+ let translateY = scrollArgs.offset.top - (listElement.offsetHeight * virtualListCount);
406
+ this.parent.list.getElementsByClassName('e-virtual-ddl-content')[0].style.transform = "translate(0px," + translateY + "px)";
407
+ }
408
+ this.parent.previousInfo = this.parent.viewPortInfo;
409
+ }
410
+ }
411
+ getPageCount(popupElement, returnExactCount = false) {
412
+ var list = popupElement && popupElement.querySelector('.e-content');
413
+ if (list) {
414
+ var liHeight = list.classList.contains('e-nodata') ? null : getComputedStyle(list.querySelectorAll('.e-list-item')[0], null).getPropertyValue('height');
415
+ var pageCount = list.getBoundingClientRect().height / parseInt(liHeight, 10);
416
+ return returnExactCount ? pageCount : Math.round(pageCount);
417
+ }
418
+ return 0;
419
+ }
420
+ ;
421
+ getRowHeight() {
422
+ return (isNullOrUndefined(this.parent.liCollections) || this.parent.liCollections.length == 0) ? 0 : Math.ceil(this.parent.liCollections[0].getBoundingClientRect().height);
423
+ }
424
+ getInfoFromView(direction, info, e, isscrollAction) {
425
+ let infoType = {
426
+ direction: direction, sentinelInfo: info, offsets: e,
427
+ startIndex: this.parent.previousStartIndex, endIndex: this.parent.previousEndIndex
428
+ };
429
+ let vHeight = this.parent.popupContentElement.getBoundingClientRect().height;
430
+ //Row Start and End Index calculation
431
+ let rowHeight = this.parent.listItemHeight;
432
+ let exactTopIndex = e.top / rowHeight;
433
+ let infoViewIndices = vHeight / rowHeight;
434
+ let exactEndIndex = exactTopIndex + infoViewIndices;
435
+ let pageSizeBy4 = this.parent.virtualItemCount / 4;
436
+ let totalItemCount = this.parent.totalItemCount;
437
+ if (infoType.direction === 'down') {
438
+ let sIndex = Math.round(exactEndIndex) - Math.round((pageSizeBy4));
439
+ if (isNullOrUndefined(infoType.startIndex) || (exactEndIndex >
440
+ (infoType.startIndex + Math.round((this.parent.virtualItemCount / 2 + pageSizeBy4)))
441
+ && infoType.endIndex !== totalItemCount)) {
442
+ infoType.startIndex = sIndex >= 0 ? Math.round(sIndex) : 0;
443
+ infoType.startIndex = infoType.startIndex > exactTopIndex ? Math.floor(exactTopIndex) : infoType.startIndex;
444
+ let eIndex = infoType.startIndex + this.parent.virtualItemCount;
445
+ infoType.startIndex = eIndex < exactEndIndex ? (Math.ceil(exactEndIndex) - this.parent.virtualItemCount)
446
+ : infoType.startIndex;
447
+ infoType.endIndex = eIndex < totalItemCount ? eIndex : totalItemCount;
448
+ infoType.startIndex = eIndex >= totalItemCount ? (infoType.endIndex - this.parent.virtualItemCount > 0 ? infoType.endIndex - this.parent.virtualItemCount : 0) : infoType.startIndex;
449
+ infoType.currentPageNumber = Math.ceil(infoType.endIndex / this.parent.virtualItemCount);
450
+ }
451
+ }
452
+ else if (infoType.direction === 'up') {
453
+ if (infoType.startIndex && infoType.endIndex) {
454
+ let loadAtIndex = Math.round(((infoType.startIndex * rowHeight) + (pageSizeBy4 * rowHeight)) / rowHeight);
455
+ if (exactTopIndex < loadAtIndex) {
456
+ let idxAddedToExactTop = (pageSizeBy4) > infoViewIndices ? pageSizeBy4 :
457
+ (infoViewIndices + infoViewIndices / 4);
458
+ let eIndex = Math.round(exactTopIndex + idxAddedToExactTop);
459
+ infoType.endIndex = eIndex < totalItemCount ? eIndex : totalItemCount;
460
+ let sIndex = infoType.endIndex - this.parent.virtualItemCount;
461
+ infoType.startIndex = sIndex > 0 ? sIndex : 0;
462
+ infoType.endIndex = sIndex < 0 ? this.parent.virtualItemCount : infoType.endIndex;
463
+ infoType.currentPageNumber = Math.ceil(infoType.startIndex / this.parent.virtualItemCount);
464
+ }
465
+ }
466
+ }
467
+ if (!isscrollAction) {
468
+ this.parent.previousStartIndex = infoType.startIndex;
469
+ this.parent.startIndex = infoType.startIndex;
470
+ this.parent.previousEndIndex = infoType.endIndex;
471
+ }
472
+ else {
473
+ this.parent.scrollPreStartIndex = infoType.startIndex;
474
+ }
475
+ return infoType;
476
+ }
477
+ virtualScrollHandler(callback) {
478
+ let delay = Browser.info.name === 'chrome' ? 200 : 100;
479
+ let prevTop = 0;
480
+ let debounced100 = debounce(callback, delay);
481
+ let debounced50 = debounce(callback, 50);
482
+ return (e) => {
483
+ let top = e.target.scrollTop;
484
+ let left = e.target.scrollLeft;
485
+ let direction = prevTop < top && !this.parent.isUpwardScrolling ? 'down' : 'up';
486
+ prevTop = top;
487
+ let current = this.sentinelInfo[direction];
488
+ var pstartIndex = this.parent.scrollPreStartIndex;
489
+ var scrollOffsetargs = {
490
+ top: top,
491
+ left: left
492
+ };
493
+ if (this.parent.list.querySelectorAll('.e-virtual-list').length > 0) {
494
+ var infoview = this.getInfoFromView(direction, current, scrollOffsetargs, true);
495
+ if (this.parent.scrollPreStartIndex != pstartIndex && !this.parent.isPreventScrollAction) {
496
+ this.parent.isScrollActionTriggered = true;
497
+ let virtualPoup = (this.parent.list.querySelector('.e-virtual-ddl-content'));
498
+ virtualPoup.style.transform = "translate(0px," + top + "px)";
499
+ }
500
+ }
501
+ let debounceFunction = debounced100;
502
+ if (current.axis === 'X') {
503
+ debounceFunction = debounced50;
504
+ }
505
+ debounceFunction({ direction: direction, sentinel: current, offset: { top: top, left: left },
506
+ focusElement: document.activeElement });
507
+ };
508
+ }
509
+ destroy() {
510
+ this.removeEventListener();
511
+ }
512
+ }
513
+
192
514
  /**
193
515
  * Common source
194
516
  */
@@ -260,6 +582,11 @@ let DropDownBase = class DropDownBase extends Component {
260
582
  this.addedNewItem = false;
261
583
  this.isAddNewItemTemplate = false;
262
584
  this.isRequesting = false;
585
+ this.isVirtualizationEnabled = false;
586
+ this.isAllowFiltering = false;
587
+ this.virtualizedItemsCount = 0;
588
+ this.totalItemCount = 0;
589
+ this.dataCount = 0;
263
590
  }
264
591
  getPropObject(prop, newProp, oldProp) {
265
592
  const newProperty = new Object();
@@ -659,11 +986,12 @@ let DropDownBase = class DropDownBase extends Component {
659
986
  this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
660
987
  this.trigger('actionComplete', e, (e) => {
661
988
  if (!e.cancel) {
662
- this.isRequesting = false;
663
989
  const listItems = e.result;
664
990
  if (listItems.length === 0) {
665
991
  this.isDataFetched = true;
666
992
  }
993
+ this.dataCount = e.count;
994
+ this.totalItemCount = e.count;
667
995
  ulElement = this.renderItems(listItems, fields);
668
996
  this.onActionComplete(ulElement, listItems, e);
669
997
  if (this.groupTemplate) {
@@ -672,6 +1000,7 @@ let DropDownBase = class DropDownBase extends Component {
672
1000
  this.isRequested = false;
673
1001
  this.bindChildItems(listItems, ulElement, fields, e);
674
1002
  }
1003
+ this.isRequesting = false;
675
1004
  });
676
1005
  }).catch((e) => {
677
1006
  this.isRequested = false;
@@ -681,13 +1010,19 @@ let DropDownBase = class DropDownBase extends Component {
681
1010
  });
682
1011
  }
683
1012
  else {
1013
+ this.isRequesting = false;
684
1014
  const dataManager = new DataManager(eventArgs.data);
685
- const listItems = (this.getQuery(eventArgs.query)).executeLocal(dataManager);
1015
+ let listItems = (this.getQuery(eventArgs.query)).executeLocal(dataManager);
1016
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1017
+ this.dataCount = listItems.count;
1018
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1019
+ this.totalItemCount = listItems.count;
1020
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1021
+ listItems = this.isVirtualizationEnabled ? listItems.result : listItems;
686
1022
  const localDataArgs = { cancel: false, result: listItems };
687
1023
  this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
688
1024
  this.trigger('actionComplete', localDataArgs, (localDataArgs) => {
689
1025
  if (!localDataArgs.cancel) {
690
- this.isRequesting = false;
691
1026
  ulElement = this.renderItems(localDataArgs.result, fields);
692
1027
  this.onActionComplete(ulElement, localDataArgs.result, event);
693
1028
  if (this.groupTemplate) {
@@ -780,6 +1115,11 @@ let DropDownBase = class DropDownBase extends Component {
780
1115
  onActionComplete(ulElement, list, e) {
781
1116
  /* eslint-enable @typescript-eslint/no-unused-vars */
782
1117
  this.listData = list;
1118
+ if (this.isVirtualizationEnabled) {
1119
+ this.notify("setGeneratedData", {
1120
+ module: "VirtualScroll",
1121
+ });
1122
+ }
783
1123
  if (this.getModuleName() !== 'listbox') {
784
1124
  ulElement.setAttribute('tabindex', '0');
785
1125
  }
@@ -798,11 +1138,13 @@ let DropDownBase = class DropDownBase extends Component {
798
1138
  }
799
1139
  }
800
1140
  if (!isNullOrUndefined(this.list)) {
801
- this.list.innerHTML = '';
802
- this.list.appendChild(ulElement);
803
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
804
- this.ulElement = this.list.querySelector('ul');
805
- this.postRender(this.list, list, this.bindEvent);
1141
+ if (!this.isVirtualizationEnabled) {
1142
+ this.list.innerHTML = '';
1143
+ this.list.appendChild(ulElement);
1144
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1145
+ this.ulElement = this.list.querySelector('ul');
1146
+ this.postRender(this.list, list, this.bindEvent);
1147
+ }
806
1148
  }
807
1149
  }
808
1150
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -830,6 +1172,11 @@ let DropDownBase = class DropDownBase extends Component {
830
1172
  getQuery(query) {
831
1173
  return query ? query : this.query ? this.query : new Query();
832
1174
  }
1175
+ updateVirtualizationProperties(itemCount, filtering) {
1176
+ this.isVirtualizationEnabled = true;
1177
+ this.virtualizedItemsCount = itemCount;
1178
+ this.isAllowFiltering = filtering;
1179
+ }
833
1180
  /**
834
1181
  * To render the template content for group header element.
835
1182
  *
@@ -968,9 +1315,47 @@ let DropDownBase = class DropDownBase extends Component {
968
1315
  new DataManager(dataSource).executeLocal(new Query().take(100))
969
1316
  : dataSource;
970
1317
  ulElement = this.templateListItem((this.getModuleName() === 'autocomplete') ? spliceData : dataSource, fields);
1318
+ if (this.isVirtualizationEnabled) {
1319
+ var oldUlElement = this.list.querySelector('.e-list-parent');
1320
+ var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
1321
+ if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
1322
+ virtualUlElement.replaceChild(ulElement, oldUlElement);
1323
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1324
+ this.ulElement = this.list.querySelector('ul');
1325
+ this.listData = listData;
1326
+ this.postRender(this.list, listData, this.bindEvent);
1327
+ }
1328
+ else if ((!virtualUlElement)) {
1329
+ this.list.innerHTML = '';
1330
+ this.list.appendChild(ulElement);
1331
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1332
+ this.ulElement = this.list.querySelector('ul');
1333
+ this.listData = listData;
1334
+ this.postRender(this.list, listData, this.bindEvent);
1335
+ }
1336
+ }
971
1337
  }
972
1338
  else {
973
1339
  ulElement = this.createListItems(listData, fields);
1340
+ if (this.isVirtualizationEnabled) {
1341
+ var oldUlElement = this.list.querySelector('.e-list-parent');
1342
+ var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
1343
+ if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
1344
+ virtualUlElement.replaceChild(ulElement, oldUlElement);
1345
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1346
+ this.ulElement = this.list.querySelector('ul');
1347
+ this.listData = listData;
1348
+ this.postRender(this.list, listData, this.bindEvent);
1349
+ }
1350
+ else if ((!virtualUlElement)) {
1351
+ this.list.innerHTML = '';
1352
+ this.list.appendChild(ulElement);
1353
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1354
+ this.ulElement = this.list.querySelector('ul');
1355
+ this.listData = listData;
1356
+ this.postRender(this.list, listData, this.bindEvent);
1357
+ }
1358
+ }
974
1359
  }
975
1360
  return ulElement;
976
1361
  }
@@ -1110,7 +1495,7 @@ let DropDownBase = class DropDownBase extends Component {
1110
1495
  }
1111
1496
  }
1112
1497
  updateSelectElementData(isFiltering) {
1113
- if (isFiltering && isNullOrUndefined(this.selectData) && this.listData && this.listData.length > 0) {
1498
+ if ((isFiltering || this.isVirtualizationEnabled) && isNullOrUndefined(this.selectData) && this.listData && this.listData.length > 0) {
1114
1499
  this.selectData = this.listData;
1115
1500
  }
1116
1501
  }
@@ -1124,6 +1509,7 @@ let DropDownBase = class DropDownBase extends Component {
1124
1509
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1125
1510
  updateDataSource(props) {
1126
1511
  this.resetList(this.dataSource);
1512
+ this.totalItemCount = this.dataSource instanceof DataManager ? this.dataSource.dataSource.json.length : 0;
1127
1513
  }
1128
1514
  setUpdateInitial(props, newProp) {
1129
1515
  this.isDataFetched = false;
@@ -1540,6 +1926,7 @@ const dropDownListClasses = {
1540
1926
  disable: dropDownBaseClasses.disabled,
1541
1927
  base: dropDownBaseClasses.root,
1542
1928
  focus: dropDownBaseClasses.focus,
1929
+ content: dropDownBaseClasses.content,
1543
1930
  input: 'e-input-group',
1544
1931
  inputFocus: 'e-input-focus',
1545
1932
  icon: 'e-input-group-icon e-ddl-icon',
@@ -1557,7 +1944,8 @@ const dropDownListClasses = {
1557
1944
  clearIconHide: 'e-clear-icon-hide',
1558
1945
  popupFullScreen: 'e-popup-full-page',
1559
1946
  disableIcon: 'e-ddl-disable-icon',
1560
- hiddenElement: 'e-ddl-hidden'
1947
+ hiddenElement: 'e-ddl-hidden',
1948
+ virtualList: 'e-list-item e-virtual-list',
1561
1949
  };
1562
1950
  const inputObject = {
1563
1951
  container: null,
@@ -1584,9 +1972,52 @@ let DropDownList = class DropDownList extends DropDownBase {
1584
1972
  */
1585
1973
  constructor(options, element) {
1586
1974
  super(options, element);
1975
+ this.skeletonCount = 32;
1587
1976
  this.isListSearched = false;
1588
1977
  this.preventChange = false;
1589
1978
  this.isAngular = false;
1979
+ this.itemCount = 10;
1980
+ this.virtualListHeight = 0;
1981
+ this.isVirtualScrolling = false;
1982
+ this.isPreventScrollAction = false;
1983
+ this.scrollPreStartIndex = 0;
1984
+ this.isScrollActionTriggered = false;
1985
+ this.previousStartIndex = 0;
1986
+ this.isMouseScrollAction = false;
1987
+ this.isKeyBoardAction = false;
1988
+ this.isUpwardScrolling = false;
1989
+ this.startIndex = 0;
1990
+ this.currentPageNumber = 0;
1991
+ this.pageCount = 0;
1992
+ this.isPreventKeyAction = false;
1993
+ this.generatedDataObject = {};
1994
+ this.virtualListInfo = {
1995
+ currentPageNumber: null,
1996
+ direction: null,
1997
+ sentinelInfo: {},
1998
+ offsets: {},
1999
+ startIndex: 0,
2000
+ endIndex: 0,
2001
+ };
2002
+ this.viewPortInfo = {
2003
+ currentPageNumber: null,
2004
+ direction: null,
2005
+ sentinelInfo: {},
2006
+ offsets: {},
2007
+ startIndex: 0,
2008
+ endIndex: 0,
2009
+ };
2010
+ this.selectedValueInfo = {
2011
+ currentPageNumber: null,
2012
+ direction: null,
2013
+ sentinelInfo: {},
2014
+ offsets: {},
2015
+ startIndex: 0,
2016
+ endIndex: 0,
2017
+ };
2018
+ this.IsScrollerAtEnd = function () {
2019
+ return this.list && this.list.scrollTop + this.list.clientHeight >= this.list.scrollHeight;
2020
+ };
1590
2021
  }
1591
2022
  /**
1592
2023
  * Initialize the event handler.
@@ -1644,14 +2075,31 @@ let DropDownList = class DropDownList extends DropDownBase {
1644
2075
  hide: 'alt+38',
1645
2076
  space: '32'
1646
2077
  };
2078
+ this.viewPortInfo = {
2079
+ currentPageNumber: null,
2080
+ direction: null,
2081
+ sentinelInfo: {},
2082
+ offsets: {},
2083
+ startIndex: 0,
2084
+ endIndex: this.itemCount,
2085
+ };
1647
2086
  }
1648
2087
  setZIndex() {
1649
2088
  if (this.popupObj) {
1650
2089
  this.popupObj.setProperties({ 'zIndex': this.zIndex });
1651
2090
  }
1652
2091
  }
2092
+ requiredModules() {
2093
+ const modules = [];
2094
+ if (this.enableVirtualization) {
2095
+ modules.push({ args: [this], member: 'VirtualScroll' });
2096
+ }
2097
+ return modules;
2098
+ }
1653
2099
  renderList(e, isEmptyData) {
1654
2100
  super.render(e, isEmptyData);
2101
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2102
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
1655
2103
  this.unWireListEvents();
1656
2104
  this.wireListEvents();
1657
2105
  }
@@ -1669,6 +2117,12 @@ let DropDownList = class DropDownList extends DropDownBase {
1669
2117
  resetHandler(e) {
1670
2118
  e.preventDefault();
1671
2119
  this.clearAll(e);
2120
+ if (this.enableVirtualization) {
2121
+ this.list.scrollTop = 0;
2122
+ this.virtualListInfo = null;
2123
+ this.previousStartIndex = 0;
2124
+ this.previousEndIndex = 0;
2125
+ }
1672
2126
  }
1673
2127
  resetFocusElement() {
1674
2128
  this.removeHover();
@@ -1676,7 +2130,10 @@ let DropDownList = class DropDownList extends DropDownBase {
1676
2130
  this.removeFocus();
1677
2131
  this.list.scrollTop = 0;
1678
2132
  if (this.getModuleName() !== 'autocomplete' && !isNullOrUndefined(this.ulElement)) {
1679
- const li = this.ulElement.querySelector('.' + dropDownListClasses.li);
2133
+ let li = this.ulElement.querySelector('.' + dropDownListClasses.li);
2134
+ if (this.enableVirtualization) {
2135
+ li = this.liCollections[this.skeletonCount];
2136
+ }
1680
2137
  if (li) {
1681
2138
  li.classList.add(dropDownListClasses.focus);
1682
2139
  }
@@ -1695,6 +2152,10 @@ let DropDownList = class DropDownList extends DropDownBase {
1695
2152
  return;
1696
2153
  }
1697
2154
  this.onChangeEvent(e);
2155
+ this.checkAndResetCache();
2156
+ if (this.enableVirtualization) {
2157
+ this.updateInitialData();
2158
+ }
1698
2159
  }
1699
2160
  resetSelection(properties) {
1700
2161
  if (this.list) {
@@ -1760,10 +2221,10 @@ let DropDownList = class DropDownList extends DropDownBase {
1760
2221
  this.inputWrapper.container.setAttribute('style', this.htmlAttributes[`${htmlAttr}`]);
1761
2222
  }
1762
2223
  else if (htmlAttr === 'aria-label') {
1763
- if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
2224
+ if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') && !this.readonly) {
1764
2225
  this.inputElement.setAttribute('aria-label', this.htmlAttributes[`${htmlAttr}`]);
1765
2226
  }
1766
- else {
2227
+ else if (this.getModuleName() === 'dropdownlist') {
1767
2228
  this.inputWrapper.container.setAttribute('aria-label', this.htmlAttributes[`${htmlAttr}`]);
1768
2229
  }
1769
2230
  }
@@ -1862,6 +2323,8 @@ let DropDownList = class DropDownList extends DropDownBase {
1862
2323
  return item;
1863
2324
  }
1864
2325
  initValue() {
2326
+ this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
2327
+ this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.itemCount;
1865
2328
  this.renderList();
1866
2329
  if (this.dataSource instanceof DataManager) {
1867
2330
  this.initRemoteRender = true;
@@ -1871,6 +2334,7 @@ let DropDownList = class DropDownList extends DropDownBase {
1871
2334
  }
1872
2335
  }
1873
2336
  updateValues() {
2337
+ this.selectedValueInfo = this.viewPortInfo;
1874
2338
  if (!isNullOrUndefined(this.value)) {
1875
2339
  this.setSelection(this.getElementByValue(this.value), null);
1876
2340
  }
@@ -2059,6 +2523,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2059
2523
  }
2060
2524
  onMouseClick(e) {
2061
2525
  const target = e.target;
2526
+ this.keyboardEvent = null;
2062
2527
  const li = closest(target, '.' + dropDownBaseClasses.li);
2063
2528
  if (!this.isValidLI(li)) {
2064
2529
  return;
@@ -2139,6 +2604,10 @@ let DropDownList = class DropDownList extends DropDownBase {
2139
2604
  if (!this.enabled) {
2140
2605
  return;
2141
2606
  }
2607
+ this.keyboardEvent = e;
2608
+ if (this.isPreventKeyAction && this.enableVirtualization) {
2609
+ e.preventDefault();
2610
+ }
2142
2611
  const preventAction = e.action === 'pageUp' || e.action === 'pageDown';
2143
2612
  const preventHomeEnd = this.getModuleName() !== 'dropdownlist' && (e.action === 'home' || e.action === 'end');
2144
2613
  this.isEscapeKey = e.action === 'escape';
@@ -2178,9 +2647,11 @@ let DropDownList = class DropDownList extends DropDownBase {
2178
2647
  e.preventDefault();
2179
2648
  break;
2180
2649
  case 'home':
2650
+ this.isMouseScrollAction = true;
2181
2651
  this.updateHomeEndAction(e);
2182
2652
  break;
2183
2653
  case 'end':
2654
+ this.isMouseScrollAction = true;
2184
2655
  this.updateHomeEndAction(e);
2185
2656
  break;
2186
2657
  case 'space':
@@ -2214,13 +2685,19 @@ let DropDownList = class DropDownList extends DropDownBase {
2214
2685
  }
2215
2686
  }
2216
2687
  }
2217
- updateUpDownAction(e) {
2688
+ updateUpDownAction(e, isVirtualKeyAction) {
2218
2689
  const focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
2219
- if (this.isSelectFocusItem(focusEle)) {
2690
+ if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
2220
2691
  this.setSelection(focusEle, e);
2692
+ if (this.enableVirtualization) {
2693
+ let selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
2694
+ this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
2695
+ }
2221
2696
  }
2222
2697
  else if (!isNullOrUndefined(this.liCollections)) {
2698
+ let virtualIndex = this.activeIndex;
2223
2699
  let index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
2700
+ index = isVirtualKeyAction ? virtualIndex : index;
2224
2701
  let startIndex = 0;
2225
2702
  if (this.getModuleName() === 'autocomplete') {
2226
2703
  startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
@@ -2228,8 +2705,26 @@ let DropDownList = class DropDownList extends DropDownBase {
2228
2705
  }
2229
2706
  let nextItem;
2230
2707
  if (this.getModuleName() !== 'autocomplete' || this.getModuleName() === 'autocomplete' && this.isPopupOpen) {
2231
- nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
2232
- : this.liCollections[index];
2708
+ if (!this.enableVirtualization) {
2709
+ nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
2710
+ : this.liCollections[index];
2711
+ }
2712
+ else {
2713
+ if (!isVirtualKeyAction) {
2714
+ nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[this.skeletonCount]
2715
+ : this.liCollections[index];
2716
+ nextItem = !isNullOrUndefined(nextItem) && !nextItem.classList.contains('e-virtual-list') ? nextItem : null;
2717
+ }
2718
+ else {
2719
+ if (this.getModuleName() === 'autocomplete') {
2720
+ var value = this.selectedLI.dataset.value;
2721
+ nextItem = this.getElementByValue(value);
2722
+ }
2723
+ else {
2724
+ nextItem = this.getElementByValue(this.getItemData().value);
2725
+ }
2726
+ }
2727
+ }
2233
2728
  }
2234
2729
  if (!isNullOrUndefined(nextItem)) {
2235
2730
  this.setSelection(nextItem, e);
@@ -2237,17 +2732,23 @@ let DropDownList = class DropDownList extends DropDownBase {
2237
2732
  }
2238
2733
  e.preventDefault();
2239
2734
  }
2240
- updateHomeEndAction(e) {
2735
+ updateHomeEndAction(e, isVirtualKeyAction) {
2241
2736
  if (this.getModuleName() === 'dropdownlist') {
2242
2737
  let findLi = 0;
2243
2738
  if (e.action === 'home') {
2244
2739
  findLi = 0;
2740
+ if (this.enableVirtualization) {
2741
+ findLi = this.skeletonCount;
2742
+ }
2245
2743
  }
2246
2744
  else {
2247
2745
  findLi = this.getItems().length - 1;
2248
2746
  }
2249
2747
  e.preventDefault();
2250
2748
  if (this.activeIndex === findLi) {
2749
+ if (isVirtualKeyAction) {
2750
+ this.setSelection(this.liCollections[findLi], e);
2751
+ }
2251
2752
  return;
2252
2753
  }
2253
2754
  this.setSelection(this.liCollections[findLi], e);
@@ -2285,6 +2786,36 @@ let DropDownList = class DropDownList extends DropDownBase {
2285
2786
  }
2286
2787
  }
2287
2788
  }
2789
+ handleVirtualKeyboardActions(e, pageCount) {
2790
+ switch (e.action) {
2791
+ case 'down':
2792
+ case 'up':
2793
+ if (this.itemData != null || this.getModuleName() === 'autocomplete') {
2794
+ this.updateUpDownAction(e, true);
2795
+ }
2796
+ break;
2797
+ case 'pageUp':
2798
+ let count = (pageCount * 2) - 4;
2799
+ this.activeIndex = Math.round(count);
2800
+ this.pageUpSelection(this.activeIndex - this.getPageCount(), e, true);
2801
+ e.preventDefault();
2802
+ break;
2803
+ case 'pageDown':
2804
+ this.activeIndex = 1;
2805
+ this.pageDownSelection(this.activeIndex + this.getPageCount(), e, true);
2806
+ e.preventDefault();
2807
+ break;
2808
+ case 'home':
2809
+ this.isMouseScrollAction = true;
2810
+ this.updateHomeEndAction(e, true);
2811
+ break;
2812
+ case 'end':
2813
+ this.isMouseScrollAction = true;
2814
+ this.updateHomeEndAction(e, true);
2815
+ break;
2816
+ }
2817
+ this.keyboardEvent = null;
2818
+ }
2288
2819
  selectCurrentItem(e) {
2289
2820
  if (this.isPopupOpen) {
2290
2821
  const li = this.list.querySelector('.' + dropDownListClasses.focus);
@@ -2306,19 +2837,39 @@ let DropDownList = class DropDownList extends DropDownBase {
2306
2837
  isSelectFocusItem(element) {
2307
2838
  return !isNullOrUndefined(element);
2308
2839
  }
2309
- getPageCount() {
2840
+ getPageCount(returnExactCount) {
2310
2841
  const liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
2311
2842
  getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
2312
- return Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
2843
+ let pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
2844
+ return returnExactCount ? pageCount : Math.round(pageCount);
2313
2845
  }
2314
- pageUpSelection(steps, event) {
2315
- const previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
2316
- this.setSelection(previousItem, event);
2846
+ pageUpSelection(steps, event, isVirtualKeyAction) {
2847
+ let previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
2848
+ if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
2849
+ previousItem = steps >= 0 ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
2850
+ }
2851
+ if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
2852
+ previousItem = this.liCollections[this.skeletonCount];
2853
+ }
2854
+ this.PageUpDownSelection(previousItem, event);
2855
+ }
2856
+ PageUpDownSelection(previousItem, event) {
2857
+ if (this.enableVirtualization) {
2858
+ if (!isNullOrUndefined(previousItem) && ((this.getModuleName() !== 'autocomplete' && !previousItem.classList.contains('e-active')) || (this.getModuleName() === 'autocomplete' && !previousItem.classList.contains('e-item-focus')))) {
2859
+ this.setSelection(previousItem, event);
2860
+ }
2861
+ }
2862
+ else {
2863
+ this.setSelection(previousItem, event);
2864
+ }
2317
2865
  }
2318
- pageDownSelection(steps, event) {
2866
+ pageDownSelection(steps, event, isVirtualKeyAction) {
2319
2867
  const list = this.getItems();
2320
- const previousItem = steps <= list.length ? this.liCollections[steps - 1] : this.liCollections[list.length - 1];
2321
- this.setSelection(previousItem, event);
2868
+ let previousItem = steps <= list.length ? this.liCollections[steps - 1] : this.liCollections[list.length - 1];
2869
+ if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
2870
+ previousItem = steps <= list.length ? this.liCollections[steps + this.skeletonCount - 1] : this.liCollections[list.length - 1];
2871
+ }
2872
+ this.PageUpDownSelection(previousItem, event);
2322
2873
  }
2323
2874
  unWireEvent() {
2324
2875
  if (!isNullOrUndefined(this.inputWrapper)) {
@@ -2383,6 +2934,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2383
2934
  if (e.which === 3 || e.button === 2) {
2384
2935
  return;
2385
2936
  }
2937
+ this.keyboardEvent = null;
2386
2938
  if (this.targetElement().classList.contains(dropDownListClasses.disable) || this.inputWrapper.clearButton === e.target) {
2387
2939
  return;
2388
2940
  }
@@ -2527,6 +3079,14 @@ let DropDownList = class DropDownList extends DropDownBase {
2527
3079
  }
2528
3080
  else {
2529
3081
  this.setSelectOptions(li, e);
3082
+ if (this.enableVirtualization) {
3083
+ const fields = (this.fields.value) ? this.fields.value : '';
3084
+ const getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
3085
+ if (getItem && getItem.length > 0) {
3086
+ this.itemData = getItem[0];
3087
+ this.setProperties({ 'text': getItem[0].text, 'value': getItem[0].value }, true);
3088
+ }
3089
+ }
2530
3090
  }
2531
3091
  }
2532
3092
  setSelectOptions(li, e) {
@@ -2785,6 +3345,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2785
3345
  this.typedString = this.filterInput.value;
2786
3346
  this.preventAutoFill = false;
2787
3347
  this.searchLists(e);
3348
+ if (this.enableVirtualization) {
3349
+ this.getFilteringSkeletonCount();
3350
+ }
2788
3351
  break;
2789
3352
  }
2790
3353
  }
@@ -2792,6 +3355,33 @@ let DropDownList = class DropDownList extends DropDownBase {
2792
3355
  this.isValidKey = false;
2793
3356
  }
2794
3357
  }
3358
+ getFilteringSkeletonCount() {
3359
+ const difference = this.dataCount - this.viewPortInfo.endIndex;
3360
+ const currentSkeletonCount = this.skeletonCount;
3361
+ this.getSkeletonCount(true);
3362
+ this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
3363
+ if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
3364
+ const isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
3365
+ if (currentSkeletonCount !== this.skeletonCount) {
3366
+ this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
3367
+ }
3368
+ else {
3369
+ this.UpdateSkeleton();
3370
+ }
3371
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
3372
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3373
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
3374
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3375
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3376
+ }
3377
+ }
3378
+ getSkeletonCount(retainSkeleton) {
3379
+ this.virtualListHeight = this.listHeight != null ? parseInt(this.listHeight, 10) : this.virtualListHeight;
3380
+ const actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
3381
+ this.skeletonCount = actualCount * 2 < this.itemCount ? this.itemCount : actualCount * 2;
3382
+ this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
3383
+ this.skeletonCount = Math.floor(this.skeletonCount / 2) + 2;
3384
+ }
2795
3385
  onFilterDown(e) {
2796
3386
  switch (e.keyCode) {
2797
3387
  case 13: //enter
@@ -2835,6 +3425,14 @@ let DropDownList = class DropDownList extends DropDownBase {
2835
3425
  else {
2836
3426
  filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
2837
3427
  }
3428
+ if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0)) {
3429
+ var takeValue = this.getTakeValue();
3430
+ if (this.allowFiltering) {
3431
+ filterQuery.skip(this.virtualItemStartIndex);
3432
+ }
3433
+ filterQuery.take(takeValue);
3434
+ filterQuery.requiresCount();
3435
+ }
2838
3436
  return filterQuery;
2839
3437
  }
2840
3438
  getSelectionPoints() {
@@ -2851,6 +3449,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2851
3449
  }
2852
3450
  this.isDataFetched = false;
2853
3451
  if (this.isFiltering()) {
3452
+ this.checkAndResetCache();
2854
3453
  const eventArgs = {
2855
3454
  preventDefaultAction: false,
2856
3455
  text: this.filterInput.value,
@@ -2888,10 +3487,30 @@ let DropDownList = class DropDownList extends DropDownBase {
2888
3487
  if (!isNullOrUndefined(this.filterInput)) {
2889
3488
  this.beforePopupOpen = (!this.isPopupOpen && this.getModuleName() === 'combobox' && this.filterInput.value === '') ?
2890
3489
  false : true;
3490
+ let isNoData = this.list.classList.contains(dropDownBaseClasses.noData);
2891
3491
  if (this.filterInput.value.trim() === '' && !this.itemTemplate) {
2892
3492
  this.actionCompleteData.isUpdated = false;
2893
3493
  this.isTyped = false;
2894
3494
  if (!isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {
3495
+ if (this.enableVirtualization) {
3496
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3497
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
3498
+ this.resetList(dataSource, fields, query);
3499
+ if (isNoData && !this.list.classList.contains(dropDownBaseClasses.noData)) {
3500
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
3501
+ this.list.appendChild(this.createElement('div', {
3502
+ className: 'e-virtual-ddl-content',
3503
+ styles: this.getTransformValues()
3504
+ })).appendChild(this.list.querySelector('.e-list-parent'));
3505
+ }
3506
+ if (!this.list.querySelector('.e-virtual-ddl')) {
3507
+ var virualElement = this.createElement('div', {
3508
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
3509
+ });
3510
+ document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
3511
+ }
3512
+ }
3513
+ }
2895
3514
  this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list);
2896
3515
  }
2897
3516
  this.isTyped = true;
@@ -2904,7 +3523,30 @@ let DropDownList = class DropDownList extends DropDownBase {
2904
3523
  else {
2905
3524
  this.isNotSearchList = false;
2906
3525
  query = (this.filterInput.value.trim() === '') ? null : query;
3526
+ if (this.enableVirtualization && this.isFiltering() && this.isTyped) {
3527
+ this.isPreventScrollAction = true;
3528
+ this.list.scrollTop = 0;
3529
+ this.previousStartIndex = 0;
3530
+ this.virtualListInfo = null;
3531
+ }
2907
3532
  this.resetList(dataSource, fields, query);
3533
+ if (this.enableVirtualization && isNoData && !this.list.classList.contains(dropDownBaseClasses.noData)) {
3534
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
3535
+ this.list.appendChild(this.createElement('div', {
3536
+ className: 'e-virtual-ddl-content',
3537
+ styles: this.getTransformValues()
3538
+ })).appendChild(this.list.querySelector('.e-list-parent'));
3539
+ }
3540
+ if (!this.list.querySelector('.e-virtual-ddl')) {
3541
+ var virualElement = this.createElement('div', {
3542
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
3543
+ });
3544
+ document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
3545
+ }
3546
+ }
3547
+ }
3548
+ if (this.enableVirtualization) {
3549
+ this.getFilteringSkeletonCount();
2908
3550
  }
2909
3551
  this.renderReactTemplates();
2910
3552
  }
@@ -3001,15 +3643,47 @@ let DropDownList = class DropDownList extends DropDownBase {
3001
3643
  this.renderPopup();
3002
3644
  }
3003
3645
  }
3646
+ UpdateSkeleton(isSkeletonCountChange, skeletonCount) {
3647
+ let isContainSkeleton = this.list.querySelector('.e-virtual-ddl-content');
3648
+ let isContainVirtualList = this.list.querySelector('.e-virtual-list');
3649
+ if (isContainSkeleton && (!isContainVirtualList || isSkeletonCountChange) && this.enableVirtualization) {
3650
+ const totalSkeletonCount = isSkeletonCountChange ? skeletonCount : this.skeletonCount;
3651
+ for (let i = 0; i < totalSkeletonCount; i++) {
3652
+ const liElement = this.createElement('li', { className: dropDownListClasses.virtualList, styles: 'overflow: inherit' });
3653
+ if (this.enableVirtualization && this.itemTemplate) {
3654
+ liElement.style.height = this.listItemHeight + 'px';
3655
+ }
3656
+ let skeleton = new Skeleton({
3657
+ shape: "Text",
3658
+ height: "10px",
3659
+ width: "95%",
3660
+ cssClass: "e-skeleton-text",
3661
+ });
3662
+ skeleton.appendTo(this.createElement('div'));
3663
+ liElement.appendChild(skeleton.element);
3664
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3665
+ isContainSkeleton.firstChild.insertBefore(liElement, isContainSkeleton.firstChild.children[0]);
3666
+ }
3667
+ }
3668
+ }
3669
+ getTakeValue() {
3670
+ return this.allowFiltering && this.getModuleName() === 'dropdownlist' && Browser.isDevice ? Math.round(window.outerHeight / this.listItemHeight) : this.itemCount;
3671
+ }
3004
3672
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
3005
3673
  onActionComplete(ulElement, list, e, isUpdated) {
3006
- if (this.isNotSearchList) {
3674
+ if (this.dataSource instanceof DataManager && !isNullOrUndefined(e)) {
3675
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3676
+ this.totalItemCount = e.count;
3677
+ }
3678
+ if (this.isNotSearchList && !this.enableVirtualization) {
3007
3679
  this.isNotSearchList = false;
3008
3680
  return;
3009
3681
  }
3682
+ let tempItemCount = this.itemCount;
3010
3683
  if (this.isActive || !isNullOrUndefined(ulElement)) {
3011
3684
  const selectedItem = this.selectedLI ? this.selectedLI.cloneNode(true) : null;
3012
3685
  super.onActionComplete(ulElement, list, e);
3686
+ this.skeletonCount = this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2) ? 0 : this.skeletonCount;
3013
3687
  this.updateSelectElementData(this.allowFiltering);
3014
3688
  if (this.isRequested && !isNullOrUndefined(this.searchKeyEvent) && this.searchKeyEvent.type === 'keydown') {
3015
3689
  this.isRequested = false;
@@ -3020,7 +3694,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3020
3694
  this.incrementalSearch(this.searchKeyEvent);
3021
3695
  this.searchKeyEvent = null;
3022
3696
  }
3023
- this.list.scrollTop = 0;
3697
+ if (!this.enableVirtualization) {
3698
+ this.list.scrollTop = 0;
3699
+ }
3024
3700
  if (!isNullOrUndefined(ulElement)) {
3025
3701
  attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
3026
3702
  }
@@ -3072,13 +3748,36 @@ let DropDownList = class DropDownList extends DropDownBase {
3072
3748
  this.updateActionCompleteDataValues(ulElement, list);
3073
3749
  }
3074
3750
  }
3075
- this.addNewItem(list, selectedItem);
3076
- if (!isNullOrUndefined(this.itemData)) {
3751
+ if (!this.enableVirtualization) {
3752
+ this.addNewItem(list, selectedItem);
3753
+ }
3754
+ if (!isNullOrUndefined(this.itemData) || (isNullOrUndefined(this.itemData) && this.enableVirtualization)) {
3077
3755
  this.focusIndexItem();
3078
3756
  }
3757
+ if (this.enableVirtualization) {
3758
+ this.updateActionCompleteDataValues(ulElement, list);
3759
+ }
3760
+ }
3761
+ else if (this.enableVirtualization && this.getModuleName() !== 'autocomplete' && !this.isFiltering()) {
3762
+ const value = this.getItemData().value;
3763
+ this.activeIndex = this.getIndexByValue(value);
3764
+ const element = this.findListElement(this.list, 'li', 'data-value', value);
3765
+ this.selectedLI = element;
3766
+ }
3767
+ else if (this.enableVirtualization && this.getModuleName() === 'autocomplete') {
3768
+ this.activeIndex = this.skeletonCount;
3079
3769
  }
3080
3770
  if (this.beforePopupOpen) {
3081
3771
  this.renderPopup(e);
3772
+ if (this.enableVirtualization) {
3773
+ if (!this.list.querySelector('.e-virtual-list')) {
3774
+ this.UpdateSkeleton();
3775
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
3776
+ }
3777
+ }
3778
+ if (this.enableVirtualization && tempItemCount != this.itemCount) {
3779
+ this.resetList(this.dataSource, this.fields);
3780
+ }
3082
3781
  }
3083
3782
  }
3084
3783
  }
@@ -3139,7 +3838,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3139
3838
  const element = this.findListElement(this.list, 'li', 'data-value', value);
3140
3839
  this.selectedLI = element;
3141
3840
  this.activeItem(element);
3142
- this.removeFocus();
3841
+ if (!(this.enableVirtualization && isNullOrUndefined(element))) {
3842
+ this.removeFocus();
3843
+ }
3143
3844
  }
3144
3845
  updateSelection() {
3145
3846
  const selectedItem = this.list.querySelector('.' + dropDownBaseClasses.selected);
@@ -3152,12 +3853,46 @@ let DropDownList = class DropDownList extends DropDownBase {
3152
3853
  this.list.querySelector('.' + dropDownBaseClasses.li).classList.add(dropDownListClasses.focus);
3153
3854
  }
3154
3855
  }
3856
+ updateSelectionList() {
3857
+ let selectedItem = this.list && this.list.querySelector('.' + 'e-active');
3858
+ if (!selectedItem && !isNullOrUndefined(this.value)) {
3859
+ var findEle = this.findListElement(this.list, 'li', 'data-value', this.value);
3860
+ if (findEle) {
3861
+ findEle.classList.add('e-active');
3862
+ }
3863
+ }
3864
+ }
3865
+ checkAndResetCache() {
3866
+ if (this.enableVirtualization) {
3867
+ this.generatedDataObject = {};
3868
+ this.virtualItemStartIndex = this.virtualItemEndIndex = 0;
3869
+ this.viewPortInfo = { currentPageNumber: null,
3870
+ direction: null,
3871
+ sentinelInfo: {},
3872
+ offsets: {},
3873
+ startIndex: 0,
3874
+ endIndex: this.itemCount, };
3875
+ this.selectedValueInfo = null;
3876
+ }
3877
+ }
3155
3878
  removeFocus() {
3156
3879
  const highlightedItem = this.list.querySelectorAll('.' + dropDownListClasses.focus);
3157
3880
  if (highlightedItem && highlightedItem.length) {
3158
3881
  removeClass(highlightedItem, dropDownListClasses.focus);
3159
3882
  }
3160
3883
  }
3884
+ getTransformValues() {
3885
+ let translateY = this.viewPortInfo.startIndex * this.listItemHeight;
3886
+ translateY = translateY - (this.skeletonCount * this.listItemHeight);
3887
+ translateY = this.viewPortInfo.startIndex === 0 && this.listData && this.listData.length === 0 ? 0 : translateY;
3888
+ const styleText = `transform: translate(0px, ${translateY}px);`;
3889
+ return styleText;
3890
+ }
3891
+ GetVirtualTrackHeight() {
3892
+ const height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
3893
+ const heightDimension = `height: ${height - this.itemCount * this.listItemHeight}px;`;
3894
+ return heightDimension;
3895
+ }
3161
3896
  renderPopup(e) {
3162
3897
  if (this.popupObj && document.body.contains(this.popupObj.element)) {
3163
3898
  this.refreshPopup();
@@ -3179,10 +3914,39 @@ let DropDownList = class DropDownList extends DropDownBase {
3179
3914
  this.setFooterTemplate(popupEle);
3180
3915
  }
3181
3916
  document.body.appendChild(popupEle);
3917
+ if (this.enableVirtualization && this.itemTemplate) {
3918
+ var listitems = popupEle.querySelectorAll('li.e-list-item:not(.e-virtual-list)');
3919
+ this.listItemHeight = listitems.length > 0 ? Math.ceil(listitems[0].getBoundingClientRect().height) : 0;
3920
+ }
3921
+ if (this.enableVirtualization && !this.list.classList.contains(dropDownBaseClasses.noData)) {
3922
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
3923
+ this.list.appendChild(this.createElement('div', {
3924
+ className: 'e-virtual-ddl-content',
3925
+ styles: this.getTransformValues()
3926
+ })).appendChild(this.list.querySelector('.e-list-parent'));
3927
+ }
3928
+ else {
3929
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3930
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3931
+ }
3932
+ this.UpdateSkeleton();
3933
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
3934
+ this.virtualItemCount = this.itemCount;
3935
+ if (!this.list.querySelector('.e-virtual-ddl')) {
3936
+ var virualElement = this.createElement('div', {
3937
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
3938
+ });
3939
+ popupEle.querySelector('.e-dropdownbase').appendChild(virualElement);
3940
+ }
3941
+ else {
3942
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3943
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
3944
+ }
3945
+ }
3182
3946
  popupEle.style.visibility = 'hidden';
3183
3947
  if (this.popupHeight !== 'auto') {
3184
3948
  this.searchBoxHeight = 0;
3185
- if (!isNullOrUndefined(searchBox.container)) {
3949
+ if (!isNullOrUndefined(searchBox.container) && this.getModuleName() !== 'combobox' && this.getModuleName() !== 'autocomplete') {
3186
3950
  this.searchBoxHeight = (searchBox.container.parentElement).getBoundingClientRect().height;
3187
3951
  this.listHeight = (parseInt(this.listHeight, 10) - (this.searchBoxHeight)).toString() + 'px';
3188
3952
  }
@@ -3204,9 +3968,13 @@ let DropDownList = class DropDownList extends DropDownBase {
3204
3968
  }
3205
3969
  let offsetValue = 0;
3206
3970
  let left;
3971
+ this.isPreventScrollAction = true;
3207
3972
  if (!isNullOrUndefined(this.selectedLI) && (!isNullOrUndefined(this.activeIndex) && this.activeIndex >= 0)) {
3208
3973
  this.setScrollPosition();
3209
3974
  }
3975
+ else if (this.enableVirtualization) {
3976
+ this.setScrollPosition();
3977
+ }
3210
3978
  else {
3211
3979
  this.list.scrollTop = 0;
3212
3980
  }
@@ -3222,6 +3990,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3222
3990
  }
3223
3991
  this.getFocusElement();
3224
3992
  this.createPopup(popupEle, offsetValue, left);
3993
+ this.popupContentElement = this.popupObj.element.querySelector('.e-content');
3225
3994
  this.checkCollision(popupEle);
3226
3995
  if (Browser.isDevice) {
3227
3996
  this.popupObj.element.classList.add(dropDownListClasses.device);
@@ -3253,6 +4022,24 @@ let DropDownList = class DropDownList extends DropDownBase {
3253
4022
  this.wireListEvents();
3254
4023
  }
3255
4024
  this.selectedElementID = this.selectedLI ? this.selectedLI.id : null;
4025
+ if (this.enableVirtualization) {
4026
+ this.notify("bindScrollEvent", {
4027
+ module: "VirtualScroll",
4028
+ component: this.getModuleName(),
4029
+ enable: this.enableVirtualization,
4030
+ });
4031
+ setTimeout(() => {
4032
+ if (this.value) {
4033
+ this.updateSelectionList();
4034
+ if (this.selectedValueInfo && this.viewPortInfo && this.viewPortInfo.offsets.top) {
4035
+ this.list.scrollTop = this.viewPortInfo.offsets.top;
4036
+ }
4037
+ else {
4038
+ this.scrollBottom(true, true);
4039
+ }
4040
+ }
4041
+ }, 5);
4042
+ }
3256
4043
  attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_options' });
3257
4044
  this.inputElement.setAttribute('aria-expanded', 'true');
3258
4045
  const inputParent = this.isFiltering() ? this.filterInput.parentElement : this.inputWrapper.container;
@@ -3300,7 +4087,8 @@ let DropDownList = class DropDownList extends DropDownBase {
3300
4087
  createPopup(element, offsetValue, left) {
3301
4088
  this.popupObj = new Popup(element, {
3302
4089
  width: this.setWidth(), targetType: 'relative',
3303
- relateTo: this.inputWrapper.container, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
4090
+ relateTo: this.inputWrapper.container,
4091
+ collision: this.enableRtl ? { X: 'fit', Y: 'flip' } : { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
3304
4092
  enableRtl: this.enableRtl, offsetX: left,
3305
4093
  position: this.enableRtl ? { X: 'right', Y: 'bottom' } : { X: 'left', Y: 'bottom' },
3306
4094
  zIndex: this.zIndex,
@@ -3386,6 +4174,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3386
4174
  const firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
3387
4175
  const lastItem = this.isEmptyList() ? this.list : this.liCollections[this.getItems().length - 1];
3388
4176
  const liHeight = firstItem.getBoundingClientRect().height;
4177
+ this.listItemHeight = liHeight;
3389
4178
  const listHeight = this.list.offsetHeight / 2;
3390
4179
  const height = isNullOrUndefined(selectedLI) ? firstItem.offsetTop : selectedLI.offsetTop;
3391
4180
  const lastItemOffsetValue = lastItem.offsetTop;
@@ -3396,7 +4185,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3396
4185
  offsetValue = (count - (this.liCollections.length - this.activeIndex)) * liHeight - popupOffset + paddingBottom;
3397
4186
  this.list.scrollTop = selectedLI.offsetTop;
3398
4187
  }
3399
- else if (height > listHeight) {
4188
+ else if (height > listHeight && !this.enableVirtualization) {
3400
4189
  offsetValue = listHeight - liHeight / 2;
3401
4190
  this.list.scrollTop = height - listHeight + liHeight / 2;
3402
4191
  }
@@ -3422,34 +4211,110 @@ let DropDownList = class DropDownList extends DropDownBase {
3422
4211
  }
3423
4212
  return width;
3424
4213
  }
3425
- scrollBottom(isInitial) {
4214
+ scrollBottom(isInitial, isInitialSelection = false, keyAction = null) {
4215
+ if (isNullOrUndefined(this.selectedLI) && this.enableVirtualization) {
4216
+ this.selectedLI = this.list.querySelector('.' + dropDownBaseClasses.li);
4217
+ if (!isNullOrUndefined(this.selectedLI) && this.selectedLI.classList.contains('e-virtual-list')) {
4218
+ this.selectedLI = this.liCollections[this.skeletonCount];
4219
+ }
4220
+ }
3426
4221
  if (!isNullOrUndefined(this.selectedLI)) {
4222
+ this.isUpwardScrolling = false;
4223
+ let virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
4224
+ let lastElementValue = this.list.querySelector('li:last-of-type') ? this.list.querySelector('li:last-of-type').getAttribute('data-value') : null;
4225
+ let selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
3427
4226
  const currentOffset = this.list.offsetHeight;
3428
- const nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
4227
+ let nextBottom = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop;
3429
4228
  let nextOffset = this.list.scrollTop + nextBottom - currentOffset;
3430
- nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
3431
- let boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
4229
+ let isScrollerCHanged = false;
4230
+ nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10);
4231
+ let boxRange = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop;
3432
4232
  boxRange = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
3433
4233
  boxRange - this.fixedHeaderElement.offsetHeight : boxRange;
3434
- if (this.activeIndex === 0) {
4234
+ if (this.activeIndex === 0 && !this.enableVirtualization) {
3435
4235
  this.list.scrollTop = 0;
4236
+ isScrollerCHanged = this.isKeyBoardAction;
3436
4237
  }
3437
4238
  else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
3438
- this.list.scrollTop = nextOffset;
4239
+ let currentElementValue = this.selectedLI ? this.selectedLI.getAttribute('data-value') : null;
4240
+ var liCount = keyAction == "pageDown" ? this.getPageCount() - 2 : 1;
4241
+ if (!this.enableVirtualization || this.isKeyBoardAction || isInitialSelection) {
4242
+ if (this.isKeyBoardAction && this.enableVirtualization && lastElementValue && currentElementValue === lastElementValue && keyAction != "end" && !this.isVirtualScrolling) {
4243
+ this.isPreventKeyAction = true;
4244
+ if (this.enableVirtualization && this.itemTemplate) {
4245
+ this.list.scrollTop += nextOffset;
4246
+ }
4247
+ else {
4248
+ this.list.scrollTop += this.selectedLI.offsetHeight * liCount;
4249
+ }
4250
+ this.isPreventKeyAction = this.IsScrollerAtEnd() ? false : this.isPreventKeyAction;
4251
+ this.isKeyBoardAction = false;
4252
+ this.isPreventScrollAction = false;
4253
+ }
4254
+ else if (this.enableVirtualization && keyAction == "end") {
4255
+ this.isPreventKeyAction = false;
4256
+ this.isKeyBoardAction = false;
4257
+ this.isPreventScrollAction = false;
4258
+ this.list.scrollTop = this.list.scrollHeight;
4259
+ }
4260
+ else {
4261
+ if (keyAction == "pageDown" && this.enableVirtualization && !this.isVirtualScrolling) {
4262
+ this.isPreventKeyAction = false;
4263
+ this.isKeyBoardAction = false;
4264
+ this.isPreventScrollAction = false;
4265
+ nextOffset = nextOffset + (this.selectedLI.offsetHeight * liCount);
4266
+ }
4267
+ this.list.scrollTop = nextOffset;
4268
+ }
4269
+ }
4270
+ else {
4271
+ this.list.scrollTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.virtualListInfo.startIndex * this.listItemHeight : 0;
4272
+ }
4273
+ isScrollerCHanged = this.isKeyBoardAction;
4274
+
3439
4275
  }
4276
+ this.isKeyBoardAction = isScrollerCHanged;
3440
4277
  }
3441
4278
  }
3442
- scrollTop() {
4279
+ scrollTop(keyAction = null) {
3443
4280
  if (!isNullOrUndefined(this.selectedLI)) {
3444
- let nextOffset = this.selectedLI.offsetTop - this.list.scrollTop;
4281
+ let virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
4282
+ let selectedLiOffsetTop = (this.virtualListInfo && this.virtualListInfo.startIndex) ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
4283
+ let nextOffset = selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) - this.list.scrollTop;
4284
+ let 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;
3445
4285
  nextOffset = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
3446
4286
  nextOffset - this.fixedHeaderElement.offsetHeight : nextOffset;
3447
- const boxRange = (this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop);
3448
- if (this.activeIndex === 0) {
4287
+ let boxRange = (selectedLiOffsetTop - (virtualListCount * this.selectedLI.offsetHeight) + this.selectedLI.offsetHeight - this.list.scrollTop);
4288
+ let isPageUpKeyAction = this.enableVirtualization && this.getModuleName() === 'autocomplete' && nextOffset <= 0;
4289
+ if (this.activeIndex === 0 && !this.enableVirtualization) {
3449
4290
  this.list.scrollTop = 0;
3450
4291
  }
3451
- else if (nextOffset < 0) {
3452
- this.list.scrollTop = this.list.scrollTop + nextOffset;
4292
+ else if (nextOffset < 0 || isPageUpKeyAction) {
4293
+ var currentElementValue = this.selectedLI ? this.selectedLI.getAttribute('data-value') : null;
4294
+ var liCount = keyAction == "pageUp" ? this.getPageCount() - 2 : 1;
4295
+ if (this.enableVirtualization && this.isKeyBoardAction && firstElementValue && currentElementValue === firstElementValue && keyAction != "home" && !this.isVirtualScrolling) {
4296
+ this.isUpwardScrolling = true;
4297
+ this.isPreventKeyAction = true;
4298
+ this.list.scrollTop -= this.selectedLI.offsetHeight * liCount;
4299
+ this.isPreventKeyAction = this.list.scrollTop != 0 ? this.isPreventKeyAction : false;
4300
+ this.isKeyBoardAction = false;
4301
+ this.isPreventScrollAction = false;
4302
+ }
4303
+ else if (this.enableVirtualization && keyAction == "home") {
4304
+ this.isPreventScrollAction = false;
4305
+ this.isPreventKeyAction = true;
4306
+ this.isKeyBoardAction = false;
4307
+ this.list.scrollTo(0, 0);
4308
+ }
4309
+ else {
4310
+ if (keyAction == "pageUp" && this.enableVirtualization && !this.isVirtualScrolling) {
4311
+ this.isPreventKeyAction = false;
4312
+ this.isKeyBoardAction = false;
4313
+ this.isPreventScrollAction = false;
4314
+ nextOffset = nextOffset - (this.selectedLI.offsetHeight * liCount);
4315
+ }
4316
+ this.list.scrollTop = this.list.scrollTop + nextOffset;
4317
+ }
3453
4318
  }
3454
4319
  else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
3455
4320
  this.list.scrollTop = this.selectedLI.offsetTop - (this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
@@ -3467,25 +4332,47 @@ let DropDownList = class DropDownList extends DropDownBase {
3467
4332
  return true;
3468
4333
  }
3469
4334
  setScrollPosition(e) {
4335
+ this.isPreventScrollAction = true;
3470
4336
  if (!isNullOrUndefined(e)) {
3471
4337
  switch (e.action) {
3472
4338
  case 'pageDown':
3473
4339
  case 'down':
3474
4340
  case 'end':
3475
- this.scrollBottom();
4341
+ this.isKeyBoardAction = true;
4342
+ this.scrollBottom(false, false, e.action);
3476
4343
  break;
3477
4344
  default:
3478
- this.scrollTop();
4345
+ this.isKeyBoardAction = e.action == 'up' || e.action == 'pageUp' || e.action == 'open';
4346
+ this.scrollTop(e.action);
3479
4347
  break;
3480
4348
  }
3481
4349
  }
3482
4350
  else {
3483
4351
  this.scrollBottom(true);
3484
4352
  }
4353
+ this.isKeyBoardAction = false;
3485
4354
  }
3486
4355
  clearText() {
3487
4356
  this.filterInput.value = this.typedString = '';
3488
4357
  this.searchLists(null);
4358
+ if (this.enableVirtualization) {
4359
+ this.list.scrollTop = 0;
4360
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4361
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
4362
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4363
+ if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
4364
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4365
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
4366
+ }
4367
+ this.getSkeletonCount();
4368
+ this.UpdateSkeleton();
4369
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
4370
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4371
+ if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
4372
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4373
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
4374
+ }
4375
+ }
3489
4376
  }
3490
4377
  setEleWidth(width) {
3491
4378
  if (!isNullOrUndefined(width)) {
@@ -3498,10 +4385,13 @@ let DropDownList = class DropDownList extends DropDownBase {
3498
4385
  }
3499
4386
  }
3500
4387
  closePopup(delay, e) {
4388
+ let isFilterValue = !isNullOrUndefined(this.filterInput) && !isNullOrUndefined(this.filterInput.value) && this.filterInput.value !== '';
4389
+ const typedString = this.getModuleName() === 'combobox' ? this.typedString : null;
3501
4390
  this.isTyped = false;
3502
4391
  if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
3503
4392
  return;
3504
4393
  }
4394
+ this.keyboardEvent = null;
3505
4395
  EventHandler.remove(document, 'mousedown', this.onDocumentClick);
3506
4396
  this.isActive = false;
3507
4397
  this.filterInputObj = null;
@@ -3542,6 +4432,20 @@ let DropDownList = class DropDownList extends DropDownBase {
3542
4432
  if (this.isFiltering()) {
3543
4433
  this.actionCompleteData.isUpdated = false;
3544
4434
  }
4435
+ if (this.enableVirtualization) {
4436
+ if ((this.value == null || this.isTyped)) {
4437
+ this.viewPortInfo.endIndex = this.viewPortInfo && this.viewPortInfo.endIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
4438
+ if (this.getModuleName() === 'autocomplete' || (this.getModuleName() === 'dropdownlist' && !isNullOrUndefined(this.typedString) && this.typedString != "") || (this.getModuleName() === 'combobox' && this.allowFiltering && !isNullOrUndefined(this.typedString) && this.typedString != "")) {
4439
+ this.checkAndResetCache();
4440
+ }
4441
+ }
4442
+ else if (this.getModuleName() === 'autocomplete') {
4443
+ this.checkAndResetCache();
4444
+ }
4445
+ if ((this.getModuleName() === 'dropdownlist' || this.getModuleName() === 'combobox') && !(this.skeletonCount == 0)) {
4446
+ this.getSkeletonCount(true);
4447
+ }
4448
+ }
3545
4449
  this.beforePopupOpen = false;
3546
4450
  const animModel = {
3547
4451
  name: 'FadeOut',
@@ -3572,6 +4476,46 @@ let DropDownList = class DropDownList extends DropDownBase {
3572
4476
  if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
3573
4477
  this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
3574
4478
  }
4479
+ const dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
4480
+ if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
4481
+ this.updateInitialData();
4482
+ this.checkAndResetCache();
4483
+ }
4484
+ }
4485
+ updateInitialData() {
4486
+ let currentData = this.selectData;
4487
+ let ulElement = this.renderItems(currentData, this.fields);
4488
+ this.list.scrollTop = 0;
4489
+ this.virtualListInfo = {
4490
+ currentPageNumber: null,
4491
+ direction: null,
4492
+ sentinelInfo: {},
4493
+ offsets: {},
4494
+ startIndex: 0,
4495
+ endIndex: 0,
4496
+ };
4497
+ if (this.getModuleName() === 'combobox') {
4498
+ this.typedString = "";
4499
+ }
4500
+ this.previousStartIndex = 0;
4501
+ this.previousEndIndex = 0;
4502
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4503
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
4504
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4505
+ if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
4506
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4507
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
4508
+ }
4509
+ this.getSkeletonCount();
4510
+ this.UpdateSkeleton();
4511
+ this.listData = currentData;
4512
+ this.updateActionCompleteDataValues(ulElement, currentData);
4513
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
4514
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4515
+ if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
4516
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4517
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
4518
+ }
3575
4519
  }
3576
4520
  destroyPopup() {
3577
4521
  this.isPopupOpen = false;
@@ -3658,10 +4602,10 @@ let DropDownList = class DropDownList extends DropDownBase {
3658
4602
  this.element.id = id;
3659
4603
  this.hiddenElement.id = id + '_hidden';
3660
4604
  this.targetElement().setAttribute('tabindex', this.tabIndex);
3661
- if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
4605
+ if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') && !this.readonly) {
3662
4606
  this.inputElement.setAttribute('aria-label', this.getModuleName());
3663
4607
  }
3664
- else {
4608
+ else if (this.getModuleName() === 'dropdownlist') {
3665
4609
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
3666
4610
  }
3667
4611
  attributes(this.targetElement(), this.getAriaAttributes());
@@ -3671,7 +4615,16 @@ let DropDownList = class DropDownList extends DropDownBase {
3671
4615
  this.inputElement.removeAttribute('aria-labelledby');
3672
4616
  }
3673
4617
  if (this.value !== null || this.activeIndex !== null || this.text !== null) {
4618
+ if (this.enableVirtualization) {
4619
+ this.listItemHeight = this.getListHeight();
4620
+ this.getSkeletonCount();
4621
+ this.updateVirtualizationProperties(this.itemCount, this.allowFiltering);
4622
+ }
3674
4623
  this.initValue();
4624
+ this.selectedValueInfo = this.viewPortInfo;
4625
+ if (this.enableVirtualization) {
4626
+ this.activeIndex = this.activeIndex + this.skeletonCount;
4627
+ }
3675
4628
  }
3676
4629
  else if (this.element.tagName === 'SELECT' && this.element.options[0]) {
3677
4630
  const selectElement = this.element;
@@ -3707,6 +4660,29 @@ let DropDownList = class DropDownList extends DropDownBase {
3707
4660
  attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
3708
4661
  }
3709
4662
  this.renderComplete();
4663
+ this.listItemHeight = this.getListHeight();
4664
+ this.getSkeletonCount();
4665
+ if (this.enableVirtualization) {
4666
+ this.updateVirtualizationProperties(this.itemCount, this.allowFiltering);
4667
+ }
4668
+ this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
4669
+ this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.viewPortInfo.startIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
4670
+ }
4671
+ getListHeight() {
4672
+ let listParent = this.createElement('div', {
4673
+ className: 'e-dropdownbase'
4674
+ });
4675
+ let item = this.createElement('li', {
4676
+ className: 'e-list-item'
4677
+ });
4678
+ let listParentHeight = formatUnit(this.popupHeight);
4679
+ listParent.style.height = (parseInt(listParentHeight, 10)).toString() + 'px';
4680
+ listParent.appendChild(item);
4681
+ document.body.appendChild(listParent);
4682
+ this.virtualListHeight = listParent.getBoundingClientRect().height;
4683
+ let listItemHeight = Math.ceil(item.getBoundingClientRect().height);
4684
+ listParent.remove();
4685
+ return listItemHeight;
3710
4686
  }
3711
4687
  setFooterTemplate(popupEle) {
3712
4688
  let compiledString;
@@ -3849,7 +4825,10 @@ let DropDownList = class DropDownList extends DropDownBase {
3849
4825
  for (const prop of Object.keys(newProp)) {
3850
4826
  switch (prop) {
3851
4827
  case 'query':
3852
- case 'dataSource': break;
4828
+ case 'dataSource':
4829
+ this.getSkeletonCount();
4830
+ this.checkAndResetCache();
4831
+ break;
3853
4832
  case 'htmlAttributes':
3854
4833
  this.setHTMLAttributes();
3855
4834
  break;
@@ -4137,7 +5116,23 @@ let DropDownList = class DropDownList extends DropDownBase {
4137
5116
  this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
4138
5117
  this.renderList(e);
4139
5118
  }
5119
+ if (this.enableVirtualization && this.listData && this.listData.length) {
5120
+ if (!isNullOrUndefined(this.value) && (this.getModuleName() === 'dropdownlist' || this.getModuleName() === 'combobox')) {
5121
+ this.removeHover();
5122
+ }
5123
+ if (!this.beforePopupOpen) {
5124
+ this.notify("setCurrentViewDataAsync", {
5125
+ module: "VirtualScroll",
5126
+ });
5127
+ }
5128
+ }
4140
5129
  this.invokeRenderPopup(e);
5130
+ if (this.enableVirtualization && !this.allowFiltering && this.selectedValueInfo != null && this.selectedValueInfo.startIndex > 0 && this.value != null) {
5131
+ this.notify("dataProcessAsync", {
5132
+ module: "VirtualScroll",
5133
+ isOpen: true,
5134
+ });
5135
+ }
4141
5136
  }
4142
5137
  invokeRenderPopup(e) {
4143
5138
  if (Browser.isDevice && this.isFilterLayout()) {
@@ -4231,7 +5226,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4231
5226
  if (!this.enabled) {
4232
5227
  return;
4233
5228
  }
4234
- this.isTyped = true;
5229
+ if (!this.enableVirtualization && this.getModuleName() === 'combobox') {
5230
+ this.isTyped = true;
5231
+ }
4235
5232
  this.hidePopup(e);
4236
5233
  if (this.targetElement()) {
4237
5234
  this.targetElement().blur();
@@ -4287,6 +5284,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4287
5284
  this.ulElement = null;
4288
5285
  this.list = null;
4289
5286
  this.popupObj = null;
5287
+ this.popupContentElement = null;
4290
5288
  this.rippleFun = null;
4291
5289
  this.selectedLI = null;
4292
5290
  this.liCollections = null;
@@ -4384,6 +5382,9 @@ __decorate$1([
4384
5382
  __decorate$1([
4385
5383
  Property(false)
4386
5384
  ], DropDownList.prototype, "readonly", void 0);
5385
+ __decorate$1([
5386
+ Property(false)
5387
+ ], DropDownList.prototype, "enableVirtualization", void 0);
4387
5388
  __decorate$1([
4388
5389
  Property(null)
4389
5390
  ], DropDownList.prototype, "text", void 0);
@@ -7839,14 +8840,18 @@ let ComboBox = class ComboBox extends DropDownList {
7839
8840
  if (!isNaN(height) && this.getModuleName() !== 'autocomplete') {
7840
8841
  this.removeFocus();
7841
8842
  const fixedHead = this.fields.groupBy ? this.liCollections[0].offsetHeight : 0;
7842
- this.list.scrollTop = count * height + fixedHead;
8843
+ if (!this.enableVirtualization) {
8844
+ this.list.scrollTop = count * height + fixedHead;
8845
+ }
7843
8846
  addClass([activeElement], dropDownListClasses.focus);
7844
8847
  }
7845
8848
  }
7846
8849
  else {
7847
8850
  if (this.isSelectCustom && this.inputElement.value.trim() !== '') {
7848
8851
  this.removeFocus();
7849
- this.list.scrollTop = 0;
8852
+ if (!this.enableVirtualization) {
8853
+ this.list.scrollTop = 0;
8854
+ }
7850
8855
  }
7851
8856
  }
7852
8857
  return activeElement;
@@ -7982,7 +8987,9 @@ let ComboBox = class ComboBox extends DropDownList {
7982
8987
  else if (this.inputElement.value === '') {
7983
8988
  this.activeIndex = null;
7984
8989
  if (!isNullOrUndefined(this.list)) {
7985
- this.list.scrollTop = 0;
8990
+ if (!this.enableVirtualization) {
8991
+ this.list.scrollTop = 0;
8992
+ }
7986
8993
  const focusItem = this.list.querySelector('.' + dropDownListClasses.li);
7987
8994
  this.setHoverList(focusItem);
7988
8995
  }
@@ -8521,7 +9528,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
8521
9528
  filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
8522
9529
  }
8523
9530
  }
8524
- if (!isNullOrUndefined(this.suggestionCount)) {
9531
+ if (!isNullOrUndefined(this.suggestionCount) && !this.enableVirtualization) {
8525
9532
  // Since defualt value of suggestioncount is 20, checked the condition
8526
9533
  if (this.suggestionCount !== 20) {
8527
9534
  for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
@@ -8532,11 +9539,18 @@ let AutoComplete = class AutoComplete extends ComboBox {
8532
9539
  }
8533
9540
  filterQuery.take(this.suggestionCount);
8534
9541
  }
9542
+ if (this.enableVirtualization) {
9543
+ var takeValue = this.getTakeValue();
9544
+ filterQuery.skip(this.virtualItemStartIndex);
9545
+ filterQuery.take(takeValue);
9546
+ filterQuery.requiresCount();
9547
+ }
8535
9548
  return filterQuery;
8536
9549
  }
8537
9550
  searchLists(e) {
8538
9551
  this.isTyped = true;
8539
9552
  this.isDataFetched = this.isSelectCustom = false;
9553
+ this.checkAndResetCache();
8540
9554
  if (isNullOrUndefined(this.list)) {
8541
9555
  super.renderList(e, true);
8542
9556
  }
@@ -8583,8 +9597,32 @@ let AutoComplete = class AutoComplete extends ComboBox {
8583
9597
  }
8584
9598
  filterAction(dataSource, query, fields, e) {
8585
9599
  this.beforePopupOpen = true;
9600
+ let isNoDataElement = this.list.classList.contains('e-nodata');
8586
9601
  if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
9602
+ if (this.enableVirtualization && this.isFiltering() && this.isTyped) {
9603
+ this.isPreventScrollAction = true;
9604
+ this.list.scrollTop = 0;
9605
+ this.previousStartIndex = 0;
9606
+ this.virtualListInfo = null;
9607
+ }
8587
9608
  this.resetList(dataSource, fields, query, e);
9609
+ if (this.enableVirtualization && isNoDataElement && !this.list.classList.contains('e-nodata')) {
9610
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
9611
+ this.list.appendChild(this.createElement('div', {
9612
+ className: 'e-virtual-ddl-content',
9613
+ styles: this.getTransformValues()
9614
+ })).appendChild(this.list.querySelector('.e-list-parent'));
9615
+ }
9616
+ if (!this.list.querySelector('.e-virtual-ddl')) {
9617
+ var virualElement = this.createElement('div', {
9618
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
9619
+ });
9620
+ document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
9621
+ }
9622
+ }
9623
+ if (this.enableVirtualization) {
9624
+ this.getFilteringSkeletonCount();
9625
+ }
8588
9626
  }
8589
9627
  else {
8590
9628
  this.hidePopup(e);
@@ -8595,6 +9633,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
8595
9633
  clearAll(e, property) {
8596
9634
  if (isNullOrUndefined(property) || (!isNullOrUndefined(property) && isNullOrUndefined(property.dataSource))) {
8597
9635
  super.clearAll(e);
9636
+ this.checkAndResetCache();
8598
9637
  }
8599
9638
  if (this.beforePopupOpen) {
8600
9639
  this.hidePopup();
@@ -8676,7 +9715,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
8676
9715
  return true;
8677
9716
  }
8678
9717
  renderPopup(e) {
8679
- this.list.scrollTop = 0;
9718
+ if (!this.enableVirtualization) {
9719
+ this.list.scrollTop = 0;
9720
+ }
8680
9721
  super.renderPopup(e);
8681
9722
  }
8682
9723
  isEditTextBox() {
@@ -8744,6 +9785,10 @@ let AutoComplete = class AutoComplete extends ComboBox {
8744
9785
  hidePopup(e) {
8745
9786
  super.hidePopup(e);
8746
9787
  this.activeIndex = null;
9788
+ this.virtualListInfo = this.viewPortInfo;
9789
+ this.previousStartIndex = this.viewPortInfo.startIndex;
9790
+ this.startIndex = this.viewPortInfo.startIndex;
9791
+ this.previousEndIndex = this.viewPortInfo.endIndex;
8747
9792
  }
8748
9793
  /**
8749
9794
  * Dynamically change the value of properties.
@@ -9261,6 +10306,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9261
10306
  if (this.isFirstClick) {
9262
10307
  this.loadTemplate();
9263
10308
  }
10309
+ if (this.mode === 'CheckBox' && this.showSelectAll) {
10310
+ EventHandler.add(this.popupObj.element, 'click', this.clickHandler, this);
10311
+ }
9264
10312
  }
9265
10313
  });
9266
10314
  }
@@ -10266,11 +11314,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10266
11314
  }
10267
11315
  spaceKeySelection(e) {
10268
11316
  if (this.mode === 'CheckBox') {
10269
- if (!document.activeElement.classList.contains(FILTERINPUT)) {
11317
+ const li = this.list.querySelector('li.' + dropDownBaseClasses.focus);
11318
+ const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
11319
+ if (!isNullOrUndefined(li) || (selectAllParent && selectAllParent.classList.contains('e-item-focus'))) {
10270
11320
  e.preventDefault();
10271
11321
  this.keyAction = true;
10272
11322
  }
10273
11323
  this.selectByKey(e);
11324
+ if (this.keyAction) {
11325
+ const li = this.list.querySelector('li.' + dropDownBaseClasses.focus);
11326
+ if (!isNullOrUndefined(li) && selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
11327
+ li.classList.remove('e-item-focus');
11328
+ }
11329
+ }
10274
11330
  }
10275
11331
  this.checkPlaceholderSize();
10276
11332
  }
@@ -10426,9 +11482,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10426
11482
  }
10427
11483
  }
10428
11484
  const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
10429
- if (selectAllParent && !selectAllParent.classList.contains('e-item-focus')) {
10430
- e.preventDefault();
10431
- }
10432
11485
  if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
10433
11486
  const selectAllCheckBox = selectAllParent.childNodes[0];
10434
11487
  if (!selectAllCheckBox.classList.contains('e-check')) {
@@ -10501,6 +11554,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10501
11554
  }
10502
11555
  this.updateAriaAttribute();
10503
11556
  }
11557
+ clickHandler(e) {
11558
+ const targetElement = e.target;
11559
+ const filterInputClassName = targetElement.className;
11560
+ const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
11561
+ if ((filterInputClassName === 'e-input-filter e-input' || filterInputClassName === 'e-input-group e-control-wrapper e-input-focus') && selectAllParent.classList.contains('e-item-focus')) {
11562
+ selectAllParent.classList.remove('e-item-focus');
11563
+ }
11564
+ }
10504
11565
  moveByList(position) {
10505
11566
  if (this.list) {
10506
11567
  let elements = this.list.querySelectorAll('li.'
@@ -10515,12 +11576,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10515
11576
  let temp = -1;
10516
11577
  const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
10517
11578
  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) {
10518
- selectAllParent.classList.add('e-item-focus');
11579
+ if (!this.focusFirstListItem && selectAllParent.classList.contains('e-item-focus')) {
11580
+ selectAllParent.classList.remove('e-item-focus');
11581
+ }
11582
+ else if (!selectAllParent.classList.contains('e-item-focus')) {
11583
+ selectAllParent.classList.add('e-item-focus');
11584
+ }
10519
11585
  }
10520
11586
  else if (elements.length) {
10521
- if (this.mode === 'CheckBox' && this.showSelectAll && !isNullOrUndefined(selectAllParent)) {
10522
- selectAllParent.classList.remove('e-item-focus');
10523
- if (this.showSelectAll && position == -1 && !isNullOrUndefined(selectAllParent) && this.liCollections.length > 1 && (this.focusFirstListItem || this.list.getElementsByClassName('e-item-focus').length == 0)) {
11587
+ if (this.mode === 'CheckBox' && this.showSelectAll && !isNullOrUndefined(selectAllParent && position == -1)) {
11588
+ if (!this.focusFirstListItem && selectAllParent.classList.contains('e-item-focus')) {
11589
+ selectAllParent.classList.remove('e-item-focus');
11590
+ }
11591
+ else if (this.focusFirstListItem && !selectAllParent.classList.contains('e-item-focus')) {
10524
11592
  selectAllParent.classList.add('e-item-focus');
10525
11593
  }
10526
11594
  }
@@ -11115,7 +12183,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11115
12183
  this.popupObj = new Popup(this.popupWrapper, {
11116
12184
  width: this.calcPopupWidth(), targetType: 'relative',
11117
12185
  position: this.enableRtl ? { X: 'right', Y: 'bottom' } : { X: 'left', Y: 'bottom' },
11118
- relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
12186
+ relateTo: this.overAllWrapper,
12187
+ collision: this.enableRtl ? { X: 'fit', Y: 'flip' } : { X: 'flip', Y: 'flip' }, offsetY: 1,
11119
12188
  enableRtl: this.enableRtl, zIndex: this.zIndex,
11120
12189
  close: () => {
11121
12190
  if (this.popupObj.element.parentElement) {
@@ -12779,6 +13848,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12779
13848
  this.popupObj.hide();
12780
13849
  removeClass([document.body, this.popupObj.element], 'e-popup-full-page');
12781
13850
  EventHandler.remove(this.list, 'keydown', this.onKeyDown);
13851
+ if (this.mode === 'CheckBox' && this.showSelectAll) {
13852
+ EventHandler.remove(this.popupObj.element, 'click', this.clickHandler);
13853
+ }
12782
13854
  }
12783
13855
  });
12784
13856
  }
@@ -13537,7 +14609,7 @@ class CheckBoxSelection {
13537
14609
  }
13538
14610
  clickHandler(e) {
13539
14611
  let target;
13540
- if (e.currentTarget.classList.contains(this.checkAllParent.className)) {
14612
+ if (e.currentTarget.classList.contains(this.checkAllParent.className) || (e.currentTarget.classList.value === this.checkAllParent.className)) {
13541
14613
  target = e.currentTarget.firstElementChild.lastElementChild;
13542
14614
  }
13543
14615
  else {
@@ -16911,7 +17983,9 @@ let Mention = class Mention extends DropDownBase {
16911
17983
  this.trigger('opened', eventArgs, (eventArgs) => {
16912
17984
  if (!eventArgs.cancel) {
16913
17985
  this.renderReactTemplates();
16914
- this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.inputElement : null);
17986
+ if (this.popupObj) {
17987
+ this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.inputElement : null);
17988
+ }
16915
17989
  if (isNullOrUndefined(this.getTriggerCharPosition())) {
16916
17990
  return;
16917
17991
  }
@@ -17620,6 +18694,11 @@ let Mention = class Mention extends DropDownBase {
17620
18694
  if (this.inputElement && !this.inputElement.classList.contains('e-' + this.getModuleName())) {
17621
18695
  return;
17622
18696
  }
18697
+ this.previousSelectedLI = null;
18698
+ this.item = null;
18699
+ this.selectedLI = null;
18700
+ this.inputElement.innerText = null;
18701
+ this.popupObj = null;
17623
18702
  super.destroy();
17624
18703
  }
17625
18704
  getLocaleName() {
@@ -17749,5 +18828,5 @@ Mention = __decorate$7([
17749
18828
  * export all modules from current location
17750
18829
  */
17751
18830
 
17752
- 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 };
18831
+ 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 };
17753
18832
  //# sourceMappingURL=ej2-dropdowns.es2015.js.map