@syncfusion/ej2-dropdowns 20.3.57 → 20.3.59

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 (50) hide show
  1. package/CHANGELOG.md +16 -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 +76 -46
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +76 -46
  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 +7 -7
  13. package/src/combo-box/combo-box.js +1 -1
  14. package/src/drop-down-base/drop-down-base.js +12 -10
  15. package/src/drop-down-list/drop-down-list.d.ts +0 -1
  16. package/src/drop-down-list/drop-down-list.js +17 -16
  17. package/src/list-box/list-box.js +17 -8
  18. package/src/multi-select/multi-select.d.ts +1 -0
  19. package/src/multi-select/multi-select.js +29 -11
  20. package/styles/bootstrap-dark.css +4 -0
  21. package/styles/bootstrap.css +4 -0
  22. package/styles/bootstrap4.css +4 -0
  23. package/styles/bootstrap5-dark.css +4 -0
  24. package/styles/bootstrap5.css +4 -0
  25. package/styles/fabric-dark.css +4 -0
  26. package/styles/fabric.css +4 -0
  27. package/styles/fluent-dark.css +4 -0
  28. package/styles/fluent.css +4 -0
  29. package/styles/highcontrast-light.css +4 -0
  30. package/styles/highcontrast.css +4 -0
  31. package/styles/material-dark.css +4 -0
  32. package/styles/material.css +4 -0
  33. package/styles/multi-select/_layout.scss +4 -0
  34. package/styles/multi-select/bootstrap-dark.css +4 -0
  35. package/styles/multi-select/bootstrap.css +4 -0
  36. package/styles/multi-select/bootstrap4.css +4 -0
  37. package/styles/multi-select/bootstrap5-dark.css +4 -0
  38. package/styles/multi-select/bootstrap5.css +4 -0
  39. package/styles/multi-select/fabric-dark.css +4 -0
  40. package/styles/multi-select/fabric.css +4 -0
  41. package/styles/multi-select/fluent-dark.css +4 -0
  42. package/styles/multi-select/fluent.css +4 -0
  43. package/styles/multi-select/highcontrast-light.css +4 -0
  44. package/styles/multi-select/highcontrast.css +4 -0
  45. package/styles/multi-select/material-dark.css +4 -0
  46. package/styles/multi-select/material.css +4 -0
  47. package/styles/multi-select/tailwind-dark.css +4 -0
  48. package/styles/multi-select/tailwind.css +4 -0
  49. package/styles/tailwind-dark.css +4 -0
  50. package/styles/tailwind.css +4 -0
@@ -851,18 +851,20 @@ let DropDownBase = class DropDownBase extends Component {
851
851
  return extend({}, options, fields, true);
852
852
  }
853
853
  setFloatingHeader(e) {
854
- if (isNullOrUndefined(this.fixedHeaderElement)) {
855
- this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
856
- if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
857
- this.fixedHeaderElement.style.display = 'none';
854
+ if (!isNullOrUndefined(this.list) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
855
+ if (isNullOrUndefined(this.fixedHeaderElement)) {
856
+ this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
857
+ if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
858
+ this.fixedHeaderElement.style.display = 'none';
859
+ }
860
+ prepend([this.fixedHeaderElement], this.list);
861
+ this.setFixedHeader();
858
862
  }
859
- prepend([this.fixedHeaderElement], this.list);
860
- this.setFixedHeader();
861
- }
862
- if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
863
- this.setFixedHeader();
863
+ if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
864
+ this.setFixedHeader();
865
+ }
866
+ this.scrollStop(e);
864
867
  }
865
- this.scrollStop(e);
866
868
  }
867
869
  scrollStop(e) {
868
870
  let target = !isNullOrUndefined(e) ? e.target : this.list;
@@ -2441,10 +2443,16 @@ let DropDownList = class DropDownList extends DropDownBase {
2441
2443
  this.setScrollPosition(e);
2442
2444
  }
2443
2445
  if (Browser.info.name !== 'mozilla') {
2444
- attributes(this.inputElement, { 'aria-label': this.inputElement.value });
2446
+ attributes(this.targetElement(), { 'aria-label': this.inputElement.value });
2445
2447
  attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
2446
2448
  this.targetElement().removeAttribute('aria-live');
2447
2449
  }
2450
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
2451
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
2452
+ }
2453
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
2454
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
2455
+ }
2448
2456
  }
2449
2457
  dropdownCompiler(dropdownTemplate) {
2450
2458
  let checkTemplate = false;
@@ -2637,6 +2645,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2637
2645
  this.preventAutoFill = false;
2638
2646
  }
2639
2647
  this.preventAltUp = false;
2648
+ if (this.getModuleName() === 'autocomplete' && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
2649
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
2650
+ }
2640
2651
  e.preventDefault();
2641
2652
  break;
2642
2653
  case 46: //delete
@@ -3123,19 +3134,13 @@ let DropDownList = class DropDownList extends DropDownBase {
3123
3134
  for (const element of scrollParentElements) {
3124
3135
  EventHandler.add(element, 'scroll', this.scrollHandler, this);
3125
3136
  }
3126
- if (Browser.isDevice && this.isFilterLayout()) {
3127
- EventHandler.add(this.list, 'scroll', this.listScroll, this);
3128
- }
3129
3137
  if (!isNullOrUndefined(this.list)) {
3130
3138
  this.unWireListEvents();
3131
3139
  this.wireListEvents();
3132
3140
  }
3133
3141
  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 });
3142
+ attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options' });
3135
3143
  this.inputElement.setAttribute('aria-expanded', 'true');
3136
- if (this.selectedElementID == null) {
3137
- this.targetElement().removeAttribute('aria-activedescendant');
3138
- }
3139
3144
  const inputParent = this.isFiltering() ? this.filterInput.parentElement : this.inputWrapper.container;
3140
3145
  addClass([inputParent], [dropDownListClasses.inputFocus]);
3141
3146
  const animModel = { name: 'FadeIn', duration: 100 };
@@ -3203,6 +3208,12 @@ let DropDownList = class DropDownList extends DropDownBase {
3203
3208
  const actionList = this.actionCompleteData && this.actionCompleteData.ulElement &&
3204
3209
  this.actionCompleteData.ulElement.querySelector('li');
3205
3210
  const ulElement = this.list.querySelector('ul li');
3211
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
3212
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
3213
+ }
3214
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
3215
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
3216
+ }
3206
3217
  if (this.isFiltering() && this.itemTemplate && (this.element.tagName === this.getNgDirective()) &&
3207
3218
  (actionList && ulElement && actionList.textContent !== ulElement.textContent) &&
3208
3219
  this.element.tagName !== 'EJS-COMBOBOX') {
@@ -3358,9 +3369,6 @@ let DropDownList = class DropDownList extends DropDownBase {
3358
3369
  this.filterInput.value = this.typedString = '';
3359
3370
  this.searchLists(null);
3360
3371
  }
3361
- listScroll() {
3362
- this.filterInput.blur();
3363
- }
3364
3372
  setEleWidth(width) {
3365
3373
  if (!isNullOrUndefined(width)) {
3366
3374
  if (typeof width === 'number') {
@@ -3387,7 +3395,6 @@ let DropDownList = class DropDownList extends DropDownBase {
3387
3395
  }
3388
3396
  if (Browser.isDevice && this.isFilterLayout()) {
3389
3397
  removeClass([document.body, this.popupObj.element], dropDownListClasses.popupFullScreen);
3390
- EventHandler.remove(this.list, 'scroll', this.listScroll);
3391
3398
  }
3392
3399
  if (this.isFilterLayout()) {
3393
3400
  if (!Browser.isDevice) {
@@ -3994,10 +4001,6 @@ let DropDownList = class DropDownList extends DropDownBase {
3994
4001
  if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
3995
4002
  this.renderPopup(e);
3996
4003
  }
3997
- attributes(this.targetElement(), { 'aria-activedescendant': this.selectedElementID });
3998
- if (this.selectedElementID == null) {
3999
- this.targetElement().removeAttribute('aria-activedescendant');
4000
- }
4001
4004
  }
4002
4005
  renderHightSearch() {
4003
4006
  // update high light search
@@ -7611,7 +7614,7 @@ let ComboBox = class ComboBox extends DropDownList {
7611
7614
  this.itemData = this.getDataByValue(this.value);
7612
7615
  const dataItem = this.getItemData();
7613
7616
  if (!(this.allowCustom && isNullOrUndefined(dataItem.value) && isNullOrUndefined(dataItem.text))) {
7614
- this.setProperties({ 'value': dataItem.value, 'text': dataItem.text }, !this.allowCustom);
7617
+ this.setProperties({ 'value': dataItem.value }, !this.allowCustom);
7615
7618
  }
7616
7619
  }
7617
7620
  /**
@@ -8979,12 +8982,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8979
8982
  this.renderReactTemplates();
8980
8983
  this.popupObj.show(eventArgs.animation, (this.zIndex === 1000) ? this.element : null);
8981
8984
  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
- }
8985
+ this.updateAriaActiveDescendant();
8988
8986
  if (this.isFirstClick) {
8989
8987
  this.loadTemplate();
8990
8988
  }
@@ -9134,13 +9132,23 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9134
9132
  if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9135
9133
  for (let i = 0; i < this.value.length; i++) {
9136
9134
  const checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', proxy.value[i]);
9137
- if (!checkEle) {
9135
+ if (!checkEle && !(this.dataSource instanceof DataManager)) {
9138
9136
  this.value.splice(i, 1);
9139
9137
  i -= 1;
9140
9138
  }
9141
9139
  }
9142
9140
  }
9143
- this.updateActionList(ulElement, list, e);
9141
+ let valuecheck = [];
9142
+ if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9143
+ valuecheck = this.presentItemValue(this.ulElement);
9144
+ }
9145
+ if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
9146
+ && this.listData != null) {
9147
+ this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
9148
+ }
9149
+ else {
9150
+ this.updateActionList(ulElement, list, e);
9151
+ }
9144
9152
  if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
9145
9153
  this.removeFocus();
9146
9154
  }
@@ -9222,6 +9230,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9222
9230
  dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')');
9223
9231
  if (listEle.length > 0) {
9224
9232
  addClass([listEle[0]], dropDownBaseClasses.focus);
9233
+ this.updateAriaActiveDescendant();
9225
9234
  }
9226
9235
  else {
9227
9236
  //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 +9678,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9669
9678
  this.tempValues = this.value.slice();
9670
9679
  }
9671
9680
  }
9681
+ updateAriaActiveDescendant() {
9682
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
9683
+ attributes(this.inputElement, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
9684
+ }
9685
+ }
9672
9686
  getPagingCount() {
9673
9687
  const height = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
9674
9688
  getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
@@ -9812,6 +9826,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9812
9826
  const element = scrollEle[(isHome) ? 0 : (scrollEle.length - 1)];
9813
9827
  element.classList.add(dropDownBaseClasses.focus);
9814
9828
  this.scrollBottom(element);
9829
+ this.updateAriaActiveDescendant();
9815
9830
  }
9816
9831
  }
9817
9832
  onKeyDown(e) {
@@ -10313,7 +10328,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10313
10328
  }
10314
10329
  invokeCheckboxSelection(element, eve, isClearAll) {
10315
10330
  this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: eve });
10316
- attributes(this.inputElement, { 'aria-activedescendant': element.id });
10331
+ this.updateAriaActiveDescendant();
10317
10332
  if ((this.value && this.value.length !== this.mainData.length)
10318
10333
  && (this.mode === 'CheckBox' && this.showSelectAll && !(this.isSelectAll || isClearAll))) {
10319
10334
  this.notify('checkSelectAll', {
@@ -11329,10 +11344,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11329
11344
  if (this.enabled && this.isValidLI(element)) {
11330
11345
  this.removeFocus();
11331
11346
  addClass([element], dropDownBaseClasses.focus);
11347
+ this.updateAriaActiveDescendant();
11332
11348
  }
11333
11349
  else {
11334
11350
  if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {
11335
11351
  addClass([element], dropDownBaseClasses.focus);
11352
+ this.updateAriaActiveDescendant();
11336
11353
  }
11337
11354
  }
11338
11355
  }
@@ -11900,6 +11917,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11900
11917
  target.classList.remove('e-active');
11901
11918
  }
11902
11919
  target.classList.add('e-item-focus');
11920
+ this.updateAriaActiveDescendant();
11903
11921
  }
11904
11922
  this.textboxValueUpdate();
11905
11923
  this.checkPlaceholderSize();
@@ -12285,7 +12303,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12285
12303
  ;
12286
12304
  addNonPresentItems(valuecheck, ulElement, list, event) {
12287
12305
  this.dataSource.executeQuery(this.getForQuery(valuecheck)).then((e) => {
12288
- this.addItem(e.result, list.length);
12306
+ if (e.result.length > 0) {
12307
+ this.addItem(e.result, list.length);
12308
+ }
12289
12309
  this.updateActionList(ulElement, list, event);
12290
12310
  });
12291
12311
  }
@@ -12518,7 +12538,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12518
12538
  spellcheck: 'false',
12519
12539
  type: 'text',
12520
12540
  autocomplete: 'off',
12521
- tabindex: '0'
12541
+ tabindex: '0',
12542
+ role: 'combobox'
12522
12543
  }
12523
12544
  });
12524
12545
  if (this.mode === 'Default' || this.mode === 'Box') {
@@ -14505,12 +14526,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14505
14526
  if (li && li.parentElement) {
14506
14527
  currSelIdx = [].slice.call(li.parentElement.children).indexOf(li);
14507
14528
  if (!this.selectionSettings.showCheckbox) {
14508
- if ((e.ctrlKey || Browser.isDevice) && this.isSelected(li)) {
14529
+ if ((e.ctrlKey || e.metaKey || Browser.isDevice) && this.isSelected(li)) {
14509
14530
  li.classList.remove(cssClass.selected);
14510
14531
  li.removeAttribute('aria-selected');
14511
14532
  isSelect = false;
14512
14533
  }
14513
- else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || Browser.isDevice))) {
14534
+ else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || e.metaKey || Browser.isDevice))) {
14514
14535
  this.getSelectedItems().forEach((ele) => {
14515
14536
  ele.removeAttribute('aria-selected');
14516
14537
  });
@@ -14976,12 +14997,21 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14976
14997
  }
14977
14998
  return listObj;
14978
14999
  }
14979
- getGrabbedItems() {
15000
+ getGrabbedItems(args) {
15001
+ let grabbItems = false;
14980
15002
  for (let i = 0; i < this.value.length; i++) {
14981
- const liColl = this.list.querySelectorAll('[aria-selected="true"]');
14982
- for (let j = 0; j < liColl.length; j++) {
14983
- if (this.value[i] === liColl[j].textContent) {
14984
- liColl[j].classList.add('e-grabbed');
15003
+ if (this.value[i] === this.getFormattedValue(args.target.getAttribute('data-value'))) {
15004
+ grabbItems = true;
15005
+ break;
15006
+ }
15007
+ }
15008
+ if (grabbItems) {
15009
+ for (let i = 0; i < this.value.length; i++) {
15010
+ const liColl = this.list.querySelectorAll('[aria-selected="true"]');
15011
+ for (let j = 0; j < liColl.length; j++) {
15012
+ if (this.value[i] === this.getFormattedValue(liColl[j].getAttribute('data-value'))) {
15013
+ liColl[j].classList.add('e-grabbed');
15014
+ }
14985
15015
  }
14986
15016
  }
14987
15017
  }
@@ -14995,7 +15025,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14995
15025
  return elems;
14996
15026
  }
14997
15027
  getDragArgs(args, isDragEnd) {
14998
- let elems = this.getGrabbedItems();
15028
+ let elems = this.getGrabbedItems(args);
14999
15029
  if (elems.length) {
15000
15030
  if (isDragEnd) {
15001
15031
  elems.push(args.target);