@syncfusion/ej2-dropdowns 20.4.48 → 20.4.50

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.
@@ -1701,7 +1701,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1701
1701
  }
1702
1702
  else {
1703
1703
  if (this.allowFiltering && this.getModuleName() !== 'autocomplete'
1704
- && !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {
1704
+ && !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list) && this.actionCompleteData.list.length > 0) {
1705
1705
  this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(true), this.actionCompleteData.list);
1706
1706
  }
1707
1707
  this.resetFocusElement();
@@ -2441,6 +2441,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2441
2441
  };
2442
2442
  DropDownList.prototype.selectEventCallback = function (li, e, preventSelect, selectedData, value) {
2443
2443
  this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
2444
+ if (this.itemData != selectedData) {
2445
+ this.previousValue = (!isNullOrUndefined(this.itemData)) ? typeof this.itemData == "object" ? this.checkFieldValue(this.itemData, this.fields.value.split('.')) : this.itemData : null;
2446
+ }
2444
2447
  this.item = li;
2445
2448
  this.itemData = selectedData;
2446
2449
  var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
@@ -4541,6 +4544,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
4541
4544
  _this.selectedData = [];
4542
4545
  _this.filterDelayTime = 300;
4543
4546
  _this.isClicked = false;
4547
+ // Specifies if the checkAll method has been called
4548
+ _this.isCheckAllCalled = false;
4544
4549
  return _this;
4545
4550
  }
4546
4551
  /**
@@ -5524,6 +5529,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5524
5529
  frameSpan.classList.add(CHECK);
5525
5530
  ariaState = 'true';
5526
5531
  if (!this.isReverseUpdate) {
5532
+ this.isCheckAllCalled = true;
5527
5533
  this.treeObj.checkAll();
5528
5534
  if (!this.changeOnBlur) {
5529
5535
  this.triggerChangeEvent(e);
@@ -6329,13 +6335,14 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6329
6335
  var nodes = this.treeObj.element.querySelectorAll('li');
6330
6336
  var checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
6331
6337
  var wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
6332
- if (wrap && args.action === 'uncheck') {
6338
+ if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0)) {
6333
6339
  this.isReverseUpdate = true;
6334
6340
  this.changeState(wrap, 'uncheck');
6335
6341
  this.isReverseUpdate = false;
6336
6342
  }
6337
- else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length) {
6343
+ else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && this.isCheckAllCalled) {
6338
6344
  this.isReverseUpdate = true;
6345
+ this.isCheckAllCalled = false;
6339
6346
  this.changeState(wrap, 'check');
6340
6347
  this.isReverseUpdate = false;
6341
6348
  }
@@ -6854,6 +6861,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6854
6861
  DropDownTree.prototype.selectAllItems = function (state) {
6855
6862
  if (this.showCheckBox) {
6856
6863
  if (state) {
6864
+ this.isCheckAllCalled = true;
6857
6865
  this.treeObj.checkAll();
6858
6866
  }
6859
6867
  else {
@@ -12026,7 +12034,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12026
12034
  overAllContainer = this.componentWrapper.offsetWidth -
12027
12035
  parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
12028
12036
  parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
12029
- if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
12037
+ if ((wrapperleng + downIconWidth + this.clearIconWidth) >= overAllContainer) {
12030
12038
  if (tempData !== undefined && tempData !== '') {
12031
12039
  temp = tempData;
12032
12040
  index = tempIndex + 1;
@@ -12035,7 +12043,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12035
12043
  remaining = this.value.length - index;
12036
12044
  wrapperleng = this.viewWrapper.offsetWidth +
12037
12045
  parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
12038
- while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) > overAllContainer) && wrapperleng !== 0
12046
+ while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) >= overAllContainer) && wrapperleng !== 0
12039
12047
  && this.viewWrapper.innerHTML !== '') {
12040
12048
  var textArr = [];
12041
12049
  this.viewWrapper.innerHTML = textArr.join(this.delimiterChar);
@@ -12045,7 +12053,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12045
12053
  }
12046
12054
  break;
12047
12055
  }
12048
- else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) <= overAllContainer) {
12056
+ else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) < overAllContainer) {
12049
12057
  tempData = data;
12050
12058
  tempIndex = index;
12051
12059
  }
@@ -12238,6 +12246,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12238
12246
  else {
12239
12247
  this.updateValue(event, li, state);
12240
12248
  }
12249
+ this.addValidInputClass();
12241
12250
  };
12242
12251
  MultiSelect.prototype.updateValue = function (event, li, state) {
12243
12252
  var _this = this;
@@ -16330,7 +16339,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16330
16339
  var isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
16331
16340
  || e.action === 'home' || e.action === 'end');
16332
16341
  var isTabAction = e.action === 'tab' || e.action === 'close';
16333
- if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
16342
+ if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape' && e.action !== 'space') {
16334
16343
  this.renderList();
16335
16344
  }
16336
16345
  if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
@@ -16474,11 +16483,11 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16474
16483
  }
16475
16484
  }
16476
16485
  else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
16477
- e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8) {
16486
+ e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
16478
16487
  this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
16479
16488
  this.searchLists(e);
16480
16489
  }
16481
- else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
16490
+ else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
16482
16491
  this.searchLists(e);
16483
16492
  if (!this.isListResetted) {
16484
16493
  this.resetList(this.dataSource, this.fields);