@syncfusion/ej2-dropdowns 23.1.40 → 23.1.41

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 (59) hide show
  1. package/CHANGELOG.md +21 -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 +45 -4
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +45 -4
  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/drop-down-base/drop-down-base.d.ts +1 -0
  14. package/src/drop-down-base/drop-down-base.js +5 -0
  15. package/src/drop-down-list/drop-down-list.d.ts +3 -0
  16. package/src/drop-down-list/drop-down-list.js +33 -2
  17. package/src/drop-down-tree/drop-down-tree.js +2 -2
  18. package/src/multi-select/multi-select.js +5 -0
  19. package/styles/auto-complete/bootstrap4.css +13 -2
  20. package/styles/bootstrap-dark.css +1 -1
  21. package/styles/bootstrap.css +1 -1
  22. package/styles/bootstrap4.css +33 -3
  23. package/styles/bootstrap5-dark.css +1 -1
  24. package/styles/bootstrap5.css +1 -1
  25. package/styles/combo-box/bootstrap4.css +13 -2
  26. package/styles/drop-down-list/_bootstrap4-definition.scss +13 -2
  27. package/styles/drop-down-list/bootstrap4.css +13 -2
  28. package/styles/fabric-dark.css +1 -1
  29. package/styles/fabric.css +1 -1
  30. package/styles/fluent-dark.css +1 -1
  31. package/styles/fluent.css +1 -1
  32. package/styles/highcontrast-light.css +1 -1
  33. package/styles/highcontrast.css +1 -1
  34. package/styles/list-box/_theme.scss +1 -1
  35. package/styles/list-box/bootstrap-dark.css +1 -1
  36. package/styles/list-box/bootstrap.css +1 -1
  37. package/styles/list-box/bootstrap4.css +1 -1
  38. package/styles/list-box/bootstrap5-dark.css +1 -1
  39. package/styles/list-box/bootstrap5.css +1 -1
  40. package/styles/list-box/fabric-dark.css +1 -1
  41. package/styles/list-box/fabric.css +1 -1
  42. package/styles/list-box/fluent-dark.css +1 -1
  43. package/styles/list-box/fluent.css +1 -1
  44. package/styles/list-box/highcontrast-light.css +1 -1
  45. package/styles/list-box/highcontrast.css +1 -1
  46. package/styles/list-box/material-dark.css +1 -1
  47. package/styles/list-box/material.css +1 -1
  48. package/styles/list-box/material3-dark.css +1 -1
  49. package/styles/list-box/material3.css +1 -1
  50. package/styles/list-box/tailwind-dark.css +1 -1
  51. package/styles/list-box/tailwind.css +1 -1
  52. package/styles/material-dark.css +1 -1
  53. package/styles/material.css +1 -1
  54. package/styles/material3-dark.css +1 -1
  55. package/styles/material3.css +1 -1
  56. package/styles/multi-select/_bootstrap4-definition.scss +19 -0
  57. package/styles/multi-select/bootstrap4.css +19 -0
  58. package/styles/tailwind-dark.css +1 -1
  59. package/styles/tailwind.css +1 -1
@@ -1611,6 +1611,11 @@ let DropDownBase = class DropDownBase extends Component {
1611
1611
  this.initialize(e);
1612
1612
  }
1613
1613
  }
1614
+ removeScrollEvent() {
1615
+ if (this.list) {
1616
+ EventHandler.remove(this.list, 'scroll', this.setFloatingHeader);
1617
+ }
1618
+ }
1614
1619
  /**
1615
1620
  * Return the module name of this component.
1616
1621
  *
@@ -1991,6 +1996,7 @@ let DropDownList = class DropDownList extends DropDownBase {
1991
1996
  this.pageCount = 0;
1992
1997
  this.isPreventKeyAction = false;
1993
1998
  this.generatedDataObject = {};
1999
+ this.isTouched = false;
1994
2000
  this.virtualListInfo = {
1995
2001
  currentPageNumber: null,
1996
2002
  direction: null,
@@ -3751,7 +3757,12 @@ let DropDownList = class DropDownList extends DropDownBase {
3751
3757
  this.updateActionCompleteDataValues(ulElement, list);
3752
3758
  }
3753
3759
  }
3754
- if (!this.enableVirtualization) {
3760
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3761
+ if ((this.allowCustom || (this.allowFiltering && !this.isValueInList(list, this.value) && this.dataSource instanceof DataManager)) && !this.enableVirtualization) {
3762
+ this.addNewItem(list, selectedItem);
3763
+ }
3764
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3765
+ else if ((this.allowCustom || (this.allowFiltering && this.isValueInList(list, this.value))) && !this.enableVirtualization) {
3755
3766
  this.addNewItem(list, selectedItem);
3756
3767
  }
3757
3768
  if (!isNullOrUndefined(this.itemData) || (isNullOrUndefined(this.itemData) && this.enableVirtualization)) {
@@ -3785,6 +3796,24 @@ let DropDownList = class DropDownList extends DropDownBase {
3785
3796
  }
3786
3797
  }
3787
3798
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3799
+ isValueInList(list, valueToFind) {
3800
+ if (Array.isArray(list)) {
3801
+ for (let i = 0; i < list.length; i++) {
3802
+ if (list[i] === valueToFind) {
3803
+ return true;
3804
+ }
3805
+ }
3806
+ }
3807
+ else if (typeof list === 'object' && list !== null) {
3808
+ for (const key in list) {
3809
+ if (Object.prototype.hasOwnProperty.call(list, key) && list[key] === valueToFind) {
3810
+ return true;
3811
+ }
3812
+ }
3813
+ }
3814
+ return false;
3815
+ }
3816
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3788
3817
  checkFieldValue(list, fieldValue) {
3789
3818
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3790
3819
  let checkField = list;
@@ -4539,6 +4568,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4539
4568
  * @returns {void}
4540
4569
  */
4541
4570
  render() {
4571
+ this.preselectedIndex = !isNullOrUndefined(this.index) ? this.index : null;
4542
4572
  if (this.element.tagName === 'INPUT') {
4543
4573
  this.inputElement = this.element;
4544
4574
  if (isNullOrUndefined(this.inputElement.getAttribute('role'))) {
@@ -4776,7 +4806,6 @@ let DropDownList = class DropDownList extends DropDownBase {
4776
4806
  if (this.allowFiltering && newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))) {
4777
4807
  this.actionCompleteData = { ulElement: null, list: null, isUpdated: false };
4778
4808
  this.actionData = this.actionCompleteData;
4779
- this.itemData = null;
4780
4809
  }
4781
4810
  else if (this.allowFiltering && newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
4782
4811
  this.actionCompleteData = this.getModuleName() === 'combobox' ?
@@ -4821,6 +4850,13 @@ let DropDownList = class DropDownList extends DropDownBase {
4821
4850
  * @returns {void}
4822
4851
  */
4823
4852
  onPropertyChanged(newProp, oldProp) {
4853
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4854
+ if (!isNullOrUndefined(newProp.dataSource) && !this.isTouched && (isNullOrUndefined(newProp.value) && isNullOrUndefined(newProp.index)) && !isNullOrUndefined(this.preselectedIndex)) {
4855
+ newProp.index = this.preselectedIndex;
4856
+ }
4857
+ if (!isNullOrUndefined(newProp.value) || !isNullOrUndefined(newProp.index)) {
4858
+ this.isTouched = true;
4859
+ }
4824
4860
  if (this.getModuleName() === 'dropdownlist') {
4825
4861
  this.checkData(newProp);
4826
4862
  this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
@@ -7359,12 +7395,12 @@ let DropDownTree = class DropDownTree extends Component {
7359
7395
  const nodes = this.treeObj.element.querySelectorAll('li');
7360
7396
  const checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
7361
7397
  const wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
7362
- if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0)) {
7398
+ if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0 || args.data[0].isChecked == "false")) {
7363
7399
  this.isReverseUpdate = true;
7364
7400
  this.changeState(wrap, 'uncheck');
7365
7401
  this.isReverseUpdate = false;
7366
7402
  }
7367
- else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && (args.isInteracted || this.isCheckAllCalled)) {
7403
+ else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && (args.isInteracted || this.isCheckAllCalled || args.data[0].isChecked == "true")) {
7368
7404
  this.isReverseUpdate = true;
7369
7405
  this.isCheckAllCalled = false;
7370
7406
  this.changeState(wrap, 'check');
@@ -13721,6 +13757,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13721
13757
  }
13722
13758
  this.updateSelectElementData(this.allowFiltering);
13723
13759
  break;
13760
+ case 'fields':
13761
+ if (isNullOrUndefined(this.fields.groupBy)) {
13762
+ this.removeScrollEvent();
13763
+ }
13764
+ break;
13724
13765
  default:
13725
13766
  {
13726
13767
  // eslint-disable-next-line max-len