@@ -62,67 +62,6 @@ export function DataGrid({
6262 const child = data ? ( typeof children === 'function' ? children ( data ) : children ) : null ;
6363
6464 return (
65- < Column gap = "4" minHeight = "300px" >
66- { allowSearch && (
67- < Row alignItems = "center" justifyContent = "space-between" wrap = "wrap" gap >
68- < SearchField
69- value = { search }
70- onSearch = { handleSearch }
71- delay = { searchDelay || DEFAULT_SEARCH_DELAY }
72- autoFocus = { autoFocus }
73- placeholder = { t ( labels . search ) }
74- />
75- { renderActions ?.( ) }
76- </ Row >
77- ) }
78- < LoadingPanel
79- data = { data ?. data }
80- isLoading = { isLoading }
81- isFetching = { isFetching }
82- error = { error }
83- renderEmpty = { renderEmpty }
84- >
85- { data && (
86- < >
87- { /*
88- Wrap the table in a horizontally scrollable container. The
89- react-zen DataTable lays its columns out on a CSS Grid with
90- fixed pixel widths, so the sum of column widths becomes the
91- table's max-content and propagates up through the surrounding
92- flex chain into the Tabs grid track, pinning every ancestor
93- wider than the viewport on small screens. overflow-x: auto on
94- its own does not break that chain because the wrapper still
95- stretches to its parent's width. Setting display: grid with
96- grid-template-columns: minmax(0, 1fr) gives the wrapper an
97- explicit 1fr column that resolves to the available space,
98- caps its own intrinsic width, and lets overflow-x: auto
99- kick in so the user can scroll the columns horizontally
100- instead of having the card overflow off screen.
101- */ }
102- < div
103- style = { {
104- display : 'grid' ,
105- gridTemplateColumns : 'minmax(0, 1fr)' ,
106- overflowX : 'auto' ,
107- } }
108- >
109- { isValidElement ( child )
110- ? cloneElement ( child as ReactElement < any > , { displayMode } )
111- : child }
112- </ div >
113- { showPager && (
114- < Row marginTop = "6" >
115- < Pager
116- page = { data . page }
117- pageSize = { data . pageSize }
118- count = { data . count }
119- onPageChange = { handlePageChange }
120- />
121- </ Row >
122- ) }
123- </ >
124- ) }
125- </ LoadingPanel >
12665 < Column gap = "4" minHeight = "300px" justifyContent = "space-between" >
12766 < Column gap = "4" >
12867 { allowSearch && (
@@ -145,11 +84,17 @@ export function DataGrid({
14584 renderEmpty = { renderEmpty }
14685 >
14786 { data && (
148- < Column >
87+ < div
88+ style = { {
89+ display : 'grid' ,
90+ gridTemplateColumns : 'minmax(0, 1fr)' ,
91+ overflowX : 'auto' ,
92+ } }
93+ >
14994 { isValidElement ( child )
15095 ? cloneElement ( child as ReactElement < any > , { displayMode } )
15196 : child }
152- </ Column >
97+ </ div >
15398 ) }
15499 </ LoadingPanel >
155100 </ Column >
0 commit comments