@syncfusion/ej2-dropdowns 24.2.8 → 25.1.35

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 (110) hide show
  1. package/CHANGELOG.md +23 -150
  2. package/dist/ej2-dropdowns.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-dropdowns.es2015.js +2049 -528
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +2072 -533
  8. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  9. package/dist/global/ej2-dropdowns.min.js +2 -2
  10. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/auto-complete/auto-complete-model.d.ts +3 -1
  14. package/src/auto-complete/auto-complete.d.ts +2 -0
  15. package/src/auto-complete/auto-complete.js +51 -6
  16. package/src/combo-box/combo-box-model.d.ts +11 -2
  17. package/src/combo-box/combo-box.d.ts +10 -2
  18. package/src/combo-box/combo-box.js +75 -16
  19. package/src/common/interface.d.ts +32 -0
  20. package/src/common/virtual-scroll.d.ts +1 -3
  21. package/src/common/virtual-scroll.js +157 -27
  22. package/src/drop-down-base/drop-down-base-model.d.ts +1 -1
  23. package/src/drop-down-base/drop-down-base.d.ts +65 -5
  24. package/src/drop-down-base/drop-down-base.js +242 -25
  25. package/src/drop-down-list/drop-down-list-model.d.ts +10 -1
  26. package/src/drop-down-list/drop-down-list.d.ts +16 -51
  27. package/src/drop-down-list/drop-down-list.js +180 -217
  28. package/src/drop-down-tree/drop-down-tree-model.d.ts +16 -12
  29. package/src/drop-down-tree/drop-down-tree.d.ts +13 -3
  30. package/src/drop-down-tree/drop-down-tree.js +55 -49
  31. package/src/global.js +1 -1
  32. package/src/list-box/list-box.js +9 -4
  33. package/src/mention/mention.d.ts +2 -0
  34. package/src/mention/mention.js +21 -9
  35. package/src/multi-select/checkbox-selection.js +8 -2
  36. package/src/multi-select/float-label.d.ts +5 -5
  37. package/src/multi-select/index.d.ts +1 -0
  38. package/src/multi-select/index.js +1 -0
  39. package/src/multi-select/interface.d.ts +1 -0
  40. package/src/multi-select/multi-select-model.d.ts +17 -2
  41. package/src/multi-select/multi-select.d.ts +34 -4
  42. package/src/multi-select/multi-select.js +1271 -173
  43. package/styles/auto-complete/_bds-definition.scss +2 -0
  44. package/styles/bootstrap-dark.css +8 -2
  45. package/styles/bootstrap.css +8 -2
  46. package/styles/bootstrap4.css +3 -2
  47. package/styles/bootstrap5-dark.css +3 -2
  48. package/styles/bootstrap5.css +3 -2
  49. package/styles/combo-box/_bds-definition.scss +2 -0
  50. package/styles/drop-down-base/_bds-definition.scss +134 -0
  51. package/styles/drop-down-list/_bds-definition.scss +134 -0
  52. package/styles/drop-down-list/_layout.scss +1 -1
  53. package/styles/drop-down-list/bootstrap-dark.css +1 -1
  54. package/styles/drop-down-list/bootstrap.css +1 -1
  55. package/styles/drop-down-list/bootstrap4.css +1 -1
  56. package/styles/drop-down-list/bootstrap5-dark.css +1 -1
  57. package/styles/drop-down-list/bootstrap5.css +1 -1
  58. package/styles/drop-down-list/fabric-dark.css +1 -1
  59. package/styles/drop-down-list/fabric.css +1 -1
  60. package/styles/drop-down-list/fluent-dark.css +1 -1
  61. package/styles/drop-down-list/fluent.css +1 -1
  62. package/styles/drop-down-list/highcontrast-light.css +1 -1
  63. package/styles/drop-down-list/highcontrast.css +1 -1
  64. package/styles/drop-down-list/icons/_bds.scss +14 -0
  65. package/styles/drop-down-list/material-dark.css +1 -1
  66. package/styles/drop-down-list/material.css +1 -1
  67. package/styles/drop-down-list/material3-dark.css +1 -1
  68. package/styles/drop-down-list/material3.css +1 -1
  69. package/styles/drop-down-list/tailwind-dark.css +1 -1
  70. package/styles/drop-down-list/tailwind.css +1 -1
  71. package/styles/drop-down-tree/_bds-definition.scss +61 -0
  72. package/styles/drop-down-tree/icons/_bds.scss +11 -0
  73. package/styles/fabric-dark.css +4 -2
  74. package/styles/fabric.css +4 -2
  75. package/styles/fluent-dark.css +8 -2
  76. package/styles/fluent.css +8 -2
  77. package/styles/highcontrast-light.css +4 -2
  78. package/styles/highcontrast.css +4 -2
  79. package/styles/list-box/_bds-definition.scss +136 -0
  80. package/styles/list-box/icons/_bds.scss +25 -0
  81. package/styles/material-dark.css +3 -2
  82. package/styles/material.css +3 -2
  83. package/styles/material3-dark.css +3 -2
  84. package/styles/material3.css +3 -2
  85. package/styles/mention/_bds-definition.scss +1 -0
  86. package/styles/multi-select/_bds-definition.scss +235 -0
  87. package/styles/multi-select/_bootstrap-dark-definition.scss +4 -0
  88. package/styles/multi-select/_bootstrap-definition.scss +4 -0
  89. package/styles/multi-select/_fluent-definition.scss +5 -0
  90. package/styles/multi-select/_layout.scss +8 -1
  91. package/styles/multi-select/bootstrap-dark.css +7 -1
  92. package/styles/multi-select/bootstrap.css +7 -1
  93. package/styles/multi-select/bootstrap4.css +2 -1
  94. package/styles/multi-select/bootstrap5-dark.css +2 -1
  95. package/styles/multi-select/bootstrap5.css +2 -1
  96. package/styles/multi-select/fabric-dark.css +3 -1
  97. package/styles/multi-select/fabric.css +3 -1
  98. package/styles/multi-select/fluent-dark.css +7 -1
  99. package/styles/multi-select/fluent.css +7 -1
  100. package/styles/multi-select/highcontrast-light.css +3 -1
  101. package/styles/multi-select/highcontrast.css +3 -1
  102. package/styles/multi-select/icons/_bds.scss +26 -0
  103. package/styles/multi-select/material-dark.css +2 -1
  104. package/styles/multi-select/material.css +2 -1
  105. package/styles/multi-select/material3-dark.css +2 -1
  106. package/styles/multi-select/material3.css +2 -1
  107. package/styles/multi-select/tailwind-dark.css +2 -1
  108. package/styles/multi-select/tailwind.css +2 -1
  109. package/styles/tailwind-dark.css +3 -2
  110. package/styles/tailwind.css +3 -2
@@ -104,8 +104,12 @@ var MultiSelect = /** @class */ (function (_super) {
104
104
  _this.selectAllEventEle = [];
105
105
  _this.resetMainList = null;
106
106
  _this.resetFilteredData = false;
107
+ _this.preventSetCurrentData = false;
107
108
  _this.scrollFocusStatus = false;
108
109
  _this.keyDownStatus = false;
110
+ _this.IsScrollerAtEnd = function () {
111
+ return this.list && this.list.scrollTop + this.list.clientHeight >= this.list.scrollHeight;
112
+ };
109
113
  return _this;
110
114
  }
111
115
  MultiSelect.prototype.enableRTL = function (state) {
@@ -122,6 +126,9 @@ var MultiSelect = /** @class */ (function (_super) {
122
126
  };
123
127
  MultiSelect.prototype.requiredModules = function () {
124
128
  var modules = [];
129
+ if (this.enableVirtualization) {
130
+ modules.push({ args: [this], member: 'VirtualScroll' });
131
+ }
125
132
  if (this.mode === 'CheckBox') {
126
133
  this.isGroupChecking = this.enableGroupCheckBox;
127
134
  if (this.enableGroupCheckBox) {
@@ -262,6 +269,9 @@ var MultiSelect = /** @class */ (function (_super) {
262
269
  attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_popup', 'aria-controls': _this.element.id });
263
270
  _this.updateAriaActiveDescendant();
264
271
  if (_this.isFirstClick) {
272
+ if (_this.enableVirtualization && _this.mode === 'CheckBox' && _this.value) {
273
+ _this.updateVirtualReOrderList();
274
+ }
265
275
  _this.loadTemplate();
266
276
  }
267
277
  if (_this.mode === 'CheckBox' && _this.showSelectAll) {
@@ -270,6 +280,33 @@ var MultiSelect = /** @class */ (function (_super) {
270
280
  }
271
281
  });
272
282
  };
283
+ MultiSelect.prototype.updateVirtualReOrderList = function (isCheckBoxUpdate) {
284
+ var query = this.getForQuery(this.value, true).clone();
285
+ this.resetList(this.dataSource, this.fields, query);
286
+ this.UpdateSkeleton();
287
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
288
+ this.virtualItemCount = this.itemCount;
289
+ if (this.mode !== 'CheckBox') {
290
+ this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length : this.totalItemCount;
291
+ }
292
+ if (!this.list.querySelector('.e-virtual-ddl')) {
293
+ var virualElement = this.createElement('div', {
294
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
295
+ });
296
+ this.popupWrapper.querySelector('.e-dropdownbase').appendChild(virualElement);
297
+ }
298
+ else {
299
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
300
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
301
+ }
302
+ if (this.list.querySelector('.e-virtual-ddl-content')) {
303
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
304
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
305
+ }
306
+ if (isCheckBoxUpdate) {
307
+ this.loadTemplate();
308
+ }
309
+ };
273
310
  MultiSelect.prototype.updateListItems = function (listItems, mainListItems) {
274
311
  for (var i = 0; i < listItems.length; i++) {
275
312
  this.findGroupStart(listItems[i]);
@@ -279,19 +316,33 @@ var MultiSelect = /** @class */ (function (_super) {
279
316
  };
280
317
  MultiSelect.prototype.loadTemplate = function () {
281
318
  this.refreshListItems(null);
319
+ if (this.enableVirtualization && this.list && this.mode === 'CheckBox') {
320
+ var reOrderList = this.list.querySelectorAll('.e-reorder')[0];
321
+ if (this.list.querySelector('.e-virtual-ddl-content') && reOrderList) {
322
+ this.list.querySelector('.e-virtual-ddl-content').removeChild(reOrderList);
323
+ }
324
+ }
282
325
  if (this.mode === 'CheckBox') {
283
326
  this.removeFocus();
284
327
  }
285
328
  this.notify('reOrder', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', e: this });
329
+ this.isPreventScrollAction = true;
286
330
  };
287
331
  MultiSelect.prototype.setScrollPosition = function () {
288
332
  if (((!this.hideSelectedItem && this.mode !== 'CheckBox') || (this.mode === 'CheckBox' && !this.enableSelectionOrder)) &&
289
333
  (!isNullOrUndefined(this.value) && (this.value.length > 0))) {
290
- var valueEle = this.findListElement((this.hideSelectedItem ? this.ulElement : this.list), 'li', 'data-value', this.value[this.value.length - 1]);
334
+ var value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[this.value.length - 1]) : this.value[this.value.length - 1];
335
+ var valueEle = this.findListElement((this.hideSelectedItem ? this.ulElement : this.list), 'li', 'data-value', value);
291
336
  if (!isNullOrUndefined(valueEle)) {
292
337
  this.scrollBottom(valueEle);
293
338
  }
294
339
  }
340
+ if (this.enableVirtualization) {
341
+ var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
342
+ if (focusedItem) {
343
+ this.scrollBottom(focusedItem);
344
+ }
345
+ }
295
346
  };
296
347
  MultiSelect.prototype.focusAtFirstListItem = function () {
297
348
  if (this.ulElement && this.ulElement.querySelector('li.'
@@ -302,9 +353,15 @@ var MultiSelect = /** @class */ (function (_super) {
302
353
  return;
303
354
  }
304
355
  else {
305
- element = this.ulElement.querySelector('li.'
306
- + dropDownBaseClasses.li + ':not(.'
307
- + HIDE_LIST + ')');
356
+ if (this.enableVirtualization) {
357
+ element = this.ulElement.querySelector('li.'
358
+ + dropDownBaseClasses.li + ':not(.e-virtual-list)' + ':not(.e-hide-listitem)');
359
+ }
360
+ else {
361
+ element = this.ulElement.querySelector('li.'
362
+ + dropDownBaseClasses.li + ':not(.'
363
+ + HIDE_LIST + ')');
364
+ }
308
365
  }
309
366
  if (element !== null) {
310
367
  this.removeFocus();
@@ -319,7 +376,8 @@ var MultiSelect = /** @class */ (function (_super) {
319
376
  }
320
377
  else {
321
378
  if (this.value && this.value.length) {
322
- Search(this.value[this.value.length - 1], this.liCollections, 'StartsWith', this.ignoreCase);
379
+ var value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), this.value[this.value.length - 1]) : this.value[this.value.length - 1];
380
+ Search(value, this.liCollections, 'StartsWith', this.ignoreCase);
323
381
  }
324
382
  else {
325
383
  activeElement = null;
@@ -327,7 +385,7 @@ var MultiSelect = /** @class */ (function (_super) {
327
385
  }
328
386
  if (activeElement && activeElement.item !== null) {
329
387
  this.addListFocus(activeElement.item);
330
- if (((this.allowCustomValue || this.allowFiltering) && this.isPopupOpen() && this.closePopupOnSelect) || this.closePopupOnSelect) {
388
+ if (((this.allowCustomValue || this.allowFiltering) && this.isPopupOpen() && this.closePopupOnSelect && !this.enableVirtualization) || this.closePopupOnSelect && !this.enableVirtualization) {
331
389
  this.scrollBottom(activeElement.item, activeElement.index);
332
390
  }
333
391
  }
@@ -369,9 +427,9 @@ var MultiSelect = /** @class */ (function (_super) {
369
427
  var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP);
370
428
  var value = elements[elements.length - 1].getAttribute('data-value');
371
429
  if (!isNullOrUndefined(this.value)) {
372
- this.tempValues = this.value.slice();
430
+ this.tempValues = this.allowObjectBinding ? this.value.slice() : this.value.slice();
373
431
  }
374
- var customValue = this.getFormattedValue(value);
432
+ var customValue = this.allowObjectBinding ? this.getDataByValue(value) : this.getFormattedValue(value);
375
433
  if (this.allowCustomValue && (value !== 'false' && customValue === false || (!isNullOrUndefined(customValue) &&
376
434
  customValue.toString() === 'NaN'))) {
377
435
  customValue = value;
@@ -397,15 +455,43 @@ var MultiSelect = /** @class */ (function (_super) {
397
455
  }
398
456
  return this.targetInputElement.value;
399
457
  };
400
- MultiSelect.prototype.getForQuery = function (valuecheck) {
458
+ MultiSelect.prototype.getForQuery = function (valuecheck, isCheckbox) {
401
459
  var predicate;
402
460
  var field = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
403
- for (var i = 0; i < valuecheck.length; i++) {
404
- if (i === 0) {
405
- predicate = new Predicate(field, 'equal', valuecheck[i]);
461
+ if (this.enableVirtualization) {
462
+ if (isCheckbox) {
463
+ for (var i = 0; i < valuecheck.length; i++) {
464
+ var value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', valuecheck[i]) : valuecheck[i];
465
+ if (i === 0) {
466
+ predicate = new Predicate(field, 'equal', value);
467
+ }
468
+ else {
469
+ predicate = predicate.or(field, 'equal', value);
470
+ }
471
+ }
472
+ return new Query().where(predicate);
406
473
  }
407
474
  else {
408
- predicate = predicate.or(field, 'equal', valuecheck[i]);
475
+ for (var i = 0; i < valuecheck.length; i++) {
476
+ var value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', valuecheck[i]) : valuecheck[i];
477
+ if (i === 0) {
478
+ predicate = new Predicate(field, 'notequal', value);
479
+ }
480
+ else {
481
+ predicate = predicate.and(field, 'notequal', value);
482
+ }
483
+ }
484
+ return new Query().where(predicate);
485
+ }
486
+ }
487
+ else {
488
+ for (var i = 0; i < valuecheck.length; i++) {
489
+ if (i === 0) {
490
+ predicate = new Predicate(field, 'equal', valuecheck[i]);
491
+ }
492
+ else {
493
+ predicate = predicate.or(field, 'equal', valuecheck[i]);
494
+ }
409
495
  }
410
496
  }
411
497
  if (this.dataSource instanceof DataManager && this.dataSource.adaptor instanceof JsonAdaptor) {
@@ -417,14 +503,20 @@ var MultiSelect = /** @class */ (function (_super) {
417
503
  };
418
504
  /* eslint-disable @typescript-eslint/no-unused-vars */
419
505
  MultiSelect.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
506
+ if (this.dataSource instanceof DataManager && !isNullOrUndefined(e) && !this.virtualGroupDataSource) {
507
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
508
+ this.totalItemCount = e.count;
509
+ }
420
510
  /* eslint-enable @typescript-eslint/no-unused-vars */
421
511
  _super.prototype.onActionComplete.call(this, ulElement, list, e);
512
+ this.skeletonCount = this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2) ? 0 : this.skeletonCount;
422
513
  this.updateSelectElementData(this.allowFiltering);
423
514
  // eslint-disable-next-line @typescript-eslint/no-this-alias
424
515
  var proxy = this;
425
- if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
516
+ if (!isNullOrUndefined(this.value) && !this.allowCustomValue && !this.enableVirtualization) {
426
517
  for (var i = 0; i < this.value.length; i++) {
427
- var checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', proxy.value[i]);
518
+ var value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', proxy.value[i]) : proxy.value[i];
519
+ var checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', value);
428
520
  if (!checkEle && !(this.dataSource instanceof DataManager)) {
429
521
  this.value.splice(i, 1);
430
522
  i -= 1;
@@ -512,7 +604,7 @@ var MultiSelect = /** @class */ (function (_super) {
512
604
  dropDownBaseClasses.selected;
513
605
  if (!isNullOrUndefined(this.value)) {
514
606
  for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
515
- value = this.value[index];
607
+ value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[index]) : this.value[index];
516
608
  element = this.findListElement(this.list, 'li', 'data-value', value);
517
609
  if (element) {
518
610
  addClass([element], className);
@@ -611,13 +703,13 @@ var MultiSelect = /** @class */ (function (_super) {
611
703
  MultiSelect.prototype.checkSelectAll = function () {
612
704
  var groupItemLength = this.list.querySelectorAll('li.e-list-group-item.e-active').length;
613
705
  var listItem = this.list.querySelectorAll('li.e-list-item');
614
- var searchCount = this.list.querySelectorAll('li.' + dropDownBaseClasses.li).length;
706
+ var searchCount = this.enableVirtualization ? this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-virtual-list)').length : this.list.querySelectorAll('li.' + dropDownBaseClasses.li).length;
615
707
  var searchActiveCount = this.list.querySelectorAll('li.' + dropDownBaseClasses.selected).length;
616
708
  if (this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy)) {
617
709
  searchActiveCount = searchActiveCount - groupItemLength;
618
710
  }
619
- if ((searchCount === searchActiveCount || searchActiveCount === this.maximumSelectionLength)
620
- && (this.mode === 'CheckBox' && this.showSelectAll)) {
711
+ if ((!this.enableVirtualization && ((searchCount === searchActiveCount || searchActiveCount === this.maximumSelectionLength)
712
+ && (this.mode === 'CheckBox' && this.showSelectAll))) || (this.enableVirtualization && this.mode === 'CheckBox' && this.showSelectAll && this.virtualSelectAll && this.value && this.value.length === this.totalItemCount)) {
621
713
  this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'check' });
622
714
  }
623
715
  else if ((searchCount !== searchActiveCount) && (this.mode === 'CheckBox' && this.showSelectAll)) {
@@ -654,7 +746,7 @@ var MultiSelect = /** @class */ (function (_super) {
654
746
  }
655
747
  this.isValidKey = (this.isPopupOpen() && e.keyCode === 8) || this.isValidKey;
656
748
  this.isValidKey = e.ctrlKey && e.keyCode === 86 ? false : this.isValidKey;
657
- if (this.isValidKey) {
749
+ if (this.isValidKey && this.inputElement) {
658
750
  this.isValidKey = false;
659
751
  this.expandTextbox();
660
752
  this.showOverAllClear();
@@ -684,7 +776,7 @@ var MultiSelect = /** @class */ (function (_super) {
684
776
  return filterQuery;
685
777
  }
686
778
  if (this.filterAction) {
687
- if (this.targetElement() !== null) {
779
+ if ((this.targetElement() !== null && !this.enableVirtualization) || (this.enableVirtualization && this.targetElement() !== null && this.targetElement().trim() !== '')) {
688
780
  var dataType = this.typeOfData(this.dataSource).typeof;
689
781
  if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
690
782
  filterQuery.where('', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);
@@ -694,21 +786,89 @@ var MultiSelect = /** @class */ (function (_super) {
694
786
  filterQuery.where(!isNullOrUndefined(fields.text) ? fields.text : '', this.filterType, this.targetElement(), this.ignoreCase, this.ignoreAccent);
695
787
  }
696
788
  }
789
+ if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll) {
790
+ return this.virtualFilterQuery(filterQuery);
791
+ }
697
792
  return filterQuery;
698
793
  }
699
794
  else {
795
+ if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
796
+ return this.virtualFilterQuery(filterQuery);
797
+ }
700
798
  return query ? query : this.query ? this.query : new Query();
701
799
  }
702
800
  };
801
+ MultiSelect.prototype.virtualFilterQuery = function (filterQuery) {
802
+ var takeValue = this.getTakeValue();
803
+ var isReOrder = true;
804
+ var isSkip = true;
805
+ var isTake = true;
806
+ for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
807
+ if (this.getModuleName() === 'multiselect' && ((filterQuery.queries[queryElements].e && filterQuery.queries[queryElements].e.condition == 'or') || (filterQuery.queries[queryElements].e && filterQuery.queries[queryElements].e.operator == 'equal'))) {
808
+ isReOrder = false;
809
+ }
810
+ if (filterQuery.queries[queryElements].fn === 'onSkip') {
811
+ isSkip = false;
812
+ }
813
+ if (filterQuery.queries[queryElements].fn === 'onTake') {
814
+ isTake = false;
815
+ }
816
+ }
817
+ if ((this.allowFiltering && isSkip) || !isReOrder || (!this.allowFiltering && isSkip)) {
818
+ if (!isReOrder) {
819
+ filterQuery.skip(this.viewPortInfo.startIndex);
820
+ }
821
+ else {
822
+ filterQuery.skip(this.virtualItemStartIndex);
823
+ }
824
+ }
825
+ if (isTake) {
826
+ if (this.isIncrementalRequest) {
827
+ filterQuery.take(this.incrementalEndIndex);
828
+ }
829
+ else {
830
+ filterQuery.take(takeValue);
831
+ }
832
+ }
833
+ filterQuery.requiresCount();
834
+ return filterQuery;
835
+ };
836
+ MultiSelect.prototype.getTakeValue = function () {
837
+ return this.allowFiltering && Browser.isDevice ? Math.round(window.outerHeight / this.listItemHeight) : this.itemCount;
838
+ };
703
839
  MultiSelect.prototype.dataUpdater = function (dataSource, query, fields) {
704
840
  this.isDataFetched = false;
841
+ var isNoData = this.list.classList.contains(dropDownBaseClasses.noData);
705
842
  if (this.targetElement().trim() === '') {
706
- var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
843
+ var list = this.enableVirtualization ? this.list.cloneNode(true) : this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
707
844
  if (this.backCommand) {
708
845
  this.remoteCustomValue = false;
709
846
  if (this.allowCustomValue && list.querySelectorAll('li').length == 0 && this.mainData.length > 0) {
710
847
  this.mainData = [];
711
848
  }
849
+ if (this.enableVirtualization) {
850
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
851
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
852
+ this.resetList(dataSource, fields, query);
853
+ if (this.mode !== 'CheckBox') {
854
+ this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length : this.totalItemCount;
855
+ }
856
+ this.UpdateSkeleton();
857
+ if ((isNoData || this.allowCustomValue) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
858
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
859
+ this.list.appendChild(this.createElement('div', {
860
+ className: 'e-virtual-ddl-content',
861
+ styles: this.getTransformValues()
862
+ })).appendChild(this.list.querySelector('.e-list-parent'));
863
+ }
864
+ if (!this.list.querySelector('.e-virtual-ddl')) {
865
+ var virualElement = this.createElement('div', {
866
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
867
+ });
868
+ document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
869
+ }
870
+ }
871
+ }
712
872
  this.onActionComplete(list, this.mainData);
713
873
  if (this.value && this.value.length) {
714
874
  this.refreshSelection();
@@ -720,7 +880,30 @@ var MultiSelect = /** @class */ (function (_super) {
720
880
  }
721
881
  }
722
882
  else {
883
+ if (this.enableVirtualization && this.allowFiltering) {
884
+ this.isPreventScrollAction = true;
885
+ this.list.scrollTop = 0;
886
+ this.previousStartIndex = 0;
887
+ this.virtualListInfo = null;
888
+ }
723
889
  this.resetList(dataSource, fields, query);
890
+ if (this.enableVirtualization && (isNoData || this.allowCustomValue) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
891
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
892
+ this.list.appendChild(this.createElement('div', {
893
+ className: 'e-virtual-ddl-content',
894
+ styles: this.getTransformValues()
895
+ })).appendChild(this.list.querySelector('.e-list-parent'));
896
+ }
897
+ if (this.mode !== 'CheckBox') {
898
+ this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length : this.totalItemCount;
899
+ }
900
+ if (!this.list.querySelector('.e-virtual-ddl')) {
901
+ var virualElement = this.createElement('div', {
902
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
903
+ });
904
+ document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
905
+ }
906
+ }
724
907
  if (this.allowCustomValue) {
725
908
  if (!(dataSource instanceof DataManager)) {
726
909
  this.checkForCustomValue(query, fields);
@@ -731,6 +914,9 @@ var MultiSelect = /** @class */ (function (_super) {
731
914
  }
732
915
  }
733
916
  }
917
+ if (this.enableVirtualization && this.allowFiltering) {
918
+ this.getFilteringSkeletonCount();
919
+ }
734
920
  this.refreshPopup();
735
921
  if (this.mode === 'CheckBox') {
736
922
  this.removeFocus();
@@ -744,18 +930,43 @@ var MultiSelect = /** @class */ (function (_super) {
744
930
  var customData = (!isNullOrUndefined(this.mainData) && this.mainData.length > 0) ?
745
931
  this.mainData[0] : this.mainData;
746
932
  if (customData && typeof (customData) !== 'string' && typeof (customData) !== 'number' && typeof (customData) !== 'boolean') {
747
- var dataItem = {};
748
- setValue(field.text, value, dataItem);
933
+ var dataItem_1 = {};
934
+ setValue(field.text, value, dataItem_1);
749
935
  if (typeof getValue((this.fields.value ? this.fields.value : 'value'), customData)
750
936
  === 'number') {
751
- setValue(field.value, Math.random(), dataItem);
937
+ setValue(field.value, Math.random(), dataItem_1);
752
938
  }
753
939
  else {
754
- setValue(field.value, value, dataItem);
940
+ setValue(field.value, value, dataItem_1);
941
+ }
942
+ var emptyObject_1 = {};
943
+ if (this.allowObjectBinding) {
944
+ var keys = this.listData && this.listData.length > 0 ? Object.keys(this.listData[0]) : this.firstItem ? Object.keys(this.firstItem) : Object.keys(dataItem_1);
945
+ // Create an empty object with predefined keys
946
+ keys.forEach(function (key) {
947
+ emptyObject_1[key] = ((key === fields.value) || (key === fields.text)) ? getValue(fields.value, dataItem_1) : null;
948
+ });
949
+ }
950
+ dataItem_1 = this.allowObjectBinding ? emptyObject_1 : dataItem_1;
951
+ if (this.enableVirtualization) {
952
+ this.virtualCustomData = dataItem_1;
953
+ var tempData = this.virtualGroupDataSource ? JSON.parse(JSON.stringify(this.virtualGroupDataSource)) : JSON.parse(JSON.stringify(this.dataSource));
954
+ var totalData = [];
955
+ if (this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
956
+ totalData = tempData.concat(this.virtualCustomSelectData);
957
+ }
958
+ tempData.splice(0, 0, dataItem_1);
959
+ this.isCustomDataUpdated = true;
960
+ this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
961
+ this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.itemCount;
962
+ this.resetList(tempData, field, query);
963
+ this.isCustomDataUpdated = false;
964
+ }
965
+ else {
966
+ var tempData = JSON.parse(JSON.stringify(this.listData));
967
+ tempData.splice(0, 0, dataItem_1);
968
+ this.resetList(tempData, field, query);
755
969
  }
756
- var tempData = JSON.parse(JSON.stringify(this.listData));
757
- tempData.splice(0, 0, dataItem);
758
- this.resetList(tempData, field, query);
759
970
  }
760
971
  else if (this.listData) {
761
972
  var tempData = JSON.parse(JSON.stringify(this.listData));
@@ -789,6 +1000,8 @@ var MultiSelect = /** @class */ (function (_super) {
789
1000
  };
790
1001
  MultiSelect.prototype.wrapperClick = function (e) {
791
1002
  this.setDynValue = false;
1003
+ this.keyboardEvent = null;
1004
+ this.isKeyBoardAction = false;
792
1005
  if (!this.enabled) {
793
1006
  return;
794
1007
  }
@@ -988,8 +1201,8 @@ var MultiSelect = /** @class */ (function (_super) {
988
1201
  if (this.initStatus && this.validateValues(newValue, oldValue)) {
989
1202
  var eventArgs = {
990
1203
  e: event,
991
- oldValue: oldVal,
992
- value: newVal,
1204
+ oldValue: this.allowObjectBinding ? oldVal : oldVal,
1205
+ value: this.allowObjectBinding ? newVal : newVal,
993
1206
  isInteracted: event ? true : false,
994
1207
  element: this.element,
995
1208
  event: event
@@ -1005,13 +1218,14 @@ var MultiSelect = /** @class */ (function (_super) {
1005
1218
  this.dispatchEvent(this.hiddenElement, 'change');
1006
1219
  }
1007
1220
  }
1221
+ this.selectedValueInfo = this.viewPortInfo;
1008
1222
  };
1009
1223
  MultiSelect.prototype.updateTempValue = function () {
1010
1224
  if (!this.value) {
1011
1225
  this.tempValues = this.value;
1012
1226
  }
1013
1227
  else {
1014
- this.tempValues = this.value.slice();
1228
+ this.tempValues = this.allowObjectBinding ? this.value.slice() : this.value.slice();
1015
1229
  }
1016
1230
  };
1017
1231
  MultiSelect.prototype.updateAriaActiveDescendant = function () {
@@ -1019,26 +1233,44 @@ var MultiSelect = /** @class */ (function (_super) {
1019
1233
  attributes(this.inputElement, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
1020
1234
  }
1021
1235
  };
1022
- MultiSelect.prototype.getPagingCount = function () {
1023
- var height = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
1024
- getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
1025
- return Math.round(this.list.offsetHeight / parseInt(height, 10));
1026
- };
1027
- MultiSelect.prototype.pageUpSelection = function (steps) {
1236
+ MultiSelect.prototype.pageUpSelection = function (steps, isVirtualKeyAction) {
1028
1237
  var collection = this.list.querySelectorAll('li.'
1029
1238
  + dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
1030
1239
  var previousItem = steps >= 0 ? collection[steps + 1] : collection[0];
1031
- this.addListFocus(previousItem);
1032
- this.scrollBottom(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')));
1240
+ if (this.enableVirtualization && isVirtualKeyAction) {
1241
+ previousItem = steps >= 0 && this.viewPortInfo.startIndex != 0 ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[this.skeletonCount];
1242
+ }
1243
+ if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
1244
+ previousItem = this.liCollections[this.skeletonCount];
1245
+ }
1246
+ if (this.enableVirtualization) {
1247
+ if (!isNullOrUndefined(previousItem) && !previousItem.classList.contains('e-item-focus')) {
1248
+ this.addListFocus(previousItem);
1249
+ this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
1250
+ }
1251
+ else if (this.viewPortInfo.startIndex == 0) {
1252
+ this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
1253
+ }
1254
+ }
1255
+ else {
1256
+ this.addListFocus(previousItem);
1257
+ this.scrollTop(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), this.keyboardEvent.keyCode);
1258
+ }
1033
1259
  };
1034
- MultiSelect.prototype.pageDownSelection = function (steps) {
1260
+ MultiSelect.prototype.pageDownSelection = function (steps, isVirtualKeyAction) {
1035
1261
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1036
1262
  var list = this.getItems();
1037
1263
  var collection = this.list.querySelectorAll('li.'
1038
1264
  + dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
1039
1265
  var previousItem = steps <= collection.length ? collection[steps - 1] : collection[collection.length - 1];
1266
+ if (this.enableVirtualization && this.skeletonCount > 0) {
1267
+ previousItem = steps < list.length ? this.liCollections[steps] : this.liCollections[list.length - 1];
1268
+ }
1269
+ if (this.enableVirtualization && isVirtualKeyAction) {
1270
+ previousItem = steps <= list.length ? this.liCollections[steps] : this.liCollections[list.length - 1];
1271
+ }
1040
1272
  this.addListFocus(previousItem);
1041
- this.scrollBottom(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')));
1273
+ this.scrollBottom(previousItem, this.getIndexByValue(previousItem.getAttribute('data-value')), false, this.keyboardEvent.keyCode);
1042
1274
  };
1043
1275
  MultiSelect.prototype.getItems = function () {
1044
1276
  if (!this.list) {
@@ -1157,21 +1389,110 @@ var MultiSelect = /** @class */ (function (_super) {
1157
1389
  }
1158
1390
  }
1159
1391
  };
1160
- MultiSelect.prototype.homeNavigation = function (isHome) {
1392
+ MultiSelect.prototype.homeNavigation = function (isHome, isVirtualKeyAction) {
1161
1393
  this.removeFocus();
1394
+ if (this.enableVirtualization) {
1395
+ if (isHome) {
1396
+ if (this.enableVirtualization && this.viewPortInfo.startIndex !== 0) {
1397
+ this.viewPortInfo.startIndex = 0;
1398
+ this.viewPortInfo.endIndex = this.itemCount;
1399
+ this.updateVirtualItemIndex();
1400
+ this.resetList(this.dataSource, this.fields, this.query);
1401
+ }
1402
+ }
1403
+ else {
1404
+ if (this.enableVirtualization && ((!this.value && this.viewPortInfo.endIndex !== this.totalItemCount) || (this.value && this.value.length > 0 && this.viewPortInfo.endIndex !== this.totalItemCount + this.value.length))) {
1405
+ this.viewPortInfo.startIndex = this.totalItemCount - this.itemCount;
1406
+ this.viewPortInfo.endIndex = this.totalItemCount;
1407
+ this.updateVirtualItemIndex();
1408
+ var query = new Query().clone();
1409
+ if (this.value && this.value.length > 0) {
1410
+ query = this.getForQuery(this.value).clone();
1411
+ query = query.skip(this.totalItemCount - this.itemCount);
1412
+ }
1413
+ this.resetList(this.dataSource, this.fields, query);
1414
+ }
1415
+ }
1416
+ }
1417
+ this.UpdateSkeleton();
1162
1418
  var scrollEle = this.ulElement.querySelectorAll('li.' + dropDownBaseClasses.li
1163
1419
  + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
1164
1420
  if (scrollEle.length > 0) {
1165
1421
  var element = scrollEle[(isHome) ? 0 : (scrollEle.length - 1)];
1422
+ if (this.enableVirtualization && isHome) {
1423
+ element = scrollEle[this.skeletonCount];
1424
+ }
1425
+ this.removeFocus();
1166
1426
  element.classList.add(dropDownBaseClasses.focus);
1167
- this.scrollBottom(element);
1427
+ if (this.enableVirtualization && isHome) {
1428
+ this.scrollTop(element, undefined, this.keyboardEvent.keyCode);
1429
+ }
1430
+ else if (!isVirtualKeyAction) {
1431
+ this.scrollBottom(element, undefined, false, this.keyboardEvent.keyCode);
1432
+ }
1168
1433
  this.updateAriaActiveDescendant();
1169
1434
  }
1170
1435
  };
1436
+ MultiSelect.prototype.updateSelectionList = function () {
1437
+ if (!isNullOrUndefined(this.value) && this.value.length) {
1438
+ for (var index = 0; index < this.value.length; index++) {
1439
+ var value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), this.value[index]) : this.value[index];
1440
+ var selectedItem = this.getElementByValue(value);
1441
+ if (selectedItem && !selectedItem.classList.contains(dropDownBaseClasses.selected)) {
1442
+ selectedItem.classList.add('e-active');
1443
+ }
1444
+ }
1445
+ }
1446
+ };
1447
+ MultiSelect.prototype.handleVirtualKeyboardActions = function (e, pageCount) {
1448
+ var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
1449
+ var activeIndex;
1450
+ this.isKeyBoardAction = true;
1451
+ switch (e.keyCode) {
1452
+ case 40:
1453
+ this.arrowDown(e, true);
1454
+ break;
1455
+ case 38:
1456
+ this.arrowUp(e, true);
1457
+ break;
1458
+ case 33:
1459
+ e.preventDefault();
1460
+ if (focusedItem) {
1461
+ var count = (this.getPageCount() * 2) - 4;
1462
+ activeIndex = Math.round(count);
1463
+ activeIndex = this.getIndexByValue(focusedItem.getAttribute('data-value'));
1464
+ this.pageUpSelection(activeIndex - this.getPageCount(), true);
1465
+ this.updateAriaAttribute();
1466
+ }
1467
+ break;
1468
+ case 34:
1469
+ e.preventDefault();
1470
+ if (focusedItem) {
1471
+ activeIndex = this.getIndexByValue(focusedItem.getAttribute('data-value'));
1472
+ this.pageDownSelection(activeIndex + this.getPageCount() + 1, true);
1473
+ this.updateAriaAttribute();
1474
+ }
1475
+ break;
1476
+ case 35:
1477
+ case 36:
1478
+ this.isMouseScrollAction = true;
1479
+ this.homeNavigation((e.keyCode === 36) ? true : false, true);
1480
+ this.isPreventScrollAction = true;
1481
+ break;
1482
+ }
1483
+ this.keyboardEvent = null;
1484
+ this.isScrollChanged = true;
1485
+ this.isKeyBoardAction = false;
1486
+ };
1171
1487
  MultiSelect.prototype.onKeyDown = function (e) {
1172
1488
  if (this.readonly || !this.enabled && this.mode !== 'CheckBox') {
1173
1489
  return;
1174
1490
  }
1491
+ this.preventSetCurrentData = false;
1492
+ this.keyboardEvent = e;
1493
+ if (this.isPreventKeyAction && this.enableVirtualization) {
1494
+ e.preventDefault();
1495
+ }
1175
1496
  this.keyCode = e.keyCode;
1176
1497
  this.keyDownStatus = true;
1177
1498
  if (e.keyCode > 111 && e.keyCode < 124) {
@@ -1184,16 +1505,18 @@ var MultiSelect = /** @class */ (function (_super) {
1184
1505
  else if (this.isPopupOpen()) {
1185
1506
  var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
1186
1507
  var activeIndex = void 0;
1508
+ this.isKeyBoardAction = true;
1187
1509
  switch (e.keyCode) {
1188
1510
  case 36:
1189
1511
  case 35:
1512
+ this.isMouseScrollAction = true;
1190
1513
  this.homeNavigation((e.keyCode === 36) ? true : false);
1191
1514
  break;
1192
1515
  case 33:
1193
1516
  e.preventDefault();
1194
1517
  if (focusedItem) {
1195
- this.getIndexByValue(focusedItem.getAttribute('data-value'));
1196
- this.pageUpSelection(activeIndex - this.getPagingCount());
1518
+ activeIndex = this.getIndexByValue(focusedItem.getAttribute('data-value'));
1519
+ this.pageUpSelection(activeIndex - this.getPageCount() - 1);
1197
1520
  this.updateAriaAttribute();
1198
1521
  }
1199
1522
  return;
@@ -1201,7 +1524,7 @@ var MultiSelect = /** @class */ (function (_super) {
1201
1524
  e.preventDefault();
1202
1525
  if (focusedItem) {
1203
1526
  this.getIndexByValue(focusedItem.getAttribute('data-value'));
1204
- this.pageDownSelection(activeIndex + this.getPagingCount());
1527
+ this.pageDownSelection(activeIndex + this.getPageCount());
1205
1528
  this.updateAriaAttribute();
1206
1529
  }
1207
1530
  return;
@@ -1267,10 +1590,11 @@ var MultiSelect = /** @class */ (function (_super) {
1267
1590
  if (!(this.mode === 'CheckBox' && this.showSelectAll)) {
1268
1591
  this.refreshPopup();
1269
1592
  }
1593
+ this.isKeyBoardAction = false;
1270
1594
  };
1271
- MultiSelect.prototype.arrowDown = function (e) {
1595
+ MultiSelect.prototype.arrowDown = function (e, isVirtualKeyAction) {
1272
1596
  e.preventDefault();
1273
- this.moveByList(1);
1597
+ this.moveByList(1, isVirtualKeyAction);
1274
1598
  this.keyAction = true;
1275
1599
  if (document.activeElement.classList.contains(FILTERINPUT)
1276
1600
  || (this.mode === 'CheckBox' && !this.allowFiltering && document.activeElement !== this.list)) {
@@ -1278,7 +1602,7 @@ var MultiSelect = /** @class */ (function (_super) {
1278
1602
  }
1279
1603
  this.updateAriaAttribute();
1280
1604
  };
1281
- MultiSelect.prototype.arrowUp = function (e) {
1605
+ MultiSelect.prototype.arrowUp = function (e, isVirtualKeyAction) {
1282
1606
  e.preventDefault();
1283
1607
  this.keyAction = true;
1284
1608
  var list = this.list.querySelectorAll('li.'
@@ -1296,7 +1620,7 @@ var MultiSelect = /** @class */ (function (_super) {
1296
1620
  this.keyAction = false;
1297
1621
  this.notify('inputFocus', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'focus' });
1298
1622
  }
1299
- this.moveByList(-1);
1623
+ this.moveByList(-1, isVirtualKeyAction);
1300
1624
  this.updateAriaAttribute();
1301
1625
  };
1302
1626
  MultiSelect.prototype.spaceKeySelection = function (e) {
@@ -1347,8 +1671,8 @@ var MultiSelect = /** @class */ (function (_super) {
1347
1671
  else if (e.keyCode === 8 && this.mode === 'Delimiter') {
1348
1672
  if (this.value && this.value.length) {
1349
1673
  e.preventDefault();
1350
- var temp = this.value[this.value.length - 1];
1351
- this.removeValue(temp, e);
1674
+ var temp = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), this.value[this.value.length - 1]) : this.value[this.value.length - 1];
1675
+ this.removeValue(this.value[this.value.length - 1], e);
1352
1676
  this.updateDelimeter(this.delimiterChar, e);
1353
1677
  this.focusAtLastListItem(temp);
1354
1678
  }
@@ -1363,6 +1687,9 @@ var MultiSelect = /** @class */ (function (_super) {
1363
1687
  };
1364
1688
  MultiSelect.prototype.escapeAction = function () {
1365
1689
  var temp = this.tempValues ? this.tempValues.slice() : [];
1690
+ if (this.allowObjectBinding) {
1691
+ temp = this.tempValues ? this.tempValues.slice() : [];
1692
+ }
1366
1693
  if (this.value && this.validateValues(this.value, temp)) {
1367
1694
  if (this.mode !== 'CheckBox') {
1368
1695
  this.value = temp;
@@ -1384,36 +1711,104 @@ var MultiSelect = /** @class */ (function (_super) {
1384
1711
  }
1385
1712
  this.makeTextBoxEmpty();
1386
1713
  };
1387
- MultiSelect.prototype.scrollBottom = function (selectedLI, activeIndex) {
1714
+ MultiSelect.prototype.scrollBottom = function (selectedLI, activeIndex, isInitialSelection, keyCode) {
1715
+ if (isInitialSelection === void 0) { isInitialSelection = false; }
1716
+ if (keyCode === void 0) { keyCode = null; }
1717
+ if ((!isNullOrUndefined(selectedLI) && selectedLI.classList.contains('e-virtual-list')) || (this.enableVirtualization && isNullOrUndefined(selectedLI))) {
1718
+ selectedLI = this.liCollections[this.skeletonCount];
1719
+ }
1720
+ this.isUpwardScrolling = false;
1721
+ var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
1722
+ var lastElementValue = this.list.querySelector('li:last-of-type') ? this.list.querySelector('li:last-of-type').getAttribute('data-value') : null;
1723
+ var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? selectedLI.offsetTop + (this.virtualListInfo.startIndex * selectedLI.offsetHeight) : selectedLI.offsetTop;
1388
1724
  var currentOffset = this.list.offsetHeight;
1389
- var nextBottom = selectedLI.offsetTop + selectedLI.offsetHeight - this.list.scrollTop;
1725
+ var nextBottom = selectedLiOffsetTop - (virtualListCount * selectedLI.offsetHeight) + selectedLI.offsetHeight - this.list.scrollTop;
1390
1726
  var nextOffset = this.list.scrollTop + nextBottom - currentOffset;
1391
- var boxRange = (selectedLI.offsetTop + selectedLI.offsetHeight - this.list.scrollTop);
1727
+ var isScrollerCHanged = false;
1728
+ var isScrollTopChanged = false;
1729
+ var boxRange = selectedLiOffsetTop - (virtualListCount * selectedLI.offsetHeight) + selectedLI.offsetHeight - this.list.scrollTop;
1392
1730
  boxRange = this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
1393
1731
  boxRange - this.fixedHeaderElement.offsetHeight : boxRange;
1394
- if (activeIndex === 0) {
1732
+ if (activeIndex === 0 && !this.enableVirtualization) {
1395
1733
  this.list.scrollTop = 0;
1396
1734
  }
1397
- else if (nextBottom > currentOffset) {
1398
- this.list.scrollTop = nextOffset;
1399
- }
1400
- else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
1401
- this.list.scrollTop = nextOffset;
1735
+ else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
1736
+ var currentElementValue = selectedLI ? selectedLI.getAttribute('data-value') : null;
1737
+ var liCount = keyCode == 34 ? this.getPageCount() - 1 : 1;
1738
+ if (!this.enableVirtualization || this.isKeyBoardAction || isInitialSelection) {
1739
+ if (this.isKeyBoardAction && this.enableVirtualization && lastElementValue && currentElementValue === lastElementValue && keyCode != 35 && !this.isVirtualScrolling) {
1740
+ this.isPreventKeyAction = true;
1741
+ this.list.scrollTop += selectedLI.offsetHeight * liCount;
1742
+ this.isPreventKeyAction = this.IsScrollerAtEnd() ? false : this.isPreventKeyAction;
1743
+ this.isKeyBoardAction = false;
1744
+ this.isPreventScrollAction = false;
1745
+ }
1746
+ else if (this.enableVirtualization && keyCode == 35) {
1747
+ this.isPreventKeyAction = false;
1748
+ this.isKeyBoardAction = false;
1749
+ this.isPreventScrollAction = false;
1750
+ this.list.scrollTop = this.list.scrollHeight;
1751
+ }
1752
+ else {
1753
+ if (keyCode == 34 && this.enableVirtualization && !this.isVirtualScrolling) {
1754
+ this.isPreventKeyAction = false;
1755
+ this.isKeyBoardAction = false;
1756
+ this.isPreventScrollAction = false;
1757
+ nextOffset = nextOffset + (selectedLI.offsetHeight * liCount);
1758
+ }
1759
+ this.list.scrollTop = nextOffset;
1760
+ }
1761
+ }
1762
+ else {
1763
+ this.list.scrollTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.virtualListInfo.startIndex * this.listItemHeight : 0;
1764
+ }
1765
+ isScrollerCHanged = this.isKeyBoardAction;
1766
+ isScrollTopChanged = true;
1402
1767
  }
1768
+ this.isKeyBoardAction = isScrollerCHanged;
1403
1769
  };
1404
- MultiSelect.prototype.scrollTop = function (selectedLI, activeIndex) {
1405
- var nextOffset = selectedLI.offsetTop - this.list.scrollTop;
1770
+ MultiSelect.prototype.scrollTop = function (selectedLI, activeIndex, keyCode) {
1771
+ if (keyCode === void 0) { keyCode = null; }
1772
+ var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
1773
+ var selectedLiOffsetTop = (this.virtualListInfo && this.virtualListInfo.startIndex) ? selectedLI.offsetTop + (this.virtualListInfo.startIndex * selectedLI.offsetHeight) : selectedLI.offsetTop;
1774
+ var nextOffset = selectedLiOffsetTop - (virtualListCount * selectedLI.offsetHeight) - this.list.scrollTop;
1775
+ var firstElementValue = this.list.querySelector('li.e-list-item:not(.e-virtual-list)') ? this.list.querySelector('li.e-list-item:not(.e-virtual-list)').getAttribute('data-value') : null;
1406
1776
  nextOffset = this.fields.groupBy && !isUndefined(this.fixedHeaderElement) ?
1407
1777
  nextOffset - this.fixedHeaderElement.offsetHeight : nextOffset;
1408
- var boxRange = (selectedLI.offsetTop + selectedLI.offsetHeight - this.list.scrollTop);
1409
- if (activeIndex === 0) {
1778
+ var boxRange = (selectedLiOffsetTop - (virtualListCount * selectedLI.offsetHeight) + selectedLI.offsetHeight - this.list.scrollTop);
1779
+ var isPageUpKeyAction = this.enableVirtualization && this.getModuleName() === 'autocomplete' && nextOffset <= 0;
1780
+ if (activeIndex === 0 && !this.enableVirtualization) {
1410
1781
  this.list.scrollTop = 0;
1411
1782
  }
1412
- else if (nextOffset < 0) {
1413
- this.list.scrollTop = this.list.scrollTop + nextOffset;
1783
+ else if (nextOffset < 0 || isPageUpKeyAction) {
1784
+ var currentElementValue = selectedLI ? selectedLI.getAttribute('data-value') : null;
1785
+ var liCount = keyCode == 33 ? this.getPageCount() - 2 : 1;
1786
+ if (this.enableVirtualization && this.isKeyBoardAction && firstElementValue && currentElementValue === firstElementValue && keyCode != 36 && !this.isVirtualScrolling) {
1787
+ this.isUpwardScrolling = true;
1788
+ this.isPreventKeyAction = true;
1789
+ this.list.scrollTop -= selectedLI.offsetHeight * liCount;
1790
+ this.isPreventKeyAction = this.list.scrollTop != 0 ? this.isPreventKeyAction : false;
1791
+ this.isKeyBoardAction = false;
1792
+ this.isPreventScrollAction = false;
1793
+ }
1794
+ else if (this.enableVirtualization && keyCode == 36) {
1795
+ this.isPreventScrollAction = false;
1796
+ this.isPreventKeyAction = true;
1797
+ this.isKeyBoardAction = false;
1798
+ this.list.scrollTo(0, 0);
1799
+ }
1800
+ else {
1801
+ if (keyCode == 33 && this.enableVirtualization && !this.isVirtualScrolling) {
1802
+ this.isPreventKeyAction = false;
1803
+ this.isKeyBoardAction = false;
1804
+ this.isPreventScrollAction = false;
1805
+ nextOffset = nextOffset - (selectedLI.offsetHeight * liCount);
1806
+ }
1807
+ this.list.scrollTop = this.list.scrollTop + nextOffset;
1808
+ }
1414
1809
  }
1415
1810
  else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
1416
- this.list.scrollTop = selectedLI.offsetTop - (this.fields.groupBy && !isUndefined(this.fixedHeaderElement) ?
1811
+ this.list.scrollTop = selectedLI.offsetTop - (this.fields.groupBy && !isNullOrUndefined(this.fixedHeaderElement) ?
1417
1812
  this.fixedHeaderElement.offsetHeight : 0);
1418
1813
  }
1419
1814
  };
@@ -1500,7 +1895,19 @@ var MultiSelect = /** @class */ (function (_super) {
1500
1895
  if ((this.allowFiltering || (this.mode === 'CheckBox' && this.enableSelectionOrder === true)
1501
1896
  || this.allowCustomValue) && this.mainList && this.listData) {
1502
1897
  var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
1503
- this.onActionComplete(list, this.mainData);
1898
+ if (this.enableVirtualization) {
1899
+ if (this.allowCustomValue && this.virtualCustomData && data == null && this.virtualCustomData && this.viewPortInfo && this.viewPortInfo.startIndex === 0 && this.viewPortInfo.endIndex === this.itemCount) {
1900
+ this.virtualCustomData = null;
1901
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1902
+ this.renderItems(this.mainData, this.fields);
1903
+ }
1904
+ else {
1905
+ this.onActionComplete(this.list, this.listData);
1906
+ }
1907
+ }
1908
+ else {
1909
+ this.onActionComplete(list, this.mainData);
1910
+ }
1504
1911
  this.focusAtLastListItem(data);
1505
1912
  if (this.value && this.value.length) {
1506
1913
  this.refreshSelection();
@@ -1515,14 +1922,15 @@ var MultiSelect = /** @class */ (function (_super) {
1515
1922
  var temp;
1516
1923
  if (selectedElem !== null) {
1517
1924
  if (!isNullOrUndefined(this.value)) {
1518
- this.tempValues = this.value.slice();
1925
+ this.tempValues = this.allowObjectBinding ? this.value.slice() : this.value.slice();
1519
1926
  }
1520
1927
  temp = selectedElem.nextElementSibling;
1521
1928
  if (temp !== null) {
1522
1929
  this.removeChipSelection();
1523
1930
  this.addChipSelection(temp, e);
1524
1931
  }
1525
- this.removeValue(selectedElem.getAttribute('data-value'), e);
1932
+ var currentChip = this.allowObjectBinding ? this.getDataByValue(selectedElem.getAttribute('data-value')) : selectedElem.getAttribute('data-value');
1933
+ this.removeValue(currentChip, e);
1526
1934
  this.makeTextBoxEmpty();
1527
1935
  }
1528
1936
  if (this.closePopupOnSelect) {
@@ -1549,7 +1957,7 @@ var MultiSelect = /** @class */ (function (_super) {
1549
1957
  selectAllParent.classList.remove('e-item-focus');
1550
1958
  }
1551
1959
  };
1552
- MultiSelect.prototype.moveByList = function (position) {
1960
+ MultiSelect.prototype.moveByList = function (position, isVirtualKeyAction) {
1553
1961
  if (this.list) {
1554
1962
  var elements = this.list.querySelectorAll('li.'
1555
1963
  + dropDownBaseClasses.li
@@ -1560,6 +1968,9 @@ var MultiSelect = /** @class */ (function (_super) {
1560
1968
  + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
1561
1969
  }
1562
1970
  var selectedElem = this.list.querySelector('li.' + dropDownBaseClasses.focus);
1971
+ if (this.enableVirtualization && isVirtualKeyAction && !isNullOrUndefined(this.currentFocuedListElement)) {
1972
+ selectedElem = this.getElementByValue(this.getFormattedValue(this.currentFocuedListElement.getAttribute('data-value')));
1973
+ }
1563
1974
  var temp = -1;
1564
1975
  var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
1565
1976
  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) {
@@ -1588,22 +1999,57 @@ var MultiSelect = /** @class */ (function (_super) {
1588
1999
  if (position > 0) {
1589
2000
  if (temp < (elements.length - 1)) {
1590
2001
  this.removeFocus();
1591
- this.addListFocus(elements[++temp]);
1592
- this.updateCheck(elements[temp]);
1593
- this.scrollBottom(elements[temp], temp);
2002
+ if (this.enableVirtualization && isVirtualKeyAction) {
2003
+ this.addListFocus(elements[temp]);
2004
+ }
2005
+ else {
2006
+ this.addListFocus(elements[++temp]);
2007
+ }
2008
+ if (temp > -1) {
2009
+ this.updateCheck(elements[temp]);
2010
+ this.scrollBottom(elements[temp], temp);
2011
+ this.currentFocuedListElement = elements[temp];
2012
+ }
1594
2013
  }
1595
2014
  }
1596
2015
  else {
1597
2016
  if (temp > 0) {
1598
- this.removeFocus();
1599
- this.addListFocus(elements[--temp]);
1600
- this.updateCheck(elements[temp]);
1601
- this.scrollTop(elements[temp], temp);
2017
+ if (this.enableVirtualization) {
2018
+ var isVirtualElement = elements[temp - 1].classList.contains('e-virtual-list');
2019
+ var elementIndex = isVirtualKeyAction ? temp : temp - 1;
2020
+ if (isVirtualKeyAction || !isVirtualElement) {
2021
+ this.removeFocus();
2022
+ }
2023
+ if (isVirtualKeyAction || !isVirtualElement) {
2024
+ this.addListFocus(elements[elementIndex]);
2025
+ this.updateCheck(elements[elementIndex]);
2026
+ this.scrollTop(elements[elementIndex], temp);
2027
+ this.currentFocuedListElement = elements[elementIndex];
2028
+ }
2029
+ }
2030
+ else {
2031
+ this.removeFocus();
2032
+ this.addListFocus(elements[--temp]);
2033
+ this.updateCheck(elements[temp]);
2034
+ this.scrollTop(elements[temp], temp);
2035
+ }
1602
2036
  }
1603
2037
  }
1604
2038
  }
1605
2039
  }
1606
2040
  };
2041
+ MultiSelect.prototype.getElementByValue = function (value) {
2042
+ var item;
2043
+ var listItems = this.getItems();
2044
+ for (var _i = 0, listItems_1 = listItems; _i < listItems_1.length; _i++) {
2045
+ var liItem = listItems_1[_i];
2046
+ if (this.getFormattedValue(liItem.getAttribute('data-value')) === value) {
2047
+ item = liItem;
2048
+ break;
2049
+ }
2050
+ }
2051
+ return item;
2052
+ };
1607
2053
  MultiSelect.prototype.updateCheck = function (element) {
1608
2054
  if (this.mode === 'CheckBox' && this.enableGroupCheckBox &&
1609
2055
  !isNullOrUndefined(this.fields.groupBy)) {
@@ -1665,7 +2111,7 @@ var MultiSelect = /** @class */ (function (_super) {
1665
2111
  if (this.enabled && !this.readonly) {
1666
2112
  var element = e.target.parentElement;
1667
2113
  var customVal = element.getAttribute('data-value');
1668
- var value = this.getFormattedValue(customVal);
2114
+ var value = this.allowObjectBinding ? this.getDataByValue(customVal) : this.getFormattedValue(customVal);
1669
2115
  if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
1670
2116
  (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
1671
2117
  value = customVal;
@@ -1677,6 +2123,7 @@ var MultiSelect = /** @class */ (function (_super) {
1677
2123
  this.inputElement.focus();
1678
2124
  }
1679
2125
  this.removeValue(value, e);
2126
+ value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
1680
2127
  if (isNullOrUndefined(this.findListElement(this.list, 'li', 'data-value', value)) && this.mainList && this.listData) {
1681
2128
  var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
1682
2129
  this.onActionComplete(list, this.mainData);
@@ -1711,7 +2158,7 @@ var MultiSelect = /** @class */ (function (_super) {
1711
2158
  this.expandTextbox();
1712
2159
  };
1713
2160
  MultiSelect.prototype.removeAllItems = function (value, eve, isClearAll, element, mainElement) {
1714
- var index = this.value.indexOf(value);
2161
+ var index = this.allowObjectBinding ? this.indexOfObjectInArray(value, this.value) : this.value.indexOf(value);
1715
2162
  var removeVal = this.value.slice(0);
1716
2163
  removeVal.splice(index, 1);
1717
2164
  this.setProperties({ value: [].concat([], removeVal) }, true);
@@ -1726,7 +2173,8 @@ var MultiSelect = /** @class */ (function (_super) {
1726
2173
  e: this, index: index
1727
2174
  });
1728
2175
  this.invokeCheckboxSelection(element, eve, isClearAll);
1729
- this.updateMainList(true, value, mainElement);
2176
+ var currentValue = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), value) : value;
2177
+ this.updateMainList(true, currentValue, mainElement);
1730
2178
  this.updateChipStatus();
1731
2179
  };
1732
2180
  MultiSelect.prototype.invokeCheckboxSelection = function (element, eve, isClearAll) {
@@ -1743,9 +2191,9 @@ var MultiSelect = /** @class */ (function (_super) {
1743
2191
  };
1744
2192
  MultiSelect.prototype.removeValue = function (value, eve, length, isClearAll) {
1745
2193
  var _this = this;
1746
- var index = this.value.indexOf(this.getFormattedValue(value));
2194
+ var index = this.allowObjectBinding ? this.indexOfObjectInArray(value, this.value) : this.value.indexOf(this.getFormattedValue(value));
1747
2195
  if (index === -1 && this.allowCustomValue && !isNullOrUndefined(value)) {
1748
- index = this.value.indexOf(value.toString());
2196
+ index = this.allowObjectBinding ? this.indexOfObjectInArray(value, this.value) : this.value.indexOf(value.toString());
1749
2197
  }
1750
2198
  var targetEle = eve && eve.target;
1751
2199
  isClearAll = (isClearAll || targetEle && targetEle.classList.contains('e-close-hooker')) ? true : null;
@@ -1753,7 +2201,8 @@ var MultiSelect = /** @class */ (function (_super) {
1753
2201
  HIDE_LIST :
1754
2202
  dropDownBaseClasses.selected;
1755
2203
  if (index !== -1) {
1756
- var element_1 = this.findListElement(this.list, 'li', 'data-value', value);
2204
+ var currentValue = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), value) : value;
2205
+ var element_1 = this.findListElement(this.list, 'li', 'data-value', currentValue);
1757
2206
  var val_1 = this.getDataByValue(value);
1758
2207
  var eventArgs = {
1759
2208
  e: eve,
@@ -1767,11 +2216,20 @@ var MultiSelect = /** @class */ (function (_super) {
1767
2216
  _this.removeIndex++;
1768
2217
  }
1769
2218
  else {
2219
+ _this.virtualSelectAll = false;
1770
2220
  var removeVal = _this.value.slice(0);
2221
+ if (_this.enableVirtualization && isClearAll) {
2222
+ removeVal = [];
2223
+ }
1771
2224
  removeVal.splice(index, 1);
1772
2225
  _this.setProperties({ value: [].concat([], removeVal) }, true);
2226
+ if (_this.enableVirtualization) {
2227
+ var currentText = index == 0 ? _this.text.replace(_this.text.split(_this.delimiterChar)[index] + _this.delimiterChar, '') : _this.text.replace(_this.delimiterChar + _this.text.split(_this.delimiterChar)[index], '');
2228
+ _this.setProperties({ text: currentText.toString() }, true);
2229
+ }
1773
2230
  if (element_1 !== null) {
1774
- var hideElement = _this.findListElement(_this.mainList, 'li', 'data-value', value);
2231
+ var currentValue_1 = _this.allowObjectBinding ? getValue(((_this.fields.value) ? _this.fields.value : ''), value) : value;
2232
+ var hideElement = _this.findListElement(_this.mainList, 'li', 'data-value', currentValue_1);
1775
2233
  element_1.setAttribute('aria-selected', 'false');
1776
2234
  removeClass([element_1], className);
1777
2235
  if (hideElement) {
@@ -1785,15 +2243,16 @@ var MultiSelect = /** @class */ (function (_super) {
1785
2243
  });
1786
2244
  _this.invokeCheckboxSelection(element_1, eve, isClearAll);
1787
2245
  }
2246
+ var currentValue_2 = _this.allowObjectBinding ? getValue(((_this.fields.value) ? _this.fields.value : ''), value) : value;
1788
2247
  if (_this.hideSelectedItem && _this.fields.groupBy && element_1) {
1789
- _this.hideGroupItem(value);
2248
+ _this.hideGroupItem(currentValue_2);
1790
2249
  }
1791
2250
  if (_this.hideSelectedItem && _this.fixedHeaderElement && _this.fields.groupBy && _this.mode !== 'CheckBox' &&
1792
2251
  _this.isPopupOpen()) {
1793
2252
  _super.prototype.scrollStop.call(_this);
1794
2253
  }
1795
- _this.updateMainList(true, value);
1796
- _this.removeChip(value);
2254
+ _this.updateMainList(true, currentValue_2);
2255
+ _this.removeChip(currentValue_2, isClearAll);
1797
2256
  _this.updateChipStatus();
1798
2257
  var limit = _this.value && _this.value.length ? _this.value.length : 0;
1799
2258
  if (limit < _this.maximumSelectionLength) {
@@ -1829,6 +2288,14 @@ var MultiSelect = /** @class */ (function (_super) {
1829
2288
  if (isClearAll && (length === 1 || length === null)) {
1830
2289
  _this.clearAllCallback(eve, isClearAll);
1831
2290
  }
2291
+ if (_this.isPopupOpen() && element_1 && element_1.parentElement.classList.contains('e-reorder')) {
2292
+ if (_this.hideSelectedItem && _this.value && Array.isArray(_this.value) && _this.value.length > 0) {
2293
+ _this.totalItemsCount();
2294
+ }
2295
+ _this.notify("setCurrentViewDataAsync", {
2296
+ module: "VirtualScroll",
2297
+ });
2298
+ }
1832
2299
  }
1833
2300
  });
1834
2301
  }
@@ -1859,11 +2326,16 @@ var MultiSelect = /** @class */ (function (_super) {
1859
2326
  }
1860
2327
  }
1861
2328
  };
1862
- MultiSelect.prototype.removeChip = function (value) {
2329
+ MultiSelect.prototype.removeChip = function (value, isClearAll) {
1863
2330
  if (this.chipCollectionWrapper) {
1864
- var element = this.findListElement(this.chipCollectionWrapper, 'span', 'data-value', value);
1865
- if (element) {
1866
- remove(element);
2331
+ if (this.enableVirtualization && isClearAll) {
2332
+ var childElements = this.chipCollectionWrapper.querySelectorAll('.e-chips');
2333
+ }
2334
+ else {
2335
+ var element = this.findListElement(this.chipCollectionWrapper, 'span', 'data-value', value);
2336
+ if (element) {
2337
+ remove(element);
2338
+ }
1867
2339
  }
1868
2340
  }
1869
2341
  };
@@ -1897,12 +2369,45 @@ var MultiSelect = /** @class */ (function (_super) {
1897
2369
  this.hideOverAllClear();
1898
2370
  }
1899
2371
  };
2372
+ MultiSelect.prototype.indexOfObjectInArray = function (objectToFind, array) {
2373
+ var _loop_1 = function (i) {
2374
+ var item = array[i];
2375
+ if (Object.keys(objectToFind).every(function (key) { return item.hasOwnProperty(key) && item[key] === objectToFind[key]; })) {
2376
+ return { value: i };
2377
+ }
2378
+ };
2379
+ for (var i = 0; i < array.length; i++) {
2380
+ var state_1 = _loop_1(i);
2381
+ if (typeof state_1 === "object")
2382
+ return state_1.value;
2383
+ }
2384
+ return -1; // Return -1 if the object is not found
2385
+ };
1900
2386
  MultiSelect.prototype.addValue = function (value, text, eve) {
1901
2387
  if (!this.value) {
1902
2388
  this.value = [];
1903
2389
  }
1904
- if (this.value.indexOf(value) < 0) {
1905
- this.setProperties({ value: [].concat([], this.value, [value]) }, true);
2390
+ var currentValue = this.allowObjectBinding ? this.getDataByValue(value) : value;
2391
+ if ((this.allowObjectBinding && !this.isObjectInArray(value, this.value)) || (!this.allowObjectBinding && this.value.indexOf(currentValue) < 0)) {
2392
+ this.setProperties({ value: [].concat([], this.value, [currentValue]) }, true);
2393
+ if (this.enableVirtualization) {
2394
+ var data = this.viewWrapper.innerHTML;
2395
+ var temp = void 0;
2396
+ data += (this.value.length === 1) ? '' : this.delimiterChar + ' ';
2397
+ temp = this.getOverflowVal(this.value.length - 1);
2398
+ data += temp;
2399
+ temp = this.viewWrapper.innerHTML;
2400
+ this.updateWrapperText(this.viewWrapper, data);
2401
+ }
2402
+ if (this.enableVirtualization && this.mode === 'CheckBox') {
2403
+ var temp = void 0;
2404
+ var currentText = [];
2405
+ var value_1 = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), this.value[this.value.length - 1]) : this.value[this.value.length - 1];
2406
+ temp = this.getTextByValue(value_1);
2407
+ var textValues = this.text != null ? this.text + ',' + temp : temp;
2408
+ currentText.push(textValues);
2409
+ this.setProperties({ text: currentText.toString() }, true);
2410
+ }
1906
2411
  }
1907
2412
  var element = this.findListElement(this.list, 'li', 'data-value', value);
1908
2413
  this.removeFocus();
@@ -1931,6 +2436,7 @@ var MultiSelect = /** @class */ (function (_super) {
1931
2436
  var _this = this;
1932
2437
  var list = this.listData;
1933
2438
  if (this.initStatus && !isNotTrigger) {
2439
+ value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), value) : value;
1934
2440
  var val_2 = this.getDataByValue(value);
1935
2441
  var eventArgs = {
1936
2442
  e: eve,
@@ -1959,7 +2465,10 @@ var MultiSelect = /** @class */ (function (_super) {
1959
2465
  if (_this.allowCustomValue && _this.isServerRendered && _this.listData !== list) {
1960
2466
  _this.listData = list;
1961
2467
  }
1962
- _this.updateListSelectEventCallback(value, element, eve);
2468
+ value = _this.allowObjectBinding ? _this.getDataByValue(value) : value;
2469
+ if ((_this.enableVirtualization && value) || !_this.enableVirtualization) {
2470
+ _this.updateListSelectEventCallback(value, element, eve);
2471
+ }
1963
2472
  if (_this.hideSelectedItem && _this.fixedHeaderElement && _this.fields.groupBy && _this.mode !== 'CheckBox') {
1964
2473
  _super.prototype.scrollStop.call(_this);
1965
2474
  }
@@ -2044,7 +2553,7 @@ var MultiSelect = /** @class */ (function (_super) {
2044
2553
  chipContent.innerText = data;
2045
2554
  }
2046
2555
  else {
2047
- chipContent.innerHTML = this.encodeHtmlEntities(data);
2556
+ chipContent.innerHTML = this.encodeHtmlEntities(data.toString());
2048
2557
  }
2049
2558
  chip.appendChild(chipContent);
2050
2559
  var eventArgs = {
@@ -2130,6 +2639,37 @@ var MultiSelect = /** @class */ (function (_super) {
2130
2639
  overAllHeight -= this.header.offsetHeight;
2131
2640
  }
2132
2641
  append([this.list], this.popupWrapper);
2642
+ if (!this.list.classList.contains(dropDownBaseClasses.noData) && this.getItems()[1]) {
2643
+ this.listItemHeight = this.getItems()[1].offsetHeight;
2644
+ }
2645
+ if (this.enableVirtualization && !this.list.classList.contains(dropDownBaseClasses.noData)) {
2646
+ if (!this.list.querySelector('.e-virtual-ddl-content') && this.list.querySelector('.e-list-parent')) {
2647
+ this.list.appendChild(this.createElement('div', {
2648
+ className: 'e-virtual-ddl-content',
2649
+ styles: this.getTransformValues()
2650
+ })).appendChild(this.list.querySelector('.e-list-parent'));
2651
+ }
2652
+ else if (this.list.querySelector('.e-virtual-ddl-content')) {
2653
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2654
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
2655
+ }
2656
+ this.UpdateSkeleton();
2657
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
2658
+ this.virtualItemCount = this.itemCount;
2659
+ if (this.mode !== 'CheckBox') {
2660
+ this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length : this.totalItemCount;
2661
+ }
2662
+ if (!this.list.querySelector('.e-virtual-ddl')) {
2663
+ var virualElement = this.createElement('div', {
2664
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
2665
+ });
2666
+ this.popupWrapper.querySelector('.e-dropdownbase').appendChild(virualElement);
2667
+ }
2668
+ else {
2669
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2670
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
2671
+ }
2672
+ }
2133
2673
  if (this.footerTemplate) {
2134
2674
  this.setFooterTemplate();
2135
2675
  overAllHeight -= this.footer.offsetHeight;
@@ -2202,21 +2742,41 @@ var MultiSelect = /** @class */ (function (_super) {
2202
2742
  }
2203
2743
  _this.popupObj.wireScrollEvents();
2204
2744
  if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
2205
- _this.targetElement().trim() !== '')) {
2745
+ _this.targetElement().trim() !== '') && !_this.enableVirtualization) {
2206
2746
  _this.loadTemplate();
2747
+ if (_this.enableVirtualization && _this.mode === 'CheckBox') {
2748
+ _this.UpdateSkeleton();
2749
+ }
2207
2750
  }
2751
+ _this.isPreventScrollAction = true;
2208
2752
  _this.setScrollPosition();
2209
2753
  if (_this.allowFiltering) {
2210
2754
  _this.notify('inputFocus', {
2211
2755
  module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'focus'
2212
2756
  });
2213
2757
  }
2758
+ if (_this.enableVirtualization) {
2759
+ _this.notify("bindScrollEvent", {
2760
+ module: "VirtualScroll",
2761
+ component: _this.getModuleName(),
2762
+ enable: _this.enableVirtualization,
2763
+ });
2764
+ setTimeout(function () {
2765
+ if (_this.value) {
2766
+ _this.updateSelectionList();
2767
+ }
2768
+ else if (_this.viewPortInfo && _this.viewPortInfo.offsets.top) {
2769
+ _this.list.scrollTop = _this.viewPortInfo.offsets.top;
2770
+ }
2771
+ }, 5);
2772
+ }
2214
2773
  }, targetExitViewport: function () {
2215
2774
  if (!Browser.isDevice) {
2216
2775
  _this.hidePopup();
2217
2776
  }
2218
2777
  }
2219
2778
  });
2779
+ this.popupContentElement = this.popupObj.element.querySelector('.e-content');
2220
2780
  if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
2221
2781
  this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
2222
2782
  }
@@ -2274,6 +2834,53 @@ var MultiSelect = /** @class */ (function (_super) {
2274
2834
  append([this.footer], this.popupWrapper);
2275
2835
  EventHandler.add(this.footer, 'mousedown', this.onListMouseDown, this);
2276
2836
  };
2837
+ MultiSelect.prototype.updateInitialData = function () {
2838
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2839
+ var currentData = this.selectData;
2840
+ var ulElement = this.renderItems(currentData, this.fields);
2841
+ this.list.scrollTop = 0;
2842
+ this.virtualListInfo = {
2843
+ currentPageNumber: null,
2844
+ direction: null,
2845
+ sentinelInfo: {},
2846
+ offsets: {},
2847
+ startIndex: 0,
2848
+ endIndex: 0,
2849
+ };
2850
+ this.previousStartIndex = 0;
2851
+ this.previousEndIndex = 0;
2852
+ if (this.dataSource instanceof DataManager) {
2853
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2854
+ this.totalItemCount = this.dataCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
2855
+ }
2856
+ else {
2857
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2858
+ this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2859
+ }
2860
+ if (this.mode !== 'CheckBox') {
2861
+ this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length : this.totalItemCount;
2862
+ }
2863
+ this.getSkeletonCount();
2864
+ this.UpdateSkeleton();
2865
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2866
+ if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
2867
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2868
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
2869
+ }
2870
+ else if (!this.list.querySelector('.e-virtual-ddl') && this.skeletonCount > 0) {
2871
+ var virualElement = this.createElement('div', {
2872
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
2873
+ });
2874
+ this.popupWrapper.querySelector('.e-dropdownbase').appendChild(virualElement);
2875
+ }
2876
+ this.listData = currentData;
2877
+ this.liCollections = this.list.querySelectorAll('.e-list-item');
2878
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2879
+ if (this.list.getElementsByClassName('e-virtual-ddl-content')[0]) {
2880
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2881
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
2882
+ }
2883
+ };
2277
2884
  MultiSelect.prototype.clearAll = function (e) {
2278
2885
  if (this.enabled && !this.readonly) {
2279
2886
  var temp = void 0;
@@ -2294,6 +2901,24 @@ var MultiSelect = /** @class */ (function (_super) {
2294
2901
  else {
2295
2902
  this.clearAllCallback(e);
2296
2903
  }
2904
+ this.checkAndResetCache();
2905
+ if (this.enableVirtualization) {
2906
+ this.updateInitialData();
2907
+ if (this.chipCollectionWrapper) {
2908
+ this.chipCollectionWrapper.innerHTML = '';
2909
+ }
2910
+ if (!this.isCustomDataUpdated) {
2911
+ this.notify("setGeneratedData", {
2912
+ module: "VirtualScroll",
2913
+ });
2914
+ }
2915
+ }
2916
+ if (this.enableVirtualization) {
2917
+ this.list.scrollTop = 0;
2918
+ this.virtualListInfo = null;
2919
+ this.previousStartIndex = 0;
2920
+ this.previousEndIndex = 0;
2921
+ }
2297
2922
  }
2298
2923
  };
2299
2924
  MultiSelect.prototype.clearAllCallback = function (e, isClearAll) {
@@ -2394,6 +3019,8 @@ var MultiSelect = /** @class */ (function (_super) {
2394
3019
  MultiSelect.prototype.search = function (e) {
2395
3020
  var _this = this;
2396
3021
  this.resetFilteredData = true;
3022
+ this.preventSetCurrentData = false;
3023
+ this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
2397
3024
  if (!isNullOrUndefined(e)) {
2398
3025
  this.keyCode = e.keyCode;
2399
3026
  }
@@ -2410,6 +3037,9 @@ var MultiSelect = /** @class */ (function (_super) {
2410
3037
  if (this.allowCustomValue) {
2411
3038
  this.isRemoteSelection = true;
2412
3039
  }
3040
+ if (!this.backCommand) {
3041
+ this.checkAndResetCache();
3042
+ }
2413
3043
  var eventArgs_1 = {
2414
3044
  preventDefaultAction: false,
2415
3045
  text: this.targetElement(),
@@ -2436,12 +3066,83 @@ var MultiSelect = /** @class */ (function (_super) {
2436
3066
  else if (this.allowCustomValue) {
2437
3067
  var query = new Query();
2438
3068
  query = this.allowFiltering && (text !== '') ? query.where(this.fields.text, 'startswith', text, this.ignoreCase, this.ignoreAccent) : query;
2439
- this.dataUpdater(this.mainData, query, this.fields);
3069
+ if (this.enableVirtualization) {
3070
+ if (this.dataSource instanceof DataManager) {
3071
+ this.dataUpdater(this.virtualGroupDataSource, query, this.fields);
3072
+ }
3073
+ else {
3074
+ this.dataUpdater(this.dataSource, query, this.fields);
3075
+ }
3076
+ }
3077
+ else {
3078
+ this.dataUpdater(this.mainData, query, this.fields);
3079
+ }
3080
+ this.UpdateSkeleton();
2440
3081
  }
2441
3082
  else {
2442
3083
  var liCollections = this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-hide-listitem)');
3084
+ var type = this.typeOfData(this.listData).typeof;
2443
3085
  var activeElement = Search(this.targetElement(), liCollections, 'StartsWith', this.ignoreCase);
2444
- if (activeElement && activeElement.item !== null) {
3086
+ if (this.enableVirtualization && this.targetElement().trim() !== '' && !this.allowFiltering) {
3087
+ var updatingincrementalindex = false;
3088
+ if ((this.viewPortInfo.endIndex >= this.incrementalEndIndex && this.incrementalEndIndex <= this.totalItemCount) || this.incrementalEndIndex == 0) {
3089
+ updatingincrementalindex = true;
3090
+ this.incrementalStartIndex = 0;
3091
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
3092
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
3093
+ updatingincrementalindex = false;
3094
+ }
3095
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
3096
+ this.updateIncrementalView(0, this.itemCount);
3097
+ }
3098
+ activeElement = Search(this.targetElement(), this.incrementalLiCollections, this.filterType, true, this.listData, this.fields, type);
3099
+ while (isNullOrUndefined(activeElement) && this.incrementalEndIndex < this.totalItemCount) {
3100
+ this.incrementalStartIndex = this.incrementalEndIndex;
3101
+ this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
3102
+ this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
3103
+ updatingincrementalindex = true;
3104
+ if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
3105
+ this.updateIncrementalView(0, this.itemCount);
3106
+ }
3107
+ activeElement = Search(this.targetElement(), this.incrementalLiCollections, this.filterType, true, this.listData, this.fields, type);
3108
+ if (!isNullOrUndefined(activeElement)) {
3109
+ break;
3110
+ }
3111
+ if (isNullOrUndefined(activeElement) && this.incrementalEndIndex >= this.totalItemCount) {
3112
+ this.incrementalStartIndex = 0;
3113
+ this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
3114
+ break;
3115
+ }
3116
+ }
3117
+ if (activeElement.index) {
3118
+ if ((!(this.viewPortInfo.startIndex >= activeElement.index)) || (!(activeElement.index >= this.viewPortInfo.endIndex))) {
3119
+ var startIndex = activeElement.index - ((this.itemCount / 2) - 2) > 0 ? activeElement.index - ((this.itemCount / 2) - 2) : 0;
3120
+ var endIndex = startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : startIndex + this.itemCount;
3121
+ if (startIndex != this.viewPortInfo.startIndex) {
3122
+ this.updateIncrementalView(startIndex, endIndex);
3123
+ }
3124
+ }
3125
+ }
3126
+ if (!isNullOrUndefined(activeElement.item)) {
3127
+ var index_1 = this.getIndexByValue(activeElement.item.getAttribute('data-value')) - this.skeletonCount;
3128
+ if (index_1 > this.itemCount / 2) {
3129
+ var startIndex = this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) < this.totalItemCount ? this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) : this.totalItemCount;
3130
+ var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
3131
+ this.updateIncrementalView(startIndex, endIndex);
3132
+ }
3133
+ activeElement.item = this.getElementByValue(activeElement.item.getAttribute('data-value'));
3134
+ }
3135
+ else {
3136
+ this.updateIncrementalView(0, this.itemCount);
3137
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3138
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3139
+ this.list.scrollTop = 0;
3140
+ }
3141
+ if (activeElement && activeElement.item) {
3142
+ activeElement.item = this.getElementByValue(activeElement.item.getAttribute('data-value'));
3143
+ }
3144
+ }
3145
+ if (activeElement && activeElement.item) {
2445
3146
  this.addListFocus(activeElement.item);
2446
3147
  this.list.scrollTop =
2447
3148
  activeElement.item.offsetHeight * activeElement.index;
@@ -2454,11 +3155,15 @@ var MultiSelect = /** @class */ (function (_super) {
2454
3155
  }
2455
3156
  }
2456
3157
  }
3158
+ if (this.enableVirtualization && this.allowFiltering) {
3159
+ this.getFilteringSkeletonCount();
3160
+ }
2457
3161
  };
2458
3162
  MultiSelect.prototype.preRender = function () {
2459
3163
  if (this.allowFiltering === null) {
2460
3164
  this.allowFiltering = (this.mode === 'CheckBox') ? true : false;
2461
3165
  }
3166
+ this.preventSetCurrentData = false;
2462
3167
  this.initializeData();
2463
3168
  this.updateDataAttribute(this.htmlAttributes);
2464
3169
  _super.prototype.preRender.call(this);
@@ -2480,6 +3185,14 @@ var MultiSelect = /** @class */ (function (_super) {
2480
3185
  this.isCustomRendered = false;
2481
3186
  this.isRemoteSelection = false;
2482
3187
  this.isSelectAllTarget = true;
3188
+ this.viewPortInfo = {
3189
+ currentPageNumber: null,
3190
+ direction: null,
3191
+ sentinelInfo: {},
3192
+ offsets: {},
3193
+ startIndex: 0,
3194
+ endIndex: this.itemCount,
3195
+ };
2483
3196
  };
2484
3197
  MultiSelect.prototype.updateData = function (delimiterChar, e) {
2485
3198
  var data = '';
@@ -2487,7 +3200,9 @@ var MultiSelect = /** @class */ (function (_super) {
2487
3200
  var text = [];
2488
3201
  var temp;
2489
3202
  var tempData = this.listData;
2490
- this.listData = this.mainData;
3203
+ if (!this.enableVirtualization) {
3204
+ this.listData = this.mainData;
3205
+ }
2491
3206
  if (!isNullOrUndefined(this.hiddenElement)) {
2492
3207
  this.hiddenElement.innerHTML = '';
2493
3208
  }
@@ -2495,16 +3210,32 @@ var MultiSelect = /** @class */ (function (_super) {
2495
3210
  var valueLength = this.value.length;
2496
3211
  var hiddenElementContent = '';
2497
3212
  for (var index = 0; index < valueLength; index++) {
2498
- var valueItem = this.value[index];
3213
+ var valueItem = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[index]) : this.value[index];
2499
3214
  var listValue = this.findListElement((!isNullOrUndefined(this.mainList) ? this.mainList : this.ulElement), 'li', 'data-value', valueItem);
2500
- if (isNullOrUndefined(listValue) && !this.allowCustomValue) {
3215
+ if (this.enableVirtualization) {
3216
+ listValue = this.findListElement((!isNullOrUndefined(this.list) ? this.list : this.ulElement), 'li', 'data-value', valueItem);
3217
+ }
3218
+ if (isNullOrUndefined(listValue) && !this.allowCustomValue && !this.enableVirtualization) {
2501
3219
  this.value.splice(index, 1);
2502
3220
  index -= 1;
2503
3221
  valueLength -= 1;
2504
3222
  }
2505
3223
  else {
2506
3224
  if (this.listData) {
2507
- temp = this.getTextByValue(valueItem);
3225
+ if (this.enableVirtualization) {
3226
+ if (delim) {
3227
+ data = this.delimiterWrapper && this.delimiterWrapper.innerHTML == "" ? data : this.delimiterWrapper.innerHTML;
3228
+ }
3229
+ var value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), this.value[this.value.length - 1]) : this.value[this.value.length - 1];
3230
+ temp = this.getTextByValue(value);
3231
+ var textValues = this.text != null && this.text != "" ? this.text + ',' + temp : temp;
3232
+ data += temp + delimiterChar + ' ';
3233
+ text.push(textValues);
3234
+ break;
3235
+ }
3236
+ else {
3237
+ temp = this.getTextByValue(valueItem);
3238
+ }
2508
3239
  }
2509
3240
  else {
2510
3241
  temp = valueItem;
@@ -2518,7 +3249,10 @@ var MultiSelect = /** @class */ (function (_super) {
2518
3249
  this.hiddenElement.innerHTML = hiddenElementContent;
2519
3250
  }
2520
3251
  }
2521
- this.setProperties({ text: text.toString() }, true);
3252
+ var isChipRemove = e && e.target && e.target.classList.contains('e-chips-close');
3253
+ if (!this.enableVirtualization || (this.enableVirtualization && this.mode !== 'CheckBox' && !isChipRemove)) {
3254
+ this.setProperties({ text: text.toString() }, true);
3255
+ }
2522
3256
  if (delim) {
2523
3257
  this.updateWrapperText(this.delimiterWrapper, data);
2524
3258
  this.delimiterWrapper.setAttribute('id', getUniqueID('delim_val'));
@@ -2547,7 +3281,8 @@ var MultiSelect = /** @class */ (function (_super) {
2547
3281
  }
2548
3282
  }
2549
3283
  if (textVal && textVal.length) {
2550
- this.setProperties({ value: textVal }, true);
3284
+ var value = this.allowObjectBinding ? this.getDataByValue(textVal) : textVal;
3285
+ this.setProperties({ value: value }, true);
2551
3286
  }
2552
3287
  }
2553
3288
  else {
@@ -2560,10 +3295,12 @@ var MultiSelect = /** @class */ (function (_super) {
2560
3295
  isEmptyData = true;
2561
3296
  }
2562
3297
  _super.prototype.render.call(this, null, isEmptyData);
3298
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3299
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
2563
3300
  this.unwireListEvents();
2564
3301
  this.wireListEvents();
2565
3302
  };
2566
- MultiSelect.prototype.initialValueUpdate = function () {
3303
+ MultiSelect.prototype.initialValueUpdate = function (listItems) {
2567
3304
  if (this.list) {
2568
3305
  var text = void 0;
2569
3306
  var element = void 0;
@@ -2574,12 +3311,34 @@ var MultiSelect = /** @class */ (function (_super) {
2574
3311
  this.removeListSelection();
2575
3312
  if (!isNullOrUndefined(this.value)) {
2576
3313
  for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
2577
- value = this.value[index];
3314
+ value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), this.value[index]) : this.value[index];
2578
3315
  element = this.findListElement(this.hideSelectedItem ? this.ulElement : this.list, 'li', 'data-value', value);
2579
- text = this.getTextByValue(value);
2580
- if ((element && (element.getAttribute('aria-selected') !== 'true')) ||
3316
+ var isCustomData = false;
3317
+ if (this.enableVirtualization) {
3318
+ text = null;
3319
+ if (listItems != null && listItems.length > 0) {
3320
+ for (var i = 0; i < listItems.length; i++) {
3321
+ if (getValue((this.fields.value ? this.fields.value : 'value'), listItems[i]) === value) {
3322
+ text = getValue(this.fields.text, listItems[i]);
3323
+ break;
3324
+ }
3325
+ }
3326
+ }
3327
+ if (isNullOrUndefined(text) && this.allowCustomValue) {
3328
+ text = this.getTextByValue(value);
3329
+ isCustomData = true;
3330
+ }
3331
+ }
3332
+ else {
3333
+ text = this.getTextByValue(value);
3334
+ }
3335
+ if (((element && (element.getAttribute('aria-selected') !== 'true')) ||
2581
3336
  (element && (element.getAttribute('aria-selected') === 'true' && this.hideSelectedItem) &&
2582
- (this.mode === 'Box' || this.mode === 'Default'))) {
3337
+ (this.mode === 'Box' || this.mode === 'Default'))) || (this.enableVirtualization && value != null && text != null && !isCustomData)) {
3338
+ var currentText = [];
3339
+ var textValues = this.text != null ? this.text + ',' + text : text;
3340
+ currentText.push(textValues);
3341
+ this.setProperties({ text: currentText.toString() }, true);
2583
3342
  this.addChip(text, value);
2584
3343
  this.addListSelection(element);
2585
3344
  }
@@ -2590,12 +3349,24 @@ var MultiSelect = /** @class */ (function (_super) {
2590
3349
  setValue(this.fields.value, value, newValue);
2591
3350
  var noDataEle = this.popupWrapper.querySelector('.' + dropDownBaseClasses.noData);
2592
3351
  this.addItem(newValue, indexItem);
3352
+ if (this.enableVirtualization) {
3353
+ if (this.virtualCustomSelectData && this.virtualCustomSelectData.length >= 0) {
3354
+ this.virtualCustomSelectData.push(newValue);
3355
+ }
3356
+ else {
3357
+ this.virtualCustomSelectData = [newValue];
3358
+ }
3359
+ }
2593
3360
  element = element ? element : this.findListElement(this.hideSelectedItem ? this.ulElement : this.list, 'li', 'data-value', value);
2594
3361
  if (this.popupWrapper.contains(noDataEle)) {
2595
3362
  this.list.setAttribute('style', noDataEle.getAttribute('style'));
2596
3363
  this.popupWrapper.replaceChild(this.list, noDataEle);
2597
3364
  this.wireListEvents();
2598
3365
  }
3366
+ var currentText = [];
3367
+ var textValues = this.text != null ? this.text + ',' + text : text;
3368
+ currentText.push(textValues);
3369
+ this.setProperties({ text: currentText.toString() }, true);
2599
3370
  this.addChip(text, value);
2600
3371
  this.addListSelection(element);
2601
3372
  }
@@ -2625,7 +3396,7 @@ var MultiSelect = /** @class */ (function (_super) {
2625
3396
  };
2626
3397
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2627
3398
  MultiSelect.prototype.updateActionCompleteData = function (li, item) {
2628
- if (this.value && this.value.indexOf(li.getAttribute('data-value')) > -1) {
3399
+ if (this.value && ((!this.allowObjectBinding && this.value.indexOf(li.getAttribute('data-value')) > -1) || (this.allowObjectBinding && this.isObjectInArray(this.getDataByValue(li.getAttribute('data-value')), this.value)))) {
2629
3400
  this.mainList = this.ulElement;
2630
3401
  if (this.hideSelectedItem) {
2631
3402
  addClass([li], HIDE_LIST);
@@ -2663,13 +3434,13 @@ var MultiSelect = /** @class */ (function (_super) {
2663
3434
  };
2664
3435
  MultiSelect.prototype.updateListSelection = function (li, e, length) {
2665
3436
  var customVal = li.getAttribute('data-value');
2666
- var value = this.getFormattedValue(customVal);
3437
+ var value = this.allowObjectBinding ? this.getDataByValue(customVal) : this.getFormattedValue(customVal);
2667
3438
  if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
2668
3439
  (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
2669
3440
  value = customVal;
2670
3441
  }
2671
3442
  this.removeHover();
2672
- if (!this.value || this.value.indexOf(value) === -1) {
3443
+ if (!this.value || ((!this.allowObjectBinding && this.value.indexOf(value) === -1) || (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) === -1))) {
2673
3444
  this.dispatchSelect(value, e, li, (li.getAttribute('aria-selected') === 'true'), length);
2674
3445
  }
2675
3446
  else {
@@ -2678,9 +3449,10 @@ var MultiSelect = /** @class */ (function (_super) {
2678
3449
  };
2679
3450
  MultiSelect.prototype.updateListSelectEventCallback = function (value, li, e) {
2680
3451
  var _this = this;
3452
+ value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), value) : value;
2681
3453
  var text = this.getTextByValue(value);
2682
- if ((this.allowCustomValue || this.allowFiltering) && !this.findListElement(this.mainList, 'li', 'data-value', value)) {
2683
- var temp_1 = li.cloneNode(true);
3454
+ if ((this.allowCustomValue || this.allowFiltering) && !this.findListElement(this.mainList, 'li', 'data-value', value) && (!this.enableVirtualization || (this.enableVirtualization && this.virtualCustomData))) {
3455
+ var temp_1 = li ? li.cloneNode(true) : li;
2684
3456
  var fieldValue = this.fields.value ? this.fields.value : 'value';
2685
3457
  if (this.allowCustomValue && this.mainData.length && typeof getValue(fieldValue, this.mainData[0]) === 'number') {
2686
3458
  value = !isNaN(parseFloat(value.toString())) ? parseFloat(value.toString()) : value;
@@ -2692,10 +3464,22 @@ var MultiSelect = /** @class */ (function (_super) {
2692
3464
  };
2693
3465
  this.trigger('customValueSelection', eventArgs, function (eventArgs) {
2694
3466
  if (!eventArgs.cancel) {
2695
- append([temp_1], _this.mainList);
2696
- _this.mainData.push(data_1);
2697
- _this.remoteCustomValue = false;
2698
- _this.addValue(value, text, e);
3467
+ if (_this.enableVirtualization && _this.virtualCustomData) {
3468
+ if (_this.virtualCustomSelectData && _this.virtualCustomSelectData.length >= 0) {
3469
+ _this.virtualCustomSelectData.push(data_1);
3470
+ }
3471
+ else {
3472
+ _this.virtualCustomSelectData = [data_1];
3473
+ }
3474
+ _this.remoteCustomValue = false;
3475
+ _this.addValue(value, text, e);
3476
+ }
3477
+ else {
3478
+ append([temp_1], _this.mainList);
3479
+ _this.mainData.push(data_1);
3480
+ _this.remoteCustomValue = false;
3481
+ _this.addValue(value, text, e);
3482
+ }
2699
3483
  }
2700
3484
  });
2701
3485
  }
@@ -2805,8 +3589,12 @@ var MultiSelect = /** @class */ (function (_super) {
2805
3589
  var _this = this;
2806
3590
  this.keyCode = null;
2807
3591
  this.scrollFocusStatus = false;
3592
+ this.keyboardEvent = null;
2808
3593
  var target = e.target;
2809
3594
  var li = closest(target, '.' + dropDownBaseClasses.li);
3595
+ if (this.enableVirtualization && li && li.classList.contains('e-virtual-list')) {
3596
+ return;
3597
+ }
2810
3598
  var headerLi = closest(target, '.' + dropDownBaseClasses.group);
2811
3599
  if (headerLi && this.enableGroupCheckBox && this.mode === 'CheckBox' && this.fields.groupBy) {
2812
3600
  target = target.classList.contains('e-list-group-item') ? target.firstElementChild.lastElementChild
@@ -2883,6 +3671,39 @@ var MultiSelect = /** @class */ (function (_super) {
2883
3671
  else {
2884
3672
  e.preventDefault();
2885
3673
  }
3674
+ if (this.enableVirtualization && this.hideSelectedItem) {
3675
+ var visibleListElements = this.list.querySelectorAll('li.'
3676
+ + dropDownBaseClasses.li
3677
+ + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)' + ':not(.e-virtual-list)');
3678
+ if (visibleListElements.length) {
3679
+ var actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
3680
+ if (visibleListElements.length < (actualCount + 2)) {
3681
+ var query = this.getForQuery(this.value).clone();
3682
+ query = query.skip(this.virtualItemStartIndex);
3683
+ this.resetList(this.dataSource, this.fields, query);
3684
+ this.UpdateSkeleton();
3685
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
3686
+ this.virtualItemCount = this.itemCount;
3687
+ if (this.mode !== 'CheckBox') {
3688
+ this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length : this.totalItemCount;
3689
+ }
3690
+ if (!this.list.querySelector('.e-virtual-ddl')) {
3691
+ var virualElement = this.createElement('div', {
3692
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
3693
+ });
3694
+ this.popupWrapper.querySelector('.e-dropdownbase').appendChild(virualElement);
3695
+ }
3696
+ else {
3697
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3698
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
3699
+ }
3700
+ if (this.list.querySelector('.e-virtual-ddl-content')) {
3701
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3702
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
3703
+ }
3704
+ }
3705
+ }
3706
+ }
2886
3707
  this.refreshPlaceHolder();
2887
3708
  this.deselectHeader();
2888
3709
  }
@@ -3120,7 +3941,9 @@ var MultiSelect = /** @class */ (function (_super) {
3120
3941
  var remaining = void 0;
3121
3942
  var downIconWidth = 0;
3122
3943
  var overAllContainer = void 0;
3123
- this.updateWrapperText(this.viewWrapper, data);
3944
+ if (!this.enableVirtualization) {
3945
+ this.updateWrapperText(this.viewWrapper, data);
3946
+ }
3124
3947
  var l10nLocale = {
3125
3948
  noRecordsTemplate: 'No records found',
3126
3949
  actionFailureTemplate: 'Request failed',
@@ -3151,11 +3974,21 @@ var MultiSelect = /** @class */ (function (_super) {
3151
3974
  this.checkClearIconWidth();
3152
3975
  if (!isNullOrUndefined(this.value)) {
3153
3976
  for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
3154
- data += (index === 0) ? '' : this.delimiterChar + ' ';
3155
- temp = this.getOverflowVal(index);
3156
- data += temp;
3157
- temp = this.viewWrapper.innerHTML;
3158
- this.updateWrapperText(this.viewWrapper, data);
3977
+ var items = this.text && this.text.split(this.delimiterChar);
3978
+ if (!this.enableVirtualization) {
3979
+ data += (index === 0) ? '' : this.delimiterChar + ' ';
3980
+ temp = this.getOverflowVal(index);
3981
+ data += temp;
3982
+ temp = this.viewWrapper.innerHTML;
3983
+ this.updateWrapperText(this.viewWrapper, data);
3984
+ }
3985
+ else if (items) {
3986
+ data += (index === 0) ? '' : this.delimiterChar + ' ';
3987
+ temp = items[index];
3988
+ data += temp;
3989
+ temp = this.viewWrapper.innerHTML;
3990
+ this.updateWrapperText(this.viewWrapper, data);
3991
+ }
3159
3992
  wrapperleng = this.viewWrapper.offsetWidth +
3160
3993
  parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
3161
3994
  overAllContainer = this.componentWrapper.offsetWidth -
@@ -3258,18 +4091,19 @@ var MultiSelect = /** @class */ (function (_super) {
3258
4091
  MultiSelect.prototype.getOverflowVal = function (index) {
3259
4092
  var temp;
3260
4093
  if (this.mainData && this.mainData.length) {
4094
+ var value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), this.value[index]) : this.value[index];
3261
4095
  if (this.mode === 'CheckBox') {
3262
4096
  var newTemp = this.listData;
3263
4097
  this.listData = this.mainData;
3264
- temp = this.getTextByValue(this.value[index]);
4098
+ temp = this.getTextByValue(value);
3265
4099
  this.listData = newTemp;
3266
4100
  }
3267
4101
  else {
3268
- temp = this.getTextByValue(this.value[index]);
4102
+ temp = this.getTextByValue(value);
3269
4103
  }
3270
4104
  }
3271
4105
  else {
3272
- temp = this.value[index];
4106
+ temp = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), this.value[index]) : this.value[index];
3273
4107
  }
3274
4108
  return temp;
3275
4109
  };
@@ -3387,8 +4221,8 @@ var MultiSelect = /** @class */ (function (_super) {
3387
4221
  preventSelectEvent: false
3388
4222
  };
3389
4223
  this.trigger('beforeSelectAll', beforeSelectArgs);
3390
- if (li && li.length) {
3391
- var index_1 = 0;
4224
+ if ((li && li.length) || (this.enableVirtualization && !state)) {
4225
+ var index_2 = 0;
3392
4226
  var count_1 = 0;
3393
4227
  if (this.enableGroupCheckBox) {
3394
4228
  count_1 = state ? this.maximumSelectionLength - (this.value ? this.value.length : 0) : li.length;
@@ -3397,62 +4231,153 @@ var MultiSelect = /** @class */ (function (_super) {
3397
4231
  count_1 = state ? this.maximumSelectionLength - (this.value ? this.value.length : 0) : this.maximumSelectionLength;
3398
4232
  }
3399
4233
  if (!beforeSelectArgs.preventSelectEvent) {
3400
- this.isSelectAllTarget = (length === index_1 + 1);
3401
- while (index_1 < length && index_1 <= 50 && index_1 < count_1) {
3402
- this.updateListSelection(li[index_1], event, length - index_1);
3403
- if (this.enableGroupCheckBox) {
3404
- this.findGroupStart(li[index_1]);
3405
- }
3406
- index_1++;
3407
- }
3408
- if (length > 50) {
3409
- setTimeout(function () {
3410
- while (index_1 < length && index_1 < count_1) {
3411
- _this.isSelectAllTarget = (length === index_1 + 1);
3412
- _this.updateListSelection(li[index_1], event, length - index_1);
3413
- if (_this.enableGroupCheckBox) {
3414
- _this.findGroupStart(li[index_1]);
4234
+ if (this.enableVirtualization) {
4235
+ if (state) {
4236
+ this.virtualSelectAll = true;
4237
+ this.resetList(this.dataSource, this.fields, new Query().skip(this.viewPortInfo.startIndex));
4238
+ if (this.virtualSelectAllData instanceof Array) {
4239
+ for (var i = 0; i < this.virtualSelectAllData.length; i++) {
4240
+ if (li[this.skeletonCount + i]) {
4241
+ var value_2 = this.allowObjectBinding ? this.getDataByValue(li[this.skeletonCount + i].getAttribute('data-value')) : this.getFormattedValue(li[this.skeletonCount + i].getAttribute('data-value'));
4242
+ if (((!this.allowObjectBinding && this.value && this.value.indexOf(value_2) === 1) || (this.allowObjectBinding && this.indexOfObjectInArray(value_2, this.value) === 1))) {
4243
+ continue;
4244
+ }
4245
+ this.updateListSelection(li[this.skeletonCount + i], event, length - i);
4246
+ }
4247
+ else {
4248
+ if (this.fields) {
4249
+ var value_3 = getValue(this.fields.value, this.virtualSelectAllData[i]);
4250
+ value_3 = this.allowObjectBinding ? this.getDataByValue(value_3) : value_3;
4251
+ if (((!this.allowObjectBinding && this.value && this.value.indexOf(value_3) === 1) || (this.allowObjectBinding && this.indexOfObjectInArray(value_3, this.value) === 1))) {
4252
+ continue;
4253
+ }
4254
+ if (this.value && value_3 != null && Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value_3) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value_3, this.value)))) {
4255
+ this.dispatchSelect(value_3, event, null, false, length);
4256
+ }
4257
+ }
4258
+ }
4259
+ }
4260
+ if (this.virtualSelectAllData && this.value.length != this.virtualSelectAllData.length && this.virtualItemStartIndex != 0) {
4261
+ if (this.virtualItemStartIndex > this.itemCount) {
4262
+ for (var i = 0; i < this.itemCount; i++) {
4263
+ if (this.fields) {
4264
+ var value_4 = getValue(this.fields.value, this.virtualSelectAllData[i]);
4265
+ value_4 = this.allowObjectBinding ? this.getDataByValue(value_4) : value_4;
4266
+ if (this.value && value_4 != null && Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value_4) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value_4, this.value)))) {
4267
+ this.setProperties({ value: [].concat([], this.value, this.allowObjectBinding ? [this.virtualSelectAllData[i]] : [value_4]) }, true);
4268
+ }
4269
+ }
4270
+ }
4271
+ }
4272
+ }
4273
+ else {
4274
+ for (var i = 0; i < this.virtualItemStartIndex; i++) {
4275
+ if (this.fields) {
4276
+ var value = getValue(this.fields.value, this.virtualSelectAllData[i]);
4277
+ value = this.allowObjectBinding ? this.getDataByValue(value) : value;
4278
+ if (Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value, this.value)))) {
4279
+ this.setProperties({ value: [].concat([], this.value, this.allowObjectBinding ? [this.virtualSelectAllData[i]] : [value]) }, true);
4280
+ }
4281
+ }
4282
+ }
3415
4283
  }
3416
- index_1++;
3417
4284
  }
3418
- _this.updatedataValueItems(event);
3419
- if (!_this.changeOnBlur) {
3420
- _this.updateValueState(event, _this.value, _this.tempValues);
3421
- _this.isSelectAll = _this.isSelectAll ? !_this.isSelectAll : _this.isSelectAll;
4285
+ }
4286
+ else {
4287
+ while (index_2 < this.value.length && index_2 <= 50 && index_2 < count_1 && this.value.length > 0) {
4288
+ this.removeValue(this.value[index_2], event, this.value.length - index_2);
4289
+ index_2++;
3422
4290
  }
3423
- _this.updateHiddenElement();
3424
- if (_this.popupWrapper && li[index_1 - 1].classList.contains('e-item-focus')) {
3425
- var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
3426
- if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
3427
- li[index_1 - 1].classList.remove('e-item-focus');
3428
- }
4291
+ if (length > 50) {
4292
+ setTimeout(function () {
4293
+ while (index_2 < _this.value.length && index_2 < count_1 && _this.value.length > 0) {
4294
+ _this.removeValue(value[index_2], event, _this.value.length - index_2);
4295
+ index_2++;
4296
+ }
4297
+ _this.updatedataValueItems(event);
4298
+ if (!_this.changeOnBlur) {
4299
+ _this.updateValueState(event, _this.value, _this.tempValues);
4300
+ _this.isSelectAll = _this.isSelectAll ? !_this.isSelectAll : _this.isSelectAll;
4301
+ }
4302
+ _this.updateHiddenElement();
4303
+ }, 0);
4304
+ }
4305
+ this.value = [];
4306
+ this.virtualSelectAll = false;
4307
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4308
+ var ulElement = this.renderItems(this.listData, this.fields);
4309
+ }
4310
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4311
+ var virtualTrackElement = this.list.getElementsByClassName('e-virtual-ddl')[0];
4312
+ if (virtualTrackElement) {
4313
+ (virtualTrackElement).style = this.GetVirtualTrackHeight();
4314
+ }
4315
+ this.UpdateSkeleton();
4316
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4317
+ var virtualContentElement = this.list.getElementsByClassName('e-virtual-ddl-content')[0];
4318
+ if (virtualContentElement) {
4319
+ (virtualContentElement).style = this.getTransformValues();
4320
+ }
4321
+ }
4322
+ else {
4323
+ while (index_2 < length && index_2 <= 50 && index_2 < count_1) {
4324
+ this.isSelectAllTarget = (length === index_2 + 1);
4325
+ this.updateListSelection(li[index_2], event, length - index_2);
4326
+ if (this.enableGroupCheckBox) {
4327
+ this.findGroupStart(li[index_2]);
3429
4328
  }
3430
- }, 0);
4329
+ index_2++;
4330
+ }
4331
+ if (length > 50) {
4332
+ setTimeout(function () {
4333
+ while (index_2 < length && index_2 < count_1) {
4334
+ _this.isSelectAllTarget = (length === index_2 + 1);
4335
+ _this.updateListSelection(li[index_2], event, length - index_2);
4336
+ if (_this.enableGroupCheckBox) {
4337
+ _this.findGroupStart(li[index_2]);
4338
+ }
4339
+ index_2++;
4340
+ }
4341
+ _this.updatedataValueItems(event);
4342
+ if (!_this.changeOnBlur) {
4343
+ _this.updateValueState(event, _this.value, _this.tempValues);
4344
+ _this.isSelectAll = _this.isSelectAll ? !_this.isSelectAll : _this.isSelectAll;
4345
+ }
4346
+ _this.updateHiddenElement();
4347
+ if (_this.popupWrapper && li[index_2 - 1].classList.contains('e-item-focus')) {
4348
+ var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
4349
+ if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
4350
+ li[index_2 - 1].classList.remove('e-item-focus');
4351
+ }
4352
+ }
4353
+ }, 0);
4354
+ }
3431
4355
  }
3432
4356
  }
3433
4357
  else {
3434
- for (var i = 0; i < li.length && i < count_1; i++) {
4358
+ for (var i_1 = 0; i_1 < li.length && i_1 < count_1; i_1++) {
3435
4359
  this.removeHover();
3436
- var customVal = li[i].getAttribute('data-value');
3437
- var value = this.getFormattedValue(customVal);
4360
+ var customVal = li[i_1].getAttribute('data-value');
4361
+ var value_5 = this.getFormattedValue(customVal);
4362
+ value_5 = this.allowObjectBinding ? this.getDataByValue(value_5) : value_5;
3438
4363
  var mainElement = this.mainList ? this.mainList.querySelectorAll(state ?
3439
4364
  'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
3440
- 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[i] : null;
4365
+ 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[i_1] : null;
3441
4366
  if (state) {
3442
4367
  this.value = !this.value ? [] : this.value;
3443
- if (this.value.indexOf(value) < 0) {
3444
- this.setProperties({ value: [].concat([], this.value, [value]) }, true);
4368
+ if ((!this.allowObjectBinding && this.value.indexOf(value_5) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value_5, this.value))) {
4369
+ this.setProperties({ value: [].concat([], this.value, [value_5]) }, true);
3445
4370
  }
3446
4371
  this.removeFocus();
3447
- this.addListSelection(li[i], mainElement);
4372
+ this.addListSelection(li[i_1], mainElement);
3448
4373
  this.updateChipStatus();
3449
4374
  this.checkMaxSelection();
3450
4375
  }
3451
4376
  else {
3452
- this.removeAllItems(value, event, false, li[i], mainElement);
4377
+ this.removeAllItems(value_5, event, false, li[i_1], mainElement);
3453
4378
  }
3454
4379
  if (this.enableGroupCheckBox) {
3455
- this.findGroupStart(li[i]);
4380
+ this.findGroupStart(li[i_1]);
3456
4381
  }
3457
4382
  }
3458
4383
  if (!state) {
@@ -3586,6 +4511,7 @@ var MultiSelect = /** @class */ (function (_super) {
3586
4511
  }
3587
4512
  this.selectAllItem(state, event);
3588
4513
  }
4514
+ this.virtualSelectAll = false;
3589
4515
  };
3590
4516
  /**
3591
4517
  * Get the properties to be maintained in the persisted state.
@@ -3753,12 +4679,31 @@ var MultiSelect = /** @class */ (function (_super) {
3753
4679
  }
3754
4680
  this.renderPopup();
3755
4681
  };
4682
+ MultiSelect.prototype.totalItemsCount = function () {
4683
+ var dataSourceCount;
4684
+ if (this.dataSource instanceof DataManager) {
4685
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4686
+ dataSourceCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
4687
+ }
4688
+ else {
4689
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4690
+ dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
4691
+ }
4692
+ if (this.mode === 'CheckBox') {
4693
+ this.totalItemCount = dataSourceCount != 0 ? dataSourceCount : this.totalItemCount;
4694
+ }
4695
+ else {
4696
+ this.totalItemCount = dataSourceCount != 0 ? dataSourceCount - this.value.length : this.totalItemCount;
4697
+ }
4698
+ };
3756
4699
  MultiSelect.prototype.presentItemValue = function (ulElement) {
3757
4700
  var valuecheck = [];
3758
4701
  for (var i = 0; i < this.value.length; i++) {
3759
- var checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', this.value[i]);
4702
+ var value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[i]) : this.value[i];
4703
+ var checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', value);
3760
4704
  if (!checkEle) {
3761
- valuecheck.push(this.value[i]);
4705
+ var checkvalue = this.allowObjectBinding ? this.getDataByValue(this.value[i]) : this.value[i];
4706
+ valuecheck.push(checkvalue);
3762
4707
  }
3763
4708
  }
3764
4709
  return valuecheck;
@@ -3871,6 +4816,31 @@ var MultiSelect = /** @class */ (function (_super) {
3871
4816
  if (_this.mode === 'CheckBox' && _this.showSelectAll) {
3872
4817
  EventHandler.remove(_this.popupObj.element, 'click', _this.clickHandler);
3873
4818
  }
4819
+ if (_this.enableVirtualization && _this.mode === 'CheckBox') {
4820
+ _this.viewPortInfo.startIndex = _this.virtualItemStartIndex = 0;
4821
+ _this.viewPortInfo.endIndex = _this.virtualItemEndIndex = _this.viewPortInfo.startIndex > 0 ? _this.viewPortInfo.endIndex : _this.itemCount;
4822
+ _this.previousStartIndex = 0;
4823
+ _this.previousEndIndex = 0;
4824
+ }
4825
+ var dataSourceCount = void 0;
4826
+ if (_this.dataSource instanceof DataManager) {
4827
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4828
+ dataSourceCount = _this.virtualGroupDataSource && _this.virtualGroupDataSource.length ? _this.virtualGroupDataSource.length : 0;
4829
+ }
4830
+ else {
4831
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4832
+ dataSourceCount = _this.dataSource && _this.dataSource.length ? _this.dataSource.length : 0;
4833
+ }
4834
+ if (_this.enableVirtualization && (_this.allowFiltering || _this.allowCustomValue) && _this.value != null && _this.targetElement() && _this.totalItemCount !== dataSourceCount) {
4835
+ _this.updateInitialData();
4836
+ _this.checkAndResetCache();
4837
+ }
4838
+ if (_this.virtualCustomData && _this.viewPortInfo && _this.viewPortInfo.startIndex === 0 && _this.viewPortInfo.endIndex === _this.itemCount) {
4839
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4840
+ _this.renderItems(_this.mainData, _this.fields);
4841
+ }
4842
+ _this.virtualCustomData = null;
4843
+ _this.isVirtualTrackHeight = false;
3874
4844
  }
3875
4845
  });
3876
4846
  }
@@ -3885,6 +4855,7 @@ var MultiSelect = /** @class */ (function (_super) {
3885
4855
  if (!this.enabled) {
3886
4856
  return;
3887
4857
  }
4858
+ this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
3888
4859
  var args = { cancel: false };
3889
4860
  this.trigger('beforeOpen', args, function (args) {
3890
4861
  if (!args.cancel) {
@@ -3907,6 +4878,47 @@ var MultiSelect = /** @class */ (function (_super) {
3907
4878
  return;
3908
4879
  }
3909
4880
  _this.onPopupShown(e);
4881
+ if (_this.enableVirtualization && _this.listData && _this.listData.length) {
4882
+ if (!isNullOrUndefined(_this.value) && (_this.getModuleName() === 'dropdownlist' || _this.getModuleName() === 'combobox')) {
4883
+ _this.removeHover();
4884
+ }
4885
+ if (!_this.beforePopupOpen) {
4886
+ if (_this.hideSelectedItem && _this.value && Array.isArray(_this.value) && _this.value.length > 0) {
4887
+ _this.totalItemsCount();
4888
+ }
4889
+ if (!_this.preventSetCurrentData && !isNullOrUndefined(_this.viewPortInfo.startIndex) && !isNullOrUndefined(_this.viewPortInfo.endIndex)) {
4890
+ _this.notify("setCurrentViewDataAsync", {
4891
+ component: _this.getModuleName(),
4892
+ module: "VirtualScroll",
4893
+ });
4894
+ }
4895
+ }
4896
+ }
4897
+ if (_this.enableVirtualization && !_this.allowFiltering && _this.selectedValueInfo != null && _this.selectedValueInfo.startIndex > 0 && _this.value != null) {
4898
+ _this.notify("dataProcessAsync", {
4899
+ module: "VirtualScroll",
4900
+ isOpen: true,
4901
+ });
4902
+ }
4903
+ if (_this.enableVirtualization) {
4904
+ _this.updatevirtualizationList();
4905
+ }
4906
+ else {
4907
+ if (_this.value && _this.value.length) {
4908
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4909
+ var element = void 0;
4910
+ var listItems = _this.getItems();
4911
+ for (var _i = 0, _a = _this.value; _i < _a.length; _i++) {
4912
+ var value = _a[_i];
4913
+ var checkValue = _this.allowObjectBinding ? getValue((_this.fields.value) ? _this.fields.value : '', value) : value;
4914
+ element = _this.getElementByValue(checkValue);
4915
+ if (element) {
4916
+ _this.addListSelection(element);
4917
+ }
4918
+ }
4919
+ }
4920
+ }
4921
+ _this.preventSetCurrentData = true;
3910
4922
  }
3911
4923
  });
3912
4924
  };
@@ -4059,6 +5071,13 @@ var MultiSelect = /** @class */ (function (_super) {
4059
5071
  this.wireEvent();
4060
5072
  this.enable(this.enabled);
4061
5073
  this.enableRTL(this.enableRtl);
5074
+ if (this.enableVirtualization) {
5075
+ this.updateVirtualizationProperties(this.itemCount, this.allowFiltering, this.mode === 'CheckBox');
5076
+ }
5077
+ this.listItemHeight = this.getListHeight();
5078
+ this.getSkeletonCount();
5079
+ this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
5080
+ this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.viewPortInfo.startIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
4062
5081
  this.checkInitialValue();
4063
5082
  if (this.element.hasAttribute('data-val')) {
4064
5083
  this.element.setAttribute('data-val', 'false');
@@ -4070,6 +5089,22 @@ var MultiSelect = /** @class */ (function (_super) {
4070
5089
  }
4071
5090
  this.renderComplete();
4072
5091
  };
5092
+ MultiSelect.prototype.getListHeight = function () {
5093
+ var listParent = this.createElement('div', {
5094
+ className: 'e-dropdownbase'
5095
+ });
5096
+ var item = this.createElement('li', {
5097
+ className: 'e-list-item'
5098
+ });
5099
+ var listParentHeight = formatUnit(this.popupHeight);
5100
+ listParent.style.height = (parseInt(listParentHeight, 10)).toString() + 'px';
5101
+ listParent.appendChild(item);
5102
+ document.body.appendChild(listParent);
5103
+ this.virtualListHeight = listParent.getBoundingClientRect().height;
5104
+ var listItemHeight = Math.ceil(item.getBoundingClientRect().height);
5105
+ listParent.remove();
5106
+ return listItemHeight;
5107
+ };
4073
5108
  MultiSelect.prototype.checkInitialValue = function () {
4074
5109
  var _this = this;
4075
5110
  var isData = this.dataSource instanceof Array ? (this.dataSource.length > 0)
@@ -4086,7 +5121,8 @@ var MultiSelect = /** @class */ (function (_super) {
4086
5121
  var opt = optionsElement[index];
4087
5122
  if (!isNullOrUndefined(opt.getAttribute('selected'))) {
4088
5123
  if (opt.getAttribute('value')) {
4089
- valueCol.push(opt.getAttribute('value'));
5124
+ var value = this.allowObjectBinding ? this.getDataByValue(opt.getAttribute('value')) : opt.getAttribute('value');
5125
+ valueCol.push(value);
4090
5126
  }
4091
5127
  else {
4092
5128
  textCol += (opt.text + this.delimiterChar);
@@ -4113,14 +5149,40 @@ var MultiSelect = /** @class */ (function (_super) {
4113
5149
  this.initialTextUpdate();
4114
5150
  }
4115
5151
  if (this.value && this.value.length) {
5152
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5153
+ var listItems_2;
5154
+ if (this.enableVirtualization) {
5155
+ var fields = (this.fields.value) ? this.fields.value : '';
5156
+ var predicate = void 0;
5157
+ for (var i = 0; i < this.value.length; i++) {
5158
+ var value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[i]) : this.value[i];
5159
+ if (i === 0) {
5160
+ predicate = new Predicate(fields, 'equal', value);
5161
+ }
5162
+ else {
5163
+ predicate = predicate.or(fields, 'equal', value);
5164
+ }
5165
+ }
5166
+ if (this.dataSource instanceof DataManager) {
5167
+ this.dataSource.executeQuery(new Query().where(predicate))
5168
+ .then(function (e) {
5169
+ if (e.result.result.length > 0) {
5170
+ listItems_2 = e.result.result;
5171
+ }
5172
+ });
5173
+ }
5174
+ else {
5175
+ listItems_2 = new DataManager(this.dataSource).executeLocal(new Query().where(predicate));
5176
+ }
5177
+ }
4116
5178
  if (!(this.dataSource instanceof DataManager)) {
4117
- this.initialValueUpdate();
5179
+ this.initialValueUpdate(listItems_2);
4118
5180
  this.initialUpdate();
4119
5181
  }
4120
5182
  else {
4121
5183
  this.setInitialValue = function () {
4122
5184
  _this.initStatus = false;
4123
- _this.initialValueUpdate();
5185
+ _this.initialValueUpdate(listItems_2);
4124
5186
  _this.initialUpdate();
4125
5187
  _this.setInitialValue = null;
4126
5188
  _this.initStatus = true;
@@ -4142,6 +5204,34 @@ var MultiSelect = /** @class */ (function (_super) {
4142
5204
  this.inputElement.focus();
4143
5205
  }
4144
5206
  };
5207
+ MultiSelect.prototype.updatevirtualizationList = function () {
5208
+ if (this.value && this.value.length) {
5209
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5210
+ var element = void 0;
5211
+ var listItems = this.getItems();
5212
+ for (var _i = 0, _a = this.value; _i < _a.length; _i++) {
5213
+ var value = _a[_i];
5214
+ var checkValue = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
5215
+ element = this.getElementByValue(checkValue);
5216
+ if (element) {
5217
+ this.addListSelection(element);
5218
+ }
5219
+ }
5220
+ if (this.enableVirtualization && this.hideSelectedItem) {
5221
+ var visibleListElements = this.list.querySelectorAll('li.'
5222
+ + dropDownBaseClasses.li
5223
+ + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)' + ':not(.e-virtual-list)');
5224
+ if (visibleListElements.length) {
5225
+ var actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
5226
+ if (visibleListElements.length < (actualCount + 2)) {
5227
+ var query = this.getForQuery(this.value).clone();
5228
+ query = query.skip(this.viewPortInfo.startIndex);
5229
+ this.resetList(this.dataSource, this.fields, query);
5230
+ }
5231
+ }
5232
+ }
5233
+ }
5234
+ };
4145
5235
  MultiSelect.prototype.setFloatLabelType = function () {
4146
5236
  removeFloating(this.overAllWrapper, this.componentWrapper, this.searchWrapper, this.inputElement, this.value, this.floatLabelType, this.placeholder);
4147
5237
  if (this.floatLabelType !== 'Never') {
@@ -4175,6 +5265,8 @@ var MultiSelect = /** @class */ (function (_super) {
4175
5265
  if (this.mode !== 'Box' && !(this.setDynValue && this.mode === 'Default' && this.inputFocus)) {
4176
5266
  this.updateDelimView();
4177
5267
  }
5268
+ this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
5269
+ this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.itemCount;
4178
5270
  this.updateCssClass();
4179
5271
  this.updateHTMLAttribute();
4180
5272
  this.updateReadonly(this.readonly);
@@ -4271,6 +5363,9 @@ var MultiSelect = /** @class */ (function (_super) {
4271
5363
  __decorate([
4272
5364
  Property(true)
4273
5365
  ], MultiSelect.prototype, "enableHtmlSanitizer", void 0);
5366
+ __decorate([
5367
+ Property(false)
5368
+ ], MultiSelect.prototype, "enableVirtualization", void 0);
4274
5369
  __decorate([
4275
5370
  Property([])
4276
5371
  ], MultiSelect.prototype, "dataSource", void 0);
@@ -4349,6 +5444,9 @@ var MultiSelect = /** @class */ (function (_super) {
4349
5444
  __decorate([
4350
5445
  Property(null)
4351
5446
  ], MultiSelect.prototype, "value", void 0);
5447
+ __decorate([
5448
+ Property(false)
5449
+ ], MultiSelect.prototype, "allowObjectBinding", void 0);
4352
5450
  __decorate([
4353
5451
  Property(true)
4354
5452
  ], MultiSelect.prototype, "hideSelectedItem", void 0);