@syncfusion/ej2-dropdowns 31.2.3 → 31.2.4

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 (83) hide show
  1. package/README.md +11 -3
  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 +102 -6
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +117 -20
  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 +3 -3
  13. package/src/combo-box/combo-box.js +3 -1
  14. package/src/drop-down-base/drop-down-base.js +10 -0
  15. package/src/drop-down-list/drop-down-list.d.ts +2 -0
  16. package/src/drop-down-list/drop-down-list.js +27 -1
  17. package/src/mention/mention.js +1 -1
  18. package/src/multi-select/multi-select.d.ts +3 -0
  19. package/src/multi-select/multi-select.js +76 -17
  20. package/styles/bds-lite.css +4 -0
  21. package/styles/bds.css +4 -0
  22. package/styles/bootstrap-dark-lite.css +4 -0
  23. package/styles/bootstrap-dark.css +4 -0
  24. package/styles/bootstrap-lite.css +4 -0
  25. package/styles/bootstrap.css +4 -0
  26. package/styles/bootstrap4-lite.css +4 -0
  27. package/styles/bootstrap4.css +4 -0
  28. package/styles/bootstrap5-dark-lite.css +4 -0
  29. package/styles/bootstrap5-dark.css +4 -0
  30. package/styles/bootstrap5-lite.css +4 -0
  31. package/styles/bootstrap5.3-lite.css +4 -0
  32. package/styles/bootstrap5.3.css +4 -0
  33. package/styles/bootstrap5.css +4 -0
  34. package/styles/drop-down-list/_layout.scss +4 -0
  35. package/styles/drop-down-list/bds.css +4 -0
  36. package/styles/drop-down-list/bootstrap-dark.css +4 -0
  37. package/styles/drop-down-list/bootstrap.css +4 -0
  38. package/styles/drop-down-list/bootstrap4.css +4 -0
  39. package/styles/drop-down-list/bootstrap5-dark.css +4 -0
  40. package/styles/drop-down-list/bootstrap5.3.css +4 -0
  41. package/styles/drop-down-list/bootstrap5.css +4 -0
  42. package/styles/drop-down-list/fabric-dark.css +4 -0
  43. package/styles/drop-down-list/fabric.css +4 -0
  44. package/styles/drop-down-list/fluent-dark.css +4 -0
  45. package/styles/drop-down-list/fluent.css +4 -0
  46. package/styles/drop-down-list/fluent2.css +4 -0
  47. package/styles/drop-down-list/highcontrast-light.css +4 -0
  48. package/styles/drop-down-list/highcontrast.css +4 -0
  49. package/styles/drop-down-list/material-dark.css +4 -0
  50. package/styles/drop-down-list/material.css +4 -0
  51. package/styles/drop-down-list/material3-dark.css +4 -0
  52. package/styles/drop-down-list/material3.css +4 -0
  53. package/styles/drop-down-list/tailwind-dark.css +4 -0
  54. package/styles/drop-down-list/tailwind.css +4 -0
  55. package/styles/drop-down-list/tailwind3.css +4 -0
  56. package/styles/fabric-dark-lite.css +4 -0
  57. package/styles/fabric-dark.css +4 -0
  58. package/styles/fabric-lite.css +4 -0
  59. package/styles/fabric.css +4 -0
  60. package/styles/fluent-dark-lite.css +4 -0
  61. package/styles/fluent-dark.css +4 -0
  62. package/styles/fluent-lite.css +4 -0
  63. package/styles/fluent.css +4 -0
  64. package/styles/fluent2-lite.css +4 -0
  65. package/styles/fluent2.css +4 -0
  66. package/styles/highcontrast-light-lite.css +4 -0
  67. package/styles/highcontrast-light.css +4 -0
  68. package/styles/highcontrast-lite.css +4 -0
  69. package/styles/highcontrast.css +4 -0
  70. package/styles/material-dark-lite.css +4 -0
  71. package/styles/material-dark.css +4 -0
  72. package/styles/material-lite.css +4 -0
  73. package/styles/material.css +4 -0
  74. package/styles/material3-dark-lite.css +4 -0
  75. package/styles/material3-dark.css +4 -0
  76. package/styles/material3-lite.css +4 -0
  77. package/styles/material3.css +4 -0
  78. package/styles/tailwind-dark-lite.css +4 -0
  79. package/styles/tailwind-dark.css +4 -0
  80. package/styles/tailwind-lite.css +4 -0
  81. package/styles/tailwind.css +4 -0
  82. package/styles/tailwind3-lite.css +4 -0
  83. package/styles/tailwind3.css +4 -0
@@ -1533,6 +1533,11 @@ let DropDownBase = class DropDownBase extends Component {
1533
1533
  if (this.isVirtualizationEnabled && (e.count !== 0 && e.count < (this.itemCount * 2))) {
1534
1534
  if (newQuery) {
1535
1535
  for (let queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
1536
+ if (this.getModuleName() === 'multiselect' && this.isCheckBoxSelection && (newQuery.queries[queryElements].e && (newQuery.queries[queryElements].e.operator === 'notequal' ||
1537
+ newQuery.queries[queryElements].e.operator === 'equal' || newQuery.queries[queryElements].e.condition === 'or' || newQuery.queries[queryElements].e.condition === 'and') && !this.isCustomFiltering)) {
1538
+ isReOrder = false;
1539
+ break;
1540
+ }
1536
1541
  if (newQuery.queries[queryElements].fn === 'onTake') {
1537
1542
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1538
1543
  newQuery.queries[queryElements].e.nos = e.count;
@@ -1644,6 +1649,11 @@ let DropDownBase = class DropDownBase extends Component {
1644
1649
  listItems.count < (this.itemCount * 2)) && !this.appendUncheckList) {
1645
1650
  if (newQuery) {
1646
1651
  for (let queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
1652
+ if (this.getModuleName() === 'multiselect' && this.isCheckBoxSelection && (newQuery.queries[queryElements].e && (newQuery.queries[queryElements].e.operator === 'notequal' ||
1653
+ newQuery.queries[queryElements].e.operator === 'equal' || newQuery.queries[queryElements].e.condition === 'or' || newQuery.queries[queryElements].e.condition === 'and') && !this.isCustomFiltering)) {
1654
+ isReOrder = false;
1655
+ break;
1656
+ }
1647
1657
  if (newQuery.queries[queryElements].fn === 'onTake') {
1648
1658
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1649
1659
  newQuery.queries[queryElements].e.nos = listItems.count;
@@ -3565,6 +3575,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3565
3575
  this.onChangeEvent(e);
3566
3576
  }
3567
3577
  this.floatLabelChange();
3578
+ this.updateFloatLabelOverflowWidth();
3568
3579
  this.dispatchEvent(this.hiddenElement, 'change');
3569
3580
  if (this.getModuleName() === 'dropdownlist' && this.element.tagName !== 'INPUT') {
3570
3581
  this.dispatchEvent(this.inputElement, 'blur');
@@ -3581,6 +3592,12 @@ let DropDownList = class DropDownList extends DropDownBase {
3581
3592
  this.trigger('focus', args);
3582
3593
  }
3583
3594
  this.updateIconState();
3595
+ if (this.floatLabelType !== 'Never' && this.inputWrapper && this.inputWrapper.container) {
3596
+ const label = this.inputWrapper.container.querySelector('.e-float-text');
3597
+ if (label) {
3598
+ label.removeAttribute('style');
3599
+ }
3600
+ }
3584
3601
  this.isFocused = true;
3585
3602
  }
3586
3603
  resizingWireEvent() {
@@ -5398,7 +5415,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5398
5415
  checkVal = this.virtualGroupDataSource.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
5399
5416
  this.checkFieldValue(x, fieldValue) === value : x[checkField] === value);
5400
5417
  }
5401
- if (!checkVal) {
5418
+ if (!checkVal && !this.enableVirtualization) {
5402
5419
  this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', value)))
5403
5420
  .then((e) => {
5404
5421
  if (e.result.length > 0) {
@@ -6535,6 +6552,7 @@ let DropDownList = class DropDownList extends DropDownBase {
6535
6552
  this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never') {
6536
6553
  this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
6537
6554
  }
6555
+ this.updateFloatLabelOverflowWidth();
6538
6556
  this.wireEvent();
6539
6557
  this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
6540
6558
  this.element.removeAttribute('tabindex');
@@ -7095,6 +7113,24 @@ let DropDownList = class DropDownList extends DropDownBase {
7095
7113
  Input.setCssClass(newClass, [this.popupObj.element], oldClass);
7096
7114
  }
7097
7115
  }
7116
+ getRightIconsWidth() {
7117
+ const container = this.inputWrapper.container;
7118
+ let width = 0;
7119
+ const iconSelectors = '.e-input-group-icon, .e-clear-icon';
7120
+ const icons = container.querySelectorAll(iconSelectors);
7121
+ for (let index = 0; index < icons.length; index++) {
7122
+ width += icons[index].offsetWidth;
7123
+ }
7124
+ return width;
7125
+ }
7126
+ updateFloatLabelOverflowWidth() {
7127
+ const container = this.inputWrapper.container;
7128
+ const label = container.querySelector('.e-float-text');
7129
+ const calculateWidth = (container.clientWidth - this.getRightIconsWidth());
7130
+ if (label && calculateWidth) {
7131
+ label.style.width = calculateWidth + 'px';
7132
+ }
7133
+ }
7098
7134
  /**
7099
7135
  * Return the module name of this component.
7100
7136
  *
@@ -11311,7 +11347,9 @@ let ComboBox = class ComboBox extends DropDownList {
11311
11347
  this.fields.value : '', this.value) : this.value;
11312
11348
  if ((valueFieldValue === dataItem.value && this.text !== dataItem.text.toString()) ||
11313
11349
  (valueFieldValue !== dataItem.value && this.text === dataItem.text.toString())) {
11314
- this.setProperties({ 'text': dataItem.text ? dataItem.text.toString() : dataItem.text, 'value': value });
11350
+ this.setProperties({ 'text': dataItem.text ? dataItem.text.toString() : dataItem.text, 'value': value }, true);
11351
+ this.setHiddenValue();
11352
+ Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
11315
11353
  }
11316
11354
  }
11317
11355
  else if (this.allowCustom) {
@@ -13245,6 +13283,27 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13245
13283
  this.scrollBottom(focusedItem, undefined, false, null, true);
13246
13284
  }
13247
13285
  }
13286
+ updatePopupHeightOnFilter() {
13287
+ if (this.allowFiltering && this.allowResize && this.keyboardEvent) {
13288
+ if (this.allowResize && this.popupObj && this.list) {
13289
+ const filterText = this.inputElement && this.inputElement.value;
13290
+ const filteredItems = this.list.querySelectorAll('li.e-list-item:not(.e-hide-listitem):not(.e-disabled)');
13291
+ const isFiltering = filterText && filterText.length > 0;
13292
+ if (isFiltering && filteredItems.length > 0) {
13293
+ const itemHeight = filteredItems[0].offsetHeight;
13294
+ const newHeight = filteredItems.length * itemHeight;
13295
+ this.popupObj.element.style.maxHeight = newHeight + 16 + 'px';
13296
+ this.list.style.maxHeight = newHeight + 'px';
13297
+ }
13298
+ else if (!isFiltering) {
13299
+ const restoreHeight = this.resizeHeight || parseInt(this.popupHeight, 10);
13300
+ this.popupObj.element.style.maxHeight = restoreHeight + 'px';
13301
+ this.list.style.maxHeight = restoreHeight + 'px';
13302
+ this.setResize();
13303
+ }
13304
+ }
13305
+ }
13306
+ }
13248
13307
  focusAtFirstListItem(isOpen) {
13249
13308
  if (this.ulElement && this.ulElement.querySelector('li.'
13250
13309
  + dropDownBaseClasses.li)) {
@@ -13971,7 +14030,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13971
14030
  this.getFilteringSkeletonCount();
13972
14031
  }
13973
14032
  this.refreshPopup();
13974
- if (this.allowResize) {
14033
+ if (this.allowResize && !this.isFilteringAction) {
13975
14034
  this.setResize();
13976
14035
  }
13977
14036
  if (this.mode === 'CheckBox') {
@@ -14158,6 +14217,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14158
14217
  }
14159
14218
  onBlurHandler(eve, isDocClickFromCheck) {
14160
14219
  let target;
14220
+ this.updatePopupHeightOnFilter();
14161
14221
  if (this.isBlurDispatching && this.isAngular) {
14162
14222
  this.isBlurDispatching = false;
14163
14223
  return;
@@ -14238,6 +14298,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14238
14298
  Input.createSpanElement(this.overAllWrapper, this.createElement);
14239
14299
  }
14240
14300
  this.calculateWidth();
14301
+ this.updateFloatLabelOverflowWidth();
14241
14302
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] &&
14242
14303
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
14243
14304
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
@@ -14439,6 +14500,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14439
14500
  this.searchWrapper.classList.remove(ZERO_SIZE);
14440
14501
  }
14441
14502
  this.checkPlaceholderSize();
14503
+ if (this.floatLabelType !== 'Never' && this.overAllWrapper) {
14504
+ const label = this.overAllWrapper.querySelector('.e-float-text');
14505
+ if (label) {
14506
+ label.removeAttribute('style');
14507
+ }
14508
+ }
14442
14509
  if (this.focused) {
14443
14510
  const args = { isInteracted: e ? true : false, event: e };
14444
14511
  this.trigger('focus', args);
@@ -14749,7 +14816,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14749
14816
  if (!(this.mode === 'CheckBox' && this.showSelectAll)) {
14750
14817
  this.refreshPopup();
14751
14818
  }
14752
- if (this.allowResize) {
14819
+ if (this.allowResize && !this.isFilterAction) {
14753
14820
  this.setResize();
14754
14821
  }
14755
14822
  this.isKeyBoardAction = false;
@@ -16453,6 +16520,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16453
16520
  }
16454
16521
  }
16455
16522
  });
16523
+ this.updatePopupHeightOnFilter();
16456
16524
  }
16457
16525
  search(e) {
16458
16526
  this.preventSetCurrentData = false;
@@ -16847,10 +16915,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16847
16915
  ((!(this.dataSource instanceof DataManager)) ||
16848
16916
  (this.dataSource instanceof DataManager && isInitialVirtualData)))) {
16849
16917
  const indexItem = this.listData.length;
16850
- const newValue = {};
16918
+ let newValue = {};
16851
16919
  setValue(this.fields.text, value, newValue);
16852
16920
  setValue(this.fields.value, value, newValue);
16853
16921
  const noDataEle = this.popupWrapper.querySelector('.' + dropDownBaseClasses.noData);
16922
+ if (newValue && this.allowObjectBinding && this.allowCustomValue && this.value.length > 0 && typeof this.value[0] === 'object') {
16923
+ const valueArray = this.value;
16924
+ const filteredItems = valueArray.filter((valObj) => {
16925
+ return valObj[this.fields.value] === value;
16926
+ });
16927
+ if (filteredItems.length > 0) {
16928
+ newValue = filteredItems[0]; // Take the first matching item
16929
+ }
16930
+ }
16854
16931
  if (!this.enableVirtualization) {
16855
16932
  this.addItem(newValue, indexItem);
16856
16933
  }
@@ -18698,6 +18775,24 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18698
18775
  this.isSelectAll = true;
18699
18776
  this.selectAllItems(state);
18700
18777
  }
18778
+ getRightIconsWidth() {
18779
+ const container = this.overAllWrapper;
18780
+ let width = 0;
18781
+ const iconSelectors = '.e-input-group-icon, .e-clear-icon';
18782
+ const icons = container.querySelectorAll(iconSelectors);
18783
+ for (let index = 0; index < icons.length; index++) {
18784
+ width += icons[index].offsetWidth;
18785
+ }
18786
+ return width;
18787
+ }
18788
+ updateFloatLabelOverflowWidth() {
18789
+ const container = this.overAllWrapper;
18790
+ const label = container.querySelector('.e-float-text');
18791
+ const calculateWidth = (container.clientWidth - this.getRightIconsWidth());
18792
+ if (label && calculateWidth) {
18793
+ label.style.width = calculateWidth + 'px';
18794
+ }
18795
+ }
18701
18796
  /**
18702
18797
  * Return the module name of this component.
18703
18798
  *
@@ -18861,6 +18956,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18861
18956
  closest(this.element, 'fieldset').disabled) {
18862
18957
  this.enabled = false;
18863
18958
  }
18959
+ this.updateFloatLabelOverflowWidth();
18864
18960
  this.wireEvent();
18865
18961
  this.enable(this.enabled);
18866
18962
  this.enableRTL(this.enableRtl);
@@ -23186,7 +23282,7 @@ let Mention = class Mention extends DropDownBase {
23186
23282
  : lastWordRange.replace(this.mentionChar, '');
23187
23283
  }
23188
23284
  if (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) &&
23189
- this.queryString !== '' && e.keyCode !== 38 && e.keyCode !== 40 && !this.lineBreak) {
23285
+ this.queryString !== '' && e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && !this.lineBreak) {
23190
23286
  this.searchLists(e);
23191
23287
  if (!this.isPopupOpen && this.queryString.length >= this.minLength) {
23192
23288
  if (!this.isContentEditable(this.inputElement)) {