@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.
@@ -1,3 +1,12 @@
1
+ /*!
2
+ * filename: index.d.ts
3
+ * version : 28.1.38
4
+ * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
5
+ * Use of this code is subject to the terms of our license.
6
+ * A copy of the current license can be obtained at any time by e-mailing
7
+ * licensing@syncfusion.com. Any infringement will be prosecuted under
8
+ * applicable laws.
9
+ */
1
10
  import * as _dropdowns from '@syncfusion/ej2-dropdowns';
2
11
 
3
12
  export declare namespace ej {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-dropdowns@*",
3
- "_id": "@syncfusion/ej2-dropdowns@28.1.35",
3
+ "_id": "@syncfusion/ej2-dropdowns@28.1.37",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-AV0Z1peZZOX3YhbLRzB/vm9sp/iKHLJXoEpR1lAHxIq/vJYIG2ExbHWSiueXlcmjxTtQBOdCXj3AntmcZOdfnQ==",
5
+ "_integrity": "sha512-YBUYysD/7B2KQkM3EFVWMJW0Wlnc1qsEtsjZwWGung4kILvAZXjeI5IDuAkNp+L1cMn+rcUf+5stmZW2U4dHJA==",
6
6
  "_location": "/@syncfusion/ej2-dropdowns",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -18,22 +18,26 @@
18
18
  },
19
19
  "_requiredBy": [
20
20
  "/",
21
+ "/@syncfusion/ej2",
21
22
  "/@syncfusion/ej2-angular-dropdowns",
22
23
  "/@syncfusion/ej2-documenteditor",
23
24
  "/@syncfusion/ej2-gantt",
24
25
  "/@syncfusion/ej2-grids",
26
+ "/@syncfusion/ej2-image-editor",
25
27
  "/@syncfusion/ej2-inplace-editor",
26
28
  "/@syncfusion/ej2-kanban",
27
29
  "/@syncfusion/ej2-pdfviewer",
28
30
  "/@syncfusion/ej2-pivotview",
31
+ "/@syncfusion/ej2-querybuilder",
29
32
  "/@syncfusion/ej2-react-dropdowns",
33
+ "/@syncfusion/ej2-ribbon",
30
34
  "/@syncfusion/ej2-richtexteditor",
31
35
  "/@syncfusion/ej2-schedule",
32
36
  "/@syncfusion/ej2-spreadsheet",
33
37
  "/@syncfusion/ej2-vue-dropdowns"
34
38
  ],
35
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-28.1.35.tgz",
36
- "_shasum": "b8a7bc80767221ac6a1046b6a1562ae1333d144c",
39
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-28.1.37.tgz",
40
+ "_shasum": "071a9760d7254c4da9114cd668922351f4b6c64a",
37
41
  "_spec": "@syncfusion/ej2-dropdowns@*",
38
42
  "_where": "/jenkins/workspace/elease-automation_release_28.1.1/packages/included",
39
43
  "author": {
@@ -43,11 +47,11 @@
43
47
  "dependencies": {
44
48
  "@syncfusion/ej2-base": "~28.1.33",
45
49
  "@syncfusion/ej2-data": "~28.1.33",
46
- "@syncfusion/ej2-inputs": "~28.1.33",
47
- "@syncfusion/ej2-lists": "~28.1.33",
48
- "@syncfusion/ej2-navigations": "~28.1.36",
50
+ "@syncfusion/ej2-inputs": "~28.1.37",
51
+ "@syncfusion/ej2-lists": "~28.1.37",
52
+ "@syncfusion/ej2-navigations": "~28.1.37",
49
53
  "@syncfusion/ej2-notifications": "~28.1.33",
50
- "@syncfusion/ej2-popups": "~28.1.33"
54
+ "@syncfusion/ej2-popups": "~28.1.38"
51
55
  },
52
56
  "deprecated": false,
53
57
  "description": "Essential JS 2 DropDown Components",
@@ -72,7 +76,7 @@
72
76
  "module": "./index.js",
73
77
  "name": "@syncfusion/ej2-dropdowns",
74
78
  "typings": "index.d.ts",
75
- "version": "28.1.36",
79
+ "version": "28.1.38",
76
80
  "sideEffects": false,
77
81
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
78
82
  }
@@ -285,8 +285,8 @@ var VirtualScroll = /** @class */ (function () {
285
285
  if (this.parent.hideSelectedItem) {
286
286
  var query = this.parent.value && this.parent.value.length > 0 ?
287
287
  this.parent.getForQuery(this.parent.value).clone() : new Query;
288
- if (this.parent.viewPortInfo.endIndex === this.parent.totalItemCount + this.parent.value.length &&
289
- this.parent.hideSelectedItem) {
288
+ if (this.parent.value && (this.parent.viewPortInfo.endIndex === this.parent.totalItemCount +
289
+ this.parent.value.length) && this.parent.hideSelectedItem) {
290
290
  query = query.skip(this.parent.totalItemCount - this.parent.itemCount);
291
291
  }
292
292
  else {
@@ -193,58 +193,60 @@ var DropDownBase = /** @class */ (function (_super) {
193
193
  if (isTextByValue) {
194
194
  value = text;
195
195
  }
196
- var dataSource = this.listData;
197
- var fields = this.fields;
198
- var type = this.typeOfData(dataSource).typeof;
199
- if (type === 'string' || type === 'number' || type === 'boolean') {
200
- for (var _i = 0, dataSource_1 = dataSource; _i < dataSource_1.length; _i++) {
201
- var item = dataSource_1[_i];
202
- if (!isNullOrUndefined(item)) {
203
- if (ignoreAccent) {
204
- value = this.checkingAccent(String(item), text, ignoreCase);
205
- }
206
- else {
207
- if (ignoreCase) {
208
- if (this.checkIgnoreCase(String(item), text)) {
209
- value = this.getItemValue(String(item), text, ignoreCase);
210
- }
196
+ if (!isNullOrUndefined(this.listData)) {
197
+ var dataSource = this.listData;
198
+ var fields_1 = this.fields;
199
+ var type = this.typeOfData(dataSource).typeof;
200
+ if (type === 'string' || type === 'number' || type === 'boolean') {
201
+ for (var _i = 0, dataSource_1 = dataSource; _i < dataSource_1.length; _i++) {
202
+ var item = dataSource_1[_i];
203
+ if (!isNullOrUndefined(item)) {
204
+ if (ignoreAccent) {
205
+ value = this.checkingAccent(String(item), text, ignoreCase);
211
206
  }
212
207
  else {
213
- if (this.checkNonIgnoreCase(String(item), text)) {
214
- value = this.getItemValue(String(item), text, ignoreCase, isTextByValue);
208
+ if (ignoreCase) {
209
+ if (this.checkIgnoreCase(String(item), text)) {
210
+ value = this.getItemValue(String(item), text, ignoreCase);
211
+ }
212
+ }
213
+ else {
214
+ if (this.checkNonIgnoreCase(String(item), text)) {
215
+ value = this.getItemValue(String(item), text, ignoreCase, isTextByValue);
216
+ }
215
217
  }
216
218
  }
217
219
  }
218
220
  }
219
221
  }
220
- }
221
- else {
222
- if (ignoreCase) {
223
- dataSource.filter(function (item) {
224
- var itemValue = getValue(fields.value, item);
225
- if (!isNullOrUndefined(itemValue) && _this.checkIgnoreCase(getValue(fields.text, item).toString(), text)) {
226
- value = getValue(fields.value, item);
227
- }
228
- });
229
- }
230
222
  else {
231
- if (isTextByValue) {
232
- var compareValue_1 = null;
233
- compareValue_1 = value;
223
+ if (ignoreCase) {
234
224
  dataSource.filter(function (item) {
235
- var itemValue = getValue(fields.value, item);
236
- if (!isNullOrUndefined(itemValue) && !isNullOrUndefined(value) &&
237
- itemValue.toString() === compareValue_1.toString()) {
238
- value = getValue(fields.text, item);
225
+ var itemValue = getValue(fields_1.value, item);
226
+ if (!isNullOrUndefined(itemValue) && _this.checkIgnoreCase(getValue(fields_1.text, item).toString(), text)) {
227
+ value = getValue(fields_1.value, item);
239
228
  }
240
229
  });
241
230
  }
242
231
  else {
243
- dataSource.filter(function (item) {
244
- if (_this.checkNonIgnoreCase(getValue(fields.text, item), text)) {
245
- value = getValue(fields.value, item);
246
- }
247
- });
232
+ if (isTextByValue) {
233
+ var compareValue_1 = null;
234
+ compareValue_1 = value;
235
+ dataSource.filter(function (item) {
236
+ var itemValue = getValue(fields_1.value, item);
237
+ if (!isNullOrUndefined(itemValue) && !isNullOrUndefined(value) &&
238
+ itemValue.toString() === compareValue_1.toString()) {
239
+ value = getValue(fields_1.text, item);
240
+ }
241
+ });
242
+ }
243
+ else {
244
+ dataSource.filter(function (item) {
245
+ if (_this.checkNonIgnoreCase(getValue(fields_1.text, item), text)) {
246
+ value = getValue(fields_1.value, item);
247
+ }
248
+ });
249
+ }
248
250
  }
249
251
  }
250
252
  }
@@ -769,7 +771,6 @@ var DropDownBase = /** @class */ (function (_super) {
769
771
  _this.isRequested = false;
770
772
  _this.bindChildItems(listItems, ulElement, fields, e);
771
773
  if (_this.getInitialData) {
772
- _this.setListData(dataSource, fields, query, event);
773
774
  _this.getInitialData = false;
774
775
  _this.preventPopupOpen = false;
775
776
  return;
@@ -1024,7 +1025,17 @@ var DropDownBase = /** @class */ (function (_super) {
1024
1025
  var liCollections = listElement.querySelectorAll('.' + dropDownBaseClasses.li);
1025
1026
  for (var index = 0; index < liCollections.length; index++) {
1026
1027
  if (JSON.parse(JSON.stringify(this.listData[index]))[this.fields.disabled]) {
1027
- this.disableListItem(liCollections[index]);
1028
+ if (!isNullOrUndefined(this.fields.groupBy)) {
1029
+ var item = this.listData[index];
1030
+ var value = getValue((this.fields.value ? this.fields.value : 'value'), item);
1031
+ var li = listElement.querySelector('li[data-value="' + value + '"]');
1032
+ if (!isNullOrUndefined(li)) {
1033
+ this.disableListItem(li);
1034
+ }
1035
+ }
1036
+ else {
1037
+ this.disableListItem(liCollections[index]);
1038
+ }
1028
1039
  }
1029
1040
  }
1030
1041
  }
@@ -1164,7 +1175,8 @@ var DropDownBase = /** @class */ (function (_super) {
1164
1175
  };
1165
1176
  DropDownBase.prototype.scrollStop = function (e, isDownkey) {
1166
1177
  var target = !isNullOrUndefined(e) ? e.target : this.list;
1167
- var liHeight = parseInt(getComputedStyle(this.getValidLi(), null).getPropertyValue('height'), 10);
1178
+ var computedHeight = getComputedStyle(this.getValidLi(), null).getPropertyValue('height');
1179
+ var liHeight = this.getModuleName() === 'multiselect' ? parseFloat(computedHeight) : parseInt(computedHeight, 10);
1168
1180
  var topIndex = Math.round(target.scrollTop / liHeight);
1169
1181
  var liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
1170
1182
  var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
@@ -120,6 +120,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
120
120
  private resizeWidth;
121
121
  private isUpdateHeaderHeight;
122
122
  private isUpdateFooterHeight;
123
+ private filterArgs;
123
124
  /**
124
125
  * Sets CSS classes to the root element of the component that allows customization of appearance.
125
126
  *
@@ -1869,6 +1869,7 @@ var DropDownList = /** @class */ (function (_super) {
1869
1869
  DropDownList.prototype.onFilterUp = function (e) {
1870
1870
  if (!(e.ctrlKey && e.keyCode === 86) && (this.isValidKey || e.keyCode === 40 || e.keyCode === 38)) {
1871
1871
  this.isValidKey = false;
1872
+ this.filterArgs = e;
1872
1873
  this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
1873
1874
  switch (e.keyCode) {
1874
1875
  case 38: //up arrow
@@ -1922,7 +1923,9 @@ var DropDownList = /** @class */ (function (_super) {
1922
1923
  }
1923
1924
  this.typedString = this.filterInput.value;
1924
1925
  this.preventAutoFill = false;
1925
- this.searchLists(e);
1926
+ if (!this.getInitialData) {
1927
+ this.searchLists(e);
1928
+ }
1926
1929
  if ((this.enableVirtualization && this.getModuleName() !== 'autocomplete') || (this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount !== 0)) {
1927
1930
  this.getFilteringSkeletonCount();
1928
1931
  }
@@ -2270,6 +2273,9 @@ var DropDownList = /** @class */ (function (_super) {
2270
2273
  var _this = this;
2271
2274
  setTimeout(function () {
2272
2275
  _this.typedString = _this.filterInput.value;
2276
+ if (_this.getModuleName() === 'combobox' && _this.isFiltering() && isNullOrUndefined(_this.list)) {
2277
+ _this.renderList();
2278
+ }
2273
2279
  _this.searchLists(e);
2274
2280
  });
2275
2281
  };
@@ -2295,10 +2301,9 @@ var DropDownList = /** @class */ (function (_super) {
2295
2301
  }
2296
2302
  if (this.getInitialData) {
2297
2303
  this.updateActionCompleteDataValues(ulElement, list);
2298
- }
2299
- if (!this.preventPopupOpen && this.getModuleName() === 'combobox') {
2300
- this.beforePopupOpen = true;
2301
- this.preventPopupOpen = true;
2304
+ this.getInitialData = false;
2305
+ this.searchLists(this.filterArgs);
2306
+ return;
2302
2307
  }
2303
2308
  var tempItemCount = this.itemCount;
2304
2309
  if (this.isActive || !isNullOrUndefined(ulElement)) {
@@ -2758,7 +2763,7 @@ var DropDownList = /** @class */ (function (_super) {
2758
2763
  _this.destroyPopup();
2759
2764
  }
2760
2765
  });
2761
- if (_this.allowResize) {
2766
+ if (_this.allowResize && (_this.getModuleName() !== 'dropdownlist' || !(Browser.isDevice && _this.isDeviceFullScreen && _this.allowFiltering))) {
2762
2767
  var resizePaddingBottom = 16;
2763
2768
  // Create the resizer div
2764
2769
  _this.resizer = _this.createElement('div', {
@@ -499,6 +499,9 @@ var DropDownTree = /** @class */ (function (_super) {
499
499
  }
500
500
  _this.treeObj.fields = _this.getTreeFields(fields);
501
501
  _this.treeObj.dataBind();
502
+ if (_this.popupObj) {
503
+ _this.popupObj.refreshPosition();
504
+ }
502
505
  if (_this.hasTemplate && _this.portals && _this.treeObj.portals) {
503
506
  for (var i = 0; i < _this.treeObj.portals.length; i++) {
504
507
  if (_this.portals.indexOf(_this.treeObj.portals[i]) === -1) {
@@ -791,8 +794,8 @@ var DropDownTree = /** @class */ (function (_super) {
791
794
  }
792
795
  addClass([this.inputEle], CHIP_INPUT);
793
796
  this.updateOverFlowView();
794
- this.ensurePlaceHolder();
795
797
  }
798
+ this.ensurePlaceHolder();
796
799
  };
797
800
  DropDownTree.prototype.triggerChangeEvent = function (event) {
798
801
  var isEqual = this.ddtCompareValues(this.oldValue, this.value);
@@ -1420,10 +1423,10 @@ var DropDownTree = /** @class */ (function (_super) {
1420
1423
  if (this.value !== null && this.value.length !== 0) {
1421
1424
  var data = void 0;
1422
1425
  if (this.showCheckBox || this.allowMultiSelection) {
1423
- for (var i = 0; i < this.value.length; i++) {
1426
+ for (var i = this.value.length - 1; i >= 0; i--) {
1424
1427
  data = this.treeObj.getTreeData(this.value[i])[0];
1425
1428
  if (isNOU(data)) {
1426
- this.value.splice(this.value.indexOf(this.value[i]), 1);
1429
+ this.value.splice(i, 1);
1427
1430
  }
1428
1431
  }
1429
1432
  if (this.value.length !== 0) {
@@ -1480,7 +1483,7 @@ var DropDownTree = /** @class */ (function (_super) {
1480
1483
  }
1481
1484
  };
1482
1485
  DropDownTree.prototype.setSelectedValue = function () {
1483
- if (this.value != null) {
1486
+ if (this.value !== null && !(this.value.length === 0)) {
1484
1487
  return;
1485
1488
  }
1486
1489
  if (!this.isInitialized) {
@@ -2290,7 +2293,7 @@ var DropDownTree = /** @class */ (function (_super) {
2290
2293
  }
2291
2294
  };
2292
2295
  DropDownTree.prototype.ensurePlaceHolder = function () {
2293
- if (isNOU(this.value) || (this.value && this.value.length === 0)) {
2296
+ if (isNOU(this.value) || (this.value !== null && this.value.length === 0)) {
2294
2297
  removeClass([this.inputEle], CHIP_INPUT);
2295
2298
  if (this.chipWrapper) {
2296
2299
  addClass([this.chipWrapper], HIDEICON);
@@ -2593,7 +2596,10 @@ var DropDownTree = /** @class */ (function (_super) {
2593
2596
  }
2594
2597
  };
2595
2598
  DropDownTree.prototype.setTagValues = function () {
2596
- if (this.value === null || this.text == null) {
2599
+ if (this.value === null || this.text == null || this.value.length === 0) {
2600
+ if (this.inputWrapper.contains(this.chipWrapper)) {
2601
+ addClass([this.chipWrapper], HIDEICON);
2602
+ }
2597
2603
  return;
2598
2604
  }
2599
2605
  if (!this.inputWrapper.contains(this.chipWrapper)) {
@@ -272,6 +272,7 @@ var Mention = /** @class */ (function (_super) {
272
272
  e.preventDefault();
273
273
  var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
274
274
  if (li) {
275
+ this.isSelected = true;
275
276
  this.setSelection(li, e);
276
277
  }
277
278
  if (this.isPopupOpen) {
@@ -848,6 +848,7 @@ var MultiSelect = /** @class */ (function (_super) {
848
848
  if (this.isFiltered) {
849
849
  if ((this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery))) {
850
850
  filterQuery = this.customFilterQuery.clone();
851
+ return this.virtualFilterQuery(filterQuery);
851
852
  }
852
853
  else if (!this.enableVirtualization) {
853
854
  return filterQuery;
@@ -2698,7 +2699,7 @@ var MultiSelect = /** @class */ (function (_super) {
2698
2699
  getValue(((this.fields.value) ? this.fields.value : ''), this.value[this.value.length - 1]) :
2699
2700
  this.value[this.value.length - 1];
2700
2701
  var temp = text;
2701
- var textValues = this.text != null && this.text !== '' ? this.text + ',' + temp : temp;
2702
+ var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + temp : temp;
2702
2703
  currentText.push(textValues);
2703
2704
  this.setProperties({ text: currentText.toString() }, true);
2704
2705
  }
@@ -3633,7 +3634,7 @@ var MultiSelect = /** @class */ (function (_super) {
3633
3634
  }
3634
3635
  else {
3635
3636
  temp = isInitialVirtualData && delim ? this_1.text : this_1.getTextByValue(value);
3636
- var textValues = isInitialVirtualData ? this_1.text : (this_1.text && this_1.text !== '' ? this_1.text + ',' + temp : temp);
3637
+ var textValues = isInitialVirtualData ? this_1.text : (this_1.text && this_1.text !== '' ? this_1.text + this_1.delimiterChar + temp : temp);
3637
3638
  data += temp + delimiterChar + ' ';
3638
3639
  text.push(textValues);
3639
3640
  hiddenElementContent = this_1.hiddenElement.innerHTML;
@@ -3801,7 +3802,7 @@ var MultiSelect = /** @class */ (function (_super) {
3801
3802
  (this.mode === 'Box' || this.mode === 'Default'))) ||
3802
3803
  (this.enableVirtualization && value != null && text != null && !isCustomData)) {
3803
3804
  var currentText = [];
3804
- var textValues = this.text != null && this.text !== '' ? this.text + ',' + text : text;
3805
+ var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + text : text;
3805
3806
  currentText.push(textValues);
3806
3807
  this.setProperties({ text: currentText.toString() }, true);
3807
3808
  this.addChip(text, value);
@@ -3837,7 +3838,7 @@ var MultiSelect = /** @class */ (function (_super) {
3837
3838
  this.wireListEvents();
3838
3839
  }
3839
3840
  var currentText = [];
3840
- var textValues = this.text != null && this.text !== '' ? this.text + ',' + text : text;
3841
+ var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + text : text;
3841
3842
  currentText.push(textValues);
3842
3843
  this.setProperties({ text: currentText.toString() }, true);
3843
3844
  this.addChip(text, value);