|
@@ -11,7 +11,7 @@ import { Body as BodyCtor } from 'native-base';
|
|
|
import { Button as ButtonCtor } from 'native-base';
|
|
|
import { Card as CardCtor } 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 { Content as ContentCtor } from 'native-base';
|
|
|
import { DatePicker as DatePickerCtor } from 'native-base';
|
|
@@ -126,26 +126,29 @@ export class Card extends Module {
|
|
|
header,
|
|
|
body,
|
|
|
footer,
|
|
|
+ bodyModules,
|
|
|
...rest
|
|
|
} = this.props;
|
|
|
|
|
|
let item = this.renderModule('Button','NativeBase');
|
|
|
console.log("ITEM : ", item);
|
|
|
return <CardCtor {...rest}>
|
|
|
- <CardItemCtor header>
|
|
|
+ {header ? <CardItemCtor header>
|
|
|
<TextCtor>{header}</TextCtor>
|
|
|
</CardItemCtor>
|
|
|
+ : null}
|
|
|
<CardItemCtor>
|
|
|
<BodyCtor>
|
|
|
<TextCtor>
|
|
|
{body}
|
|
|
- {item}
|
|
|
</TextCtor>
|
|
|
+ {this.moduleArray(bodyModules)}
|
|
|
</BodyCtor>
|
|
|
</CardItemCtor>
|
|
|
- <CardItemCtor footer>
|
|
|
+ {footer ? <CardItemCtor footer>
|
|
|
<TextCtor>{footer}</TextCtor>
|
|
|
</CardItemCtor>
|
|
|
+ : null}
|
|
|
</CardCtor>;
|
|
|
}
|
|
|
}
|
|
@@ -224,16 +227,41 @@ export class FooterTab extends Module {
|
|
|
export class Form extends Module {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
+ this.state = {};
|
|
|
}
|
|
|
+
|
|
|
+ submit() {
|
|
|
+ this.createAction(this.props.onSubmit);
|
|
|
+ }
|
|
|
+
|
|
|
+ change(item, value) {
|
|
|
+ this.setState({
|
|
|
+ [item]: value
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
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 {
|
|
@@ -339,7 +367,7 @@ export class Item extends Module {
|
|
|
console.log("RENDERMOD:", mod);
|
|
|
return <ContentCtor>
|
|
|
<ItemCtor {...rest}>
|
|
|
- {mod ? this.renderModule(mod.value, mod.namespace) : null}
|
|
|
+ {this.module(mod)}
|
|
|
</ItemCtor>
|
|
|
</ContentCtor>;
|
|
|
}
|
|
@@ -591,6 +619,8 @@ Card.Inputs = {
|
|
|
header: new Types.Text().default("Header"),
|
|
|
body: new Types.Text().default("Lorem ipsum body bla la trapala"),
|
|
|
footer: new Types.Text().default("Add footer here"),
|
|
|
+ bodyModules: new Types.Array(new Types.Module()),
|
|
|
+ texts: new Types.Array(new Types.Text())
|
|
|
}
|
|
|
CardItem.Inputs = {
|
|
|
header: new Types.Bool(),
|
|
@@ -625,7 +655,9 @@ FooterTab.Inputs = {
|
|
|
|
|
|
}
|
|
|
Form.Inputs = {
|
|
|
-
|
|
|
+ inputs: new Types.Array(new Types.Text()),
|
|
|
+ button: new Types.Text().default('Submit'),
|
|
|
+ onSubmit: new Types.Action()
|
|
|
}
|
|
|
Gravatar.Inputs = {
|
|
|
email: new Types.Text().require(),
|
|
@@ -750,53 +782,53 @@ View.Inputs = {
|
|
|
}
|
|
|
|
|
|
export default {
|
|
|
- Accordion,
|
|
|
- Actionsheet,
|
|
|
+ // Accordion,
|
|
|
+ // Actionsheet,
|
|
|
Badge,
|
|
|
- Body,
|
|
|
+ // Body,
|
|
|
Button,
|
|
|
Card,
|
|
|
- CardItem,
|
|
|
+ // CardItem,
|
|
|
Checkbox,
|
|
|
- Container,
|
|
|
- Content,
|
|
|
- DatePicker,
|
|
|
- DeckSwiper,
|
|
|
- Fab,
|
|
|
- Footer,
|
|
|
- FooterTab,
|
|
|
+ // Container,
|
|
|
+ // Content,
|
|
|
+ // DatePicker,
|
|
|
+ // DeckSwiper,
|
|
|
+ // Fab,
|
|
|
+ // Footer,
|
|
|
+ // FooterTab,
|
|
|
Form,
|
|
|
- Gravatar,
|
|
|
+ // Gravatar,
|
|
|
H1,
|
|
|
H2,
|
|
|
H3,
|
|
|
- Header,
|
|
|
+ // Header,
|
|
|
IconNB,
|
|
|
Input,
|
|
|
- InputGroup,
|
|
|
- Item,
|
|
|
- Label,
|
|
|
- Left,
|
|
|
- List,
|
|
|
- ListItem,
|
|
|
- PickerItem,
|
|
|
+ // InputGroup,
|
|
|
+ // Item,
|
|
|
+ // Label,
|
|
|
+ // Left,
|
|
|
+ // List,
|
|
|
+ // ListItem,
|
|
|
+ // PickerItem,
|
|
|
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
|
|
|
}
|