2019-09-18 10:19:50 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import BaseControl, { ControlProps } from "./BaseControl";
|
2019-09-24 12:11:32 +00:00
|
|
|
import { ControlType } from "../constants/PropertyControlConstants";
|
|
|
|
|
import { InputType } from "../widgets/InputWidget";
|
Property Pane Controls
- Fixes #121, #122, #123, #124, #90, #46, #65, #100, #101, #68, #102
2019-10-24 05:24:45 +00:00
|
|
|
import { ControlWrapper, StyledInputGroup } from "./StyledControls";
|
2019-09-18 10:19:50 +00:00
|
|
|
|
|
|
|
|
class InputTextControl extends BaseControl<InputControlProps> {
|
|
|
|
|
render() {
|
Property Pane Controls
- Fixes #121, #122, #123, #124, #90, #46, #65, #100, #101, #68, #102
2019-10-24 05:24:45 +00:00
|
|
|
return (
|
|
|
|
|
<ControlWrapper>
|
|
|
|
|
<label>{this.props.label}</label>
|
|
|
|
|
<StyledInputGroup
|
|
|
|
|
onChange={this.onTextChange}
|
|
|
|
|
defaultValue={this.props.propertyValue}
|
|
|
|
|
/>
|
|
|
|
|
</ControlWrapper>
|
|
|
|
|
);
|
2019-09-18 10:19:50 +00:00
|
|
|
}
|
|
|
|
|
|
Property Pane Controls
- Fixes #121, #122, #123, #124, #90, #46, #65, #100, #101, #68, #102
2019-10-24 05:24:45 +00:00
|
|
|
onTextChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
2019-09-18 10:19:50 +00:00
|
|
|
this.updateProperty(this.props.propertyName, event.target.value);
|
Property Pane Controls
- Fixes #121, #122, #123, #124, #90, #46, #65, #100, #101, #68, #102
2019-10-24 05:24:45 +00:00
|
|
|
};
|
2019-09-18 10:19:50 +00:00
|
|
|
|
|
|
|
|
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;
|