Module.js 2.2 KB

1
  1. "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;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=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _Types=require("./Types");var _jsxFileName="C:\\Users\\Karteri\\Desktop\\Development\\TrapiLib\\lib\\Module.js";var Module=function(_React$Component){(0,_inherits2["default"])(Module,_React$Component);function Module(props){var _this;(0,_classCallCheck2["default"])(this,Module);_this=(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(Module).call(this,props));var ModuleID=props.ModuleID,EventSystem=props.EventSystem;var eventName=ModuleID+"HitCheck";EventSystem&&EventSystem.on(eventName,function(_ref){var x=_ref.x,y=_ref.y;return true;});_this.isTemplate=false;_this._containerStyle={marginLeft:24,marginRight:24};return _this;}(0,_createClass2["default"])(Module,[{key:"componentWillMount",value:function componentWillMount(){}},{key:"setContainerStyle",value:function setContainerStyle(style){this._containerStyle=style;}},{key:"display",value:function display(){throw new Error("You must extend this base Module and override display method!");}},{key:"render",value:function render(){return _react["default"].createElement(_reactNative.View,{ModuleID:this.props.ModuleID,style:[{overflow:'hidden'}],MY_WRAPPER_FROM_BASE_MODULE:true,__source:{fileName:_jsxFileName,lineNumber:40}},this.display());}},{key:"getProps",value:function getProps(){return(0,_Types.Resolver)(this.constructor.Inputs,this.props);}}]);return Module;}(_react["default"].Component);exports["default"]=Module;