@syncfusion/ej2-dropdowns 21.1.39 → 21.1.41

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.
@@ -441,6 +441,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
441
441
  var noDataCompTemp = compiledString({}, this, templateName, templateId, this.isStringTemplate, null, ele);
442
442
  if (noDataCompTemp && noDataCompTemp.length > 0) {
443
443
  for (var i = 0; i < noDataCompTemp.length; i++) {
444
+ if (this.getModuleName() === 'listbox' && templateName === 'noRecordsTemplate') {
445
+ noDataCompTemp[i].classList.add('e-list-nr-template');
446
+ }
444
447
  ele.appendChild(noDataCompTemp[i]);
445
448
  }
446
449
  }
@@ -481,7 +484,13 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
481
484
  };
482
485
  DropDownBase.prototype.getFormattedValue = function (value) {
483
486
  if (this.listData && this.listData.length) {
484
- var item = this.typeOfData(this.listData);
487
+ var item = void 0;
488
+ if (this.properties.allowCustomValue && this.properties.value && this.properties.value instanceof Array && this.properties.value.length > 0) {
489
+ item = this.typeOfData(this.properties.value);
490
+ }
491
+ else {
492
+ item = this.typeOfData(this.listData);
493
+ }
485
494
  if (typeof getValue((this.fields.value ? this.fields.value : 'value'), item.item) === 'number'
486
495
  || item.typeof === 'number') {
487
496
  return parseFloat(value);
@@ -4582,6 +4591,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
4582
4591
  _this.isClicked = false;
4583
4592
  // Specifies if the checkAll method has been called
4584
4593
  _this.isCheckAllCalled = false;
4594
+ _this.isFromFilterChange = false;
4585
4595
  return _this;
4586
4596
  }
4587
4597
  /**
@@ -4795,6 +4805,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
4795
4805
  };
4796
4806
  DropDownTree.prototype.filterHandler = function (value, event) {
4797
4807
  var _this = this;
4808
+ this.isFromFilterChange = true;
4798
4809
  if (!this.isFilteredData) {
4799
4810
  this.treeData = this.treeObj.getTreeData();
4800
4811
  }
@@ -6071,7 +6082,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6071
6082
  this.isDocumentClick = false;
6072
6083
  e.preventDefault();
6073
6084
  }
6074
- else if (this.inputWrapper != null && !this.inputWrapper.contains(target) && this.inputFocus && !isFilter) {
6085
+ else if (!isNullOrUndefined(this.inputWrapper) && !this.inputWrapper.contains(target) && this.inputFocus && !isFilter) {
6075
6086
  this.focusOut(e);
6076
6087
  }
6077
6088
  };
@@ -6490,7 +6501,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6490
6501
  };
6491
6502
  DropDownTree.prototype.setMultiSelectValue = function (newValues) {
6492
6503
  if (!this.isFilteredData) {
6493
- this.setProperties({ value: newValues }, true);
6504
+ this.setProperties({ value: this.isFromFilterChange && newValues && newValues.length == 0 ? this.value : newValues }, true);
6505
+ this.isFromFilterChange = false;
6494
6506
  if (newValues && newValues.length !== 0 && !this.showCheckBox) {
6495
6507
  this.treeObj.selectedNodes = this.value.slice();
6496
6508
  this.treeObj.dataBind();
@@ -9293,7 +9305,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9293
9305
  this.trigger('open', eventArgs, function (eventArgs) {
9294
9306
  if (!eventArgs.cancel) {
9295
9307
  _this.focusAtFirstListItem();
9296
- document.body.appendChild(_this.popupObj.element);
9308
+ if (_this.popupObj) {
9309
+ document.body.appendChild(_this.popupObj.element);
9310
+ }
9297
9311
  if (_this.mode === 'CheckBox' && _this.enableGroupCheckBox && !isNullOrUndefined(_this.fields.groupBy)) {
9298
9312
  _this.updateListItems(_this.list.querySelectorAll('li.e-list-item'), _this.mainList.querySelectorAll('li.e-list-item'));
9299
9313
  }
@@ -9302,7 +9316,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9302
9316
  }
9303
9317
  _this.refreshPopup();
9304
9318
  _this.renderReactTemplates();
9305
- _this.popupObj.show(eventArgs.animation, (_this.zIndex === 1000) ? _this.element : null);
9319
+ if (_this.popupObj) {
9320
+ _this.popupObj.show(eventArgs.animation, (_this.zIndex === 1000) ? _this.element : null);
9321
+ }
9306
9322
  attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.inputElement.id + '_options' });
9307
9323
  _this.updateAriaActiveDescendant();
9308
9324
  if (_this.isFirstClick) {
@@ -10476,6 +10492,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10476
10492
  this.refreshSelection();
10477
10493
  }
10478
10494
  }
10495
+ else if (!isNullOrUndefined(this.fields.groupBy) && this.value && this.value.length) {
10496
+ this.refreshSelection();
10497
+ }
10479
10498
  };
10480
10499
  MultiSelect.prototype.removeSelectedChip = function (e) {
10481
10500
  var selectedElem = this.chipCollectionWrapper.querySelector('span.' + CHIP_SELECTED);
@@ -12092,7 +12111,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12092
12111
  overAllContainer = this.componentWrapper.offsetWidth -
12093
12112
  parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
12094
12113
  parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
12095
- if ((wrapperleng + downIconWidth + this.clearIconWidth) >= overAllContainer) {
12114
+ if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
12096
12115
  if (tempData !== undefined && tempData !== '') {
12097
12116
  temp = tempData;
12098
12117
  index = tempIndex + 1;
@@ -12101,7 +12120,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12101
12120
  remaining = this.value.length - index;
12102
12121
  wrapperleng = this.viewWrapper.offsetWidth +
12103
12122
  parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
12104
- while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) >= overAllContainer) && wrapperleng !== 0
12123
+ while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) > overAllContainer) && wrapperleng !== 0
12105
12124
  && this.viewWrapper.innerHTML !== '') {
12106
12125
  var textArr = [];
12107
12126
  this.viewWrapper.innerHTML = textArr.join(this.delimiterChar);
@@ -12111,7 +12130,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12111
12130
  }
12112
12131
  break;
12113
12132
  }
12114
- else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) < overAllContainer) {
12133
+ else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) <= overAllContainer) {
12115
12134
  tempData = data;
12116
12135
  tempIndex = index;
12117
12136
  }
@@ -14274,17 +14293,26 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14274
14293
  var scrollMoved = 36;
14275
14294
  var scrollHeight = 10;
14276
14295
  if (this.itemTemplate && args.target) {
14277
- scrollHeight = args.target.scrollHeight;
14296
+ if (args.target && args.target.closest('.e-list-item')) {
14297
+ scrollHeight = args.target.closest('.e-list-item').scrollHeight;
14298
+ }
14299
+ else {
14300
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14301
+ var listItem = args.element.querySelector('.e-list-item');
14302
+ if (listItem) {
14303
+ scrollHeight = listItem.scrollHeight;
14304
+ }
14305
+ }
14278
14306
  }
14279
14307
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14280
14308
  var event = args.event;
14281
14309
  var wrapper;
14282
14310
  if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
14283
- || (args.target.parentElement && args.target.parentElement.classList.contains('e-list-item'))
14284
- || args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
14311
+ || args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group')
14312
+ || args.target.closest('.e-list-item'))) {
14285
14313
  if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
14286
- || (args.target.parentElement && args.target.parentElement.classList.contains('e-list-item'))
14287
- || args.target.classList.contains('e-input-group')) {
14314
+ || args.target.classList.contains('e-input-group')
14315
+ || args.target.closest('.e-list-item')) {
14288
14316
  wrapper = args.target.closest('.e-listbox-wrapper');
14289
14317
  }
14290
14318
  else {