@syncfusion/ej2-dropdowns 20.3.60 → 20.4.40

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.
Files changed (54) hide show
  1. package/.eslintrc.json +16 -1
  2. package/CHANGELOG.md +12 -31
  3. package/dist/ej2-dropdowns.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js +2 -2
  5. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es2015.js +500 -314
  7. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  8. package/dist/es6/ej2-dropdowns.es5.js +485 -299
  9. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  10. package/dist/global/ej2-dropdowns.min.js +2 -2
  11. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +13 -12
  14. package/src/auto-complete/auto-complete-model.d.ts +1 -1
  15. package/src/combo-box/combo-box.js +7 -5
  16. package/src/drop-down-base/drop-down-base-model.d.ts +0 -18
  17. package/src/drop-down-base/drop-down-base.d.ts +0 -22
  18. package/src/drop-down-base/drop-down-base.js +42 -37
  19. package/src/drop-down-list/drop-down-list-model.d.ts +18 -0
  20. package/src/drop-down-list/drop-down-list.d.ts +22 -0
  21. package/src/drop-down-list/drop-down-list.js +95 -41
  22. package/src/drop-down-tree/drop-down-tree-model.d.ts +15 -1
  23. package/src/drop-down-tree/drop-down-tree.d.ts +13 -1
  24. package/src/drop-down-tree/drop-down-tree.js +25 -5
  25. package/src/list-box/list-box-model.d.ts +18 -0
  26. package/src/list-box/list-box.d.ts +22 -0
  27. package/src/list-box/list-box.js +38 -17
  28. package/src/mention/mention-model.d.ts +2 -2
  29. package/src/mention/mention.d.ts +4 -1
  30. package/src/mention/mention.js +66 -27
  31. package/src/multi-select/checkbox-selection.js +10 -8
  32. package/src/multi-select/multi-select.js +203 -156
  33. package/styles/bootstrap5-dark.css +2 -2
  34. package/styles/bootstrap5.css +2 -2
  35. package/styles/drop-down-base/_bootstrap-dark-definition.scss +1 -0
  36. package/styles/drop-down-base/_bootstrap-definition.scss +1 -0
  37. package/styles/drop-down-base/_bootstrap4-definition.scss +1 -0
  38. package/styles/drop-down-base/_bootstrap5-definition.scss +1 -0
  39. package/styles/drop-down-base/_fabric-dark-definition.scss +1 -0
  40. package/styles/drop-down-base/_fabric-definition.scss +1 -0
  41. package/styles/drop-down-base/_fluent-definition.scss +1 -0
  42. package/styles/drop-down-base/_fusionnew-definition.scss +1 -0
  43. package/styles/drop-down-base/_highcontrast-definition.scss +1 -0
  44. package/styles/drop-down-base/_highcontrast-light-definition.scss +1 -0
  45. package/styles/drop-down-base/_layout.scss +1 -1
  46. package/styles/drop-down-base/_material-dark-definition.scss +1 -0
  47. package/styles/drop-down-base/_material-definition.scss +1 -0
  48. package/styles/drop-down-base/_material3-definition.scss +1 -0
  49. package/styles/drop-down-base/_tailwind-definition.scss +1 -0
  50. package/styles/drop-down-base/material-dark.css +1 -1
  51. package/styles/drop-down-tree/_layout.scss +3 -3
  52. package/styles/drop-down-tree/bootstrap5-dark.css +2 -2
  53. package/styles/drop-down-tree/bootstrap5.css +2 -2
  54. package/styles/material-dark.css +1 -1
@@ -459,7 +459,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
459
459
  liElem.setAttribute('role', 'option');
460
460
  }
461
461
  else {
462
- ele.innerHTML = content;
462
+ if (!isNullOrUndefined(ele)) {
463
+ ele.innerHTML = content;
464
+ }
463
465
  }
464
466
  }
465
467
  };
@@ -490,14 +492,16 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
490
492
  * @returns {void}
491
493
  */
492
494
  DropDownBase.prototype.setEnableRtl = function () {
493
- if (this.list) {
494
- this.enableRtlElements.push(this.list);
495
- }
496
- if (this.enableRtl) {
497
- addClass(this.enableRtlElements, dropDownBaseClasses.rtl);
498
- }
499
- else {
500
- removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);
495
+ if (!isNullOrUndefined(this.enableRtlElements)) {
496
+ if (this.list) {
497
+ this.enableRtlElements.push(this.list);
498
+ }
499
+ if (this.enableRtl) {
500
+ addClass(this.enableRtlElements, dropDownBaseClasses.rtl);
501
+ }
502
+ else {
503
+ removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);
504
+ }
501
505
  }
502
506
  };
503
507
  /**
@@ -535,14 +539,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
535
539
  DropDownBase.prototype.getPersistData = function () {
536
540
  return this.addOnPersist([]);
537
541
  };
538
- /**
539
- * Sets the enabled state to DropDownBase.
540
- *
541
- * @returns {void}
542
- */
543
- DropDownBase.prototype.setEnabled = function () {
544
- this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
545
- };
546
542
  /**
547
543
  * Sets the enabled state to DropDownBase.
548
544
  *
@@ -764,7 +760,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
764
760
  this.liCollections = [];
765
761
  this.trigger('actionFailure', e);
766
762
  this.l10nUpdate(true);
767
- addClass([this.list], dropDownBaseClasses.noData);
763
+ if (!isNullOrUndefined(this.list)) {
764
+ addClass([this.list], dropDownBaseClasses.noData);
765
+ }
768
766
  };
769
767
  /* eslint-disable @typescript-eslint/no-unused-vars */
770
768
  DropDownBase.prototype.onActionComplete = function (ulElement, list, e) {
@@ -894,10 +892,12 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
894
892
  if (!isNullOrUndefined(this.list) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
895
893
  if (isNullOrUndefined(this.fixedHeaderElement)) {
896
894
  this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
897
- if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
895
+ if (!isNullOrUndefined(this.list) && !this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
898
896
  this.fixedHeaderElement.style.display = 'none';
899
897
  }
900
- prepend([this.fixedHeaderElement], this.list);
898
+ if (!isNullOrUndefined(this.fixedHeaderElement) && !isNullOrUndefined(this.list)) {
899
+ prepend([this.fixedHeaderElement], this.list);
900
+ }
901
901
  this.setFixedHeader();
902
902
  }
903
903
  if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
@@ -988,7 +988,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
988
988
  return item;
989
989
  };
990
990
  DropDownBase.prototype.setFixedHeader = function () {
991
- this.list.parentElement.style.display = 'block';
991
+ if (!isNullOrUndefined(this.list)) {
992
+ this.list.parentElement.style.display = 'block';
993
+ }
992
994
  var borderWidth = 0;
993
995
  if (this.list && this.list.parentElement) {
994
996
  borderWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-width'), 10);
@@ -1003,8 +1005,10 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1003
1005
  borderWidth = (borderTopWidth + borderBottomWidth + borderLeftWidth + borderRightWidth);
1004
1006
  }
1005
1007
  }
1006
- var liWidth = this.getValidLi().offsetWidth - borderWidth;
1007
- this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
1008
+ if (!isNullOrUndefined(this.liCollections)) {
1009
+ var liWidth = this.getValidLi().offsetWidth - borderWidth;
1010
+ this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
1011
+ }
1008
1012
  setStyleAttribute(this.fixedHeaderElement, { zIndex: 10 });
1009
1013
  var firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group + ':not(.e-hide-listitem)');
1010
1014
  this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
@@ -1148,9 +1152,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1148
1152
  case 'enableRtl':
1149
1153
  this.setEnableRtl();
1150
1154
  break;
1151
- case 'enabled':
1152
- this.setEnabled();
1153
- break;
1154
1155
  case 'groupTemplate':
1155
1156
  this.renderGroupTemplate(this.list);
1156
1157
  if (this.ulElement && this.fixedHeaderElement) {
@@ -1199,7 +1200,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1199
1200
  wrapperElement.appendChild(this.list);
1200
1201
  }
1201
1202
  this.setEnableRtl();
1202
- this.setEnabled();
1203
1203
  if (!isEmptyData) {
1204
1204
  this.initialize(e);
1205
1205
  }
@@ -1291,11 +1291,17 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1291
1291
  this.trigger('beforeItemRender', { element: li, item: item });
1292
1292
  }
1293
1293
  if (itemsCount === 0 && isNullOrUndefined(this.list.querySelector('ul'))) {
1294
- this.list.innerHTML = '';
1295
- this.list.classList.remove(dropDownBaseClasses.noData);
1296
- this.list.appendChild(this.ulElement);
1294
+ if (!isNullOrUndefined(this.list)) {
1295
+ this.list.innerHTML = '';
1296
+ this.list.classList.remove(dropDownBaseClasses.noData);
1297
+ if (!isNullOrUndefined(this.ulElement)) {
1298
+ this.list.appendChild(this.ulElement);
1299
+ }
1300
+ }
1297
1301
  this.liCollections = liCollections;
1298
- append(liCollections, this.ulElement);
1302
+ if (!isNullOrUndefined(liCollections) && !isNullOrUndefined(this.ulElement)) {
1303
+ append(liCollections, this.ulElement);
1304
+ }
1299
1305
  this.updateAddItemList(this.list, itemsCount);
1300
1306
  }
1301
1307
  else {
@@ -1416,14 +1422,16 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1416
1422
  }
1417
1423
  detach(this.list);
1418
1424
  }
1425
+ this.liCollections = null;
1426
+ this.ulElement = null;
1427
+ this.list = null;
1428
+ this.enableRtlElements = null;
1429
+ this.rippleFun = null;
1419
1430
  _super.prototype.destroy.call(this);
1420
1431
  };
1421
1432
  __decorate([
1422
1433
  Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
1423
1434
  ], DropDownBase.prototype, "fields", void 0);
1424
- __decorate([
1425
- Property(false)
1426
- ], DropDownBase.prototype, "enablePersistence", void 0);
1427
1435
  __decorate([
1428
1436
  Property(null)
1429
1437
  ], DropDownBase.prototype, "itemTemplate", void 0);
@@ -1439,9 +1447,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1439
1447
  __decorate([
1440
1448
  Property('None')
1441
1449
  ], DropDownBase.prototype, "sortOrder", void 0);
1442
- __decorate([
1443
- Property(true)
1444
- ], DropDownBase.prototype, "enabled", void 0);
1445
1450
  __decorate([
1446
1451
  Property([])
1447
1452
  ], DropDownBase.prototype, "dataSource", void 0);
@@ -1702,8 +1707,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1702
1707
  this.resetFocusElement();
1703
1708
  }
1704
1709
  }
1705
- this.hiddenElement.innerHTML = '';
1706
- this.inputElement.value = '';
1710
+ if (!isNullOrUndefined(this.hiddenElement)) {
1711
+ this.hiddenElement.innerHTML = '';
1712
+ }
1713
+ if (!isNullOrUndefined(this.inputElement)) {
1714
+ this.inputElement.value = '';
1715
+ }
1707
1716
  this.value = null;
1708
1717
  this.itemData = null;
1709
1718
  this.text = null;
@@ -1726,21 +1735,21 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1726
1735
  for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
1727
1736
  var htmlAttr = _a[_i];
1728
1737
  if (htmlAttr === 'class') {
1729
- var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
1738
+ var updatedClassValue = (this.htmlAttributes["" + htmlAttr].replace(/\s+/g, ' ')).trim();
1730
1739
  if (updatedClassValue !== '') {
1731
1740
  addClass([this.inputWrapper.container], updatedClassValue.split(' '));
1732
1741
  }
1733
1742
  }
1734
- else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {
1743
+ else if (htmlAttr === 'disabled' && this.htmlAttributes["" + htmlAttr] === 'disabled') {
1735
1744
  this.enabled = false;
1736
1745
  this.setEnable();
1737
1746
  }
1738
- else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[htmlAttr])) {
1747
+ else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes["" + htmlAttr])) {
1739
1748
  this.readonly = true;
1740
1749
  this.dataBind();
1741
1750
  }
1742
1751
  else if (htmlAttr === 'style') {
1743
- this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);
1752
+ this.inputWrapper.container.setAttribute('style', this.htmlAttributes["" + htmlAttr]);
1744
1753
  }
1745
1754
  else {
1746
1755
  var defaultAttr = ['title', 'id', 'placeholder',
@@ -1750,18 +1759,18 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1750
1759
  defaultAttr.push('tabindex');
1751
1760
  }
1752
1761
  if (validateAttr.indexOf(htmlAttr) > -1 || htmlAttr.indexOf('data') === 0) {
1753
- this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
1762
+ this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
1754
1763
  }
1755
1764
  else if (defaultAttr.indexOf(htmlAttr) > -1) {
1756
1765
  if (htmlAttr === 'placeholder') {
1757
- Input.setPlaceholder(this.htmlAttributes[htmlAttr], this.inputElement);
1766
+ Input.setPlaceholder(this.htmlAttributes["" + htmlAttr], this.inputElement);
1758
1767
  }
1759
1768
  else {
1760
- this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
1769
+ this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
1761
1770
  }
1762
1771
  }
1763
1772
  else {
1764
- this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
1773
+ this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
1765
1774
  }
1766
1775
  }
1767
1776
  }
@@ -1817,7 +1826,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1817
1826
  }
1818
1827
  };
1819
1828
  DropDownList.prototype.targetElement = function () {
1820
- return this.inputWrapper.container;
1829
+ return !isNullOrUndefined(this.inputWrapper) ? this.inputWrapper.container : null;
1821
1830
  };
1822
1831
  DropDownList.prototype.getNgDirective = function () {
1823
1832
  return 'EJS-DROPDOWNLIST';
@@ -1976,7 +1985,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1976
1985
  }
1977
1986
  };
1978
1987
  DropDownList.prototype.unBindCommonEvent = function () {
1979
- if (this.targetElement()) {
1988
+ if (!isNullOrUndefined(this.inputWrapper) && this.targetElement()) {
1980
1989
  EventHandler.remove(this.targetElement(), 'blur', this.onBlurHandler);
1981
1990
  }
1982
1991
  var formElement = this.inputElement && closest(this.inputElement, 'form');
@@ -2006,9 +2015,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2006
2015
  * @returns {void}
2007
2016
  */
2008
2017
  DropDownList.prototype.wireListEvents = function () {
2009
- EventHandler.add(this.list, 'click', this.onMouseClick, this);
2010
- EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
2011
- EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
2018
+ if (!isNullOrUndefined(this.list)) {
2019
+ EventHandler.add(this.list, 'click', this.onMouseClick, this);
2020
+ EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
2021
+ EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
2022
+ }
2012
2023
  };
2013
2024
  DropDownList.prototype.onSearch = function (e) {
2014
2025
  if (e.charCode !== 32 && e.charCode !== 13) {
@@ -2286,9 +2297,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2286
2297
  this.setSelection(previousItem, event);
2287
2298
  };
2288
2299
  DropDownList.prototype.unWireEvent = function () {
2289
- EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
2290
- EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
2291
- EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
2300
+ if (!isNullOrUndefined(this.inputWrapper)) {
2301
+ EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
2302
+ EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
2303
+ EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
2304
+ }
2292
2305
  this.unBindCommonEvent();
2293
2306
  };
2294
2307
  /**
@@ -2297,9 +2310,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2297
2310
  * @returns {void}
2298
2311
  */
2299
2312
  DropDownList.prototype.unWireListEvents = function () {
2300
- EventHandler.remove(this.list, 'click', this.onMouseClick);
2301
- EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
2302
- EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
2313
+ if (this.list) {
2314
+ EventHandler.remove(this.list, 'click', this.onMouseClick);
2315
+ EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
2316
+ EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
2317
+ }
2303
2318
  };
2304
2319
  DropDownList.prototype.checkSelector = function (id) {
2305
2320
  return '[id="' + id.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g, '\\$1') + '"]';
@@ -2307,7 +2322,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2307
2322
  DropDownList.prototype.onDocumentClick = function (e) {
2308
2323
  var target = e.target;
2309
2324
  if (!(!isNullOrUndefined(this.popupObj) && closest(target, this.checkSelector(this.popupObj.element.id))) &&
2310
- !this.inputWrapper.container.contains(e.target)) {
2325
+ !isNullOrUndefined(this.inputWrapper) && !this.inputWrapper.container.contains(e.target)) {
2311
2326
  if (this.inputWrapper.container.classList.contains(dropDownListClasses.inputFocus) || this.isPopupOpen) {
2312
2327
  this.isDocumentClick = true;
2313
2328
  var isActive = this.isRequested;
@@ -2505,9 +2520,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2505
2520
  this.setScrollPosition(e);
2506
2521
  }
2507
2522
  if (Browser.info.name !== 'mozilla') {
2508
- attributes(this.targetElement(), { 'aria-label': this.inputElement.value });
2509
- attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
2510
- this.targetElement().removeAttribute('aria-live');
2523
+ attributes(this.inputElement, { 'aria-label': this.inputElement.value });
2524
+ if (this.targetElement()) {
2525
+ attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
2526
+ this.targetElement().removeAttribute('aria-live');
2527
+ }
2511
2528
  }
2512
2529
  if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
2513
2530
  attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
@@ -2678,9 +2695,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2678
2695
  selectedElement.setAttribute('value', this.value.toString());
2679
2696
  }
2680
2697
  else {
2681
- this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
2682
- var selectedElement = this.hiddenElement.querySelector('option');
2683
- selectedElement.setAttribute('value', this.value.toString());
2698
+ if (!isNullOrUndefined(this.hiddenElement)) {
2699
+ this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
2700
+ var selectedElement = this.hiddenElement.querySelector('option');
2701
+ selectedElement.setAttribute('value', this.value.toString());
2702
+ }
2684
2703
  }
2685
2704
  }
2686
2705
  else {
@@ -3019,7 +3038,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3019
3038
  && ((this.dataSource instanceof DataManager)
3020
3039
  || (!isNullOrUndefined(this.dataSource) && !isNullOrUndefined(this.dataSource.length) &&
3021
3040
  this.dataSource.length !== 0)))) {
3022
- if (this.itemTemplate && (this.element.tagName === 'EJS-COMBOBOX' || this.element.tagName === 'EJS-DROPDOWNLIST') && this.allowFiltering) {
3041
+ if (this.itemTemplate && this.element.tagName === 'EJS-COMBOBOX' && this.allowFiltering) {
3023
3042
  setTimeout(function () {
3024
3043
  _this.updateActionCompleteDataValues(ulElement, list);
3025
3044
  }, 0);
@@ -3170,9 +3189,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3170
3189
  (_this.isDropDownClick && _this.getModuleName() === 'combobox')))) {
3171
3190
  offsetValue = _this.getOffsetValue(popupEle);
3172
3191
  var firstItem = _this.isEmptyList() ? _this.list : _this.liCollections[0];
3173
- left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
3174
- parseInt(getComputedStyle(_this.inputElement).paddingLeft, 10) +
3175
- parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
3192
+ if (!isNullOrUndefined(_this.inputElement)) {
3193
+ left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
3194
+ parseInt(getComputedStyle(_this.inputElement).paddingLeft, 10) +
3195
+ parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
3196
+ }
3176
3197
  }
3177
3198
  _this.getFocusElement();
3178
3199
  _this.createPopup(popupEle, offsetValue, left);
@@ -3218,9 +3239,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3218
3239
  var eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
3219
3240
  _this.trigger('open', eventArgs, function (eventArgs) {
3220
3241
  if (!eventArgs.cancel) {
3221
- addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
3242
+ if (!isNullOrUndefined(_this.inputWrapper)) {
3243
+ addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
3244
+ }
3222
3245
  _this.renderReactTemplates();
3223
- _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);
3246
+ if (!isNullOrUndefined(_this.popupObj)) {
3247
+ _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);
3248
+ }
3224
3249
  }
3225
3250
  else {
3226
3251
  _this.beforePopupOpen = false;
@@ -3479,11 +3504,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3479
3504
  EventHandler.remove(this.backIconElement, 'click', this.clickOnBackIcon);
3480
3505
  EventHandler.remove(this.clearIconElement, 'click', this.clearText);
3481
3506
  }
3482
- EventHandler.remove(this.filterInput, 'input', this.onInput);
3483
- EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);
3484
- EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);
3485
- EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
3486
- EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
3507
+ if (!isNullOrUndefined(this.filterInput)) {
3508
+ EventHandler.remove(this.filterInput, 'input', this.onInput);
3509
+ EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);
3510
+ EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);
3511
+ EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
3512
+ EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
3513
+ }
3487
3514
  this.filterInput = null;
3488
3515
  }
3489
3516
  attributes(this.targetElement(), { 'aria-expanded': 'false' });
@@ -3618,6 +3645,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3618
3645
  this.text = isNullOrUndefined(this.value) ? null : selectElement.options[selectElement.selectedIndex].textContent;
3619
3646
  this.initValue();
3620
3647
  }
3648
+ this.setEnabled();
3621
3649
  this.preventTabIndex(this.element);
3622
3650
  if (!this.enabled) {
3623
3651
  this.targetElement().tabIndex = -1;
@@ -3702,6 +3730,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3702
3730
  var contentEle = popupEle.querySelector('div.e-content');
3703
3731
  popupEle.insertBefore(this.header, contentEle);
3704
3732
  };
3733
+ /**
3734
+ * Sets the enabled state to DropDownBase.
3735
+ *
3736
+ * @returns {void}
3737
+ */
3738
+ DropDownList.prototype.setEnabled = function () {
3739
+ this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
3740
+ };
3705
3741
  DropDownList.prototype.setOldText = function (text) {
3706
3742
  this.text = text;
3707
3743
  };
@@ -4077,7 +4113,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4077
4113
  };
4078
4114
  history.pushState({}, '');
4079
4115
  }
4080
- if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
4116
+ if (!isNullOrUndefined(this.list) && (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData))) {
4081
4117
  this.renderPopup(e);
4082
4118
  }
4083
4119
  };
@@ -4093,7 +4129,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4093
4129
  DropDownList.prototype.hidePopup = function (e) {
4094
4130
  /* eslint-enable valid-jsdoc, jsdoc/require-param */
4095
4131
  if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
4096
- Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
4132
+ if (!isNullOrUndefined(this.inputElement)) {
4133
+ Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
4134
+ }
4097
4135
  this.isEscapeKey = false;
4098
4136
  if (!isNullOrUndefined(this.index)) {
4099
4137
  var element = this.findListElement(this.ulElement, 'li', 'data-value', this.value);
@@ -4203,6 +4241,21 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4203
4241
  this.inputWrapper.container.parentElement.insertBefore(this.element, this.inputWrapper.container);
4204
4242
  detach(this.inputWrapper.container);
4205
4243
  }
4244
+ this.hiddenElement = null;
4245
+ this.inputWrapper = null;
4246
+ this.keyboardModule = null;
4247
+ this.ulElement = null;
4248
+ this.list = null;
4249
+ this.popupObj = null;
4250
+ this.rippleFun = null;
4251
+ this.selectedLI = null;
4252
+ this.liCollections = null;
4253
+ this.item = null;
4254
+ this.inputWrapper = null;
4255
+ this.footer = null;
4256
+ this.header = null;
4257
+ this.previousSelectedLI = null;
4258
+ this.valueTempElement = null;
4206
4259
  _super.prototype.destroy.call(this);
4207
4260
  };
4208
4261
  /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
@@ -4244,6 +4297,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4244
4297
  __decorate$1([
4245
4298
  Property('100%')
4246
4299
  ], DropDownList.prototype, "width", void 0);
4300
+ __decorate$1([
4301
+ Property(true)
4302
+ ], DropDownList.prototype, "enabled", void 0);
4303
+ __decorate$1([
4304
+ Property(false)
4305
+ ], DropDownList.prototype, "enablePersistence", void 0);
4247
4306
  __decorate$1([
4248
4307
  Property('300px')
4249
4308
  ], DropDownList.prototype, "popupHeight", void 0);
@@ -4423,6 +4482,9 @@ var Fields = /** @__PURE__ @class */ (function (_super) {
4423
4482
  __decorate$2([
4424
4483
  Property(null)
4425
4484
  ], Fields.prototype, "query", void 0);
4485
+ __decorate$2([
4486
+ Property('selectable')
4487
+ ], Fields.prototype, "selectable", void 0);
4426
4488
  __decorate$2([
4427
4489
  Property('selected')
4428
4490
  ], Fields.prototype, "selected", void 0);
@@ -5232,7 +5294,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5232
5294
  temp = this.getOverflowVal(index);
5233
5295
  data += temp;
5234
5296
  temp = this.overFlowWrapper.innerHTML;
5235
- this.overFlowWrapper.innerHTML = data;
5297
+ if (this.enableHtmlSanitizer) {
5298
+ this.overFlowWrapper.innerText = data;
5299
+ }
5300
+ else {
5301
+ this.overFlowWrapper.innerHTML = data;
5302
+ }
5236
5303
  wrapperleng = this.overFlowWrapper.offsetWidth;
5237
5304
  overAllContainer = this.inputWrapper.offsetWidth;
5238
5305
  if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
@@ -5764,6 +5831,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5764
5831
  nodeClicked: this.onNodeClicked.bind(this),
5765
5832
  dataBound: this.OnDataBound.bind(this),
5766
5833
  allowMultiSelection: this.allowMultiSelection,
5834
+ enableHtmlSanitizer: this.enableHtmlSanitizer,
5767
5835
  showCheckBox: this.showCheckBox,
5768
5836
  autoCheck: this.treeSettings.autoCheck,
5769
5837
  sortOrder: this.sortOrder,
@@ -5989,6 +6057,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5989
6057
  }
5990
6058
  var eventArgs = { data: args.data };
5991
6059
  this.trigger('dataBound', eventArgs);
6060
+ if (this.filterObj === null) {
6061
+ this.isFilteredData = false;
6062
+ }
5992
6063
  if (this.isFilteredData) {
5993
6064
  this.treeObj.expandAll();
5994
6065
  }
@@ -6056,7 +6127,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6056
6127
  dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
6057
6128
  child: this.cloneChildField(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
6058
6129
  iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes, query: fields.query,
6059
- selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
6130
+ selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
6060
6131
  };
6061
6132
  return clonedField;
6062
6133
  };
@@ -6069,7 +6140,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6069
6140
  dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
6070
6141
  child: (fields.child ? this.cloneChildField(fields.child) : null), hasChildren: fields.hasChildren,
6071
6142
  expanded: fields.expanded, iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes,
6072
- query: fields.query, selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
6143
+ query: fields.query, selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
6073
6144
  };
6074
6145
  return clonedField;
6075
6146
  }
@@ -6079,7 +6150,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6079
6150
  dataSource: fields.dataSource, id: fields.value, text: fields.text, parentID: fields.parentValue,
6080
6151
  child: this.getTreeChildren(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
6081
6152
  iconCss: fields.iconCss, imageUrl: fields.imageUrl, isChecked: fields.selected,
6082
- htmlAttributes: fields.htmlAttributes, query: fields.query, selected: fields.selected,
6153
+ htmlAttributes: fields.htmlAttributes, query: fields.query, selectable: fields.selectable, selected: fields.selected,
6083
6154
  tableName: fields.tableName, tooltip: fields.tooltip
6084
6155
  };
6085
6156
  return treeFields;
@@ -6574,7 +6645,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6574
6645
  });
6575
6646
  var chipContent = this.createElement('span', { className: CHIP_CONTENT });
6576
6647
  var chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
6577
- chipContent.innerHTML = text;
6648
+ if (this.enableHtmlSanitizer) {
6649
+ chipContent.innerText = text;
6650
+ }
6651
+ else {
6652
+ chipContent.innerHTML = text;
6653
+ }
6578
6654
  chip.appendChild(chipContent);
6579
6655
  this.chipCollection.appendChild(chip);
6580
6656
  if (this.showClearButton) {
@@ -7396,6 +7472,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
7396
7472
  __decorate$2([
7397
7473
  Property(false)
7398
7474
  ], DropDownTree.prototype, "showCheckBox", void 0);
7475
+ __decorate$2([
7476
+ Property(false)
7477
+ ], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
7399
7478
  __decorate$2([
7400
7479
  Property(true)
7401
7480
  ], DropDownTree.prototype, "showClearButton", void 0);
@@ -7697,7 +7776,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7697
7776
  };
7698
7777
  ComboBox.prototype.getFocusElement = function () {
7699
7778
  var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
7700
- var selected = this.list.querySelector('.' + dropDownListClasses.selected);
7779
+ var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
7701
7780
  var isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
7702
7781
  if (isSelected) {
7703
7782
  return selected;
@@ -7857,9 +7936,11 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7857
7936
  }
7858
7937
  else if (this.inputElement.value === '') {
7859
7938
  this.activeIndex = null;
7860
- this.list.scrollTop = 0;
7861
- var focusItem = this.list.querySelector('.' + dropDownListClasses.li);
7862
- this.setHoverList(focusItem);
7939
+ if (!isNullOrUndefined(this.list)) {
7940
+ this.list.scrollTop = 0;
7941
+ var focusItem = this.list.querySelector('.' + dropDownListClasses.li);
7942
+ this.setHoverList(focusItem);
7943
+ }
7863
7944
  }
7864
7945
  else {
7865
7946
  this.activeIndex = null;
@@ -8158,7 +8239,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
8158
8239
  this.removeFillSelection();
8159
8240
  }
8160
8241
  var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
8161
- var selected = this.list.querySelector('.' + dropDownListClasses.selected);
8242
+ var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : null;
8162
8243
  if (this.inputElement && dataItem.text === this.inputElement.value && !isNullOrUndefined(selected)) {
8163
8244
  if (this.isSelected) {
8164
8245
  this.onChangeEvent(e);
@@ -9052,7 +9133,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9052
9133
  var htmlAttr = _a[_i];
9053
9134
  switch (htmlAttr) {
9054
9135
  case 'class': {
9055
- var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
9136
+ var updatedClassValue = (this.htmlAttributes["" + htmlAttr].replace(/\s+/g, ' ')).trim();
9056
9137
  if (updatedClassValue !== '') {
9057
9138
  addClass([this.overAllWrapper], updatedClassValue.split(' '));
9058
9139
  addClass([this.popupWrapper], updatedClassValue.split(' '));
@@ -9064,7 +9145,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9064
9145
  break;
9065
9146
  case 'placeholder':
9066
9147
  if (!this.placeholder) {
9067
- this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9148
+ this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
9068
9149
  this.setProperties({ placeholder: this.inputElement.placeholder }, true);
9069
9150
  this.refreshPlaceHolder();
9070
9151
  }
@@ -9074,16 +9155,16 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9074
9155
  var validateAttr = ['name', 'required', 'aria-required', 'form'];
9075
9156
  var containerAttr = ['title', 'role', 'style', 'class'];
9076
9157
  if (defaultAttr.indexOf(htmlAttr) > -1) {
9077
- this.element.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9158
+ this.element.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
9078
9159
  }
9079
9160
  else if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
9080
- this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9161
+ this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
9081
9162
  }
9082
9163
  else if (containerAttr.indexOf(htmlAttr) > -1) {
9083
- this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9164
+ this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
9084
9165
  }
9085
- else if (htmlAttr !== 'size') {
9086
- this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9166
+ else if (htmlAttr !== 'size' && !isNullOrUndefined(this.inputElement)) {
9167
+ this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
9087
9168
  }
9088
9169
  break;
9089
9170
  }
@@ -9092,11 +9173,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9092
9173
  }
9093
9174
  };
9094
9175
  MultiSelect.prototype.updateReadonly = function (state) {
9095
- if (state || this.mode === 'CheckBox') {
9096
- this.inputElement.setAttribute('readonly', 'true');
9097
- }
9098
- else {
9099
- this.inputElement.removeAttribute('readonly');
9176
+ if (!isNullOrUndefined(this.inputElement)) {
9177
+ if (state || this.mode === 'CheckBox') {
9178
+ this.inputElement.setAttribute('readonly', 'true');
9179
+ }
9180
+ else {
9181
+ this.inputElement.removeAttribute('readonly');
9182
+ }
9100
9183
  }
9101
9184
  };
9102
9185
  MultiSelect.prototype.updateClearButton = function (state) {
@@ -9239,8 +9322,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9239
9322
  if (!isNullOrUndefined(this.ulElement)) {
9240
9323
  attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
9241
9324
  }
9242
- var disableStatus = (this.inputElement.disabled) ? true : false;
9243
- if (!this.isPopupOpen()) {
9325
+ var disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
9326
+ if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
9244
9327
  attributes(this.inputElement, this.getAriaAttributes());
9245
9328
  }
9246
9329
  if (disableStatus) {
@@ -9350,7 +9433,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9350
9433
  this.checkForCustomValue(this.tempQuery, this.fields);
9351
9434
  return;
9352
9435
  }
9353
- if (this.value && this.value.length && ((this.mode !== 'CheckBox' && this.inputElement.value.trim() !== '') ||
9436
+ if (this.value && this.value.length && ((this.mode !== 'CheckBox' && !isNullOrUndefined(this.inputElement) && this.inputElement.value.trim() !== '') ||
9354
9437
  this.mode === 'CheckBox' || ((this.keyCode === 8 || this.keyCode === 46) && this.allowFiltering &&
9355
9438
  this.allowCustomValue && this.dataSource instanceof DataManager && this.inputElement.value === ''))) {
9356
9439
  this.refreshSelection();
@@ -9420,8 +9503,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9420
9503
  }
9421
9504
  element.setAttribute('aria-selected', 'true');
9422
9505
  if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
9423
- var ariaValue = element.firstElementChild.getAttribute('aria-checked');
9424
- if (isNullOrUndefined(ariaValue) || ariaValue === 'false') {
9506
+ var ariaValue = element.getElementsByClassName('e-check').length;
9507
+ if (ariaValue === 0) {
9425
9508
  var args = {
9426
9509
  module: 'CheckBoxSelection',
9427
9510
  enable: this.mode === 'CheckBox',
@@ -9814,11 +9897,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9814
9897
  }
9815
9898
  };
9816
9899
  MultiSelect.prototype.refreshInputHight = function () {
9817
- if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {
9818
- this.searchWrapper.classList.remove(ZERO_SIZE);
9819
- }
9820
- else {
9821
- this.searchWrapper.classList.add(ZERO_SIZE);
9900
+ if (!isNullOrUndefined(this.searchWrapper)) {
9901
+ if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {
9902
+ this.searchWrapper.classList.remove(ZERO_SIZE);
9903
+ }
9904
+ else {
9905
+ this.searchWrapper.classList.add(ZERO_SIZE);
9906
+ }
9822
9907
  }
9823
9908
  };
9824
9909
  MultiSelect.prototype.validateValues = function (newValue, oldValue) {
@@ -10619,7 +10704,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10619
10704
  HIDE_LIST :
10620
10705
  dropDownBaseClasses.selected);
10621
10706
  if (this.mode === 'CheckBox') {
10622
- element2.firstElementChild.setAttribute('aria-checked', 'false');
10623
10707
  removeClass([element2.firstElementChild.lastElementChild], 'e-check');
10624
10708
  }
10625
10709
  }
@@ -10629,7 +10713,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10629
10713
  HIDE_LIST :
10630
10714
  dropDownBaseClasses.selected);
10631
10715
  if (this.mode === 'CheckBox') {
10632
- element2.firstElementChild.setAttribute('aria-checked', 'true');
10633
10716
  addClass([element2.firstElementChild.lastElementChild], 'e-check');
10634
10717
  }
10635
10718
  }
@@ -10890,109 +10973,111 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10890
10973
  _super.prototype.render.call(this);
10891
10974
  }
10892
10975
  if (!this.popupObj) {
10893
- document.body.appendChild(this.popupWrapper);
10894
- var checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
10895
- if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
10896
- checkboxFilter.remove();
10897
- this.filterParent = null;
10898
- }
10899
- var overAllHeight = parseInt(this.popupHeight, 10);
10900
- this.popupWrapper.style.visibility = 'hidden';
10901
- if (this.headerTemplate) {
10902
- this.setHeaderTemplate();
10903
- overAllHeight -= this.header.offsetHeight;
10904
- }
10905
- append([this.list], this.popupWrapper);
10906
- if (this.footerTemplate) {
10907
- this.setFooterTemplate();
10908
- overAllHeight -= this.footer.offsetHeight;
10909
- }
10910
- if (this.mode === 'CheckBox' && this.showSelectAll) {
10911
- this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10912
- overAllHeight -= this.selectAllHeight;
10913
- }
10914
- else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
10915
- this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10916
- overAllHeight = parseInt(this.popupHeight, 10);
10917
- }
10918
- else if (this.mode === 'CheckBox' && !this.showSelectAll) {
10919
- this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10920
- overAllHeight = parseInt(this.popupHeight, 10);
10921
- if (this.headerTemplate && this.header) {
10976
+ if (!isNullOrUndefined(this.popupWrapper)) {
10977
+ document.body.appendChild(this.popupWrapper);
10978
+ var checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
10979
+ if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
10980
+ checkboxFilter.remove();
10981
+ this.filterParent = null;
10982
+ }
10983
+ var overAllHeight = parseInt(this.popupHeight, 10);
10984
+ this.popupWrapper.style.visibility = 'hidden';
10985
+ if (this.headerTemplate) {
10986
+ this.setHeaderTemplate();
10922
10987
  overAllHeight -= this.header.offsetHeight;
10923
10988
  }
10924
- if (this.footerTemplate && this.footer) {
10989
+ append([this.list], this.popupWrapper);
10990
+ if (this.footerTemplate) {
10991
+ this.setFooterTemplate();
10925
10992
  overAllHeight -= this.footer.offsetHeight;
10926
10993
  }
10927
- }
10928
- if (this.mode === 'CheckBox') {
10929
- var args = {
10930
- module: 'CheckBoxSelection',
10931
- enable: this.mode === 'CheckBox',
10932
- popupElement: this.popupWrapper
10933
- };
10934
- if (this.allowFiltering) {
10935
- this.notify('searchBox', args);
10936
- overAllHeight -= this.searchBoxHeight;
10994
+ if (this.mode === 'CheckBox' && this.showSelectAll) {
10995
+ this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10996
+ overAllHeight -= this.selectAllHeight;
10937
10997
  }
10938
- addClass([this.popupWrapper], 'e-checkbox');
10939
- }
10940
- if (this.popupHeight !== 'auto') {
10941
- this.list.style.maxHeight = formatUnit(overAllHeight);
10942
- this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
10943
- }
10944
- else {
10945
- this.list.style.maxHeight = formatUnit(this.popupHeight);
10946
- }
10947
- this.popupObj = new Popup(this.popupWrapper, {
10948
- width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
10949
- relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
10950
- enableRtl: this.enableRtl, zIndex: this.zIndex,
10951
- close: function () {
10952
- if (_this.popupObj.element.parentElement) {
10953
- _this.popupObj.unwireScrollEvents();
10954
- // For restrict the page scrolling in safari browser
10955
- var checkboxFilterInput = _this.popupWrapper.querySelector('.' + FILTERINPUT);
10956
- if (_this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
10957
- checkboxFilterInput.blur();
10958
- }
10959
- detach(_this.popupObj.element);
10960
- }
10961
- },
10962
- open: function () {
10963
- _this.popupObj.resolveCollision();
10964
- if (!_this.isFirstClick) {
10965
- var ulElement = _this.list.querySelector('ul');
10966
- if (ulElement) {
10967
- if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
10968
- _this.targetElement().trim() !== '')) {
10969
- _this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
10970
- }
10971
- }
10972
- _this.isFirstClick = true;
10998
+ else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
10999
+ this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
11000
+ overAllHeight = parseInt(this.popupHeight, 10);
11001
+ }
11002
+ else if (this.mode === 'CheckBox' && !this.showSelectAll) {
11003
+ this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
11004
+ overAllHeight = parseInt(this.popupHeight, 10);
11005
+ if (this.headerTemplate && this.header) {
11006
+ overAllHeight -= this.header.offsetHeight;
10973
11007
  }
10974
- _this.popupObj.wireScrollEvents();
10975
- if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
10976
- _this.targetElement().trim() !== '')) {
10977
- _this.loadTemplate();
11008
+ if (this.footerTemplate && this.footer) {
11009
+ overAllHeight -= this.footer.offsetHeight;
10978
11010
  }
10979
- _this.setScrollPosition();
10980
- if (_this.allowFiltering) {
10981
- _this.notify('inputFocus', {
10982
- module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'focus'
10983
- });
11011
+ }
11012
+ if (this.mode === 'CheckBox') {
11013
+ var args = {
11014
+ module: 'CheckBoxSelection',
11015
+ enable: this.mode === 'CheckBox',
11016
+ popupElement: this.popupWrapper
11017
+ };
11018
+ if (this.allowFiltering) {
11019
+ this.notify('searchBox', args);
11020
+ overAllHeight -= this.searchBoxHeight;
10984
11021
  }
10985
- }, targetExitViewport: function () {
10986
- if (!Browser.isDevice) {
10987
- _this.hidePopup();
11022
+ addClass([this.popupWrapper], 'e-checkbox');
11023
+ }
11024
+ if (this.popupHeight !== 'auto') {
11025
+ this.list.style.maxHeight = formatUnit(overAllHeight);
11026
+ this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
11027
+ }
11028
+ else {
11029
+ this.list.style.maxHeight = formatUnit(this.popupHeight);
11030
+ }
11031
+ this.popupObj = new Popup(this.popupWrapper, {
11032
+ width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
11033
+ relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
11034
+ enableRtl: this.enableRtl, zIndex: this.zIndex,
11035
+ close: function () {
11036
+ if (_this.popupObj.element.parentElement) {
11037
+ _this.popupObj.unwireScrollEvents();
11038
+ // For restrict the page scrolling in safari browser
11039
+ var checkboxFilterInput = _this.popupWrapper.querySelector('.' + FILTERINPUT);
11040
+ if (_this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
11041
+ checkboxFilterInput.blur();
11042
+ }
11043
+ detach(_this.popupObj.element);
11044
+ }
11045
+ },
11046
+ open: function () {
11047
+ _this.popupObj.resolveCollision();
11048
+ if (!_this.isFirstClick) {
11049
+ var ulElement = _this.list.querySelector('ul');
11050
+ if (ulElement) {
11051
+ if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
11052
+ _this.targetElement().trim() !== '')) {
11053
+ _this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
11054
+ }
11055
+ }
11056
+ _this.isFirstClick = true;
11057
+ }
11058
+ _this.popupObj.wireScrollEvents();
11059
+ if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
11060
+ _this.targetElement().trim() !== '')) {
11061
+ _this.loadTemplate();
11062
+ }
11063
+ _this.setScrollPosition();
11064
+ if (_this.allowFiltering) {
11065
+ _this.notify('inputFocus', {
11066
+ module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'focus'
11067
+ });
11068
+ }
11069
+ }, targetExitViewport: function () {
11070
+ if (!Browser.isDevice) {
11071
+ _this.hidePopup();
11072
+ }
10988
11073
  }
11074
+ });
11075
+ if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
11076
+ this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10989
11077
  }
10990
- });
10991
- if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
10992
- this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
11078
+ this.popupObj.close();
11079
+ this.popupWrapper.style.visibility = '';
10993
11080
  }
10994
- this.popupObj.close();
10995
- this.popupWrapper.style.visibility = '';
10996
11081
  }
10997
11082
  };
10998
11083
  MultiSelect.prototype.setHeaderTemplate = function () {
@@ -11255,7 +11340,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11255
11340
  var temp;
11256
11341
  var tempData = this.listData;
11257
11342
  this.listData = this.mainData;
11258
- this.hiddenElement.innerHTML = '';
11343
+ if (!isNullOrUndefined(this.hiddenElement)) {
11344
+ this.hiddenElement.innerHTML = '';
11345
+ }
11259
11346
  if (!isNullOrUndefined(this.value)) {
11260
11347
  for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
11261
11348
  var listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
@@ -11273,7 +11360,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11273
11360
  data += temp + delimiterChar + ' ';
11274
11361
  text.push(temp);
11275
11362
  }
11276
- this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
11363
+ if (!isNullOrUndefined(this.hiddenElement)) {
11364
+ this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
11365
+ }
11277
11366
  }
11278
11367
  }
11279
11368
  this.setProperties({ text: text.toString() }, true);
@@ -11485,10 +11574,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11485
11574
  selectItems[temp1 - 1].setAttribute('aria-selected', 'false');
11486
11575
  if (this.mode === 'CheckBox') {
11487
11576
  if (selectedItems && (selectedItems.length > (temp1 - 1))) {
11488
- selectedItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
11489
11577
  removeClass([selectedItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
11490
11578
  }
11491
- selectItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
11492
11579
  removeClass([selectItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
11493
11580
  }
11494
11581
  temp1--;
@@ -11546,9 +11633,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11546
11633
  addClass([element], className);
11547
11634
  this.updateMainList(false, element.getAttribute('data-value'), mainElement);
11548
11635
  element.setAttribute('aria-selected', 'true');
11549
- if (this.mode === 'CheckBox') {
11550
- var ariaCheck = element.firstElementChild.getAttribute('aria-checked');
11551
- if (ariaCheck === 'false' || isNullOrUndefined(ariaCheck)) {
11636
+ if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
11637
+ var ariaCheck = element.getElementsByClassName('e-check').length;
11638
+ if (ariaCheck === 0) {
11552
11639
  this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });
11553
11640
  }
11554
11641
  }
@@ -11867,9 +11954,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11867
11954
  if (this.chipCollectionWrapper) {
11868
11955
  this.chipCollectionWrapper.style.display = 'none';
11869
11956
  }
11870
- this.viewWrapper.style.display = '';
11871
- this.viewWrapper.style.width = '';
11872
- this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
11957
+ if (!isNullOrUndefined(this.viewWrapper)) {
11958
+ this.viewWrapper.style.display = '';
11959
+ this.viewWrapper.style.width = '';
11960
+ this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
11961
+ }
11873
11962
  if (this.value && this.value.length) {
11874
11963
  var data = '';
11875
11964
  var temp = void 0;
@@ -11957,8 +12046,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11957
12046
  }
11958
12047
  }
11959
12048
  else {
11960
- this.viewWrapper.innerHTML = '';
11961
- this.viewWrapper.style.display = 'none';
12049
+ if (!isNullOrUndefined(this.viewWrapper)) {
12050
+ this.viewWrapper.innerHTML = '';
12051
+ this.viewWrapper.style.display = 'none';
12052
+ }
11962
12053
  }
11963
12054
  };
11964
12055
  MultiSelect.prototype.checkClearIconWidth = function () {
@@ -12031,29 +12122,41 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12031
12122
  return temp;
12032
12123
  };
12033
12124
  MultiSelect.prototype.unWireEvent = function () {
12034
- EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
12125
+ if (!isNullOrUndefined(this.componentWrapper)) {
12126
+ EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
12127
+ }
12035
12128
  EventHandler.remove(window, 'resize', this.windowResize);
12036
- EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
12037
- EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
12038
- if (this.mode !== 'CheckBox') {
12039
- EventHandler.remove(this.inputElement, 'input', this.onInput);
12129
+ if (!isNullOrUndefined(this.inputElement)) {
12130
+ EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
12131
+ EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
12132
+ if (this.mode !== 'CheckBox') {
12133
+ EventHandler.remove(this.inputElement, 'input', this.onInput);
12134
+ }
12135
+ EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
12136
+ var formElement = closest(this.inputElement, 'form');
12137
+ if (formElement) {
12138
+ EventHandler.remove(formElement, 'reset', this.resetValueHandler);
12139
+ }
12140
+ EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
12040
12141
  }
12041
- EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
12042
- var formElement = closest(this.inputElement, 'form');
12043
- if (formElement) {
12044
- EventHandler.remove(formElement, 'reset', this.resetValueHandler);
12142
+ if (!isNullOrUndefined(this.componentWrapper)) {
12143
+ EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
12144
+ EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
12145
+ }
12146
+ if (!isNullOrUndefined(this.overAllClear)) {
12147
+ EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
12148
+ }
12149
+ if (!isNullOrUndefined(this.inputElement)) {
12150
+ EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
12045
12151
  }
12046
- EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
12047
- EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
12048
- EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
12049
- EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
12050
- EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
12051
12152
  };
12052
12153
  MultiSelect.prototype.selectAllItem = function (state, event, list) {
12053
12154
  var li;
12054
- li = this.list.querySelectorAll(state ?
12055
- 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
12056
- 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
12155
+ if (!isNullOrUndefined(this.list)) {
12156
+ li = this.list.querySelectorAll(state ?
12157
+ 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
12158
+ 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
12159
+ }
12057
12160
  if (this.value && this.value.length && event && event.target
12058
12161
  && closest(event.target, '.e-close-hooker') && this.allowFiltering) {
12059
12162
  li = this.mainList.querySelectorAll(state ?
@@ -12866,11 +12969,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12866
12969
  }
12867
12970
  };
12868
12971
  MultiSelect.prototype.addValidInputClass = function () {
12869
- if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {
12870
- addClass([this.overAllWrapper], 'e-valid-input');
12871
- }
12872
- else {
12873
- removeClass([this.overAllWrapper], 'e-valid-input');
12972
+ if (!isNullOrUndefined(this.overAllWrapper)) {
12973
+ if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {
12974
+ addClass([this.overAllWrapper], 'e-valid-input');
12975
+ }
12976
+ else {
12977
+ removeClass([this.overAllWrapper], 'e-valid-input');
12978
+ }
12874
12979
  }
12875
12980
  };
12876
12981
  MultiSelect.prototype.dropDownIcon = function () {
@@ -12923,13 +13028,17 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12923
13028
  _super.prototype.destroy.call(this);
12924
13029
  var temp = ['readonly', 'aria-disabled', 'placeholder'];
12925
13030
  var length = temp.length;
12926
- while (length > 0) {
12927
- this.inputElement.removeAttribute(temp[length - 1]);
12928
- length--;
13031
+ if (!isNullOrUndefined(this.inputElement)) {
13032
+ while (length > 0) {
13033
+ this.inputElement.removeAttribute(temp[length - 1]);
13034
+ length--;
13035
+ }
12929
13036
  }
12930
- this.element.removeAttribute('data-initial-value');
12931
- this.element.style.display = 'block';
12932
- if (this.overAllWrapper.parentElement) {
13037
+ if (!isNullOrUndefined(this.element)) {
13038
+ this.element.removeAttribute('data-initial-value');
13039
+ this.element.style.display = 'block';
13040
+ }
13041
+ if (this.overAllWrapper && this.overAllWrapper.parentElement) {
12933
13042
  if (this.overAllWrapper.parentElement.tagName === this.getNgDirective()) {
12934
13043
  remove(this.overAllWrapper);
12935
13044
  }
@@ -12938,6 +13047,25 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12938
13047
  remove(this.overAllWrapper);
12939
13048
  }
12940
13049
  }
13050
+ this.componentWrapper = null;
13051
+ this.overAllClear = null;
13052
+ this.overAllWrapper = null;
13053
+ this.hiddenElement = null;
13054
+ this.searchWrapper = null;
13055
+ this.viewWrapper = null;
13056
+ this.chipCollectionWrapper = null;
13057
+ this.targetInputElement = null;
13058
+ this.popupWrapper = null;
13059
+ this.inputElement = null;
13060
+ this.delimiterWrapper = null;
13061
+ this.popupObj = null;
13062
+ this.popupWrapper = null;
13063
+ this.liCollections = null;
13064
+ this.header = null;
13065
+ this.mainList = null;
13066
+ this.mainListCollection = null;
13067
+ this.footer = null;
13068
+ this.selectAllEventEle = null;
12941
13069
  };
12942
13070
  __decorate$5([
12943
13071
  Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
@@ -13289,6 +13417,12 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13289
13417
  CheckBoxSelection.prototype.destroy = function () {
13290
13418
  this.removeEventListener();
13291
13419
  EventHandler.remove(document, 'mousedown', this.onDocumentClick);
13420
+ this.checkAllParent = null;
13421
+ this.clearIconElement = null;
13422
+ this.filterInput = null;
13423
+ this.filterInputObj = null;
13424
+ this.checkWrapper = null;
13425
+ this.selectAllSpan = null;
13292
13426
  };
13293
13427
  CheckBoxSelection.prototype.listSelection = function (args) {
13294
13428
  var target;
@@ -13337,12 +13471,10 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13337
13471
  e.preventDefault();
13338
13472
  };
13339
13473
  CheckBoxSelection.prototype.changeState = function (wrapper, state, e, isPrevent, selectAll$$1) {
13340
- var ariaState;
13341
13474
  var frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME$1)[0];
13342
13475
  if (state === 'check' && !frameSpan.classList.contains(CHECK$1)) {
13343
13476
  frameSpan.classList.remove(INDETERMINATE);
13344
13477
  frameSpan.classList.add(CHECK$1);
13345
- ariaState = 'true';
13346
13478
  if (selectAll$$1) {
13347
13479
  this.parent.selectAllItems(true, e);
13348
13480
  this.setLocale(true);
@@ -13350,7 +13482,6 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13350
13482
  }
13351
13483
  else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK$1) || frameSpan.classList.contains(INDETERMINATE))) {
13352
13484
  removeClass([frameSpan], [CHECK$1, INDETERMINATE]);
13353
- ariaState = 'false';
13354
13485
  if (selectAll$$1) {
13355
13486
  this.parent.selectAllItems(false, e);
13356
13487
  this.setLocale();
@@ -13359,16 +13490,11 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13359
13490
  else if (state === 'indeterminate' && !(frameSpan.classList.contains(INDETERMINATE))) {
13360
13491
  removeClass([frameSpan], [CHECK$1]);
13361
13492
  frameSpan.classList.add(INDETERMINATE);
13362
- ariaState = 'false';
13363
13493
  if (selectAll$$1) {
13364
13494
  this.parent.selectAllItems(false, e);
13365
13495
  this.setLocale();
13366
13496
  }
13367
13497
  }
13368
- ariaState = state === 'check' ? 'true' : state === 'uncheck' ? 'false' : ariaState;
13369
- if (!isNullOrUndefined(ariaState)) {
13370
- wrapper.setAttribute('aria-checked', ariaState);
13371
- }
13372
13498
  };
13373
13499
  CheckBoxSelection.prototype.setSearchBox = function (args) {
13374
13500
  if (isNullOrUndefined(this.parent.filterParent)) {
@@ -13529,8 +13655,8 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13529
13655
  e.preventDefault();
13530
13656
  }
13531
13657
  }
13532
- if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]')) &&
13533
- !this.parent.overAllWrapper.contains(e.target)) {
13658
+ if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
13659
+ && !isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target)) {
13534
13660
  if (this.parent.overAllWrapper.classList.contains(dropDownBaseClasses.focus) || this.parent.isPopupOpen()) {
13535
13661
  this.parent.inputFocus = false;
13536
13662
  this.parent.scrollFocusStatus = false;
@@ -13543,7 +13669,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13543
13669
  this.parent.scrollFocusStatus = (Browser.isIE || Browser.info.name === 'edge') &&
13544
13670
  (document.activeElement === this.filterInput);
13545
13671
  }
13546
- if (!this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
13672
+ if (!isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
13547
13673
  !this.parent.isPopupOpen()) {
13548
13674
  if (Browser.isIE) {
13549
13675
  this.parent.onBlurHandler();
@@ -13574,7 +13700,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13574
13700
  }
13575
13701
  };
13576
13702
  CheckBoxSelection.prototype.checkSelectAll = function (e) {
13577
- if (e.value === 'check' && this.checkAllParent.getAttribute('aria-checked') !== 'true') {
13703
+ if (e.value === 'check') {
13578
13704
  this.changeState(this.checkAllParent, e.value, null, null, false);
13579
13705
  this.setLocale(true);
13580
13706
  }
@@ -13758,6 +13884,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13758
13884
  this.isCustomFiltering = false;
13759
13885
  this.initialSelectedOptions = this.value;
13760
13886
  _super.prototype.render.call(this);
13887
+ this.setEnabled();
13761
13888
  this.renderComplete();
13762
13889
  };
13763
13890
  ListBox.prototype.initWrapper = function () {
@@ -14055,10 +14182,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14055
14182
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14056
14183
  var event = args.event;
14057
14184
  var wrapper;
14058
- if (args.target && (args.target.classList.contains("e-listbox-wrapper") || args.target.classList.contains("e-list-item")
14059
- || args.target.classList.contains("e-filter-parent") || args.target.classList.contains("e-input-group"))) {
14060
- if (args.target.classList.contains("e-list-item") || args.target.classList.contains("e-filter-parent")
14061
- || args.target.classList.contains("e-input-group")) {
14185
+ if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
14186
+ || args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
14187
+ if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
14188
+ || args.target.classList.contains('e-input-group')) {
14062
14189
  wrapper = args.target.closest('.e-listbox-wrapper');
14063
14190
  }
14064
14191
  else {
@@ -14113,7 +14240,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14113
14240
  var getArgs = this.getDragArgs({ target: args.droppedElement }, true);
14114
14241
  var sourceArgs = { previousData: this.dataSource };
14115
14242
  var destArgs = { previousData: listObj.dataSource };
14116
- var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource }, previousIndex: args.previousIndex, currentIndex: args.currentIndex });
14243
+ var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
14244
+ previousIndex: args.previousIndex, currentIndex: args.currentIndex });
14117
14245
  if (listObj !== this) {
14118
14246
  var sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
14119
14247
  dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
@@ -14241,6 +14369,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14241
14369
  dragArgs = extend(dragArgs, { destination: dragArgs1 });
14242
14370
  }
14243
14371
  this.trigger('drop', dragArgs);
14372
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14244
14373
  var liCollElem = dragArgs.elements;
14245
14374
  if (liCollElem.length) {
14246
14375
  for (var i = 0; i < liCollElem.length; i++) {
@@ -14250,7 +14379,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14250
14379
  };
14251
14380
  ListBox.prototype.updateListItems = function (sourceElem, destElem) {
14252
14381
  var i = 0;
14253
- destElem.innerHTML = "";
14382
+ destElem.innerHTML = '';
14254
14383
  while (i < sourceElem.childNodes.length) {
14255
14384
  destElem.appendChild(sourceElem.childNodes[i]);
14256
14385
  }
@@ -14279,6 +14408,14 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14279
14408
  }
14280
14409
  return listObj;
14281
14410
  };
14411
+ /**
14412
+ * Sets the enabled state to DropDownBase.
14413
+ *
14414
+ * @returns {void}
14415
+ */
14416
+ ListBox.prototype.setEnabled = function () {
14417
+ this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
14418
+ };
14282
14419
  ListBox.prototype.listOption = function (dataSource, fields) {
14283
14420
  this.listCurrentOptions = _super.prototype.listOption.call(this, dataSource, fields);
14284
14421
  this.listCurrentOptions = extend({}, this.listCurrentOptions, { itemCreated: this.triggerBeforeItemRender.bind(this) }, true);
@@ -14728,9 +14865,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14728
14865
  prepend([this.filterParent], this.list);
14729
14866
  attributes(this.filterInput, {
14730
14867
  'aria-disabled': 'false',
14731
- 'aria-owns': this.element.id + '_options',
14732
- 'role': 'listbox',
14733
- 'aria-activedescendant': null,
14868
+ 'aria-label': 'search list item',
14734
14869
  'autocomplete': 'off',
14735
14870
  'autocorrect': 'off',
14736
14871
  'autocapitalize': 'off',
@@ -15132,7 +15267,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15132
15267
  var isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
15133
15268
  fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
15134
15269
  this.removeSelected(fListBox, fListBox.getSelectedItems());
15135
- var tempItems = [].slice.call(fListBox.jsonData);
15270
+ var tempItems = [].slice.call(fListBox.listData);
15136
15271
  var localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
15137
15272
  fListBox.trigger('actionBegin', localDataArgs);
15138
15273
  if (localDataArgs.cancel) {
@@ -15177,11 +15312,18 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15177
15312
  fListBox.value = [];
15178
15313
  listData = listData
15179
15314
  .filter(function (data) { return data.isHeader !== true; });
15180
- tListBox.listData = tListBox.jsonData = listData;
15181
- if (fListBox.listData.length == fListBox.jsonData.length) {
15315
+ var sortedData = listData.filter(function (val) {
15316
+ return tListBox.jsonData.indexOf(val) === -1;
15317
+ });
15318
+ for (var i = 0; i < sortedData.length; i++) {
15319
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15320
+ tListBox.jsonData.splice(index + i, 0, sortedData[i]);
15321
+ }
15322
+ tListBox.listData = listData;
15323
+ if (fListBox.listData.length === fListBox.jsonData.length) {
15182
15324
  fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
15183
15325
  }
15184
- else if (this.allowFiltering) {
15326
+ else if (fListBox.allowFiltering) {
15185
15327
  for (var i = 0; i < fListBox.listData.length; i++) {
15186
15328
  for (var j = 0; j < fListBox.jsonData.length; j++) {
15187
15329
  if (fListBox.listData[i] === fListBox.jsonData[j]) {
@@ -15324,7 +15466,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15324
15466
  }
15325
15467
  }
15326
15468
  }
15327
- else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== "KeyA") {
15469
+ else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
15328
15470
  this.upDownKeyHandler(e);
15329
15471
  }
15330
15472
  }
@@ -15368,8 +15510,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15368
15510
  }
15369
15511
  if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
15370
15512
  var selectedidx = Array.prototype.indexOf.call(ul.children, fli);
15371
- var sidx = e.code === "Home" ? 0 : selectedidx;
15372
- var eidx = e.code === "Home" ? selectedidx : ul.children.length - 1;
15513
+ var sidx = e.code === 'Home' ? 0 : selectedidx;
15514
+ var eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
15373
15515
  for (var i = sidx; i <= eidx; i++) {
15374
15516
  var item = ul.children[i];
15375
15517
  this.notify('updatelist', { li: item, e: {
@@ -15527,7 +15669,6 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15527
15669
  dvalue_1 = _this.getFormattedValue(li.getAttribute('data-value'));
15528
15670
  if (values.indexOf(dvalue_1) < 0) {
15529
15671
  li.getElementsByClassName('e-check')[0].classList.remove('e-check');
15530
- li.getElementsByClassName('e-checkbox-wrapper')[0].removeAttribute('aria-checked');
15531
15672
  li.removeAttribute('aria-selected');
15532
15673
  }
15533
15674
  });
@@ -15879,6 +16020,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15879
16020
  __decorate$6([
15880
16021
  Property('')
15881
16022
  ], ListBox.prototype, "height", void 0);
16023
+ __decorate$6([
16024
+ Property(true)
16025
+ ], ListBox.prototype, "enabled", void 0);
16026
+ __decorate$6([
16027
+ Property(false)
16028
+ ], ListBox.prototype, "enablePersistence", void 0);
15882
16029
  __decorate$6([
15883
16030
  Property(false)
15884
16031
  ], ListBox.prototype, "allowDragAndDrop", void 0);
@@ -16053,6 +16200,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16053
16200
  this.isFiltered = false;
16054
16201
  this.beforePopupOpen = false;
16055
16202
  this.initRemoteRender = false;
16203
+ this.isListResetted = false;
16056
16204
  this.isPopupOpen = false;
16057
16205
  this.isCollided = false;
16058
16206
  this.lineBreak = false;
@@ -16119,6 +16267,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16119
16267
  /**
16120
16268
  * Hides the spinner loader.
16121
16269
  *
16270
+ * @private
16122
16271
  * @returns {void}
16123
16272
  */
16124
16273
  Mention.prototype.hideSpinner = function () {
@@ -16174,6 +16323,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16174
16323
  break;
16175
16324
  case 'tab':
16176
16325
  if (this.isPopupOpen) {
16326
+ e.preventDefault();
16177
16327
  var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
16178
16328
  if (li) {
16179
16329
  this.setSelection(li, e);
@@ -16213,7 +16363,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16213
16363
  var startIndex = 0;
16214
16364
  startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
16215
16365
  index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
16216
- var nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex] : this.liCollections[index];
16366
+ var nextItem = isNullOrUndefined(this.activeIndex) ?
16367
+ this.liCollections[startIndex] : this.liCollections[index];
16217
16368
  if (!isNullOrUndefined(nextItem)) {
16218
16369
  this.setSelection(nextItem, e);
16219
16370
  }
@@ -16238,9 +16389,14 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16238
16389
  }
16239
16390
  var currentRange = this.getTextRange();
16240
16391
  var lastWordRange = this.getLastLetter(currentRange);
16392
+ // eslint-disable-next-line security/detect-non-literal-regexp
16241
16393
  var Regex = new RegExp(this.mentionChar, 'g');
16242
16394
  var charRegex = new RegExp('[a-zA-Z]', 'g');
16243
16395
  if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
16396
+ if ((e.keyCode === 37 || e.keyCode === 39) && !isNullOrUndefined(currentRange) &&
16397
+ currentRange.indexOf(this.mentionChar) === -1 && this.isPopupOpen) {
16398
+ this.hidePopup();
16399
+ }
16244
16400
  return;
16245
16401
  }
16246
16402
  if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
@@ -16269,7 +16425,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16269
16425
  if (!this.isContentEditable(this.inputElement)) {
16270
16426
  this.showPopup();
16271
16427
  }
16272
- else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement) {
16428
+ else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement && e.keyCode !== 9) {
16273
16429
  this.showPopup();
16274
16430
  }
16275
16431
  }
@@ -16298,8 +16454,12 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16298
16454
  this.searchLists(e);
16299
16455
  }
16300
16456
  else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
16301
- this.resetList(this.dataSource, this.fields);
16457
+ this.searchLists(e);
16458
+ if (!this.isListResetted) {
16459
+ this.resetList(this.dataSource, this.fields);
16460
+ }
16302
16461
  }
16462
+ this.isListResetted = false;
16303
16463
  };
16304
16464
  Mention.prototype.isMatchedText = function () {
16305
16465
  var isMatched = false;
@@ -16333,7 +16493,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16333
16493
  this.activeIndex = null;
16334
16494
  var eventArgs = {
16335
16495
  preventDefaultAction: false,
16336
- text: this.elementValue(),
16496
+ text: this.queryString,
16337
16497
  updateData: function (dataSource, query, fields) {
16338
16498
  if (eventArgs.cancel) {
16339
16499
  return;
@@ -16351,8 +16511,9 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16351
16511
  };
16352
16512
  Mention.prototype.filterAction = function (dataSource, query, fields) {
16353
16513
  this.beforePopupOpen = true;
16354
- if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
16514
+ if (this.queryString.length >= this.minLength) {
16355
16515
  this.resetList(dataSource, fields, query);
16516
+ this.isListResetted = true;
16356
16517
  }
16357
16518
  else {
16358
16519
  if (this.isPopupOpen) {
@@ -16474,12 +16635,14 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16474
16635
  }
16475
16636
  }
16476
16637
  else {
16477
- var selectedElem = this.range.startContainer;
16478
- if (!isNullOrUndefined(selectedElem)) {
16479
- var workingNodeContent = selectedElem.textContent;
16480
- var selectStartOffset = this.range.startOffset;
16481
- if (workingNodeContent && selectStartOffset >= 0) {
16482
- text = workingNodeContent.substring(0, selectStartOffset);
16638
+ if (this.range) {
16639
+ var selectedElem = this.range.startContainer;
16640
+ if (!isNullOrUndefined(selectedElem)) {
16641
+ var workingNodeContent = selectedElem.textContent;
16642
+ var selectStartOffset = this.range.startOffset;
16643
+ if (workingNodeContent && selectStartOffset >= 0) {
16644
+ text = workingNodeContent.substring(0, selectStartOffset);
16645
+ }
16483
16646
  }
16484
16647
  }
16485
16648
  }
@@ -16503,6 +16666,10 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16503
16666
  * @returns {void}
16504
16667
  */
16505
16668
  Mention.prototype.showPopup = function () {
16669
+ this.beforePopupOpen = true;
16670
+ if (isNullOrUndefined(this.list)) {
16671
+ this.initValue();
16672
+ }
16506
16673
  this.renderPopup();
16507
16674
  attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
16508
16675
  if (this.selectedElementID == null) {
@@ -16568,18 +16735,13 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16568
16735
  }
16569
16736
  }
16570
16737
  append([_this.list], popupEle_1);
16571
- if ((!_this.popupObj || !document.body.contains(_this.popupObj.element)) || !document.contains(popupEle_1) && isNullOrUndefined(_this.target)) {
16738
+ if ((!_this.popupObj || !document.body.contains(_this.popupObj.element)) ||
16739
+ !document.contains(popupEle_1) && isNullOrUndefined(_this.target)) {
16572
16740
  document.body.appendChild(popupEle_1);
16573
16741
  }
16574
16742
  var coordinates_1;
16575
16743
  popupEle_1.style.visibility = 'hidden';
16576
- if (_this.popupHeight !== 'auto') {
16577
- _this.list.style.maxHeight = (parseInt(_this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
16578
- popupEle_1.style.maxHeight = formatUnit(_this.popupHeight);
16579
- }
16580
- else {
16581
- popupEle_1.style.height = 'auto';
16582
- }
16744
+ _this.setHeight(popupEle_1);
16583
16745
  var offsetValue = 0;
16584
16746
  var left = 0;
16585
16747
  _this.initializePopup(popupEle_1, offsetValue, left);
@@ -16602,6 +16764,9 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16602
16764
  if (!eventArgs.cancel) {
16603
16765
  _this.renderReactTemplates();
16604
16766
  _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.inputElement : null);
16767
+ if (isNullOrUndefined(_this.getTriggerCharPosition())) {
16768
+ return;
16769
+ }
16605
16770
  coordinates_1 = _this.getCoordinates(_this.inputElement, _this.getTriggerCharPosition());
16606
16771
  if (!_this.isCollided) {
16607
16772
  popupEle_1.style.cssText = 'top: '.concat(coordinates_1.top.toString(), 'px;\n left: ').concat(coordinates_1.left.toString(), 'px;\nposition: absolute;\n display: block;');
@@ -16611,6 +16776,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16611
16776
  _this.isCollided = false;
16612
16777
  }
16613
16778
  popupEle_1.style.width = _this.popupWidth !== '100%' && !isNullOrUndefined(_this.popupWidth) ? formatUnit(_this.popupWidth) : 'auto';
16779
+ _this.setHeight(popupEle_1);
16780
+ popupEle_1.style.zIndex = _this.zIndex === 1000 ? getZindexPartial(popupEle_1).toString() : _this.zIndex.toString();
16614
16781
  }
16615
16782
  else {
16616
16783
  _this.beforePopupOpen = false;
@@ -16623,6 +16790,15 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16623
16790
  }
16624
16791
  });
16625
16792
  };
16793
+ Mention.prototype.setHeight = function (popupEle) {
16794
+ if (this.popupHeight !== 'auto') {
16795
+ this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
16796
+ popupEle.style.maxHeight = formatUnit(this.popupHeight);
16797
+ }
16798
+ else {
16799
+ popupEle.style.height = 'auto';
16800
+ }
16801
+ };
16626
16802
  Mention.prototype.checkCollision = function (popupEle) {
16627
16803
  if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
16628
16804
  var collision = isCollide(popupEle);
@@ -16703,7 +16879,9 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16703
16879
  computed = getComputedStyle(element);
16704
16880
  div.style.position = 'absolute';
16705
16881
  div.style.visibility = 'hidden';
16882
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16706
16883
  properties.forEach(function (prop) {
16884
+ // eslint-disable-next-line security/detect-object-injection
16707
16885
  div.style[prop] = computed[prop];
16708
16886
  });
16709
16887
  div.textContent = element.value.substring(0, position);
@@ -16737,13 +16915,12 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16737
16915
  }
16738
16916
  else {
16739
16917
  coordinates = {
16740
- top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize),
16918
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
16741
16919
  left: rect.left + windowLeft
16742
16920
  };
16743
16921
  }
16744
16922
  return coordinates;
16745
16923
  };
16746
-
16747
16924
  Mention.prototype.initValue = function () {
16748
16925
  this.renderList();
16749
16926
  if (this.dataSource instanceof DataManager) {
@@ -16939,8 +17116,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16939
17116
  }
16940
17117
  return items;
16941
17118
  };
16942
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
16943
17119
  Mention.prototype.setValue = function (e) {
17120
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16944
17121
  if (!this.isReact) {
16945
17122
  if (!isNullOrUndefined(this.displayTemplate)) {
16946
17123
  this.setDisplayTemplate();
@@ -16968,7 +17145,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16968
17145
  var selection = this.inputElement.ownerDocument.getSelection();
16969
17146
  var startPos = this.getTriggerCharPosition();
16970
17147
  textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
16971
- if (dataItem.value !== null) {
17148
+ if (dataItem.text !== null) {
16972
17149
  value = this.mentionVal(dataItem.text);
16973
17150
  }
16974
17151
  if (!this.isContentEditable(this.inputElement)) {
@@ -17000,6 +17177,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17000
17177
  var frag = document.createDocumentFragment();
17001
17178
  var node = void 0;
17002
17179
  var lastNode = void 0;
17180
+ // eslint-disable-next-line no-cond-assign
17003
17181
  while (node = element.firstChild) {
17004
17182
  lastNode = frag.appendChild(node);
17005
17183
  }
@@ -17055,6 +17233,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17055
17233
  this.displayTempElement.appendChild(displayCompTemp[i]);
17056
17234
  }
17057
17235
  }
17236
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17058
17237
  if (!this.isReact) {
17059
17238
  this.renderTemplates();
17060
17239
  }
@@ -17064,6 +17243,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17064
17243
  });
17065
17244
  }
17066
17245
  };
17246
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17067
17247
  Mention.prototype.renderTemplates = function (callBack) {
17068
17248
  this.renderReactTemplates(callBack);
17069
17249
  };
@@ -17093,6 +17273,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17093
17273
  this.spinnerTemplateElement.appendChild(spinnerCompTemp[i]);
17094
17274
  }
17095
17275
  }
17276
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17096
17277
  if (!this.isReact) {
17097
17278
  this.renderTemplates();
17098
17279
  this.popupObj.element.appendChild(this.spinnerTemplateElement);
@@ -17187,7 +17368,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17187
17368
  this.setHover(currentLi);
17188
17369
  };
17189
17370
  Mention.prototype.setHover = function (li) {
17190
- if (this.enabled && this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
17371
+ if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
17191
17372
  this.removeHover();
17192
17373
  addClass([li], dropDownBaseClasses.hover);
17193
17374
  }
@@ -17212,8 +17393,13 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17212
17393
  * @returns {void}
17213
17394
  */
17214
17395
  Mention.prototype.search = function (text, positionX, positionY) {
17215
- if ((this.ignoreCase && (text === this.elementValue() || text === this.elementValue().toLowerCase()))
17216
- || !this.ignoreCase && text === this.elementValue()) {
17396
+ if (this.isContentEditable(this.inputElement)) {
17397
+ this.range = this.getCurrentRange();
17398
+ }
17399
+ var currentRange = this.getTextRange();
17400
+ var lastWordRange = this.getLastLetter(currentRange);
17401
+ if ((this.ignoreCase && (text === lastWordRange || text === lastWordRange.toLowerCase()))
17402
+ || !this.ignoreCase && text === lastWordRange) {
17217
17403
  this.resetList(this.dataSource, this.fields);
17218
17404
  }
17219
17405
  else {