text: var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _Input=require("../../primitives/Input");var _Context=require("./Context");var _reactNative=require("react-native");var _utils=require("../../../utils");var _useHasResponsiveProps=require("../../../hooks/useHasResponsiveProps");var _this=this,_jsxFileName="/Users/suraj/Sites/projects/NativeBase/src/components/composites/PinInput/PinInputField.tsx";var PinInputFiled=function PinInputFiled(_ref,ref){var _ref$fieldIndex=_ref.fieldIndex,fieldIndex=_ref$fieldIndex===void 0?0:_ref$fieldIndex,pDefaultValue=_ref.defaultValue,props=(0,_objectWithoutProperties2.default)(_ref,["fieldIndex","defaultValue"]);var _React$useContext=_react.default.useContext(_Context.PinInputContext),handleChange=_React$useContext.handleChange,cValue=_React$useContext.value,setRefList=_React$useContext.setRefList,cDefaultValue=_React$useContext.defaultValue,handleMultiValueChange=_React$useContext.handleMultiValueChange,context=(0,_objectWithoutProperties2.default)(_React$useContext,["handleChange","value","setRefList","defaultValue","handleMultiValueChange"]);cDefaultValue=cDefaultValue&&cDefaultValue[fieldIndex];var defaultValue=pDefaultValue||cDefaultValue;var value=cValue&&cValue[fieldIndex];var keyPressHandler=function keyPressHandler(event){if(_reactNative.Platform.OS!=='web'){if(event.nativeEvent.key>=0&&event.nativeEvent.key<=9){handleChange&&handleChange(event.nativeEvent.key,fieldIndex);}else if(event.nativeEvent.key==='Backspace'){handleChange&&handleChange('',fieldIndex);}}};var textChangeHandler=function textChangeHandler(value){handleMultiValueChange&&handleMultiValueChange(value,fieldIndex);};var myRef=_react.default.useRef(null);_react.default.useEffect(function(){setRefList&&setRefList(myRef,fieldIndex);},[myRef,fieldIndex,setRefList]);if((0,_useHasResponsiveProps.useHasResponsiveProps)(props)){return null;}return _react.default.createElement(_Input.Input,(0,_extends2.default)({ref:(0,_utils.mergeRefs)([myRef,ref])},context,props,{onKeyPress:function onKeyPress(event){return keyPressHandler(event);},onChangeText:function onChangeText(value){return textChangeHandler(value);},keyboardType:"numeric",defaultValue:defaultValue,value:value,__self:_this,__source:{fileName:_jsxFileName,lineNumber:52,columnNumber:5}}));};var _default=_react.default.memo(_react.default.forwardRef(PinInputFiled));exports.default=_default;
  //# sourceMappingURL=PinInputField.js.map