fix(DataTable): cells type.

This commit is contained in:
a.bouhuolia
2022-03-21 13:14:44 +02:00
parent a093c0d335
commit 2f36594459
21 changed files with 120 additions and 51 deletions

View File

@@ -54,10 +54,15 @@ const DatatableEditableRoot = styled.div`
}
.tbody {
.tr .td {
padding: 2px;
border-bottom: 0;
border-bottom: 1px solid #d8d8d8;
min-height: 38px;
padding: 4px 14px;
&.td-field-type,
&.td-button-type{
padding: 2px;
}
}
.tr:last-of-type .td {
border-bottom: 0;

View File

@@ -1,7 +1,8 @@
import React, { useContext } from 'react';
import classNames from 'classnames';
import { If } from 'components';
import { Skeleton } from 'components';
import { camelCase} from 'lodash';
import { If, Skeleton } from 'components';
import { useAppIntlContext } from 'components/AppIntlProvider';
import TableContext from './TableContext';
import { saveInvoke, ignoreEventFromSelectors } from 'utils';
@@ -56,7 +57,8 @@ export default function TableCell({ cell, row, index }) {
return;
}
saveInvoke(onCellClick, cell, event);
};
};
const cellType = camelCase(cell.column.Cell.cellType) || 'text';
return (
<div
@@ -65,6 +67,8 @@ export default function TableCell({ cell, row, index }) {
'is-text-overview': cell.column.textOverview,
clickable: cell.column.clickable,
'align-right': cell.column.align === 'right',
[`td-${cell.column.id}`]: cell.column.id,
[`td-${cellType}-type`]: !!cellType,
}),
onClick: handleCellClick,
})}

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { Checkbox } from '@blueprintjs/core';
import { CellType } from 'common';
export default function TableIndeterminateCheckboxRow({ row }) {
return (
<div class="selection-checkbox">
@@ -8,3 +8,5 @@ export default function TableIndeterminateCheckboxRow({ row }) {
</div>
);
}
TableIndeterminateCheckboxRow.cellType = CellType.Field;