@datorama/core 22.12.4 → 22.12.5-beta.2
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.
- package/bundles/datorama-core.umd.js +45 -6
- package/bundles/datorama-core.umd.js.map +1 -1
- package/bundles/datorama-core.umd.min.js +25 -25
- package/bundles/datorama-core.umd.min.js.map +1 -1
- package/datorama-core.metadata.json +1 -1
- package/esm2015/lib/grid-v2/grid-store/grid.service.js +46 -7
- package/esm2015/lib/icon/icon.types.js +1 -1
- package/esm2015/lib/version.js +1 -1
- package/esm5/lib/grid-v2/grid-store/grid.service.js +46 -7
- package/esm5/lib/icon/icon.types.js +1 -1
- package/esm5/lib/version.js +1 -1
- package/fesm2015/datorama-core.js +45 -6
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +45 -6
- package/fesm5/datorama-core.js.map +1 -1
- package/lib/grid-v2/grid-store/grid.service.d.ts +4 -0
- package/package.json +1 -1
|
@@ -14414,14 +14414,18 @@
|
|
|
14414
14414
|
if (params.gridOptions.usePivotGridStyle) {
|
|
14415
14415
|
var rowHeight_1 = 30;
|
|
14416
14416
|
params.gridOptions.rowHeight = rowHeight_1;
|
|
14417
|
-
params.gridOptions.defaultColDef = __assign(__assign({}, params.gridOptions.defaultColDef), {
|
|
14417
|
+
params.gridOptions.defaultColDef = __assign(__assign({}, params.gridOptions.defaultColDef), {
|
|
14418
|
+
// cellClass: this.getPivotCellClass.bind(this),
|
|
14419
|
+
cellClassRules: this.getCellClassRules(), headerClass: this.getPivotHeaderClass.bind(this), cellStyle: function (params) {
|
|
14418
14420
|
var style = { lineHeight: rowHeight_1 + "px" };
|
|
14419
14421
|
if (params.colDef.type === exports.DatoGridColumnTypes.Number) {
|
|
14420
14422
|
style.textAlign = 'end';
|
|
14421
14423
|
}
|
|
14422
14424
|
return style;
|
|
14423
14425
|
} });
|
|
14424
|
-
params.gridOptions.autoGroupColumnDef = __assign(__assign({}, params.gridOptions.autoGroupColumnDef), {
|
|
14426
|
+
params.gridOptions.autoGroupColumnDef = __assign(__assign({}, params.gridOptions.autoGroupColumnDef), {
|
|
14427
|
+
// cellClass: this.getPivotCellClass.bind(this),
|
|
14428
|
+
cellClassRules: this.getCellClassRules(), headerClass: this.getPivotHeaderClass.bind(this) });
|
|
14425
14429
|
}
|
|
14426
14430
|
return params.gridOptions;
|
|
14427
14431
|
};
|
|
@@ -14444,11 +14448,20 @@
|
|
|
14444
14448
|
var cellClass = "";
|
|
14445
14449
|
if (gridQuery && gridQuery.api) {
|
|
14446
14450
|
var columns = gridQuery.api.columns;
|
|
14447
|
-
var
|
|
14448
|
-
var
|
|
14449
|
-
|
|
14451
|
+
var originalColumns = columns.getAllColumns();
|
|
14452
|
+
var originalColumn = originalColumns.find(function (col) {
|
|
14453
|
+
var _a = params.colDef, cellColumnGroupId = _a.showRowGroup, pivotValueColumn = _a.pivotValueColumn, colId = _a.colId;
|
|
14454
|
+
var cellPivotColumnId = pivotValueColumn && pivotValueColumn.getColId();
|
|
14455
|
+
var cellColumnId = cellColumnGroupId || cellPivotColumnId || colId;
|
|
14456
|
+
return col.getColId() === cellColumnId;
|
|
14450
14457
|
});
|
|
14451
|
-
var
|
|
14458
|
+
var allDisplayedColumns = columns.getAllDisplayedColumns();
|
|
14459
|
+
var displayedColumn = allDisplayedColumns.find(function (col) { return col.getColId() === params.colDef.colId; });
|
|
14460
|
+
var colIndex = allDisplayedColumns.indexOf(displayedColumn);
|
|
14461
|
+
var originalCellClass = originalColumn.getColDef().cellClass;
|
|
14462
|
+
if (originalCellClass && typeof originalCellClass === 'string') {
|
|
14463
|
+
cellClass += originalCellClass + " ";
|
|
14464
|
+
}
|
|
14452
14465
|
if (rowGroupIndex <= colIndex) {
|
|
14453
14466
|
if (leafGroup) {
|
|
14454
14467
|
if (childIndex % 2 === 0) {
|
|
@@ -15313,6 +15326,32 @@
|
|
|
15313
15326
|
});
|
|
15314
15327
|
this.api.grid.setRowData(convertedData);
|
|
15315
15328
|
};
|
|
15329
|
+
GridService.prototype.getCellClassRules = function () {
|
|
15330
|
+
return {
|
|
15331
|
+
'primary-0-background-color': this.isLeafGroupEvenCell.bind(this),
|
|
15332
|
+
'primary-100-background-color pointer dato-simple-bold': this.isRowGroupValuedCell.bind(this)
|
|
15333
|
+
};
|
|
15334
|
+
};
|
|
15335
|
+
GridService.prototype.isLeafGroupEvenCell = function (params) {
|
|
15336
|
+
var _a = params.node, leafGroup = _a.leafGroup, childIndex = _a.childIndex, rowGroupIndex = _a.rowGroupIndex;
|
|
15337
|
+
var colIndex = this.getCellClassRuleColIndex(params);
|
|
15338
|
+
return !isNil(colIndex) && rowGroupIndex <= colIndex && leafGroup && childIndex % 2 === 0;
|
|
15339
|
+
};
|
|
15340
|
+
GridService.prototype.isRowGroupValuedCell = function (params) {
|
|
15341
|
+
var _a = params.node, leafGroup = _a.leafGroup, rowGroupIndex = _a.rowGroupIndex;
|
|
15342
|
+
var colIndex = this.getCellClassRuleColIndex(params);
|
|
15343
|
+
return !isNil(colIndex) && rowGroupIndex <= colIndex && !leafGroup;
|
|
15344
|
+
};
|
|
15345
|
+
GridService.prototype.getCellClassRuleColIndex = function (params) {
|
|
15346
|
+
var gridQuery = params.colDef.headerComponentParams.gridQuery;
|
|
15347
|
+
if (gridQuery && gridQuery.api) {
|
|
15348
|
+
var columns = gridQuery.api.columns;
|
|
15349
|
+
var allDisplayedColumns = columns.getAllDisplayedColumns();
|
|
15350
|
+
var displayedColumn = allDisplayedColumns.find(function (col) { return col.getColId() === params.colDef.colId; });
|
|
15351
|
+
return allDisplayedColumns.indexOf(displayedColumn);
|
|
15352
|
+
}
|
|
15353
|
+
return null;
|
|
15354
|
+
};
|
|
15316
15355
|
GridService.ctorParameters = function () { return [
|
|
15317
15356
|
{ type: GridStore },
|
|
15318
15357
|
{ type: GridQuery },
|