@@ -42,7 +42,7 @@ const passwordProgressMap = {
4242
4343export type PasssWordStrengthProps = {
4444 getStatus ?: ( value ?: string ) => PasswordStatus ;
45- statusRender ?: ( status : PasswordStatus ) => React . ReactNode ;
45+ statusRender ?: ( status : PasswordStatus , value ?: string ) => React . ReactNode ;
4646 getPercent ?: ( value ?: string ) => number ;
4747 popoverProps ?: PopoverProps ;
4848 strengthText ?: React . ReactNode ;
@@ -63,7 +63,7 @@ const PasssWordStrength: React.FC<
6363 return (
6464 < Form . Item shouldUpdate noStyle >
6565 { ( form ) => {
66- const value = form . getFieldValue ( props . name || [ ] ) ;
66+ const value = form . getFieldValue ( props . name || [ ] ) as string ;
6767 const status = props . getStatus ?.( value ) ;
6868 const getPasswordProgressDom = ( ) => {
6969 return value && value . length && status ? (
@@ -93,7 +93,7 @@ const PasssWordStrength: React.FC<
9393 padding : '4px 0' ,
9494 } }
9595 >
96- { props ?. statusRender ?.( status ) }
96+ { props ?. statusRender ?.( status , value ) }
9797 { getPasswordProgressDom ( ) }
9898 < div
9999 style = { {
@@ -128,7 +128,7 @@ const Password: React.FC<
128128} : ProFormFieldItemProps < PasswordProps & PasssWordStrengthProps , InputRef > ) => {
129129 const [ open , setOpen ] = useState < boolean > ( false ) ;
130130
131- if ( fieldProps ?. getStatus && fieldProps ?. statusRender ) {
131+ if ( fieldProps ?. getStatus && fieldProps ?. statusRender && rest . name ) {
132132 return (
133133 < PasssWordStrength
134134 name = { rest . name }
0 commit comments