@syncfusion/ej2-dropdowns 29.2.4 → 29.2.7

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 : 29.2.4
3
+ * version : 29.2.7
4
4
  * Copyright Syncfusion Inc. 2001 - 2024. 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@29.1.41",
3
+ "_id": "@syncfusion/ej2-dropdowns@29.2.5",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-MguJkedxJ1fsjo2kpSIDWlIMg4AM/9Sivaogd+NwxyxjKdkn5jg5325cmvC/cO1A+ZenI0w5fwOotB1ANtPDiA==",
5
+ "_integrity": "sha512-IsEFxa88R9vq0rxkXFKbcEvdOoqOm5ylg2VOqzviJxv1+1il6HugrjpFGDconadN+HnRhW6nC539m8dj1CeRbg==",
6
6
  "_location": "/@syncfusion/ej2-dropdowns",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -36,8 +36,8 @@
36
36
  "/@syncfusion/ej2-spreadsheet",
37
37
  "/@syncfusion/ej2-vue-dropdowns"
38
38
  ],
39
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-29.1.41.tgz",
40
- "_shasum": "7a112cc2e360ea39ea9a4c681a580cdffa9ef3ff",
39
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-29.2.5.tgz",
40
+ "_shasum": "73cddd41df6eda7061648a90dd58f5f6d5a95a03",
41
41
  "_spec": "@syncfusion/ej2-dropdowns@*",
42
42
  "_where": "/jenkins/workspace/elease-automation_release_29.1.1/packages/included",
43
43
  "author": {
@@ -47,11 +47,11 @@
47
47
  "dependencies": {
48
48
  "@syncfusion/ej2-base": "~29.2.4",
49
49
  "@syncfusion/ej2-data": "~29.2.4",
50
- "@syncfusion/ej2-inputs": "~29.2.4",
50
+ "@syncfusion/ej2-inputs": "~29.2.5",
51
51
  "@syncfusion/ej2-lists": "~29.2.4",
52
- "@syncfusion/ej2-navigations": "~29.2.4",
52
+ "@syncfusion/ej2-navigations": "~29.2.7",
53
53
  "@syncfusion/ej2-notifications": "~29.2.4",
54
- "@syncfusion/ej2-popups": "~29.2.4"
54
+ "@syncfusion/ej2-popups": "~29.2.7"
55
55
  },
56
56
  "deprecated": false,
57
57
  "description": "Essential JS 2 DropDown Components",
@@ -76,7 +76,7 @@
76
76
  "module": "./index.js",
77
77
  "name": "@syncfusion/ej2-dropdowns",
78
78
  "typings": "index.d.ts",
79
- "version": "29.2.4",
79
+ "version": "29.2.7",
80
80
  "sideEffects": false,
81
81
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
82
82
  }
@@ -1,4 +1,4 @@
1
- import { EventHandler, Property, Event, EmitType, addClass, Browser, KeyboardEventArgs, removeClass, detach } from '@syncfusion/ej2-base';import { isNullOrUndefined, NotifyPropertyChanges, getValue, setValue } from '@syncfusion/ej2-base';import { DropDownList, dropDownListClasses } from '../drop-down-list/drop-down-list';import { FilteringEventArgs } from '../drop-down-base/drop-down-base';import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';import { Search } from '../common/incremental-search';import { createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';import { Input, InputObject, FloatLabelType } from '@syncfusion/ej2-inputs';import { DataManager, DataOptions, Predicate, Query } from '@syncfusion/ej2-data';
1
+ import { EventHandler, Property, Event, EmitType, addClass, Browser, KeyboardEventArgs, removeClass, detach } from '@syncfusion/ej2-base';import { isNullOrUndefined, NotifyPropertyChanges, getValue, setValue } from '@syncfusion/ej2-base';import { DropDownList, dropDownListClasses } from '../drop-down-list/drop-down-list';import { FilteringEventArgs, ResultData } from '../drop-down-base/drop-down-base';import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';import { Search } from '../common/incremental-search';import { createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';import { Input, InputObject, FloatLabelType } from '@syncfusion/ej2-inputs';import { DataManager, DataOptions, Predicate, Query } from '@syncfusion/ej2-data';
2
2
  import {CustomValueSpecifierEventArgs} from "./combo-box";
3
3
  import {DropDownListModel} from "../drop-down-list/drop-down-list-model";
4
4
 
@@ -179,6 +179,7 @@ var ComboBox = /** @class */ (function (_super) {
179
179
  }
180
180
  };
181
181
  ComboBox.prototype.updateValues = function () {
182
+ var _this = this;
182
183
  if (this.fields.disabled) {
183
184
  if (this.value != null) {
184
185
  this.value = !this.isDisableItemValue(this.value) ? this.value : null;
@@ -199,19 +200,22 @@ var ComboBox = /** @class */ (function (_super) {
199
200
  var fields = (this.fields.value) ? this.fields.value : '';
200
201
  var currentValue_1 = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
201
202
  if (this.dataSource instanceof DataManager) {
202
- var getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue_1)));
203
- if (getItem && getItem.length > 0) {
204
- this.itemData = getItem[0];
205
- doesItemExist = true;
206
- var dataItem = this.getItemData();
207
- var value = this.allowObjectBinding
208
- ? this.getDataByValue(dataItem.value)
209
- : dataItem.value;
210
- if ((this.value === dataItem.value && this.text !== dataItem.text)
211
- || (this.value !== dataItem.value && this.text === dataItem.text)) {
212
- this.setProperties({ 'text': dataItem.text ? dataItem.text.toString() : dataItem.text, 'value': value });
203
+ this.dataSource.executeQuery(new Query().where(new Predicate(fields, 'equal', currentValue_1)))
204
+ .then(function (e) {
205
+ if (e.result.length > 0) {
206
+ _this.itemData = e.result[0];
207
+ var dataItem = _this.getItemData();
208
+ var value = _this.allowObjectBinding ?
209
+ _this.getDataByValue(dataItem.value) : dataItem.value;
210
+ if ((_this.value === dataItem.value && _this.text !== dataItem.text) ||
211
+ (_this.value !== dataItem.value && _this.text === dataItem.text)) {
212
+ _this.setProperties({ 'text': dataItem.text ? dataItem.text.toString() : dataItem.text, 'value': value });
213
+ }
213
214
  }
214
- }
215
+ else {
216
+ _this.valueMuteChange(null);
217
+ }
218
+ });
215
219
  }
216
220
  else {
217
221
  var getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue_1)));
@@ -239,7 +243,8 @@ var ComboBox = /** @class */ (function (_super) {
239
243
  (this.allowCustom && this.enableVirtualization && !doesItemExist)) {
240
244
  this.valueMuteChange(this.value);
241
245
  }
242
- else if (!this.enableVirtualization || (this.enableVirtualization && !doesItemExist)) {
246
+ else if (!this.enableVirtualization || (this.enableVirtualization && !(this.dataSource instanceof DataManager)
247
+ && !doesItemExist)) {
243
248
  this.valueMuteChange(null);
244
249
  }
245
250
  }
@@ -403,7 +408,10 @@ var ComboBox = /** @class */ (function (_super) {
403
408
  }
404
409
  }
405
410
  var activeElement = activeItem.item;
406
- if (!isNullOrUndefined(activeElement)) {
411
+ var dataItem_1 = this.getItemData();
412
+ if ((!isNullOrUndefined(activeElement) && !this.enableVirtualization) || (this.enableVirtualization &&
413
+ this.isTyped && isNullOrUndefined(dataItem_1) && isNullOrUndefined(dataItem_1.value) &&
414
+ dataItem_1.value.toString() === activeElement.getAttribute('data-value').toString())) {
407
415
  var count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
408
416
  var height = parseInt(getComputedStyle(this.liCollections[0], null).getPropertyValue('height'), 10);
409
417
  if (!isNaN(height) && this.getModuleName() !== 'autocomplete') {
@@ -1016,6 +1016,7 @@ var DropDownBase = /** @class */ (function (_super) {
1016
1016
  };
1017
1017
  /* eslint-disable @typescript-eslint/no-unused-vars */
1018
1018
  DropDownBase.prototype.onActionComplete = function (ulElement, list, e) {
1019
+ var _this = this;
1019
1020
  /* eslint-enable @typescript-eslint/no-unused-vars */
1020
1021
  this.listData = list;
1021
1022
  if (this.isVirtualizationEnabled && !this.isCustomDataUpdated && !this.virtualSelectAll) {
@@ -1045,6 +1046,13 @@ var DropDownBase = /** @class */ (function (_super) {
1045
1046
  }
1046
1047
  }
1047
1048
  }
1049
+ if (this.getModuleName() === 'multiselect' && this.isAngular && this.ngEle) {
1050
+ var popupHolder = this.list;
1051
+ if (popupHolder) {
1052
+ var prevHeight = popupHolder.offsetHeight + 'px';
1053
+ popupHolder.style.height = prevHeight;
1054
+ }
1055
+ }
1048
1056
  if (!isNullOrUndefined(this.list)) {
1049
1057
  if (!this.isVirtualizationEnabled) {
1050
1058
  this.list.innerHTML = '';
@@ -1054,6 +1062,15 @@ var DropDownBase = /** @class */ (function (_super) {
1054
1062
  this.postRender(this.list, list, this.bindEvent);
1055
1063
  }
1056
1064
  }
1065
+ if (this.getModuleName() === 'multiselect' && this.isAngular && this.ngEle) {
1066
+ var popupHolder_1 = this.list;
1067
+ if (popupHolder_1) {
1068
+ setTimeout(function () {
1069
+ popupHolder_1.style.height = '';
1070
+ _this.refreshPopup();
1071
+ }, 0);
1072
+ }
1073
+ }
1057
1074
  };
1058
1075
  /* eslint-disable @typescript-eslint/no-unused-vars */
1059
1076
  DropDownBase.prototype.postRender = function (listElement, list, bindEvent) {
@@ -1461,7 +1461,8 @@ var DropDownList = /** @class */ (function (_super) {
1461
1461
  // eslint-disable-next-line @typescript-eslint/no-this-alias
1462
1462
  var proxy_1 = this;
1463
1463
  // eslint-disable-next-line max-len
1464
- var duration = (this.element.tagName === this.getNgDirective() && this.itemTemplate) ? 500 : 100;
1464
+ var duration = ((this.dataSource instanceof DataManager) && this.groupTemplate) ? 700 :
1465
+ (this.element.tagName === this.getNgDirective() && this.itemTemplate) ? 500 : 100;
1465
1466
  if (!this.isSecondClick) {
1466
1467
  setTimeout(function () {
1467
1468
  proxy_1.cloneElements();
@@ -2322,6 +2323,9 @@ var DropDownList = /** @class */ (function (_super) {
2322
2323
  }
2323
2324
  if (this.getInitialData) {
2324
2325
  this.updateActionCompleteDataValues(ulElement, list);
2326
+ if (this.enableVirtualization) {
2327
+ this.updateSelectElementData(this.allowFiltering);
2328
+ }
2325
2329
  this.getInitialData = false;
2326
2330
  this.isReactTemplateUpdate = true;
2327
2331
  this.searchLists(this.filterArgs);
@@ -2376,16 +2380,6 @@ var DropDownList = /** @class */ (function (_super) {
2376
2380
  if (!_this.enableVirtualization) {
2377
2381
  _this.addItem(e.result, list.length);
2378
2382
  }
2379
- else {
2380
- _this.itemData = e.result[0];
2381
- var dataItem = _this.getItemData();
2382
- var value_2 = _this.allowObjectBinding ?
2383
- _this.getDataByValue(dataItem.value) : dataItem.value;
2384
- if ((_this.value === dataItem.value && _this.text !== dataItem.text) ||
2385
- (_this.value !== dataItem.value && _this.text === dataItem.text)) {
2386
- _this.setProperties({ 'text': dataItem.text ? dataItem.text.toString() : dataItem.text, 'value': value_2 });
2387
- }
2388
- }
2389
2383
  _this.updateValues();
2390
2384
  }
2391
2385
  else {
@@ -2512,10 +2506,10 @@ var DropDownList = /** @class */ (function (_super) {
2512
2506
  DropDownList.prototype.addNewItem = function (listData, newElement) {
2513
2507
  var _this = this;
2514
2508
  if (!isNullOrUndefined(this.itemData) && !isNullOrUndefined(newElement)) {
2515
- var value_3 = this.getItemData().value;
2509
+ var value_2 = this.getItemData().value;
2516
2510
  var isExist = listData.some(function (data) {
2517
- return (((typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean') && data === value_3) ||
2518
- (getValue(_this.fields.value, data) === value_3));
2511
+ return (((typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean') && data === value_2) ||
2512
+ (getValue(_this.fields.value, data) === value_2));
2519
2513
  });
2520
2514
  if (!isExist) {
2521
2515
  this.addItem(this.itemData);
@@ -3338,6 +3332,7 @@ var DropDownList = /** @class */ (function (_super) {
3338
3332
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3339
3333
  dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
3340
3334
  }
3335
+ this.customFilterQuery = null;
3341
3336
  if (this.enableVirtualization && this.isFiltering() && isFilterValue && this.totalItemCount !== dataSourceCount) {
3342
3337
  this.updateInitialData();
3343
3338
  this.checkAndResetCache();
@@ -3892,9 +3887,9 @@ var DropDownList = /** @class */ (function (_super) {
3892
3887
  var listLength_2 = this_1.getItems().length;
3893
3888
  var checkField = isNullOrUndefined(this_1.fields.value) ? this_1.fields.text : this_1.fields.value;
3894
3889
  this_1.typedString = '';
3895
- var value_4 = this_1.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
3890
+ var value_3 = this_1.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
3896
3891
  getValue(checkField, newProp.value) : newProp.value;
3897
- this_1.dataSource.executeQuery(this_1.getQuery(this_1.query).where(new Predicate(checkField, 'equal', value_4)))
3892
+ this_1.dataSource.executeQuery(this_1.getQuery(this_1.query).where(new Predicate(checkField, 'equal', value_3)))
3898
3893
  .then(function (e) {
3899
3894
  if (e.result.length > 0) {
3900
3895
  _this.addItem(e.result, listLength_2);
@@ -4083,6 +4078,9 @@ var DropDownList = /** @class */ (function (_super) {
4083
4078
  if (!this.enabled) {
4084
4079
  return;
4085
4080
  }
4081
+ if (this.getModuleName() === 'dropdownlist' && this.beforePopupOpen && !this.isPopupOpen) {
4082
+ this.beforePopupOpen = false;
4083
+ }
4086
4084
  this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
4087
4085
  if (this.isReact && this.getModuleName() === 'combobox' && this.itemTemplate && this.isCustomFilter && this.isAddNewItemTemplate) {
4088
4086
  this.renderList();
@@ -1649,7 +1649,8 @@ var DropDownTree = /** @class */ (function (_super) {
1649
1649
  loadOnDemand: this.treeSettings.loadOnDemand,
1650
1650
  nodeSelecting: this.onBeforeSelect.bind(this),
1651
1651
  nodeTemplate: this.itemTemplate,
1652
- checkDisabledChildren: this.treeSettings.checkDisabledChildren
1652
+ checkDisabledChildren: this.treeSettings.checkDisabledChildren,
1653
+ checkOnClick: true
1653
1654
  });
1654
1655
  this.treeObj.root = this.root ? this.root : this;
1655
1656
  this.treeObj.appendTo(this.tree);
@@ -1730,7 +1731,7 @@ var DropDownTree = /** @class */ (function (_super) {
1730
1731
  _this.popupObj.refreshPosition();
1731
1732
  if (!(_this.showSelectAll || _this.allowFiltering) && (!_this.popupDiv.classList.contains(NODATA)
1732
1733
  && _this.treeItems.length > 0)) {
1733
- var focusedElement = _this.value != null && _this.text != null ? _this.treeObj.element.querySelector('[data-uid="' + _this.value[0] + '"]') : null;
1734
+ var focusedElement = _this.value != null && _this.text != null ? _this.treeObj.element.querySelector('[data-uid="' + _this.value[_this.value.length - 1] + '"]') : null;
1734
1735
  if (focusedElement) {
1735
1736
  _this.treeObj.element.querySelector('li').setAttribute('tabindex', '-1');
1736
1737
  focusedElement.setAttribute('tabindex', '0');
@@ -2177,15 +2178,6 @@ var DropDownTree = /** @class */ (function (_super) {
2177
2178
  }
2178
2179
  var target = args.event.target;
2179
2180
  if ((target.classList.contains('e-fullrow') || target.classList.contains('e-list-text')) && this.showCheckBox) {
2180
- this.isClicked = true;
2181
- var getNodeDetails = this.treeObj.getNode(args.node);
2182
- if (getNodeDetails.isChecked === 'true') {
2183
- this.treeObj.uncheckAll([args.node]);
2184
- }
2185
- else {
2186
- this.treeObj.checkAll([args.node]);
2187
- }
2188
- this.isClicked = false;
2189
2181
  this.setMultiSelect();
2190
2182
  this.ensurePlaceHolder();
2191
2183
  }
@@ -1237,13 +1237,20 @@ var MultiSelect = /** @class */ (function (_super) {
1237
1237
  this.checkAndScrollParent();
1238
1238
  };
1239
1239
  MultiSelect.prototype.checkAndScrollParent = function () {
1240
- var parentElement = this.overAllWrapper ? this.overAllWrapper.parentElement : null;
1241
- if (parentElement) {
1242
- var wrapperHeight = parseFloat(getComputedStyle(this.overAllWrapper).height);
1243
- var parentMaxHeight = parseFloat(getComputedStyle(parentElement).maxHeight);
1244
- if (!isNaN(parentMaxHeight) && wrapperHeight > parentMaxHeight) {
1245
- parentElement.scrollTop = parentElement.scrollHeight;
1240
+ var scrollElement = this.overAllWrapper ? this.overAllWrapper.parentElement : null;
1241
+ while (scrollElement) {
1242
+ var scrollElementStyle = getComputedStyle(scrollElement);
1243
+ var scrollElmentHeight = parseFloat(scrollElementStyle.maxHeight) || parseFloat(scrollElementStyle.height);
1244
+ if (!isNaN(scrollElmentHeight) && this.isPopupOpen()) {
1245
+ var overflowY = scrollElementStyle.overflowY;
1246
+ var wrapperBottom = this.overAllWrapper.getBoundingClientRect().bottom;
1247
+ var scrollElementBottom = scrollElement.getBoundingClientRect().bottom;
1248
+ if ((overflowY === 'auto' || overflowY === 'scroll') && wrapperBottom > scrollElementBottom) {
1249
+ scrollElement.scrollTop += (wrapperBottom - scrollElementBottom) + 10;
1250
+ return;
1251
+ }
1246
1252
  }
1253
+ scrollElement = scrollElement.parentElement;
1247
1254
  }
1248
1255
  };
1249
1256
  MultiSelect.prototype.enable = function (state) {