@syncfusion/ej2-dropdowns 20.4.54 → 21.1.36

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 (126) hide show
  1. package/CHANGELOG.md +1 -78
  2. package/dist/ej2-dropdowns.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-dropdowns.es2015.js +162 -56
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +158 -50
  8. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  9. package/dist/global/ej2-dropdowns.min.js +2 -2
  10. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +23 -36
  13. package/src/combo-box/combo-box.js +2 -0
  14. package/src/common/highlight-search.js +1 -1
  15. package/src/common/incremental-search.d.ts +3 -0
  16. package/src/common/incremental-search.js +7 -0
  17. package/src/drop-down-list/drop-down-list-model.d.ts +6 -6
  18. package/src/drop-down-list/drop-down-list.js +46 -18
  19. package/src/drop-down-tree/drop-down-tree-model.d.ts +2 -2
  20. package/src/drop-down-tree/drop-down-tree.d.ts +62 -6
  21. package/src/drop-down-tree/drop-down-tree.js +11 -11
  22. package/src/list-box/list-box.d.ts +15 -3
  23. package/src/list-box/list-box.js +3 -3
  24. package/src/mention/mention.d.ts +4 -0
  25. package/src/mention/mention.js +88 -17
  26. package/styles/bootstrap-dark.css +2 -15
  27. package/styles/bootstrap.css +2 -5
  28. package/styles/bootstrap4.css +3 -14
  29. package/styles/bootstrap5-dark.css +5 -8
  30. package/styles/bootstrap5.css +5 -8
  31. package/styles/drop-down-base/_bootstrap4-definition.scss +0 -8
  32. package/styles/drop-down-base/_bootstrap5-definition.scss +2 -2
  33. package/styles/drop-down-base/_fluent-definition.scss +2 -2
  34. package/styles/drop-down-base/_tailwind-definition.scss +2 -2
  35. package/styles/drop-down-base/_theme.scss +63 -10
  36. package/styles/drop-down-base/bootstrap-dark.css +2 -2
  37. package/styles/drop-down-base/bootstrap.css +2 -2
  38. package/styles/drop-down-base/bootstrap4.css +2 -10
  39. package/styles/drop-down-base/bootstrap5-dark.css +2 -2
  40. package/styles/drop-down-base/bootstrap5.css +2 -2
  41. package/styles/drop-down-base/fabric-dark.css +2 -2
  42. package/styles/drop-down-base/fabric.css +2 -2
  43. package/styles/drop-down-base/fluent-dark.css +2 -2
  44. package/styles/drop-down-base/fluent.css +2 -2
  45. package/styles/drop-down-base/highcontrast-light.css +2 -2
  46. package/styles/drop-down-base/highcontrast.css +2 -2
  47. package/styles/drop-down-base/material-dark.css +2 -2
  48. package/styles/drop-down-base/material.css +2 -2
  49. package/styles/drop-down-base/tailwind-dark.css +2 -2
  50. package/styles/drop-down-base/tailwind.css +2 -2
  51. package/styles/drop-down-list/_bootstrap4-definition.scss +1 -1
  52. package/styles/drop-down-list/_bootstrap5-definition.scss +6 -6
  53. package/styles/drop-down-list/_fluent-definition.scss +5 -5
  54. package/styles/drop-down-list/_layout.scss +1 -4
  55. package/styles/drop-down-list/_tailwind-definition.scss +1 -1
  56. package/styles/drop-down-list/bootstrap-dark.css +0 -3
  57. package/styles/drop-down-list/bootstrap.css +0 -3
  58. package/styles/drop-down-list/bootstrap4.css +1 -12
  59. package/styles/drop-down-list/bootstrap5-dark.css +0 -3
  60. package/styles/drop-down-list/bootstrap5.css +0 -3
  61. package/styles/drop-down-list/fabric-dark.css +0 -3
  62. package/styles/drop-down-list/fabric.css +0 -3
  63. package/styles/drop-down-list/fluent-dark.css +0 -3
  64. package/styles/drop-down-list/fluent.css +0 -3
  65. package/styles/drop-down-list/highcontrast-light.css +0 -3
  66. package/styles/drop-down-list/highcontrast.css +0 -3
  67. package/styles/drop-down-list/icons/_material3.scss +1 -1
  68. package/styles/drop-down-list/material-dark.css +1 -3
  69. package/styles/drop-down-list/material.css +0 -3
  70. package/styles/drop-down-list/tailwind-dark.css +1 -4
  71. package/styles/drop-down-list/tailwind.css +1 -4
  72. package/styles/drop-down-tree/_layout.scss +34 -14
  73. package/styles/drop-down-tree/_tailwind-definition.scss +1 -1
  74. package/styles/drop-down-tree/_theme.scss +1 -1
  75. package/styles/drop-down-tree/bootstrap4.css +0 -8
  76. package/styles/drop-down-tree/material-dark.css +1 -0
  77. package/styles/fabric-dark.css +2 -15
  78. package/styles/fabric.css +2 -5
  79. package/styles/fluent-dark.css +6 -9
  80. package/styles/fluent.css +6 -9
  81. package/styles/highcontrast-light.css +9 -15
  82. package/styles/highcontrast.css +15 -11
  83. package/styles/list-box/_bootstrap-dark-definition.scss +0 -3
  84. package/styles/list-box/_bootstrap-definition.scss +0 -3
  85. package/styles/list-box/_bootstrap4-definition.scss +0 -3
  86. package/styles/list-box/_bootstrap5-definition.scss +0 -3
  87. package/styles/list-box/_fabric-dark-definition.scss +0 -3
  88. package/styles/list-box/_fabric-definition.scss +0 -3
  89. package/styles/list-box/_fluent-definition.scss +0 -3
  90. package/styles/list-box/_fusionnew-definition.scss +0 -3
  91. package/styles/list-box/_highcontrast-definition.scss +0 -3
  92. package/styles/list-box/_highcontrast-light-definition.scss +0 -3
  93. package/styles/list-box/_material-dark-definition.scss +0 -3
  94. package/styles/list-box/_material-definition.scss +0 -3
  95. package/styles/list-box/_tailwind-definition.scss +0 -3
  96. package/styles/list-box/bootstrap4.css +0 -8
  97. package/styles/material-dark.css +4 -15
  98. package/styles/material.css +2 -5
  99. package/styles/mention/bootstrap4.css +0 -8
  100. package/styles/multi-select/_bootstrap5-definition.scss +6 -6
  101. package/styles/multi-select/_fluent-definition.scss +7 -7
  102. package/styles/multi-select/_highcontrast-definition.scss +8 -6
  103. package/styles/multi-select/_highcontrast-light-definition.scss +2 -0
  104. package/styles/multi-select/_layout.scss +94 -77
  105. package/styles/multi-select/_tailwind-definition.scss +2 -2
  106. package/styles/multi-select/_theme.scss +110 -22
  107. package/styles/multi-select/bootstrap4.css +0 -8
  108. package/styles/multi-select/bootstrap5-dark.css +3 -3
  109. package/styles/multi-select/bootstrap5.css +3 -3
  110. package/styles/multi-select/fluent-dark.css +4 -4
  111. package/styles/multi-select/fluent.css +4 -4
  112. package/styles/multi-select/highcontrast-light.css +7 -0
  113. package/styles/multi-select/highcontrast.css +13 -6
  114. package/styles/multi-select/icons/_material3.scss +670 -3
  115. package/styles/multi-select/tailwind-dark.css +2 -1
  116. package/styles/multi-select/tailwind.css +2 -1
  117. package/styles/tailwind-dark.css +5 -7
  118. package/styles/tailwind.css +5 -7
  119. package/styles/auto-complete/_material3-definition.scss +0 -2
  120. package/styles/combo-box/_material3-definition.scss +0 -2
  121. package/styles/drop-down-base/_material3-definition.scss +0 -117
  122. package/styles/drop-down-list/_material3-definition.scss +0 -201
  123. package/styles/drop-down-tree/_material3-definition.scss +0 -60
  124. package/styles/list-box/_material3-definition.scss +0 -120
  125. package/styles/mention/_material3-definition.scss +0 -1
  126. package/styles/multi-select/_material3-definition.scss +0 -226
@@ -6,6 +6,9 @@ import { Input, TextBox } from '@syncfusion/ej2-inputs';
6
6
  import { Button, createCheckBox } from '@syncfusion/ej2-buttons';
7
7
  import { TreeView } from '@syncfusion/ej2-navigations';
8
8
 
9
+ /**
10
+ * IncrementalSearch module file
11
+ */
9
12
  var queryString = '';
10
13
  var prevString = '';
11
14
  var matches$1 = [];
@@ -95,6 +98,7 @@ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, typ
95
98
  var fieldValue_1 = fields.text.split('.');
96
99
  dataSource.filter(function (data) {
97
100
  Array.prototype.slice.call(fieldValue_1).forEach(function (value) {
101
+ /* eslint-disable security/detect-object-injection */
98
102
  if (type === 'object' && checkField_1.textContent.toString().indexOf(data[value]) !== -1 && checkField_1.getAttribute('data-value') === data[fields.value].toString() || type === 'string' && checkField_1.textContent.toString().indexOf(data) !== -1) {
99
103
  filterValue = type === 'object' ? data[value] : data;
100
104
  }
@@ -102,6 +106,7 @@ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, typ
102
106
  });
103
107
  }
104
108
  text = dataSource && filterValue ? (ignoreCase ? filterValue.toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
109
+ /* eslint-disable security/detect-non-literal-regexp */
105
110
  if ((searchType === 'Equal' && text === queryStr) || (searchType === 'StartsWith' && text.substr(0, strLength) === queryStr) || (searchType === 'EndsWith' && text.substr(text.length - queryStr.length) === queryStr) || (searchType === 'Contains' && new RegExp(queryStr, "g").test(text))) {
106
111
  itemData.item = item;
107
112
  itemData.index = i;
@@ -114,9 +119,11 @@ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, typ
114
119
  return state_1.value;
115
120
  }
116
121
  return itemData;
122
+ /* eslint-enable security/detect-non-literal-regexp */
117
123
  }
118
124
  return itemData;
119
125
  }
126
+ /* eslint-enable security/detect-object-injection */
120
127
  function escapeCharRegExp(value) {
121
128
  return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
122
129
  }
@@ -129,7 +136,6 @@ function resetIncrementalSearchValues(elementId) {
129
136
  }
130
137
  }
131
138
 
132
- /* eslint-disable jsdoc/require-param, valid-jsdoc */
133
139
  /**
134
140
  * Function helps to find which highlightSearch is to call based on your data.
135
141
  *
@@ -149,6 +155,7 @@ function highlightSearch(element, query, ignoreCase, type) {
149
155
  query = /^[a-zA-Z0-9- ]*$/.test(query) ? query : query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
150
156
  var replaceQuery = type === 'StartsWith' ? '^(' + query + ')' : type === 'EndsWith' ?
151
157
  '(' + query + ')$' : '(' + query + ')';
158
+ // eslint-disable-next-line security/detect-non-literal-regexp
152
159
  findTextNode(element, new RegExp(replaceQuery, ignoreRegex));
153
160
  }
154
161
  }
@@ -1701,7 +1708,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1701
1708
  }
1702
1709
  else {
1703
1710
  if (this.allowFiltering && this.getModuleName() !== 'autocomplete'
1704
- && !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list) && this.actionCompleteData.list.length > 0) {
1711
+ && !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list) &&
1712
+ this.actionCompleteData.list.length > 0) {
1705
1713
  this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(true), this.actionCompleteData.list);
1706
1714
  }
1707
1715
  this.resetFocusElement();
@@ -1751,6 +1759,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1751
1759
  else if (htmlAttr === 'style') {
1752
1760
  this.inputWrapper.container.setAttribute('style', this.htmlAttributes["" + htmlAttr]);
1753
1761
  }
1762
+ else if (htmlAttr === 'aria-label') {
1763
+ if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
1764
+ this.inputElement.setAttribute('aria-label', this.htmlAttributes["" + htmlAttr]);
1765
+ }
1766
+ else {
1767
+ this.inputWrapper.container.setAttribute('aria-label', this.htmlAttributes["" + htmlAttr]);
1768
+ }
1769
+ }
1754
1770
  else {
1755
1771
  var defaultAttr = ['title', 'id', 'placeholder',
1756
1772
  'role', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
@@ -2122,7 +2138,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2122
2138
  var preventHomeEnd = this.getModuleName() !== 'dropdownlist' && (e.action === 'home' || e.action === 'end');
2123
2139
  this.isEscapeKey = e.action === 'escape';
2124
2140
  this.isTabKey = !this.isPopupOpen && e.action === 'tab';
2125
- var isNavAction = e.action === 'down' || e.action === 'up' || e.action === 'home' || e.action === 'end';
2126
2141
  var isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
2127
2142
  || e.action === 'home' || e.action === 'end');
2128
2143
  if ((this.isEditTextBox() || preventAction || preventHomeEnd) && !this.isPopupOpen) {
@@ -2206,7 +2221,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2206
2221
  startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
2207
2222
  index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
2208
2223
  }
2209
- var nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex] : this.liCollections[index];
2224
+ var nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
2225
+ : this.liCollections[index];
2210
2226
  if (!isNullOrUndefined(nextItem)) {
2211
2227
  this.setSelection(nextItem, e);
2212
2228
  }
@@ -2524,8 +2540,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2524
2540
  }
2525
2541
  if (Browser.info.name !== 'mozilla') {
2526
2542
  if (this.targetElement()) {
2527
- attributes(this.targetElement(), { 'aria-label': this.inputElement.value });
2528
- attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
2543
+ attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id !== '' ? this.inputElement.id : this.element.id });
2529
2544
  this.targetElement().removeAttribute('aria-live');
2530
2545
  }
2531
2546
  }
@@ -3010,7 +3025,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3010
3025
  if (this.value && this.dataSource instanceof DataManager) {
3011
3026
  var checkField_1 = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
3012
3027
  var fieldValue_1 = this.fields.value.split('.');
3013
- var checkVal = list.some(function (x) { return isNullOrUndefined(x[checkField_1]) && fieldValue_1.length > 1 ? _this.checkFieldValue(x, fieldValue_1) === _this.value : x[checkField_1] === _this.value; });
3028
+ var checkVal = list.some(function (x) {
3029
+ return isNullOrUndefined(x[checkField_1]) && fieldValue_1.length > 1 ?
3030
+ _this.checkFieldValue(x, fieldValue_1) === _this.value : x[checkField_1] === _this.value;
3031
+ });
3014
3032
  if (!checkVal) {
3015
3033
  this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField_1, 'equal', this.value)))
3016
3034
  .then(function (e) {
@@ -3060,7 +3078,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3060
3078
  }
3061
3079
  }
3062
3080
  };
3081
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3063
3082
  DropDownList.prototype.checkFieldValue = function (list, fieldValue) {
3083
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3064
3084
  var checkField = list;
3065
3085
  fieldValue.forEach(function (value) {
3066
3086
  checkField = checkField[value];
@@ -3100,8 +3120,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3100
3120
  }
3101
3121
  };
3102
3122
  DropDownList.prototype.actionCompleteDataUpdate = function (li, item, index) {
3103
- if (index != null) {
3104
- this.actionCompleteData.ulElement.insertBefore(li.cloneNode(true), this.actionCompleteData.ulElement.childNodes[index]);
3123
+ if (index !== null) {
3124
+ this.actionCompleteData.ulElement.
3125
+ insertBefore(li.cloneNode(true), this.actionCompleteData.ulElement.childNodes[index]);
3105
3126
  }
3106
3127
  else {
3107
3128
  this.actionCompleteData.ulElement.appendChild(li.cloneNode(true));
@@ -3145,7 +3166,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3145
3166
  this.trigger('beforeOpen', args, function (args) {
3146
3167
  if (!args.cancel) {
3147
3168
  var popupEle = _this.createElement('div', {
3148
- id: _this.element.id + '_popup', className: 'e-ddl e-popup ' + (_this.cssClass != null ? _this.cssClass : '')
3169
+ id: _this.element.id + '_popup', className: 'e-ddl e-popup ' + (_this.cssClass !== null ? _this.cssClass : '')
3149
3170
  });
3150
3171
  var searchBox = _this.setSearchBox(popupEle);
3151
3172
  _this.listHeight = formatUnit(_this.popupHeight);
@@ -3291,10 +3312,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3291
3312
  if (_this.isReact) {
3292
3313
  _this.clearTemplate(['headerTemplate', 'footerTemplate']);
3293
3314
  }
3294
- var isResetItem = (_this.getModuleName() === 'autocomplete') ? true : false;
3295
3315
  _this.isNotSearchList = false;
3296
3316
  _this.isDocumentClick = false;
3297
3317
  _this.destroyPopup();
3318
+ EventHandler.remove(document, 'mousedown', _this.onDocumentClick);
3298
3319
  if (_this.isFiltering() && _this.actionCompleteData.list && _this.actionCompleteData.list[0]) {
3299
3320
  _this.isActive = true;
3300
3321
  _this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);
@@ -3556,8 +3577,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3556
3577
  DropDownList.prototype.destroyPopup = function () {
3557
3578
  this.isPopupOpen = false;
3558
3579
  this.isFilterFocus = false;
3559
- this.popupObj.destroy();
3560
- detach(this.popupObj.element);
3580
+ if (this.popupObj) {
3581
+ this.popupObj.destroy();
3582
+ detach(this.popupObj.element);
3583
+ }
3561
3584
  };
3562
3585
  DropDownList.prototype.clickOnBackIcon = function () {
3563
3586
  this.hidePopup();
@@ -3592,7 +3615,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3592
3615
  if (!isNullOrUndefined(this.cssClass) && this.cssClass !== '') {
3593
3616
  updatedCssClassValues = (this.cssClass.replace(/\s+/g, ' ')).trim();
3594
3617
  }
3595
- if (!isNullOrUndefined(closest(this.element, "fieldset")) && closest(this.element, "fieldset").disabled) {
3618
+ if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
3596
3619
  this.enabled = false;
3597
3620
  }
3598
3621
  this.inputWrapper = Input.createInput({
@@ -3634,6 +3657,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3634
3657
  this.element.id = id;
3635
3658
  this.hiddenElement.id = id + '_hidden';
3636
3659
  this.targetElement().setAttribute('tabindex', this.tabIndex);
3660
+ if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
3661
+ this.inputElement.setAttribute('aria-label', this.getModuleName());
3662
+ }
3663
+ else {
3664
+ attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
3665
+ }
3637
3666
  attributes(this.targetElement(), this.getAriaAttributes());
3638
3667
  this.updateDataAttribute(this.htmlAttributes);
3639
3668
  this.setHTMLAttributes();
@@ -3979,14 +4008,16 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3979
4008
  }
3980
4009
  break;
3981
4010
  case 'valueTemplate':
3982
- if (!isNullOrUndefined(this_1.itemData) && this_1.valueTemplate != null) {
4011
+ if (!isNullOrUndefined(this_1.itemData) && this_1.valueTemplate !== null) {
3983
4012
  this_1.setValueTemplate();
3984
4013
  }
3985
4014
  break;
3986
4015
  case 'allowFiltering':
3987
4016
  if (this_1.allowFiltering) {
3988
- this_1.actionCompleteData = { ulElement: this_1.ulElement,
3989
- list: this_1.listData, isUpdated: true };
4017
+ this_1.actionCompleteData = {
4018
+ ulElement: this_1.ulElement,
4019
+ list: this_1.listData, isUpdated: true
4020
+ };
3990
4021
  this_1.actionData = this_1.actionCompleteData;
3991
4022
  this_1.updateSelectElementData(this_1.allowFiltering);
3992
4023
  }
@@ -4056,6 +4087,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4056
4087
  removeClass([this.inputWrapper.container], ['e-readonly']);
4057
4088
  }
4058
4089
  };
4090
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4059
4091
  DropDownList.prototype.setInputValue = function (newProp, oldProp) {
4060
4092
  };
4061
4093
  DropDownList.prototype.setCssClass = function (newClass, oldClass) {
@@ -4079,16 +4111,18 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4079
4111
  DropDownList.prototype.getModuleName = function () {
4080
4112
  return 'dropdownlist';
4081
4113
  };
4114
+ /* eslint-disable valid-jsdoc, jsdoc/require-param */
4082
4115
  /**
4083
4116
  * Opens the popup that displays the list of items.
4084
4117
  *
4085
4118
  * @returns {void}
4086
4119
  */
4087
4120
  DropDownList.prototype.showPopup = function (e) {
4121
+ /* eslint-enable valid-jsdoc, jsdoc/require-param */
4088
4122
  if (!this.enabled) {
4089
4123
  return;
4090
4124
  }
4091
- if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list != this.actionCompleteData.list) &&
4125
+ if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list !== this.actionCompleteData.list) &&
4092
4126
  this.actionData.list && this.actionData.ulElement) {
4093
4127
  this.actionCompleteData = this.actionData;
4094
4128
  this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
@@ -4117,7 +4151,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4117
4151
  };
4118
4152
  history.pushState({}, '');
4119
4153
  }
4120
- if (!isNullOrUndefined(this.list) && (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData))) {
4154
+ if (!isNullOrUndefined(this.list) && (!isNullOrUndefined(this.list.children[0]) ||
4155
+ this.list.classList.contains(dropDownBaseClasses.noData))) {
4121
4156
  this.renderPopup(e);
4122
4157
  }
4123
4158
  };
@@ -5477,7 +5512,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5477
5512
  if (isValid && this.value !== null && (this.value && this.value.length !== 0)) {
5478
5513
  addClass([this.inputEle], CHIP_INPUT);
5479
5514
  }
5480
- else if (this.value === null || (this.value && this.value.length === 0) || this.chipWrapper) {
5515
+ else if (this.value === null || (this.value && this.value.length === 0) || this.checkWrapper) {
5481
5516
  addClass([this.chipWrapper], HIDEICON);
5482
5517
  }
5483
5518
  }
@@ -5589,36 +5624,36 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5589
5624
  for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
5590
5625
  var htmlAttr = _a[_i];
5591
5626
  if (htmlAttr === 'class') {
5592
- this.inputWrapper.classList.add(this.htmlAttributes[htmlAttr]);
5627
+ this.inputWrapper.classList.add(this.htmlAttributes["" + htmlAttr]);
5593
5628
  }
5594
- else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {
5629
+ else if (htmlAttr === 'disabled' && this.htmlAttributes["" + htmlAttr] === 'disabled') {
5595
5630
  this.setProperties({ enabled: false }, true);
5596
5631
  this.setEnable();
5597
5632
  }
5598
- else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[htmlAttr])) {
5633
+ else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes["" + htmlAttr])) {
5599
5634
  this.setProperties({ readonly: true }, true);
5600
5635
  this.dataBind();
5601
5636
  }
5602
5637
  else if (htmlAttr === 'style') {
5603
- this.inputWrapper.setAttribute('style', this.htmlAttributes[htmlAttr]);
5638
+ this.inputWrapper.setAttribute('style', this.htmlAttributes["" + htmlAttr]);
5604
5639
  }
5605
5640
  else {
5606
5641
  var defaultAttr = ['title', 'id', 'placeholder', 'aria-placeholder',
5607
5642
  'role', 'autocorrect', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
5608
5643
  var validateAttr = ['name', 'required'];
5609
5644
  if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
5610
- this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
5645
+ this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
5611
5646
  }
5612
5647
  else if (defaultAttr.indexOf(htmlAttr) > -1) {
5613
5648
  if (htmlAttr === 'placeholder') {
5614
- Input.setPlaceholder(this.htmlAttributes[htmlAttr], this.inputEle);
5649
+ Input.setPlaceholder(this.htmlAttributes["" + htmlAttr], this.inputEle);
5615
5650
  }
5616
5651
  else {
5617
- this.inputEle.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
5652
+ this.inputEle.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
5618
5653
  }
5619
5654
  }
5620
5655
  else {
5621
- this.inputWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
5656
+ this.inputWrapper.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
5622
5657
  }
5623
5658
  }
5624
5659
  }
@@ -6036,7 +6071,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6036
6071
  this.isDocumentClick = false;
6037
6072
  e.preventDefault();
6038
6073
  }
6039
- else if (!this.inputWrapper.contains(target) && this.inputFocus && !isFilter) {
6074
+ else if (this.inputWrapper != null && !this.inputWrapper.contains(target) && this.inputFocus && !isFilter) {
6040
6075
  this.focusOut(e);
6041
6076
  }
6042
6077
  };
@@ -6441,7 +6476,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6441
6476
  }
6442
6477
  };
6443
6478
  DropDownTree.prototype.ensurePlaceHolder = function () {
6444
- if (this.value && this.value.length === 0) {
6479
+ if (isNullOrUndefined(this.value) || (this.value && this.value.length === 0)) {
6445
6480
  removeClass([this.inputEle], CHIP_INPUT);
6446
6481
  if (this.chipWrapper) {
6447
6482
  addClass([this.chipWrapper], HIDEICON);
@@ -8231,6 +8266,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
8231
8266
  ComboBox.prototype.filter = function (dataSource, query, fields) {
8232
8267
  _super.prototype.filter.call(this, dataSource, query, fields);
8233
8268
  };
8269
+ /* eslint-disable valid-jsdoc, jsdoc/require-param */
8234
8270
  /**
8235
8271
  * Opens the popup that displays the list of items.
8236
8272
  *
@@ -8238,6 +8274,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
8238
8274
  * @deprecated
8239
8275
  */
8240
8276
  ComboBox.prototype.showPopup = function (e) {
8277
+ /* eslint-enable valid-jsdoc, jsdoc/require-param */
8241
8278
  _super.prototype.showPopup.call(this, e);
8242
8279
  };
8243
8280
  /* eslint-disable valid-jsdoc, jsdoc/require-param */
@@ -14095,7 +14132,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14095
14132
  ListBox.prototype.setCssClass = function () {
14096
14133
  var wrap = this.toolbarSettings.items.length ? this.list.parentElement : this.list;
14097
14134
  if (this.cssClass) {
14098
- addClass([wrap], this.cssClass.split(' '));
14135
+ addClass([wrap], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
14099
14136
  }
14100
14137
  if (this.enableRtl) {
14101
14138
  addClass([this.list], 'e-rtl');
@@ -15744,7 +15781,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15744
15781
  text = value;
15745
15782
  }
15746
15783
  if (typeof (text) === 'string') {
15747
- text = text.split("\\").join("\\\\");
15784
+ text = text.split('\\').join('\\\\');
15748
15785
  }
15749
15786
  li = _this.list.querySelector('[data-value="' + text + '"]');
15750
15787
  if (li) {
@@ -15948,7 +15985,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15948
15985
  removeClass([wrap], oldProp.cssClass.split(' '));
15949
15986
  }
15950
15987
  if (newProp.cssClass) {
15951
- addClass([wrap], newProp.cssClass.split(' '));
15988
+ addClass([wrap], newProp.cssClass.replace(/\s+/g, ' ').trim().split(' '));
15952
15989
  }
15953
15990
  break;
15954
15991
  case 'enableRtl':
@@ -16293,8 +16330,11 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16293
16330
  * @returns {void}
16294
16331
  */
16295
16332
  Mention.prototype.render = function () {
16296
- this.inputElement = !isNullOrUndefined(this.target) ? ((typeof this.target) === 'string') ?
16297
- document.querySelector(this.target) : this.target : this.element;
16333
+ var isSelector = typeof this.target === 'string';
16334
+ this.inputElement = !isNullOrUndefined(this.target) ?
16335
+ this.checkAndUpdateInternalComponent(isSelector
16336
+ ? document.querySelector(this.target)
16337
+ : this.target) : this.element;
16298
16338
  if (this.isContentEditable(this.inputElement)) {
16299
16339
  this.inputElement.setAttribute('contenteditable', 'true');
16300
16340
  addClass([this.inputElement], ['e-mention']);
@@ -16302,6 +16342,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16302
16342
  addClass([this.inputElement], ['e-editable-element']);
16303
16343
  }
16304
16344
  }
16345
+ this.inputElement.setAttribute('role', 'textbox');
16305
16346
  this.queryString = this.elementValue();
16306
16347
  this.wireEvent();
16307
16348
  };
@@ -16337,6 +16378,18 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16337
16378
  detach(this.spinnerTemplateElement);
16338
16379
  }
16339
16380
  };
16381
+ Mention.prototype.checkAndUpdateInternalComponent = function (targetElement) {
16382
+ if (!this.isVue && targetElement.classList.contains('e-richtexteditor')) {
16383
+ return targetElement.querySelector('.e-content');
16384
+ }
16385
+ if (this.isVue && targetElement.nodeName === 'TEXTAREA' && targetElement.classList.contains('e-rte-hidden')) {
16386
+ var parentElement = targetElement.parentElement;
16387
+ if (parentElement && parentElement.classList.contains('e-richtexteditor')) {
16388
+ return parentElement.querySelector('.e-content');
16389
+ }
16390
+ }
16391
+ return targetElement;
16392
+ };
16340
16393
  /**
16341
16394
  * Shows the spinner loader.
16342
16395
  *
@@ -16393,7 +16446,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16393
16446
  if (this.isPopupOpen) {
16394
16447
  e.preventDefault();
16395
16448
  if (this.popupObj && this.popupObj.element.contains(this.selectedLI)) {
16396
- this.setValue(e);
16449
+ this.updateSelectedItem(this.selectedLI, e, false, true);
16397
16450
  }
16398
16451
  }
16399
16452
  break;
@@ -16439,6 +16492,10 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16439
16492
  };
16440
16493
  Mention.prototype.onKeyUp = function (e) {
16441
16494
  var rangetextContent;
16495
+ this.isTyped = e.code !== 'Enter' && e.code !== 'Space' && e.code !== 'ArrowDown' && e.code !== 'ArrowUp' ? true : false;
16496
+ if (document.activeElement != this.inputElement) {
16497
+ this.inputElement.focus();
16498
+ }
16442
16499
  if (this.isContentEditable(this.inputElement)) {
16443
16500
  this.range = this.getCurrentRange();
16444
16501
  rangetextContent = this.range.startContainer.textContent.split('');
@@ -16449,10 +16506,6 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16449
16506
  var Regex = new RegExp(this.mentionChar, 'g');
16450
16507
  var charRegex = new RegExp('[a-zA-Z]', 'g');
16451
16508
  if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
16452
- if ((e.keyCode === 37 || e.keyCode === 39) && !isNullOrUndefined(currentRange) &&
16453
- currentRange.indexOf(this.mentionChar) === -1 && this.isPopupOpen) {
16454
- this.hidePopup();
16455
- }
16456
16509
  return;
16457
16510
  }
16458
16511
  if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
@@ -16467,7 +16520,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16467
16520
  this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
16468
16521
  this.searchLists(e);
16469
16522
  }
16470
- else if (this.isPopupOpen && (!this.allowSpaces || !lastWordRange)) {
16523
+ else if (this.isPopupOpen && (!this.allowSpaces || !lastWordRange) && (e.code !== 'ArrowDown' && e.code !== 'ArrowUp')) {
16471
16524
  this.hidePopup();
16472
16525
  this.lineBreak = true;
16473
16526
  }
@@ -16497,6 +16550,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16497
16550
  this.initValue();
16498
16551
  }
16499
16552
  if (!this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
16553
+ this.didPopupOpenByTypingInitialChar = true;
16500
16554
  this.showPopup();
16501
16555
  if (this.initRemoteRender && this.list.querySelectorAll('li').length === 0) {
16502
16556
  this.showWaitingSpinner();
@@ -16723,6 +16777,17 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16723
16777
  */
16724
16778
  Mention.prototype.showPopup = function () {
16725
16779
  this.beforePopupOpen = true;
16780
+ if (document.activeElement != this.inputElement) {
16781
+ this.inputElement.focus();
16782
+ }
16783
+ this.queryString = this.didPopupOpenByTypingInitialChar ? this.queryString : '';
16784
+ this.didPopupOpenByTypingInitialChar = false;
16785
+ if (this.isContentEditable(this.inputElement)) {
16786
+ this.range = this.getCurrentRange();
16787
+ }
16788
+ if (!this.isTyped) {
16789
+ this.resetList(this.dataSource, this.fields);
16790
+ }
16726
16791
  if (isNullOrUndefined(this.list)) {
16727
16792
  this.initValue();
16728
16793
  }
@@ -16857,7 +16922,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16857
16922
  });
16858
16923
  };
16859
16924
  Mention.prototype.setHeight = function (popupEle) {
16860
- if (this.popupHeight !== 'auto') {
16925
+ if (this.popupHeight !== 'auto' && this.list) {
16861
16926
  this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
16862
16927
  popupEle.style.maxHeight = formatUnit(this.popupHeight);
16863
16928
  }
@@ -16886,7 +16951,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16886
16951
  mostRecentTriggerCharPos = idx;
16887
16952
  }
16888
16953
  }
16889
- return mostRecentTriggerCharPos;
16954
+ return mostRecentTriggerCharPos ? mostRecentTriggerCharPos : 0;
16890
16955
  };
16891
16956
  Mention.prototype.initializePopup = function (element, offsetValue, left) {
16892
16957
  var _this = this;
@@ -16964,14 +17029,37 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16964
17029
  var selectedNodePosition = this.getTriggerCharPosition();
16965
17030
  globalRange = this.range;
16966
17031
  range = document.createRange();
16967
- range.setStart(globalRange.startContainer, selectedNodePosition);
16968
- range.setEnd(globalRange.startContainer, selectedNodePosition);
17032
+ if (this.getTextRange() && this.getTextRange().lastIndexOf(this.mentionChar) !== -1 && this.isTyped) {
17033
+ range.setStart(globalRange.startContainer, selectedNodePosition);
17034
+ range.setEnd(globalRange.startContainer, selectedNodePosition);
17035
+ }
17036
+ else {
17037
+ range.setStart(globalRange.startContainer, globalRange.startOffset);
17038
+ range.setEnd(globalRange.startContainer, globalRange.endOffset);
17039
+ }
17040
+ this.isTyped = false;
16969
17041
  range.collapse(false);
16970
- rect = range.getBoundingClientRect();
17042
+ rect = range.getBoundingClientRect().top === 0 ? range.startContainer.getClientRects()[0] : range.getBoundingClientRect();
16971
17043
  }
16972
17044
  var doc = document.documentElement;
16973
17045
  var windowLeft = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
16974
17046
  var windowTop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
17047
+ var width = 0;
17048
+ if (!isNullOrUndefined(range) && range.getBoundingClientRect().top === 0) {
17049
+ for (var i = 0; i < this.range.startContainer.childNodes.length; i++) {
17050
+ if (this.range.startContainer.childNodes[i].nodeType !== Node.TEXT_NODE && this.range.startContainer.childNodes[i].textContent.trim() !== '') {
17051
+ width += this.range.startContainer.childNodes[i].getClientRects()[0].width;
17052
+ }
17053
+ else if (this.range.startContainer.childNodes[i].textContent !== '') {
17054
+ var span_1 = document.createElement("span");
17055
+ span_1.innerHTML = this.range.startContainer.childNodes[i].nodeValue;
17056
+ document.body.appendChild(span_1);
17057
+ var textNodeWidth = span_1.offsetWidth;
17058
+ document.body.removeChild(span_1);
17059
+ width += textNodeWidth;
17060
+ }
17061
+ }
17062
+ }
16975
17063
  if (!this.isContentEditable(this.inputElement)) {
16976
17064
  coordinates = {
16977
17065
  top: rect.top + windowTop + span.offsetTop + parseInt(computed.borderTopWidth, 10) +
@@ -16983,7 +17071,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
16983
17071
  else {
16984
17072
  coordinates = {
16985
17073
  top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10) - (this.isCollided ? 10 : 0),
16986
- left: rect.left + windowLeft
17074
+ left: rect.left + windowLeft + width
16987
17075
  };
16988
17076
  }
16989
17077
  return coordinates;
@@ -17034,6 +17122,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17034
17122
  if (!this.isValidLI(li)) {
17035
17123
  return;
17036
17124
  }
17125
+ this.isSelected = true;
17037
17126
  this.setSelection(li, e);
17038
17127
  var delay = 100;
17039
17128
  this.closePopup(delay, e);
@@ -17046,7 +17135,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17046
17135
  this.removeHover();
17047
17136
  var value = this.getFormattedValue(li.getAttribute('data-value'));
17048
17137
  var selectedData = this.getDataByValue(value);
17049
- if (!preventSelect && !isNullOrUndefined(e)) {
17138
+ if (!preventSelect && !isNullOrUndefined(e) && !(e.action === "down" || e.action === "up")) {
17050
17139
  var items = this.detachChanges(selectedData);
17051
17140
  this.isSelected = true;
17052
17141
  var eventArgs = {
@@ -17059,6 +17148,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17059
17148
  this.trigger('select', eventArgs, function (eventArgs) {
17060
17149
  if (eventArgs.cancel) {
17061
17150
  li.classList.remove(dropDownBaseClasses.selected);
17151
+ _this.isSelected = false;
17152
+ _this.isSelectCancel = true;
17062
17153
  }
17063
17154
  else {
17064
17155
  _this.selectEventCallback(li, selectedData, value);
@@ -17212,6 +17303,10 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17212
17303
  var selection = this.inputElement.ownerDocument.getSelection();
17213
17304
  var startPos = this.getTriggerCharPosition();
17214
17305
  textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
17306
+ if (this.isSelectCancel) {
17307
+ this.isSelectCancel = false;
17308
+ return;
17309
+ }
17215
17310
  if (dataItem.text !== null) {
17216
17311
  value = this.mentionVal(dataItem.text);
17217
17312
  }
@@ -17236,8 +17331,21 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
17236
17331
  }
17237
17332
  globalRange = this.range;
17238
17333
  range = document.createRange();
17239
- range.setStart(globalRange.startContainer, startPos);
17240
- range.setEnd(globalRange.startContainer, endPos);
17334
+ if (((this.getTextRange() && this.getTextRange().lastIndexOf(this.mentionChar) !== -1 && this.isTyped) || this.getTextRange() && this.getTextRange().trim() === '@')) {
17335
+ range.setStart(globalRange.startContainer, startPos);
17336
+ range.setEnd(globalRange.startContainer, endPos);
17337
+ }
17338
+ else {
17339
+ if (globalRange.commonAncestorContainer.textContent.trim() !== '' && !isNullOrUndefined(globalRange.commonAncestorContainer.textContent.trim()) && this.getTextRange() && this.getTextRange().lastIndexOf(this.mentionChar) !== -1) {
17340
+ range.setStart(globalRange.startContainer, globalRange.startOffset - 1);
17341
+ range.setEnd(globalRange.startContainer, globalRange.endOffset - 1);
17342
+ }
17343
+ else {
17344
+ range.setStart(globalRange.startContainer, globalRange.startOffset);
17345
+ range.setEnd(globalRange.startContainer, globalRange.endOffset);
17346
+ }
17347
+ }
17348
+ this.isTyped = false;
17241
17349
  range.deleteContents();
17242
17350
  var element = this.createElement('div');
17243
17351
  element.innerHTML = value;