@syncfusion/ej2-dropdowns 25.2.4 → 25.2.6

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 (73) hide show
  1. package/CHANGELOG.md +32 -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 +59 -25
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +59 -25
  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 +9 -9
  13. package/src/drop-down-base/drop-down-base.d.ts +1 -1
  14. package/src/drop-down-base/drop-down-base.js +22 -11
  15. package/src/drop-down-list/drop-down-list.d.ts +1 -0
  16. package/src/drop-down-list/drop-down-list.js +31 -8
  17. package/src/drop-down-tree/drop-down-tree.js +2 -3
  18. package/src/multi-select/float-label.js +1 -0
  19. package/src/multi-select/multi-select.js +3 -3
  20. package/styles/bootstrap-dark.css +3 -0
  21. package/styles/bootstrap.css +3 -0
  22. package/styles/bootstrap4.css +3 -0
  23. package/styles/bootstrap5-dark.css +3 -0
  24. package/styles/bootstrap5.css +3 -0
  25. package/styles/drop-down-tree/_bds-definition.scss +1 -0
  26. package/styles/drop-down-tree/_bootstrap-dark-definition.scss +2 -1
  27. package/styles/drop-down-tree/_bootstrap-definition.scss +2 -1
  28. package/styles/drop-down-tree/_bootstrap4-definition.scss +2 -1
  29. package/styles/drop-down-tree/_bootstrap5-definition.scss +2 -1
  30. package/styles/drop-down-tree/_fabric-dark-definition.scss +2 -1
  31. package/styles/drop-down-tree/_fabric-definition.scss +2 -1
  32. package/styles/drop-down-tree/_fluent-definition.scss +2 -1
  33. package/styles/drop-down-tree/_fusionnew-definition.scss +2 -1
  34. package/styles/drop-down-tree/_highcontrast-definition.scss +2 -1
  35. package/styles/drop-down-tree/_highcontrast-light-definition.scss +2 -1
  36. package/styles/drop-down-tree/_material-dark-definition.scss +2 -1
  37. package/styles/drop-down-tree/_material-definition.scss +2 -1
  38. package/styles/drop-down-tree/_material3-definition.scss +1 -0
  39. package/styles/drop-down-tree/_tailwind-definition.scss +1 -0
  40. package/styles/drop-down-tree/_theme.scss +3 -0
  41. package/styles/drop-down-tree/bootstrap-dark.css +3 -0
  42. package/styles/drop-down-tree/bootstrap.css +3 -0
  43. package/styles/drop-down-tree/bootstrap4.css +3 -0
  44. package/styles/drop-down-tree/bootstrap5-dark.css +3 -0
  45. package/styles/drop-down-tree/bootstrap5.css +3 -0
  46. package/styles/drop-down-tree/fabric-dark.css +3 -0
  47. package/styles/drop-down-tree/fabric.css +3 -0
  48. package/styles/drop-down-tree/fluent-dark.css +3 -0
  49. package/styles/drop-down-tree/fluent.css +3 -0
  50. package/styles/drop-down-tree/highcontrast-light.css +3 -0
  51. package/styles/drop-down-tree/highcontrast.css +3 -0
  52. package/styles/drop-down-tree/material-dark.css +3 -0
  53. package/styles/drop-down-tree/material.css +3 -0
  54. package/styles/drop-down-tree/material3-dark.css +3 -0
  55. package/styles/drop-down-tree/material3.css +3 -0
  56. package/styles/drop-down-tree/tailwind-dark.css +3 -0
  57. package/styles/drop-down-tree/tailwind.css +3 -0
  58. package/styles/fabric-dark.css +3 -0
  59. package/styles/fabric.css +3 -0
  60. package/styles/fluent-dark.css +3 -0
  61. package/styles/fluent.css +3 -0
  62. package/styles/highcontrast-light.css +3 -0
  63. package/styles/highcontrast.css +3 -0
  64. package/styles/material-dark.css +3 -0
  65. package/styles/material.css +3 -0
  66. package/styles/material3-dark.css +13 -7
  67. package/styles/material3.css +13 -7
  68. package/styles/multi-select/_layout.scss +2 -2
  69. package/styles/multi-select/icons/_material3.scss +8 -5
  70. package/styles/multi-select/material3-dark.css +10 -7
  71. package/styles/multi-select/material3.css +10 -7
  72. package/styles/tailwind-dark.css +3 -0
  73. package/styles/tailwind.css +3 -0
@@ -1856,10 +1856,14 @@ let DropDownBase = class DropDownBase extends Component {
1856
1856
  }
1857
1857
  }
1858
1858
  updateGroupFixedHeader(element, target) {
1859
- this.fixedHeaderElement.innerHTML = element.innerHTML;
1860
- this.fixedHeaderElement.style.position = 'fixed';
1861
- this.fixedHeaderElement.style.top = this.list.parentElement.offsetTop + this.list.offsetTop + 'px';
1862
- this.fixedHeaderElement.style.display = 'block';
1859
+ if (this.fixedHeaderElement) {
1860
+ if (!isNullOrUndefined(element.innerHTML)) {
1861
+ this.fixedHeaderElement.innerHTML = element.innerHTML;
1862
+ }
1863
+ this.fixedHeaderElement.style.position = 'fixed';
1864
+ this.fixedHeaderElement.style.top = (this.list.parentElement.offsetTop + this.list.offsetTop) - window.scrollY + 'px';
1865
+ this.fixedHeaderElement.style.display = 'block';
1866
+ }
1863
1867
  }
1864
1868
  getValidLi() {
1865
1869
  if (this.isVirtualizationEnabled) {
@@ -2050,9 +2054,12 @@ let DropDownBase = class DropDownBase extends Component {
2050
2054
  * @param {string | number | boolean} value - Specifies given value.
2051
2055
  * @returns {number} Returns the index of the item.
2052
2056
  */
2053
- getIndexByValueFilter(value) {
2057
+ getIndexByValueFilter(value, ulElement) {
2054
2058
  let index;
2055
- const listItems = this.renderItems(this.dataSource, this.fields).querySelectorAll('li' + ':not(.e-list-group-item)');
2059
+ if (!ulElement) {
2060
+ return null;
2061
+ }
2062
+ const listItems = ulElement.querySelectorAll('li' + ':not(.e-list-group-item)');
2056
2063
  if (listItems) {
2057
2064
  for (let i = 0; i < listItems.length; i++) {
2058
2065
  if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
@@ -2216,6 +2223,7 @@ let DropDownBase = class DropDownBase extends Component {
2216
2223
  const group = this.element.querySelector('select>optgroup');
2217
2224
  if ((this.fields.groupBy || !isNullOrUndefined(group)) && !this.isGroupChecking) {
2218
2225
  EventHandler.add(this.list, 'scroll', this.setFloatingHeader, this);
2226
+ EventHandler.add(document, 'scroll', this.updateGroupFixedHeader, this);
2219
2227
  }
2220
2228
  if (this.getModuleName() === 'dropdownbase') {
2221
2229
  if (this.element.getAttribute('tabindex')) {
@@ -2467,12 +2475,15 @@ let DropDownBase = class DropDownBase extends Component {
2467
2475
  * @returns {void}
2468
2476
  */
2469
2477
  destroy() {
2470
- if (document.body.contains(this.list)) {
2471
- EventHandler.remove(this.list, 'scroll', this.setFloatingHeader);
2472
- if (!isNullOrUndefined(this.rippleFun)) {
2473
- this.rippleFun();
2478
+ if (document) {
2479
+ EventHandler.remove(document, 'scroll', this.updateGroupFixedHeader);
2480
+ if (document.body.contains(this.list)) {
2481
+ EventHandler.remove(this.list, 'scroll', this.setFloatingHeader);
2482
+ if (!isNullOrUndefined(this.rippleFun)) {
2483
+ this.rippleFun();
2484
+ }
2485
+ detach(this.list);
2474
2486
  }
2475
- detach(this.list);
2476
2487
  }
2477
2488
  this.liCollections = null;
2478
2489
  this.ulElement = null;
@@ -2621,6 +2632,12 @@ let DropDownList = class DropDownList extends DropDownBase {
2621
2632
  this.IsScrollerAtEnd = function () {
2622
2633
  return this.list && this.list.scrollTop + this.list.clientHeight >= this.list.scrollHeight;
2623
2634
  };
2635
+ this.removeAllChildren = function (element) {
2636
+ while (element.children[0]) {
2637
+ this.removeAllChildren(element.children[0]);
2638
+ element.removeChild(element.children[0]);
2639
+ }
2640
+ };
2624
2641
  }
2625
2642
  /**
2626
2643
  * Initialize the event handler.
@@ -3507,7 +3524,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3507
3524
  }
3508
3525
  if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
3509
3526
  let value = this.getItemData().value;
3510
- let filterIndex = this.getIndexByValueFilter(value);
3527
+ let filterIndex = this.getIndexByValueFilter(value, this.actionCompleteData.ulElement);
3511
3528
  if (!isNullOrUndefined(filterIndex)) {
3512
3529
  this.activeIndex = filterIndex;
3513
3530
  }
@@ -3849,7 +3866,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3849
3866
  value = 'null';
3850
3867
  }
3851
3868
  if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
3852
- let filterIndex = this.getIndexByValueFilter(value);
3869
+ let filterIndex = this.getIndexByValueFilter(value, this.actionCompleteData.ulElement);
3853
3870
  if (!isNullOrUndefined(filterIndex)) {
3854
3871
  this.activeIndex = filterIndex;
3855
3872
  }
@@ -3891,7 +3908,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3891
3908
  this.inputElement.style.display = 'block';
3892
3909
  }
3893
3910
  if (!isNullOrUndefined(dataItem.value) && !this.enableVirtualization && this.allowFiltering) {
3894
- this.activeIndex = this.getIndexByValueFilter(dataItem.value);
3911
+ this.activeIndex = this.getIndexByValueFilter(dataItem.value, this.actionCompleteData.ulElement);
3895
3912
  }
3896
3913
  const clearIcon = dropDownListClasses.clearIcon;
3897
3914
  const isFilterElement = this.isFiltering() && this.filterInput && (this.getModuleName() === 'combobox');
@@ -5339,6 +5356,14 @@ let DropDownList = class DropDownList extends DropDownBase {
5339
5356
  this.keyboardEvent = null;
5340
5357
  EventHandler.remove(document, 'mousedown', this.onDocumentClick);
5341
5358
  this.isActive = false;
5359
+ if (this.getModuleName() === 'dropdownlist') {
5360
+ Input.destroy({
5361
+ element: this.filterInput,
5362
+ floatLabelType: this.floatLabelType,
5363
+ properties: { placeholder: this.filterBarPlaceholder },
5364
+ buttons: this.clearIconElement,
5365
+ }, this.clearIconElement);
5366
+ }
5342
5367
  this.filterInputObj = null;
5343
5368
  this.isDropDownClick = false;
5344
5369
  this.preventAutoFill = false;
@@ -5369,6 +5394,11 @@ let DropDownList = class DropDownList extends DropDownBase {
5369
5394
  }
5370
5395
  if (this.allowFiltering && this.getModuleName() === 'dropdownlist') {
5371
5396
  this.filterInput.removeAttribute('aria-activedescendant');
5397
+ this.filterInput.removeAttribute('aria-disabled');
5398
+ this.filterInput.removeAttribute('role');
5399
+ this.filterInput.removeAttribute('autocomplete');
5400
+ this.filterInput.removeAttribute('autocapitalize');
5401
+ this.filterInput.removeAttribute('spellcheck');
5372
5402
  }
5373
5403
  this.filterInput = null;
5374
5404
  }
@@ -5795,8 +5825,8 @@ let DropDownList = class DropDownList extends DropDownBase {
5795
5825
  */
5796
5826
  onPropertyChanged(newProp, oldProp) {
5797
5827
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5798
- if (!isNullOrUndefined(newProp.dataSource) && !this.isTouched && (isNullOrUndefined(newProp.value) && isNullOrUndefined(newProp.index)) && !isNullOrUndefined(this.preselectedIndex)) {
5799
- newProp.index = this.preselectedIndex;
5828
+ if (!isNullOrUndefined(newProp.dataSource) && !this.isTouched && (isNullOrUndefined(newProp.value) && isNullOrUndefined(newProp.index)) && !isNullOrUndefined(this.preselectedIndex) && !isNullOrUndefined(this.index)) {
5829
+ newProp.index = this.index;
5800
5830
  }
5801
5831
  if (!isNullOrUndefined(newProp.value) || !isNullOrUndefined(newProp.index)) {
5802
5832
  this.isTouched = true;
@@ -6309,10 +6339,12 @@ let DropDownList = class DropDownList extends DropDownBase {
6309
6339
  this.inputWrapper.container.parentElement.insertBefore(this.element, this.inputWrapper.container);
6310
6340
  detach(this.inputWrapper.container);
6311
6341
  }
6312
- this.hiddenElement = null;
6342
+ delete this.hiddenElement;
6313
6343
  this.filterInput = null;
6314
- this.inputWrapper = null;
6315
6344
  this.keyboardModule = null;
6345
+ if (!isNullOrUndefined(this.ulElement)) {
6346
+ this.removeAllChildren(this.ulElement);
6347
+ }
6316
6348
  this.ulElement = null;
6317
6349
  this.list = null;
6318
6350
  this.clearIconElement = null;
@@ -6336,10 +6368,12 @@ let DropDownList = class DropDownList extends DropDownBase {
6336
6368
  Input.destroy({
6337
6369
  element: this.inputElement,
6338
6370
  floatLabelType: this.floatLabelType,
6339
- properties: this.properties
6371
+ properties: this.properties,
6372
+ buttons: this.inputWrapper.container.querySelectorAll('.e-input-group-icon')[0],
6340
6373
  }, this.clearButton);
6341
6374
  this.clearButton = null;
6342
6375
  this.inputElement = null;
6376
+ this.inputWrapper = null;
6343
6377
  super.destroy();
6344
6378
  }
6345
6379
  /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
@@ -7254,7 +7288,6 @@ let DropDownTree = class DropDownTree extends Component {
7254
7288
  }
7255
7289
  break;
7256
7290
  case 'tab':
7257
- case 'shiftTab':
7258
7291
  if (this.isPopupOpen) {
7259
7292
  this.hidePopup();
7260
7293
  }
@@ -8394,6 +8427,8 @@ let DropDownTree = class DropDownTree extends Component {
8394
8427
  if (this.showCheckBox) {
8395
8428
  return;
8396
8429
  }
8430
+ const eventArgs = this.getEventArgs(args);
8431
+ this.trigger('select', eventArgs);
8397
8432
  let selectedText;
8398
8433
  if (args.isInteracted) {
8399
8434
  const id = getValue('id', args.nodeData).toString();
@@ -8421,8 +8456,6 @@ let DropDownTree = class DropDownTree extends Component {
8421
8456
  this.setMultiSelect();
8422
8457
  }
8423
8458
  }
8424
- const eventArgs = this.getEventArgs(args);
8425
- this.trigger('select', eventArgs);
8426
8459
  if (this.isValueChange && !this.changeOnBlur) {
8427
8460
  this.triggerChangeEvent(this.keyEventArgs);
8428
8461
  this.isValueChange = false;
@@ -11256,6 +11289,7 @@ function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement,
11256
11289
  element.id = id;
11257
11290
  if (!isNullOrUndefined(element.id) && element.id !== '') {
11258
11291
  floatLabelElement.id = 'label_' + element.id.replace(/ /g, '_');
11292
+ floatLabelElement.setAttribute('for', element.id);
11259
11293
  attributes(inputElement, { 'aria-labelledby': floatLabelElement.id });
11260
11294
  }
11261
11295
  if (!isNullOrUndefined(inputElement.placeholder) && inputElement.placeholder !== '') {
@@ -11872,7 +11906,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11872
11906
  this.updateSelectElementData(this.allowFiltering);
11873
11907
  // eslint-disable-next-line @typescript-eslint/no-this-alias
11874
11908
  const proxy = this;
11875
- if (!isNullOrUndefined(this.value) && !this.allowCustomValue && !this.enableVirtualization) {
11909
+ if (!isNullOrUndefined(this.value) && !this.allowCustomValue && !this.enableVirtualization && this.listData && this.listData.length > 0) {
11876
11910
  for (let i = 0; i < this.value.length; i++) {
11877
11911
  const value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', proxy.value[i]) : proxy.value[i];
11878
11912
  const checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', value);
@@ -14640,7 +14674,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14640
14674
  if (this.enableVirtualization) {
14641
14675
  listValue = this.findListElement((!isNullOrUndefined(this.list) ? this.list : this.ulElement), 'li', 'data-value', valueItem);
14642
14676
  }
14643
- if (isNullOrUndefined(listValue) && !this.allowCustomValue && !this.enableVirtualization) {
14677
+ if (isNullOrUndefined(listValue) && !this.allowCustomValue && !this.enableVirtualization && this.listData && this.listData.length > 0) {
14644
14678
  this.value.splice(index, 1);
14645
14679
  index -= 1;
14646
14680
  valueLength -= 1;
@@ -15431,7 +15465,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15431
15465
  downIconWidth = this.dropIcon.offsetWidth + parseInt(window.getComputedStyle(this.dropIcon).marginRight, 10);
15432
15466
  }
15433
15467
  this.checkClearIconWidth();
15434
- if (!isNullOrUndefined(this.value)) {
15468
+ if (!isNullOrUndefined(this.value) && (this.allowCustomValue || (this.listData && this.listData.length > 0))) {
15435
15469
  for (let index = 0; !isNullOrUndefined(this.value[index]); index++) {
15436
15470
  let items = this.text && this.text.split(this.delimiterChar);
15437
15471
  if (!this.enableVirtualization) {