@@ -34,12 +34,9 @@ const StyledHeaderCell = styled(Box)`
3434 }
3535`
3636const StyledSortIcon = styled ( Icon ) `
37- position: absolute;
38- top: 0;
39- bottom: 0;
4037 height: 16px;
38+ margin: auto 4px;
4139 width: 16px;
42- margin: auto;
4340`
4441const StyledPagination = styled ( Flex ) `
4542 height: 45px;
@@ -80,7 +77,10 @@ Table.HeadRow = forwardRef(({ children, ...props }, ref) => (
8077) )
8178
8279Table . HeadCell = forwardRef (
83- ( { children, align = "left" , width, maxWidth, minWidth, styles = { } , ...props } , ref ) => (
80+ (
81+ { align = "left" , children, headStyles = { } , maxWidth, minWidth, width, styles = { } , ...rest } ,
82+ ref
83+ ) => (
8484 < StyledHeaderCell
8585 width = { { max : maxWidth , base : width , min : minWidth } }
8686 ref = { ref }
@@ -91,9 +91,10 @@ Table.HeadCell = forwardRef(
9191 position : "sticky" ,
9292 top : 0 ,
9393 ...styles ,
94+ ...headStyles ,
9495 } }
95- { ...props }
9696 as = "th"
97+ { ...rest }
9798 >
9899 { children }
99100 </ StyledHeaderCell >
@@ -103,19 +104,20 @@ Table.HeadCell = forwardRef(
103104Table . SortingHeadCell = forwardRef (
104105 (
105106 {
107+ align = "left" ,
106108 children,
107- onSortClicked,
108- setSortDirection,
109+ "data-testid" : dataTestid ,
110+ filter,
111+ headStyles = { } ,
109112 maxWidth,
110- width,
111113 minWidth,
112- sortDirection,
113- filter,
114- align = "left" ,
115- "data-testid" : dataTestid ,
114+ onSortClicked,
115+ setSortDirection,
116116 "sortby-testid" : sortbyTestid ,
117+ sortDirection,
117118 styles = { } ,
118- ...props
119+ width,
120+ ...rest
119121 } ,
120122 ref
121123 ) => {
@@ -142,29 +144,34 @@ Table.SortingHeadCell = forwardRef(
142144 width = { { max : maxWidth , base : width , min : minWidth } }
143145 as = "th"
144146 ref = { ref }
145- { ...props }
147+ { ...rest }
146148 sx = { {
147149 textAlign : align ,
148150 fontSize : "14px" ,
149151 height : "90px" ,
150152 position : "sticky" ,
151153 top : 0 ,
152154 ...styles ,
155+ ...headStyles ,
153156 } }
154157 data-testid = { dataTestid }
155158 >
156- < Box
159+ < Flex
160+ cursor = "pointer"
161+ data-testid = { sortbyTestid }
162+ onClick = { onClick }
157163 onMouseEnter = { onMouseEnter }
158164 onMouseLeave = { onMouseLeave }
159- onClick = { onClick }
160165 position = "relative"
161- cursor = "pointer"
162- data-testid = { sortbyTestid }
163166 >
164167 { children }
165168 < StyledSortIcon color = "text" name = { sortingIcons [ sortDirection ] ?? null } />
166- { showHoveringIcon && < StyledSortIcon color = "textLite" name = { sortingIcons [ "indicator" ] } /> }
167- </ Box >
169+ { showHoveringIcon ? (
170+ < StyledSortIcon color = "textLite" name = { sortingIcons [ "indicator" ] } />
171+ ) : (
172+ < Box width = { 6 } height = { 4 } />
173+ ) }
174+ </ Flex >
168175 { filter }
169176 </ StyledHeaderCell >
170177 )
@@ -178,21 +185,34 @@ Table.Body = forwardRef(({ children, ...props }, ref) => (
178185) )
179186
180187Table . Cell = forwardRef (
181- ( { children, onClick, width, maxWidth, minWidth, align = "left" , ...props } , ref ) => {
188+ (
189+ {
190+ align = "left" ,
191+ cellStyles = { } ,
192+ children,
193+ maxWidth,
194+ minWidth,
195+ onClick,
196+ styles = { } ,
197+ width,
198+ ...rest
199+ } ,
200+ ref
201+ ) => {
182202 const handleClick = e => {
183203 e . persist ( )
184- if ( props . stopPropagation ) e . stopPropagation ( )
204+ if ( rest . stopPropagation ) e . stopPropagation ( )
185205 onClick ?. ( )
186206 }
187207 return (
188208 < Box
189209 width = { { max : maxWidth , base : width , min : minWidth } }
190210 padding = { [ 3 ] }
191- sx = { { textAlign : align , height : "80px" } }
211+ sx = { { textAlign : align , height : "80px" , ... styles , ... cellStyles } }
192212 as = "td"
193213 ref = { ref }
194- { ...props }
195214 onClick = { handleClick }
215+ { ...rest }
196216 >
197217 { children }
198218 </ Box >
@@ -217,7 +237,7 @@ Table.Row = forwardRef(
217237 onMouseEnter ?. ( event )
218238 }
219239
220- const handleMousLeave = event => {
240+ const handleMouseLeave = event => {
221241 onMouseLeave ?. ( event )
222242 }
223243
@@ -227,7 +247,7 @@ Table.Row = forwardRef(
227247 return (
228248 < Box
229249 onMouseEnter = { handleMouseEnter }
230- onMouseLeave = { handleMousLeave }
250+ onMouseLeave = { handleMouseLeave }
231251 as = { StyledRow }
232252 _hover = { isRowClickable && { background : "borderSecondary" } }
233253 cursor = { cursor }
0 commit comments