UNPKG

2.21 kBTypeScriptView Raw
1import * as React from 'react';
2import { SearchAttribute } from './SearchInput';
3export interface AdvancedSearchMenuProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange'> {
4 /** Value of the search input */
5 value?: string;
6 /** Ref of the div wrapping the whole search input **/
7 parentRef?: React.RefObject<any>;
8 /** Ref of the input element within the search input**/
9 parentInputRef?: React.RefObject<any>;
10 /** Function which builds an attribute-value map by parsing the value in the search input */
11 getAttrValueMap?: () => {
12 [key: string]: string;
13 };
14 /** A callback for when the search button clicked changes */
15 onSearch?: (value: string, event: React.SyntheticEvent<HTMLButtonElement>, attrValueMap: {
16 [key: string]: string;
17 }) => void;
18 /** A callback for when the user clicks the clear button */
19 onClear?: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
20 /** A callback for when the input value changes */
21 onChange?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;
22 /** Function called to toggle the advanced search menu */
23 onToggleAdvancedMenu?: (e: React.SyntheticEvent<HTMLButtonElement>) => void;
24 /** Flag for toggling the open/close state of the advanced search menu */
25 isSearchMenuOpen?: boolean;
26 /** Label for the buttons which reset the advanced search form and clear the search input */
27 resetButtonLabel?: string;
28 /** Label for the buttons which called the onSearch event handler */
29 submitSearchButtonLabel?: string;
30 /** Array of attribute values used for dynamically generated advanced search */
31 attributes?: string[] | SearchAttribute[];
32 formAdditionalItems?: React.ReactNode;
33 /** Attribute label for strings unassociated with one of the provided listed attributes */
34 hasWordsAttrLabel?: React.ReactNode;
35 /** Delimiter in the query string for pairing attributes with search values.
36 * Required whenever attributes are passed as props */
37 advancedSearchDelimiter?: string;
38}
39export declare const AdvancedSearchMenu: React.FunctionComponent<AdvancedSearchMenuProps>;
40//# sourceMappingURL=AdvancedSearchMenu.d.ts.map
\No newline at end of file