@syncfusion/ej2-dropdowns 23.1.42 → 23.1.43

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.
@@ -1509,6 +1509,23 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1509
1509
  }
1510
1510
  return dataSource;
1511
1511
  };
1512
+ /**
1513
+ * Return the index of item which matched with given value in data source
1514
+ *
1515
+ * @param {string | number | boolean} value - Specifies given value.
1516
+ * @returns {number} Returns the index of the item.
1517
+ */
1518
+ DropDownBase.prototype.getIndexByValueFilter = function (value) {
1519
+ var index;
1520
+ var listItems = this.renderItems(this.selectData, this.fields);
1521
+ for (var i = 0; i < listItems.children.length; i++) {
1522
+ if (!isNullOrUndefined(value) && listItems.children[i].getAttribute('data-value') === value.toString()) {
1523
+ index = i;
1524
+ break;
1525
+ }
1526
+ }
1527
+ return index;
1528
+ };
1512
1529
  /**
1513
1530
  * Return the index of item which matched with given value in data source
1514
1531
  *
@@ -2798,6 +2815,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2798
2815
  }
2799
2816
  };
2800
2817
  DropDownList.prototype.updateUpDownAction = function (e, isVirtualKeyAction) {
2818
+ if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
2819
+ var value_1 = this.getItemData().value;
2820
+ var filterIndex = this.getIndexByValue(value_1);
2821
+ if (!isNullOrUndefined(filterIndex)) {
2822
+ this.activeIndex = filterIndex;
2823
+ }
2824
+ }
2801
2825
  var focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
2802
2826
  if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
2803
2827
  this.setSelection(focusEle, e);
@@ -2842,6 +2866,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2842
2866
  this.setSelection(nextItem, e);
2843
2867
  }
2844
2868
  }
2869
+ if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
2870
+ var value_2 = this.getItemData().value;
2871
+ var filterIndex = this.getIndexByValueFilter(value_2);
2872
+ if (!isNullOrUndefined(filterIndex)) {
2873
+ this.activeIndex = filterIndex;
2874
+ }
2875
+ }
2845
2876
  e.preventDefault();
2846
2877
  };
2847
2878
  DropDownList.prototype.updateHomeEndAction = function (e, isVirtualKeyAction) {
@@ -3143,7 +3174,18 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3143
3174
  if (isNullOrUndefined(value)) {
3144
3175
  value = 'null';
3145
3176
  }
3146
- this.activeIndex = this.getIndexByValue(value);
3177
+ if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
3178
+ var filterIndex = this.getIndexByValueFilter(value);
3179
+ if (!isNullOrUndefined(filterIndex)) {
3180
+ this.activeIndex = filterIndex;
3181
+ }
3182
+ else {
3183
+ this.activeIndex = this.getIndexByValue(value);
3184
+ }
3185
+ }
3186
+ else {
3187
+ this.activeIndex = this.getIndexByValue(value);
3188
+ }
3147
3189
  };
3148
3190
  DropDownList.prototype.activeItem = function (li) {
3149
3191
  if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.selected)) {
@@ -3169,6 +3211,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3169
3211
  detach(this.valueTempElement);
3170
3212
  this.inputElement.style.display = 'block';
3171
3213
  }
3214
+ if (!isNullOrUndefined(dataItem.value) && !this.enableVirtualization && this.allowFiltering) {
3215
+ this.activeIndex = this.getIndexByValueFilter(dataItem.value);
3216
+ }
3172
3217
  var clearIcon = dropDownListClasses.clearIcon;
3173
3218
  var isFilterElement = this.isFiltering() && this.filterInput && (this.getModuleName() === 'combobox');
3174
3219
  var clearElement = isFilterElement && this.filterInput.parentElement.querySelector('.' + clearIcon);
@@ -3943,10 +3988,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3943
3988
  DropDownList.prototype.addNewItem = function (listData, newElement) {
3944
3989
  var _this = this;
3945
3990
  if (!isNullOrUndefined(this.itemData) && !isNullOrUndefined(newElement)) {
3946
- var value_1 = this.getItemData().value;
3991
+ var value_3 = this.getItemData().value;
3947
3992
  var isExist = listData.some(function (data) {
3948
- return (((typeof data === 'string' || typeof data === 'number') && data === value_1) ||
3949
- (getValue(_this.fields.value, data) === value_1));
3993
+ return (((typeof data === 'string' || typeof data === 'number') && data === value_3) ||
3994
+ (getValue(_this.fields.value, data) === value_3));
3950
3995
  });
3951
3996
  if (!isExist) {
3952
3997
  this.addItem(this.itemData);
@@ -4660,7 +4705,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4660
4705
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4661
4706
  this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
4662
4707
  }
4663
- this.getSkeletonCount();
4708
+ if (this.getModuleName() !== 'autocomplete' && this.totalItemCount != 0 && this.totalItemCount > (this.itemCount * 2)) {
4709
+ this.getSkeletonCount();
4710
+ }
4664
4711
  this.UpdateSkeleton();
4665
4712
  this.listData = currentData;
4666
4713
  this.updateActionCompleteDataValues(ulElement, currentData);
@@ -7560,12 +7607,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
7560
7607
  var nodes = this.treeObj.element.querySelectorAll('li');
7561
7608
  var checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
7562
7609
  var wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
7563
- if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0 || args.data[0].isChecked == "false")) {
7610
+ if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0 || (!isNullOrUndefined(args.data[0]) && args.data[0].isChecked === 'false'))) {
7564
7611
  this.isReverseUpdate = true;
7565
7612
  this.changeState(wrap, 'uncheck');
7566
7613
  this.isReverseUpdate = false;
7567
7614
  }
7568
- else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && (args.isInteracted || this.isCheckAllCalled || args.data[0].isChecked == "true")) {
7615
+ else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && (args.isInteracted || this.isCheckAllCalled || (!isNullOrUndefined(args.data[0]) && args.data[0].isChecked === 'true'))) {
7569
7616
  this.isReverseUpdate = true;
7570
7617
  this.isCheckAllCalled = false;
7571
7618
  this.changeState(wrap, 'check');
@@ -8529,7 +8576,6 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8529
8576
  this.clearTemplate();
8530
8577
  this.unWireEvents();
8531
8578
  this.setCssClass(null, this.cssClass);
8532
- this.setProperties({ value: [] }, true);
8533
8579
  this.setProperties({ text: null }, true);
8534
8580
  this.treeObj.destroy();
8535
8581
  this.destroyFilter();
@@ -8572,6 +8618,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8572
8618
  this.overFlowWrapper = null;
8573
8619
  this.keyboardModule = null;
8574
8620
  _super.prototype.destroy.call(this);
8621
+ this.setProperties({ value: [] }, true);
8575
8622
  };
8576
8623
  DropDownTree.prototype.destroyFilter = function () {
8577
8624
  if (this.filterObj) {
@@ -18859,7 +18906,12 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18859
18906
  value = this.displayTempElement.innerHTML;
18860
18907
  }
18861
18908
  if (this.isContentEditable(this.inputElement)) {
18862
- return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
18909
+ if (Browser.isAndroid) {
18910
+ return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
18911
+ }
18912
+ else {
18913
+ return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
18914
+ }
18863
18915
  }
18864
18916
  else {
18865
18917
  return showChar + value;