@syncfusion/ej2-dropdowns 20.3.56 → 20.3.58

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/ej2-dropdowns.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-dropdowns.es2015.js +46 -27
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +46 -27
  8. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  9. package/dist/global/ej2-dropdowns.min.js +2 -2
  10. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +8 -8
  13. package/src/drop-down-list/drop-down-list.d.ts +0 -1
  14. package/src/drop-down-list/drop-down-list.js +17 -16
  15. package/src/multi-select/multi-select.d.ts +1 -0
  16. package/src/multi-select/multi-select.js +29 -11
  17. package/styles/bootstrap-dark.css +4 -0
  18. package/styles/bootstrap.css +4 -0
  19. package/styles/bootstrap4.css +4 -0
  20. package/styles/bootstrap5-dark.css +4 -0
  21. package/styles/bootstrap5.css +4 -0
  22. package/styles/fabric-dark.css +4 -0
  23. package/styles/fabric.css +4 -0
  24. package/styles/fluent-dark.css +4 -0
  25. package/styles/fluent.css +4 -0
  26. package/styles/highcontrast-light.css +4 -0
  27. package/styles/highcontrast.css +4 -0
  28. package/styles/material-dark.css +4 -0
  29. package/styles/material.css +4 -0
  30. package/styles/multi-select/_layout.scss +4 -0
  31. package/styles/multi-select/bootstrap-dark.css +4 -0
  32. package/styles/multi-select/bootstrap.css +4 -0
  33. package/styles/multi-select/bootstrap4.css +4 -0
  34. package/styles/multi-select/bootstrap5-dark.css +4 -0
  35. package/styles/multi-select/bootstrap5.css +4 -0
  36. package/styles/multi-select/fabric-dark.css +4 -0
  37. package/styles/multi-select/fabric.css +4 -0
  38. package/styles/multi-select/fluent-dark.css +4 -0
  39. package/styles/multi-select/fluent.css +4 -0
  40. package/styles/multi-select/highcontrast-light.css +4 -0
  41. package/styles/multi-select/highcontrast.css +4 -0
  42. package/styles/multi-select/material-dark.css +4 -0
  43. package/styles/multi-select/material.css +4 -0
  44. package/styles/multi-select/tailwind-dark.css +4 -0
  45. package/styles/multi-select/tailwind.css +4 -0
  46. package/styles/tailwind-dark.css +4 -0
  47. package/styles/tailwind.css +4 -0
@@ -2488,10 +2488,16 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2488
2488
  this.setScrollPosition(e);
2489
2489
  }
2490
2490
  if (Browser.info.name !== 'mozilla') {
2491
- attributes(this.inputElement, { 'aria-label': this.inputElement.value });
2491
+ attributes(this.targetElement(), { 'aria-label': this.inputElement.value });
2492
2492
  attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
2493
2493
  this.targetElement().removeAttribute('aria-live');
2494
2494
  }
2495
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
2496
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
2497
+ }
2498
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
2499
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
2500
+ }
2495
2501
  };
2496
2502
  DropDownList.prototype.dropdownCompiler = function (dropdownTemplate) {
2497
2503
  var checkTemplate = false;
@@ -2684,6 +2690,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2684
2690
  this.preventAutoFill = false;
2685
2691
  }
2686
2692
  this.preventAltUp = false;
2693
+ if (this.getModuleName() === 'autocomplete' && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
2694
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
2695
+ }
2687
2696
  e.preventDefault();
2688
2697
  break;
2689
2698
  case 46: //delete
@@ -3177,19 +3186,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3177
3186
  var element = scrollParentElements_1[_i];
3178
3187
  EventHandler.add(element, 'scroll', _this.scrollHandler, _this);
3179
3188
  }
3180
- if (Browser.isDevice && _this.isFilterLayout()) {
3181
- EventHandler.add(_this.list, 'scroll', _this.listScroll, _this);
3182
- }
3183
3189
  if (!isNullOrUndefined(_this.list)) {
3184
3190
  _this.unWireListEvents();
3185
3191
  _this.wireListEvents();
3186
3192
  }
3187
3193
  _this.selectedElementID = _this.selectedLI ? _this.selectedLI.id : null;
3188
- attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.inputElement.id + '_options', 'aria-activedescendant': _this.selectedElementID });
3194
+ attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.inputElement.id + '_options' });
3189
3195
  _this.inputElement.setAttribute('aria-expanded', 'true');
3190
- if (_this.selectedElementID == null) {
3191
- _this.targetElement().removeAttribute('aria-activedescendant');
3192
- }
3193
3196
  var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
3194
3197
  addClass([inputParent], [dropDownListClasses.inputFocus]);
3195
3198
  var animModel = { name: 'FadeIn', duration: 100 };
@@ -3258,6 +3261,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3258
3261
  var actionList = _this.actionCompleteData && _this.actionCompleteData.ulElement &&
3259
3262
  _this.actionCompleteData.ulElement.querySelector('li');
3260
3263
  var ulElement = _this.list.querySelector('ul li');
3264
+ if (!isNullOrUndefined(_this.ulElement) && !isNullOrUndefined(_this.ulElement.getElementsByClassName('e-item-focus')[0])) {
3265
+ attributes(_this.targetElement(), { 'aria-activedescendant': _this.ulElement.getElementsByClassName('e-item-focus')[0].id });
3266
+ }
3267
+ else if (!isNullOrUndefined(_this.ulElement) && !isNullOrUndefined(_this.ulElement.getElementsByClassName('e-active')[0])) {
3268
+ attributes(_this.targetElement(), { 'aria-activedescendant': _this.ulElement.getElementsByClassName('e-active')[0].id });
3269
+ }
3261
3270
  if (_this.isFiltering() && _this.itemTemplate && (_this.element.tagName === _this.getNgDirective()) &&
3262
3271
  (actionList && ulElement && actionList.textContent !== ulElement.textContent) &&
3263
3272
  _this.element.tagName !== 'EJS-COMBOBOX') {
@@ -3413,9 +3422,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3413
3422
  this.filterInput.value = this.typedString = '';
3414
3423
  this.searchLists(null);
3415
3424
  };
3416
- DropDownList.prototype.listScroll = function () {
3417
- this.filterInput.blur();
3418
- };
3419
3425
  DropDownList.prototype.setEleWidth = function (width) {
3420
3426
  if (!isNullOrUndefined(width)) {
3421
3427
  if (typeof width === 'number') {
@@ -3444,7 +3450,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3444
3450
  }
3445
3451
  if (Browser.isDevice && this.isFilterLayout()) {
3446
3452
  removeClass([document.body, this.popupObj.element], dropDownListClasses.popupFullScreen);
3447
- EventHandler.remove(this.list, 'scroll', this.listScroll);
3448
3453
  }
3449
3454
  if (this.isFilterLayout()) {
3450
3455
  if (!Browser.isDevice) {
@@ -4058,10 +4063,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4058
4063
  if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
4059
4064
  this.renderPopup(e);
4060
4065
  }
4061
- attributes(this.targetElement(), { 'aria-activedescendant': this.selectedElementID });
4062
- if (this.selectedElementID == null) {
4063
- this.targetElement().removeAttribute('aria-activedescendant');
4064
- }
4065
4066
  };
4066
4067
  DropDownList.prototype.renderHightSearch = function () {
4067
4068
  // update high light search
@@ -9136,12 +9137,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9136
9137
  _this.renderReactTemplates();
9137
9138
  _this.popupObj.show(eventArgs.animation, (_this.zIndex === 1000) ? _this.element : null);
9138
9139
  attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.inputElement.id + '_options' });
9139
- if (_this.selectedElementID == null) {
9140
- _this.inputElement.removeAttribute('aria-activedescendant');
9141
- }
9142
- else {
9143
- attributes(_this.inputElement, { 'aria-activedescendant': _this.selectedElementID });
9144
- }
9140
+ _this.updateAriaActiveDescendant();
9145
9141
  if (_this.isFirstClick) {
9146
9142
  _this.loadTemplate();
9147
9143
  }
@@ -9291,13 +9287,23 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9291
9287
  if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9292
9288
  for (var i = 0; i < this.value.length; i++) {
9293
9289
  var checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', proxy.value[i]);
9294
- if (!checkEle) {
9290
+ if (!checkEle && !(this.dataSource instanceof DataManager)) {
9295
9291
  this.value.splice(i, 1);
9296
9292
  i -= 1;
9297
9293
  }
9298
9294
  }
9299
9295
  }
9300
- this.updateActionList(ulElement, list, e);
9296
+ var valuecheck = [];
9297
+ if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9298
+ valuecheck = this.presentItemValue(this.ulElement);
9299
+ }
9300
+ if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
9301
+ && this.listData != null) {
9302
+ this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
9303
+ }
9304
+ else {
9305
+ this.updateActionList(ulElement, list, e);
9306
+ }
9301
9307
  if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
9302
9308
  this.removeFocus();
9303
9309
  }
@@ -9379,6 +9385,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9379
9385
  dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')');
9380
9386
  if (listEle.length > 0) {
9381
9387
  addClass([listEle[0]], dropDownBaseClasses.focus);
9388
+ this.updateAriaActiveDescendant();
9382
9389
  }
9383
9390
  else {
9384
9391
  //EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
@@ -9826,6 +9833,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9826
9833
  this.tempValues = this.value.slice();
9827
9834
  }
9828
9835
  };
9836
+ MultiSelect.prototype.updateAriaActiveDescendant = function () {
9837
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
9838
+ attributes(this.inputElement, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
9839
+ }
9840
+ };
9829
9841
  MultiSelect.prototype.getPagingCount = function () {
9830
9842
  var height = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
9831
9843
  getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
@@ -9969,6 +9981,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9969
9981
  var element = scrollEle[(isHome) ? 0 : (scrollEle.length - 1)];
9970
9982
  element.classList.add(dropDownBaseClasses.focus);
9971
9983
  this.scrollBottom(element);
9984
+ this.updateAriaActiveDescendant();
9972
9985
  }
9973
9986
  };
9974
9987
  MultiSelect.prototype.onKeyDown = function (e) {
@@ -10470,7 +10483,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10470
10483
  };
10471
10484
  MultiSelect.prototype.invokeCheckboxSelection = function (element, eve, isClearAll) {
10472
10485
  this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: eve });
10473
- attributes(this.inputElement, { 'aria-activedescendant': element.id });
10486
+ this.updateAriaActiveDescendant();
10474
10487
  if ((this.value && this.value.length !== this.mainData.length)
10475
10488
  && (this.mode === 'CheckBox' && this.showSelectAll && !(this.isSelectAll || isClearAll))) {
10476
10489
  this.notify('checkSelectAll', {
@@ -11493,10 +11506,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11493
11506
  if (this.enabled && this.isValidLI(element)) {
11494
11507
  this.removeFocus();
11495
11508
  addClass([element], dropDownBaseClasses.focus);
11509
+ this.updateAriaActiveDescendant();
11496
11510
  }
11497
11511
  else {
11498
11512
  if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {
11499
11513
  addClass([element], dropDownBaseClasses.focus);
11514
+ this.updateAriaActiveDescendant();
11500
11515
  }
11501
11516
  }
11502
11517
  };
@@ -12065,6 +12080,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12065
12080
  target.classList.remove('e-active');
12066
12081
  }
12067
12082
  target.classList.add('e-item-focus');
12083
+ this.updateAriaActiveDescendant();
12068
12084
  }
12069
12085
  this.textboxValueUpdate();
12070
12086
  this.checkPlaceholderSize();
@@ -12455,7 +12471,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12455
12471
  MultiSelect.prototype.addNonPresentItems = function (valuecheck, ulElement, list, event) {
12456
12472
  var _this = this;
12457
12473
  this.dataSource.executeQuery(this.getForQuery(valuecheck)).then(function (e) {
12458
- _this.addItem(e.result, list.length);
12474
+ if (e.result.length > 0) {
12475
+ _this.addItem(e.result, list.length);
12476
+ }
12459
12477
  _this.updateActionList(ulElement, list, event);
12460
12478
  });
12461
12479
  };
@@ -12691,7 +12709,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12691
12709
  spellcheck: 'false',
12692
12710
  type: 'text',
12693
12711
  autocomplete: 'off',
12694
- tabindex: '0'
12712
+ tabindex: '0',
12713
+ role: 'combobox'
12695
12714
  }
12696
12715
  });
12697
12716
  if (this.mode === 'Default' || this.mode === 'Box') {