Przeglądaj źródła

Merge branch 'master' of http://git.onarbooks.com/Klapi/TrapiLib

sxoinas12 5 lat temu
rodzic
commit
a40c572bc9

Plik diff jest za duży
+ 0 - 0
dist/lib/Module.js


Plik diff jest za duży
+ 0 - 0
dist/lib/systems/ViewSystem.js


Plik diff jest za duży
+ 0 - 0
dist/modules/BaseContainer/index.js


Plik diff jest za duży
+ 0 - 0
dist/modules/BaseHolder/index.js


Plik diff jest za duży
+ 0 - 0
dist/modules/BlogFeed/index.js


Plik diff jest za duży
+ 0 - 0
dist/modules/BlogPost/index.js


Plik diff jest za duży
+ 0 - 0
dist/modules/Button/index.js


Plik diff jest za duży
+ 0 - 0
dist/modules/Col.js


Plik diff jest za duży
+ 0 - 0
dist/modules/DatePicker.js


Plik diff jest za duży
+ 0 - 0
dist/modules/Form/index.js


Plik diff jest za duży
+ 0 - 0
dist/modules/Icon/index.js


Plik diff jest za duży
+ 0 - 0
dist/modules/Image/index.js


Plik diff jest za duży
+ 0 - 0
dist/modules/NativeBase/index.js


+ 1 - 1
dist/modules/RootComp/index.js

@@ -1 +1 @@
-var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");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=_interopRequireDefault(require("react"));var _Types=_interopRequireDefault(require("../../lib/Types"));var _Module2=_interopRequireDefault(require("../../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Konstanitnos\\Development\\TrapiLib\\src\\modules\\RootComp\\index.js";var RootComp=function(_Module){(0,_inherits2.default)(RootComp,_Module);function RootComp(props){(0,_classCallCheck2.default)(this,RootComp);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(RootComp).call(this,props));}(0,_createClass2.default)(RootComp,[{key:"display",value:function display(){return;_react.default.createElement(_reactNative.Text,{__source:{fileName:_jsxFileName,lineNumber:14}},this.props.text||""," - ",this.props.second);}}]);return RootComp;}(_Module2.default);exports.default=RootComp;RootComp.Inputs={text:new _Types.default.Text().require().default("Sample Text"),second:new _Types.default.Integer().require().default(5)};
+var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");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=_interopRequireDefault(require("react"));var _Types=_interopRequireDefault(require("../../lib/Types"));var _Module2=_interopRequireDefault(require("../../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Karteri\\Desktop\\Development\\TrapiLib\\src\\modules\\RootComp\\index.js";var RootComp=function(_Module){(0,_inherits2.default)(RootComp,_Module);function RootComp(props){(0,_classCallCheck2.default)(this,RootComp);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(RootComp).call(this,props));}(0,_createClass2.default)(RootComp,[{key:"display",value:function display(){return;_react.default.createElement(_reactNative.Text,{__source:{fileName:_jsxFileName,lineNumber:14}},this.props.text||""," - ",this.props.second);}}]);return RootComp;}(_Module2.default);exports.default=RootComp;RootComp.Inputs={text:new _Types.default.Text().require().default("Sample Text"),second:new _Types.default.Integer().require().default(5)};

Plik diff jest za duży
+ 0 - 0
dist/modules/Row.js


Plik diff jest za duży
+ 0 - 0
dist/modules/Text/index.js


+ 1 - 1
dist/modules/View.js

@@ -1 +1 @@
-var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");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=_interopRequireDefault(require("react"));var _Module2=_interopRequireDefault(require("../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Konstanitnos\\Development\\TrapiLib\\src\\modules\\View.js";var ViewComp=function(_Module){(0,_inherits2.default)(ViewComp,_Module);function ViewComp(props){(0,_classCallCheck2.default)(this,ViewComp);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(ViewComp).call(this,props));}(0,_createClass2.default)(ViewComp,[{key:"display",value:function display(){return _react.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:16}},this.props.children);}}]);return ViewComp;}(_Module2.default);exports.default=ViewComp;
+var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");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=_interopRequireDefault(require("react"));var _Module2=_interopRequireDefault(require("../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Karteri\\Desktop\\Development\\TrapiLib\\src\\modules\\View.js";var ViewComp=function(_Module){(0,_inherits2.default)(ViewComp,_Module);function ViewComp(props){(0,_classCallCheck2.default)(this,ViewComp);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(ViewComp).call(this,props));}(0,_createClass2.default)(ViewComp,[{key:"display",value:function display(){return _react.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:16}},this.props.children);}}]);return ViewComp;}(_Module2.default);exports.default=ViewComp;

+ 1 - 1
dist/modules/ViewComp.js

@@ -1 +1 @@
-var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");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=_interopRequireDefault(require("react"));var _Module2=_interopRequireDefault(require("../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Konstanitnos\\Development\\TrapiLib\\src\\modules\\ViewComp.js";var ViewComp=function(_Module){(0,_inherits2.default)(ViewComp,_Module);function ViewComp(props){(0,_classCallCheck2.default)(this,ViewComp);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(ViewComp).call(this,props));}(0,_createClass2.default)(ViewComp,[{key:"display",value:function display(){return _react.default.createElement(_reactNative.View,{key:Math.random(),__source:{fileName:_jsxFileName,lineNumber:16}});}}]);return ViewComp;}(_Module2.default);exports.default=ViewComp;
+var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");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=_interopRequireDefault(require("react"));var _Module2=_interopRequireDefault(require("../lib/Module"));var _reactNative=require("react-native");var _jsxFileName="C:\\Users\\Karteri\\Desktop\\Development\\TrapiLib\\src\\modules\\ViewComp.js";var ViewComp=function(_Module){(0,_inherits2.default)(ViewComp,_Module);function ViewComp(props){(0,_classCallCheck2.default)(this,ViewComp);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(ViewComp).call(this,props));}(0,_createClass2.default)(ViewComp,[{key:"display",value:function display(){return _react.default.createElement(_reactNative.View,{key:Math.random(),__source:{fileName:_jsxFileName,lineNumber:16}});}}]);return ViewComp;}(_Module2.default);exports.default=ViewComp;

+ 1 - 1
dist/rules/Universal.css

@@ -25,7 +25,7 @@ ROOT > ~Badge {
 	fontSize: 11;
 }
 Image > ~Text {
-	fontSize: 111;
+	fontSize: 52;
 }
 Image > Text {
 	asdfontSize: 111;

+ 173 - 0
src/lib/Module.js

@@ -10,6 +10,7 @@ export default class Module extends React.Component{
 
 	constructor(props) {
 		super(props);
+
 		this.Core = Injection.inject('Core');
 		this.Modules = Injection.inject('Modules');
 
@@ -79,4 +80,176 @@ export default class Module extends React.Component{
 	getProps() {
 		return Resolver(this.constructor.Inputs, this.props);
 	}
+
+	static getDerivedStateFromProps(props) {
+		let styleProps = {};
+		let restProps = {};
+		for(var i in props) {
+			if(StyleProps[i]) {
+				styleProps[i] = props[i];
+			} else {
+				restProps[i] = props[i];
+			}
+		}
+		return {
+			styleProps,
+			restProps
+		}
+	}
+}
+
+const StyleProps = {
+	"fontSize":1,
+	"fontFamily":1,
+	"fontWeight":1,
+	"letterSpacing":1,
+
+
+	"animationDelay":1,
+	"animationDirection":1,
+	"animationDuration":1,
+	"animationFillMode":1,
+	"animationIterationCount":1,
+	"animationKeyframes":1,
+	"animationPlayState":1,
+	"animationTimingFunction":1,
+	"transitionDelay":1,
+	"transitionDuration":1,
+	"transitionProperty":1,
+	"transitionTimingFunction":1,
+	"borderColor":1,
+	"borderBottomColor":1,
+	"borderEndColor":1,
+	"borderLeftColor":1,
+	"borderRightColor":1,
+	"borderStartColor":1,
+	"borderTopColor":1,
+	"borderRadius":1,
+	"borderBottomEndRadius":1,
+	"borderBottomLeftRadius":1,
+	"borderBottomRightRadius":1,
+	"borderBottomStartRadius":1,
+	"borderTopEndRadius":1,
+	"borderTopLeftRadius":1,
+	"borderTopRightRadius":1,
+	"borderTopStartRadius":1,
+	"borderStyle":1,
+	"borderBottomStyle":1,
+	"borderEndStyle":1,
+	"borderLeftStyle":1,
+	"borderRightStyle":1,
+	"borderStartStyle":1,
+	"borderTopStyle":1,
+	"cursor":1,
+	"touchAction":1,
+	"userSelect":1,
+	"willChange":1,
+	"alignContent":1,
+	"alignItems":1,
+	"alignSelf":1,
+	"backfaceVisibility":1,
+	"borderWidth":1,
+	"borderBottomWidth":1,
+	"borderEndWidth":1,
+	"borderLeftWidth":1,
+	"borderRightWidth":1,
+	"borderStartWidth":1,
+	"borderTopWidth":1,
+	"bottom":1,
+	"boxSizing":1,
+	"direction":1,
+	"display":1,
+	"end":1,
+	"flex":1,
+	"flexBasis":1,
+	"flexDirection":1,
+	"flexGrow":1,
+	"flexShrink":1,
+	"flexWrap":1,
+	"height":1,
+	"justifyContent":1,
+	"left":1,
+	"margin":1,
+	"marginBottom":1,
+	"marginHorizontal":1,
+	"marginEnd":1,
+	"marginLeft":1,
+	"marginRight":1,
+	"marginStart":1,
+	"marginTop":1,
+	"marginVertical":1,
+	"maxHeight":1,
+	"maxWidth":1,
+	"minHeight":1,
+	"minWidth":1,
+	"order":1,
+	"overflow":1,
+	"overflowX":1,
+	"overflowY":1,
+	"padding":1,
+	"paddingBottom":1,
+	"paddingHorizontal":1,
+	"paddingEnd":1,
+	"paddingLeft":1,
+	"paddingRight":1,
+	"paddingStart":1,
+	"paddingTop":1,
+	"paddingVertical":1,
+	"position":1,
+	"right":1,
+	"start":1,
+	"top":1,
+	"visibility":1,
+	"width":1,
+	"zIndex":1,
+	"aspectRatio":1,
+	"gridAutoColumns":1,
+	"gridAutoFlow":1,
+	"gridAutoRows":1,
+	"gridColumnEnd":1,
+	"gridColumnGap":1,
+	"gridColumnStart":1,
+	"gridRowEnd":1,
+	"gridRowGap":1,
+	"gridRowStart":1,
+	"gridTemplateColumns":1,
+	"gridTemplateRows":1,
+	"gridTemplateAreas":1,
+	"shadowColor":1,
+	"shadowOffset":1,
+	"shadowOpacity":1,
+	"shadowRadius":1,
+	"shadowSpread":1,
+	"perspective":1,
+	"perspectiveOrigin":1,
+	"transform":1,
+	"transformOrigin":1,
+	"transformStyle":1,
+	"backgroundColor":1,
+	"opacity":1,
+	"elevation":1,
+	"backdropFilter":1,
+	"backgroundAttachment":1,
+	"backgroundBlendMode":1,
+	"backgroundClip":1,
+	"backgroundImage":1,
+	"backgroundOrigin":1,
+	"backgroundPosition":1,
+	"backgroundRepeat":1,
+	"backgroundSize":1,
+	"boxShadow":1,
+	"clip":1,
+	"filter":1,
+	"outlineColor":1,
+	"outlineOffset":1,
+	"outlineStyle":1,
+	"outlineWidth":1,
+	"overscrollBehavior":1,
+	"overscrollBehaviorX":1,
+	"overscrollBehaviorY":1,
+	"scrollbarWidth":1,
+	"scrollSnapAlign":1,
+	"scrollSnapType":1,
+	"WebkitMaskImage":1,
+	"WebkitOverflowScrolling":1
 }

+ 10 - 7
src/modules/NativeBase/index.js

@@ -131,8 +131,7 @@ export class Card extends Module {
 		} = this.props;
 
 		let item = this.renderModule('Button','NativeBase');
-		console.log("ITEM : ", item);
-		return  <CardCtor {...rest}>
+		return  <CardCtor  style={this.state.styleProps} {...this.state.restProps}>
             {header ? <CardItemCtor header>
               <TextCtor>{header}</TextCtor>
             </CardItemCtor>
@@ -281,7 +280,7 @@ export class H1 extends Module {
 			content,
 			...rest
 		} = this.props;
-		return <H1Ctor {...rest}>
+		return <H1Ctor style={this.state.styleProps} {...this.state.restProps}>
 			{content}
 		</H1Ctor>
 	}
@@ -295,7 +294,7 @@ export class H2 extends Module {
 			content,
 			...rest
 		} = this.props;
-		return <H2Ctor {...rest}>
+		return <H2Ctor style={this.state.styleProps} {...this.state.restProps}>
 			{content}
 		</H2Ctor>
 	}
@@ -309,7 +308,7 @@ export class H3 extends Module {
 			content,
 			...rest
 		} = this.props;
-		return <H3Ctor {...rest}>
+		return <H3Ctor style={this.state.styleProps} {...this.state.restProps}>
 			{content}
 		</H3Ctor>
 	}
@@ -517,7 +516,7 @@ export class Text extends Module {
 			content,
 			...rest
 		} = this.props
-		return <TextCtor {...rest} >
+		return <TextCtor style={this.state.styleProps} {...this.state.restProps}>
 			{content}
 		</TextCtor>
 	}
@@ -576,6 +575,10 @@ export class View extends Module {
 }
 
 Text.Inputs = {
+	fontSize: new Types.Integer(),
+	fontWeight: new Types.Text(),
+	fontFamily: new Types.Text(),
+	letterSpacing: new Types.Integer(),
 	uppercase: new Types.Bool().default(false),
 	content: new Types.Text().default("Hello world!")
 }
@@ -824,7 +827,7 @@ export default {
 	// Tab,
 	// TabContainer,
 	// TabHeading,
-	// Text,
+	Text,
 	// Textarea,
 	// Thumbnail,
 	// Title,

+ 1 - 1
src/rules/Universal.css

@@ -25,7 +25,7 @@ ROOT > ~Badge {
 	fontSize: 11;
 }
 Image > ~Text {
-	fontSize: 111;
+	fontSize: 52;
 }
 Image > Text {
 	asdfontSize: 111;

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików