Introduce input component specifically for IFQL function selection

pull/3142/head
Alex P 2018-04-05 16:02:45 -07:00
parent 3840029ed8
commit 2975c98412
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
import React, {SFC, ChangeEvent, KeyboardEvent} from 'react'
type OnFilterChangeHandler = (e: ChangeEvent<HTMLInputElement>) => void
type OnFilterKeyPress = (e: KeyboardEvent<HTMLInputElement>) => void
interface Props {
searchTerm: string
onFilterChange: OnFilterChangeHandler
onFilterKeyPress: OnFilterKeyPress
}
const FuncSelectorInput: SFC<Props> = ({
searchTerm,
onFilterChange,
onFilterKeyPress,
}) => (
<input
className="form-control input-sm ifql-func--input"
type="text"
autoFocus={true}
placeholder="Add Function..."
spellCheck={false}
onChange={onFilterChange}
onKeyDown={onFilterKeyPress}
value={searchTerm}
/>
)
export default FuncSelectorInput