@@ -51,7 +51,7 @@ const getStyle = (
5151 style : TableStyleType ,
5252 rowStyle : TableRowStyleType ,
5353 headerStyle : TableHeaderStyleType ,
54- toolbarStyle : TableToolbarStyleType
54+ toolbarStyle : TableToolbarStyleType ,
5555) => {
5656 const background = genLinerGradient ( style . background ) ;
5757 const selectedRowBackground = genLinerGradient ( rowStyle . selectedRowBackground ) ;
@@ -140,7 +140,8 @@ const BackgroundWrapper = styled.div<{
140140 background: ${ ( props ) => props . $style . background } !important;
141141 border: ${ ( props ) => `${ props . $style . borderWidth } solid ${ props . $style . border } !important` } ;
142142 border-radius: ${ ( props ) => props . $style . radius } !important;
143- padding: unset !important;
143+ // padding: unset !important;
144+ padding: ${ ( props ) => props . $style . padding } !important
144145 margin: ${ ( props ) => props . $style . margin } !important;
145146 overflow: scroll !important;
146147 ${ ( props ) => props . $style }
@@ -209,18 +210,19 @@ const TableWrapper = styled.div<{
209210 > .ant-table-thead {
210211 > tr > th {
211212 background-color: ${ ( props ) => props . $headerStyle . headerBackground } ;
213+
212214 border-color: ${ ( props ) => props . $headerStyle . border } ;
213215 border-width: ${ ( props ) => props . $headerStyle . borderWidth } ;
214216 color: ${ ( props ) => props . $headerStyle . headerText } ;
215217 border-inline-end: ${ ( props ) => `${ props . $headerStyle . borderWidth } solid ${ props . $headerStyle . border } ` } !important;
216- ${ ( props ) =>
217- props . $fixedHeader && `
218+ ${ ( props ) =>
219+ props . $fixedHeader && `
218220 position: sticky;
219221 position: -webkit-sticky;
220222 top: ${ props . $fixedToolbar ? '47px' : '0' } ;
221223 z-index: 99;
222224 `
223- }
225+ }
224226
225227 > div {
226228 margin: ${ ( props ) => props . $headerStyle . margin } ;
@@ -229,6 +231,8 @@ const TableWrapper = styled.div<{
229231 font-size: ${ ( props ) => props . $headerStyle . textSize } ;
230232 font-weight: ${ ( props ) => props . $headerStyle . textWeight } ;
231233 font-family: ${ ( props ) => props . $headerStyle . fontFamily } ;
234+ font-style: ${ ( props ) => props . $headerStyle . fontStyle } ;
235+ color:${ ( props ) => props . $headerStyle . text }
232236 }
233237 }
234238
@@ -286,8 +290,8 @@ const TableWrapper = styled.div<{
286290
287291 // hide the bottom border of the last row
288292 ${ ( props ) =>
289- props . $toolbarPosition !== "below" &&
290- `
293+ props . $toolbarPosition !== "below" &&
294+ `
291295 tbody > tr:last-child > td {
292296 border-bottom: unset;
293297 }
@@ -300,10 +304,10 @@ const TableWrapper = styled.div<{
300304 }
301305 }
302306
303- ${ ( props ) =>
307+ ${ ( props ) =>
304308 props . $style && getStyle ( props . $style , props . $rowStyle , props . $headerStyle , props . $toolbarStyle ) }
305309` ;
306-
310+
307311const TableTh = styled . th < { width ?: number } > `
308312 overflow: hidden;
309313
@@ -318,7 +322,7 @@ const TableTh = styled.th<{ width?: number }>`
318322
319323const TableTd = styled . td < {
320324 $background : string ;
321- $style : TableColumnStyleType & { rowHeight ?: string } ;
325+ $style : TableColumnStyleType & { rowHeight ?: string } ;
322326 $defaultThemeDetail : ThemeDetail ;
323327 $linkStyle ?: TableColumnLinkStyleType ;
324328 $isEditing : boolean ;
@@ -348,7 +352,8 @@ const TableTd = styled.td<{
348352
349353 ${ ( props ) => props . $tableSize === 'small' && `
350354 padding: 1px 8px;
351- font-size: ${ props . $defaultThemeDetail . textSize == props . $style . textSize ? '14px !important' : props . $style . textSize + ' !important' } ;
355+ font-size: ${ props . $defaultThemeDetail . textSize == props . $style . textSize ? '14px !important' : props . $style . textSize + ' !important' } ;
356+ font-style:${ props . $style . fontStyle } !important;
352357 min-height: ${ props . $style . rowHeight || '14px' } ;
353358 line-height: 20px;
354359 ${ ! props . $autoHeight && `
@@ -358,7 +363,8 @@ const TableTd = styled.td<{
358363 ` } ;
359364 ${ ( props ) => props . $tableSize === 'middle' && `
360365 padding: 8px 8px;
361- font-size: ${ props . $defaultThemeDetail . textSize == props . $style . textSize ? '16px !important' : props . $style . textSize + ' !important' } ;
366+ font-size: ${ props . $defaultThemeDetail . textSize == props . $style . textSize ? '16px !important' : props . $style . textSize + ' !important' } ;
367+ font-style:${ props . $style . fontStyle } !important;
362368 min-height: ${ props . $style . rowHeight || '24px' } ;
363369 line-height: 24px;
364370 ${ ! props . $autoHeight && `
@@ -368,7 +374,8 @@ const TableTd = styled.td<{
368374 ` } ;
369375 ${ ( props ) => props . $tableSize === 'large' && `
370376 padding: 16px 16px;
371- font-size: ${ props . $defaultThemeDetail . textSize == props . $style . textSize ? '18px !important' : props . $style . textSize + ' !important' } ;
377+ font-size: ${ props . $defaultThemeDetail . textSize == props . $style . textSize ? '18px !important' : props . $style . textSize + ' !important' } ;
378+ font-style:${ props . $style . fontStyle } !important;
372379 min-height: ${ props . $style . rowHeight || '48px' } ;
373380 ${ ! props . $autoHeight && `
374381 overflow-y: auto;
@@ -444,7 +451,7 @@ const ResizeableTitle = (props: any) => {
444451 draggableOpts = { { enableUserSelectHack : false } }
445452 handle = { ( axis : ResizeHandleAxis , ref : ReactRef < HTMLDivElement > ) => (
446453 < TitleResizeHandle
447- ref = { ref }
454+ ref = { ref }
448455 onClick = { ( e ) => {
449456 e . preventDefault ( ) ;
450457 e . stopPropagation ( ) ;
@@ -519,7 +526,7 @@ function TableCellView(props: {
519526 const cellColor = cellColorFn ( {
520527 currentCell : record [ title . toLowerCase ( ) ] ,
521528 } ) ;
522-
529+
523530 const style = {
524531 background : cellColor || rowColor || columnStyle . background || columnsStyle . background ,
525532 margin : columnStyle . margin || columnsStyle . margin ,
@@ -528,8 +535,9 @@ function TableCellView(props: {
528535 radius : columnStyle . radius || columnsStyle . radius ,
529536 borderWidth : columnStyle . borderWidth || columnsStyle . borderWidth ,
530537 textSize : columnStyle . textSize || columnsStyle . textSize ,
531- textWeight : columnStyle . textWeight || columnsStyle . textWeight ,
532- fontFamily : columnStyle . fontFamily || columnsStyle . fontFamily ,
538+ textWeight : columnsStyle . textWeight || columnStyle . textWeight ,
539+ fontFamily : columnsStyle . fontFamily || columnStyle . fontFamily ,
540+ fontStyle : columnsStyle . fontStyle || columnStyle . fontStyle ,
533541 rowHeight : rowHeight ,
534542 }
535543 let { background } = style ;
@@ -554,7 +562,7 @@ function TableCellView(props: {
554562 </ TableTd >
555563 ) ;
556564 }
557-
565+
558566 return (
559567 < TableCellContext . Provider value = { { isEditing : editing , setIsEditing : setEditing } } >
560568 { tdView }
@@ -804,7 +812,7 @@ export function TableCompView(props: {
804812
805813 return (
806814 < BackgroundColorContext . Provider value = { style . background } >
807-
815+
808816 < BackgroundWrapper ref = { ref } $style = { style } $tableAutoHeight = { tableAutoHeight } >
809817 { toolbar . position === "above" && toolbarView }
810818 < TableWrapper
@@ -826,11 +834,11 @@ export function TableCompView(props: {
826834 : "OB_CHILDREN_KEY_PLACEHOLDER" ,
827835 fixed : "left" ,
828836 onExpand : ( expanded ) => {
829- if ( expanded ) {
830- handleChangeEvent ( 'rowExpand' )
831- } else {
832- handleChangeEvent ( 'rowShrink' )
833- }
837+ if ( expanded ) {
838+ handleChangeEvent ( 'rowExpand' )
839+ } else {
840+ handleChangeEvent ( 'rowShrink' )
841+ }
834842 }
835843 } }
836844 rowColorFn = { compChildren . rowColor . getView ( ) as any }
@@ -857,14 +865,14 @@ export function TableCompView(props: {
857865 compChildren . loading . getView ( )
858866 }
859867 />
860-
868+
861869 < SlotConfigContext . Provider value = { { modalWidth : width && Math . max ( width , 300 ) } } >
862870 { expansion . expandModalView }
863871 </ SlotConfigContext . Provider >
864872 </ TableWrapper >
865873 { toolbar . position === "below" && toolbarView }
866874 </ BackgroundWrapper >
867-
875+
868876 </ BackgroundColorContext . Provider >
869877 ) ;
870878}
0 commit comments