@syncfusion/ej2-dropdowns 32.1.21 → 32.1.22

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.
@@ -1734,7 +1734,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1734
1734
  var newQuery = _this.getQuery(eventArgs.query);
1735
1735
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1736
1736
  if (_this.isVirtualizationEnabled && (listItems.count !== 0 &&
1737
- listItems.count < (_this.itemCount * 2)) && !_this.appendUncheckList) {
1737
+ listItems.count < (_this.itemCount * 2))) {
1738
1738
  if (newQuery) {
1739
1739
  for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
1740
1740
  if (_this.getModuleName() === 'multiselect' && _this.isCheckBoxSelection && (newQuery.queries[queryElements].e && (newQuery.queries[queryElements].e.operator === 'notequal' ||
@@ -23744,6 +23744,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
23744
23744
  }
23745
23745
  };
23746
23746
  Mention.prototype.onKeyUp = function (e) {
23747
+ var _this = this;
23747
23748
  var rangetextContent;
23748
23749
  if (this.isUpDownKey && this.isPopupOpen && e.keyCode === 229) {
23749
23750
  this.isUpDownKey = false;
@@ -23795,13 +23796,33 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
23795
23796
  this.hidePopup();
23796
23797
  return;
23797
23798
  }
23799
+ var prevSiblingIsChip = (function () {
23800
+ if (!_this.isContentEditable(_this.inputElement) || !_this.range || !_this.range.startContainer) {
23801
+ return false;
23802
+ }
23803
+ var startContainer = _this.range.startContainer;
23804
+ var textNode = startContainer.nodeType === Node.TEXT_NODE ? startContainer : (function () {
23805
+ var idx = Math.min(_this.range.startOffset, startContainer.childNodes.length - 1);
23806
+ var child = startContainer.childNodes[idx] || startContainer.firstChild;
23807
+ return child && child.nodeType === Node.TEXT_NODE ? child : null;
23808
+ })();
23809
+ if (!textNode) {
23810
+ return false;
23811
+ }
23812
+ var firstChar = (textNode.data || '').replace(/\u200B/g, '').replace(/\u00A0/g, ' ').charAt(0);
23813
+ var previousSibling = textNode.previousSibling;
23814
+ while (previousSibling && ((previousSibling.nodeType === Node.TEXT_NODE && !(previousSibling.data || '').trim()) || (previousSibling.tagName === 'BR'))) {
23815
+ previousSibling = previousSibling.previousSibling;
23816
+ }
23817
+ return firstChar === _this.mentionChar && !!(previousSibling && previousSibling.classList && previousSibling.classList.contains('e-mention-chip'));
23818
+ })();
23798
23819
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
23799
23820
  if (((!currentRange || !lastWordRange) || (!lastWordRange.includes(this.mentionChar) && !this.requireLeadingSpace && !this.allowSpaces)) || e.code === 'Enter' || e.keyCode === 27 ||
23800
23821
  (lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
23801
23822
  (this.isContentEditable(this.inputElement) && this.range.startContainer &&
23802
23823
  this.range.startContainer.previousElementSibling && this.range.startContainer.previousElementSibling.tagName !== 'BR' && this.range.startContainer.textContent.split('').length > 0 &&
23803
23824
  (rangetextContent.length === 1 || rangetextContent[rangetextContent.length - 2].indexOf('') === -1 ||
23804
- this.range.startContainer.nodeType === 1))) {
23825
+ this.range.startContainer.nodeType === 1)) && !prevSiblingIsChip) {
23805
23826
  if (isValid && this.isPopupOpen && this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
23806
23827
  && !this.isMatchedText() && this.list && e.code !== 'ArrowDown' && e.code !== 'ArrowUp' && e.code !== 'Enter') {
23807
23828
  this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
@@ -24287,15 +24308,13 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
24287
24308
  }
24288
24309
  };
24289
24310
  Mention.prototype.checkCollision = function (popupEle) {
24290
- if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
24291
- var coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
24292
- this.collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
24293
- if (this.collision.length > 0) {
24294
- popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
24295
- this.isCollided = true;
24296
- }
24297
- this.popupObj.resolveCollision();
24311
+ var coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
24312
+ this.collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
24313
+ if (this.collision.length > 0) {
24314
+ popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
24315
+ this.isCollided = true;
24298
24316
  }
24317
+ this.popupObj.resolveCollision();
24299
24318
  };
24300
24319
  Mention.prototype.getTriggerCharPosition = function () {
24301
24320
  var mostRecentTriggerCharPos;
@@ -24345,7 +24364,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
24345
24364
  this.popupObj.element.removeAttribute('style');
24346
24365
  this.popupObj.element.removeAttribute('aria-disabled');
24347
24366
  }
24348
- if (this.list.classList.contains('e-nodata')) {
24367
+ if (this.list && this.list.classList.contains('e-nodata')) {
24349
24368
  this.list = null;
24350
24369
  }
24351
24370
  };
@@ -24781,14 +24800,15 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
24781
24800
  value = this.displayTempElement.innerHTML;
24782
24801
  }
24783
24802
  if (this.isContentEditable(this.inputElement)) {
24803
+ var defaultSuffix = this.isRTE ? '&#8203;' : '';
24784
24804
  if (Browser.isAndroid) {
24785
- return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
24805
+ return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : defaultSuffix);
24786
24806
  }
24787
24807
  else if (Browser.info.name === 'mozilla') {
24788
- return '<span>&#65279;<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>&#65279;</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
24808
+ return '<span>&#65279;<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>&#65279;</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : defaultSuffix);
24789
24809
  }
24790
24810
  else {
24791
- return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
24811
+ return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : defaultSuffix);
24792
24812
  }
24793
24813
  }
24794
24814
  else {