@syncfusion/ej2-dropdowns 33.1.44 → 33.1.47

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.44
3
+ * version : 33.1.47
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.44",
3
+ "version": "33.1.47",
4
4
  "description": "Essential JS 2 DropDown Components",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,11 +8,11 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-dropdowns.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~33.1.44",
12
- "@syncfusion/ej2-data": "~33.1.44",
13
- "@syncfusion/ej2-inputs": "~33.1.44",
14
- "@syncfusion/ej2-lists": "~33.1.44",
15
- "@syncfusion/ej2-navigations": "~33.1.44",
11
+ "@syncfusion/ej2-base": "~33.1.45",
12
+ "@syncfusion/ej2-data": "~33.1.45",
13
+ "@syncfusion/ej2-inputs": "~33.1.47",
14
+ "@syncfusion/ej2-lists": "~33.1.47",
15
+ "@syncfusion/ej2-navigations": "~33.1.47",
16
16
  "@syncfusion/ej2-notifications": "~33.1.44",
17
17
  "@syncfusion/ej2-popups": "~33.1.44"
18
18
  },
@@ -265,7 +265,7 @@ var VirtualScroll = /** @class */ (function () {
265
265
  this.parent.totalItemsCount();
266
266
  }
267
267
  if (isListUpdated) {
268
- if (this.component === 'multiselect' && this.parent.itemCount * 2 > this.parent.totalItemCount) {
268
+ if (this.component === 'multiselect' && this.parent.itemCount * 2 > this.parent.totalItemCount && !(this.parent.dataSource instanceof DataManager)) {
269
269
  this.parent.viewPortInfo.endIndex = endIndex = this.parent.totalItemCount;
270
270
  this.parent.isVirtualTrackHeight = true;
271
271
  }
@@ -482,6 +482,12 @@ var DropDownBase = /** @class */ (function (_super) {
482
482
  translateY = translateY - (this.skeletonCount * this.listItemHeight);
483
483
  translateY = ((this.viewPortInfo.startIndex === 0 && this.listData && this.listData.length === 0) ||
484
484
  this.skeletonCount === 0) ? 0 : translateY;
485
+ var virtualElement = this.list.getElementsByClassName('e-virtual-ddl')[0];
486
+ var style = virtualElement && virtualElement.style && virtualElement.style.height;
487
+ if (this.getModuleName() === 'multiselect' && !isNullOrUndefined(style) && style === '' &&
488
+ this.dataSource instanceof DataManager) {
489
+ translateY = 0;
490
+ }
485
491
  var styleText = "transform: translate(0px, " + translateY + "px);";
486
492
  return styleText;
487
493
  };
@@ -764,12 +770,25 @@ var DropDownBase = /** @class */ (function (_super) {
764
770
  _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
765
771
  var isReOrder = true;
766
772
  if (!_this.virtualSelectAll) {
773
+ var newQueryWhereCount = void 0;
774
+ var queryWhereCount = void 0;
767
775
  var newQuery = query_1.clone();
768
776
  for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
769
777
  if (newQuery.queries[queryElements].fn === 'onWhere') {
770
778
  isWhereExist_1 = true;
779
+ newQueryWhereCount++;
771
780
  }
772
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
+ }
773
792
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
774
793
  if (_this.isVirtualizationEnabled && (e.count !== 0 && e.count < (_this.itemCount * 2))) {
775
794
  if (newQuery) {
@@ -527,6 +527,11 @@ var DropDownList = /** @class */ (function (_super) {
527
527
  this.isActive = false;
528
528
  this.beforePopupOpen = false;
529
529
  }
530
+ // Cancel any pending debounced filtering when focus leaves the component.
531
+ if (this.debounceTimer !== null) {
532
+ clearTimeout(this.debounceTimer);
533
+ this.debounceTimer = null;
534
+ }
530
535
  this.isFocused = false;
531
536
  };
532
537
  DropDownList.prototype.focusOutAction = function (e) {
@@ -3605,6 +3610,12 @@ var DropDownList = /** @class */ (function (_super) {
3605
3610
  }
3606
3611
  else {
3607
3612
  this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
3613
+ if (this.element.tagName === this.getNgDirective()) {
3614
+ // Pre-populate id so Input.createInput/createFloatingInput can wire label.for correctly
3615
+ var ngId = this.element.getAttribute('id') ? this.element.getAttribute('id') : getUniqueID('ej2_dropdownlist');
3616
+ this.element.id = ngId;
3617
+ this.inputElement.id = ngId + '_input';
3618
+ }
3608
3619
  if (this.element.tagName !== this.getNgDirective()) {
3609
3620
  this.element.style.display = 'none';
3610
3621
  }
@@ -3668,6 +3679,9 @@ var DropDownList = /** @class */ (function (_super) {
3668
3679
  var id = this.element.getAttribute('id') ? this.element.getAttribute('id') : getUniqueID('ej2_dropdownlist');
3669
3680
  this.element.id = id;
3670
3681
  this.hiddenElement.id = id + '_hidden';
3682
+ if (this.element.tagName === this.getNgDirective() && !this.inputElement.id) {
3683
+ this.inputElement.id = id + '_input';
3684
+ }
3671
3685
  this.targetElement().setAttribute('tabindex', this.tabIndex);
3672
3686
  if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') && !this.readonly) {
3673
3687
  if (!this.inputElement.hasAttribute('aria-label')) {
@@ -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,7 +662,7 @@ 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);
@@ -697,7 +698,7 @@ var DropDownTree = /** @class */ (function (_super) {
697
698
  EventHandler.remove(this.inputWrapper, 'mousemove', this.mouseIn);
698
699
  EventHandler.remove(this.inputWrapper, 'mouseout', this.onMouseLeave);
699
700
  EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
700
- EventHandler.remove(window, 'resize', this.windowResize);
701
+ EventHandler.remove(window, 'resize', this.windowResizeContext);
701
702
  var formElement = closest(this.inputWrapper, 'form');
702
703
  if (formElement) {
703
704
  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;
@@ -25,9 +25,15 @@ export function createFloatLabel(overAllWrapper, searchWrapper, element, inputEl
25
25
  var floatLabelElement = createElement('label', { className: FLOATTEXT });
26
26
  var id = element.getAttribute('id') ? element.getAttribute('id') : getUniqueID('ej2_multiselect');
27
27
  element.id = id;
28
+ var isAngularComponent = false;
29
+ if (element.tagName && element.tagName.indexOf('EJS-') === 0 && inputElement.id === '' && element !== inputElement) {
30
+ inputElement.id = id + '_input';
31
+ isAngularComponent = true;
32
+ }
28
33
  if (!isNullOrUndefined(element.id) && element.id !== '') {
29
- floatLabelElement.id = 'label_' + element.id.replace(/ /g, '_');
30
- floatLabelElement.setAttribute('for', element.id);
34
+ var labelTarget = isAngularComponent ? inputElement.id || element.id : element.id;
35
+ floatLabelElement.id = 'label_' + labelTarget.replace(/ /g, '_');
36
+ floatLabelElement.setAttribute('for', labelTarget);
31
37
  attributes(inputElement, { 'aria-labelledby': floatLabelElement.id });
32
38
  }
33
39
  if (!isNullOrUndefined(inputElement.placeholder) && inputElement.placeholder !== '') {
@@ -2523,6 +2523,9 @@ var MultiSelect = /** @class */ (function (_super) {
2523
2523
  selectedChips[0].removeAttribute('id');
2524
2524
  if (!isNullOrUndefined(this.inputElement) && this.inputElement.hasAttribute('aria-activedescendant')) {
2525
2525
  this.inputElement.removeAttribute('aria-activedescendant');
2526
+ if (!this.inputElement.hasAttribute('aria-describedby') && this.chipCollectionWrapper.id) {
2527
+ this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
2528
+ }
2526
2529
  }
2527
2530
  }
2528
2531
  this.removeChipFocus();
@@ -2534,6 +2537,9 @@ var MultiSelect = /** @class */ (function (_super) {
2534
2537
  element.setAttribute('id', this.element.id + '_chip_item');
2535
2538
  if (!isNullOrUndefined(this.inputElement) && element.id) {
2536
2539
  this.inputElement.setAttribute('aria-activedescendant', element.id);
2540
+ if (this.inputElement.hasAttribute('aria-describedby')) {
2541
+ this.inputElement.removeAttribute('aria-describedby');
2542
+ }
2537
2543
  }
2538
2544
  var chipClose = element.querySelector('span.' + CHIP_CLOSE.split(' ')[0]);
2539
2545
  if (chipClose) {
@@ -5059,9 +5065,11 @@ var MultiSelect = /** @class */ (function (_super) {
5059
5065
  firstItems.forEach(function (node) {
5060
5066
  fragment_1.appendChild(node.cloneNode(true));
5061
5067
  });
5062
- li.forEach(function (node) {
5063
- fragment_1.appendChild(node.cloneNode(true));
5064
- });
5068
+ if ((this.totalItemCount >= (this.itemCount * 2) && this.dataSource instanceof DataManager)) {
5069
+ li.forEach(function (node) {
5070
+ fragment_1.appendChild(node.cloneNode(true));
5071
+ });
5072
+ }
5065
5073
  var concatenatedNodeList = fragment_1.childNodes;
5066
5074
  if (this.virtualSelectAllData instanceof Array) {
5067
5075
  while (index < length && index <= 50 && index < count) {
@@ -5962,7 +5970,8 @@ var MultiSelect = /** @class */ (function (_super) {
5962
5970
  _this.renderItems(_this.mainData, _this.fields);
5963
5971
  }
5964
5972
  _this.virtualCustomData = null;
5965
- _this.isVirtualTrackHeight = _this.totalItemCount >= (_this.itemCount * 2) ? false : true;
5973
+ _this.isVirtualTrackHeight = (_this.totalItemCount >= (_this.itemCount * 2) ||
5974
+ _this.dataSource instanceof DataManager) ? false : true;
5966
5975
  }
5967
5976
  });
5968
5977
  }
@@ -6179,7 +6188,7 @@ var MultiSelect = /** @class */ (function (_super) {
6179
6188
  }
6180
6189
  else {
6181
6190
  this.chipCollectionWrapper = this.createElement('span', {
6182
- className: CHIP_WRAPPER, attrs: { role: 'listbox' }
6191
+ className: CHIP_WRAPPER
6183
6192
  });
6184
6193
  this.chipCollectionWrapper.style.display = 'none';
6185
6194
  if (this.mode === 'Default') {