items: T[];
itemsAvailable: number;
columns: DataColumns<T>;
+ searchLabel?: string;
searchValue: string;
rowsPerPage: number;
rowsPerPageOptions: number[];
render() {
const {
columns, onContextMenu, onFiltersChange, onSortToggle, working, extractKey,
- rowsPerPage, rowsPerPageOptions, onColumnToggle, searchValue, onSearch,
+ rowsPerPage, rowsPerPageOptions, onColumnToggle, searchLabel, searchValue, onSearch,
items, itemsAvailable, onRowClick, onRowDoubleClick, classes,
dataTableDefaultView, hideColumnSelector, actions, paperProps, hideSearchInput,
paperKey, fetchMode, currentItemUuid, title
<Grid container justify="space-between" wrap="nowrap" alignItems="center">
<div className={classes.searchBox}>
{!hideSearchInput && <SearchInput
+ label={searchLabel}
value={searchValue}
onSearch={onSearch} />}
</div>
interface SearchInputDataProps {
value: string;
+ label?: string;
}
interface SearchInputActionProps {
interface SearchInputState {
value: string;
+ label: string;
}
export const DEFAULT_SEARCH_DEBOUNCE = 1000;
export const SearchInput = withStyles(styles)(
class extends React.Component<SearchInputProps> {
state: SearchInputState = {
- value: ""
+ value: "",
+ label: ""
};
timeout: number;
render() {
return <form onSubmit={this.handleSubmit}>
<FormControl>
- <InputLabel>Search files</InputLabel>
+ <InputLabel>{this.state.label}</InputLabel>
<Input
type="text"
value={this.state.value}
onChange={this.handleChange}
endAdornment={
<InputAdornment position="end">
- <Tooltip title='Search files'>
+ <Tooltip title='Search'>
<IconButton
onClick={this.handleSubmit}>
<SearchIcon />
}
componentDidMount() {
- this.setState({ value: this.props.value });
+ this.setState({
+ value: this.props.value,
+ label: this.props.label || 'Search'
+ });
}
componentWillReceiveProps(nextProps: SearchInputProps) {