@syncfusion/ej2-dropdowns 20.4.54 → 21.1.35
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/CHANGELOG.md +1 -78
- 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 +162 -56
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +158 -50
- 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 +13 -12
- package/src/combo-box/combo-box.js +2 -0
- package/src/common/highlight-search.js +1 -1
- package/src/common/incremental-search.d.ts +3 -0
- package/src/common/incremental-search.js +7 -0
- package/src/drop-down-list/drop-down-list-model.d.ts +6 -6
- package/src/drop-down-list/drop-down-list.js +46 -18
- package/src/drop-down-tree/drop-down-tree-model.d.ts +2 -2
- package/src/drop-down-tree/drop-down-tree.d.ts +62 -6
- package/src/drop-down-tree/drop-down-tree.js +11 -11
- package/src/list-box/list-box.d.ts +15 -3
- package/src/list-box/list-box.js +3 -3
- package/src/mention/mention.d.ts +4 -0
- package/src/mention/mention.js +88 -17
- package/styles/bootstrap-dark.css +2 -15
- package/styles/bootstrap.css +2 -5
- package/styles/bootstrap4.css +3 -14
- package/styles/bootstrap5-dark.css +5 -8
- package/styles/bootstrap5.css +5 -8
- package/styles/drop-down-base/_bootstrap4-definition.scss +0 -8
- package/styles/drop-down-base/_bootstrap5-definition.scss +2 -2
- package/styles/drop-down-base/_fluent-definition.scss +2 -2
- package/styles/drop-down-base/_tailwind-definition.scss +2 -2
- package/styles/drop-down-base/_theme.scss +63 -10
- package/styles/drop-down-base/bootstrap-dark.css +2 -2
- package/styles/drop-down-base/bootstrap.css +2 -2
- package/styles/drop-down-base/bootstrap4.css +2 -10
- package/styles/drop-down-base/bootstrap5-dark.css +2 -2
- package/styles/drop-down-base/bootstrap5.css +2 -2
- package/styles/drop-down-base/fabric-dark.css +2 -2
- package/styles/drop-down-base/fabric.css +2 -2
- package/styles/drop-down-base/fluent-dark.css +2 -2
- package/styles/drop-down-base/fluent.css +2 -2
- package/styles/drop-down-base/highcontrast-light.css +2 -2
- package/styles/drop-down-base/highcontrast.css +2 -2
- package/styles/drop-down-base/material-dark.css +2 -2
- package/styles/drop-down-base/material.css +2 -2
- package/styles/drop-down-base/tailwind-dark.css +2 -2
- package/styles/drop-down-base/tailwind.css +2 -2
- package/styles/drop-down-list/_bootstrap4-definition.scss +1 -1
- package/styles/drop-down-list/_bootstrap5-definition.scss +6 -6
- package/styles/drop-down-list/_fluent-definition.scss +5 -5
- package/styles/drop-down-list/_layout.scss +1 -4
- package/styles/drop-down-list/_tailwind-definition.scss +1 -1
- package/styles/drop-down-list/bootstrap-dark.css +0 -3
- package/styles/drop-down-list/bootstrap.css +0 -3
- package/styles/drop-down-list/bootstrap4.css +1 -12
- package/styles/drop-down-list/bootstrap5-dark.css +0 -3
- package/styles/drop-down-list/bootstrap5.css +0 -3
- package/styles/drop-down-list/fabric-dark.css +0 -3
- package/styles/drop-down-list/fabric.css +0 -3
- package/styles/drop-down-list/fluent-dark.css +0 -3
- package/styles/drop-down-list/fluent.css +0 -3
- package/styles/drop-down-list/highcontrast-light.css +0 -3
- package/styles/drop-down-list/highcontrast.css +0 -3
- package/styles/drop-down-list/icons/_material3.scss +1 -1
- package/styles/drop-down-list/material-dark.css +1 -3
- package/styles/drop-down-list/material.css +0 -3
- package/styles/drop-down-list/tailwind-dark.css +1 -4
- package/styles/drop-down-list/tailwind.css +1 -4
- package/styles/drop-down-tree/_layout.scss +34 -14
- package/styles/drop-down-tree/_tailwind-definition.scss +1 -1
- package/styles/drop-down-tree/_theme.scss +1 -1
- package/styles/drop-down-tree/bootstrap4.css +0 -8
- package/styles/drop-down-tree/material-dark.css +1 -0
- package/styles/fabric-dark.css +2 -15
- package/styles/fabric.css +2 -5
- package/styles/fluent-dark.css +6 -9
- package/styles/fluent.css +6 -9
- package/styles/highcontrast-light.css +9 -15
- package/styles/highcontrast.css +15 -11
- package/styles/list-box/_bootstrap-dark-definition.scss +0 -3
- package/styles/list-box/_bootstrap-definition.scss +0 -3
- package/styles/list-box/_bootstrap4-definition.scss +0 -3
- package/styles/list-box/_bootstrap5-definition.scss +0 -3
- package/styles/list-box/_fabric-dark-definition.scss +0 -3
- package/styles/list-box/_fabric-definition.scss +0 -3
- package/styles/list-box/_fluent-definition.scss +0 -3
- package/styles/list-box/_fusionnew-definition.scss +0 -3
- package/styles/list-box/_highcontrast-definition.scss +0 -3
- package/styles/list-box/_highcontrast-light-definition.scss +0 -3
- package/styles/list-box/_material-dark-definition.scss +0 -3
- package/styles/list-box/_material-definition.scss +0 -3
- package/styles/list-box/_tailwind-definition.scss +0 -3
- package/styles/list-box/bootstrap4.css +0 -8
- package/styles/material-dark.css +4 -15
- package/styles/material.css +2 -5
- package/styles/mention/bootstrap4.css +0 -8
- package/styles/multi-select/_bootstrap5-definition.scss +6 -6
- package/styles/multi-select/_fluent-definition.scss +7 -7
- package/styles/multi-select/_highcontrast-definition.scss +8 -6
- package/styles/multi-select/_highcontrast-light-definition.scss +2 -0
- package/styles/multi-select/_layout.scss +94 -77
- package/styles/multi-select/_tailwind-definition.scss +2 -2
- package/styles/multi-select/_theme.scss +110 -22
- package/styles/multi-select/bootstrap4.css +0 -8
- package/styles/multi-select/bootstrap5-dark.css +3 -3
- package/styles/multi-select/bootstrap5.css +3 -3
- package/styles/multi-select/fluent-dark.css +4 -4
- package/styles/multi-select/fluent.css +4 -4
- package/styles/multi-select/highcontrast-light.css +7 -0
- package/styles/multi-select/highcontrast.css +13 -6
- package/styles/multi-select/icons/_material3.scss +670 -3
- package/styles/multi-select/tailwind-dark.css +2 -1
- package/styles/multi-select/tailwind.css +2 -1
- package/styles/tailwind-dark.css +5 -7
- package/styles/tailwind.css +5 -7
- package/styles/auto-complete/_material3-definition.scss +0 -2
- package/styles/combo-box/_material3-definition.scss +0 -2
- package/styles/drop-down-base/_material3-definition.scss +0 -117
- package/styles/drop-down-list/_material3-definition.scss +0 -201
- package/styles/drop-down-tree/_material3-definition.scss +0 -60
- package/styles/list-box/_material3-definition.scss +0 -120
- package/styles/mention/_material3-definition.scss +0 -1
- package/styles/multi-select/_material3-definition.scss +0 -226
|
@@ -6,6 +6,9 @@ import { Input, TextBox } from '@syncfusion/ej2-inputs';
|
|
|
6
6
|
import { Button, createCheckBox } from '@syncfusion/ej2-buttons';
|
|
7
7
|
import { TreeView } from '@syncfusion/ej2-navigations';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* IncrementalSearch module file
|
|
11
|
+
*/
|
|
9
12
|
let queryString = '';
|
|
10
13
|
let prevString = '';
|
|
11
14
|
let matches$1 = [];
|
|
@@ -95,6 +98,7 @@ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, typ
|
|
|
95
98
|
let fieldValue = fields.text.split('.');
|
|
96
99
|
dataSource.filter(function (data) {
|
|
97
100
|
Array.prototype.slice.call(fieldValue).forEach(function (value) {
|
|
101
|
+
/* eslint-disable security/detect-object-injection */
|
|
98
102
|
if (type === 'object' && checkField.textContent.toString().indexOf(data[value]) !== -1 && checkField.getAttribute('data-value') === data[fields.value].toString() || type === 'string' && checkField.textContent.toString().indexOf(data) !== -1) {
|
|
99
103
|
filterValue = type === 'object' ? data[value] : data;
|
|
100
104
|
}
|
|
@@ -102,6 +106,7 @@ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, typ
|
|
|
102
106
|
});
|
|
103
107
|
}
|
|
104
108
|
text = dataSource && filterValue ? (ignoreCase ? filterValue.toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
|
|
109
|
+
/* eslint-disable security/detect-non-literal-regexp */
|
|
105
110
|
if ((searchType === 'Equal' && text === queryStr) || (searchType === 'StartsWith' && text.substr(0, strLength) === queryStr) || (searchType === 'EndsWith' && text.substr(text.length - queryStr.length) === queryStr) || (searchType === 'Contains' && new RegExp(queryStr, "g").test(text))) {
|
|
106
111
|
itemData.item = item;
|
|
107
112
|
itemData.index = i;
|
|
@@ -109,9 +114,11 @@ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, typ
|
|
|
109
114
|
}
|
|
110
115
|
}
|
|
111
116
|
return itemData;
|
|
117
|
+
/* eslint-enable security/detect-non-literal-regexp */
|
|
112
118
|
}
|
|
113
119
|
return itemData;
|
|
114
120
|
}
|
|
121
|
+
/* eslint-enable security/detect-object-injection */
|
|
115
122
|
function escapeCharRegExp(value) {
|
|
116
123
|
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
117
124
|
}
|
|
@@ -124,7 +131,6 @@ function resetIncrementalSearchValues(elementId) {
|
|
|
124
131
|
}
|
|
125
132
|
}
|
|
126
133
|
|
|
127
|
-
/* eslint-disable jsdoc/require-param, valid-jsdoc */
|
|
128
134
|
/**
|
|
129
135
|
* Function helps to find which highlightSearch is to call based on your data.
|
|
130
136
|
*
|
|
@@ -144,6 +150,7 @@ function highlightSearch(element, query, ignoreCase, type) {
|
|
|
144
150
|
query = /^[a-zA-Z0-9- ]*$/.test(query) ? query : query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
|
|
145
151
|
const replaceQuery = type === 'StartsWith' ? '^(' + query + ')' : type === 'EndsWith' ?
|
|
146
152
|
'(' + query + ')$' : '(' + query + ')';
|
|
153
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
147
154
|
findTextNode(element, new RegExp(replaceQuery, ignoreRegex));
|
|
148
155
|
}
|
|
149
156
|
}
|
|
@@ -877,8 +884,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
877
884
|
}
|
|
878
885
|
}
|
|
879
886
|
scrollStop(e) {
|
|
880
|
-
|
|
881
|
-
|
|
887
|
+
const target = !isNullOrUndefined(e) ? e.target : this.list;
|
|
888
|
+
const liHeight = parseInt(getComputedStyle(this.getValidLi(), null).getPropertyValue('height'), 10);
|
|
882
889
|
const topIndex = Math.round(target.scrollTop / liHeight);
|
|
883
890
|
const liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
|
|
884
891
|
for (let i = topIndex; i > -1; i--) {
|
|
@@ -1652,7 +1659,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1652
1659
|
}
|
|
1653
1660
|
else {
|
|
1654
1661
|
if (this.allowFiltering && this.getModuleName() !== 'autocomplete'
|
|
1655
|
-
&& !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list) &&
|
|
1662
|
+
&& !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list) &&
|
|
1663
|
+
this.actionCompleteData.list.length > 0) {
|
|
1656
1664
|
this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(true), this.actionCompleteData.list);
|
|
1657
1665
|
}
|
|
1658
1666
|
this.resetFocusElement();
|
|
@@ -1701,6 +1709,14 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1701
1709
|
else if (htmlAttr === 'style') {
|
|
1702
1710
|
this.inputWrapper.container.setAttribute('style', this.htmlAttributes[`${htmlAttr}`]);
|
|
1703
1711
|
}
|
|
1712
|
+
else if (htmlAttr === 'aria-label') {
|
|
1713
|
+
if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
|
|
1714
|
+
this.inputElement.setAttribute('aria-label', this.htmlAttributes[`${htmlAttr}`]);
|
|
1715
|
+
}
|
|
1716
|
+
else {
|
|
1717
|
+
this.inputWrapper.container.setAttribute('aria-label', this.htmlAttributes[`${htmlAttr}`]);
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1704
1720
|
else {
|
|
1705
1721
|
const defaultAttr = ['title', 'id', 'placeholder',
|
|
1706
1722
|
'role', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
|
|
@@ -2071,7 +2087,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2071
2087
|
const preventHomeEnd = this.getModuleName() !== 'dropdownlist' && (e.action === 'home' || e.action === 'end');
|
|
2072
2088
|
this.isEscapeKey = e.action === 'escape';
|
|
2073
2089
|
this.isTabKey = !this.isPopupOpen && e.action === 'tab';
|
|
2074
|
-
const isNavAction = e.action === 'down' || e.action === 'up' || e.action === 'home' || e.action === 'end';
|
|
2075
2090
|
const isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
|
|
2076
2091
|
|| e.action === 'home' || e.action === 'end');
|
|
2077
2092
|
if ((this.isEditTextBox() || preventAction || preventHomeEnd) && !this.isPopupOpen) {
|
|
@@ -2155,7 +2170,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2155
2170
|
startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
|
|
2156
2171
|
index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
|
|
2157
2172
|
}
|
|
2158
|
-
const nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
|
|
2173
|
+
const nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
|
|
2174
|
+
: this.liCollections[index];
|
|
2159
2175
|
if (!isNullOrUndefined(nextItem)) {
|
|
2160
2176
|
this.setSelection(nextItem, e);
|
|
2161
2177
|
}
|
|
@@ -2425,9 +2441,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2425
2441
|
detach(this.valueTempElement);
|
|
2426
2442
|
this.inputElement.style.display = 'block';
|
|
2427
2443
|
}
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2444
|
+
const clearIcon = dropDownListClasses.clearIcon;
|
|
2445
|
+
const isFilterElement = this.isFiltering() && this.filterInput && (this.getModuleName() === 'combobox');
|
|
2446
|
+
const clearElement = isFilterElement && this.filterInput.parentElement.querySelector('.' + clearIcon);
|
|
2431
2447
|
if (this.isFiltering() && clearElement) {
|
|
2432
2448
|
clearElement.style.removeProperty('visibility');
|
|
2433
2449
|
}
|
|
@@ -2472,8 +2488,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2472
2488
|
}
|
|
2473
2489
|
if (Browser.info.name !== 'mozilla') {
|
|
2474
2490
|
if (this.targetElement()) {
|
|
2475
|
-
attributes(this.targetElement(), { 'aria-
|
|
2476
|
-
attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
|
|
2491
|
+
attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id !== '' ? this.inputElement.id : this.element.id });
|
|
2477
2492
|
this.targetElement().removeAttribute('aria-live');
|
|
2478
2493
|
}
|
|
2479
2494
|
}
|
|
@@ -2955,7 +2970,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2955
2970
|
if (this.value && this.dataSource instanceof DataManager) {
|
|
2956
2971
|
const checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
|
|
2957
2972
|
const fieldValue = this.fields.value.split('.');
|
|
2958
|
-
const checkVal = list.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
|
|
2973
|
+
const checkVal = list.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
|
|
2974
|
+
this.checkFieldValue(x, fieldValue) === this.value : x[checkField] === this.value);
|
|
2959
2975
|
if (!checkVal) {
|
|
2960
2976
|
this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', this.value)))
|
|
2961
2977
|
.then((e) => {
|
|
@@ -3005,7 +3021,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3005
3021
|
}
|
|
3006
3022
|
}
|
|
3007
3023
|
}
|
|
3024
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3008
3025
|
checkFieldValue(list, fieldValue) {
|
|
3026
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3009
3027
|
let checkField = list;
|
|
3010
3028
|
fieldValue.forEach((value) => {
|
|
3011
3029
|
checkField = checkField[value];
|
|
@@ -3043,8 +3061,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3043
3061
|
}
|
|
3044
3062
|
}
|
|
3045
3063
|
actionCompleteDataUpdate(li, item, index) {
|
|
3046
|
-
if (index
|
|
3047
|
-
this.actionCompleteData.ulElement.
|
|
3064
|
+
if (index !== null) {
|
|
3065
|
+
this.actionCompleteData.ulElement.
|
|
3066
|
+
insertBefore(li.cloneNode(true), this.actionCompleteData.ulElement.childNodes[index]);
|
|
3048
3067
|
}
|
|
3049
3068
|
else {
|
|
3050
3069
|
this.actionCompleteData.ulElement.appendChild(li.cloneNode(true));
|
|
@@ -3087,7 +3106,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3087
3106
|
this.trigger('beforeOpen', args, (args) => {
|
|
3088
3107
|
if (!args.cancel) {
|
|
3089
3108
|
const popupEle = this.createElement('div', {
|
|
3090
|
-
id: this.element.id + '_popup', className: 'e-ddl e-popup ' + (this.cssClass
|
|
3109
|
+
id: this.element.id + '_popup', className: 'e-ddl e-popup ' + (this.cssClass !== null ? this.cssClass : '')
|
|
3091
3110
|
});
|
|
3092
3111
|
const searchBox = this.setSearchBox(popupEle);
|
|
3093
3112
|
this.listHeight = formatUnit(this.popupHeight);
|
|
@@ -3231,10 +3250,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3231
3250
|
if (this.isReact) {
|
|
3232
3251
|
this.clearTemplate(['headerTemplate', 'footerTemplate']);
|
|
3233
3252
|
}
|
|
3234
|
-
const isResetItem = (this.getModuleName() === 'autocomplete') ? true : false;
|
|
3235
3253
|
this.isNotSearchList = false;
|
|
3236
3254
|
this.isDocumentClick = false;
|
|
3237
3255
|
this.destroyPopup();
|
|
3256
|
+
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
3238
3257
|
if (this.isFiltering() && this.actionCompleteData.list && this.actionCompleteData.list[0]) {
|
|
3239
3258
|
this.isActive = true;
|
|
3240
3259
|
this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
|
|
@@ -3494,8 +3513,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3494
3513
|
destroyPopup() {
|
|
3495
3514
|
this.isPopupOpen = false;
|
|
3496
3515
|
this.isFilterFocus = false;
|
|
3497
|
-
this.popupObj
|
|
3498
|
-
|
|
3516
|
+
if (this.popupObj) {
|
|
3517
|
+
this.popupObj.destroy();
|
|
3518
|
+
detach(this.popupObj.element);
|
|
3519
|
+
}
|
|
3499
3520
|
}
|
|
3500
3521
|
clickOnBackIcon() {
|
|
3501
3522
|
this.hidePopup();
|
|
@@ -3530,7 +3551,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3530
3551
|
if (!isNullOrUndefined(this.cssClass) && this.cssClass !== '') {
|
|
3531
3552
|
updatedCssClassValues = (this.cssClass.replace(/\s+/g, ' ')).trim();
|
|
3532
3553
|
}
|
|
3533
|
-
if (!isNullOrUndefined(closest(this.element,
|
|
3554
|
+
if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
|
|
3534
3555
|
this.enabled = false;
|
|
3535
3556
|
}
|
|
3536
3557
|
this.inputWrapper = Input.createInput({
|
|
@@ -3572,6 +3593,12 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3572
3593
|
this.element.id = id;
|
|
3573
3594
|
this.hiddenElement.id = id + '_hidden';
|
|
3574
3595
|
this.targetElement().setAttribute('tabindex', this.tabIndex);
|
|
3596
|
+
if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
|
|
3597
|
+
this.inputElement.setAttribute('aria-label', this.getModuleName());
|
|
3598
|
+
}
|
|
3599
|
+
else {
|
|
3600
|
+
attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
|
|
3601
|
+
}
|
|
3575
3602
|
attributes(this.targetElement(), this.getAriaAttributes());
|
|
3576
3603
|
this.updateDataAttribute(this.htmlAttributes);
|
|
3577
3604
|
this.setHTMLAttributes();
|
|
@@ -3916,14 +3943,16 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3916
3943
|
}
|
|
3917
3944
|
break;
|
|
3918
3945
|
case 'valueTemplate':
|
|
3919
|
-
if (!isNullOrUndefined(this.itemData) && this.valueTemplate
|
|
3946
|
+
if (!isNullOrUndefined(this.itemData) && this.valueTemplate !== null) {
|
|
3920
3947
|
this.setValueTemplate();
|
|
3921
3948
|
}
|
|
3922
3949
|
break;
|
|
3923
3950
|
case 'allowFiltering':
|
|
3924
3951
|
if (this.allowFiltering) {
|
|
3925
|
-
this.actionCompleteData = {
|
|
3926
|
-
|
|
3952
|
+
this.actionCompleteData = {
|
|
3953
|
+
ulElement: this.ulElement,
|
|
3954
|
+
list: this.listData, isUpdated: true
|
|
3955
|
+
};
|
|
3927
3956
|
this.actionData = this.actionCompleteData;
|
|
3928
3957
|
this.updateSelectElementData(this.allowFiltering);
|
|
3929
3958
|
}
|
|
@@ -3987,6 +4016,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3987
4016
|
removeClass([this.inputWrapper.container], ['e-readonly']);
|
|
3988
4017
|
}
|
|
3989
4018
|
}
|
|
4019
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3990
4020
|
setInputValue(newProp, oldProp) {
|
|
3991
4021
|
}
|
|
3992
4022
|
setCssClass(newClass, oldClass) {
|
|
@@ -4010,16 +4040,18 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4010
4040
|
getModuleName() {
|
|
4011
4041
|
return 'dropdownlist';
|
|
4012
4042
|
}
|
|
4043
|
+
/* eslint-disable valid-jsdoc, jsdoc/require-param */
|
|
4013
4044
|
/**
|
|
4014
4045
|
* Opens the popup that displays the list of items.
|
|
4015
4046
|
*
|
|
4016
4047
|
* @returns {void}
|
|
4017
4048
|
*/
|
|
4018
4049
|
showPopup(e) {
|
|
4050
|
+
/* eslint-enable valid-jsdoc, jsdoc/require-param */
|
|
4019
4051
|
if (!this.enabled) {
|
|
4020
4052
|
return;
|
|
4021
4053
|
}
|
|
4022
|
-
if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list
|
|
4054
|
+
if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list !== this.actionCompleteData.list) &&
|
|
4023
4055
|
this.actionData.list && this.actionData.ulElement) {
|
|
4024
4056
|
this.actionCompleteData = this.actionData;
|
|
4025
4057
|
this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
|
|
@@ -4048,7 +4080,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4048
4080
|
};
|
|
4049
4081
|
history.pushState({}, '');
|
|
4050
4082
|
}
|
|
4051
|
-
if (!isNullOrUndefined(this.list) && (!isNullOrUndefined(this.list.children[0]) ||
|
|
4083
|
+
if (!isNullOrUndefined(this.list) && (!isNullOrUndefined(this.list.children[0]) ||
|
|
4084
|
+
this.list.classList.contains(dropDownBaseClasses.noData))) {
|
|
4052
4085
|
this.renderPopup(e);
|
|
4053
4086
|
}
|
|
4054
4087
|
}
|
|
@@ -5377,7 +5410,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5377
5410
|
if (isValid && this.value !== null && (this.value && this.value.length !== 0)) {
|
|
5378
5411
|
addClass([this.inputEle], CHIP_INPUT);
|
|
5379
5412
|
}
|
|
5380
|
-
else if (this.value === null || (this.value && this.value.length === 0) || this.
|
|
5413
|
+
else if (this.value === null || (this.value && this.value.length === 0) || this.checkWrapper) {
|
|
5381
5414
|
addClass([this.chipWrapper], HIDEICON);
|
|
5382
5415
|
}
|
|
5383
5416
|
}
|
|
@@ -5487,36 +5520,36 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5487
5520
|
if (Object.keys(this.htmlAttributes).length) {
|
|
5488
5521
|
for (const htmlAttr of Object.keys(this.htmlAttributes)) {
|
|
5489
5522
|
if (htmlAttr === 'class') {
|
|
5490
|
-
this.inputWrapper.classList.add(this.htmlAttributes[htmlAttr]);
|
|
5523
|
+
this.inputWrapper.classList.add(this.htmlAttributes[`${htmlAttr}`]);
|
|
5491
5524
|
}
|
|
5492
|
-
else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {
|
|
5525
|
+
else if (htmlAttr === 'disabled' && this.htmlAttributes[`${htmlAttr}`] === 'disabled') {
|
|
5493
5526
|
this.setProperties({ enabled: false }, true);
|
|
5494
5527
|
this.setEnable();
|
|
5495
5528
|
}
|
|
5496
|
-
else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[htmlAttr])) {
|
|
5529
|
+
else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[`${htmlAttr}`])) {
|
|
5497
5530
|
this.setProperties({ readonly: true }, true);
|
|
5498
5531
|
this.dataBind();
|
|
5499
5532
|
}
|
|
5500
5533
|
else if (htmlAttr === 'style') {
|
|
5501
|
-
this.inputWrapper.setAttribute('style', this.htmlAttributes[htmlAttr]);
|
|
5534
|
+
this.inputWrapper.setAttribute('style', this.htmlAttributes[`${htmlAttr}`]);
|
|
5502
5535
|
}
|
|
5503
5536
|
else {
|
|
5504
5537
|
const defaultAttr = ['title', 'id', 'placeholder', 'aria-placeholder',
|
|
5505
5538
|
'role', 'autocorrect', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
|
|
5506
5539
|
const validateAttr = ['name', 'required'];
|
|
5507
5540
|
if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
|
|
5508
|
-
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
5541
|
+
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
5509
5542
|
}
|
|
5510
5543
|
else if (defaultAttr.indexOf(htmlAttr) > -1) {
|
|
5511
5544
|
if (htmlAttr === 'placeholder') {
|
|
5512
|
-
Input.setPlaceholder(this.htmlAttributes[htmlAttr], this.inputEle);
|
|
5545
|
+
Input.setPlaceholder(this.htmlAttributes[`${htmlAttr}`], this.inputEle);
|
|
5513
5546
|
}
|
|
5514
5547
|
else {
|
|
5515
|
-
this.inputEle.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
5548
|
+
this.inputEle.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
5516
5549
|
}
|
|
5517
5550
|
}
|
|
5518
5551
|
else {
|
|
5519
|
-
this.inputWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
5552
|
+
this.inputWrapper.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
5520
5553
|
}
|
|
5521
5554
|
}
|
|
5522
5555
|
}
|
|
@@ -5931,7 +5964,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5931
5964
|
this.isDocumentClick = false;
|
|
5932
5965
|
e.preventDefault();
|
|
5933
5966
|
}
|
|
5934
|
-
else if (!this.inputWrapper.contains(target) && this.inputFocus && !isFilter) {
|
|
5967
|
+
else if (this.inputWrapper != null && !this.inputWrapper.contains(target) && this.inputFocus && !isFilter) {
|
|
5935
5968
|
this.focusOut(e);
|
|
5936
5969
|
}
|
|
5937
5970
|
}
|
|
@@ -6336,7 +6369,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6336
6369
|
}
|
|
6337
6370
|
}
|
|
6338
6371
|
ensurePlaceHolder() {
|
|
6339
|
-
if (this.value && this.value.length === 0) {
|
|
6372
|
+
if (isNullOrUndefined(this.value) || (this.value && this.value.length === 0)) {
|
|
6340
6373
|
removeClass([this.inputEle], CHIP_INPUT);
|
|
6341
6374
|
if (this.chipWrapper) {
|
|
6342
6375
|
addClass([this.chipWrapper], HIDEICON);
|
|
@@ -7687,7 +7720,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7687
7720
|
const dataSource = this.sortedData;
|
|
7688
7721
|
const type = this.typeOfData(dataSource).typeof;
|
|
7689
7722
|
const activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
|
|
7690
|
-
|
|
7723
|
+
const activeElement = activeItem.item;
|
|
7691
7724
|
if (!isNullOrUndefined(activeElement)) {
|
|
7692
7725
|
const count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
|
|
7693
7726
|
const height = parseInt(getComputedStyle(this.liCollections[0], null).getPropertyValue('height'), 10);
|
|
@@ -8106,6 +8139,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
8106
8139
|
filter(dataSource, query, fields) {
|
|
8107
8140
|
super.filter(dataSource, query, fields);
|
|
8108
8141
|
}
|
|
8142
|
+
/* eslint-disable valid-jsdoc, jsdoc/require-param */
|
|
8109
8143
|
/**
|
|
8110
8144
|
* Opens the popup that displays the list of items.
|
|
8111
8145
|
*
|
|
@@ -8113,6 +8147,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
8113
8147
|
* @deprecated
|
|
8114
8148
|
*/
|
|
8115
8149
|
showPopup(e) {
|
|
8150
|
+
/* eslint-enable valid-jsdoc, jsdoc/require-param */
|
|
8116
8151
|
super.showPopup(e);
|
|
8117
8152
|
}
|
|
8118
8153
|
/* eslint-disable valid-jsdoc, jsdoc/require-param */
|
|
@@ -13884,7 +13919,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13884
13919
|
setCssClass() {
|
|
13885
13920
|
const wrap = this.toolbarSettings.items.length ? this.list.parentElement : this.list;
|
|
13886
13921
|
if (this.cssClass) {
|
|
13887
|
-
addClass([wrap], this.cssClass.split(' '));
|
|
13922
|
+
addClass([wrap], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
13888
13923
|
}
|
|
13889
13924
|
if (this.enableRtl) {
|
|
13890
13925
|
addClass([this.list], 'e-rtl');
|
|
@@ -15504,7 +15539,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
15504
15539
|
text = value;
|
|
15505
15540
|
}
|
|
15506
15541
|
if (typeof (text) === 'string') {
|
|
15507
|
-
text = text.split(
|
|
15542
|
+
text = text.split('\\').join('\\\\');
|
|
15508
15543
|
}
|
|
15509
15544
|
li = this.list.querySelector('[data-value="' + text + '"]');
|
|
15510
15545
|
if (li) {
|
|
@@ -15706,7 +15741,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
15706
15741
|
removeClass([wrap], oldProp.cssClass.split(' '));
|
|
15707
15742
|
}
|
|
15708
15743
|
if (newProp.cssClass) {
|
|
15709
|
-
addClass([wrap], newProp.cssClass.split(' '));
|
|
15744
|
+
addClass([wrap], newProp.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
15710
15745
|
}
|
|
15711
15746
|
break;
|
|
15712
15747
|
case 'enableRtl':
|
|
@@ -16034,8 +16069,11 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16034
16069
|
* @returns {void}
|
|
16035
16070
|
*/
|
|
16036
16071
|
render() {
|
|
16037
|
-
|
|
16038
|
-
|
|
16072
|
+
const isSelector = typeof this.target === 'string';
|
|
16073
|
+
this.inputElement = !isNullOrUndefined(this.target) ?
|
|
16074
|
+
this.checkAndUpdateInternalComponent(isSelector
|
|
16075
|
+
? document.querySelector(this.target)
|
|
16076
|
+
: this.target) : this.element;
|
|
16039
16077
|
if (this.isContentEditable(this.inputElement)) {
|
|
16040
16078
|
this.inputElement.setAttribute('contenteditable', 'true');
|
|
16041
16079
|
addClass([this.inputElement], ['e-mention']);
|
|
@@ -16043,6 +16081,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16043
16081
|
addClass([this.inputElement], ['e-editable-element']);
|
|
16044
16082
|
}
|
|
16045
16083
|
}
|
|
16084
|
+
this.inputElement.setAttribute('role', 'textbox');
|
|
16046
16085
|
this.queryString = this.elementValue();
|
|
16047
16086
|
this.wireEvent();
|
|
16048
16087
|
}
|
|
@@ -16078,6 +16117,18 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16078
16117
|
detach(this.spinnerTemplateElement);
|
|
16079
16118
|
}
|
|
16080
16119
|
}
|
|
16120
|
+
checkAndUpdateInternalComponent(targetElement) {
|
|
16121
|
+
if (!this.isVue && targetElement.classList.contains('e-richtexteditor')) {
|
|
16122
|
+
return targetElement.querySelector('.e-content');
|
|
16123
|
+
}
|
|
16124
|
+
if (this.isVue && targetElement.nodeName === 'TEXTAREA' && targetElement.classList.contains('e-rte-hidden')) {
|
|
16125
|
+
const parentElement = targetElement.parentElement;
|
|
16126
|
+
if (parentElement && parentElement.classList.contains('e-richtexteditor')) {
|
|
16127
|
+
return parentElement.querySelector('.e-content');
|
|
16128
|
+
}
|
|
16129
|
+
}
|
|
16130
|
+
return targetElement;
|
|
16131
|
+
}
|
|
16081
16132
|
/**
|
|
16082
16133
|
* Shows the spinner loader.
|
|
16083
16134
|
*
|
|
@@ -16134,7 +16185,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16134
16185
|
if (this.isPopupOpen) {
|
|
16135
16186
|
e.preventDefault();
|
|
16136
16187
|
if (this.popupObj && this.popupObj.element.contains(this.selectedLI)) {
|
|
16137
|
-
this.
|
|
16188
|
+
this.updateSelectedItem(this.selectedLI, e, false, true);
|
|
16138
16189
|
}
|
|
16139
16190
|
}
|
|
16140
16191
|
break;
|
|
@@ -16180,6 +16231,10 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16180
16231
|
}
|
|
16181
16232
|
onKeyUp(e) {
|
|
16182
16233
|
let rangetextContent;
|
|
16234
|
+
this.isTyped = e.code !== 'Enter' && e.code !== 'Space' && e.code !== 'ArrowDown' && e.code !== 'ArrowUp' ? true : false;
|
|
16235
|
+
if (document.activeElement != this.inputElement) {
|
|
16236
|
+
this.inputElement.focus();
|
|
16237
|
+
}
|
|
16183
16238
|
if (this.isContentEditable(this.inputElement)) {
|
|
16184
16239
|
this.range = this.getCurrentRange();
|
|
16185
16240
|
rangetextContent = this.range.startContainer.textContent.split('');
|
|
@@ -16190,10 +16245,6 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16190
16245
|
const Regex = new RegExp(this.mentionChar, 'g');
|
|
16191
16246
|
const charRegex = new RegExp('[a-zA-Z]', 'g');
|
|
16192
16247
|
if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
|
|
16193
|
-
if ((e.keyCode === 37 || e.keyCode === 39) && !isNullOrUndefined(currentRange) &&
|
|
16194
|
-
currentRange.indexOf(this.mentionChar) === -1 && this.isPopupOpen) {
|
|
16195
|
-
this.hidePopup();
|
|
16196
|
-
}
|
|
16197
16248
|
return;
|
|
16198
16249
|
}
|
|
16199
16250
|
if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
|
|
@@ -16208,7 +16259,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16208
16259
|
this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
|
|
16209
16260
|
this.searchLists(e);
|
|
16210
16261
|
}
|
|
16211
|
-
else if (this.isPopupOpen && (!this.allowSpaces || !lastWordRange)) {
|
|
16262
|
+
else if (this.isPopupOpen && (!this.allowSpaces || !lastWordRange) && (e.code !== 'ArrowDown' && e.code !== 'ArrowUp')) {
|
|
16212
16263
|
this.hidePopup();
|
|
16213
16264
|
this.lineBreak = true;
|
|
16214
16265
|
}
|
|
@@ -16238,6 +16289,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16238
16289
|
this.initValue();
|
|
16239
16290
|
}
|
|
16240
16291
|
if (!this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
|
|
16292
|
+
this.didPopupOpenByTypingInitialChar = true;
|
|
16241
16293
|
this.showPopup();
|
|
16242
16294
|
if (this.initRemoteRender && this.list.querySelectorAll('li').length === 0) {
|
|
16243
16295
|
this.showWaitingSpinner();
|
|
@@ -16462,6 +16514,17 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16462
16514
|
*/
|
|
16463
16515
|
showPopup() {
|
|
16464
16516
|
this.beforePopupOpen = true;
|
|
16517
|
+
if (document.activeElement != this.inputElement) {
|
|
16518
|
+
this.inputElement.focus();
|
|
16519
|
+
}
|
|
16520
|
+
this.queryString = this.didPopupOpenByTypingInitialChar ? this.queryString : '';
|
|
16521
|
+
this.didPopupOpenByTypingInitialChar = false;
|
|
16522
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
16523
|
+
this.range = this.getCurrentRange();
|
|
16524
|
+
}
|
|
16525
|
+
if (!this.isTyped) {
|
|
16526
|
+
this.resetList(this.dataSource, this.fields);
|
|
16527
|
+
}
|
|
16465
16528
|
if (isNullOrUndefined(this.list)) {
|
|
16466
16529
|
this.initValue();
|
|
16467
16530
|
}
|
|
@@ -16594,7 +16657,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16594
16657
|
});
|
|
16595
16658
|
}
|
|
16596
16659
|
setHeight(popupEle) {
|
|
16597
|
-
if (this.popupHeight !== 'auto') {
|
|
16660
|
+
if (this.popupHeight !== 'auto' && this.list) {
|
|
16598
16661
|
this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
|
|
16599
16662
|
popupEle.style.maxHeight = formatUnit(this.popupHeight);
|
|
16600
16663
|
}
|
|
@@ -16623,7 +16686,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16623
16686
|
mostRecentTriggerCharPos = idx;
|
|
16624
16687
|
}
|
|
16625
16688
|
}
|
|
16626
|
-
return mostRecentTriggerCharPos;
|
|
16689
|
+
return mostRecentTriggerCharPos ? mostRecentTriggerCharPos : 0;
|
|
16627
16690
|
}
|
|
16628
16691
|
initializePopup(element, offsetValue, left) {
|
|
16629
16692
|
this.popupObj = new Popup(element, {
|
|
@@ -16700,14 +16763,37 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16700
16763
|
const selectedNodePosition = this.getTriggerCharPosition();
|
|
16701
16764
|
globalRange = this.range;
|
|
16702
16765
|
range = document.createRange();
|
|
16703
|
-
|
|
16704
|
-
|
|
16766
|
+
if (this.getTextRange() && this.getTextRange().lastIndexOf(this.mentionChar) !== -1 && this.isTyped) {
|
|
16767
|
+
range.setStart(globalRange.startContainer, selectedNodePosition);
|
|
16768
|
+
range.setEnd(globalRange.startContainer, selectedNodePosition);
|
|
16769
|
+
}
|
|
16770
|
+
else {
|
|
16771
|
+
range.setStart(globalRange.startContainer, globalRange.startOffset);
|
|
16772
|
+
range.setEnd(globalRange.startContainer, globalRange.endOffset);
|
|
16773
|
+
}
|
|
16774
|
+
this.isTyped = false;
|
|
16705
16775
|
range.collapse(false);
|
|
16706
|
-
rect = range.getBoundingClientRect();
|
|
16776
|
+
rect = range.getBoundingClientRect().top === 0 ? range.startContainer.getClientRects()[0] : range.getBoundingClientRect();
|
|
16707
16777
|
}
|
|
16708
16778
|
const doc = document.documentElement;
|
|
16709
16779
|
const windowLeft = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
|
|
16710
16780
|
const windowTop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
|
|
16781
|
+
let width = 0;
|
|
16782
|
+
if (!isNullOrUndefined(range) && range.getBoundingClientRect().top === 0) {
|
|
16783
|
+
for (let i = 0; i < this.range.startContainer.childNodes.length; i++) {
|
|
16784
|
+
if (this.range.startContainer.childNodes[i].nodeType !== Node.TEXT_NODE && this.range.startContainer.childNodes[i].textContent.trim() !== '') {
|
|
16785
|
+
width += this.range.startContainer.childNodes[i].getClientRects()[0].width;
|
|
16786
|
+
}
|
|
16787
|
+
else if (this.range.startContainer.childNodes[i].textContent !== '') {
|
|
16788
|
+
let span = document.createElement("span");
|
|
16789
|
+
span.innerHTML = this.range.startContainer.childNodes[i].nodeValue;
|
|
16790
|
+
document.body.appendChild(span);
|
|
16791
|
+
let textNodeWidth = span.offsetWidth;
|
|
16792
|
+
document.body.removeChild(span);
|
|
16793
|
+
width += textNodeWidth;
|
|
16794
|
+
}
|
|
16795
|
+
}
|
|
16796
|
+
}
|
|
16711
16797
|
if (!this.isContentEditable(this.inputElement)) {
|
|
16712
16798
|
coordinates = {
|
|
16713
16799
|
top: rect.top + windowTop + span.offsetTop + parseInt(computed.borderTopWidth, 10) +
|
|
@@ -16719,7 +16805,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16719
16805
|
else {
|
|
16720
16806
|
coordinates = {
|
|
16721
16807
|
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10) - (this.isCollided ? 10 : 0),
|
|
16722
|
-
left: rect.left + windowLeft
|
|
16808
|
+
left: rect.left + windowLeft + width
|
|
16723
16809
|
};
|
|
16724
16810
|
}
|
|
16725
16811
|
return coordinates;
|
|
@@ -16770,6 +16856,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16770
16856
|
if (!this.isValidLI(li)) {
|
|
16771
16857
|
return;
|
|
16772
16858
|
}
|
|
16859
|
+
this.isSelected = true;
|
|
16773
16860
|
this.setSelection(li, e);
|
|
16774
16861
|
const delay = 100;
|
|
16775
16862
|
this.closePopup(delay, e);
|
|
@@ -16781,7 +16868,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16781
16868
|
this.removeHover();
|
|
16782
16869
|
const value = this.getFormattedValue(li.getAttribute('data-value'));
|
|
16783
16870
|
const selectedData = this.getDataByValue(value);
|
|
16784
|
-
if (!preventSelect && !isNullOrUndefined(e)) {
|
|
16871
|
+
if (!preventSelect && !isNullOrUndefined(e) && !(e.action === "down" || e.action === "up")) {
|
|
16785
16872
|
const items = this.detachChanges(selectedData);
|
|
16786
16873
|
this.isSelected = true;
|
|
16787
16874
|
const eventArgs = {
|
|
@@ -16794,6 +16881,8 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16794
16881
|
this.trigger('select', eventArgs, (eventArgs) => {
|
|
16795
16882
|
if (eventArgs.cancel) {
|
|
16796
16883
|
li.classList.remove(dropDownBaseClasses.selected);
|
|
16884
|
+
this.isSelected = false;
|
|
16885
|
+
this.isSelectCancel = true;
|
|
16797
16886
|
}
|
|
16798
16887
|
else {
|
|
16799
16888
|
this.selectEventCallback(li, selectedData, value);
|
|
@@ -16947,6 +17036,10 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16947
17036
|
const selection = this.inputElement.ownerDocument.getSelection();
|
|
16948
17037
|
const startPos = this.getTriggerCharPosition();
|
|
16949
17038
|
textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
|
|
17039
|
+
if (this.isSelectCancel) {
|
|
17040
|
+
this.isSelectCancel = false;
|
|
17041
|
+
return;
|
|
17042
|
+
}
|
|
16950
17043
|
if (dataItem.text !== null) {
|
|
16951
17044
|
value = this.mentionVal(dataItem.text);
|
|
16952
17045
|
}
|
|
@@ -16971,8 +17064,21 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16971
17064
|
}
|
|
16972
17065
|
globalRange = this.range;
|
|
16973
17066
|
range = document.createRange();
|
|
16974
|
-
|
|
16975
|
-
|
|
17067
|
+
if (((this.getTextRange() && this.getTextRange().lastIndexOf(this.mentionChar) !== -1 && this.isTyped) || this.getTextRange() && this.getTextRange().trim() === '@')) {
|
|
17068
|
+
range.setStart(globalRange.startContainer, startPos);
|
|
17069
|
+
range.setEnd(globalRange.startContainer, endPos);
|
|
17070
|
+
}
|
|
17071
|
+
else {
|
|
17072
|
+
if (globalRange.commonAncestorContainer.textContent.trim() !== '' && !isNullOrUndefined(globalRange.commonAncestorContainer.textContent.trim()) && this.getTextRange() && this.getTextRange().lastIndexOf(this.mentionChar) !== -1) {
|
|
17073
|
+
range.setStart(globalRange.startContainer, globalRange.startOffset - 1);
|
|
17074
|
+
range.setEnd(globalRange.startContainer, globalRange.endOffset - 1);
|
|
17075
|
+
}
|
|
17076
|
+
else {
|
|
17077
|
+
range.setStart(globalRange.startContainer, globalRange.startOffset);
|
|
17078
|
+
range.setEnd(globalRange.startContainer, globalRange.endOffset);
|
|
17079
|
+
}
|
|
17080
|
+
}
|
|
17081
|
+
this.isTyped = false;
|
|
16976
17082
|
range.deleteContents();
|
|
16977
17083
|
const element = this.createElement('div');
|
|
16978
17084
|
element.innerHTML = value;
|