Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into kevalbhatt-master
  • Loading branch information
ni3galave committed Jan 11, 2018
2 parents 019149e + a4178fc commit 770e7ea
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
4 changes: 4 additions & 0 deletions examples/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ export default class App extends Component {
title="Enter username"
placement="right"
showButtons={true}
emptyValueText="Enter Text"
placeholder="Field is required"
validate={(value) => {
if(!value){
return 'Required';
Expand Down Expand Up @@ -176,6 +178,8 @@ export default class App extends Component {
mode={"popup"}
title="Enter description"
placement="right"
emptyValueText="Enter Text"
placeholder="Enter text in textarea"
showButtons={true}
/>
<Panel collapsible expanded={this.state.simpleTexareatField} >
Expand Down
11 changes: 6 additions & 5 deletions libs/js/Editable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,19 @@ export default class Editable extends Component {
value: this.value || defaultValue ,
onSubmit: this.onSubmit.bind(this),
setEditable: this.setEditable.bind(this),
validation: this.validation,
validation: this.validation
};
const content = [];
if (editable) {
switch (dataType) {
case 'text':
content.push(<Text {...componetProps} {...this.state} />);
content.push(<Text {...this.props} {...componetProps} {...this.state} />);
break;
case 'textarea':
content.push(<Textarea {...componetProps} {...this.state} />);
content.push(<Textarea {...this.props} {...componetProps} {...this.state} />);
break;
case 'select':
content.push(<Select {...componetProps} {...this.state} />);
content.push(<Select {...this.props} {...componetProps} {...this.state} />);
break;
case 'checklist':
content.push(<Checklist {...componetProps} {...this.state} />);
Expand Down Expand Up @@ -227,7 +227,7 @@ export default class Editable extends Component {
onClick={this.setEditable.bind(this, true)}
href="javascript:;"
>
{ this.getValueForAnchor() || 'empty' }
{ this.getValueForAnchor() || this.props.emptyValueText }
</a>
)
: null
Expand All @@ -243,6 +243,7 @@ Editable.defaultProps = {
dataType : "text",
mode : "inline",
disabled : false,
emptyValueText : "empty",
//depend on mode
placement : "right",
};
Expand Down
6 changes: 5 additions & 1 deletion libs/js/Select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class Select extends Component {
<FormGroup controlId="formControlsSelect" validationState={this.props.validation.type} >
<FormControl
componentClass="select"
placeholder="select"
placeholder={this.props.placeholder}
bsSize="small"
key={"form-control-"+this.props.name}
value={ this.getValue() }
Expand All @@ -75,3 +75,7 @@ export default class Select extends Component {
)
}
}

Select.defaultProps = {
placeholder : "Enter text"
};
6 changes: 5 additions & 1 deletion libs/js/Text.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class Text extends Component {
<FormControl
key={"form-control"+this.props.name}
type="text"
placeholder="Enter text"
placeholder={this.props.placeholder}
bsSize="sm"
value={this.state.value || ''}
onChange={this.setValue.bind(this)}
Expand All @@ -51,3 +51,7 @@ export default class Text extends Component {
);
}
}

Text.defaultProps = {
placeholder : "Enter text"
};
6 changes: 5 additions & 1 deletion libs/js/Textarea.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class Textarea extends Component {
componentClass="textarea"
bsSize="sm"
value={this.state.value || ''}
placeholder="Enter text"
placeholder={this.props.placeholder}
onChange={this.setValue.bind(this)}
onBlur={this.onBlur.bind(this)}
onKeyDown={this.handleKeyDown.bind(this)}
Expand All @@ -51,3 +51,7 @@ export default class Textarea extends Component {
)
}
}

Textarea.defaultProps = {
placeholder : "Enter text"
};

0 comments on commit 770e7ea

Please sign in to comment.