@@ -12,6 +12,7 @@ export interface CellHeaderExtraProps extends CommonThemeProps {
12
12
active ?: boolean ;
13
13
hideSortIcon ?: boolean ;
14
14
horizontalAlign ?: "left" | "center" | "right" ;
15
+ hover ?: boolean ;
15
16
}
16
17
17
18
const contentPositionMapping = {
@@ -27,6 +28,7 @@ const doNotForwardProps = [
27
28
"tooltipProps" ,
28
29
"tooltipText" ,
29
30
"hideSortIcon" ,
31
+ "hover" ,
30
32
] ;
31
33
32
34
export const StyledSortingIcon = styled ( Icon , {
@@ -55,28 +57,36 @@ export const StyledTableHeader = styled("th", {
55
57
${ focusVisibleA11yStyle }
56
58
57
59
${ ( props : CellHeaderExtraProps ) => {
58
- const { active = false , horizontalAlign = "left" } = props ;
60
+ const { active = false , horizontalAlign = "left" , hover = true } = props ;
59
61
60
62
const spaces = getSpaces ( props ) ;
61
63
const semanticColors = getSemanticColors ( props ) ;
62
64
65
+ const defaultColor = active
66
+ ? semanticColors ?. accent ?. textAction
67
+ : semanticColors ?. base ?. textSecondary ;
68
+
69
+ const hoverColor = active
70
+ ? semanticColors ?. accent ?. textActionHover
71
+ : semanticColors ?. base ?. textPrimary ;
72
+
63
73
return `
64
- color: ${ active ? semanticColors ?. accent ?. textAction : semanticColors ?. base ?. textSecondary } ;
74
+ color: ${ defaultColor } ;
65
75
padding: ${ spaces ?. l } px ${ spaces ?. m } px;
66
76
text-align: ${ horizontalAlign } ;
67
77
min-width: 96px;
68
- cursor: pointer;
78
+ cursor: ${ hover ? " pointer" : "default" } ;
69
79
vertical-align: bottom;
70
80
71
81
& .MuiButtonBase-root {
72
82
outline: none;
73
83
}
74
84
75
85
&:hover {
76
- color: ${ active ? semanticColors ?. accent ?. textActionHover : semanticColors ?. base ?. textPrimary } ;
86
+ color: ${ hover ? hoverColor : defaultColor } ;
77
87
78
88
& .MuiButtonBase-root {
79
- color: ${ active ? semanticColors ?. accent ?. textActionHover : semanticColors ?. base ?. textPrimary } ;
89
+ color: ${ hoverColor } ;
80
90
opacity: 1;
81
91
}
82
92
0 commit comments