@syncfusion/ej2-treegrid 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 (55) hide show
  1. package/CHANGELOG.md +2 -61
  2. package/dist/ej2-treegrid.min.js +2 -2
  3. package/dist/ej2-treegrid.umd.min.js +2 -2
  4. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-treegrid.es2015.js +79 -54
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +79 -54
  8. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  9. package/dist/global/ej2-treegrid.min.js +2 -2
  10. package/dist/global/ej2-treegrid.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +10 -10
  13. package/src/treegrid/actions/summary.js +1 -7
  14. package/src/treegrid/actions/virtual-scroll.js +10 -4
  15. package/src/treegrid/base/treegrid-model.d.ts +3 -3
  16. package/src/treegrid/base/treegrid.d.ts +2 -3
  17. package/src/treegrid/base/treegrid.js +64 -43
  18. package/src/treegrid/renderer/virtual-row-model-generator.js +4 -2
  19. package/styles/bootstrap-dark.css +8 -0
  20. package/styles/bootstrap.css +8 -0
  21. package/styles/bootstrap4.css +8 -0
  22. package/styles/bootstrap5-dark.css +8 -0
  23. package/styles/bootstrap5.css +8 -0
  24. package/styles/fabric-dark.css +8 -0
  25. package/styles/fabric.css +8 -0
  26. package/styles/fluent-dark.css +8 -0
  27. package/styles/fluent.css +8 -0
  28. package/styles/highcontrast-light.css +8 -0
  29. package/styles/highcontrast.css +8 -0
  30. package/styles/material-dark.css +8 -0
  31. package/styles/material.css +8 -0
  32. package/styles/material3-dark.css +8 -0
  33. package/styles/material3.css +8 -0
  34. package/styles/tailwind-dark.css +8 -0
  35. package/styles/tailwind.css +8 -0
  36. package/styles/treegrid/_bds-definition.scss +28 -0
  37. package/styles/treegrid/_layout.scss +9 -1
  38. package/styles/treegrid/bootstrap-dark.css +8 -0
  39. package/styles/treegrid/bootstrap.css +8 -0
  40. package/styles/treegrid/bootstrap4.css +8 -0
  41. package/styles/treegrid/bootstrap5-dark.css +8 -0
  42. package/styles/treegrid/bootstrap5.css +8 -0
  43. package/styles/treegrid/fabric-dark.css +8 -0
  44. package/styles/treegrid/fabric.css +8 -0
  45. package/styles/treegrid/fluent-dark.css +8 -0
  46. package/styles/treegrid/fluent.css +8 -0
  47. package/styles/treegrid/highcontrast-light.css +8 -0
  48. package/styles/treegrid/highcontrast.css +8 -0
  49. package/styles/treegrid/icons/_bds.scss +37 -0
  50. package/styles/treegrid/material-dark.css +8 -0
  51. package/styles/treegrid/material.css +8 -0
  52. package/styles/treegrid/material3-dark.css +8 -0
  53. package/styles/treegrid/material3.css +8 -0
  54. package/styles/treegrid/tailwind-dark.css +8 -0
  55. package/styles/treegrid/tailwind.css +8 -0
@@ -2,7 +2,7 @@ import { Browser, ChildProperty, Collection, Complex, Component, Event, EventHan
2
2
  import { Aggregate, Cell, CellRenderer, CellType, Clipboard, ColumnChooser, ColumnMenu, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualHeaderRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getNumberFormat, getObject, getTransformValues, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, templateCompiler } from '@syncfusion/ej2-grids';
3
3
  import { createCheckBox } from '@syncfusion/ej2-buttons';
4
4
  import { CacheAdaptor, DataManager, DataUtil, Deferred, JsonAdaptor, ODataAdaptor, Predicate, Query, RemoteSaveAdaptor, UrlAdaptor, WebApiAdaptor, WebMethodAdaptor } from '@syncfusion/ej2-data';
5
- import { Tooltip, createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
5
+ import { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
6
6
 
7
7
  var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
8
8
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -3434,7 +3434,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3434
3434
  return false;
3435
3435
  }
3436
3436
  };
3437
- TreeGrid_1.Inject(Selection);
3437
+ TreeGrid_1.Inject(Selection, Logger$1);
3438
3438
  setValue('mergePersistData', this.mergePersistTreeGridData, this);
3439
3439
  const logger = 'Logger';
3440
3440
  if (!isNullOrUndefined(this.injectedModules[`${logger}`])) {
@@ -3841,7 +3841,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3841
3841
  wireEvents() {
3842
3842
  EventHandler.add(this.grid.element, 'click', this.mouseClickHandler, this);
3843
3843
  EventHandler.add(this.element, 'touchend', this.mouseClickHandler, this);
3844
- EventHandler.add(this.element, 'mousemove', this.mouseMoveHandler, this);
3845
3844
  this.keyboardModule = new KeyboardEvents(this.element, {
3846
3845
  keyAction: this.treeGridkeyActionHandler.bind(this),
3847
3846
  keyConfigs: this.keyConfigs,
@@ -3865,78 +3864,94 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3865
3864
  return modules;
3866
3865
  }
3867
3866
  modules.push({
3868
- member: 'filter', args: [this, this.filterSettings]
3867
+ member: 'filter', args: [this, this.filterSettings],
3868
+ name: 'Filter'
3869
3869
  });
3870
3870
  if (!isNullOrUndefined(this.toolbar)) {
3871
3871
  modules.push({
3872
3872
  member: 'toolbar',
3873
- args: [this]
3873
+ args: [this],
3874
+ name: 'Toolbar'
3874
3875
  });
3875
3876
  }
3876
3877
  if (this.contextMenuItems) {
3877
3878
  modules.push({
3878
3879
  member: 'contextMenu',
3879
- args: [this]
3880
+ args: [this],
3881
+ name: 'ContextMenu'
3880
3882
  });
3881
3883
  }
3882
3884
  if (this.allowPaging) {
3883
3885
  modules.push({
3884
3886
  member: 'pager',
3885
- args: [this, this.pageSettings]
3887
+ args: [this, this.pageSettings],
3888
+ name: 'Page'
3886
3889
  });
3887
3890
  }
3888
3891
  if (this.allowReordering) {
3889
3892
  modules.push({
3890
3893
  member: 'reorder',
3891
- args: [this]
3894
+ args: [this],
3895
+ name: 'Reorder'
3892
3896
  });
3893
3897
  }
3894
3898
  if (this.allowSorting) {
3895
3899
  modules.push({
3896
3900
  member: 'sort',
3897
- args: [this]
3901
+ args: [this],
3902
+ name: 'Sort'
3898
3903
  });
3899
3904
  }
3900
3905
  if (this.aggregates.length > 0) {
3901
3906
  modules.push({
3902
- member: 'summary', args: [this]
3907
+ member: 'summary', args: [this],
3908
+ name: 'Aggregate'
3909
+ });
3910
+ }
3911
+ if (this.allowResizing) {
3912
+ modules.push({
3913
+ member: 'resize', args: [this],
3914
+ name: 'Resize'
3903
3915
  });
3904
3916
  }
3905
- modules.push({
3906
- member: 'resize', args: [this]
3907
- });
3908
3917
  if (this.allowExcelExport) {
3909
3918
  modules.push({
3910
- member: 'ExcelExport', args: [this]
3919
+ member: 'ExcelExport', args: [this],
3920
+ name: 'ExcelExport'
3911
3921
  });
3912
3922
  }
3913
3923
  const freezePresent = this.injectedModules.filter((e) => {
3914
3924
  return e.prototype.getModuleName() === 'freeze';
3915
3925
  });
3916
- if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
3917
- this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount() || freezePresent.length) {
3926
+ if ((this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
3927
+ this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) && freezePresent.length > 0) {
3918
3928
  modules.push({
3919
- member: 'freeze', args: [this]
3929
+ member: 'freeze', args: [this],
3930
+ name: 'Freeze'
3920
3931
  });
3921
3932
  }
3922
3933
  if (this.detailTemplate) {
3923
3934
  modules.push({
3924
- member: 'detailRow', args: [this]
3935
+ member: 'detailRow', args: [this],
3936
+ name: 'DetailRow'
3925
3937
  });
3926
3938
  }
3927
3939
  if (this.allowPdfExport) {
3928
3940
  modules.push({
3929
- member: 'PdfExport', args: [this]
3941
+ member: 'PdfExport', args: [this],
3942
+ name: 'PdfExport'
3930
3943
  });
3931
3944
  }
3932
3945
  if (this.showColumnMenu) {
3933
3946
  modules.push({
3934
- member: 'columnMenu', args: [this]
3947
+ member: 'columnMenu', args: [this],
3948
+ name: 'ColumnMenu'
3935
3949
  });
3936
3950
  }
3937
3951
  if (this.showColumnChooser) {
3938
3952
  modules.push({
3939
- member: 'ColumnChooser', args: [this]
3953
+ member: 'ColumnChooser', args: [this],
3954
+ name: 'ColumnChooser'
3940
3955
  });
3941
3956
  }
3942
3957
  this.extendRequiredModules(modules);
@@ -3953,37 +3968,43 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3953
3968
  }
3954
3969
  modules.push({
3955
3970
  member: 'rowDragAndDrop',
3956
- args: [this]
3971
+ args: [this],
3972
+ name: 'RowDD'
3957
3973
  });
3958
3974
  }
3959
3975
  if (this.editSettings.allowAdding || this.editSettings.allowDeleting || this.editSettings.allowEditing) {
3960
3976
  modules.push({
3961
3977
  member: 'edit',
3962
- args: [this]
3978
+ args: [this],
3979
+ name: 'Edit'
3963
3980
  });
3964
3981
  }
3965
3982
  if (this.isCommandColumn(this.columns)) {
3966
3983
  modules.push({
3967
3984
  member: 'commandColumn',
3968
- args: [this]
3985
+ args: [this],
3986
+ name: 'CommandColumn'
3969
3987
  });
3970
3988
  }
3971
3989
  if (this.allowSelection) {
3972
3990
  modules.push({
3973
3991
  member: 'selection',
3974
- args: [this]
3992
+ args: [this],
3993
+ name: 'Selection'
3975
3994
  });
3976
3995
  }
3977
3996
  if (this.enableVirtualization) {
3978
3997
  modules.push({
3979
3998
  member: 'virtualScroll',
3980
- args: [this]
3999
+ args: [this],
4000
+ name: 'VirtualScroll'
3981
4001
  });
3982
4002
  }
3983
4003
  if (this.enableInfiniteScrolling) {
3984
4004
  modules.push({
3985
4005
  member: 'infiniteScroll',
3986
- args: [this]
4006
+ args: [this],
4007
+ name: 'InfiniteScroll'
3987
4008
  });
3988
4009
  }
3989
4010
  modules.push({
@@ -4009,6 +4030,16 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4009
4030
  if (this.grid && this.grid.element) {
4010
4031
  EventHandler.remove(this.grid.element, 'click', this.mouseClickHandler);
4011
4032
  }
4033
+ if (this.element) {
4034
+ EventHandler.remove(this.element, 'touchend', this.mouseClickHandler);
4035
+ if (this.keyboardModule) {
4036
+ this.keyboardModule.destroy();
4037
+ this.keyboardModule = null;
4038
+ }
4039
+ if (this.allowKeyboard) {
4040
+ this.element.removeAttribute('tabIndex');
4041
+ }
4042
+ }
4012
4043
  }
4013
4044
  /**
4014
4045
  * Logs tree grid error message on console
@@ -5297,6 +5328,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5297
5328
  target.classList.contains('e-treegridcollapse')) && (!this.isEditCollapse && !this.grid.isEdit)) {
5298
5329
  this.expandCollapseRequest(target);
5299
5330
  }
5331
+ const isEllipsisTooltip = 'isEllipsisTooltip';
5332
+ if ((target.classList.contains('e-treegridexpand') || target.classList.contains('e-treegridcollapse')) &&
5333
+ (this.grid[`${isEllipsisTooltip}`]())) {
5334
+ this.grid['toolTipObj'].close();
5335
+ }
5300
5336
  this.isEditCollapse = false;
5301
5337
  this.notify('checkboxSelection', { target: target });
5302
5338
  if (this.grid.isCheckBoxSelection && !this.grid.isPersistSelection) {
@@ -5312,20 +5348,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5312
5348
  }
5313
5349
  }
5314
5350
  }
5315
- mouseMoveHandler(e) {
5316
- let showTooltip = false;
5317
- const cols = this.getColumns();
5318
- if (this.clipMode === 'EllipsisWithTooltip') {
5319
- showTooltip = true;
5320
- }
5321
- const element = parentsUntil(e.target, 'e-ellipsistooltip');
5322
- if ((showTooltip || (this.treeColumnIndex !== -1 && cols[this.treeColumnIndex].clipMode === 'EllipsisWithTooltip')) && element !== null && parseInt(element.getAttribute('data-colindex'), 10) === this.treeColumnIndex && element.children[0].scrollWidth > element.children[0].clientWidth) {
5323
- const tooltip = new Tooltip({
5324
- content: element.textContent
5325
- });
5326
- tooltip.appendTo(element);
5327
- }
5328
- }
5329
5351
  /**
5330
5352
  * Returns TreeGrid rows
5331
5353
  *
@@ -7485,7 +7507,7 @@ __decorate([
7485
7507
  Property(false)
7486
7508
  ], TreeGrid.prototype, "enableColumnVirtualization", void 0);
7487
7509
  __decorate([
7488
- Property(false)
7510
+ Property(true)
7489
7511
  ], TreeGrid.prototype, "enableHtmlSanitizer", void 0);
7490
7512
  __decorate([
7491
7513
  Property(false)
@@ -9270,8 +9292,10 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
9270
9292
  notifyArgs.requestType = 'refresh';
9271
9293
  }
9272
9294
  const rows = super.generateRows(data, notifyArgs);
9273
- for (let r = 0; r < rows.length; r++) {
9274
- rows[parseInt(r.toString(), 10)].index = (this.visualData).indexOf(rows[parseInt(r.toString(), 10)].data);
9295
+ if (!isNullOrUndefined((this.visualData))) {
9296
+ for (let r = 0; r < rows.length; r++) {
9297
+ rows[parseInt(r.toString(), 10)].index = (this.visualData).indexOf(rows[parseInt(r.toString(), 10)].data);
9298
+ }
9275
9299
  }
9276
9300
  return rows;
9277
9301
  }
@@ -10447,12 +10471,7 @@ class Aggregate$1 {
10447
10471
  if (this.parent.isReact) {
10448
10472
  const renderReactTemplates = 'renderReactTemplates';
10449
10473
  tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property, '', null, null, cellElement);
10450
- // eslint-disable-next-line @typescript-eslint/no-this-alias
10451
- const thisRef = this;
10452
- // tslint:disable-next-line:typedef
10453
- thisRef.parent[`${renderReactTemplates}`](function () {
10454
- thisRef.parent.trigger(queryCellInfo, thisRef.parent['args']);
10455
- });
10474
+ this.parent[`${renderReactTemplates}`]();
10456
10475
  }
10457
10476
  else {
10458
10477
  appendChildren(cellElement, tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property));
@@ -13347,10 +13366,16 @@ class VirtualScroll$1 {
13347
13366
  this.parent.grid.getContent().firstElementChild.scrollTop = 0;
13348
13367
  this.parent.grid.notify(virtualActionArgs, { setTop: true });
13349
13368
  }
13350
- if ((requestType === 'save' && pageingDetails.actionArgs.index >= (counts.count - this.parent.grid.pageSettings.pageSize)) || (requestType === 'refresh' && this.parent['isGantt'] && this.parent['isAddedFromGantt']
13351
- && this.parent.grid.pageSettings.currentPage === this.parent.grid.contentModule['maxPage'])) {
13352
- startIndex = counts.startIndex + (counts.count - counts.endIndex);
13353
- endIndex = counts.count;
13369
+ if ((requestType === 'save' && pageingDetails.actionArgs.index >= (counts.count - this.parent.grid.pageSettings.pageSize)) || (requestType === 'refresh' && this.parent['isGantt'] && this.parent['isAddedFromGantt'])) {
13370
+ const modifiedStartIndex = counts.startIndex + (counts.count - counts.endIndex);
13371
+ if (counts.startIndex <= modifiedStartIndex && counts.endIndex <= modifiedStartIndex) {
13372
+ startIndex = counts.startIndex;
13373
+ endIndex = counts.endIndex;
13374
+ }
13375
+ else {
13376
+ startIndex = modifiedStartIndex;
13377
+ endIndex = counts.count;
13378
+ }
13354
13379
  this.parent['isAddedFromGantt'] = false;
13355
13380
  }
13356
13381
  //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&