"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.TextInput=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _reactNativePaper=require("react-native-paper");var _themed=require("@brightlayer-ui/react-native-components/themed");var _reactNativeComponents=require("@brightlayer-ui/react-native-components");var Colors=_interopRequireWildcard(require("@brightlayer-ui/colors"));var _excluded=["style","keyboardType","autoCapitalize","returnKeyType","errorText","theme"];var _jsxFileName="/home/circleci/login-workflow/login-workflow/src/components/TextInput.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var makeStyles=function makeStyles(theme){return _reactNative.StyleSheet.create({textInput:{height:70,fontSize:18},errorText:{position:'absolute',bottom:-20,paddingLeft:13,color:theme.colors.error}});};var ErrorText=function ErrorText(props){var errorText=props.errorText,style=props.style;var theme=(0,_reactNativePaper.useTheme)(props.theme);var styles=makeStyles(theme);return _react.default.createElement(_reactNativeComponents.Subtitle2,{style:[styles.errorText,style],font:'regular',__source:{fileName:_jsxFileName,lineNumber:54,columnNumber:9}},errorText||null);};var TextInputRender=function TextInputRender(props,ref){var style=props.style,_props$keyboardType=props.keyboardType,keyboardType=_props$keyboardType===void 0?'default':_props$keyboardType,_props$autoCapitalize=props.autoCapitalize,autoCapitalize=_props$autoCapitalize===void 0?'none':_props$autoCapitalize,_props$returnKeyType=props.returnKeyType,returnKeyType=_props$returnKeyType===void 0?'done':_props$returnKeyType,errorText=props.errorText,customTheme=props.theme,inputProps=(0,_objectWithoutProperties2.default)(props,_excluded);var theme=(0,_reactNativePaper.useTheme)(customTheme);var styles=makeStyles(theme);var inputRef=_react.default.useRef(null);_react.default.useImperativeHandle(ref,function(){return{focus:function focus(){if(inputRef&&inputRef.current)inputRef.current.focus();}};});var selectionColor=_reactNative.Platform.OS==='android'?Colors.blue['100']:undefined;return _react.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:102,columnNumber:9}},_react.default.createElement(_themed.ThemedTextInput,(0,_extends2.default)({ref:inputRef,style:[styles.textInput,style],keyboardType:keyboardType,autoCapitalize:autoCapitalize,returnKeyType:returnKeyType,textContentType:props.secureTextEntry?'oneTimeCode':'none',underlineColor:Colors.gray['100'],selectionColor:selectionColor,theme:customTheme},inputProps,{__source:{fileName:_jsxFileName,lineNumber:104,columnNumber:13}})),props.error?_react.default.createElement(ErrorText,{errorText:errorText,__source:{fileName:_jsxFileName,lineNumber:116,columnNumber:28}}):null);};var TextInput=_react.default.forwardRef(TextInputRender);exports.TextInput=TextInput;TextInput.displayName='TextInput';
//# sourceMappingURL=TextInput.js.map