@syncfusion/ej2-dropdowns 24.1.45 → 24.1.46

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 (53) hide show
  1. package/CHANGELOG.md +24 -0
  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 +89 -17
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +94 -17
  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 +9 -9
  13. package/src/drop-down-list/drop-down-list.d.ts +1 -0
  14. package/src/drop-down-list/drop-down-list.js +9 -2
  15. package/src/drop-down-tree/drop-down-tree.d.ts +3 -1
  16. package/src/drop-down-tree/drop-down-tree.js +76 -13
  17. package/src/mention/mention.js +8 -1
  18. package/src/multi-select/multi-select.js +1 -1
  19. package/styles/bootstrap-dark.css +5 -0
  20. package/styles/bootstrap.css +5 -0
  21. package/styles/bootstrap4.css +5 -0
  22. package/styles/bootstrap5-dark.css +5 -0
  23. package/styles/bootstrap5.css +5 -0
  24. package/styles/drop-down-list/_layout.scss +5 -0
  25. package/styles/drop-down-list/bootstrap-dark.css +5 -0
  26. package/styles/drop-down-list/bootstrap.css +5 -0
  27. package/styles/drop-down-list/bootstrap4.css +5 -0
  28. package/styles/drop-down-list/bootstrap5-dark.css +5 -0
  29. package/styles/drop-down-list/bootstrap5.css +5 -0
  30. package/styles/drop-down-list/fabric-dark.css +5 -0
  31. package/styles/drop-down-list/fabric.css +5 -0
  32. package/styles/drop-down-list/fluent-dark.css +5 -0
  33. package/styles/drop-down-list/fluent.css +5 -0
  34. package/styles/drop-down-list/highcontrast-light.css +5 -0
  35. package/styles/drop-down-list/highcontrast.css +5 -0
  36. package/styles/drop-down-list/material-dark.css +5 -0
  37. package/styles/drop-down-list/material.css +5 -0
  38. package/styles/drop-down-list/material3-dark.css +5 -0
  39. package/styles/drop-down-list/material3.css +5 -0
  40. package/styles/drop-down-list/tailwind-dark.css +5 -0
  41. package/styles/drop-down-list/tailwind.css +5 -0
  42. package/styles/fabric-dark.css +5 -0
  43. package/styles/fabric.css +5 -0
  44. package/styles/fluent-dark.css +5 -0
  45. package/styles/fluent.css +5 -0
  46. package/styles/highcontrast-light.css +5 -0
  47. package/styles/highcontrast.css +5 -0
  48. package/styles/material-dark.css +5 -0
  49. package/styles/material.css +5 -0
  50. package/styles/material3-dark.css +5 -0
  51. package/styles/material3.css +5 -0
  52. package/styles/tailwind-dark.css +5 -0
  53. package/styles/tailwind.css +5 -0
@@ -4677,9 +4677,16 @@ let DropDownList = class DropDownList extends DropDownBase {
4677
4677
  scrollHandler() {
4678
4678
  if (Browser.isDevice && ((this.getModuleName() === 'dropdownlist' &&
4679
4679
  !this.isFilterLayout()) || (this.getModuleName() === 'combobox' && !this.allowFiltering && this.isDropDownClick))) {
4680
- this.hidePopup();
4680
+ if (this.element && !(this.isElementInViewport(this.element))) {
4681
+ this.hidePopup();
4682
+ }
4681
4683
  }
4682
4684
  }
4685
+ isElementInViewport(element) {
4686
+ var elementRect = element.getBoundingClientRect();
4687
+ return (elementRect.top >= 0 && elementRect.left >= 0 && elementRect.bottom <= window.innerHeight && elementRect.right <= window.innerWidth);
4688
+ }
4689
+ ;
4683
4690
  setSearchBoxPosition() {
4684
4691
  const searchBoxHeight = this.filterInput.parentElement.getBoundingClientRect().height;
4685
4692
  this.popupObj.element.style.maxHeight = '100%';
@@ -5811,7 +5818,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5811
5818
  if (!this.enabled) {
5812
5819
  return;
5813
5820
  }
5814
- if (!this.enableVirtualization && this.getModuleName() === 'combobox') {
5821
+ if (!this.enableVirtualization && (this.getModuleName() === 'combobox' || this.getModuleName() === 'autocomplete')) {
5815
5822
  this.isTyped = true;
5816
5823
  }
5817
5824
  this.hidePopup(e);
@@ -6236,7 +6243,6 @@ let DropDownTree = class DropDownTree extends Component {
6236
6243
  const popupDiv = select('#' + this.element.id + '_options', document);
6237
6244
  detach(popupDiv ? popupDiv : isTree.parentElement);
6238
6245
  }
6239
- this.ensureAutoCheck();
6240
6246
  if (this.element.tagName === 'INPUT') {
6241
6247
  this.inputEle = this.element;
6242
6248
  if (isNullOrUndefined(this.inputEle.getAttribute('role'))) {
@@ -6323,11 +6329,6 @@ let DropDownTree = class DropDownTree extends Component {
6323
6329
  || this.noRecordsTemplate || this.customTemplate;
6324
6330
  this.renderComplete();
6325
6331
  }
6326
- ensureAutoCheck() {
6327
- if (this.allowFiltering && this.treeSettings.autoCheck) {
6328
- this.setProperties({ treeSettings: { autoCheck: false } }, true);
6329
- }
6330
- }
6331
6332
  hideCheckAll(flag) {
6332
6333
  const checkAllEle = !isNullOrUndefined(this.popupEle) ? this.popupEle.querySelector('.' + CHECKALLPARENT) : null;
6333
6334
  if (!isNullOrUndefined(checkAllEle)) {
@@ -6364,9 +6365,20 @@ let DropDownTree = class DropDownTree extends Component {
6364
6365
  this.filterTimer = window.setTimeout(() => { this.filterHandler(args.value, args.event); }, this.filterDelayTime);
6365
6366
  }
6366
6367
  }
6368
+ isChildObject() {
6369
+ if (typeof this.treeObj.fields.child === 'object') {
6370
+ return true;
6371
+ }
6372
+ else {
6373
+ return false;
6374
+ }
6375
+ }
6367
6376
  filterHandler(value, event) {
6368
6377
  this.isFromFilterChange = true;
6369
6378
  if (!this.isFilteredData) {
6379
+ if (this.isRemoteData) {
6380
+ this.treeObj.expandedNodes = [];
6381
+ }
6370
6382
  this.treeData = this.treeObj.getTreeData();
6371
6383
  }
6372
6384
  const filterFields = this.cloneFields(this.fields);
@@ -6396,6 +6408,10 @@ let DropDownTree = class DropDownTree extends Component {
6396
6408
  }
6397
6409
  else {
6398
6410
  if (this.fields.dataSource instanceof DataManager) {
6411
+ fields = this.remoteDataFilter(value, args.fields);
6412
+ fields.child = this.fields.child;
6413
+ this.treeObj.fields = this.getTreeFields(args.fields);
6414
+ this.treeObj.dataBind();
6399
6415
  flag = true;
6400
6416
  }
6401
6417
  else {
@@ -6407,6 +6423,14 @@ let DropDownTree = class DropDownTree extends Component {
6407
6423
  if (flag) {
6408
6424
  return;
6409
6425
  }
6426
+ if (this.isRemoteData) {
6427
+ if (this.isChildObject()) {
6428
+ fields.child = this.fields.child;
6429
+ }
6430
+ else {
6431
+ fields = args.fields;
6432
+ }
6433
+ }
6410
6434
  this.treeObj.fields = this.getTreeFields(fields);
6411
6435
  this.treeObj.dataBind();
6412
6436
  if (this.hasTemplate && this.portals && this.treeObj.portals) {
@@ -6422,6 +6446,33 @@ let DropDownTree = class DropDownTree extends Component {
6422
6446
  }
6423
6447
  });
6424
6448
  }
6449
+ remoteDataFilter(value, filteredFields) {
6450
+ filteredFields.dataSource = this.treeData.map(item => this.remoteChildFilter(value, item)).filter(filteredChild => !isNullOrUndefined(filteredChild));
6451
+ return filteredFields;
6452
+ }
6453
+ remoteChildFilter(value, node, isChild, isChildFiltering) {
6454
+ let children = this.isChildObject() ? node['child'] : node[this.fields.child];
6455
+ if (isNullOrUndefined(children)) {
6456
+ return (this.isMatchedNode(value, node, isChild, isChildFiltering)) ? node : null;
6457
+ }
6458
+ let matchedChildren = [];
6459
+ for (let i = 0; i < children.length; i++) {
6460
+ let filteredChild = this.remoteChildFilter(value, children[i], true, true);
6461
+ if (!isNullOrUndefined(filteredChild)) {
6462
+ matchedChildren.push(filteredChild);
6463
+ }
6464
+ }
6465
+ let filteredItems = Object.assign({}, node);
6466
+ isChildFiltering = false;
6467
+ if (matchedChildren.length !== 0) {
6468
+ filteredItems.child = matchedChildren;
6469
+ }
6470
+ else {
6471
+ filteredItems.child = null;
6472
+ filteredItems = (this.isMatchedNode(value, filteredItems)) ? filteredItems : null;
6473
+ }
6474
+ return filteredItems;
6475
+ }
6425
6476
  nestedFilter(value, filteredFields) {
6426
6477
  // eslint-disable-next-line
6427
6478
  const matchedDataSource = [];
@@ -6503,8 +6554,17 @@ let DropDownTree = class DropDownTree extends Component {
6503
6554
  return filteredFields;
6504
6555
  }
6505
6556
  // eslint-disable-next-line
6506
- isMatchedNode(value, node) {
6507
- let checkValue = node[this.fields.text];
6557
+ isMatchedNode(value, node, isChild, isChildFiltering) {
6558
+ let checkValue;
6559
+ let isObjectValue = isChild && isChildFiltering && this.isChildObject();
6560
+ checkValue = isObjectValue ? node[this.fields.child.text] : node[this.fields.text];
6561
+ if (!checkValue) {
6562
+ let tempChild = this.fields.child;
6563
+ while (!node[tempChild.text]) {
6564
+ tempChild = tempChild.child;
6565
+ }
6566
+ checkValue = node[tempChild.text];
6567
+ }
6508
6568
  if (this.ignoreCase) {
6509
6569
  checkValue = checkValue.toLowerCase();
6510
6570
  value = value.toLowerCase();
@@ -7459,8 +7519,6 @@ let DropDownTree = class DropDownTree extends Component {
7459
7519
  if (this.isFilteredData) {
7460
7520
  this.filterObj.value = '';
7461
7521
  this.treeObj.fields = this.getTreeFields(this.fields);
7462
- if (this.isReact)
7463
- this.refresh();
7464
7522
  this.isFilterRestore = true;
7465
7523
  this.isFilteredData = false;
7466
7524
  this.hideCheckAll(false);
@@ -7481,12 +7539,18 @@ let DropDownTree = class DropDownTree extends Component {
7481
7539
  }
7482
7540
  else {
7483
7541
  this.popupEle = this.popupObj.element;
7542
+ if (this.isReact && this.isFilterRestore) {
7543
+ this.treeObj.refresh();
7544
+ this.isFilteredData = true;
7545
+ this.popupEle.removeChild(this.filterContainer);
7546
+ }
7484
7547
  }
7485
7548
  }
7486
7549
  else {
7487
7550
  isCancelled = true;
7488
7551
  }
7489
- if (this.isFirstRender && !isCancelled) {
7552
+ if (this.isFirstRender && !isCancelled || this.isFilteredData) {
7553
+ this.isFilteredData = false;
7490
7554
  prepend([this.popupDiv], this.popupEle);
7491
7555
  removeClass([this.popupDiv], DDTHIDEICON);
7492
7556
  if (this.allowFiltering) {
@@ -7852,6 +7916,9 @@ let DropDownTree = class DropDownTree extends Component {
7852
7916
  if (this.value === null) {
7853
7917
  this.setProperties({ value: [] }, true);
7854
7918
  }
7919
+ if (args.node.classList.contains("e-active")) {
7920
+ this.hidePopup();
7921
+ }
7855
7922
  }
7856
7923
  }
7857
7924
  updateHiddenValue() {
@@ -8510,7 +8577,6 @@ let DropDownTree = class DropDownTree extends Component {
8510
8577
  updateTreeSettings(prop) {
8511
8578
  const value = Object.keys(prop.treeSettings)[0];
8512
8579
  if (value === 'autoCheck') {
8513
- this.ensureAutoCheck();
8514
8580
  this.treeObj.autoCheck = this.treeSettings.autoCheck;
8515
8581
  }
8516
8582
  else if (value === 'loadOnDemand') {
@@ -8631,7 +8697,6 @@ let DropDownTree = class DropDownTree extends Component {
8631
8697
  this.destroyFilter();
8632
8698
  }
8633
8699
  }
8634
- this.ensureAutoCheck();
8635
8700
  }
8636
8701
  updateFilterPlaceHolder() {
8637
8702
  if (this.filterObj) {
@@ -14546,10 +14611,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14546
14611
  if (!args.cancel) {
14547
14612
  if (!this.ulElement) {
14548
14613
  this.beforePopupOpen = true;
14549
- super.render(e);
14550
14614
  if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
14551
14615
  this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
14552
14616
  }
14617
+ super.render(e);
14553
14618
  return;
14554
14619
  }
14555
14620
  if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
@@ -18303,7 +18368,8 @@ let Mention = class Mention extends DropDownBase {
18303
18368
  return;
18304
18369
  }
18305
18370
  this.isTyped = e.code !== 'Enter' && e.code !== 'Space' && e.code !== 'ArrowDown' && e.code !== 'ArrowUp' ? true : false;
18306
- if (document.activeElement != this.inputElement) {
18371
+ const isRteImage = document.activeElement.parentElement && document.activeElement.parentElement.querySelector('.e-rte-image') ? true : false;
18372
+ if (document.activeElement != this.inputElement && !isRteImage) {
18307
18373
  this.inputElement.focus();
18308
18374
  }
18309
18375
  if (this.isContentEditable(this.inputElement)) {
@@ -19169,6 +19235,12 @@ let Mention = class Mention extends DropDownBase {
19169
19235
  if (this.isPopupOpen) {
19170
19236
  this.hidePopup();
19171
19237
  }
19238
+ //New event to update the RichTextEditor value, when a mention item is selected using mouse click action.
19239
+ if (!isNullOrUndefined(e.pointerType) && e.pointerType === 'mouse') {
19240
+ const event = new CustomEvent('content-changed', { detail: { click: true } });
19241
+ this.inputElement.dispatchEvent(event);
19242
+ }
19243
+
19172
19244
  this.onChangeEvent(e);
19173
19245
  }
19174
19246
  else {