@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
@@ -2441,10 +2441,16 @@ let DropDownList = class DropDownList extends DropDownBase {
2441
2441
  this.setScrollPosition(e);
2442
2442
  }
2443
2443
  if (Browser.info.name !== 'mozilla') {
2444
- attributes(this.inputElement, { 'aria-label': this.inputElement.value });
2444
+ attributes(this.targetElement(), { 'aria-label': this.inputElement.value });
2445
2445
  attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
2446
2446
  this.targetElement().removeAttribute('aria-live');
2447
2447
  }
2448
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
2449
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
2450
+ }
2451
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
2452
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
2453
+ }
2448
2454
  }
2449
2455
  dropdownCompiler(dropdownTemplate) {
2450
2456
  let checkTemplate = false;
@@ -2637,6 +2643,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2637
2643
  this.preventAutoFill = false;
2638
2644
  }
2639
2645
  this.preventAltUp = false;
2646
+ if (this.getModuleName() === 'autocomplete' && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
2647
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
2648
+ }
2640
2649
  e.preventDefault();
2641
2650
  break;
2642
2651
  case 46: //delete
@@ -3123,19 +3132,13 @@ let DropDownList = class DropDownList extends DropDownBase {
3123
3132
  for (const element of scrollParentElements) {
3124
3133
  EventHandler.add(element, 'scroll', this.scrollHandler, this);
3125
3134
  }
3126
- if (Browser.isDevice && this.isFilterLayout()) {
3127
- EventHandler.add(this.list, 'scroll', this.listScroll, this);
3128
- }
3129
3135
  if (!isNullOrUndefined(this.list)) {
3130
3136
  this.unWireListEvents();
3131
3137
  this.wireListEvents();
3132
3138
  }
3133
3139
  this.selectedElementID = this.selectedLI ? this.selectedLI.id : null;
3134
- attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options', 'aria-activedescendant': this.selectedElementID });
3140
+ attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options' });
3135
3141
  this.inputElement.setAttribute('aria-expanded', 'true');
3136
- if (this.selectedElementID == null) {
3137
- this.targetElement().removeAttribute('aria-activedescendant');
3138
- }
3139
3142
  const inputParent = this.isFiltering() ? this.filterInput.parentElement : this.inputWrapper.container;
3140
3143
  addClass([inputParent], [dropDownListClasses.inputFocus]);
3141
3144
  const animModel = { name: 'FadeIn', duration: 100 };
@@ -3203,6 +3206,12 @@ let DropDownList = class DropDownList extends DropDownBase {
3203
3206
  const actionList = this.actionCompleteData && this.actionCompleteData.ulElement &&
3204
3207
  this.actionCompleteData.ulElement.querySelector('li');
3205
3208
  const ulElement = this.list.querySelector('ul li');
3209
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
3210
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
3211
+ }
3212
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
3213
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
3214
+ }
3206
3215
  if (this.isFiltering() && this.itemTemplate && (this.element.tagName === this.getNgDirective()) &&
3207
3216
  (actionList && ulElement && actionList.textContent !== ulElement.textContent) &&
3208
3217
  this.element.tagName !== 'EJS-COMBOBOX') {
@@ -3358,9 +3367,6 @@ let DropDownList = class DropDownList extends DropDownBase {
3358
3367
  this.filterInput.value = this.typedString = '';
3359
3368
  this.searchLists(null);
3360
3369
  }
3361
- listScroll() {
3362
- this.filterInput.blur();
3363
- }
3364
3370
  setEleWidth(width) {
3365
3371
  if (!isNullOrUndefined(width)) {
3366
3372
  if (typeof width === 'number') {
@@ -3387,7 +3393,6 @@ let DropDownList = class DropDownList extends DropDownBase {
3387
3393
  }
3388
3394
  if (Browser.isDevice && this.isFilterLayout()) {
3389
3395
  removeClass([document.body, this.popupObj.element], dropDownListClasses.popupFullScreen);
3390
- EventHandler.remove(this.list, 'scroll', this.listScroll);
3391
3396
  }
3392
3397
  if (this.isFilterLayout()) {
3393
3398
  if (!Browser.isDevice) {
@@ -3994,10 +3999,6 @@ let DropDownList = class DropDownList extends DropDownBase {
3994
3999
  if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
3995
4000
  this.renderPopup(e);
3996
4001
  }
3997
- attributes(this.targetElement(), { 'aria-activedescendant': this.selectedElementID });
3998
- if (this.selectedElementID == null) {
3999
- this.targetElement().removeAttribute('aria-activedescendant');
4000
- }
4001
4002
  }
4002
4003
  renderHightSearch() {
4003
4004
  // update high light search
@@ -8979,12 +8980,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8979
8980
  this.renderReactTemplates();
8980
8981
  this.popupObj.show(eventArgs.animation, (this.zIndex === 1000) ? this.element : null);
8981
8982
  attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options' });
8982
- if (this.selectedElementID == null) {
8983
- this.inputElement.removeAttribute('aria-activedescendant');
8984
- }
8985
- else {
8986
- attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
8987
- }
8983
+ this.updateAriaActiveDescendant();
8988
8984
  if (this.isFirstClick) {
8989
8985
  this.loadTemplate();
8990
8986
  }
@@ -9134,13 +9130,23 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9134
9130
  if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9135
9131
  for (let i = 0; i < this.value.length; i++) {
9136
9132
  const checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', proxy.value[i]);
9137
- if (!checkEle) {
9133
+ if (!checkEle && !(this.dataSource instanceof DataManager)) {
9138
9134
  this.value.splice(i, 1);
9139
9135
  i -= 1;
9140
9136
  }
9141
9137
  }
9142
9138
  }
9143
- this.updateActionList(ulElement, list, e);
9139
+ let valuecheck = [];
9140
+ if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9141
+ valuecheck = this.presentItemValue(this.ulElement);
9142
+ }
9143
+ if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
9144
+ && this.listData != null) {
9145
+ this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
9146
+ }
9147
+ else {
9148
+ this.updateActionList(ulElement, list, e);
9149
+ }
9144
9150
  if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
9145
9151
  this.removeFocus();
9146
9152
  }
@@ -9222,6 +9228,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9222
9228
  dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')');
9223
9229
  if (listEle.length > 0) {
9224
9230
  addClass([listEle[0]], dropDownBaseClasses.focus);
9231
+ this.updateAriaActiveDescendant();
9225
9232
  }
9226
9233
  else {
9227
9234
  //EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
@@ -9669,6 +9676,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9669
9676
  this.tempValues = this.value.slice();
9670
9677
  }
9671
9678
  }
9679
+ updateAriaActiveDescendant() {
9680
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
9681
+ attributes(this.inputElement, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
9682
+ }
9683
+ }
9672
9684
  getPagingCount() {
9673
9685
  const height = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
9674
9686
  getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
@@ -9812,6 +9824,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9812
9824
  const element = scrollEle[(isHome) ? 0 : (scrollEle.length - 1)];
9813
9825
  element.classList.add(dropDownBaseClasses.focus);
9814
9826
  this.scrollBottom(element);
9827
+ this.updateAriaActiveDescendant();
9815
9828
  }
9816
9829
  }
9817
9830
  onKeyDown(e) {
@@ -10313,7 +10326,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10313
10326
  }
10314
10327
  invokeCheckboxSelection(element, eve, isClearAll) {
10315
10328
  this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: eve });
10316
- attributes(this.inputElement, { 'aria-activedescendant': element.id });
10329
+ this.updateAriaActiveDescendant();
10317
10330
  if ((this.value && this.value.length !== this.mainData.length)
10318
10331
  && (this.mode === 'CheckBox' && this.showSelectAll && !(this.isSelectAll || isClearAll))) {
10319
10332
  this.notify('checkSelectAll', {
@@ -11329,10 +11342,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11329
11342
  if (this.enabled && this.isValidLI(element)) {
11330
11343
  this.removeFocus();
11331
11344
  addClass([element], dropDownBaseClasses.focus);
11345
+ this.updateAriaActiveDescendant();
11332
11346
  }
11333
11347
  else {
11334
11348
  if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {
11335
11349
  addClass([element], dropDownBaseClasses.focus);
11350
+ this.updateAriaActiveDescendant();
11336
11351
  }
11337
11352
  }
11338
11353
  }
@@ -11900,6 +11915,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11900
11915
  target.classList.remove('e-active');
11901
11916
  }
11902
11917
  target.classList.add('e-item-focus');
11918
+ this.updateAriaActiveDescendant();
11903
11919
  }
11904
11920
  this.textboxValueUpdate();
11905
11921
  this.checkPlaceholderSize();
@@ -12285,7 +12301,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12285
12301
  ;
12286
12302
  addNonPresentItems(valuecheck, ulElement, list, event) {
12287
12303
  this.dataSource.executeQuery(this.getForQuery(valuecheck)).then((e) => {
12288
- this.addItem(e.result, list.length);
12304
+ if (e.result.length > 0) {
12305
+ this.addItem(e.result, list.length);
12306
+ }
12289
12307
  this.updateActionList(ulElement, list, event);
12290
12308
  });
12291
12309
  }
@@ -12518,7 +12536,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12518
12536
  spellcheck: 'false',
12519
12537
  type: 'text',
12520
12538
  autocomplete: 'off',
12521
- tabindex: '0'
12539
+ tabindex: '0',
12540
+ role: 'combobox'
12522
12541
  }
12523
12542
  });
12524
12543
  if (this.mode === 'Default' || this.mode === 'Box') {