@syncfusion/ej2-treegrid 25.2.3 → 25.2.4

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.
@@ -3733,6 +3733,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3733
3733
  if (!isNullOrUndefined(_this.injectedModules["" + logger])) {
3734
3734
  Grid.Inject(Logger);
3735
3735
  }
3736
+ var freezeModulePresent = _this.injectedModules.filter(function (e) {
3737
+ if (e.prototype.getModuleName() === 'freeze') {
3738
+ Grid.Inject(Freeze);
3739
+ }
3740
+ });
3736
3741
  _this.grid = new Grid();
3737
3742
  return _this;
3738
3743
  }
@@ -4049,19 +4054,21 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4049
4054
  if (!this.enableVirtualization) {
4050
4055
  target = e.target;
4051
4056
  parentTarget = target.parentElement;
4052
- var cellIndex = parentTarget.cellIndex;
4053
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
4054
- parentTarget = target;
4055
- }
4056
- summaryElement = this.findnextRowElement(parentTarget);
4057
- if (summaryElement !== null) {
4058
- var cellIndex_1 = e.target.cellIndex;
4059
- var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
4060
- addClass([row_1], 'e-focused');
4061
- addClass([row_1], 'e-focus');
4062
- }
4063
- else {
4064
- this.clearSelection();
4057
+ if (!isNullOrUndefined(parentTarget)) {
4058
+ var cellIndex = parentTarget.cellIndex;
4059
+ if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
4060
+ parentTarget = target;
4061
+ }
4062
+ summaryElement = this.findnextRowElement(parentTarget);
4063
+ if (summaryElement !== null) {
4064
+ var cellIndex_1 = e.target.cellIndex;
4065
+ var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
4066
+ addClass([row_1], 'e-focused');
4067
+ addClass([row_1], 'e-focus');
4068
+ }
4069
+ else {
4070
+ this.clearSelection();
4071
+ }
4065
4072
  }
4066
4073
  }
4067
4074
  break;
@@ -4069,19 +4076,21 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4069
4076
  if (!this.enableVirtualization) {
4070
4077
  target = e.target;
4071
4078
  parentTarget = target.parentElement;
4072
- var cellIndex = parentTarget.cellIndex;
4073
- if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
4074
- parentTarget = target;
4075
- }
4076
- summaryElement = this.findPreviousRowElement(parentTarget);
4077
- if (summaryElement !== null) {
4078
- var cIndex = e.target.cellIndex;
4079
- var rows = summaryElement.children[parseInt(cIndex.toString(), 10)];
4080
- addClass([rows], 'e-focused');
4081
- addClass([rows], 'e-focus');
4082
- }
4083
- else {
4084
- this.clearSelection();
4079
+ if (!isNullOrUndefined(parentTarget)) {
4080
+ var cellIndex = parentTarget.cellIndex;
4081
+ if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
4082
+ parentTarget = target;
4083
+ }
4084
+ summaryElement = this.findPreviousRowElement(parentTarget);
4085
+ if (summaryElement !== null) {
4086
+ var cIndex = e.target.cellIndex;
4087
+ var rows = summaryElement.children[parseInt(cIndex.toString(), 10)];
4088
+ addClass([rows], 'e-focused');
4089
+ addClass([rows], 'e-focus');
4090
+ }
4091
+ else {
4092
+ this.clearSelection();
4093
+ }
4085
4094
  }
4086
4095
  }
4087
4096
  }
@@ -6436,7 +6445,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6436
6445
  if (!this.isExpandingEventTriggered) {
6437
6446
  this.trigger(expanding, args, function (expandingArgs) {
6438
6447
  _this.expandAllPrevent = expandingArgs.cancel;
6439
- if (!expandingArgs.cancel) {
6448
+ if (!expandingArgs.cancel && !isNullOrUndefined(record)) {
6440
6449
  if (expandingArgs.expandAll) {
6441
6450
  _this.expandCollapseAllChildren(record, 'expand', key, level);
6442
6451
  }
@@ -6562,7 +6571,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6562
6571
  else if (!this.isCollapseAll || (this.isCollapseAll && isRemoteData(this))) {
6563
6572
  var args = { data: record, row: row, cancel: false };
6564
6573
  this.trigger(collapsing, args, function (collapsingArgs) {
6565
- if (!collapsingArgs.cancel) {
6574
+ if (!collapsingArgs.cancel && !isNullOrUndefined(record)) {
6566
6575
  _this.collapseRows(row, record, parentRec, key);
6567
6576
  }
6568
6577
  });
@@ -10038,12 +10047,17 @@ var ExcelExport$1 = /** @__PURE__ @class */ (function () {
10038
10047
  if (!isNullOrUndefined(excelExportProperties)) {
10039
10048
  this.isCollapsedStatePersist = excelExportProperties.isCollapsedStatePersist;
10040
10049
  }
10050
+ if (!isNullOrUndefined(excelExportProperties) && !isNullOrUndefined(excelExportProperties.dataSource)
10051
+ && !isNullOrUndefined(excelExportProperties.dataSource instanceof DataManager)) {
10052
+ return this.parent.grid.excelExportModule.Map(this.parent.grid, excelExportProperties, isMultipleExport, workbook, isCsv, isBlob);
10053
+ }
10041
10054
  return new Promise(function (resolve) {
10042
10055
  var dm = _this.isLocal() && !(dataSource instanceof DataManager) ? new DataManager(dataSource)
10043
10056
  : _this.parent.dataSource;
10044
10057
  var query = new Query();
10045
10058
  if (!_this.isLocal()) {
10046
10059
  query = _this.generateQuery(query);
10060
+ query.queries = _this.parent.grid.getDataModule().generateQuery().queries;
10047
10061
  setValue('query', query, property);
10048
10062
  }
10049
10063
  _this.parent.trigger(beforeExcelExport, extend(property, excelExportProperties));
@@ -12769,6 +12783,7 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
12769
12783
  args.index = position === 'before' ? index : index + 1;
12770
12784
  }
12771
12785
  if (this.parent.editSettings.newRowPosition === 'Bottom') {
12786
+ level = 0;
12772
12787
  var dataSource = (this.parent.grid.dataSource instanceof DataManager ?
12773
12788
  this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
12774
12789
  args.index = dataSource.length;
@@ -13457,7 +13472,12 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
13457
13472
  }
13458
13473
  if (firsttdinx === 0) {
13459
13474
  this.translateY = (scrollArgs.offset.top - (outBuffer * rowHeight) > 0) ?
13460
- scrollArgs.offset.top - (outBuffer * this.parent.getRowHeight()) + 10 : 0;
13475
+ scrollArgs.offset.top - (outBuffer * this.parent.getRowHeight()) + rowHeight : 0;
13476
+ }
13477
+ else if (this.parent.getFrozenColumns() > 0) {
13478
+ scrollArgs.offset.top = scrollArgs.offset.top + 80;
13479
+ this.translateY = (scrollArgs.offset.top - (outBuffer * rowHeight) > 0) ?
13480
+ scrollArgs.offset.top - (outBuffer * rowHeight) + 10 : 0;
13461
13481
  }
13462
13482
  else {
13463
13483
  this.translateY = (scrollArgs.offset.top - (outBuffer * rowHeight) > 0) ?
@@ -13497,6 +13517,9 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
13497
13517
  if (this.parent.allowRowDragAndDrop) {
13498
13518
  this.translateY = scrollArgs.offset.top - rowHeight * 2;
13499
13519
  }
13520
+ else if (this.parent.getFrozenColumns() > 0) {
13521
+ this.translateY = scrollArgs.offset.top - ((rowHeight * 2) + this.parent.pageSettings.pageSize);
13522
+ }
13500
13523
  else {
13501
13524
  this.translateY = scrollArgs.offset.top;
13502
13525
  }
@@ -13833,15 +13856,11 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
13833
13856
  this.parent.grid.notify(virtualActionArgs, { setTop: true });
13834
13857
  }
13835
13858
  if ((requestType === 'save' && pageingDetails.actionArgs.index >= (counts.count - this.parent.grid.pageSettings.pageSize)) || (requestType === 'refresh' && this.parent['isGantt'] && this.parent['isAddedFromGantt'])) {
13836
- var modifiedStartIndex = counts.startIndex + (counts.count - counts.endIndex);
13837
- if (counts.count - counts.startIndex <= this.parent.grid.pageSettings.pageSize) {
13838
- startIndex = modifiedStartIndex;
13859
+ if ((counts.endIndex + this.parent.pageSettings.pageSize >= counts.count && (this.parent.root && counts.count - counts.endIndex === this.visualData.length - this.parent.root['previousFlatData'].length))
13860
+ || !(this.parent['isGantt'] && this.parent['isAddedFromGantt'])) {
13861
+ startIndex = counts.startIndex + (counts.count - counts.endIndex);
13839
13862
  endIndex = counts.count;
13840
13863
  }
13841
- else {
13842
- startIndex = counts.startIndex;
13843
- endIndex = counts.endIndex;
13844
- }
13845
13864
  this.parent['isAddedFromGantt'] = false;
13846
13865
  }
13847
13866
  //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&