@@ -18,8 +18,10 @@ import {
18
18
handleToSelectedRow ,
19
19
TableColumnLinkStyleType ,
20
20
TableColumnStyleType ,
21
+ TableHeaderStyleType ,
21
22
TableRowStyleType ,
22
23
TableStyleType ,
24
+ TableToolbarStyleType ,
23
25
} from "comps/controls/styleControlConstants" ;
24
26
import { CompNameContext , EditorContext } from "comps/editorState" ;
25
27
import { BackgroundColorContext } from "comps/utils/backgroundColorContext" ;
@@ -56,6 +58,8 @@ function genLinerGradient(color: string) {
56
58
const getStyle = (
57
59
style : TableStyleType ,
58
60
rowStyle : TableRowStyleType ,
61
+ headerStyle : TableHeaderStyleType ,
62
+ toolbarStyle : TableToolbarStyleType
59
63
) => {
60
64
const background = genLinerGradient ( style . background ) ;
61
65
const selectedRowBackground = genLinerGradient ( rowStyle . selectedRowBackground ) ;
@@ -128,6 +132,8 @@ const getStyle = (
128
132
129
133
const TableWrapper = styled . div < {
130
134
$style : TableStyleType ;
135
+ $headerStyle : TableHeaderStyleType ;
136
+ $toolbarStyle : TableToolbarStyleType ;
131
137
$rowStyle : TableRowStyleType ;
132
138
$toolbarPosition : "above" | "below" | "close" ;
133
139
$fixedHeader : boolean ;
@@ -136,7 +142,7 @@ const TableWrapper = styled.div<{
136
142
max-height: 100%;
137
143
overflow-y: auto;
138
144
background: white;
139
- border: ${ ( props ) => `1px solid ${ props . $style . border } ` } ;
145
+ border: ${ ( props ) => `${ props . $style . borderWidth } solid ${ props . $style . border } ` } ;
140
146
border-radius: ${ ( props ) => props . $style . radius } ;
141
147
142
148
.ant-table-wrapper {
@@ -187,10 +193,12 @@ const TableWrapper = styled.div<{
187
193
188
194
> .ant-table-thead {
189
195
> tr > th {
190
- background-color: ${ ( props ) => props . $style . headerBackground } ;
196
+ background-color: ${ ( props ) => props . $headerStyle . headerBackground } ;
191
197
border-color: ${ ( props ) => props . $style . border } ;
198
+ border-width: ${ ( props ) => props . $headerStyle . borderWidth } ;
192
199
color: ${ ( props ) => props . $style . headerText } ;
193
- border-inline-end: ${ ( props ) => `1px solid ${ props . $style . border } ` } !important;
200
+ font-size: ${ ( props ) => props . $headerStyle . textSize } ;
201
+ border-inline-end: ${ ( props ) => `${ props . $headerStyle . borderWidth } solid ${ props . $style . border } ` } !important;
194
202
${ ( props ) =>
195
203
props . $fixedHeader && `
196
204
position: sticky;
@@ -267,7 +275,7 @@ const TableWrapper = styled.div<{
267
275
}
268
276
269
277
${ ( props ) =>
270
- props . $style && getStyle ( props . $style , props . $rowStyle ) }
278
+ props . $style && getStyle ( props . $style , props . $rowStyle , props . $headerStyle , props . $toolbarStyle ) }
271
279
` ;
272
280
273
281
const TableTh = styled . th < { width ?: number } > `
@@ -641,6 +649,8 @@ export function TableCompView(props: {
641
649
const compChildren = comp . children ;
642
650
const style = compChildren . style . getView ( ) ;
643
651
const rowStyle = compChildren . rowStyle . getView ( ) ;
652
+ const headerStyle = compChildren . headerStyle . getView ( ) ;
653
+ const toolbarStyle = compChildren . toolbarStyle . getView ( ) ;
644
654
const rowAutoHeight = compChildren . rowAutoHeight . getView ( ) ;
645
655
const columnsStyle = compChildren . columnsStyle . getView ( ) ;
646
656
const changeSet = useMemo ( ( ) => compChildren . columns . getChangeSet ( ) , [ compChildren . columns ] ) ;
@@ -753,6 +763,8 @@ export function TableCompView(props: {
753
763
< TableWrapper
754
764
$style = { style }
755
765
$rowStyle = { rowStyle }
766
+ $headerStyle = { headerStyle }
767
+ $toolbarStyle = { toolbarStyle }
756
768
$toolbarPosition = { toolbar . position }
757
769
$fixedHeader = { compChildren . fixedHeader . getView ( ) }
758
770
$fixedToolbar = { toolbar . fixedToolbar && toolbar . position === 'above' }
0 commit comments