@datorama/core 22.12.5-beta.2 → 22.12.5

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.
@@ -14215,18 +14215,14 @@ var GridService = /** @class */ (function () {
14215
14215
  if (params.gridOptions.usePivotGridStyle) {
14216
14216
  var rowHeight_1 = 30;
14217
14217
  params.gridOptions.rowHeight = rowHeight_1;
14218
- params.gridOptions.defaultColDef = __assign(__assign({}, params.gridOptions.defaultColDef), {
14219
- // cellClass: this.getPivotCellClass.bind(this),
14220
- cellClassRules: this.getCellClassRules(), headerClass: this.getPivotHeaderClass.bind(this), cellStyle: function (params) {
14218
+ params.gridOptions.defaultColDef = __assign(__assign({}, params.gridOptions.defaultColDef), { cellClassRules: this.getPivotModeCellClassRules(), headerClass: this.getPivotHeaderClass.bind(this), cellStyle: function (params) {
14221
14219
  var style = { lineHeight: rowHeight_1 + "px" };
14222
14220
  if (params.colDef.type === DatoGridColumnTypes.Number) {
14223
14221
  style.textAlign = 'end';
14224
14222
  }
14225
14223
  return style;
14226
14224
  } });
14227
- params.gridOptions.autoGroupColumnDef = __assign(__assign({}, params.gridOptions.autoGroupColumnDef), {
14228
- // cellClass: this.getPivotCellClass.bind(this),
14229
- cellClassRules: this.getCellClassRules(), headerClass: this.getPivotHeaderClass.bind(this) });
14225
+ params.gridOptions.autoGroupColumnDef = __assign(__assign({}, params.gridOptions.autoGroupColumnDef), { cellClassRules: this.getPivotModeCellClassRules(), headerClass: this.getPivotHeaderClass.bind(this) });
14230
14226
  }
14231
14227
  return params.gridOptions;
14232
14228
  };
@@ -14243,40 +14239,6 @@ var GridService = /** @class */ (function () {
14243
14239
  }
14244
14240
  return cellClass;
14245
14241
  };
14246
- GridService.prototype.getPivotCellClass = function (params) {
14247
- var _a = params.node, leafGroup = _a.leafGroup, childIndex = _a.childIndex, rowGroupIndex = _a.rowGroupIndex;
14248
- var gridQuery = params.colDef.headerComponentParams.gridQuery;
14249
- var cellClass = "";
14250
- if (gridQuery && gridQuery.api) {
14251
- var columns = gridQuery.api.columns;
14252
- var originalColumns = columns.getAllColumns();
14253
- var originalColumn = originalColumns.find(function (col) {
14254
- var _a = params.colDef, cellColumnGroupId = _a.showRowGroup, pivotValueColumn = _a.pivotValueColumn, colId = _a.colId;
14255
- var cellPivotColumnId = pivotValueColumn && pivotValueColumn.getColId();
14256
- var cellColumnId = cellColumnGroupId || cellPivotColumnId || colId;
14257
- return col.getColId() === cellColumnId;
14258
- });
14259
- var allDisplayedColumns = columns.getAllDisplayedColumns();
14260
- var displayedColumn = allDisplayedColumns.find(function (col) { return col.getColId() === params.colDef.colId; });
14261
- var colIndex = allDisplayedColumns.indexOf(displayedColumn);
14262
- var originalCellClass = originalColumn.getColDef().cellClass;
14263
- if (originalCellClass && typeof originalCellClass === 'string') {
14264
- cellClass += originalCellClass + " ";
14265
- }
14266
- if (rowGroupIndex <= colIndex) {
14267
- if (leafGroup) {
14268
- if (childIndex % 2 === 0) {
14269
- /** If row is even */
14270
- cellClass += 'primary-0-background-color';
14271
- }
14272
- }
14273
- else {
14274
- cellClass += 'primary-100-background-color pointer dato-simple-bold';
14275
- }
14276
- }
14277
- }
14278
- return cellClass;
14279
- };
14280
14242
  GridService.prototype.normalizeColumns = function (colDefs, gridOptions) {
14281
14243
  var _this = this;
14282
14244
  if (gridOptions === void 0) { gridOptions = null; }
@@ -15127,7 +15089,9 @@ var GridService = /** @class */ (function () {
15127
15089
  });
15128
15090
  this.api.grid.setRowData(convertedData);
15129
15091
  };
15130
- GridService.prototype.getCellClassRules = function () {
15092
+ /** No declared interface in current grid version yet.
15093
+ * Refer docs - https://www.ag-grid.com/angular-data-grid/cell-styles/#cell-class-rules */
15094
+ GridService.prototype.getPivotModeCellClassRules = function () {
15131
15095
  return {
15132
15096
  'primary-0-background-color': this.isLeafGroupEvenCell.bind(this),
15133
15097
  'primary-100-background-color pointer dato-simple-bold': this.isRowGroupValuedCell.bind(this)
@@ -15136,12 +15100,12 @@ var GridService = /** @class */ (function () {
15136
15100
  GridService.prototype.isLeafGroupEvenCell = function (params) {
15137
15101
  var _a = params.node, leafGroup = _a.leafGroup, childIndex = _a.childIndex, rowGroupIndex = _a.rowGroupIndex;
15138
15102
  var colIndex = this.getCellClassRuleColIndex(params);
15139
- return !isNil(colIndex) && rowGroupIndex <= colIndex && leafGroup && childIndex % 2 === 0;
15103
+ return rowGroupIndex <= colIndex && leafGroup && childIndex % 2 === 0;
15140
15104
  };
15141
15105
  GridService.prototype.isRowGroupValuedCell = function (params) {
15142
15106
  var _a = params.node, leafGroup = _a.leafGroup, rowGroupIndex = _a.rowGroupIndex;
15143
15107
  var colIndex = this.getCellClassRuleColIndex(params);
15144
- return !isNil(colIndex) && rowGroupIndex <= colIndex && !leafGroup;
15108
+ return rowGroupIndex <= colIndex && !leafGroup;
15145
15109
  };
15146
15110
  GridService.prototype.getCellClassRuleColIndex = function (params) {
15147
15111
  var gridQuery = params.colDef.headerComponentParams.gridQuery;
@@ -15151,7 +15115,7 @@ var GridService = /** @class */ (function () {
15151
15115
  var displayedColumn = allDisplayedColumns.find(function (col) { return col.getColId() === params.colDef.colId; });
15152
15116
  return allDisplayedColumns.indexOf(displayedColumn);
15153
15117
  }
15154
- return null;
15118
+ return -1;
15155
15119
  };
15156
15120
  GridService.ctorParameters = function () { return [
15157
15121
  { type: GridStore },
@@ -25524,7 +25488,7 @@ function fixNgLeaks() {
25524
25488
  };
25525
25489
  }
25526
25490
 
25527
- window.coreVersion = '22.12.4';
25491
+ window.coreVersion = '22.12.5';
25528
25492
 
25529
25493
  /**
25530
25494
  * @license