@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.
@@ -5054,6 +5054,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5054
5054
  var currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ?
5055
5055
  getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
5056
5056
  this.itemData = this.getDataByValue(currentValue);
5057
+ this.selectedLI = this.getElementByValue(currentValue);
5057
5058
  this.isDynamicData = false;
5058
5059
  }
5059
5060
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -7993,6 +7994,11 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
7993
7994
  _this.checkAllParent.focus();
7994
7995
  }
7995
7996
  break;
7997
+ case 'tab':
7998
+ if (!_this.isPopupOpen && _this.inputFocus) {
7999
+ _this.onFocusOut();
8000
+ }
8001
+ break;
7996
8002
  }
7997
8003
  }
7998
8004
  });
@@ -10318,7 +10324,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
10318
10324
  this.isPopupOpen = false;
10319
10325
  if (this.isReact) {
10320
10326
  this.clearTemplate(['headerTemplate', 'footerTemplate', 'itemTemplate', 'actionFailureTemplate',
10321
- 'noRecordsTemplate', 'customTemplate']);
10327
+ 'noRecordsTemplate']);
10322
10328
  }
10323
10329
  if (this.popupObj) {
10324
10330
  this.popupObj.destroy();
@@ -10680,6 +10686,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
10680
10686
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
10681
10687
  ComboBox.prototype.setOldValue = function (value) {
10682
10688
  if (this.allowCustom) {
10689
+ this.selectedLI = this.getElementByValue(this.value);
10683
10690
  this.valueMuteChange(this.value);
10684
10691
  }
10685
10692
  else {
@@ -15536,6 +15543,15 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15536
15543
  this.previousEndIndex = 0;
15537
15544
  }
15538
15545
  }
15546
+ this.isClearAllItem = true;
15547
+ EventHandler.add(document, 'mouseup', this.preventSelection, this);
15548
+ };
15549
+ MultiSelect.prototype.preventSelection = function (e) {
15550
+ if (this.isClearAllItem) {
15551
+ e.stopPropagation();
15552
+ }
15553
+ this.isClearAllItem = false;
15554
+ EventHandler.remove(document, 'mouseup', this.preventSelection);
15539
15555
  };
15540
15556
  MultiSelect.prototype.clearAllCallback = function (e, isClearAll) {
15541
15557
  var tempValues = this.value ? this.value.slice() : [];
@@ -16300,127 +16316,131 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16300
16316
  };
16301
16317
  MultiSelect.prototype.onMouseClick = function (e) {
16302
16318
  var _this = this;
16303
- this.keyCode = null;
16304
- this.scrollFocusStatus = false;
16305
- this.keyboardEvent = null;
16306
- var target = e.target;
16307
- var li = closest(target, '.' + dropDownBaseClasses.li);
16308
- if (this.enableVirtualization && li && li.classList.contains('e-virtual-list')) {
16309
- return;
16310
- }
16311
- var headerLi = closest(target, '.' + dropDownBaseClasses.group);
16312
- if (headerLi && this.enableGroupCheckBox && this.mode === 'CheckBox' && this.fields.groupBy) {
16313
- target = target.classList.contains('e-list-group-item') ? target.firstElementChild.lastElementChild
16314
- : e.target;
16315
- if (target.classList.contains('e-check')) {
16316
- this.selectAllItem(false, e);
16317
- target.classList.remove('e-check');
16318
- target.classList.remove('e-stop');
16319
- closest(target, '.' + 'e-list-group-item').classList.remove('e-active');
16320
- target.setAttribute('aria-selected', 'false');
16321
- }
16322
- else {
16323
- this.selectAllItem(true, e);
16324
- target.classList.remove('e-stop');
16325
- target.classList.add('e-check');
16326
- closest(target, '.' + 'e-list-group-item').classList.add('e-active');
16327
- target.setAttribute('aria-selected', 'true');
16319
+ if (!this.isClearAllItem) {
16320
+ this.keyCode = null;
16321
+ this.scrollFocusStatus = false;
16322
+ this.keyboardEvent = null;
16323
+ var target = e.target;
16324
+ var li = closest(target, '.' + dropDownBaseClasses.li);
16325
+ if (this.enableVirtualization && li && li.classList.contains('e-virtual-list')) {
16326
+ return;
16328
16327
  }
16329
- this.refreshSelection();
16330
- this.checkSelectAll();
16331
- }
16332
- else {
16333
- if (this.isValidLI(li)) {
16334
- var limit = this.value && this.value.length ? this.value.length : 0;
16335
- if (li.classList.contains('e-active')) {
16336
- limit = limit - 1;
16328
+ var headerLi = closest(target, '.' + dropDownBaseClasses.group);
16329
+ if (headerLi && this.enableGroupCheckBox && this.mode === 'CheckBox' && this.fields.groupBy) {
16330
+ target = target.classList.contains('e-list-group-item') ? target.firstElementChild.lastElementChild
16331
+ : e.target;
16332
+ if (target.classList.contains('e-check')) {
16333
+ this.selectAllItem(false, e);
16334
+ target.classList.remove('e-check');
16335
+ target.classList.remove('e-stop');
16336
+ closest(target, '.' + 'e-list-group-item').classList.remove('e-active');
16337
+ target.setAttribute('aria-selected', 'false');
16337
16338
  }
16338
- if (limit < this.maximumSelectionLength) {
16339
- this.updateListSelection(li, e);
16340
- this.checkPlaceholderSize();
16341
- this.addListFocus(li);
16342
- if ((this.allowCustomValue || this.allowFiltering) && this.mainList && this.listData) {
16343
- if (this.mode !== 'CheckBox') {
16344
- this.focusAtLastListItem(li.getAttribute('data-value'));
16345
- this.refreshSelection();
16339
+ else {
16340
+ this.selectAllItem(true, e);
16341
+ target.classList.remove('e-stop');
16342
+ target.classList.add('e-check');
16343
+ closest(target, '.' + 'e-list-group-item').classList.add('e-active');
16344
+ target.setAttribute('aria-selected', 'true');
16345
+ }
16346
+ this.refreshSelection();
16347
+ this.checkSelectAll();
16348
+ }
16349
+ else {
16350
+ if (this.isValidLI(li)) {
16351
+ var limit = this.value && this.value.length ? this.value.length : 0;
16352
+ if (li.classList.contains('e-active')) {
16353
+ limit = limit - 1;
16354
+ }
16355
+ if (limit < this.maximumSelectionLength) {
16356
+ this.updateListSelection(li, e);
16357
+ this.checkPlaceholderSize();
16358
+ this.addListFocus(li);
16359
+ if ((this.allowCustomValue || this.allowFiltering) && this.mainList && this.listData) {
16360
+ if (this.mode !== 'CheckBox') {
16361
+ this.focusAtLastListItem(li.getAttribute('data-value'));
16362
+ this.refreshSelection();
16363
+ }
16364
+ }
16365
+ else {
16366
+ this.makeTextBoxEmpty();
16346
16367
  }
16347
16368
  }
16369
+ if (this.mode === 'CheckBox') {
16370
+ this.updateDelimView();
16371
+ if (this.value && this.value.length > 50) {
16372
+ setTimeout(function () {
16373
+ _this.updateDelimeter(_this.delimiterChar, e);
16374
+ }, 0);
16375
+ }
16376
+ else {
16377
+ this.updateDelimeter(this.delimiterChar, e);
16378
+ }
16379
+ this.refreshInputHight();
16380
+ }
16348
16381
  else {
16349
- this.makeTextBoxEmpty();
16382
+ this.updateDelimeter(this.delimiterChar, e);
16350
16383
  }
16351
- }
16352
- if (this.mode === 'CheckBox') {
16353
- this.updateDelimView();
16354
- if (this.value && this.value.length > 50) {
16355
- setTimeout(function () {
16356
- _this.updateDelimeter(_this.delimiterChar, e);
16357
- }, 0);
16384
+ this.checkSelectAll();
16385
+ this.refreshPopup();
16386
+ if (this.hideSelectedItem) {
16387
+ this.focusAtFirstListItem();
16388
+ }
16389
+ if (this.closePopupOnSelect) {
16390
+ this.hidePopup(e);
16358
16391
  }
16359
16392
  else {
16360
- this.updateDelimeter(this.delimiterChar, e);
16393
+ e.preventDefault();
16394
+ }
16395
+ var isFilterData = this.targetElement().trim() !== '' ? true : false;
16396
+ this.makeTextBoxEmpty();
16397
+ this.findGroupStart(target);
16398
+ if (this.mode !== 'CheckBox') {
16399
+ this.refreshListItems(isNullOrUndefined(li) ? null : li.textContent, isFilterData);
16361
16400
  }
16362
- this.refreshInputHight();
16363
- }
16364
- else {
16365
- this.updateDelimeter(this.delimiterChar, e);
16366
- }
16367
- this.checkSelectAll();
16368
- this.refreshPopup();
16369
- if (this.hideSelectedItem) {
16370
- this.focusAtFirstListItem();
16371
- }
16372
- if (this.closePopupOnSelect) {
16373
- this.hidePopup(e);
16374
16401
  }
16375
16402
  else {
16376
16403
  e.preventDefault();
16377
16404
  }
16378
- var isFilterData = this.targetElement().trim() !== '' ? true : false;
16379
- this.makeTextBoxEmpty();
16380
- this.findGroupStart(target);
16381
- if (this.mode !== 'CheckBox') {
16382
- this.refreshListItems(isNullOrUndefined(li) ? null : li.textContent, isFilterData);
16383
- }
16384
- }
16385
- else {
16386
- e.preventDefault();
16387
- }
16388
- if (this.enableVirtualization && this.hideSelectedItem) {
16389
- var visibleListElements = this.list.querySelectorAll('li.'
16390
- + dropDownBaseClasses.li
16391
- + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)' + ':not(.e-virtual-list)');
16392
- if (visibleListElements.length) {
16393
- var actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
16394
- if (visibleListElements.length < (actualCount + 2)) {
16395
- var query = this.getForQuery(this.value).clone();
16396
- query = query.skip(this.virtualItemStartIndex);
16397
- this.resetList(this.dataSource, this.fields, query);
16398
- this.UpdateSkeleton();
16399
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
16400
- this.virtualItemCount = this.itemCount;
16401
- if (this.mode !== 'CheckBox') {
16402
- this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length :
16403
- this.totalItemCount;
16404
- }
16405
- if (!this.list.querySelector('.e-virtual-ddl')) {
16406
- var virualElement = this.createElement('div', {
16407
- id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
16408
- });
16409
- this.popupWrapper.querySelector('.e-dropdownbase').appendChild(virualElement);
16410
- }
16411
- else {
16412
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16413
- this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
16414
- }
16415
- if (this.list.querySelector('.e-virtual-ddl-content')) {
16416
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16417
- this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
16405
+ if (this.enableVirtualization && this.hideSelectedItem) {
16406
+ var visibleListElements = this.list.querySelectorAll('li.'
16407
+ + dropDownBaseClasses.li
16408
+ + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)' + ':not(.e-virtual-list)');
16409
+ if (visibleListElements.length) {
16410
+ var actualCount = this.virtualListHeight > 0 ?
16411
+ Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
16412
+ if (visibleListElements.length < (actualCount + 2)) {
16413
+ var query = this.getForQuery(this.value).clone();
16414
+ query = query.skip(this.virtualItemStartIndex);
16415
+ this.resetList(this.dataSource, this.fields, query);
16416
+ this.UpdateSkeleton();
16417
+ this.liCollections = this.list.querySelectorAll('.'
16418
+ + dropDownBaseClasses.li);
16419
+ this.virtualItemCount = this.itemCount;
16420
+ if (this.mode !== 'CheckBox') {
16421
+ this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length :
16422
+ this.totalItemCount;
16423
+ }
16424
+ if (!this.list.querySelector('.e-virtual-ddl')) {
16425
+ var virualElement = this.createElement('div', {
16426
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
16427
+ });
16428
+ this.popupWrapper.querySelector('.e-dropdownbase').appendChild(virualElement);
16429
+ }
16430
+ else {
16431
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16432
+ this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
16433
+ }
16434
+ if (this.list.querySelector('.e-virtual-ddl-content')) {
16435
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16436
+ this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
16437
+ }
16418
16438
  }
16419
16439
  }
16420
16440
  }
16441
+ this.refreshPlaceHolder();
16442
+ this.deselectHeader();
16421
16443
  }
16422
- this.refreshPlaceHolder();
16423
- this.deselectHeader();
16424
16444
  }
16425
16445
  };
16426
16446
  MultiSelect.prototype.findGroupStart = function (target) {