fix: numeric values formating.

This commit is contained in:
a.bouhuolia
2021-09-14 15:28:02 +02:00
parent 40ff1464c8
commit e1a2fa57db
50 changed files with 492 additions and 420 deletions

View File

@@ -59,6 +59,7 @@ export default function TableCell({ cell, row, index }) {
className: classNames(cell.column.className, 'td', {
'is-text-overview': cell.column.textOverview,
'clickable': cell.column.clickable,
'align-right': cell.column.align === 'right',
}),
onClick: handleCellClick,
})}

View File

@@ -14,7 +14,9 @@ function TableHeaderCell({ column, index }) {
return (
<div
{...column.getHeaderProps({
className: classNames(column.className || '', 'th'),
className: classNames(column.className || '', 'th', {
'align-right': column.align === 'right',
}),
})}
>
<If condition={expandable && index + 1 === expandToggleColumn}>
@@ -32,7 +34,7 @@ function TableHeaderCell({ column, index }) {
{...column.getSortByToggleProps({
className: classNames('cell-inner', {
'text-overview': column.textOverview,
})
}),
})}
>
{column.render('Header')}

View File

@@ -0,0 +1,10 @@
import React from 'react';
import { formattedAmount } from 'utils';
export function FormatNumber({ value, currency = '', noZero }) {
return formattedAmount(value, currency, { noZero });
}
export function FormatNumberCell({ value, column: { formatNumber } }) {
return <FormatNumber value={value} {...formatNumber} />;
}

View File

@@ -0,0 +1,3 @@
export * from './FormatNumber';

View File

@@ -78,6 +78,8 @@ export * from './Dashboard';
export * from './Drawer';
export * from './Forms';
export * from './MultiSelectTaggable'
export * from './Utils/FormatNumber';
const Hint = FieldHint;
const T = FormattedMessage;