PromucFlow_constructor/app/client/src/propertyControls/InputTextControl.tsx

28 lines
765 B
TypeScript
Raw Normal View History

import React from "react";
import BaseControl, { ControlProps } from "./BaseControl";
2019-09-24 12:11:32 +00:00
import { ControlType } from "../constants/PropertyControlConstants";
import { InputGroup } from "@blueprintjs/core";
2019-09-24 12:11:32 +00:00
import { InputType } from "../widgets/InputWidget";
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;
inputType: InputType;
isDisabled?: boolean;
}
export default InputTextControl;