UNPKG

2.27 kBTypeScriptView Raw
1import * as React from 'react';
2import { ToggleMenuBaseProps } from '../../helpers/Popper/Popper';
3import { OUIAProps } from '../../helpers';
4export interface ContextSelectorProps extends ToggleMenuBaseProps, OUIAProps {
5 /** content rendered inside the Context Selector */
6 children?: React.ReactNode;
7 /** Classes applied to root element of Context Selector */
8 className?: string;
9 /** Flag to indicate if Context Selector is opened */
10 isOpen?: boolean;
11 /** Function callback called when user clicks toggle button */
12 onToggle?: (event: any, value: boolean) => void;
13 /** Function callback called when user selects item */
14 onSelect?: (event: any, value: React.ReactNode) => void;
15 /** Flag indicating that the context selector should expand to full height */
16 isFullHeight?: boolean;
17 /** Labels the Context Selector for Screen Readers */
18 screenReaderLabel?: string;
19 /** Text that appears in the Context Selector Toggle */
20 toggleText?: string;
21 /** Aria-label for the Context Selector Search Button */
22 searchButtonAriaLabel?: string;
23 /** Value in the Search field */
24 searchInputValue?: string;
25 /** Function callback called when user changes the Search Input */
26 onSearchInputChange?: (value: string) => void;
27 /** Search Input placeholder */
28 searchInputPlaceholder?: string;
29 /** Function callback for when Search Button is clicked */
30 onSearchButtonClick?: (event?: React.SyntheticEvent<HTMLButtonElement>) => void;
31 /** Footer of the context selector */
32 footer?: React.ReactNode;
33 /** Flag to indicate the toggle has no border or background */
34 isPlain?: boolean;
35 /** Flag to indicate if toggle is textual toggle */
36 isText?: boolean;
37 /** Flag to disable focus trap */
38 disableFocusTrap?: boolean;
39}
40export declare class ContextSelector extends React.Component<ContextSelectorProps, {
41 ouiaStateId: string;
42}> {
43 static displayName: string;
44 static defaultProps: ContextSelectorProps;
45 constructor(props: ContextSelectorProps);
46 parentRef: React.RefObject<HTMLDivElement>;
47 popperRef: React.RefObject<HTMLDivElement>;
48 onEnterPressed: (event: any) => void;
49 render(): JSX.Element;
50}
51//# sourceMappingURL=ContextSelector.d.ts.map
\No newline at end of file