@syncfusion/ej2-dropdowns 20.3.60 → 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 -44
- 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 +485 -310
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +471 -296
- 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 -1
- package/src/combo-box/combo-box.js +7 -5
- package/src/drop-down-base/drop-down-base-model.d.ts +0 -18
- package/src/drop-down-base/drop-down-base.d.ts +0 -22
- package/src/drop-down-base/drop-down-base.js +42 -37
- package/src/drop-down-list/drop-down-list-model.d.ts +18 -0
- package/src/drop-down-list/drop-down-list.d.ts +22 -0
- package/src/drop-down-list/drop-down-list.js +95 -41
- 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.js +203 -156
- 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
|
@@ -432,7 +432,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
432
432
|
liElem.setAttribute('role', 'option');
|
|
433
433
|
}
|
|
434
434
|
else {
|
|
435
|
-
ele
|
|
435
|
+
if (!isNullOrUndefined(ele)) {
|
|
436
|
+
ele.innerHTML = content;
|
|
437
|
+
}
|
|
436
438
|
}
|
|
437
439
|
}
|
|
438
440
|
}
|
|
@@ -463,14 +465,16 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
463
465
|
* @returns {void}
|
|
464
466
|
*/
|
|
465
467
|
setEnableRtl() {
|
|
466
|
-
if (this.
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
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
|
+
}
|
|
474
478
|
}
|
|
475
479
|
}
|
|
476
480
|
/**
|
|
@@ -508,14 +512,6 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
508
512
|
getPersistData() {
|
|
509
513
|
return this.addOnPersist([]);
|
|
510
514
|
}
|
|
511
|
-
/**
|
|
512
|
-
* Sets the enabled state to DropDownBase.
|
|
513
|
-
*
|
|
514
|
-
* @returns {void}
|
|
515
|
-
*/
|
|
516
|
-
setEnabled() {
|
|
517
|
-
this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
|
|
518
|
-
}
|
|
519
515
|
/**
|
|
520
516
|
* Sets the enabled state to DropDownBase.
|
|
521
517
|
*
|
|
@@ -734,7 +730,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
734
730
|
this.liCollections = [];
|
|
735
731
|
this.trigger('actionFailure', e);
|
|
736
732
|
this.l10nUpdate(true);
|
|
737
|
-
|
|
733
|
+
if (!isNullOrUndefined(this.list)) {
|
|
734
|
+
addClass([this.list], dropDownBaseClasses.noData);
|
|
735
|
+
}
|
|
738
736
|
}
|
|
739
737
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
740
738
|
onActionComplete(ulElement, list, e) {
|
|
@@ -864,10 +862,12 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
864
862
|
if (!isNullOrUndefined(this.list) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
865
863
|
if (isNullOrUndefined(this.fixedHeaderElement)) {
|
|
866
864
|
this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
|
|
867
|
-
if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
|
|
865
|
+
if (!isNullOrUndefined(this.list) && !this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
|
|
868
866
|
this.fixedHeaderElement.style.display = 'none';
|
|
869
867
|
}
|
|
870
|
-
|
|
868
|
+
if (!isNullOrUndefined(this.fixedHeaderElement) && !isNullOrUndefined(this.list)) {
|
|
869
|
+
prepend([this.fixedHeaderElement], this.list);
|
|
870
|
+
}
|
|
871
871
|
this.setFixedHeader();
|
|
872
872
|
}
|
|
873
873
|
if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
|
|
@@ -958,7 +958,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
958
958
|
return item;
|
|
959
959
|
}
|
|
960
960
|
setFixedHeader() {
|
|
961
|
-
this.list
|
|
961
|
+
if (!isNullOrUndefined(this.list)) {
|
|
962
|
+
this.list.parentElement.style.display = 'block';
|
|
963
|
+
}
|
|
962
964
|
let borderWidth = 0;
|
|
963
965
|
if (this.list && this.list.parentElement) {
|
|
964
966
|
borderWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-width'), 10);
|
|
@@ -973,8 +975,10 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
973
975
|
borderWidth = (borderTopWidth + borderBottomWidth + borderLeftWidth + borderRightWidth);
|
|
974
976
|
}
|
|
975
977
|
}
|
|
976
|
-
|
|
977
|
-
|
|
978
|
+
if (!isNullOrUndefined(this.liCollections)) {
|
|
979
|
+
const liWidth = this.getValidLi().offsetWidth - borderWidth;
|
|
980
|
+
this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
|
|
981
|
+
}
|
|
978
982
|
setStyleAttribute(this.fixedHeaderElement, { zIndex: 10 });
|
|
979
983
|
const firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group + ':not(.e-hide-listitem)');
|
|
980
984
|
this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
|
|
@@ -1117,9 +1121,6 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1117
1121
|
case 'enableRtl':
|
|
1118
1122
|
this.setEnableRtl();
|
|
1119
1123
|
break;
|
|
1120
|
-
case 'enabled':
|
|
1121
|
-
this.setEnabled();
|
|
1122
|
-
break;
|
|
1123
1124
|
case 'groupTemplate':
|
|
1124
1125
|
this.renderGroupTemplate(this.list);
|
|
1125
1126
|
if (this.ulElement && this.fixedHeaderElement) {
|
|
@@ -1168,7 +1169,6 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1168
1169
|
wrapperElement.appendChild(this.list);
|
|
1169
1170
|
}
|
|
1170
1171
|
this.setEnableRtl();
|
|
1171
|
-
this.setEnabled();
|
|
1172
1172
|
if (!isEmptyData) {
|
|
1173
1173
|
this.initialize(e);
|
|
1174
1174
|
}
|
|
@@ -1260,11 +1260,17 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1260
1260
|
this.trigger('beforeItemRender', { element: li, item: item });
|
|
1261
1261
|
}
|
|
1262
1262
|
if (itemsCount === 0 && isNullOrUndefined(this.list.querySelector('ul'))) {
|
|
1263
|
-
this.list
|
|
1264
|
-
|
|
1265
|
-
|
|
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
|
+
}
|
|
1266
1270
|
this.liCollections = liCollections;
|
|
1267
|
-
|
|
1271
|
+
if (!isNullOrUndefined(liCollections) && !isNullOrUndefined(this.ulElement)) {
|
|
1272
|
+
append(liCollections, this.ulElement);
|
|
1273
|
+
}
|
|
1268
1274
|
this.updateAddItemList(this.list, itemsCount);
|
|
1269
1275
|
}
|
|
1270
1276
|
else {
|
|
@@ -1383,15 +1389,17 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1383
1389
|
}
|
|
1384
1390
|
detach(this.list);
|
|
1385
1391
|
}
|
|
1392
|
+
this.liCollections = null;
|
|
1393
|
+
this.ulElement = null;
|
|
1394
|
+
this.list = null;
|
|
1395
|
+
this.enableRtlElements = null;
|
|
1396
|
+
this.rippleFun = null;
|
|
1386
1397
|
super.destroy();
|
|
1387
1398
|
}
|
|
1388
1399
|
};
|
|
1389
1400
|
__decorate([
|
|
1390
1401
|
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
1391
1402
|
], DropDownBase.prototype, "fields", void 0);
|
|
1392
|
-
__decorate([
|
|
1393
|
-
Property(false)
|
|
1394
|
-
], DropDownBase.prototype, "enablePersistence", void 0);
|
|
1395
1403
|
__decorate([
|
|
1396
1404
|
Property(null)
|
|
1397
1405
|
], DropDownBase.prototype, "itemTemplate", void 0);
|
|
@@ -1407,9 +1415,6 @@ __decorate([
|
|
|
1407
1415
|
__decorate([
|
|
1408
1416
|
Property('None')
|
|
1409
1417
|
], DropDownBase.prototype, "sortOrder", void 0);
|
|
1410
|
-
__decorate([
|
|
1411
|
-
Property(true)
|
|
1412
|
-
], DropDownBase.prototype, "enabled", void 0);
|
|
1413
1418
|
__decorate([
|
|
1414
1419
|
Property([])
|
|
1415
1420
|
], DropDownBase.prototype, "dataSource", void 0);
|
|
@@ -1653,8 +1658,12 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1653
1658
|
this.resetFocusElement();
|
|
1654
1659
|
}
|
|
1655
1660
|
}
|
|
1656
|
-
this.hiddenElement
|
|
1657
|
-
|
|
1661
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
1662
|
+
this.hiddenElement.innerHTML = '';
|
|
1663
|
+
}
|
|
1664
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
1665
|
+
this.inputElement.value = '';
|
|
1666
|
+
}
|
|
1658
1667
|
this.value = null;
|
|
1659
1668
|
this.itemData = null;
|
|
1660
1669
|
this.text = null;
|
|
@@ -1676,21 +1685,21 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1676
1685
|
if (Object.keys(this.htmlAttributes).length) {
|
|
1677
1686
|
for (const htmlAttr of Object.keys(this.htmlAttributes)) {
|
|
1678
1687
|
if (htmlAttr === 'class') {
|
|
1679
|
-
const updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
|
|
1688
|
+
const updatedClassValue = (this.htmlAttributes[`${htmlAttr}`].replace(/\s+/g, ' ')).trim();
|
|
1680
1689
|
if (updatedClassValue !== '') {
|
|
1681
1690
|
addClass([this.inputWrapper.container], updatedClassValue.split(' '));
|
|
1682
1691
|
}
|
|
1683
1692
|
}
|
|
1684
|
-
else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {
|
|
1693
|
+
else if (htmlAttr === 'disabled' && this.htmlAttributes[`${htmlAttr}`] === 'disabled') {
|
|
1685
1694
|
this.enabled = false;
|
|
1686
1695
|
this.setEnable();
|
|
1687
1696
|
}
|
|
1688
|
-
else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[htmlAttr])) {
|
|
1697
|
+
else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[`${htmlAttr}`])) {
|
|
1689
1698
|
this.readonly = true;
|
|
1690
1699
|
this.dataBind();
|
|
1691
1700
|
}
|
|
1692
1701
|
else if (htmlAttr === 'style') {
|
|
1693
|
-
this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);
|
|
1702
|
+
this.inputWrapper.container.setAttribute('style', this.htmlAttributes[`${htmlAttr}`]);
|
|
1694
1703
|
}
|
|
1695
1704
|
else {
|
|
1696
1705
|
const defaultAttr = ['title', 'id', 'placeholder',
|
|
@@ -1700,18 +1709,18 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1700
1709
|
defaultAttr.push('tabindex');
|
|
1701
1710
|
}
|
|
1702
1711
|
if (validateAttr.indexOf(htmlAttr) > -1 || htmlAttr.indexOf('data') === 0) {
|
|
1703
|
-
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
1712
|
+
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
1704
1713
|
}
|
|
1705
1714
|
else if (defaultAttr.indexOf(htmlAttr) > -1) {
|
|
1706
1715
|
if (htmlAttr === 'placeholder') {
|
|
1707
|
-
Input.setPlaceholder(this.htmlAttributes[htmlAttr], this.inputElement);
|
|
1716
|
+
Input.setPlaceholder(this.htmlAttributes[`${htmlAttr}`], this.inputElement);
|
|
1708
1717
|
}
|
|
1709
1718
|
else {
|
|
1710
|
-
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
1719
|
+
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
1711
1720
|
}
|
|
1712
1721
|
}
|
|
1713
1722
|
else {
|
|
1714
|
-
this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
1723
|
+
this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
1715
1724
|
}
|
|
1716
1725
|
}
|
|
1717
1726
|
}
|
|
@@ -1767,7 +1776,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1767
1776
|
}
|
|
1768
1777
|
}
|
|
1769
1778
|
targetElement() {
|
|
1770
|
-
return this.inputWrapper.container;
|
|
1779
|
+
return !isNullOrUndefined(this.inputWrapper) ? this.inputWrapper.container : null;
|
|
1771
1780
|
}
|
|
1772
1781
|
getNgDirective() {
|
|
1773
1782
|
return 'EJS-DROPDOWNLIST';
|
|
@@ -1925,7 +1934,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1925
1934
|
}
|
|
1926
1935
|
}
|
|
1927
1936
|
unBindCommonEvent() {
|
|
1928
|
-
if (this.targetElement()) {
|
|
1937
|
+
if (!isNullOrUndefined(this.inputWrapper) && this.targetElement()) {
|
|
1929
1938
|
EventHandler.remove(this.targetElement(), 'blur', this.onBlurHandler);
|
|
1930
1939
|
}
|
|
1931
1940
|
const formElement = this.inputElement && closest(this.inputElement, 'form');
|
|
@@ -1955,9 +1964,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1955
1964
|
* @returns {void}
|
|
1956
1965
|
*/
|
|
1957
1966
|
wireListEvents() {
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
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
|
+
}
|
|
1961
1972
|
}
|
|
1962
1973
|
onSearch(e) {
|
|
1963
1974
|
if (e.charCode !== 32 && e.charCode !== 13) {
|
|
@@ -2235,9 +2246,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2235
2246
|
this.setSelection(previousItem, event);
|
|
2236
2247
|
}
|
|
2237
2248
|
unWireEvent() {
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
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
|
+
}
|
|
2241
2254
|
this.unBindCommonEvent();
|
|
2242
2255
|
}
|
|
2243
2256
|
/**
|
|
@@ -2246,9 +2259,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2246
2259
|
* @returns {void}
|
|
2247
2260
|
*/
|
|
2248
2261
|
unWireListEvents() {
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
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
|
+
}
|
|
2252
2267
|
}
|
|
2253
2268
|
checkSelector(id) {
|
|
2254
2269
|
return '[id="' + id.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g, '\\$1') + '"]';
|
|
@@ -2256,7 +2271,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2256
2271
|
onDocumentClick(e) {
|
|
2257
2272
|
const target = e.target;
|
|
2258
2273
|
if (!(!isNullOrUndefined(this.popupObj) && closest(target, this.checkSelector(this.popupObj.element.id))) &&
|
|
2259
|
-
!this.inputWrapper.container.contains(e.target)) {
|
|
2274
|
+
!isNullOrUndefined(this.inputWrapper) && !this.inputWrapper.container.contains(e.target)) {
|
|
2260
2275
|
if (this.inputWrapper.container.classList.contains(dropDownListClasses.inputFocus) || this.isPopupOpen) {
|
|
2261
2276
|
this.isDocumentClick = true;
|
|
2262
2277
|
const isActive = this.isRequested;
|
|
@@ -2453,9 +2468,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2453
2468
|
this.setScrollPosition(e);
|
|
2454
2469
|
}
|
|
2455
2470
|
if (Browser.info.name !== 'mozilla') {
|
|
2456
|
-
attributes(this.
|
|
2457
|
-
|
|
2458
|
-
|
|
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
|
+
}
|
|
2459
2476
|
}
|
|
2460
2477
|
if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
2461
2478
|
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
|
|
@@ -2626,9 +2643,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2626
2643
|
selectedElement.setAttribute('value', this.value.toString());
|
|
2627
2644
|
}
|
|
2628
2645
|
else {
|
|
2629
|
-
this.hiddenElement
|
|
2630
|
-
|
|
2631
|
-
|
|
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
|
+
}
|
|
2632
2651
|
}
|
|
2633
2652
|
}
|
|
2634
2653
|
else {
|
|
@@ -2964,7 +2983,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2964
2983
|
&& ((this.dataSource instanceof DataManager)
|
|
2965
2984
|
|| (!isNullOrUndefined(this.dataSource) && !isNullOrUndefined(this.dataSource.length) &&
|
|
2966
2985
|
this.dataSource.length !== 0)))) {
|
|
2967
|
-
if (this.itemTemplate &&
|
|
2986
|
+
if (this.itemTemplate && this.element.tagName === 'EJS-COMBOBOX' && this.allowFiltering) {
|
|
2968
2987
|
setTimeout(() => {
|
|
2969
2988
|
this.updateActionCompleteDataValues(ulElement, list);
|
|
2970
2989
|
}, 0);
|
|
@@ -3112,9 +3131,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3112
3131
|
(this.isDropDownClick && this.getModuleName() === 'combobox')))) {
|
|
3113
3132
|
offsetValue = this.getOffsetValue(popupEle);
|
|
3114
3133
|
const firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
|
|
3115
|
-
|
|
3116
|
-
parseInt(getComputedStyle(
|
|
3117
|
-
|
|
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
|
+
}
|
|
3118
3139
|
}
|
|
3119
3140
|
this.getFocusElement();
|
|
3120
3141
|
this.createPopup(popupEle, offsetValue, left);
|
|
@@ -3159,9 +3180,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3159
3180
|
const eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
|
|
3160
3181
|
this.trigger('open', eventArgs, (eventArgs) => {
|
|
3161
3182
|
if (!eventArgs.cancel) {
|
|
3162
|
-
|
|
3183
|
+
if (!isNullOrUndefined(this.inputWrapper)) {
|
|
3184
|
+
addClass([this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
|
|
3185
|
+
}
|
|
3163
3186
|
this.renderReactTemplates();
|
|
3164
|
-
|
|
3187
|
+
if (!isNullOrUndefined(this.popupObj)) {
|
|
3188
|
+
this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.element : null);
|
|
3189
|
+
}
|
|
3165
3190
|
}
|
|
3166
3191
|
else {
|
|
3167
3192
|
this.beforePopupOpen = false;
|
|
@@ -3417,11 +3442,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3417
3442
|
EventHandler.remove(this.backIconElement, 'click', this.clickOnBackIcon);
|
|
3418
3443
|
EventHandler.remove(this.clearIconElement, 'click', this.clearText);
|
|
3419
3444
|
}
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
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
|
+
}
|
|
3425
3452
|
this.filterInput = null;
|
|
3426
3453
|
}
|
|
3427
3454
|
attributes(this.targetElement(), { 'aria-expanded': 'false' });
|
|
@@ -3556,6 +3583,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3556
3583
|
this.text = isNullOrUndefined(this.value) ? null : selectElement.options[selectElement.selectedIndex].textContent;
|
|
3557
3584
|
this.initValue();
|
|
3558
3585
|
}
|
|
3586
|
+
this.setEnabled();
|
|
3559
3587
|
this.preventTabIndex(this.element);
|
|
3560
3588
|
if (!this.enabled) {
|
|
3561
3589
|
this.targetElement().tabIndex = -1;
|
|
@@ -3640,6 +3668,14 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3640
3668
|
const contentEle = popupEle.querySelector('div.e-content');
|
|
3641
3669
|
popupEle.insertBefore(this.header, contentEle);
|
|
3642
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
|
+
}
|
|
3643
3679
|
setOldText(text) {
|
|
3644
3680
|
this.text = text;
|
|
3645
3681
|
}
|
|
@@ -4008,7 +4044,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4008
4044
|
};
|
|
4009
4045
|
history.pushState({}, '');
|
|
4010
4046
|
}
|
|
4011
|
-
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))) {
|
|
4012
4048
|
this.renderPopup(e);
|
|
4013
4049
|
}
|
|
4014
4050
|
}
|
|
@@ -4024,7 +4060,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4024
4060
|
hidePopup(e) {
|
|
4025
4061
|
/* eslint-enable valid-jsdoc, jsdoc/require-param */
|
|
4026
4062
|
if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
|
|
4027
|
-
|
|
4063
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
4064
|
+
Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
4065
|
+
}
|
|
4028
4066
|
this.isEscapeKey = false;
|
|
4029
4067
|
if (!isNullOrUndefined(this.index)) {
|
|
4030
4068
|
const element = this.findListElement(this.ulElement, 'li', 'data-value', this.value);
|
|
@@ -4134,6 +4172,21 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4134
4172
|
this.inputWrapper.container.parentElement.insertBefore(this.element, this.inputWrapper.container);
|
|
4135
4173
|
detach(this.inputWrapper.container);
|
|
4136
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;
|
|
4137
4190
|
super.destroy();
|
|
4138
4191
|
}
|
|
4139
4192
|
/* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
|
|
@@ -4176,6 +4229,12 @@ __decorate$1([
|
|
|
4176
4229
|
__decorate$1([
|
|
4177
4230
|
Property('100%')
|
|
4178
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);
|
|
4179
4238
|
__decorate$1([
|
|
4180
4239
|
Property('300px')
|
|
4181
4240
|
], DropDownList.prototype, "popupHeight", void 0);
|
|
@@ -4337,6 +4396,9 @@ __decorate$2([
|
|
|
4337
4396
|
__decorate$2([
|
|
4338
4397
|
Property(null)
|
|
4339
4398
|
], Fields.prototype, "query", void 0);
|
|
4399
|
+
__decorate$2([
|
|
4400
|
+
Property('selectable')
|
|
4401
|
+
], Fields.prototype, "selectable", void 0);
|
|
4340
4402
|
__decorate$2([
|
|
4341
4403
|
Property('selected')
|
|
4342
4404
|
], Fields.prototype, "selected", void 0);
|
|
@@ -5132,7 +5194,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5132
5194
|
temp = this.getOverflowVal(index);
|
|
5133
5195
|
data += temp;
|
|
5134
5196
|
temp = this.overFlowWrapper.innerHTML;
|
|
5135
|
-
this.
|
|
5197
|
+
if (this.enableHtmlSanitizer) {
|
|
5198
|
+
this.overFlowWrapper.innerText = data;
|
|
5199
|
+
}
|
|
5200
|
+
else {
|
|
5201
|
+
this.overFlowWrapper.innerHTML = data;
|
|
5202
|
+
}
|
|
5136
5203
|
wrapperleng = this.overFlowWrapper.offsetWidth;
|
|
5137
5204
|
overAllContainer = this.inputWrapper.offsetWidth;
|
|
5138
5205
|
if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
|
|
@@ -5661,6 +5728,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5661
5728
|
nodeClicked: this.onNodeClicked.bind(this),
|
|
5662
5729
|
dataBound: this.OnDataBound.bind(this),
|
|
5663
5730
|
allowMultiSelection: this.allowMultiSelection,
|
|
5731
|
+
enableHtmlSanitizer: this.enableHtmlSanitizer,
|
|
5664
5732
|
showCheckBox: this.showCheckBox,
|
|
5665
5733
|
autoCheck: this.treeSettings.autoCheck,
|
|
5666
5734
|
sortOrder: this.sortOrder,
|
|
@@ -5951,7 +6019,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5951
6019
|
dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
|
|
5952
6020
|
child: this.cloneChildField(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
|
|
5953
6021
|
iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes, query: fields.query,
|
|
5954
|
-
selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
|
|
6022
|
+
selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
|
|
5955
6023
|
};
|
|
5956
6024
|
return clonedField;
|
|
5957
6025
|
}
|
|
@@ -5964,7 +6032,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5964
6032
|
dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
|
|
5965
6033
|
child: (fields.child ? this.cloneChildField(fields.child) : null), hasChildren: fields.hasChildren,
|
|
5966
6034
|
expanded: fields.expanded, iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes,
|
|
5967
|
-
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
|
|
5968
6036
|
};
|
|
5969
6037
|
return clonedField;
|
|
5970
6038
|
}
|
|
@@ -5974,7 +6042,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5974
6042
|
dataSource: fields.dataSource, id: fields.value, text: fields.text, parentID: fields.parentValue,
|
|
5975
6043
|
child: this.getTreeChildren(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
|
|
5976
6044
|
iconCss: fields.iconCss, imageUrl: fields.imageUrl, isChecked: fields.selected,
|
|
5977
|
-
htmlAttributes: fields.htmlAttributes, query: fields.query, selected: fields.selected,
|
|
6045
|
+
htmlAttributes: fields.htmlAttributes, query: fields.query, selectable: fields.selectable, selected: fields.selected,
|
|
5978
6046
|
tableName: fields.tableName, tooltip: fields.tooltip
|
|
5979
6047
|
};
|
|
5980
6048
|
return treeFields;
|
|
@@ -6469,7 +6537,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6469
6537
|
});
|
|
6470
6538
|
const chipContent = this.createElement('span', { className: CHIP_CONTENT });
|
|
6471
6539
|
const chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
|
|
6472
|
-
|
|
6540
|
+
if (this.enableHtmlSanitizer) {
|
|
6541
|
+
chipContent.innerText = text;
|
|
6542
|
+
}
|
|
6543
|
+
else {
|
|
6544
|
+
chipContent.innerHTML = text;
|
|
6545
|
+
}
|
|
6473
6546
|
chip.appendChild(chipContent);
|
|
6474
6547
|
this.chipCollection.appendChild(chip);
|
|
6475
6548
|
if (this.showClearButton) {
|
|
@@ -7291,6 +7364,9 @@ __decorate$2([
|
|
|
7291
7364
|
__decorate$2([
|
|
7292
7365
|
Property(false)
|
|
7293
7366
|
], DropDownTree.prototype, "showCheckBox", void 0);
|
|
7367
|
+
__decorate$2([
|
|
7368
|
+
Property(false)
|
|
7369
|
+
], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
|
|
7294
7370
|
__decorate$2([
|
|
7295
7371
|
Property(true)
|
|
7296
7372
|
], DropDownTree.prototype, "showClearButton", void 0);
|
|
@@ -7575,7 +7651,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7575
7651
|
}
|
|
7576
7652
|
getFocusElement() {
|
|
7577
7653
|
const dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
|
|
7578
|
-
const selected = this.list.querySelector('.' + dropDownListClasses.selected);
|
|
7654
|
+
const selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
|
|
7579
7655
|
const isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
|
|
7580
7656
|
if (isSelected) {
|
|
7581
7657
|
return selected;
|
|
@@ -7586,7 +7662,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7586
7662
|
const dataSource = this.sortedData;
|
|
7587
7663
|
const type = this.typeOfData(dataSource).typeof;
|
|
7588
7664
|
const activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
|
|
7589
|
-
|
|
7665
|
+
var activeElement = activeItem.item;
|
|
7590
7666
|
if (!isNullOrUndefined(activeElement)) {
|
|
7591
7667
|
const count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
|
|
7592
7668
|
const height = parseInt(getComputedStyle(this.liCollections[0], null).getPropertyValue('height'), 10);
|
|
@@ -7735,9 +7811,11 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7735
7811
|
}
|
|
7736
7812
|
else if (this.inputElement.value === '') {
|
|
7737
7813
|
this.activeIndex = null;
|
|
7738
|
-
this.list
|
|
7739
|
-
|
|
7740
|
-
|
|
7814
|
+
if (!isNullOrUndefined(this.list)) {
|
|
7815
|
+
this.list.scrollTop = 0;
|
|
7816
|
+
const focusItem = this.list.querySelector('.' + dropDownListClasses.li);
|
|
7817
|
+
this.setHoverList(focusItem);
|
|
7818
|
+
}
|
|
7741
7819
|
}
|
|
7742
7820
|
else {
|
|
7743
7821
|
this.activeIndex = null;
|
|
@@ -8033,7 +8111,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
8033
8111
|
this.removeFillSelection();
|
|
8034
8112
|
}
|
|
8035
8113
|
const dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
|
|
8036
|
-
const selected = this.list.querySelector('.' + dropDownListClasses.selected);
|
|
8114
|
+
const selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : null;
|
|
8037
8115
|
if (this.inputElement && dataItem.text === this.inputElement.value && !isNullOrUndefined(selected)) {
|
|
8038
8116
|
if (this.isSelected) {
|
|
8039
8117
|
this.onChangeEvent(e);
|
|
@@ -8891,7 +8969,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8891
8969
|
for (const htmlAttr of Object.keys(this.htmlAttributes)) {
|
|
8892
8970
|
switch (htmlAttr) {
|
|
8893
8971
|
case 'class': {
|
|
8894
|
-
const updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
|
|
8972
|
+
const updatedClassValue = (this.htmlAttributes[`${htmlAttr}`].replace(/\s+/g, ' ')).trim();
|
|
8895
8973
|
if (updatedClassValue !== '') {
|
|
8896
8974
|
addClass([this.overAllWrapper], updatedClassValue.split(' '));
|
|
8897
8975
|
addClass([this.popupWrapper], updatedClassValue.split(' '));
|
|
@@ -8903,7 +8981,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8903
8981
|
break;
|
|
8904
8982
|
case 'placeholder':
|
|
8905
8983
|
if (!this.placeholder) {
|
|
8906
|
-
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
8984
|
+
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
8907
8985
|
this.setProperties({ placeholder: this.inputElement.placeholder }, true);
|
|
8908
8986
|
this.refreshPlaceHolder();
|
|
8909
8987
|
}
|
|
@@ -8913,16 +8991,16 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8913
8991
|
const validateAttr = ['name', 'required', 'aria-required', 'form'];
|
|
8914
8992
|
const containerAttr = ['title', 'role', 'style', 'class'];
|
|
8915
8993
|
if (defaultAttr.indexOf(htmlAttr) > -1) {
|
|
8916
|
-
this.element.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
8994
|
+
this.element.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
8917
8995
|
}
|
|
8918
8996
|
else if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
|
|
8919
|
-
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
8997
|
+
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
8920
8998
|
}
|
|
8921
8999
|
else if (containerAttr.indexOf(htmlAttr) > -1) {
|
|
8922
|
-
this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9000
|
+
this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
8923
9001
|
}
|
|
8924
|
-
else if (htmlAttr !== 'size') {
|
|
8925
|
-
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9002
|
+
else if (htmlAttr !== 'size' && !isNullOrUndefined(this.inputElement)) {
|
|
9003
|
+
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
|
|
8926
9004
|
}
|
|
8927
9005
|
break;
|
|
8928
9006
|
}
|
|
@@ -8931,11 +9009,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8931
9009
|
}
|
|
8932
9010
|
}
|
|
8933
9011
|
updateReadonly(state) {
|
|
8934
|
-
if (
|
|
8935
|
-
this.
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
|
|
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
|
+
}
|
|
8939
9019
|
}
|
|
8940
9020
|
}
|
|
8941
9021
|
updateClearButton(state) {
|
|
@@ -9077,8 +9157,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9077
9157
|
if (!isNullOrUndefined(this.ulElement)) {
|
|
9078
9158
|
attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
9079
9159
|
}
|
|
9080
|
-
const disableStatus = (this.inputElement.disabled) ? true : false;
|
|
9081
|
-
if (!this.isPopupOpen()) {
|
|
9160
|
+
const disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
|
|
9161
|
+
if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
|
|
9082
9162
|
attributes(this.inputElement, this.getAriaAttributes());
|
|
9083
9163
|
}
|
|
9084
9164
|
if (disableStatus) {
|
|
@@ -9188,7 +9268,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9188
9268
|
this.checkForCustomValue(this.tempQuery, this.fields);
|
|
9189
9269
|
return;
|
|
9190
9270
|
}
|
|
9191
|
-
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() !== '') ||
|
|
9192
9272
|
this.mode === 'CheckBox' || ((this.keyCode === 8 || this.keyCode === 46) && this.allowFiltering &&
|
|
9193
9273
|
this.allowCustomValue && this.dataSource instanceof DataManager && this.inputElement.value === ''))) {
|
|
9194
9274
|
this.refreshSelection();
|
|
@@ -9258,8 +9338,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9258
9338
|
}
|
|
9259
9339
|
element.setAttribute('aria-selected', 'true');
|
|
9260
9340
|
if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
|
|
9261
|
-
const ariaValue = element.
|
|
9262
|
-
if (
|
|
9341
|
+
const ariaValue = element.getElementsByClassName('e-check').length;
|
|
9342
|
+
if (ariaValue === 0) {
|
|
9263
9343
|
const args = {
|
|
9264
9344
|
module: 'CheckBoxSelection',
|
|
9265
9345
|
enable: this.mode === 'CheckBox',
|
|
@@ -9652,11 +9732,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9652
9732
|
}
|
|
9653
9733
|
}
|
|
9654
9734
|
refreshInputHight() {
|
|
9655
|
-
if (
|
|
9656
|
-
this.
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
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
|
+
}
|
|
9660
9742
|
}
|
|
9661
9743
|
}
|
|
9662
9744
|
validateValues(newValue, oldValue) {
|
|
@@ -10456,7 +10538,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10456
10538
|
HIDE_LIST :
|
|
10457
10539
|
dropDownBaseClasses.selected);
|
|
10458
10540
|
if (this.mode === 'CheckBox') {
|
|
10459
|
-
element2.firstElementChild.setAttribute('aria-checked', 'false');
|
|
10460
10541
|
removeClass([element2.firstElementChild.lastElementChild], 'e-check');
|
|
10461
10542
|
}
|
|
10462
10543
|
}
|
|
@@ -10466,7 +10547,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10466
10547
|
HIDE_LIST :
|
|
10467
10548
|
dropDownBaseClasses.selected);
|
|
10468
10549
|
if (this.mode === 'CheckBox') {
|
|
10469
|
-
element2.firstElementChild.setAttribute('aria-checked', 'true');
|
|
10470
10550
|
addClass([element2.firstElementChild.lastElementChild], 'e-check');
|
|
10471
10551
|
}
|
|
10472
10552
|
}
|
|
@@ -10724,109 +10804,111 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10724
10804
|
super.render();
|
|
10725
10805
|
}
|
|
10726
10806
|
if (!this.popupObj) {
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
checkboxFilter.
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
this.
|
|
10737
|
-
|
|
10738
|
-
}
|
|
10739
|
-
append([this.list], this.popupWrapper);
|
|
10740
|
-
if (this.footerTemplate) {
|
|
10741
|
-
this.setFooterTemplate();
|
|
10742
|
-
overAllHeight -= this.footer.offsetHeight;
|
|
10743
|
-
}
|
|
10744
|
-
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
10745
|
-
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10746
|
-
overAllHeight -= this.selectAllHeight;
|
|
10747
|
-
}
|
|
10748
|
-
else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
|
|
10749
|
-
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10750
|
-
overAllHeight = parseInt(this.popupHeight, 10);
|
|
10751
|
-
}
|
|
10752
|
-
else if (this.mode === 'CheckBox' && !this.showSelectAll) {
|
|
10753
|
-
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10754
|
-
overAllHeight = parseInt(this.popupHeight, 10);
|
|
10755
|
-
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();
|
|
10756
10818
|
overAllHeight -= this.header.offsetHeight;
|
|
10757
10819
|
}
|
|
10758
|
-
|
|
10820
|
+
append([this.list], this.popupWrapper);
|
|
10821
|
+
if (this.footerTemplate) {
|
|
10822
|
+
this.setFooterTemplate();
|
|
10759
10823
|
overAllHeight -= this.footer.offsetHeight;
|
|
10760
10824
|
}
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
|
|
10767
|
-
|
|
10768
|
-
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
if (this.popupHeight !== 'auto') {
|
|
10775
|
-
this.list.style.maxHeight = formatUnit(overAllHeight);
|
|
10776
|
-
this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
|
|
10777
|
-
}
|
|
10778
|
-
else {
|
|
10779
|
-
this.list.style.maxHeight = formatUnit(this.popupHeight);
|
|
10780
|
-
}
|
|
10781
|
-
this.popupObj = new Popup(this.popupWrapper, {
|
|
10782
|
-
width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
|
|
10783
|
-
relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
|
|
10784
|
-
enableRtl: this.enableRtl, zIndex: this.zIndex,
|
|
10785
|
-
close: () => {
|
|
10786
|
-
if (this.popupObj.element.parentElement) {
|
|
10787
|
-
this.popupObj.unwireScrollEvents();
|
|
10788
|
-
// For restrict the page scrolling in safari browser
|
|
10789
|
-
const checkboxFilterInput = this.popupWrapper.querySelector('.' + FILTERINPUT);
|
|
10790
|
-
if (this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
|
|
10791
|
-
checkboxFilterInput.blur();
|
|
10792
|
-
}
|
|
10793
|
-
detach(this.popupObj.element);
|
|
10794
|
-
}
|
|
10795
|
-
},
|
|
10796
|
-
open: () => {
|
|
10797
|
-
this.popupObj.resolveCollision();
|
|
10798
|
-
if (!this.isFirstClick) {
|
|
10799
|
-
const ulElement = this.list.querySelector('ul');
|
|
10800
|
-
if (ulElement) {
|
|
10801
|
-
if (!(this.mode !== 'CheckBox' && (this.allowFiltering || this.allowCustomValue) &&
|
|
10802
|
-
this.targetElement().trim() !== '')) {
|
|
10803
|
-
this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
|
|
10804
|
-
}
|
|
10805
|
-
}
|
|
10806
|
-
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;
|
|
10807
10838
|
}
|
|
10808
|
-
this.
|
|
10809
|
-
|
|
10810
|
-
this.targetElement().trim() !== '')) {
|
|
10811
|
-
this.loadTemplate();
|
|
10839
|
+
if (this.footerTemplate && this.footer) {
|
|
10840
|
+
overAllHeight -= this.footer.offsetHeight;
|
|
10812
10841
|
}
|
|
10813
|
-
|
|
10842
|
+
}
|
|
10843
|
+
if (this.mode === 'CheckBox') {
|
|
10844
|
+
const args = {
|
|
10845
|
+
module: 'CheckBoxSelection',
|
|
10846
|
+
enable: this.mode === 'CheckBox',
|
|
10847
|
+
popupElement: this.popupWrapper
|
|
10848
|
+
};
|
|
10814
10849
|
if (this.allowFiltering) {
|
|
10815
|
-
this.notify('
|
|
10816
|
-
|
|
10817
|
-
});
|
|
10850
|
+
this.notify('searchBox', args);
|
|
10851
|
+
overAllHeight -= this.searchBoxHeight;
|
|
10818
10852
|
}
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
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
|
+
}
|
|
10822
10904
|
}
|
|
10905
|
+
});
|
|
10906
|
+
if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
|
|
10907
|
+
this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10823
10908
|
}
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10909
|
+
this.popupObj.close();
|
|
10910
|
+
this.popupWrapper.style.visibility = '';
|
|
10827
10911
|
}
|
|
10828
|
-
this.popupObj.close();
|
|
10829
|
-
this.popupWrapper.style.visibility = '';
|
|
10830
10912
|
}
|
|
10831
10913
|
}
|
|
10832
10914
|
setHeaderTemplate() {
|
|
@@ -11087,7 +11169,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11087
11169
|
let temp;
|
|
11088
11170
|
const tempData = this.listData;
|
|
11089
11171
|
this.listData = this.mainData;
|
|
11090
|
-
this.hiddenElement
|
|
11172
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
11173
|
+
this.hiddenElement.innerHTML = '';
|
|
11174
|
+
}
|
|
11091
11175
|
if (!isNullOrUndefined(this.value)) {
|
|
11092
11176
|
for (let index = 0; !isNullOrUndefined(this.value[index]); index++) {
|
|
11093
11177
|
const listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
|
|
@@ -11105,7 +11189,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11105
11189
|
data += temp + delimiterChar + ' ';
|
|
11106
11190
|
text.push(temp);
|
|
11107
11191
|
}
|
|
11108
|
-
this.hiddenElement
|
|
11192
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
11193
|
+
this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
|
|
11194
|
+
}
|
|
11109
11195
|
}
|
|
11110
11196
|
}
|
|
11111
11197
|
this.setProperties({ text: text.toString() }, true);
|
|
@@ -11316,10 +11402,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11316
11402
|
selectItems[temp1 - 1].setAttribute('aria-selected', 'false');
|
|
11317
11403
|
if (this.mode === 'CheckBox') {
|
|
11318
11404
|
if (selectedItems && (selectedItems.length > (temp1 - 1))) {
|
|
11319
|
-
selectedItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
|
|
11320
11405
|
removeClass([selectedItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
|
|
11321
11406
|
}
|
|
11322
|
-
selectItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
|
|
11323
11407
|
removeClass([selectItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
|
|
11324
11408
|
}
|
|
11325
11409
|
temp1--;
|
|
@@ -11377,9 +11461,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11377
11461
|
addClass([element], className);
|
|
11378
11462
|
this.updateMainList(false, element.getAttribute('data-value'), mainElement);
|
|
11379
11463
|
element.setAttribute('aria-selected', 'true');
|
|
11380
|
-
if (this.mode === 'CheckBox') {
|
|
11381
|
-
const ariaCheck = element.
|
|
11382
|
-
if (ariaCheck ===
|
|
11464
|
+
if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
|
|
11465
|
+
const ariaCheck = element.getElementsByClassName('e-check').length;
|
|
11466
|
+
if (ariaCheck === 0) {
|
|
11383
11467
|
this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });
|
|
11384
11468
|
}
|
|
11385
11469
|
}
|
|
@@ -11697,9 +11781,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11697
11781
|
if (this.chipCollectionWrapper) {
|
|
11698
11782
|
this.chipCollectionWrapper.style.display = 'none';
|
|
11699
11783
|
}
|
|
11700
|
-
this.viewWrapper
|
|
11701
|
-
|
|
11702
|
-
|
|
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
|
+
}
|
|
11703
11789
|
if (this.value && this.value.length) {
|
|
11704
11790
|
let data = '';
|
|
11705
11791
|
let temp;
|
|
@@ -11787,8 +11873,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11787
11873
|
}
|
|
11788
11874
|
}
|
|
11789
11875
|
else {
|
|
11790
|
-
this.viewWrapper
|
|
11791
|
-
|
|
11876
|
+
if (!isNullOrUndefined(this.viewWrapper)) {
|
|
11877
|
+
this.viewWrapper.innerHTML = '';
|
|
11878
|
+
this.viewWrapper.style.display = 'none';
|
|
11879
|
+
}
|
|
11792
11880
|
}
|
|
11793
11881
|
}
|
|
11794
11882
|
checkClearIconWidth() {
|
|
@@ -11861,29 +11949,41 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11861
11949
|
return temp;
|
|
11862
11950
|
}
|
|
11863
11951
|
unWireEvent() {
|
|
11864
|
-
|
|
11952
|
+
if (!isNullOrUndefined(this.componentWrapper)) {
|
|
11953
|
+
EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
|
|
11954
|
+
}
|
|
11865
11955
|
EventHandler.remove(window, 'resize', this.windowResize);
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
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);
|
|
11870
11968
|
}
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
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);
|
|
11875
11978
|
}
|
|
11876
|
-
EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
|
|
11877
|
-
EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
|
|
11878
|
-
EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
|
|
11879
|
-
EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
|
|
11880
|
-
EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
|
|
11881
11979
|
}
|
|
11882
11980
|
selectAllItem(state, event, list) {
|
|
11883
11981
|
let li;
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
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
|
+
}
|
|
11887
11987
|
if (this.value && this.value.length && event && event.target
|
|
11888
11988
|
&& closest(event.target, '.e-close-hooker') && this.allowFiltering) {
|
|
11889
11989
|
li = this.mainList.querySelectorAll(state ?
|
|
@@ -12687,11 +12787,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12687
12787
|
}
|
|
12688
12788
|
}
|
|
12689
12789
|
addValidInputClass() {
|
|
12690
|
-
if (
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
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
|
+
}
|
|
12695
12797
|
}
|
|
12696
12798
|
}
|
|
12697
12799
|
dropDownIcon() {
|
|
@@ -12744,13 +12846,17 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12744
12846
|
super.destroy();
|
|
12745
12847
|
const temp = ['readonly', 'aria-disabled', 'placeholder'];
|
|
12746
12848
|
let length = temp.length;
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12849
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
12850
|
+
while (length > 0) {
|
|
12851
|
+
this.inputElement.removeAttribute(temp[length - 1]);
|
|
12852
|
+
length--;
|
|
12853
|
+
}
|
|
12750
12854
|
}
|
|
12751
|
-
this.element
|
|
12752
|
-
|
|
12753
|
-
|
|
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) {
|
|
12754
12860
|
if (this.overAllWrapper.parentElement.tagName === this.getNgDirective()) {
|
|
12755
12861
|
remove(this.overAllWrapper);
|
|
12756
12862
|
}
|
|
@@ -12759,6 +12865,25 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12759
12865
|
remove(this.overAllWrapper);
|
|
12760
12866
|
}
|
|
12761
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;
|
|
12762
12887
|
}
|
|
12763
12888
|
};
|
|
12764
12889
|
__decorate$5([
|
|
@@ -13108,6 +13233,12 @@ class CheckBoxSelection {
|
|
|
13108
13233
|
destroy() {
|
|
13109
13234
|
this.removeEventListener();
|
|
13110
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;
|
|
13111
13242
|
}
|
|
13112
13243
|
listSelection(args) {
|
|
13113
13244
|
let target;
|
|
@@ -13156,12 +13287,10 @@ class CheckBoxSelection {
|
|
|
13156
13287
|
e.preventDefault();
|
|
13157
13288
|
}
|
|
13158
13289
|
changeState(wrapper, state, e, isPrevent, selectAll$$1) {
|
|
13159
|
-
let ariaState;
|
|
13160
13290
|
const frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME$1)[0];
|
|
13161
13291
|
if (state === 'check' && !frameSpan.classList.contains(CHECK$1)) {
|
|
13162
13292
|
frameSpan.classList.remove(INDETERMINATE);
|
|
13163
13293
|
frameSpan.classList.add(CHECK$1);
|
|
13164
|
-
ariaState = 'true';
|
|
13165
13294
|
if (selectAll$$1) {
|
|
13166
13295
|
this.parent.selectAllItems(true, e);
|
|
13167
13296
|
this.setLocale(true);
|
|
@@ -13169,7 +13298,6 @@ class CheckBoxSelection {
|
|
|
13169
13298
|
}
|
|
13170
13299
|
else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK$1) || frameSpan.classList.contains(INDETERMINATE))) {
|
|
13171
13300
|
removeClass([frameSpan], [CHECK$1, INDETERMINATE]);
|
|
13172
|
-
ariaState = 'false';
|
|
13173
13301
|
if (selectAll$$1) {
|
|
13174
13302
|
this.parent.selectAllItems(false, e);
|
|
13175
13303
|
this.setLocale();
|
|
@@ -13178,16 +13306,11 @@ class CheckBoxSelection {
|
|
|
13178
13306
|
else if (state === 'indeterminate' && !(frameSpan.classList.contains(INDETERMINATE))) {
|
|
13179
13307
|
removeClass([frameSpan], [CHECK$1]);
|
|
13180
13308
|
frameSpan.classList.add(INDETERMINATE);
|
|
13181
|
-
ariaState = 'false';
|
|
13182
13309
|
if (selectAll$$1) {
|
|
13183
13310
|
this.parent.selectAllItems(false, e);
|
|
13184
13311
|
this.setLocale();
|
|
13185
13312
|
}
|
|
13186
13313
|
}
|
|
13187
|
-
ariaState = state === 'check' ? 'true' : state === 'uncheck' ? 'false' : ariaState;
|
|
13188
|
-
if (!isNullOrUndefined(ariaState)) {
|
|
13189
|
-
wrapper.setAttribute('aria-checked', ariaState);
|
|
13190
|
-
}
|
|
13191
13314
|
}
|
|
13192
13315
|
setSearchBox(args) {
|
|
13193
13316
|
if (isNullOrUndefined(this.parent.filterParent)) {
|
|
@@ -13348,8 +13471,8 @@ class CheckBoxSelection {
|
|
|
13348
13471
|
e.preventDefault();
|
|
13349
13472
|
}
|
|
13350
13473
|
}
|
|
13351
|
-
if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
|
|
13352
|
-
!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)) {
|
|
13353
13476
|
if (this.parent.overAllWrapper.classList.contains(dropDownBaseClasses.focus) || this.parent.isPopupOpen()) {
|
|
13354
13477
|
this.parent.inputFocus = false;
|
|
13355
13478
|
this.parent.scrollFocusStatus = false;
|
|
@@ -13362,7 +13485,7 @@ class CheckBoxSelection {
|
|
|
13362
13485
|
this.parent.scrollFocusStatus = (Browser.isIE || Browser.info.name === 'edge') &&
|
|
13363
13486
|
(document.activeElement === this.filterInput);
|
|
13364
13487
|
}
|
|
13365
|
-
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') &&
|
|
13366
13489
|
!this.parent.isPopupOpen()) {
|
|
13367
13490
|
if (Browser.isIE) {
|
|
13368
13491
|
this.parent.onBlurHandler();
|
|
@@ -13393,7 +13516,7 @@ class CheckBoxSelection {
|
|
|
13393
13516
|
}
|
|
13394
13517
|
}
|
|
13395
13518
|
checkSelectAll(e) {
|
|
13396
|
-
if (e.value === 'check'
|
|
13519
|
+
if (e.value === 'check') {
|
|
13397
13520
|
this.changeState(this.checkAllParent, e.value, null, null, false);
|
|
13398
13521
|
this.setLocale(true);
|
|
13399
13522
|
}
|
|
@@ -13550,6 +13673,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13550
13673
|
this.isCustomFiltering = false;
|
|
13551
13674
|
this.initialSelectedOptions = this.value;
|
|
13552
13675
|
super.render();
|
|
13676
|
+
this.setEnabled();
|
|
13553
13677
|
this.renderComplete();
|
|
13554
13678
|
}
|
|
13555
13679
|
initWrapper() {
|
|
@@ -13840,14 +13964,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13840
13964
|
triggerDrag(args) {
|
|
13841
13965
|
let scrollParent;
|
|
13842
13966
|
let boundRect;
|
|
13843
|
-
|
|
13967
|
+
const scrollMoved = 36;
|
|
13844
13968
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13845
|
-
|
|
13969
|
+
const event = args.event;
|
|
13846
13970
|
let wrapper;
|
|
13847
|
-
if (args.target && (args.target.classList.contains(
|
|
13848
|
-
|| args.target.classList.contains(
|
|
13849
|
-
if (args.target.classList.contains(
|
|
13850
|
-
|| 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')) {
|
|
13851
13975
|
wrapper = args.target.closest('.e-listbox-wrapper');
|
|
13852
13976
|
}
|
|
13853
13977
|
else {
|
|
@@ -13901,7 +14025,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13901
14025
|
const getArgs = this.getDragArgs({ target: args.droppedElement }, true);
|
|
13902
14026
|
const sourceArgs = { previousData: this.dataSource };
|
|
13903
14027
|
const destArgs = { previousData: listObj.dataSource };
|
|
13904
|
-
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 });
|
|
13905
14030
|
if (listObj !== this) {
|
|
13906
14031
|
const sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
|
|
13907
14032
|
dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
|
|
@@ -13995,14 +14120,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13995
14120
|
currIdx++;
|
|
13996
14121
|
});
|
|
13997
14122
|
if (this.fields.groupBy) {
|
|
13998
|
-
|
|
14123
|
+
const sourceElem = this.renderItems(this.listData, this.fields);
|
|
13999
14124
|
this.updateListItems(sourceElem, this.ulElement);
|
|
14000
14125
|
this.setSelection();
|
|
14001
14126
|
}
|
|
14002
14127
|
if (listObj.sortOrder !== 'None' || this.selectionSettings.showCheckbox
|
|
14003
14128
|
!== listObj.selectionSettings.showCheckbox || listObj.fields.groupBy || listObj.itemTemplate || this.itemTemplate) {
|
|
14004
14129
|
const sortable = getComponent(ul, 'sortable');
|
|
14005
|
-
|
|
14130
|
+
const sourceElem = listObj.renderItems(listData, listObj.fields);
|
|
14006
14131
|
listObj.updateListItems(sourceElem, ul);
|
|
14007
14132
|
this.setSelection();
|
|
14008
14133
|
if (sortable.placeHolderElement) {
|
|
@@ -14038,7 +14163,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14038
14163
|
}
|
|
14039
14164
|
updateListItems(sourceElem, destElem) {
|
|
14040
14165
|
const i = 0;
|
|
14041
|
-
destElem.innerHTML =
|
|
14166
|
+
destElem.innerHTML = '';
|
|
14042
14167
|
while (i < sourceElem.childNodes.length) {
|
|
14043
14168
|
destElem.appendChild(sourceElem.childNodes[i]);
|
|
14044
14169
|
}
|
|
@@ -14067,6 +14192,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14067
14192
|
}
|
|
14068
14193
|
return listObj;
|
|
14069
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
|
+
}
|
|
14070
14203
|
listOption(dataSource, fields) {
|
|
14071
14204
|
this.listCurrentOptions = super.listOption(dataSource, fields);
|
|
14072
14205
|
this.listCurrentOptions = extend({}, this.listCurrentOptions, { itemCreated: this.triggerBeforeItemRender.bind(this) }, true);
|
|
@@ -14098,7 +14231,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14098
14231
|
enableItems(items, enable = true, isValue) {
|
|
14099
14232
|
let li;
|
|
14100
14233
|
items.forEach((item) => {
|
|
14101
|
-
|
|
14234
|
+
const text = item;
|
|
14102
14235
|
li = this.findListElement(this.list, 'li', 'data-value', isValue ? text : this.getValueByText(text));
|
|
14103
14236
|
if (!li) {
|
|
14104
14237
|
return;
|
|
@@ -14503,9 +14636,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14503
14636
|
prepend([this.filterParent], this.list);
|
|
14504
14637
|
attributes(this.filterInput, {
|
|
14505
14638
|
'aria-disabled': 'false',
|
|
14506
|
-
'aria-
|
|
14507
|
-
'role': 'listbox',
|
|
14508
|
-
'aria-activedescendant': null,
|
|
14639
|
+
'aria-label': 'search list item',
|
|
14509
14640
|
'autocomplete': 'off',
|
|
14510
14641
|
'autocorrect': 'off',
|
|
14511
14642
|
'autocapitalize': 'off',
|
|
@@ -14829,7 +14960,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14829
14960
|
});
|
|
14830
14961
|
if (isRefresh) {
|
|
14831
14962
|
if (fListBox.fields.groupBy) {
|
|
14832
|
-
|
|
14963
|
+
const sourceElem = fListBox.renderItems(listData, fListBox.fields);
|
|
14833
14964
|
fListBox.updateListItems(sourceElem, fListBox.ulElement);
|
|
14834
14965
|
}
|
|
14835
14966
|
else {
|
|
@@ -14862,7 +14993,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14862
14993
|
tListBox.jsonData = tJsonData;
|
|
14863
14994
|
tListBox.sortedData = tSortData;
|
|
14864
14995
|
if (isRefresh) {
|
|
14865
|
-
|
|
14996
|
+
const sourceElem = tListBox.renderItems(tListData, tListBox.fields);
|
|
14866
14997
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
14867
14998
|
tListBox.setSelection();
|
|
14868
14999
|
fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
@@ -14948,7 +15079,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14948
15079
|
listData = listData
|
|
14949
15080
|
.filter((data) => data.isHeader !== true);
|
|
14950
15081
|
tListBox.listData = tListBox.jsonData = listData;
|
|
14951
|
-
if (fListBox.listData.length
|
|
15082
|
+
if (fListBox.listData.length === fListBox.jsonData.length) {
|
|
14952
15083
|
fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
|
|
14953
15084
|
}
|
|
14954
15085
|
else if (this.allowFiltering) {
|
|
@@ -14962,7 +15093,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14962
15093
|
fListBox.listData = fListBox.sortedData = [];
|
|
14963
15094
|
}
|
|
14964
15095
|
if (isRefresh) {
|
|
14965
|
-
|
|
15096
|
+
const sourceElem = tListBox.renderItems(listData, tListBox.fields);
|
|
14966
15097
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
14967
15098
|
this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
14968
15099
|
}
|
|
@@ -15093,7 +15224,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
15093
15224
|
}
|
|
15094
15225
|
}
|
|
15095
15226
|
}
|
|
15096
|
-
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !==
|
|
15227
|
+
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
|
|
15097
15228
|
this.upDownKeyHandler(e);
|
|
15098
15229
|
}
|
|
15099
15230
|
}
|
|
@@ -15136,9 +15267,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
15136
15267
|
this.selectHandler({ target: ul.children[fliIdx], ctrlKey: e.ctrlKey, shiftKey: e.shiftKey }, true);
|
|
15137
15268
|
}
|
|
15138
15269
|
if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
|
|
15139
|
-
|
|
15140
|
-
|
|
15141
|
-
|
|
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;
|
|
15142
15273
|
for (let i = sidx; i <= eidx; i++) {
|
|
15143
15274
|
const item = ul.children[i];
|
|
15144
15275
|
this.notify('updatelist', { li: item, e: {
|
|
@@ -15292,7 +15423,6 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
15292
15423
|
dvalue = this.getFormattedValue(li.getAttribute('data-value'));
|
|
15293
15424
|
if (values.indexOf(dvalue) < 0) {
|
|
15294
15425
|
li.getElementsByClassName('e-check')[0].classList.remove('e-check');
|
|
15295
|
-
li.getElementsByClassName('e-checkbox-wrapper')[0].removeAttribute('aria-checked');
|
|
15296
15426
|
li.removeAttribute('aria-selected');
|
|
15297
15427
|
}
|
|
15298
15428
|
});
|
|
@@ -15638,6 +15768,12 @@ __decorate$6([
|
|
|
15638
15768
|
__decorate$6([
|
|
15639
15769
|
Property('')
|
|
15640
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);
|
|
15641
15777
|
__decorate$6([
|
|
15642
15778
|
Property(false)
|
|
15643
15779
|
], ListBox.prototype, "allowDragAndDrop", void 0);
|
|
@@ -15795,6 +15931,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
15795
15931
|
this.isFiltered = false;
|
|
15796
15932
|
this.beforePopupOpen = false;
|
|
15797
15933
|
this.initRemoteRender = false;
|
|
15934
|
+
this.isListResetted = false;
|
|
15798
15935
|
this.isPopupOpen = false;
|
|
15799
15936
|
this.isCollided = false;
|
|
15800
15937
|
this.lineBreak = false;
|
|
@@ -15861,6 +15998,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
15861
15998
|
/**
|
|
15862
15999
|
* Hides the spinner loader.
|
|
15863
16000
|
*
|
|
16001
|
+
* @private
|
|
15864
16002
|
* @returns {void}
|
|
15865
16003
|
*/
|
|
15866
16004
|
hideSpinner() {
|
|
@@ -15916,6 +16054,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
15916
16054
|
break;
|
|
15917
16055
|
case 'tab':
|
|
15918
16056
|
if (this.isPopupOpen) {
|
|
16057
|
+
e.preventDefault();
|
|
15919
16058
|
const li = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
15920
16059
|
if (li) {
|
|
15921
16060
|
this.setSelection(li, e);
|
|
@@ -15955,7 +16094,8 @@ let Mention = class Mention extends DropDownBase {
|
|
|
15955
16094
|
let startIndex = 0;
|
|
15956
16095
|
startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
|
|
15957
16096
|
index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
|
|
15958
|
-
const nextItem = isNullOrUndefined(this.activeIndex) ?
|
|
16097
|
+
const nextItem = isNullOrUndefined(this.activeIndex) ?
|
|
16098
|
+
this.liCollections[startIndex] : this.liCollections[index];
|
|
15959
16099
|
if (!isNullOrUndefined(nextItem)) {
|
|
15960
16100
|
this.setSelection(nextItem, e);
|
|
15961
16101
|
}
|
|
@@ -15980,9 +16120,14 @@ let Mention = class Mention extends DropDownBase {
|
|
|
15980
16120
|
}
|
|
15981
16121
|
let currentRange = this.getTextRange();
|
|
15982
16122
|
const lastWordRange = this.getLastLetter(currentRange);
|
|
16123
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
15983
16124
|
const Regex = new RegExp(this.mentionChar, 'g');
|
|
15984
16125
|
const charRegex = new RegExp('[a-zA-Z]', 'g');
|
|
15985
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
|
+
}
|
|
15986
16131
|
return;
|
|
15987
16132
|
}
|
|
15988
16133
|
if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
|
|
@@ -16011,7 +16156,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16011
16156
|
if (!this.isContentEditable(this.inputElement)) {
|
|
16012
16157
|
this.showPopup();
|
|
16013
16158
|
}
|
|
16014
|
-
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) {
|
|
16015
16160
|
this.showPopup();
|
|
16016
16161
|
}
|
|
16017
16162
|
}
|
|
@@ -16040,8 +16185,12 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16040
16185
|
this.searchLists(e);
|
|
16041
16186
|
}
|
|
16042
16187
|
else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
|
|
16043
|
-
this.
|
|
16188
|
+
this.searchLists(e);
|
|
16189
|
+
if (!this.isListResetted) {
|
|
16190
|
+
this.resetList(this.dataSource, this.fields);
|
|
16191
|
+
}
|
|
16044
16192
|
}
|
|
16193
|
+
this.isListResetted = false;
|
|
16045
16194
|
}
|
|
16046
16195
|
isMatchedText() {
|
|
16047
16196
|
let isMatched = false;
|
|
@@ -16074,7 +16223,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16074
16223
|
this.activeIndex = null;
|
|
16075
16224
|
const eventArgs = {
|
|
16076
16225
|
preventDefaultAction: false,
|
|
16077
|
-
text: this.
|
|
16226
|
+
text: this.queryString,
|
|
16078
16227
|
updateData: (dataSource, query, fields) => {
|
|
16079
16228
|
if (eventArgs.cancel) {
|
|
16080
16229
|
return;
|
|
@@ -16092,8 +16241,9 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16092
16241
|
}
|
|
16093
16242
|
filterAction(dataSource, query, fields) {
|
|
16094
16243
|
this.beforePopupOpen = true;
|
|
16095
|
-
if (this.queryString
|
|
16244
|
+
if (this.queryString.length >= this.minLength) {
|
|
16096
16245
|
this.resetList(dataSource, fields, query);
|
|
16246
|
+
this.isListResetted = true;
|
|
16097
16247
|
}
|
|
16098
16248
|
else {
|
|
16099
16249
|
if (this.isPopupOpen) {
|
|
@@ -16214,12 +16364,14 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16214
16364
|
}
|
|
16215
16365
|
}
|
|
16216
16366
|
else {
|
|
16217
|
-
|
|
16218
|
-
|
|
16219
|
-
|
|
16220
|
-
|
|
16221
|
-
|
|
16222
|
-
|
|
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
|
+
}
|
|
16223
16375
|
}
|
|
16224
16376
|
}
|
|
16225
16377
|
}
|
|
@@ -16231,7 +16383,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16231
16383
|
}
|
|
16232
16384
|
const textValue = text.replace(/\u00A0/g, ' ');
|
|
16233
16385
|
const words = textValue.split(/\s+/);
|
|
16234
|
-
|
|
16386
|
+
const wordCnt = words.length - 1;
|
|
16235
16387
|
return words[wordCnt].trim();
|
|
16236
16388
|
}
|
|
16237
16389
|
isContentEditable(element) {
|
|
@@ -16243,6 +16395,10 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16243
16395
|
* @returns {void}
|
|
16244
16396
|
*/
|
|
16245
16397
|
showPopup() {
|
|
16398
|
+
this.beforePopupOpen = true;
|
|
16399
|
+
if (isNullOrUndefined(this.list)) {
|
|
16400
|
+
this.initValue();
|
|
16401
|
+
}
|
|
16246
16402
|
this.renderPopup();
|
|
16247
16403
|
attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
|
|
16248
16404
|
if (this.selectedElementID == null) {
|
|
@@ -16306,18 +16462,13 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16306
16462
|
}
|
|
16307
16463
|
}
|
|
16308
16464
|
append([this.list], popupEle);
|
|
16309
|
-
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)) {
|
|
16310
16467
|
document.body.appendChild(popupEle);
|
|
16311
16468
|
}
|
|
16312
16469
|
let coordinates;
|
|
16313
16470
|
popupEle.style.visibility = 'hidden';
|
|
16314
|
-
|
|
16315
|
-
this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
|
|
16316
|
-
popupEle.style.maxHeight = formatUnit(this.popupHeight);
|
|
16317
|
-
}
|
|
16318
|
-
else {
|
|
16319
|
-
popupEle.style.height = 'auto';
|
|
16320
|
-
}
|
|
16471
|
+
this.setHeight(popupEle);
|
|
16321
16472
|
const offsetValue = 0;
|
|
16322
16473
|
const left = 0;
|
|
16323
16474
|
this.initializePopup(popupEle, offsetValue, left);
|
|
@@ -16340,6 +16491,9 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16340
16491
|
if (!eventArgs.cancel) {
|
|
16341
16492
|
this.renderReactTemplates();
|
|
16342
16493
|
this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.inputElement : null);
|
|
16494
|
+
if (isNullOrUndefined(this.getTriggerCharPosition())) {
|
|
16495
|
+
return;
|
|
16496
|
+
}
|
|
16343
16497
|
coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
|
|
16344
16498
|
if (!this.isCollided) {
|
|
16345
16499
|
popupEle.style.cssText = 'top: '.concat(coordinates.top.toString(), 'px;\n left: ').concat(coordinates.left.toString(), 'px;\nposition: absolute;\n display: block;');
|
|
@@ -16349,6 +16503,8 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16349
16503
|
this.isCollided = false;
|
|
16350
16504
|
}
|
|
16351
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();
|
|
16352
16508
|
}
|
|
16353
16509
|
else {
|
|
16354
16510
|
this.beforePopupOpen = false;
|
|
@@ -16361,6 +16517,15 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16361
16517
|
}
|
|
16362
16518
|
});
|
|
16363
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
|
+
}
|
|
16364
16529
|
checkCollision(popupEle) {
|
|
16365
16530
|
if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
|
|
16366
16531
|
const collision = isCollide(popupEle);
|
|
@@ -16440,7 +16605,9 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16440
16605
|
computed = getComputedStyle(element);
|
|
16441
16606
|
div.style.position = 'absolute';
|
|
16442
16607
|
div.style.visibility = 'hidden';
|
|
16608
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16443
16609
|
properties.forEach((prop) => {
|
|
16610
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
16444
16611
|
div.style[prop] = computed[prop];
|
|
16445
16612
|
});
|
|
16446
16613
|
div.textContent = element.value.substring(0, position);
|
|
@@ -16474,13 +16641,12 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16474
16641
|
}
|
|
16475
16642
|
else {
|
|
16476
16643
|
coordinates = {
|
|
16477
|
-
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize),
|
|
16644
|
+
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
|
|
16478
16645
|
left: rect.left + windowLeft
|
|
16479
16646
|
};
|
|
16480
16647
|
}
|
|
16481
16648
|
return coordinates;
|
|
16482
16649
|
}
|
|
16483
|
-
;
|
|
16484
16650
|
initValue() {
|
|
16485
16651
|
this.renderList();
|
|
16486
16652
|
if (this.dataSource instanceof DataManager) {
|
|
@@ -16615,7 +16781,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16615
16781
|
const nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
16616
16782
|
let nextOffset = this.list.scrollTop + nextBottom - currentOffset;
|
|
16617
16783
|
nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
|
|
16618
|
-
|
|
16784
|
+
const boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
16619
16785
|
if (this.activeIndex === 0) {
|
|
16620
16786
|
this.list.scrollTop = 0;
|
|
16621
16787
|
}
|
|
@@ -16675,8 +16841,8 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16675
16841
|
}
|
|
16676
16842
|
return items;
|
|
16677
16843
|
}
|
|
16678
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16679
16844
|
setValue(e) {
|
|
16845
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16680
16846
|
if (!this.isReact) {
|
|
16681
16847
|
if (!isNullOrUndefined(this.displayTemplate)) {
|
|
16682
16848
|
this.setDisplayTemplate();
|
|
@@ -16704,12 +16870,12 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16704
16870
|
const selection = this.inputElement.ownerDocument.getSelection();
|
|
16705
16871
|
const startPos = this.getTriggerCharPosition();
|
|
16706
16872
|
textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
|
|
16707
|
-
if (dataItem.
|
|
16873
|
+
if (dataItem.text !== null) {
|
|
16708
16874
|
value = this.mentionVal(dataItem.text);
|
|
16709
16875
|
}
|
|
16710
16876
|
if (!this.isContentEditable(this.inputElement)) {
|
|
16711
16877
|
const myField = this.inputElement;
|
|
16712
|
-
|
|
16878
|
+
const currentTriggerSnippet = this.getTextRange().substring(startPos + this.mentionChar.length, this.getTextRange().length);
|
|
16713
16879
|
value += textSuffix;
|
|
16714
16880
|
endPos = startPos + this.mentionChar.length;
|
|
16715
16881
|
endPos += currentTriggerSnippet.length;
|
|
@@ -16736,6 +16902,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16736
16902
|
const frag = document.createDocumentFragment();
|
|
16737
16903
|
let node;
|
|
16738
16904
|
let lastNode;
|
|
16905
|
+
// eslint-disable-next-line no-cond-assign
|
|
16739
16906
|
while (node = element.firstChild) {
|
|
16740
16907
|
lastNode = frag.appendChild(node);
|
|
16741
16908
|
}
|
|
@@ -16754,7 +16921,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16754
16921
|
}
|
|
16755
16922
|
}
|
|
16756
16923
|
mentionVal(value) {
|
|
16757
|
-
|
|
16924
|
+
const showChar = this.showMentionChar ? this.mentionChar : '';
|
|
16758
16925
|
if (!isNullOrUndefined(this.displayTemplate) && !isNullOrUndefined(this.displayTempElement)) {
|
|
16759
16926
|
value = this.displayTempElement.innerHTML;
|
|
16760
16927
|
}
|
|
@@ -16790,6 +16957,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16790
16957
|
this.displayTempElement.appendChild(displayCompTemp[i]);
|
|
16791
16958
|
}
|
|
16792
16959
|
}
|
|
16960
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16793
16961
|
if (!this.isReact) {
|
|
16794
16962
|
this.renderTemplates();
|
|
16795
16963
|
}
|
|
@@ -16799,6 +16967,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16799
16967
|
});
|
|
16800
16968
|
}
|
|
16801
16969
|
}
|
|
16970
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16802
16971
|
renderTemplates(callBack) {
|
|
16803
16972
|
this.renderReactTemplates(callBack);
|
|
16804
16973
|
}
|
|
@@ -16827,6 +16996,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16827
16996
|
this.spinnerTemplateElement.appendChild(spinnerCompTemp[i]);
|
|
16828
16997
|
}
|
|
16829
16998
|
}
|
|
16999
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16830
17000
|
if (!this.isReact) {
|
|
16831
17001
|
this.renderTemplates();
|
|
16832
17002
|
this.popupObj.element.appendChild(this.spinnerTemplateElement);
|
|
@@ -16921,7 +17091,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16921
17091
|
this.setHover(currentLi);
|
|
16922
17092
|
}
|
|
16923
17093
|
setHover(li) {
|
|
16924
|
-
if (this.
|
|
17094
|
+
if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
|
|
16925
17095
|
this.removeHover();
|
|
16926
17096
|
addClass([li], dropDownBaseClasses.hover);
|
|
16927
17097
|
}
|
|
@@ -16946,8 +17116,13 @@ let Mention = class Mention extends DropDownBase {
|
|
|
16946
17116
|
* @returns {void}
|
|
16947
17117
|
*/
|
|
16948
17118
|
search(text, positionX, positionY) {
|
|
16949
|
-
if (
|
|
16950
|
-
|
|
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) {
|
|
16951
17126
|
this.resetList(this.dataSource, this.fields);
|
|
16952
17127
|
}
|
|
16953
17128
|
else {
|