@syncfusion/ej2-dropdowns 25.2.3 → 25.2.4

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.
@@ -840,6 +840,8 @@ let DropDownBase = class DropDownBase extends Component {
840
840
  this.appendUncheckList = false;
841
841
  this.getInitialData = false;
842
842
  this.preventPopupOpen = true;
843
+ this.virtualSelectAllState = false;
844
+ this.CurrentEvent = null;
843
845
  this.virtualListInfo = {
844
846
  currentPageNumber: null,
845
847
  direction: null,
@@ -1434,8 +1436,8 @@ let DropDownBase = class DropDownBase extends Component {
1434
1436
  if (!isWhereExist) {
1435
1437
  this.remoteDataCount = e.count;
1436
1438
  }
1437
- this.dataCount = e.count;
1438
- this.totalItemCount = e.count;
1439
+ this.dataCount = !this.virtualSelectAll ? e.count : this.dataCount;
1440
+ this.totalItemCount = !this.virtualSelectAll ? e.count : this.totalItemCount;
1439
1441
  ulElement = this.renderItems(listItems, fields);
1440
1442
  this.appendUncheckList = false;
1441
1443
  this.onActionComplete(ulElement, listItems, e);
@@ -1461,6 +1463,12 @@ let DropDownBase = class DropDownBase extends Component {
1461
1463
  if (this.isVirtualizationEnabled) {
1462
1464
  this.getFilteringSkeletonCount();
1463
1465
  }
1466
+ if (this.virtualSelectAll && this.virtualSelectAllData) {
1467
+ this.virtualSelectionAll(this.virtualSelectAllState, this.liCollections, this.CurrentEvent);
1468
+ this.virtualSelectAllState = false;
1469
+ this.CurrentEvent = null;
1470
+ this.virtualSelectAll = false;
1471
+ }
1464
1472
  }
1465
1473
  });
1466
1474
  }).catch((e) => {
@@ -1512,11 +1520,11 @@ let DropDownBase = class DropDownBase extends Component {
1512
1520
  }
1513
1521
  }
1514
1522
  }
1515
- if (isReOrder && (!(this.dataSource instanceof DataManager) && !this.isCustomDataUpdated)) {
1523
+ if (isReOrder && (!(this.dataSource instanceof DataManager) && !this.isCustomDataUpdated) && !this.virtualSelectAll) {
1516
1524
  // eslint-disable @typescript-eslint/no-explicit-any
1517
1525
  this.dataCount = this.totalItemCount = this.virtualSelectAll ? listItems.length : listItems.count;
1518
1526
  }
1519
- listItems = this.isVirtualizationEnabled && !this.virtualSelectAll ? listItems.result : listItems;
1527
+ listItems = this.isVirtualizationEnabled ? listItems.result : listItems;
1520
1528
  // eslint-enable @typescript-eslint/no-explicit-any
1521
1529
  const localDataArgs = { cancel: false, result: listItems };
1522
1530
  this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
@@ -1555,6 +1563,9 @@ let DropDownBase = class DropDownBase extends Component {
1555
1563
  updatePopupState() {
1556
1564
  // Used this method in component side.
1557
1565
  }
1566
+ virtualSelectionAll(state, li, event) {
1567
+ // Used this method in component side.
1568
+ }
1558
1569
  updateRemoteData() {
1559
1570
  this.setListData(this.dataSource, this.fields, this.query);
1560
1571
  }
@@ -2041,10 +2052,10 @@ let DropDownBase = class DropDownBase extends Component {
2041
2052
  */
2042
2053
  getIndexByValueFilter(value) {
2043
2054
  let index;
2044
- const listItems = this.renderItems(this.selectData, this.fields);
2045
- if (listItems && listItems.children) {
2046
- for (let i = 0; i < listItems.children.length; i++) {
2047
- if (!isNullOrUndefined(value) && listItems.children[i].getAttribute('data-value') === value.toString()) {
2055
+ const listItems = this.renderItems(this.dataSource, this.fields).querySelectorAll('li' + ':not(.e-list-group-item)');
2056
+ if (listItems) {
2057
+ for (let i = 0; i < listItems.length; i++) {
2058
+ if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
2048
2059
  index = i;
2049
2060
  break;
2050
2061
  }
@@ -4953,7 +4964,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4953
4964
  this.popupContentElement.setAttribute('id', 'no-record');
4954
4965
  }
4955
4966
  this.inputElement.setAttribute('aria-expanded', 'true');
4956
- this.inputElement.setAttribute('aria-controls', this.element.id);
4967
+ this.inputElement.setAttribute('aria-controls', this.element.id + '_popup');
4957
4968
  const inputParent = this.isFiltering() ? this.filterInput.parentElement : this.inputWrapper.container;
4958
4969
  addClass([inputParent], [dropDownListClasses.inputFocus]);
4959
4970
  const animModel = { name: 'FadeIn', duration: 100 };
@@ -5477,6 +5488,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5477
5488
  destroyPopup() {
5478
5489
  this.isPopupOpen = false;
5479
5490
  this.isFilterFocus = false;
5491
+ this.inputElement.removeAttribute('aria-controls');
5480
5492
  if (this.popupObj) {
5481
5493
  this.popupObj.destroy();
5482
5494
  detach(this.popupObj.element);
@@ -5567,7 +5579,6 @@ let DropDownList = class DropDownList extends DropDownBase {
5567
5579
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
5568
5580
  this.inputElement.setAttribute('aria-label', this.getModuleName());
5569
5581
  this.inputElement.setAttribute('aria-expanded', 'false');
5570
- this.inputElement.setAttribute('aria-controls', this.element.id + '_popups');
5571
5582
  }
5572
5583
  attributes(this.targetElement(), this.getAriaAttributes());
5573
5584
  this.updateDataAttribute(this.htmlAttributes);
@@ -8029,10 +8040,14 @@ let DropDownTree = class DropDownTree extends Component {
8029
8040
  focusedElement.focus();
8030
8041
  addClass([focusedElement], ['e-node-focus']);
8031
8042
  }
8032
- if (this.checkSelectAll && this.checkBoxElement) {
8033
- const wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
8034
- this.changeState(wrap, 'check');
8035
- this.checkSelectAll = false;
8043
+ if (this.treeObj.checkedNodes.length > 0) {
8044
+ const nodes = this.treeObj.element.querySelectorAll('li');
8045
+ const checkedNodes = this.treeObj.element.querySelectorAll('li[aria-checked=true]');
8046
+ if ((checkedNodes.length === nodes.length || this.checkSelectAll) && this.checkBoxElement) {
8047
+ const wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
8048
+ this.changeState(wrap, 'check');
8049
+ this.checkSelectAll = false;
8050
+ }
8036
8051
  }
8037
8052
  if (this.allowFiltering) {
8038
8053
  removeClass([this.inputWrapper], [INPUTFOCUS]);
@@ -11448,6 +11463,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11448
11463
  this.resetMainList = null;
11449
11464
  this.resetFilteredData = false;
11450
11465
  this.preventSetCurrentData = false;
11466
+ this.isSelectAllLoop = false;
11451
11467
  this.scrollFocusStatus = false;
11452
11468
  this.keyDownStatus = false;
11453
11469
  this.IsScrollerAtEnd = function () {
@@ -11772,7 +11788,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11772
11788
  if (!isNullOrUndefined(this.value)) {
11773
11789
  this.tempValues = this.allowObjectBinding ? this.value.slice() : this.value.slice();
11774
11790
  }
11775
- let customValue = this.allowObjectBinding ? this.getDataByValue(value) : this.getFormattedValue(value);
11791
+ let customValue = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(value)) : this.getFormattedValue(value);
11776
11792
  if (this.allowCustomValue && (value !== 'false' && customValue === false || (!isNullOrUndefined(customValue) &&
11777
11793
  customValue.toString() === 'NaN'))) {
11778
11794
  customValue = value;
@@ -12146,6 +12162,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12146
12162
  if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll) {
12147
12163
  return this.virtualFilterQuery(filterQuery);
12148
12164
  }
12165
+ if (this.virtualSelectAll) {
12166
+ return query ? query.take(this.maximumSelectionLength).requiresCount() : this.query ? this.query.take(this.maximumSelectionLength).requiresCount() : new Query().take(this.maximumSelectionLength).requiresCount();
12167
+ }
12149
12168
  return query ? query : this.query ? this.query : new Query();
12150
12169
  }
12151
12170
  }
@@ -13311,7 +13330,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13311
13330
  this.removeChipSelection();
13312
13331
  this.addChipSelection(temp, e);
13313
13332
  }
13314
- const currentChip = this.allowObjectBinding ? this.getDataByValue(selectedElem.getAttribute('data-value')) : selectedElem.getAttribute('data-value');
13333
+ const currentChip = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(selectedElem.getAttribute('data-value'))) : selectedElem.getAttribute('data-value');
13315
13334
  this.removeValue(currentChip, e);
13316
13335
  this.makeTextBoxEmpty();
13317
13336
  }
@@ -13497,7 +13516,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13497
13516
  if (this.enabled && !this.readonly) {
13498
13517
  const element = e.target.parentElement;
13499
13518
  const customVal = element.getAttribute('data-value');
13500
- let value = this.allowObjectBinding ? this.getDataByValue(customVal) : this.getFormattedValue(customVal);
13519
+ let value = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(customVal)) : this.getFormattedValue(customVal);
13501
13520
  if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
13502
13521
  (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
13503
13522
  value = customVal;
@@ -13587,8 +13606,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13587
13606
  dropDownBaseClasses.selected;
13588
13607
  if (index !== -1) {
13589
13608
  const currentValue = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), value) : value;
13590
- const element = this.findListElement(this.list, 'li', 'data-value', currentValue);
13591
- const val = this.getDataByValue(value);
13609
+ const element = this.virtualSelectAll ? null : this.findListElement(this.list, 'li', 'data-value', currentValue);
13610
+ const val = this.allowObjectBinding ? value : this.getDataByValue(value);
13592
13611
  const eventArgs = {
13593
13612
  e: eve,
13594
13613
  item: element,
@@ -13771,9 +13790,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13771
13790
  this.value = [];
13772
13791
  }
13773
13792
  let currentValue = this.allowObjectBinding ? this.getDataByValue(value) : value;
13774
- if ((this.allowObjectBinding && !this.isObjectInArray(value, this.value)) || (!this.allowObjectBinding && this.value.indexOf(currentValue) < 0)) {
13793
+ if ((this.allowObjectBinding && !this.isObjectInArray(this.getDataByValue(value), this.value)) || (!this.allowObjectBinding && this.value.indexOf(currentValue) < 0)) {
13775
13794
  this.setProperties({ value: [].concat([], this.value, [currentValue]) }, true);
13776
- if (this.enableVirtualization) {
13795
+ if (this.enableVirtualization && !this.isSelectAllLoop) {
13777
13796
  let data = this.viewWrapper.innerHTML;
13778
13797
  let temp;
13779
13798
  data += (this.value.length === 1) ? '' : this.delimiterChar + ' ';
@@ -14609,7 +14628,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14609
14628
  if (!this.enableVirtualization) {
14610
14629
  this.listData = this.mainData;
14611
14630
  }
14612
- if (!isNullOrUndefined(this.hiddenElement)) {
14631
+ if (!isNullOrUndefined(this.hiddenElement) && !this.enableVirtualization) {
14613
14632
  this.hiddenElement.innerHTML = '';
14614
14633
  }
14615
14634
  if (!isNullOrUndefined(this.value)) {
@@ -14637,7 +14656,27 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14637
14656
  let textValues = this.text != null && this.text != "" ? this.text + ',' + temp : temp;
14638
14657
  data += temp + delimiterChar + ' ';
14639
14658
  text.push(textValues);
14640
- hiddenElementContent += `<option selected value="${valueItem}">${index}</option>`;
14659
+ hiddenElementContent = this.hiddenElement.innerHTML;
14660
+ if ((e && e.currentTarget && e.currentTarget.classList.contains('e-chips-close')) || (e && (e.key === 'Backspace'))) {
14661
+ var item = e.target.parentElement.getAttribute('data-value');
14662
+ if (e.key === 'Backspace') {
14663
+ const lastChild = this.hiddenElement.lastChild;
14664
+ if (lastChild) {
14665
+ this.hiddenElement.removeChild(lastChild);
14666
+ }
14667
+ }
14668
+ else {
14669
+ this.hiddenElement.childNodes.forEach((option) => {
14670
+ if (option.value === item) {
14671
+ option.parentNode.removeChild(option);
14672
+ }
14673
+ });
14674
+ }
14675
+ hiddenElementContent = this.hiddenElement.innerHTML;
14676
+ }
14677
+ else {
14678
+ hiddenElementContent += "<option selected value=\"" + value + "\">" + index + "</option>";
14679
+ }
14641
14680
  break;
14642
14681
  }
14643
14682
  else {
@@ -14856,7 +14895,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14856
14895
  }
14857
14896
  updateListSelection(li, e, length) {
14858
14897
  const customVal = li.getAttribute('data-value');
14859
- let value = this.allowObjectBinding ? this.getDataByValue(customVal) : this.getFormattedValue(customVal);
14898
+ let value = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(customVal)) : this.getFormattedValue(customVal);
14860
14899
  if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
14861
14900
  (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
14862
14901
  value = customVal;
@@ -15560,14 +15599,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15560
15599
  let li;
15561
15600
  if (!isNullOrUndefined(this.list)) {
15562
15601
  li = this.list.querySelectorAll(state ?
15563
- 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
15564
- 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
15602
+ 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-virtual-list)' :
15603
+ 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-virtual-list)');
15565
15604
  }
15566
15605
  if (this.value && this.value.length && event && event.target
15567
15606
  && closest(event.target, '.e-close-hooker') && this.allowFiltering) {
15568
15607
  li = this.mainList.querySelectorAll(state ?
15569
- 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
15570
- 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
15608
+ 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-virtual-list)' :
15609
+ 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-virtual-list)');
15571
15610
  }
15572
15611
  if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {
15573
15612
  let target = (event ? (this.groupTemplate ? closest(event.target, '.e-list-group-item') : event.target) : null);
@@ -15629,8 +15668,109 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15629
15668
  }
15630
15669
  this.addValidInputClass();
15631
15670
  }
15671
+ virtualSelectionAll(state, li, event) {
15672
+ let index = 0;
15673
+ let length = li.length;
15674
+ let count = this.maximumSelectionLength;
15675
+ if (state) {
15676
+ length = this.virtualSelectAllData && this.virtualSelectAllData.length != 0 ? this.virtualSelectAllData.length : length;
15677
+ this.listData = this.virtualSelectAllData;
15678
+ const ulElement = this.createListItems(this.virtualSelectAllData.slice(0, 30), this.fields);
15679
+ const firstItems = ulElement.querySelectorAll('li');
15680
+ const fragment = document.createDocumentFragment();
15681
+ firstItems.forEach((node) => {
15682
+ fragment.appendChild(node.cloneNode(true));
15683
+ });
15684
+ li.forEach((node) => {
15685
+ fragment.appendChild(node.cloneNode(true));
15686
+ });
15687
+ const concatenatedNodeList = fragment.childNodes;
15688
+ if (this.virtualSelectAllData instanceof Array) {
15689
+ while (index < length && index <= 50 && index < count) {
15690
+ this.isSelectAllTarget = (length === index + 1);
15691
+ if (concatenatedNodeList[index]) {
15692
+ let value = this.allowObjectBinding ? this.getDataByValue(concatenatedNodeList[index].getAttribute('data-value')) : this.getFormattedValue(concatenatedNodeList[index].getAttribute('data-value'));
15693
+ if (((!this.allowObjectBinding && this.value && this.value.indexOf(value) >= 0) || (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) >= 0))) {
15694
+ index++;
15695
+ continue;
15696
+ }
15697
+ this.updateListSelection(concatenatedNodeList[index], event, length - index);
15698
+ }
15699
+ else {
15700
+ let value = getValue((this.fields.value) ? this.fields.value : '', this.virtualSelectAllData[index]);
15701
+ value = this.allowObjectBinding ? this.getDataByValue(value) : value;
15702
+ if (((!this.allowObjectBinding && this.value && this.value.indexOf(value) >= 0) || (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) >= 0))) {
15703
+ index++;
15704
+ continue;
15705
+ }
15706
+ if (this.value && value != null && Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value, this.value)))) {
15707
+ this.dispatchSelect(value, event, null, false, length);
15708
+ }
15709
+ }
15710
+ index++;
15711
+ }
15712
+ if (length > 50) {
15713
+ setTimeout(() => {
15714
+ if (this.virtualSelectAllData && this.virtualSelectAllData.length > 0) {
15715
+ this.virtualSelectAllData.map((obj) => {
15716
+ if (this.value && obj[this.fields.value] != null && Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(obj[this.fields.value]) < 0) || (this.allowObjectBinding && !this.isObjectInArray(obj[this.fields.value], this.value)))) {
15717
+ this.dispatchSelect(obj[this.fields.value], event, null, false, length);
15718
+ }
15719
+ });
15720
+ }
15721
+ this.updatedataValueItems(event);
15722
+ this.isSelectAllLoop = false;
15723
+ if (!this.changeOnBlur) {
15724
+ this.updateValueState(event, this.value, this.tempValues);
15725
+ this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
15726
+ }
15727
+ this.updateHiddenElement();
15728
+ if (this.popupWrapper && li[index - 1] && li[index - 1].classList.contains('e-item-focus')) {
15729
+ const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
15730
+ if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
15731
+ li[index - 1].classList.remove('e-item-focus');
15732
+ }
15733
+ }
15734
+ }, 0);
15735
+ }
15736
+ }
15737
+ }
15738
+ else {
15739
+ if (this.virtualSelectAllData && this.virtualSelectAllData.length > 0) {
15740
+ this.virtualSelectAllData.map((obj) => {
15741
+ this.virtualSelectAll = true;
15742
+ this.removeValue(this.value[index], event, this.value.length - index);
15743
+ });
15744
+ }
15745
+ this.updatedataValueItems(event);
15746
+ if (!this.changeOnBlur) {
15747
+ this.updateValueState(event, this.value, this.tempValues);
15748
+ this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
15749
+ }
15750
+ this.updateHiddenElement();
15751
+ this.value = [];
15752
+ this.virtualSelectAll = false;
15753
+ if (!isNullOrUndefined(this.viewPortInfo.startIndex) && !isNullOrUndefined(this.viewPortInfo.endIndex)) {
15754
+ this.notify("setCurrentViewDataAsync", {
15755
+ component: this.getModuleName(),
15756
+ module: "VirtualScroll",
15757
+ });
15758
+ }
15759
+ }
15760
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15761
+ const virtualTrackElement = this.list.getElementsByClassName('e-virtual-ddl')[0];
15762
+ if (virtualTrackElement) {
15763
+ (virtualTrackElement).style = this.GetVirtualTrackHeight();
15764
+ }
15765
+ this.UpdateSkeleton();
15766
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15767
+ const virtualContentElement = this.list.getElementsByClassName('e-virtual-ddl-content')[0];
15768
+ if (virtualContentElement) {
15769
+ (virtualContentElement).style = this.getTransformValues();
15770
+ }
15771
+ }
15632
15772
  updateValue(event, li, state) {
15633
- const length = li.length;
15773
+ let length = li.length;
15634
15774
  const beforeSelectArgs = {
15635
15775
  event: event,
15636
15776
  items: state ? li : [],
@@ -15651,95 +15791,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15651
15791
  }
15652
15792
  if (!beforeSelectArgs.preventSelectEvent) {
15653
15793
  if (this.enableVirtualization) {
15654
- if (state) {
15655
- this.virtualSelectAll = true;
15794
+ this.virtualSelectAll = true;
15795
+ this.virtualSelectAllState = state;
15796
+ this.CurrentEvent = event;
15797
+ if (!this.virtualSelectAllData) {
15656
15798
  this.resetList(this.dataSource, this.fields, new Query());
15657
- if (this.virtualSelectAllData instanceof Array) {
15658
- for (var i = 0; i < this.virtualSelectAllData.length; i++) {
15659
- if (li[this.skeletonCount + i]) {
15660
- let value = this.allowObjectBinding ? this.getDataByValue(li[this.skeletonCount + i].getAttribute('data-value')) : this.getFormattedValue(li[this.skeletonCount + i].getAttribute('data-value'));
15661
- if (((!this.allowObjectBinding && this.value && this.value.indexOf(value) === 1) || (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) === 1))) {
15662
- continue;
15663
- }
15664
- this.updateListSelection(li[this.skeletonCount + i], event, length - i);
15665
- }
15666
- else {
15667
- if (this.fields) {
15668
- let value = getValue(this.fields.value, this.virtualSelectAllData[i]);
15669
- value = this.allowObjectBinding ? this.getDataByValue(value) : value;
15670
- if (((!this.allowObjectBinding && this.value && this.value.indexOf(value) === 1) || (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) === 1))) {
15671
- continue;
15672
- }
15673
- if (this.value && value != null && Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value, this.value)))) {
15674
- this.dispatchSelect(value, event, null, false, length);
15675
- }
15676
- }
15677
- }
15678
- }
15679
- if (this.virtualSelectAllData && this.value.length != this.virtualSelectAllData.length && this.virtualItemStartIndex != 0) {
15680
- if (this.virtualItemStartIndex > this.itemCount) {
15681
- for (var i = 0; i < this.itemCount; i++) {
15682
- if (this.fields) {
15683
- let value = getValue(this.fields.value, this.virtualSelectAllData[i]);
15684
- value = this.allowObjectBinding ? this.getDataByValue(value) : value;
15685
- if (this.value && value != null && Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value, this.value)))) {
15686
- this.setProperties({ value: [].concat([], this.value, this.allowObjectBinding ? [this.virtualSelectAllData[i]] : [value]) }, true);
15687
- }
15688
- }
15689
- }
15690
- }
15691
- }
15692
- else {
15693
- for (var i = 0; i < this.virtualItemStartIndex; i++) {
15694
- if (this.fields) {
15695
- var value = getValue(this.fields.value, this.virtualSelectAllData[i]);
15696
- value = this.allowObjectBinding ? this.getDataByValue(value) : value;
15697
- if (Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value, this.value)))) {
15698
- this.setProperties({ value: [].concat([], this.value, this.allowObjectBinding ? [this.virtualSelectAllData[i]] : [value]) }, true);
15699
- }
15700
- }
15701
- }
15702
- }
15703
- }
15704
- }
15705
- else {
15706
- while (index < this.value.length && index <= 50 && index < count && this.value.length > 0) {
15707
- this.removeValue(this.value[index], event, this.value.length - index);
15708
- index++;
15709
- }
15710
- if (length > 50) {
15711
- setTimeout(() => {
15712
- while (index < this.value.length && index < count && this.value.length > 0) {
15713
- this.removeValue(value[index], event, this.value.length - index);
15714
- index++;
15715
- }
15716
- this.updatedataValueItems(event);
15717
- if (!this.changeOnBlur) {
15718
- this.updateValueState(event, this.value, this.tempValues);
15719
- this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
15720
- }
15721
- this.updateHiddenElement();
15722
- }, 0);
15723
- }
15724
- this.value = [];
15725
- this.virtualSelectAll = false;
15726
- if (!isNullOrUndefined(this.viewPortInfo.startIndex) && !isNullOrUndefined(this.viewPortInfo.endIndex)) {
15727
- this.notify("setCurrentViewDataAsync", {
15728
- component: this.getModuleName(),
15729
- module: "VirtualScroll",
15730
- });
15731
- }
15732
15799
  }
15733
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15734
- const virtualTrackElement = this.list.getElementsByClassName('e-virtual-ddl')[0];
15735
- if (virtualTrackElement) {
15736
- (virtualTrackElement).style = this.GetVirtualTrackHeight();
15737
- }
15738
- this.UpdateSkeleton();
15739
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15740
- const virtualContentElement = this.list.getElementsByClassName('e-virtual-ddl-content')[0];
15741
- if (virtualContentElement) {
15742
- (virtualContentElement).style = this.getTransformValues();
15800
+ if (this.virtualSelectAllData) {
15801
+ this.virtualSelectionAll(state, li, event);
15743
15802
  }
15744
15803
  }
15745
15804
  else {
@@ -15828,7 +15887,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15828
15887
  this.updateValueState(event, this.value, this.tempValues);
15829
15888
  this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
15830
15889
  }
15831
- this.updateHiddenElement();
15890
+ if ((this.enableVirtualization && this.value && this.value.length > 0) || !this.enableVirtualization) {
15891
+ this.updateHiddenElement();
15892
+ }
15832
15893
  }
15833
15894
  }
15834
15895
  updateHiddenElement() {
@@ -15932,7 +15993,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15932
15993
  }
15933
15994
  this.selectAllItem(state, event);
15934
15995
  }
15935
- this.virtualSelectAll = false;
15996
+ if (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualSelectAllData)) {
15997
+ this.virtualSelectAll = false;
15998
+ }
15936
15999
  }
15937
16000
  /**
15938
16001
  * Get the properties to be maintained in the persisted state.