PromucFlow_constructor/app/client/src/components/designSystems/appsmith/SearchComponent.tsx

45 lines
932 B
TypeScript
Raw Normal View History

import React from "react";
import styled from "styled-components";
import { InputGroup } from "@blueprintjs/core";
interface SearchProps {
onSearch: (value: any) => void;
placeholder: string;
value: string;
}
const SearchInputWrapper = styled(InputGroup)`
&&& input {
box-shadow: none;
}
&&& svg {
opacity: 0.6;
}
margin: 14px 20px;
width: 250px;
`;
const SearchComponent = (props: SearchProps) => {
const [value, setValue] = React.useState(props.value);
const handleSearch = (
event:
| React.ChangeEvent<HTMLInputElement>
| React.ChangeEvent<HTMLTextAreaElement>,
) => {
const search = event.target.value;
setValue(search);
props.onSearch(search);
};
return (
<SearchInputWrapper
leftIcon="search"
Fix-Open image in new tab on clicking it in table widget. (#119) * Added Button component in Table widget for actions * Action button state loading added for Table widget * Action button font-weight made as normal * Created header for common functionalities in Table Widget * Client side searching added in Table Widget. Action created for server side searching also. * Columns visibility feature initial commit * Column visibility list added in Table Widget * Changed pagination designs in accordance with new layout. This enable user to jump page as well. * Using colors values from constants * Table widget pagination, numeric input page number clamped between 1 and total pages * Adding tool tip to truncated values in table widget. Added AutoToolTipComponent that adds tooltip when text is truncated. * Table data download changes. Added downlaod icon and button to table widget. * Table data download changes * Table button loading state fixed. Table code refactored, rendering from props instead of state in ReactTableComponent * Table widget action button alignment fixed * Handled actions column changes * added proper keys to useMemo for react table widget * Download table data as CSV implemented * table data download, unused code removed * Code refactors and added dependency map with meta props and table data for computing columns * Table UI breakages on scroll and empty cells fixed * Handled empty rows in table widget * Fixed last row cut issue * Code review changes * Code review changes * Added table widget component heights as enum * code review changes * Search component in Table widget updated with support for clearing data, renamed properties * Opening image in new tab on clicking in table widget * Fixed table craching due to empty data filtering * Empty extra space on loading removed in table widget * Removed stopping of event propagation on table widget action button click * Table header UI overflow fixed * Clearing selected row on searching data in table widget * fix for cypress test Co-authored-by: Arpit Mohan <me@arpitmohan.com>
2020-07-24 10:32:31 +00:00
type="search"
onChange={handleSearch}
placeholder={props.placeholder}
value={value}
/>
);
};
export default SearchComponent;