|
@@ -75,7 +75,17 @@ export class Badge extends Module {
|
|
|
super(props);
|
|
|
}
|
|
|
display() {
|
|
|
- return <BadgeCtor {...this.props} />
|
|
|
+ let {
|
|
|
+ text,
|
|
|
+ icon,
|
|
|
+ style,
|
|
|
+ color,
|
|
|
+ ...restProps
|
|
|
+ } = this.props;
|
|
|
+ return <BadgeCtor {...restProps} style={[{flexDirection: 'row'}, style]}>
|
|
|
+ {icon ? <IconNBCtor name={icon} style={{ fontSize: 15, color, lineHeight: 27 }}/> : null}
|
|
|
+ {text ? <TextCtor style={{ fontSize: 15, color, lineHeight: 27 }}>{text}</TextCtor> : null}
|
|
|
+ </BadgeCtor>
|
|
|
}
|
|
|
}
|
|
|
export class Body extends Module {
|
|
@@ -93,10 +103,16 @@ export class Button extends Module {
|
|
|
display() {
|
|
|
let {
|
|
|
text,
|
|
|
+ icon,
|
|
|
+ onPress,
|
|
|
...rest
|
|
|
} = this.props;
|
|
|
- return <ButtonCtor {...rest}>
|
|
|
- {text ? <TextCtor>{text}</TextCtor> : null}
|
|
|
+ let run = () => {
|
|
|
+ this.createAction(onPress)
|
|
|
+ };
|
|
|
+ return <ButtonCtor {...rest} onClick={run} onPress={run}>
|
|
|
+ {icon ? <IconCtor name={icon} /> : null}
|
|
|
+ {text ? <TextCtor>{text}</TextCtor> : null}
|
|
|
</ButtonCtor>
|
|
|
}
|
|
|
}
|
|
@@ -111,8 +127,7 @@ export class Card extends Module {
|
|
|
footer,
|
|
|
...rest
|
|
|
} = this.props;
|
|
|
- return
|
|
|
- <CardCtor {...rest}>
|
|
|
+ return <CardCtor {...rest}>
|
|
|
<CardItemCtor header>
|
|
|
<TextCtor>{header}</TextCtor>
|
|
|
</CardItemCtor>
|
|
@@ -206,7 +221,14 @@ export class Form extends Module {
|
|
|
super(props);
|
|
|
}
|
|
|
display() {
|
|
|
- return <FormCtor {...this.props} />
|
|
|
+ return <FormCtor {...this.props}>
|
|
|
+ <ItemCtor>
|
|
|
+ <InputCtor placeholder="Username" />
|
|
|
+ </ItemCtor>
|
|
|
+ <ItemCtor last>
|
|
|
+ <InputCtor placeholder="Password" />
|
|
|
+ </ItemCtor>
|
|
|
+ </FormCtor>
|
|
|
}
|
|
|
}
|
|
|
export class Gravatar extends Module {
|
|
@@ -280,7 +302,15 @@ export class Input extends Module {
|
|
|
super(props);
|
|
|
}
|
|
|
display() {
|
|
|
- return <InputCtor {...this.props} />
|
|
|
+ let {
|
|
|
+ icon,
|
|
|
+ placeholder,
|
|
|
+ ...rest
|
|
|
+ } = this.props;
|
|
|
+ return <ItemCtor {...rest}>
|
|
|
+ <InputCtor placeholder={placeholder}/>
|
|
|
+ {icon ? <IconNBCtor active name={icon} /> : null}
|
|
|
+ </ItemCtor>;
|
|
|
}
|
|
|
}
|
|
|
export class InputGroup extends Module {
|
|
@@ -296,7 +326,13 @@ export class Item extends Module {
|
|
|
super(props);
|
|
|
}
|
|
|
display() {
|
|
|
- return <ItemCtor {...this.props} />
|
|
|
+ let {
|
|
|
+ placeholder,
|
|
|
+ ...rest
|
|
|
+ } = this.props;
|
|
|
+ return <ItemCtor {...rest}>
|
|
|
+ <InputCtor placeholder={placeholder}/>
|
|
|
+ </ItemCtor>;
|
|
|
}
|
|
|
}
|
|
|
export class Label extends Module {
|
|
@@ -511,15 +547,13 @@ Accordion.Inputs = {
|
|
|
}
|
|
|
Actionsheet.Inputs = {
|
|
|
|
|
|
-}
|
|
|
-Badge.Inputs = {
|
|
|
-
|
|
|
}
|
|
|
Body.Inputs = {
|
|
|
|
|
|
}
|
|
|
Button.Inputs = {
|
|
|
text: new Types.Text().default("Press me"),
|
|
|
+ onPress: new Types.Action(),
|
|
|
block: new Types.Bool(),
|
|
|
primary: new Types.Bool(),
|
|
|
transparent: new Types.Bool(),
|
|
@@ -534,6 +568,16 @@ Button.Inputs = {
|
|
|
small: new Types.Bool(),
|
|
|
active: new Types.Bool()
|
|
|
}
|
|
|
+Badge.Inputs = {
|
|
|
+ icon: new Types.Text(),
|
|
|
+ text: new Types.Text().require().default("1"),
|
|
|
+ color: new Types.Text().color().require().default("rgba(255,255,255,1)"),
|
|
|
+ primary: new Types.Bool(),
|
|
|
+ success: new Types.Bool(),
|
|
|
+ danger: new Types.Bool(),
|
|
|
+ warning: new Types.Bool(),
|
|
|
+ info: new Types.Bool()
|
|
|
+}
|
|
|
Card.Inputs = {
|
|
|
header: new Types.Text().default("Header"),
|
|
|
body: new Types.Text().default("Lorem ipsum body bla la trapala"),
|
|
@@ -595,9 +639,19 @@ Header.Inputs = {
|
|
|
}
|
|
|
IconNB.Inputs = {
|
|
|
|
|
|
+}
|
|
|
+Item.Inputs = {
|
|
|
+ inlineLabel: new Types.Bool(),
|
|
|
+ floatingLabel: new Types.Bool(),
|
|
|
+ stackedLabel: new Types.Bool(),
|
|
|
+ fixedLabel: new Types.Bool(),
|
|
|
+ success: new Types.Bool(),
|
|
|
+ error: new Types.Bool()
|
|
|
}
|
|
|
Input.Inputs = {
|
|
|
-
|
|
|
+ icon: new Types.Text(),
|
|
|
+ placeholder: new Types.Text(),
|
|
|
+ ...Item.Inputs
|
|
|
}
|
|
|
InputGroup.Inputs = {
|
|
|
regular: new Types.Bool(),
|
|
@@ -607,14 +661,6 @@ InputGroup.Inputs = {
|
|
|
error: new Types.Bool(),
|
|
|
disabled: new Types.Bool()
|
|
|
}
|
|
|
-Item.Inputs = {
|
|
|
- inlineLabel: new Types.Bool(),
|
|
|
- floatingLabel: new Types.Bool(),
|
|
|
- stackedLabel: new Types.Bool(),
|
|
|
- fixedLabel: new Types.Bool(),
|
|
|
- success: new Types.Bool(),
|
|
|
- error: new Types.Bool()
|
|
|
-}
|
|
|
Label.Inputs = {
|
|
|
floatBack: new Types.Real()
|
|
|
}
|