@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
@@ -432,7 +432,9 @@ let DropDownBase = class DropDownBase extends Component {
432
432
  liElem.setAttribute('role', 'option');
433
433
  }
434
434
  else {
435
- ele.innerHTML = content;
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.list) {
467
- this.enableRtlElements.push(this.list);
468
- }
469
- if (this.enableRtl) {
470
- addClass(this.enableRtlElements, dropDownBaseClasses.rtl);
471
- }
472
- else {
473
- removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);
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
- addClass([this.list], dropDownBaseClasses.noData);
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
- prepend([this.fixedHeaderElement], this.list);
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.parentElement.style.display = 'block';
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
- const liWidth = this.getValidLi().offsetWidth - borderWidth;
977
- this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
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.innerHTML = '';
1264
- this.list.classList.remove(dropDownBaseClasses.noData);
1265
- this.list.appendChild(this.ulElement);
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
- append(liCollections, this.ulElement);
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.innerHTML = '';
1657
- this.inputElement.value = '';
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
- EventHandler.add(this.list, 'click', this.onMouseClick, this);
1959
- EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
1960
- EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
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
- EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
2239
- EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
2240
- EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
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
- EventHandler.remove(this.list, 'click', this.onMouseClick);
2250
- EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
2251
- EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
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.targetElement(), { 'aria-label': this.inputElement.value });
2457
- attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
2458
- this.targetElement().removeAttribute('aria-live');
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.innerHTML = '<option selected>' + this.text + '</option>';
2630
- const selectedElement = this.hiddenElement.querySelector('option');
2631
- selectedElement.setAttribute('value', this.value.toString());
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 && (this.element.tagName === 'EJS-COMBOBOX' || this.element.tagName === 'EJS-DROPDOWNLIST') && this.allowFiltering) {
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
- left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
3116
- parseInt(getComputedStyle(this.inputElement).paddingLeft, 10) +
3117
- parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10));
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
- addClass([this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
3183
+ if (!isNullOrUndefined(this.inputWrapper)) {
3184
+ addClass([this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
3185
+ }
3163
3186
  this.renderReactTemplates();
3164
- this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.element : null);
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
- EventHandler.remove(this.filterInput, 'input', this.onInput);
3421
- EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);
3422
- EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);
3423
- EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
3424
- EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
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
- Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
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.overFlowWrapper.innerHTML = data;
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,
@@ -5884,6 +5952,9 @@ let DropDownTree = class DropDownTree extends Component {
5884
5952
  }
5885
5953
  const eventArgs = { data: args.data };
5886
5954
  this.trigger('dataBound', eventArgs);
5955
+ if (this.filterObj === null) {
5956
+ this.isFilteredData = false;
5957
+ }
5887
5958
  if (this.isFilteredData) {
5888
5959
  this.treeObj.expandAll();
5889
5960
  }
@@ -5951,7 +6022,7 @@ let DropDownTree = class DropDownTree extends Component {
5951
6022
  dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
5952
6023
  child: this.cloneChildField(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
5953
6024
  iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes, query: fields.query,
5954
- selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
6025
+ selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
5955
6026
  };
5956
6027
  return clonedField;
5957
6028
  }
@@ -5964,7 +6035,7 @@ let DropDownTree = class DropDownTree extends Component {
5964
6035
  dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
5965
6036
  child: (fields.child ? this.cloneChildField(fields.child) : null), hasChildren: fields.hasChildren,
5966
6037
  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
6038
+ query: fields.query, selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
5968
6039
  };
5969
6040
  return clonedField;
5970
6041
  }
@@ -5974,7 +6045,7 @@ let DropDownTree = class DropDownTree extends Component {
5974
6045
  dataSource: fields.dataSource, id: fields.value, text: fields.text, parentID: fields.parentValue,
5975
6046
  child: this.getTreeChildren(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
5976
6047
  iconCss: fields.iconCss, imageUrl: fields.imageUrl, isChecked: fields.selected,
5977
- htmlAttributes: fields.htmlAttributes, query: fields.query, selected: fields.selected,
6048
+ htmlAttributes: fields.htmlAttributes, query: fields.query, selectable: fields.selectable, selected: fields.selected,
5978
6049
  tableName: fields.tableName, tooltip: fields.tooltip
5979
6050
  };
5980
6051
  return treeFields;
@@ -6469,7 +6540,12 @@ let DropDownTree = class DropDownTree extends Component {
6469
6540
  });
6470
6541
  const chipContent = this.createElement('span', { className: CHIP_CONTENT });
6471
6542
  const chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
6472
- chipContent.innerHTML = text;
6543
+ if (this.enableHtmlSanitizer) {
6544
+ chipContent.innerText = text;
6545
+ }
6546
+ else {
6547
+ chipContent.innerHTML = text;
6548
+ }
6473
6549
  chip.appendChild(chipContent);
6474
6550
  this.chipCollection.appendChild(chip);
6475
6551
  if (this.showClearButton) {
@@ -7291,6 +7367,9 @@ __decorate$2([
7291
7367
  __decorate$2([
7292
7368
  Property(false)
7293
7369
  ], DropDownTree.prototype, "showCheckBox", void 0);
7370
+ __decorate$2([
7371
+ Property(false)
7372
+ ], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
7294
7373
  __decorate$2([
7295
7374
  Property(true)
7296
7375
  ], DropDownTree.prototype, "showClearButton", void 0);
@@ -7575,7 +7654,7 @@ let ComboBox = class ComboBox extends DropDownList {
7575
7654
  }
7576
7655
  getFocusElement() {
7577
7656
  const dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
7578
- const selected = this.list.querySelector('.' + dropDownListClasses.selected);
7657
+ const selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
7579
7658
  const isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
7580
7659
  if (isSelected) {
7581
7660
  return selected;
@@ -7586,7 +7665,7 @@ let ComboBox = class ComboBox extends DropDownList {
7586
7665
  const dataSource = this.sortedData;
7587
7666
  const type = this.typeOfData(dataSource).typeof;
7588
7667
  const activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
7589
- const activeElement = activeItem.item;
7668
+ var activeElement = activeItem.item;
7590
7669
  if (!isNullOrUndefined(activeElement)) {
7591
7670
  const count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
7592
7671
  const height = parseInt(getComputedStyle(this.liCollections[0], null).getPropertyValue('height'), 10);
@@ -7735,9 +7814,11 @@ let ComboBox = class ComboBox extends DropDownList {
7735
7814
  }
7736
7815
  else if (this.inputElement.value === '') {
7737
7816
  this.activeIndex = null;
7738
- this.list.scrollTop = 0;
7739
- const focusItem = this.list.querySelector('.' + dropDownListClasses.li);
7740
- this.setHoverList(focusItem);
7817
+ if (!isNullOrUndefined(this.list)) {
7818
+ this.list.scrollTop = 0;
7819
+ const focusItem = this.list.querySelector('.' + dropDownListClasses.li);
7820
+ this.setHoverList(focusItem);
7821
+ }
7741
7822
  }
7742
7823
  else {
7743
7824
  this.activeIndex = null;
@@ -8033,7 +8114,7 @@ let ComboBox = class ComboBox extends DropDownList {
8033
8114
  this.removeFillSelection();
8034
8115
  }
8035
8116
  const dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
8036
- const selected = this.list.querySelector('.' + dropDownListClasses.selected);
8117
+ const selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : null;
8037
8118
  if (this.inputElement && dataItem.text === this.inputElement.value && !isNullOrUndefined(selected)) {
8038
8119
  if (this.isSelected) {
8039
8120
  this.onChangeEvent(e);
@@ -8891,7 +8972,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8891
8972
  for (const htmlAttr of Object.keys(this.htmlAttributes)) {
8892
8973
  switch (htmlAttr) {
8893
8974
  case 'class': {
8894
- const updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
8975
+ const updatedClassValue = (this.htmlAttributes[`${htmlAttr}`].replace(/\s+/g, ' ')).trim();
8895
8976
  if (updatedClassValue !== '') {
8896
8977
  addClass([this.overAllWrapper], updatedClassValue.split(' '));
8897
8978
  addClass([this.popupWrapper], updatedClassValue.split(' '));
@@ -8903,7 +8984,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8903
8984
  break;
8904
8985
  case 'placeholder':
8905
8986
  if (!this.placeholder) {
8906
- this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
8987
+ this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
8907
8988
  this.setProperties({ placeholder: this.inputElement.placeholder }, true);
8908
8989
  this.refreshPlaceHolder();
8909
8990
  }
@@ -8913,16 +8994,16 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8913
8994
  const validateAttr = ['name', 'required', 'aria-required', 'form'];
8914
8995
  const containerAttr = ['title', 'role', 'style', 'class'];
8915
8996
  if (defaultAttr.indexOf(htmlAttr) > -1) {
8916
- this.element.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
8997
+ this.element.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
8917
8998
  }
8918
8999
  else if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
8919
- this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9000
+ this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
8920
9001
  }
8921
9002
  else if (containerAttr.indexOf(htmlAttr) > -1) {
8922
- this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9003
+ this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
8923
9004
  }
8924
- else if (htmlAttr !== 'size') {
8925
- this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9005
+ else if (htmlAttr !== 'size' && !isNullOrUndefined(this.inputElement)) {
9006
+ this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
8926
9007
  }
8927
9008
  break;
8928
9009
  }
@@ -8931,11 +9012,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8931
9012
  }
8932
9013
  }
8933
9014
  updateReadonly(state) {
8934
- if (state || this.mode === 'CheckBox') {
8935
- this.inputElement.setAttribute('readonly', 'true');
8936
- }
8937
- else {
8938
- this.inputElement.removeAttribute('readonly');
9015
+ if (!isNullOrUndefined(this.inputElement)) {
9016
+ if (state || this.mode === 'CheckBox') {
9017
+ this.inputElement.setAttribute('readonly', 'true');
9018
+ }
9019
+ else {
9020
+ this.inputElement.removeAttribute('readonly');
9021
+ }
8939
9022
  }
8940
9023
  }
8941
9024
  updateClearButton(state) {
@@ -9077,8 +9160,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9077
9160
  if (!isNullOrUndefined(this.ulElement)) {
9078
9161
  attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
9079
9162
  }
9080
- const disableStatus = (this.inputElement.disabled) ? true : false;
9081
- if (!this.isPopupOpen()) {
9163
+ const disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
9164
+ if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
9082
9165
  attributes(this.inputElement, this.getAriaAttributes());
9083
9166
  }
9084
9167
  if (disableStatus) {
@@ -9188,7 +9271,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9188
9271
  this.checkForCustomValue(this.tempQuery, this.fields);
9189
9272
  return;
9190
9273
  }
9191
- if (this.value && this.value.length && ((this.mode !== 'CheckBox' && this.inputElement.value.trim() !== '') ||
9274
+ if (this.value && this.value.length && ((this.mode !== 'CheckBox' && !isNullOrUndefined(this.inputElement) && this.inputElement.value.trim() !== '') ||
9192
9275
  this.mode === 'CheckBox' || ((this.keyCode === 8 || this.keyCode === 46) && this.allowFiltering &&
9193
9276
  this.allowCustomValue && this.dataSource instanceof DataManager && this.inputElement.value === ''))) {
9194
9277
  this.refreshSelection();
@@ -9258,8 +9341,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9258
9341
  }
9259
9342
  element.setAttribute('aria-selected', 'true');
9260
9343
  if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
9261
- const ariaValue = element.firstElementChild.getAttribute('aria-checked');
9262
- if (isNullOrUndefined(ariaValue) || ariaValue === 'false') {
9344
+ const ariaValue = element.getElementsByClassName('e-check').length;
9345
+ if (ariaValue === 0) {
9263
9346
  const args = {
9264
9347
  module: 'CheckBoxSelection',
9265
9348
  enable: this.mode === 'CheckBox',
@@ -9652,11 +9735,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9652
9735
  }
9653
9736
  }
9654
9737
  refreshInputHight() {
9655
- if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {
9656
- this.searchWrapper.classList.remove(ZERO_SIZE);
9657
- }
9658
- else {
9659
- this.searchWrapper.classList.add(ZERO_SIZE);
9738
+ if (!isNullOrUndefined(this.searchWrapper)) {
9739
+ if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {
9740
+ this.searchWrapper.classList.remove(ZERO_SIZE);
9741
+ }
9742
+ else {
9743
+ this.searchWrapper.classList.add(ZERO_SIZE);
9744
+ }
9660
9745
  }
9661
9746
  }
9662
9747
  validateValues(newValue, oldValue) {
@@ -10456,7 +10541,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10456
10541
  HIDE_LIST :
10457
10542
  dropDownBaseClasses.selected);
10458
10543
  if (this.mode === 'CheckBox') {
10459
- element2.firstElementChild.setAttribute('aria-checked', 'false');
10460
10544
  removeClass([element2.firstElementChild.lastElementChild], 'e-check');
10461
10545
  }
10462
10546
  }
@@ -10466,7 +10550,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10466
10550
  HIDE_LIST :
10467
10551
  dropDownBaseClasses.selected);
10468
10552
  if (this.mode === 'CheckBox') {
10469
- element2.firstElementChild.setAttribute('aria-checked', 'true');
10470
10553
  addClass([element2.firstElementChild.lastElementChild], 'e-check');
10471
10554
  }
10472
10555
  }
@@ -10724,109 +10807,111 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10724
10807
  super.render();
10725
10808
  }
10726
10809
  if (!this.popupObj) {
10727
- document.body.appendChild(this.popupWrapper);
10728
- const checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
10729
- if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
10730
- checkboxFilter.remove();
10731
- this.filterParent = null;
10732
- }
10733
- let overAllHeight = parseInt(this.popupHeight, 10);
10734
- this.popupWrapper.style.visibility = 'hidden';
10735
- if (this.headerTemplate) {
10736
- this.setHeaderTemplate();
10737
- overAllHeight -= this.header.offsetHeight;
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) {
10810
+ if (!isNullOrUndefined(this.popupWrapper)) {
10811
+ document.body.appendChild(this.popupWrapper);
10812
+ const checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
10813
+ if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
10814
+ checkboxFilter.remove();
10815
+ this.filterParent = null;
10816
+ }
10817
+ let overAllHeight = parseInt(this.popupHeight, 10);
10818
+ this.popupWrapper.style.visibility = 'hidden';
10819
+ if (this.headerTemplate) {
10820
+ this.setHeaderTemplate();
10756
10821
  overAllHeight -= this.header.offsetHeight;
10757
10822
  }
10758
- if (this.footerTemplate && this.footer) {
10823
+ append([this.list], this.popupWrapper);
10824
+ if (this.footerTemplate) {
10825
+ this.setFooterTemplate();
10759
10826
  overAllHeight -= this.footer.offsetHeight;
10760
10827
  }
10761
- }
10762
- if (this.mode === 'CheckBox') {
10763
- const args = {
10764
- module: 'CheckBoxSelection',
10765
- enable: this.mode === 'CheckBox',
10766
- popupElement: this.popupWrapper
10767
- };
10768
- if (this.allowFiltering) {
10769
- this.notify('searchBox', args);
10770
- overAllHeight -= this.searchBoxHeight;
10771
- }
10772
- addClass([this.popupWrapper], 'e-checkbox');
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;
10828
+ if (this.mode === 'CheckBox' && this.showSelectAll) {
10829
+ this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10830
+ overAllHeight -= this.selectAllHeight;
10831
+ }
10832
+ else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
10833
+ this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10834
+ overAllHeight = parseInt(this.popupHeight, 10);
10835
+ }
10836
+ else if (this.mode === 'CheckBox' && !this.showSelectAll) {
10837
+ this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10838
+ overAllHeight = parseInt(this.popupHeight, 10);
10839
+ if (this.headerTemplate && this.header) {
10840
+ overAllHeight -= this.header.offsetHeight;
10807
10841
  }
10808
- this.popupObj.wireScrollEvents();
10809
- if (!(this.mode !== 'CheckBox' && (this.allowFiltering || this.allowCustomValue) &&
10810
- this.targetElement().trim() !== '')) {
10811
- this.loadTemplate();
10842
+ if (this.footerTemplate && this.footer) {
10843
+ overAllHeight -= this.footer.offsetHeight;
10812
10844
  }
10813
- this.setScrollPosition();
10845
+ }
10846
+ if (this.mode === 'CheckBox') {
10847
+ const args = {
10848
+ module: 'CheckBoxSelection',
10849
+ enable: this.mode === 'CheckBox',
10850
+ popupElement: this.popupWrapper
10851
+ };
10814
10852
  if (this.allowFiltering) {
10815
- this.notify('inputFocus', {
10816
- module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'focus'
10817
- });
10853
+ this.notify('searchBox', args);
10854
+ overAllHeight -= this.searchBoxHeight;
10818
10855
  }
10819
- }, targetExitViewport: () => {
10820
- if (!Browser.isDevice) {
10821
- this.hidePopup();
10856
+ addClass([this.popupWrapper], 'e-checkbox');
10857
+ }
10858
+ if (this.popupHeight !== 'auto') {
10859
+ this.list.style.maxHeight = formatUnit(overAllHeight);
10860
+ this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
10861
+ }
10862
+ else {
10863
+ this.list.style.maxHeight = formatUnit(this.popupHeight);
10864
+ }
10865
+ this.popupObj = new Popup(this.popupWrapper, {
10866
+ width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
10867
+ relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
10868
+ enableRtl: this.enableRtl, zIndex: this.zIndex,
10869
+ close: () => {
10870
+ if (this.popupObj.element.parentElement) {
10871
+ this.popupObj.unwireScrollEvents();
10872
+ // For restrict the page scrolling in safari browser
10873
+ const checkboxFilterInput = this.popupWrapper.querySelector('.' + FILTERINPUT);
10874
+ if (this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
10875
+ checkboxFilterInput.blur();
10876
+ }
10877
+ detach(this.popupObj.element);
10878
+ }
10879
+ },
10880
+ open: () => {
10881
+ this.popupObj.resolveCollision();
10882
+ if (!this.isFirstClick) {
10883
+ const ulElement = this.list.querySelector('ul');
10884
+ if (ulElement) {
10885
+ if (!(this.mode !== 'CheckBox' && (this.allowFiltering || this.allowCustomValue) &&
10886
+ this.targetElement().trim() !== '')) {
10887
+ this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
10888
+ }
10889
+ }
10890
+ this.isFirstClick = true;
10891
+ }
10892
+ this.popupObj.wireScrollEvents();
10893
+ if (!(this.mode !== 'CheckBox' && (this.allowFiltering || this.allowCustomValue) &&
10894
+ this.targetElement().trim() !== '')) {
10895
+ this.loadTemplate();
10896
+ }
10897
+ this.setScrollPosition();
10898
+ if (this.allowFiltering) {
10899
+ this.notify('inputFocus', {
10900
+ module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'focus'
10901
+ });
10902
+ }
10903
+ }, targetExitViewport: () => {
10904
+ if (!Browser.isDevice) {
10905
+ this.hidePopup();
10906
+ }
10822
10907
  }
10908
+ });
10909
+ if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
10910
+ this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10823
10911
  }
10824
- });
10825
- if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
10826
- this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10912
+ this.popupObj.close();
10913
+ this.popupWrapper.style.visibility = '';
10827
10914
  }
10828
- this.popupObj.close();
10829
- this.popupWrapper.style.visibility = '';
10830
10915
  }
10831
10916
  }
10832
10917
  setHeaderTemplate() {
@@ -11087,7 +11172,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11087
11172
  let temp;
11088
11173
  const tempData = this.listData;
11089
11174
  this.listData = this.mainData;
11090
- this.hiddenElement.innerHTML = '';
11175
+ if (!isNullOrUndefined(this.hiddenElement)) {
11176
+ this.hiddenElement.innerHTML = '';
11177
+ }
11091
11178
  if (!isNullOrUndefined(this.value)) {
11092
11179
  for (let index = 0; !isNullOrUndefined(this.value[index]); index++) {
11093
11180
  const listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
@@ -11105,7 +11192,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11105
11192
  data += temp + delimiterChar + ' ';
11106
11193
  text.push(temp);
11107
11194
  }
11108
- this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
11195
+ if (!isNullOrUndefined(this.hiddenElement)) {
11196
+ this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
11197
+ }
11109
11198
  }
11110
11199
  }
11111
11200
  this.setProperties({ text: text.toString() }, true);
@@ -11316,10 +11405,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11316
11405
  selectItems[temp1 - 1].setAttribute('aria-selected', 'false');
11317
11406
  if (this.mode === 'CheckBox') {
11318
11407
  if (selectedItems && (selectedItems.length > (temp1 - 1))) {
11319
- selectedItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
11320
11408
  removeClass([selectedItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
11321
11409
  }
11322
- selectItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
11323
11410
  removeClass([selectItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
11324
11411
  }
11325
11412
  temp1--;
@@ -11377,9 +11464,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11377
11464
  addClass([element], className);
11378
11465
  this.updateMainList(false, element.getAttribute('data-value'), mainElement);
11379
11466
  element.setAttribute('aria-selected', 'true');
11380
- if (this.mode === 'CheckBox') {
11381
- const ariaCheck = element.firstElementChild.getAttribute('aria-checked');
11382
- if (ariaCheck === 'false' || isNullOrUndefined(ariaCheck)) {
11467
+ if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
11468
+ const ariaCheck = element.getElementsByClassName('e-check').length;
11469
+ if (ariaCheck === 0) {
11383
11470
  this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });
11384
11471
  }
11385
11472
  }
@@ -11697,9 +11784,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11697
11784
  if (this.chipCollectionWrapper) {
11698
11785
  this.chipCollectionWrapper.style.display = 'none';
11699
11786
  }
11700
- this.viewWrapper.style.display = '';
11701
- this.viewWrapper.style.width = '';
11702
- this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
11787
+ if (!isNullOrUndefined(this.viewWrapper)) {
11788
+ this.viewWrapper.style.display = '';
11789
+ this.viewWrapper.style.width = '';
11790
+ this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
11791
+ }
11703
11792
  if (this.value && this.value.length) {
11704
11793
  let data = '';
11705
11794
  let temp;
@@ -11787,8 +11876,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11787
11876
  }
11788
11877
  }
11789
11878
  else {
11790
- this.viewWrapper.innerHTML = '';
11791
- this.viewWrapper.style.display = 'none';
11879
+ if (!isNullOrUndefined(this.viewWrapper)) {
11880
+ this.viewWrapper.innerHTML = '';
11881
+ this.viewWrapper.style.display = 'none';
11882
+ }
11792
11883
  }
11793
11884
  }
11794
11885
  checkClearIconWidth() {
@@ -11861,29 +11952,41 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11861
11952
  return temp;
11862
11953
  }
11863
11954
  unWireEvent() {
11864
- EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
11955
+ if (!isNullOrUndefined(this.componentWrapper)) {
11956
+ EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
11957
+ }
11865
11958
  EventHandler.remove(window, 'resize', this.windowResize);
11866
- EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
11867
- EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
11868
- if (this.mode !== 'CheckBox') {
11869
- EventHandler.remove(this.inputElement, 'input', this.onInput);
11959
+ if (!isNullOrUndefined(this.inputElement)) {
11960
+ EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
11961
+ EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
11962
+ if (this.mode !== 'CheckBox') {
11963
+ EventHandler.remove(this.inputElement, 'input', this.onInput);
11964
+ }
11965
+ EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
11966
+ const formElement = closest(this.inputElement, 'form');
11967
+ if (formElement) {
11968
+ EventHandler.remove(formElement, 'reset', this.resetValueHandler);
11969
+ }
11970
+ EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
11870
11971
  }
11871
- EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
11872
- const formElement = closest(this.inputElement, 'form');
11873
- if (formElement) {
11874
- EventHandler.remove(formElement, 'reset', this.resetValueHandler);
11972
+ if (!isNullOrUndefined(this.componentWrapper)) {
11973
+ EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
11974
+ EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
11975
+ }
11976
+ if (!isNullOrUndefined(this.overAllClear)) {
11977
+ EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
11978
+ }
11979
+ if (!isNullOrUndefined(this.inputElement)) {
11980
+ EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
11875
11981
  }
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
11982
  }
11882
11983
  selectAllItem(state, event, list) {
11883
11984
  let li;
11884
- li = this.list.querySelectorAll(state ?
11885
- 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
11886
- 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
11985
+ if (!isNullOrUndefined(this.list)) {
11986
+ li = this.list.querySelectorAll(state ?
11987
+ 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
11988
+ 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
11989
+ }
11887
11990
  if (this.value && this.value.length && event && event.target
11888
11991
  && closest(event.target, '.e-close-hooker') && this.allowFiltering) {
11889
11992
  li = this.mainList.querySelectorAll(state ?
@@ -12687,11 +12790,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12687
12790
  }
12688
12791
  }
12689
12792
  addValidInputClass() {
12690
- if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {
12691
- addClass([this.overAllWrapper], 'e-valid-input');
12692
- }
12693
- else {
12694
- removeClass([this.overAllWrapper], 'e-valid-input');
12793
+ if (!isNullOrUndefined(this.overAllWrapper)) {
12794
+ if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {
12795
+ addClass([this.overAllWrapper], 'e-valid-input');
12796
+ }
12797
+ else {
12798
+ removeClass([this.overAllWrapper], 'e-valid-input');
12799
+ }
12695
12800
  }
12696
12801
  }
12697
12802
  dropDownIcon() {
@@ -12744,13 +12849,17 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12744
12849
  super.destroy();
12745
12850
  const temp = ['readonly', 'aria-disabled', 'placeholder'];
12746
12851
  let length = temp.length;
12747
- while (length > 0) {
12748
- this.inputElement.removeAttribute(temp[length - 1]);
12749
- length--;
12852
+ if (!isNullOrUndefined(this.inputElement)) {
12853
+ while (length > 0) {
12854
+ this.inputElement.removeAttribute(temp[length - 1]);
12855
+ length--;
12856
+ }
12750
12857
  }
12751
- this.element.removeAttribute('data-initial-value');
12752
- this.element.style.display = 'block';
12753
- if (this.overAllWrapper.parentElement) {
12858
+ if (!isNullOrUndefined(this.element)) {
12859
+ this.element.removeAttribute('data-initial-value');
12860
+ this.element.style.display = 'block';
12861
+ }
12862
+ if (this.overAllWrapper && this.overAllWrapper.parentElement) {
12754
12863
  if (this.overAllWrapper.parentElement.tagName === this.getNgDirective()) {
12755
12864
  remove(this.overAllWrapper);
12756
12865
  }
@@ -12759,6 +12868,25 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12759
12868
  remove(this.overAllWrapper);
12760
12869
  }
12761
12870
  }
12871
+ this.componentWrapper = null;
12872
+ this.overAllClear = null;
12873
+ this.overAllWrapper = null;
12874
+ this.hiddenElement = null;
12875
+ this.searchWrapper = null;
12876
+ this.viewWrapper = null;
12877
+ this.chipCollectionWrapper = null;
12878
+ this.targetInputElement = null;
12879
+ this.popupWrapper = null;
12880
+ this.inputElement = null;
12881
+ this.delimiterWrapper = null;
12882
+ this.popupObj = null;
12883
+ this.popupWrapper = null;
12884
+ this.liCollections = null;
12885
+ this.header = null;
12886
+ this.mainList = null;
12887
+ this.mainListCollection = null;
12888
+ this.footer = null;
12889
+ this.selectAllEventEle = null;
12762
12890
  }
12763
12891
  };
12764
12892
  __decorate$5([
@@ -13108,6 +13236,12 @@ class CheckBoxSelection {
13108
13236
  destroy() {
13109
13237
  this.removeEventListener();
13110
13238
  EventHandler.remove(document, 'mousedown', this.onDocumentClick);
13239
+ this.checkAllParent = null;
13240
+ this.clearIconElement = null;
13241
+ this.filterInput = null;
13242
+ this.filterInputObj = null;
13243
+ this.checkWrapper = null;
13244
+ this.selectAllSpan = null;
13111
13245
  }
13112
13246
  listSelection(args) {
13113
13247
  let target;
@@ -13156,12 +13290,10 @@ class CheckBoxSelection {
13156
13290
  e.preventDefault();
13157
13291
  }
13158
13292
  changeState(wrapper, state, e, isPrevent, selectAll$$1) {
13159
- let ariaState;
13160
13293
  const frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME$1)[0];
13161
13294
  if (state === 'check' && !frameSpan.classList.contains(CHECK$1)) {
13162
13295
  frameSpan.classList.remove(INDETERMINATE);
13163
13296
  frameSpan.classList.add(CHECK$1);
13164
- ariaState = 'true';
13165
13297
  if (selectAll$$1) {
13166
13298
  this.parent.selectAllItems(true, e);
13167
13299
  this.setLocale(true);
@@ -13169,7 +13301,6 @@ class CheckBoxSelection {
13169
13301
  }
13170
13302
  else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK$1) || frameSpan.classList.contains(INDETERMINATE))) {
13171
13303
  removeClass([frameSpan], [CHECK$1, INDETERMINATE]);
13172
- ariaState = 'false';
13173
13304
  if (selectAll$$1) {
13174
13305
  this.parent.selectAllItems(false, e);
13175
13306
  this.setLocale();
@@ -13178,16 +13309,11 @@ class CheckBoxSelection {
13178
13309
  else if (state === 'indeterminate' && !(frameSpan.classList.contains(INDETERMINATE))) {
13179
13310
  removeClass([frameSpan], [CHECK$1]);
13180
13311
  frameSpan.classList.add(INDETERMINATE);
13181
- ariaState = 'false';
13182
13312
  if (selectAll$$1) {
13183
13313
  this.parent.selectAllItems(false, e);
13184
13314
  this.setLocale();
13185
13315
  }
13186
13316
  }
13187
- ariaState = state === 'check' ? 'true' : state === 'uncheck' ? 'false' : ariaState;
13188
- if (!isNullOrUndefined(ariaState)) {
13189
- wrapper.setAttribute('aria-checked', ariaState);
13190
- }
13191
13317
  }
13192
13318
  setSearchBox(args) {
13193
13319
  if (isNullOrUndefined(this.parent.filterParent)) {
@@ -13348,8 +13474,8 @@ class CheckBoxSelection {
13348
13474
  e.preventDefault();
13349
13475
  }
13350
13476
  }
13351
- if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]')) &&
13352
- !this.parent.overAllWrapper.contains(e.target)) {
13477
+ if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
13478
+ && !isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target)) {
13353
13479
  if (this.parent.overAllWrapper.classList.contains(dropDownBaseClasses.focus) || this.parent.isPopupOpen()) {
13354
13480
  this.parent.inputFocus = false;
13355
13481
  this.parent.scrollFocusStatus = false;
@@ -13362,7 +13488,7 @@ class CheckBoxSelection {
13362
13488
  this.parent.scrollFocusStatus = (Browser.isIE || Browser.info.name === 'edge') &&
13363
13489
  (document.activeElement === this.filterInput);
13364
13490
  }
13365
- if (!this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
13491
+ if (!isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
13366
13492
  !this.parent.isPopupOpen()) {
13367
13493
  if (Browser.isIE) {
13368
13494
  this.parent.onBlurHandler();
@@ -13393,7 +13519,7 @@ class CheckBoxSelection {
13393
13519
  }
13394
13520
  }
13395
13521
  checkSelectAll(e) {
13396
- if (e.value === 'check' && this.checkAllParent.getAttribute('aria-checked') !== 'true') {
13522
+ if (e.value === 'check') {
13397
13523
  this.changeState(this.checkAllParent, e.value, null, null, false);
13398
13524
  this.setLocale(true);
13399
13525
  }
@@ -13550,6 +13676,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13550
13676
  this.isCustomFiltering = false;
13551
13677
  this.initialSelectedOptions = this.value;
13552
13678
  super.render();
13679
+ this.setEnabled();
13553
13680
  this.renderComplete();
13554
13681
  }
13555
13682
  initWrapper() {
@@ -13840,14 +13967,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13840
13967
  triggerDrag(args) {
13841
13968
  let scrollParent;
13842
13969
  let boundRect;
13843
- let scrollMoved = 36;
13970
+ const scrollMoved = 36;
13844
13971
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13845
- let event = args.event;
13972
+ const event = args.event;
13846
13973
  let wrapper;
13847
- if (args.target && (args.target.classList.contains("e-listbox-wrapper") || args.target.classList.contains("e-list-item")
13848
- || args.target.classList.contains("e-filter-parent") || args.target.classList.contains("e-input-group"))) {
13849
- if (args.target.classList.contains("e-list-item") || args.target.classList.contains("e-filter-parent")
13850
- || args.target.classList.contains("e-input-group")) {
13974
+ if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
13975
+ || args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
13976
+ if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
13977
+ || args.target.classList.contains('e-input-group')) {
13851
13978
  wrapper = args.target.closest('.e-listbox-wrapper');
13852
13979
  }
13853
13980
  else {
@@ -13901,7 +14028,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13901
14028
  const getArgs = this.getDragArgs({ target: args.droppedElement }, true);
13902
14029
  const sourceArgs = { previousData: this.dataSource };
13903
14030
  const destArgs = { previousData: listObj.dataSource };
13904
- let dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource }, previousIndex: args.previousIndex, currentIndex: args.currentIndex });
14031
+ let dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
14032
+ previousIndex: args.previousIndex, currentIndex: args.currentIndex });
13905
14033
  if (listObj !== this) {
13906
14034
  const sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
13907
14035
  dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
@@ -13995,14 +14123,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13995
14123
  currIdx++;
13996
14124
  });
13997
14125
  if (this.fields.groupBy) {
13998
- let sourceElem = this.renderItems(this.listData, this.fields);
14126
+ const sourceElem = this.renderItems(this.listData, this.fields);
13999
14127
  this.updateListItems(sourceElem, this.ulElement);
14000
14128
  this.setSelection();
14001
14129
  }
14002
14130
  if (listObj.sortOrder !== 'None' || this.selectionSettings.showCheckbox
14003
14131
  !== listObj.selectionSettings.showCheckbox || listObj.fields.groupBy || listObj.itemTemplate || this.itemTemplate) {
14004
14132
  const sortable = getComponent(ul, 'sortable');
14005
- let sourceElem = listObj.renderItems(listData, listObj.fields);
14133
+ const sourceElem = listObj.renderItems(listData, listObj.fields);
14006
14134
  listObj.updateListItems(sourceElem, ul);
14007
14135
  this.setSelection();
14008
14136
  if (sortable.placeHolderElement) {
@@ -14029,7 +14157,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14029
14157
  dragArgs = extend(dragArgs, { destination: dragArgs1 });
14030
14158
  }
14031
14159
  this.trigger('drop', dragArgs);
14032
- let liCollElem = dragArgs.elements;
14160
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14161
+ const liCollElem = dragArgs.elements;
14033
14162
  if (liCollElem.length) {
14034
14163
  for (let i = 0; i < liCollElem.length; i++) {
14035
14164
  liCollElem[i].classList.remove('e-grabbed');
@@ -14038,7 +14167,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14038
14167
  }
14039
14168
  updateListItems(sourceElem, destElem) {
14040
14169
  const i = 0;
14041
- destElem.innerHTML = "";
14170
+ destElem.innerHTML = '';
14042
14171
  while (i < sourceElem.childNodes.length) {
14043
14172
  destElem.appendChild(sourceElem.childNodes[i]);
14044
14173
  }
@@ -14067,6 +14196,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14067
14196
  }
14068
14197
  return listObj;
14069
14198
  }
14199
+ /**
14200
+ * Sets the enabled state to DropDownBase.
14201
+ *
14202
+ * @returns {void}
14203
+ */
14204
+ setEnabled() {
14205
+ this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
14206
+ }
14070
14207
  listOption(dataSource, fields) {
14071
14208
  this.listCurrentOptions = super.listOption(dataSource, fields);
14072
14209
  this.listCurrentOptions = extend({}, this.listCurrentOptions, { itemCreated: this.triggerBeforeItemRender.bind(this) }, true);
@@ -14098,7 +14235,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14098
14235
  enableItems(items, enable = true, isValue) {
14099
14236
  let li;
14100
14237
  items.forEach((item) => {
14101
- let text = item;
14238
+ const text = item;
14102
14239
  li = this.findListElement(this.list, 'li', 'data-value', isValue ? text : this.getValueByText(text));
14103
14240
  if (!li) {
14104
14241
  return;
@@ -14503,9 +14640,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14503
14640
  prepend([this.filterParent], this.list);
14504
14641
  attributes(this.filterInput, {
14505
14642
  'aria-disabled': 'false',
14506
- 'aria-owns': this.element.id + '_options',
14507
- 'role': 'listbox',
14508
- 'aria-activedescendant': null,
14643
+ 'aria-label': 'search list item',
14509
14644
  'autocomplete': 'off',
14510
14645
  'autocorrect': 'off',
14511
14646
  'autocapitalize': 'off',
@@ -14829,7 +14964,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14829
14964
  });
14830
14965
  if (isRefresh) {
14831
14966
  if (fListBox.fields.groupBy) {
14832
- let sourceElem = fListBox.renderItems(listData, fListBox.fields);
14967
+ const sourceElem = fListBox.renderItems(listData, fListBox.fields);
14833
14968
  fListBox.updateListItems(sourceElem, fListBox.ulElement);
14834
14969
  }
14835
14970
  else {
@@ -14862,7 +14997,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14862
14997
  tListBox.jsonData = tJsonData;
14863
14998
  tListBox.sortedData = tSortData;
14864
14999
  if (isRefresh) {
14865
- let sourceElem = tListBox.renderItems(tListData, tListBox.fields);
15000
+ const sourceElem = tListBox.renderItems(tListData, tListBox.fields);
14866
15001
  tListBox.updateListItems(sourceElem, tListBox.ulElement);
14867
15002
  tListBox.setSelection();
14868
15003
  fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
@@ -14902,7 +15037,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14902
15037
  const isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
14903
15038
  fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
14904
15039
  this.removeSelected(fListBox, fListBox.getSelectedItems());
14905
- const tempItems = [].slice.call(fListBox.jsonData);
15040
+ const tempItems = [].slice.call(fListBox.listData);
14906
15041
  const localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
14907
15042
  fListBox.trigger('actionBegin', localDataArgs);
14908
15043
  if (localDataArgs.cancel) {
@@ -14947,11 +15082,18 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14947
15082
  fListBox.value = [];
14948
15083
  listData = listData
14949
15084
  .filter((data) => data.isHeader !== true);
14950
- tListBox.listData = tListBox.jsonData = listData;
14951
- if (fListBox.listData.length == fListBox.jsonData.length) {
15085
+ const sortedData = listData.filter(function (val) {
15086
+ return tListBox.jsonData.indexOf(val) === -1;
15087
+ });
15088
+ for (let i = 0; i < sortedData.length; i++) {
15089
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15090
+ tListBox.jsonData.splice(index + i, 0, sortedData[i]);
15091
+ }
15092
+ tListBox.listData = listData;
15093
+ if (fListBox.listData.length === fListBox.jsonData.length) {
14952
15094
  fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
14953
15095
  }
14954
- else if (this.allowFiltering) {
15096
+ else if (fListBox.allowFiltering) {
14955
15097
  for (let i = 0; i < fListBox.listData.length; i++) {
14956
15098
  for (let j = 0; j < fListBox.jsonData.length; j++) {
14957
15099
  if (fListBox.listData[i] === fListBox.jsonData[j]) {
@@ -14962,7 +15104,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14962
15104
  fListBox.listData = fListBox.sortedData = [];
14963
15105
  }
14964
15106
  if (isRefresh) {
14965
- let sourceElem = tListBox.renderItems(listData, tListBox.fields);
15107
+ const sourceElem = tListBox.renderItems(listData, tListBox.fields);
14966
15108
  tListBox.updateListItems(sourceElem, tListBox.ulElement);
14967
15109
  this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
14968
15110
  }
@@ -15093,7 +15235,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
15093
15235
  }
15094
15236
  }
15095
15237
  }
15096
- else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== "KeyA") {
15238
+ else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
15097
15239
  this.upDownKeyHandler(e);
15098
15240
  }
15099
15241
  }
@@ -15136,9 +15278,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
15136
15278
  this.selectHandler({ target: ul.children[fliIdx], ctrlKey: e.ctrlKey, shiftKey: e.shiftKey }, true);
15137
15279
  }
15138
15280
  if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
15139
- let selectedidx = Array.prototype.indexOf.call(ul.children, fli);
15140
- let sidx = e.code === "Home" ? 0 : selectedidx;
15141
- let eidx = e.code === "Home" ? selectedidx : ul.children.length - 1;
15281
+ const selectedidx = Array.prototype.indexOf.call(ul.children, fli);
15282
+ const sidx = e.code === 'Home' ? 0 : selectedidx;
15283
+ const eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
15142
15284
  for (let i = sidx; i <= eidx; i++) {
15143
15285
  const item = ul.children[i];
15144
15286
  this.notify('updatelist', { li: item, e: {
@@ -15292,7 +15434,6 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
15292
15434
  dvalue = this.getFormattedValue(li.getAttribute('data-value'));
15293
15435
  if (values.indexOf(dvalue) < 0) {
15294
15436
  li.getElementsByClassName('e-check')[0].classList.remove('e-check');
15295
- li.getElementsByClassName('e-checkbox-wrapper')[0].removeAttribute('aria-checked');
15296
15437
  li.removeAttribute('aria-selected');
15297
15438
  }
15298
15439
  });
@@ -15638,6 +15779,12 @@ __decorate$6([
15638
15779
  __decorate$6([
15639
15780
  Property('')
15640
15781
  ], ListBox.prototype, "height", void 0);
15782
+ __decorate$6([
15783
+ Property(true)
15784
+ ], ListBox.prototype, "enabled", void 0);
15785
+ __decorate$6([
15786
+ Property(false)
15787
+ ], ListBox.prototype, "enablePersistence", void 0);
15641
15788
  __decorate$6([
15642
15789
  Property(false)
15643
15790
  ], ListBox.prototype, "allowDragAndDrop", void 0);
@@ -15795,6 +15942,7 @@ let Mention = class Mention extends DropDownBase {
15795
15942
  this.isFiltered = false;
15796
15943
  this.beforePopupOpen = false;
15797
15944
  this.initRemoteRender = false;
15945
+ this.isListResetted = false;
15798
15946
  this.isPopupOpen = false;
15799
15947
  this.isCollided = false;
15800
15948
  this.lineBreak = false;
@@ -15861,6 +16009,7 @@ let Mention = class Mention extends DropDownBase {
15861
16009
  /**
15862
16010
  * Hides the spinner loader.
15863
16011
  *
16012
+ * @private
15864
16013
  * @returns {void}
15865
16014
  */
15866
16015
  hideSpinner() {
@@ -15916,6 +16065,7 @@ let Mention = class Mention extends DropDownBase {
15916
16065
  break;
15917
16066
  case 'tab':
15918
16067
  if (this.isPopupOpen) {
16068
+ e.preventDefault();
15919
16069
  const li = this.list.querySelector('.' + dropDownBaseClasses.selected);
15920
16070
  if (li) {
15921
16071
  this.setSelection(li, e);
@@ -15955,7 +16105,8 @@ let Mention = class Mention extends DropDownBase {
15955
16105
  let startIndex = 0;
15956
16106
  startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
15957
16107
  index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
15958
- const nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex] : this.liCollections[index];
16108
+ const nextItem = isNullOrUndefined(this.activeIndex) ?
16109
+ this.liCollections[startIndex] : this.liCollections[index];
15959
16110
  if (!isNullOrUndefined(nextItem)) {
15960
16111
  this.setSelection(nextItem, e);
15961
16112
  }
@@ -15980,9 +16131,14 @@ let Mention = class Mention extends DropDownBase {
15980
16131
  }
15981
16132
  let currentRange = this.getTextRange();
15982
16133
  const lastWordRange = this.getLastLetter(currentRange);
16134
+ // eslint-disable-next-line security/detect-non-literal-regexp
15983
16135
  const Regex = new RegExp(this.mentionChar, 'g');
15984
16136
  const charRegex = new RegExp('[a-zA-Z]', 'g');
15985
16137
  if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
16138
+ if ((e.keyCode === 37 || e.keyCode === 39) && !isNullOrUndefined(currentRange) &&
16139
+ currentRange.indexOf(this.mentionChar) === -1 && this.isPopupOpen) {
16140
+ this.hidePopup();
16141
+ }
15986
16142
  return;
15987
16143
  }
15988
16144
  if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
@@ -16011,7 +16167,7 @@ let Mention = class Mention extends DropDownBase {
16011
16167
  if (!this.isContentEditable(this.inputElement)) {
16012
16168
  this.showPopup();
16013
16169
  }
16014
- else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement) {
16170
+ else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement && e.keyCode !== 9) {
16015
16171
  this.showPopup();
16016
16172
  }
16017
16173
  }
@@ -16040,8 +16196,12 @@ let Mention = class Mention extends DropDownBase {
16040
16196
  this.searchLists(e);
16041
16197
  }
16042
16198
  else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
16043
- this.resetList(this.dataSource, this.fields);
16199
+ this.searchLists(e);
16200
+ if (!this.isListResetted) {
16201
+ this.resetList(this.dataSource, this.fields);
16202
+ }
16044
16203
  }
16204
+ this.isListResetted = false;
16045
16205
  }
16046
16206
  isMatchedText() {
16047
16207
  let isMatched = false;
@@ -16074,7 +16234,7 @@ let Mention = class Mention extends DropDownBase {
16074
16234
  this.activeIndex = null;
16075
16235
  const eventArgs = {
16076
16236
  preventDefaultAction: false,
16077
- text: this.elementValue(),
16237
+ text: this.queryString,
16078
16238
  updateData: (dataSource, query, fields) => {
16079
16239
  if (eventArgs.cancel) {
16080
16240
  return;
@@ -16092,8 +16252,9 @@ let Mention = class Mention extends DropDownBase {
16092
16252
  }
16093
16253
  filterAction(dataSource, query, fields) {
16094
16254
  this.beforePopupOpen = true;
16095
- if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
16255
+ if (this.queryString.length >= this.minLength) {
16096
16256
  this.resetList(dataSource, fields, query);
16257
+ this.isListResetted = true;
16097
16258
  }
16098
16259
  else {
16099
16260
  if (this.isPopupOpen) {
@@ -16214,12 +16375,14 @@ let Mention = class Mention extends DropDownBase {
16214
16375
  }
16215
16376
  }
16216
16377
  else {
16217
- const selectedElem = this.range.startContainer;
16218
- if (!isNullOrUndefined(selectedElem)) {
16219
- const workingNodeContent = selectedElem.textContent;
16220
- let selectStartOffset = this.range.startOffset;
16221
- if (workingNodeContent && selectStartOffset >= 0) {
16222
- text = workingNodeContent.substring(0, selectStartOffset);
16378
+ if (this.range) {
16379
+ const selectedElem = this.range.startContainer;
16380
+ if (!isNullOrUndefined(selectedElem)) {
16381
+ const workingNodeContent = selectedElem.textContent;
16382
+ const selectStartOffset = this.range.startOffset;
16383
+ if (workingNodeContent && selectStartOffset >= 0) {
16384
+ text = workingNodeContent.substring(0, selectStartOffset);
16385
+ }
16223
16386
  }
16224
16387
  }
16225
16388
  }
@@ -16231,7 +16394,7 @@ let Mention = class Mention extends DropDownBase {
16231
16394
  }
16232
16395
  const textValue = text.replace(/\u00A0/g, ' ');
16233
16396
  const words = textValue.split(/\s+/);
16234
- let wordCnt = words.length - 1;
16397
+ const wordCnt = words.length - 1;
16235
16398
  return words[wordCnt].trim();
16236
16399
  }
16237
16400
  isContentEditable(element) {
@@ -16243,6 +16406,10 @@ let Mention = class Mention extends DropDownBase {
16243
16406
  * @returns {void}
16244
16407
  */
16245
16408
  showPopup() {
16409
+ this.beforePopupOpen = true;
16410
+ if (isNullOrUndefined(this.list)) {
16411
+ this.initValue();
16412
+ }
16246
16413
  this.renderPopup();
16247
16414
  attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
16248
16415
  if (this.selectedElementID == null) {
@@ -16306,18 +16473,13 @@ let Mention = class Mention extends DropDownBase {
16306
16473
  }
16307
16474
  }
16308
16475
  append([this.list], popupEle);
16309
- if ((!this.popupObj || !document.body.contains(this.popupObj.element)) || !document.contains(popupEle) && isNullOrUndefined(this.target)) {
16476
+ if ((!this.popupObj || !document.body.contains(this.popupObj.element)) ||
16477
+ !document.contains(popupEle) && isNullOrUndefined(this.target)) {
16310
16478
  document.body.appendChild(popupEle);
16311
16479
  }
16312
16480
  let coordinates;
16313
16481
  popupEle.style.visibility = 'hidden';
16314
- if (this.popupHeight !== 'auto') {
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
- }
16482
+ this.setHeight(popupEle);
16321
16483
  const offsetValue = 0;
16322
16484
  const left = 0;
16323
16485
  this.initializePopup(popupEle, offsetValue, left);
@@ -16340,6 +16502,9 @@ let Mention = class Mention extends DropDownBase {
16340
16502
  if (!eventArgs.cancel) {
16341
16503
  this.renderReactTemplates();
16342
16504
  this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.inputElement : null);
16505
+ if (isNullOrUndefined(this.getTriggerCharPosition())) {
16506
+ return;
16507
+ }
16343
16508
  coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
16344
16509
  if (!this.isCollided) {
16345
16510
  popupEle.style.cssText = 'top: '.concat(coordinates.top.toString(), 'px;\n left: ').concat(coordinates.left.toString(), 'px;\nposition: absolute;\n display: block;');
@@ -16349,6 +16514,8 @@ let Mention = class Mention extends DropDownBase {
16349
16514
  this.isCollided = false;
16350
16515
  }
16351
16516
  popupEle.style.width = this.popupWidth !== '100%' && !isNullOrUndefined(this.popupWidth) ? formatUnit(this.popupWidth) : 'auto';
16517
+ this.setHeight(popupEle);
16518
+ popupEle.style.zIndex = this.zIndex === 1000 ? getZindexPartial(popupEle).toString() : this.zIndex.toString();
16352
16519
  }
16353
16520
  else {
16354
16521
  this.beforePopupOpen = false;
@@ -16361,6 +16528,15 @@ let Mention = class Mention extends DropDownBase {
16361
16528
  }
16362
16529
  });
16363
16530
  }
16531
+ setHeight(popupEle) {
16532
+ if (this.popupHeight !== 'auto') {
16533
+ this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
16534
+ popupEle.style.maxHeight = formatUnit(this.popupHeight);
16535
+ }
16536
+ else {
16537
+ popupEle.style.height = 'auto';
16538
+ }
16539
+ }
16364
16540
  checkCollision(popupEle) {
16365
16541
  if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
16366
16542
  const collision = isCollide(popupEle);
@@ -16440,7 +16616,9 @@ let Mention = class Mention extends DropDownBase {
16440
16616
  computed = getComputedStyle(element);
16441
16617
  div.style.position = 'absolute';
16442
16618
  div.style.visibility = 'hidden';
16619
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16443
16620
  properties.forEach((prop) => {
16621
+ // eslint-disable-next-line security/detect-object-injection
16444
16622
  div.style[prop] = computed[prop];
16445
16623
  });
16446
16624
  div.textContent = element.value.substring(0, position);
@@ -16474,13 +16652,12 @@ let Mention = class Mention extends DropDownBase {
16474
16652
  }
16475
16653
  else {
16476
16654
  coordinates = {
16477
- top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize),
16655
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
16478
16656
  left: rect.left + windowLeft
16479
16657
  };
16480
16658
  }
16481
16659
  return coordinates;
16482
16660
  }
16483
- ;
16484
16661
  initValue() {
16485
16662
  this.renderList();
16486
16663
  if (this.dataSource instanceof DataManager) {
@@ -16615,7 +16792,7 @@ let Mention = class Mention extends DropDownBase {
16615
16792
  const nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
16616
16793
  let nextOffset = this.list.scrollTop + nextBottom - currentOffset;
16617
16794
  nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
16618
- let boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
16795
+ const boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
16619
16796
  if (this.activeIndex === 0) {
16620
16797
  this.list.scrollTop = 0;
16621
16798
  }
@@ -16675,8 +16852,8 @@ let Mention = class Mention extends DropDownBase {
16675
16852
  }
16676
16853
  return items;
16677
16854
  }
16678
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
16679
16855
  setValue(e) {
16856
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16680
16857
  if (!this.isReact) {
16681
16858
  if (!isNullOrUndefined(this.displayTemplate)) {
16682
16859
  this.setDisplayTemplate();
@@ -16704,12 +16881,12 @@ let Mention = class Mention extends DropDownBase {
16704
16881
  const selection = this.inputElement.ownerDocument.getSelection();
16705
16882
  const startPos = this.getTriggerCharPosition();
16706
16883
  textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
16707
- if (dataItem.value !== null) {
16884
+ if (dataItem.text !== null) {
16708
16885
  value = this.mentionVal(dataItem.text);
16709
16886
  }
16710
16887
  if (!this.isContentEditable(this.inputElement)) {
16711
16888
  const myField = this.inputElement;
16712
- let currentTriggerSnippet = this.getTextRange().substring(startPos + this.mentionChar.length, this.getTextRange().length);
16889
+ const currentTriggerSnippet = this.getTextRange().substring(startPos + this.mentionChar.length, this.getTextRange().length);
16713
16890
  value += textSuffix;
16714
16891
  endPos = startPos + this.mentionChar.length;
16715
16892
  endPos += currentTriggerSnippet.length;
@@ -16736,6 +16913,7 @@ let Mention = class Mention extends DropDownBase {
16736
16913
  const frag = document.createDocumentFragment();
16737
16914
  let node;
16738
16915
  let lastNode;
16916
+ // eslint-disable-next-line no-cond-assign
16739
16917
  while (node = element.firstChild) {
16740
16918
  lastNode = frag.appendChild(node);
16741
16919
  }
@@ -16754,7 +16932,7 @@ let Mention = class Mention extends DropDownBase {
16754
16932
  }
16755
16933
  }
16756
16934
  mentionVal(value) {
16757
- let showChar = this.showMentionChar ? this.mentionChar : '';
16935
+ const showChar = this.showMentionChar ? this.mentionChar : '';
16758
16936
  if (!isNullOrUndefined(this.displayTemplate) && !isNullOrUndefined(this.displayTempElement)) {
16759
16937
  value = this.displayTempElement.innerHTML;
16760
16938
  }
@@ -16790,6 +16968,7 @@ let Mention = class Mention extends DropDownBase {
16790
16968
  this.displayTempElement.appendChild(displayCompTemp[i]);
16791
16969
  }
16792
16970
  }
16971
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16793
16972
  if (!this.isReact) {
16794
16973
  this.renderTemplates();
16795
16974
  }
@@ -16799,6 +16978,7 @@ let Mention = class Mention extends DropDownBase {
16799
16978
  });
16800
16979
  }
16801
16980
  }
16981
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16802
16982
  renderTemplates(callBack) {
16803
16983
  this.renderReactTemplates(callBack);
16804
16984
  }
@@ -16827,6 +17007,7 @@ let Mention = class Mention extends DropDownBase {
16827
17007
  this.spinnerTemplateElement.appendChild(spinnerCompTemp[i]);
16828
17008
  }
16829
17009
  }
17010
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16830
17011
  if (!this.isReact) {
16831
17012
  this.renderTemplates();
16832
17013
  this.popupObj.element.appendChild(this.spinnerTemplateElement);
@@ -16921,7 +17102,7 @@ let Mention = class Mention extends DropDownBase {
16921
17102
  this.setHover(currentLi);
16922
17103
  }
16923
17104
  setHover(li) {
16924
- if (this.enabled && this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
17105
+ if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
16925
17106
  this.removeHover();
16926
17107
  addClass([li], dropDownBaseClasses.hover);
16927
17108
  }
@@ -16946,8 +17127,13 @@ let Mention = class Mention extends DropDownBase {
16946
17127
  * @returns {void}
16947
17128
  */
16948
17129
  search(text, positionX, positionY) {
16949
- if ((this.ignoreCase && (text === this.elementValue() || text === this.elementValue().toLowerCase()))
16950
- || !this.ignoreCase && text === this.elementValue()) {
17130
+ if (this.isContentEditable(this.inputElement)) {
17131
+ this.range = this.getCurrentRange();
17132
+ }
17133
+ const currentRange = this.getTextRange();
17134
+ const lastWordRange = this.getLastLetter(currentRange);
17135
+ if ((this.ignoreCase && (text === lastWordRange || text === lastWordRange.toLowerCase()))
17136
+ || !this.ignoreCase && text === lastWordRange) {
16951
17137
  this.resetList(this.dataSource, this.fields);
16952
17138
  }
16953
17139
  else {