@syncfusion/ej2-dropdowns 27.1.57 → 27.2.2

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.
@@ -4937,6 +4937,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4937
4937
  const currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ?
4938
4938
  getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
4939
4939
  this.itemData = this.getDataByValue(currentValue);
4940
+ this.selectedLI = this.getElementByValue(currentValue);
4940
4941
  this.isDynamicData = false;
4941
4942
  }
4942
4943
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -7820,6 +7821,11 @@ let DropDownTree = class DropDownTree extends Component {
7820
7821
  this.checkAllParent.focus();
7821
7822
  }
7822
7823
  break;
7824
+ case 'tab':
7825
+ if (!this.isPopupOpen && this.inputFocus) {
7826
+ this.onFocusOut();
7827
+ }
7828
+ break;
7823
7829
  }
7824
7830
  }
7825
7831
  });
@@ -10125,7 +10131,7 @@ let DropDownTree = class DropDownTree extends Component {
10125
10131
  this.isPopupOpen = false;
10126
10132
  if (this.isReact) {
10127
10133
  this.clearTemplate(['headerTemplate', 'footerTemplate', 'itemTemplate', 'actionFailureTemplate',
10128
- 'noRecordsTemplate', 'customTemplate']);
10134
+ 'noRecordsTemplate']);
10129
10135
  }
10130
10136
  if (this.popupObj) {
10131
10137
  this.popupObj.destroy();
@@ -10472,6 +10478,7 @@ let ComboBox = class ComboBox extends DropDownList {
10472
10478
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
10473
10479
  setOldValue(value) {
10474
10480
  if (this.allowCustom) {
10481
+ this.selectedLI = this.getElementByValue(this.value);
10475
10482
  this.valueMuteChange(this.value);
10476
10483
  }
10477
10484
  else {
@@ -15272,6 +15279,15 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15272
15279
  this.previousEndIndex = 0;
15273
15280
  }
15274
15281
  }
15282
+ this.isClearAllItem = true;
15283
+ EventHandler.add(document, 'mouseup', this.preventSelection, this);
15284
+ }
15285
+ preventSelection(e) {
15286
+ if (this.isClearAllItem) {
15287
+ e.stopPropagation();
15288
+ }
15289
+ this.isClearAllItem = false;
15290
+ EventHandler.remove(document, 'mouseup', this.preventSelection);
15275
15291
  }
15276
15292
  clearAllCallback(e, isClearAll) {
15277
15293
  const tempValues = this.value ? this.value.slice() : [];
@@ -16024,127 +16040,131 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16024
16040
  this.updateData(delimChar, e);
16025
16041
  }
16026
16042
  onMouseClick(e) {
16027
- this.keyCode = null;
16028
- this.scrollFocusStatus = false;
16029
- this.keyboardEvent = null;
16030
- let target = e.target;
16031
- const li = closest(target, '.' + dropDownBaseClasses.li);
16032
- if (this.enableVirtualization && li && li.classList.contains('e-virtual-list')) {
16033
- return;
16034
- }
16035
- const headerLi = closest(target, '.' + dropDownBaseClasses.group);
16036
- if (headerLi && this.enableGroupCheckBox && this.mode === 'CheckBox' && this.fields.groupBy) {
16037
- target = target.classList.contains('e-list-group-item') ? target.firstElementChild.lastElementChild
16038
- : e.target;
16039
- if (target.classList.contains('e-check')) {
16040
- this.selectAllItem(false, e);
16041
- target.classList.remove('e-check');
16042
- target.classList.remove('e-stop');
16043
- closest(target, '.' + 'e-list-group-item').classList.remove('e-active');
16044
- target.setAttribute('aria-selected', 'false');
16045
- }
16046
- else {
16047
- this.selectAllItem(true, e);
16048
- target.classList.remove('e-stop');
16049
- target.classList.add('e-check');
16050
- closest(target, '.' + 'e-list-group-item').classList.add('e-active');
16051
- target.setAttribute('aria-selected', 'true');
16043
+ if (!this.isClearAllItem) {
16044
+ this.keyCode = null;
16045
+ this.scrollFocusStatus = false;
16046
+ this.keyboardEvent = null;
16047
+ let target = e.target;
16048
+ const li = closest(target, '.' + dropDownBaseClasses.li);
16049
+ if (this.enableVirtualization && li && li.classList.contains('e-virtual-list')) {
16050
+ return;
16052
16051
  }
16053
- this.refreshSelection();
16054
- this.checkSelectAll();
16055
- }
16056
- else {
16057
- if (this.isValidLI(li)) {
16058
- let limit = this.value && this.value.length ? this.value.length : 0;
16059
- if (li.classList.contains('e-active')) {
16060
- limit = limit - 1;
16052
+ const headerLi = closest(target, '.' + dropDownBaseClasses.group);
16053
+ if (headerLi && this.enableGroupCheckBox && this.mode === 'CheckBox' && this.fields.groupBy) {
16054
+ target = target.classList.contains('e-list-group-item') ? target.firstElementChild.lastElementChild
16055
+ : e.target;
16056
+ if (target.classList.contains('e-check')) {
16057
+ this.selectAllItem(false, e);
16058
+ target.classList.remove('e-check');
16059
+ target.classList.remove('e-stop');
16060
+ closest(target, '.' + 'e-list-group-item').classList.remove('e-active');
16061
+ target.setAttribute('aria-selected', 'false');
16061
16062
  }
16062
- if (limit < this.maximumSelectionLength) {
16063
- this.updateListSelection(li, e);
16064
- this.checkPlaceholderSize();
16065
- this.addListFocus(li);
16066
- if ((this.allowCustomValue || this.allowFiltering) && this.mainList && this.listData) {
16067
- if (this.mode !== 'CheckBox') {
16068
- this.focusAtLastListItem(li.getAttribute('data-value'));
16069
- this.refreshSelection();
16070
- }
16063
+ else {
16064
+ this.selectAllItem(true, e);
16065
+ target.classList.remove('e-stop');
16066
+ target.classList.add('e-check');
16067
+ closest(target, '.' + 'e-list-group-item').classList.add('e-active');
16068
+ target.setAttribute('aria-selected', 'true');
16069
+ }
16070
+ this.refreshSelection();
16071
+ this.checkSelectAll();
16072
+ }
16073
+ else {
16074
+ if (this.isValidLI(li)) {
16075
+ let limit = this.value && this.value.length ? this.value.length : 0;
16076
+ if (li.classList.contains('e-active')) {
16077
+ limit = limit - 1;
16071
16078
  }
16072
- else {
16073
- this.makeTextBoxEmpty();
16079
+ if (limit < this.maximumSelectionLength) {
16080
+ this.updateListSelection(li, e);
16081
+ this.checkPlaceholderSize();
16082
+ this.addListFocus(li);
16083
+ if ((this.allowCustomValue || this.allowFiltering) && this.mainList && this.listData) {
16084
+ if (this.mode !== 'CheckBox') {
16085
+ this.focusAtLastListItem(li.getAttribute('data-value'));
16086
+ this.refreshSelection();
16087
+ }
16088
+ }
16089
+ else {
16090
+ this.makeTextBoxEmpty();
16091
+ }
16074
16092
  }
16075
- }
16076
- if (this.mode === 'CheckBox') {
16077
- this.updateDelimView();
16078
- if (this.value && this.value.length > 50) {
16079
- setTimeout(() => {
16093
+ if (this.mode === 'CheckBox') {
16094
+ this.updateDelimView();
16095
+ if (this.value && this.value.length > 50) {
16096
+ setTimeout(() => {
16097
+ this.updateDelimeter(this.delimiterChar, e);
16098
+ }, 0);
16099
+ }
16100
+ else {
16080
16101
  this.updateDelimeter(this.delimiterChar, e);
16081
- }, 0);
16102
+ }
16103
+ this.refreshInputHight();
16082
16104
  }
16083
16105
  else {
16084
16106
  this.updateDelimeter(this.delimiterChar, e);
16085
16107
  }
16086
- this.refreshInputHight();
16087
- }
16088
- else {
16089
- this.updateDelimeter(this.delimiterChar, e);
16090
- }
16091
- this.checkSelectAll();
16092
- this.refreshPopup();
16093
- if (this.hideSelectedItem) {
16094
- this.focusAtFirstListItem();
16095
- }
16096
- if (this.closePopupOnSelect) {
16097
- this.hidePopup(e);
16108
+ this.checkSelectAll();
16109
+ this.refreshPopup();
16110
+ if (this.hideSelectedItem) {
16111
+ this.focusAtFirstListItem();
16112
+ }
16113
+ if (this.closePopupOnSelect) {
16114
+ this.hidePopup(e);
16115
+ }
16116
+ else {
16117
+ e.preventDefault();
16118
+ }
16119
+ const isFilterData = this.targetElement().trim() !== '' ? true : false;
16120
+ this.makeTextBoxEmpty();
16121
+ this.findGroupStart(target);
16122
+ if (this.mode !== 'CheckBox') {
16123
+ this.refreshListItems(isNullOrUndefined(li) ? null : li.textContent, isFilterData);
16124
+ }
16098
16125
  }
16099
16126
  else {
16100
16127
  e.preventDefault();
16101
16128
  }
16102
- const isFilterData = this.targetElement().trim() !== '' ? true : false;
16103
- this.makeTextBoxEmpty();
16104
- this.findGroupStart(target);
16105
- if (this.mode !== 'CheckBox') {
16106
- this.refreshListItems(isNullOrUndefined(li) ? null : li.textContent, isFilterData);
16107
- }
16108
- }
16109
- else {
16110
- e.preventDefault();
16111
- }
16112
- if (this.enableVirtualization && this.hideSelectedItem) {
16113
- const visibleListElements = this.list.querySelectorAll('li.'
16114
- + dropDownBaseClasses.li
16115
- + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)' + ':not(.e-virtual-list)');
16116
- if (visibleListElements.length) {
16117
- const actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
16118
- if (visibleListElements.length < (actualCount + 2)) {
16119
- let query = this.getForQuery(this.value).clone();
16120
- query = query.skip(this.virtualItemStartIndex);
16121
- this.resetList(this.dataSource, this.fields, query);
16122
- this.UpdateSkeleton();
16123
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
16124
- this.virtualItemCount = this.itemCount;
16125
- if (this.mode !== 'CheckBox') {
16126
- this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length :
16127
- this.totalItemCount;
16128
- }
16129
- if (!this.list.querySelector('.e-virtual-ddl')) {
16130
- const virualElement = this.createElement('div', {
16131
- id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
16132
- });
16133
- this.popupWrapper.querySelector('.e-dropdownbase').appendChild(virualElement);
16134
- }
16135
- else {
16136
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16137
- this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
16138
- }
16139
- if (this.list.querySelector('.e-virtual-ddl-content')) {
16140
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16141
- this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
16129
+ if (this.enableVirtualization && this.hideSelectedItem) {
16130
+ const visibleListElements = this.list.querySelectorAll('li.'
16131
+ + dropDownBaseClasses.li
16132
+ + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)' + ':not(.e-virtual-list)');
16133
+ if (visibleListElements.length) {
16134
+ const actualCount = this.virtualListHeight > 0 ?
16135
+ Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
16136
+ if (visibleListElements.length < (actualCount + 2)) {
16137
+ let query = this.getForQuery(this.value).clone();
16138
+ query = query.skip(this.virtualItemStartIndex);
16139
+ this.resetList(this.dataSource, this.fields, query);
16140
+ this.UpdateSkeleton();
16141
+ this.liCollections = this.list.querySelectorAll('.'
16142
+ + dropDownBaseClasses.li);
16143
+ this.virtualItemCount = this.itemCount;
16144
+ if (this.mode !== 'CheckBox') {
16145
+ this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length :
16146
+ this.totalItemCount;
16147
+ }
16148
+ if (!this.list.querySelector('.e-virtual-ddl')) {
16149
+ const virualElement = this.createElement('div', {
16150
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
16151
+ });
16152
+ this.popupWrapper.querySelector('.e-dropdownbase').appendChild(virualElement);
16153
+ }
16154
+ else {
16155
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16156
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
16157
+ }
16158
+ if (this.list.querySelector('.e-virtual-ddl-content')) {
16159
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16160
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
16161
+ }
16142
16162
  }
16143
16163
  }
16144
16164
  }
16165
+ this.refreshPlaceHolder();
16166
+ this.deselectHeader();
16145
16167
  }
16146
- this.refreshPlaceHolder();
16147
- this.deselectHeader();
16148
16168
  }
16149
16169
  }
16150
16170
  findGroupStart(target) {