@syncfusion/ej2-dropdowns 19.4.48 → 19.4.54

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 (45) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +1 -1
  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 +82 -35
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +160 -107
  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 +11 -11
  13. package/src/combo-box/combo-box.js +4 -1
  14. package/src/drop-down-base/drop-down-base.js +18 -6
  15. package/src/drop-down-list/drop-down-list.js +106 -71
  16. package/src/drop-down-tree/drop-down-tree.js +6 -14
  17. package/src/list-box/list-box.js +4 -3
  18. package/src/multi-select/multi-select.js +19 -9
  19. package/styles/bootstrap-dark.css +10 -1
  20. package/styles/bootstrap.css +10 -1
  21. package/styles/bootstrap4.css +10 -1
  22. package/styles/bootstrap5-dark.css +10 -1
  23. package/styles/bootstrap5.css +10 -1
  24. package/styles/fabric-dark.css +10 -1
  25. package/styles/fabric.css +10 -1
  26. package/styles/highcontrast-light.css +10 -1
  27. package/styles/highcontrast.css +10 -1
  28. package/styles/material-dark.css +10 -1
  29. package/styles/material.css +10 -1
  30. package/styles/multi-select/_layout.scss +10 -1
  31. package/styles/multi-select/bootstrap-dark.css +10 -1
  32. package/styles/multi-select/bootstrap.css +10 -1
  33. package/styles/multi-select/bootstrap4.css +10 -1
  34. package/styles/multi-select/bootstrap5-dark.css +10 -1
  35. package/styles/multi-select/bootstrap5.css +10 -1
  36. package/styles/multi-select/fabric-dark.css +10 -1
  37. package/styles/multi-select/fabric.css +10 -1
  38. package/styles/multi-select/highcontrast-light.css +10 -1
  39. package/styles/multi-select/highcontrast.css +10 -1
  40. package/styles/multi-select/material-dark.css +10 -1
  41. package/styles/multi-select/material.css +10 -1
  42. package/styles/multi-select/tailwind-dark.css +10 -1
  43. package/styles/multi-select/tailwind.css +10 -1
  44. package/styles/tailwind-dark.css +10 -1
  45. package/styles/tailwind.css +10 -1
@@ -234,6 +234,7 @@ var HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';
234
234
  var FOOTERTEMPLATE_PROPERTY = 'FooterTemplate';
235
235
  var NORECORDSTEMPLATE_PROPERTY = 'NoRecordsTemplate';
236
236
  var ACTIONFAILURETEMPLATE_PROPERTY = 'ActionFailureTemplate';
237
+ var HIDE_GROUPLIST = 'e-hide-group-header';
237
238
  /**
238
239
  * DropDownBase component will generate the list items based on given data and act as base class to drop-down related components
239
240
  */
@@ -660,7 +661,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
660
661
  }
661
662
  _this.bindChildItems(localDataArgs.result, ulElement, fields);
662
663
  setTimeout(function () {
663
- if (_this.getModuleName() === 'multiselect' && _this.itemTemplate != null && (ulElement.childElementCount > 0 && ulElement.children[0].childElementCount > 0)) {
664
+ if (_this.getModuleName() === 'multiselect' && _this.itemTemplate != null && (ulElement.childElementCount > 0 && (ulElement.children[0].childElementCount > 0 || (_this.fields.groupBy && ulElement.children[1] && ulElement.children[1].childElementCount > 0)))) {
664
665
  _this.updateDataList();
665
666
  }
666
667
  });
@@ -747,12 +748,23 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
747
748
  if (this.isReact) {
748
749
  this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);
749
750
  }
750
- this.list.innerHTML = '';
751
751
  this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
752
- this.list.appendChild(ulElement);
753
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
754
- this.ulElement = this.list.querySelector('ul');
755
- this.postRender(this.list, list, this.bindEvent);
752
+ if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
753
+ for (var i = 0; i < ulElement.childElementCount; i++) {
754
+ if (ulElement.children[i].classList.contains('e-list-group-item')) {
755
+ if (isNullOrUndefined(ulElement.children[i].innerHTML) || ulElement.children[i].innerHTML == "") {
756
+ addClass([ulElement.children[i]], HIDE_GROUPLIST);
757
+ }
758
+ }
759
+ }
760
+ }
761
+ if (!isNullOrUndefined(this.list)) {
762
+ this.list.innerHTML = '';
763
+ this.list.appendChild(ulElement);
764
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
765
+ this.ulElement = this.list.querySelector('ul');
766
+ this.postRender(this.list, list, this.bindEvent);
767
+ }
756
768
  };
757
769
  /* eslint-disable @typescript-eslint/no-unused-vars */
758
770
  DropDownBase.prototype.postRender = function (listElement, list, bindEvent) {
@@ -3682,160 +3694,195 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3682
3694
  * @returns {void}
3683
3695
  */
3684
3696
  DropDownList.prototype.onPropertyChanged = function (newProp, oldProp) {
3697
+ var _this = this;
3685
3698
  if (this.getModuleName() === 'dropdownlist') {
3686
3699
  this.checkData(newProp);
3687
3700
  this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
3688
3701
  }
3689
- for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
3690
- var prop = _a[_i];
3702
+ var _loop_1 = function (prop) {
3691
3703
  switch (prop) {
3692
3704
  case 'query':
3693
3705
  case 'dataSource': break;
3694
3706
  case 'htmlAttributes':
3695
- this.setHTMLAttributes();
3707
+ this_1.setHTMLAttributes();
3696
3708
  break;
3697
3709
  case 'width':
3698
- this.setEleWidth(newProp.width);
3710
+ this_1.setEleWidth(newProp.width);
3699
3711
  break;
3700
3712
  case 'placeholder':
3701
- Input.setPlaceholder(newProp.placeholder, this.inputElement);
3713
+ Input.setPlaceholder(newProp.placeholder, this_1.inputElement);
3702
3714
  break;
3703
3715
  case 'filterBarPlaceholder':
3704
- if (this.filterInput) {
3705
- Input.setPlaceholder(newProp.filterBarPlaceholder, this.filterInput);
3716
+ if (this_1.filterInput) {
3717
+ Input.setPlaceholder(newProp.filterBarPlaceholder, this_1.filterInput);
3706
3718
  }
3707
3719
  break;
3708
3720
  case 'readonly':
3709
- if (this.getModuleName() !== 'dropdownlist') {
3710
- Input.setReadonly(newProp.readonly, this.inputElement);
3721
+ if (this_1.getModuleName() !== 'dropdownlist') {
3722
+ Input.setReadonly(newProp.readonly, this_1.inputElement);
3711
3723
  }
3712
- this.setReadOnly();
3724
+ this_1.setReadOnly();
3713
3725
  break;
3714
3726
  case 'cssClass':
3715
- this.setCssClass(newProp.cssClass, oldProp.cssClass);
3727
+ this_1.setCssClass(newProp.cssClass, oldProp.cssClass);
3716
3728
  break;
3717
3729
  case 'enableRtl':
3718
- this.setEnableRtl();
3730
+ this_1.setEnableRtl();
3719
3731
  break;
3720
3732
  case 'enabled':
3721
- this.setEnable();
3733
+ this_1.setEnable();
3722
3734
  break;
3723
3735
  case 'text':
3724
3736
  if (newProp.text === null) {
3725
- this.clearAll();
3737
+ this_1.clearAll();
3726
3738
  break;
3727
3739
  }
3728
- if (!this.list) {
3729
- if (this.dataSource instanceof DataManager) {
3730
- this.initRemoteRender = true;
3740
+ if (!this_1.list) {
3741
+ if (this_1.dataSource instanceof DataManager) {
3742
+ this_1.initRemoteRender = true;
3731
3743
  }
3732
- this.renderList();
3733
- }
3734
- if (!this.initRemoteRender) {
3735
- var li = this.getElementByText(newProp.text);
3736
- if (!this.checkValidLi(li)) {
3737
- if (this.liCollections && this.liCollections.length === 100 &&
3738
- this.getModuleName() === 'autocomplete' && this.listData.length > 100) {
3739
- this.setSelectionData(newProp.text, oldProp.text, 'text');
3744
+ this_1.renderList();
3745
+ }
3746
+ if (!this_1.initRemoteRender) {
3747
+ var li = this_1.getElementByText(newProp.text);
3748
+ if (!this_1.checkValidLi(li)) {
3749
+ if (this_1.liCollections && this_1.liCollections.length === 100 &&
3750
+ this_1.getModuleName() === 'autocomplete' && this_1.listData.length > 100) {
3751
+ this_1.setSelectionData(newProp.text, oldProp.text, 'text');
3752
+ }
3753
+ else if (newProp.text && this_1.dataSource instanceof DataManager) {
3754
+ var listLength_1 = this_1.getItems().length;
3755
+ var checkField = isNullOrUndefined(this_1.fields.text) ? this_1.fields.value : this_1.fields.text;
3756
+ this_1.typedString = '';
3757
+ this_1.dataSource.executeQuery(this_1.getQuery(this_1.query).where(new Predicate(checkField, 'equal', newProp.text)))
3758
+ .then(function (e) {
3759
+ if (e.result.length > 0) {
3760
+ _this.addItem(e.result, listLength_1);
3761
+ _this.updateValues();
3762
+ }
3763
+ else {
3764
+ _this.setOldText(oldProp.text);
3765
+ }
3766
+ });
3740
3767
  }
3741
3768
  else {
3742
- this.setOldText(oldProp.text);
3769
+ this_1.setOldText(oldProp.text);
3743
3770
  }
3744
3771
  }
3745
- this.updateInputFields();
3772
+ this_1.updateInputFields();
3746
3773
  }
3747
3774
  break;
3748
3775
  case 'value':
3749
3776
  if (newProp.value === null) {
3750
- this.clearAll();
3777
+ this_1.clearAll();
3751
3778
  break;
3752
3779
  }
3753
- this.notify('beforeValueChange', { newProp: newProp }); // gird component value type change
3754
- if (!this.list) {
3755
- if (this.dataSource instanceof DataManager) {
3756
- this.initRemoteRender = true;
3780
+ this_1.notify('beforeValueChange', { newProp: newProp }); // gird component value type change
3781
+ if (!this_1.list) {
3782
+ if (this_1.dataSource instanceof DataManager) {
3783
+ this_1.initRemoteRender = true;
3757
3784
  }
3758
- this.renderList();
3759
- }
3760
- if (!this.initRemoteRender) {
3761
- var item = this.getElementByValue(newProp.value);
3762
- if (!this.checkValidLi(item)) {
3763
- if (this.liCollections && this.liCollections.length === 100 &&
3764
- this.getModuleName() === 'autocomplete' && this.listData.length > 100) {
3765
- this.setSelectionData(newProp.value, oldProp.value, 'value');
3785
+ this_1.renderList();
3786
+ }
3787
+ if (!this_1.initRemoteRender) {
3788
+ var item = this_1.getElementByValue(newProp.value);
3789
+ if (!this_1.checkValidLi(item)) {
3790
+ if (this_1.liCollections && this_1.liCollections.length === 100 &&
3791
+ this_1.getModuleName() === 'autocomplete' && this_1.listData.length > 100) {
3792
+ this_1.setSelectionData(newProp.value, oldProp.value, 'value');
3793
+ }
3794
+ else if (newProp.value && this_1.dataSource instanceof DataManager) {
3795
+ var listLength_2 = this_1.getItems().length;
3796
+ var checkField = isNullOrUndefined(this_1.fields.value) ? this_1.fields.text : this_1.fields.value;
3797
+ this_1.typedString = '';
3798
+ this_1.dataSource.executeQuery(this_1.getQuery(this_1.query).where(new Predicate(checkField, 'equal', newProp.value)))
3799
+ .then(function (e) {
3800
+ if (e.result.length > 0) {
3801
+ _this.addItem(e.result, listLength_2);
3802
+ _this.updateValues();
3803
+ }
3804
+ else {
3805
+ _this.setOldValue(oldProp.value);
3806
+ }
3807
+ });
3766
3808
  }
3767
3809
  else {
3768
- this.setOldValue(oldProp.value);
3810
+ this_1.setOldValue(oldProp.value);
3769
3811
  }
3770
3812
  }
3771
- this.updateInputFields();
3772
- this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
3813
+ this_1.updateInputFields();
3814
+ this_1.preventChange = this_1.isAngular && this_1.preventChange ? !this_1.preventChange : this_1.preventChange;
3773
3815
  }
3774
3816
  break;
3775
3817
  case 'index':
3776
3818
  if (newProp.index === null) {
3777
- this.clearAll();
3819
+ this_1.clearAll();
3778
3820
  break;
3779
3821
  }
3780
- if (!this.list) {
3781
- if (this.dataSource instanceof DataManager) {
3782
- this.initRemoteRender = true;
3822
+ if (!this_1.list) {
3823
+ if (this_1.dataSource instanceof DataManager) {
3824
+ this_1.initRemoteRender = true;
3783
3825
  }
3784
- this.renderList();
3785
- }
3786
- if (!this.initRemoteRender && this.liCollections) {
3787
- var element = this.liCollections[newProp.index];
3788
- if (!this.checkValidLi(element)) {
3789
- if (this.liCollections && this.liCollections.length === 100 &&
3790
- this.getModuleName() === 'autocomplete' && this.listData.length > 100) {
3791
- this.setSelectionData(newProp.index, oldProp.index, 'index');
3826
+ this_1.renderList();
3827
+ }
3828
+ if (!this_1.initRemoteRender && this_1.liCollections) {
3829
+ var element = this_1.liCollections[newProp.index];
3830
+ if (!this_1.checkValidLi(element)) {
3831
+ if (this_1.liCollections && this_1.liCollections.length === 100 &&
3832
+ this_1.getModuleName() === 'autocomplete' && this_1.listData.length > 100) {
3833
+ this_1.setSelectionData(newProp.index, oldProp.index, 'index');
3792
3834
  }
3793
3835
  else {
3794
- this.index = oldProp.index;
3836
+ this_1.index = oldProp.index;
3795
3837
  }
3796
3838
  }
3797
- this.updateInputFields();
3839
+ this_1.updateInputFields();
3798
3840
  }
3799
3841
  break;
3800
3842
  case 'footerTemplate':
3801
- if (this.popupObj) {
3802
- this.setFooterTemplate(this.popupObj.element);
3843
+ if (this_1.popupObj) {
3844
+ this_1.setFooterTemplate(this_1.popupObj.element);
3803
3845
  }
3804
3846
  break;
3805
3847
  case 'headerTemplate':
3806
- if (this.popupObj) {
3807
- this.setHeaderTemplate(this.popupObj.element);
3848
+ if (this_1.popupObj) {
3849
+ this_1.setHeaderTemplate(this_1.popupObj.element);
3808
3850
  }
3809
3851
  break;
3810
3852
  case 'valueTemplate':
3811
- if (!isNullOrUndefined(this.itemData) && this.valueTemplate != null) {
3812
- this.setValueTemplate();
3853
+ if (!isNullOrUndefined(this_1.itemData) && this_1.valueTemplate != null) {
3854
+ this_1.setValueTemplate();
3813
3855
  }
3814
3856
  break;
3815
3857
  case 'allowFiltering':
3816
- if (this.allowFiltering) {
3817
- this.actionCompleteData = { ulElement: this.ulElement,
3818
- list: this.listData, isUpdated: true };
3819
- this.actionData = this.actionCompleteData;
3820
- this.updateSelectElementData(this.allowFiltering);
3858
+ if (this_1.allowFiltering) {
3859
+ this_1.actionCompleteData = { ulElement: this_1.ulElement,
3860
+ list: this_1.listData, isUpdated: true };
3861
+ this_1.actionData = this_1.actionCompleteData;
3862
+ this_1.updateSelectElementData(this_1.allowFiltering);
3821
3863
  }
3822
3864
  break;
3823
3865
  case 'floatLabelType':
3824
- Input.removeFloating(this.inputWrapper);
3825
- Input.addFloating(this.inputElement, newProp.floatLabelType, this.placeholder, this.createElement);
3866
+ Input.removeFloating(this_1.inputWrapper);
3867
+ Input.addFloating(this_1.inputElement, newProp.floatLabelType, this_1.placeholder, this_1.createElement);
3826
3868
  break;
3827
3869
  case 'showClearButton':
3828
- Input.setClearButton(newProp.showClearButton, this.inputElement, this.inputWrapper, null, this.createElement);
3829
- this.bindClearEvent();
3870
+ Input.setClearButton(newProp.showClearButton, this_1.inputElement, this_1.inputWrapper, null, this_1.createElement);
3871
+ this_1.bindClearEvent();
3830
3872
  break;
3831
3873
  default:
3832
3874
  {
3833
3875
  // eslint-disable-next-line max-len
3834
- var ddlProps = this.getPropObject(prop, newProp, oldProp);
3835
- _super.prototype.onPropertyChanged.call(this, ddlProps.newProperty, ddlProps.oldProperty);
3876
+ var ddlProps = this_1.getPropObject(prop, newProp, oldProp);
3877
+ _super.prototype.onPropertyChanged.call(this_1, ddlProps.newProperty, ddlProps.oldProperty);
3836
3878
  }
3837
3879
  break;
3838
3880
  }
3881
+ };
3882
+ var this_1 = this;
3883
+ for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
3884
+ var prop = _a[_i];
3885
+ _loop_1(prop);
3839
3886
  }
3840
3887
  };
3841
3888
  DropDownList.prototype.checkValidLi = function (element) {
@@ -5074,13 +5121,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5074
5121
  var l10nLocale = { overflowCountTemplate: '+${count} more..', totalCountTemplate: '${count} selected' };
5075
5122
  this.l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);
5076
5123
  var remainContent = this.l10n.getConstant('overflowCountTemplate');
5124
+ var totalContent = this.l10n.getConstant('totalCountTemplate');
5077
5125
  var remainElement = this.createElement('span', { className: REMAIN_WRAPPER });
5078
- // eslint-disable-next-line
5079
- var compiledString = compile(remainContent);
5080
- // eslint-disable-next-line
5081
- var totalCompiledString = compile(this.l10n.getConstant('totalCountTemplate'));
5082
- remainElement.appendChild(compiledString({ 'count': this.value.length }, this, 'overflowCountTemplate', null, !this.isStringTemplate)[0]);
5083
5126
  this.overFlowWrapper.appendChild(remainElement);
5127
+ remainElement.innerText = remainContent.replace('${count}', this.value.length.toString());
5084
5128
  var remainSize = remainElement.offsetWidth;
5085
5129
  remove(remainElement);
5086
5130
  if (this.showDropDownIcon) {
@@ -5162,7 +5206,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5162
5206
  }
5163
5207
  }
5164
5208
  if (remaining > 0) {
5165
- this.overFlowWrapper.appendChild(this.updateRemainTemplate(remainElement, remaining, compiledString, totalCompiledString));
5209
+ this.overFlowWrapper.appendChild(this.updateRemainTemplate(remainElement, remaining, remainContent, totalContent));
5166
5210
  }
5167
5211
  if (this.mode === 'Box' && !this.overFlowWrapper.classList.contains(TOTAL_COUNT_WRAPPER)) {
5168
5212
  addClass([remainElement], REMAIN_COUNT);
@@ -5174,19 +5218,14 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5174
5218
  }
5175
5219
  this.updateDelimMode();
5176
5220
  };
5177
- DropDownTree.prototype.updateRemainTemplate = function (remainElement, remaining,
5178
- // eslint-disable-next-line
5179
- compiledString,
5180
- // eslint-disable-next-line
5181
- totalCompiledString) {
5221
+ DropDownTree.prototype.updateRemainTemplate = function (remainElement, remaining, remainContent, totalContent) {
5182
5222
  if (this.overFlowWrapper.firstChild && this.overFlowWrapper.firstChild.nodeType === 3 &&
5183
5223
  this.overFlowWrapper.firstChild.nodeValue === '') {
5184
5224
  this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild);
5185
5225
  }
5186
5226
  remainElement.innerHTML = '';
5187
- remainElement.appendChild((this.overFlowWrapper.firstChild && (this.overFlowWrapper.firstChild.nodeType === 3 || this.mode === 'Box')) ?
5188
- compiledString({ 'count': remaining }, this, 'overflowCountTemplate', null, !this.isStringTemplate)[0] :
5189
- totalCompiledString({ 'count': remaining }, this, 'totalCountTemplate', null, !this.isStringTemplate)[0]);
5227
+ remainElement.innerText = (this.overFlowWrapper.firstChild && (this.overFlowWrapper.firstChild.nodeType === 3 || this.mode === 'Box')) ?
5228
+ remainContent.replace('${count}', remaining.toString()) : totalContent.replace('${count}', remaining.toString());
5190
5229
  if (this.overFlowWrapper.firstChild && (this.overFlowWrapper.firstChild.nodeType === 3 || this.mode === 'Box')) {
5191
5230
  removeClass([this.overFlowWrapper], TOTAL_COUNT_WRAPPER);
5192
5231
  }
@@ -7547,12 +7586,15 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7547
7586
  };
7548
7587
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
7549
7588
  ComboBox.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
7589
+ var _this = this;
7550
7590
  _super.prototype.onActionComplete.call(this, ulElement, list, e);
7551
7591
  if (this.isSelectCustom) {
7552
7592
  this.removeSelection();
7553
7593
  }
7554
7594
  if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped) {
7555
- this.inlineSearch();
7595
+ setTimeout(function () {
7596
+ _this.inlineSearch();
7597
+ });
7556
7598
  }
7557
7599
  };
7558
7600
  ComboBox.prototype.getFocusElement = function () {
@@ -9058,7 +9100,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9058
9100
  return ariaAttributes;
9059
9101
  };
9060
9102
  MultiSelect.prototype.updateListARIA = function () {
9061
- attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
9103
+ if (!isNullOrUndefined(this.ulElement)) {
9104
+ attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
9105
+ }
9062
9106
  var disableStatus = (this.inputElement.disabled) ? true : false;
9063
9107
  attributes(this.inputElement, this.getAriaAttributes());
9064
9108
  if (disableStatus) {
@@ -9218,7 +9262,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9218
9262
  addClass([listEle[0]], dropDownBaseClasses.focus);
9219
9263
  }
9220
9264
  else {
9221
- this.ulElement = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;
9265
+ //EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
9222
9266
  if (!(this.list && this.list.querySelectorAll('.' + dropDownBaseClasses.li).length > 0)) {
9223
9267
  this.l10nUpdate();
9224
9268
  addClass([this.list], dropDownBaseClasses.noData);
@@ -11192,8 +11236,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11192
11236
  }
11193
11237
  };
11194
11238
  MultiSelect.prototype.updateDataList = function () {
11195
- if (this.mainList && this.ulElement && (this.mainList.childElementCount < this.ulElement.childElementCount || ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount)))) {
11196
- this.mainList = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;
11239
+ if (this.mainList && this.ulElement) {
11240
+ var isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
11241
+ var isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
11242
+ var isAngularTemplateUpdate = this.itemTemplate && this.ulElement.childElementCount > 0 && (this.ulElement.children[0].childElementCount > 0 || (this.fields.groupBy && this.ulElement.children[1] && this.ulElement.children[1].childElementCount > 0));
11243
+ if (isDynamicGroupItemUpdate || isReactTemplateUpdate || isAngularTemplateUpdate) {
11244
+ this.mainList = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;
11245
+ }
11197
11246
  }
11198
11247
  };
11199
11248
  MultiSelect.prototype.isValidLI = function (li) {
@@ -11542,11 +11591,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11542
11591
  }
11543
11592
  };
11544
11593
  MultiSelect.prototype.wireListEvents = function () {
11545
- EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
11546
- EventHandler.add(this.list, 'mousedown', this.onListMouseDown, this);
11547
- EventHandler.add(this.list, 'mouseup', this.onMouseClick, this);
11548
- EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
11549
- EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
11594
+ if (!isNullOrUndefined(this.list)) {
11595
+ EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
11596
+ EventHandler.add(this.list, 'mousedown', this.onListMouseDown, this);
11597
+ EventHandler.add(this.list, 'mouseup', this.onMouseClick, this);
11598
+ EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
11599
+ EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
11600
+ }
11550
11601
  };
11551
11602
  MultiSelect.prototype.unwireListEvents = function () {
11552
11603
  EventHandler.remove(document, 'mousedown', this.onDocumentClick);
@@ -12676,6 +12727,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12676
12727
  this.mainData = null;
12677
12728
  this.filterParent = null;
12678
12729
  this.ulElement = null;
12730
+ this.mainListCollection = null;
12679
12731
  _super.prototype.destroy.call(this);
12680
12732
  var temp = ['readonly', 'aria-disabled', 'aria-placeholder', 'placeholder'];
12681
12733
  var length = temp.length;
@@ -14129,9 +14181,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14129
14181
  }
14130
14182
  if (objValue === dataValue) {
14131
14183
  itemIdx = this.getIndexByValue(dataValue);
14132
- liCollections.push(liElement[itemIdx]);
14133
- removeIdxes.push(i);
14134
- removeLiIdxes.push(itemIdx);
14184
+ var idx = itemIdx === i ? itemIdx : i;
14185
+ liCollections.push(liElement[idx]);
14186
+ removeIdxes.push(idx);
14187
+ removeLiIdxes.push(idx);
14135
14188
  }
14136
14189
  }
14137
14190
  }