@syncfusion/ej2-dropdowns 20.4.50 → 20.4.52

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.
@@ -2130,7 +2130,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2130
2130
  }
2131
2131
  if (!this.readonly) {
2132
2132
  var isTabAction = e.action === 'tab' || e.action === 'close';
2133
- if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
2133
+ if (isNullOrUndefined(this.list) && !this.isRequested && !isTabAction && e.action !== 'escape') {
2134
2134
  this.searchKeyEvent = e;
2135
2135
  this.renderList(e);
2136
2136
  }
@@ -5234,7 +5234,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5234
5234
  _this.clickHandler(e);
5235
5235
  break;
5236
5236
  case 'moveDown':
5237
- _this.treeObj.element.focus();
5237
+ var focusedElement = _this.treeObj.element.querySelector('li');
5238
+ focusedElement.focus();
5239
+ addClass([focusedElement], ['e-hover', 'e-node-focus']);
5238
5240
  }
5239
5241
  }
5240
5242
  });
@@ -5911,7 +5913,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5911
5913
  _this.popupObj.refreshPosition();
5912
5914
  if (!(_this.showCheckBox && _this.showSelectAll) && (!_this.popupDiv.classList.contains(NODATA)
5913
5915
  && _this.treeItems.length > 0)) {
5914
- _this.treeObj.element.focus();
5916
+ var focusedElement = _this.treeObj.element.querySelector('li');
5917
+ focusedElement.focus();
5918
+ addClass([focusedElement], ['e-hover', 'e-node-focus']);
5915
5919
  }
5916
5920
  if (_this.checkSelectAll && _this.checkBoxElement) {
5917
5921
  var wrap = closest(_this.checkBoxElement, '.' + CHECKBOXWRAP);
@@ -9889,11 +9893,25 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9889
9893
  }
9890
9894
  this.checkPlaceholderSize();
9891
9895
  Input.createSpanElement(this.overAllWrapper, this.createElement);
9892
- Input.calculateWidth(this.inputElement, this.overAllWrapper);
9896
+ this.calculateWidth();
9893
9897
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
9894
9898
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
9895
9899
  }
9896
9900
  };
9901
+ MultiSelect.prototype.calculateWidth = function () {
9902
+ var elementWidth;
9903
+ if (this.overAllWrapper) {
9904
+ if (!this.showDropDownIcon || this.overAllWrapper.querySelector('.' + 'e-label-top')) {
9905
+ elementWidth = this.overAllWrapper.clientWidth - 2 * (parseInt(getComputedStyle(this.inputElement).paddingRight));
9906
+ }
9907
+ else {
9908
+ var downIconWidth = this.dropIcon.offsetWidth +
9909
+ parseInt(getComputedStyle(this.dropIcon).marginRight);
9910
+ elementWidth = this.overAllWrapper.clientWidth - (downIconWidth + 2 * (parseInt(getComputedStyle(this.inputElement).paddingRight)));
9911
+ }
9912
+ Input.calculateWidth(elementWidth, this.overAllWrapper, this.getModuleName());
9913
+ }
9914
+ };
9897
9915
  MultiSelect.prototype.checkPlaceholderSize = function () {
9898
9916
  if (this.showDropDownIcon) {
9899
9917
  var downIconWidth = this.dropIcon.offsetWidth +
@@ -10000,6 +10018,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10000
10018
  + ':not(.' + HIDE_LIST + ')') : [];
10001
10019
  };
10002
10020
  MultiSelect.prototype.focusInHandler = function (e) {
10021
+ var _this = this;
10003
10022
  if (this.enabled) {
10004
10023
  this.showOverAllClear();
10005
10024
  this.inputFocus = true;
@@ -10030,7 +10049,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10030
10049
  if (this.isPopupOpen()) {
10031
10050
  this.refreshPopup();
10032
10051
  }
10033
- Input.calculateWidth(this.inputElement, this.overAllWrapper);
10052
+ setTimeout(function () {
10053
+ _this.calculateWidth();
10054
+ }, 150);
10034
10055
  return true;
10035
10056
  }
10036
10057
  else {
@@ -12537,7 +12558,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12537
12558
  case 'cssClass':
12538
12559
  this.updateOldPropCssClass(oldProp.cssClass);
12539
12560
  this.updateCssClass();
12540
- Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12561
+ this.calculateWidth();
12541
12562
  break;
12542
12563
  case 'enableRtl':
12543
12564
  this.enableRTL(newProp.enableRtl);
@@ -12565,7 +12586,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12565
12586
  this.setFloatLabelType();
12566
12587
  this.addValidInputClass();
12567
12588
  Input.createSpanElement(this.overAllWrapper, this.createElement);
12568
- Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12589
+ this.calculateWidth();
12569
12590
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12570
12591
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12571
12592
  }
@@ -12915,7 +12936,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12915
12936
  this.element.setAttribute('data-val', 'false');
12916
12937
  }
12917
12938
  Input.createSpanElement(this.overAllWrapper, this.createElement);
12918
- Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12939
+ this.calculateWidth();
12919
12940
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12920
12941
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12921
12942
  }
@@ -16766,7 +16787,6 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16766
16787
  }
16767
16788
  if (!isNullOrUndefined(_this.target)) {
16768
16789
  popupEle_1.id = _this.inputElement.id + '_popup';
16769
- addClass([popupEle_1], ['e-mention', 'e-popup', 'e-popup-close']);
16770
16790
  }
16771
16791
  _this.listHeight = formatUnit(_this.popupHeight);
16772
16792
  if (!isNullOrUndefined(_this.list.querySelector('li')) && !_this.initRemoteRender) {
@@ -16790,6 +16810,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16790
16810
  _this.initializePopup(popupEle_1, offsetValue, left);
16791
16811
  _this.checkCollision(popupEle_1);
16792
16812
  popupEle_1.style.visibility = 'visible';
16813
+ addClass([popupEle_1], ['e-mention', 'e-popup', 'e-popup-close']);
16793
16814
  if (!isNullOrUndefined(_this.list)) {
16794
16815
  _this.unWireListEvents();
16795
16816
  _this.wireListEvents();
@@ -16816,6 +16837,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16816
16837
  }
16817
16838
  else {
16818
16839
  popupEle_1.style.left = formatUnit(coordinates_1.left);
16840
+ popupEle_1.style.top = formatUnit(coordinates_1.top - parseInt(_this.popupHeight.toString()));
16819
16841
  _this.isCollided = false;
16820
16842
  }
16821
16843
  popupEle_1.style.width = _this.popupWidth !== '100%' && !isNullOrUndefined(_this.popupWidth) ? formatUnit(_this.popupWidth) : 'auto';
@@ -16844,7 +16866,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16844
16866
  };
16845
16867
  Mention.prototype.checkCollision = function (popupEle) {
16846
16868
  if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
16847
- var collision = isCollide(popupEle);
16869
+ var coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
16870
+ var collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
16848
16871
  if (collision.length > 0) {
16849
16872
  popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
16850
16873
  this.isCollided = true;
@@ -16869,7 +16892,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16869
16892
  this.popupObj = new Popup(element, {
16870
16893
  width: this.setWidth(), targetType: 'relative',
16871
16894
  relateTo: this.inputElement, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
16872
- enableRtl: this.enableRtl, offsetX: left, position: { X: 'top', Y: 'left' }, actionOnScroll: 'hide',
16895
+ enableRtl: this.enableRtl, offsetX: left, position: { X: 'left', Y: 'bottom' }, actionOnScroll: 'hide',
16873
16896
  zIndex: this.zIndex,
16874
16897
  close: function () {
16875
16898
  _this.destroyPopup();
@@ -16951,14 +16974,14 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16951
16974
  if (!this.isContentEditable(this.inputElement)) {
16952
16975
  coordinates = {
16953
16976
  top: rect.top + windowTop + span.offsetTop + parseInt(computed.borderTopWidth, 10) +
16954
- parseInt(computed.fontSize, 10) + 3 - element.scrollTop,
16977
+ parseInt(computed.fontSize, 10) + 3 - element.scrollTop - (this.isCollided ? 10 : 0),
16955
16978
  left: rect.left + windowLeft + span.offsetLeft + parseInt(computed.borderLeftWidth, 10)
16956
16979
  };
16957
16980
  document.body.removeChild(div);
16958
16981
  }
16959
16982
  else {
16960
16983
  coordinates = {
16961
- top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
16984
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10) - (this.isCollided ? 10 : 0),
16962
16985
  left: rect.left + windowLeft
16963
16986
  };
16964
16987
  }