@syncfusion/ej2-dropdowns 24.2.6 → 24.2.8

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.
@@ -7408,7 +7408,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
7408
7408
  this.ensurePlaceHolder();
7409
7409
  ariaState = state === 'check' ? 'true' : 'false';
7410
7410
  if (!isNullOrUndefined(ariaState)) {
7411
- wrapper.setAttribute('aria-checked', ariaState);
7411
+ wrapper.parentElement.setAttribute('aria-checked', ariaState);
7412
7412
  }
7413
7413
  };
7414
7414
  DropDownTree.prototype.setLocale = function (unSelect) {
@@ -8199,7 +8199,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8199
8199
  }
8200
8200
  if (this.showSelectAll && this.checkBoxElement) {
8201
8201
  var nodes = this.treeObj.element.querySelectorAll('li');
8202
- var checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
8202
+ var checkedNodes = this.treeObj.element.querySelectorAll('li[aria-checked=true]');
8203
8203
  var wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
8204
8204
  if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0 || (!isNullOrUndefined(args.data[0]) && args.data[0].isChecked === 'false'))) {
8205
8205
  this.isReverseUpdate = true;
@@ -11659,7 +11659,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11659
11659
  };
11660
11660
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
11661
11661
  MultiSelect.prototype.openClick = function (e) {
11662
- if (!this.openOnClick && this.mode !== 'CheckBox') {
11662
+ if (!this.openOnClick && this.mode !== 'CheckBox' && !this.isPopupOpen()) {
11663
11663
  if (this.targetElement() !== '') {
11664
11664
  this.showPopup();
11665
11665
  }
@@ -12831,7 +12831,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12831
12831
  _this.trigger('removed', eventArgs);
12832
12832
  var targetEle_1 = eve && eve.currentTarget;
12833
12833
  var isSelectAll = (targetEle_1 && targetEle_1.classList.contains('e-selectall-parent')) ? true : null;
12834
- if (!_this.changeOnBlur && !isClearAll && (eve && length && !isSelectAll)) {
12834
+ if (!_this.changeOnBlur && !isClearAll && (eve && length && !isSelectAll && _this.isSelectAllTarget)) {
12835
12835
  _this.updateValueState(eve, _this.value, _this.tempValues);
12836
12836
  }
12837
12837
  if (length) {
@@ -13506,6 +13506,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13506
13506
  this.backCommand = true;
13507
13507
  this.isCustomRendered = false;
13508
13508
  this.isRemoteSelection = false;
13509
+ this.isSelectAllTarget = true;
13509
13510
  };
13510
13511
  MultiSelect.prototype.updateData = function (delimiterChar, e) {
13511
13512
  var data = '';
@@ -14423,6 +14424,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14423
14424
  count_1 = state ? this.maximumSelectionLength - (this.value ? this.value.length : 0) : this.maximumSelectionLength;
14424
14425
  }
14425
14426
  if (!beforeSelectArgs.preventSelectEvent) {
14427
+ this.isSelectAllTarget = (length === index_1 + 1);
14426
14428
  while (index_1 < length && index_1 <= 50 && index_1 < count_1) {
14427
14429
  this.updateListSelection(li[index_1], event, length - index_1);
14428
14430
  if (this.enableGroupCheckBox) {
@@ -14433,6 +14435,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14433
14435
  if (length > 50) {
14434
14436
  setTimeout(function () {
14435
14437
  while (index_1 < length && index_1 < count_1) {
14438
+ _this.isSelectAllTarget = (length === index_1 + 1);
14436
14439
  _this.updateListSelection(li[index_1], event, length - index_1);
14437
14440
  if (_this.enableGroupCheckBox) {
14438
14441
  _this.findGroupStart(li[index_1]);
@@ -14445,6 +14448,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14445
14448
  _this.isSelectAll = _this.isSelectAll ? !_this.isSelectAll : _this.isSelectAll;
14446
14449
  }
14447
14450
  _this.updateHiddenElement();
14451
+ if (_this.popupWrapper && li[index_1 - 1].classList.contains('e-item-focus')) {
14452
+ var selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
14453
+ if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
14454
+ li[index_1 - 1].classList.remove('e-item-focus');
14455
+ }
14456
+ }
14448
14457
  }, 0);
14449
14458
  }
14450
14459
  }
@@ -14543,7 +14552,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14543
14552
  }
14544
14553
  if (this.mode === 'CheckBox') {
14545
14554
  this.updateDelimView();
14546
- if (!(isRemoveAll || this.isSelectAll)) {
14555
+ if (!(isRemoveAll || this.isSelectAll) && this.isSelectAllTarget) {
14547
14556
  this.updateDelimeter(this.delimiterChar, event);
14548
14557
  }
14549
14558
  this.refreshInputHight();
@@ -18564,21 +18573,6 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18564
18573
  this.isPopupOpen = false;
18565
18574
  this.isCollided = false;
18566
18575
  this.lineBreak = false;
18567
- this.keyConfigure = {
18568
- tab: 'tab',
18569
- enter: '13',
18570
- escape: '27',
18571
- end: '35',
18572
- home: '36',
18573
- down: '40',
18574
- up: '38',
18575
- pageUp: '33',
18576
- pageDown: '34',
18577
- open: 'alt+40',
18578
- close: 'shift+tab',
18579
- hide: 'alt+38',
18580
- space: '32'
18581
- };
18582
18576
  };
18583
18577
  /**
18584
18578
  * Execute before render the list items
@@ -18624,9 +18618,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18624
18618
  };
18625
18619
  Mention.prototype.bindCommonEvent = function () {
18626
18620
  if (!Browser.isDevice) {
18627
- this.keyboardModule = new KeyboardEvents(this.inputElement, {
18628
- keyAction: this.keyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'
18629
- });
18621
+ this.inputElement.addEventListener('keydown', this.keyDownHandler.bind(this), true);
18630
18622
  }
18631
18623
  };
18632
18624
  /**
@@ -18678,6 +18670,47 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18678
18670
  }
18679
18671
  }
18680
18672
  };
18673
+ Mention.prototype.keyDownHandler = function (e) {
18674
+ var isKeyAction = true;
18675
+ switch (e.keyCode) {
18676
+ case 38:
18677
+ e.action = e.altKey ? 'hide' : 'up';
18678
+ break;
18679
+ case 40:
18680
+ e.action = e.altKey ? 'open' : 'down';
18681
+ break;
18682
+ case 33:
18683
+ e.action = 'pageUp';
18684
+ break;
18685
+ case 34:
18686
+ e.action = 'pageDown';
18687
+ break;
18688
+ case 36:
18689
+ e.action = 'home';
18690
+ break;
18691
+ case 35:
18692
+ e.action = 'end';
18693
+ break;
18694
+ case 9:
18695
+ e.action = e.shiftKey ? 'close' : 'tab';
18696
+ break;
18697
+ case 27:
18698
+ e.action = 'escape';
18699
+ break;
18700
+ case 32:
18701
+ e.action = 'space';
18702
+ break;
18703
+ case 13:
18704
+ e.action = 'enter';
18705
+ break;
18706
+ default:
18707
+ isKeyAction = false;
18708
+ break;
18709
+ }
18710
+ if (isKeyAction) {
18711
+ this.keyActionHandler(e);
18712
+ }
18713
+ };
18681
18714
  Mention.prototype.keyActionHandler = function (e) {
18682
18715
  var isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
18683
18716
  || e.action === 'home' || e.action === 'end');
@@ -18756,7 +18789,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18756
18789
  };
18757
18790
  Mention.prototype.unBindCommonEvent = function () {
18758
18791
  if (!Browser.isDevice) {
18759
- this.keyboardModule.destroy();
18792
+ this.inputElement.removeEventListener('keydown', this.keyDownHandler.bind(this), true);
18760
18793
  }
18761
18794
  };
18762
18795
  Mention.prototype.onKeyUp = function (e) {
@@ -19360,7 +19393,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
19360
19393
  for (var i = 0; i < iframes.length; i++) {
19361
19394
  // eslint-disable-next-line security/detect-object-injection
19362
19395
  var iframe = iframes[i];
19363
- if (iframe.contentDocument.contains(element)) {
19396
+ if (iframe.contentDocument && iframe.contentDocument.contains(element)) {
19364
19397
  var iframeRect = iframe.getBoundingClientRect();
19365
19398
  rectTop += iframeRect.top;
19366
19399
  rectLeft += iframeRect.left;
@@ -19436,7 +19469,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
19436
19469
  * @returns {void}
19437
19470
  */
19438
19471
  Mention.prototype.wireListEvents = function () {
19439
- EventHandler.add(this.list, 'click', this.onMouseClick, this);
19472
+ EventHandler.add(this.list, 'mousedown', this.onMouseClick, this);
19440
19473
  EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
19441
19474
  EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
19442
19475
  };
@@ -19446,7 +19479,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
19446
19479
  * @returns {void}
19447
19480
  */
19448
19481
  Mention.prototype.unWireListEvents = function () {
19449
- EventHandler.remove(this.list, 'click', this.onMouseClick);
19482
+ EventHandler.remove(this.list, 'mousedown', this.onMouseClick);
19450
19483
  EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
19451
19484
  EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
19452
19485
  };
@@ -19461,6 +19494,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
19461
19494
  var delay = 100;
19462
19495
  this.closePopup(delay, e);
19463
19496
  this.inputElement.focus();
19497
+ e.preventDefault();
19464
19498
  };
19465
19499
  Mention.prototype.updateSelectedItem = function (li, e, preventSelect, isSelection) {
19466
19500
  var _this = this;