diff --git a/lib/dtable/src/components/block.tsx b/lib/dtable/src/components/block.tsx index 06eaa611b8..657a7ee5cd 100644 --- a/lib/dtable/src/components/block.tsx +++ b/lib/dtable/src/components/block.tsx @@ -11,6 +11,7 @@ export function Block({ scrollLeft, scrollTop, className, + cellClass, style, onRenderCell, children, @@ -26,6 +27,7 @@ export function Block({ cols={left.list} width={left.width} rowHeight={rowHeight} + cellClass={cellClass} onRenderCell={onRenderCell} /> ); @@ -43,6 +45,7 @@ export function Block({ left={left.width} width={center.width} rowHeight={rowHeight} + cellClass={cellClass} onRenderCell={onRenderCell} /> ); @@ -59,6 +62,7 @@ export function Block({ left={left.width + center.width} width={right.width} rowHeight={rowHeight} + cellClass={cellClass} onRenderCell={onRenderCell} /> ); diff --git a/lib/dtable/src/components/cells.tsx b/lib/dtable/src/components/cells.tsx index e7504d397d..4653c0d362 100644 --- a/lib/dtable/src/components/cells.tsx +++ b/lib/dtable/src/components/cells.tsx @@ -17,6 +17,7 @@ export function Cells({ height = '100%', className, CellComponent = Cell, + cellClass, onRenderCell, }: CellsProps) { const rowsList = Array.isArray(rows) ? rows : [rows]; @@ -40,6 +41,7 @@ export function Cells({ colIndex === colsCount - 1 ? 'is-last-in-row' : '', rowIndex ? '' : 'is-first-row', rowIndex === rowsCount - 1 ? 'is-last-row' : '', + cellClass, )} col={col} row={row} diff --git a/lib/dtable/src/components/dtable.tsx b/lib/dtable/src/components/dtable.tsx index 54a7411344..f5ede550f2 100644 --- a/lib/dtable/src/components/dtable.tsx +++ b/lib/dtable/src/components/dtable.tsx @@ -484,6 +484,7 @@ export class DTable extends Component { scrollLeft={scrollLeft} rowHeight={headerHeight} scrollTop={0} + cellClass="dtable-header-cell" rows={{id: 'HEADER', index: -1, top: 0}} top={0} onRenderCell={this.#handleRenderCell} diff --git a/lib/dtable/src/types/block-props.ts b/lib/dtable/src/types/block-props.ts index 4549714fd5..333fa9930b 100644 --- a/lib/dtable/src/types/block-props.ts +++ b/lib/dtable/src/types/block-props.ts @@ -13,6 +13,7 @@ export type BlockProps = { scrollLeft: number; scrollTop: number; className?: ClassNameLike; + cellClass?: ClassNameLike; style?: JSX.CSSProperties; onRenderCell?: CellRenderCallback; children?: ComponentChildren; diff --git a/lib/dtable/src/types/cell.ts b/lib/dtable/src/types/cell.ts index 2cb329cd93..2abf414030 100644 --- a/lib/dtable/src/types/cell.ts +++ b/lib/dtable/src/types/cell.ts @@ -41,6 +41,7 @@ export type CellsProps = { width?: number; height?: number | '100%'; className?: ClassNameLike; + cellClass?: ClassNameLike; CellComponent?: preact.ComponentType; onRenderCell?: CellRenderCallback; };