@syncfusion/ej2-dropdowns 20.2.39 → 20.2.40

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.
@@ -2983,6 +2983,27 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2983
2983
  }
2984
2984
  this.initial = false;
2985
2985
  }
2986
+ else if (this.getModuleName() === 'autocomplete' && this.value && this.typedString === '' && !(this.dataSource instanceof DataManager)) {
2987
+ var checkFields_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
2988
+ var checkValue = list.some(function (x) { return x[checkFields_1] === _this.value; });
2989
+ var query = new Query();
2990
+ if (!checkValue) {
2991
+ new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1, 'equal', this.value)))
2992
+ .then(function (e) {
2993
+ if (e.result.length > 0) {
2994
+ _this.value = checkFields_1 !== '' ? e.result[0][_this.fields.value].toString() : e.result[0].toString();
2995
+ _this.addItem(e.result, list.length);
2996
+ _this.updateValues();
2997
+ }
2998
+ else {
2999
+ _this.updateValues();
3000
+ }
3001
+ });
3002
+ }
3003
+ else {
3004
+ this.updateValues();
3005
+ }
3006
+ }
2986
3007
  if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
2987
3008
  if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
2988
3009
  && !this.isFilterFocus) || (isNullOrUndefined(this.itemData) && this.allowFiltering)
@@ -6042,7 +6063,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6042
6063
  }
6043
6064
  return 2;
6044
6065
  }
6045
- this.fields.dataSource = isNullOrUndefined(this.fields.dataSource) ? [] : this.fields.dataSource;
6066
+ if (isNullOrUndefined(this.fields.dataSource))
6067
+ this.fields.dataSource = [];
6046
6068
  for (var i = 0, len = this.fields.dataSource.length; i < len; i++) {
6047
6069
  if ((typeof field.child === 'string') && !isNullOrUndefined(getValue(field.child, this.fields.dataSource[i]))) {
6048
6070
  return 2;
@@ -11271,7 +11293,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11271
11293
  }
11272
11294
  };
11273
11295
  MultiSelect.prototype.updateDataList = function () {
11274
- if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction)) {
11296
+ if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction || this.targetElement().trim())) {
11275
11297
  var isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
11276
11298
  var isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
11277
11299
  var isAngularTemplateUpdate = this.itemTemplate && this.ulElement.childElementCount > 0 && !(this.ulElement.childElementCount < this.mainList.childElementCount) && (this.ulElement.children[0].childElementCount > 0 || (this.fields.groupBy && this.ulElement.children[1] && this.ulElement.children[1].childElementCount > 0));
@@ -13685,8 +13707,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13685
13707
  });
13686
13708
  }
13687
13709
  };
13688
- ListBox.prototype.updateActionCompleteData = function (li, item, index) {
13689
- this.jsonData.splice(index, 0, item);
13710
+ ListBox.prototype.updateActionCompleteData = function (li, item) {
13711
+ this.jsonData.push(item);
13690
13712
  };
13691
13713
  ListBox.prototype.initToolbar = function () {
13692
13714
  var pos = this.toolbarSettings.position;
@@ -14231,7 +14253,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14231
14253
  var objValue = void 0;
14232
14254
  var dupData = [];
14233
14255
  var itemIdx = void 0;
14234
- extend(dupData, [], this.jsonData);
14256
+ extend(dupData, [], this.listData);
14235
14257
  var removeIdxes = [];
14236
14258
  var removeLiIdxes = [];
14237
14259
  for (var j = 0; j < items.length; j++) {
@@ -15020,7 +15042,19 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15020
15042
  .filter(function (data) { return data.isHeader !== true; });
15021
15043
  tListBox.listData = listData;
15022
15044
  tListBox.jsonData = jsonData;
15023
- fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
15045
+ if (this.listData.length == this.jsonData.length) {
15046
+ fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
15047
+ }
15048
+ else if (this.allowFiltering) {
15049
+ for (var i = 0; i < fListBox.listData.length; i++) {
15050
+ for (var j = 0; j < fListBox.jsonData.length; j++) {
15051
+ if (fListBox.listData[i] === fListBox.jsonData[j]) {
15052
+ fListBox.jsonData.splice(j, 1);
15053
+ }
15054
+ }
15055
+ }
15056
+ fListBox.listData = fListBox.sortedData = [];
15057
+ }
15024
15058
  if (isRefresh) {
15025
15059
  var sourceElem = tListBox.renderItems(listData, tListBox.fields);
15026
15060
  tListBox.updateListItems(sourceElem, tListBox.ulElement);