@syncfusion/ej2-dropdowns 33.2.10 → 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.
@@ -6119,7 +6119,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
6119
6119
  }, 5);
6120
6120
  }
6121
6121
  attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_popup', 'aria-controls': _this.element.id });
6122
- if (_this.getModuleName() !== 'dropdownlist' && _this.list.classList.contains('e-nodata')) {
6122
+ if (_this.list.classList.contains('e-nodata')) {
6123
6123
  attributes(_this.targetElement(), { 'aria-activedescendant': 'no-record' });
6124
6124
  _this.popupContentElement.setAttribute('role', 'status');
6125
6125
  _this.popupContentElement.setAttribute('id', 'no-record');
@@ -6313,9 +6313,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
6313
6313
  ulElement = null;
6314
6314
  },
6315
6315
  targetExitViewport: function () {
6316
- if (!Browser.isDevice) {
6317
- _this.hidePopup();
6318
- }
6316
+ _this.hidePopup();
6319
6317
  }
6320
6318
  });
6321
6319
  };
@@ -6931,8 +6929,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
6931
6929
  if (!this.targetElement().hasAttribute('aria-label')) {
6932
6930
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
6933
6931
  }
6934
- if (!this.inputElement.hasAttribute('aria-label')) {
6935
- this.inputElement.setAttribute('aria-label', this.getModuleName());
6932
+ if (!this.inputElement.hasAttribute('aria-labelledby')) {
6933
+ this.inputElement.setAttribute('aria-labelledby', this.hiddenElement.id);
6936
6934
  }
6937
6935
  this.inputElement.setAttribute('aria-expanded', 'false');
6938
6936
  }
@@ -7289,6 +7287,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7289
7287
  }
7290
7288
  break;
7291
7289
  case 'value':
7290
+ if (this_1.isAngular && closest(this_1.inputElement, 'form') && oldProp.value === newProp.value) {
7291
+ this_1.preventChange = true;
7292
+ }
7292
7293
  if (this_1.fields.disabled) {
7293
7294
  newProp.value = newProp.value != null && !this_1.isDisableItemValue(newProp.value) ? newProp.value : null;
7294
7295
  }
@@ -13672,6 +13673,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13672
13673
  _this.selectAllEventEle = [];
13673
13674
  _this.preventSetCurrentData = false;
13674
13675
  _this.isSelectAllLoop = false;
13676
+ _this.isInitialFocusAnnouncementDone = false;
13675
13677
  _this.scrollFocusStatus = false;
13676
13678
  _this.keyDownStatus = false;
13677
13679
  return _this;
@@ -14911,6 +14913,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14911
14913
  return;
14912
14914
  }
14913
14915
  this.inputFocus = false;
14916
+ this.isInitialFocusAnnouncementDone = false;
14914
14917
  this.overAllWrapper.classList.remove(FOCUS);
14915
14918
  if (this.addTagOnBlur) {
14916
14919
  var dataChecks = this.getValueByText(this.inputElement.value, this.ignoreCase, this.ignoreAccent);
@@ -15178,6 +15181,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15178
15181
  this.trigger('focus', args);
15179
15182
  this.focused = false;
15180
15183
  }
15184
+ if (!this.isInitialFocusAnnouncementDone) {
15185
+ this.announceInitialFocusInstruction();
15186
+ this.isInitialFocusAnnouncementDone = true;
15187
+ }
15181
15188
  if (!this.overAllWrapper.classList.contains(FOCUS)) {
15182
15189
  this.overAllWrapper.classList.add(FOCUS);
15183
15190
  }
@@ -15903,6 +15910,25 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15903
15910
  }
15904
15911
  this.checkPlaceholderSize();
15905
15912
  };
15913
+ MultiSelect.prototype.announceSelection = function (text) {
15914
+ if (text && this.chipAnnouncerLiveRegion) {
15915
+ var count = this.value ? this.value.length : 0;
15916
+ var announcement = text + " added to selection " + count + " items selected";
15917
+ this.chipAnnouncerLiveRegion.textContent = announcement;
15918
+ }
15919
+ };
15920
+ MultiSelect.prototype.announceInitialFocusInstruction = function () {
15921
+ var _this = this;
15922
+ if (this.chipAnnouncerLiveRegion) {
15923
+ var instruction_1 = 'Use arrow keys to open popup and navigate items, Enter to select, and Backspace to delete selections';
15924
+ this.chipAnnouncerLiveRegion.textContent = '';
15925
+ setTimeout(function () {
15926
+ if (_this.chipAnnouncerLiveRegion) {
15927
+ _this.chipAnnouncerLiveRegion.textContent = instruction_1;
15928
+ }
15929
+ }, 200);
15930
+ }
15931
+ };
15906
15932
  MultiSelect.prototype.moveByTop = function (state) {
15907
15933
  var elements = this.list.querySelectorAll('li.' + dropDownBaseClasses.li);
15908
15934
  var index;
@@ -16107,7 +16133,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16107
16133
  element.setAttribute('aria-hidden', 'true');
16108
16134
  var chipTitle = element.getAttribute('title');
16109
16135
  if (chipTitle && this.chipAnnouncerLiveRegion) {
16110
- var announcement = chipTitle + " focused. Press Backspace to remove";
16136
+ var announcement = chipTitle.length > 500
16137
+ ? 'Chip focused. Press Backspace to remove'
16138
+ : chipTitle + " focused. Press Backspace to remove";
16111
16139
  this.chipAnnouncerLiveRegion.textContent = announcement;
16112
16140
  }
16113
16141
  if (!isNullOrUndefined(this.inputElement) && element.id) {
@@ -16484,6 +16512,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16484
16512
  if (this.mode !== 'Delimiter' && this.mode !== 'CheckBox') {
16485
16513
  this.addChip(text, value, eve);
16486
16514
  }
16515
+ else {
16516
+ this.announceSelection(text);
16517
+ }
16487
16518
  if (this.hideSelectedItem && this.fields.groupBy) {
16488
16519
  this.hideGroupItem(value);
16489
16520
  }
@@ -16696,6 +16727,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16696
16727
  }
16697
16728
  EventHandler.add(chipClose, 'mousedown', _this.onChipRemove, _this);
16698
16729
  _this.chipCollectionWrapper.appendChild(chip);
16730
+ _this.announceSelection(data);
16699
16731
  if (!_this.changeOnBlur && e) {
16700
16732
  _this.updateValueState(e, _this.value, _this.tempValues);
16701
16733
  }
@@ -21225,8 +21257,10 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
21225
21257
  }
21226
21258
  };
21227
21259
  CheckBoxSelection.prototype.setLocale = function (unSelect) {
21228
- if (this.parent.selectAllText !== 'Select All' || this.parent.unSelectAllText !== 'Unselect All') {
21229
- var template = unSelect ? this.parent.unSelectAllText : this.parent.selectAllText;
21260
+ var template = unSelect ? this.parent.unSelectAllText : this.parent.selectAllText;
21261
+ var isListBox = this.parent.element.classList.contains('e-listbox');
21262
+ if ((this.parent.selectAllText !== 'Select All' || this.parent.unSelectAllText !== 'Unselect All') &&
21263
+ (!isListBox || typeof template === 'function' || (typeof template === 'string' && /<[a-z][\s\S]*>/i.test(template)))) {
21230
21264
  this.selectAllSpan.textContent = '';
21231
21265
  var compiledString = compile(template);
21232
21266
  var templateName = unSelect ? 'unSelectAllText' : 'selectAllText';