@syncfusion/ej2-dropdowns 27.1.58 → 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.
@@ -7994,6 +7994,11 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
7994
7994
  _this.checkAllParent.focus();
7995
7995
  }
7996
7996
  break;
7997
+ case 'tab':
7998
+ if (!_this.isPopupOpen && _this.inputFocus) {
7999
+ _this.onFocusOut();
8000
+ }
8001
+ break;
7997
8002
  }
7998
8003
  }
7999
8004
  });
@@ -15538,6 +15543,15 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15538
15543
  this.previousEndIndex = 0;
15539
15544
  }
15540
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);
15541
15555
  };
15542
15556
  MultiSelect.prototype.clearAllCallback = function (e, isClearAll) {
15543
15557
  var tempValues = this.value ? this.value.slice() : [];
@@ -16302,127 +16316,131 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16302
16316
  };
16303
16317
  MultiSelect.prototype.onMouseClick = function (e) {
16304
16318
  var _this = this;
16305
- this.keyCode = null;
16306
- this.scrollFocusStatus = false;
16307
- this.keyboardEvent = null;
16308
- var target = e.target;
16309
- var li = closest(target, '.' + dropDownBaseClasses.li);
16310
- if (this.enableVirtualization && li && li.classList.contains('e-virtual-list')) {
16311
- return;
16312
- }
16313
- var headerLi = closest(target, '.' + dropDownBaseClasses.group);
16314
- if (headerLi && this.enableGroupCheckBox && this.mode === 'CheckBox' && this.fields.groupBy) {
16315
- target = target.classList.contains('e-list-group-item') ? target.firstElementChild.lastElementChild
16316
- : e.target;
16317
- if (target.classList.contains('e-check')) {
16318
- this.selectAllItem(false, e);
16319
- target.classList.remove('e-check');
16320
- target.classList.remove('e-stop');
16321
- closest(target, '.' + 'e-list-group-item').classList.remove('e-active');
16322
- target.setAttribute('aria-selected', 'false');
16323
- }
16324
- else {
16325
- this.selectAllItem(true, e);
16326
- target.classList.remove('e-stop');
16327
- target.classList.add('e-check');
16328
- closest(target, '.' + 'e-list-group-item').classList.add('e-active');
16329
- 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;
16330
16327
  }
16331
- this.refreshSelection();
16332
- this.checkSelectAll();
16333
- }
16334
- else {
16335
- if (this.isValidLI(li)) {
16336
- var limit = this.value && this.value.length ? this.value.length : 0;
16337
- if (li.classList.contains('e-active')) {
16338
- 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');
16339
16338
  }
16340
- if (limit < this.maximumSelectionLength) {
16341
- this.updateListSelection(li, e);
16342
- this.checkPlaceholderSize();
16343
- this.addListFocus(li);
16344
- if ((this.allowCustomValue || this.allowFiltering) && this.mainList && this.listData) {
16345
- if (this.mode !== 'CheckBox') {
16346
- this.focusAtLastListItem(li.getAttribute('data-value'));
16347
- 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();
16348
16367
  }
16349
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
+ }
16350
16381
  else {
16351
- this.makeTextBoxEmpty();
16382
+ this.updateDelimeter(this.delimiterChar, e);
16352
16383
  }
16353
- }
16354
- if (this.mode === 'CheckBox') {
16355
- this.updateDelimView();
16356
- if (this.value && this.value.length > 50) {
16357
- setTimeout(function () {
16358
- _this.updateDelimeter(_this.delimiterChar, e);
16359
- }, 0);
16384
+ this.checkSelectAll();
16385
+ this.refreshPopup();
16386
+ if (this.hideSelectedItem) {
16387
+ this.focusAtFirstListItem();
16388
+ }
16389
+ if (this.closePopupOnSelect) {
16390
+ this.hidePopup(e);
16360
16391
  }
16361
16392
  else {
16362
- 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);
16363
16400
  }
16364
- this.refreshInputHight();
16365
- }
16366
- else {
16367
- this.updateDelimeter(this.delimiterChar, e);
16368
- }
16369
- this.checkSelectAll();
16370
- this.refreshPopup();
16371
- if (this.hideSelectedItem) {
16372
- this.focusAtFirstListItem();
16373
- }
16374
- if (this.closePopupOnSelect) {
16375
- this.hidePopup(e);
16376
16401
  }
16377
16402
  else {
16378
16403
  e.preventDefault();
16379
16404
  }
16380
- var isFilterData = this.targetElement().trim() !== '' ? true : false;
16381
- this.makeTextBoxEmpty();
16382
- this.findGroupStart(target);
16383
- if (this.mode !== 'CheckBox') {
16384
- this.refreshListItems(isNullOrUndefined(li) ? null : li.textContent, isFilterData);
16385
- }
16386
- }
16387
- else {
16388
- e.preventDefault();
16389
- }
16390
- if (this.enableVirtualization && this.hideSelectedItem) {
16391
- var visibleListElements = this.list.querySelectorAll('li.'
16392
- + dropDownBaseClasses.li
16393
- + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)' + ':not(.e-virtual-list)');
16394
- if (visibleListElements.length) {
16395
- var actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
16396
- if (visibleListElements.length < (actualCount + 2)) {
16397
- var query = this.getForQuery(this.value).clone();
16398
- query = query.skip(this.virtualItemStartIndex);
16399
- this.resetList(this.dataSource, this.fields, query);
16400
- this.UpdateSkeleton();
16401
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
16402
- this.virtualItemCount = this.itemCount;
16403
- if (this.mode !== 'CheckBox') {
16404
- this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length :
16405
- this.totalItemCount;
16406
- }
16407
- if (!this.list.querySelector('.e-virtual-ddl')) {
16408
- var virualElement = this.createElement('div', {
16409
- id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
16410
- });
16411
- this.popupWrapper.querySelector('.e-dropdownbase').appendChild(virualElement);
16412
- }
16413
- else {
16414
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16415
- this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
16416
- }
16417
- if (this.list.querySelector('.e-virtual-ddl-content')) {
16418
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16419
- 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
+ }
16420
16438
  }
16421
16439
  }
16422
16440
  }
16441
+ this.refreshPlaceHolder();
16442
+ this.deselectHeader();
16423
16443
  }
16424
- this.refreshPlaceHolder();
16425
- this.deselectHeader();
16426
16444
  }
16427
16445
  };
16428
16446
  MultiSelect.prototype.findGroupStart = function (target) {