Skip to content

Commit f92acd2

Browse files
committed
EditableGrid: Simplify count col rendering
1 parent 9f20f71 commit f92acd2

3 files changed

Lines changed: 4 additions & 18 deletions

File tree

packages/components/src/internal/components/base/models/GridColumn.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ export class GridColumn implements ColumnProps {
8181
}
8282
}
8383

84-
// Special interface that lets us pass GridColumn and EditableColumnMetadata to getTextAlignClassname
84+
// Special interface that lets us pass GridColumn and QueryColumn to getTextAlignClassname
8585
interface WithAlignment {
8686
align?: string;
87-
jsonType?: string;
8887
}
8988

9089
const TEXT_ALIGN_CLASSES = {

packages/components/src/internal/components/editable/EditableGrid.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { HeaderSelectionCell } from '../../renderers';
3737
import { blurActiveElement, capitalizeFirstChar, not } from '../../util/utils';
3838
import { Grid } from '../base/Grid';
3939

40-
import { getTextAlignClassName, GridColumn, GridColumnCellRenderer } from '../base/models/GridColumn';
40+
import { GridColumn, GridColumnCellRenderer } from '../base/models/GridColumn';
4141

4242
import { BulkAddUpdateForm } from '../forms/BulkAddUpdateForm';
4343
import { QueryInfoForm, QueryInfoFormProps } from '../forms/QueryInfoForm';
@@ -142,8 +142,8 @@ const COUNT_COL = new GridColumn({
142142
tableCell: true,
143143
title: 'Row',
144144
cell: (d, r, c, rn) => (
145-
<td className={classNames('cellular-count', getTextAlignClassName(c))} key={c.index}>
146-
<div className="cellular-count-static-content">{rn + 1}</div>
145+
<td className="cellular-count" key={c.index}>
146+
{rn + 1}
147147
</td>
148148
),
149149
});

packages/components/src/theme/grid.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -248,19 +248,6 @@ $table-cell-padding: 4px 2px;
248248
font-size: small;
249249
text-align: center;
250250
width: 45px;
251-
252-
.cellular-count-content {
253-
position: absolute;
254-
bottom: 0;
255-
left: 0;
256-
right: 0;
257-
top: 0;
258-
margin-top: 6px;
259-
}
260-
261-
.cellular-count-static-content {
262-
text-align: center;
263-
}
264251
}
265252

266253
.cellular-display {

0 commit comments

Comments
 (0)