@@ -30,6 +30,7 @@ import AddButton from './AddButton';
30
30
import ExtraContent from './ExtraContent' ;
31
31
import OperationNode from './OperationNode' ;
32
32
import TabNode from './TabNode' ;
33
+ import type { SemanticName } from '../Tabs' ;
33
34
34
35
export interface TabNavListProps {
35
36
id : string ;
@@ -55,6 +56,8 @@ export interface TabNavListProps {
55
56
size ?: GetIndicatorSize ;
56
57
align ?: 'start' | 'center' | 'end' ;
57
58
} ;
59
+ classNames ?: Partial < Record < SemanticName , string > > ;
60
+ styles ?: Partial < Record < SemanticName , React . CSSProperties > > ;
58
61
}
59
62
60
63
const getTabSize = ( tab : HTMLElement , containerRect : { left : number ; top : number } ) => {
@@ -109,6 +112,8 @@ const TabNavList = React.forwardRef<HTMLDivElement, TabNavListProps>((props, ref
109
112
onTabClick,
110
113
onTabScroll,
111
114
indicator,
115
+ classNames : tabsClassNames ,
116
+ styles,
112
117
} = props ;
113
118
114
119
const { prefixCls, tabs } = React . useContext ( TabContext ) ;
@@ -417,8 +422,9 @@ const TabNavList = React.forwardRef<HTMLDivElement, TabNavListProps>((props, ref
417
422
prefixCls = { prefixCls }
418
423
key = { key }
419
424
tab = { tab }
425
+ className = { tabsClassNames ?. item }
420
426
/* first node should not have margin left */
421
- style = { i === 0 ? undefined : tabNodeStyle }
427
+ style = { i === 0 ? styles ?. item : { ... tabNodeStyle , ... styles ?. item } }
422
428
closable = { tab . closable }
423
429
editable = { editable }
424
430
active = { key === activeKey }
@@ -607,10 +613,10 @@ const TabNavList = React.forwardRef<HTMLDivElement, TabNavListProps>((props, ref
607
613
} }
608
614
/>
609
615
< div
610
- className = { classNames ( `${ prefixCls } -ink-bar` , {
616
+ className = { classNames ( `${ prefixCls } -ink-bar` , tabsClassNames ?. indicator , {
611
617
[ `${ prefixCls } -ink-bar-animated` ] : animated . inkBar ,
612
618
} ) }
613
- style = { indicatorStyle }
619
+ style = { { ... indicatorStyle , ... styles ?. indicator } }
614
620
/>
615
621
</ div >
616
622
</ ResizeObserver >
@@ -624,6 +630,7 @@ const TabNavList = React.forwardRef<HTMLDivElement, TabNavListProps>((props, ref
624
630
prefixCls = { prefixCls }
625
631
tabs = { hiddenTabs }
626
632
className = { ! hasDropdown && operationsHiddenClassName }
633
+ popupStyle = { styles ?. popup }
627
634
tabMoving = { ! ! lockAnimation }
628
635
/>
629
636
0 commit comments