@syncfusion/ej2-dropdowns 26.2.7 → 26.2.9

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 (109) hide show
  1. package/dist/ej2-dropdowns.min.js +2 -2
  2. package/dist/ej2-dropdowns.umd.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-dropdowns.es2015.js +89 -52
  5. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es5.js +89 -52
  7. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  8. package/dist/global/ej2-dropdowns.min.js +2 -2
  9. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +8 -8
  12. package/src/combo-box/combo-box.js +33 -2
  13. package/src/common/virtual-scroll.js +5 -7
  14. package/src/drop-down-base/drop-down-base.js +10 -5
  15. package/src/drop-down-list/drop-down-list.js +4 -1
  16. package/src/list-box/list-box.js +20 -30
  17. package/src/mention/mention.js +2 -2
  18. package/src/multi-select/checkbox-selection.js +3 -1
  19. package/src/multi-select/multi-select.js +12 -4
  20. package/styles/auto-complete/fluent2.css +3 -1031
  21. package/styles/auto-complete/material3-dark.css +1 -54
  22. package/styles/auto-complete/material3.css +2 -109
  23. package/styles/bootstrap-dark.css +9 -0
  24. package/styles/bootstrap.css +9 -0
  25. package/styles/bootstrap4.css +9 -0
  26. package/styles/bootstrap5-dark.css +9 -0
  27. package/styles/bootstrap5.css +9 -0
  28. package/styles/combo-box/fluent2.css +3 -1031
  29. package/styles/combo-box/material3-dark.css +1 -54
  30. package/styles/combo-box/material3.css +2 -109
  31. package/styles/drop-down-base/_theme.scss +2 -0
  32. package/styles/drop-down-base/bootstrap-dark.css +2 -0
  33. package/styles/drop-down-base/bootstrap.css +2 -0
  34. package/styles/drop-down-base/bootstrap4.css +2 -0
  35. package/styles/drop-down-base/bootstrap5-dark.css +2 -0
  36. package/styles/drop-down-base/bootstrap5.css +2 -0
  37. package/styles/drop-down-base/fabric-dark.css +2 -0
  38. package/styles/drop-down-base/fabric.css +2 -0
  39. package/styles/drop-down-base/fluent-dark.css +2 -0
  40. package/styles/drop-down-base/fluent.css +2 -0
  41. package/styles/drop-down-base/fluent2.css +7 -1033
  42. package/styles/drop-down-base/highcontrast-light.css +2 -0
  43. package/styles/drop-down-base/highcontrast.css +2 -0
  44. package/styles/drop-down-base/material-dark.css +2 -0
  45. package/styles/drop-down-base/material.css +2 -0
  46. package/styles/drop-down-base/material3-dark.css +3 -54
  47. package/styles/drop-down-base/material3.css +5 -110
  48. package/styles/drop-down-base/tailwind-dark.css +2 -0
  49. package/styles/drop-down-base/tailwind.css +2 -0
  50. package/styles/drop-down-list/fluent2.css +5 -1033
  51. package/styles/drop-down-list/material3-dark.css +1 -54
  52. package/styles/drop-down-list/material3.css +3 -110
  53. package/styles/drop-down-tree/fluent2.css +3 -1031
  54. package/styles/drop-down-tree/material3-dark.css +1 -54
  55. package/styles/drop-down-tree/material3.css +2 -109
  56. package/styles/fabric-dark.css +9 -0
  57. package/styles/fabric.css +9 -0
  58. package/styles/fluent-dark.css +9 -0
  59. package/styles/fluent.css +9 -0
  60. package/styles/fluent2.css +14 -1033
  61. package/styles/highcontrast-light.css +9 -0
  62. package/styles/highcontrast.css +9 -0
  63. package/styles/list-box/_layout.scss +6 -0
  64. package/styles/list-box/bootstrap-dark.css +6 -0
  65. package/styles/list-box/bootstrap.css +6 -0
  66. package/styles/list-box/bootstrap4.css +6 -0
  67. package/styles/list-box/bootstrap5-dark.css +6 -0
  68. package/styles/list-box/bootstrap5.css +6 -0
  69. package/styles/list-box/fabric-dark.css +6 -0
  70. package/styles/list-box/fabric.css +6 -0
  71. package/styles/list-box/fluent-dark.css +6 -0
  72. package/styles/list-box/fluent.css +6 -0
  73. package/styles/list-box/fluent2.css +9 -1031
  74. package/styles/list-box/highcontrast-light.css +6 -0
  75. package/styles/list-box/highcontrast.css +6 -0
  76. package/styles/list-box/material-dark.css +6 -0
  77. package/styles/list-box/material.css +6 -0
  78. package/styles/list-box/material3-dark.css +7 -54
  79. package/styles/list-box/material3.css +8 -109
  80. package/styles/list-box/tailwind-dark.css +6 -0
  81. package/styles/list-box/tailwind.css +6 -0
  82. package/styles/material-dark.css +9 -0
  83. package/styles/material.css +9 -0
  84. package/styles/material3-dark.css +10 -54
  85. package/styles/material3.css +12 -110
  86. package/styles/mention/fluent2.css +3 -1031
  87. package/styles/mention/material3-dark.css +1 -54
  88. package/styles/mention/material3.css +2 -109
  89. package/styles/multi-select/_layout.scss +1 -0
  90. package/styles/multi-select/bootstrap-dark.css +1 -0
  91. package/styles/multi-select/bootstrap.css +1 -0
  92. package/styles/multi-select/bootstrap4.css +1 -0
  93. package/styles/multi-select/bootstrap5-dark.css +1 -0
  94. package/styles/multi-select/bootstrap5.css +1 -0
  95. package/styles/multi-select/fabric-dark.css +1 -0
  96. package/styles/multi-select/fabric.css +1 -0
  97. package/styles/multi-select/fluent-dark.css +1 -0
  98. package/styles/multi-select/fluent.css +1 -0
  99. package/styles/multi-select/fluent2.css +6 -1033
  100. package/styles/multi-select/highcontrast-light.css +1 -0
  101. package/styles/multi-select/highcontrast.css +1 -0
  102. package/styles/multi-select/material-dark.css +1 -0
  103. package/styles/multi-select/material.css +1 -0
  104. package/styles/multi-select/material3-dark.css +2 -54
  105. package/styles/multi-select/material3.css +4 -110
  106. package/styles/multi-select/tailwind-dark.css +1 -0
  107. package/styles/multi-select/tailwind.css +1 -0
  108. package/styles/tailwind-dark.css +9 -0
  109. package/styles/tailwind.css +9 -0
@@ -634,10 +634,8 @@ class VirtualScroll {
634
634
  else if (this.parent.isScrollActionTriggered) {
635
635
  this.parent.isPreventKeyAction = false;
636
636
  this.parent.isScrollActionTriggered = false;
637
- let virtualListCount = this.parent.list.querySelectorAll('.e-virtual-list').length;
638
- let listElement = this.parent.list.querySelector('.' + 'e-list-item');
639
- let translateY = scrollArgs.offset.top - (listElement.offsetHeight * virtualListCount);
640
- this.parent.list.getElementsByClassName('e-virtual-ddl-content')[0].style.transform = "translate(0px," + translateY + "px)";
637
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
638
+ this.parent.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.parent.getTransformValues();
641
639
  }
642
640
  this.parent.previousInfo = this.parent.viewPortInfo;
643
641
  }
@@ -671,13 +669,13 @@ class VirtualScroll {
671
669
  }
672
670
  }
673
671
  else if (infoType.direction === 'up') {
674
- if (infoType.startIndex && infoType.endIndex) {
672
+ if ((infoType.startIndex && infoType.endIndex) || (Math.ceil(exactTopIndex) > this.parent.previousStartIndex)) {
675
673
  let loadAtIndex = Math.round(((infoType.startIndex * rowHeight) + (pageSizeBy4 * rowHeight)) / rowHeight);
676
- if (exactTopIndex < loadAtIndex) {
674
+ if (exactTopIndex < loadAtIndex || (Math.ceil(exactTopIndex) > this.parent.previousStartIndex)) {
677
675
  let idxAddedToExactTop = (pageSizeBy4) > infoViewIndices ? pageSizeBy4 :
678
676
  (infoViewIndices + infoViewIndices / 4);
679
677
  let eIndex = Math.round(exactTopIndex + idxAddedToExactTop);
680
- infoType.endIndex = (eIndex < totalItemCount || this.component == "multiselect") ? eIndex : totalItemCount;
678
+ infoType.endIndex = (eIndex < totalItemCount) ? eIndex : totalItemCount;
681
679
  let sIndex = infoType.endIndex - this.parent.virtualItemCount;
682
680
  infoType.startIndex = sIndex > 0 ? sIndex : 0;
683
681
  infoType.endIndex = sIndex < 0 ? this.parent.virtualItemCount : infoType.endIndex;
@@ -1041,7 +1039,7 @@ let DropDownBase = class DropDownBase extends Component {
1041
1039
  }
1042
1040
  }
1043
1041
  else {
1044
- if (noDataElement[i] instanceof HTMLElement || noDataElement[i] instanceof Text) {
1042
+ if (noDataElement[i] instanceof HTMLElement || ((noDataElement[i] instanceof Text) && (noDataElement[i]).textContent !== '')) {
1045
1043
  ele.appendChild(noDataElement[i]);
1046
1044
  }
1047
1045
  }
@@ -1845,10 +1843,15 @@ let DropDownBase = class DropDownBase extends Component {
1845
1843
  }
1846
1844
  }
1847
1845
  getPageCount(returnExactCount) {
1848
- const liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
1849
- getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
1850
- let pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
1851
- return returnExactCount ? pageCount : Math.round(pageCount);
1846
+ if (this.list) {
1847
+ const liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
1848
+ getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
1849
+ let pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
1850
+ return returnExactCount ? pageCount : Math.round(pageCount);
1851
+ }
1852
+ else {
1853
+ return 0;
1854
+ }
1852
1855
  }
1853
1856
  updateGroupHeader(index, liCollections, target) {
1854
1857
  if (!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.group)) {
@@ -5869,9 +5872,12 @@ let DropDownList = class DropDownList extends DropDownBase {
5869
5872
  checkData(newProp) {
5870
5873
  if (newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource)) && this.itemTemplate && this.allowFiltering &&
5871
5874
  !(this.isListSearched && (newProp.dataSource instanceof DataManager))) {
5872
- if (this.list) {
5875
+ if (this.list && !(this.isReact)) {
5873
5876
  this.list.innerHTML = '';
5874
5877
  }
5878
+ else {
5879
+ this.list = null;
5880
+ }
5875
5881
  this.actionCompleteData = { ulElement: null, list: null, isUpdated: false };
5876
5882
  }
5877
5883
  this.isListSearched = false;
@@ -10069,10 +10075,41 @@ let ComboBox = class ComboBox extends DropDownList {
10069
10075
  value = this.allowObjectBinding && !isNullOrUndefined(value) ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
10070
10076
  const inputValue = isNullOrUndefined(value) ? null : value.toString();
10071
10077
  Input.setValue(inputValue, this.inputElement, this.floatLabelType, this.showClearButton);
10078
+ let changeData = {};
10072
10079
  if (this.allowObjectBinding) {
10073
10080
  value = this.getDataByValue(value);
10081
+ if (isNullOrUndefined(value)) {
10082
+ const fields = this.fields;
10083
+ let isvalidTextField = false;
10084
+ let isValidValue = false;
10085
+ if (this.allowObjectBinding) {
10086
+ let keys = Object.keys(this.value);
10087
+ keys.forEach((key) => {
10088
+ if (key === fields.value) {
10089
+ isValidValue = true;
10090
+ return;
10091
+ }
10092
+ });
10093
+ keys.forEach((key) => {
10094
+ if (key === fields.text) {
10095
+ isvalidTextField = true;
10096
+ return;
10097
+ }
10098
+ });
10099
+ }
10100
+ changeData = {
10101
+ text: isValidValue ? isvalidTextField ? getValue(fields.text, this.value) : getValue(fields.value, this.value) : null,
10102
+ value: isValidValue ? this.value : null,
10103
+ index: null
10104
+ };
10105
+ }
10106
+ }
10107
+ if (this.allowObjectBinding) {
10108
+ this.setProperties(changeData, true);
10109
+ }
10110
+ else {
10111
+ this.setProperties({ value: value, text: value, index: null }, true);
10074
10112
  }
10075
- this.setProperties({ value: value, text: value, index: null }, true);
10076
10113
  this.activeIndex = this.index;
10077
10114
  const fields = this.fields;
10078
10115
  const dataItem = {};
@@ -10609,7 +10646,7 @@ let ComboBox = class ComboBox extends DropDownList {
10609
10646
  }
10610
10647
  }
10611
10648
  }
10612
- else if (this.allowCustom) {
10649
+ else if (this.allowCustom && this.isInteracted) {
10613
10650
  this.isSelectCustom = true;
10614
10651
  }
10615
10652
  }
@@ -12984,7 +13021,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12984
13021
  expandTextbox() {
12985
13022
  let size = 5;
12986
13023
  if (this.placeholder) {
12987
- size = size > this.inputElement.placeholder.length ? size : this.inputElement.placeholder.length;
13024
+ let codePoint = this.placeholder.charCodeAt(0);
13025
+ let sizeMultiplier = (0xAC00 <= codePoint && codePoint <= 0xD7AF) ? 1.5 : (0x4E00 <= codePoint && codePoint <= 0x9FFF) ? 2 : 1;
13026
+ size = size > this.inputElement.placeholder.length ? size : this.inputElement.placeholder.length * sizeMultiplier;
12988
13027
  }
12989
13028
  if (this.inputElement.value.length > size) {
12990
13029
  this.inputElement.size = this.inputElement.value.length;
@@ -14650,7 +14689,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14650
14689
  if (this.mode === 'CheckBox') {
14651
14690
  this.refreshPlaceHolder();
14652
14691
  this.refreshInputHight();
14653
- if (!this.changeOnBlur && isClearAll && (isNullOrUndefined(this.value) || this.value.length === 0)) {
14692
+ if (this.changeOnBlur && isClearAll && (isNullOrUndefined(this.value) || this.value.length === 0)) {
14654
14693
  this.updateValueState(e, this.value, this.tempValues);
14655
14694
  }
14656
14695
  }
@@ -16360,6 +16399,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16360
16399
  if (!this.closePopupOnSelect && this.isPopupOpen()) {
16361
16400
  this.refreshPopup();
16362
16401
  }
16402
+ if (this.isPopupOpen() && this.mode === 'CheckBox' && this.list && this.list.querySelector('.e-active.e-disable')) {
16403
+ const activeItems = this.list.querySelectorAll('li.' + dropDownBaseClasses.li + '.e-active' + '.e-disable');
16404
+ removeClass(activeItems, 'e-disable');
16405
+ }
16363
16406
  this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
16364
16407
  break;
16365
16408
  case 'width':
@@ -17012,8 +17055,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17012
17055
  if (e.result.length > 0) {
17013
17056
  listItems = e.result;
17014
17057
  this.initStatus = false;
17015
- this.initialValueUpdate(listItems, true);
17016
- this.initialUpdate();
17058
+ setTimeout(() => {
17059
+ this.initialValueUpdate(listItems, true);
17060
+ this.initialUpdate();
17061
+ }, 100);
17017
17062
  this.initStatus = true;
17018
17063
  }
17019
17064
  });
@@ -17928,7 +17973,9 @@ class CheckBoxSelection {
17928
17973
  if (l10n.getConstant('selectAllText') === '') {
17929
17974
  l10n = new L10n('dropdowns', l10nLocale, this.parent.locale);
17930
17975
  }
17931
- this.selectAllSpan.textContent = unSelect ? l10n.getConstant('unSelectAllText') : l10n.getConstant('selectAllText');
17976
+ if (!isNullOrUndefined(this.selectAllSpan)) {
17977
+ this.selectAllSpan.textContent = unSelect ? l10n.getConstant('unSelectAllText') : l10n.getConstant('selectAllText');
17978
+ }
17932
17979
  }
17933
17980
  }
17934
17981
  getActiveList(args) {
@@ -18114,7 +18161,6 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18114
18161
  this.list.setAttribute('role', 'listbox');
18115
18162
  attributes(this.list, { 'role': 'listbox', 'aria-label': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
18116
18163
  this.updateSelectionSettings();
18117
- this.resizeHandler();
18118
18164
  }
18119
18165
  updateSelectionSettings() {
18120
18166
  if (this.selectionSettings.showCheckbox && this.selectionSettings.showSelectAll && this.liCollections.length) {
@@ -18360,7 +18406,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18360
18406
  filterElem = this.list.getElementsByClassName('e-input-filter')[0];
18361
18407
  filterElem.selectionStart = txtLength;
18362
18408
  filterElem.selectionEnd = txtLength;
18363
- filterElem.focus();
18409
+ if (filterElem.value !== '') {
18410
+ filterElem.focus();
18411
+ }
18364
18412
  }
18365
18413
  }
18366
18414
  if (this.toolbarSettings.items.length && this.scope && this.scope.indexOf('#') > -1 && !isNullOrUndefined(e)) {
@@ -18804,33 +18852,22 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18804
18852
  items = (items instanceof Array ? items : [items]);
18805
18853
  const fields = this.fields;
18806
18854
  let dataValue;
18807
- let objValue;
18855
+ let objValue = {};
18808
18856
  const dupData = [];
18809
- let itemIdx;
18810
18857
  extend(dupData, [], this.jsonData);
18811
18858
  const removeIdxes = [];
18812
18859
  const removeLiIdxes = [];
18860
+ for (let i = 0; i < dupData.length; i++) {
18861
+ const value = (dupData[i] instanceof Object) ? dupData[i][fields.value] : dupData[i].toString();
18862
+ objValue[value] = i;
18863
+ }
18813
18864
  for (let j = 0; j < items.length; j++) {
18814
- if (items[j] instanceof Object) {
18815
- dataValue = getValue(fields.value, items[j]);
18816
- }
18817
- else {
18818
- dataValue = items[j].toString();
18819
- }
18820
- for (let i = 0, len = dupData.length; i < len; i++) {
18821
- if (dupData[i] instanceof Object) {
18822
- objValue = getValue(fields.value, dupData[i]);
18823
- }
18824
- else {
18825
- objValue = dupData[i].toString();
18826
- }
18827
- if (objValue === dataValue) {
18828
- itemIdx = this.getIndexByValue(dataValue);
18829
- const idx = itemIdx === i ? itemIdx : i;
18830
- liCollections.push(liElement[idx]);
18831
- removeIdxes.push(idx);
18832
- removeLiIdxes.push(idx);
18833
- }
18865
+ dataValue = (items[j] instanceof Object) ? items[j][fields.value] : items[j].toString();
18866
+ if (objValue.hasOwnProperty(dataValue)) {
18867
+ const idx = objValue[dataValue];
18868
+ liCollections.push(liElement[idx]);
18869
+ removeIdxes.push(idx);
18870
+ removeLiIdxes.push(idx);
18834
18871
  }
18835
18872
  }
18836
18873
  for (let k = removeIdxes.length - 1; k >= 0; k--) {
@@ -19180,6 +19217,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
19180
19217
  }
19181
19218
  this.inputString = this.filterInput.value;
19182
19219
  this.filterWireEvents();
19220
+ this.ulElement.style.setProperty('height', 'calc(100% - ' + (this.filterParent.offsetHeight) + 'px)', 'important');
19183
19221
  return filterInputObj;
19184
19222
  }
19185
19223
  }
@@ -19987,11 +20025,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
19987
20025
  }
19988
20026
  resizeHandler() {
19989
20027
  if (this.list && !(this.cssClass && this.cssClass.indexOf('e-horizontal-listbox') > -1)) {
19990
- if (this.list.scrollWidth > this.list.offsetWidth) {
19991
- this.list.querySelector('.e-list-parent').style.display = 'inline-block';
19992
- }
19993
- else {
19994
- this.list.querySelector('.e-list-parent').style.display = 'block';
20028
+ if (this.list.getElementsByClassName('e-filter-parent').length > 0 && this.allowFiltering) {
20029
+ this.ulElement.style.setProperty('height', 'calc(100% - ' + (this.filterParent.offsetHeight) + 'px)', 'important');
19995
20030
  }
19996
20031
  }
19997
20032
  }
@@ -20324,7 +20359,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
20324
20359
  this.initDraggable();
20325
20360
  }
20326
20361
  else {
20327
- getComponent(this.ulElement, 'sortable').destroy();
20362
+ if (this.ulElement.classList.contains("e-sortable")) {
20363
+ getComponent(this.ulElement, 'sortable').destroy();
20364
+ }
20328
20365
  }
20329
20366
  break;
20330
20367
  case 'allowFiltering':
@@ -21790,10 +21827,10 @@ let Mention = class Mention extends DropDownBase {
21790
21827
  }
21791
21828
  if (this.isContentEditable(this.inputElement)) {
21792
21829
  if (Browser.isAndroid) {
21793
- return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
21830
+ return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
21794
21831
  }
21795
21832
  else {
21796
- return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
21833
+ return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
21797
21834
  }
21798
21835
  }
21799
21836
  else {