@@ -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' } )
@@ -1269,11 +1278,11 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
12691278 const isSummaryRowSelected = selectedPosition . rowIdx === summaryRowIdx ;
12701279 const top =
12711280 clientHeight > totalRowHeight
1272- ? gridHeight - summaryRowHeight * ( bottomSummaryRows . length - rowIdx )
1281+ ? gridHeight - summaryRowHeight * ( bottomSummaryRowsCount - rowIdx )
12731282 : undefined ;
12741283 const bottom =
12751284 top === undefined
1276- ? summaryRowHeight * ( bottomSummaryRows . length - 1 - rowIdx )
1285+ ? summaryRowHeight * ( bottomSummaryRowsCount - 1 - rowIdx )
12771286 : undefined ;
12781287
12791288 return (
@@ -1298,6 +1307,47 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
12981307 ) }
12991308 </ DataGridDefaultRenderersContext >
13001309
1310+ { lastFrozenColumnIndex > - 1 && (
1311+ < >
1312+ < div
1313+ className = { frozenColumnShadowTopClassname }
1314+ style = { {
1315+ ...frozenShadowStyles ,
1316+ gridRowStart : 1 ,
1317+ gridRowEnd : headerRowsCount + 1 + topSummaryRowsCount ,
1318+ insetBlockStart : 0
1319+ } }
1320+ />
1321+
1322+ { rows . length > 0 && (
1323+ < div
1324+ className = { frozenColumnShadowClassname }
1325+ style = { {
1326+ ...frozenShadowStyles ,
1327+ gridRowStart : headerAndTopSummaryRowsCount + rowOverscanStartIdx + 1 ,
1328+ gridRowEnd : headerAndTopSummaryRowsCount + rowOverscanEndIdx + 2
1329+ } }
1330+ />
1331+ ) }
1332+
1333+ { bottomSummaryRows != null && bottomSummaryRowsCount > 0 && (
1334+ < div
1335+ className = { frozenColumnShadowTopClassname }
1336+ style = { {
1337+ ...frozenShadowStyles ,
1338+ gridRowStart : headerAndTopSummaryRowsCount + rows . length + 1 ,
1339+ gridRowEnd : headerAndTopSummaryRowsCount + rows . length + 1 + bottomSummaryRowsCount ,
1340+ insetBlockStart :
1341+ clientHeight > totalRowHeight
1342+ ? gridHeight - summaryRowHeight * bottomSummaryRowsCount
1343+ : undefined ,
1344+ insetBlockEnd : clientHeight > totalRowHeight ? undefined : 0
1345+ } }
1346+ />
1347+ ) }
1348+ </ >
1349+ ) }
1350+
13011351 { getDragHandle ( ) }
13021352
13031353 { /* render empty cells that span only 1 column so we can safely measure column widths, regardless of colSpan */ }
0 commit comments