@@ -18,8 +18,10 @@ import {
1818 handleToSelectedRow ,
1919 TableColumnLinkStyleType ,
2020 TableColumnStyleType ,
21+ TableHeaderStyleType ,
2122 TableRowStyleType ,
2223 TableStyleType ,
24+ TableToolbarStyleType ,
2325} from "comps/controls/styleControlConstants" ;
2426import { CompNameContext , EditorContext } from "comps/editorState" ;
2527import { BackgroundColorContext } from "comps/utils/backgroundColorContext" ;
@@ -56,6 +58,8 @@ function genLinerGradient(color: string) {
5658const getStyle = (
5759 style : TableStyleType ,
5860 rowStyle : TableRowStyleType ,
61+ headerStyle : TableHeaderStyleType ,
62+ toolbarStyle : TableToolbarStyleType
5963) => {
6064 const background = genLinerGradient ( style . background ) ;
6165 const selectedRowBackground = genLinerGradient ( rowStyle . selectedRowBackground ) ;
@@ -128,6 +132,8 @@ const getStyle = (
128132
129133const TableWrapper = styled . div < {
130134 $style : TableStyleType ;
135+ $headerStyle : TableHeaderStyleType ;
136+ $toolbarStyle : TableToolbarStyleType ;
131137 $rowStyle : TableRowStyleType ;
132138 $toolbarPosition : "above" | "below" | "close" ;
133139 $fixedHeader : boolean ;
@@ -136,7 +142,7 @@ const TableWrapper = styled.div<{
136142 max-height: 100%;
137143 overflow-y: auto;
138144 background: white;
139- border: ${ ( props ) => `1px solid ${ props . $style . border } ` } ;
145+ border: ${ ( props ) => `${ props . $style . borderWidth } solid ${ props . $style . border } ` } ;
140146 border-radius: ${ ( props ) => props . $style . radius } ;
141147
142148 .ant-table-wrapper {
@@ -187,10 +193,12 @@ const TableWrapper = styled.div<{
187193
188194 > .ant-table-thead {
189195 > tr > th {
190- background-color: ${ ( props ) => props . $style . headerBackground } ;
196+ background-color: ${ ( props ) => props . $headerStyle . headerBackground } ;
191197 border-color: ${ ( props ) => props . $style . border } ;
198+ border-width: ${ ( props ) => props . $headerStyle . borderWidth } ;
192199 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;
194202 ${ ( props ) =>
195203 props . $fixedHeader && `
196204 position: sticky;
@@ -267,7 +275,7 @@ const TableWrapper = styled.div<{
267275 }
268276
269277 ${ ( props ) =>
270- props . $style && getStyle ( props . $style , props . $rowStyle ) }
278+ props . $style && getStyle ( props . $style , props . $rowStyle , props . $headerStyle , props . $toolbarStyle ) }
271279` ;
272280
273281const TableTh = styled . th < { width ?: number } > `
@@ -641,6 +649,8 @@ export function TableCompView(props: {
641649 const compChildren = comp . children ;
642650 const style = compChildren . style . getView ( ) ;
643651 const rowStyle = compChildren . rowStyle . getView ( ) ;
652+ const headerStyle = compChildren . headerStyle . getView ( ) ;
653+ const toolbarStyle = compChildren . toolbarStyle . getView ( ) ;
644654 const rowAutoHeight = compChildren . rowAutoHeight . getView ( ) ;
645655 const columnsStyle = compChildren . columnsStyle . getView ( ) ;
646656 const changeSet = useMemo ( ( ) => compChildren . columns . getChangeSet ( ) , [ compChildren . columns ] ) ;
@@ -753,6 +763,8 @@ export function TableCompView(props: {
753763 < TableWrapper
754764 $style = { style }
755765 $rowStyle = { rowStyle }
766+ $headerStyle = { headerStyle }
767+ $toolbarStyle = { toolbarStyle }
756768 $toolbarPosition = { toolbar . position }
757769 $fixedHeader = { compChildren . fixedHeader . getView ( ) }
758770 $fixedToolbar = { toolbar . fixedToolbar && toolbar . position === 'above' }
0 commit comments