|
@@ -11,7 +11,7 @@ import { Body as BodyCtor } from 'native-base';
|
|
import { Button as ButtonCtor } from 'native-base';
|
|
import { Button as ButtonCtor } from 'native-base';
|
|
import { Card as CardCtor } from 'native-base';
|
|
import { Card as CardCtor } from 'native-base';
|
|
import { CardItem as CardItemCtor } from 'native-base';
|
|
import { CardItem as CardItemCtor } from 'native-base';
|
|
-import { Checkbox as CheckboxCtor } from 'native-base';
|
|
|
|
|
|
+import { CheckBox as CheckboxCtor } from 'native-base';
|
|
import { Container as ContainerCtor } from 'native-base';
|
|
import { Container as ContainerCtor } from 'native-base';
|
|
import { Content as ContentCtor } from 'native-base';
|
|
import { Content as ContentCtor } from 'native-base';
|
|
import { DatePicker as DatePickerCtor } from 'native-base';
|
|
import { DatePicker as DatePickerCtor } from 'native-base';
|
|
@@ -126,26 +126,29 @@ export class Card extends Module {
|
|
header,
|
|
header,
|
|
body,
|
|
body,
|
|
footer,
|
|
footer,
|
|
|
|
+ bodyModules,
|
|
...rest
|
|
...rest
|
|
} = this.props;
|
|
} = this.props;
|
|
|
|
|
|
let item = this.renderModule('Button','NativeBase');
|
|
let item = this.renderModule('Button','NativeBase');
|
|
console.log("ITEM : ", item);
|
|
console.log("ITEM : ", item);
|
|
return <CardCtor {...rest}>
|
|
return <CardCtor {...rest}>
|
|
- <CardItemCtor header>
|
|
|
|
|
|
+ {header ? <CardItemCtor header>
|
|
<TextCtor>{header}</TextCtor>
|
|
<TextCtor>{header}</TextCtor>
|
|
</CardItemCtor>
|
|
</CardItemCtor>
|
|
|
|
+ : null}
|
|
<CardItemCtor>
|
|
<CardItemCtor>
|
|
<BodyCtor>
|
|
<BodyCtor>
|
|
<TextCtor>
|
|
<TextCtor>
|
|
{body}
|
|
{body}
|
|
- {item}
|
|
|
|
</TextCtor>
|
|
</TextCtor>
|
|
|
|
+ {this.moduleArray(bodyModules)}
|
|
</BodyCtor>
|
|
</BodyCtor>
|
|
</CardItemCtor>
|
|
</CardItemCtor>
|
|
- <CardItemCtor footer>
|
|
|
|
|
|
+ {footer ? <CardItemCtor footer>
|
|
<TextCtor>{footer}</TextCtor>
|
|
<TextCtor>{footer}</TextCtor>
|
|
</CardItemCtor>
|
|
</CardItemCtor>
|
|
|
|
+ : null}
|
|
</CardCtor>;
|
|
</CardCtor>;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -224,16 +227,41 @@ export class FooterTab extends Module {
|
|
export class Form extends Module {
|
|
export class Form extends Module {
|
|
constructor(props) {
|
|
constructor(props) {
|
|
super(props);
|
|
super(props);
|
|
|
|
+ this.state = {};
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ submit() {
|
|
|
|
+ this.createAction(this.props.onSubmit);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ change(item, value) {
|
|
|
|
+ this.setState({
|
|
|
|
+ [item]: value
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
display() {
|
|
display() {
|
|
- return <FormCtor {...this.props}>
|
|
|
|
- <ItemCtor>
|
|
|
|
- <InputCtor placeholder="Username" />
|
|
|
|
- </ItemCtor>
|
|
|
|
- <ItemCtor last>
|
|
|
|
- <InputCtor placeholder="Password" />
|
|
|
|
- </ItemCtor>
|
|
|
|
- </FormCtor>
|
|
|
|
|
|
+ let {
|
|
|
|
+ inputs,
|
|
|
|
+ button,
|
|
|
|
+ onSubmit,
|
|
|
|
+ ...rest
|
|
|
|
+ } = this.props;
|
|
|
|
+ return [
|
|
|
|
+ <FormCtor {...rest}>
|
|
|
|
+ {inputs ? inputs.map((item, index) => {
|
|
|
|
+ return <ItemCtor key={index} last={index === inputs.length-1}>
|
|
|
|
+ <InputCtor placeholder={item}
|
|
|
|
+ placeholderLabel={item}
|
|
|
|
+ value={this.state[item && item.toLowerCase()] || ''}
|
|
|
|
+ onChangeText={(value) => this.change(item && item.toLowerCase(), value)}/>
|
|
|
|
+ </ItemCtor>
|
|
|
|
+ }) : null}
|
|
|
|
+ </FormCtor>,
|
|
|
|
+ button ? <ButtonCtor onPress={() => this.submit()}>
|
|
|
|
+ <TextCtor>{button}</TextCtor>
|
|
|
|
+ </ButtonCtor>: null
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
export class Gravatar extends Module {
|
|
export class Gravatar extends Module {
|
|
@@ -339,7 +367,7 @@ export class Item extends Module {
|
|
console.log("RENDERMOD:", mod);
|
|
console.log("RENDERMOD:", mod);
|
|
return <ContentCtor>
|
|
return <ContentCtor>
|
|
<ItemCtor {...rest}>
|
|
<ItemCtor {...rest}>
|
|
- {mod ? this.renderModule(mod.value, mod.namespace) : null}
|
|
|
|
|
|
+ {this.module(mod)}
|
|
</ItemCtor>
|
|
</ItemCtor>
|
|
</ContentCtor>;
|
|
</ContentCtor>;
|
|
}
|
|
}
|
|
@@ -591,6 +619,8 @@ Card.Inputs = {
|
|
header: new Types.Text().default("Header"),
|
|
header: new Types.Text().default("Header"),
|
|
body: new Types.Text().default("Lorem ipsum body bla la trapala"),
|
|
body: new Types.Text().default("Lorem ipsum body bla la trapala"),
|
|
footer: new Types.Text().default("Add footer here"),
|
|
footer: new Types.Text().default("Add footer here"),
|
|
|
|
+ bodyModules: new Types.Array(new Types.Module()),
|
|
|
|
+ texts: new Types.Array(new Types.Text())
|
|
}
|
|
}
|
|
CardItem.Inputs = {
|
|
CardItem.Inputs = {
|
|
header: new Types.Bool(),
|
|
header: new Types.Bool(),
|
|
@@ -625,7 +655,9 @@ FooterTab.Inputs = {
|
|
|
|
|
|
}
|
|
}
|
|
Form.Inputs = {
|
|
Form.Inputs = {
|
|
-
|
|
|
|
|
|
+ inputs: new Types.Array(new Types.Text()),
|
|
|
|
+ button: new Types.Text().default('Submit'),
|
|
|
|
+ onSubmit: new Types.Action()
|
|
}
|
|
}
|
|
Gravatar.Inputs = {
|
|
Gravatar.Inputs = {
|
|
email: new Types.Text().require(),
|
|
email: new Types.Text().require(),
|
|
@@ -750,53 +782,53 @@ View.Inputs = {
|
|
}
|
|
}
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- Accordion,
|
|
|
|
- Actionsheet,
|
|
|
|
|
|
+ // Accordion,
|
|
|
|
+ // Actionsheet,
|
|
Badge,
|
|
Badge,
|
|
- Body,
|
|
|
|
|
|
+ // Body,
|
|
Button,
|
|
Button,
|
|
Card,
|
|
Card,
|
|
- CardItem,
|
|
|
|
|
|
+ // CardItem,
|
|
Checkbox,
|
|
Checkbox,
|
|
- Container,
|
|
|
|
- Content,
|
|
|
|
- DatePicker,
|
|
|
|
- DeckSwiper,
|
|
|
|
- Fab,
|
|
|
|
- Footer,
|
|
|
|
- FooterTab,
|
|
|
|
|
|
+ // Container,
|
|
|
|
+ // Content,
|
|
|
|
+ // DatePicker,
|
|
|
|
+ // DeckSwiper,
|
|
|
|
+ // Fab,
|
|
|
|
+ // Footer,
|
|
|
|
+ // FooterTab,
|
|
Form,
|
|
Form,
|
|
- Gravatar,
|
|
|
|
|
|
+ // Gravatar,
|
|
H1,
|
|
H1,
|
|
H2,
|
|
H2,
|
|
H3,
|
|
H3,
|
|
- Header,
|
|
|
|
|
|
+ // Header,
|
|
IconNB,
|
|
IconNB,
|
|
Input,
|
|
Input,
|
|
- InputGroup,
|
|
|
|
- Item,
|
|
|
|
- Label,
|
|
|
|
- Left,
|
|
|
|
- List,
|
|
|
|
- ListItem,
|
|
|
|
- PickerItem,
|
|
|
|
|
|
+ // InputGroup,
|
|
|
|
+ // Item,
|
|
|
|
+ // Label,
|
|
|
|
+ // Left,
|
|
|
|
+ // List,
|
|
|
|
+ // ListItem,
|
|
|
|
+ // PickerItem,
|
|
Radio,
|
|
Radio,
|
|
- Right,
|
|
|
|
- Root,
|
|
|
|
- Segment,
|
|
|
|
- Separator,
|
|
|
|
- Spinner,
|
|
|
|
- Subtitle,
|
|
|
|
- SwipeRow,
|
|
|
|
- Switch,
|
|
|
|
- Tab,
|
|
|
|
- TabContainer,
|
|
|
|
- TabHeading,
|
|
|
|
- Text,
|
|
|
|
- Textarea,
|
|
|
|
- Thumbnail,
|
|
|
|
- Title,
|
|
|
|
- Toast,
|
|
|
|
- ToastContainer,
|
|
|
|
- View
|
|
|
|
|
|
+ // Right,
|
|
|
|
+ // Root,
|
|
|
|
+ // Segment,
|
|
|
|
+ // Separator,
|
|
|
|
+ // Spinner,
|
|
|
|
+ // Subtitle,
|
|
|
|
+ // SwipeRow,
|
|
|
|
+ // Switch,
|
|
|
|
+ // Tab,
|
|
|
|
+ // TabContainer,
|
|
|
|
+ // TabHeading,
|
|
|
|
+ // Text,
|
|
|
|
+ // Textarea,
|
|
|
|
+ // Thumbnail,
|
|
|
|
+ // Title,
|
|
|
|
+ // Toast,
|
|
|
|
+ // ToastContainer,
|
|
|
|
+ // View
|
|
}
|
|
}
|