@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.
@@ -918,6 +918,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
918
918
  _this.appendUncheckList = false;
919
919
  _this.getInitialData = false;
920
920
  _this.preventPopupOpen = true;
921
+ _this.virtualSelectAllState = false;
922
+ _this.CurrentEvent = null;
921
923
  _this.virtualListInfo = {
922
924
  currentPageNumber: null,
923
925
  direction: null,
@@ -1517,8 +1519,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1517
1519
  if (!isWhereExist_1) {
1518
1520
  _this.remoteDataCount = e.count;
1519
1521
  }
1520
- _this.dataCount = e.count;
1521
- _this.totalItemCount = e.count;
1522
+ _this.dataCount = !_this.virtualSelectAll ? e.count : _this.dataCount;
1523
+ _this.totalItemCount = !_this.virtualSelectAll ? e.count : _this.totalItemCount;
1522
1524
  ulElement = _this.renderItems(listItems, fields);
1523
1525
  _this.appendUncheckList = false;
1524
1526
  _this.onActionComplete(ulElement, listItems, e);
@@ -1544,6 +1546,12 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1544
1546
  if (_this.isVirtualizationEnabled) {
1545
1547
  _this.getFilteringSkeletonCount();
1546
1548
  }
1549
+ if (_this.virtualSelectAll && _this.virtualSelectAllData) {
1550
+ _this.virtualSelectionAll(_this.virtualSelectAllState, _this.liCollections, _this.CurrentEvent);
1551
+ _this.virtualSelectAllState = false;
1552
+ _this.CurrentEvent = null;
1553
+ _this.virtualSelectAll = false;
1554
+ }
1547
1555
  }
1548
1556
  });
1549
1557
  }).catch(function (e) {
@@ -1595,11 +1603,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1595
1603
  }
1596
1604
  }
1597
1605
  }
1598
- if (isReOrder && (!(_this.dataSource instanceof DataManager) && !_this.isCustomDataUpdated)) {
1606
+ if (isReOrder && (!(_this.dataSource instanceof DataManager) && !_this.isCustomDataUpdated) && !_this.virtualSelectAll) {
1599
1607
  // eslint-disable @typescript-eslint/no-explicit-any
1600
1608
  _this.dataCount = _this.totalItemCount = _this.virtualSelectAll ? listItems.length : listItems.count;
1601
1609
  }
1602
- listItems = _this.isVirtualizationEnabled && !_this.virtualSelectAll ? listItems.result : listItems;
1610
+ listItems = _this.isVirtualizationEnabled ? listItems.result : listItems;
1603
1611
  // eslint-enable @typescript-eslint/no-explicit-any
1604
1612
  var localDataArgs = { cancel: false, result: listItems };
1605
1613
  _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
@@ -1638,6 +1646,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1638
1646
  DropDownBase.prototype.updatePopupState = function () {
1639
1647
  // Used this method in component side.
1640
1648
  };
1649
+ DropDownBase.prototype.virtualSelectionAll = function (state, li, event) {
1650
+ // Used this method in component side.
1651
+ };
1641
1652
  DropDownBase.prototype.updateRemoteData = function () {
1642
1653
  this.setListData(this.dataSource, this.fields, this.query);
1643
1654
  };
@@ -2125,10 +2136,10 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
2125
2136
  */
2126
2137
  DropDownBase.prototype.getIndexByValueFilter = function (value) {
2127
2138
  var index;
2128
- var listItems = this.renderItems(this.selectData, this.fields);
2129
- if (listItems && listItems.children) {
2130
- for (var i = 0; i < listItems.children.length; i++) {
2131
- if (!isNullOrUndefined(value) && listItems.children[i].getAttribute('data-value') === value.toString()) {
2139
+ var listItems = this.renderItems(this.dataSource, this.fields).querySelectorAll('li' + ':not(.e-list-group-item)');
2140
+ if (listItems) {
2141
+ for (var i = 0; i < listItems.length; i++) {
2142
+ if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
2132
2143
  index = i;
2133
2144
  break;
2134
2145
  }
@@ -5073,7 +5084,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5073
5084
  _this.popupContentElement.setAttribute('id', 'no-record');
5074
5085
  }
5075
5086
  _this.inputElement.setAttribute('aria-expanded', 'true');
5076
- _this.inputElement.setAttribute('aria-controls', _this.element.id);
5087
+ _this.inputElement.setAttribute('aria-controls', _this.element.id + '_popup');
5077
5088
  var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
5078
5089
  addClass([inputParent], [dropDownListClasses.inputFocus]);
5079
5090
  var animModel = { name: 'FadeIn', duration: 100 };
@@ -5604,6 +5615,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5604
5615
  DropDownList.prototype.destroyPopup = function () {
5605
5616
  this.isPopupOpen = false;
5606
5617
  this.isFilterFocus = false;
5618
+ this.inputElement.removeAttribute('aria-controls');
5607
5619
  if (this.popupObj) {
5608
5620
  this.popupObj.destroy();
5609
5621
  detach(this.popupObj.element);
@@ -5694,7 +5706,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5694
5706
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
5695
5707
  this.inputElement.setAttribute('aria-label', this.getModuleName());
5696
5708
  this.inputElement.setAttribute('aria-expanded', 'false');
5697
- this.inputElement.setAttribute('aria-controls', this.element.id + '_popups');
5698
5709
  }
5699
5710
  attributes(this.targetElement(), this.getAriaAttributes());
5700
5711
  this.updateDataAttribute(this.htmlAttributes);
@@ -8205,10 +8216,14 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8205
8216
  focusedElement.focus();
8206
8217
  addClass([focusedElement], ['e-node-focus']);
8207
8218
  }
8208
- if (_this.checkSelectAll && _this.checkBoxElement) {
8209
- var wrap = closest(_this.checkBoxElement, '.' + CHECKBOXWRAP);
8210
- _this.changeState(wrap, 'check');
8211
- _this.checkSelectAll = false;
8219
+ if (_this.treeObj.checkedNodes.length > 0) {
8220
+ var nodes = _this.treeObj.element.querySelectorAll('li');
8221
+ var checkedNodes = _this.treeObj.element.querySelectorAll('li[aria-checked=true]');
8222
+ if ((checkedNodes.length === nodes.length || _this.checkSelectAll) && _this.checkBoxElement) {
8223
+ var wrap = closest(_this.checkBoxElement, '.' + CHECKBOXWRAP);
8224
+ _this.changeState(wrap, 'check');
8225
+ _this.checkSelectAll = false;
8226
+ }
8212
8227
  }
8213
8228
  if (_this.allowFiltering) {
8214
8229
  removeClass([_this.inputWrapper], [INPUTFOCUS]);
@@ -11680,6 +11695,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11680
11695
  _this.resetMainList = null;
11681
11696
  _this.resetFilteredData = false;
11682
11697
  _this.preventSetCurrentData = false;
11698
+ _this.isSelectAllLoop = false;
11683
11699
  _this.scrollFocusStatus = false;
11684
11700
  _this.keyDownStatus = false;
11685
11701
  _this.IsScrollerAtEnd = function () {
@@ -12007,7 +12023,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12007
12023
  if (!isNullOrUndefined(this.value)) {
12008
12024
  this.tempValues = this.allowObjectBinding ? this.value.slice() : this.value.slice();
12009
12025
  }
12010
- var customValue = this.allowObjectBinding ? this.getDataByValue(value) : this.getFormattedValue(value);
12026
+ var customValue = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(value)) : this.getFormattedValue(value);
12011
12027
  if (this.allowCustomValue && (value !== 'false' && customValue === false || (!isNullOrUndefined(customValue) &&
12012
12028
  customValue.toString() === 'NaN'))) {
12013
12029
  customValue = value;
@@ -12381,6 +12397,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12381
12397
  if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll) {
12382
12398
  return this.virtualFilterQuery(filterQuery);
12383
12399
  }
12400
+ if (this.virtualSelectAll) {
12401
+ return query ? query.take(this.maximumSelectionLength).requiresCount() : this.query ? this.query.take(this.maximumSelectionLength).requiresCount() : new Query().take(this.maximumSelectionLength).requiresCount();
12402
+ }
12384
12403
  return query ? query : this.query ? this.query : new Query();
12385
12404
  }
12386
12405
  };
@@ -13550,7 +13569,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13550
13569
  this.removeChipSelection();
13551
13570
  this.addChipSelection(temp, e);
13552
13571
  }
13553
- var currentChip = this.allowObjectBinding ? this.getDataByValue(selectedElem.getAttribute('data-value')) : selectedElem.getAttribute('data-value');
13572
+ var currentChip = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(selectedElem.getAttribute('data-value'))) : selectedElem.getAttribute('data-value');
13554
13573
  this.removeValue(currentChip, e);
13555
13574
  this.makeTextBoxEmpty();
13556
13575
  }
@@ -13737,7 +13756,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13737
13756
  if (this.enabled && !this.readonly) {
13738
13757
  var element = e.target.parentElement;
13739
13758
  var customVal = element.getAttribute('data-value');
13740
- var value = this.allowObjectBinding ? this.getDataByValue(customVal) : this.getFormattedValue(customVal);
13759
+ var value = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(customVal)) : this.getFormattedValue(customVal);
13741
13760
  if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
13742
13761
  (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
13743
13762
  value = customVal;
@@ -13828,8 +13847,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13828
13847
  dropDownBaseClasses.selected;
13829
13848
  if (index !== -1) {
13830
13849
  var currentValue = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), value) : value;
13831
- var element_1 = this.findListElement(this.list, 'li', 'data-value', currentValue);
13832
- var val_1 = this.getDataByValue(value);
13850
+ var element_1 = this.virtualSelectAll ? null : this.findListElement(this.list, 'li', 'data-value', currentValue);
13851
+ var val_1 = this.allowObjectBinding ? value : this.getDataByValue(value);
13833
13852
  var eventArgs = {
13834
13853
  e: eve,
13835
13854
  item: element_1,
@@ -14017,9 +14036,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14017
14036
  this.value = [];
14018
14037
  }
14019
14038
  var currentValue = this.allowObjectBinding ? this.getDataByValue(value) : value;
14020
- if ((this.allowObjectBinding && !this.isObjectInArray(value, this.value)) || (!this.allowObjectBinding && this.value.indexOf(currentValue) < 0)) {
14039
+ if ((this.allowObjectBinding && !this.isObjectInArray(this.getDataByValue(value), this.value)) || (!this.allowObjectBinding && this.value.indexOf(currentValue) < 0)) {
14021
14040
  this.setProperties({ value: [].concat([], this.value, [currentValue]) }, true);
14022
- if (this.enableVirtualization) {
14041
+ if (this.enableVirtualization && !this.isSelectAllLoop) {
14023
14042
  var data = this.viewWrapper.innerHTML;
14024
14043
  var temp = void 0;
14025
14044
  data += (this.value.length === 1) ? '' : this.delimiterChar + ' ';
@@ -14860,7 +14879,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14860
14879
  if (!this.enableVirtualization) {
14861
14880
  this.listData = this.mainData;
14862
14881
  }
14863
- if (!isNullOrUndefined(this.hiddenElement)) {
14882
+ if (!isNullOrUndefined(this.hiddenElement) && !this.enableVirtualization) {
14864
14883
  this.hiddenElement.innerHTML = '';
14865
14884
  }
14866
14885
  if (!isNullOrUndefined(this.value)) {
@@ -14888,7 +14907,27 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14888
14907
  var textValues = this.text != null && this.text != "" ? this.text + ',' + temp : temp;
14889
14908
  data += temp + delimiterChar + ' ';
14890
14909
  text.push(textValues);
14891
- hiddenElementContent += "<option selected value=\"" + valueItem + "\">" + index + "</option>";
14910
+ hiddenElementContent = this.hiddenElement.innerHTML;
14911
+ if ((e && e.currentTarget && e.currentTarget.classList.contains('e-chips-close')) || (e && (e.key === 'Backspace'))) {
14912
+ var item = e.target.parentElement.getAttribute('data-value');
14913
+ if (e.key === 'Backspace') {
14914
+ var lastChild = this.hiddenElement.lastChild;
14915
+ if (lastChild) {
14916
+ this.hiddenElement.removeChild(lastChild);
14917
+ }
14918
+ }
14919
+ else {
14920
+ this.hiddenElement.childNodes.forEach(function (option) {
14921
+ if (option.value === item) {
14922
+ option.parentNode.removeChild(option);
14923
+ }
14924
+ });
14925
+ }
14926
+ hiddenElementContent = this.hiddenElement.innerHTML;
14927
+ }
14928
+ else {
14929
+ hiddenElementContent += "<option selected value=\"" + value + "\">" + index + "</option>";
14930
+ }
14892
14931
  break;
14893
14932
  }
14894
14933
  else {
@@ -15107,7 +15146,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15107
15146
  };
15108
15147
  MultiSelect.prototype.updateListSelection = function (li, e, length) {
15109
15148
  var customVal = li.getAttribute('data-value');
15110
- var value = this.allowObjectBinding ? this.getDataByValue(customVal) : this.getFormattedValue(customVal);
15149
+ var value = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(customVal)) : this.getFormattedValue(customVal);
15111
15150
  if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
15112
15151
  (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
15113
15152
  value = customVal;
@@ -15813,14 +15852,14 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15813
15852
  var li;
15814
15853
  if (!isNullOrUndefined(this.list)) {
15815
15854
  li = this.list.querySelectorAll(state ?
15816
- 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
15817
- 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
15855
+ 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-virtual-list)' :
15856
+ 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-virtual-list)');
15818
15857
  }
15819
15858
  if (this.value && this.value.length && event && event.target
15820
15859
  && closest(event.target, '.e-close-hooker') && this.allowFiltering) {
15821
15860
  li = this.mainList.querySelectorAll(state ?
15822
- 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
15823
- 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
15861
+ 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-virtual-list)' :
15862
+ 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-virtual-list)');
15824
15863
  }
15825
15864
  if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {
15826
15865
  var target = (event ? (this.groupTemplate ? closest(event.target, '.e-list-group-item') : event.target) : null);
@@ -15882,6 +15921,108 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15882
15921
  }
15883
15922
  this.addValidInputClass();
15884
15923
  };
15924
+ MultiSelect.prototype.virtualSelectionAll = function (state, li, event) {
15925
+ var _this = this;
15926
+ var index = 0;
15927
+ var length = li.length;
15928
+ var count = this.maximumSelectionLength;
15929
+ if (state) {
15930
+ length = this.virtualSelectAllData && this.virtualSelectAllData.length != 0 ? this.virtualSelectAllData.length : length;
15931
+ this.listData = this.virtualSelectAllData;
15932
+ var ulElement = this.createListItems(this.virtualSelectAllData.slice(0, 30), this.fields);
15933
+ var firstItems = ulElement.querySelectorAll('li');
15934
+ var fragment_1 = document.createDocumentFragment();
15935
+ firstItems.forEach(function (node) {
15936
+ fragment_1.appendChild(node.cloneNode(true));
15937
+ });
15938
+ li.forEach(function (node) {
15939
+ fragment_1.appendChild(node.cloneNode(true));
15940
+ });
15941
+ var concatenatedNodeList = fragment_1.childNodes;
15942
+ if (this.virtualSelectAllData instanceof Array) {
15943
+ while (index < length && index <= 50 && index < count) {
15944
+ this.isSelectAllTarget = (length === index + 1);
15945
+ if (concatenatedNodeList[index]) {
15946
+ var value = this.allowObjectBinding ? this.getDataByValue(concatenatedNodeList[index].getAttribute('data-value')) : this.getFormattedValue(concatenatedNodeList[index].getAttribute('data-value'));
15947
+ if (((!this.allowObjectBinding && this.value && this.value.indexOf(value) >= 0) || (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) >= 0))) {
15948
+ index++;
15949
+ continue;
15950
+ }
15951
+ this.updateListSelection(concatenatedNodeList[index], event, length - index);
15952
+ }
15953
+ else {
15954
+ var value = getValue((this.fields.value) ? this.fields.value : '', this.virtualSelectAllData[index]);
15955
+ value = this.allowObjectBinding ? this.getDataByValue(value) : value;
15956
+ if (((!this.allowObjectBinding && this.value && this.value.indexOf(value) >= 0) || (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) >= 0))) {
15957
+ index++;
15958
+ continue;
15959
+ }
15960
+ if (this.value && value != null && Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value, this.value)))) {
15961
+ this.dispatchSelect(value, event, null, false, length);
15962
+ }
15963
+ }
15964
+ index++;
15965
+ }
15966
+ if (length > 50) {
15967
+ setTimeout(function () {
15968
+ if (_this.virtualSelectAllData && _this.virtualSelectAllData.length > 0) {
15969
+ _this.virtualSelectAllData.map(function (obj) {
15970
+ 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)))) {
15971
+ _this.dispatchSelect(obj[_this.fields.value], event, null, false, length);
15972
+ }
15973
+ });
15974
+ }
15975
+ _this.updatedataValueItems(event);
15976
+ _this.isSelectAllLoop = false;
15977
+ if (!_this.changeOnBlur) {
15978
+ _this.updateValueState(event, _this.value, _this.tempValues);
15979
+ _this.isSelectAll = _this.isSelectAll ? !_this.isSelectAll : _this.isSelectAll;
15980
+ }
15981
+ _this.updateHiddenElement();
15982
+ if (_this.popupWrapper && li[index - 1] && li[index - 1].classList.contains('e-item-focus')) {
15983
+ var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
15984
+ if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
15985
+ li[index - 1].classList.remove('e-item-focus');
15986
+ }
15987
+ }
15988
+ }, 0);
15989
+ }
15990
+ }
15991
+ }
15992
+ else {
15993
+ if (this.virtualSelectAllData && this.virtualSelectAllData.length > 0) {
15994
+ this.virtualSelectAllData.map(function (obj) {
15995
+ _this.virtualSelectAll = true;
15996
+ _this.removeValue(_this.value[index], event, _this.value.length - index);
15997
+ });
15998
+ }
15999
+ this.updatedataValueItems(event);
16000
+ if (!this.changeOnBlur) {
16001
+ this.updateValueState(event, this.value, this.tempValues);
16002
+ this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
16003
+ }
16004
+ this.updateHiddenElement();
16005
+ this.value = [];
16006
+ this.virtualSelectAll = false;
16007
+ if (!isNullOrUndefined(this.viewPortInfo.startIndex) && !isNullOrUndefined(this.viewPortInfo.endIndex)) {
16008
+ this.notify("setCurrentViewDataAsync", {
16009
+ component: this.getModuleName(),
16010
+ module: "VirtualScroll",
16011
+ });
16012
+ }
16013
+ }
16014
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16015
+ var virtualTrackElement = this.list.getElementsByClassName('e-virtual-ddl')[0];
16016
+ if (virtualTrackElement) {
16017
+ (virtualTrackElement).style = this.GetVirtualTrackHeight();
16018
+ }
16019
+ this.UpdateSkeleton();
16020
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16021
+ var virtualContentElement = this.list.getElementsByClassName('e-virtual-ddl-content')[0];
16022
+ if (virtualContentElement) {
16023
+ (virtualContentElement).style = this.getTransformValues();
16024
+ }
16025
+ };
15885
16026
  MultiSelect.prototype.updateValue = function (event, li, state) {
15886
16027
  var _this = this;
15887
16028
  var length = li.length;
@@ -15905,95 +16046,14 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15905
16046
  }
15906
16047
  if (!beforeSelectArgs.preventSelectEvent) {
15907
16048
  if (this.enableVirtualization) {
15908
- if (state) {
15909
- this.virtualSelectAll = true;
16049
+ this.virtualSelectAll = true;
16050
+ this.virtualSelectAllState = state;
16051
+ this.CurrentEvent = event;
16052
+ if (!this.virtualSelectAllData) {
15910
16053
  this.resetList(this.dataSource, this.fields, new Query());
15911
- if (this.virtualSelectAllData instanceof Array) {
15912
- for (var i = 0; i < this.virtualSelectAllData.length; i++) {
15913
- if (li[this.skeletonCount + i]) {
15914
- var value_2 = this.allowObjectBinding ? this.getDataByValue(li[this.skeletonCount + i].getAttribute('data-value')) : this.getFormattedValue(li[this.skeletonCount + i].getAttribute('data-value'));
15915
- if (((!this.allowObjectBinding && this.value && this.value.indexOf(value_2) === 1) || (this.allowObjectBinding && this.indexOfObjectInArray(value_2, this.value) === 1))) {
15916
- continue;
15917
- }
15918
- this.updateListSelection(li[this.skeletonCount + i], event, length - i);
15919
- }
15920
- else {
15921
- if (this.fields) {
15922
- var value_3 = getValue(this.fields.value, this.virtualSelectAllData[i]);
15923
- value_3 = this.allowObjectBinding ? this.getDataByValue(value_3) : value_3;
15924
- if (((!this.allowObjectBinding && this.value && this.value.indexOf(value_3) === 1) || (this.allowObjectBinding && this.indexOfObjectInArray(value_3, this.value) === 1))) {
15925
- continue;
15926
- }
15927
- 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)))) {
15928
- this.dispatchSelect(value_3, event, null, false, length);
15929
- }
15930
- }
15931
- }
15932
- }
15933
- if (this.virtualSelectAllData && this.value.length != this.virtualSelectAllData.length && this.virtualItemStartIndex != 0) {
15934
- if (this.virtualItemStartIndex > this.itemCount) {
15935
- for (var i = 0; i < this.itemCount; i++) {
15936
- if (this.fields) {
15937
- var value_4 = getValue(this.fields.value, this.virtualSelectAllData[i]);
15938
- value_4 = this.allowObjectBinding ? this.getDataByValue(value_4) : value_4;
15939
- 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)))) {
15940
- this.setProperties({ value: [].concat([], this.value, this.allowObjectBinding ? [this.virtualSelectAllData[i]] : [value_4]) }, true);
15941
- }
15942
- }
15943
- }
15944
- }
15945
- }
15946
- else {
15947
- for (var i = 0; i < this.virtualItemStartIndex; i++) {
15948
- if (this.fields) {
15949
- var value = getValue(this.fields.value, this.virtualSelectAllData[i]);
15950
- value = this.allowObjectBinding ? this.getDataByValue(value) : value;
15951
- if (Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value, this.value)))) {
15952
- this.setProperties({ value: [].concat([], this.value, this.allowObjectBinding ? [this.virtualSelectAllData[i]] : [value]) }, true);
15953
- }
15954
- }
15955
- }
15956
- }
15957
- }
15958
- }
15959
- else {
15960
- while (index_2 < this.value.length && index_2 <= 50 && index_2 < count_1 && this.value.length > 0) {
15961
- this.removeValue(this.value[index_2], event, this.value.length - index_2);
15962
- index_2++;
15963
- }
15964
- if (length > 50) {
15965
- setTimeout(function () {
15966
- while (index_2 < _this.value.length && index_2 < count_1 && _this.value.length > 0) {
15967
- _this.removeValue(value[index_2], event, _this.value.length - index_2);
15968
- index_2++;
15969
- }
15970
- _this.updatedataValueItems(event);
15971
- if (!_this.changeOnBlur) {
15972
- _this.updateValueState(event, _this.value, _this.tempValues);
15973
- _this.isSelectAll = _this.isSelectAll ? !_this.isSelectAll : _this.isSelectAll;
15974
- }
15975
- _this.updateHiddenElement();
15976
- }, 0);
15977
- }
15978
- this.value = [];
15979
- this.virtualSelectAll = false;
15980
- if (!isNullOrUndefined(this.viewPortInfo.startIndex) && !isNullOrUndefined(this.viewPortInfo.endIndex)) {
15981
- this.notify("setCurrentViewDataAsync", {
15982
- component: this.getModuleName(),
15983
- module: "VirtualScroll",
15984
- });
15985
- }
15986
- }
15987
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15988
- var virtualTrackElement = this.list.getElementsByClassName('e-virtual-ddl')[0];
15989
- if (virtualTrackElement) {
15990
- (virtualTrackElement).style = this.GetVirtualTrackHeight();
15991
16054
  }
15992
- this.UpdateSkeleton();
15993
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15994
- var virtualContentElement = this.list.getElementsByClassName('e-virtual-ddl-content')[0];
15995
- if (virtualContentElement) {
15996
- (virtualContentElement).style = this.getTransformValues();
16055
+ if (this.virtualSelectAllData) {
16056
+ this.virtualSelectionAll(state, li, event);
15997
16057
  }
15998
16058
  }
15999
16059
  else {
@@ -16032,29 +16092,29 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16032
16092
  }
16033
16093
  }
16034
16094
  else {
16035
- for (var i_1 = 0; i_1 < li.length && i_1 < count_1; i_1++) {
16095
+ for (var i = 0; i < li.length && i < count_1; i++) {
16036
16096
  this.removeHover();
16037
- var customVal = li[i_1].getAttribute('data-value');
16038
- var value_5 = this.getFormattedValue(customVal);
16039
- value_5 = this.allowObjectBinding ? this.getDataByValue(value_5) : value_5;
16097
+ var customVal = li[i].getAttribute('data-value');
16098
+ var value = this.getFormattedValue(customVal);
16099
+ value = this.allowObjectBinding ? this.getDataByValue(value) : value;
16040
16100
  var mainElement = this.mainList ? this.mainList.querySelectorAll(state ?
16041
16101
  'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
16042
- 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[i_1] : null;
16102
+ 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[i] : null;
16043
16103
  if (state) {
16044
16104
  this.value = !this.value ? [] : this.value;
16045
- if ((!this.allowObjectBinding && this.value.indexOf(value_5) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value_5, this.value))) {
16046
- this.setProperties({ value: [].concat([], this.value, [value_5]) }, true);
16105
+ if ((!this.allowObjectBinding && this.value.indexOf(value) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value, this.value))) {
16106
+ this.setProperties({ value: [].concat([], this.value, [value]) }, true);
16047
16107
  }
16048
16108
  this.removeFocus();
16049
- this.addListSelection(li[i_1], mainElement);
16109
+ this.addListSelection(li[i], mainElement);
16050
16110
  this.updateChipStatus();
16051
16111
  this.checkMaxSelection();
16052
16112
  }
16053
16113
  else {
16054
- this.removeAllItems(value_5, event, false, li[i_1], mainElement);
16114
+ this.removeAllItems(value, event, false, li[i], mainElement);
16055
16115
  }
16056
16116
  if (this.enableGroupCheckBox) {
16057
- this.findGroupStart(li[i_1]);
16117
+ this.findGroupStart(li[i]);
16058
16118
  }
16059
16119
  }
16060
16120
  if (!state) {
@@ -16082,7 +16142,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16082
16142
  this.updateValueState(event, this.value, this.tempValues);
16083
16143
  this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
16084
16144
  }
16085
- this.updateHiddenElement();
16145
+ if ((this.enableVirtualization && this.value && this.value.length > 0) || !this.enableVirtualization) {
16146
+ this.updateHiddenElement();
16147
+ }
16086
16148
  }
16087
16149
  };
16088
16150
  MultiSelect.prototype.updateHiddenElement = function () {
@@ -16188,7 +16250,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16188
16250
  }
16189
16251
  this.selectAllItem(state, event);
16190
16252
  }
16191
- this.virtualSelectAll = false;
16253
+ if (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualSelectAllData)) {
16254
+ this.virtualSelectAll = false;
16255
+ }
16192
16256
  };
16193
16257
  /**
16194
16258
  * Get the properties to be maintained in the persisted state.