@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.
- package/README.md +1 -1
- package/dist/ej2-dropdowns.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +33 -14
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +34 -14
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +2 -2
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/drop-down-base/drop-down-base.js +1 -1
- package/src/mention/mention.js +33 -13
|
@@ -1650,7 +1650,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1650
1650
|
const newQuery = this.getQuery(eventArgs.query);
|
|
1651
1651
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1652
1652
|
if (this.isVirtualizationEnabled && (listItems.count !== 0 &&
|
|
1653
|
-
listItems.count < (this.itemCount * 2))
|
|
1653
|
+
listItems.count < (this.itemCount * 2))) {
|
|
1654
1654
|
if (newQuery) {
|
|
1655
1655
|
for (let queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
1656
1656
|
if (this.getModuleName() === 'multiselect' && this.isCheckBoxSelection && (newQuery.queries[queryElements].e && (newQuery.queries[queryElements].e.operator === 'notequal' ||
|
|
@@ -23409,13 +23409,33 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23409
23409
|
this.hidePopup();
|
|
23410
23410
|
return;
|
|
23411
23411
|
}
|
|
23412
|
+
const prevSiblingIsChip = (() => {
|
|
23413
|
+
if (!this.isContentEditable(this.inputElement) || !this.range || !this.range.startContainer) {
|
|
23414
|
+
return false;
|
|
23415
|
+
}
|
|
23416
|
+
const startContainer = this.range.startContainer;
|
|
23417
|
+
const textNode = startContainer.nodeType === Node.TEXT_NODE ? startContainer : (() => {
|
|
23418
|
+
const idx = Math.min(this.range.startOffset, startContainer.childNodes.length - 1);
|
|
23419
|
+
const child = startContainer.childNodes[idx] || startContainer.firstChild;
|
|
23420
|
+
return child && child.nodeType === Node.TEXT_NODE ? child : null;
|
|
23421
|
+
})();
|
|
23422
|
+
if (!textNode) {
|
|
23423
|
+
return false;
|
|
23424
|
+
}
|
|
23425
|
+
const firstChar = (textNode.data || '').replace(/\u200B/g, '').replace(/\u00A0/g, ' ').charAt(0);
|
|
23426
|
+
let previousSibling = textNode.previousSibling;
|
|
23427
|
+
while (previousSibling && ((previousSibling.nodeType === Node.TEXT_NODE && !(previousSibling.data || '').trim()) || (previousSibling.tagName === 'BR'))) {
|
|
23428
|
+
previousSibling = previousSibling.previousSibling;
|
|
23429
|
+
}
|
|
23430
|
+
return firstChar === this.mentionChar && !!(previousSibling && previousSibling.classList && previousSibling.classList.contains('e-mention-chip'));
|
|
23431
|
+
})();
|
|
23412
23432
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23413
23433
|
if (((!currentRange || !lastWordRange) || (!lastWordRange.includes(this.mentionChar) && !this.requireLeadingSpace && !this.allowSpaces)) || e.code === 'Enter' || e.keyCode === 27 ||
|
|
23414
23434
|
(lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
|
|
23415
23435
|
(this.isContentEditable(this.inputElement) && this.range.startContainer &&
|
|
23416
23436
|
this.range.startContainer.previousElementSibling && this.range.startContainer.previousElementSibling.tagName !== 'BR' && this.range.startContainer.textContent.split('').length > 0 &&
|
|
23417
23437
|
(rangetextContent.length === 1 || rangetextContent[rangetextContent.length - 2].indexOf('') === -1 ||
|
|
23418
|
-
this.range.startContainer.nodeType === 1))) {
|
|
23438
|
+
this.range.startContainer.nodeType === 1)) && !prevSiblingIsChip) {
|
|
23419
23439
|
if (isValid && this.isPopupOpen && this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
|
|
23420
23440
|
&& !this.isMatchedText() && this.list && e.code !== 'ArrowDown' && e.code !== 'ArrowUp' && e.code !== 'Enter') {
|
|
23421
23441
|
this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
|
|
@@ -23896,15 +23916,13 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23896
23916
|
}
|
|
23897
23917
|
}
|
|
23898
23918
|
checkCollision(popupEle) {
|
|
23899
|
-
|
|
23900
|
-
|
|
23901
|
-
|
|
23902
|
-
|
|
23903
|
-
|
|
23904
|
-
this.isCollided = true;
|
|
23905
|
-
}
|
|
23906
|
-
this.popupObj.resolveCollision();
|
|
23919
|
+
const coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
|
|
23920
|
+
this.collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
|
|
23921
|
+
if (this.collision.length > 0) {
|
|
23922
|
+
popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
|
|
23923
|
+
this.isCollided = true;
|
|
23907
23924
|
}
|
|
23925
|
+
this.popupObj.resolveCollision();
|
|
23908
23926
|
}
|
|
23909
23927
|
getTriggerCharPosition() {
|
|
23910
23928
|
let mostRecentTriggerCharPos;
|
|
@@ -23953,7 +23971,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23953
23971
|
this.popupObj.element.removeAttribute('style');
|
|
23954
23972
|
this.popupObj.element.removeAttribute('aria-disabled');
|
|
23955
23973
|
}
|
|
23956
|
-
if (this.list.classList.contains('e-nodata')) {
|
|
23974
|
+
if (this.list && this.list.classList.contains('e-nodata')) {
|
|
23957
23975
|
this.list = null;
|
|
23958
23976
|
}
|
|
23959
23977
|
}
|
|
@@ -24388,14 +24406,15 @@ let Mention = class Mention extends DropDownBase {
|
|
|
24388
24406
|
value = this.displayTempElement.innerHTML;
|
|
24389
24407
|
}
|
|
24390
24408
|
if (this.isContentEditable(this.inputElement)) {
|
|
24409
|
+
const defaultSuffix = this.isRTE ? '​' : '';
|
|
24391
24410
|
if (Browser.isAndroid) {
|
|
24392
|
-
return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText :
|
|
24411
|
+
return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : defaultSuffix);
|
|
24393
24412
|
}
|
|
24394
24413
|
else if (Browser.info.name === 'mozilla') {
|
|
24395
|
-
return '<span><span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span></span>'.concat(typeof this.suffixText === 'string' ? this.suffixText :
|
|
24414
|
+
return '<span><span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span></span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : defaultSuffix);
|
|
24396
24415
|
}
|
|
24397
24416
|
else {
|
|
24398
|
-
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText :
|
|
24417
|
+
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : defaultSuffix);
|
|
24399
24418
|
}
|
|
24400
24419
|
}
|
|
24401
24420
|
else {
|