@syncfusion/ej2-dropdowns 23.1.42 → 23.1.44

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 23.1.42
3
+ * version : 23.1.44
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-dropdowns@*",
3
- "_id": "@syncfusion/ej2-dropdowns@23.1.41",
3
+ "_id": "@syncfusion/ej2-dropdowns@23.1.43",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-y//3VH/5+habVL6F0DziqbiYzeCU3yvRE5/8YmQRKStz0qg/N0emXUiW/y2uerMFcEuWYUHAz6zIobX28fiA8Q==",
5
+ "_integrity": "sha512-Xr9PivtmGzoHdHTa7A/OdylJZvAicZq8KjyH32IBZmIu8LXxy4CnqwqZE4iArWew6cieHg2T4iisgBkXfhXM0w==",
6
6
  "_location": "/@syncfusion/ej2-dropdowns",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -34,8 +34,8 @@
34
34
  "/@syncfusion/ej2-spreadsheet",
35
35
  "/@syncfusion/ej2-vue-dropdowns"
36
36
  ],
37
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-23.1.41.tgz",
38
- "_shasum": "b4d93ee08b3b0bf0ed2cc3efe64f19e33255a6f6",
37
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-23.1.43.tgz",
38
+ "_shasum": "387fcadf249d432ca74bb8349ea730b7bfe7e6b7",
39
39
  "_spec": "@syncfusion/ej2-dropdowns@*",
40
40
  "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
41
41
  "author": {
@@ -44,12 +44,12 @@
44
44
  "bundleDependencies": false,
45
45
  "dependencies": {
46
46
  "@syncfusion/ej2-base": "~23.1.41",
47
- "@syncfusion/ej2-data": "~23.1.36",
48
- "@syncfusion/ej2-inputs": "~23.1.42",
49
- "@syncfusion/ej2-lists": "~23.1.42",
50
- "@syncfusion/ej2-navigations": "~23.1.41",
47
+ "@syncfusion/ej2-data": "~23.1.44",
48
+ "@syncfusion/ej2-inputs": "~23.1.43",
49
+ "@syncfusion/ej2-lists": "~23.1.43",
50
+ "@syncfusion/ej2-navigations": "~23.1.44",
51
51
  "@syncfusion/ej2-notifications": "~23.1.40",
52
- "@syncfusion/ej2-popups": "~23.1.38"
52
+ "@syncfusion/ej2-popups": "~23.1.44"
53
53
  },
54
54
  "deprecated": false,
55
55
  "description": "Essential JS 2 DropDown Components",
@@ -74,7 +74,7 @@
74
74
  "module": "./index.js",
75
75
  "name": "@syncfusion/ej2-dropdowns",
76
76
  "typings": "index.d.ts",
77
- "version": "23.1.42",
77
+ "version": "23.1.44",
78
78
  "sideEffects": false,
79
79
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
80
80
  }
@@ -554,6 +554,13 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
554
554
  };
555
555
  protected setFixedHeader(): void;
556
556
  private getSortedDataSource;
557
+ /**
558
+ * Return the index of item which matched with given value in data source
559
+ *
560
+ * @param {string | number | boolean} value - Specifies given value.
561
+ * @returns {number} Returns the index of the item.
562
+ */
563
+ protected getIndexByValueFilter(value: string | number | boolean): number;
557
564
  /**
558
565
  * Return the index of item which matched with given value in data source
559
566
  *
@@ -275,7 +275,9 @@ var DropDownBase = /** @class */ (function (_super) {
275
275
  }
276
276
  }
277
277
  else {
278
- ele.appendChild(noDataElement[i]);
278
+ if (noDataElement[i] instanceof HTMLElement) {
279
+ ele.appendChild(noDataElement[i]);
280
+ }
279
281
  }
280
282
  }
281
283
  }
@@ -939,6 +941,23 @@ var DropDownBase = /** @class */ (function (_super) {
939
941
  }
940
942
  return dataSource;
941
943
  };
944
+ /**
945
+ * Return the index of item which matched with given value in data source
946
+ *
947
+ * @param {string | number | boolean} value - Specifies given value.
948
+ * @returns {number} Returns the index of the item.
949
+ */
950
+ DropDownBase.prototype.getIndexByValueFilter = function (value) {
951
+ var index;
952
+ var listItems = this.renderItems(this.selectData, this.fields);
953
+ for (var i = 0; i < listItems.children.length; i++) {
954
+ if (!isNullOrUndefined(value) && listItems.children[i].getAttribute('data-value') === value.toString()) {
955
+ index = i;
956
+ break;
957
+ }
958
+ }
959
+ return index;
960
+ };
942
961
  /**
943
962
  * Return the index of item which matched with given value in data source
944
963
  *
@@ -805,6 +805,13 @@ var DropDownList = /** @class */ (function (_super) {
805
805
  }
806
806
  };
807
807
  DropDownList.prototype.updateUpDownAction = function (e, isVirtualKeyAction) {
808
+ if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
809
+ var value_1 = this.getItemData().value;
810
+ var filterIndex = this.getIndexByValue(value_1);
811
+ if (!isNullOrUndefined(filterIndex)) {
812
+ this.activeIndex = filterIndex;
813
+ }
814
+ }
808
815
  var focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
809
816
  if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
810
817
  this.setSelection(focusEle, e);
@@ -849,6 +856,13 @@ var DropDownList = /** @class */ (function (_super) {
849
856
  this.setSelection(nextItem, e);
850
857
  }
851
858
  }
859
+ if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
860
+ var value_2 = this.getItemData().value;
861
+ var filterIndex = this.getIndexByValueFilter(value_2);
862
+ if (!isNullOrUndefined(filterIndex)) {
863
+ this.activeIndex = filterIndex;
864
+ }
865
+ }
852
866
  e.preventDefault();
853
867
  };
854
868
  DropDownList.prototype.updateHomeEndAction = function (e, isVirtualKeyAction) {
@@ -1150,7 +1164,18 @@ var DropDownList = /** @class */ (function (_super) {
1150
1164
  if (isNullOrUndefined(value)) {
1151
1165
  value = 'null';
1152
1166
  }
1153
- this.activeIndex = this.getIndexByValue(value);
1167
+ if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
1168
+ var filterIndex = this.getIndexByValueFilter(value);
1169
+ if (!isNullOrUndefined(filterIndex)) {
1170
+ this.activeIndex = filterIndex;
1171
+ }
1172
+ else {
1173
+ this.activeIndex = this.getIndexByValue(value);
1174
+ }
1175
+ }
1176
+ else {
1177
+ this.activeIndex = this.getIndexByValue(value);
1178
+ }
1154
1179
  };
1155
1180
  DropDownList.prototype.activeItem = function (li) {
1156
1181
  if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.selected)) {
@@ -1176,6 +1201,9 @@ var DropDownList = /** @class */ (function (_super) {
1176
1201
  detach(this.valueTempElement);
1177
1202
  this.inputElement.style.display = 'block';
1178
1203
  }
1204
+ if (!isNullOrUndefined(dataItem.value) && !this.enableVirtualization && this.allowFiltering) {
1205
+ this.activeIndex = this.getIndexByValueFilter(dataItem.value);
1206
+ }
1179
1207
  var clearIcon = dropDownListClasses.clearIcon;
1180
1208
  var isFilterElement = this.isFiltering() && this.filterInput && (this.getModuleName() === 'combobox');
1181
1209
  var clearElement = isFilterElement && this.filterInput.parentElement.querySelector('.' + clearIcon);
@@ -1950,10 +1978,10 @@ var DropDownList = /** @class */ (function (_super) {
1950
1978
  DropDownList.prototype.addNewItem = function (listData, newElement) {
1951
1979
  var _this = this;
1952
1980
  if (!isNullOrUndefined(this.itemData) && !isNullOrUndefined(newElement)) {
1953
- var value_1 = this.getItemData().value;
1981
+ var value_3 = this.getItemData().value;
1954
1982
  var isExist = listData.some(function (data) {
1955
- return (((typeof data === 'string' || typeof data === 'number') && data === value_1) ||
1956
- (getValue(_this.fields.value, data) === value_1));
1983
+ return (((typeof data === 'string' || typeof data === 'number') && data === value_3) ||
1984
+ (getValue(_this.fields.value, data) === value_3));
1957
1985
  });
1958
1986
  if (!isExist) {
1959
1987
  this.addItem(this.itemData);
@@ -2668,7 +2696,9 @@ var DropDownList = /** @class */ (function (_super) {
2668
2696
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2669
2697
  this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
2670
2698
  }
2671
- this.getSkeletonCount();
2699
+ if (this.getModuleName() !== 'autocomplete' && this.totalItemCount != 0 && this.totalItemCount > (this.itemCount * 2)) {
2700
+ this.getSkeletonCount();
2701
+ }
2672
2702
  this.UpdateSkeleton();
2673
2703
  this.listData = currentData;
2674
2704
  this.updateActionCompleteDataValues(ulElement, currentData);
@@ -1971,12 +1971,12 @@ var DropDownTree = /** @class */ (function (_super) {
1971
1971
  var nodes = this.treeObj.element.querySelectorAll('li');
1972
1972
  var checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
1973
1973
  var wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
1974
- if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0 || args.data[0].isChecked == "false")) {
1974
+ if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0 || (!isNOU(args.data[0]) && args.data[0].isChecked === 'false'))) {
1975
1975
  this.isReverseUpdate = true;
1976
1976
  this.changeState(wrap, 'uncheck');
1977
1977
  this.isReverseUpdate = false;
1978
1978
  }
1979
- else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && (args.isInteracted || this.isCheckAllCalled || args.data[0].isChecked == "true")) {
1979
+ else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && (args.isInteracted || this.isCheckAllCalled || (!isNOU(args.data[0]) && args.data[0].isChecked === 'true'))) {
1980
1980
  this.isReverseUpdate = true;
1981
1981
  this.isCheckAllCalled = false;
1982
1982
  this.changeState(wrap, 'check');
@@ -2941,7 +2941,6 @@ var DropDownTree = /** @class */ (function (_super) {
2941
2941
  this.clearTemplate();
2942
2942
  this.unWireEvents();
2943
2943
  this.setCssClass(null, this.cssClass);
2944
- this.setProperties({ value: [] }, true);
2945
2944
  this.setProperties({ text: null }, true);
2946
2945
  this.treeObj.destroy();
2947
2946
  this.destroyFilter();
@@ -2984,6 +2983,7 @@ var DropDownTree = /** @class */ (function (_super) {
2984
2983
  this.overFlowWrapper = null;
2985
2984
  this.keyboardModule = null;
2986
2985
  _super.prototype.destroy.call(this);
2986
+ this.setProperties({ value: [] }, true);
2987
2987
  };
2988
2988
  DropDownTree.prototype.destroyFilter = function () {
2989
2989
  if (this.filterObj) {
@@ -314,7 +314,7 @@ var Mention = /** @class */ (function (_super) {
314
314
  var currentRange = this.getTextRange();
315
315
  var lastWordRange = this.getLastLetter(currentRange);
316
316
  // eslint-disable-next-line security/detect-non-literal-regexp
317
- var Regex = new RegExp(this.mentionChar, 'g');
317
+ var Regex = new RegExp(this.mentionChar.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'g');
318
318
  var charRegex = new RegExp('[a-zA-Z]', 'g');
319
319
  if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
320
320
  return;
@@ -1219,7 +1219,12 @@ var Mention = /** @class */ (function (_super) {
1219
1219
  value = this.displayTempElement.innerHTML;
1220
1220
  }
1221
1221
  if (this.isContentEditable(this.inputElement)) {
1222
- return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
1222
+ if (Browser.isAndroid) {
1223
+ return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
1224
+ }
1225
+ else {
1226
+ return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
1227
+ }
1223
1228
  }
1224
1229
  else {
1225
1230
  return showChar + value;
@@ -1452,7 +1457,6 @@ var Mention = /** @class */ (function (_super) {
1452
1457
  this.previousSelectedLI = null;
1453
1458
  this.item = null;
1454
1459
  this.selectedLI = null;
1455
- this.inputElement.innerText = null;
1456
1460
  this.popupObj = null;
1457
1461
  _super.prototype.destroy.call(this);
1458
1462
  };