@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.
@@ -2933,6 +2933,27 @@ let DropDownList = class DropDownList extends DropDownBase {
2933
2933
  }
2934
2934
  this.initial = false;
2935
2935
  }
2936
+ else if (this.getModuleName() === 'autocomplete' && this.value && this.typedString === '' && !(this.dataSource instanceof DataManager)) {
2937
+ const checkFields = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
2938
+ const checkValue = list.some((x) => x[checkFields] === this.value);
2939
+ let query = new Query();
2940
+ if (!checkValue) {
2941
+ new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields, 'equal', this.value)))
2942
+ .then((e) => {
2943
+ if (e.result.length > 0) {
2944
+ this.value = checkFields !== '' ? e.result[0][this.fields.value].toString() : e.result[0].toString();
2945
+ this.addItem(e.result, list.length);
2946
+ this.updateValues();
2947
+ }
2948
+ else {
2949
+ this.updateValues();
2950
+ }
2951
+ });
2952
+ }
2953
+ else {
2954
+ this.updateValues();
2955
+ }
2956
+ }
2936
2957
  if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
2937
2958
  if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
2938
2959
  && !this.isFilterFocus) || (isNullOrUndefined(this.itemData) && this.allowFiltering)
@@ -5942,7 +5963,8 @@ let DropDownTree = class DropDownTree extends Component {
5942
5963
  }
5943
5964
  return 2;
5944
5965
  }
5945
- this.fields.dataSource = isNullOrUndefined(this.fields.dataSource) ? [] : this.fields.dataSource;
5966
+ if (isNullOrUndefined(this.fields.dataSource))
5967
+ this.fields.dataSource = [];
5946
5968
  for (let i = 0, len = this.fields.dataSource.length; i < len; i++) {
5947
5969
  if ((typeof field.child === 'string') && !isNullOrUndefined(getValue(field.child, this.fields.dataSource[i]))) {
5948
5970
  return 2;
@@ -11108,7 +11130,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11108
11130
  }
11109
11131
  }
11110
11132
  updateDataList() {
11111
- if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction)) {
11133
+ if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction || this.targetElement().trim())) {
11112
11134
  let isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
11113
11135
  let isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
11114
11136
  let 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));
@@ -13481,8 +13503,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13481
13503
  });
13482
13504
  }
13483
13505
  }
13484
- updateActionCompleteData(li, item, index) {
13485
- this.jsonData.splice(index, 0, item);
13506
+ updateActionCompleteData(li, item) {
13507
+ this.jsonData.push(item);
13486
13508
  }
13487
13509
  initToolbar() {
13488
13510
  const pos = this.toolbarSettings.position;
@@ -14020,7 +14042,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14020
14042
  let objValue;
14021
14043
  const dupData = [];
14022
14044
  let itemIdx;
14023
- extend(dupData, [], this.jsonData);
14045
+ extend(dupData, [], this.listData);
14024
14046
  const removeIdxes = [];
14025
14047
  const removeLiIdxes = [];
14026
14048
  for (let j = 0; j < items.length; j++) {
@@ -14795,7 +14817,19 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14795
14817
  .filter((data) => data.isHeader !== true);
14796
14818
  tListBox.listData = listData;
14797
14819
  tListBox.jsonData = jsonData;
14798
- fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
14820
+ if (this.listData.length == this.jsonData.length) {
14821
+ fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
14822
+ }
14823
+ else if (this.allowFiltering) {
14824
+ for (let i = 0; i < fListBox.listData.length; i++) {
14825
+ for (let j = 0; j < fListBox.jsonData.length; j++) {
14826
+ if (fListBox.listData[i] === fListBox.jsonData[j]) {
14827
+ fListBox.jsonData.splice(j, 1);
14828
+ }
14829
+ }
14830
+ }
14831
+ fListBox.listData = fListBox.sortedData = [];
14832
+ }
14799
14833
  if (isRefresh) {
14800
14834
  let sourceElem = tListBox.renderItems(listData, tListBox.fields);
14801
14835
  tListBox.updateListItems(sourceElem, tListBox.ulElement);