@@ -17,7 +17,7 @@ export interface StepProps {
1717
1818 // data
1919 data : StepItem ;
20- prevStatus ?: Status ;
20+ nextStatus ?: Status ;
2121
2222 active ?: boolean ;
2323 index : number ;
@@ -32,7 +32,7 @@ export interface StepProps {
3232 iconRender ?: StepsProps [ 'iconRender' ] ;
3333 icon ?: React . ReactNode ;
3434 progressDot ?: ProgressDotRender | boolean ;
35- itemRender ?: ( stepItem : React . ReactElement ) => React . ReactNode ;
35+ itemRender ?: StepsProps [ 'itemRender' ] ;
3636
3737 // Event
3838 onClick ?: ( index : number ) => void ;
@@ -47,7 +47,7 @@ export default function Step(props: StepProps) {
4747
4848 // data
4949 data,
50- prevStatus ,
50+ nextStatus ,
5151
5252 active,
5353 index,
@@ -61,6 +61,8 @@ export default function Step(props: StepProps) {
6161 onClick,
6262 } = props ;
6363
64+ const itemCls = `${ prefixCls } -item` ;
65+
6466 // ========================== Data ==========================
6567 const {
6668 onClick : onItemClick ,
@@ -76,8 +78,15 @@ export default function Step(props: StepProps) {
7678 style,
7779 ...restItemProps
7880 } = data ;
81+
7982 const mergedContent = content ?? description ;
8083
84+ const renderInfo = {
85+ item : data ,
86+ index,
87+ active,
88+ } ;
89+
8190 // ========================= Click ==========================
8291 const clickable = ! ! ( onItemClick || onItemClick ) && ! disabled ;
8392
@@ -108,12 +117,12 @@ export default function Step(props: StepProps) {
108117 const mergedStatus = status || 'wait' ;
109118
110119 const classString = cls (
111- ` ${ prefixCls } -item` ,
112- `${ prefixCls } -item -${ mergedStatus } ` ,
120+ itemCls ,
121+ `${ itemCls } -${ mergedStatus } ` ,
113122 {
114- [ `${ prefixCls } -item -custom` ] : icon ,
115- [ `${ prefixCls } -item -active` ] : active ,
116- [ `${ prefixCls } -item -disabled` ] : disabled === true ,
123+ [ `${ itemCls } -custom` ] : icon ,
124+ [ `${ itemCls } -active` ] : active ,
125+ [ `${ itemCls } -disabled` ] : disabled === true ,
117126 } ,
118127 className ,
119128 classNames . item ,
@@ -128,34 +137,31 @@ export default function Step(props: StepProps) {
128137 ...style ,
129138 } }
130139 >
131- < div { ...accessibilityProps } className = { `${ prefixCls } -item-container` } >
132- < div className = { `${ prefixCls } -item-tail` } />
133- < div className = { `${ prefixCls } -item-icon` } >
134- { iconRender ( data , {
135- index,
136- active,
137- } ) }
140+ < div { ...accessibilityProps } className = { `${ itemCls } -container` } >
141+ < div className = { `${ itemCls } -tail` } />
142+ < div className = { cls ( `{itemCls}-icon` , progressDot && `{itemCls}-icon-dot` ) } >
143+ { iconRender ( renderInfo ) }
138144 </ div >
139- < div className = { `${ prefixCls } -item -content` } >
140- < div className = { `${ prefixCls } -item -title` } >
145+ < div className = { `{itemCls} -content` } >
146+ < div className = { `{itemCls} -title` } >
141147 { title }
142148 { subTitle && (
143149 < div
144150 title = { typeof subTitle === 'string' ? subTitle : undefined }
145- className = { `${ prefixCls } -item -subtitle` }
151+ className = { `{itemCls} -subtitle` }
146152 >
147153 { subTitle }
148154 </ div >
149155 ) }
150156 </ div >
151- { description && < div className = { `${ prefixCls } -item- description` } > { description } </ div > }
157+ { mergedContent && < div className = { `{itemCls}- description` } > { mergedContent } </ div > }
152158 </ div >
153159 </ div >
154160 </ div >
155161 ) ;
156162
157163 if ( itemRender ) {
158- stepNode = ( itemRender ( stepNode ) || null ) as React . ReactElement ;
164+ stepNode = ( itemRender ( stepNode , renderInfo ) || null ) as React . ReactElement ;
159165 }
160166
161167 return stepNode ;
0 commit comments