@syncfusion/ej2-dropdowns 33.2.12 → 33.2.15

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.
@@ -6184,9 +6184,7 @@ let DropDownList = class DropDownList extends DropDownBase {
6184
6184
  ulElement = null;
6185
6185
  },
6186
6186
  targetExitViewport: () => {
6187
- if (!Browser.isDevice) {
6188
- this.hidePopup();
6189
- }
6187
+ this.hidePopup();
6190
6188
  }
6191
6189
  });
6192
6190
  }
@@ -6796,8 +6794,8 @@ let DropDownList = class DropDownList extends DropDownBase {
6796
6794
  if (!this.targetElement().hasAttribute('aria-label')) {
6797
6795
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
6798
6796
  }
6799
- if (!this.inputElement.hasAttribute('aria-label')) {
6800
- this.inputElement.setAttribute('aria-label', this.getModuleName());
6797
+ if (!this.inputElement.hasAttribute('aria-labelledby')) {
6798
+ this.inputElement.setAttribute('aria-labelledby', this.hiddenElement.id);
6801
6799
  }
6802
6800
  this.inputElement.setAttribute('aria-expanded', 'false');
6803
6801
  }
@@ -13419,6 +13417,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13419
13417
  this.selectAllEventEle = [];
13420
13418
  this.preventSetCurrentData = false;
13421
13419
  this.isSelectAllLoop = false;
13420
+ this.isInitialFocusAnnouncementDone = false;
13422
13421
  this.scrollFocusStatus = false;
13423
13422
  this.keyDownStatus = false;
13424
13423
  }
@@ -14654,6 +14653,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14654
14653
  return;
14655
14654
  }
14656
14655
  this.inputFocus = false;
14656
+ this.isInitialFocusAnnouncementDone = false;
14657
14657
  this.overAllWrapper.classList.remove(FOCUS);
14658
14658
  if (this.addTagOnBlur) {
14659
14659
  const dataChecks = this.getValueByText(this.inputElement.value, this.ignoreCase, this.ignoreAccent);
@@ -14920,6 +14920,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14920
14920
  this.trigger('focus', args);
14921
14921
  this.focused = false;
14922
14922
  }
14923
+ if (!this.isInitialFocusAnnouncementDone) {
14924
+ this.announceInitialFocusInstruction();
14925
+ this.isInitialFocusAnnouncementDone = true;
14926
+ }
14923
14927
  if (!this.overAllWrapper.classList.contains(FOCUS)) {
14924
14928
  this.overAllWrapper.classList.add(FOCUS);
14925
14929
  }
@@ -15641,6 +15645,24 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15641
15645
  }
15642
15646
  this.checkPlaceholderSize();
15643
15647
  }
15648
+ announceSelection(text) {
15649
+ if (text && this.chipAnnouncerLiveRegion) {
15650
+ const count = this.value ? this.value.length : 0;
15651
+ const announcement = `${text} added to selection ${count} items selected`;
15652
+ this.chipAnnouncerLiveRegion.textContent = announcement;
15653
+ }
15654
+ }
15655
+ announceInitialFocusInstruction() {
15656
+ if (this.chipAnnouncerLiveRegion) {
15657
+ const instruction = 'Use arrow keys to open popup and navigate items, Enter to select, and Backspace to delete selections';
15658
+ this.chipAnnouncerLiveRegion.textContent = '';
15659
+ setTimeout(() => {
15660
+ if (this.chipAnnouncerLiveRegion) {
15661
+ this.chipAnnouncerLiveRegion.textContent = instruction;
15662
+ }
15663
+ }, 200);
15664
+ }
15665
+ }
15644
15666
  moveByTop(state) {
15645
15667
  const elements = this.list.querySelectorAll('li.' + dropDownBaseClasses.li);
15646
15668
  let index;
@@ -16215,6 +16237,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16215
16237
  if (this.mode !== 'Delimiter' && this.mode !== 'CheckBox') {
16216
16238
  this.addChip(text, value, eve);
16217
16239
  }
16240
+ else {
16241
+ this.announceSelection(text);
16242
+ }
16218
16243
  if (this.hideSelectedItem && this.fields.groupBy) {
16219
16244
  this.hideGroupItem(value);
16220
16245
  }
@@ -16425,6 +16450,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16425
16450
  }
16426
16451
  EventHandler.add(chipClose, 'mousedown', this.onChipRemove, this);
16427
16452
  this.chipCollectionWrapper.appendChild(chip);
16453
+ this.announceSelection(data);
16428
16454
  if (!this.changeOnBlur && e) {
16429
16455
  this.updateValueState(e, this.value, this.tempValues);
16430
16456
  }
@@ -20923,8 +20949,10 @@ class CheckBoxSelection {
20923
20949
  }
20924
20950
  }
20925
20951
  setLocale(unSelect) {
20926
- if (this.parent.selectAllText !== 'Select All' || this.parent.unSelectAllText !== 'Unselect All') {
20927
- const template = unSelect ? this.parent.unSelectAllText : this.parent.selectAllText;
20952
+ const template = unSelect ? this.parent.unSelectAllText : this.parent.selectAllText;
20953
+ const isListBox = this.parent.element.classList.contains('e-listbox');
20954
+ if ((this.parent.selectAllText !== 'Select All' || this.parent.unSelectAllText !== 'Unselect All') &&
20955
+ (!isListBox || typeof template === 'function' || (typeof template === 'string' && /<[a-z][\s\S]*>/i.test(template)))) {
20928
20956
  this.selectAllSpan.textContent = '';
20929
20957
  const compiledString = compile(template);
20930
20958
  const templateName = unSelect ? 'unSelectAllText' : 'selectAllText';