Text.js 3.2 KB

1
  1. "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=_interopRequireDefault(require("react"));var _Module2=_interopRequireDefault(require("../lib/Module"));var _reactNative=require("react-native");var _Types=_interopRequireDefault(require("../lib/Types"));var _jsxFileName="C:\\Users\\Karteri\\Desktop\\Development\\TrapiLib\\modules\\Text.js";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(source,true).forEach(function(key){(0,_defineProperty2["default"])(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(source).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}var TextComp=function(_Module){(0,_inherits2["default"])(TextComp,_Module);function TextComp(props){var _this;(0,_classCallCheck2["default"])(this,TextComp);_this=(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(TextComp).call(this,props));_this.state={text:props.text||""};return _this;}(0,_createClass2["default"])(TextComp,[{key:"display",value:function display(){var _this2=this;var _ref=this.props.style||"",container=_ref.container,text=_ref.text;var _this$props=this.props,color=_this$props.color,fontSize=_this$props.fontSize;return _react["default"].createElement(_reactNative.View,{style:container||defaultStyle.container,__source:{fileName:_jsxFileName,lineNumber:21}},_react["default"].createElement(_reactNative.TextInput,{style:_objectSpread({},text||defaultStyle.text,{color:color,fontSize:fontSize}),onChangeText:function onChangeText(text){return _this2.setState({text:text});},value:this.state.text||'Default Text',__source:{fileName:_jsxFileName,lineNumber:22}}),this.props.children);}}]);return TextComp;}(_Module2["default"]);exports["default"]=TextComp;var defaultStyle=_reactNative.StyleSheet.create({container:{borderWidth:0.5,borderColor:'#E4E4E4',backgroundColor:'#FFFFFF'},text:{color:'#707070',textAlign:'center',font:8,opacity:0.8}});TextComp.Inputs={color:new _Types["default"].Text(),fontSize:new _Types["default"].Integer()["default"](22)};