@syncfusion/ej2-dropdowns 20.4.49 → 20.4.51

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.
@@ -1652,7 +1652,7 @@ let DropDownList = class DropDownList extends DropDownBase {
1652
1652
  }
1653
1653
  else {
1654
1654
  if (this.allowFiltering && this.getModuleName() !== 'autocomplete'
1655
- && !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {
1655
+ && !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list) && this.actionCompleteData.list.length > 0) {
1656
1656
  this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(true), this.actionCompleteData.list);
1657
1657
  }
1658
1658
  this.resetFocusElement();
@@ -2079,7 +2079,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2079
2079
  }
2080
2080
  if (!this.readonly) {
2081
2081
  const isTabAction = e.action === 'tab' || e.action === 'close';
2082
- if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
2082
+ if (isNullOrUndefined(this.list) && !this.isRequested && !isTabAction && e.action !== 'escape') {
2083
2083
  this.searchKeyEvent = e;
2084
2084
  this.renderList(e);
2085
2085
  }
@@ -2389,6 +2389,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2389
2389
  }
2390
2390
  selectEventCallback(li, e, preventSelect, selectedData, value) {
2391
2391
  this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
2392
+ if (this.itemData != selectedData) {
2393
+ this.previousValue = (!isNullOrUndefined(this.itemData)) ? typeof this.itemData == "object" ? this.checkFieldValue(this.itemData, this.fields.value.split('.')) : this.itemData : null;
2394
+ }
2392
2395
  this.item = li;
2393
2396
  this.itemData = selectedData;
2394
2397
  const focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
@@ -9724,11 +9727,25 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9724
9727
  }
9725
9728
  this.checkPlaceholderSize();
9726
9729
  Input.createSpanElement(this.overAllWrapper, this.createElement);
9727
- Input.calculateWidth(this.inputElement, this.overAllWrapper);
9730
+ this.calculateWidth();
9728
9731
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
9729
9732
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
9730
9733
  }
9731
9734
  }
9735
+ calculateWidth() {
9736
+ let elementWidth;
9737
+ if (this.overAllWrapper) {
9738
+ if (!this.showDropDownIcon || this.overAllWrapper.querySelector('.' + 'e-label-top')) {
9739
+ elementWidth = this.overAllWrapper.clientWidth - 2 * (parseInt(getComputedStyle(this.inputElement).paddingRight));
9740
+ }
9741
+ else {
9742
+ var downIconWidth = this.dropIcon.offsetWidth +
9743
+ parseInt(getComputedStyle(this.dropIcon).marginRight);
9744
+ elementWidth = this.overAllWrapper.clientWidth - (downIconWidth + 2 * (parseInt(getComputedStyle(this.inputElement).paddingRight)));
9745
+ }
9746
+ Input.calculateWidth(elementWidth, this.overAllWrapper, this.getModuleName());
9747
+ }
9748
+ }
9732
9749
  checkPlaceholderSize() {
9733
9750
  if (this.showDropDownIcon) {
9734
9751
  const downIconWidth = this.dropIcon.offsetWidth +
@@ -9865,7 +9882,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9865
9882
  if (this.isPopupOpen()) {
9866
9883
  this.refreshPopup();
9867
9884
  }
9868
- Input.calculateWidth(this.inputElement, this.overAllWrapper);
9885
+ setTimeout(() => {
9886
+ this.calculateWidth();
9887
+ }, 150);
9869
9888
  return true;
9870
9889
  }
9871
9890
  else {
@@ -11861,7 +11880,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11861
11880
  overAllContainer = this.componentWrapper.offsetWidth -
11862
11881
  parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
11863
11882
  parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
11864
- if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
11883
+ if ((wrapperleng + downIconWidth + this.clearIconWidth) >= overAllContainer) {
11865
11884
  if (tempData !== undefined && tempData !== '') {
11866
11885
  temp = tempData;
11867
11886
  index = tempIndex + 1;
@@ -11870,7 +11889,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11870
11889
  remaining = this.value.length - index;
11871
11890
  wrapperleng = this.viewWrapper.offsetWidth +
11872
11891
  parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
11873
- while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) > overAllContainer) && wrapperleng !== 0
11892
+ while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) >= overAllContainer) && wrapperleng !== 0
11874
11893
  && this.viewWrapper.innerHTML !== '') {
11875
11894
  const textArr = [];
11876
11895
  this.viewWrapper.innerHTML = textArr.join(this.delimiterChar);
@@ -11880,7 +11899,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11880
11899
  }
11881
11900
  break;
11882
11901
  }
11883
- else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) <= overAllContainer) {
11902
+ else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) < overAllContainer) {
11884
11903
  tempData = data;
11885
11904
  tempIndex = index;
11886
11905
  }
@@ -12073,6 +12092,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12073
12092
  else {
12074
12093
  this.updateValue(event, li, state);
12075
12094
  }
12095
+ this.addValidInputClass();
12076
12096
  }
12077
12097
  updateValue(event, li, state) {
12078
12098
  const length = li.length;
@@ -12359,7 +12379,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12359
12379
  case 'cssClass':
12360
12380
  this.updateOldPropCssClass(oldProp.cssClass);
12361
12381
  this.updateCssClass();
12362
- Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12382
+ this.calculateWidth();
12363
12383
  break;
12364
12384
  case 'enableRtl':
12365
12385
  this.enableRTL(newProp.enableRtl);
@@ -12387,7 +12407,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12387
12407
  this.setFloatLabelType();
12388
12408
  this.addValidInputClass();
12389
12409
  Input.createSpanElement(this.overAllWrapper, this.createElement);
12390
- Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12410
+ this.calculateWidth();
12391
12411
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12392
12412
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12393
12413
  }
@@ -12733,7 +12753,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12733
12753
  this.element.setAttribute('data-val', 'false');
12734
12754
  }
12735
12755
  Input.createSpanElement(this.overAllWrapper, this.createElement);
12736
- Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12756
+ this.calculateWidth();
12737
12757
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12738
12758
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12739
12759
  }
@@ -16500,7 +16520,6 @@ let Mention = class Mention extends DropDownBase {
16500
16520
  }
16501
16521
  if (!isNullOrUndefined(this.target)) {
16502
16522
  popupEle.id = this.inputElement.id + '_popup';
16503
- addClass([popupEle], ['e-mention', 'e-popup', 'e-popup-close']);
16504
16523
  }
16505
16524
  this.listHeight = formatUnit(this.popupHeight);
16506
16525
  if (!isNullOrUndefined(this.list.querySelector('li')) && !this.initRemoteRender) {
@@ -16524,6 +16543,7 @@ let Mention = class Mention extends DropDownBase {
16524
16543
  this.initializePopup(popupEle, offsetValue, left);
16525
16544
  this.checkCollision(popupEle);
16526
16545
  popupEle.style.visibility = 'visible';
16546
+ addClass([popupEle], ['e-mention', 'e-popup', 'e-popup-close']);
16527
16547
  if (!isNullOrUndefined(this.list)) {
16528
16548
  this.unWireListEvents();
16529
16549
  this.wireListEvents();