@syncfusion/ej2-dropdowns 19.4.41 → 19.4.50

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 (68) hide show
  1. package/CHANGELOG.md +20 -0
  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 +61 -7
  5. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es5.js +138 -79
  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 +11 -11
  12. package/src/drop-down-base/drop-down-base.js +12 -1
  13. package/src/drop-down-list/drop-down-list.js +107 -72
  14. package/src/list-box/list-box.js +4 -3
  15. package/src/multi-select/multi-select.js +12 -0
  16. package/styles/bootstrap-dark.css +18 -4
  17. package/styles/bootstrap.css +18 -4
  18. package/styles/bootstrap4.css +18 -4
  19. package/styles/bootstrap5-dark.css +18 -4
  20. package/styles/bootstrap5.css +18 -4
  21. package/styles/fabric-dark.css +18 -4
  22. package/styles/fabric.css +18 -4
  23. package/styles/highcontrast-light.css +18 -4
  24. package/styles/highcontrast.css +18 -4
  25. package/styles/list-box/_bootstrap-dark-definition.scss +3 -0
  26. package/styles/list-box/_bootstrap-definition.scss +3 -0
  27. package/styles/list-box/_bootstrap4-definition.scss +3 -0
  28. package/styles/list-box/_bootstrap5-definition.scss +3 -0
  29. package/styles/list-box/_fabric-dark-definition.scss +3 -0
  30. package/styles/list-box/_fabric-definition.scss +3 -0
  31. package/styles/list-box/_fluent-definition.scss +3 -0
  32. package/styles/list-box/_highcontrast-definition.scss +3 -0
  33. package/styles/list-box/_highcontrast-light-definition.scss +3 -0
  34. package/styles/list-box/_material-dark-definition.scss +3 -0
  35. package/styles/list-box/_material-definition.scss +3 -0
  36. package/styles/list-box/_tailwind-definition.scss +3 -0
  37. package/styles/list-box/_theme.scss +8 -0
  38. package/styles/list-box/bootstrap-dark.css +10 -0
  39. package/styles/list-box/bootstrap.css +10 -0
  40. package/styles/list-box/bootstrap4.css +10 -0
  41. package/styles/list-box/bootstrap5-dark.css +10 -0
  42. package/styles/list-box/bootstrap5.css +10 -0
  43. package/styles/list-box/fabric-dark.css +10 -0
  44. package/styles/list-box/fabric.css +10 -0
  45. package/styles/list-box/highcontrast-light.css +10 -0
  46. package/styles/list-box/highcontrast.css +10 -0
  47. package/styles/list-box/material-dark.css +10 -0
  48. package/styles/list-box/material.css +10 -0
  49. package/styles/list-box/tailwind-dark.css +10 -0
  50. package/styles/list-box/tailwind.css +10 -0
  51. package/styles/material-dark.css +18 -4
  52. package/styles/material.css +18 -4
  53. package/styles/multi-select/_layout.scss +6 -4
  54. package/styles/multi-select/bootstrap-dark.css +8 -4
  55. package/styles/multi-select/bootstrap.css +8 -4
  56. package/styles/multi-select/bootstrap4.css +8 -4
  57. package/styles/multi-select/bootstrap5-dark.css +8 -4
  58. package/styles/multi-select/bootstrap5.css +8 -4
  59. package/styles/multi-select/fabric-dark.css +8 -4
  60. package/styles/multi-select/fabric.css +8 -4
  61. package/styles/multi-select/highcontrast-light.css +8 -4
  62. package/styles/multi-select/highcontrast.css +8 -4
  63. package/styles/multi-select/material-dark.css +8 -4
  64. package/styles/multi-select/material.css +8 -4
  65. package/styles/multi-select/tailwind-dark.css +8 -4
  66. package/styles/multi-select/tailwind.css +8 -4
  67. package/styles/tailwind-dark.css +18 -4
  68. package/styles/tailwind.css +18 -4
@@ -216,6 +216,7 @@ const HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';
216
216
  const FOOTERTEMPLATE_PROPERTY = 'FooterTemplate';
217
217
  const NORECORDSTEMPLATE_PROPERTY = 'NoRecordsTemplate';
218
218
  const ACTIONFAILURETEMPLATE_PROPERTY = 'ActionFailureTemplate';
219
+ const HIDE_GROUPLIST = 'e-hide-group-header';
219
220
  /**
220
221
  * DropDownBase component will generate the list items based on given data and act as base class to drop-down related components
221
222
  */
@@ -724,6 +725,15 @@ let DropDownBase = class DropDownBase extends Component {
724
725
  }
725
726
  this.list.innerHTML = '';
726
727
  this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
728
+ if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
729
+ for (let i = 0; i < ulElement.childElementCount; i++) {
730
+ if (ulElement.children[i].classList.contains('e-list-group-item')) {
731
+ if (isNullOrUndefined(ulElement.children[i].innerHTML) || ulElement.children[i].innerHTML == "") {
732
+ addClass([ulElement.children[i]], HIDE_GROUPLIST);
733
+ }
734
+ }
735
+ }
736
+ }
727
737
  this.list.appendChild(ulElement);
728
738
  this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
729
739
  this.ulElement = this.list.querySelector('ul');
@@ -772,7 +782,7 @@ let DropDownBase = class DropDownBase extends Component {
772
782
  const tempHeaders = ListBase.renderGroupTemplate(groupValue, dataSource, this.fields.properties, headerItems, option, this);
773
783
  //EJ2-55168- Group checkbox is not working with group template
774
784
  if (this.isGroupChecking) {
775
- for (var i = 0; i < tempHeaders.length; i++) {
785
+ for (let i = 0; i < tempHeaders.length; i++) {
776
786
  this.notify('addItem', { module: 'CheckBoxSelection', item: tempHeaders[i] });
777
787
  }
778
788
  }
@@ -782,7 +792,7 @@ let DropDownBase = class DropDownBase extends Component {
782
792
  const tempHeaders = ListBase.renderGroupTemplate(this.groupTemplate, dataSource, this.fields.properties, headerItems, option, this);
783
793
  //EJ2-55168- Group checkbox is not working with group template
784
794
  if (this.isGroupChecking) {
785
- for (var i = 0; i < tempHeaders.length; i++) {
795
+ for (let i = 0; i < tempHeaders.length; i++) {
786
796
  this.notify('addItem', { module: 'CheckBoxSelection', item: tempHeaders[i] });
787
797
  }
788
798
  }
@@ -1199,7 +1209,8 @@ let DropDownBase = class DropDownBase extends Component {
1199
1209
  li.innerText = itemText;
1200
1210
  }
1201
1211
  if (this.itemTemplate && !isHeader) {
1202
- const compiledString = compile(this.itemTemplate);
1212
+ const itemCheck = this.templateCompiler(this.itemTemplate);
1213
+ const compiledString = itemCheck ? compile(select(this.itemTemplate, document).innerHTML.trim()) : compile(this.itemTemplate);
1203
1214
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1204
1215
  const addItemTemplate = compiledString(item, this, 'itemTemplate', this.itemTemplateId, this.isStringTemplate, null, li);
1205
1216
  if (addItemTemplate) {
@@ -3608,7 +3619,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3608
3619
  checkCustomValue() {
3609
3620
  this.itemData = this.getDataByValue(this.value);
3610
3621
  const dataItem = this.getItemData();
3611
- this.setProperties({ 'value': dataItem.value, 'text': dataItem.text });
3622
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
3612
3623
  }
3613
3624
  updateInputFields() {
3614
3625
  if (this.getModuleName() === 'dropdownlist') {
@@ -3679,6 +3690,21 @@ let DropDownList = class DropDownList extends DropDownBase {
3679
3690
  this.getModuleName() === 'autocomplete' && this.listData.length > 100) {
3680
3691
  this.setSelectionData(newProp.text, oldProp.text, 'text');
3681
3692
  }
3693
+ else if (newProp.text && this.dataSource instanceof DataManager) {
3694
+ const listLength = this.getItems().length;
3695
+ const checkField = isNullOrUndefined(this.fields.text) ? this.fields.value : this.fields.text;
3696
+ this.typedString = '';
3697
+ this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', newProp.text)))
3698
+ .then((e) => {
3699
+ if (e.result.length > 0) {
3700
+ this.addItem(e.result, listLength);
3701
+ this.updateValues();
3702
+ }
3703
+ else {
3704
+ this.setOldText(oldProp.text);
3705
+ }
3706
+ });
3707
+ }
3682
3708
  else {
3683
3709
  this.setOldText(oldProp.text);
3684
3710
  }
@@ -3705,6 +3731,21 @@ let DropDownList = class DropDownList extends DropDownBase {
3705
3731
  this.getModuleName() === 'autocomplete' && this.listData.length > 100) {
3706
3732
  this.setSelectionData(newProp.value, oldProp.value, 'value');
3707
3733
  }
3734
+ else if (newProp.value && this.dataSource instanceof DataManager) {
3735
+ const listLength = this.getItems().length;
3736
+ const checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
3737
+ this.typedString = '';
3738
+ this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', newProp.value)))
3739
+ .then((e) => {
3740
+ if (e.result.length > 0) {
3741
+ this.addItem(e.result, listLength);
3742
+ this.updateValues();
3743
+ }
3744
+ else {
3745
+ this.setOldValue(oldProp.value);
3746
+ }
3747
+ });
3748
+ }
3708
3749
  else {
3709
3750
  this.setOldValue(oldProp.value);
3710
3751
  }
@@ -12048,6 +12089,17 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12048
12089
  this.notify('selectAllText', false);
12049
12090
  break;
12050
12091
  case 'popupHeight':
12092
+ if (this.popupObj) {
12093
+ let overAllHeight = parseInt(this.popupHeight, 10);
12094
+ if (this.popupHeight !== 'auto') {
12095
+ this.list.style.maxHeight = formatUnit(overAllHeight);
12096
+ this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
12097
+ }
12098
+ else {
12099
+ this.list.style.maxHeight = formatUnit(this.popupHeight);
12100
+ }
12101
+ }
12102
+ break;
12051
12103
  case 'headerTemplate':
12052
12104
  case 'footerTemplate':
12053
12105
  this.reInitializePoup();
@@ -12497,6 +12549,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12497
12549
  this.mainData = null;
12498
12550
  this.filterParent = null;
12499
12551
  this.ulElement = null;
12552
+ this.mainListCollection = null;
12500
12553
  super.destroy();
12501
12554
  const temp = ['readonly', 'aria-disabled', 'aria-placeholder', 'placeholder'];
12502
12555
  let length = temp.length;
@@ -13913,9 +13966,10 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13913
13966
  }
13914
13967
  if (objValue === dataValue) {
13915
13968
  itemIdx = this.getIndexByValue(dataValue);
13916
- liCollections.push(liElement[itemIdx]);
13917
- removeIdxes.push(i);
13918
- removeLiIdxes.push(itemIdx);
13969
+ const idx = itemIdx === i ? itemIdx : i;
13970
+ liCollections.push(liElement[idx]);
13971
+ removeIdxes.push(idx);
13972
+ removeLiIdxes.push(idx);
13919
13973
  }
13920
13974
  }
13921
13975
  }