@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.
@@ -525,7 +525,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
525
525
  this.parent.totalItemsCount();
526
526
  }
527
527
  if (isListUpdated) {
528
- if (this.component === 'multiselect' && this.parent.itemCount * 2 > this.parent.totalItemCount) {
528
+ if (this.component === 'multiselect' && this.parent.itemCount * 2 > this.parent.totalItemCount && !(this.parent.dataSource instanceof DataManager)) {
529
529
  this.parent.viewPortInfo.endIndex = endIndex = this.parent.totalItemCount;
530
530
  this.parent.isVirtualTrackHeight = true;
531
531
  }
@@ -1363,6 +1363,12 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1363
1363
  translateY = translateY - (this.skeletonCount * this.listItemHeight);
1364
1364
  translateY = ((this.viewPortInfo.startIndex === 0 && this.listData && this.listData.length === 0) ||
1365
1365
  this.skeletonCount === 0) ? 0 : translateY;
1366
+ var virtualElement = this.list.getElementsByClassName('e-virtual-ddl')[0];
1367
+ var style = virtualElement && virtualElement.style && virtualElement.style.height;
1368
+ if (this.getModuleName() === 'multiselect' && !isNullOrUndefined(style) && style === '' &&
1369
+ this.dataSource instanceof DataManager) {
1370
+ translateY = 0;
1371
+ }
1366
1372
  var styleText = "transform: translate(0px, " + translateY + "px);";
1367
1373
  return styleText;
1368
1374
  };
@@ -1645,12 +1651,25 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1645
1651
  _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
1646
1652
  var isReOrder = true;
1647
1653
  if (!_this.virtualSelectAll) {
1654
+ var newQueryWhereCount = void 0;
1655
+ var queryWhereCount = void 0;
1648
1656
  var newQuery = query_1.clone();
1649
1657
  for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
1650
1658
  if (newQuery.queries[queryElements].fn === 'onWhere') {
1651
1659
  isWhereExist_1 = true;
1660
+ newQueryWhereCount++;
1652
1661
  }
1653
1662
  }
1663
+ for (var queryElements = 0; !isNullOrUndefined(_this.query) &&
1664
+ queryElements < _this.query.queries.length; queryElements++) {
1665
+ if (_this.query.queries[queryElements].fn === 'onWhere') {
1666
+ isWhereExist_1 = true;
1667
+ queryWhereCount++;
1668
+ }
1669
+ }
1670
+ if (queryWhereCount === newQueryWhereCount) {
1671
+ isWhereExist_1 = false;
1672
+ }
1654
1673
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1655
1674
  if (_this.isVirtualizationEnabled && (e.count !== 0 && e.count < (_this.itemCount * 2))) {
1656
1675
  if (newQuery) {
@@ -3735,6 +3754,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3735
3754
  this.isActive = false;
3736
3755
  this.beforePopupOpen = false;
3737
3756
  }
3757
+ // Cancel any pending debounced filtering when focus leaves the component.
3758
+ if (this.debounceTimer !== null) {
3759
+ clearTimeout(this.debounceTimer);
3760
+ this.debounceTimer = null;
3761
+ }
3738
3762
  this.isFocused = false;
3739
3763
  };
3740
3764
  DropDownList.prototype.focusOutAction = function (e) {
@@ -6811,6 +6835,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
6811
6835
  }
6812
6836
  else {
6813
6837
  this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
6838
+ if (this.element.tagName === this.getNgDirective()) {
6839
+ // Pre-populate id so Input.createInput/createFloatingInput can wire label.for correctly
6840
+ var ngId = this.element.getAttribute('id') ? this.element.getAttribute('id') : getUniqueID('ej2_dropdownlist');
6841
+ this.element.id = ngId;
6842
+ this.inputElement.id = ngId + '_input';
6843
+ }
6814
6844
  if (this.element.tagName !== this.getNgDirective()) {
6815
6845
  this.element.style.display = 'none';
6816
6846
  }
@@ -6874,6 +6904,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
6874
6904
  var id = this.element.getAttribute('id') ? this.element.getAttribute('id') : getUniqueID('ej2_dropdownlist');
6875
6905
  this.element.id = id;
6876
6906
  this.hiddenElement.id = id + '_hidden';
6907
+ if (this.element.tagName === this.getNgDirective() && !this.inputElement.id) {
6908
+ this.inputElement.id = id + '_input';
6909
+ }
6877
6910
  this.targetElement().setAttribute('tabindex', this.tabIndex);
6878
6911
  if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') && !this.readonly) {
6879
6912
  if (!this.inputElement.hasAttribute('aria-label')) {
@@ -8227,6 +8260,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8227
8260
  _this.filterDelayTime = 300;
8228
8261
  _this.isClicked = false;
8229
8262
  _this.documentClickContext = _this.onDocumentClick.bind(_this);
8263
+ _this.windowResizeContext = _this.windowResize.bind(_this);
8230
8264
  // Specifies if the checkAll method has been called
8231
8265
  _this.isCheckAllCalled = false;
8232
8266
  _this.isFromFilterChange = false;
@@ -8716,7 +8750,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8716
8750
  EventHandler.add(this.inputWrapper, 'mousemove', this.mouseIn, this);
8717
8751
  EventHandler.add(this.inputWrapper, 'mouseout', this.onMouseLeave, this);
8718
8752
  EventHandler.add(this.overAllClear, 'mousedown', this.clearAll, this);
8719
- EventHandler.add(window, 'resize', this.windowResize, this);
8753
+ EventHandler.add(window, 'resize', this.windowResizeContext);
8720
8754
  var formElement = closest(this.inputWrapper, 'form');
8721
8755
  if (formElement) {
8722
8756
  EventHandler.add(formElement, 'reset', this.resetValueHandler, this);
@@ -8752,7 +8786,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8752
8786
  EventHandler.remove(this.inputWrapper, 'mousemove', this.mouseIn);
8753
8787
  EventHandler.remove(this.inputWrapper, 'mouseout', this.onMouseLeave);
8754
8788
  EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
8755
- EventHandler.remove(window, 'resize', this.windowResize);
8789
+ EventHandler.remove(window, 'resize', this.windowResizeContext);
8756
8790
  var formElement = closest(this.inputWrapper, 'form');
8757
8791
  if (formElement) {
8758
8792
  EventHandler.remove(formElement, 'reset', this.resetValueHandler);
@@ -13369,9 +13403,15 @@ function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement,
13369
13403
  var floatLabelElement = createElement('label', { className: FLOATTEXT });
13370
13404
  var id = element.getAttribute('id') ? element.getAttribute('id') : getUniqueID('ej2_multiselect');
13371
13405
  element.id = id;
13406
+ var isAngularComponent = false;
13407
+ if (element.tagName && element.tagName.indexOf('EJS-') === 0 && inputElement.id === '' && element !== inputElement) {
13408
+ inputElement.id = id + '_input';
13409
+ isAngularComponent = true;
13410
+ }
13372
13411
  if (!isNullOrUndefined(element.id) && element.id !== '') {
13373
- floatLabelElement.id = 'label_' + element.id.replace(/ /g, '_');
13374
- floatLabelElement.setAttribute('for', element.id);
13412
+ var labelTarget = isAngularComponent ? inputElement.id || element.id : element.id;
13413
+ floatLabelElement.id = 'label_' + labelTarget.replace(/ /g, '_');
13414
+ floatLabelElement.setAttribute('for', labelTarget);
13375
13415
  attributes(inputElement, { 'aria-labelledby': floatLabelElement.id });
13376
13416
  }
13377
13417
  if (!isNullOrUndefined(inputElement.placeholder) && inputElement.placeholder !== '') {
@@ -16004,6 +16044,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16004
16044
  selectedChips[0].removeAttribute('id');
16005
16045
  if (!isNullOrUndefined(this.inputElement) && this.inputElement.hasAttribute('aria-activedescendant')) {
16006
16046
  this.inputElement.removeAttribute('aria-activedescendant');
16047
+ if (!this.inputElement.hasAttribute('aria-describedby') && this.chipCollectionWrapper.id) {
16048
+ this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
16049
+ }
16007
16050
  }
16008
16051
  }
16009
16052
  this.removeChipFocus();
@@ -16015,6 +16058,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16015
16058
  element.setAttribute('id', this.element.id + '_chip_item');
16016
16059
  if (!isNullOrUndefined(this.inputElement) && element.id) {
16017
16060
  this.inputElement.setAttribute('aria-activedescendant', element.id);
16061
+ if (this.inputElement.hasAttribute('aria-describedby')) {
16062
+ this.inputElement.removeAttribute('aria-describedby');
16063
+ }
16018
16064
  }
16019
16065
  var chipClose = element.querySelector('span.' + CHIP_CLOSE$1.split(' ')[0]);
16020
16066
  if (chipClose) {
@@ -18540,9 +18586,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18540
18586
  firstItems.forEach(function (node) {
18541
18587
  fragment_1.appendChild(node.cloneNode(true));
18542
18588
  });
18543
- li.forEach(function (node) {
18544
- fragment_1.appendChild(node.cloneNode(true));
18545
- });
18589
+ if ((this.totalItemCount >= (this.itemCount * 2) && this.dataSource instanceof DataManager)) {
18590
+ li.forEach(function (node) {
18591
+ fragment_1.appendChild(node.cloneNode(true));
18592
+ });
18593
+ }
18546
18594
  var concatenatedNodeList = fragment_1.childNodes;
18547
18595
  if (this.virtualSelectAllData instanceof Array) {
18548
18596
  while (index < length && index <= 50 && index < count) {
@@ -19443,7 +19491,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
19443
19491
  _this.renderItems(_this.mainData, _this.fields);
19444
19492
  }
19445
19493
  _this.virtualCustomData = null;
19446
- _this.isVirtualTrackHeight = _this.totalItemCount >= (_this.itemCount * 2) ? false : true;
19494
+ _this.isVirtualTrackHeight = (_this.totalItemCount >= (_this.itemCount * 2) ||
19495
+ _this.dataSource instanceof DataManager) ? false : true;
19447
19496
  }
19448
19497
  });
19449
19498
  }
@@ -19660,7 +19709,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
19660
19709
  }
19661
19710
  else {
19662
19711
  this.chipCollectionWrapper = this.createElement('span', {
19663
- className: CHIP_WRAPPER$1, attrs: { role: 'listbox' }
19712
+ className: CHIP_WRAPPER$1
19664
19713
  });
19665
19714
  this.chipCollectionWrapper.style.display = 'none';
19666
19715
  if (this.mode === 'Default') {
@@ -24184,6 +24233,12 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
24184
24233
  }
24185
24234
  }
24186
24235
  var currentRange = this.getTextRange();
24236
+ // Pre-flight guard: close popup if mention character is no longer present
24237
+ if (this.isPopupOpen && currentRange !== undefined && currentRange.indexOf(this.mentionChar) === -1) {
24238
+ this.queryString = '';
24239
+ this.hidePopup();
24240
+ return;
24241
+ }
24187
24242
  // eslint-disable-next-line security/detect-non-literal-regexp
24188
24243
  var mentionRegex = new RegExp(this.mentionChar.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '\\s');
24189
24244
  var isValid = currentRange && mentionRegex.test(currentRange) ? false : true;