@@ -69,7 +69,12 @@ import type { PartialPosition } from './ScrollToCell';
6969import ScrollToCell from './ScrollToCell' ;
7070import { default as defaultRenderSortStatus } from './sortStatus' ;
7171import { cellDragHandleClassname , cellDragHandleFrozenClassname } from './style/cell' ;
72- import { rootClassname , viewportDraggingClassname } from './style/core' ;
72+ import {
73+ rootClassname ,
74+ frozenColumnShadowClassname ,
75+ viewportDraggingClassname ,
76+ frozenColumnShadowTopClassname
77+ } from './style/core' ;
7378import SummaryRow from './SummaryRow' ;
7479
7580export interface SelectCellState extends Position {
@@ -368,6 +373,10 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
368373 const minRowIdx = - headerAndTopSummaryRowsCount ;
369374 const mainHeaderRowIdx = minRowIdx + groupedColumnHeaderRowsCount ;
370375 const maxRowIdx = rows . length + bottomSummaryRowsCount - 1 ;
376+ const frozenShadowStyles : React . CSSProperties = {
377+ gridColumnStart : lastFrozenColumnIndex + 2 ,
378+ insetInlineStart : totalFrozenColumnWidth
379+ } ;
371380
372381 const [ selectedPosition , setSelectedPosition ] = useState (
373382 ( ) : SelectCellState | EditCellState < R > => ( { idx : - 1 , rowIdx : minRowIdx - 1 , mode : 'SELECT' } )
@@ -1270,11 +1279,11 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
12701279 const isSummaryRowSelected = selectedPosition . rowIdx === summaryRowIdx ;
12711280 const top =
12721281 clientHeight > totalRowHeight
1273- ? gridHeight - summaryRowHeight * ( bottomSummaryRows . length - rowIdx )
1282+ ? gridHeight - summaryRowHeight * ( bottomSummaryRowsCount - rowIdx )
12741283 : undefined ;
12751284 const bottom =
12761285 top === undefined
1277- ? summaryRowHeight * ( bottomSummaryRows . length - 1 - rowIdx )
1286+ ? summaryRowHeight * ( bottomSummaryRowsCount - 1 - rowIdx )
12781287 : undefined ;
12791288
12801289 return (
@@ -1299,6 +1308,47 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
12991308 ) }
13001309 </ DataGridDefaultRenderersContext >
13011310
1311+ { lastFrozenColumnIndex > - 1 && (
1312+ < >
1313+ < div
1314+ className = { frozenColumnShadowTopClassname }
1315+ style = { {
1316+ ...frozenShadowStyles ,
1317+ gridRowStart : 1 ,
1318+ gridRowEnd : headerRowsCount + 1 + topSummaryRowsCount ,
1319+ insetBlockStart : 0
1320+ } }
1321+ />
1322+
1323+ { rows . length > 0 && (
1324+ < div
1325+ className = { frozenColumnShadowClassname }
1326+ style = { {
1327+ ...frozenShadowStyles ,
1328+ gridRowStart : headerAndTopSummaryRowsCount + rowOverscanStartIdx + 1 ,
1329+ gridRowEnd : headerAndTopSummaryRowsCount + rowOverscanEndIdx + 2
1330+ } }
1331+ />
1332+ ) }
1333+
1334+ { bottomSummaryRows != null && bottomSummaryRowsCount > 0 && (
1335+ < div
1336+ className = { frozenColumnShadowTopClassname }
1337+ style = { {
1338+ ...frozenShadowStyles ,
1339+ gridRowStart : headerAndTopSummaryRowsCount + rows . length + 1 ,
1340+ gridRowEnd : headerAndTopSummaryRowsCount + rows . length + 1 + bottomSummaryRowsCount ,
1341+ insetBlockStart :
1342+ clientHeight > totalRowHeight
1343+ ? gridHeight - summaryRowHeight * bottomSummaryRowsCount
1344+ : undefined ,
1345+ insetBlockEnd : clientHeight > totalRowHeight ? undefined : 0
1346+ } }
1347+ />
1348+ ) }
1349+ </ >
1350+ ) }
1351+
13021352 { getDragHandle ( ) }
13031353
13041354 { /* render empty cells that span only 1 column so we can safely measure column widths, regardless of colSpan */ }
0 commit comments