123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- import React , { useState } from 'react';
- import { StyleSheet, Text, View, TextInput, Button } from 'react-native';
- import Types from '../../lib/Types';
- export default class BaseHolder extends React.Component {
- constructor(props){
- super(props);
- }
- render() {
- let {
- children,
- selected,
- justifyContent,
- alignItems,
- alignContent,
- flexDirection,
- flexWrap,
- order,
- alignSelf,
- flexGrow,
- flexShrink,
- flexBasis,
- width,
- height,
- paddingTop,
- paddingBottom,
- marginLeft,
- marginRight,
- overflow,
- CoreSystem,
- stretchContainer,
- content,
- ...restProps
- } = this.props;
- if(!width) width = undefined;
- if(!height) height = undefined;
- let styl = [styles.base];
- if (CoreSystem && CoreSystem._devMode && selected) styl.push(styles.selected);
- if (stretchContainer) styl.push(styles.stretchToContent);
- return (
- // self container
- <View {...restProps} style={[styl, {
- alignSelf,
- flexGrow,
- flexShrink,
- flexBasis,
- width,
- height,
- paddingTop,
- paddingBottom,
- marginLeft,
- marginRight,
- overflow,
- pointerEvents: 'auto'
- }]}>
- {content}
- <View WRAPPER={true} style={ //children Container
- [
- (!!content || stretchContainer) ? styles.stretchToContent : {},
- {
- pointerEvents: 'none',
- justifyContent,
- alignItems,
- alignContent,
- flexDirection,
- flexWrap
- }
- ]}>
- {children}
- </View>
-
-
- </View>
- );
- }
- }
- const styles = StyleSheet.create({
- base: {
- minHeight: 10,
- // borderColor: 'blue',
- // borderWidth: 1
- },
- stretchToContent: {
- position: 'absolute',
- top: 0,
- left: 0,
- bottom: 0,
- right: 0,
- // borderColor: 'red',
- // borderWidth: 1
- },
- contentWrapper: {
- },
- selected: {
-
- borderWidth: 1,
- borderColor: '#f28d8d',
- shadowColor: "rgba(250,10,0,0.81)",
- shadowOffset: {
- width: 0,
- height: 4,
- },
- shadowOpacity: 0.30,
- shadowRadius: 4.65,
- elevation: 8
- // border: '1px solid green'
- }
- });
- BaseHolder.Inputs = {
- width: new Types.Integer(),
- height: new Types.Integer(),
- paddingTop: new Types.Integer(),
- paddingBottom: new Types.Integer(),
- marginLeft: new Types.Integer().default(0),
- marginRight: new Types.Integer().default(0),
- stretchContainer: new Types.Bool().default(false),
- overflow: new Types.Text().default('visible'),
- justifyContent: new Types.Text().default("flex-start"),
- alignItems: new Types.Text(),
- alignContent: new Types.Text(),
- flexDirection: new Types.Text(),
- flexWrap: new Types.Text(),
- alignSelf: new Types.Text(),
- flexGrow: new Types.Real(),
- flexShrink: new Types.Real(),
- flexBasis: new Types.Real()
- }
|