diff --git a/src/widget/edit-widget-aspect-control.js b/src/widget/edit-widget-aspect-control.js index 502e837..59af823 100644 --- a/src/widget/edit-widget-aspect-control.js +++ b/src/widget/edit-widget-aspect-control.js @@ -28,7 +28,9 @@ class EditWidgetAspectControl extends React.Component { this.state = { widget: { - lockAspect: true + customProperties:{ + isLocked: true + } } }; } @@ -40,7 +42,7 @@ class EditWidgetAspectControl extends React.Component { render() { return ( - this.props.handleChange(e)}>Lock Aspect + this.props.handleChange(e)}>Lock Aspect ); } diff --git a/src/widget/edit-widget-checkbox-control.js b/src/widget/edit-widget-checkbox-control.js index 0118abb..41c17c6 100644 --- a/src/widget/edit-widget-checkbox-control.js +++ b/src/widget/edit-widget-checkbox-control.js @@ -27,7 +27,11 @@ class EditWidgetCheckboxControl extends React.Component { super(props); this.state = { - widget: {} + widget: { + customProperties:{ + + } + } }; } @@ -37,7 +41,7 @@ class EditWidgetCheckboxControl extends React.Component { render() { return - this.props.handleChange(e)}>{this.props.text} + this.props.handleChange(e)}> ; } } diff --git a/src/widget/edit-widget-color-control.js b/src/widget/edit-widget-color-control.js index 8ec2bd3..212e487 100644 --- a/src/widget/edit-widget-color-control.js +++ b/src/widget/edit-widget-color-control.js @@ -43,7 +43,9 @@ class EditWidgetColorControl extends Component { super(props); this.state = { - widget: {} + widget: { + customProperties:{} + } }; } @@ -57,7 +59,7 @@ class EditWidgetColorControl extends Component { return ( - + { this.props.label } @@ -69,7 +71,7 @@ class EditWidgetColorControl extends Component { }; let checkedClass = classNames({ - 'checked': idx === this.state.widget[this.props.controlId] + 'checked': idx === this.state.widget[this.props.controlId] || this.state.widget.customProperties[this.props.controlId] }); return ( this.props.handleChange({target: { id: this.props.controlId, value: idx}})} />) diff --git a/src/widget/edit-widget-color-zones-control.js b/src/widget/edit-widget-color-zones-control.js index c124353..3e64684 100644 --- a/src/widget/edit-widget-color-zones-control.js +++ b/src/widget/edit-widget-color-zones-control.js @@ -33,7 +33,9 @@ class EditWidgetColorZonesControl extends React.Component { this.state = { widget: { + customProperties:{ zones: [] + } }, selectedZones: [] }; @@ -46,7 +48,7 @@ class EditWidgetColorZonesControl extends React.Component { addZone = () => { // add row const widget = this.state.widget; - widget.zones.push({ strokeStyle: 'ffffff', min: 0, max: 100 }); + widget.customProperties.zones.push({ strokeStyle: 'ffffff', min: 0, max: 100 }); this.setState({ widget }); @@ -58,7 +60,7 @@ class EditWidgetColorZonesControl extends React.Component { const widget = this.state.widget; this.state.selectedZones.forEach(row => { - widget.zones.splice(row, 1); + widget.customProperties.zones.splice(row, 1); }); this.setState({ selectedZones: [], widget }); @@ -71,11 +73,11 @@ class EditWidgetColorZonesControl extends React.Component { const widget = this.state.widget; if (column === 1) { - widget.zones[row].strokeStyle = event.target.value; + widget.customProperties.zones[row].strokeStyle = event.target.value; } else if (column === 2) { - widget.zones[row].min = event.target.value; + widget.customProperties.zones[row].min = event.target.value; } else if (column === 3) { - widget.zones[row].max = event.target.value; + widget.customProperties.zones[row].max = event.target.value; } this.setState({ widget }); @@ -88,7 +90,7 @@ class EditWidgetColorZonesControl extends React.Component { const event = { target: { id: 'zones', - value: widget.zones + value: widget.customProperties.zones } }; @@ -117,15 +119,15 @@ class EditWidgetColorZonesControl extends React.Component { return Color zones - +
- - + +
; } } diff --git a/src/widget/edit-widget-html-content.js b/src/widget/edit-widget-html-content.js index 8633a61..e11fd60 100644 --- a/src/widget/edit-widget-html-content.js +++ b/src/widget/edit-widget-html-content.js @@ -44,7 +44,7 @@ class EditWidgetHTMLContent extends React.Component { render() { return HTML Content - this.props.handleChange(e)} /> + this.props.handleChange(e)} /> ; } } diff --git a/src/widget/edit-widget-image-control.js b/src/widget/edit-widget-image-control.js index e9d0118..501e5eb 100644 --- a/src/widget/edit-widget-image-control.js +++ b/src/widget/edit-widget-image-control.js @@ -30,7 +30,9 @@ class EditImageWidgetControl extends React.Component { this.state = { widget: { + customProperties:{ file: '' + } }, fileList: null, progress: 0 @@ -73,7 +75,7 @@ class EditImageWidgetControl extends React.Component { return
Image - this.props.handleChange(e)}> + this.props.handleChange(e)}> {this.props.files.length === 0 ? ( ) : ( diff --git a/src/widget/edit-widget-min-max-control.js b/src/widget/edit-widget-min-max-control.js index c717f55..ef7f00a 100644 --- a/src/widget/edit-widget-min-max-control.js +++ b/src/widget/edit-widget-min-max-control.js @@ -45,7 +45,7 @@ class EditWidgetMinMaxControl extends React.Component { console.log(this.state.widget); return {this.props.label} - this.props.handleChange(e)}>Enable min-max + this.props.handleChange(e)}> diff --git a/src/widget/edit-widget-orientation.js b/src/widget/edit-widget-orientation.js index 41503ba..2da449d 100644 --- a/src/widget/edit-widget-orientation.js +++ b/src/widget/edit-widget-orientation.js @@ -29,7 +29,9 @@ class EditWidgetOrientation extends Component { super(props); this.state = { - widget: {} + widget: { + customProperties:{} + } }; } @@ -48,7 +50,7 @@ class EditWidgetOrientation extends Component { return ( - + Orientation @@ -58,8 +60,7 @@ class EditWidgetOrientation extends Component { let name = WidgetSlider.OrientationTypes[type].name; return ( - this.handleOrientationChange(value)}> - { name } + this.handleOrientationChange(value)}> ) }) } diff --git a/src/widget/widgets/button.js b/src/widget/widgets/button.js index 62b8c1b..a7fd2ae 100644 --- a/src/widget/widgets/button.js +++ b/src/widget/widgets/button.js @@ -34,6 +34,7 @@ class WidgetButton extends Component { } onPress(e) { + console.log("button was pressed!"); if (!this.props.widget.customProperties.toggle) { this.setState({ pressed: true }); this.valueChanged(this.props.widget.customProperties.on_value); @@ -41,6 +42,7 @@ class WidgetButton extends Component { } onRelease(e) { + console.log("button was released!"); let nextState = false; if (this.props.widget.customProperties.toggle) { nextState = !this.state.pressed; diff --git a/src/widget/widgets/slider.js b/src/widget/widgets/slider.js index 435a29e..4c41a4c 100644 --- a/src/widget/widgets/slider.js +++ b/src/widget/widgets/slider.js @@ -119,10 +119,7 @@ class WidgetSlider extends Component { ) : (
- - { fields.control } - { fields.value } - { this.props.widget.customProperties.showUnit && fields.unit } + this.valueIsChanging(v) } onAfterChange={ (v) => this.valueChanged(v) }/>,
) ); @@ -130,3 +127,17 @@ class WidgetSlider extends Component { } export default WidgetSlider; +/*!isVertical? ( +
+ +
{ fields.control }
+ { fields.value } +
+) : ( +
+ + { fields.control } + { fields.value } + { this.props.widget.customProperties.showUnit && fields.unit } +
+)*/ \ No newline at end of file