@@ -4,6 +4,8 @@ import classNames from 'classnames';
44import './InputEditor.scss' ;
55
66interface InputEditorProps {
7+ className ?: string ;
8+ placeholder ?: string ;
79 value : string ;
810 onContentChanged : ( value ?: string ) => void ;
911 editorSettings : Partial < monaco . editor . IStandaloneEditorConstructionOptions > ;
@@ -20,10 +22,7 @@ interface InputEditorState {
2022 * A monaco editor that looks like an general input
2123 */
2224
23- export default class InputEditor extends Component <
24- InputEditorProps ,
25- InputEditorState
26- > {
25+ export class InputEditor extends Component < InputEditorProps , InputEditorState > {
2726 static defaultProps = {
2827 value : '' ,
2928 onContentChanged : ( ) : void => undefined ,
@@ -156,14 +155,18 @@ export default class InputEditor extends Component<
156155 }
157156
158157 render ( ) : ReactElement {
159- const { value , invalid } = this . props ;
158+ const { className , invalid, placeholder = '' , value } = this . props ;
160159 const { isEditorFocused, isEditorEmpty } = this . state ;
161160 return (
162161 < div
163- className = { classNames ( 'input-editor-wrapper' , {
164- focused : isEditorFocused ,
165- invalid,
166- } ) }
162+ className = { classNames (
163+ 'input-editor-wrapper' ,
164+ {
165+ focused : isEditorFocused ,
166+ invalid,
167+ } ,
168+ className
169+ ) }
167170 role = "presentation"
168171 onClick = { this . handleContainerClick }
169172 >
@@ -174,10 +177,12 @@ export default class InputEditor extends Component<
174177 } }
175178 data-testid = "custom-column-formula"
176179 />
177- { isEditorEmpty && ! value && (
178- < div className = "editor-placeholder text-muted" > Column Formula </ div >
180+ { isEditorEmpty && ! value && placeholder . length > 0 && (
181+ < div className = "editor-placeholder text-muted" > { placeholder } </ div >
179182 ) }
180183 </ div >
181184 ) ;
182185 }
183186}
187+
188+ export default InputEditor ;
0 commit comments