@syncfusion/ej2-dropdowns 20.3.60 → 20.4.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +2 -44
  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 +485 -310
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +471 -296
  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 +11 -11
  13. package/src/auto-complete/auto-complete-model.d.ts +1 -1
  14. package/src/combo-box/combo-box.js +7 -5
  15. package/src/drop-down-base/drop-down-base-model.d.ts +0 -18
  16. package/src/drop-down-base/drop-down-base.d.ts +0 -22
  17. package/src/drop-down-base/drop-down-base.js +42 -37
  18. package/src/drop-down-list/drop-down-list-model.d.ts +18 -0
  19. package/src/drop-down-list/drop-down-list.d.ts +22 -0
  20. package/src/drop-down-list/drop-down-list.js +95 -41
  21. package/src/drop-down-tree/drop-down-tree-model.d.ts +15 -1
  22. package/src/drop-down-tree/drop-down-tree.d.ts +13 -1
  23. package/src/drop-down-tree/drop-down-tree.js +22 -5
  24. package/src/list-box/list-box-model.d.ts +18 -0
  25. package/src/list-box/list-box.d.ts +22 -0
  26. package/src/list-box/list-box.js +27 -14
  27. package/src/mention/mention-model.d.ts +2 -2
  28. package/src/mention/mention.d.ts +4 -1
  29. package/src/mention/mention.js +66 -27
  30. package/src/multi-select/checkbox-selection.js +10 -8
  31. package/src/multi-select/multi-select.js +203 -156
  32. package/styles/bootstrap5-dark.css +2 -2
  33. package/styles/bootstrap5.css +2 -2
  34. package/styles/drop-down-base/_bootstrap-dark-definition.scss +1 -0
  35. package/styles/drop-down-base/_bootstrap-definition.scss +1 -0
  36. package/styles/drop-down-base/_bootstrap4-definition.scss +1 -0
  37. package/styles/drop-down-base/_bootstrap5-definition.scss +1 -0
  38. package/styles/drop-down-base/_fabric-dark-definition.scss +1 -0
  39. package/styles/drop-down-base/_fabric-definition.scss +1 -0
  40. package/styles/drop-down-base/_fluent-definition.scss +1 -0
  41. package/styles/drop-down-base/_fusionnew-definition.scss +1 -0
  42. package/styles/drop-down-base/_highcontrast-definition.scss +1 -0
  43. package/styles/drop-down-base/_highcontrast-light-definition.scss +1 -0
  44. package/styles/drop-down-base/_layout.scss +1 -1
  45. package/styles/drop-down-base/_material-dark-definition.scss +1 -0
  46. package/styles/drop-down-base/_material-definition.scss +1 -0
  47. package/styles/drop-down-base/_material3-definition.scss +1 -0
  48. package/styles/drop-down-base/_tailwind-definition.scss +1 -0
  49. package/styles/drop-down-base/material-dark.css +1 -1
  50. package/styles/drop-down-tree/_layout.scss +3 -3
  51. package/styles/drop-down-tree/bootstrap5-dark.css +2 -2
  52. package/styles/drop-down-tree/bootstrap5.css +2 -2
  53. package/styles/material-dark.css +1 -1
  54. package/.eslintrc.json +0 -244
  55. package/tslint.json +0 -111
@@ -215,8 +215,12 @@ var DropDownList = /** @class */ (function (_super) {
215
215
  this.resetFocusElement();
216
216
  }
217
217
  }
218
- this.hiddenElement.innerHTML = '';
219
- this.inputElement.value = '';
218
+ if (!isNullOrUndefined(this.hiddenElement)) {
219
+ this.hiddenElement.innerHTML = '';
220
+ }
221
+ if (!isNullOrUndefined(this.inputElement)) {
222
+ this.inputElement.value = '';
223
+ }
220
224
  this.value = null;
221
225
  this.itemData = null;
222
226
  this.text = null;
@@ -239,21 +243,21 @@ var DropDownList = /** @class */ (function (_super) {
239
243
  for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
240
244
  var htmlAttr = _a[_i];
241
245
  if (htmlAttr === 'class') {
242
- var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
246
+ var updatedClassValue = (this.htmlAttributes["" + htmlAttr].replace(/\s+/g, ' ')).trim();
243
247
  if (updatedClassValue !== '') {
244
248
  addClass([this.inputWrapper.container], updatedClassValue.split(' '));
245
249
  }
246
250
  }
247
- else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {
251
+ else if (htmlAttr === 'disabled' && this.htmlAttributes["" + htmlAttr] === 'disabled') {
248
252
  this.enabled = false;
249
253
  this.setEnable();
250
254
  }
251
- else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[htmlAttr])) {
255
+ else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes["" + htmlAttr])) {
252
256
  this.readonly = true;
253
257
  this.dataBind();
254
258
  }
255
259
  else if (htmlAttr === 'style') {
256
- this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);
260
+ this.inputWrapper.container.setAttribute('style', this.htmlAttributes["" + htmlAttr]);
257
261
  }
258
262
  else {
259
263
  var defaultAttr = ['title', 'id', 'placeholder',
@@ -263,18 +267,18 @@ var DropDownList = /** @class */ (function (_super) {
263
267
  defaultAttr.push('tabindex');
264
268
  }
265
269
  if (validateAttr.indexOf(htmlAttr) > -1 || htmlAttr.indexOf('data') === 0) {
266
- this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
270
+ this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
267
271
  }
268
272
  else if (defaultAttr.indexOf(htmlAttr) > -1) {
269
273
  if (htmlAttr === 'placeholder') {
270
- Input.setPlaceholder(this.htmlAttributes[htmlAttr], this.inputElement);
274
+ Input.setPlaceholder(this.htmlAttributes["" + htmlAttr], this.inputElement);
271
275
  }
272
276
  else {
273
- this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
277
+ this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
274
278
  }
275
279
  }
276
280
  else {
277
- this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
281
+ this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
278
282
  }
279
283
  }
280
284
  }
@@ -330,7 +334,7 @@ var DropDownList = /** @class */ (function (_super) {
330
334
  }
331
335
  };
332
336
  DropDownList.prototype.targetElement = function () {
333
- return this.inputWrapper.container;
337
+ return !isNullOrUndefined(this.inputWrapper) ? this.inputWrapper.container : null;
334
338
  };
335
339
  DropDownList.prototype.getNgDirective = function () {
336
340
  return 'EJS-DROPDOWNLIST';
@@ -489,7 +493,7 @@ var DropDownList = /** @class */ (function (_super) {
489
493
  }
490
494
  };
491
495
  DropDownList.prototype.unBindCommonEvent = function () {
492
- if (this.targetElement()) {
496
+ if (!isNullOrUndefined(this.inputWrapper) && this.targetElement()) {
493
497
  EventHandler.remove(this.targetElement(), 'blur', this.onBlurHandler);
494
498
  }
495
499
  var formElement = this.inputElement && closest(this.inputElement, 'form');
@@ -519,9 +523,11 @@ var DropDownList = /** @class */ (function (_super) {
519
523
  * @returns {void}
520
524
  */
521
525
  DropDownList.prototype.wireListEvents = function () {
522
- EventHandler.add(this.list, 'click', this.onMouseClick, this);
523
- EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
524
- EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
526
+ if (!isNullOrUndefined(this.list)) {
527
+ EventHandler.add(this.list, 'click', this.onMouseClick, this);
528
+ EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
529
+ EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
530
+ }
525
531
  };
526
532
  DropDownList.prototype.onSearch = function (e) {
527
533
  if (e.charCode !== 32 && e.charCode !== 13) {
@@ -799,9 +805,11 @@ var DropDownList = /** @class */ (function (_super) {
799
805
  this.setSelection(previousItem, event);
800
806
  };
801
807
  DropDownList.prototype.unWireEvent = function () {
802
- EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
803
- EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
804
- EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
808
+ if (!isNullOrUndefined(this.inputWrapper)) {
809
+ EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
810
+ EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
811
+ EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
812
+ }
805
813
  this.unBindCommonEvent();
806
814
  };
807
815
  /**
@@ -810,9 +818,11 @@ var DropDownList = /** @class */ (function (_super) {
810
818
  * @returns {void}
811
819
  */
812
820
  DropDownList.prototype.unWireListEvents = function () {
813
- EventHandler.remove(this.list, 'click', this.onMouseClick);
814
- EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
815
- EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
821
+ if (this.list) {
822
+ EventHandler.remove(this.list, 'click', this.onMouseClick);
823
+ EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
824
+ EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
825
+ }
816
826
  };
817
827
  DropDownList.prototype.checkSelector = function (id) {
818
828
  return '[id="' + id.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g, '\\$1') + '"]';
@@ -820,7 +830,7 @@ var DropDownList = /** @class */ (function (_super) {
820
830
  DropDownList.prototype.onDocumentClick = function (e) {
821
831
  var target = e.target;
822
832
  if (!(!isNullOrUndefined(this.popupObj) && closest(target, this.checkSelector(this.popupObj.element.id))) &&
823
- !this.inputWrapper.container.contains(e.target)) {
833
+ !isNullOrUndefined(this.inputWrapper) && !this.inputWrapper.container.contains(e.target)) {
824
834
  if (this.inputWrapper.container.classList.contains(dropDownListClasses.inputFocus) || this.isPopupOpen) {
825
835
  this.isDocumentClick = true;
826
836
  var isActive = this.isRequested;
@@ -1018,9 +1028,11 @@ var DropDownList = /** @class */ (function (_super) {
1018
1028
  this.setScrollPosition(e);
1019
1029
  }
1020
1030
  if (Browser.info.name !== 'mozilla') {
1021
- attributes(this.targetElement(), { 'aria-label': this.inputElement.value });
1022
- attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
1023
- this.targetElement().removeAttribute('aria-live');
1031
+ attributes(this.inputElement, { 'aria-label': this.inputElement.value });
1032
+ if (this.targetElement()) {
1033
+ attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
1034
+ this.targetElement().removeAttribute('aria-live');
1035
+ }
1024
1036
  }
1025
1037
  if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
1026
1038
  attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
@@ -1191,9 +1203,11 @@ var DropDownList = /** @class */ (function (_super) {
1191
1203
  selectedElement.setAttribute('value', this.value.toString());
1192
1204
  }
1193
1205
  else {
1194
- this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
1195
- var selectedElement = this.hiddenElement.querySelector('option');
1196
- selectedElement.setAttribute('value', this.value.toString());
1206
+ if (!isNullOrUndefined(this.hiddenElement)) {
1207
+ this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
1208
+ var selectedElement = this.hiddenElement.querySelector('option');
1209
+ selectedElement.setAttribute('value', this.value.toString());
1210
+ }
1197
1211
  }
1198
1212
  }
1199
1213
  else {
@@ -1532,7 +1546,7 @@ var DropDownList = /** @class */ (function (_super) {
1532
1546
  && ((this.dataSource instanceof DataManager)
1533
1547
  || (!isNullOrUndefined(this.dataSource) && !isNullOrUndefined(this.dataSource.length) &&
1534
1548
  this.dataSource.length !== 0)))) {
1535
- if (this.itemTemplate && (this.element.tagName === 'EJS-COMBOBOX' || this.element.tagName === 'EJS-DROPDOWNLIST') && this.allowFiltering) {
1549
+ if (this.itemTemplate && this.element.tagName === 'EJS-COMBOBOX' && this.allowFiltering) {
1536
1550
  setTimeout(function () {
1537
1551
  _this.updateActionCompleteDataValues(ulElement, list);
1538
1552
  }, 0);
@@ -1683,9 +1697,11 @@ var DropDownList = /** @class */ (function (_super) {
1683
1697
  (_this.isDropDownClick && _this.getModuleName() === 'combobox')))) {
1684
1698
  offsetValue = _this.getOffsetValue(popupEle);
1685
1699
  var firstItem = _this.isEmptyList() ? _this.list : _this.liCollections[0];
1686
- left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
1687
- parseInt(getComputedStyle(_this.inputElement).paddingLeft, 10) +
1688
- parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
1700
+ if (!isNullOrUndefined(_this.inputElement)) {
1701
+ left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
1702
+ parseInt(getComputedStyle(_this.inputElement).paddingLeft, 10) +
1703
+ parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
1704
+ }
1689
1705
  }
1690
1706
  _this.getFocusElement();
1691
1707
  _this.createPopup(popupEle, offsetValue, left);
@@ -1731,9 +1747,13 @@ var DropDownList = /** @class */ (function (_super) {
1731
1747
  var eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
1732
1748
  _this.trigger('open', eventArgs, function (eventArgs) {
1733
1749
  if (!eventArgs.cancel) {
1734
- addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
1750
+ if (!isNullOrUndefined(_this.inputWrapper)) {
1751
+ addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
1752
+ }
1735
1753
  _this.renderReactTemplates();
1736
- _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);
1754
+ if (!isNullOrUndefined(_this.popupObj)) {
1755
+ _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);
1756
+ }
1737
1757
  }
1738
1758
  else {
1739
1759
  _this.beforePopupOpen = false;
@@ -1992,11 +2012,13 @@ var DropDownList = /** @class */ (function (_super) {
1992
2012
  EventHandler.remove(this.backIconElement, 'click', this.clickOnBackIcon);
1993
2013
  EventHandler.remove(this.clearIconElement, 'click', this.clearText);
1994
2014
  }
1995
- EventHandler.remove(this.filterInput, 'input', this.onInput);
1996
- EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);
1997
- EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);
1998
- EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
1999
- EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
2015
+ if (!isNullOrUndefined(this.filterInput)) {
2016
+ EventHandler.remove(this.filterInput, 'input', this.onInput);
2017
+ EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);
2018
+ EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);
2019
+ EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
2020
+ EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
2021
+ }
2000
2022
  this.filterInput = null;
2001
2023
  }
2002
2024
  attributes(this.targetElement(), { 'aria-expanded': 'false' });
@@ -2131,6 +2153,7 @@ var DropDownList = /** @class */ (function (_super) {
2131
2153
  this.text = isNullOrUndefined(this.value) ? null : selectElement.options[selectElement.selectedIndex].textContent;
2132
2154
  this.initValue();
2133
2155
  }
2156
+ this.setEnabled();
2134
2157
  this.preventTabIndex(this.element);
2135
2158
  if (!this.enabled) {
2136
2159
  this.targetElement().tabIndex = -1;
@@ -2215,6 +2238,14 @@ var DropDownList = /** @class */ (function (_super) {
2215
2238
  var contentEle = popupEle.querySelector('div.e-content');
2216
2239
  popupEle.insertBefore(this.header, contentEle);
2217
2240
  };
2241
+ /**
2242
+ * Sets the enabled state to DropDownBase.
2243
+ *
2244
+ * @returns {void}
2245
+ */
2246
+ DropDownList.prototype.setEnabled = function () {
2247
+ this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
2248
+ };
2218
2249
  DropDownList.prototype.setOldText = function (text) {
2219
2250
  this.text = text;
2220
2251
  };
@@ -2590,7 +2621,7 @@ var DropDownList = /** @class */ (function (_super) {
2590
2621
  };
2591
2622
  history.pushState({}, '');
2592
2623
  }
2593
- if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
2624
+ if (!isNullOrUndefined(this.list) && (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData))) {
2594
2625
  this.renderPopup(e);
2595
2626
  }
2596
2627
  };
@@ -2606,7 +2637,9 @@ var DropDownList = /** @class */ (function (_super) {
2606
2637
  DropDownList.prototype.hidePopup = function (e) {
2607
2638
  /* eslint-enable valid-jsdoc, jsdoc/require-param */
2608
2639
  if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
2609
- Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
2640
+ if (!isNullOrUndefined(this.inputElement)) {
2641
+ Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
2642
+ }
2610
2643
  this.isEscapeKey = false;
2611
2644
  if (!isNullOrUndefined(this.index)) {
2612
2645
  var element = this.findListElement(this.ulElement, 'li', 'data-value', this.value);
@@ -2716,6 +2749,21 @@ var DropDownList = /** @class */ (function (_super) {
2716
2749
  this.inputWrapper.container.parentElement.insertBefore(this.element, this.inputWrapper.container);
2717
2750
  detach(this.inputWrapper.container);
2718
2751
  }
2752
+ this.hiddenElement = null;
2753
+ this.inputWrapper = null;
2754
+ this.keyboardModule = null;
2755
+ this.ulElement = null;
2756
+ this.list = null;
2757
+ this.popupObj = null;
2758
+ this.rippleFun = null;
2759
+ this.selectedLI = null;
2760
+ this.liCollections = null;
2761
+ this.item = null;
2762
+ this.inputWrapper = null;
2763
+ this.footer = null;
2764
+ this.header = null;
2765
+ this.previousSelectedLI = null;
2766
+ this.valueTempElement = null;
2719
2767
  _super.prototype.destroy.call(this);
2720
2768
  };
2721
2769
  /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
@@ -2757,6 +2805,12 @@ var DropDownList = /** @class */ (function (_super) {
2757
2805
  __decorate([
2758
2806
  Property('100%')
2759
2807
  ], DropDownList.prototype, "width", void 0);
2808
+ __decorate([
2809
+ Property(true)
2810
+ ], DropDownList.prototype, "enabled", void 0);
2811
+ __decorate([
2812
+ Property(false)
2813
+ ], DropDownList.prototype, "enablePersistence", void 0);
2760
2814
  __decorate([
2761
2815
  Property('300px')
2762
2816
  ], DropDownList.prototype, "popupHeight", void 0);
@@ -58,6 +58,12 @@ export interface FieldsModel {
58
58
  */
59
59
  query?: Query;
60
60
 
61
+ /**
62
+ * Specifies whether the node can be selected by users or not
63
+ * When set to false, the user interaction is prevented for the corresponding node.
64
+ */
65
+ selectable?: string;
66
+
61
67
  /**
62
68
  * Specifies the mapping field for the selected state of the Dropdown Tree item.
63
69
  */
@@ -199,7 +205,7 @@ export interface DropDownTreeModel extends ComponentModel{
199
205
  *
200
206
  * @default {value: 'value', text: 'text', dataSource: [], child: 'child', parentValue: 'parentValue', hasChildren: 'hasChildren',
201
207
  * expanded: 'expanded', htmlAttributes: 'htmlAttributes', iconCss: 'iconCss', imageUrl: 'imageUrl',
202
- * query: null, selected: 'selected', tableName: null, tooltip: 'tooltip'}
208
+ * query: null, selected: 'selected', selectable: 'selectable', tableName: null, tooltip: 'tooltip' }
203
209
  */
204
210
  fields?: FieldsModel;
205
211
 
@@ -370,6 +376,14 @@ export interface DropDownTreeModel extends ComponentModel{
370
376
  */
371
377
  showCheckBox?: boolean;
372
378
 
379
+ /**
380
+ * Specifies whether to allow rendering of untrusted HTML values in the Dropdown Tree component.
381
+ * While enable this property, it sanitize suspected untrusted strings and script, and update in the Dropdown Tree component.
382
+ *
383
+ * @default false
384
+ */
385
+ enableHtmlSanitizer?: boolean;
386
+
373
387
  /**
374
388
  * Specifies whether to show or hide the clear icon in textbox.
375
389
  * When the clear button is clicked, `value`, `text` properties will be reset to null.
@@ -50,6 +50,11 @@ export declare class Fields extends ChildProperty<Fields> {
50
50
  * @default null
51
51
  */
52
52
  query: Query;
53
+ /**
54
+ * Specifies whether the node can be selected by users or not
55
+ * When set to false, the user interaction is prevented for the corresponding node.
56
+ */
57
+ selectable: string;
53
58
  /**
54
59
  * Specifies the mapping field for the selected state of the Dropdown Tree item.
55
60
  */
@@ -345,7 +350,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
345
350
  *
346
351
  * @default {value: 'value', text: 'text', dataSource: [], child: 'child', parentValue: 'parentValue', hasChildren: 'hasChildren',
347
352
  * expanded: 'expanded', htmlAttributes: 'htmlAttributes', iconCss: 'iconCss', imageUrl: 'imageUrl',
348
- * query: null, selected: 'selected', tableName: null, tooltip: 'tooltip'}
353
+ * query: null, selected: 'selected', selectable: 'selectable', tableName: null, tooltip: 'tooltip' }
349
354
  */
350
355
  fields: FieldsModel;
351
356
  /**
@@ -499,6 +504,13 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
499
504
  * @default false
500
505
  */
501
506
  showCheckBox: boolean;
507
+ /**
508
+ * Specifies whether to allow rendering of untrusted HTML values in the Dropdown Tree component.
509
+ * While enable this property, it sanitize suspected untrusted strings and script, and update in the Dropdown Tree component.
510
+ *
511
+ * @default false
512
+ */
513
+ enableHtmlSanitizer: boolean;
502
514
  /**
503
515
  * Specifies whether to show or hide the clear icon in textbox.
504
516
  * When the clear button is clicked, `value`, `text` properties will be reset to null.
@@ -107,6 +107,9 @@ var Fields = /** @class */ (function (_super) {
107
107
  __decorate([
108
108
  Property(null)
109
109
  ], Fields.prototype, "query", void 0);
110
+ __decorate([
111
+ Property('selectable')
112
+ ], Fields.prototype, "selectable", void 0);
110
113
  __decorate([
111
114
  Property('selected')
112
115
  ], Fields.prototype, "selected", void 0);
@@ -918,7 +921,12 @@ var DropDownTree = /** @class */ (function (_super) {
918
921
  temp = this.getOverflowVal(index);
919
922
  data += temp;
920
923
  temp = this.overFlowWrapper.innerHTML;
921
- this.overFlowWrapper.innerHTML = data;
924
+ if (this.enableHtmlSanitizer) {
925
+ this.overFlowWrapper.innerText = data;
926
+ }
927
+ else {
928
+ this.overFlowWrapper.innerHTML = data;
929
+ }
922
930
  wrapperleng = this.overFlowWrapper.offsetWidth;
923
931
  overAllContainer = this.inputWrapper.offsetWidth;
924
932
  if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
@@ -1450,6 +1458,7 @@ var DropDownTree = /** @class */ (function (_super) {
1450
1458
  nodeClicked: this.onNodeClicked.bind(this),
1451
1459
  dataBound: this.OnDataBound.bind(this),
1452
1460
  allowMultiSelection: this.allowMultiSelection,
1461
+ enableHtmlSanitizer: this.enableHtmlSanitizer,
1453
1462
  showCheckBox: this.showCheckBox,
1454
1463
  autoCheck: this.treeSettings.autoCheck,
1455
1464
  sortOrder: this.sortOrder,
@@ -1742,7 +1751,7 @@ var DropDownTree = /** @class */ (function (_super) {
1742
1751
  dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
1743
1752
  child: this.cloneChildField(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
1744
1753
  iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes, query: fields.query,
1745
- selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
1754
+ selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
1746
1755
  };
1747
1756
  return clonedField;
1748
1757
  };
@@ -1755,7 +1764,7 @@ var DropDownTree = /** @class */ (function (_super) {
1755
1764
  dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
1756
1765
  child: (fields.child ? this.cloneChildField(fields.child) : null), hasChildren: fields.hasChildren,
1757
1766
  expanded: fields.expanded, iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes,
1758
- query: fields.query, selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
1767
+ query: fields.query, selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
1759
1768
  };
1760
1769
  return clonedField;
1761
1770
  }
@@ -1765,7 +1774,7 @@ var DropDownTree = /** @class */ (function (_super) {
1765
1774
  dataSource: fields.dataSource, id: fields.value, text: fields.text, parentID: fields.parentValue,
1766
1775
  child: this.getTreeChildren(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
1767
1776
  iconCss: fields.iconCss, imageUrl: fields.imageUrl, isChecked: fields.selected,
1768
- htmlAttributes: fields.htmlAttributes, query: fields.query, selected: fields.selected,
1777
+ htmlAttributes: fields.htmlAttributes, query: fields.query, selectable: fields.selectable, selected: fields.selected,
1769
1778
  tableName: fields.tableName, tooltip: fields.tooltip
1770
1779
  };
1771
1780
  return treeFields;
@@ -2260,7 +2269,12 @@ var DropDownTree = /** @class */ (function (_super) {
2260
2269
  });
2261
2270
  var chipContent = this.createElement('span', { className: CHIP_CONTENT });
2262
2271
  var chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
2263
- chipContent.innerHTML = text;
2272
+ if (this.enableHtmlSanitizer) {
2273
+ chipContent.innerText = text;
2274
+ }
2275
+ else {
2276
+ chipContent.innerHTML = text;
2277
+ }
2264
2278
  chip.appendChild(chipContent);
2265
2279
  this.chipCollection.appendChild(chip);
2266
2280
  if (this.showClearButton) {
@@ -3083,6 +3097,9 @@ var DropDownTree = /** @class */ (function (_super) {
3083
3097
  __decorate([
3084
3098
  Property(false)
3085
3099
  ], DropDownTree.prototype, "showCheckBox", void 0);
3100
+ __decorate([
3101
+ Property(false)
3102
+ ], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
3086
3103
  __decorate([
3087
3104
  Property(true)
3088
3105
  ], DropDownTree.prototype, "showClearButton", void 0);
@@ -93,6 +93,24 @@ export interface ListBoxModel extends DropDownBaseModel{
93
93
  */
94
94
  height?: number | string;
95
95
 
96
+ /**
97
+ * Specifies a value that indicates whether the component is enabled or not.
98
+ *
99
+ * @default true
100
+
101
+ */
102
+ enabled?: boolean;
103
+
104
+ /**
105
+ * Enable or disable persisting component's state between page reloads.
106
+ * If enabled, following list of states will be persisted.
107
+ * 1. value
108
+ *
109
+ * @default false
110
+
111
+ */
112
+ enablePersistence?: boolean;
113
+
96
114
  /**
97
115
  * If 'allowDragAndDrop' is set to true, then you can perform drag and drop of the list item.
98
116
  * ListBox contains same 'scope' property enables drag and drop between multiple ListBox.
@@ -141,6 +141,22 @@ export declare class ListBox extends DropDownBase {
141
141
  * @default ''
142
142
  */
143
143
  height: number | string;
144
+ /**
145
+ * Specifies a value that indicates whether the component is enabled or not.
146
+ *
147
+ * @default true
148
+
149
+ */
150
+ enabled: boolean;
151
+ /**
152
+ * Enable or disable persisting component's state between page reloads.
153
+ * If enabled, following list of states will be persisted.
154
+ * 1. value
155
+ *
156
+ * @default false
157
+
158
+ */
159
+ enablePersistence: boolean;
144
160
  /**
145
161
  * If 'allowDragAndDrop' is set to true, then you can perform drag and drop of the list item.
146
162
  * ListBox contains same 'scope' property enables drag and drop between multiple ListBox.
@@ -342,6 +358,12 @@ export declare class ListBox extends DropDownBase {
342
358
  private removeSelected;
343
359
  private getCurIdx;
344
360
  private getComponent;
361
+ /**
362
+ * Sets the enabled state to DropDownBase.
363
+ *
364
+ * @returns {void}
365
+ */
366
+ protected setEnabled(): void;
345
367
  protected listOption(dataSource: obj[] | string[] | number[] | boolean[], fields: FieldSettingsModel): FieldSettingsModel;
346
368
  private triggerBeforeItemRender;
347
369
  requiredModules(): ModuleDeclaration[];
@@ -130,6 +130,7 @@ var ListBox = /** @class */ (function (_super) {
130
130
  this.isCustomFiltering = false;
131
131
  this.initialSelectedOptions = this.value;
132
132
  _super.prototype.render.call(this);
133
+ this.setEnabled();
133
134
  this.renderComplete();
134
135
  };
135
136
  ListBox.prototype.initWrapper = function () {
@@ -427,10 +428,10 @@ var ListBox = /** @class */ (function (_super) {
427
428
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
428
429
  var event = args.event;
429
430
  var wrapper;
430
- if (args.target && (args.target.classList.contains("e-listbox-wrapper") || args.target.classList.contains("e-list-item")
431
- || args.target.classList.contains("e-filter-parent") || args.target.classList.contains("e-input-group"))) {
432
- if (args.target.classList.contains("e-list-item") || args.target.classList.contains("e-filter-parent")
433
- || args.target.classList.contains("e-input-group")) {
431
+ if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
432
+ || args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
433
+ if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
434
+ || args.target.classList.contains('e-input-group')) {
434
435
  wrapper = args.target.closest('.e-listbox-wrapper');
435
436
  }
436
437
  else {
@@ -485,7 +486,8 @@ var ListBox = /** @class */ (function (_super) {
485
486
  var getArgs = this.getDragArgs({ target: args.droppedElement }, true);
486
487
  var sourceArgs = { previousData: this.dataSource };
487
488
  var destArgs = { previousData: listObj.dataSource };
488
- var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource }, previousIndex: args.previousIndex, currentIndex: args.currentIndex });
489
+ var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
490
+ previousIndex: args.previousIndex, currentIndex: args.currentIndex });
489
491
  if (listObj !== this) {
490
492
  var sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
491
493
  dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
@@ -622,7 +624,7 @@ var ListBox = /** @class */ (function (_super) {
622
624
  };
623
625
  ListBox.prototype.updateListItems = function (sourceElem, destElem) {
624
626
  var i = 0;
625
- destElem.innerHTML = "";
627
+ destElem.innerHTML = '';
626
628
  while (i < sourceElem.childNodes.length) {
627
629
  destElem.appendChild(sourceElem.childNodes[i]);
628
630
  }
@@ -651,6 +653,14 @@ var ListBox = /** @class */ (function (_super) {
651
653
  }
652
654
  return listObj;
653
655
  };
656
+ /**
657
+ * Sets the enabled state to DropDownBase.
658
+ *
659
+ * @returns {void}
660
+ */
661
+ ListBox.prototype.setEnabled = function () {
662
+ this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
663
+ };
654
664
  ListBox.prototype.listOption = function (dataSource, fields) {
655
665
  this.listCurrentOptions = _super.prototype.listOption.call(this, dataSource, fields);
656
666
  this.listCurrentOptions = extend({}, this.listCurrentOptions, { itemCreated: this.triggerBeforeItemRender.bind(this) }, true);
@@ -1100,9 +1110,7 @@ var ListBox = /** @class */ (function (_super) {
1100
1110
  prepend([this.filterParent], this.list);
1101
1111
  attributes(this.filterInput, {
1102
1112
  'aria-disabled': 'false',
1103
- 'aria-owns': this.element.id + '_options',
1104
- 'role': 'listbox',
1105
- 'aria-activedescendant': null,
1113
+ 'aria-label': 'search list item',
1106
1114
  'autocomplete': 'off',
1107
1115
  'autocorrect': 'off',
1108
1116
  'autocapitalize': 'off',
@@ -1550,7 +1558,7 @@ var ListBox = /** @class */ (function (_super) {
1550
1558
  listData = listData
1551
1559
  .filter(function (data) { return data.isHeader !== true; });
1552
1560
  tListBox.listData = tListBox.jsonData = listData;
1553
- if (fListBox.listData.length == fListBox.jsonData.length) {
1561
+ if (fListBox.listData.length === fListBox.jsonData.length) {
1554
1562
  fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
1555
1563
  }
1556
1564
  else if (this.allowFiltering) {
@@ -1696,7 +1704,7 @@ var ListBox = /** @class */ (function (_super) {
1696
1704
  }
1697
1705
  }
1698
1706
  }
1699
- else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== "KeyA") {
1707
+ else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
1700
1708
  this.upDownKeyHandler(e);
1701
1709
  }
1702
1710
  }
@@ -1740,8 +1748,8 @@ var ListBox = /** @class */ (function (_super) {
1740
1748
  }
1741
1749
  if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
1742
1750
  var selectedidx = Array.prototype.indexOf.call(ul.children, fli);
1743
- var sidx = e.code === "Home" ? 0 : selectedidx;
1744
- var eidx = e.code === "Home" ? selectedidx : ul.children.length - 1;
1751
+ var sidx = e.code === 'Home' ? 0 : selectedidx;
1752
+ var eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
1745
1753
  for (var i = sidx; i <= eidx; i++) {
1746
1754
  var item = ul.children[i];
1747
1755
  this.notify('updatelist', { li: item, e: {
@@ -1899,7 +1907,6 @@ var ListBox = /** @class */ (function (_super) {
1899
1907
  dvalue_1 = _this.getFormattedValue(li.getAttribute('data-value'));
1900
1908
  if (values.indexOf(dvalue_1) < 0) {
1901
1909
  li.getElementsByClassName('e-check')[0].classList.remove('e-check');
1902
- li.getElementsByClassName('e-checkbox-wrapper')[0].removeAttribute('aria-checked');
1903
1910
  li.removeAttribute('aria-selected');
1904
1911
  }
1905
1912
  });
@@ -2251,6 +2258,12 @@ var ListBox = /** @class */ (function (_super) {
2251
2258
  __decorate([
2252
2259
  Property('')
2253
2260
  ], ListBox.prototype, "height", void 0);
2261
+ __decorate([
2262
+ Property(true)
2263
+ ], ListBox.prototype, "enabled", void 0);
2264
+ __decorate([
2265
+ Property(false)
2266
+ ], ListBox.prototype, "enablePersistence", void 0);
2254
2267
  __decorate([
2255
2268
  Property(false)
2256
2269
  ], ListBox.prototype, "allowDragAndDrop", void 0);
@@ -1,4 +1,4 @@
1
- import { KeyboardEvents, compile, Property, EventHandler, Animation, AnimationModel, KeyboardEventArgs, formatUnit, append, attributes } from '@syncfusion/ej2-base';import { isNullOrUndefined, detach, Event, EmitType, Complex, addClass, removeClass, closest, isUndefined, getValue, NotifyPropertyChanges, Browser } from '@syncfusion/ej2-base';import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';import { FieldSettings, FilteringEventArgs, FilterType } from '../drop-down-base/drop-down-base';import { DropDownBase, PopupEventArgs, SelectEventArgs, BeforeOpenEventArgs, dropDownBaseClasses } from '../drop-down-base/drop-down-base';import { DataManager, Query } from '@syncfusion/ej2-data';import { SortOrder } from '@syncfusion/ej2-lists';import { Popup, isCollide, createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';import { highlightSearch, revertHighlightSearch } from '../common/highlight-search';
1
+ import { KeyboardEvents, compile, Property, EventHandler, Animation, AnimationModel, KeyboardEventArgs, formatUnit, append, attributes } from '@syncfusion/ej2-base';import { isNullOrUndefined, detach, Event, EmitType, Complex, addClass, removeClass, closest, isUndefined, getValue, NotifyPropertyChanges, Browser } from '@syncfusion/ej2-base';import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';import { FieldSettings, FilteringEventArgs, FilterType } from '../drop-down-base/drop-down-base';import { DropDownBase, PopupEventArgs, SelectEventArgs, BeforeOpenEventArgs, dropDownBaseClasses } from '../drop-down-base/drop-down-base';import { DataManager, Query } from '@syncfusion/ej2-data';import { SortOrder } from '@syncfusion/ej2-lists';import { Popup, isCollide, createSpinner, showSpinner, hideSpinner, getZindexPartial } from '@syncfusion/ej2-popups';import { highlightSearch, revertHighlightSearch } from '../common/highlight-search';
2
2
  import {MentionChangeEventArgs} from "./mention";
3
3
 
4
4
  /**
@@ -62,7 +62,7 @@ export interface MentionModel {
62
62
  minLength?: number;
63
63
 
64
64
  /**
65
- * Specifies the order to sort the data source. The possible sort orders are,
65
+ * Specifies the order to sort the data source. The possible sort orders are,
66
66
  * * `None` - The data source is not sorted.
67
67
  * * `Ascending` - The data source is sorted in ascending order.
68
68
  * * `Descending` - The data source is sorted in descending order.