refactor: add ColumnDefinition type (#1357)

* refactor: add ColumnDefinition type

Closes #1193

* refactor: code review - rename things

* fix: fix wrong import and lint
This commit is contained in:
Thaïs
2023-08-28 18:33:03 +02:00
committed by GitHub
parent 0d7b869274
commit 74919eff7a
57 changed files with 770 additions and 772 deletions

View File

@ -114,16 +114,16 @@ export function EntityTableHeader() {
const nextWidth = Math.round(
Math.max(
columnsById[resizedFieldId].columnSize +
columnsById[resizedFieldId].size +
snapshot.getLoadable(resizeFieldOffsetState).valueOrThrow(),
COLUMN_MIN_WIDTH,
),
);
if (nextWidth !== columnsById[resizedFieldId].columnSize) {
if (nextWidth !== columnsById[resizedFieldId].size) {
const nextColumns = columns.map((column) =>
column.id === resizedFieldId
? { ...column, columnSize: nextWidth }
? { ...column, size: nextWidth }
: column,
);
@ -179,15 +179,12 @@ export function EntityTableHeader() {
key={column.id}
isResizing={resizedFieldId === column.id}
columnWidth={Math.max(
columnsById[column.id].columnSize +
columnsById[column.id].size +
(resizedFieldId === column.id ? offset : 0),
COLUMN_MIN_WIDTH,
)}
>
<ColumnHead
viewName={column.columnLabel}
viewIcon={column.columnIcon}
/>
<ColumnHead viewName={column.label} viewIcon={column.icon} />
<StyledResizeHandler
className="cursor-col-resize"
role="separator"