1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-16 00:00:03 +01:00

NumberInput Widget now droppable/editable

This commit is contained in:
Laura Fuentes Grau 2020-03-29 14:11:57 +02:00
parent 76b7c60196
commit 5c95cbf05f
3 changed files with 6 additions and 4 deletions

View file

@ -152,7 +152,7 @@ export default function CreateControls(widgetType = null, widget = null, session
);
break;
case 'Input':
case 'NumberInput':
DialogControls.push(
<EditWidgetTextControl key={0} widget={widget} controlId={'name'} label={'Text'} placeholder={'Enter text'} handleChange={e => handleChange(e)} />,
<EditWidgetSignalControl key={2} widget={widget} controlId={'signalIDs'} input signals={signals} handleChange={(e) => handleChange(e)} />

View file

@ -132,7 +132,7 @@ class WidgetFactory {
widget.customProperties.off_value = 0;
widget.customProperties.toggle = false;
break;
case 'Input':
case 'NumberInput':
widget.minWidth = 200;
widget.minHeight = 50;
widget.width = 200;

View file

@ -76,7 +76,7 @@ class WidgetInput extends Component {
render() {
return (
<div className="number-input-widget full">
<Form componentClass="fieldset" horizontal>
<Form componentclass="fieldset" horizontal="true">
<FormGroup>
<Col as={FormLabel} xs={3}>
{this.props.widget.name}
@ -84,7 +84,9 @@ class WidgetInput extends Component {
<Col xs={9}>
<InputGroup>
<FormControl type="number" step="any" disabled={ this.props.editing } onKeyPress={ (e) => this.handleKeyPress(e) } onBlur={ (e) => this.valueChanged(this.state.value) } onChange={ (e) => this.valueIsChanging(e.target.value) } placeholder="Enter value" value={ this.state.value } />
<InputGroup.Addon>{this.state.unit}</InputGroup.Addon>
<InputGroup.Append>
<InputGroup.Text>{this.state.unit}</InputGroup.Text>
</InputGroup.Append>
</InputGroup>
</Col>
</FormGroup>