@syncfusion/ej2-dropdowns 28.1.36 → 28.1.37

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.
@@ -544,8 +544,8 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
544
544
  if (this.parent.hideSelectedItem) {
545
545
  var query = this.parent.value && this.parent.value.length > 0 ?
546
546
  this.parent.getForQuery(this.parent.value).clone() : new Query;
547
- if (this.parent.viewPortInfo.endIndex === this.parent.totalItemCount + this.parent.value.length &&
548
- this.parent.hideSelectedItem) {
547
+ if (this.parent.value && (this.parent.viewPortInfo.endIndex === this.parent.totalItemCount +
548
+ this.parent.value.length) && this.parent.hideSelectedItem) {
549
549
  query = query.skip(this.parent.totalItemCount - this.parent.itemCount);
550
550
  }
551
551
  else {
@@ -1029,58 +1029,60 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1029
1029
  if (isTextByValue) {
1030
1030
  value = text;
1031
1031
  }
1032
- var dataSource = this.listData;
1033
- var fields = this.fields;
1034
- var type = this.typeOfData(dataSource).typeof;
1035
- if (type === 'string' || type === 'number' || type === 'boolean') {
1036
- for (var _i = 0, dataSource_1 = dataSource; _i < dataSource_1.length; _i++) {
1037
- var item = dataSource_1[_i];
1038
- if (!isNullOrUndefined(item)) {
1039
- if (ignoreAccent) {
1040
- value = this.checkingAccent(String(item), text, ignoreCase);
1041
- }
1042
- else {
1043
- if (ignoreCase) {
1044
- if (this.checkIgnoreCase(String(item), text)) {
1045
- value = this.getItemValue(String(item), text, ignoreCase);
1046
- }
1032
+ if (!isNullOrUndefined(this.listData)) {
1033
+ var dataSource = this.listData;
1034
+ var fields_1 = this.fields;
1035
+ var type = this.typeOfData(dataSource).typeof;
1036
+ if (type === 'string' || type === 'number' || type === 'boolean') {
1037
+ for (var _i = 0, dataSource_1 = dataSource; _i < dataSource_1.length; _i++) {
1038
+ var item = dataSource_1[_i];
1039
+ if (!isNullOrUndefined(item)) {
1040
+ if (ignoreAccent) {
1041
+ value = this.checkingAccent(String(item), text, ignoreCase);
1047
1042
  }
1048
1043
  else {
1049
- if (this.checkNonIgnoreCase(String(item), text)) {
1050
- value = this.getItemValue(String(item), text, ignoreCase, isTextByValue);
1044
+ if (ignoreCase) {
1045
+ if (this.checkIgnoreCase(String(item), text)) {
1046
+ value = this.getItemValue(String(item), text, ignoreCase);
1047
+ }
1048
+ }
1049
+ else {
1050
+ if (this.checkNonIgnoreCase(String(item), text)) {
1051
+ value = this.getItemValue(String(item), text, ignoreCase, isTextByValue);
1052
+ }
1051
1053
  }
1052
1054
  }
1053
1055
  }
1054
1056
  }
1055
1057
  }
1056
- }
1057
- else {
1058
- if (ignoreCase) {
1059
- dataSource.filter(function (item) {
1060
- var itemValue = getValue(fields.value, item);
1061
- if (!isNullOrUndefined(itemValue) && _this.checkIgnoreCase(getValue(fields.text, item).toString(), text)) {
1062
- value = getValue(fields.value, item);
1063
- }
1064
- });
1065
- }
1066
1058
  else {
1067
- if (isTextByValue) {
1068
- var compareValue_1 = null;
1069
- compareValue_1 = value;
1059
+ if (ignoreCase) {
1070
1060
  dataSource.filter(function (item) {
1071
- var itemValue = getValue(fields.value, item);
1072
- if (!isNullOrUndefined(itemValue) && !isNullOrUndefined(value) &&
1073
- itemValue.toString() === compareValue_1.toString()) {
1074
- value = getValue(fields.text, item);
1061
+ var itemValue = getValue(fields_1.value, item);
1062
+ if (!isNullOrUndefined(itemValue) && _this.checkIgnoreCase(getValue(fields_1.text, item).toString(), text)) {
1063
+ value = getValue(fields_1.value, item);
1075
1064
  }
1076
1065
  });
1077
1066
  }
1078
1067
  else {
1079
- dataSource.filter(function (item) {
1080
- if (_this.checkNonIgnoreCase(getValue(fields.text, item), text)) {
1081
- value = getValue(fields.value, item);
1082
- }
1083
- });
1068
+ if (isTextByValue) {
1069
+ var compareValue_1 = null;
1070
+ compareValue_1 = value;
1071
+ dataSource.filter(function (item) {
1072
+ var itemValue = getValue(fields_1.value, item);
1073
+ if (!isNullOrUndefined(itemValue) && !isNullOrUndefined(value) &&
1074
+ itemValue.toString() === compareValue_1.toString()) {
1075
+ value = getValue(fields_1.text, item);
1076
+ }
1077
+ });
1078
+ }
1079
+ else {
1080
+ dataSource.filter(function (item) {
1081
+ if (_this.checkNonIgnoreCase(getValue(fields_1.text, item), text)) {
1082
+ value = getValue(fields_1.value, item);
1083
+ }
1084
+ });
1085
+ }
1084
1086
  }
1085
1087
  }
1086
1088
  }
@@ -1605,7 +1607,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1605
1607
  _this.isRequested = false;
1606
1608
  _this.bindChildItems(listItems, ulElement, fields, e);
1607
1609
  if (_this.getInitialData) {
1608
- _this.setListData(dataSource, fields, query, event);
1609
1610
  _this.getInitialData = false;
1610
1611
  _this.preventPopupOpen = false;
1611
1612
  return;
@@ -2000,7 +2001,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
2000
2001
  };
2001
2002
  DropDownBase.prototype.scrollStop = function (e, isDownkey) {
2002
2003
  var target = !isNullOrUndefined(e) ? e.target : this.list;
2003
- var liHeight = parseInt(getComputedStyle(this.getValidLi(), null).getPropertyValue('height'), 10);
2004
+ var computedHeight = getComputedStyle(this.getValidLi(), null).getPropertyValue('height');
2005
+ var liHeight = this.getModuleName() === 'multiselect' ? parseFloat(computedHeight) : parseInt(computedHeight, 10);
2004
2006
  var topIndex = Math.round(target.scrollTop / liHeight);
2005
2007
  var liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
2006
2008
  var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
@@ -4697,6 +4699,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4697
4699
  DropDownList.prototype.onFilterUp = function (e) {
4698
4700
  if (!(e.ctrlKey && e.keyCode === 86) && (this.isValidKey || e.keyCode === 40 || e.keyCode === 38)) {
4699
4701
  this.isValidKey = false;
4702
+ this.filterArgs = e;
4700
4703
  this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
4701
4704
  switch (e.keyCode) {
4702
4705
  case 38: //up arrow
@@ -4750,7 +4753,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4750
4753
  }
4751
4754
  this.typedString = this.filterInput.value;
4752
4755
  this.preventAutoFill = false;
4753
- this.searchLists(e);
4756
+ if (!this.getInitialData) {
4757
+ this.searchLists(e);
4758
+ }
4754
4759
  if ((this.enableVirtualization && this.getModuleName() !== 'autocomplete') || (this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount !== 0)) {
4755
4760
  this.getFilteringSkeletonCount();
4756
4761
  }
@@ -5098,6 +5103,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5098
5103
  var _this = this;
5099
5104
  setTimeout(function () {
5100
5105
  _this.typedString = _this.filterInput.value;
5106
+ if (_this.getModuleName() === 'combobox' && _this.isFiltering() && isNullOrUndefined(_this.list)) {
5107
+ _this.renderList();
5108
+ }
5101
5109
  _this.searchLists(e);
5102
5110
  });
5103
5111
  };
@@ -5123,10 +5131,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5123
5131
  }
5124
5132
  if (this.getInitialData) {
5125
5133
  this.updateActionCompleteDataValues(ulElement, list);
5126
- }
5127
- if (!this.preventPopupOpen && this.getModuleName() === 'combobox') {
5128
- this.beforePopupOpen = true;
5129
- this.preventPopupOpen = true;
5134
+ this.getInitialData = false;
5135
+ this.searchLists(this.filterArgs);
5136
+ return;
5130
5137
  }
5131
5138
  var tempItemCount = this.itemCount;
5132
5139
  if (this.isActive || !isNullOrUndefined(ulElement)) {
@@ -8087,8 +8094,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8087
8094
  }
8088
8095
  addClass([this.inputEle], CHIP_INPUT);
8089
8096
  this.updateOverFlowView();
8090
- this.ensurePlaceHolder();
8091
8097
  }
8098
+ this.ensurePlaceHolder();
8092
8099
  };
8093
8100
  DropDownTree.prototype.triggerChangeEvent = function (event) {
8094
8101
  var isEqual = this.ddtCompareValues(this.oldValue, this.value);
@@ -8698,10 +8705,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8698
8705
  if (this.value !== null && this.value.length !== 0) {
8699
8706
  var data = void 0;
8700
8707
  if (this.showCheckBox || this.allowMultiSelection) {
8701
- for (var i = 0; i < this.value.length; i++) {
8708
+ for (var i = this.value.length - 1; i >= 0; i--) {
8702
8709
  data = this.treeObj.getTreeData(this.value[i])[0];
8703
8710
  if (isNullOrUndefined(data)) {
8704
- this.value.splice(this.value.indexOf(this.value[i]), 1);
8711
+ this.value.splice(i, 1);
8705
8712
  }
8706
8713
  }
8707
8714
  if (this.value.length !== 0) {
@@ -8758,7 +8765,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8758
8765
  }
8759
8766
  };
8760
8767
  DropDownTree.prototype.setSelectedValue = function () {
8761
- if (this.value != null) {
8768
+ if (this.value !== null && !(this.value.length === 0)) {
8762
8769
  return;
8763
8770
  }
8764
8771
  if (!this.isInitialized) {
@@ -9568,7 +9575,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
9568
9575
  }
9569
9576
  };
9570
9577
  DropDownTree.prototype.ensurePlaceHolder = function () {
9571
- if (isNullOrUndefined(this.value) || (this.value && this.value.length === 0)) {
9578
+ if (isNullOrUndefined(this.value) || (this.value !== null && this.value.length === 0)) {
9572
9579
  removeClass([this.inputEle], CHIP_INPUT);
9573
9580
  if (this.chipWrapper) {
9574
9581
  addClass([this.chipWrapper], HIDEICON);
@@ -9871,7 +9878,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
9871
9878
  }
9872
9879
  };
9873
9880
  DropDownTree.prototype.setTagValues = function () {
9874
- if (this.value === null || this.text == null) {
9881
+ if (this.value === null || this.text == null || this.value.length === 0) {
9882
+ if (this.inputWrapper.contains(this.chipWrapper)) {
9883
+ addClass([this.chipWrapper], HIDEICON);
9884
+ }
9875
9885
  return;
9876
9886
  }
9877
9887
  if (!this.inputWrapper.contains(this.chipWrapper)) {
@@ -13457,6 +13467,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13457
13467
  if (this.isFiltered) {
13458
13468
  if ((this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery))) {
13459
13469
  filterQuery = this.customFilterQuery.clone();
13470
+ return this.virtualFilterQuery(filterQuery);
13460
13471
  }
13461
13472
  else if (!this.enableVirtualization) {
13462
13473
  return filterQuery;
@@ -15302,7 +15313,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15302
15313
  getValue(((this.fields.value) ? this.fields.value : ''), this.value[this.value.length - 1]) :
15303
15314
  this.value[this.value.length - 1];
15304
15315
  var temp = text;
15305
- var textValues = this.text != null && this.text !== '' ? this.text + ',' + temp : temp;
15316
+ var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + temp : temp;
15306
15317
  currentText.push(textValues);
15307
15318
  this.setProperties({ text: currentText.toString() }, true);
15308
15319
  }
@@ -16237,7 +16248,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16237
16248
  }
16238
16249
  else {
16239
16250
  temp = isInitialVirtualData && delim ? this_1.text : this_1.getTextByValue(value);
16240
- var textValues = isInitialVirtualData ? this_1.text : (this_1.text && this_1.text !== '' ? this_1.text + ',' + temp : temp);
16251
+ var textValues = isInitialVirtualData ? this_1.text : (this_1.text && this_1.text !== '' ? this_1.text + this_1.delimiterChar + temp : temp);
16241
16252
  data += temp + delimiterChar + ' ';
16242
16253
  text.push(textValues);
16243
16254
  hiddenElementContent = this_1.hiddenElement.innerHTML;
@@ -16405,7 +16416,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16405
16416
  (this.mode === 'Box' || this.mode === 'Default'))) ||
16406
16417
  (this.enableVirtualization && value != null && text != null && !isCustomData)) {
16407
16418
  var currentText = [];
16408
- var textValues = this.text != null && this.text !== '' ? this.text + ',' + text : text;
16419
+ var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + text : text;
16409
16420
  currentText.push(textValues);
16410
16421
  this.setProperties({ text: currentText.toString() }, true);
16411
16422
  this.addChip(text, value);
@@ -16441,7 +16452,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16441
16452
  this.wireListEvents();
16442
16453
  }
16443
16454
  var currentText = [];
16444
- var textValues = this.text != null && this.text !== '' ? this.text + ',' + text : text;
16455
+ var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + text : text;
16445
16456
  currentText.push(textValues);
16446
16457
  this.setProperties({ text: currentText.toString() }, true);
16447
16458
  this.addChip(text, value);
@@ -22556,6 +22567,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
22556
22567
  e.preventDefault();
22557
22568
  var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
22558
22569
  if (li) {
22570
+ this.isSelected = true;
22559
22571
  this.setSelection(li, e);
22560
22572
  }
22561
22573
  if (this.isPopupOpen) {