@syncfusion/ej2-dropdowns 33.1.46 → 33.1.49

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 : 33.1.46
3
+ * version : 33.1.49
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-dropdowns",
3
- "version": "33.1.46",
3
+ "version": "33.1.49",
4
4
  "description": "Essential JS 2 DropDown Components",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -10,10 +10,10 @@
10
10
  "dependencies": {
11
11
  "@syncfusion/ej2-base": "~33.1.45",
12
12
  "@syncfusion/ej2-data": "~33.1.45",
13
- "@syncfusion/ej2-inputs": "~33.1.44",
14
- "@syncfusion/ej2-lists": "~33.1.44",
15
- "@syncfusion/ej2-navigations": "~33.1.46",
16
- "@syncfusion/ej2-notifications": "~33.1.44",
13
+ "@syncfusion/ej2-inputs": "~33.1.49",
14
+ "@syncfusion/ej2-lists": "~33.1.47",
15
+ "@syncfusion/ej2-navigations": "~33.1.49",
16
+ "@syncfusion/ej2-notifications": "~33.1.49",
17
17
  "@syncfusion/ej2-popups": "~33.1.44"
18
18
  },
19
19
  "devDependencies": {},
@@ -770,12 +770,25 @@ var DropDownBase = /** @class */ (function (_super) {
770
770
  _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
771
771
  var isReOrder = true;
772
772
  if (!_this.virtualSelectAll) {
773
+ var newQueryWhereCount = 0;
774
+ var queryWhereCount = 0;
773
775
  var newQuery = query_1.clone();
774
776
  for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
775
777
  if (newQuery.queries[queryElements].fn === 'onWhere') {
776
778
  isWhereExist_1 = true;
779
+ newQueryWhereCount++;
777
780
  }
778
781
  }
782
+ for (var queryElements = 0; !isNullOrUndefined(_this.query) &&
783
+ queryElements < _this.query.queries.length; queryElements++) {
784
+ if (_this.query.queries[queryElements].fn === 'onWhere') {
785
+ isWhereExist_1 = true;
786
+ queryWhereCount++;
787
+ }
788
+ }
789
+ if (queryWhereCount === newQueryWhereCount) {
790
+ isWhereExist_1 = false;
791
+ }
779
792
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
780
793
  if (_this.isVirtualizationEnabled && (e.count !== 0 && e.count < (_this.itemCount * 2))) {
781
794
  if (newQuery) {
@@ -333,6 +333,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
333
333
  private clearIconWidth;
334
334
  private isClicked;
335
335
  private documentClickContext;
336
+ private windowResizeContext;
336
337
  private isCheckAllCalled;
337
338
  private isFromFilterChange;
338
339
  private valueTemplateContainer;
@@ -172,6 +172,7 @@ var DropDownTree = /** @class */ (function (_super) {
172
172
  _this.filterDelayTime = 300;
173
173
  _this.isClicked = false;
174
174
  _this.documentClickContext = _this.onDocumentClick.bind(_this);
175
+ _this.windowResizeContext = _this.windowResize.bind(_this);
175
176
  // Specifies if the checkAll method has been called
176
177
  _this.isCheckAllCalled = false;
177
178
  _this.isFromFilterChange = false;
@@ -661,11 +662,14 @@ var DropDownTree = /** @class */ (function (_super) {
661
662
  EventHandler.add(this.inputWrapper, 'mousemove', this.mouseIn, this);
662
663
  EventHandler.add(this.inputWrapper, 'mouseout', this.onMouseLeave, this);
663
664
  EventHandler.add(this.overAllClear, 'mousedown', this.clearAll, this);
664
- EventHandler.add(window, 'resize', this.windowResize, this);
665
+ EventHandler.add(window, 'resize', this.windowResizeContext);
665
666
  var formElement = closest(this.inputWrapper, 'form');
666
667
  if (formElement) {
667
668
  EventHandler.add(formElement, 'reset', this.resetValueHandler, this);
668
669
  }
670
+ if (this.keyboardModule && typeof this.keyboardModule.destroy === 'function') {
671
+ this.keyboardModule.destroy();
672
+ }
669
673
  this.keyboardModule = new KeyboardEvents(this.inputWrapper, {
670
674
  keyAction: this.keyActionHandler.bind(this),
671
675
  keyConfigs: this.keyConfigs,
@@ -673,6 +677,9 @@ var DropDownTree = /** @class */ (function (_super) {
673
677
  });
674
678
  };
675
679
  DropDownTree.prototype.wireTreeEvents = function () {
680
+ if (this.keyboardModule && typeof this.keyboardModule.destroy === 'function') {
681
+ this.keyboardModule.destroy();
682
+ }
676
683
  this.keyboardModule = new KeyboardEvents(this.tree, {
677
684
  keyAction: this.treeAction.bind(this),
678
685
  keyConfigs: this.keyConfigs,
@@ -697,7 +704,7 @@ var DropDownTree = /** @class */ (function (_super) {
697
704
  EventHandler.remove(this.inputWrapper, 'mousemove', this.mouseIn);
698
705
  EventHandler.remove(this.inputWrapper, 'mouseout', this.onMouseLeave);
699
706
  EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
700
- EventHandler.remove(window, 'resize', this.windowResize);
707
+ EventHandler.remove(window, 'resize', this.windowResizeContext);
701
708
  var formElement = closest(this.inputWrapper, 'form');
702
709
  if (formElement) {
703
710
  EventHandler.remove(formElement, 'reset', this.resetValueHandler);
@@ -378,6 +378,12 @@ var Mention = /** @class */ (function (_super) {
378
378
  }
379
379
  }
380
380
  var currentRange = this.getTextRange();
381
+ // Pre-flight guard: close popup if mention character is no longer present
382
+ if (this.isPopupOpen && currentRange !== undefined && currentRange.indexOf(this.mentionChar) === -1) {
383
+ this.queryString = '';
384
+ this.hidePopup();
385
+ return;
386
+ }
381
387
  // eslint-disable-next-line security/detect-non-literal-regexp
382
388
  var mentionRegex = new RegExp(this.mentionChar.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '\\s');
383
389
  var isValid = currentRange && mentionRegex.test(currentRange) ? false : true;
@@ -5059,7 +5059,7 @@ var MultiSelect = /** @class */ (function (_super) {
5059
5059
  this.virtualSelectAll = true;
5060
5060
  length = this.virtualSelectAllData && this.virtualSelectAllData.length !== 0 ? this.virtualSelectAllData.length : length;
5061
5061
  this.listData = this.virtualSelectAllData;
5062
- var ulElement = this.createListItems(this.virtualSelectAllData.slice(0, 30), this.fields);
5062
+ var ulElement = this.createListItems(this.virtualSelectAllData.slice(0, Math.min(50, this.virtualSelectAllData.length)), this.fields);
5063
5063
  var firstItems = ulElement.querySelectorAll('li');
5064
5064
  var fragment_1 = document.createDocumentFragment();
5065
5065
  firstItems.forEach(function (node) {
@@ -5086,7 +5086,10 @@ var MultiSelect = /** @class */ (function (_super) {
5086
5086
  this.updateListSelection(concatenatedNodeList[index], event, length - index);
5087
5087
  }
5088
5088
  else {
5089
- var value = getValue(this.fields.value ? this.fields.value : '', this.virtualSelectAllData[index]);
5089
+ var rawItem = this.virtualSelectAllData[index];
5090
+ var value = this.fields.value
5091
+ ? getValue(this.fields.value, rawItem)
5092
+ : (typeof rawItem === 'object' && rawItem !== null ? rawItem : rawItem);
5090
5093
  value = this.allowObjectBinding ? this.getDataByValue(value) : value;
5091
5094
  if (((!this.allowObjectBinding && this.value && this.value.indexOf(value) >= 0) ||
5092
5095
  (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) >= 0))) {
@@ -5118,12 +5121,17 @@ var MultiSelect = /** @class */ (function (_super) {
5118
5121
  var batch = dataArray.slice(currentIndex, endIndex);
5119
5122
  // Use map on the batch
5120
5123
  batch.map(function (obj) {
5121
- if (_this.value && obj[_this.fields.value] != null && Array.isArray(_this.value) &&
5122
- ((!_this.allowObjectBinding && _this.value.indexOf(obj[_this.fields.value]) < 0) ||
5123
- (_this.allowObjectBinding && !_this.isObjectInArray(obj[_this.fields.value], _this.value)))) {
5124
- var value = obj[_this.fields.value];
5125
- var text = (obj[_this.fields.text]).toString();
5126
- _this.dispatchSelect(value, event, null, false, length, obj, text);
5124
+ var isPlainValue = typeof obj !== 'object' || obj === null;
5125
+ var value = isPlainValue
5126
+ ? obj
5127
+ : (_this.fields.value ? obj[_this.fields.value] : obj);
5128
+ var text = isPlainValue
5129
+ ? String(obj)
5130
+ : (_this.fields.text ? (obj[_this.fields.text]).toString() : String(obj));
5131
+ if (_this.value && value != null && Array.isArray(_this.value) &&
5132
+ ((!_this.allowObjectBinding && _this.value.indexOf(value) < 0) ||
5133
+ (_this.allowObjectBinding && !_this.isObjectInArray(value, _this.value)))) {
5134
+ _this.dispatchSelect(value, event, null, false, length, isPlainValue ? null : obj, text);
5127
5135
  }
5128
5136
  });
5129
5137
  currentIndex = endIndex;