@syncfusion/ej2-dropdowns 28.1.36 → 28.1.38

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;
@@ -1860,7 +1861,17 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1860
1861
  var liCollections = listElement.querySelectorAll('.' + dropDownBaseClasses.li);
1861
1862
  for (var index = 0; index < liCollections.length; index++) {
1862
1863
  if (JSON.parse(JSON.stringify(this.listData[index]))[this.fields.disabled]) {
1863
- this.disableListItem(liCollections[index]);
1864
+ if (!isNullOrUndefined(this.fields.groupBy)) {
1865
+ var item = this.listData[index];
1866
+ var value = getValue((this.fields.value ? this.fields.value : 'value'), item);
1867
+ var li = listElement.querySelector('li[data-value="' + value + '"]');
1868
+ if (!isNullOrUndefined(li)) {
1869
+ this.disableListItem(li);
1870
+ }
1871
+ }
1872
+ else {
1873
+ this.disableListItem(liCollections[index]);
1874
+ }
1864
1875
  }
1865
1876
  }
1866
1877
  }
@@ -2000,7 +2011,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
2000
2011
  };
2001
2012
  DropDownBase.prototype.scrollStop = function (e, isDownkey) {
2002
2013
  var target = !isNullOrUndefined(e) ? e.target : this.list;
2003
- var liHeight = parseInt(getComputedStyle(this.getValidLi(), null).getPropertyValue('height'), 10);
2014
+ var computedHeight = getComputedStyle(this.getValidLi(), null).getPropertyValue('height');
2015
+ var liHeight = this.getModuleName() === 'multiselect' ? parseFloat(computedHeight) : parseInt(computedHeight, 10);
2004
2016
  var topIndex = Math.round(target.scrollTop / liHeight);
2005
2017
  var liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
2006
2018
  var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
@@ -4697,6 +4709,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4697
4709
  DropDownList.prototype.onFilterUp = function (e) {
4698
4710
  if (!(e.ctrlKey && e.keyCode === 86) && (this.isValidKey || e.keyCode === 40 || e.keyCode === 38)) {
4699
4711
  this.isValidKey = false;
4712
+ this.filterArgs = e;
4700
4713
  this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
4701
4714
  switch (e.keyCode) {
4702
4715
  case 38: //up arrow
@@ -4750,7 +4763,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4750
4763
  }
4751
4764
  this.typedString = this.filterInput.value;
4752
4765
  this.preventAutoFill = false;
4753
- this.searchLists(e);
4766
+ if (!this.getInitialData) {
4767
+ this.searchLists(e);
4768
+ }
4754
4769
  if ((this.enableVirtualization && this.getModuleName() !== 'autocomplete') || (this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount !== 0)) {
4755
4770
  this.getFilteringSkeletonCount();
4756
4771
  }
@@ -5098,6 +5113,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5098
5113
  var _this = this;
5099
5114
  setTimeout(function () {
5100
5115
  _this.typedString = _this.filterInput.value;
5116
+ if (_this.getModuleName() === 'combobox' && _this.isFiltering() && isNullOrUndefined(_this.list)) {
5117
+ _this.renderList();
5118
+ }
5101
5119
  _this.searchLists(e);
5102
5120
  });
5103
5121
  };
@@ -5123,10 +5141,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5123
5141
  }
5124
5142
  if (this.getInitialData) {
5125
5143
  this.updateActionCompleteDataValues(ulElement, list);
5126
- }
5127
- if (!this.preventPopupOpen && this.getModuleName() === 'combobox') {
5128
- this.beforePopupOpen = true;
5129
- this.preventPopupOpen = true;
5144
+ this.getInitialData = false;
5145
+ this.searchLists(this.filterArgs);
5146
+ return;
5130
5147
  }
5131
5148
  var tempItemCount = this.itemCount;
5132
5149
  if (this.isActive || !isNullOrUndefined(ulElement)) {
@@ -5586,7 +5603,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5586
5603
  _this.destroyPopup();
5587
5604
  }
5588
5605
  });
5589
- if (_this.allowResize) {
5606
+ if (_this.allowResize && (_this.getModuleName() !== 'dropdownlist' || !(Browser.isDevice && _this.isDeviceFullScreen && _this.allowFiltering))) {
5590
5607
  var resizePaddingBottom = 16;
5591
5608
  // Create the resizer div
5592
5609
  _this.resizer = _this.createElement('div', {
@@ -7795,6 +7812,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
7795
7812
  }
7796
7813
  _this.treeObj.fields = _this.getTreeFields(fields);
7797
7814
  _this.treeObj.dataBind();
7815
+ if (_this.popupObj) {
7816
+ _this.popupObj.refreshPosition();
7817
+ }
7798
7818
  if (_this.hasTemplate && _this.portals && _this.treeObj.portals) {
7799
7819
  for (var i = 0; i < _this.treeObj.portals.length; i++) {
7800
7820
  if (_this.portals.indexOf(_this.treeObj.portals[i]) === -1) {
@@ -8087,8 +8107,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8087
8107
  }
8088
8108
  addClass([this.inputEle], CHIP_INPUT);
8089
8109
  this.updateOverFlowView();
8090
- this.ensurePlaceHolder();
8091
8110
  }
8111
+ this.ensurePlaceHolder();
8092
8112
  };
8093
8113
  DropDownTree.prototype.triggerChangeEvent = function (event) {
8094
8114
  var isEqual = this.ddtCompareValues(this.oldValue, this.value);
@@ -8698,10 +8718,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8698
8718
  if (this.value !== null && this.value.length !== 0) {
8699
8719
  var data = void 0;
8700
8720
  if (this.showCheckBox || this.allowMultiSelection) {
8701
- for (var i = 0; i < this.value.length; i++) {
8721
+ for (var i = this.value.length - 1; i >= 0; i--) {
8702
8722
  data = this.treeObj.getTreeData(this.value[i])[0];
8703
8723
  if (isNullOrUndefined(data)) {
8704
- this.value.splice(this.value.indexOf(this.value[i]), 1);
8724
+ this.value.splice(i, 1);
8705
8725
  }
8706
8726
  }
8707
8727
  if (this.value.length !== 0) {
@@ -8758,7 +8778,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8758
8778
  }
8759
8779
  };
8760
8780
  DropDownTree.prototype.setSelectedValue = function () {
8761
- if (this.value != null) {
8781
+ if (this.value !== null && !(this.value.length === 0)) {
8762
8782
  return;
8763
8783
  }
8764
8784
  if (!this.isInitialized) {
@@ -9568,7 +9588,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
9568
9588
  }
9569
9589
  };
9570
9590
  DropDownTree.prototype.ensurePlaceHolder = function () {
9571
- if (isNullOrUndefined(this.value) || (this.value && this.value.length === 0)) {
9591
+ if (isNullOrUndefined(this.value) || (this.value !== null && this.value.length === 0)) {
9572
9592
  removeClass([this.inputEle], CHIP_INPUT);
9573
9593
  if (this.chipWrapper) {
9574
9594
  addClass([this.chipWrapper], HIDEICON);
@@ -9871,7 +9891,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
9871
9891
  }
9872
9892
  };
9873
9893
  DropDownTree.prototype.setTagValues = function () {
9874
- if (this.value === null || this.text == null) {
9894
+ if (this.value === null || this.text == null || this.value.length === 0) {
9895
+ if (this.inputWrapper.contains(this.chipWrapper)) {
9896
+ addClass([this.chipWrapper], HIDEICON);
9897
+ }
9875
9898
  return;
9876
9899
  }
9877
9900
  if (!this.inputWrapper.contains(this.chipWrapper)) {
@@ -13457,6 +13480,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13457
13480
  if (this.isFiltered) {
13458
13481
  if ((this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery))) {
13459
13482
  filterQuery = this.customFilterQuery.clone();
13483
+ return this.virtualFilterQuery(filterQuery);
13460
13484
  }
13461
13485
  else if (!this.enableVirtualization) {
13462
13486
  return filterQuery;
@@ -15302,7 +15326,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15302
15326
  getValue(((this.fields.value) ? this.fields.value : ''), this.value[this.value.length - 1]) :
15303
15327
  this.value[this.value.length - 1];
15304
15328
  var temp = text;
15305
- var textValues = this.text != null && this.text !== '' ? this.text + ',' + temp : temp;
15329
+ var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + temp : temp;
15306
15330
  currentText.push(textValues);
15307
15331
  this.setProperties({ text: currentText.toString() }, true);
15308
15332
  }
@@ -16237,7 +16261,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16237
16261
  }
16238
16262
  else {
16239
16263
  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);
16264
+ var textValues = isInitialVirtualData ? this_1.text : (this_1.text && this_1.text !== '' ? this_1.text + this_1.delimiterChar + temp : temp);
16241
16265
  data += temp + delimiterChar + ' ';
16242
16266
  text.push(textValues);
16243
16267
  hiddenElementContent = this_1.hiddenElement.innerHTML;
@@ -16405,7 +16429,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16405
16429
  (this.mode === 'Box' || this.mode === 'Default'))) ||
16406
16430
  (this.enableVirtualization && value != null && text != null && !isCustomData)) {
16407
16431
  var currentText = [];
16408
- var textValues = this.text != null && this.text !== '' ? this.text + ',' + text : text;
16432
+ var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + text : text;
16409
16433
  currentText.push(textValues);
16410
16434
  this.setProperties({ text: currentText.toString() }, true);
16411
16435
  this.addChip(text, value);
@@ -16441,7 +16465,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16441
16465
  this.wireListEvents();
16442
16466
  }
16443
16467
  var currentText = [];
16444
- var textValues = this.text != null && this.text !== '' ? this.text + ',' + text : text;
16468
+ var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + text : text;
16445
16469
  currentText.push(textValues);
16446
16470
  this.setProperties({ text: currentText.toString() }, true);
16447
16471
  this.addChip(text, value);
@@ -22556,6 +22580,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
22556
22580
  e.preventDefault();
22557
22581
  var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
22558
22582
  if (li) {
22583
+ this.isSelected = true;
22559
22584
  this.setSelection(li, e);
22560
22585
  }
22561
22586
  if (this.isPopupOpen) {