2019-09-18 10:19:50 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import BaseControl, { ControlProps } from "./BaseControl";
|
|
|
|
|
import { ControlType } from "../../constants/PropertyControlConstants";
|
|
|
|
|
import { InputGroup } from "@blueprintjs/core";
|
2019-09-19 11:29:24 +00:00
|
|
|
import { InputType } from "../../widgets/InputWidget";
|
2019-09-18 10:19:50 +00:00
|
|
|
|
|
|
|
|
class InputTextControl extends BaseControl<InputControlProps> {
|
|
|
|
|
render() {
|
|
|
|
|
return <InputGroup onChange={this.onTextChange} />;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onTextChange(event: React.ChangeEvent<HTMLInputElement>) {
|
|
|
|
|
this.updateProperty(this.props.propertyName, event.target.value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getControlType(): ControlType {
|
|
|
|
|
return "INPUT_TEXT";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface InputControlProps extends ControlProps {
|
|
|
|
|
placeholderText: string;
|
2019-09-19 11:29:24 +00:00
|
|
|
inputType: InputType;
|
|
|
|
|
isDisabled?: boolean;
|
2019-09-18 10:19:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default InputTextControl;
|