@@ -8,8 +8,8 @@ const VerticalStick_1 = require("./VerticalStick");
88const useOtpInput_1 = require ( "./useOtpInput" ) ;
99exports . OtpInput = ( 0 , react_1 . forwardRef ) ( ( props , ref ) => {
1010 const { models : { text, inputRef, focusedInputIndex } , actions : { clear, handlePress, handleTextChange, focus } , forms : { setTextWithRef } , } = ( 0 , useOtpInput_1 . useOtpInput ) ( props ) ;
11- const { numberOfDigits, autoFocus = true , hideStick, focusColor = "#A4D0A4" , focusStickBlinkingDuration, secureTextEntry = false , autoComplete = "sms-otp" , theme = { } , } = props ;
12- const { containerStyle, inputsContainerStyle, pinCodeContainerStyle, pinCodeTextStyle, focusStickStyle, focusedPinCodeContainerStyle, } = theme ;
11+ const { numberOfDigits, autoFocus = true , hideStick, focusColor = "#A4D0A4" , focusStickBlinkingDuration, secureTextEntry = false , theme = { } , } = props ;
12+ const { containerStyle, inputsContainerStyle, pinCodeContainerStyle, pinCodeTextStyle, focusStickStyle, focusedPinCodeContainerStyle, filledPinCodeContainerStyle , } = theme ;
1313 ( 0 , react_1 . useImperativeHandle ) ( ref , ( ) => ( { clear, focus, setValue : setTextWithRef } ) ) ;
1414 return ( < react_native_1 . View style = { [ OtpInput_styles_1 . styles . container , containerStyle ] } >
1515 < react_native_1 . View style = { [ OtpInput_styles_1 . styles . inputsContainer , inputsContainerStyle ] } >
@@ -25,13 +25,16 @@ exports.OtpInput = (0, react_1.forwardRef)((props, ref) => {
2525 focusedPinCodeContainerStyle && isFocusedInput
2626 ? { ...focusedPinCodeContainerStyle }
2727 : { } ,
28+ filledPinCodeContainerStyle && Boolean ( char )
29+ ? { ...filledPinCodeContainerStyle }
30+ : { } ,
2831 ] } testID = "otp-input" >
2932 { isFocusedInput && ! hideStick ? ( < VerticalStick_1 . VerticalStick focusColor = { focusColor } style = { focusStickStyle } focusStickBlinkingDuration = { focusStickBlinkingDuration } /> ) : ( < react_native_1 . Text style = { [ OtpInput_styles_1 . styles . codeText , pinCodeTextStyle ] } >
3033 { char && secureTextEntry ? "•" : char }
3134 </ react_native_1 . Text > ) }
3235 </ react_native_1 . Pressable > ) ;
3336 } ) }
3437 </ react_native_1 . View >
35- < react_native_1 . TextInput value = { text } onChangeText = { handleTextChange } maxLength = { numberOfDigits } inputMode = "numeric" textContentType = "oneTimeCode" ref = { inputRef } autoFocus = { autoFocus } style = { OtpInput_styles_1 . styles . hiddenInput } secureTextEntry = { secureTextEntry } autoComplete = { autoComplete } testID = "otp-input-hidden" />
38+ < react_native_1 . TextInput value = { text } onChangeText = { handleTextChange } maxLength = { numberOfDigits } inputMode = "numeric" textContentType = "oneTimeCode" ref = { inputRef } autoFocus = { autoFocus } style = { OtpInput_styles_1 . styles . hiddenInput } secureTextEntry = { secureTextEntry } autoComplete = "one-time-code" testID = "otp-input-hidden" />
3639 </ react_native_1 . View > ) ;
3740} ) ;
0 commit comments