@syncfusion/ej2-treegrid 20.1.55 → 20.1.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.
@@ -77,12 +77,12 @@ var Column = /** @__PURE__ @class */ (function () {
77
77
  merge(this, options);
78
78
  }
79
79
  /**
80
- * Update the State changes reflected for TreeGrid columndirective in react platform.
81
- *
82
- * @param {Column} column - specifies the column
83
- * @returns {void}
84
- * @hidden
85
- */
80
+ * Update the State changes reflected for TreeGrid columndirective in react platform.
81
+ *
82
+ * @param {Column} column - specifies the column
83
+ * @returns {void}
84
+ * @hidden
85
+ */
86
86
  Column.prototype.setProperties = function (column) {
87
87
  //Angular two way binding
88
88
  var keys = Object.keys(column);
@@ -959,7 +959,7 @@ var Selection = /** @__PURE__ @class */ (function () {
959
959
  Selection.prototype.getCheckboxcolumnIndex = function () {
960
960
  var mappingUid;
961
961
  var columnIndex;
962
- var stackedHeader = "stackedHeader";
962
+ var stackedHeader = 'stackedHeader';
963
963
  var columnModel = 'columnModel';
964
964
  var columns = this.parent[stackedHeader] ? this.parent[columnModel] : (this.parent.columns);
965
965
  for (var col = 0; col < columns.length; col++) {
@@ -1350,6 +1350,105 @@ var Selection = /** @__PURE__ @class */ (function () {
1350
1350
  return Selection;
1351
1351
  }());
1352
1352
 
1353
+ /**
1354
+ * TreeGrid Freeze module
1355
+ *
1356
+ * @hidden
1357
+ */
1358
+ var Freeze$1 = /** @__PURE__ @class */ (function () {
1359
+ /**
1360
+ * Constructor for render module
1361
+ *
1362
+ * @param {TreeGrid} parent - Tree Grid instance
1363
+ */
1364
+ function Freeze$$1(parent) {
1365
+ Grid.Inject(Freeze);
1366
+ this.parent = parent;
1367
+ this.addEventListener();
1368
+ }
1369
+ Freeze$$1.prototype.addEventListener = function () {
1370
+ this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);
1371
+ this.parent.on('dataBoundArg', this.dataBoundArg, this);
1372
+ this.parent.grid.on('dblclick', this.dblClickHandler, this);
1373
+ };
1374
+ Freeze$$1.prototype.removeEventListener = function () {
1375
+ if (this.parent.isDestroyed) {
1376
+ return;
1377
+ }
1378
+ this.parent.off('rowExpandCollapse', this.rowExpandCollapse);
1379
+ this.parent.off('dataBoundArg', this.dataBoundArg);
1380
+ this.parent.grid.off('dblclick', this.dblClickHandler);
1381
+ };
1382
+ Freeze$$1.prototype.rowExpandCollapse = function (args) {
1383
+ var movableRows = this.parent.getMovableDataRows();
1384
+ var frozenrows = this.parent.getRows();
1385
+ var rows;
1386
+ var frozenRightRows;
1387
+ var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
1388
+ this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
1389
+ if (freeze) {
1390
+ frozenRightRows = this.parent.getFrozenRightRows().filter(function (e) {
1391
+ return e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1));
1392
+ });
1393
+ }
1394
+ if (!args.detailrows.length) {
1395
+ rows = movableRows.filter(function (e) {
1396
+ return e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1));
1397
+ });
1398
+ }
1399
+ else {
1400
+ rows = args.detailrows;
1401
+ }
1402
+ for (var i = 0; i < rows.length; i++) {
1403
+ var rData = this.parent.grid.getRowObjectFromUID(rows[i].getAttribute('data-Uid')).data;
1404
+ rows[i].style.display = args.action;
1405
+ if (freeze) {
1406
+ frozenRightRows[i].style.display = args.action;
1407
+ }
1408
+ var queryselector = args.action === 'none' ? '.e-treecolumn-container .e-treegridcollapse'
1409
+ : '.e-treecolumn-container .e-treegridexpand';
1410
+ if (frozenrows[rows[i].rowIndex].querySelector(queryselector)) {
1411
+ var cRow = [];
1412
+ for (var i_1 = 0; i_1 < movableRows.length; i_1++) {
1413
+ if (movableRows[i_1].querySelector('.e-gridrowindex' + rData.index + 'level' + (rData.level + 1))) {
1414
+ cRow.push(movableRows[i_1]);
1415
+ }
1416
+ }
1417
+ if (cRow.length) {
1418
+ this.rowExpandCollapse({ detailrows: cRow, action: args.action });
1419
+ }
1420
+ }
1421
+ }
1422
+ };
1423
+ Freeze$$1.prototype.dblClickHandler = function (e) {
1424
+ if (parentsUntil(e.target, 'e-rowcell') &&
1425
+ this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell') {
1426
+ this.parent.grid.editModule.startEdit(parentsUntil(e.target, 'e-row'));
1427
+ }
1428
+ };
1429
+ Freeze$$1.prototype.dataBoundArg = function () {
1430
+ var checkboxColumn = this.parent.getColumns().filter(function (e) {
1431
+ return e.showCheckbox;
1432
+ });
1433
+ if (checkboxColumn.length && this.parent.freezeModule && this.parent.initialRender) {
1434
+ addClass([this.parent.element.getElementsByClassName('e-grid')[0]], 'e-checkselection');
1435
+ }
1436
+ };
1437
+ Freeze$$1.prototype.destroy = function () {
1438
+ this.removeEventListener();
1439
+ };
1440
+ /**
1441
+ * For internal use only - Get the module name.
1442
+ *
1443
+ * @private
1444
+ * @returns {string} Returns Freeze module name
1445
+ */
1446
+ Freeze$$1.prototype.getModuleName = function () {
1447
+ return 'freeze';
1448
+ };
1449
+ return Freeze$$1;
1450
+ }());
1451
+
1353
1452
  /**
1354
1453
  * TreeGrid Print module
1355
1454
  *
@@ -1777,10 +1876,10 @@ var Render = /** @__PURE__ @class */ (function () {
1777
1876
  }
1778
1877
  };
1779
1878
  /**
1780
- * @param {string} columnUid - Defines column uid
1781
- * @returns {void}
1782
- * @hidden
1783
- */
1879
+ * @param {string} columnUid - Defines column uid
1880
+ * @returns {void}
1881
+ * @hidden
1882
+ */
1784
1883
  Render.prototype.refreshReactColumnTemplateByUid = function (columnUid) {
1785
1884
  var _this = this;
1786
1885
  if (this.parent.isReact) {
@@ -1797,6 +1896,8 @@ var Render = /** @__PURE__ @class */ (function () {
1797
1896
  var cellRenderer = new CellRenderer(_this.parent.grid, _this.parent.grid.serviceLocator);
1798
1897
  var td = _this.parent.getCellFromIndex(rowsObj[j].index, cellIndex - indent);
1799
1898
  cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });
1899
+ var treecell = _this.parent.getRows()[j].cells[cellIndex];
1900
+ _this.cellRender({ data: rowsObj[j].data, cell: treecell, column: cell.column });
1800
1901
  }
1801
1902
  }
1802
1903
  });
@@ -2458,6 +2559,8 @@ var ContextMenuItems;
2458
2559
  ContextMenuItems[ContextMenuItems["LastPage"] = 13] = "LastPage";
2459
2560
  ContextMenuItems[ContextMenuItems["NextPage"] = 14] = "NextPage";
2460
2561
  ContextMenuItems[ContextMenuItems["AddRow"] = 15] = "AddRow";
2562
+ ContextMenuItems[ContextMenuItems["RowIndent"] = 16] = "RowIndent";
2563
+ ContextMenuItems[ContextMenuItems["RowOutdent"] = 17] = "RowOutdent";
2461
2564
  })(ContextMenuItems || (ContextMenuItems = {}));
2462
2565
 
2463
2566
  var __extends$7 = (undefined && undefined.__extends) || (function () {
@@ -3559,6 +3662,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3559
3662
  TreeGrid.prototype.requiredModules = function () {
3560
3663
  var modules = [];
3561
3664
  var splitFrozenCount = 'splitFrozenCount';
3665
+ this.freezeModule = new Freeze$1(this);
3562
3666
  this.grid[splitFrozenCount](this.getGridColumns(this.columns));
3563
3667
  if (this.isDestroyed) {
3564
3668
  return modules;
@@ -3610,7 +3714,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3610
3714
  });
3611
3715
  }
3612
3716
  if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
3613
- this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) {
3717
+ this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount() || this.freezeModule) {
3614
3718
  modules.push({
3615
3719
  member: 'freeze', args: [this]
3616
3720
  });
@@ -3640,7 +3744,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3640
3744
  };
3641
3745
  TreeGrid.prototype.extendRequiredModules = function (modules) {
3642
3746
  var IsRowDDInjected = this.injectedModules.filter(function (e) {
3643
- return e.name === 'RowDD';
3747
+ return e.prototype.getModuleName() === 'rowDragAndDrop';
3644
3748
  });
3645
3749
  if (this.allowRowDragAndDrop || IsRowDDInjected.length) {
3646
3750
  if ((!isNullOrUndefined(this.toolbar) && (this.toolbar['includes']('Indent') ||
@@ -4453,6 +4557,16 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4453
4557
  target: '.e-content', id: this.element.id + '_gridcontrol_cmenu_AddRow',
4454
4558
  items: [{ text: this.l10n.getConstant('Above'), id: 'Above' }, { text: this.l10n.getConstant('Below'), id: 'Below' }, { text: this.l10n.getConstant('Child'), id: 'Child' }] });
4455
4559
  break;
4560
+ case 'Indent':
4561
+ case ContextMenuItems.RowIndent:
4562
+ items.push({ text: this.l10n.getConstant('RowIndent'),
4563
+ target: '.e-content', iconCss: 'e-indent e-icons', id: this.element.id + '_gridcontrol_cmenu_Indent' });
4564
+ break;
4565
+ case 'Outdent':
4566
+ case ContextMenuItems.RowOutdent:
4567
+ items.push({ text: this.l10n.getConstant('RowOutdent'),
4568
+ target: '.e-content', iconCss: 'e-outdent e-icons', id: this.element.id + '_gridcontrol_cmenu_Outdent' });
4569
+ break;
4456
4570
  default:
4457
4571
  items.push(this.contextMenuItems[i]);
4458
4572
  }
@@ -4471,6 +4585,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4471
4585
  */
4472
4586
  TreeGrid.prototype.getGridToolbar = function () {
4473
4587
  if (this.toolbar) {
4588
+ this.l10n = new L10n('treegrid', this.defaultLocale, this.locale);
4474
4589
  var items = [];
4475
4590
  var tooltipText = void 0;
4476
4591
  for (var i = 0; i < this.toolbar.length; i++) {
@@ -4552,6 +4667,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4552
4667
  gridColumn[prop] = this.getGridColumns(column[i][prop], false, index);
4553
4668
  treeGridColumn[prop] = column[i][prop];
4554
4669
  }
4670
+ else if (this.initialRender && !isNullOrUndefined(treeColumn) && this.enablePersistence && prop === 'edit') {
4671
+ gridColumn[prop] = treeGridColumn[prop] = treeColumn[prop];
4672
+ }
4555
4673
  else if (!(treeColumn) || prop !== 'sortComparer') {
4556
4674
  gridColumn[prop] = treeGridColumn[prop] = column[i][prop];
4557
4675
  }
@@ -4716,6 +4834,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4716
4834
  break;
4717
4835
  case 'locale':
4718
4836
  this.grid.locale = this.locale;
4837
+ this.TreeGridLocale();
4838
+ this.grid.toolbar = this.getGridToolbar();
4839
+ this.grid.contextMenuItems = this.getContextMenu();
4719
4840
  break;
4720
4841
  case 'selectedRowIndex':
4721
4842
  this.grid.selectedRowIndex = this.selectedRowIndex;
@@ -8018,8 +8139,8 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
8018
8139
  if (this.dropPosition === 'bottomSegment') {
8019
8140
  var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
8020
8141
  var rowIndex = selectedItemIndex === -1 ?
8021
- (this.parent.grid.getRowIndexByPrimaryKey(data[0][primaryKeyField])) - 1
8022
- : this.parent.getSelectedRowIndexes()[0] - 1;
8142
+ (this.parent.grid.getRowIndexByPrimaryKey(data[0][primaryKeyField]))
8143
+ : this.parent.getSelectedRowIndexes()[0];
8023
8144
  var selectedRecord = this.parent.getCurrentViewRecords()[rowIndex];
8024
8145
  this.droppedRecord = getParentData(this.parent, selectedRecord.parentItem.uniqueID);
8025
8146
  }
@@ -9377,6 +9498,16 @@ var Page$1 = /** @__PURE__ @class */ (function () {
9377
9498
  }
9378
9499
  return newResults;
9379
9500
  };
9501
+ Page$$1.prototype.updatePageSize = function (pageingDetails) {
9502
+ var updateSize = pageingDetails.result.length;
9503
+ var gridPagerModule = this.parent.grid.pagerModule;
9504
+ if (this.parent.pageSettings.pageSizes === true) {
9505
+ if (gridPagerModule.pagerObj.pagerdropdownModule['dropDownListObject'].value === gridPagerModule.pagerObj.getLocalizedLabel('All')) {
9506
+ gridPagerModule['pagerObj'].totalRecordsCount = updateSize;
9507
+ this.parent.grid.pageSettings.pageSize = updateSize;
9508
+ }
9509
+ }
9510
+ };
9380
9511
  Page$$1.prototype.pageAction = function (pageingDetails) {
9381
9512
  var _this = this;
9382
9513
  var dm = new DataManager(pageingDetails.result);
@@ -9413,6 +9544,7 @@ var Page$1 = /** @__PURE__ @class */ (function () {
9413
9544
  pageingDetails.count = visualData.length;
9414
9545
  var query = new Query();
9415
9546
  var size = this.parent.grid.pageSettings.pageSize;
9547
+ this.updatePageSize(pageingDetails);
9416
9548
  var current = this.parent.grid.pageSettings.currentPage;
9417
9549
  if (visualData.length < (current * size)) {
9418
9550
  current = (Math.floor(visualData.length / size)) + ((visualData.length % size) ? 1 : 0);
@@ -10001,6 +10133,8 @@ var ContextMenu$1 = /** @__PURE__ @class */ (function () {
10001
10133
  ContextMenu$$1.prototype.contextMenuOpen = function (args) {
10002
10134
  var addRow = select('#' + this.parent.element.id + '_gridcontrol_cmenu_AddRow', args.element);
10003
10135
  var editRecord = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Edit', args.element);
10136
+ var indent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Indent', args.element);
10137
+ var outdent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Outdent', args.element);
10004
10138
  if (addRow) {
10005
10139
  if (this.parent.grid.editSettings.allowAdding === false) {
10006
10140
  addRow.style.display = 'none';
@@ -10013,6 +10147,47 @@ var ContextMenu$1 = /** @__PURE__ @class */ (function () {
10013
10147
  && !(isNullOrUndefined(editRecord)) && !(editRecord.classList.contains('e-menu-hide'))) {
10014
10148
  editRecord.style.display = 'none';
10015
10149
  }
10150
+ if (indent || outdent) {
10151
+ var tObj = this.parent;
10152
+ var selectedrow = tObj.getSelectedRows()[0];
10153
+ var targetElement = args.event.target.closest('td');
10154
+ if (isNullOrUndefined(targetElement) || (!isNullOrUndefined(targetElement) && !targetElement.classList.contains('e-rowcell'))) {
10155
+ indent.style.display = outdent.style.display = 'none';
10156
+ }
10157
+ else {
10158
+ if (selectedrow.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {
10159
+ indent.style.display = outdent.style.display = 'none';
10160
+ }
10161
+ else if (args['name'] !== 'rowDeselected' || (!isNullOrUndefined(selectedrow) && tObj.grid.isCheckBoxSelection)) {
10162
+ var selectedItem = tObj.getCurrentViewRecords()[selectedrow.rowIndex];
10163
+ if (!isNullOrUndefined(selectedItem)) {
10164
+ if ((selectedItem.level > tObj.getCurrentViewRecords()[selectedrow.rowIndex - 1].level)) {
10165
+ indent.style.display = 'none';
10166
+ }
10167
+ else {
10168
+ indent.style.display = 'block';
10169
+ }
10170
+ if (selectedItem.level === tObj.getCurrentViewRecords()[selectedrow.rowIndex - 1].level) {
10171
+ indent.style.display = 'block';
10172
+ }
10173
+ if (selectedItem.level === 0) {
10174
+ outdent.style.display = 'none';
10175
+ }
10176
+ if (selectedItem.level !== 0) {
10177
+ outdent.style.display = 'block';
10178
+ }
10179
+ }
10180
+ }
10181
+ if (args['name'] === 'rowDeselected' && isNullOrUndefined(selectedrow) && !tObj.grid.isCheckBoxSelection) {
10182
+ if (this.parent.toolbar['includes']('Indent')) {
10183
+ indent.style.display = 'none';
10184
+ }
10185
+ if (this.parent.toolbar['includes']('Outdent')) {
10186
+ outdent.style.display = 'none';
10187
+ }
10188
+ }
10189
+ }
10190
+ }
10016
10191
  };
10017
10192
  ContextMenu$$1.prototype.contextMenuClick = function (args) {
10018
10193
  if (args.item.id === 'Above' || args.item.id === 'Below' || args.item.id === 'Child') {
@@ -10020,6 +10195,13 @@ var ContextMenu$1 = /** @__PURE__ @class */ (function () {
10020
10195
  this.parent.setProperties({ editSettings: { newRowPosition: args.item.id } }, true);
10021
10196
  this.parent.addRecord();
10022
10197
  }
10198
+ if (args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Indent' || args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Outdent') {
10199
+ if (!isNullOrUndefined(this.parent.rowDragAndDropModule)) {
10200
+ var indentOutdentAction = 'indentOutdentAction';
10201
+ var action = args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Indent' ? 'indent' : 'outdent';
10202
+ this.parent.rowDragAndDropModule[indentOutdentAction](null, action);
10203
+ }
10204
+ }
10023
10205
  };
10024
10206
  /**
10025
10207
  * For internal use only - Get the module name.
@@ -11195,11 +11377,13 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
11195
11377
  Edit$$1.prototype.updateIndex = function (data, rows, records) {
11196
11378
  for (var j = 0; j < this.parent.getDataRows().length; j++) {
11197
11379
  var data1 = records[j];
11198
- var index = getValue('uniqueIDCollection.' + data1.uniqueID + '.index', this.parent);
11199
- data1.index = index;
11200
- if (!isNullOrUndefined(data1.parentItem)) {
11201
- var parentIndex = getValue('uniqueIDCollection.' + data1.parentItem.uniqueID + '.index', this.parent);
11202
- data1.parentItem.index = parentIndex;
11380
+ if (!isNullOrUndefined(data1)) {
11381
+ var index = getValue('uniqueIDCollection.' + data1.uniqueID + '.index', this.parent);
11382
+ data1.index = index;
11383
+ if (!isNullOrUndefined(data1.parentItem)) {
11384
+ var parentIndex = getValue('uniqueIDCollection.' + data1.parentItem.uniqueID + '.index', this.parent);
11385
+ data1.parentItem.index = parentIndex;
11386
+ }
11203
11387
  }
11204
11388
  }
11205
11389
  var count = -1;
@@ -11218,32 +11402,34 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
11218
11402
  count++;
11219
11403
  }
11220
11404
  var data2 = records[count];
11221
- var index = data2.index;
11222
- var level = data2.level;
11223
- var row = rows[k];
11224
- if (!isNullOrUndefined(data2.parentItem)) {
11225
- index = getValue('uniqueIDCollection.' + data2.parentItem.uniqueID + '.index', this.parent);
11226
- }
11227
- var treecell = row.cells[treeColIndex];
11228
- if (!isNullOrUndefined(treecell)) {
11229
- for (var l = 0; l < treecell.classList.length; l++) {
11230
- var value = treecell.classList[l];
11231
- var remove$$1 = /e-gridrowindex/i;
11232
- var removed = /e-griddetailrowindex/i;
11233
- var result = value.match(remove$$1);
11234
- var results = value.match(removed);
11235
- if (result != null) {
11236
- removeClass([treecell], value);
11237
- }
11238
- if (results != null) {
11239
- removeClass([treecell], value);
11240
- }
11241
- }
11242
- if (!rows[k].classList.contains('e-detailrow')) {
11243
- addClass([treecell], 'e-gridrowindex' + index + 'level' + level);
11244
- }
11245
- else {
11246
- addClass([treecell], 'e-griddetailrowindex' + index + 'level' + level);
11405
+ if (!isNullOrUndefined(data2)) {
11406
+ var index = data2.index;
11407
+ var level = data2.level;
11408
+ var row = rows[k];
11409
+ if (!isNullOrUndefined(data2.parentItem)) {
11410
+ index = getValue('uniqueIDCollection.' + data2.parentItem.uniqueID + '.index', this.parent);
11411
+ }
11412
+ var treecell = row.cells[treeColIndex];
11413
+ if (!isNullOrUndefined(treecell)) {
11414
+ for (var l = 0; l < treecell.classList.length; l++) {
11415
+ var value = treecell.classList[l];
11416
+ var remove$$1 = /e-gridrowindex/i;
11417
+ var removed = /e-griddetailrowindex/i;
11418
+ var result = value.match(remove$$1);
11419
+ var results = value.match(removed);
11420
+ if (result != null) {
11421
+ removeClass([treecell], value);
11422
+ }
11423
+ if (results != null) {
11424
+ removeClass([treecell], value);
11425
+ }
11426
+ }
11427
+ if (!rows[k].classList.contains('e-detailrow')) {
11428
+ addClass([treecell], 'e-gridrowindex' + index + 'level' + level);
11429
+ }
11430
+ else {
11431
+ addClass([treecell], 'e-griddetailrowindex' + index + 'level' + level);
11432
+ }
11247
11433
  }
11248
11434
  }
11249
11435
  }
@@ -12583,105 +12769,6 @@ var TreeVirtual = /** @__PURE__ @class */ (function (_super) {
12583
12769
  return TreeVirtual;
12584
12770
  }(VirtualScroll));
12585
12771
 
12586
- /**
12587
- * TreeGrid Freeze module
12588
- *
12589
- * @hidden
12590
- */
12591
- var Freeze$1 = /** @__PURE__ @class */ (function () {
12592
- /**
12593
- * Constructor for render module
12594
- *
12595
- * @param {TreeGrid} parent - Tree Grid instance
12596
- */
12597
- function Freeze$$1(parent) {
12598
- Grid.Inject(Freeze);
12599
- this.parent = parent;
12600
- this.addEventListener();
12601
- }
12602
- Freeze$$1.prototype.addEventListener = function () {
12603
- this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);
12604
- this.parent.on('dataBoundArg', this.dataBoundArg, this);
12605
- this.parent.grid.on('dblclick', this.dblClickHandler, this);
12606
- };
12607
- Freeze$$1.prototype.removeEventListener = function () {
12608
- if (this.parent.isDestroyed) {
12609
- return;
12610
- }
12611
- this.parent.off('rowExpandCollapse', this.rowExpandCollapse);
12612
- this.parent.off('dataBoundArg', this.dataBoundArg);
12613
- this.parent.grid.off('dblclick', this.dblClickHandler);
12614
- };
12615
- Freeze$$1.prototype.rowExpandCollapse = function (args) {
12616
- var movableRows = this.parent.getMovableDataRows();
12617
- var frozenrows = this.parent.getRows();
12618
- var rows;
12619
- var frozenRightRows;
12620
- var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||
12621
- this.parent.getFrozenRightColumnsCount() > 0) ? true : false;
12622
- if (freeze) {
12623
- frozenRightRows = this.parent.getFrozenRightRows().filter(function (e) {
12624
- return e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1));
12625
- });
12626
- }
12627
- if (!args.detailrows.length) {
12628
- rows = movableRows.filter(function (e) {
12629
- return e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1));
12630
- });
12631
- }
12632
- else {
12633
- rows = args.detailrows;
12634
- }
12635
- for (var i = 0; i < rows.length; i++) {
12636
- var rData = this.parent.grid.getRowObjectFromUID(rows[i].getAttribute('data-Uid')).data;
12637
- rows[i].style.display = args.action;
12638
- if (freeze) {
12639
- frozenRightRows[i].style.display = args.action;
12640
- }
12641
- var queryselector = args.action === 'none' ? '.e-treecolumn-container .e-treegridcollapse'
12642
- : '.e-treecolumn-container .e-treegridexpand';
12643
- if (frozenrows[rows[i].rowIndex].querySelector(queryselector)) {
12644
- var cRow = [];
12645
- for (var i_1 = 0; i_1 < movableRows.length; i_1++) {
12646
- if (movableRows[i_1].querySelector('.e-gridrowindex' + rData.index + 'level' + (rData.level + 1))) {
12647
- cRow.push(movableRows[i_1]);
12648
- }
12649
- }
12650
- if (cRow.length) {
12651
- this.rowExpandCollapse({ detailrows: cRow, action: args.action });
12652
- }
12653
- }
12654
- }
12655
- };
12656
- Freeze$$1.prototype.dblClickHandler = function (e) {
12657
- if (parentsUntil(e.target, 'e-rowcell') &&
12658
- this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell') {
12659
- this.parent.grid.editModule.startEdit(parentsUntil(e.target, 'e-row'));
12660
- }
12661
- };
12662
- Freeze$$1.prototype.dataBoundArg = function () {
12663
- var checkboxColumn = this.parent.getColumns().filter(function (e) {
12664
- return e.showCheckbox;
12665
- });
12666
- if (checkboxColumn.length && this.parent.freezeModule && this.parent.initialRender) {
12667
- addClass([this.parent.element.getElementsByClassName('e-grid')[0]], 'e-checkselection');
12668
- }
12669
- };
12670
- Freeze$$1.prototype.destroy = function () {
12671
- this.removeEventListener();
12672
- };
12673
- /**
12674
- * For internal use only - Get the module name.
12675
- *
12676
- * @private
12677
- * @returns {string} Returns Freeze module name
12678
- */
12679
- Freeze$$1.prototype.getModuleName = function () {
12680
- return 'freeze';
12681
- };
12682
- return Freeze$$1;
12683
- }());
12684
-
12685
12772
  /**
12686
12773
  * TreeGrid ColumnChooser module
12687
12774
  *
@@ -13018,7 +13105,7 @@ var InfiniteScroll$1 = /** @__PURE__ @class */ (function () {
13018
13105
  if (getValue('selectedIndex', this.parent.editModule) !== -1 && this.parent.editSettings.newRowPosition !== 'Top') {
13019
13106
  if (this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child') {
13020
13107
  position = 'after';
13021
- newRowIndex += findChildrenRecords(currentData[newRowIndex + 1]).length;
13108
+ newRowIndex += findChildrenRecords(currentData[newRowIndex]).length;
13022
13109
  if (this.parent.editSettings.newRowPosition === 'Child') {
13023
13110
  newRowIndex -= 1; //// for child position already child record is added in childRecords so subtracting 1
13024
13111
  }