Introduce input component specifically for IFQL function selection
parent
3840029ed8
commit
2975c98412
|
@ -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
|
Loading…
Reference in New Issue