@datorama/core 22.12.5-beta.1 → 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,14 +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), { cellClass: this.getPivotCellClass.bind(this), 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) {
14219
14219
  var style = { lineHeight: rowHeight_1 + "px" };
14220
14220
  if (params.colDef.type === DatoGridColumnTypes.Number) {
14221
14221
  style.textAlign = 'end';
14222
14222
  }
14223
14223
  return style;
14224
14224
  } });
14225
- params.gridOptions.autoGroupColumnDef = __assign(__assign({}, params.gridOptions.autoGroupColumnDef), { cellClass: this.getPivotCellClass.bind(this), headerClass: this.getPivotHeaderClass.bind(this) });
14225
+ params.gridOptions.autoGroupColumnDef = __assign(__assign({}, params.gridOptions.autoGroupColumnDef), { cellClassRules: this.getPivotModeCellClassRules(), headerClass: this.getPivotHeaderClass.bind(this) });
14226
14226
  }
14227
14227
  return params.gridOptions;
14228
14228
  };
@@ -14239,40 +14239,6 @@ var GridService = /** @class */ (function () {
14239
14239
  }
14240
14240
  return cellClass;
14241
14241
  };
14242
- GridService.prototype.getPivotCellClass = function (params) {
14243
- var _a = params.node, leafGroup = _a.leafGroup, childIndex = _a.childIndex, rowGroupIndex = _a.rowGroupIndex;
14244
- var gridQuery = params.colDef.headerComponentParams.gridQuery;
14245
- var cellClass = "";
14246
- if (gridQuery && gridQuery.api) {
14247
- var columns = gridQuery.api.columns;
14248
- var originalColumns = columns.getAllColumns();
14249
- var originalColumn = originalColumns.find(function (col) {
14250
- var _a = params.colDef, cellColumnGroupId = _a.showRowGroup, pivotValueColumn = _a.pivotValueColumn, colId = _a.colId;
14251
- var cellPivotColumnId = pivotValueColumn && pivotValueColumn.getColId();
14252
- var cellColumnId = cellColumnGroupId || cellPivotColumnId || colId;
14253
- return col.getColId() === cellColumnId;
14254
- });
14255
- var allDisplayedColumns = columns.getAllDisplayedColumns();
14256
- var displayedColumn = allDisplayedColumns.find(function (col) { return col.getColId() === params.colDef.colId; });
14257
- var colIndex = allDisplayedColumns.indexOf(displayedColumn);
14258
- var originalCellClass = originalColumn.getColDef().cellClass;
14259
- if (originalCellClass && typeof originalCellClass === 'string') {
14260
- cellClass += originalCellClass + " ";
14261
- }
14262
- if (rowGroupIndex <= colIndex) {
14263
- if (leafGroup) {
14264
- if (childIndex % 2 === 0) {
14265
- /** If row is even */
14266
- cellClass += 'primary-0-background-color';
14267
- }
14268
- }
14269
- else {
14270
- cellClass += 'primary-100-background-color pointer dato-simple-bold';
14271
- }
14272
- }
14273
- }
14274
- return cellClass;
14275
- };
14276
14242
  GridService.prototype.normalizeColumns = function (colDefs, gridOptions) {
14277
14243
  var _this = this;
14278
14244
  if (gridOptions === void 0) { gridOptions = null; }
@@ -15123,6 +15089,34 @@ var GridService = /** @class */ (function () {
15123
15089
  });
15124
15090
  this.api.grid.setRowData(convertedData);
15125
15091
  };
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 () {
15095
+ return {
15096
+ 'primary-0-background-color': this.isLeafGroupEvenCell.bind(this),
15097
+ 'primary-100-background-color pointer dato-simple-bold': this.isRowGroupValuedCell.bind(this)
15098
+ };
15099
+ };
15100
+ GridService.prototype.isLeafGroupEvenCell = function (params) {
15101
+ var _a = params.node, leafGroup = _a.leafGroup, childIndex = _a.childIndex, rowGroupIndex = _a.rowGroupIndex;
15102
+ var colIndex = this.getCellClassRuleColIndex(params);
15103
+ return rowGroupIndex <= colIndex && leafGroup && childIndex % 2 === 0;
15104
+ };
15105
+ GridService.prototype.isRowGroupValuedCell = function (params) {
15106
+ var _a = params.node, leafGroup = _a.leafGroup, rowGroupIndex = _a.rowGroupIndex;
15107
+ var colIndex = this.getCellClassRuleColIndex(params);
15108
+ return rowGroupIndex <= colIndex && !leafGroup;
15109
+ };
15110
+ GridService.prototype.getCellClassRuleColIndex = function (params) {
15111
+ var gridQuery = params.colDef.headerComponentParams.gridQuery;
15112
+ if (gridQuery && gridQuery.api) {
15113
+ var columns = gridQuery.api.columns;
15114
+ var allDisplayedColumns = columns.getAllDisplayedColumns();
15115
+ var displayedColumn = allDisplayedColumns.find(function (col) { return col.getColId() === params.colDef.colId; });
15116
+ return allDisplayedColumns.indexOf(displayedColumn);
15117
+ }
15118
+ return -1;
15119
+ };
15126
15120
  GridService.ctorParameters = function () { return [
15127
15121
  { type: GridStore },
15128
15122
  { type: GridQuery },
@@ -25494,7 +25488,7 @@ function fixNgLeaks() {
25494
25488
  };
25495
25489
  }
25496
25490
 
25497
- window.coreVersion = '22.12.4';
25491
+ window.coreVersion = '22.12.5';
25498
25492
 
25499
25493
  /**
25500
25494
  * @license