@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.
@@ -7241,7 +7241,7 @@ let DropDownTree = class DropDownTree extends Component {
7241
7241
  this.ensurePlaceHolder();
7242
7242
  ariaState = state === 'check' ? 'true' : 'false';
7243
7243
  if (!isNullOrUndefined(ariaState)) {
7244
- wrapper.setAttribute('aria-checked', ariaState);
7244
+ wrapper.parentElement.setAttribute('aria-checked', ariaState);
7245
7245
  }
7246
7246
  }
7247
7247
  setLocale(unSelect) {
@@ -8027,7 +8027,7 @@ let DropDownTree = class DropDownTree extends Component {
8027
8027
  }
8028
8028
  if (this.showSelectAll && this.checkBoxElement) {
8029
8029
  const nodes = this.treeObj.element.querySelectorAll('li');
8030
- const checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
8030
+ const checkedNodes = this.treeObj.element.querySelectorAll('li[aria-checked=true]');
8031
8031
  const wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
8032
8032
  if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0 || (!isNullOrUndefined(args.data[0]) && args.data[0].isChecked === 'false'))) {
8033
8033
  this.isReverseUpdate = true;
@@ -11430,7 +11430,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11430
11430
  }
11431
11431
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
11432
11432
  openClick(e) {
11433
- if (!this.openOnClick && this.mode !== 'CheckBox') {
11433
+ if (!this.openOnClick && this.mode !== 'CheckBox' && !this.isPopupOpen()) {
11434
11434
  if (this.targetElement() !== '') {
11435
11435
  this.showPopup();
11436
11436
  }
@@ -12600,7 +12600,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12600
12600
  this.trigger('removed', eventArgs);
12601
12601
  const targetEle = eve && eve.currentTarget;
12602
12602
  const isSelectAll = (targetEle && targetEle.classList.contains('e-selectall-parent')) ? true : null;
12603
- if (!this.changeOnBlur && !isClearAll && (eve && length && !isSelectAll)) {
12603
+ if (!this.changeOnBlur && !isClearAll && (eve && length && !isSelectAll && this.isSelectAllTarget)) {
12604
12604
  this.updateValueState(eve, this.value, this.tempValues);
12605
12605
  }
12606
12606
  if (length) {
@@ -13270,6 +13270,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13270
13270
  this.backCommand = true;
13271
13271
  this.isCustomRendered = false;
13272
13272
  this.isRemoteSelection = false;
13273
+ this.isSelectAllTarget = true;
13273
13274
  }
13274
13275
  updateData(delimiterChar, e) {
13275
13276
  let data = '';
@@ -14184,6 +14185,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14184
14185
  count = state ? this.maximumSelectionLength - (this.value ? this.value.length : 0) : this.maximumSelectionLength;
14185
14186
  }
14186
14187
  if (!beforeSelectArgs.preventSelectEvent) {
14188
+ this.isSelectAllTarget = (length === index + 1);
14187
14189
  while (index < length && index <= 50 && index < count) {
14188
14190
  this.updateListSelection(li[index], event, length - index);
14189
14191
  if (this.enableGroupCheckBox) {
@@ -14194,6 +14196,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14194
14196
  if (length > 50) {
14195
14197
  setTimeout(() => {
14196
14198
  while (index < length && index < count) {
14199
+ this.isSelectAllTarget = (length === index + 1);
14197
14200
  this.updateListSelection(li[index], event, length - index);
14198
14201
  if (this.enableGroupCheckBox) {
14199
14202
  this.findGroupStart(li[index]);
@@ -14206,6 +14209,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14206
14209
  this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
14207
14210
  }
14208
14211
  this.updateHiddenElement();
14212
+ if (this.popupWrapper && li[index - 1].classList.contains('e-item-focus')) {
14213
+ const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
14214
+ if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
14215
+ li[index - 1].classList.remove('e-item-focus');
14216
+ }
14217
+ }
14209
14218
  }, 0);
14210
14219
  }
14211
14220
  }
@@ -14303,7 +14312,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14303
14312
  }
14304
14313
  if (this.mode === 'CheckBox') {
14305
14314
  this.updateDelimView();
14306
- if (!(isRemoveAll || this.isSelectAll)) {
14315
+ if (!(isRemoveAll || this.isSelectAll) && this.isSelectAllTarget) {
14307
14316
  this.updateDelimeter(this.delimiterChar, event);
14308
14317
  }
14309
14318
  this.refreshInputHight();
@@ -18237,21 +18246,6 @@ let Mention = class Mention extends DropDownBase {
18237
18246
  this.isPopupOpen = false;
18238
18247
  this.isCollided = false;
18239
18248
  this.lineBreak = false;
18240
- this.keyConfigure = {
18241
- tab: 'tab',
18242
- enter: '13',
18243
- escape: '27',
18244
- end: '35',
18245
- home: '36',
18246
- down: '40',
18247
- up: '38',
18248
- pageUp: '33',
18249
- pageDown: '34',
18250
- open: 'alt+40',
18251
- close: 'shift+tab',
18252
- hide: 'alt+38',
18253
- space: '32'
18254
- };
18255
18249
  }
18256
18250
  /**
18257
18251
  * Execute before render the list items
@@ -18297,9 +18291,7 @@ let Mention = class Mention extends DropDownBase {
18297
18291
  }
18298
18292
  bindCommonEvent() {
18299
18293
  if (!Browser.isDevice) {
18300
- this.keyboardModule = new KeyboardEvents(this.inputElement, {
18301
- keyAction: this.keyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'
18302
- });
18294
+ this.inputElement.addEventListener('keydown', this.keyDownHandler.bind(this), true);
18303
18295
  }
18304
18296
  }
18305
18297
  /**
@@ -18351,6 +18343,47 @@ let Mention = class Mention extends DropDownBase {
18351
18343
  }
18352
18344
  }
18353
18345
  }
18346
+ keyDownHandler(e) {
18347
+ let isKeyAction = true;
18348
+ switch (e.keyCode) {
18349
+ case 38:
18350
+ e.action = e.altKey ? 'hide' : 'up';
18351
+ break;
18352
+ case 40:
18353
+ e.action = e.altKey ? 'open' : 'down';
18354
+ break;
18355
+ case 33:
18356
+ e.action = 'pageUp';
18357
+ break;
18358
+ case 34:
18359
+ e.action = 'pageDown';
18360
+ break;
18361
+ case 36:
18362
+ e.action = 'home';
18363
+ break;
18364
+ case 35:
18365
+ e.action = 'end';
18366
+ break;
18367
+ case 9:
18368
+ e.action = e.shiftKey ? 'close' : 'tab';
18369
+ break;
18370
+ case 27:
18371
+ e.action = 'escape';
18372
+ break;
18373
+ case 32:
18374
+ e.action = 'space';
18375
+ break;
18376
+ case 13:
18377
+ e.action = 'enter';
18378
+ break;
18379
+ default:
18380
+ isKeyAction = false;
18381
+ break;
18382
+ }
18383
+ if (isKeyAction) {
18384
+ this.keyActionHandler(e);
18385
+ }
18386
+ }
18354
18387
  keyActionHandler(e) {
18355
18388
  const isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
18356
18389
  || e.action === 'home' || e.action === 'end');
@@ -18429,7 +18462,7 @@ let Mention = class Mention extends DropDownBase {
18429
18462
  }
18430
18463
  unBindCommonEvent() {
18431
18464
  if (!Browser.isDevice) {
18432
- this.keyboardModule.destroy();
18465
+ this.inputElement.removeEventListener('keydown', this.keyDownHandler.bind(this), true);
18433
18466
  }
18434
18467
  }
18435
18468
  onKeyUp(e) {
@@ -19028,7 +19061,7 @@ let Mention = class Mention extends DropDownBase {
19028
19061
  for (let i = 0; i < iframes.length; i++) {
19029
19062
  // eslint-disable-next-line security/detect-object-injection
19030
19063
  const iframe = iframes[i];
19031
- if (iframe.contentDocument.contains(element)) {
19064
+ if (iframe.contentDocument && iframe.contentDocument.contains(element)) {
19032
19065
  const iframeRect = iframe.getBoundingClientRect();
19033
19066
  rectTop += iframeRect.top;
19034
19067
  rectLeft += iframeRect.left;
@@ -19104,7 +19137,7 @@ let Mention = class Mention extends DropDownBase {
19104
19137
  * @returns {void}
19105
19138
  */
19106
19139
  wireListEvents() {
19107
- EventHandler.add(this.list, 'click', this.onMouseClick, this);
19140
+ EventHandler.add(this.list, 'mousedown', this.onMouseClick, this);
19108
19141
  EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
19109
19142
  EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
19110
19143
  }
@@ -19114,7 +19147,7 @@ let Mention = class Mention extends DropDownBase {
19114
19147
  * @returns {void}
19115
19148
  */
19116
19149
  unWireListEvents() {
19117
- EventHandler.remove(this.list, 'click', this.onMouseClick);
19150
+ EventHandler.remove(this.list, 'mousedown', this.onMouseClick);
19118
19151
  EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
19119
19152
  EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
19120
19153
  }
@@ -19129,6 +19162,7 @@ let Mention = class Mention extends DropDownBase {
19129
19162
  const delay = 100;
19130
19163
  this.closePopup(delay, e);
19131
19164
  this.inputElement.focus();
19165
+ e.preventDefault();
19132
19166
  }
19133
19167
  updateSelectedItem(li, e, preventSelect, isSelection) {
19134
19168
  this.removeSelection();