@syncfusion/ej2-dropdowns 20.3.59 → 20.4.38
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 +2 -36
- 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 +527 -336
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +520 -324
- 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 +11 -11
- package/src/auto-complete/auto-complete-model.d.ts +1 -0
- package/src/auto-complete/auto-complete.d.ts +4 -3
- package/src/auto-complete/auto-complete.js +6 -4
- package/src/combo-box/combo-box.d.ts +4 -4
- package/src/combo-box/combo-box.js +18 -12
- package/src/common/incremental-search.d.ts +3 -4
- package/src/common/incremental-search.js +22 -7
- package/src/drop-down-base/drop-down-base-model.d.ts +0 -18
- package/src/drop-down-base/drop-down-base.d.ts +1 -23
- package/src/drop-down-base/drop-down-base.js +43 -38
- package/src/drop-down-list/drop-down-list-model.d.ts +18 -0
- package/src/drop-down-list/drop-down-list.d.ts +25 -3
- package/src/drop-down-list/drop-down-list.js +100 -46
- package/src/drop-down-tree/drop-down-tree-model.d.ts +15 -1
- package/src/drop-down-tree/drop-down-tree.d.ts +13 -1
- package/src/drop-down-tree/drop-down-tree.js +22 -5
- package/src/list-box/list-box-model.d.ts +18 -0
- package/src/list-box/list-box.d.ts +22 -0
- package/src/list-box/list-box.js +27 -14
- package/src/mention/mention-model.d.ts +2 -2
- package/src/mention/mention.d.ts +4 -1
- package/src/mention/mention.js +66 -27
- package/src/multi-select/checkbox-selection.js +10 -8
- package/src/multi-select/multi-select.d.ts +4 -4
- package/src/multi-select/multi-select.js +207 -160
- package/styles/bootstrap5-dark.css +2 -2
- package/styles/bootstrap5.css +2 -2
- package/styles/drop-down-base/_bootstrap-dark-definition.scss +1 -0
- package/styles/drop-down-base/_bootstrap-definition.scss +1 -0
- package/styles/drop-down-base/_bootstrap4-definition.scss +1 -0
- package/styles/drop-down-base/_bootstrap5-definition.scss +1 -0
- package/styles/drop-down-base/_fabric-dark-definition.scss +1 -0
- package/styles/drop-down-base/_fabric-definition.scss +1 -0
- package/styles/drop-down-base/_fluent-definition.scss +1 -0
- package/styles/drop-down-base/_fusionnew-definition.scss +1 -0
- package/styles/drop-down-base/_highcontrast-definition.scss +1 -0
- package/styles/drop-down-base/_highcontrast-light-definition.scss +1 -0
- package/styles/drop-down-base/_layout.scss +1 -1
- package/styles/drop-down-base/_material-dark-definition.scss +1 -0
- package/styles/drop-down-base/_material-definition.scss +1 -0
- package/styles/drop-down-base/_material3-definition.scss +1 -0
- package/styles/drop-down-base/_tailwind-definition.scss +1 -0
- package/styles/drop-down-base/material-dark.css +1 -1
- package/styles/drop-down-tree/_layout.scss +3 -3
- package/styles/drop-down-tree/bootstrap5-dark.css +2 -2
- package/styles/drop-down-tree/bootstrap5.css +2 -2
- package/styles/material-dark.css +1 -1
- package/.eslintrc.json +0 -244
- package/tslint.json +0 -111
|
@@ -6,9 +6,6 @@ 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
|
-
*/
|
|
12
9
|
var queryString = '';
|
|
13
10
|
var prevString = '';
|
|
14
11
|
var matches$1 = [];
|
|
@@ -81,7 +78,7 @@ function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId)
|
|
|
81
78
|
* @param {boolean} ignoreCase - Specifies the case sensitive option for search operation.
|
|
82
79
|
* @returns {Element | number} Returns the search matched items.
|
|
83
80
|
*/
|
|
84
|
-
function Search(inputVal, items, searchType, ignoreCase) {
|
|
81
|
+
function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, type) {
|
|
85
82
|
var listItems = items;
|
|
86
83
|
ignoreCase = ignoreCase !== undefined && ignoreCase !== null ? ignoreCase : true;
|
|
87
84
|
var itemData = { item: null, index: null };
|
|
@@ -89,14 +86,32 @@ function Search(inputVal, items, searchType, ignoreCase) {
|
|
|
89
86
|
var strLength = inputVal.length;
|
|
90
87
|
var queryStr = ignoreCase ? inputVal.toLocaleLowerCase() : inputVal;
|
|
91
88
|
queryStr = escapeCharRegExp(queryStr);
|
|
92
|
-
|
|
89
|
+
var _loop_1 = function (i, itemsData) {
|
|
93
90
|
var item = itemsData[i];
|
|
94
|
-
var text =
|
|
91
|
+
var text = void 0;
|
|
92
|
+
var filterValue;
|
|
93
|
+
if (items && dataSource) {
|
|
94
|
+
var checkField_1 = item;
|
|
95
|
+
var fieldValue_1 = fields.text.split('.');
|
|
96
|
+
dataSource.filter(function (data) {
|
|
97
|
+
Array.prototype.slice.call(fieldValue_1).forEach(function (value) {
|
|
98
|
+
if (type === 'object' && checkField_1.textContent.toString().indexOf(data[value]) !== -1 && checkField_1.getAttribute('data-value') === data[fields.value] || type === 'string' && checkField_1.textContent.toString().indexOf(data) !== -1) {
|
|
99
|
+
filterValue = type === 'object' ? data[value] : data;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
text = dataSource && filterValue ? (ignoreCase ? filterValue.toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
|
|
95
105
|
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))) {
|
|
96
106
|
itemData.item = item;
|
|
97
107
|
itemData.index = i;
|
|
98
|
-
return { item: item, index: i };
|
|
108
|
+
return { value: { item: item, index: i } };
|
|
99
109
|
}
|
|
110
|
+
};
|
|
111
|
+
for (var i = 0, itemsData = listItems; i < itemsData.length; i++) {
|
|
112
|
+
var state_1 = _loop_1(i, itemsData);
|
|
113
|
+
if (typeof state_1 === "object")
|
|
114
|
+
return state_1.value;
|
|
100
115
|
}
|
|
101
116
|
return itemData;
|
|
102
117
|
}
|
|
@@ -444,7 +459,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
444
459
|
liElem.setAttribute('role', 'option');
|
|
445
460
|
}
|
|
446
461
|
else {
|
|
447
|
-
ele
|
|
462
|
+
if (!isNullOrUndefined(ele)) {
|
|
463
|
+
ele.innerHTML = content;
|
|
464
|
+
}
|
|
448
465
|
}
|
|
449
466
|
}
|
|
450
467
|
};
|
|
@@ -475,14 +492,16 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
475
492
|
* @returns {void}
|
|
476
493
|
*/
|
|
477
494
|
DropDownBase.prototype.setEnableRtl = function () {
|
|
478
|
-
if (this.
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
495
|
+
if (!isNullOrUndefined(this.enableRtlElements)) {
|
|
496
|
+
if (this.list) {
|
|
497
|
+
this.enableRtlElements.push(this.list);
|
|
498
|
+
}
|
|
499
|
+
if (this.enableRtl) {
|
|
500
|
+
addClass(this.enableRtlElements, dropDownBaseClasses.rtl);
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);
|
|
504
|
+
}
|
|
486
505
|
}
|
|
487
506
|
};
|
|
488
507
|
/**
|
|
@@ -520,14 +539,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
520
539
|
DropDownBase.prototype.getPersistData = function () {
|
|
521
540
|
return this.addOnPersist([]);
|
|
522
541
|
};
|
|
523
|
-
/**
|
|
524
|
-
* Sets the enabled state to DropDownBase.
|
|
525
|
-
*
|
|
526
|
-
* @returns {void}
|
|
527
|
-
*/
|
|
528
|
-
DropDownBase.prototype.setEnabled = function () {
|
|
529
|
-
this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
|
|
530
|
-
};
|
|
531
542
|
/**
|
|
532
543
|
* Sets the enabled state to DropDownBase.
|
|
533
544
|
*
|
|
@@ -749,7 +760,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
749
760
|
this.liCollections = [];
|
|
750
761
|
this.trigger('actionFailure', e);
|
|
751
762
|
this.l10nUpdate(true);
|
|
752
|
-
|
|
763
|
+
if (!isNullOrUndefined(this.list)) {
|
|
764
|
+
addClass([this.list], dropDownBaseClasses.noData);
|
|
765
|
+
}
|
|
753
766
|
};
|
|
754
767
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
755
768
|
DropDownBase.prototype.onActionComplete = function (ulElement, list, e) {
|
|
@@ -879,10 +892,12 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
879
892
|
if (!isNullOrUndefined(this.list) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
880
893
|
if (isNullOrUndefined(this.fixedHeaderElement)) {
|
|
881
894
|
this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
|
|
882
|
-
if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
|
|
895
|
+
if (!isNullOrUndefined(this.list) && !this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
|
|
883
896
|
this.fixedHeaderElement.style.display = 'none';
|
|
884
897
|
}
|
|
885
|
-
|
|
898
|
+
if (!isNullOrUndefined(this.fixedHeaderElement) && !isNullOrUndefined(this.list)) {
|
|
899
|
+
prepend([this.fixedHeaderElement], this.list);
|
|
900
|
+
}
|
|
886
901
|
this.setFixedHeader();
|
|
887
902
|
}
|
|
888
903
|
if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
|
|
@@ -973,7 +988,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
973
988
|
return item;
|
|
974
989
|
};
|
|
975
990
|
DropDownBase.prototype.setFixedHeader = function () {
|
|
976
|
-
this.list
|
|
991
|
+
if (!isNullOrUndefined(this.list)) {
|
|
992
|
+
this.list.parentElement.style.display = 'block';
|
|
993
|
+
}
|
|
977
994
|
var borderWidth = 0;
|
|
978
995
|
if (this.list && this.list.parentElement) {
|
|
979
996
|
borderWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-width'), 10);
|
|
@@ -988,8 +1005,10 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
988
1005
|
borderWidth = (borderTopWidth + borderBottomWidth + borderLeftWidth + borderRightWidth);
|
|
989
1006
|
}
|
|
990
1007
|
}
|
|
991
|
-
|
|
992
|
-
|
|
1008
|
+
if (!isNullOrUndefined(this.liCollections)) {
|
|
1009
|
+
var liWidth = this.getValidLi().offsetWidth - borderWidth;
|
|
1010
|
+
this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
|
|
1011
|
+
}
|
|
993
1012
|
setStyleAttribute(this.fixedHeaderElement, { zIndex: 10 });
|
|
994
1013
|
var firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group + ':not(.e-hide-listitem)');
|
|
995
1014
|
this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
|
|
@@ -1133,9 +1152,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1133
1152
|
case 'enableRtl':
|
|
1134
1153
|
this.setEnableRtl();
|
|
1135
1154
|
break;
|
|
1136
|
-
case 'enabled':
|
|
1137
|
-
this.setEnabled();
|
|
1138
|
-
break;
|
|
1139
1155
|
case 'groupTemplate':
|
|
1140
1156
|
this.renderGroupTemplate(this.list);
|
|
1141
1157
|
if (this.ulElement && this.fixedHeaderElement) {
|
|
@@ -1184,7 +1200,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1184
1200
|
wrapperElement.appendChild(this.list);
|
|
1185
1201
|
}
|
|
1186
1202
|
this.setEnableRtl();
|
|
1187
|
-
this.setEnabled();
|
|
1188
1203
|
if (!isEmptyData) {
|
|
1189
1204
|
this.initialize(e);
|
|
1190
1205
|
}
|
|
@@ -1212,7 +1227,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1212
1227
|
* Adds a new item to the popup list. By default, new item appends to the list as the last item,
|
|
1213
1228
|
* but you can insert based on the index parameter.
|
|
1214
1229
|
*
|
|
1215
|
-
* @param
|
|
1230
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
1216
1231
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
1217
1232
|
* @returns {void}
|
|
1218
1233
|
* @deprecated
|
|
@@ -1276,11 +1291,17 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1276
1291
|
this.trigger('beforeItemRender', { element: li, item: item });
|
|
1277
1292
|
}
|
|
1278
1293
|
if (itemsCount === 0 && isNullOrUndefined(this.list.querySelector('ul'))) {
|
|
1279
|
-
this.list
|
|
1280
|
-
|
|
1281
|
-
|
|
1294
|
+
if (!isNullOrUndefined(this.list)) {
|
|
1295
|
+
this.list.innerHTML = '';
|
|
1296
|
+
this.list.classList.remove(dropDownBaseClasses.noData);
|
|
1297
|
+
if (!isNullOrUndefined(this.ulElement)) {
|
|
1298
|
+
this.list.appendChild(this.ulElement);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1282
1301
|
this.liCollections = liCollections;
|
|
1283
|
-
|
|
1302
|
+
if (!isNullOrUndefined(liCollections) && !isNullOrUndefined(this.ulElement)) {
|
|
1303
|
+
append(liCollections, this.ulElement);
|
|
1304
|
+
}
|
|
1284
1305
|
this.updateAddItemList(this.list, itemsCount);
|
|
1285
1306
|
}
|
|
1286
1307
|
else {
|
|
@@ -1401,14 +1422,16 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1401
1422
|
}
|
|
1402
1423
|
detach(this.list);
|
|
1403
1424
|
}
|
|
1425
|
+
this.liCollections = null;
|
|
1426
|
+
this.ulElement = null;
|
|
1427
|
+
this.list = null;
|
|
1428
|
+
this.enableRtlElements = null;
|
|
1429
|
+
this.rippleFun = null;
|
|
1404
1430
|
_super.prototype.destroy.call(this);
|
|
1405
1431
|
};
|
|
1406
1432
|
__decorate([
|
|
1407
1433
|
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
1408
1434
|
], DropDownBase.prototype, "fields", void 0);
|
|
1409
|
-
__decorate([
|
|
1410
|
-
Property(false)
|
|
1411
|
-
], DropDownBase.prototype, "enablePersistence", void 0);
|
|
1412
1435
|
__decorate([
|
|
1413
1436
|
Property(null)
|
|
1414
1437
|
], DropDownBase.prototype, "itemTemplate", void 0);
|
|
@@ -1424,9 +1447,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1424
1447
|
__decorate([
|
|
1425
1448
|
Property('None')
|
|
1426
1449
|
], DropDownBase.prototype, "sortOrder", void 0);
|
|
1427
|
-
__decorate([
|
|
1428
|
-
Property(true)
|
|
1429
|
-
], DropDownBase.prototype, "enabled", void 0);
|
|
1430
1450
|
__decorate([
|
|
1431
1451
|
Property([])
|
|
1432
1452
|
], DropDownBase.prototype, "dataSource", void 0);
|
|
@@ -1687,8 +1707,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1687
1707
|
this.resetFocusElement();
|
|
1688
1708
|
}
|
|
1689
1709
|
}
|
|
1690
|
-
this.hiddenElement
|
|
1691
|
-
|
|
1710
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
1711
|
+
this.hiddenElement.innerHTML = '';
|
|
1712
|
+
}
|
|
1713
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
1714
|
+
this.inputElement.value = '';
|
|
1715
|
+
}
|
|
1692
1716
|
this.value = null;
|
|
1693
1717
|
this.itemData = null;
|
|
1694
1718
|
this.text = null;
|
|
@@ -1711,21 +1735,21 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1711
1735
|
for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
|
|
1712
1736
|
var htmlAttr = _a[_i];
|
|
1713
1737
|
if (htmlAttr === 'class') {
|
|
1714
|
-
var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
|
|
1738
|
+
var updatedClassValue = (this.htmlAttributes["" + htmlAttr].replace(/\s+/g, ' ')).trim();
|
|
1715
1739
|
if (updatedClassValue !== '') {
|
|
1716
1740
|
addClass([this.inputWrapper.container], updatedClassValue.split(' '));
|
|
1717
1741
|
}
|
|
1718
1742
|
}
|
|
1719
|
-
else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {
|
|
1743
|
+
else if (htmlAttr === 'disabled' && this.htmlAttributes["" + htmlAttr] === 'disabled') {
|
|
1720
1744
|
this.enabled = false;
|
|
1721
1745
|
this.setEnable();
|
|
1722
1746
|
}
|
|
1723
|
-
else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[htmlAttr])) {
|
|
1747
|
+
else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes["" + htmlAttr])) {
|
|
1724
1748
|
this.readonly = true;
|
|
1725
1749
|
this.dataBind();
|
|
1726
1750
|
}
|
|
1727
1751
|
else if (htmlAttr === 'style') {
|
|
1728
|
-
this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);
|
|
1752
|
+
this.inputWrapper.container.setAttribute('style', this.htmlAttributes["" + htmlAttr]);
|
|
1729
1753
|
}
|
|
1730
1754
|
else {
|
|
1731
1755
|
var defaultAttr = ['title', 'id', 'placeholder',
|
|
@@ -1735,18 +1759,18 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1735
1759
|
defaultAttr.push('tabindex');
|
|
1736
1760
|
}
|
|
1737
1761
|
if (validateAttr.indexOf(htmlAttr) > -1 || htmlAttr.indexOf('data') === 0) {
|
|
1738
|
-
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
1762
|
+
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
1739
1763
|
}
|
|
1740
1764
|
else if (defaultAttr.indexOf(htmlAttr) > -1) {
|
|
1741
1765
|
if (htmlAttr === 'placeholder') {
|
|
1742
|
-
Input.setPlaceholder(this.htmlAttributes[htmlAttr], this.inputElement);
|
|
1766
|
+
Input.setPlaceholder(this.htmlAttributes["" + htmlAttr], this.inputElement);
|
|
1743
1767
|
}
|
|
1744
1768
|
else {
|
|
1745
|
-
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
1769
|
+
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
1746
1770
|
}
|
|
1747
1771
|
}
|
|
1748
1772
|
else {
|
|
1749
|
-
this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
1773
|
+
this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
1750
1774
|
}
|
|
1751
1775
|
}
|
|
1752
1776
|
}
|
|
@@ -1802,7 +1826,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1802
1826
|
}
|
|
1803
1827
|
};
|
|
1804
1828
|
DropDownList.prototype.targetElement = function () {
|
|
1805
|
-
return this.inputWrapper.container;
|
|
1829
|
+
return !isNullOrUndefined(this.inputWrapper) ? this.inputWrapper.container : null;
|
|
1806
1830
|
};
|
|
1807
1831
|
DropDownList.prototype.getNgDirective = function () {
|
|
1808
1832
|
return 'EJS-DROPDOWNLIST';
|
|
@@ -1961,7 +1985,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1961
1985
|
}
|
|
1962
1986
|
};
|
|
1963
1987
|
DropDownList.prototype.unBindCommonEvent = function () {
|
|
1964
|
-
if (this.targetElement()) {
|
|
1988
|
+
if (!isNullOrUndefined(this.inputWrapper) && this.targetElement()) {
|
|
1965
1989
|
EventHandler.remove(this.targetElement(), 'blur', this.onBlurHandler);
|
|
1966
1990
|
}
|
|
1967
1991
|
var formElement = this.inputElement && closest(this.inputElement, 'form');
|
|
@@ -1991,9 +2015,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1991
2015
|
* @returns {void}
|
|
1992
2016
|
*/
|
|
1993
2017
|
DropDownList.prototype.wireListEvents = function () {
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
2018
|
+
if (!isNullOrUndefined(this.list)) {
|
|
2019
|
+
EventHandler.add(this.list, 'click', this.onMouseClick, this);
|
|
2020
|
+
EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
|
|
2021
|
+
EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
|
|
2022
|
+
}
|
|
1997
2023
|
};
|
|
1998
2024
|
DropDownList.prototype.onSearch = function (e) {
|
|
1999
2025
|
if (e.charCode !== 32 && e.charCode !== 13) {
|
|
@@ -2271,9 +2297,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2271
2297
|
this.setSelection(previousItem, event);
|
|
2272
2298
|
};
|
|
2273
2299
|
DropDownList.prototype.unWireEvent = function () {
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2300
|
+
if (!isNullOrUndefined(this.inputWrapper)) {
|
|
2301
|
+
EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
|
|
2302
|
+
EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
|
|
2303
|
+
EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
|
|
2304
|
+
}
|
|
2277
2305
|
this.unBindCommonEvent();
|
|
2278
2306
|
};
|
|
2279
2307
|
/**
|
|
@@ -2282,9 +2310,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2282
2310
|
* @returns {void}
|
|
2283
2311
|
*/
|
|
2284
2312
|
DropDownList.prototype.unWireListEvents = function () {
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2313
|
+
if (this.list) {
|
|
2314
|
+
EventHandler.remove(this.list, 'click', this.onMouseClick);
|
|
2315
|
+
EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
|
|
2316
|
+
EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
|
|
2317
|
+
}
|
|
2288
2318
|
};
|
|
2289
2319
|
DropDownList.prototype.checkSelector = function (id) {
|
|
2290
2320
|
return '[id="' + id.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g, '\\$1') + '"]';
|
|
@@ -2292,7 +2322,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2292
2322
|
DropDownList.prototype.onDocumentClick = function (e) {
|
|
2293
2323
|
var target = e.target;
|
|
2294
2324
|
if (!(!isNullOrUndefined(this.popupObj) && closest(target, this.checkSelector(this.popupObj.element.id))) &&
|
|
2295
|
-
!this.inputWrapper.container.contains(e.target)) {
|
|
2325
|
+
!isNullOrUndefined(this.inputWrapper) && !this.inputWrapper.container.contains(e.target)) {
|
|
2296
2326
|
if (this.inputWrapper.container.classList.contains(dropDownListClasses.inputFocus) || this.isPopupOpen) {
|
|
2297
2327
|
this.isDocumentClick = true;
|
|
2298
2328
|
var isActive = this.isRequested;
|
|
@@ -2490,14 +2520,16 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2490
2520
|
this.setScrollPosition(e);
|
|
2491
2521
|
}
|
|
2492
2522
|
if (Browser.info.name !== 'mozilla') {
|
|
2493
|
-
attributes(this.
|
|
2494
|
-
|
|
2495
|
-
|
|
2523
|
+
attributes(this.inputElement, { 'aria-label': this.inputElement.value });
|
|
2524
|
+
if (this.targetElement()) {
|
|
2525
|
+
attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
|
|
2526
|
+
this.targetElement().removeAttribute('aria-live');
|
|
2527
|
+
}
|
|
2496
2528
|
}
|
|
2497
|
-
if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
2529
|
+
if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
2498
2530
|
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
|
|
2499
2531
|
}
|
|
2500
|
-
else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
|
|
2532
|
+
else if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
|
|
2501
2533
|
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
|
|
2502
2534
|
}
|
|
2503
2535
|
};
|
|
@@ -2663,9 +2695,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2663
2695
|
selectedElement.setAttribute('value', this.value.toString());
|
|
2664
2696
|
}
|
|
2665
2697
|
else {
|
|
2666
|
-
this.hiddenElement
|
|
2667
|
-
|
|
2668
|
-
|
|
2698
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
2699
|
+
this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
|
|
2700
|
+
var selectedElement = this.hiddenElement.querySelector('option');
|
|
2701
|
+
selectedElement.setAttribute('value', this.value.toString());
|
|
2702
|
+
}
|
|
2669
2703
|
}
|
|
2670
2704
|
}
|
|
2671
2705
|
else {
|
|
@@ -2817,9 +2851,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2817
2851
|
/**
|
|
2818
2852
|
* To filter the data from given data source by using query
|
|
2819
2853
|
*
|
|
2820
|
-
* @param
|
|
2821
|
-
* @param
|
|
2822
|
-
* @param
|
|
2854
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
2855
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
2856
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
2823
2857
|
* @returns {void}
|
|
2824
2858
|
* @deprecated
|
|
2825
2859
|
*/
|
|
@@ -3004,7 +3038,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3004
3038
|
&& ((this.dataSource instanceof DataManager)
|
|
3005
3039
|
|| (!isNullOrUndefined(this.dataSource) && !isNullOrUndefined(this.dataSource.length) &&
|
|
3006
3040
|
this.dataSource.length !== 0)))) {
|
|
3007
|
-
if (this.itemTemplate &&
|
|
3041
|
+
if (this.itemTemplate && this.element.tagName === 'EJS-COMBOBOX' && this.allowFiltering) {
|
|
3008
3042
|
setTimeout(function () {
|
|
3009
3043
|
_this.updateActionCompleteDataValues(ulElement, list);
|
|
3010
3044
|
}, 0);
|
|
@@ -3155,9 +3189,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3155
3189
|
(_this.isDropDownClick && _this.getModuleName() === 'combobox')))) {
|
|
3156
3190
|
offsetValue = _this.getOffsetValue(popupEle);
|
|
3157
3191
|
var firstItem = _this.isEmptyList() ? _this.list : _this.liCollections[0];
|
|
3158
|
-
|
|
3159
|
-
parseInt(getComputedStyle(
|
|
3160
|
-
|
|
3192
|
+
if (!isNullOrUndefined(_this.inputElement)) {
|
|
3193
|
+
left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
|
|
3194
|
+
parseInt(getComputedStyle(_this.inputElement).paddingLeft, 10) +
|
|
3195
|
+
parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
|
|
3196
|
+
}
|
|
3161
3197
|
}
|
|
3162
3198
|
_this.getFocusElement();
|
|
3163
3199
|
_this.createPopup(popupEle, offsetValue, left);
|
|
@@ -3203,9 +3239,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3203
3239
|
var eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
|
|
3204
3240
|
_this.trigger('open', eventArgs, function (eventArgs) {
|
|
3205
3241
|
if (!eventArgs.cancel) {
|
|
3206
|
-
|
|
3242
|
+
if (!isNullOrUndefined(_this.inputWrapper)) {
|
|
3243
|
+
addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
|
|
3244
|
+
}
|
|
3207
3245
|
_this.renderReactTemplates();
|
|
3208
|
-
|
|
3246
|
+
if (!isNullOrUndefined(_this.popupObj)) {
|
|
3247
|
+
_this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);
|
|
3248
|
+
}
|
|
3209
3249
|
}
|
|
3210
3250
|
else {
|
|
3211
3251
|
_this.beforePopupOpen = false;
|
|
@@ -3464,11 +3504,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3464
3504
|
EventHandler.remove(this.backIconElement, 'click', this.clickOnBackIcon);
|
|
3465
3505
|
EventHandler.remove(this.clearIconElement, 'click', this.clearText);
|
|
3466
3506
|
}
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3507
|
+
if (!isNullOrUndefined(this.filterInput)) {
|
|
3508
|
+
EventHandler.remove(this.filterInput, 'input', this.onInput);
|
|
3509
|
+
EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);
|
|
3510
|
+
EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);
|
|
3511
|
+
EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
|
|
3512
|
+
EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
|
|
3513
|
+
}
|
|
3472
3514
|
this.filterInput = null;
|
|
3473
3515
|
}
|
|
3474
3516
|
attributes(this.targetElement(), { 'aria-expanded': 'false' });
|
|
@@ -3603,6 +3645,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3603
3645
|
this.text = isNullOrUndefined(this.value) ? null : selectElement.options[selectElement.selectedIndex].textContent;
|
|
3604
3646
|
this.initValue();
|
|
3605
3647
|
}
|
|
3648
|
+
this.setEnabled();
|
|
3606
3649
|
this.preventTabIndex(this.element);
|
|
3607
3650
|
if (!this.enabled) {
|
|
3608
3651
|
this.targetElement().tabIndex = -1;
|
|
@@ -3687,6 +3730,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3687
3730
|
var contentEle = popupEle.querySelector('div.e-content');
|
|
3688
3731
|
popupEle.insertBefore(this.header, contentEle);
|
|
3689
3732
|
};
|
|
3733
|
+
/**
|
|
3734
|
+
* Sets the enabled state to DropDownBase.
|
|
3735
|
+
*
|
|
3736
|
+
* @returns {void}
|
|
3737
|
+
*/
|
|
3738
|
+
DropDownList.prototype.setEnabled = function () {
|
|
3739
|
+
this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
|
|
3740
|
+
};
|
|
3690
3741
|
DropDownList.prototype.setOldText = function (text) {
|
|
3691
3742
|
this.text = text;
|
|
3692
3743
|
};
|
|
@@ -4062,7 +4113,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4062
4113
|
};
|
|
4063
4114
|
history.pushState({}, '');
|
|
4064
4115
|
}
|
|
4065
|
-
if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
4116
|
+
if (!isNullOrUndefined(this.list) && (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData))) {
|
|
4066
4117
|
this.renderPopup(e);
|
|
4067
4118
|
}
|
|
4068
4119
|
};
|
|
@@ -4078,7 +4129,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4078
4129
|
DropDownList.prototype.hidePopup = function (e) {
|
|
4079
4130
|
/* eslint-enable valid-jsdoc, jsdoc/require-param */
|
|
4080
4131
|
if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
|
|
4081
|
-
|
|
4132
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
4133
|
+
Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
4134
|
+
}
|
|
4082
4135
|
this.isEscapeKey = false;
|
|
4083
4136
|
if (!isNullOrUndefined(this.index)) {
|
|
4084
4137
|
var element = this.findListElement(this.ulElement, 'li', 'data-value', this.value);
|
|
@@ -4188,6 +4241,21 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4188
4241
|
this.inputWrapper.container.parentElement.insertBefore(this.element, this.inputWrapper.container);
|
|
4189
4242
|
detach(this.inputWrapper.container);
|
|
4190
4243
|
}
|
|
4244
|
+
this.hiddenElement = null;
|
|
4245
|
+
this.inputWrapper = null;
|
|
4246
|
+
this.keyboardModule = null;
|
|
4247
|
+
this.ulElement = null;
|
|
4248
|
+
this.list = null;
|
|
4249
|
+
this.popupObj = null;
|
|
4250
|
+
this.rippleFun = null;
|
|
4251
|
+
this.selectedLI = null;
|
|
4252
|
+
this.liCollections = null;
|
|
4253
|
+
this.item = null;
|
|
4254
|
+
this.inputWrapper = null;
|
|
4255
|
+
this.footer = null;
|
|
4256
|
+
this.header = null;
|
|
4257
|
+
this.previousSelectedLI = null;
|
|
4258
|
+
this.valueTempElement = null;
|
|
4191
4259
|
_super.prototype.destroy.call(this);
|
|
4192
4260
|
};
|
|
4193
4261
|
/* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
|
|
@@ -4229,6 +4297,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4229
4297
|
__decorate$1([
|
|
4230
4298
|
Property('100%')
|
|
4231
4299
|
], DropDownList.prototype, "width", void 0);
|
|
4300
|
+
__decorate$1([
|
|
4301
|
+
Property(true)
|
|
4302
|
+
], DropDownList.prototype, "enabled", void 0);
|
|
4303
|
+
__decorate$1([
|
|
4304
|
+
Property(false)
|
|
4305
|
+
], DropDownList.prototype, "enablePersistence", void 0);
|
|
4232
4306
|
__decorate$1([
|
|
4233
4307
|
Property('300px')
|
|
4234
4308
|
], DropDownList.prototype, "popupHeight", void 0);
|
|
@@ -4408,6 +4482,9 @@ var Fields = /** @__PURE__ @class */ (function (_super) {
|
|
|
4408
4482
|
__decorate$2([
|
|
4409
4483
|
Property(null)
|
|
4410
4484
|
], Fields.prototype, "query", void 0);
|
|
4485
|
+
__decorate$2([
|
|
4486
|
+
Property('selectable')
|
|
4487
|
+
], Fields.prototype, "selectable", void 0);
|
|
4411
4488
|
__decorate$2([
|
|
4412
4489
|
Property('selected')
|
|
4413
4490
|
], Fields.prototype, "selected", void 0);
|
|
@@ -5217,7 +5294,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5217
5294
|
temp = this.getOverflowVal(index);
|
|
5218
5295
|
data += temp;
|
|
5219
5296
|
temp = this.overFlowWrapper.innerHTML;
|
|
5220
|
-
this.
|
|
5297
|
+
if (this.enableHtmlSanitizer) {
|
|
5298
|
+
this.overFlowWrapper.innerText = data;
|
|
5299
|
+
}
|
|
5300
|
+
else {
|
|
5301
|
+
this.overFlowWrapper.innerHTML = data;
|
|
5302
|
+
}
|
|
5221
5303
|
wrapperleng = this.overFlowWrapper.offsetWidth;
|
|
5222
5304
|
overAllContainer = this.inputWrapper.offsetWidth;
|
|
5223
5305
|
if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
|
|
@@ -5749,6 +5831,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5749
5831
|
nodeClicked: this.onNodeClicked.bind(this),
|
|
5750
5832
|
dataBound: this.OnDataBound.bind(this),
|
|
5751
5833
|
allowMultiSelection: this.allowMultiSelection,
|
|
5834
|
+
enableHtmlSanitizer: this.enableHtmlSanitizer,
|
|
5752
5835
|
showCheckBox: this.showCheckBox,
|
|
5753
5836
|
autoCheck: this.treeSettings.autoCheck,
|
|
5754
5837
|
sortOrder: this.sortOrder,
|
|
@@ -6041,7 +6124,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6041
6124
|
dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
|
|
6042
6125
|
child: this.cloneChildField(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
|
|
6043
6126
|
iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes, query: fields.query,
|
|
6044
|
-
selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
|
|
6127
|
+
selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
|
|
6045
6128
|
};
|
|
6046
6129
|
return clonedField;
|
|
6047
6130
|
};
|
|
@@ -6054,7 +6137,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6054
6137
|
dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
|
|
6055
6138
|
child: (fields.child ? this.cloneChildField(fields.child) : null), hasChildren: fields.hasChildren,
|
|
6056
6139
|
expanded: fields.expanded, iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes,
|
|
6057
|
-
query: fields.query, selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
|
|
6140
|
+
query: fields.query, selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
|
|
6058
6141
|
};
|
|
6059
6142
|
return clonedField;
|
|
6060
6143
|
}
|
|
@@ -6064,7 +6147,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6064
6147
|
dataSource: fields.dataSource, id: fields.value, text: fields.text, parentID: fields.parentValue,
|
|
6065
6148
|
child: this.getTreeChildren(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
|
|
6066
6149
|
iconCss: fields.iconCss, imageUrl: fields.imageUrl, isChecked: fields.selected,
|
|
6067
|
-
htmlAttributes: fields.htmlAttributes, query: fields.query, selected: fields.selected,
|
|
6150
|
+
htmlAttributes: fields.htmlAttributes, query: fields.query, selectable: fields.selectable, selected: fields.selected,
|
|
6068
6151
|
tableName: fields.tableName, tooltip: fields.tooltip
|
|
6069
6152
|
};
|
|
6070
6153
|
return treeFields;
|
|
@@ -6559,7 +6642,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6559
6642
|
});
|
|
6560
6643
|
var chipContent = this.createElement('span', { className: CHIP_CONTENT });
|
|
6561
6644
|
var chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
|
|
6562
|
-
|
|
6645
|
+
if (this.enableHtmlSanitizer) {
|
|
6646
|
+
chipContent.innerText = text;
|
|
6647
|
+
}
|
|
6648
|
+
else {
|
|
6649
|
+
chipContent.innerHTML = text;
|
|
6650
|
+
}
|
|
6563
6651
|
chip.appendChild(chipContent);
|
|
6564
6652
|
this.chipCollection.appendChild(chip);
|
|
6565
6653
|
if (this.showClearButton) {
|
|
@@ -7381,6 +7469,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
7381
7469
|
__decorate$2([
|
|
7382
7470
|
Property(false)
|
|
7383
7471
|
], DropDownTree.prototype, "showCheckBox", void 0);
|
|
7472
|
+
__decorate$2([
|
|
7473
|
+
Property(false)
|
|
7474
|
+
], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
|
|
7384
7475
|
__decorate$2([
|
|
7385
7476
|
Property(true)
|
|
7386
7477
|
], DropDownTree.prototype, "showClearButton", void 0);
|
|
@@ -7682,7 +7773,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7682
7773
|
};
|
|
7683
7774
|
ComboBox.prototype.getFocusElement = function () {
|
|
7684
7775
|
var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
|
|
7685
|
-
var selected = this.list.querySelector('.' + dropDownListClasses.selected);
|
|
7776
|
+
var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
|
|
7686
7777
|
var isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
|
|
7687
7778
|
if (isSelected) {
|
|
7688
7779
|
return selected;
|
|
@@ -7690,7 +7781,9 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7690
7781
|
if ((Browser.isDevice && !this.isDropDownClick || !Browser.isDevice) &&
|
|
7691
7782
|
!isNullOrUndefined(this.liCollections) && this.liCollections.length > 0) {
|
|
7692
7783
|
var inputValue = this.inputElement.value;
|
|
7693
|
-
var
|
|
7784
|
+
var dataSource = this.sortedData;
|
|
7785
|
+
var type = this.typeOfData(dataSource).typeof;
|
|
7786
|
+
var activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
|
|
7694
7787
|
var activeElement = activeItem.item;
|
|
7695
7788
|
if (!isNullOrUndefined(activeElement)) {
|
|
7696
7789
|
var count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
|
|
@@ -7840,9 +7933,11 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7840
7933
|
}
|
|
7841
7934
|
else if (this.inputElement.value === '') {
|
|
7842
7935
|
this.activeIndex = null;
|
|
7843
|
-
this.list
|
|
7844
|
-
|
|
7845
|
-
|
|
7936
|
+
if (!isNullOrUndefined(this.list)) {
|
|
7937
|
+
this.list.scrollTop = 0;
|
|
7938
|
+
var focusItem = this.list.querySelector('.' + dropDownListClasses.li);
|
|
7939
|
+
this.setHoverList(focusItem);
|
|
7940
|
+
}
|
|
7846
7941
|
}
|
|
7847
7942
|
else {
|
|
7848
7943
|
this.activeIndex = null;
|
|
@@ -8091,7 +8186,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8091
8186
|
* Adds a new item to the combobox popup list. By default, new item appends to the list as the last item,
|
|
8092
8187
|
* but you can insert based on the index parameter.
|
|
8093
8188
|
*
|
|
8094
|
-
* @param
|
|
8189
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
8095
8190
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
8096
8191
|
* @returns {void}
|
|
8097
8192
|
* @deprecated
|
|
@@ -8102,9 +8197,9 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8102
8197
|
/**
|
|
8103
8198
|
* To filter the data from given data source by using query
|
|
8104
8199
|
*
|
|
8105
|
-
* @param
|
|
8106
|
-
* @param
|
|
8107
|
-
* @param
|
|
8200
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
8201
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
8202
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
8108
8203
|
* @returns {void}
|
|
8109
8204
|
* @deprecated
|
|
8110
8205
|
*/
|
|
@@ -8141,7 +8236,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8141
8236
|
this.removeFillSelection();
|
|
8142
8237
|
}
|
|
8143
8238
|
var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
|
|
8144
|
-
var selected = this.list.querySelector('.' + dropDownListClasses.selected);
|
|
8239
|
+
var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : null;
|
|
8145
8240
|
if (this.inputElement && dataItem.text === this.inputElement.value && !isNullOrUndefined(selected)) {
|
|
8146
8241
|
if (this.isSelected) {
|
|
8147
8242
|
this.onChangeEvent(e);
|
|
@@ -8151,10 +8246,12 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8151
8246
|
return;
|
|
8152
8247
|
}
|
|
8153
8248
|
if (this.getModuleName() === 'combobox' && this.inputElement.value.trim() !== '') {
|
|
8154
|
-
var
|
|
8249
|
+
var dataSource = this.sortedData;
|
|
8250
|
+
var type = this.typeOfData(dataSource).typeof;
|
|
8251
|
+
var searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true, dataSource, this.fields, type);
|
|
8155
8252
|
this.selectedLI = searchItem.item;
|
|
8156
8253
|
if (isNullOrUndefined(searchItem.index)) {
|
|
8157
|
-
searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true).index;
|
|
8254
|
+
searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true, dataSource, this.fields, type).index;
|
|
8158
8255
|
}
|
|
8159
8256
|
this.activeIndex = searchItem.index;
|
|
8160
8257
|
if (!isNullOrUndefined(this.selectedLI)) {
|
|
@@ -8443,9 +8540,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8443
8540
|
/**
|
|
8444
8541
|
* To filter the data from given data source by using query
|
|
8445
8542
|
*
|
|
8446
|
-
* @param
|
|
8447
|
-
* @param
|
|
8448
|
-
* @param
|
|
8543
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
8544
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
8545
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
8449
8546
|
* @returns {void}
|
|
8450
8547
|
* @deprecated
|
|
8451
8548
|
*/
|
|
@@ -8485,7 +8582,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8485
8582
|
AutoComplete.prototype.postBackAction = function () {
|
|
8486
8583
|
if (this.autofill && !isNullOrUndefined(this.liCollections[0]) && this.searchList) {
|
|
8487
8584
|
var items = [this.liCollections[0]];
|
|
8488
|
-
var
|
|
8585
|
+
var dataSource = this.listData;
|
|
8586
|
+
var type = this.typeOfData(dataSource).typeof;
|
|
8587
|
+
var searchItem = Search(this.inputElement.value, items, 'StartsWith', this.ignoreCase, dataSource, this.fields, type);
|
|
8489
8588
|
this.searchList = false;
|
|
8490
8589
|
if (!isNullOrUndefined(searchItem.item)) {
|
|
8491
8590
|
_super.prototype.setAutoFill.call(this, this.liCollections[0], true);
|
|
@@ -9031,7 +9130,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9031
9130
|
var htmlAttr = _a[_i];
|
|
9032
9131
|
switch (htmlAttr) {
|
|
9033
9132
|
case 'class': {
|
|
9034
|
-
var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
|
|
9133
|
+
var updatedClassValue = (this.htmlAttributes["" + htmlAttr].replace(/\s+/g, ' ')).trim();
|
|
9035
9134
|
if (updatedClassValue !== '') {
|
|
9036
9135
|
addClass([this.overAllWrapper], updatedClassValue.split(' '));
|
|
9037
9136
|
addClass([this.popupWrapper], updatedClassValue.split(' '));
|
|
@@ -9043,7 +9142,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9043
9142
|
break;
|
|
9044
9143
|
case 'placeholder':
|
|
9045
9144
|
if (!this.placeholder) {
|
|
9046
|
-
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9145
|
+
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
9047
9146
|
this.setProperties({ placeholder: this.inputElement.placeholder }, true);
|
|
9048
9147
|
this.refreshPlaceHolder();
|
|
9049
9148
|
}
|
|
@@ -9053,16 +9152,16 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9053
9152
|
var validateAttr = ['name', 'required', 'aria-required', 'form'];
|
|
9054
9153
|
var containerAttr = ['title', 'role', 'style', 'class'];
|
|
9055
9154
|
if (defaultAttr.indexOf(htmlAttr) > -1) {
|
|
9056
|
-
this.element.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9155
|
+
this.element.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
9057
9156
|
}
|
|
9058
9157
|
else if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
|
|
9059
|
-
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9158
|
+
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
9060
9159
|
}
|
|
9061
9160
|
else if (containerAttr.indexOf(htmlAttr) > -1) {
|
|
9062
|
-
this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9161
|
+
this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
9063
9162
|
}
|
|
9064
|
-
else if (htmlAttr !== 'size') {
|
|
9065
|
-
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9163
|
+
else if (htmlAttr !== 'size' && !isNullOrUndefined(this.inputElement)) {
|
|
9164
|
+
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
9066
9165
|
}
|
|
9067
9166
|
break;
|
|
9068
9167
|
}
|
|
@@ -9071,11 +9170,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9071
9170
|
}
|
|
9072
9171
|
};
|
|
9073
9172
|
MultiSelect.prototype.updateReadonly = function (state) {
|
|
9074
|
-
if (
|
|
9075
|
-
this.
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9173
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
9174
|
+
if (state || this.mode === 'CheckBox') {
|
|
9175
|
+
this.inputElement.setAttribute('readonly', 'true');
|
|
9176
|
+
}
|
|
9177
|
+
else {
|
|
9178
|
+
this.inputElement.removeAttribute('readonly');
|
|
9179
|
+
}
|
|
9079
9180
|
}
|
|
9080
9181
|
};
|
|
9081
9182
|
MultiSelect.prototype.updateClearButton = function (state) {
|
|
@@ -9218,8 +9319,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9218
9319
|
if (!isNullOrUndefined(this.ulElement)) {
|
|
9219
9320
|
attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
9220
9321
|
}
|
|
9221
|
-
var disableStatus = (this.inputElement.disabled) ? true : false;
|
|
9222
|
-
if (!this.isPopupOpen()) {
|
|
9322
|
+
var disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
|
|
9323
|
+
if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
|
|
9223
9324
|
attributes(this.inputElement, this.getAriaAttributes());
|
|
9224
9325
|
}
|
|
9225
9326
|
if (disableStatus) {
|
|
@@ -9329,7 +9430,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9329
9430
|
this.checkForCustomValue(this.tempQuery, this.fields);
|
|
9330
9431
|
return;
|
|
9331
9432
|
}
|
|
9332
|
-
if (this.value && this.value.length && ((this.mode !== 'CheckBox' && this.inputElement.value.trim() !== '') ||
|
|
9433
|
+
if (this.value && this.value.length && ((this.mode !== 'CheckBox' && !isNullOrUndefined(this.inputElement) && this.inputElement.value.trim() !== '') ||
|
|
9333
9434
|
this.mode === 'CheckBox' || ((this.keyCode === 8 || this.keyCode === 46) && this.allowFiltering &&
|
|
9334
9435
|
this.allowCustomValue && this.dataSource instanceof DataManager && this.inputElement.value === ''))) {
|
|
9335
9436
|
this.refreshSelection();
|
|
@@ -9399,8 +9500,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9399
9500
|
}
|
|
9400
9501
|
element.setAttribute('aria-selected', 'true');
|
|
9401
9502
|
if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
|
|
9402
|
-
var ariaValue = element.
|
|
9403
|
-
if (
|
|
9503
|
+
var ariaValue = element.getElementsByClassName('e-check').length;
|
|
9504
|
+
if (ariaValue === 0) {
|
|
9404
9505
|
var args = {
|
|
9405
9506
|
module: 'CheckBoxSelection',
|
|
9406
9507
|
enable: this.mode === 'CheckBox',
|
|
@@ -9524,9 +9625,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9524
9625
|
/**
|
|
9525
9626
|
* To filter the multiselect data from given data source by using query
|
|
9526
9627
|
*
|
|
9527
|
-
* @param
|
|
9528
|
-
* @param
|
|
9529
|
-
* @param
|
|
9628
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
9629
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
9630
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
9530
9631
|
* @returns {void}
|
|
9531
9632
|
*/
|
|
9532
9633
|
MultiSelect.prototype.filter = function (dataSource, query, fields) {
|
|
@@ -9793,11 +9894,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9793
9894
|
}
|
|
9794
9895
|
};
|
|
9795
9896
|
MultiSelect.prototype.refreshInputHight = function () {
|
|
9796
|
-
if (
|
|
9797
|
-
this.
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9897
|
+
if (!isNullOrUndefined(this.searchWrapper)) {
|
|
9898
|
+
if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {
|
|
9899
|
+
this.searchWrapper.classList.remove(ZERO_SIZE);
|
|
9900
|
+
}
|
|
9901
|
+
else {
|
|
9902
|
+
this.searchWrapper.classList.add(ZERO_SIZE);
|
|
9903
|
+
}
|
|
9801
9904
|
}
|
|
9802
9905
|
};
|
|
9803
9906
|
MultiSelect.prototype.validateValues = function (newValue, oldValue) {
|
|
@@ -10598,7 +10701,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10598
10701
|
HIDE_LIST :
|
|
10599
10702
|
dropDownBaseClasses.selected);
|
|
10600
10703
|
if (this.mode === 'CheckBox') {
|
|
10601
|
-
element2.firstElementChild.setAttribute('aria-checked', 'false');
|
|
10602
10704
|
removeClass([element2.firstElementChild.lastElementChild], 'e-check');
|
|
10603
10705
|
}
|
|
10604
10706
|
}
|
|
@@ -10608,7 +10710,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10608
10710
|
HIDE_LIST :
|
|
10609
10711
|
dropDownBaseClasses.selected);
|
|
10610
10712
|
if (this.mode === 'CheckBox') {
|
|
10611
|
-
element2.firstElementChild.setAttribute('aria-checked', 'true');
|
|
10612
10713
|
addClass([element2.firstElementChild.lastElementChild], 'e-check');
|
|
10613
10714
|
}
|
|
10614
10715
|
}
|
|
@@ -10869,109 +10970,111 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10869
10970
|
_super.prototype.render.call(this);
|
|
10870
10971
|
}
|
|
10871
10972
|
if (!this.popupObj) {
|
|
10872
|
-
|
|
10873
|
-
|
|
10874
|
-
|
|
10875
|
-
checkboxFilter.
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
this.
|
|
10882
|
-
|
|
10883
|
-
}
|
|
10884
|
-
append([this.list], this.popupWrapper);
|
|
10885
|
-
if (this.footerTemplate) {
|
|
10886
|
-
this.setFooterTemplate();
|
|
10887
|
-
overAllHeight -= this.footer.offsetHeight;
|
|
10888
|
-
}
|
|
10889
|
-
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
10890
|
-
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10891
|
-
overAllHeight -= this.selectAllHeight;
|
|
10892
|
-
}
|
|
10893
|
-
else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
|
|
10894
|
-
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10895
|
-
overAllHeight = parseInt(this.popupHeight, 10);
|
|
10896
|
-
}
|
|
10897
|
-
else if (this.mode === 'CheckBox' && !this.showSelectAll) {
|
|
10898
|
-
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10899
|
-
overAllHeight = parseInt(this.popupHeight, 10);
|
|
10900
|
-
if (this.headerTemplate && this.header) {
|
|
10973
|
+
if (!isNullOrUndefined(this.popupWrapper)) {
|
|
10974
|
+
document.body.appendChild(this.popupWrapper);
|
|
10975
|
+
var checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
|
|
10976
|
+
if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
|
|
10977
|
+
checkboxFilter.remove();
|
|
10978
|
+
this.filterParent = null;
|
|
10979
|
+
}
|
|
10980
|
+
var overAllHeight = parseInt(this.popupHeight, 10);
|
|
10981
|
+
this.popupWrapper.style.visibility = 'hidden';
|
|
10982
|
+
if (this.headerTemplate) {
|
|
10983
|
+
this.setHeaderTemplate();
|
|
10901
10984
|
overAllHeight -= this.header.offsetHeight;
|
|
10902
10985
|
}
|
|
10903
|
-
|
|
10986
|
+
append([this.list], this.popupWrapper);
|
|
10987
|
+
if (this.footerTemplate) {
|
|
10988
|
+
this.setFooterTemplate();
|
|
10904
10989
|
overAllHeight -= this.footer.offsetHeight;
|
|
10905
10990
|
}
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
module: 'CheckBoxSelection',
|
|
10910
|
-
enable: this.mode === 'CheckBox',
|
|
10911
|
-
popupElement: this.popupWrapper
|
|
10912
|
-
};
|
|
10913
|
-
if (this.allowFiltering) {
|
|
10914
|
-
this.notify('searchBox', args);
|
|
10915
|
-
overAllHeight -= this.searchBoxHeight;
|
|
10991
|
+
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
10992
|
+
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10993
|
+
overAllHeight -= this.selectAllHeight;
|
|
10916
10994
|
}
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
this.
|
|
10922
|
-
|
|
10923
|
-
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
this.popupObj = new Popup(this.popupWrapper, {
|
|
10927
|
-
width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
|
|
10928
|
-
relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
|
|
10929
|
-
enableRtl: this.enableRtl, zIndex: this.zIndex,
|
|
10930
|
-
close: function () {
|
|
10931
|
-
if (_this.popupObj.element.parentElement) {
|
|
10932
|
-
_this.popupObj.unwireScrollEvents();
|
|
10933
|
-
// For restrict the page scrolling in safari browser
|
|
10934
|
-
var checkboxFilterInput = _this.popupWrapper.querySelector('.' + FILTERINPUT);
|
|
10935
|
-
if (_this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
|
|
10936
|
-
checkboxFilterInput.blur();
|
|
10937
|
-
}
|
|
10938
|
-
detach(_this.popupObj.element);
|
|
10939
|
-
}
|
|
10940
|
-
},
|
|
10941
|
-
open: function () {
|
|
10942
|
-
_this.popupObj.resolveCollision();
|
|
10943
|
-
if (!_this.isFirstClick) {
|
|
10944
|
-
var ulElement = _this.list.querySelector('ul');
|
|
10945
|
-
if (ulElement) {
|
|
10946
|
-
if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
|
|
10947
|
-
_this.targetElement().trim() !== '')) {
|
|
10948
|
-
_this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
|
|
10949
|
-
}
|
|
10950
|
-
}
|
|
10951
|
-
_this.isFirstClick = true;
|
|
10995
|
+
else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
|
|
10996
|
+
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10997
|
+
overAllHeight = parseInt(this.popupHeight, 10);
|
|
10998
|
+
}
|
|
10999
|
+
else if (this.mode === 'CheckBox' && !this.showSelectAll) {
|
|
11000
|
+
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
11001
|
+
overAllHeight = parseInt(this.popupHeight, 10);
|
|
11002
|
+
if (this.headerTemplate && this.header) {
|
|
11003
|
+
overAllHeight -= this.header.offsetHeight;
|
|
10952
11004
|
}
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
_this.targetElement().trim() !== '')) {
|
|
10956
|
-
_this.loadTemplate();
|
|
11005
|
+
if (this.footerTemplate && this.footer) {
|
|
11006
|
+
overAllHeight -= this.footer.offsetHeight;
|
|
10957
11007
|
}
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
11008
|
+
}
|
|
11009
|
+
if (this.mode === 'CheckBox') {
|
|
11010
|
+
var args = {
|
|
11011
|
+
module: 'CheckBoxSelection',
|
|
11012
|
+
enable: this.mode === 'CheckBox',
|
|
11013
|
+
popupElement: this.popupWrapper
|
|
11014
|
+
};
|
|
11015
|
+
if (this.allowFiltering) {
|
|
11016
|
+
this.notify('searchBox', args);
|
|
11017
|
+
overAllHeight -= this.searchBoxHeight;
|
|
10963
11018
|
}
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
|
|
11019
|
+
addClass([this.popupWrapper], 'e-checkbox');
|
|
11020
|
+
}
|
|
11021
|
+
if (this.popupHeight !== 'auto') {
|
|
11022
|
+
this.list.style.maxHeight = formatUnit(overAllHeight);
|
|
11023
|
+
this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
|
|
11024
|
+
}
|
|
11025
|
+
else {
|
|
11026
|
+
this.list.style.maxHeight = formatUnit(this.popupHeight);
|
|
11027
|
+
}
|
|
11028
|
+
this.popupObj = new Popup(this.popupWrapper, {
|
|
11029
|
+
width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
|
|
11030
|
+
relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
|
|
11031
|
+
enableRtl: this.enableRtl, zIndex: this.zIndex,
|
|
11032
|
+
close: function () {
|
|
11033
|
+
if (_this.popupObj.element.parentElement) {
|
|
11034
|
+
_this.popupObj.unwireScrollEvents();
|
|
11035
|
+
// For restrict the page scrolling in safari browser
|
|
11036
|
+
var checkboxFilterInput = _this.popupWrapper.querySelector('.' + FILTERINPUT);
|
|
11037
|
+
if (_this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
|
|
11038
|
+
checkboxFilterInput.blur();
|
|
11039
|
+
}
|
|
11040
|
+
detach(_this.popupObj.element);
|
|
11041
|
+
}
|
|
11042
|
+
},
|
|
11043
|
+
open: function () {
|
|
11044
|
+
_this.popupObj.resolveCollision();
|
|
11045
|
+
if (!_this.isFirstClick) {
|
|
11046
|
+
var ulElement = _this.list.querySelector('ul');
|
|
11047
|
+
if (ulElement) {
|
|
11048
|
+
if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
|
|
11049
|
+
_this.targetElement().trim() !== '')) {
|
|
11050
|
+
_this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
|
|
11051
|
+
}
|
|
11052
|
+
}
|
|
11053
|
+
_this.isFirstClick = true;
|
|
11054
|
+
}
|
|
11055
|
+
_this.popupObj.wireScrollEvents();
|
|
11056
|
+
if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
|
|
11057
|
+
_this.targetElement().trim() !== '')) {
|
|
11058
|
+
_this.loadTemplate();
|
|
11059
|
+
}
|
|
11060
|
+
_this.setScrollPosition();
|
|
11061
|
+
if (_this.allowFiltering) {
|
|
11062
|
+
_this.notify('inputFocus', {
|
|
11063
|
+
module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'focus'
|
|
11064
|
+
});
|
|
11065
|
+
}
|
|
11066
|
+
}, targetExitViewport: function () {
|
|
11067
|
+
if (!Browser.isDevice) {
|
|
11068
|
+
_this.hidePopup();
|
|
11069
|
+
}
|
|
10967
11070
|
}
|
|
11071
|
+
});
|
|
11072
|
+
if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
|
|
11073
|
+
this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10968
11074
|
}
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
11075
|
+
this.popupObj.close();
|
|
11076
|
+
this.popupWrapper.style.visibility = '';
|
|
10972
11077
|
}
|
|
10973
|
-
this.popupObj.close();
|
|
10974
|
-
this.popupWrapper.style.visibility = '';
|
|
10975
11078
|
}
|
|
10976
11079
|
};
|
|
10977
11080
|
MultiSelect.prototype.setHeaderTemplate = function () {
|
|
@@ -11234,7 +11337,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11234
11337
|
var temp;
|
|
11235
11338
|
var tempData = this.listData;
|
|
11236
11339
|
this.listData = this.mainData;
|
|
11237
|
-
this.hiddenElement
|
|
11340
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
11341
|
+
this.hiddenElement.innerHTML = '';
|
|
11342
|
+
}
|
|
11238
11343
|
if (!isNullOrUndefined(this.value)) {
|
|
11239
11344
|
for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
|
|
11240
11345
|
var listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
|
|
@@ -11252,7 +11357,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11252
11357
|
data += temp + delimiterChar + ' ';
|
|
11253
11358
|
text.push(temp);
|
|
11254
11359
|
}
|
|
11255
|
-
this.hiddenElement
|
|
11360
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
11361
|
+
this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
|
|
11362
|
+
}
|
|
11256
11363
|
}
|
|
11257
11364
|
}
|
|
11258
11365
|
this.setProperties({ text: text.toString() }, true);
|
|
@@ -11464,10 +11571,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11464
11571
|
selectItems[temp1 - 1].setAttribute('aria-selected', 'false');
|
|
11465
11572
|
if (this.mode === 'CheckBox') {
|
|
11466
11573
|
if (selectedItems && (selectedItems.length > (temp1 - 1))) {
|
|
11467
|
-
selectedItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
|
|
11468
11574
|
removeClass([selectedItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
|
|
11469
11575
|
}
|
|
11470
|
-
selectItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
|
|
11471
11576
|
removeClass([selectItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
|
|
11472
11577
|
}
|
|
11473
11578
|
temp1--;
|
|
@@ -11525,9 +11630,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11525
11630
|
addClass([element], className);
|
|
11526
11631
|
this.updateMainList(false, element.getAttribute('data-value'), mainElement);
|
|
11527
11632
|
element.setAttribute('aria-selected', 'true');
|
|
11528
|
-
if (this.mode === 'CheckBox') {
|
|
11529
|
-
var ariaCheck = element.
|
|
11530
|
-
if (ariaCheck ===
|
|
11633
|
+
if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
|
|
11634
|
+
var ariaCheck = element.getElementsByClassName('e-check').length;
|
|
11635
|
+
if (ariaCheck === 0) {
|
|
11531
11636
|
this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });
|
|
11532
11637
|
}
|
|
11533
11638
|
}
|
|
@@ -11846,9 +11951,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11846
11951
|
if (this.chipCollectionWrapper) {
|
|
11847
11952
|
this.chipCollectionWrapper.style.display = 'none';
|
|
11848
11953
|
}
|
|
11849
|
-
this.viewWrapper
|
|
11850
|
-
|
|
11851
|
-
|
|
11954
|
+
if (!isNullOrUndefined(this.viewWrapper)) {
|
|
11955
|
+
this.viewWrapper.style.display = '';
|
|
11956
|
+
this.viewWrapper.style.width = '';
|
|
11957
|
+
this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
|
|
11958
|
+
}
|
|
11852
11959
|
if (this.value && this.value.length) {
|
|
11853
11960
|
var data = '';
|
|
11854
11961
|
var temp = void 0;
|
|
@@ -11936,8 +12043,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11936
12043
|
}
|
|
11937
12044
|
}
|
|
11938
12045
|
else {
|
|
11939
|
-
this.viewWrapper
|
|
11940
|
-
|
|
12046
|
+
if (!isNullOrUndefined(this.viewWrapper)) {
|
|
12047
|
+
this.viewWrapper.innerHTML = '';
|
|
12048
|
+
this.viewWrapper.style.display = 'none';
|
|
12049
|
+
}
|
|
11941
12050
|
}
|
|
11942
12051
|
};
|
|
11943
12052
|
MultiSelect.prototype.checkClearIconWidth = function () {
|
|
@@ -12010,29 +12119,41 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12010
12119
|
return temp;
|
|
12011
12120
|
};
|
|
12012
12121
|
MultiSelect.prototype.unWireEvent = function () {
|
|
12013
|
-
|
|
12122
|
+
if (!isNullOrUndefined(this.componentWrapper)) {
|
|
12123
|
+
EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
|
|
12124
|
+
}
|
|
12014
12125
|
EventHandler.remove(window, 'resize', this.windowResize);
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
12018
|
-
|
|
12126
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
12127
|
+
EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
|
|
12128
|
+
EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
|
|
12129
|
+
if (this.mode !== 'CheckBox') {
|
|
12130
|
+
EventHandler.remove(this.inputElement, 'input', this.onInput);
|
|
12131
|
+
}
|
|
12132
|
+
EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
|
|
12133
|
+
var formElement = closest(this.inputElement, 'form');
|
|
12134
|
+
if (formElement) {
|
|
12135
|
+
EventHandler.remove(formElement, 'reset', this.resetValueHandler);
|
|
12136
|
+
}
|
|
12137
|
+
EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
|
|
12019
12138
|
}
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12139
|
+
if (!isNullOrUndefined(this.componentWrapper)) {
|
|
12140
|
+
EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
|
|
12141
|
+
EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
|
|
12142
|
+
}
|
|
12143
|
+
if (!isNullOrUndefined(this.overAllClear)) {
|
|
12144
|
+
EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
|
|
12145
|
+
}
|
|
12146
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
12147
|
+
EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
|
|
12024
12148
|
}
|
|
12025
|
-
EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
|
|
12026
|
-
EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
|
|
12027
|
-
EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
|
|
12028
|
-
EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
|
|
12029
|
-
EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
|
|
12030
12149
|
};
|
|
12031
12150
|
MultiSelect.prototype.selectAllItem = function (state, event, list) {
|
|
12032
12151
|
var li;
|
|
12033
|
-
|
|
12034
|
-
|
|
12035
|
-
|
|
12152
|
+
if (!isNullOrUndefined(this.list)) {
|
|
12153
|
+
li = this.list.querySelectorAll(state ?
|
|
12154
|
+
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
|
|
12155
|
+
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
|
|
12156
|
+
}
|
|
12036
12157
|
if (this.value && this.value.length && event && event.target
|
|
12037
12158
|
&& closest(event.target, '.e-close-hooker') && this.allowFiltering) {
|
|
12038
12159
|
li = this.mainList.querySelectorAll(state ?
|
|
@@ -12534,7 +12655,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12534
12655
|
* Adds a new item to the multiselect popup list. By default, new item appends to the list as the last item,
|
|
12535
12656
|
* but you can insert based on the index parameter.
|
|
12536
12657
|
*
|
|
12537
|
-
* @param
|
|
12658
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
12538
12659
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
12539
12660
|
* @returns {void}
|
|
12540
12661
|
*/
|
|
@@ -12845,11 +12966,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12845
12966
|
}
|
|
12846
12967
|
};
|
|
12847
12968
|
MultiSelect.prototype.addValidInputClass = function () {
|
|
12848
|
-
if (
|
|
12849
|
-
|
|
12850
|
-
|
|
12851
|
-
|
|
12852
|
-
|
|
12969
|
+
if (!isNullOrUndefined(this.overAllWrapper)) {
|
|
12970
|
+
if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {
|
|
12971
|
+
addClass([this.overAllWrapper], 'e-valid-input');
|
|
12972
|
+
}
|
|
12973
|
+
else {
|
|
12974
|
+
removeClass([this.overAllWrapper], 'e-valid-input');
|
|
12975
|
+
}
|
|
12853
12976
|
}
|
|
12854
12977
|
};
|
|
12855
12978
|
MultiSelect.prototype.dropDownIcon = function () {
|
|
@@ -12902,13 +13025,17 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12902
13025
|
_super.prototype.destroy.call(this);
|
|
12903
13026
|
var temp = ['readonly', 'aria-disabled', 'placeholder'];
|
|
12904
13027
|
var length = temp.length;
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
13028
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
13029
|
+
while (length > 0) {
|
|
13030
|
+
this.inputElement.removeAttribute(temp[length - 1]);
|
|
13031
|
+
length--;
|
|
13032
|
+
}
|
|
12908
13033
|
}
|
|
12909
|
-
this.element
|
|
12910
|
-
|
|
12911
|
-
|
|
13034
|
+
if (!isNullOrUndefined(this.element)) {
|
|
13035
|
+
this.element.removeAttribute('data-initial-value');
|
|
13036
|
+
this.element.style.display = 'block';
|
|
13037
|
+
}
|
|
13038
|
+
if (this.overAllWrapper && this.overAllWrapper.parentElement) {
|
|
12912
13039
|
if (this.overAllWrapper.parentElement.tagName === this.getNgDirective()) {
|
|
12913
13040
|
remove(this.overAllWrapper);
|
|
12914
13041
|
}
|
|
@@ -12917,6 +13044,25 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12917
13044
|
remove(this.overAllWrapper);
|
|
12918
13045
|
}
|
|
12919
13046
|
}
|
|
13047
|
+
this.componentWrapper = null;
|
|
13048
|
+
this.overAllClear = null;
|
|
13049
|
+
this.overAllWrapper = null;
|
|
13050
|
+
this.hiddenElement = null;
|
|
13051
|
+
this.searchWrapper = null;
|
|
13052
|
+
this.viewWrapper = null;
|
|
13053
|
+
this.chipCollectionWrapper = null;
|
|
13054
|
+
this.targetInputElement = null;
|
|
13055
|
+
this.popupWrapper = null;
|
|
13056
|
+
this.inputElement = null;
|
|
13057
|
+
this.delimiterWrapper = null;
|
|
13058
|
+
this.popupObj = null;
|
|
13059
|
+
this.popupWrapper = null;
|
|
13060
|
+
this.liCollections = null;
|
|
13061
|
+
this.header = null;
|
|
13062
|
+
this.mainList = null;
|
|
13063
|
+
this.mainListCollection = null;
|
|
13064
|
+
this.footer = null;
|
|
13065
|
+
this.selectAllEventEle = null;
|
|
12920
13066
|
};
|
|
12921
13067
|
__decorate$5([
|
|
12922
13068
|
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
@@ -13268,6 +13414,12 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13268
13414
|
CheckBoxSelection.prototype.destroy = function () {
|
|
13269
13415
|
this.removeEventListener();
|
|
13270
13416
|
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
13417
|
+
this.checkAllParent = null;
|
|
13418
|
+
this.clearIconElement = null;
|
|
13419
|
+
this.filterInput = null;
|
|
13420
|
+
this.filterInputObj = null;
|
|
13421
|
+
this.checkWrapper = null;
|
|
13422
|
+
this.selectAllSpan = null;
|
|
13271
13423
|
};
|
|
13272
13424
|
CheckBoxSelection.prototype.listSelection = function (args) {
|
|
13273
13425
|
var target;
|
|
@@ -13316,12 +13468,10 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13316
13468
|
e.preventDefault();
|
|
13317
13469
|
};
|
|
13318
13470
|
CheckBoxSelection.prototype.changeState = function (wrapper, state, e, isPrevent, selectAll$$1) {
|
|
13319
|
-
var ariaState;
|
|
13320
13471
|
var frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME$1)[0];
|
|
13321
13472
|
if (state === 'check' && !frameSpan.classList.contains(CHECK$1)) {
|
|
13322
13473
|
frameSpan.classList.remove(INDETERMINATE);
|
|
13323
13474
|
frameSpan.classList.add(CHECK$1);
|
|
13324
|
-
ariaState = 'true';
|
|
13325
13475
|
if (selectAll$$1) {
|
|
13326
13476
|
this.parent.selectAllItems(true, e);
|
|
13327
13477
|
this.setLocale(true);
|
|
@@ -13329,7 +13479,6 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13329
13479
|
}
|
|
13330
13480
|
else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK$1) || frameSpan.classList.contains(INDETERMINATE))) {
|
|
13331
13481
|
removeClass([frameSpan], [CHECK$1, INDETERMINATE]);
|
|
13332
|
-
ariaState = 'false';
|
|
13333
13482
|
if (selectAll$$1) {
|
|
13334
13483
|
this.parent.selectAllItems(false, e);
|
|
13335
13484
|
this.setLocale();
|
|
@@ -13338,16 +13487,11 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13338
13487
|
else if (state === 'indeterminate' && !(frameSpan.classList.contains(INDETERMINATE))) {
|
|
13339
13488
|
removeClass([frameSpan], [CHECK$1]);
|
|
13340
13489
|
frameSpan.classList.add(INDETERMINATE);
|
|
13341
|
-
ariaState = 'false';
|
|
13342
13490
|
if (selectAll$$1) {
|
|
13343
13491
|
this.parent.selectAllItems(false, e);
|
|
13344
13492
|
this.setLocale();
|
|
13345
13493
|
}
|
|
13346
13494
|
}
|
|
13347
|
-
ariaState = state === 'check' ? 'true' : state === 'uncheck' ? 'false' : ariaState;
|
|
13348
|
-
if (!isNullOrUndefined(ariaState)) {
|
|
13349
|
-
wrapper.setAttribute('aria-checked', ariaState);
|
|
13350
|
-
}
|
|
13351
13495
|
};
|
|
13352
13496
|
CheckBoxSelection.prototype.setSearchBox = function (args) {
|
|
13353
13497
|
if (isNullOrUndefined(this.parent.filterParent)) {
|
|
@@ -13508,8 +13652,8 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13508
13652
|
e.preventDefault();
|
|
13509
13653
|
}
|
|
13510
13654
|
}
|
|
13511
|
-
if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
|
|
13512
|
-
!this.parent.overAllWrapper.contains(e.target)) {
|
|
13655
|
+
if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
|
|
13656
|
+
&& !isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target)) {
|
|
13513
13657
|
if (this.parent.overAllWrapper.classList.contains(dropDownBaseClasses.focus) || this.parent.isPopupOpen()) {
|
|
13514
13658
|
this.parent.inputFocus = false;
|
|
13515
13659
|
this.parent.scrollFocusStatus = false;
|
|
@@ -13522,7 +13666,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13522
13666
|
this.parent.scrollFocusStatus = (Browser.isIE || Browser.info.name === 'edge') &&
|
|
13523
13667
|
(document.activeElement === this.filterInput);
|
|
13524
13668
|
}
|
|
13525
|
-
if (!this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
|
|
13669
|
+
if (!isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
|
|
13526
13670
|
!this.parent.isPopupOpen()) {
|
|
13527
13671
|
if (Browser.isIE) {
|
|
13528
13672
|
this.parent.onBlurHandler();
|
|
@@ -13553,7 +13697,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13553
13697
|
}
|
|
13554
13698
|
};
|
|
13555
13699
|
CheckBoxSelection.prototype.checkSelectAll = function (e) {
|
|
13556
|
-
if (e.value === 'check'
|
|
13700
|
+
if (e.value === 'check') {
|
|
13557
13701
|
this.changeState(this.checkAllParent, e.value, null, null, false);
|
|
13558
13702
|
this.setLocale(true);
|
|
13559
13703
|
}
|
|
@@ -13737,6 +13881,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13737
13881
|
this.isCustomFiltering = false;
|
|
13738
13882
|
this.initialSelectedOptions = this.value;
|
|
13739
13883
|
_super.prototype.render.call(this);
|
|
13884
|
+
this.setEnabled();
|
|
13740
13885
|
this.renderComplete();
|
|
13741
13886
|
};
|
|
13742
13887
|
ListBox.prototype.initWrapper = function () {
|
|
@@ -14034,10 +14179,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14034
14179
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14035
14180
|
var event = args.event;
|
|
14036
14181
|
var wrapper;
|
|
14037
|
-
if (args.target && (args.target.classList.contains(
|
|
14038
|
-
|| args.target.classList.contains(
|
|
14039
|
-
if (args.target.classList.contains(
|
|
14040
|
-
|| args.target.classList.contains(
|
|
14182
|
+
if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
|
|
14183
|
+
|| args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
|
|
14184
|
+
if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
|
|
14185
|
+
|| args.target.classList.contains('e-input-group')) {
|
|
14041
14186
|
wrapper = args.target.closest('.e-listbox-wrapper');
|
|
14042
14187
|
}
|
|
14043
14188
|
else {
|
|
@@ -14092,7 +14237,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14092
14237
|
var getArgs = this.getDragArgs({ target: args.droppedElement }, true);
|
|
14093
14238
|
var sourceArgs = { previousData: this.dataSource };
|
|
14094
14239
|
var destArgs = { previousData: listObj.dataSource };
|
|
14095
|
-
var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
14240
|
+
var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
14241
|
+
previousIndex: args.previousIndex, currentIndex: args.currentIndex });
|
|
14096
14242
|
if (listObj !== this) {
|
|
14097
14243
|
var sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
|
|
14098
14244
|
dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
|
|
@@ -14229,7 +14375,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14229
14375
|
};
|
|
14230
14376
|
ListBox.prototype.updateListItems = function (sourceElem, destElem) {
|
|
14231
14377
|
var i = 0;
|
|
14232
|
-
destElem.innerHTML =
|
|
14378
|
+
destElem.innerHTML = '';
|
|
14233
14379
|
while (i < sourceElem.childNodes.length) {
|
|
14234
14380
|
destElem.appendChild(sourceElem.childNodes[i]);
|
|
14235
14381
|
}
|
|
@@ -14258,6 +14404,14 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14258
14404
|
}
|
|
14259
14405
|
return listObj;
|
|
14260
14406
|
};
|
|
14407
|
+
/**
|
|
14408
|
+
* Sets the enabled state to DropDownBase.
|
|
14409
|
+
*
|
|
14410
|
+
* @returns {void}
|
|
14411
|
+
*/
|
|
14412
|
+
ListBox.prototype.setEnabled = function () {
|
|
14413
|
+
this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
|
|
14414
|
+
};
|
|
14261
14415
|
ListBox.prototype.listOption = function (dataSource, fields) {
|
|
14262
14416
|
this.listCurrentOptions = _super.prototype.listOption.call(this, dataSource, fields);
|
|
14263
14417
|
this.listCurrentOptions = extend({}, this.listCurrentOptions, { itemCreated: this.triggerBeforeItemRender.bind(this) }, true);
|
|
@@ -14707,9 +14861,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14707
14861
|
prepend([this.filterParent], this.list);
|
|
14708
14862
|
attributes(this.filterInput, {
|
|
14709
14863
|
'aria-disabled': 'false',
|
|
14710
|
-
'aria-
|
|
14711
|
-
'role': 'listbox',
|
|
14712
|
-
'aria-activedescendant': null,
|
|
14864
|
+
'aria-label': 'search list item',
|
|
14713
14865
|
'autocomplete': 'off',
|
|
14714
14866
|
'autocorrect': 'off',
|
|
14715
14867
|
'autocapitalize': 'off',
|
|
@@ -15157,7 +15309,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15157
15309
|
listData = listData
|
|
15158
15310
|
.filter(function (data) { return data.isHeader !== true; });
|
|
15159
15311
|
tListBox.listData = tListBox.jsonData = listData;
|
|
15160
|
-
if (fListBox.listData.length
|
|
15312
|
+
if (fListBox.listData.length === fListBox.jsonData.length) {
|
|
15161
15313
|
fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
|
|
15162
15314
|
}
|
|
15163
15315
|
else if (this.allowFiltering) {
|
|
@@ -15303,7 +15455,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15303
15455
|
}
|
|
15304
15456
|
}
|
|
15305
15457
|
}
|
|
15306
|
-
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !==
|
|
15458
|
+
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
|
|
15307
15459
|
this.upDownKeyHandler(e);
|
|
15308
15460
|
}
|
|
15309
15461
|
}
|
|
@@ -15347,8 +15499,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15347
15499
|
}
|
|
15348
15500
|
if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
|
|
15349
15501
|
var selectedidx = Array.prototype.indexOf.call(ul.children, fli);
|
|
15350
|
-
var sidx = e.code ===
|
|
15351
|
-
var eidx = e.code ===
|
|
15502
|
+
var sidx = e.code === 'Home' ? 0 : selectedidx;
|
|
15503
|
+
var eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
|
|
15352
15504
|
for (var i = sidx; i <= eidx; i++) {
|
|
15353
15505
|
var item = ul.children[i];
|
|
15354
15506
|
this.notify('updatelist', { li: item, e: {
|
|
@@ -15506,7 +15658,6 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15506
15658
|
dvalue_1 = _this.getFormattedValue(li.getAttribute('data-value'));
|
|
15507
15659
|
if (values.indexOf(dvalue_1) < 0) {
|
|
15508
15660
|
li.getElementsByClassName('e-check')[0].classList.remove('e-check');
|
|
15509
|
-
li.getElementsByClassName('e-checkbox-wrapper')[0].removeAttribute('aria-checked');
|
|
15510
15661
|
li.removeAttribute('aria-selected');
|
|
15511
15662
|
}
|
|
15512
15663
|
});
|
|
@@ -15858,6 +16009,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15858
16009
|
__decorate$6([
|
|
15859
16010
|
Property('')
|
|
15860
16011
|
], ListBox.prototype, "height", void 0);
|
|
16012
|
+
__decorate$6([
|
|
16013
|
+
Property(true)
|
|
16014
|
+
], ListBox.prototype, "enabled", void 0);
|
|
16015
|
+
__decorate$6([
|
|
16016
|
+
Property(false)
|
|
16017
|
+
], ListBox.prototype, "enablePersistence", void 0);
|
|
15861
16018
|
__decorate$6([
|
|
15862
16019
|
Property(false)
|
|
15863
16020
|
], ListBox.prototype, "allowDragAndDrop", void 0);
|
|
@@ -16032,6 +16189,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16032
16189
|
this.isFiltered = false;
|
|
16033
16190
|
this.beforePopupOpen = false;
|
|
16034
16191
|
this.initRemoteRender = false;
|
|
16192
|
+
this.isListResetted = false;
|
|
16035
16193
|
this.isPopupOpen = false;
|
|
16036
16194
|
this.isCollided = false;
|
|
16037
16195
|
this.lineBreak = false;
|
|
@@ -16098,6 +16256,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16098
16256
|
/**
|
|
16099
16257
|
* Hides the spinner loader.
|
|
16100
16258
|
*
|
|
16259
|
+
* @private
|
|
16101
16260
|
* @returns {void}
|
|
16102
16261
|
*/
|
|
16103
16262
|
Mention.prototype.hideSpinner = function () {
|
|
@@ -16153,6 +16312,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16153
16312
|
break;
|
|
16154
16313
|
case 'tab':
|
|
16155
16314
|
if (this.isPopupOpen) {
|
|
16315
|
+
e.preventDefault();
|
|
16156
16316
|
var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
16157
16317
|
if (li) {
|
|
16158
16318
|
this.setSelection(li, e);
|
|
@@ -16192,7 +16352,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16192
16352
|
var startIndex = 0;
|
|
16193
16353
|
startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
|
|
16194
16354
|
index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
|
|
16195
|
-
var nextItem = isNullOrUndefined(this.activeIndex) ?
|
|
16355
|
+
var nextItem = isNullOrUndefined(this.activeIndex) ?
|
|
16356
|
+
this.liCollections[startIndex] : this.liCollections[index];
|
|
16196
16357
|
if (!isNullOrUndefined(nextItem)) {
|
|
16197
16358
|
this.setSelection(nextItem, e);
|
|
16198
16359
|
}
|
|
@@ -16217,9 +16378,14 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16217
16378
|
}
|
|
16218
16379
|
var currentRange = this.getTextRange();
|
|
16219
16380
|
var lastWordRange = this.getLastLetter(currentRange);
|
|
16381
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
16220
16382
|
var Regex = new RegExp(this.mentionChar, 'g');
|
|
16221
16383
|
var charRegex = new RegExp('[a-zA-Z]', 'g');
|
|
16222
16384
|
if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
|
|
16385
|
+
if ((e.keyCode === 37 || e.keyCode === 39) && !isNullOrUndefined(currentRange) &&
|
|
16386
|
+
currentRange.indexOf(this.mentionChar) === -1 && this.isPopupOpen) {
|
|
16387
|
+
this.hidePopup();
|
|
16388
|
+
}
|
|
16223
16389
|
return;
|
|
16224
16390
|
}
|
|
16225
16391
|
if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
|
|
@@ -16248,7 +16414,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16248
16414
|
if (!this.isContentEditable(this.inputElement)) {
|
|
16249
16415
|
this.showPopup();
|
|
16250
16416
|
}
|
|
16251
|
-
else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement) {
|
|
16417
|
+
else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement && e.keyCode !== 9) {
|
|
16252
16418
|
this.showPopup();
|
|
16253
16419
|
}
|
|
16254
16420
|
}
|
|
@@ -16277,8 +16443,12 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16277
16443
|
this.searchLists(e);
|
|
16278
16444
|
}
|
|
16279
16445
|
else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
|
|
16280
|
-
this.
|
|
16446
|
+
this.searchLists(e);
|
|
16447
|
+
if (!this.isListResetted) {
|
|
16448
|
+
this.resetList(this.dataSource, this.fields);
|
|
16449
|
+
}
|
|
16281
16450
|
}
|
|
16451
|
+
this.isListResetted = false;
|
|
16282
16452
|
};
|
|
16283
16453
|
Mention.prototype.isMatchedText = function () {
|
|
16284
16454
|
var isMatched = false;
|
|
@@ -16312,7 +16482,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16312
16482
|
this.activeIndex = null;
|
|
16313
16483
|
var eventArgs = {
|
|
16314
16484
|
preventDefaultAction: false,
|
|
16315
|
-
text: this.
|
|
16485
|
+
text: this.queryString,
|
|
16316
16486
|
updateData: function (dataSource, query, fields) {
|
|
16317
16487
|
if (eventArgs.cancel) {
|
|
16318
16488
|
return;
|
|
@@ -16330,8 +16500,9 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16330
16500
|
};
|
|
16331
16501
|
Mention.prototype.filterAction = function (dataSource, query, fields) {
|
|
16332
16502
|
this.beforePopupOpen = true;
|
|
16333
|
-
if (this.queryString
|
|
16503
|
+
if (this.queryString.length >= this.minLength) {
|
|
16334
16504
|
this.resetList(dataSource, fields, query);
|
|
16505
|
+
this.isListResetted = true;
|
|
16335
16506
|
}
|
|
16336
16507
|
else {
|
|
16337
16508
|
if (this.isPopupOpen) {
|
|
@@ -16453,12 +16624,14 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16453
16624
|
}
|
|
16454
16625
|
}
|
|
16455
16626
|
else {
|
|
16456
|
-
|
|
16457
|
-
|
|
16458
|
-
|
|
16459
|
-
|
|
16460
|
-
|
|
16461
|
-
|
|
16627
|
+
if (this.range) {
|
|
16628
|
+
var selectedElem = this.range.startContainer;
|
|
16629
|
+
if (!isNullOrUndefined(selectedElem)) {
|
|
16630
|
+
var workingNodeContent = selectedElem.textContent;
|
|
16631
|
+
var selectStartOffset = this.range.startOffset;
|
|
16632
|
+
if (workingNodeContent && selectStartOffset >= 0) {
|
|
16633
|
+
text = workingNodeContent.substring(0, selectStartOffset);
|
|
16634
|
+
}
|
|
16462
16635
|
}
|
|
16463
16636
|
}
|
|
16464
16637
|
}
|
|
@@ -16482,6 +16655,10 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16482
16655
|
* @returns {void}
|
|
16483
16656
|
*/
|
|
16484
16657
|
Mention.prototype.showPopup = function () {
|
|
16658
|
+
this.beforePopupOpen = true;
|
|
16659
|
+
if (isNullOrUndefined(this.list)) {
|
|
16660
|
+
this.initValue();
|
|
16661
|
+
}
|
|
16485
16662
|
this.renderPopup();
|
|
16486
16663
|
attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
|
|
16487
16664
|
if (this.selectedElementID == null) {
|
|
@@ -16547,18 +16724,13 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16547
16724
|
}
|
|
16548
16725
|
}
|
|
16549
16726
|
append([_this.list], popupEle_1);
|
|
16550
|
-
if ((!_this.popupObj || !document.body.contains(_this.popupObj.element)) ||
|
|
16727
|
+
if ((!_this.popupObj || !document.body.contains(_this.popupObj.element)) ||
|
|
16728
|
+
!document.contains(popupEle_1) && isNullOrUndefined(_this.target)) {
|
|
16551
16729
|
document.body.appendChild(popupEle_1);
|
|
16552
16730
|
}
|
|
16553
16731
|
var coordinates_1;
|
|
16554
16732
|
popupEle_1.style.visibility = 'hidden';
|
|
16555
|
-
|
|
16556
|
-
_this.list.style.maxHeight = (parseInt(_this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
|
|
16557
|
-
popupEle_1.style.maxHeight = formatUnit(_this.popupHeight);
|
|
16558
|
-
}
|
|
16559
|
-
else {
|
|
16560
|
-
popupEle_1.style.height = 'auto';
|
|
16561
|
-
}
|
|
16733
|
+
_this.setHeight(popupEle_1);
|
|
16562
16734
|
var offsetValue = 0;
|
|
16563
16735
|
var left = 0;
|
|
16564
16736
|
_this.initializePopup(popupEle_1, offsetValue, left);
|
|
@@ -16581,6 +16753,9 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16581
16753
|
if (!eventArgs.cancel) {
|
|
16582
16754
|
_this.renderReactTemplates();
|
|
16583
16755
|
_this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.inputElement : null);
|
|
16756
|
+
if (isNullOrUndefined(_this.getTriggerCharPosition())) {
|
|
16757
|
+
return;
|
|
16758
|
+
}
|
|
16584
16759
|
coordinates_1 = _this.getCoordinates(_this.inputElement, _this.getTriggerCharPosition());
|
|
16585
16760
|
if (!_this.isCollided) {
|
|
16586
16761
|
popupEle_1.style.cssText = 'top: '.concat(coordinates_1.top.toString(), 'px;\n left: ').concat(coordinates_1.left.toString(), 'px;\nposition: absolute;\n display: block;');
|
|
@@ -16590,6 +16765,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16590
16765
|
_this.isCollided = false;
|
|
16591
16766
|
}
|
|
16592
16767
|
popupEle_1.style.width = _this.popupWidth !== '100%' && !isNullOrUndefined(_this.popupWidth) ? formatUnit(_this.popupWidth) : 'auto';
|
|
16768
|
+
_this.setHeight(popupEle_1);
|
|
16769
|
+
popupEle_1.style.zIndex = _this.zIndex === 1000 ? getZindexPartial(popupEle_1).toString() : _this.zIndex.toString();
|
|
16593
16770
|
}
|
|
16594
16771
|
else {
|
|
16595
16772
|
_this.beforePopupOpen = false;
|
|
@@ -16602,6 +16779,15 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16602
16779
|
}
|
|
16603
16780
|
});
|
|
16604
16781
|
};
|
|
16782
|
+
Mention.prototype.setHeight = function (popupEle) {
|
|
16783
|
+
if (this.popupHeight !== 'auto') {
|
|
16784
|
+
this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
|
|
16785
|
+
popupEle.style.maxHeight = formatUnit(this.popupHeight);
|
|
16786
|
+
}
|
|
16787
|
+
else {
|
|
16788
|
+
popupEle.style.height = 'auto';
|
|
16789
|
+
}
|
|
16790
|
+
};
|
|
16605
16791
|
Mention.prototype.checkCollision = function (popupEle) {
|
|
16606
16792
|
if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
|
|
16607
16793
|
var collision = isCollide(popupEle);
|
|
@@ -16682,7 +16868,9 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16682
16868
|
computed = getComputedStyle(element);
|
|
16683
16869
|
div.style.position = 'absolute';
|
|
16684
16870
|
div.style.visibility = 'hidden';
|
|
16871
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16685
16872
|
properties.forEach(function (prop) {
|
|
16873
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
16686
16874
|
div.style[prop] = computed[prop];
|
|
16687
16875
|
});
|
|
16688
16876
|
div.textContent = element.value.substring(0, position);
|
|
@@ -16716,13 +16904,12 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16716
16904
|
}
|
|
16717
16905
|
else {
|
|
16718
16906
|
coordinates = {
|
|
16719
|
-
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize),
|
|
16907
|
+
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
|
|
16720
16908
|
left: rect.left + windowLeft
|
|
16721
16909
|
};
|
|
16722
16910
|
}
|
|
16723
16911
|
return coordinates;
|
|
16724
16912
|
};
|
|
16725
|
-
|
|
16726
16913
|
Mention.prototype.initValue = function () {
|
|
16727
16914
|
this.renderList();
|
|
16728
16915
|
if (this.dataSource instanceof DataManager) {
|
|
@@ -16918,8 +17105,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16918
17105
|
}
|
|
16919
17106
|
return items;
|
|
16920
17107
|
};
|
|
16921
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16922
17108
|
Mention.prototype.setValue = function (e) {
|
|
17109
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16923
17110
|
if (!this.isReact) {
|
|
16924
17111
|
if (!isNullOrUndefined(this.displayTemplate)) {
|
|
16925
17112
|
this.setDisplayTemplate();
|
|
@@ -16947,7 +17134,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16947
17134
|
var selection = this.inputElement.ownerDocument.getSelection();
|
|
16948
17135
|
var startPos = this.getTriggerCharPosition();
|
|
16949
17136
|
textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
|
|
16950
|
-
if (dataItem.
|
|
17137
|
+
if (dataItem.text !== null) {
|
|
16951
17138
|
value = this.mentionVal(dataItem.text);
|
|
16952
17139
|
}
|
|
16953
17140
|
if (!this.isContentEditable(this.inputElement)) {
|
|
@@ -16979,6 +17166,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
16979
17166
|
var frag = document.createDocumentFragment();
|
|
16980
17167
|
var node = void 0;
|
|
16981
17168
|
var lastNode = void 0;
|
|
17169
|
+
// eslint-disable-next-line no-cond-assign
|
|
16982
17170
|
while (node = element.firstChild) {
|
|
16983
17171
|
lastNode = frag.appendChild(node);
|
|
16984
17172
|
}
|
|
@@ -17034,6 +17222,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
17034
17222
|
this.displayTempElement.appendChild(displayCompTemp[i]);
|
|
17035
17223
|
}
|
|
17036
17224
|
}
|
|
17225
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17037
17226
|
if (!this.isReact) {
|
|
17038
17227
|
this.renderTemplates();
|
|
17039
17228
|
}
|
|
@@ -17043,6 +17232,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
17043
17232
|
});
|
|
17044
17233
|
}
|
|
17045
17234
|
};
|
|
17235
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17046
17236
|
Mention.prototype.renderTemplates = function (callBack) {
|
|
17047
17237
|
this.renderReactTemplates(callBack);
|
|
17048
17238
|
};
|
|
@@ -17072,6 +17262,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
17072
17262
|
this.spinnerTemplateElement.appendChild(spinnerCompTemp[i]);
|
|
17073
17263
|
}
|
|
17074
17264
|
}
|
|
17265
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17075
17266
|
if (!this.isReact) {
|
|
17076
17267
|
this.renderTemplates();
|
|
17077
17268
|
this.popupObj.element.appendChild(this.spinnerTemplateElement);
|
|
@@ -17166,7 +17357,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
17166
17357
|
this.setHover(currentLi);
|
|
17167
17358
|
};
|
|
17168
17359
|
Mention.prototype.setHover = function (li) {
|
|
17169
|
-
if (this.
|
|
17360
|
+
if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
|
|
17170
17361
|
this.removeHover();
|
|
17171
17362
|
addClass([li], dropDownBaseClasses.hover);
|
|
17172
17363
|
}
|
|
@@ -17191,8 +17382,13 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
17191
17382
|
* @returns {void}
|
|
17192
17383
|
*/
|
|
17193
17384
|
Mention.prototype.search = function (text, positionX, positionY) {
|
|
17194
|
-
if (
|
|
17195
|
-
|
|
17385
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
17386
|
+
this.range = this.getCurrentRange();
|
|
17387
|
+
}
|
|
17388
|
+
var currentRange = this.getTextRange();
|
|
17389
|
+
var lastWordRange = this.getLastLetter(currentRange);
|
|
17390
|
+
if ((this.ignoreCase && (text === lastWordRange || text === lastWordRange.toLowerCase()))
|
|
17391
|
+
|| !this.ignoreCase && text === lastWordRange) {
|
|
17196
17392
|
this.resetList(this.dataSource, this.fields);
|
|
17197
17393
|
}
|
|
17198
17394
|
else {
|