UNPKG

2.2 kBTypeScriptView Raw
1import * as React from 'react';
2import { ToolbarItemProps } from './ToolbarItem';
3import { ToolbarContext } from './ToolbarUtils';
4import { PickOptional } from '../../helpers/typeUtils';
5export interface ToolbarChipGroup {
6 /** A unique key to identify this chip group category */
7 key: string;
8 /** The category name to display for the chip group */
9 name: string;
10}
11export interface ToolbarChip {
12 /** A unique key to identify this chip */
13 key: string;
14 /** The ReactNode to display in the chip */
15 node: React.ReactNode;
16}
17export interface ToolbarFilterProps extends ToolbarItemProps {
18 /** An array of strings to be displayed as chips in the expandable content */
19 chips?: (string | ToolbarChip)[];
20 /** Callback passed by consumer used to close the entire chip group */
21 deleteChipGroup?: (category: string | ToolbarChipGroup) => void;
22 /** Callback passed by consumer used to delete a chip from the chips[] */
23 deleteChip?: (category: string | ToolbarChipGroup, chip: ToolbarChip | string) => void;
24 /** Customizable "Show Less" text string for the chip group */
25 chipGroupExpandedText?: string;
26 /** Customizeable template string for the chip group. Use variable "${remaining}" for the overflow chip count. */
27 chipGroupCollapsedText?: string;
28 /** Content to be rendered inside the data toolbar item associated with the chip group */
29 children: React.ReactNode;
30 /** Unique category name to be used as a label for the chip group */
31 categoryName: string | ToolbarChipGroup;
32 /** Flag to show the toolbar item */
33 showToolbarItem?: boolean;
34}
35interface ToolbarFilterState {
36 isMounted: boolean;
37}
38export declare class ToolbarFilter extends React.Component<ToolbarFilterProps, ToolbarFilterState> {
39 static displayName: string;
40 static contextType: React.Context<import("./ToolbarUtils").ToolbarContextProps>;
41 context: React.ContextType<typeof ToolbarContext>;
42 static defaultProps: PickOptional<ToolbarFilterProps>;
43 constructor(props: ToolbarFilterProps);
44 componentDidMount(): void;
45 componentDidUpdate(): void;
46 render(): JSX.Element;
47}
48export {};
49//# sourceMappingURL=ToolbarFilter.d.ts.map
\No newline at end of file