@syncfusion/ej2-treegrid 20.3.58 → 20.3.61

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.
@@ -1316,9 +1316,9 @@ var Selection = /** @__PURE__ @class */ (function () {
1316
1316
  if (recordIndex > -1) {
1317
1317
  if (!isNullOrUndefined(checkbox)) {
1318
1318
  checkbox.classList.add(checkBoxclass);
1319
- var chkstate = checkState == 'check' ? 'checked' : checkState == 'uncheck' ? 'unchecked' : 'mixed';
1320
- tr.querySelector('.e-treecheckselect').setAttribute("aria-checked", checkState == 'check' ? 'true' : checkState == 'uncheck' ? 'false' : 'mixed');
1321
- tr.querySelector('.e-frame').setAttribute("title", "checkbox" + chkstate);
1319
+ var chkstate = checkState === 'check' ? 'checked' : checkState === 'uncheck' ? 'unchecked' : 'mixed';
1320
+ tr.querySelector('.e-treecheckselect').setAttribute('aria-checked', checkState === 'check' ? 'true' : checkState === 'uncheck' ? 'false' : 'mixed');
1321
+ tr.querySelector('.e-frame').setAttribute('title', 'checkbox' + chkstate);
1322
1322
  }
1323
1323
  }
1324
1324
  };
@@ -1684,7 +1684,7 @@ var Render = /** @__PURE__ @class */ (function () {
1684
1684
  }
1685
1685
  if (iconRequired) {
1686
1686
  addClass([args.cell], 'e-treerowcell');
1687
- args.cell.setAttribute("aria-expanded", data.expanded ? "true" : "false");
1687
+ args.cell.setAttribute('aria-expanded', data.expanded ? 'true' : 'false');
1688
1688
  var expandIcon = createElement('span', { className: 'e-icons' });
1689
1689
  var expand = void 0;
1690
1690
  if (this.parent.initialRender) {
@@ -3996,7 +3996,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3996
3996
  };
3997
3997
  TreeGrid.prototype.IsExpandCollapseClicked = function (args) {
3998
3998
  if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
3999
- || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))) {
3999
+ || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))
4000
+ && (!isNullOrUndefined(args.data) && args.data['hasChildRecords'])) {
4000
4001
  args.cancel = true;
4001
4002
  return;
4002
4003
  }
@@ -4663,7 +4664,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4663
4664
  }
4664
4665
  var treeGridColumn;
4665
4666
  var gridColumn;
4666
- index = index === 0 ? -1 : index;
4667
+ if (this.columnModel.length == 0) {
4668
+ index = index === 0 ? -1 : index;
4669
+ }
4667
4670
  var gridColumnCollection = [];
4668
4671
  for (var i = 0; i < column.length; i++) {
4669
4672
  index = index + 1;
@@ -5823,7 +5826,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5823
5826
  record = this.grid.getCurrentViewRecords()[row.getAttribute('data-rowindex')];
5824
5827
  }
5825
5828
  else {
5826
- record = this.grid.getCurrentViewRecords()[row.rowIndex];
5829
+ record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
5827
5830
  }
5828
5831
  }
5829
5832
  return record;
@@ -6153,7 +6156,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6153
6156
  }
6154
6157
  removeClass([targetEle], 'e-treegridexpand');
6155
6158
  }
6156
- row.querySelectorAll('.e-treerowcell')[0].setAttribute("aria-expanded", action == 'expand' ? 'true' : 'false');
6159
+ row.querySelectorAll('.e-treerowcell')[0].setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');
6157
6160
  var detailrows = gridRows.filter(function (r) {
6158
6161
  return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));
6159
6162
  });
@@ -6346,10 +6349,24 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6346
6349
  return r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1));
6347
6350
  });
6348
6351
  }
6352
+ var gridRowsObject = this.grid.getRowsObject();
6353
+ if (!isNullOrUndefined(gridRowsObject[this.getCurrentViewRecords().indexOf(record)].visible) && gridRowsObject[this.getCurrentViewRecords().indexOf(record)].visible !== false) {
6354
+ gridRowsObject[this.getCurrentViewRecords().indexOf(record)].visible = true;
6355
+ }
6356
+ var detailrows = gridRows.filter(function (r) {
6357
+ return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));
6358
+ });
6349
6359
  for (var i = 0; i < rows.length; i++) {
6350
6360
  if (!isNullOrUndefined(rows[i])) {
6351
6361
  rows[i].style.display = displayAction;
6352
6362
  }
6363
+ if (!isNullOrUndefined(rows[i]) && !this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
6364
+ gridRowsObject[rows[i].rowIndex].visible = displayAction != 'none' ? true : false;
6365
+ var parentRecord = getValue('uniqueIDCollection.' + record.parentUniqueID, this);
6366
+ if (!isNullOrUndefined(parentRecord) && gridRows[this.getCurrentViewRecords().indexOf(parentRecord)].getElementsByClassName('e-treegridcollapse').length) {
6367
+ gridRowsObject[this.getCurrentViewRecords().indexOf(record)].visible = false;
6368
+ }
6369
+ }
6353
6370
  if (!isNullOrUndefined(movableRows)) {
6354
6371
  movableRows[i].style.display = displayAction;
6355
6372
  }
@@ -6365,6 +6382,15 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6365
6382
  }
6366
6383
  }
6367
6384
  }
6385
+ for (var i = 0; i < detailrows.length; i++) {
6386
+ if (!isNullOrUndefined(detailrows[i]) && !this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
6387
+ gridRowsObject[detailrows[i].rowIndex].visible = displayAction != 'none' ? true : false;
6388
+ detailrows[i].style.display = displayAction;
6389
+ }
6390
+ }
6391
+ if (!this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
6392
+ this.grid.notify('refresh-Expand-and-Collapse', { rows: this.grid.getRowsObject() });
6393
+ }
6368
6394
  };
6369
6395
  TreeGrid.prototype.updateAltRow = function (rows) {
6370
6396
  if (this.enableAltRow && !this.rowTemplate) {
@@ -12788,7 +12814,7 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
12788
12814
  };
12789
12815
  TreeInterSectionObserver.prototype.virtualScrollHandlers = function (callback, onEnterCallback, instance) {
12790
12816
  var _this = this;
12791
- var delay = Browser.info.name === 'chrome' ? 200 : 100;
12817
+ //const delay: number = Browser.info.name === 'chrome' ? 200 : 100;
12792
12818
  var options = 'options';
12793
12819
  var movableEle = 'movableEle';
12794
12820
  var element = 'element';