@syncfusion/ej2-dropdowns 22.2.8 → 22.2.9

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.
@@ -283,6 +283,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
283
283
  _this.isDynamicDataChange = false;
284
284
  _this.addedNewItem = false;
285
285
  _this.isAddNewItemTemplate = false;
286
+ _this.isRequesting = false;
286
287
  return _this;
287
288
  }
288
289
  DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
@@ -666,61 +667,67 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
666
667
  this.isActive = true;
667
668
  var eventArgs = { cancel: false, data: dataSource, query: query };
668
669
  this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
669
- this.trigger('actionBegin', eventArgs, function (eventArgs) {
670
- if (!eventArgs.cancel) {
671
- _this.showSpinner();
672
- if (dataSource instanceof DataManager) {
673
- _this.isRequested = true;
674
- if (_this.isDataFetched) {
675
- _this.emptyDataRequest(fields);
676
- return;
670
+ if (!this.isRequesting) {
671
+ this.trigger('actionBegin', eventArgs, function (eventArgs) {
672
+ if (!eventArgs.cancel) {
673
+ _this.isRequesting = true;
674
+ _this.showSpinner();
675
+ if (dataSource instanceof DataManager) {
676
+ _this.isRequested = true;
677
+ if (_this.isDataFetched) {
678
+ _this.emptyDataRequest(fields);
679
+ return;
680
+ }
681
+ eventArgs.data.executeQuery(_this.getQuery(eventArgs.query)).then(function (e) {
682
+ _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
683
+ _this.trigger('actionComplete', e, function (e) {
684
+ if (!e.cancel) {
685
+ _this.isRequesting = false;
686
+ var listItems = e.result;
687
+ if (listItems.length === 0) {
688
+ _this.isDataFetched = true;
689
+ }
690
+ ulElement = _this.renderItems(listItems, fields);
691
+ _this.onActionComplete(ulElement, listItems, e);
692
+ if (_this.groupTemplate) {
693
+ _this.renderGroupTemplate(ulElement);
694
+ }
695
+ _this.isRequested = false;
696
+ _this.bindChildItems(listItems, ulElement, fields, e);
697
+ }
698
+ });
699
+ }).catch(function (e) {
700
+ _this.isRequested = false;
701
+ _this.isRequesting = false;
702
+ _this.onActionFailure(e);
703
+ _this.hideSpinner();
704
+ });
677
705
  }
678
- eventArgs.data.executeQuery(_this.getQuery(eventArgs.query)).then(function (e) {
706
+ else {
707
+ var dataManager = new DataManager(eventArgs.data);
708
+ var listItems = (_this.getQuery(eventArgs.query)).executeLocal(dataManager);
709
+ var localDataArgs = { cancel: false, result: listItems };
679
710
  _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
680
- _this.trigger('actionComplete', e, function (e) {
681
- if (!e.cancel) {
682
- var listItems = e.result;
683
- if (listItems.length === 0) {
684
- _this.isDataFetched = true;
685
- }
686
- ulElement = _this.renderItems(listItems, fields);
687
- _this.onActionComplete(ulElement, listItems, e);
711
+ _this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
712
+ if (!localDataArgs.cancel) {
713
+ _this.isRequesting = false;
714
+ ulElement = _this.renderItems(localDataArgs.result, fields);
715
+ _this.onActionComplete(ulElement, localDataArgs.result, event);
688
716
  if (_this.groupTemplate) {
689
717
  _this.renderGroupTemplate(ulElement);
690
718
  }
691
- _this.isRequested = false;
692
- _this.bindChildItems(listItems, ulElement, fields, e);
719
+ _this.bindChildItems(localDataArgs.result, ulElement, fields);
720
+ setTimeout(function () {
721
+ 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)))) {
722
+ _this.updateDataList();
723
+ }
724
+ });
693
725
  }
694
726
  });
695
- }).catch(function (e) {
696
- _this.isRequested = false;
697
- _this.onActionFailure(e);
698
- _this.hideSpinner();
699
- });
700
- }
701
- else {
702
- var dataManager = new DataManager(eventArgs.data);
703
- var listItems = (_this.getQuery(eventArgs.query)).executeLocal(dataManager);
704
- var localDataArgs = { cancel: false, result: listItems };
705
- _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
706
- _this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
707
- if (!localDataArgs.cancel) {
708
- ulElement = _this.renderItems(localDataArgs.result, fields);
709
- _this.onActionComplete(ulElement, localDataArgs.result, event);
710
- if (_this.groupTemplate) {
711
- _this.renderGroupTemplate(ulElement);
712
- }
713
- _this.bindChildItems(localDataArgs.result, ulElement, fields);
714
- setTimeout(function () {
715
- 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)))) {
716
- _this.updateDataList();
717
- }
718
- });
719
- }
720
- });
727
+ }
721
728
  }
722
- }
723
- });
729
+ });
730
+ }
724
731
  };
725
732
  DropDownBase.prototype.bindChildItems = function (listItems, ulElement, fields, e) {
726
733
  var _this = this;
@@ -3049,7 +3056,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3049
3056
  this.isNotSearchList = false;
3050
3057
  return;
3051
3058
  }
3052
- if (this.isActive) {
3059
+ if (this.isActive || !isNullOrUndefined(ulElement)) {
3053
3060
  var selectedItem = this.selectedLI ? this.selectedLI.cloneNode(true) : null;
3054
3061
  _super.prototype.onActionComplete.call(this, ulElement, list, e);
3055
3062
  this.updateSelectElementData(this.allowFiltering);
@@ -3762,7 +3769,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3762
3769
  DropDownList.prototype.setFooterTemplate = function (popupEle) {
3763
3770
  var compiledString;
3764
3771
  if (this.footer) {
3765
- if (this.isReact) {
3772
+ if (this.isReact && typeof this.footerTemplate === 'function') {
3766
3773
  this.clearTemplate(['footerTemplate']);
3767
3774
  }
3768
3775
  else {
@@ -3848,6 +3855,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3848
3855
  if (this.allowFiltering && newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))) {
3849
3856
  this.actionCompleteData = { ulElement: null, list: null, isUpdated: false };
3850
3857
  this.actionData = this.actionCompleteData;
3858
+ this.itemData = null;
3851
3859
  }
3852
3860
  else if (this.allowFiltering && newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
3853
3861
  this.actionCompleteData = this.getModuleName() === 'combobox' ?
@@ -4355,6 +4363,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4355
4363
  if (this.inputElement && !isNullOrUndefined(this.inputElement.onchange)) {
4356
4364
  this.inputElement.onchange = null;
4357
4365
  }
4366
+ if (this.isAngular) {
4367
+ this.inputElement = null;
4368
+ }
4358
4369
  _super.prototype.destroy.call(this);
4359
4370
  };
4360
4371
  /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
@@ -7910,7 +7921,8 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7910
7921
  };
7911
7922
  ComboBox.prototype.setSearchBox = function () {
7912
7923
  this.filterInput = this.inputElement;
7913
- return (this.isFiltering() ? this.inputWrapper : inputObject$1);
7924
+ var searchBoxContainer = (this.isFiltering() || (this.isReact && this.getModuleName() === 'combobox')) ? this.inputWrapper : inputObject$1;
7925
+ return searchBoxContainer;
7914
7926
  };
7915
7927
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
7916
7928
  ComboBox.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {