@datorama/core 22.12.5-beta.1 → 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 +32 -2
- 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 +33 -3
- package/esm5/lib/grid-v2/grid-store/grid.service.js +33 -3
- package/fesm2015/datorama-core.js +32 -2
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +32 -2
- 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
|
@@ -12681,14 +12681,18 @@ let GridService = class GridService {
|
|
|
12681
12681
|
if (params.gridOptions.usePivotGridStyle) {
|
|
12682
12682
|
const rowHeight = 30;
|
|
12683
12683
|
params.gridOptions.rowHeight = rowHeight;
|
|
12684
|
-
params.gridOptions.defaultColDef = Object.assign(Object.assign({}, params.gridOptions.defaultColDef), {
|
|
12684
|
+
params.gridOptions.defaultColDef = Object.assign(Object.assign({}, params.gridOptions.defaultColDef), {
|
|
12685
|
+
// cellClass: this.getPivotCellClass.bind(this),
|
|
12686
|
+
cellClassRules: this.getCellClassRules(), headerClass: this.getPivotHeaderClass.bind(this), cellStyle: params => {
|
|
12685
12687
|
const style = { lineHeight: `${rowHeight}px` };
|
|
12686
12688
|
if (params.colDef.type === DatoGridColumnTypes.Number) {
|
|
12687
12689
|
style.textAlign = 'end';
|
|
12688
12690
|
}
|
|
12689
12691
|
return style;
|
|
12690
12692
|
} });
|
|
12691
|
-
params.gridOptions.autoGroupColumnDef = Object.assign(Object.assign({}, params.gridOptions.autoGroupColumnDef), {
|
|
12693
|
+
params.gridOptions.autoGroupColumnDef = Object.assign(Object.assign({}, params.gridOptions.autoGroupColumnDef), {
|
|
12694
|
+
// cellClass: this.getPivotCellClass.bind(this),
|
|
12695
|
+
cellClassRules: this.getCellClassRules(), headerClass: this.getPivotHeaderClass.bind(this) });
|
|
12692
12696
|
}
|
|
12693
12697
|
return params.gridOptions;
|
|
12694
12698
|
}
|
|
@@ -13484,6 +13488,32 @@ let GridService = class GridService {
|
|
|
13484
13488
|
});
|
|
13485
13489
|
this.api.grid.setRowData(convertedData);
|
|
13486
13490
|
}
|
|
13491
|
+
getCellClassRules() {
|
|
13492
|
+
return {
|
|
13493
|
+
'primary-0-background-color': this.isLeafGroupEvenCell.bind(this),
|
|
13494
|
+
'primary-100-background-color pointer dato-simple-bold': this.isRowGroupValuedCell.bind(this)
|
|
13495
|
+
};
|
|
13496
|
+
}
|
|
13497
|
+
isLeafGroupEvenCell(params) {
|
|
13498
|
+
const { leafGroup, childIndex, rowGroupIndex } = params.node;
|
|
13499
|
+
const colIndex = this.getCellClassRuleColIndex(params);
|
|
13500
|
+
return !isNil(colIndex) && rowGroupIndex <= colIndex && leafGroup && childIndex % 2 === 0;
|
|
13501
|
+
}
|
|
13502
|
+
isRowGroupValuedCell(params) {
|
|
13503
|
+
const { leafGroup, rowGroupIndex } = params.node;
|
|
13504
|
+
const colIndex = this.getCellClassRuleColIndex(params);
|
|
13505
|
+
return !isNil(colIndex) && rowGroupIndex <= colIndex && !leafGroup;
|
|
13506
|
+
}
|
|
13507
|
+
getCellClassRuleColIndex(params) {
|
|
13508
|
+
const gridQuery = params.colDef.headerComponentParams.gridQuery;
|
|
13509
|
+
if (gridQuery && gridQuery.api) {
|
|
13510
|
+
const { columns } = gridQuery.api;
|
|
13511
|
+
const allDisplayedColumns = columns.getAllDisplayedColumns();
|
|
13512
|
+
const displayedColumn = allDisplayedColumns.find(col => col.getColId() === params.colDef.colId);
|
|
13513
|
+
return allDisplayedColumns.indexOf(displayedColumn);
|
|
13514
|
+
}
|
|
13515
|
+
return null;
|
|
13516
|
+
}
|
|
13487
13517
|
};
|
|
13488
13518
|
GridService.ctorParameters = () => [
|
|
13489
13519
|
{ type: GridStore },
|