@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.
@@ -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();
@@ -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);
@@ -4447,6 +4450,8 @@ let DropDownTree = class DropDownTree extends Component {
4447
4450
  this.selectedData = [];
4448
4451
  this.filterDelayTime = 300;
4449
4452
  this.isClicked = false;
4453
+ // Specifies if the checkAll method has been called
4454
+ this.isCheckAllCalled = false;
4450
4455
  }
4451
4456
  /**
4452
4457
  * Get the properties to be maintained in the persisted state.
@@ -5424,6 +5429,7 @@ let DropDownTree = class DropDownTree extends Component {
5424
5429
  frameSpan.classList.add(CHECK);
5425
5430
  ariaState = 'true';
5426
5431
  if (!this.isReverseUpdate) {
5432
+ this.isCheckAllCalled = true;
5427
5433
  this.treeObj.checkAll();
5428
5434
  if (!this.changeOnBlur) {
5429
5435
  this.triggerChangeEvent(e);
@@ -6224,13 +6230,14 @@ let DropDownTree = class DropDownTree extends Component {
6224
6230
  const nodes = this.treeObj.element.querySelectorAll('li');
6225
6231
  const checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
6226
6232
  const wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
6227
- if (wrap && args.action === 'uncheck') {
6233
+ if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0)) {
6228
6234
  this.isReverseUpdate = true;
6229
6235
  this.changeState(wrap, 'uncheck');
6230
6236
  this.isReverseUpdate = false;
6231
6237
  }
6232
- else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length) {
6238
+ else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && this.isCheckAllCalled) {
6233
6239
  this.isReverseUpdate = true;
6240
+ this.isCheckAllCalled = false;
6234
6241
  this.changeState(wrap, 'check');
6235
6242
  this.isReverseUpdate = false;
6236
6243
  }
@@ -6749,6 +6756,7 @@ let DropDownTree = class DropDownTree extends Component {
6749
6756
  selectAllItems(state) {
6750
6757
  if (this.showCheckBox) {
6751
6758
  if (state) {
6759
+ this.isCheckAllCalled = true;
6752
6760
  this.treeObj.checkAll();
6753
6761
  }
6754
6762
  else {
@@ -11856,7 +11864,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11856
11864
  overAllContainer = this.componentWrapper.offsetWidth -
11857
11865
  parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
11858
11866
  parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
11859
- if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
11867
+ if ((wrapperleng + downIconWidth + this.clearIconWidth) >= overAllContainer) {
11860
11868
  if (tempData !== undefined && tempData !== '') {
11861
11869
  temp = tempData;
11862
11870
  index = tempIndex + 1;
@@ -11865,7 +11873,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11865
11873
  remaining = this.value.length - index;
11866
11874
  wrapperleng = this.viewWrapper.offsetWidth +
11867
11875
  parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
11868
- while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) > overAllContainer) && wrapperleng !== 0
11876
+ while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) >= overAllContainer) && wrapperleng !== 0
11869
11877
  && this.viewWrapper.innerHTML !== '') {
11870
11878
  const textArr = [];
11871
11879
  this.viewWrapper.innerHTML = textArr.join(this.delimiterChar);
@@ -11875,7 +11883,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11875
11883
  }
11876
11884
  break;
11877
11885
  }
11878
- else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) <= overAllContainer) {
11886
+ else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) < overAllContainer) {
11879
11887
  tempData = data;
11880
11888
  tempIndex = index;
11881
11889
  }
@@ -12068,6 +12076,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12068
12076
  else {
12069
12077
  this.updateValue(event, li, state);
12070
12078
  }
12079
+ this.addValidInputClass();
12071
12080
  }
12072
12081
  updateValue(event, li, state) {
12073
12082
  const length = li.length;
@@ -16072,7 +16081,7 @@ let Mention = class Mention extends DropDownBase {
16072
16081
  const isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
16073
16082
  || e.action === 'home' || e.action === 'end');
16074
16083
  const isTabAction = e.action === 'tab' || e.action === 'close';
16075
- if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
16084
+ if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape' && e.action !== 'space') {
16076
16085
  this.renderList();
16077
16086
  }
16078
16087
  if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
@@ -16216,11 +16225,11 @@ let Mention = class Mention extends DropDownBase {
16216
16225
  }
16217
16226
  }
16218
16227
  else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
16219
- e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8) {
16228
+ e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
16220
16229
  this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
16221
16230
  this.searchLists(e);
16222
16231
  }
16223
- else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
16232
+ else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
16224
16233
  this.searchLists(e);
16225
16234
  if (!this.isListResetted) {
16226
16235
  this.resetList(this.dataSource, this.fields);