fix(BalanceSheet): highlight total assets and libaiities.

This commit is contained in:
a.bouhuolia
2022-02-02 13:33:54 +02:00
parent c72802d683
commit 2c2740ea73
3 changed files with 16 additions and 11 deletions

View File

@@ -76,9 +76,15 @@ const BalanceSheetDataTable = styled(DataTable)`
}
}
&:last-of-type .td{
&:last-of-type .td {
border-bottom: 1px solid #bbb;
}
&.row_type--TOTAL.row-id--ASSETS,
&.row_type--TOTAL.row-id--LIABILITY_EQUITY {
.td{
border-bottom: 3px double #000;
}
}
}
}
`;

View File

@@ -14,7 +14,7 @@ const getReportColWidth = (data, accessor, headerText) => {
return getColumnWidth(
data,
accessor,
{ magicSpacing: 9, minWidth: 100 },
{ magicSpacing: 10, minWidth: 100 },
headerText,
);
};

View File

@@ -3,6 +3,7 @@ import moment from 'moment';
import _ from 'lodash';
import * as R from 'ramda';
import Currencies from 'js-money/lib/currency';
import clsx from 'classnames';
import { Intent } from '@blueprintjs/core';
import Currency from 'js-money/lib/currency';
@@ -439,11 +440,11 @@ export const getColumnWidth = (
rows,
accessor,
{ maxWidth, minWidth, magicSpacing = 14 },
headerText = ''
headerText = '',
) => {
const cellLength = Math.max(
...rows.map((row) => (`${_.get(row, accessor)}` || '').length),
headerText.length
headerText.length,
);
let result = cellLength * magicSpacing;
@@ -903,14 +904,12 @@ export function ignoreEventFromSelectors(event, selectors) {
.some((element) => !!element);
}
export const tableRowTypesToClassnames = ({ original }) => {
const rowTypes = _.castArray(original.row_types);
const rowId = original.id;
return rowTypes.reduce((acc, rowType) => {
acc[`row_type--${rowType}`] = rowType;
const rowTypesClsx = rowTypes.map((t) => `row_type--${t}`);
const rowIdClsx = `row-id--${original.id}`;
return acc;
}, {});
};
return clsx(rowTypesClsx, { [`${rowIdClsx}`]: rowId });
};