@syncfusion/ej2-dropdowns 24.2.9 → 25.1.35

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 (92) hide show
  1. package/CHANGELOG.md +23 -158
  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 +1996 -513
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +2012 -512
  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 +13 -13
  13. package/src/auto-complete/auto-complete-model.d.ts +3 -1
  14. package/src/auto-complete/auto-complete.d.ts +2 -0
  15. package/src/auto-complete/auto-complete.js +51 -6
  16. package/src/combo-box/combo-box-model.d.ts +10 -1
  17. package/src/combo-box/combo-box.d.ts +10 -2
  18. package/src/combo-box/combo-box.js +55 -23
  19. package/src/common/interface.d.ts +32 -0
  20. package/src/common/virtual-scroll.d.ts +1 -3
  21. package/src/common/virtual-scroll.js +157 -27
  22. package/src/drop-down-base/drop-down-base-model.d.ts +1 -1
  23. package/src/drop-down-base/drop-down-base.d.ts +64 -5
  24. package/src/drop-down-base/drop-down-base.js +241 -24
  25. package/src/drop-down-list/drop-down-list-model.d.ts +10 -1
  26. package/src/drop-down-list/drop-down-list.d.ts +16 -50
  27. package/src/drop-down-list/drop-down-list.js +150 -196
  28. package/src/drop-down-tree/drop-down-tree-model.d.ts +16 -12
  29. package/src/drop-down-tree/drop-down-tree.d.ts +13 -3
  30. package/src/drop-down-tree/drop-down-tree.js +55 -49
  31. package/src/global.js +1 -1
  32. package/src/list-box/list-box.js +9 -4
  33. package/src/mention/mention.d.ts +2 -0
  34. package/src/mention/mention.js +16 -8
  35. package/src/multi-select/checkbox-selection.js +8 -2
  36. package/src/multi-select/float-label.d.ts +5 -5
  37. package/src/multi-select/index.d.ts +1 -0
  38. package/src/multi-select/index.js +1 -0
  39. package/src/multi-select/interface.d.ts +1 -0
  40. package/src/multi-select/multi-select-model.d.ts +17 -2
  41. package/src/multi-select/multi-select.d.ts +34 -4
  42. package/src/multi-select/multi-select.js +1271 -173
  43. package/styles/auto-complete/_bds-definition.scss +2 -0
  44. package/styles/bootstrap-dark.css +7 -1
  45. package/styles/bootstrap.css +7 -1
  46. package/styles/bootstrap4.css +2 -1
  47. package/styles/bootstrap5-dark.css +2 -1
  48. package/styles/bootstrap5.css +2 -1
  49. package/styles/combo-box/_bds-definition.scss +2 -0
  50. package/styles/drop-down-base/_bds-definition.scss +134 -0
  51. package/styles/drop-down-list/_bds-definition.scss +134 -0
  52. package/styles/drop-down-list/icons/_bds.scss +14 -0
  53. package/styles/drop-down-tree/_bds-definition.scss +61 -0
  54. package/styles/drop-down-tree/icons/_bds.scss +11 -0
  55. package/styles/fabric-dark.css +3 -1
  56. package/styles/fabric.css +3 -1
  57. package/styles/fluent-dark.css +7 -1
  58. package/styles/fluent.css +7 -1
  59. package/styles/highcontrast-light.css +3 -1
  60. package/styles/highcontrast.css +3 -1
  61. package/styles/list-box/_bds-definition.scss +136 -0
  62. package/styles/list-box/icons/_bds.scss +25 -0
  63. package/styles/material-dark.css +2 -1
  64. package/styles/material.css +2 -1
  65. package/styles/material3-dark.css +2 -1
  66. package/styles/material3.css +2 -1
  67. package/styles/mention/_bds-definition.scss +1 -0
  68. package/styles/multi-select/_bds-definition.scss +235 -0
  69. package/styles/multi-select/_bootstrap-dark-definition.scss +4 -0
  70. package/styles/multi-select/_bootstrap-definition.scss +4 -0
  71. package/styles/multi-select/_fluent-definition.scss +5 -0
  72. package/styles/multi-select/_layout.scss +8 -1
  73. package/styles/multi-select/bootstrap-dark.css +7 -1
  74. package/styles/multi-select/bootstrap.css +7 -1
  75. package/styles/multi-select/bootstrap4.css +2 -1
  76. package/styles/multi-select/bootstrap5-dark.css +2 -1
  77. package/styles/multi-select/bootstrap5.css +2 -1
  78. package/styles/multi-select/fabric-dark.css +3 -1
  79. package/styles/multi-select/fabric.css +3 -1
  80. package/styles/multi-select/fluent-dark.css +7 -1
  81. package/styles/multi-select/fluent.css +7 -1
  82. package/styles/multi-select/highcontrast-light.css +3 -1
  83. package/styles/multi-select/highcontrast.css +3 -1
  84. package/styles/multi-select/icons/_bds.scss +26 -0
  85. package/styles/multi-select/material-dark.css +2 -1
  86. package/styles/multi-select/material.css +2 -1
  87. package/styles/multi-select/material3-dark.css +2 -1
  88. package/styles/multi-select/material3.css +2 -1
  89. package/styles/multi-select/tailwind-dark.css +2 -1
  90. package/styles/multi-select/tailwind.css +2 -1
  91. package/styles/tailwind-dark.css +2 -1
  92. package/styles/tailwind.css +2 -1
@@ -17,7 +17,6 @@ export interface FieldsModel {
17
17
  *
18
18
  * @default []
19
19
  */
20
- /* eslint-disable */
21
20
  dataSource?: DataManager | { [key: string]: Object }[];
22
21
 
23
22
  /**
@@ -59,8 +58,8 @@ export interface FieldsModel {
59
58
  query?: Query;
60
59
 
61
60
  /**
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.
61
+ * Specifies whether the node can be selected by users or not
62
+ * When set to false, the user interaction is prevented for the corresponding node.
64
63
  */
65
64
  selectable?: string;
66
65
 
@@ -179,7 +178,7 @@ export interface DropDownTreeModel extends ComponentModel{
179
178
  cssClass?: string;
180
179
 
181
180
  /**
182
- * This property is used to customize the display text of the selected items in the Dropdown Tree. The given custom template is
181
+ * This property is used to customize the display text of the selected items in the Dropdown Tree. The given custom template is
183
182
  * added to the input instead of the selected item text in the Dropdown Tree when the multi-selection or checkbox support is enabled.
184
183
  *
185
184
  * @default "${value.length} item(s) selected"
@@ -328,7 +327,7 @@ export interface DropDownTreeModel extends ComponentModel{
328
327
  * * Delimiter : Selected items will be visualized in the text content.
329
328
  * * Default : On focus in component will act in the box mode. On blur component will act in the delimiter mode.
330
329
  * * Custom : Selected items will be visualized with the given custom template value. The given custom template
331
- * is added to the input instead of the selected item text in the Dropdown Tree when the multi-selection or checkbox support is enabled.
330
+ * is added to the input instead of the selected item text in the Dropdown Tree when the multi-selection or checkbox support is enabled.
332
331
  */
333
332
  mode?: Mode;
334
333
 
@@ -392,10 +391,19 @@ export interface DropDownTreeModel extends ComponentModel{
392
391
  showCheckBox?: boolean;
393
392
 
394
393
  /**
395
- * Specifies whether to allow rendering of untrusted HTML values in the Dropdown Tree component.
396
- * While enable this property, it sanitize suspected untrusted strings and script, and update in the Dropdown Tree component.
394
+ * Specifies whether to destroy the popup or to maintain it in DOM when it is closed.
395
+ * When this property is set to false, then the popup will not be removed from DOM once it is closed.
397
396
  *
398
- * @default false
397
+ * @default true
398
+
399
+ */
400
+ destroyPopupOnHide?: boolean;
401
+
402
+ /**
403
+ * Specifies whether to display or remove the untrusted HTML values in the Dropdown Tree component.
404
+ * If 'enableHtmlSanitizer' set to true, the component will sanitize any suspected untrusted strings and scripts before rendering them.
405
+ *
406
+ * @default true
399
407
  */
400
408
  enableHtmlSanitizer?: boolean;
401
409
 
@@ -482,7 +490,6 @@ export interface DropDownTreeModel extends ComponentModel{
482
490
  *
483
491
  * @event
484
492
  */
485
- /* eslint-disable */
486
493
  actionFailure?: EmitType<Object>;
487
494
 
488
495
  /**
@@ -511,7 +518,6 @@ export interface DropDownTreeModel extends ComponentModel{
511
518
  *
512
519
  * @event
513
520
  */
514
- /* eslint-disable */
515
521
  blur?: EmitType<Object>;
516
522
 
517
523
  /**
@@ -519,7 +525,6 @@ export interface DropDownTreeModel extends ComponentModel{
519
525
  *
520
526
  * @event
521
527
  */
522
- /* eslint-disable */
523
528
  created?: EmitType<Object>;
524
529
 
525
530
  /**
@@ -534,7 +539,6 @@ export interface DropDownTreeModel extends ComponentModel{
534
539
  *
535
540
  * @event
536
541
  */
537
- /* eslint-disable */
538
542
  destroyed?: EmitType<Object>;
539
543
 
540
544
  /**
@@ -556,10 +556,18 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
556
556
  */
557
557
  showCheckBox: boolean;
558
558
  /**
559
- * Specifies whether to allow rendering of untrusted HTML values in the Dropdown Tree component.
560
- * While enable this property, it sanitize suspected untrusted strings and script, and update in the Dropdown Tree component.
559
+ * Specifies whether to destroy the popup or to maintain it in DOM when it is closed.
560
+ * When this property is set to false, then the popup will not be removed from DOM once it is closed.
561
561
  *
562
- * @default false
562
+ * @default true
563
+
564
+ */
565
+ destroyPopupOnHide: boolean;
566
+ /**
567
+ * Specifies whether to display or remove the untrusted HTML values in the Dropdown Tree component.
568
+ * If 'enableHtmlSanitizer' set to true, the component will sanitize any suspected untrusted strings and scripts before rendering them.
569
+ *
570
+ * @default true
563
571
  */
564
572
  enableHtmlSanitizer: boolean;
565
573
  /**
@@ -790,6 +798,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
790
798
  private getChildType;
791
799
  private renderTree;
792
800
  private renderPopup;
801
+ private reactCallBack;
793
802
  private updatePopupHeight;
794
803
  private createPopup;
795
804
  private setElementWidth;
@@ -877,6 +886,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
877
886
  */
878
887
  destroy(): void;
879
888
  private destroyFilter;
889
+ private destroyPopup;
880
890
  /**
881
891
  * Ensures visibility of the Dropdown Tree item by using item value or item element.
882
892
  * If many Dropdown Tree items are present, and we are in need to find a particular item, then the `ensureVisible` property
@@ -164,7 +164,6 @@ var DropDownTree = /** @class */ (function (_super) {
164
164
  _this.filterTimer = null;
165
165
  _this.isFilteredData = false;
166
166
  _this.isFilterRestore = false;
167
- // eslint-disable-next-line
168
167
  _this.selectedData = [];
169
168
  _this.filterDelayTime = 300;
170
169
  _this.isClicked = false;
@@ -262,7 +261,7 @@ var DropDownTree = /** @class */ (function (_super) {
262
261
  this.inputEle.setAttribute('aria-expanded', 'false');
263
262
  this.inputEle.setAttribute('role', 'combobox');
264
263
  this.inputEle.setAttribute('aria-haspopup', 'tree');
265
- this.inputEle.setAttribute('aria-controls', this.element.id + "_options");
264
+ this.inputEle.setAttribute('aria-controls', this.element.id + '_options');
266
265
  }
267
266
  if (isNOU(this.inputEle.getAttribute('type'))) {
268
267
  this.inputEle.setAttribute('type', 'text');
@@ -305,7 +304,9 @@ var DropDownTree = /** @class */ (function (_super) {
305
304
  this.popupDiv.classList.add(DROPDOWN);
306
305
  this.tree = this.createElement('div', { id: this.element.id + '_tree' });
307
306
  this.popupDiv.appendChild(this.tree);
308
- document.body.appendChild(this.popupDiv);
307
+ if (!this.destroyPopupOnHide) {
308
+ document.body.appendChild(this.popupDiv);
309
+ }
309
310
  this.wireTreeEvents();
310
311
  addClass([this.popupDiv], DDTHIDEICON);
311
312
  this.renderTree();
@@ -412,6 +413,7 @@ var DropDownTree = /** @class */ (function (_super) {
412
413
  if (value === '') {
413
414
  _this.isFilteredData = false;
414
415
  _this.isFilterRestore = true;
416
+ _this.isFromFilterChange = false;
415
417
  fields = _this.cloneFields(_this.fields);
416
418
  }
417
419
  else if (args.preventDefaultAction) {
@@ -450,7 +452,7 @@ var DropDownTree = /** @class */ (function (_super) {
450
452
  _this.treeObj.dataBind();
451
453
  if (_this.hasTemplate && _this.portals && _this.treeObj.portals) {
452
454
  for (var i = 0; i < _this.treeObj.portals.length; i++) {
453
- if (_this.portals.indexOf(_this.treeObj.portals[i]) == -1) {
455
+ if (_this.portals.indexOf(_this.treeObj.portals[i]) === -1) {
454
456
  _this.portals.push(_this.treeObj.portals[i]);
455
457
  }
456
458
  }
@@ -494,7 +496,6 @@ var DropDownTree = /** @class */ (function (_super) {
494
496
  return filteredItems;
495
497
  };
496
498
  DropDownTree.prototype.nestedFilter = function (value, filteredFields) {
497
- // eslint-disable-next-line
498
499
  var matchedDataSource = [];
499
500
  for (var i = 0; i < this.treeData.length; i++) {
500
501
  // eslint-disable-next-line
@@ -506,15 +507,12 @@ var DropDownTree = /** @class */ (function (_super) {
506
507
  filteredFields.dataSource = matchedDataSource;
507
508
  return filteredFields;
508
509
  };
509
- // eslint-disable-next-line
510
510
  DropDownTree.prototype.nestedChildFilter = function (value, node) {
511
- // eslint-disable-next-line
512
511
  var children = node[this.fields.child];
513
512
  if (isNOU(children)) {
514
513
  return (this.isMatchedNode(value, node)) ? node : null;
515
514
  }
516
515
  else {
517
- // eslint-disable-next-line
518
516
  var matchedChildren = [];
519
517
  for (var i = 0; i < children.length; i++) {
520
518
  // eslint-disable-next-line
@@ -535,9 +533,7 @@ var DropDownTree = /** @class */ (function (_super) {
535
533
  }
536
534
  };
537
535
  DropDownTree.prototype.selfReferencefilter = function (value, filteredFields) {
538
- // eslint-disable-next-line
539
536
  var matchedData = [];
540
- // eslint-disable-next-line
541
537
  var matchedDataSource = [];
542
538
  for (var i = 0; i < this.treeData.length; i++) {
543
539
  if (this.isMatchedNode(value, this.treeData[i])) {
@@ -550,7 +546,6 @@ var DropDownTree = /** @class */ (function (_super) {
550
546
  // eslint-disable-next-line
551
547
  var parentId = matchedData[i][this.fields.parentValue];
552
548
  while (!isNOU(parentId)) {
553
- // eslint-disable-next-line
554
549
  var parent_1 = null;
555
550
  for (var j = 0; j < this.treeData.length; j++) {
556
551
  // eslint-disable-next-line
@@ -573,7 +568,6 @@ var DropDownTree = /** @class */ (function (_super) {
573
568
  filteredFields.dataSource = matchedDataSource;
574
569
  return filteredFields;
575
570
  };
576
- // eslint-disable-next-line
577
571
  DropDownTree.prototype.isMatchedNode = function (value, node, isChild, isChildFiltering) {
578
572
  var checkValue;
579
573
  var isObjectValue = isChild && isChildFiltering && this.isChildObject();
@@ -969,7 +963,6 @@ var DropDownTree = /** @class */ (function (_super) {
969
963
  var remaining = void 0;
970
964
  var downIconWidth = 0;
971
965
  this.overFlowWrapper.innerHTML = '';
972
- // eslint-disable-next-line
973
966
  var l10nLocale = { overflowCountTemplate: '+${count} more..', totalCountTemplate: '${count} selected' };
974
967
  this.l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);
975
968
  var remainContent = this.l10n.getConstant('overflowCountTemplate');
@@ -1252,7 +1245,6 @@ var DropDownTree = /** @class */ (function (_super) {
1252
1245
  if (this.selectAllText !== 'Select All' || this.unSelectAllText !== 'Unselect All') {
1253
1246
  var template = unSelect ? this.unSelectAllText : this.selectAllText;
1254
1247
  this.selectAllSpan.textContent = '';
1255
- // eslint-disable-next-line
1256
1248
  var compiledString = compile(template);
1257
1249
  var templateName = unSelect ? 'unSelectAllText' : 'selectAllText';
1258
1250
  for (var _i = 0, _a = compiledString({}, this, templateName, null, !this.isStringTemplate); _i < _a.length; _i++) {
@@ -1278,11 +1270,11 @@ var DropDownTree = /** @class */ (function (_super) {
1278
1270
  if (htmlAttr === 'class') {
1279
1271
  this.inputWrapper.classList.add(this.htmlAttributes["" + htmlAttr]);
1280
1272
  }
1281
- else if (htmlAttr === 'disabled' && this.htmlAttributes["" + htmlAttr] === 'disabled') {
1273
+ else if (htmlAttr === 'disabled') {
1282
1274
  this.setProperties({ enabled: false }, true);
1283
1275
  this.setEnable();
1284
1276
  }
1285
- else if (htmlAttr === 'readonly' && !isNOU(this.htmlAttributes["" + htmlAttr])) {
1277
+ else if (htmlAttr === 'readonly') {
1286
1278
  this.setProperties({ readonly: true }, true);
1287
1279
  this.dataBind();
1288
1280
  }
@@ -1342,7 +1334,6 @@ var DropDownTree = /** @class */ (function (_super) {
1342
1334
  };
1343
1335
  DropDownTree.prototype.setTreeValue = function () {
1344
1336
  if (this.value !== null && this.value.length !== 0) {
1345
- // eslint-disable-next-line
1346
1337
  var data = void 0;
1347
1338
  if (this.showCheckBox || this.allowMultiSelection) {
1348
1339
  for (var i = 0; i < this.value.length; i++) {
@@ -1372,7 +1363,6 @@ var DropDownTree = /** @class */ (function (_super) {
1372
1363
  return;
1373
1364
  }
1374
1365
  if (this.text !== null) {
1375
- // eslint-disable-next-line
1376
1366
  var data = void 0;
1377
1367
  var valArr = [];
1378
1368
  if (this.showCheckBox || this.allowMultiSelection) {
@@ -1463,9 +1453,7 @@ var DropDownTree = /** @class */ (function (_super) {
1463
1453
  this.triggerChangeEvent();
1464
1454
  }
1465
1455
  };
1466
- // eslint-disable-next-line
1467
1456
  DropDownTree.prototype.getItems = function (givenText) {
1468
- // eslint-disable-next-line
1469
1457
  var data;
1470
1458
  if (this.treeDataType === 1) {
1471
1459
  for (var i = 0; i < this.treeItems.length; i++) {
@@ -1482,9 +1470,7 @@ var DropDownTree = /** @class */ (function (_super) {
1482
1470
  }
1483
1471
  return data;
1484
1472
  };
1485
- // eslint-disable-next-line
1486
1473
  DropDownTree.prototype.getNestedItems = function (data, field, givenText) {
1487
- // eslint-disable-next-line
1488
1474
  var newData;
1489
1475
  for (var i = 0, objlen = data.length; i < objlen; i++) {
1490
1476
  // eslint-disable-next-line
@@ -1495,7 +1481,6 @@ var DropDownTree = /** @class */ (function (_super) {
1495
1481
  else if (typeof field.child === 'string' && !isNOU(getValue(field.child, data[i]))) {
1496
1482
  // eslint-disable-next-line
1497
1483
  var childData = getValue(field.child, data[i]);
1498
- // eslint-disable-next-line
1499
1484
  newData = this.getNestedItems(childData, this.getChildType(field), givenText);
1500
1485
  if (newData !== undefined) {
1501
1486
  break;
@@ -1538,7 +1523,7 @@ var DropDownTree = /** @class */ (function (_super) {
1538
1523
  nodeTemplate: this.itemTemplate
1539
1524
  });
1540
1525
  this.treeObj.root = this.root ? this.root : this;
1541
- this.treeObj.appendTo('#' + this.tree.id);
1526
+ this.treeObj.appendTo(this.tree);
1542
1527
  };
1543
1528
  /* To render the popup element */
1544
1529
  DropDownTree.prototype.renderPopup = function () {
@@ -1596,9 +1581,13 @@ var DropDownTree = /** @class */ (function (_super) {
1596
1581
  _this.isFirstRender = false;
1597
1582
  /* eslint-disable */
1598
1583
  if (_this.hasTemplate && _this.portals) {
1599
- _this.portals = _this.portals.concat(_this.treeObj.portals);
1584
+ if (_this.treeObj.portals) {
1585
+ _this.portals = _this.portals.concat(_this.treeObj.portals.filter(function (item) { return !_this.portals.includes(item); }));
1586
+ }
1600
1587
  /* eslint-enable */
1601
- _this.renderReactTemplates();
1588
+ if (_this.isReact) {
1589
+ _this.renderReactTemplates(_this.reactCallBack);
1590
+ }
1602
1591
  }
1603
1592
  }
1604
1593
  if (!isCancelled) {
@@ -1609,7 +1598,15 @@ var DropDownTree = /** @class */ (function (_super) {
1609
1598
  _this.popupObj.refreshPosition();
1610
1599
  if (!(_this.showCheckBox && _this.showSelectAll) && (!_this.popupDiv.classList.contains(NODATA)
1611
1600
  && _this.treeItems.length > 0)) {
1612
- var focusedElement = _this.treeObj.element.querySelector('li');
1601
+ var focusedElement = void 0;
1602
+ if (_this.value != null && _this.text != null) {
1603
+ _this.treeObj.element.querySelector('li').setAttribute('tabindex', '-1');
1604
+ focusedElement = _this.treeObj.element.querySelector('[data-uid="' + _this.value[0] + '"]');
1605
+ focusedElement.setAttribute('tabindex', '0');
1606
+ }
1607
+ else {
1608
+ focusedElement = _this.treeObj.element.querySelector('li');
1609
+ }
1613
1610
  focusedElement.focus();
1614
1611
  addClass([focusedElement], ['e-node-focus']);
1615
1612
  }
@@ -1627,6 +1624,10 @@ var DropDownTree = /** @class */ (function (_super) {
1627
1624
  }
1628
1625
  });
1629
1626
  };
1627
+ DropDownTree.prototype.reactCallBack = function () {
1628
+ this.updatePopupHeight();
1629
+ this.popupObj.refreshPosition();
1630
+ };
1630
1631
  DropDownTree.prototype.updatePopupHeight = function () {
1631
1632
  if (this.isFirstRender) {
1632
1633
  return;
@@ -1885,7 +1886,6 @@ var DropDownTree = /** @class */ (function (_super) {
1885
1886
  }
1886
1887
  return null;
1887
1888
  };
1888
- // eslint-disable-next-line
1889
1889
  DropDownTree.prototype.getTreeDataType = function (ds, field) {
1890
1890
  if (this.fields.dataSource instanceof DataManager) {
1891
1891
  for (var i = 0; i < ds.length; i++) {
@@ -1895,8 +1895,9 @@ var DropDownTree = /** @class */ (function (_super) {
1895
1895
  }
1896
1896
  return 2;
1897
1897
  }
1898
- if (isNOU(this.fields.dataSource))
1898
+ if (isNOU(this.fields.dataSource)) {
1899
1899
  this.fields.dataSource = [];
1900
+ }
1900
1901
  for (var i = 0, len = this.fields.dataSource.length; i < len; i++) {
1901
1902
  if ((typeof field.child === 'string') && !isNOU(getValue(field.child, this.fields.dataSource[i]))) {
1902
1903
  return 2;
@@ -1917,9 +1918,7 @@ var DropDownTree = /** @class */ (function (_super) {
1917
1918
  this.treeObj.dataBind();
1918
1919
  };
1919
1920
  DropDownTree.prototype.getEventArgs = function (args) {
1920
- // eslint-disable-next-line
1921
1921
  var checkData = args.data;
1922
- // eslint-disable-next-line
1923
1922
  var selectData = args.nodeData;
1924
1923
  var state;
1925
1924
  if (this.showCheckBox) {
@@ -2004,7 +2003,6 @@ var DropDownTree = /** @class */ (function (_super) {
2004
2003
  var target = args.event.target;
2005
2004
  if ((target.classList.contains('e-fullrow') || target.classList.contains('e-list-text')) && this.showCheckBox) {
2006
2005
  this.isClicked = true;
2007
- // eslint-disable-next-line
2008
2006
  var getNodeDetails = this.treeObj.getNode(args.node);
2009
2007
  if (getNodeDetails.isChecked === 'true') {
2010
2008
  this.treeObj.uncheckAll([args.node]);
@@ -2056,7 +2054,7 @@ var DropDownTree = /** @class */ (function (_super) {
2056
2054
  DropDownTree.prototype.onNodeExpanded = function (args) {
2057
2055
  if (this.hasTemplate && this.portals && this.treeObj.portals) {
2058
2056
  for (var i = 0; i < this.treeObj.portals.length; i++) {
2059
- if (this.portals.indexOf(this.treeObj.portals[i]) == -1) {
2057
+ if (this.portals.indexOf(this.treeObj.portals[i]) === -1) {
2060
2058
  this.portals.push(this.treeObj.portals[i]);
2061
2059
  }
2062
2060
  }
@@ -2154,7 +2152,7 @@ var DropDownTree = /** @class */ (function (_super) {
2154
2152
  };
2155
2153
  DropDownTree.prototype.setMultiSelectValue = function (newValues) {
2156
2154
  if (!this.isFilteredData) {
2157
- this.setProperties({ value: this.isFromFilterChange && newValues && newValues.length == 0 ? this.value : newValues }, true);
2155
+ this.setProperties({ value: this.isFromFilterChange && newValues && newValues.length === 0 ? this.value : newValues }, true);
2158
2156
  this.isFromFilterChange = false;
2159
2157
  if (newValues && newValues.length !== 0 && !this.showCheckBox) {
2160
2158
  this.treeObj.selectedNodes = this.value.slice();
@@ -2204,9 +2202,7 @@ var DropDownTree = /** @class */ (function (_super) {
2204
2202
  }
2205
2203
  this.updateSelectedValues();
2206
2204
  };
2207
- // eslint-disable-next-line
2208
2205
  DropDownTree.prototype.getSelectedData = function (value) {
2209
- // eslint-disable-next-line
2210
2206
  var data = null;
2211
2207
  if (this.isFilteredData) {
2212
2208
  for (var i = 0; i < this.selectedData.length; i++) {
@@ -2293,7 +2289,6 @@ var DropDownTree = /** @class */ (function (_super) {
2293
2289
  var temp;
2294
2290
  var text;
2295
2291
  var textValue = '';
2296
- // eslint-disable-next-line
2297
2292
  var selectedData;
2298
2293
  this.hiddenElement.innerHTML = '';
2299
2294
  var hiddenInputValue = '';
@@ -2389,7 +2384,7 @@ var DropDownTree = /** @class */ (function (_super) {
2389
2384
  addClass([this.inputWrapper], SHOW_CHIP);
2390
2385
  }
2391
2386
  var chip = this.createElement('span', {
2392
- className: CHIP,
2387
+ className: CHIP
2393
2388
  });
2394
2389
  if (!this.inputEle.classList.contains(CHIP_INPUT)) {
2395
2390
  addClass([this.inputEle], CHIP_INPUT);
@@ -2431,7 +2426,6 @@ var DropDownTree = /** @class */ (function (_super) {
2431
2426
  this.header = this.createElement('div');
2432
2427
  addClass([this.header], HEADER);
2433
2428
  }
2434
- // eslint-disable-next-line
2435
2429
  var compiledString = this.templateComplier(this.headerTemplate);
2436
2430
  var tempArr = compiledString({}, this, 'headerTemplate', this.headerTemplateId, this.isStringTemplate, undefined, this.header);
2437
2431
  if (tempArr) {
@@ -2440,7 +2434,6 @@ var DropDownTree = /** @class */ (function (_super) {
2440
2434
  }
2441
2435
  this.popupEle.insertBefore(this.header, this.checkAllParent ? this.checkAllParent : this.popupDiv);
2442
2436
  };
2443
- // eslint-disable-next-line
2444
2437
  DropDownTree.prototype.templateComplier = function (template) {
2445
2438
  if (template) {
2446
2439
  // eslint-disable-next-line
@@ -2467,7 +2460,6 @@ var DropDownTree = /** @class */ (function (_super) {
2467
2460
  this.footer = this.createElement('div');
2468
2461
  addClass([this.footer], FOOTER);
2469
2462
  }
2470
- // eslint-disable-next-line
2471
2463
  var compiledString = this.templateComplier(this.footerTemplate);
2472
2464
  var tempArr = compiledString({}, this, 'footerTemplate', this.footerTemplateId, this.isStringTemplate, undefined, this.footer);
2473
2465
  if (tempArr) {
@@ -2526,7 +2518,7 @@ var DropDownTree = /** @class */ (function (_super) {
2526
2518
  this.ensurePlaceHolder();
2527
2519
  };
2528
2520
  DropDownTree.prototype.resetValue = function (isDynamicChange) {
2529
- if (this.value == [] && this.text == null) {
2521
+ if (this.value === [] && this.text == null) {
2530
2522
  return;
2531
2523
  }
2532
2524
  Input.setValue(null, this.inputEle, this.floatLabelType);
@@ -2665,7 +2657,6 @@ var DropDownTree = /** @class */ (function (_super) {
2665
2657
  var template = actionFailure ? this.actionFailureTemplate : this.noRecordsTemplate;
2666
2658
  var templateId = actionFailure ? this.actionFailureTemplateId : this.noRecordsTemplateId;
2667
2659
  var templatestring = actionFailure ? 'actionFailureTemplate' : 'noRecordsTemplate';
2668
- // eslint-disable-next-line
2669
2660
  var compiledString = this.templateComplier(template);
2670
2661
  var tempArr = compiledString({}, this, templatestring, templateId, this.isStringTemplate, undefined, this.noRecord);
2671
2662
  if (tempArr) {
@@ -2674,7 +2665,6 @@ var DropDownTree = /** @class */ (function (_super) {
2674
2665
  }
2675
2666
  }
2676
2667
  else {
2677
- // eslint-disable-next-line
2678
2668
  var l10nLocale = { noRecordsTemplate: 'No Records Found', actionFailureTemplate: 'The Request Failed' };
2679
2669
  this.l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);
2680
2670
  this.noRecord.innerHTML = actionFailure ?
@@ -2906,10 +2896,10 @@ var DropDownTree = /** @class */ (function (_super) {
2906
2896
  this.updateTreeSettings(newProp);
2907
2897
  break;
2908
2898
  case 'customTemplate':
2909
- if (this.mode !== "Custom") {
2899
+ if (this.mode !== 'Custom') {
2910
2900
  return;
2911
2901
  }
2912
- this.chipCollection.innerHTML = "";
2902
+ this.chipCollection.innerHTML = '';
2913
2903
  this.setTagValues();
2914
2904
  break;
2915
2905
  case 'sortOrder':
@@ -3059,6 +3049,16 @@ var DropDownTree = /** @class */ (function (_super) {
3059
3049
  this.filterObj = null;
3060
3050
  }
3061
3051
  };
3052
+ DropDownTree.prototype.destroyPopup = function () {
3053
+ this.isPopupOpen = false;
3054
+ if (this.isReact) {
3055
+ this.clearTemplate();
3056
+ }
3057
+ if (this.popupObj) {
3058
+ this.popupObj.destroy();
3059
+ detach(this.popupObj.element);
3060
+ }
3061
+ };
3062
3062
  /**
3063
3063
  * Ensures visibility of the Dropdown Tree item by using item value or item element.
3064
3064
  * If many Dropdown Tree items are present, and we are in need to find a particular item, then the `ensureVisible` property
@@ -3076,7 +3076,6 @@ var DropDownTree = /** @class */ (function (_super) {
3076
3076
  * @param {string | Element} item - Specifies the value of Dropdown Tree item/ Dropdown Tree item element
3077
3077
  * @returns {'{[key: string]: Object }[]'} - returns the updated data source of the Dropdown Tree.
3078
3078
  */
3079
- // eslint-disable-next-line
3080
3079
  DropDownTree.prototype.getData = function (item) {
3081
3080
  return this.treeObj.getTreeData(item);
3082
3081
  };
@@ -3101,6 +3100,10 @@ var DropDownTree = /** @class */ (function (_super) {
3101
3100
  }
3102
3101
  }
3103
3102
  this.trigger('close', eventArgs);
3103
+ if (this.destroyPopupOnHide) {
3104
+ this.isFirstRender = true;
3105
+ this.destroyPopup();
3106
+ }
3104
3107
  }
3105
3108
  };
3106
3109
  /**
@@ -3150,7 +3153,7 @@ var DropDownTree = /** @class */ (function (_super) {
3150
3153
  Property('')
3151
3154
  ], DropDownTree.prototype, "cssClass", void 0);
3152
3155
  __decorate([
3153
- Property("${value.length} item(s) selected")
3156
+ Property('${value.length} item(s) selected')
3154
3157
  ], DropDownTree.prototype, "customTemplate", void 0);
3155
3158
  __decorate([
3156
3159
  Property(',')
@@ -3216,7 +3219,10 @@ var DropDownTree = /** @class */ (function (_super) {
3216
3219
  Property(false)
3217
3220
  ], DropDownTree.prototype, "showCheckBox", void 0);
3218
3221
  __decorate([
3219
- Property(false)
3222
+ Property(true)
3223
+ ], DropDownTree.prototype, "destroyPopupOnHide", void 0);
3224
+ __decorate([
3225
+ Property(true)
3220
3226
  ], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
3221
3227
  __decorate([
3222
3228
  Property(true)
package/src/global.js CHANGED
@@ -2,6 +2,6 @@ import * as index from './index';
2
2
  index.DropDownList.Inject(index.VirtualScroll);
3
3
  index.ComboBox.Inject(index.VirtualScroll);
4
4
  index.AutoComplete.Inject(index.VirtualScroll);
5
- index.MultiSelect.Inject(index.CheckBoxSelection);
5
+ index.MultiSelect.Inject(index.CheckBoxSelection, index.VirtualScroll);
6
6
  index.ListBox.Inject(index.CheckBoxSelection);
7
7
  export * from './index';
@@ -400,7 +400,7 @@ var ListBox = /** @class */ (function (_super) {
400
400
  }
401
401
  }
402
402
  this.initWrapper();
403
- this.setSelection();
403
+ this.setSelection(this.value, true, false, !this.isRendered);
404
404
  this.initDraggable();
405
405
  this.mainList = this.ulElement;
406
406
  if (this.initLoad) {
@@ -2063,11 +2063,12 @@ var ListBox = /** @class */ (function (_super) {
2063
2063
  });
2064
2064
  }
2065
2065
  };
2066
- ListBox.prototype.setSelection = function (values, isSelect, isText) {
2066
+ ListBox.prototype.setSelection = function (values, isSelect, isText, canFocus) {
2067
2067
  var _this = this;
2068
2068
  if (values === void 0) { values = this.value; }
2069
2069
  if (isSelect === void 0) { isSelect = true; }
2070
2070
  if (isText === void 0) { isText = false; }
2071
+ if (canFocus === void 0) { canFocus = true; }
2071
2072
  var li;
2072
2073
  var liselect;
2073
2074
  if (values) {
@@ -2096,13 +2097,17 @@ var ListBox = /** @class */ (function (_super) {
2096
2097
  if (!isSelect && liselect || isSelect && !liselect && li) {
2097
2098
  if (_this.selectionSettings.showCheckbox) {
2098
2099
  _this.notify('updatelist', { li: li, module: 'listbox' });
2099
- li.focus();
2100
+ if (canFocus) {
2101
+ li.focus();
2102
+ }
2100
2103
  }
2101
2104
  else {
2102
2105
  if (isSelect) {
2103
2106
  li.classList.add(cssClass.selected);
2104
2107
  li.setAttribute('aria-selected', 'true');
2105
- li.focus();
2108
+ if (canFocus) {
2109
+ li.focus();
2110
+ }
2106
2111
  }
2107
2112
  else {
2108
2113
  li.classList.remove(cssClass.selected);
@@ -57,6 +57,8 @@ export declare class Mention extends DropDownBase {
57
57
  private isTyped;
58
58
  private didPopupOpenByTypingInitialChar;
59
59
  private isUpDownKey;
60
+ private isRTE;
61
+ private keyEventName;
60
62
  /**
61
63
  * Defines class/multiple classes separated by a space for the mention component.
62
64
  *