@syncfusion/ej2-dropdowns 28.1.37 → 28.1.39

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 (85) hide show
  1. package/README.md +1 -1
  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 +63 -8
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +64 -8
  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 +11 -7
  13. package/src/combo-box/combo-box.js +2 -2
  14. package/src/drop-down-base/drop-down-base.js +14 -2
  15. package/src/drop-down-list/drop-down-list.d.ts +1 -0
  16. package/src/drop-down-list/drop-down-list.js +12 -2
  17. package/src/drop-down-tree/drop-down-tree.js +3 -0
  18. package/src/list-box/list-box.js +1 -1
  19. package/src/mention/mention.js +3 -1
  20. package/src/multi-select/multi-select.d.ts +2 -0
  21. package/src/multi-select/multi-select.js +29 -0
  22. package/styles/bds-lite.css +8 -0
  23. package/styles/bds.css +8 -0
  24. package/styles/bootstrap-dark-lite.css +8 -0
  25. package/styles/bootstrap-dark.css +8 -0
  26. package/styles/bootstrap-lite.css +8 -0
  27. package/styles/bootstrap.css +8 -0
  28. package/styles/bootstrap4-lite.css +8 -0
  29. package/styles/bootstrap4.css +8 -0
  30. package/styles/bootstrap5-dark-lite.css +8 -0
  31. package/styles/bootstrap5-dark.css +8 -0
  32. package/styles/bootstrap5-lite.css +8 -0
  33. package/styles/bootstrap5.3-lite.css +8 -0
  34. package/styles/bootstrap5.3.css +8 -0
  35. package/styles/bootstrap5.css +8 -0
  36. package/styles/drop-down-list/_layout.scss +8 -0
  37. package/styles/drop-down-list/bds.css +8 -0
  38. package/styles/drop-down-list/bootstrap-dark.css +8 -0
  39. package/styles/drop-down-list/bootstrap.css +8 -0
  40. package/styles/drop-down-list/bootstrap4.css +8 -0
  41. package/styles/drop-down-list/bootstrap5-dark.css +8 -0
  42. package/styles/drop-down-list/bootstrap5.3.css +8 -0
  43. package/styles/drop-down-list/bootstrap5.css +8 -0
  44. package/styles/drop-down-list/fabric-dark.css +8 -0
  45. package/styles/drop-down-list/fabric.css +8 -0
  46. package/styles/drop-down-list/fluent-dark.css +8 -0
  47. package/styles/drop-down-list/fluent.css +8 -0
  48. package/styles/drop-down-list/fluent2.css +8 -0
  49. package/styles/drop-down-list/highcontrast-light.css +8 -0
  50. package/styles/drop-down-list/highcontrast.css +8 -0
  51. package/styles/drop-down-list/material-dark.css +8 -0
  52. package/styles/drop-down-list/material.css +8 -0
  53. package/styles/drop-down-list/material3-dark.css +8 -0
  54. package/styles/drop-down-list/material3.css +8 -0
  55. package/styles/drop-down-list/tailwind-dark.css +8 -0
  56. package/styles/drop-down-list/tailwind.css +8 -0
  57. package/styles/drop-down-list/tailwind3.css +8 -0
  58. package/styles/fabric-dark-lite.css +8 -0
  59. package/styles/fabric-dark.css +8 -0
  60. package/styles/fabric-lite.css +8 -0
  61. package/styles/fabric.css +8 -0
  62. package/styles/fluent-dark-lite.css +8 -0
  63. package/styles/fluent-dark.css +8 -0
  64. package/styles/fluent-lite.css +8 -0
  65. package/styles/fluent.css +8 -0
  66. package/styles/fluent2-lite.css +8 -0
  67. package/styles/fluent2.css +8 -0
  68. package/styles/highcontrast-light-lite.css +8 -0
  69. package/styles/highcontrast-light.css +8 -0
  70. package/styles/highcontrast-lite.css +8 -0
  71. package/styles/highcontrast.css +8 -0
  72. package/styles/material-dark-lite.css +8 -0
  73. package/styles/material-dark.css +8 -0
  74. package/styles/material-lite.css +8 -0
  75. package/styles/material.css +8 -0
  76. package/styles/material3-dark-lite.css +8 -0
  77. package/styles/material3-dark.css +8 -0
  78. package/styles/material3-lite.css +8 -0
  79. package/styles/material3.css +8 -0
  80. package/styles/tailwind-dark-lite.css +8 -0
  81. package/styles/tailwind-dark.css +8 -0
  82. package/styles/tailwind-lite.css +8 -0
  83. package/styles/tailwind.css +8 -0
  84. package/styles/tailwind3-lite.css +8 -0
  85. package/styles/tailwind3.css +8 -0
@@ -1776,7 +1776,17 @@ let DropDownBase = class DropDownBase extends Component {
1776
1776
  const liCollections = listElement.querySelectorAll('.' + dropDownBaseClasses.li);
1777
1777
  for (let index = 0; index < liCollections.length; index++) {
1778
1778
  if (JSON.parse(JSON.stringify(this.listData[index]))[this.fields.disabled]) {
1779
- this.disableListItem(liCollections[index]);
1779
+ if (!isNullOrUndefined(this.fields.groupBy)) {
1780
+ const item = this.listData[index];
1781
+ const value = getValue((this.fields.value ? this.fields.value : 'value'), item);
1782
+ const li = listElement.querySelector('li[data-value="' + value + '"]');
1783
+ if (!isNullOrUndefined(li)) {
1784
+ this.disableListItem(li);
1785
+ }
1786
+ }
1787
+ else {
1788
+ this.disableListItem(liCollections[index]);
1789
+ }
1780
1790
  }
1781
1791
  }
1782
1792
  }
@@ -1917,8 +1927,10 @@ let DropDownBase = class DropDownBase extends Component {
1917
1927
  scrollStop(e, isDownkey) {
1918
1928
  const target = !isNullOrUndefined(e) ? e.target : this.list;
1919
1929
  const computedHeight = getComputedStyle(this.getValidLi(), null).getPropertyValue('height');
1930
+ const computedMarginValue = getComputedStyle(this.getValidLi(), null).getPropertyValue('margin-bottom');
1931
+ const marginValue = parseInt(computedMarginValue, 10);
1920
1932
  const liHeight = this.getModuleName() === 'multiselect' ? parseFloat(computedHeight) : parseInt(computedHeight, 10);
1921
- const topIndex = Math.round(target.scrollTop / liHeight);
1933
+ const topIndex = Math.round(target.scrollTop / (liHeight + marginValue));
1922
1934
  const liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
1923
1935
  const virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
1924
1936
  for (let i = topIndex; i > -1; i--) {
@@ -2820,6 +2832,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2820
2832
  this.autoFill = false;
2821
2833
  this.isUpdateHeaderHeight = false;
2822
2834
  this.isUpdateFooterHeight = false;
2835
+ this.isReactTemplateUpdate = false;
2823
2836
  }
2824
2837
  /**
2825
2838
  * Initialize the event handler.
@@ -4187,6 +4200,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4187
4200
  setTimeout(() => {
4188
4201
  proxy.cloneElements();
4189
4202
  proxy.isSecondClick = true;
4203
+ proxy.isSecondClick = proxy.isReact && proxy.isFiltering() && proxy.dataSource instanceof DataManager && !proxy.list.querySelector('ul') ? false : true;
4190
4204
  }, duration);
4191
4205
  }
4192
4206
  }
@@ -5018,6 +5032,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5018
5032
  if (this.getInitialData) {
5019
5033
  this.updateActionCompleteDataValues(ulElement, list);
5020
5034
  this.getInitialData = false;
5035
+ this.isReactTemplateUpdate = true;
5021
5036
  this.searchLists(this.filterArgs);
5022
5037
  return;
5023
5038
  }
@@ -5445,6 +5460,9 @@ let DropDownList = class DropDownList extends DropDownBase {
5445
5460
  addClass([this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
5446
5461
  }
5447
5462
  this.renderReactTemplates();
5463
+ if (this.isReact && this.isFiltering() && this.dataSource instanceof DataManager && this.list.querySelector('ul') && !this.isSecondClick) {
5464
+ this.executeCloneElements();
5465
+ }
5448
5466
  if (!isNullOrUndefined(this.popupObj)) {
5449
5467
  this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.element : null);
5450
5468
  }
@@ -5471,7 +5489,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5471
5489
  this.destroyPopup();
5472
5490
  }
5473
5491
  });
5474
- if (this.allowResize) {
5492
+ if (this.allowResize && (this.getModuleName() !== 'dropdownlist' || !(Browser.isDevice && this.isDeviceFullScreen && this.allowFiltering))) {
5475
5493
  const resizePaddingBottom = 16;
5476
5494
  // Create the resizer div
5477
5495
  this.resizer = this.createElement('div', {
@@ -5541,6 +5559,10 @@ let DropDownList = class DropDownList extends DropDownBase {
5541
5559
  this.destroyPopup();
5542
5560
  if (this.isFiltering() && this.actionCompleteData.list && this.actionCompleteData.list.length > 0) {
5543
5561
  this.isActive = true;
5562
+ if (this.isReactTemplateUpdate && this.isReact && this.itemTemplate && !this.enableVirtualization) {
5563
+ this.actionCompleteData.ulElement = this.renderItems(this.actionCompleteData.list, this.fields);
5564
+ this.isReactTemplateUpdate = false;
5565
+ }
5544
5566
  if (this.enableVirtualization) {
5545
5567
  this.onActionComplete(this.ulElement, this.listData, null, true);
5546
5568
  }
@@ -6836,7 +6858,7 @@ let DropDownList = class DropDownList extends DropDownBase {
6836
6858
  if (isSelectVal && this.enableVirtualization && this.selectedLI.classList) {
6837
6859
  isSelectVal = this.selectedLI.classList.contains('e-active');
6838
6860
  }
6839
- if (this.inputElement && this.inputElement.value.trim() === '' && !this.isInteracted && (this.isSelectCustom ||
6861
+ if (this.inputElement && this.inputElement.value === '' && !this.isInteracted && (this.isSelectCustom ||
6840
6862
  isSelectVal && this.inputElement.value !== dataItem.text)) {
6841
6863
  this.isSelectCustom = false;
6842
6864
  this.clearAll(e);
@@ -7635,6 +7657,9 @@ let DropDownTree = class DropDownTree extends Component {
7635
7657
  }
7636
7658
  this.treeObj.fields = this.getTreeFields(fields);
7637
7659
  this.treeObj.dataBind();
7660
+ if (this.popupObj) {
7661
+ this.popupObj.refreshPosition();
7662
+ }
7638
7663
  if (this.hasTemplate && this.portals && this.treeObj.portals) {
7639
7664
  for (let i = 0; i < this.treeObj.portals.length; i++) {
7640
7665
  if (this.portals.indexOf(this.treeObj.portals[i]) === -1) {
@@ -11284,7 +11309,7 @@ let ComboBox = class ComboBox extends DropDownList {
11284
11309
  this.onChangeEvent(e);
11285
11310
  }
11286
11311
  }
11287
- if (e.action === 'enter' && this.inputElement.value.trim() === '') {
11312
+ if (e.action === 'enter' && this.inputElement.value === '') {
11288
11313
  this.clearAll(e);
11289
11314
  }
11290
11315
  else if (this.isTyped && !this.isSelected && isNullOrUndefined(li)) {
@@ -11329,7 +11354,7 @@ let ComboBox = class ComboBox extends DropDownList {
11329
11354
  this.onChangeEvent(null);
11330
11355
  }
11331
11356
  }
11332
- else if (this.inputElement.value.trim() !== '') {
11357
+ else if (this.inputElement.value !== '') {
11333
11358
  const previousValue = this.value;
11334
11359
  if (isNullOrUndefined(value)) {
11335
11360
  const value = this.inputElement.value === '' ? null : this.inputElement.value;
@@ -12474,6 +12499,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12474
12499
  this.storedSelectAllHeight = 0;
12475
12500
  this.isUpdateHeaderHeight = false;
12476
12501
  this.isUpdateFooterHeight = false;
12502
+ this.isBlurDispatching = false;
12503
+ this.isFilterPrevented = false;
12477
12504
  this.isValidKey = false;
12478
12505
  this.selectAllEventData = [];
12479
12506
  this.selectAllEventEle = [];
@@ -12933,6 +12960,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12933
12960
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12934
12961
  this.totalItemCount = e.count;
12935
12962
  }
12963
+ if (this.value && list && list.length > 0 && this.allowFiltering && this.mode !== 'CheckBox' && !this.enableVirtualization && !this.isFilterPrevented && !this.allowCustomValue) {
12964
+ const allItemsInValue = list.every((item) => {
12965
+ const itemValue = getValue((this.fields.value) ? this.fields.value : '', item);
12966
+ return this.value.some((val) => {
12967
+ const value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', val) : val;
12968
+ return itemValue === value;
12969
+ });
12970
+ });
12971
+ if (allItemsInValue) {
12972
+ ulElement.innerHTML = '';
12973
+ list = [];
12974
+ }
12975
+ }
12936
12976
  /* eslint-enable @typescript-eslint/no-unused-vars */
12937
12977
  super.onActionComplete(ulElement, list, e);
12938
12978
  this.skeletonCount = this.totalItemCount !== 0 && this.totalItemCount < (this.itemCount * 2) &&
@@ -13581,6 +13621,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13581
13621
  }
13582
13622
  onBlurHandler(eve, isDocClickFromCheck) {
13583
13623
  let target;
13624
+ if (this.isBlurDispatching && this.isAngular) {
13625
+ this.isBlurDispatching = false;
13626
+ return;
13627
+ }
13584
13628
  if (!isNullOrUndefined(eve)) {
13585
13629
  target = eve.relatedTarget;
13586
13630
  }
@@ -13663,6 +13707,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13663
13707
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
13664
13708
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
13665
13709
  }
13710
+ this.isBlurDispatching = true;
13711
+ if (this.isAngular) {
13712
+ this.dispatchEvent(this.inputElement, 'blur');
13713
+ }
13666
13714
  }
13667
13715
  calculateWidth() {
13668
13716
  let elementWidth;
@@ -15297,6 +15345,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15297
15345
  if (!this.list) {
15298
15346
  super.render();
15299
15347
  }
15348
+ if (this.popupObj && document.body.contains(this.popupObj.element) && this.allowFiltering) {
15349
+ this.refreshPopup();
15350
+ return;
15351
+ }
15300
15352
  if (!this.popupObj) {
15301
15353
  if (!isNullOrUndefined(this.popupWrapper)) {
15302
15354
  document.body.appendChild(this.popupWrapper);
@@ -15788,6 +15840,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15788
15840
  cancel: false
15789
15841
  };
15790
15842
  this.trigger('filtering', eventArgs, (eventArgs) => {
15843
+ this.isFilterPrevented = eventArgs.cancel;
15791
15844
  if (!eventArgs.cancel) {
15792
15845
  if (!this.isFiltered && !eventArgs.preventDefaultAction) {
15793
15846
  this.filterAction = true;
@@ -21314,7 +21367,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
21314
21367
  }
21315
21368
  }
21316
21369
  KeyUp(e) {
21317
- if (this.allowFiltering && e.ctrlKey && e.keyCode === 65) {
21370
+ if (this.allowFiltering && ((e.ctrlKey && e.keyCode === 65) || (e.keyCode === 8 && !this.filterInput.value))) {
21318
21371
  e.preventDefault();
21319
21372
  return;
21320
21373
  }
@@ -22048,7 +22101,9 @@ let Mention = class Mention extends DropDownBase {
22048
22101
  ? document.querySelector(this.target)
22049
22102
  : this.target) : this.element;
22050
22103
  if (this.isContentEditable(this.inputElement)) {
22051
- this.inputElement.setAttribute('contenteditable', 'true');
22104
+ if (!this.inputElement.hasAttribute('contenteditable')) {
22105
+ this.inputElement.setAttribute('contenteditable', 'true');
22106
+ }
22052
22107
  addClass([this.inputElement], ['e-mention']);
22053
22108
  if (isNullOrUndefined(this.target)) {
22054
22109
  addClass([this.inputElement], ['e-editable-element']);