@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 __extends$1 = (undefined && undefined.__extends) || (function () {
8
8
  var extendStatics = function (d, b) {
@@ -3721,7 +3721,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3721
3721
  return false;
3722
3722
  }
3723
3723
  };
3724
- TreeGrid_1.Inject(Selection);
3724
+ TreeGrid_1.Inject(Selection, Logger$1);
3725
3725
  setValue('mergePersistData', _this.mergePersistTreeGridData, _this);
3726
3726
  var logger = 'Logger';
3727
3727
  if (!isNullOrUndefined(_this.injectedModules["" + logger])) {
@@ -4130,7 +4130,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4130
4130
  TreeGrid.prototype.wireEvents = function () {
4131
4131
  EventHandler.add(this.grid.element, 'click', this.mouseClickHandler, this);
4132
4132
  EventHandler.add(this.element, 'touchend', this.mouseClickHandler, this);
4133
- EventHandler.add(this.element, 'mousemove', this.mouseMoveHandler, this);
4134
4133
  this.keyboardModule = new KeyboardEvents(this.element, {
4135
4134
  keyAction: this.treeGridkeyActionHandler.bind(this),
4136
4135
  keyConfigs: this.keyConfigs,
@@ -4154,78 +4153,94 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4154
4153
  return modules;
4155
4154
  }
4156
4155
  modules.push({
4157
- member: 'filter', args: [this, this.filterSettings]
4156
+ member: 'filter', args: [this, this.filterSettings],
4157
+ name: 'Filter'
4158
4158
  });
4159
4159
  if (!isNullOrUndefined(this.toolbar)) {
4160
4160
  modules.push({
4161
4161
  member: 'toolbar',
4162
- args: [this]
4162
+ args: [this],
4163
+ name: 'Toolbar'
4163
4164
  });
4164
4165
  }
4165
4166
  if (this.contextMenuItems) {
4166
4167
  modules.push({
4167
4168
  member: 'contextMenu',
4168
- args: [this]
4169
+ args: [this],
4170
+ name: 'ContextMenu'
4169
4171
  });
4170
4172
  }
4171
4173
  if (this.allowPaging) {
4172
4174
  modules.push({
4173
4175
  member: 'pager',
4174
- args: [this, this.pageSettings]
4176
+ args: [this, this.pageSettings],
4177
+ name: 'Page'
4175
4178
  });
4176
4179
  }
4177
4180
  if (this.allowReordering) {
4178
4181
  modules.push({
4179
4182
  member: 'reorder',
4180
- args: [this]
4183
+ args: [this],
4184
+ name: 'Reorder'
4181
4185
  });
4182
4186
  }
4183
4187
  if (this.allowSorting) {
4184
4188
  modules.push({
4185
4189
  member: 'sort',
4186
- args: [this]
4190
+ args: [this],
4191
+ name: 'Sort'
4187
4192
  });
4188
4193
  }
4189
4194
  if (this.aggregates.length > 0) {
4190
4195
  modules.push({
4191
- member: 'summary', args: [this]
4196
+ member: 'summary', args: [this],
4197
+ name: 'Aggregate'
4198
+ });
4199
+ }
4200
+ if (this.allowResizing) {
4201
+ modules.push({
4202
+ member: 'resize', args: [this],
4203
+ name: 'Resize'
4192
4204
  });
4193
4205
  }
4194
- modules.push({
4195
- member: 'resize', args: [this]
4196
- });
4197
4206
  if (this.allowExcelExport) {
4198
4207
  modules.push({
4199
- member: 'ExcelExport', args: [this]
4208
+ member: 'ExcelExport', args: [this],
4209
+ name: 'ExcelExport'
4200
4210
  });
4201
4211
  }
4202
4212
  var freezePresent = this.injectedModules.filter(function (e) {
4203
4213
  return e.prototype.getModuleName() === 'freeze';
4204
4214
  });
4205
- if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
4206
- this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount() || freezePresent.length) {
4215
+ if ((this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
4216
+ this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) && freezePresent.length > 0) {
4207
4217
  modules.push({
4208
- member: 'freeze', args: [this]
4218
+ member: 'freeze', args: [this],
4219
+ name: 'Freeze'
4209
4220
  });
4210
4221
  }
4211
4222
  if (this.detailTemplate) {
4212
4223
  modules.push({
4213
- member: 'detailRow', args: [this]
4224
+ member: 'detailRow', args: [this],
4225
+ name: 'DetailRow'
4214
4226
  });
4215
4227
  }
4216
4228
  if (this.allowPdfExport) {
4217
4229
  modules.push({
4218
- member: 'PdfExport', args: [this]
4230
+ member: 'PdfExport', args: [this],
4231
+ name: 'PdfExport'
4219
4232
  });
4220
4233
  }
4221
4234
  if (this.showColumnMenu) {
4222
4235
  modules.push({
4223
- member: 'columnMenu', args: [this]
4236
+ member: 'columnMenu', args: [this],
4237
+ name: 'ColumnMenu'
4224
4238
  });
4225
4239
  }
4226
4240
  if (this.showColumnChooser) {
4227
4241
  modules.push({
4228
- member: 'ColumnChooser', args: [this]
4242
+ member: 'ColumnChooser', args: [this],
4243
+ name: 'ColumnChooser'
4229
4244
  });
4230
4245
  }
4231
4246
  this.extendRequiredModules(modules);
@@ -4242,37 +4257,43 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4242
4257
  }
4243
4258
  modules.push({
4244
4259
  member: 'rowDragAndDrop',
4245
- args: [this]
4260
+ args: [this],
4261
+ name: 'RowDD'
4246
4262
  });
4247
4263
  }
4248
4264
  if (this.editSettings.allowAdding || this.editSettings.allowDeleting || this.editSettings.allowEditing) {
4249
4265
  modules.push({
4250
4266
  member: 'edit',
4251
- args: [this]
4267
+ args: [this],
4268
+ name: 'Edit'
4252
4269
  });
4253
4270
  }
4254
4271
  if (this.isCommandColumn(this.columns)) {
4255
4272
  modules.push({
4256
4273
  member: 'commandColumn',
4257
- args: [this]
4274
+ args: [this],
4275
+ name: 'CommandColumn'
4258
4276
  });
4259
4277
  }
4260
4278
  if (this.allowSelection) {
4261
4279
  modules.push({
4262
4280
  member: 'selection',
4263
- args: [this]
4281
+ args: [this],
4282
+ name: 'Selection'
4264
4283
  });
4265
4284
  }
4266
4285
  if (this.enableVirtualization) {
4267
4286
  modules.push({
4268
4287
  member: 'virtualScroll',
4269
- args: [this]
4288
+ args: [this],
4289
+ name: 'VirtualScroll'
4270
4290
  });
4271
4291
  }
4272
4292
  if (this.enableInfiniteScrolling) {
4273
4293
  modules.push({
4274
4294
  member: 'infiniteScroll',
4275
- args: [this]
4295
+ args: [this],
4296
+ name: 'InfiniteScroll'
4276
4297
  });
4277
4298
  }
4278
4299
  modules.push({
@@ -4299,6 +4320,16 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4299
4320
  if (this.grid && this.grid.element) {
4300
4321
  EventHandler.remove(this.grid.element, 'click', this.mouseClickHandler);
4301
4322
  }
4323
+ if (this.element) {
4324
+ EventHandler.remove(this.element, 'touchend', this.mouseClickHandler);
4325
+ if (this.keyboardModule) {
4326
+ this.keyboardModule.destroy();
4327
+ this.keyboardModule = null;
4328
+ }
4329
+ if (this.allowKeyboard) {
4330
+ this.element.removeAttribute('tabIndex');
4331
+ }
4332
+ }
4302
4333
  };
4303
4334
  /**
4304
4335
  * Logs tree grid error message on console
@@ -5601,6 +5632,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5601
5632
  target.classList.contains('e-treegridcollapse')) && (!this.isEditCollapse && !this.grid.isEdit)) {
5602
5633
  this.expandCollapseRequest(target);
5603
5634
  }
5635
+ var isEllipsisTooltip = 'isEllipsisTooltip';
5636
+ if ((target.classList.contains('e-treegridexpand') || target.classList.contains('e-treegridcollapse')) &&
5637
+ (this.grid["" + isEllipsisTooltip]())) {
5638
+ this.grid['toolTipObj'].close();
5639
+ }
5604
5640
  this.isEditCollapse = false;
5605
5641
  this.notify('checkboxSelection', { target: target });
5606
5642
  if (this.grid.isCheckBoxSelection && !this.grid.isPersistSelection) {
@@ -5616,20 +5652,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5616
5652
  }
5617
5653
  }
5618
5654
  };
5619
- TreeGrid.prototype.mouseMoveHandler = function (e) {
5620
- var showTooltip = false;
5621
- var cols = this.getColumns();
5622
- if (this.clipMode === 'EllipsisWithTooltip') {
5623
- showTooltip = true;
5624
- }
5625
- var element = parentsUntil(e.target, 'e-ellipsistooltip');
5626
- 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) {
5627
- var tooltip = new Tooltip({
5628
- content: element.textContent
5629
- });
5630
- tooltip.appendTo(element);
5631
- }
5632
- };
5633
5655
  /**
5634
5656
  * Returns TreeGrid rows
5635
5657
  *
@@ -7818,7 +7840,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7818
7840
  Property(false)
7819
7841
  ], TreeGrid.prototype, "enableColumnVirtualization", void 0);
7820
7842
  __decorate([
7821
- Property(false)
7843
+ Property(true)
7822
7844
  ], TreeGrid.prototype, "enableHtmlSanitizer", void 0);
7823
7845
  __decorate([
7824
7846
  Property(false)
@@ -9647,8 +9669,10 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
9647
9669
  notifyArgs.requestType = 'refresh';
9648
9670
  }
9649
9671
  var rows = _super.prototype.generateRows.call(this, data, notifyArgs);
9650
- for (var r = 0; r < rows.length; r++) {
9651
- rows[parseInt(r.toString(), 10)].index = (this.visualData).indexOf(rows[parseInt(r.toString(), 10)].data);
9672
+ if (!isNullOrUndefined((this.visualData))) {
9673
+ for (var r = 0; r < rows.length; r++) {
9674
+ rows[parseInt(r.toString(), 10)].index = (this.visualData).indexOf(rows[parseInt(r.toString(), 10)].data);
9675
+ }
9652
9676
  }
9653
9677
  return rows;
9654
9678
  }
@@ -10842,12 +10866,7 @@ var Aggregate$1 = /** @__PURE__ @class */ (function () {
10842
10866
  if (this.parent.isReact) {
10843
10867
  var renderReactTemplates = 'renderReactTemplates';
10844
10868
  tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property, '', null, null, cellElement);
10845
- // eslint-disable-next-line @typescript-eslint/no-this-alias
10846
- var thisRef_1 = this;
10847
- // tslint:disable-next-line:typedef
10848
- thisRef_1.parent["" + renderReactTemplates](function () {
10849
- thisRef_1.parent.trigger(queryCellInfo, thisRef_1.parent['args']);
10850
- });
10869
+ this.parent["" + renderReactTemplates]();
10851
10870
  }
10852
10871
  else {
10853
10872
  appendChildren(cellElement, tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property));
@@ -13795,10 +13814,16 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
13795
13814
  this.parent.grid.getContent().firstElementChild.scrollTop = 0;
13796
13815
  this.parent.grid.notify(virtualActionArgs, { setTop: true });
13797
13816
  }
13798
- if ((requestType === 'save' && pageingDetails.actionArgs.index >= (counts.count - this.parent.grid.pageSettings.pageSize)) || (requestType === 'refresh' && this.parent['isGantt'] && this.parent['isAddedFromGantt']
13799
- && this.parent.grid.pageSettings.currentPage === this.parent.grid.contentModule['maxPage'])) {
13800
- startIndex = counts.startIndex + (counts.count - counts.endIndex);
13801
- endIndex = counts.count;
13817
+ if ((requestType === 'save' && pageingDetails.actionArgs.index >= (counts.count - this.parent.grid.pageSettings.pageSize)) || (requestType === 'refresh' && this.parent['isGantt'] && this.parent['isAddedFromGantt'])) {
13818
+ var modifiedStartIndex = counts.startIndex + (counts.count - counts.endIndex);
13819
+ if (counts.startIndex <= modifiedStartIndex && counts.endIndex <= modifiedStartIndex) {
13820
+ startIndex = counts.startIndex;
13821
+ endIndex = counts.endIndex;
13822
+ }
13823
+ else {
13824
+ startIndex = modifiedStartIndex;
13825
+ endIndex = counts.count;
13826
+ }
13802
13827
  this.parent['isAddedFromGantt'] = false;
13803
13828
  }
13804
13829
  //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&