2019-11-05 05:09:50 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import BaseControl, { ControlProps } from "./BaseControl";
|
2019-11-25 05:07:27 +00:00
|
|
|
import { ControlType } from "constants/PropertyControlConstants";
|
2019-11-05 05:09:50 +00:00
|
|
|
import { ControlWrapper } from "./StyledControls";
|
2019-12-30 07:35:16 +00:00
|
|
|
import DynamicAutocompleteInput from "components/editorComponents/DynamicAutocompleteInput";
|
2019-11-05 05:09:50 +00:00
|
|
|
class CodeEditorControl extends BaseControl<ControlProps> {
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<ControlWrapper>
|
|
|
|
|
<label>{this.props.label}</label>
|
2019-12-30 07:35:16 +00:00
|
|
|
<DynamicAutocompleteInput
|
2019-11-05 05:09:50 +00:00
|
|
|
theme={"DARK"}
|
2019-12-30 07:35:16 +00:00
|
|
|
input={{ value: this.props.propertyValue, onChange: this.onChange }}
|
2019-11-05 05:09:50 +00:00
|
|
|
/>
|
|
|
|
|
</ControlWrapper>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onChange = (value: string) => {
|
|
|
|
|
this.updateProperty(this.props.propertyName, value);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getControlType(): ControlType {
|
|
|
|
|
return "CODE_EDITOR";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default CodeEditorControl;
|