|
@@ -18,7 +18,7 @@ interface ISliderLineComponentProps {
|
|
|
onInput?: (value: number) => void;
|
|
|
onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
|
|
|
decimalCount?: number;
|
|
|
- globalState?: GlobalState;
|
|
|
+ globalState: GlobalState;
|
|
|
}
|
|
|
|
|
|
export class SliderLineComponent extends React.Component<ISliderLineComponentProps, { value: number }> {
|
|
@@ -104,25 +104,19 @@ export class SliderLineComponent extends React.Component<ISliderLineComponentPro
|
|
|
|
|
|
render() {
|
|
|
|
|
|
- const input = this.props.globalState ?
|
|
|
- <FloatLineComponent globalState={this.props.globalState} smallUI={true} label="" target={this.state} propertyName="value" min={this.prepareDataToRead(this.props.minimum)} max={this.prepareDataToRead(this.props.maximum)}
|
|
|
- onEnter={ () => {
|
|
|
- this.onChange(this.state.value)
|
|
|
- }
|
|
|
- } >
|
|
|
- </FloatLineComponent> : null;
|
|
|
-
|
|
|
- let decimalCount = this.props.decimalCount !== undefined ? this.props.decimalCount : 2;
|
|
|
- const valueDisplay = this.state.value ? this.prepareDataToRead(this.state.value).toFixed(decimalCount) : "0";
|
|
|
-
|
|
|
return (
|
|
|
<div className="sliderLine">
|
|
|
<div className="label">
|
|
|
{this.props.label}
|
|
|
</div>
|
|
|
- {input}
|
|
|
+ <FloatLineComponent globalState={this.props.globalState} smallUI={true} label="" target={this.state} propertyName="value" min={this.prepareDataToRead(this.props.minimum)} max={this.prepareDataToRead(this.props.maximum)}
|
|
|
+ onEnter={ () => {
|
|
|
+ this.onChange(this.state.value)
|
|
|
+ }
|
|
|
+ } >
|
|
|
+ </FloatLineComponent>
|
|
|
<div className="slider">
|
|
|
- {this.props.globalState? null : valueDisplay } <input className="range" type="range" step={this.props.step} min={this.prepareDataToRead(this.props.minimum)} max={this.prepareDataToRead(this.props.maximum)} value={this.prepareDataToRead(this.state.value)}
|
|
|
+ <input className="range" type="range" step={this.props.step} min={this.prepareDataToRead(this.props.minimum)} max={this.prepareDataToRead(this.props.maximum)} value={this.prepareDataToRead(this.state.value)}
|
|
|
onInput={evt => this.onInput((evt.target as HTMLInputElement).value)}
|
|
|
onChange={evt => this.onChange(evt.target.value)} />
|
|
|
</div>
|