File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
packages/form/src/components Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ export default () => {
8888 }
8989 return 'poor' ;
9090 } ,
91- getPercent : ( value ) => {
91+ getPercent : ( status , value ) => {
9292 if ( value && value . length > 12 ) {
9393 return 100 ;
9494 }
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ const passwordProgressMap = {
4343export type PasssWordStrengthProps = {
4444 getStatus ?: ( value ?: string ) => PasswordStatus ;
4545 statusRender ?: ( status : PasswordStatus , value ?: string ) => React . ReactNode ;
46- getPercent ?: ( value ?: string ) => number ;
46+ getPercent ?: ( status : PasswordStatus , value ?: string ) => number ;
4747 popoverProps ?: PopoverProps ;
4848 strengthText ?: React . ReactNode ;
4949} ;
@@ -73,7 +73,7 @@ const PasssWordStrength: React.FC<
7373 style = { {
7474 width : '100%' ,
7575 } }
76- percent = { props . getPercent ?.( value ) || 0 }
76+ percent = { props . getPercent ?.( status , value ) || 0 }
7777 showInfo = { false }
7878 />
7979 ) : null ;
@@ -95,13 +95,15 @@ const PasssWordStrength: React.FC<
9595 >
9696 { props ?. statusRender ?.( status , value ) }
9797 { getPasswordProgressDom ( ) }
98- < div
99- style = { {
100- marginTop : 10 ,
101- } }
102- >
103- < span > { props . strengthText } </ span >
104- </ div >
98+ { props . strengthText ? (
99+ < div
100+ style = { {
101+ marginTop : 10 ,
102+ } }
103+ >
104+ < span > { props . strengthText } </ span >
105+ </ div >
106+ ) : null }
105107 </ div >
106108 }
107109 overlayStyle = { {
You can’t perform that action at this time.
0 commit comments