@syncfusion/ej2-dropdowns 33.1.47 → 33.1.49

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.
@@ -1651,8 +1651,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1651
1651
  _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
1652
1652
  var isReOrder = true;
1653
1653
  if (!_this.virtualSelectAll) {
1654
- var newQueryWhereCount = void 0;
1655
- var queryWhereCount = void 0;
1654
+ var newQueryWhereCount = 0;
1655
+ var queryWhereCount = 0;
1656
1656
  var newQuery = query_1.clone();
1657
1657
  for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
1658
1658
  if (newQuery.queries[queryElements].fn === 'onWhere') {
@@ -8755,6 +8755,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8755
8755
  if (formElement) {
8756
8756
  EventHandler.add(formElement, 'reset', this.resetValueHandler, this);
8757
8757
  }
8758
+ if (this.keyboardModule && typeof this.keyboardModule.destroy === 'function') {
8759
+ this.keyboardModule.destroy();
8760
+ }
8758
8761
  this.keyboardModule = new KeyboardEvents(this.inputWrapper, {
8759
8762
  keyAction: this.keyActionHandler.bind(this),
8760
8763
  keyConfigs: this.keyConfigs,
@@ -8762,6 +8765,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8762
8765
  });
8763
8766
  };
8764
8767
  DropDownTree.prototype.wireTreeEvents = function () {
8768
+ if (this.keyboardModule && typeof this.keyboardModule.destroy === 'function') {
8769
+ this.keyboardModule.destroy();
8770
+ }
8765
8771
  this.keyboardModule = new KeyboardEvents(this.tree, {
8766
8772
  keyAction: this.treeAction.bind(this),
8767
8773
  keyConfigs: this.keyConfigs,
@@ -18580,7 +18586,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18580
18586
  this.virtualSelectAll = true;
18581
18587
  length = this.virtualSelectAllData && this.virtualSelectAllData.length !== 0 ? this.virtualSelectAllData.length : length;
18582
18588
  this.listData = this.virtualSelectAllData;
18583
- var ulElement = this.createListItems(this.virtualSelectAllData.slice(0, 30), this.fields);
18589
+ var ulElement = this.createListItems(this.virtualSelectAllData.slice(0, Math.min(50, this.virtualSelectAllData.length)), this.fields);
18584
18590
  var firstItems = ulElement.querySelectorAll('li');
18585
18591
  var fragment_1 = document.createDocumentFragment();
18586
18592
  firstItems.forEach(function (node) {
@@ -18607,7 +18613,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18607
18613
  this.updateListSelection(concatenatedNodeList[index], event, length - index);
18608
18614
  }
18609
18615
  else {
18610
- var value = getValue(this.fields.value ? this.fields.value : '', this.virtualSelectAllData[index]);
18616
+ var rawItem = this.virtualSelectAllData[index];
18617
+ var value = this.fields.value
18618
+ ? getValue(this.fields.value, rawItem)
18619
+ : (typeof rawItem === 'object' && rawItem !== null ? rawItem : rawItem);
18611
18620
  value = this.allowObjectBinding ? this.getDataByValue(value) : value;
18612
18621
  if (((!this.allowObjectBinding && this.value && this.value.indexOf(value) >= 0) ||
18613
18622
  (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) >= 0))) {
@@ -18639,12 +18648,17 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18639
18648
  var batch = dataArray.slice(currentIndex, endIndex);
18640
18649
  // Use map on the batch
18641
18650
  batch.map(function (obj) {
18642
- if (_this.value && obj[_this.fields.value] != null && Array.isArray(_this.value) &&
18643
- ((!_this.allowObjectBinding && _this.value.indexOf(obj[_this.fields.value]) < 0) ||
18644
- (_this.allowObjectBinding && !_this.isObjectInArray(obj[_this.fields.value], _this.value)))) {
18645
- var value = obj[_this.fields.value];
18646
- var text = (obj[_this.fields.text]).toString();
18647
- _this.dispatchSelect(value, event, null, false, length, obj, text);
18651
+ var isPlainValue = typeof obj !== 'object' || obj === null;
18652
+ var value = isPlainValue
18653
+ ? obj
18654
+ : (_this.fields.value ? obj[_this.fields.value] : obj);
18655
+ var text = isPlainValue
18656
+ ? String(obj)
18657
+ : (_this.fields.text ? (obj[_this.fields.text]).toString() : String(obj));
18658
+ if (_this.value && value != null && Array.isArray(_this.value) &&
18659
+ ((!_this.allowObjectBinding && _this.value.indexOf(value) < 0) ||
18660
+ (_this.allowObjectBinding && !_this.isObjectInArray(value, _this.value)))) {
18661
+ _this.dispatchSelect(value, event, null, false, length, isPlainValue ? null : obj, text);
18648
18662
  }
18649
18663
  });
18650
18664
  currentIndex = endIndex;