@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
|
let queryString = '';
|
|
13
10
|
let prevString = '';
|
|
14
11
|
let 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
|
const listItems = items;
|
|
86
83
|
ignoreCase = ignoreCase !== undefined && ignoreCase !== null ? ignoreCase : true;
|
|
87
84
|
const itemData = { item: null, index: null };
|
|
@@ -91,7 +88,20 @@ function Search(inputVal, items, searchType, ignoreCase) {
|
|
|
91
88
|
queryStr = escapeCharRegExp(queryStr);
|
|
92
89
|
for (let i = 0, itemsData = listItems; i < itemsData.length; i++) {
|
|
93
90
|
const item = itemsData[i];
|
|
94
|
-
|
|
91
|
+
let text;
|
|
92
|
+
let filterValue;
|
|
93
|
+
if (items && dataSource) {
|
|
94
|
+
let checkField = item;
|
|
95
|
+
let fieldValue = fields.text.split('.');
|
|
96
|
+
dataSource.filter(function (data) {
|
|
97
|
+
Array.prototype.slice.call(fieldValue).forEach(function (value) {
|
|
98
|
+
if (type === 'object' && checkField.textContent.toString().indexOf(data[value]) !== -1 && checkField.getAttribute('data-value') === data[fields.value] || type === 'string' && checkField.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;
|
|
@@ -422,7 +432,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
422
432
|
liElem.setAttribute('role', 'option');
|
|
423
433
|
}
|
|
424
434
|
else {
|
|
425
|
-
ele
|
|
435
|
+
if (!isNullOrUndefined(ele)) {
|
|
436
|
+
ele.innerHTML = content;
|
|
437
|
+
}
|
|
426
438
|
}
|
|
427
439
|
}
|
|
428
440
|
}
|
|
@@ -453,14 +465,16 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
453
465
|
* @returns {void}
|
|
454
466
|
*/
|
|
455
467
|
setEnableRtl() {
|
|
456
|
-
if (this.
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
468
|
+
if (!isNullOrUndefined(this.enableRtlElements)) {
|
|
469
|
+
if (this.list) {
|
|
470
|
+
this.enableRtlElements.push(this.list);
|
|
471
|
+
}
|
|
472
|
+
if (this.enableRtl) {
|
|
473
|
+
addClass(this.enableRtlElements, dropDownBaseClasses.rtl);
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);
|
|
477
|
+
}
|
|
464
478
|
}
|
|
465
479
|
}
|
|
466
480
|
/**
|
|
@@ -498,14 +512,6 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
498
512
|
getPersistData() {
|
|
499
513
|
return this.addOnPersist([]);
|
|
500
514
|
}
|
|
501
|
-
/**
|
|
502
|
-
* Sets the enabled state to DropDownBase.
|
|
503
|
-
*
|
|
504
|
-
* @returns {void}
|
|
505
|
-
*/
|
|
506
|
-
setEnabled() {
|
|
507
|
-
this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
|
|
508
|
-
}
|
|
509
515
|
/**
|
|
510
516
|
* Sets the enabled state to DropDownBase.
|
|
511
517
|
*
|
|
@@ -724,7 +730,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
724
730
|
this.liCollections = [];
|
|
725
731
|
this.trigger('actionFailure', e);
|
|
726
732
|
this.l10nUpdate(true);
|
|
727
|
-
|
|
733
|
+
if (!isNullOrUndefined(this.list)) {
|
|
734
|
+
addClass([this.list], dropDownBaseClasses.noData);
|
|
735
|
+
}
|
|
728
736
|
}
|
|
729
737
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
730
738
|
onActionComplete(ulElement, list, e) {
|
|
@@ -854,10 +862,12 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
854
862
|
if (!isNullOrUndefined(this.list) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
855
863
|
if (isNullOrUndefined(this.fixedHeaderElement)) {
|
|
856
864
|
this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
|
|
857
|
-
if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
|
|
865
|
+
if (!isNullOrUndefined(this.list) && !this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
|
|
858
866
|
this.fixedHeaderElement.style.display = 'none';
|
|
859
867
|
}
|
|
860
|
-
|
|
868
|
+
if (!isNullOrUndefined(this.fixedHeaderElement) && !isNullOrUndefined(this.list)) {
|
|
869
|
+
prepend([this.fixedHeaderElement], this.list);
|
|
870
|
+
}
|
|
861
871
|
this.setFixedHeader();
|
|
862
872
|
}
|
|
863
873
|
if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
|
|
@@ -948,7 +958,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
948
958
|
return item;
|
|
949
959
|
}
|
|
950
960
|
setFixedHeader() {
|
|
951
|
-
this.list
|
|
961
|
+
if (!isNullOrUndefined(this.list)) {
|
|
962
|
+
this.list.parentElement.style.display = 'block';
|
|
963
|
+
}
|
|
952
964
|
let borderWidth = 0;
|
|
953
965
|
if (this.list && this.list.parentElement) {
|
|
954
966
|
borderWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-width'), 10);
|
|
@@ -963,8 +975,10 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
963
975
|
borderWidth = (borderTopWidth + borderBottomWidth + borderLeftWidth + borderRightWidth);
|
|
964
976
|
}
|
|
965
977
|
}
|
|
966
|
-
|
|
967
|
-
|
|
978
|
+
if (!isNullOrUndefined(this.liCollections)) {
|
|
979
|
+
const liWidth = this.getValidLi().offsetWidth - borderWidth;
|
|
980
|
+
this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
|
|
981
|
+
}
|
|
968
982
|
setStyleAttribute(this.fixedHeaderElement, { zIndex: 10 });
|
|
969
983
|
const firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group + ':not(.e-hide-listitem)');
|
|
970
984
|
this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
|
|
@@ -1107,9 +1121,6 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1107
1121
|
case 'enableRtl':
|
|
1108
1122
|
this.setEnableRtl();
|
|
1109
1123
|
break;
|
|
1110
|
-
case 'enabled':
|
|
1111
|
-
this.setEnabled();
|
|
1112
|
-
break;
|
|
1113
1124
|
case 'groupTemplate':
|
|
1114
1125
|
this.renderGroupTemplate(this.list);
|
|
1115
1126
|
if (this.ulElement && this.fixedHeaderElement) {
|
|
@@ -1158,7 +1169,6 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1158
1169
|
wrapperElement.appendChild(this.list);
|
|
1159
1170
|
}
|
|
1160
1171
|
this.setEnableRtl();
|
|
1161
|
-
this.setEnabled();
|
|
1162
1172
|
if (!isEmptyData) {
|
|
1163
1173
|
this.initialize(e);
|
|
1164
1174
|
}
|
|
@@ -1186,7 +1196,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1186
1196
|
* Adds a new item to the popup list. By default, new item appends to the list as the last item,
|
|
1187
1197
|
* but you can insert based on the index parameter.
|
|
1188
1198
|
*
|
|
1189
|
-
* @param
|
|
1199
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
1190
1200
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
1191
1201
|
* @returns {void}
|
|
1192
1202
|
* @deprecated
|
|
@@ -1250,11 +1260,17 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1250
1260
|
this.trigger('beforeItemRender', { element: li, item: item });
|
|
1251
1261
|
}
|
|
1252
1262
|
if (itemsCount === 0 && isNullOrUndefined(this.list.querySelector('ul'))) {
|
|
1253
|
-
this.list
|
|
1254
|
-
|
|
1255
|
-
|
|
1263
|
+
if (!isNullOrUndefined(this.list)) {
|
|
1264
|
+
this.list.innerHTML = '';
|
|
1265
|
+
this.list.classList.remove(dropDownBaseClasses.noData);
|
|
1266
|
+
if (!isNullOrUndefined(this.ulElement)) {
|
|
1267
|
+
this.list.appendChild(this.ulElement);
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1256
1270
|
this.liCollections = liCollections;
|
|
1257
|
-
|
|
1271
|
+
if (!isNullOrUndefined(liCollections) && !isNullOrUndefined(this.ulElement)) {
|
|
1272
|
+
append(liCollections, this.ulElement);
|
|
1273
|
+
}
|
|
1258
1274
|
this.updateAddItemList(this.list, itemsCount);
|
|
1259
1275
|
}
|
|
1260
1276
|
else {
|
|
@@ -1373,15 +1389,17 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1373
1389
|
}
|
|
1374
1390
|
detach(this.list);
|
|
1375
1391
|
}
|
|
1392
|
+
this.liCollections = null;
|
|
1393
|
+
this.ulElement = null;
|
|
1394
|
+
this.list = null;
|
|
1395
|
+
this.enableRtlElements = null;
|
|
1396
|
+
this.rippleFun = null;
|
|
1376
1397
|
super.destroy();
|
|
1377
1398
|
}
|
|
1378
1399
|
};
|
|
1379
1400
|
__decorate([
|
|
1380
1401
|
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
1381
1402
|
], DropDownBase.prototype, "fields", void 0);
|
|
1382
|
-
__decorate([
|
|
1383
|
-
Property(false)
|
|
1384
|
-
], DropDownBase.prototype, "enablePersistence", void 0);
|
|
1385
1403
|
__decorate([
|
|
1386
1404
|
Property(null)
|
|
1387
1405
|
], DropDownBase.prototype, "itemTemplate", void 0);
|
|
@@ -1397,9 +1415,6 @@ __decorate([
|
|
|
1397
1415
|
__decorate([
|
|
1398
1416
|
Property('None')
|
|
1399
1417
|
], DropDownBase.prototype, "sortOrder", void 0);
|
|
1400
|
-
__decorate([
|
|
1401
|
-
Property(true)
|
|
1402
|
-
], DropDownBase.prototype, "enabled", void 0);
|
|
1403
1418
|
__decorate([
|
|
1404
1419
|
Property([])
|
|
1405
1420
|
], DropDownBase.prototype, "dataSource", void 0);
|
|
@@ -1643,8 +1658,12 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1643
1658
|
this.resetFocusElement();
|
|
1644
1659
|
}
|
|
1645
1660
|
}
|
|
1646
|
-
this.hiddenElement
|
|
1647
|
-
|
|
1661
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
1662
|
+
this.hiddenElement.innerHTML = '';
|
|
1663
|
+
}
|
|
1664
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
1665
|
+
this.inputElement.value = '';
|
|
1666
|
+
}
|
|
1648
1667
|
this.value = null;
|
|
1649
1668
|
this.itemData = null;
|
|
1650
1669
|
this.text = null;
|
|
@@ -1666,21 +1685,21 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1666
1685
|
if (Object.keys(this.htmlAttributes).length) {
|
|
1667
1686
|
for (const htmlAttr of Object.keys(this.htmlAttributes)) {
|
|
1668
1687
|
if (htmlAttr === 'class') {
|
|
1669
|
-
const updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
|
|
1688
|
+
const updatedClassValue = (this.htmlAttributes[`${htmlAttr}`].replace(/\s+/g, ' ')).trim();
|
|
1670
1689
|
if (updatedClassValue !== '') {
|
|
1671
1690
|
addClass([this.inputWrapper.container], updatedClassValue.split(' '));
|
|
1672
1691
|
}
|
|
1673
1692
|
}
|
|
1674
|
-
else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {
|
|
1693
|
+
else if (htmlAttr === 'disabled' && this.htmlAttributes[`${htmlAttr}`] === 'disabled') {
|
|
1675
1694
|
this.enabled = false;
|
|
1676
1695
|
this.setEnable();
|
|
1677
1696
|
}
|
|
1678
|
-
else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[htmlAttr])) {
|
|
1697
|
+
else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[`${htmlAttr}`])) {
|
|
1679
1698
|
this.readonly = true;
|
|
1680
1699
|
this.dataBind();
|
|
1681
1700
|
}
|
|
1682
1701
|
else if (htmlAttr === 'style') {
|
|
1683
|
-
this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);
|
|
1702
|
+
this.inputWrapper.container.setAttribute('style', this.htmlAttributes[`${htmlAttr}`]);
|
|
1684
1703
|
}
|
|
1685
1704
|
else {
|
|
1686
1705
|
const defaultAttr = ['title', 'id', 'placeholder',
|
|
@@ -1690,18 +1709,18 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1690
1709
|
defaultAttr.push('tabindex');
|
|
1691
1710
|
}
|
|
1692
1711
|
if (validateAttr.indexOf(htmlAttr) > -1 || htmlAttr.indexOf('data') === 0) {
|
|
1693
|
-
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
1712
|
+
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
1694
1713
|
}
|
|
1695
1714
|
else if (defaultAttr.indexOf(htmlAttr) > -1) {
|
|
1696
1715
|
if (htmlAttr === 'placeholder') {
|
|
1697
|
-
Input.setPlaceholder(this.htmlAttributes[htmlAttr], this.inputElement);
|
|
1716
|
+
Input.setPlaceholder(this.htmlAttributes[`${htmlAttr}`], this.inputElement);
|
|
1698
1717
|
}
|
|
1699
1718
|
else {
|
|
1700
|
-
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
1719
|
+
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
1701
1720
|
}
|
|
1702
1721
|
}
|
|
1703
1722
|
else {
|
|
1704
|
-
this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
1723
|
+
this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
1705
1724
|
}
|
|
1706
1725
|
}
|
|
1707
1726
|
}
|
|
@@ -1757,7 +1776,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1757
1776
|
}
|
|
1758
1777
|
}
|
|
1759
1778
|
targetElement() {
|
|
1760
|
-
return this.inputWrapper.container;
|
|
1779
|
+
return !isNullOrUndefined(this.inputWrapper) ? this.inputWrapper.container : null;
|
|
1761
1780
|
}
|
|
1762
1781
|
getNgDirective() {
|
|
1763
1782
|
return 'EJS-DROPDOWNLIST';
|
|
@@ -1915,7 +1934,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1915
1934
|
}
|
|
1916
1935
|
}
|
|
1917
1936
|
unBindCommonEvent() {
|
|
1918
|
-
if (this.targetElement()) {
|
|
1937
|
+
if (!isNullOrUndefined(this.inputWrapper) && this.targetElement()) {
|
|
1919
1938
|
EventHandler.remove(this.targetElement(), 'blur', this.onBlurHandler);
|
|
1920
1939
|
}
|
|
1921
1940
|
const formElement = this.inputElement && closest(this.inputElement, 'form');
|
|
@@ -1945,9 +1964,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1945
1964
|
* @returns {void}
|
|
1946
1965
|
*/
|
|
1947
1966
|
wireListEvents() {
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1967
|
+
if (!isNullOrUndefined(this.list)) {
|
|
1968
|
+
EventHandler.add(this.list, 'click', this.onMouseClick, this);
|
|
1969
|
+
EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
|
|
1970
|
+
EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
|
|
1971
|
+
}
|
|
1951
1972
|
}
|
|
1952
1973
|
onSearch(e) {
|
|
1953
1974
|
if (e.charCode !== 32 && e.charCode !== 13) {
|
|
@@ -2225,9 +2246,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2225
2246
|
this.setSelection(previousItem, event);
|
|
2226
2247
|
}
|
|
2227
2248
|
unWireEvent() {
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2249
|
+
if (!isNullOrUndefined(this.inputWrapper)) {
|
|
2250
|
+
EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
|
|
2251
|
+
EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
|
|
2252
|
+
EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
|
|
2253
|
+
}
|
|
2231
2254
|
this.unBindCommonEvent();
|
|
2232
2255
|
}
|
|
2233
2256
|
/**
|
|
@@ -2236,9 +2259,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2236
2259
|
* @returns {void}
|
|
2237
2260
|
*/
|
|
2238
2261
|
unWireListEvents() {
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2262
|
+
if (this.list) {
|
|
2263
|
+
EventHandler.remove(this.list, 'click', this.onMouseClick);
|
|
2264
|
+
EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
|
|
2265
|
+
EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
|
|
2266
|
+
}
|
|
2242
2267
|
}
|
|
2243
2268
|
checkSelector(id) {
|
|
2244
2269
|
return '[id="' + id.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g, '\\$1') + '"]';
|
|
@@ -2246,7 +2271,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2246
2271
|
onDocumentClick(e) {
|
|
2247
2272
|
const target = e.target;
|
|
2248
2273
|
if (!(!isNullOrUndefined(this.popupObj) && closest(target, this.checkSelector(this.popupObj.element.id))) &&
|
|
2249
|
-
!this.inputWrapper.container.contains(e.target)) {
|
|
2274
|
+
!isNullOrUndefined(this.inputWrapper) && !this.inputWrapper.container.contains(e.target)) {
|
|
2250
2275
|
if (this.inputWrapper.container.classList.contains(dropDownListClasses.inputFocus) || this.isPopupOpen) {
|
|
2251
2276
|
this.isDocumentClick = true;
|
|
2252
2277
|
const isActive = this.isRequested;
|
|
@@ -2443,14 +2468,16 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2443
2468
|
this.setScrollPosition(e);
|
|
2444
2469
|
}
|
|
2445
2470
|
if (Browser.info.name !== 'mozilla') {
|
|
2446
|
-
attributes(this.
|
|
2447
|
-
|
|
2448
|
-
|
|
2471
|
+
attributes(this.inputElement, { 'aria-label': this.inputElement.value });
|
|
2472
|
+
if (this.targetElement()) {
|
|
2473
|
+
attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
|
|
2474
|
+
this.targetElement().removeAttribute('aria-live');
|
|
2475
|
+
}
|
|
2449
2476
|
}
|
|
2450
|
-
if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
2477
|
+
if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
2451
2478
|
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
|
|
2452
2479
|
}
|
|
2453
|
-
else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
|
|
2480
|
+
else if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
|
|
2454
2481
|
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
|
|
2455
2482
|
}
|
|
2456
2483
|
}
|
|
@@ -2616,9 +2643,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2616
2643
|
selectedElement.setAttribute('value', this.value.toString());
|
|
2617
2644
|
}
|
|
2618
2645
|
else {
|
|
2619
|
-
this.hiddenElement
|
|
2620
|
-
|
|
2621
|
-
|
|
2646
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
2647
|
+
this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
|
|
2648
|
+
const selectedElement = this.hiddenElement.querySelector('option');
|
|
2649
|
+
selectedElement.setAttribute('value', this.value.toString());
|
|
2650
|
+
}
|
|
2622
2651
|
}
|
|
2623
2652
|
}
|
|
2624
2653
|
else {
|
|
@@ -2769,9 +2798,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2769
2798
|
/**
|
|
2770
2799
|
* To filter the data from given data source by using query
|
|
2771
2800
|
*
|
|
2772
|
-
* @param
|
|
2773
|
-
* @param
|
|
2774
|
-
* @param
|
|
2801
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
2802
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
2803
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
2775
2804
|
* @returns {void}
|
|
2776
2805
|
* @deprecated
|
|
2777
2806
|
*/
|
|
@@ -2954,7 +2983,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2954
2983
|
&& ((this.dataSource instanceof DataManager)
|
|
2955
2984
|
|| (!isNullOrUndefined(this.dataSource) && !isNullOrUndefined(this.dataSource.length) &&
|
|
2956
2985
|
this.dataSource.length !== 0)))) {
|
|
2957
|
-
if (this.itemTemplate &&
|
|
2986
|
+
if (this.itemTemplate && this.element.tagName === 'EJS-COMBOBOX' && this.allowFiltering) {
|
|
2958
2987
|
setTimeout(() => {
|
|
2959
2988
|
this.updateActionCompleteDataValues(ulElement, list);
|
|
2960
2989
|
}, 0);
|
|
@@ -3102,9 +3131,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3102
3131
|
(this.isDropDownClick && this.getModuleName() === 'combobox')))) {
|
|
3103
3132
|
offsetValue = this.getOffsetValue(popupEle);
|
|
3104
3133
|
const firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
|
|
3105
|
-
|
|
3106
|
-
parseInt(getComputedStyle(
|
|
3107
|
-
|
|
3134
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
3135
|
+
left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
|
|
3136
|
+
parseInt(getComputedStyle(this.inputElement).paddingLeft, 10) +
|
|
3137
|
+
parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10));
|
|
3138
|
+
}
|
|
3108
3139
|
}
|
|
3109
3140
|
this.getFocusElement();
|
|
3110
3141
|
this.createPopup(popupEle, offsetValue, left);
|
|
@@ -3149,9 +3180,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3149
3180
|
const eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
|
|
3150
3181
|
this.trigger('open', eventArgs, (eventArgs) => {
|
|
3151
3182
|
if (!eventArgs.cancel) {
|
|
3152
|
-
|
|
3183
|
+
if (!isNullOrUndefined(this.inputWrapper)) {
|
|
3184
|
+
addClass([this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
|
|
3185
|
+
}
|
|
3153
3186
|
this.renderReactTemplates();
|
|
3154
|
-
|
|
3187
|
+
if (!isNullOrUndefined(this.popupObj)) {
|
|
3188
|
+
this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.element : null);
|
|
3189
|
+
}
|
|
3155
3190
|
}
|
|
3156
3191
|
else {
|
|
3157
3192
|
this.beforePopupOpen = false;
|
|
@@ -3407,11 +3442,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3407
3442
|
EventHandler.remove(this.backIconElement, 'click', this.clickOnBackIcon);
|
|
3408
3443
|
EventHandler.remove(this.clearIconElement, 'click', this.clearText);
|
|
3409
3444
|
}
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3445
|
+
if (!isNullOrUndefined(this.filterInput)) {
|
|
3446
|
+
EventHandler.remove(this.filterInput, 'input', this.onInput);
|
|
3447
|
+
EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);
|
|
3448
|
+
EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);
|
|
3449
|
+
EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
|
|
3450
|
+
EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
|
|
3451
|
+
}
|
|
3415
3452
|
this.filterInput = null;
|
|
3416
3453
|
}
|
|
3417
3454
|
attributes(this.targetElement(), { 'aria-expanded': 'false' });
|
|
@@ -3546,6 +3583,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3546
3583
|
this.text = isNullOrUndefined(this.value) ? null : selectElement.options[selectElement.selectedIndex].textContent;
|
|
3547
3584
|
this.initValue();
|
|
3548
3585
|
}
|
|
3586
|
+
this.setEnabled();
|
|
3549
3587
|
this.preventTabIndex(this.element);
|
|
3550
3588
|
if (!this.enabled) {
|
|
3551
3589
|
this.targetElement().tabIndex = -1;
|
|
@@ -3630,6 +3668,14 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3630
3668
|
const contentEle = popupEle.querySelector('div.e-content');
|
|
3631
3669
|
popupEle.insertBefore(this.header, contentEle);
|
|
3632
3670
|
}
|
|
3671
|
+
/**
|
|
3672
|
+
* Sets the enabled state to DropDownBase.
|
|
3673
|
+
*
|
|
3674
|
+
* @returns {void}
|
|
3675
|
+
*/
|
|
3676
|
+
setEnabled() {
|
|
3677
|
+
this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
|
|
3678
|
+
}
|
|
3633
3679
|
setOldText(text) {
|
|
3634
3680
|
this.text = text;
|
|
3635
3681
|
}
|
|
@@ -3998,7 +4044,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3998
4044
|
};
|
|
3999
4045
|
history.pushState({}, '');
|
|
4000
4046
|
}
|
|
4001
|
-
if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
4047
|
+
if (!isNullOrUndefined(this.list) && (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData))) {
|
|
4002
4048
|
this.renderPopup(e);
|
|
4003
4049
|
}
|
|
4004
4050
|
}
|
|
@@ -4014,7 +4060,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4014
4060
|
hidePopup(e) {
|
|
4015
4061
|
/* eslint-enable valid-jsdoc, jsdoc/require-param */
|
|
4016
4062
|
if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
|
|
4017
|
-
|
|
4063
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
4064
|
+
Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
4065
|
+
}
|
|
4018
4066
|
this.isEscapeKey = false;
|
|
4019
4067
|
if (!isNullOrUndefined(this.index)) {
|
|
4020
4068
|
const element = this.findListElement(this.ulElement, 'li', 'data-value', this.value);
|
|
@@ -4124,6 +4172,21 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4124
4172
|
this.inputWrapper.container.parentElement.insertBefore(this.element, this.inputWrapper.container);
|
|
4125
4173
|
detach(this.inputWrapper.container);
|
|
4126
4174
|
}
|
|
4175
|
+
this.hiddenElement = null;
|
|
4176
|
+
this.inputWrapper = null;
|
|
4177
|
+
this.keyboardModule = null;
|
|
4178
|
+
this.ulElement = null;
|
|
4179
|
+
this.list = null;
|
|
4180
|
+
this.popupObj = null;
|
|
4181
|
+
this.rippleFun = null;
|
|
4182
|
+
this.selectedLI = null;
|
|
4183
|
+
this.liCollections = null;
|
|
4184
|
+
this.item = null;
|
|
4185
|
+
this.inputWrapper = null;
|
|
4186
|
+
this.footer = null;
|
|
4187
|
+
this.header = null;
|
|
4188
|
+
this.previousSelectedLI = null;
|
|
4189
|
+
this.valueTempElement = null;
|
|
4127
4190
|
super.destroy();
|
|
4128
4191
|
}
|
|
4129
4192
|
/* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
|
|
@@ -4166,6 +4229,12 @@ __decorate$1([
|
|
|
4166
4229
|
__decorate$1([
|
|
4167
4230
|
Property('100%')
|
|
4168
4231
|
], DropDownList.prototype, "width", void 0);
|
|
4232
|
+
__decorate$1([
|
|
4233
|
+
Property(true)
|
|
4234
|
+
], DropDownList.prototype, "enabled", void 0);
|
|
4235
|
+
__decorate$1([
|
|
4236
|
+
Property(false)
|
|
4237
|
+
], DropDownList.prototype, "enablePersistence", void 0);
|
|
4169
4238
|
__decorate$1([
|
|
4170
4239
|
Property('300px')
|
|
4171
4240
|
], DropDownList.prototype, "popupHeight", void 0);
|
|
@@ -4327,6 +4396,9 @@ __decorate$2([
|
|
|
4327
4396
|
__decorate$2([
|
|
4328
4397
|
Property(null)
|
|
4329
4398
|
], Fields.prototype, "query", void 0);
|
|
4399
|
+
__decorate$2([
|
|
4400
|
+
Property('selectable')
|
|
4401
|
+
], Fields.prototype, "selectable", void 0);
|
|
4330
4402
|
__decorate$2([
|
|
4331
4403
|
Property('selected')
|
|
4332
4404
|
], Fields.prototype, "selected", void 0);
|
|
@@ -5122,7 +5194,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5122
5194
|
temp = this.getOverflowVal(index);
|
|
5123
5195
|
data += temp;
|
|
5124
5196
|
temp = this.overFlowWrapper.innerHTML;
|
|
5125
|
-
this.
|
|
5197
|
+
if (this.enableHtmlSanitizer) {
|
|
5198
|
+
this.overFlowWrapper.innerText = data;
|
|
5199
|
+
}
|
|
5200
|
+
else {
|
|
5201
|
+
this.overFlowWrapper.innerHTML = data;
|
|
5202
|
+
}
|
|
5126
5203
|
wrapperleng = this.overFlowWrapper.offsetWidth;
|
|
5127
5204
|
overAllContainer = this.inputWrapper.offsetWidth;
|
|
5128
5205
|
if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
|
|
@@ -5651,6 +5728,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5651
5728
|
nodeClicked: this.onNodeClicked.bind(this),
|
|
5652
5729
|
dataBound: this.OnDataBound.bind(this),
|
|
5653
5730
|
allowMultiSelection: this.allowMultiSelection,
|
|
5731
|
+
enableHtmlSanitizer: this.enableHtmlSanitizer,
|
|
5654
5732
|
showCheckBox: this.showCheckBox,
|
|
5655
5733
|
autoCheck: this.treeSettings.autoCheck,
|
|
5656
5734
|
sortOrder: this.sortOrder,
|
|
@@ -5941,7 +6019,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5941
6019
|
dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
|
|
5942
6020
|
child: this.cloneChildField(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
|
|
5943
6021
|
iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes, query: fields.query,
|
|
5944
|
-
selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
|
|
6022
|
+
selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
|
|
5945
6023
|
};
|
|
5946
6024
|
return clonedField;
|
|
5947
6025
|
}
|
|
@@ -5954,7 +6032,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5954
6032
|
dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
|
|
5955
6033
|
child: (fields.child ? this.cloneChildField(fields.child) : null), hasChildren: fields.hasChildren,
|
|
5956
6034
|
expanded: fields.expanded, iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes,
|
|
5957
|
-
query: fields.query, selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
|
|
6035
|
+
query: fields.query, selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
|
|
5958
6036
|
};
|
|
5959
6037
|
return clonedField;
|
|
5960
6038
|
}
|
|
@@ -5964,7 +6042,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5964
6042
|
dataSource: fields.dataSource, id: fields.value, text: fields.text, parentID: fields.parentValue,
|
|
5965
6043
|
child: this.getTreeChildren(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
|
|
5966
6044
|
iconCss: fields.iconCss, imageUrl: fields.imageUrl, isChecked: fields.selected,
|
|
5967
|
-
htmlAttributes: fields.htmlAttributes, query: fields.query, selected: fields.selected,
|
|
6045
|
+
htmlAttributes: fields.htmlAttributes, query: fields.query, selectable: fields.selectable, selected: fields.selected,
|
|
5968
6046
|
tableName: fields.tableName, tooltip: fields.tooltip
|
|
5969
6047
|
};
|
|
5970
6048
|
return treeFields;
|
|
@@ -6459,7 +6537,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6459
6537
|
});
|
|
6460
6538
|
const chipContent = this.createElement('span', { className: CHIP_CONTENT });
|
|
6461
6539
|
const chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
|
|
6462
|
-
|
|
6540
|
+
if (this.enableHtmlSanitizer) {
|
|
6541
|
+
chipContent.innerText = text;
|
|
6542
|
+
}
|
|
6543
|
+
else {
|
|
6544
|
+
chipContent.innerHTML = text;
|
|
6545
|
+
}
|
|
6463
6546
|
chip.appendChild(chipContent);
|
|
6464
6547
|
this.chipCollection.appendChild(chip);
|
|
6465
6548
|
if (this.showClearButton) {
|
|
@@ -7281,6 +7364,9 @@ __decorate$2([
|
|
|
7281
7364
|
__decorate$2([
|
|
7282
7365
|
Property(false)
|
|
7283
7366
|
], DropDownTree.prototype, "showCheckBox", void 0);
|
|
7367
|
+
__decorate$2([
|
|
7368
|
+
Property(false)
|
|
7369
|
+
], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
|
|
7284
7370
|
__decorate$2([
|
|
7285
7371
|
Property(true)
|
|
7286
7372
|
], DropDownTree.prototype, "showClearButton", void 0);
|
|
@@ -7565,7 +7651,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7565
7651
|
}
|
|
7566
7652
|
getFocusElement() {
|
|
7567
7653
|
const dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
|
|
7568
|
-
const selected = this.list.querySelector('.' + dropDownListClasses.selected);
|
|
7654
|
+
const selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
|
|
7569
7655
|
const isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
|
|
7570
7656
|
if (isSelected) {
|
|
7571
7657
|
return selected;
|
|
@@ -7573,8 +7659,10 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7573
7659
|
if ((Browser.isDevice && !this.isDropDownClick || !Browser.isDevice) &&
|
|
7574
7660
|
!isNullOrUndefined(this.liCollections) && this.liCollections.length > 0) {
|
|
7575
7661
|
const inputValue = this.inputElement.value;
|
|
7576
|
-
const
|
|
7577
|
-
const
|
|
7662
|
+
const dataSource = this.sortedData;
|
|
7663
|
+
const type = this.typeOfData(dataSource).typeof;
|
|
7664
|
+
const activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
|
|
7665
|
+
var activeElement = activeItem.item;
|
|
7578
7666
|
if (!isNullOrUndefined(activeElement)) {
|
|
7579
7667
|
const count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
|
|
7580
7668
|
const height = parseInt(getComputedStyle(this.liCollections[0], null).getPropertyValue('height'), 10);
|
|
@@ -7723,9 +7811,11 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7723
7811
|
}
|
|
7724
7812
|
else if (this.inputElement.value === '') {
|
|
7725
7813
|
this.activeIndex = null;
|
|
7726
|
-
this.list
|
|
7727
|
-
|
|
7728
|
-
|
|
7814
|
+
if (!isNullOrUndefined(this.list)) {
|
|
7815
|
+
this.list.scrollTop = 0;
|
|
7816
|
+
const focusItem = this.list.querySelector('.' + dropDownListClasses.li);
|
|
7817
|
+
this.setHoverList(focusItem);
|
|
7818
|
+
}
|
|
7729
7819
|
}
|
|
7730
7820
|
else {
|
|
7731
7821
|
this.activeIndex = null;
|
|
@@ -7971,7 +8061,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7971
8061
|
* Adds a new item to the combobox popup list. By default, new item appends to the list as the last item,
|
|
7972
8062
|
* but you can insert based on the index parameter.
|
|
7973
8063
|
*
|
|
7974
|
-
* @param
|
|
8064
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
7975
8065
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
7976
8066
|
* @returns {void}
|
|
7977
8067
|
* @deprecated
|
|
@@ -7982,9 +8072,9 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7982
8072
|
/**
|
|
7983
8073
|
* To filter the data from given data source by using query
|
|
7984
8074
|
*
|
|
7985
|
-
* @param
|
|
7986
|
-
* @param
|
|
7987
|
-
* @param
|
|
8075
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
8076
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
8077
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
7988
8078
|
* @returns {void}
|
|
7989
8079
|
* @deprecated
|
|
7990
8080
|
*/
|
|
@@ -8021,7 +8111,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
8021
8111
|
this.removeFillSelection();
|
|
8022
8112
|
}
|
|
8023
8113
|
const dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
|
|
8024
|
-
const selected = this.list.querySelector('.' + dropDownListClasses.selected);
|
|
8114
|
+
const selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : null;
|
|
8025
8115
|
if (this.inputElement && dataItem.text === this.inputElement.value && !isNullOrUndefined(selected)) {
|
|
8026
8116
|
if (this.isSelected) {
|
|
8027
8117
|
this.onChangeEvent(e);
|
|
@@ -8031,10 +8121,12 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
8031
8121
|
return;
|
|
8032
8122
|
}
|
|
8033
8123
|
if (this.getModuleName() === 'combobox' && this.inputElement.value.trim() !== '') {
|
|
8034
|
-
const
|
|
8124
|
+
const dataSource = this.sortedData;
|
|
8125
|
+
const type = this.typeOfData(dataSource).typeof;
|
|
8126
|
+
const searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true, dataSource, this.fields, type);
|
|
8035
8127
|
this.selectedLI = searchItem.item;
|
|
8036
8128
|
if (isNullOrUndefined(searchItem.index)) {
|
|
8037
|
-
searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true).index;
|
|
8129
|
+
searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true, dataSource, this.fields, type).index;
|
|
8038
8130
|
}
|
|
8039
8131
|
this.activeIndex = searchItem.index;
|
|
8040
8132
|
if (!isNullOrUndefined(this.selectedLI)) {
|
|
@@ -8306,9 +8398,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8306
8398
|
/**
|
|
8307
8399
|
* To filter the data from given data source by using query
|
|
8308
8400
|
*
|
|
8309
|
-
* @param
|
|
8310
|
-
* @param
|
|
8311
|
-
* @param
|
|
8401
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
8402
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
8403
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
8312
8404
|
* @returns {void}
|
|
8313
8405
|
* @deprecated
|
|
8314
8406
|
*/
|
|
@@ -8348,7 +8440,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8348
8440
|
postBackAction() {
|
|
8349
8441
|
if (this.autofill && !isNullOrUndefined(this.liCollections[0]) && this.searchList) {
|
|
8350
8442
|
const items = [this.liCollections[0]];
|
|
8351
|
-
const
|
|
8443
|
+
const dataSource = this.listData;
|
|
8444
|
+
const type = this.typeOfData(dataSource).typeof;
|
|
8445
|
+
const searchItem = Search(this.inputElement.value, items, 'StartsWith', this.ignoreCase, dataSource, this.fields, type);
|
|
8352
8446
|
this.searchList = false;
|
|
8353
8447
|
if (!isNullOrUndefined(searchItem.item)) {
|
|
8354
8448
|
super.setAutoFill(this.liCollections[0], true);
|
|
@@ -8875,7 +8969,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8875
8969
|
for (const htmlAttr of Object.keys(this.htmlAttributes)) {
|
|
8876
8970
|
switch (htmlAttr) {
|
|
8877
8971
|
case 'class': {
|
|
8878
|
-
const updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
|
|
8972
|
+
const updatedClassValue = (this.htmlAttributes[`${htmlAttr}`].replace(/\s+/g, ' ')).trim();
|
|
8879
8973
|
if (updatedClassValue !== '') {
|
|
8880
8974
|
addClass([this.overAllWrapper], updatedClassValue.split(' '));
|
|
8881
8975
|
addClass([this.popupWrapper], updatedClassValue.split(' '));
|
|
@@ -8887,7 +8981,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8887
8981
|
break;
|
|
8888
8982
|
case 'placeholder':
|
|
8889
8983
|
if (!this.placeholder) {
|
|
8890
|
-
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
8984
|
+
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
8891
8985
|
this.setProperties({ placeholder: this.inputElement.placeholder }, true);
|
|
8892
8986
|
this.refreshPlaceHolder();
|
|
8893
8987
|
}
|
|
@@ -8897,16 +8991,16 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8897
8991
|
const validateAttr = ['name', 'required', 'aria-required', 'form'];
|
|
8898
8992
|
const containerAttr = ['title', 'role', 'style', 'class'];
|
|
8899
8993
|
if (defaultAttr.indexOf(htmlAttr) > -1) {
|
|
8900
|
-
this.element.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
8994
|
+
this.element.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
8901
8995
|
}
|
|
8902
8996
|
else if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
|
|
8903
|
-
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
8997
|
+
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
8904
8998
|
}
|
|
8905
8999
|
else if (containerAttr.indexOf(htmlAttr) > -1) {
|
|
8906
|
-
this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9000
|
+
this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
8907
9001
|
}
|
|
8908
|
-
else if (htmlAttr !== 'size') {
|
|
8909
|
-
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9002
|
+
else if (htmlAttr !== 'size' && !isNullOrUndefined(this.inputElement)) {
|
|
9003
|
+
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
8910
9004
|
}
|
|
8911
9005
|
break;
|
|
8912
9006
|
}
|
|
@@ -8915,11 +9009,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8915
9009
|
}
|
|
8916
9010
|
}
|
|
8917
9011
|
updateReadonly(state) {
|
|
8918
|
-
if (
|
|
8919
|
-
this.
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
9012
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
9013
|
+
if (state || this.mode === 'CheckBox') {
|
|
9014
|
+
this.inputElement.setAttribute('readonly', 'true');
|
|
9015
|
+
}
|
|
9016
|
+
else {
|
|
9017
|
+
this.inputElement.removeAttribute('readonly');
|
|
9018
|
+
}
|
|
8923
9019
|
}
|
|
8924
9020
|
}
|
|
8925
9021
|
updateClearButton(state) {
|
|
@@ -9061,8 +9157,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9061
9157
|
if (!isNullOrUndefined(this.ulElement)) {
|
|
9062
9158
|
attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
9063
9159
|
}
|
|
9064
|
-
const disableStatus = (this.inputElement.disabled) ? true : false;
|
|
9065
|
-
if (!this.isPopupOpen()) {
|
|
9160
|
+
const disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
|
|
9161
|
+
if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
|
|
9066
9162
|
attributes(this.inputElement, this.getAriaAttributes());
|
|
9067
9163
|
}
|
|
9068
9164
|
if (disableStatus) {
|
|
@@ -9172,7 +9268,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9172
9268
|
this.checkForCustomValue(this.tempQuery, this.fields);
|
|
9173
9269
|
return;
|
|
9174
9270
|
}
|
|
9175
|
-
if (this.value && this.value.length && ((this.mode !== 'CheckBox' && this.inputElement.value.trim() !== '') ||
|
|
9271
|
+
if (this.value && this.value.length && ((this.mode !== 'CheckBox' && !isNullOrUndefined(this.inputElement) && this.inputElement.value.trim() !== '') ||
|
|
9176
9272
|
this.mode === 'CheckBox' || ((this.keyCode === 8 || this.keyCode === 46) && this.allowFiltering &&
|
|
9177
9273
|
this.allowCustomValue && this.dataSource instanceof DataManager && this.inputElement.value === ''))) {
|
|
9178
9274
|
this.refreshSelection();
|
|
@@ -9242,8 +9338,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9242
9338
|
}
|
|
9243
9339
|
element.setAttribute('aria-selected', 'true');
|
|
9244
9340
|
if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
|
|
9245
|
-
const ariaValue = element.
|
|
9246
|
-
if (
|
|
9341
|
+
const ariaValue = element.getElementsByClassName('e-check').length;
|
|
9342
|
+
if (ariaValue === 0) {
|
|
9247
9343
|
const args = {
|
|
9248
9344
|
module: 'CheckBoxSelection',
|
|
9249
9345
|
enable: this.mode === 'CheckBox',
|
|
@@ -9367,9 +9463,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9367
9463
|
/**
|
|
9368
9464
|
* To filter the multiselect data from given data source by using query
|
|
9369
9465
|
*
|
|
9370
|
-
* @param
|
|
9371
|
-
* @param
|
|
9372
|
-
* @param
|
|
9466
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
9467
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
9468
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
9373
9469
|
* @returns {void}
|
|
9374
9470
|
*/
|
|
9375
9471
|
filter(dataSource, query, fields) {
|
|
@@ -9636,11 +9732,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9636
9732
|
}
|
|
9637
9733
|
}
|
|
9638
9734
|
refreshInputHight() {
|
|
9639
|
-
if (
|
|
9640
|
-
this.
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9735
|
+
if (!isNullOrUndefined(this.searchWrapper)) {
|
|
9736
|
+
if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {
|
|
9737
|
+
this.searchWrapper.classList.remove(ZERO_SIZE);
|
|
9738
|
+
}
|
|
9739
|
+
else {
|
|
9740
|
+
this.searchWrapper.classList.add(ZERO_SIZE);
|
|
9741
|
+
}
|
|
9644
9742
|
}
|
|
9645
9743
|
}
|
|
9646
9744
|
validateValues(newValue, oldValue) {
|
|
@@ -10440,7 +10538,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10440
10538
|
HIDE_LIST :
|
|
10441
10539
|
dropDownBaseClasses.selected);
|
|
10442
10540
|
if (this.mode === 'CheckBox') {
|
|
10443
|
-
element2.firstElementChild.setAttribute('aria-checked', 'false');
|
|
10444
10541
|
removeClass([element2.firstElementChild.lastElementChild], 'e-check');
|
|
10445
10542
|
}
|
|
10446
10543
|
}
|
|
@@ -10450,7 +10547,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10450
10547
|
HIDE_LIST :
|
|
10451
10548
|
dropDownBaseClasses.selected);
|
|
10452
10549
|
if (this.mode === 'CheckBox') {
|
|
10453
|
-
element2.firstElementChild.setAttribute('aria-checked', 'true');
|
|
10454
10550
|
addClass([element2.firstElementChild.lastElementChild], 'e-check');
|
|
10455
10551
|
}
|
|
10456
10552
|
}
|
|
@@ -10708,109 +10804,111 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10708
10804
|
super.render();
|
|
10709
10805
|
}
|
|
10710
10806
|
if (!this.popupObj) {
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
checkboxFilter.
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
this.
|
|
10721
|
-
|
|
10722
|
-
}
|
|
10723
|
-
append([this.list], this.popupWrapper);
|
|
10724
|
-
if (this.footerTemplate) {
|
|
10725
|
-
this.setFooterTemplate();
|
|
10726
|
-
overAllHeight -= this.footer.offsetHeight;
|
|
10727
|
-
}
|
|
10728
|
-
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
10729
|
-
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10730
|
-
overAllHeight -= this.selectAllHeight;
|
|
10731
|
-
}
|
|
10732
|
-
else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
|
|
10733
|
-
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10734
|
-
overAllHeight = parseInt(this.popupHeight, 10);
|
|
10735
|
-
}
|
|
10736
|
-
else if (this.mode === 'CheckBox' && !this.showSelectAll) {
|
|
10737
|
-
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10738
|
-
overAllHeight = parseInt(this.popupHeight, 10);
|
|
10739
|
-
if (this.headerTemplate && this.header) {
|
|
10807
|
+
if (!isNullOrUndefined(this.popupWrapper)) {
|
|
10808
|
+
document.body.appendChild(this.popupWrapper);
|
|
10809
|
+
const checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
|
|
10810
|
+
if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
|
|
10811
|
+
checkboxFilter.remove();
|
|
10812
|
+
this.filterParent = null;
|
|
10813
|
+
}
|
|
10814
|
+
let overAllHeight = parseInt(this.popupHeight, 10);
|
|
10815
|
+
this.popupWrapper.style.visibility = 'hidden';
|
|
10816
|
+
if (this.headerTemplate) {
|
|
10817
|
+
this.setHeaderTemplate();
|
|
10740
10818
|
overAllHeight -= this.header.offsetHeight;
|
|
10741
10819
|
}
|
|
10742
|
-
|
|
10820
|
+
append([this.list], this.popupWrapper);
|
|
10821
|
+
if (this.footerTemplate) {
|
|
10822
|
+
this.setFooterTemplate();
|
|
10743
10823
|
overAllHeight -= this.footer.offsetHeight;
|
|
10744
10824
|
}
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
if (this.popupHeight !== 'auto') {
|
|
10759
|
-
this.list.style.maxHeight = formatUnit(overAllHeight);
|
|
10760
|
-
this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
|
|
10761
|
-
}
|
|
10762
|
-
else {
|
|
10763
|
-
this.list.style.maxHeight = formatUnit(this.popupHeight);
|
|
10764
|
-
}
|
|
10765
|
-
this.popupObj = new Popup(this.popupWrapper, {
|
|
10766
|
-
width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
|
|
10767
|
-
relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
|
|
10768
|
-
enableRtl: this.enableRtl, zIndex: this.zIndex,
|
|
10769
|
-
close: () => {
|
|
10770
|
-
if (this.popupObj.element.parentElement) {
|
|
10771
|
-
this.popupObj.unwireScrollEvents();
|
|
10772
|
-
// For restrict the page scrolling in safari browser
|
|
10773
|
-
const checkboxFilterInput = this.popupWrapper.querySelector('.' + FILTERINPUT);
|
|
10774
|
-
if (this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
|
|
10775
|
-
checkboxFilterInput.blur();
|
|
10776
|
-
}
|
|
10777
|
-
detach(this.popupObj.element);
|
|
10778
|
-
}
|
|
10779
|
-
},
|
|
10780
|
-
open: () => {
|
|
10781
|
-
this.popupObj.resolveCollision();
|
|
10782
|
-
if (!this.isFirstClick) {
|
|
10783
|
-
const ulElement = this.list.querySelector('ul');
|
|
10784
|
-
if (ulElement) {
|
|
10785
|
-
if (!(this.mode !== 'CheckBox' && (this.allowFiltering || this.allowCustomValue) &&
|
|
10786
|
-
this.targetElement().trim() !== '')) {
|
|
10787
|
-
this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
|
|
10788
|
-
}
|
|
10789
|
-
}
|
|
10790
|
-
this.isFirstClick = true;
|
|
10825
|
+
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
10826
|
+
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10827
|
+
overAllHeight -= this.selectAllHeight;
|
|
10828
|
+
}
|
|
10829
|
+
else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
|
|
10830
|
+
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10831
|
+
overAllHeight = parseInt(this.popupHeight, 10);
|
|
10832
|
+
}
|
|
10833
|
+
else if (this.mode === 'CheckBox' && !this.showSelectAll) {
|
|
10834
|
+
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10835
|
+
overAllHeight = parseInt(this.popupHeight, 10);
|
|
10836
|
+
if (this.headerTemplate && this.header) {
|
|
10837
|
+
overAllHeight -= this.header.offsetHeight;
|
|
10791
10838
|
}
|
|
10792
|
-
this.
|
|
10793
|
-
|
|
10794
|
-
this.targetElement().trim() !== '')) {
|
|
10795
|
-
this.loadTemplate();
|
|
10839
|
+
if (this.footerTemplate && this.footer) {
|
|
10840
|
+
overAllHeight -= this.footer.offsetHeight;
|
|
10796
10841
|
}
|
|
10797
|
-
|
|
10842
|
+
}
|
|
10843
|
+
if (this.mode === 'CheckBox') {
|
|
10844
|
+
const args = {
|
|
10845
|
+
module: 'CheckBoxSelection',
|
|
10846
|
+
enable: this.mode === 'CheckBox',
|
|
10847
|
+
popupElement: this.popupWrapper
|
|
10848
|
+
};
|
|
10798
10849
|
if (this.allowFiltering) {
|
|
10799
|
-
this.notify('
|
|
10800
|
-
|
|
10801
|
-
});
|
|
10850
|
+
this.notify('searchBox', args);
|
|
10851
|
+
overAllHeight -= this.searchBoxHeight;
|
|
10802
10852
|
}
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10853
|
+
addClass([this.popupWrapper], 'e-checkbox');
|
|
10854
|
+
}
|
|
10855
|
+
if (this.popupHeight !== 'auto') {
|
|
10856
|
+
this.list.style.maxHeight = formatUnit(overAllHeight);
|
|
10857
|
+
this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
|
|
10858
|
+
}
|
|
10859
|
+
else {
|
|
10860
|
+
this.list.style.maxHeight = formatUnit(this.popupHeight);
|
|
10861
|
+
}
|
|
10862
|
+
this.popupObj = new Popup(this.popupWrapper, {
|
|
10863
|
+
width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
|
|
10864
|
+
relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
|
|
10865
|
+
enableRtl: this.enableRtl, zIndex: this.zIndex,
|
|
10866
|
+
close: () => {
|
|
10867
|
+
if (this.popupObj.element.parentElement) {
|
|
10868
|
+
this.popupObj.unwireScrollEvents();
|
|
10869
|
+
// For restrict the page scrolling in safari browser
|
|
10870
|
+
const checkboxFilterInput = this.popupWrapper.querySelector('.' + FILTERINPUT);
|
|
10871
|
+
if (this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
|
|
10872
|
+
checkboxFilterInput.blur();
|
|
10873
|
+
}
|
|
10874
|
+
detach(this.popupObj.element);
|
|
10875
|
+
}
|
|
10876
|
+
},
|
|
10877
|
+
open: () => {
|
|
10878
|
+
this.popupObj.resolveCollision();
|
|
10879
|
+
if (!this.isFirstClick) {
|
|
10880
|
+
const ulElement = this.list.querySelector('ul');
|
|
10881
|
+
if (ulElement) {
|
|
10882
|
+
if (!(this.mode !== 'CheckBox' && (this.allowFiltering || this.allowCustomValue) &&
|
|
10883
|
+
this.targetElement().trim() !== '')) {
|
|
10884
|
+
this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
|
|
10885
|
+
}
|
|
10886
|
+
}
|
|
10887
|
+
this.isFirstClick = true;
|
|
10888
|
+
}
|
|
10889
|
+
this.popupObj.wireScrollEvents();
|
|
10890
|
+
if (!(this.mode !== 'CheckBox' && (this.allowFiltering || this.allowCustomValue) &&
|
|
10891
|
+
this.targetElement().trim() !== '')) {
|
|
10892
|
+
this.loadTemplate();
|
|
10893
|
+
}
|
|
10894
|
+
this.setScrollPosition();
|
|
10895
|
+
if (this.allowFiltering) {
|
|
10896
|
+
this.notify('inputFocus', {
|
|
10897
|
+
module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'focus'
|
|
10898
|
+
});
|
|
10899
|
+
}
|
|
10900
|
+
}, targetExitViewport: () => {
|
|
10901
|
+
if (!Browser.isDevice) {
|
|
10902
|
+
this.hidePopup();
|
|
10903
|
+
}
|
|
10806
10904
|
}
|
|
10905
|
+
});
|
|
10906
|
+
if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
|
|
10907
|
+
this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10807
10908
|
}
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10909
|
+
this.popupObj.close();
|
|
10910
|
+
this.popupWrapper.style.visibility = '';
|
|
10811
10911
|
}
|
|
10812
|
-
this.popupObj.close();
|
|
10813
|
-
this.popupWrapper.style.visibility = '';
|
|
10814
10912
|
}
|
|
10815
10913
|
}
|
|
10816
10914
|
setHeaderTemplate() {
|
|
@@ -11071,7 +11169,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11071
11169
|
let temp;
|
|
11072
11170
|
const tempData = this.listData;
|
|
11073
11171
|
this.listData = this.mainData;
|
|
11074
|
-
this.hiddenElement
|
|
11172
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
11173
|
+
this.hiddenElement.innerHTML = '';
|
|
11174
|
+
}
|
|
11075
11175
|
if (!isNullOrUndefined(this.value)) {
|
|
11076
11176
|
for (let index = 0; !isNullOrUndefined(this.value[index]); index++) {
|
|
11077
11177
|
const listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
|
|
@@ -11089,7 +11189,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11089
11189
|
data += temp + delimiterChar + ' ';
|
|
11090
11190
|
text.push(temp);
|
|
11091
11191
|
}
|
|
11092
|
-
this.hiddenElement
|
|
11192
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
11193
|
+
this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
|
|
11194
|
+
}
|
|
11093
11195
|
}
|
|
11094
11196
|
}
|
|
11095
11197
|
this.setProperties({ text: text.toString() }, true);
|
|
@@ -11300,10 +11402,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11300
11402
|
selectItems[temp1 - 1].setAttribute('aria-selected', 'false');
|
|
11301
11403
|
if (this.mode === 'CheckBox') {
|
|
11302
11404
|
if (selectedItems && (selectedItems.length > (temp1 - 1))) {
|
|
11303
|
-
selectedItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
|
|
11304
11405
|
removeClass([selectedItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
|
|
11305
11406
|
}
|
|
11306
|
-
selectItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
|
|
11307
11407
|
removeClass([selectItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
|
|
11308
11408
|
}
|
|
11309
11409
|
temp1--;
|
|
@@ -11361,9 +11461,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11361
11461
|
addClass([element], className);
|
|
11362
11462
|
this.updateMainList(false, element.getAttribute('data-value'), mainElement);
|
|
11363
11463
|
element.setAttribute('aria-selected', 'true');
|
|
11364
|
-
if (this.mode === 'CheckBox') {
|
|
11365
|
-
const ariaCheck = element.
|
|
11366
|
-
if (ariaCheck ===
|
|
11464
|
+
if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
|
|
11465
|
+
const ariaCheck = element.getElementsByClassName('e-check').length;
|
|
11466
|
+
if (ariaCheck === 0) {
|
|
11367
11467
|
this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });
|
|
11368
11468
|
}
|
|
11369
11469
|
}
|
|
@@ -11681,9 +11781,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11681
11781
|
if (this.chipCollectionWrapper) {
|
|
11682
11782
|
this.chipCollectionWrapper.style.display = 'none';
|
|
11683
11783
|
}
|
|
11684
|
-
this.viewWrapper
|
|
11685
|
-
|
|
11686
|
-
|
|
11784
|
+
if (!isNullOrUndefined(this.viewWrapper)) {
|
|
11785
|
+
this.viewWrapper.style.display = '';
|
|
11786
|
+
this.viewWrapper.style.width = '';
|
|
11787
|
+
this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
|
|
11788
|
+
}
|
|
11687
11789
|
if (this.value && this.value.length) {
|
|
11688
11790
|
let data = '';
|
|
11689
11791
|
let temp;
|
|
@@ -11771,8 +11873,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11771
11873
|
}
|
|
11772
11874
|
}
|
|
11773
11875
|
else {
|
|
11774
|
-
this.viewWrapper
|
|
11775
|
-
|
|
11876
|
+
if (!isNullOrUndefined(this.viewWrapper)) {
|
|
11877
|
+
this.viewWrapper.innerHTML = '';
|
|
11878
|
+
this.viewWrapper.style.display = 'none';
|
|
11879
|
+
}
|
|
11776
11880
|
}
|
|
11777
11881
|
}
|
|
11778
11882
|
checkClearIconWidth() {
|
|
@@ -11845,29 +11949,41 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11845
11949
|
return temp;
|
|
11846
11950
|
}
|
|
11847
11951
|
unWireEvent() {
|
|
11848
|
-
|
|
11952
|
+
if (!isNullOrUndefined(this.componentWrapper)) {
|
|
11953
|
+
EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
|
|
11954
|
+
}
|
|
11849
11955
|
EventHandler.remove(window, 'resize', this.windowResize);
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11956
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
11957
|
+
EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
|
|
11958
|
+
EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
|
|
11959
|
+
if (this.mode !== 'CheckBox') {
|
|
11960
|
+
EventHandler.remove(this.inputElement, 'input', this.onInput);
|
|
11961
|
+
}
|
|
11962
|
+
EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
|
|
11963
|
+
const formElement = closest(this.inputElement, 'form');
|
|
11964
|
+
if (formElement) {
|
|
11965
|
+
EventHandler.remove(formElement, 'reset', this.resetValueHandler);
|
|
11966
|
+
}
|
|
11967
|
+
EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
|
|
11854
11968
|
}
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11969
|
+
if (!isNullOrUndefined(this.componentWrapper)) {
|
|
11970
|
+
EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
|
|
11971
|
+
EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
|
|
11972
|
+
}
|
|
11973
|
+
if (!isNullOrUndefined(this.overAllClear)) {
|
|
11974
|
+
EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
|
|
11975
|
+
}
|
|
11976
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
11977
|
+
EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
|
|
11859
11978
|
}
|
|
11860
|
-
EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
|
|
11861
|
-
EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
|
|
11862
|
-
EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
|
|
11863
|
-
EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
|
|
11864
|
-
EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
|
|
11865
11979
|
}
|
|
11866
11980
|
selectAllItem(state, event, list) {
|
|
11867
11981
|
let li;
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11982
|
+
if (!isNullOrUndefined(this.list)) {
|
|
11983
|
+
li = this.list.querySelectorAll(state ?
|
|
11984
|
+
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
|
|
11985
|
+
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
|
|
11986
|
+
}
|
|
11871
11987
|
if (this.value && this.value.length && event && event.target
|
|
11872
11988
|
&& closest(event.target, '.e-close-hooker') && this.allowFiltering) {
|
|
11873
11989
|
li = this.mainList.querySelectorAll(state ?
|
|
@@ -12364,7 +12480,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12364
12480
|
* Adds a new item to the multiselect popup list. By default, new item appends to the list as the last item,
|
|
12365
12481
|
* but you can insert based on the index parameter.
|
|
12366
12482
|
*
|
|
12367
|
-
* @param
|
|
12483
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
12368
12484
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
12369
12485
|
* @returns {void}
|
|
12370
12486
|
*/
|
|
@@ -12671,11 +12787,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12671
12787
|
}
|
|
12672
12788
|
}
|
|
12673
12789
|
addValidInputClass() {
|
|
12674
|
-
if (
|
|
12675
|
-
|
|
12676
|
-
|
|
12677
|
-
|
|
12678
|
-
|
|
12790
|
+
if (!isNullOrUndefined(this.overAllWrapper)) {
|
|
12791
|
+
if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {
|
|
12792
|
+
addClass([this.overAllWrapper], 'e-valid-input');
|
|
12793
|
+
}
|
|
12794
|
+
else {
|
|
12795
|
+
removeClass([this.overAllWrapper], 'e-valid-input');
|
|
12796
|
+
}
|
|
12679
12797
|
}
|
|
12680
12798
|
}
|
|
12681
12799
|
dropDownIcon() {
|
|
@@ -12728,13 +12846,17 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12728
12846
|
super.destroy();
|
|
12729
12847
|
const temp = ['readonly', 'aria-disabled', 'placeholder'];
|
|
12730
12848
|
let length = temp.length;
|
|
12731
|
-
|
|
12732
|
-
|
|
12733
|
-
|
|
12849
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
12850
|
+
while (length > 0) {
|
|
12851
|
+
this.inputElement.removeAttribute(temp[length - 1]);
|
|
12852
|
+
length--;
|
|
12853
|
+
}
|
|
12734
12854
|
}
|
|
12735
|
-
this.element
|
|
12736
|
-
|
|
12737
|
-
|
|
12855
|
+
if (!isNullOrUndefined(this.element)) {
|
|
12856
|
+
this.element.removeAttribute('data-initial-value');
|
|
12857
|
+
this.element.style.display = 'block';
|
|
12858
|
+
}
|
|
12859
|
+
if (this.overAllWrapper && this.overAllWrapper.parentElement) {
|
|
12738
12860
|
if (this.overAllWrapper.parentElement.tagName === this.getNgDirective()) {
|
|
12739
12861
|
remove(this.overAllWrapper);
|
|
12740
12862
|
}
|
|
@@ -12743,6 +12865,25 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12743
12865
|
remove(this.overAllWrapper);
|
|
12744
12866
|
}
|
|
12745
12867
|
}
|
|
12868
|
+
this.componentWrapper = null;
|
|
12869
|
+
this.overAllClear = null;
|
|
12870
|
+
this.overAllWrapper = null;
|
|
12871
|
+
this.hiddenElement = null;
|
|
12872
|
+
this.searchWrapper = null;
|
|
12873
|
+
this.viewWrapper = null;
|
|
12874
|
+
this.chipCollectionWrapper = null;
|
|
12875
|
+
this.targetInputElement = null;
|
|
12876
|
+
this.popupWrapper = null;
|
|
12877
|
+
this.inputElement = null;
|
|
12878
|
+
this.delimiterWrapper = null;
|
|
12879
|
+
this.popupObj = null;
|
|
12880
|
+
this.popupWrapper = null;
|
|
12881
|
+
this.liCollections = null;
|
|
12882
|
+
this.header = null;
|
|
12883
|
+
this.mainList = null;
|
|
12884
|
+
this.mainListCollection = null;
|
|
12885
|
+
this.footer = null;
|
|
12886
|
+
this.selectAllEventEle = null;
|
|
12746
12887
|
}
|
|
12747
12888
|
};
|
|
12748
12889
|
__decorate$5([
|
|
@@ -13092,6 +13233,12 @@ class CheckBoxSelection {
|
|
|
13092
13233
|
destroy() {
|
|
13093
13234
|
this.removeEventListener();
|
|
13094
13235
|
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
13236
|
+
this.checkAllParent = null;
|
|
13237
|
+
this.clearIconElement = null;
|
|
13238
|
+
this.filterInput = null;
|
|
13239
|
+
this.filterInputObj = null;
|
|
13240
|
+
this.checkWrapper = null;
|
|
13241
|
+
this.selectAllSpan = null;
|
|
13095
13242
|
}
|
|
13096
13243
|
listSelection(args) {
|
|
13097
13244
|
let target;
|
|
@@ -13140,12 +13287,10 @@ class CheckBoxSelection {
|
|
|
13140
13287
|
e.preventDefault();
|
|
13141
13288
|
}
|
|
13142
13289
|
changeState(wrapper, state, e, isPrevent, selectAll$$1) {
|
|
13143
|
-
let ariaState;
|
|
13144
13290
|
const frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME$1)[0];
|
|
13145
13291
|
if (state === 'check' && !frameSpan.classList.contains(CHECK$1)) {
|
|
13146
13292
|
frameSpan.classList.remove(INDETERMINATE);
|
|
13147
13293
|
frameSpan.classList.add(CHECK$1);
|
|
13148
|
-
ariaState = 'true';
|
|
13149
13294
|
if (selectAll$$1) {
|
|
13150
13295
|
this.parent.selectAllItems(true, e);
|
|
13151
13296
|
this.setLocale(true);
|
|
@@ -13153,7 +13298,6 @@ class CheckBoxSelection {
|
|
|
13153
13298
|
}
|
|
13154
13299
|
else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK$1) || frameSpan.classList.contains(INDETERMINATE))) {
|
|
13155
13300
|
removeClass([frameSpan], [CHECK$1, INDETERMINATE]);
|
|
13156
|
-
ariaState = 'false';
|
|
13157
13301
|
if (selectAll$$1) {
|
|
13158
13302
|
this.parent.selectAllItems(false, e);
|
|
13159
13303
|
this.setLocale();
|
|
@@ -13162,16 +13306,11 @@ class CheckBoxSelection {
|
|
|
13162
13306
|
else if (state === 'indeterminate' && !(frameSpan.classList.contains(INDETERMINATE))) {
|
|
13163
13307
|
removeClass([frameSpan], [CHECK$1]);
|
|
13164
13308
|
frameSpan.classList.add(INDETERMINATE);
|
|
13165
|
-
ariaState = 'false';
|
|
13166
13309
|
if (selectAll$$1) {
|
|
13167
13310
|
this.parent.selectAllItems(false, e);
|
|
13168
13311
|
this.setLocale();
|
|
13169
13312
|
}
|
|
13170
13313
|
}
|
|
13171
|
-
ariaState = state === 'check' ? 'true' : state === 'uncheck' ? 'false' : ariaState;
|
|
13172
|
-
if (!isNullOrUndefined(ariaState)) {
|
|
13173
|
-
wrapper.setAttribute('aria-checked', ariaState);
|
|
13174
|
-
}
|
|
13175
13314
|
}
|
|
13176
13315
|
setSearchBox(args) {
|
|
13177
13316
|
if (isNullOrUndefined(this.parent.filterParent)) {
|
|
@@ -13332,8 +13471,8 @@ class CheckBoxSelection {
|
|
|
13332
13471
|
e.preventDefault();
|
|
13333
13472
|
}
|
|
13334
13473
|
}
|
|
13335
|
-
if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
|
|
13336
|
-
!this.parent.overAllWrapper.contains(e.target)) {
|
|
13474
|
+
if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
|
|
13475
|
+
&& !isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target)) {
|
|
13337
13476
|
if (this.parent.overAllWrapper.classList.contains(dropDownBaseClasses.focus) || this.parent.isPopupOpen()) {
|
|
13338
13477
|
this.parent.inputFocus = false;
|
|
13339
13478
|
this.parent.scrollFocusStatus = false;
|
|
@@ -13346,7 +13485,7 @@ class CheckBoxSelection {
|
|
|
13346
13485
|
this.parent.scrollFocusStatus = (Browser.isIE || Browser.info.name === 'edge') &&
|
|
13347
13486
|
(document.activeElement === this.filterInput);
|
|
13348
13487
|
}
|
|
13349
|
-
if (!this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
|
|
13488
|
+
if (!isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
|
|
13350
13489
|
!this.parent.isPopupOpen()) {
|
|
13351
13490
|
if (Browser.isIE) {
|
|
13352
13491
|
this.parent.onBlurHandler();
|
|
@@ -13377,7 +13516,7 @@ class CheckBoxSelection {
|
|
|
13377
13516
|
}
|
|
13378
13517
|
}
|
|
13379
13518
|
checkSelectAll(e) {
|
|
13380
|
-
if (e.value === 'check'
|
|
13519
|
+
if (e.value === 'check') {
|
|
13381
13520
|
this.changeState(this.checkAllParent, e.value, null, null, false);
|
|
13382
13521
|
this.setLocale(true);
|
|
13383
13522
|
}
|
|
@@ -13534,6 +13673,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13534
13673
|
this.isCustomFiltering = false;
|
|
13535
13674
|
this.initialSelectedOptions = this.value;
|
|
13536
13675
|
super.render();
|
|
13676
|
+
this.setEnabled();
|
|
13537
13677
|
this.renderComplete();
|
|
13538
13678
|
}
|
|
13539
13679
|
initWrapper() {
|
|
@@ -13824,14 +13964,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13824
13964
|
triggerDrag(args) {
|
|
13825
13965
|
let scrollParent;
|
|
13826
13966
|
let boundRect;
|
|
13827
|
-
|
|
13967
|
+
const scrollMoved = 36;
|
|
13828
13968
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13829
|
-
|
|
13969
|
+
const event = args.event;
|
|
13830
13970
|
let wrapper;
|
|
13831
|
-
if (args.target && (args.target.classList.contains(
|
|
13832
|
-
|| args.target.classList.contains(
|
|
13833
|
-
if (args.target.classList.contains(
|
|
13834
|
-
|| args.target.classList.contains(
|
|
13971
|
+
if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
|
|
13972
|
+
|| args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
|
|
13973
|
+
if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
|
|
13974
|
+
|| args.target.classList.contains('e-input-group')) {
|
|
13835
13975
|
wrapper = args.target.closest('.e-listbox-wrapper');
|
|
13836
13976
|
}
|
|
13837
13977
|
else {
|
|
@@ -13885,7 +14025,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13885
14025
|
const getArgs = this.getDragArgs({ target: args.droppedElement }, true);
|
|
13886
14026
|
const sourceArgs = { previousData: this.dataSource };
|
|
13887
14027
|
const destArgs = { previousData: listObj.dataSource };
|
|
13888
|
-
let dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
14028
|
+
let dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
14029
|
+
previousIndex: args.previousIndex, currentIndex: args.currentIndex });
|
|
13889
14030
|
if (listObj !== this) {
|
|
13890
14031
|
const sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
|
|
13891
14032
|
dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
|
|
@@ -13979,14 +14120,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13979
14120
|
currIdx++;
|
|
13980
14121
|
});
|
|
13981
14122
|
if (this.fields.groupBy) {
|
|
13982
|
-
|
|
14123
|
+
const sourceElem = this.renderItems(this.listData, this.fields);
|
|
13983
14124
|
this.updateListItems(sourceElem, this.ulElement);
|
|
13984
14125
|
this.setSelection();
|
|
13985
14126
|
}
|
|
13986
14127
|
if (listObj.sortOrder !== 'None' || this.selectionSettings.showCheckbox
|
|
13987
14128
|
!== listObj.selectionSettings.showCheckbox || listObj.fields.groupBy || listObj.itemTemplate || this.itemTemplate) {
|
|
13988
14129
|
const sortable = getComponent(ul, 'sortable');
|
|
13989
|
-
|
|
14130
|
+
const sourceElem = listObj.renderItems(listData, listObj.fields);
|
|
13990
14131
|
listObj.updateListItems(sourceElem, ul);
|
|
13991
14132
|
this.setSelection();
|
|
13992
14133
|
if (sortable.placeHolderElement) {
|
|
@@ -14022,7 +14163,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14022
14163
|
}
|
|
14023
14164
|
updateListItems(sourceElem, destElem) {
|
|
14024
14165
|
const i = 0;
|
|
14025
|
-
destElem.innerHTML =
|
|
14166
|
+
destElem.innerHTML = '';
|
|
14026
14167
|
while (i < sourceElem.childNodes.length) {
|
|
14027
14168
|
destElem.appendChild(sourceElem.childNodes[i]);
|
|
14028
14169
|
}
|
|
@@ -14051,6 +14192,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14051
14192
|
}
|
|
14052
14193
|
return listObj;
|
|
14053
14194
|
}
|
|
14195
|
+
/**
|
|
14196
|
+
* Sets the enabled state to DropDownBase.
|
|
14197
|
+
*
|
|
14198
|
+
* @returns {void}
|
|
14199
|
+
*/
|
|
14200
|
+
setEnabled() {
|
|
14201
|
+
this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
|
|
14202
|
+
}
|
|
14054
14203
|
listOption(dataSource, fields) {
|
|
14055
14204
|
this.listCurrentOptions = super.listOption(dataSource, fields);
|
|
14056
14205
|
this.listCurrentOptions = extend({}, this.listCurrentOptions, { itemCreated: this.triggerBeforeItemRender.bind(this) }, true);
|
|
@@ -14082,7 +14231,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14082
14231
|
enableItems(items, enable = true, isValue) {
|
|
14083
14232
|
let li;
|
|
14084
14233
|
items.forEach((item) => {
|
|
14085
|
-
|
|
14234
|
+
const text = item;
|
|
14086
14235
|
li = this.findListElement(this.list, 'li', 'data-value', isValue ? text : this.getValueByText(text));
|
|
14087
14236
|
if (!li) {
|
|
14088
14237
|
return;
|
|
@@ -14487,9 +14636,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14487
14636
|
prepend([this.filterParent], this.list);
|
|
14488
14637
|
attributes(this.filterInput, {
|
|
14489
14638
|
'aria-disabled': 'false',
|
|
14490
|
-
'aria-
|
|
14491
|
-
'role': 'listbox',
|
|
14492
|
-
'aria-activedescendant': null,
|
|
14639
|
+
'aria-label': 'search list item',
|
|
14493
14640
|
'autocomplete': 'off',
|
|
14494
14641
|
'autocorrect': 'off',
|
|
14495
14642
|
'autocapitalize': 'off',
|
|
@@ -14813,7 +14960,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14813
14960
|
});
|
|
14814
14961
|
if (isRefresh) {
|
|
14815
14962
|
if (fListBox.fields.groupBy) {
|
|
14816
|
-
|
|
14963
|
+
const sourceElem = fListBox.renderItems(listData, fListBox.fields);
|
|
14817
14964
|
fListBox.updateListItems(sourceElem, fListBox.ulElement);
|
|
14818
14965
|
}
|
|
14819
14966
|
else {
|
|
@@ -14846,7 +14993,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14846
14993
|
tListBox.jsonData = tJsonData;
|
|
14847
14994
|
tListBox.sortedData = tSortData;
|
|
14848
14995
|
if (isRefresh) {
|
|
14849
|
-
|
|
14996
|
+
const sourceElem = tListBox.renderItems(tListData, tListBox.fields);
|
|
14850
14997
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
14851
14998
|
tListBox.setSelection();
|
|
14852
14999
|
fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
@@ -14932,7 +15079,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14932
15079
|
listData = listData
|
|
14933
15080
|
.filter((data) => data.isHeader !== true);
|
|
14934
15081
|
tListBox.listData = tListBox.jsonData = listData;
|
|
14935
|
-
if (fListBox.listData.length
|
|
15082
|
+
if (fListBox.listData.length === fListBox.jsonData.length) {
|
|
14936
15083
|
fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
|
|
14937
15084
|
}
|
|
14938
15085
|
else if (this.allowFiltering) {
|
|
@@ -14946,7 +15093,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14946
15093
|
fListBox.listData = fListBox.sortedData = [];
|
|
14947
15094
|
}
|
|
14948
15095
|
if (isRefresh) {
|
|
14949
|
-
|
|
15096
|
+
const sourceElem = tListBox.renderItems(listData, tListBox.fields);
|
|
14950
15097
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
14951
15098
|
this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
14952
15099
|
}
|
|
@@ -15077,7 +15224,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
15077
15224
|
}
|
|
15078
15225
|
}
|
|
15079
15226
|
}
|
|
15080
|
-
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !==
|
|
15227
|
+
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
|
|
15081
15228
|
this.upDownKeyHandler(e);
|
|
15082
15229
|
}
|
|
15083
15230
|
}
|
|
@@ -15120,9 +15267,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
15120
15267
|
this.selectHandler({ target: ul.children[fliIdx], ctrlKey: e.ctrlKey, shiftKey: e.shiftKey }, true);
|
|
15121
15268
|
}
|
|
15122
15269
|
if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
|
|
15123
|
-
|
|
15124
|
-
|
|
15125
|
-
|
|
15270
|
+
const selectedidx = Array.prototype.indexOf.call(ul.children, fli);
|
|
15271
|
+
const sidx = e.code === 'Home' ? 0 : selectedidx;
|
|
15272
|
+
const eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
|
|
15126
15273
|
for (let i = sidx; i <= eidx; i++) {
|
|
15127
15274
|
const item = ul.children[i];
|
|
15128
15275
|
this.notify('updatelist', { li: item, e: {
|
|
@@ -15276,7 +15423,6 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
15276
15423
|
dvalue = this.getFormattedValue(li.getAttribute('data-value'));
|
|
15277
15424
|
if (values.indexOf(dvalue) < 0) {
|
|
15278
15425
|
li.getElementsByClassName('e-check')[0].classList.remove('e-check');
|
|
15279
|
-
li.getElementsByClassName('e-checkbox-wrapper')[0].removeAttribute('aria-checked');
|
|
15280
15426
|
li.removeAttribute('aria-selected');
|
|
15281
15427
|
}
|
|
15282
15428
|
});
|
|
@@ -15622,6 +15768,12 @@ __decorate$6([
|
|
|
15622
15768
|
__decorate$6([
|
|
15623
15769
|
Property('')
|
|
15624
15770
|
], ListBox.prototype, "height", void 0);
|
|
15771
|
+
__decorate$6([
|
|
15772
|
+
Property(true)
|
|
15773
|
+
], ListBox.prototype, "enabled", void 0);
|
|
15774
|
+
__decorate$6([
|
|
15775
|
+
Property(false)
|
|
15776
|
+
], ListBox.prototype, "enablePersistence", void 0);
|
|
15625
15777
|
__decorate$6([
|
|
15626
15778
|
Property(false)
|
|
15627
15779
|
], ListBox.prototype, "allowDragAndDrop", void 0);
|
|
@@ -15779,6 +15931,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
15779
15931
|
this.isFiltered = false;
|
|
15780
15932
|
this.beforePopupOpen = false;
|
|
15781
15933
|
this.initRemoteRender = false;
|
|
15934
|
+
this.isListResetted = false;
|
|
15782
15935
|
this.isPopupOpen = false;
|
|
15783
15936
|
this.isCollided = false;
|
|
15784
15937
|
this.lineBreak = false;
|
|
@@ -15845,6 +15998,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
15845
15998
|
/**
|
|
15846
15999
|
* Hides the spinner loader.
|
|
15847
16000
|
*
|
|
16001
|
+
* @private
|
|
15848
16002
|
* @returns {void}
|
|
15849
16003
|
*/
|
|
15850
16004
|
hideSpinner() {
|
|
@@ -15900,6 +16054,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
15900
16054
|
break;
|
|
15901
16055
|
case 'tab':
|
|
15902
16056
|
if (this.isPopupOpen) {
|
|
16057
|
+
e.preventDefault();
|
|
15903
16058
|
const li = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
15904
16059
|
if (li) {
|
|
15905
16060
|
this.setSelection(li, e);
|
|
@@ -15939,7 +16094,8 @@ let Mention = class Mention extends DropDownBase {
|
|
|
15939
16094
|
let startIndex = 0;
|
|
15940
16095
|
startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
|
|
15941
16096
|
index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
|
|
15942
|
-
const nextItem = isNullOrUndefined(this.activeIndex) ?
|
|
16097
|
+
const nextItem = isNullOrUndefined(this.activeIndex) ?
|
|
16098
|
+
this.liCollections[startIndex] : this.liCollections[index];
|
|
15943
16099
|
if (!isNullOrUndefined(nextItem)) {
|
|
15944
16100
|
this.setSelection(nextItem, e);
|
|
15945
16101
|
}
|
|
@@ -15964,9 +16120,14 @@ let Mention = class Mention extends DropDownBase {
|
|
|
15964
16120
|
}
|
|
15965
16121
|
let currentRange = this.getTextRange();
|
|
15966
16122
|
const lastWordRange = this.getLastLetter(currentRange);
|
|
16123
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
15967
16124
|
const Regex = new RegExp(this.mentionChar, 'g');
|
|
15968
16125
|
const charRegex = new RegExp('[a-zA-Z]', 'g');
|
|
15969
16126
|
if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
|
|
16127
|
+
if ((e.keyCode === 37 || e.keyCode === 39) && !isNullOrUndefined(currentRange) &&
|
|
16128
|
+
currentRange.indexOf(this.mentionChar) === -1 && this.isPopupOpen) {
|
|
16129
|
+
this.hidePopup();
|
|
16130
|
+
}
|
|
15970
16131
|
return;
|
|
15971
16132
|
}
|
|
15972
16133
|
if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
|
|
@@ -15995,7 +16156,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
15995
16156
|
if (!this.isContentEditable(this.inputElement)) {
|
|
15996
16157
|
this.showPopup();
|
|
15997
16158
|
}
|
|
15998
|
-
else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement) {
|
|
16159
|
+
else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement && e.keyCode !== 9) {
|
|
15999
16160
|
this.showPopup();
|
|
16000
16161
|
}
|
|
16001
16162
|
}
|
|
@@ -16024,8 +16185,12 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16024
16185
|
this.searchLists(e);
|
|
16025
16186
|
}
|
|
16026
16187
|
else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
|
|
16027
|
-
this.
|
|
16188
|
+
this.searchLists(e);
|
|
16189
|
+
if (!this.isListResetted) {
|
|
16190
|
+
this.resetList(this.dataSource, this.fields);
|
|
16191
|
+
}
|
|
16028
16192
|
}
|
|
16193
|
+
this.isListResetted = false;
|
|
16029
16194
|
}
|
|
16030
16195
|
isMatchedText() {
|
|
16031
16196
|
let isMatched = false;
|
|
@@ -16058,7 +16223,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16058
16223
|
this.activeIndex = null;
|
|
16059
16224
|
const eventArgs = {
|
|
16060
16225
|
preventDefaultAction: false,
|
|
16061
|
-
text: this.
|
|
16226
|
+
text: this.queryString,
|
|
16062
16227
|
updateData: (dataSource, query, fields) => {
|
|
16063
16228
|
if (eventArgs.cancel) {
|
|
16064
16229
|
return;
|
|
@@ -16076,8 +16241,9 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16076
16241
|
}
|
|
16077
16242
|
filterAction(dataSource, query, fields) {
|
|
16078
16243
|
this.beforePopupOpen = true;
|
|
16079
|
-
if (this.queryString
|
|
16244
|
+
if (this.queryString.length >= this.minLength) {
|
|
16080
16245
|
this.resetList(dataSource, fields, query);
|
|
16246
|
+
this.isListResetted = true;
|
|
16081
16247
|
}
|
|
16082
16248
|
else {
|
|
16083
16249
|
if (this.isPopupOpen) {
|
|
@@ -16198,12 +16364,14 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16198
16364
|
}
|
|
16199
16365
|
}
|
|
16200
16366
|
else {
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
16367
|
+
if (this.range) {
|
|
16368
|
+
const selectedElem = this.range.startContainer;
|
|
16369
|
+
if (!isNullOrUndefined(selectedElem)) {
|
|
16370
|
+
const workingNodeContent = selectedElem.textContent;
|
|
16371
|
+
const selectStartOffset = this.range.startOffset;
|
|
16372
|
+
if (workingNodeContent && selectStartOffset >= 0) {
|
|
16373
|
+
text = workingNodeContent.substring(0, selectStartOffset);
|
|
16374
|
+
}
|
|
16207
16375
|
}
|
|
16208
16376
|
}
|
|
16209
16377
|
}
|
|
@@ -16215,7 +16383,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16215
16383
|
}
|
|
16216
16384
|
const textValue = text.replace(/\u00A0/g, ' ');
|
|
16217
16385
|
const words = textValue.split(/\s+/);
|
|
16218
|
-
|
|
16386
|
+
const wordCnt = words.length - 1;
|
|
16219
16387
|
return words[wordCnt].trim();
|
|
16220
16388
|
}
|
|
16221
16389
|
isContentEditable(element) {
|
|
@@ -16227,6 +16395,10 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16227
16395
|
* @returns {void}
|
|
16228
16396
|
*/
|
|
16229
16397
|
showPopup() {
|
|
16398
|
+
this.beforePopupOpen = true;
|
|
16399
|
+
if (isNullOrUndefined(this.list)) {
|
|
16400
|
+
this.initValue();
|
|
16401
|
+
}
|
|
16230
16402
|
this.renderPopup();
|
|
16231
16403
|
attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
|
|
16232
16404
|
if (this.selectedElementID == null) {
|
|
@@ -16290,18 +16462,13 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16290
16462
|
}
|
|
16291
16463
|
}
|
|
16292
16464
|
append([this.list], popupEle);
|
|
16293
|
-
if ((!this.popupObj || !document.body.contains(this.popupObj.element)) ||
|
|
16465
|
+
if ((!this.popupObj || !document.body.contains(this.popupObj.element)) ||
|
|
16466
|
+
!document.contains(popupEle) && isNullOrUndefined(this.target)) {
|
|
16294
16467
|
document.body.appendChild(popupEle);
|
|
16295
16468
|
}
|
|
16296
16469
|
let coordinates;
|
|
16297
16470
|
popupEle.style.visibility = 'hidden';
|
|
16298
|
-
|
|
16299
|
-
this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
|
|
16300
|
-
popupEle.style.maxHeight = formatUnit(this.popupHeight);
|
|
16301
|
-
}
|
|
16302
|
-
else {
|
|
16303
|
-
popupEle.style.height = 'auto';
|
|
16304
|
-
}
|
|
16471
|
+
this.setHeight(popupEle);
|
|
16305
16472
|
const offsetValue = 0;
|
|
16306
16473
|
const left = 0;
|
|
16307
16474
|
this.initializePopup(popupEle, offsetValue, left);
|
|
@@ -16324,6 +16491,9 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16324
16491
|
if (!eventArgs.cancel) {
|
|
16325
16492
|
this.renderReactTemplates();
|
|
16326
16493
|
this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.inputElement : null);
|
|
16494
|
+
if (isNullOrUndefined(this.getTriggerCharPosition())) {
|
|
16495
|
+
return;
|
|
16496
|
+
}
|
|
16327
16497
|
coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
|
|
16328
16498
|
if (!this.isCollided) {
|
|
16329
16499
|
popupEle.style.cssText = 'top: '.concat(coordinates.top.toString(), 'px;\n left: ').concat(coordinates.left.toString(), 'px;\nposition: absolute;\n display: block;');
|
|
@@ -16333,6 +16503,8 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16333
16503
|
this.isCollided = false;
|
|
16334
16504
|
}
|
|
16335
16505
|
popupEle.style.width = this.popupWidth !== '100%' && !isNullOrUndefined(this.popupWidth) ? formatUnit(this.popupWidth) : 'auto';
|
|
16506
|
+
this.setHeight(popupEle);
|
|
16507
|
+
popupEle.style.zIndex = this.zIndex === 1000 ? getZindexPartial(popupEle).toString() : this.zIndex.toString();
|
|
16336
16508
|
}
|
|
16337
16509
|
else {
|
|
16338
16510
|
this.beforePopupOpen = false;
|
|
@@ -16345,6 +16517,15 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16345
16517
|
}
|
|
16346
16518
|
});
|
|
16347
16519
|
}
|
|
16520
|
+
setHeight(popupEle) {
|
|
16521
|
+
if (this.popupHeight !== 'auto') {
|
|
16522
|
+
this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
|
|
16523
|
+
popupEle.style.maxHeight = formatUnit(this.popupHeight);
|
|
16524
|
+
}
|
|
16525
|
+
else {
|
|
16526
|
+
popupEle.style.height = 'auto';
|
|
16527
|
+
}
|
|
16528
|
+
}
|
|
16348
16529
|
checkCollision(popupEle) {
|
|
16349
16530
|
if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
|
|
16350
16531
|
const collision = isCollide(popupEle);
|
|
@@ -16424,7 +16605,9 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16424
16605
|
computed = getComputedStyle(element);
|
|
16425
16606
|
div.style.position = 'absolute';
|
|
16426
16607
|
div.style.visibility = 'hidden';
|
|
16608
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16427
16609
|
properties.forEach((prop) => {
|
|
16610
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
16428
16611
|
div.style[prop] = computed[prop];
|
|
16429
16612
|
});
|
|
16430
16613
|
div.textContent = element.value.substring(0, position);
|
|
@@ -16458,13 +16641,12 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16458
16641
|
}
|
|
16459
16642
|
else {
|
|
16460
16643
|
coordinates = {
|
|
16461
|
-
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize),
|
|
16644
|
+
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
|
|
16462
16645
|
left: rect.left + windowLeft
|
|
16463
16646
|
};
|
|
16464
16647
|
}
|
|
16465
16648
|
return coordinates;
|
|
16466
16649
|
}
|
|
16467
|
-
;
|
|
16468
16650
|
initValue() {
|
|
16469
16651
|
this.renderList();
|
|
16470
16652
|
if (this.dataSource instanceof DataManager) {
|
|
@@ -16599,7 +16781,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16599
16781
|
const nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
16600
16782
|
let nextOffset = this.list.scrollTop + nextBottom - currentOffset;
|
|
16601
16783
|
nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
|
|
16602
|
-
|
|
16784
|
+
const boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
16603
16785
|
if (this.activeIndex === 0) {
|
|
16604
16786
|
this.list.scrollTop = 0;
|
|
16605
16787
|
}
|
|
@@ -16659,8 +16841,8 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16659
16841
|
}
|
|
16660
16842
|
return items;
|
|
16661
16843
|
}
|
|
16662
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16663
16844
|
setValue(e) {
|
|
16845
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16664
16846
|
if (!this.isReact) {
|
|
16665
16847
|
if (!isNullOrUndefined(this.displayTemplate)) {
|
|
16666
16848
|
this.setDisplayTemplate();
|
|
@@ -16688,12 +16870,12 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16688
16870
|
const selection = this.inputElement.ownerDocument.getSelection();
|
|
16689
16871
|
const startPos = this.getTriggerCharPosition();
|
|
16690
16872
|
textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
|
|
16691
|
-
if (dataItem.
|
|
16873
|
+
if (dataItem.text !== null) {
|
|
16692
16874
|
value = this.mentionVal(dataItem.text);
|
|
16693
16875
|
}
|
|
16694
16876
|
if (!this.isContentEditable(this.inputElement)) {
|
|
16695
16877
|
const myField = this.inputElement;
|
|
16696
|
-
|
|
16878
|
+
const currentTriggerSnippet = this.getTextRange().substring(startPos + this.mentionChar.length, this.getTextRange().length);
|
|
16697
16879
|
value += textSuffix;
|
|
16698
16880
|
endPos = startPos + this.mentionChar.length;
|
|
16699
16881
|
endPos += currentTriggerSnippet.length;
|
|
@@ -16720,6 +16902,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16720
16902
|
const frag = document.createDocumentFragment();
|
|
16721
16903
|
let node;
|
|
16722
16904
|
let lastNode;
|
|
16905
|
+
// eslint-disable-next-line no-cond-assign
|
|
16723
16906
|
while (node = element.firstChild) {
|
|
16724
16907
|
lastNode = frag.appendChild(node);
|
|
16725
16908
|
}
|
|
@@ -16738,7 +16921,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16738
16921
|
}
|
|
16739
16922
|
}
|
|
16740
16923
|
mentionVal(value) {
|
|
16741
|
-
|
|
16924
|
+
const showChar = this.showMentionChar ? this.mentionChar : '';
|
|
16742
16925
|
if (!isNullOrUndefined(this.displayTemplate) && !isNullOrUndefined(this.displayTempElement)) {
|
|
16743
16926
|
value = this.displayTempElement.innerHTML;
|
|
16744
16927
|
}
|
|
@@ -16774,6 +16957,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16774
16957
|
this.displayTempElement.appendChild(displayCompTemp[i]);
|
|
16775
16958
|
}
|
|
16776
16959
|
}
|
|
16960
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16777
16961
|
if (!this.isReact) {
|
|
16778
16962
|
this.renderTemplates();
|
|
16779
16963
|
}
|
|
@@ -16783,6 +16967,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16783
16967
|
});
|
|
16784
16968
|
}
|
|
16785
16969
|
}
|
|
16970
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16786
16971
|
renderTemplates(callBack) {
|
|
16787
16972
|
this.renderReactTemplates(callBack);
|
|
16788
16973
|
}
|
|
@@ -16811,6 +16996,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16811
16996
|
this.spinnerTemplateElement.appendChild(spinnerCompTemp[i]);
|
|
16812
16997
|
}
|
|
16813
16998
|
}
|
|
16999
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16814
17000
|
if (!this.isReact) {
|
|
16815
17001
|
this.renderTemplates();
|
|
16816
17002
|
this.popupObj.element.appendChild(this.spinnerTemplateElement);
|
|
@@ -16905,7 +17091,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16905
17091
|
this.setHover(currentLi);
|
|
16906
17092
|
}
|
|
16907
17093
|
setHover(li) {
|
|
16908
|
-
if (this.
|
|
17094
|
+
if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
|
|
16909
17095
|
this.removeHover();
|
|
16910
17096
|
addClass([li], dropDownBaseClasses.hover);
|
|
16911
17097
|
}
|
|
@@ -16930,8 +17116,13 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16930
17116
|
* @returns {void}
|
|
16931
17117
|
*/
|
|
16932
17118
|
search(text, positionX, positionY) {
|
|
16933
|
-
if (
|
|
16934
|
-
|
|
17119
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
17120
|
+
this.range = this.getCurrentRange();
|
|
17121
|
+
}
|
|
17122
|
+
const currentRange = this.getTextRange();
|
|
17123
|
+
const lastWordRange = this.getLastLetter(currentRange);
|
|
17124
|
+
if ((this.ignoreCase && (text === lastWordRange || text === lastWordRange.toLowerCase()))
|
|
17125
|
+
|| !this.ignoreCase && text === lastWordRange) {
|
|
16935
17126
|
this.resetList(this.dataSource, this.fields);
|
|
16936
17127
|
}
|
|
16937
17128
|
else {
|