@@ -51,7 +51,7 @@ const getStyle = (
51
51
style : TableStyleType ,
52
52
rowStyle : TableRowStyleType ,
53
53
headerStyle : TableHeaderStyleType ,
54
- toolbarStyle : TableToolbarStyleType
54
+ toolbarStyle : TableToolbarStyleType ,
55
55
) => {
56
56
const background = genLinerGradient ( style . background ) ;
57
57
const selectedRowBackground = genLinerGradient ( rowStyle . selectedRowBackground ) ;
@@ -140,7 +140,8 @@ const BackgroundWrapper = styled.div<{
140
140
background: ${ ( props ) => props . $style . background } !important;
141
141
border: ${ ( props ) => `${ props . $style . borderWidth } solid ${ props . $style . border } !important` } ;
142
142
border-radius: ${ ( props ) => props . $style . radius } !important;
143
- padding: unset !important;
143
+ // padding: unset !important;
144
+ padding: ${ ( props ) => props . $style . padding } !important
144
145
margin: ${ ( props ) => props . $style . margin } !important;
145
146
overflow: scroll !important;
146
147
${ ( props ) => props . $style }
@@ -209,18 +210,19 @@ const TableWrapper = styled.div<{
209
210
> .ant-table-thead {
210
211
> tr > th {
211
212
background-color: ${ ( props ) => props . $headerStyle . headerBackground } ;
213
+
212
214
border-color: ${ ( props ) => props . $headerStyle . border } ;
213
215
border-width: ${ ( props ) => props . $headerStyle . borderWidth } ;
214
216
color: ${ ( props ) => props . $headerStyle . headerText } ;
215
217
border-inline-end: ${ ( props ) => `${ props . $headerStyle . borderWidth } solid ${ props . $headerStyle . border } ` } !important;
216
- ${ ( props ) =>
217
- props . $fixedHeader && `
218
+ ${ ( props ) =>
219
+ props . $fixedHeader && `
218
220
position: sticky;
219
221
position: -webkit-sticky;
220
222
top: ${ props . $fixedToolbar ? '47px' : '0' } ;
221
223
z-index: 99;
222
224
`
223
- }
225
+ }
224
226
225
227
> div {
226
228
margin: ${ ( props ) => props . $headerStyle . margin } ;
@@ -229,6 +231,8 @@ const TableWrapper = styled.div<{
229
231
font-size: ${ ( props ) => props . $headerStyle . textSize } ;
230
232
font-weight: ${ ( props ) => props . $headerStyle . textWeight } ;
231
233
font-family: ${ ( props ) => props . $headerStyle . fontFamily } ;
234
+ font-style: ${ ( props ) => props . $headerStyle . fontStyle } ;
235
+ color:${ ( props ) => props . $headerStyle . text }
232
236
}
233
237
}
234
238
@@ -286,8 +290,8 @@ const TableWrapper = styled.div<{
286
290
287
291
// hide the bottom border of the last row
288
292
${ ( props ) =>
289
- props . $toolbarPosition !== "below" &&
290
- `
293
+ props . $toolbarPosition !== "below" &&
294
+ `
291
295
tbody > tr:last-child > td {
292
296
border-bottom: unset;
293
297
}
@@ -300,10 +304,10 @@ const TableWrapper = styled.div<{
300
304
}
301
305
}
302
306
303
- ${ ( props ) =>
307
+ ${ ( props ) =>
304
308
props . $style && getStyle ( props . $style , props . $rowStyle , props . $headerStyle , props . $toolbarStyle ) }
305
309
` ;
306
-
310
+
307
311
const TableTh = styled . th < { width ?: number } > `
308
312
overflow: hidden;
309
313
@@ -318,7 +322,7 @@ const TableTh = styled.th<{ width?: number }>`
318
322
319
323
const TableTd = styled . td < {
320
324
$background : string ;
321
- $style : TableColumnStyleType & { rowHeight ?: string } ;
325
+ $style : TableColumnStyleType & { rowHeight ?: string } ;
322
326
$defaultThemeDetail : ThemeDetail ;
323
327
$linkStyle ?: TableColumnLinkStyleType ;
324
328
$isEditing : boolean ;
@@ -348,7 +352,8 @@ const TableTd = styled.td<{
348
352
349
353
${ ( props ) => props . $tableSize === 'small' && `
350
354
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;
352
357
min-height: ${ props . $style . rowHeight || '14px' } ;
353
358
line-height: 20px;
354
359
${ ! props . $autoHeight && `
@@ -358,7 +363,8 @@ const TableTd = styled.td<{
358
363
` } ;
359
364
${ ( props ) => props . $tableSize === 'middle' && `
360
365
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;
362
368
min-height: ${ props . $style . rowHeight || '24px' } ;
363
369
line-height: 24px;
364
370
${ ! props . $autoHeight && `
@@ -368,7 +374,8 @@ const TableTd = styled.td<{
368
374
` } ;
369
375
${ ( props ) => props . $tableSize === 'large' && `
370
376
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;
372
379
min-height: ${ props . $style . rowHeight || '48px' } ;
373
380
${ ! props . $autoHeight && `
374
381
overflow-y: auto;
@@ -444,7 +451,7 @@ const ResizeableTitle = (props: any) => {
444
451
draggableOpts = { { enableUserSelectHack : false } }
445
452
handle = { ( axis : ResizeHandleAxis , ref : ReactRef < HTMLDivElement > ) => (
446
453
< TitleResizeHandle
447
- ref = { ref }
454
+ ref = { ref }
448
455
onClick = { ( e ) => {
449
456
e . preventDefault ( ) ;
450
457
e . stopPropagation ( ) ;
@@ -519,7 +526,7 @@ function TableCellView(props: {
519
526
const cellColor = cellColorFn ( {
520
527
currentCell : record [ title . toLowerCase ( ) ] ,
521
528
} ) ;
522
-
529
+
523
530
const style = {
524
531
background : cellColor || rowColor || columnStyle . background || columnsStyle . background ,
525
532
margin : columnStyle . margin || columnsStyle . margin ,
@@ -528,8 +535,9 @@ function TableCellView(props: {
528
535
radius : columnStyle . radius || columnsStyle . radius ,
529
536
borderWidth : columnStyle . borderWidth || columnsStyle . borderWidth ,
530
537
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 ,
533
541
rowHeight : rowHeight ,
534
542
}
535
543
let { background } = style ;
@@ -554,7 +562,7 @@ function TableCellView(props: {
554
562
</ TableTd >
555
563
) ;
556
564
}
557
-
565
+
558
566
return (
559
567
< TableCellContext . Provider value = { { isEditing : editing , setIsEditing : setEditing } } >
560
568
{ tdView }
@@ -804,7 +812,7 @@ export function TableCompView(props: {
804
812
805
813
return (
806
814
< BackgroundColorContext . Provider value = { style . background } >
807
-
815
+
808
816
< BackgroundWrapper ref = { ref } $style = { style } $tableAutoHeight = { tableAutoHeight } >
809
817
{ toolbar . position === "above" && toolbarView }
810
818
< TableWrapper
@@ -826,11 +834,11 @@ export function TableCompView(props: {
826
834
: "OB_CHILDREN_KEY_PLACEHOLDER" ,
827
835
fixed : "left" ,
828
836
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
+ }
834
842
}
835
843
} }
836
844
rowColorFn = { compChildren . rowColor . getView ( ) as any }
@@ -857,14 +865,14 @@ export function TableCompView(props: {
857
865
compChildren . loading . getView ( )
858
866
}
859
867
/>
860
-
868
+
861
869
< SlotConfigContext . Provider value = { { modalWidth : width && Math . max ( width , 300 ) } } >
862
870
{ expansion . expandModalView }
863
871
</ SlotConfigContext . Provider >
864
872
</ TableWrapper >
865
873
{ toolbar . position === "below" && toolbarView }
866
874
</ BackgroundWrapper >
867
-
875
+
868
876
</ BackgroundColorContext . Provider >
869
877
) ;
870
878
}
0 commit comments