@syncfusion/ej2-treegrid 20.3.57 → 20.3.60

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.
@@ -958,7 +958,7 @@ class Selection {
958
958
  }
959
959
  }
960
960
  renderColumnCheckbox(args) {
961
- const rowChkBox = this.parent.createElement('input', { className: 'e-treecheckselect', attrs: { 'type': 'checkbox' } });
961
+ const rowChkBox = this.parent.createElement('input', { className: 'e-treecheckselect', attrs: { 'type': 'checkbox', 'aria-label': 'checkbox' } });
962
962
  const data = args.data;
963
963
  args.cell.classList.add('e-treegridcheckbox');
964
964
  args.cell.setAttribute('aria-label', 'checkbox');
@@ -1188,9 +1188,9 @@ class Selection {
1188
1188
  let checkedRecord;
1189
1189
  const recordIndex = this.parent.getCurrentViewRecords().indexOf(record[0]);
1190
1190
  const checkboxRecord = getParentData(this.parent, currentRecord.uniqueID);
1191
+ const tr = this.parent.getRows()[recordIndex];
1191
1192
  let checkbox;
1192
1193
  if (recordIndex > -1) {
1193
- const tr = this.parent.getRows()[recordIndex];
1194
1194
  let movableTr;
1195
1195
  if (this.parent.frozenRows || this.parent.getFrozenColumns()) {
1196
1196
  movableTr = this.parent.getMovableDataRows()[recordIndex];
@@ -1239,6 +1239,9 @@ class Selection {
1239
1239
  if (recordIndex > -1) {
1240
1240
  if (!isNullOrUndefined(checkbox)) {
1241
1241
  checkbox.classList.add(checkBoxclass);
1242
+ const chkstate = checkState === 'check' ? 'checked' : checkState === 'uncheck' ? 'unchecked' : 'mixed';
1243
+ tr.querySelector('.e-treecheckselect').setAttribute('aria-checked', checkState === 'check' ? 'true' : checkState === 'uncheck' ? 'false' : 'mixed');
1244
+ tr.querySelector('.e-frame').setAttribute('title', 'checkbox' + chkstate);
1242
1245
  }
1243
1246
  }
1244
1247
  }
@@ -1565,6 +1568,7 @@ class Render {
1565
1568
  }
1566
1569
  if (iconRequired) {
1567
1570
  addClass([args.cell], 'e-treerowcell');
1571
+ args.cell.setAttribute('aria-expanded', data.expanded ? 'true' : 'false');
1568
1572
  const expandIcon = createElement('span', { className: 'e-icons' });
1569
1573
  let expand;
1570
1574
  if (this.parent.initialRender) {
@@ -3744,13 +3748,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3744
3748
  this.trigger(getObject('name', args), args);
3745
3749
  }
3746
3750
  IsExpandCollapseClicked(args) {
3747
- if (args['name'] === 'rowSelecting' && !isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
3748
- || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell')) && (isNullOrUndefined(args['previousRowIndex']))) {
3749
- args.cancel = true;
3750
- return;
3751
- }
3752
- else if (args['name'] === 'rowDeselecting' && !isNullOrUndefined(args.target) && ((!isNullOrUndefined(args.row) && (!args.row.length)) && (args.target.classList.contains('e-treegridexpand')
3753
- || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell')))) {
3751
+ if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
3752
+ || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))
3753
+ && (!isNullOrUndefined(args.data) && args.data['hasChildRecords'])) {
3754
3754
  args.cancel = true;
3755
3755
  return;
3756
3756
  }
@@ -4408,7 +4408,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4408
4408
  }
4409
4409
  let treeGridColumn;
4410
4410
  let gridColumn;
4411
- index = index === 0 ? -1 : index;
4411
+ if (this.columnModel.length == 0) {
4412
+ index = index === 0 ? -1 : index;
4413
+ }
4412
4414
  const gridColumnCollection = [];
4413
4415
  for (let i = 0; i < column.length; i++) {
4414
4416
  index = index + 1;
@@ -5886,6 +5888,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5886
5888
  }
5887
5889
  removeClass([targetEle], 'e-treegridexpand');
5888
5890
  }
5891
+ row.querySelectorAll('.e-treerowcell')[0].setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');
5889
5892
  const detailrows = gridRows.filter((r) => r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1)));
5890
5893
  if (isRemoteData(this) && !isOffline(this)) {
5891
5894
  this.remoteExpand(action, row, record);
@@ -6067,10 +6070,23 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6067
6070
  if (freeze) {
6068
6071
  freezeRightRows = this.getFrozenRightRows().filter((r) => r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1)));
6069
6072
  }
6073
+ let gridRowsObject = this.grid.getRowsObject();
6074
+ if (gridRowsObject[record.index].visible !== false) {
6075
+ gridRowsObject[record.index].visible = true;
6076
+ }
6077
+ const detailrows = gridRows.filter((r) => r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1)));
6070
6078
  for (let i = 0; i < rows.length; i++) {
6071
6079
  if (!isNullOrUndefined(rows[i])) {
6072
6080
  rows[i].style.display = displayAction;
6073
6081
  }
6082
+ if (!isNullOrUndefined(rows[i]) && !this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
6083
+ gridRowsObject[rows[i].rowIndex].visible = displayAction != 'none' ? true : false;
6084
+ if ("parentItem" in record) {
6085
+ if (gridRows[record.parentItem.index].getElementsByClassName('e-treegridcollapse').length) {
6086
+ gridRowsObject[record.index].visible = false;
6087
+ }
6088
+ }
6089
+ }
6074
6090
  if (!isNullOrUndefined(movableRows)) {
6075
6091
  movableRows[i].style.display = displayAction;
6076
6092
  }
@@ -6086,6 +6102,15 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6086
6102
  }
6087
6103
  }
6088
6104
  }
6105
+ for (let i = 0; i < detailrows.length; i++) {
6106
+ if (!isNullOrUndefined(detailrows[i]) && !this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
6107
+ gridRowsObject[detailrows[i].rowIndex].visible = displayAction != 'none' ? true : false;
6108
+ detailrows[i].style.display = displayAction;
6109
+ }
6110
+ }
6111
+ if (!this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
6112
+ this.grid.notify('refresh-Expand-and-Collapse', { rows: this.grid.getRowsObject() });
6113
+ }
6089
6114
  }
6090
6115
  updateAltRow(rows) {
6091
6116
  if (this.enableAltRow && !this.rowTemplate) {
@@ -12407,7 +12432,7 @@ class TreeInterSectionObserver extends InterSectionObserver {
12407
12432
  this.lastPos = null;
12408
12433
  }
12409
12434
  virtualScrollHandlers(callback, onEnterCallback, instance) {
12410
- const delay = Browser.info.name === 'chrome' ? 200 : 100;
12435
+ //const delay: number = Browser.info.name === 'chrome' ? 200 : 100;
12411
12436
  const options = 'options';
12412
12437
  const movableEle = 'movableEle';
12413
12438
  const element = 'element';