@syncfusion/ej2-dropdowns 28.2.4 → 28.2.6

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.
@@ -1293,7 +1293,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1293
1293
  };
1294
1294
  DropDownBase.prototype.getSkeletonCount = function (retainSkeleton) {
1295
1295
  this.virtualListHeight = this.listContainerHeight != null ? parseInt(this.listContainerHeight, 10) : this.virtualListHeight;
1296
- var actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
1296
+ var actualCount = this.virtualListHeight > 0 && this.listItemHeight > 0 ?
1297
+ Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
1297
1298
  this.skeletonCount = actualCount * 4 < this.itemCount ? this.itemCount : actualCount * 4;
1298
1299
  this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
1299
1300
  this.virtualItemCount = this.itemCount;
@@ -5420,6 +5421,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5420
5421
  }
5421
5422
  var args = { cancel: false };
5422
5423
  this.trigger('beforeOpen', args, function (args) {
5424
+ var initialPopupHeight;
5423
5425
  if (!args.cancel) {
5424
5426
  var popupEle = _this.createElement('div', {
5425
5427
  id: _this.element.id + '_popup', className: 'e-ddl e-popup ' + (_this.cssClass !== null ? _this.cssClass : '')
@@ -5440,6 +5442,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5440
5442
  }
5441
5443
  document.body.appendChild(popupEle);
5442
5444
  popupEle.style.top = '0px';
5445
+ initialPopupHeight = popupEle.clientHeight;
5443
5446
  if (_this.enableVirtualization && _this.itemTemplate) {
5444
5447
  var listitems = popupEle.querySelectorAll('li.e-list-item:not(.e-virtual-list)');
5445
5448
  _this.listItemHeight = listitems.length > 0 ? Math.ceil(listitems[0].getBoundingClientRect().height) +
@@ -5637,7 +5640,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5637
5640
  // Add the resizer div to the popup
5638
5641
  if (_this.list && _this.list.parentElement) {
5639
5642
  _this.list.parentElement.classList.add('e-resize');
5640
- if (_this.popupHeight.toString().toLowerCase() !== 'auto') {
5643
+ if (_this.popupHeight.toString().toLowerCase() !== 'auto' && initialPopupHeight > parseInt(_this.popupHeight.toString(), 10)) {
5641
5644
  _this.list.parentElement.style.height = '100%';
5642
5645
  }
5643
5646
  _this.list.parentElement.style.paddingBottom = (_this.getModuleName() === 'dropdownlist' && _this.allowFiltering && _this.searchBoxHeight) ? (_this.searchBoxHeight + resizePaddingBottom).toString() + 'px' : resizePaddingBottom.toString() + 'px';
@@ -8673,7 +8676,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8673
8676
  this.inputEle.setAttribute('aria-label', this.getModuleName());
8674
8677
  var id = this.element.getAttribute('id');
8675
8678
  this.hiddenElement.id = id + '_hidden';
8676
- this.inputWrapper.setAttribute('tabindex', '0');
8679
+ this.inputWrapper.setAttribute('tabindex', this.inputWrapper.classList.contains('e-disabled') ? '-1' : '0');
8677
8680
  this.inputWrapper.setAttribute('aria-label', this.getModuleName());
8678
8681
  attributes(this.inputWrapper, this.getAriaAttributes());
8679
8682
  };
@@ -9041,7 +9044,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
9041
9044
  removeClass([_this.popupEle], DDTHIDEICON);
9042
9045
  _this.updatePopupHeight();
9043
9046
  _this.popupObj.refreshPosition();
9044
- if (!(_this.showCheckBox && _this.showSelectAll) && (!_this.popupDiv.classList.contains(NODATA)
9047
+ if (!(_this.showSelectAll || _this.allowFiltering) && (!_this.popupDiv.classList.contains(NODATA)
9045
9048
  && _this.treeItems.length > 0)) {
9046
9049
  var focusedElement = _this.value != null && _this.text != null ? _this.treeObj.element.querySelector('[data-uid="' + _this.value[0] + '"]') : null;
9047
9050
  if (focusedElement) {
@@ -9052,17 +9055,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
9052
9055
  var oldFocussedNode = _this.treeObj.element.querySelector('.e-node-focus');
9053
9056
  focusedElement = _this.treeObj.element.querySelector('li[tabindex="0"]:not(.e-disable)') ||
9054
9057
  _this.treeObj.element.querySelector('li:not(.e-disable)');
9055
- if (oldFocussedNode && oldFocussedNode !== focusedElement) {
9056
- oldFocussedNode.setAttribute('tabindex', '-1');
9057
- removeClass([oldFocussedNode], 'e-node-focus');
9058
- }
9059
- }
9060
- if (!isNullOrUndefined(focusedElement)) {
9061
- if (!_this.allowFiltering) {
9062
- focusedElement.focus();
9063
- }
9064
- addClass([focusedElement], ['e-node-focus']);
9058
+ _this.removeFocus(focusedElement, oldFocussedNode);
9065
9059
  }
9060
+ _this.updateFocus(focusedElement);
9066
9061
  }
9067
9062
  if (_this.treeObj.checkedNodes.length > 0 && !_this.isFilterRestore) {
9068
9063
  var nodes = _this.treeObj.element.querySelectorAll('li');
@@ -9073,6 +9068,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
9073
9068
  _this.checkSelectAll = false;
9074
9069
  }
9075
9070
  }
9071
+ if (_this.showSelectAll && !_this.allowFiltering) {
9072
+ var oldFocussedNode = _this.treeObj.element.querySelector('.e-node-focus');
9073
+ var focusedElement = _this.popupEle.querySelector('.e-selectall-parent');
9074
+ _this.removeFocus(focusedElement, oldFocussedNode);
9075
+ _this.updateFocus(focusedElement);
9076
+ }
9076
9077
  if (_this.allowFiltering) {
9077
9078
  removeClass([_this.inputWrapper], [INPUTFOCUS]);
9078
9079
  _this.filterObj.element.focus();
@@ -9082,6 +9083,18 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
9082
9083
  }
9083
9084
  });
9084
9085
  };
9086
+ DropDownTree.prototype.removeFocus = function (focusedElement, oldFocusedElement) {
9087
+ if (oldFocusedElement && oldFocusedElement !== focusedElement) {
9088
+ oldFocusedElement.setAttribute('tabindex', '-1');
9089
+ removeClass([oldFocusedElement], 'e-node-focus');
9090
+ }
9091
+ };
9092
+ DropDownTree.prototype.updateFocus = function (focusedElement) {
9093
+ if (!isNullOrUndefined(focusedElement)) {
9094
+ focusedElement.focus();
9095
+ addClass([focusedElement], ['e-node-focus']);
9096
+ }
9097
+ };
9085
9098
  DropDownTree.prototype.reactCallBack = function () {
9086
9099
  if (!isNullOrUndefined(this.popupObj)) {
9087
9100
  this.updatePopupHeight();
@@ -9383,7 +9396,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
9383
9396
  this.updateTemplate();
9384
9397
  }
9385
9398
  this.treeObj.fields = this.getTreeFields(this.fields);
9399
+ this.setProperties({ value: this.oldValue }, true);
9386
9400
  this.treeObj.dataBind();
9401
+ this.updateValue(this.value);
9387
9402
  };
9388
9403
  DropDownTree.prototype.getEventArgs = function (args) {
9389
9404
  var checkData = args.data;
@@ -10400,8 +10415,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
10400
10415
  this.updateFilterPlaceHolder();
10401
10416
  break;
10402
10417
  case 'value':
10403
- this.oldValue = oldProp.value;
10404
- this.updateValue(newProp.value);
10418
+ if (JSON.stringify(oldProp.value) !== JSON.stringify(newProp.value)) {
10419
+ this.oldValue = oldProp.value;
10420
+ this.updateValue(newProp.value);
10421
+ }
10405
10422
  break;
10406
10423
  case 'text':
10407
10424
  this.updateText(newProp.text);
@@ -16505,7 +16522,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16505
16522
  (this.mode === 'Box' || this.mode === 'Default'))) ||
16506
16523
  (this.enableVirtualization && value != null && text != null && !isCustomData)) {
16507
16524
  var currentText = [];
16508
- var textValues = this.isDynamicRemoteVirtualData && text != null && text !== '' ? text : this.text != null && this.text !== '' ? this.text + this.delimiterChar + text : text;
16525
+ var textValues = this.isDynamicRemoteVirtualData && text != null && text !== '' ? text : this.text != null && this.text !== '' && !this.text.includes(text) ? this.text + this.delimiterChar + text : text;
16509
16526
  currentText.push(textValues);
16510
16527
  this.setProperties({ text: currentText.toString() }, true);
16511
16528
  this.addChip(text, value);