UNPKG

@activecollab/components

Version:

ActiveCollab Components

47 lines 1.63 kB
import { FC, ReactElement, PropsWithChildren } from "react"; import { Placement } from "@popperjs/core"; import { IOptionGroupProps, IOptionItemProps } from "../Select"; export type DataType = { id: number | string; title: string; searchPlaceholder?: string; disableInternalSort?: boolean; submenu: Array<IOptionGroupProps | IOptionItemProps>; isSingleSelect?: boolean; defaultValue?: string; emptyValue?: string; emptyAction?: (e: string | undefined) => void; }; export type SelectedType = { [key: number | string]: Array<string>; }; export interface FilterProps { /** Data rendered in submenus */ data: Array<DataType>; /** Selected data inside submenus */ selected?: SelectedType; /** Main filter label */ label: string; /** Filter width */ width?: number; /** Text displayed for the tooltip of clear all button */ clearAllText: string; /** Handler for changes on the filter */ onChange: (selected: SelectedType) => void; /** Label for reset button inside submenu */ resetLabel?: string; /** Text to show when search results are empty */ noResultText: string; /** Text to show when there are no submenus to display */ emptyFilterText?: string; /** Position of the dropped menu. */ position?: Placement; /** Icon of the trigger element. */ icon?: ReactElement; /** Disabled state of the trigger. */ disabled?: boolean; /** Applies passed classes for label text */ className?: string; } export declare const Filter: FC<PropsWithChildren<FilterProps>>; //# sourceMappingURL=Filter.d.ts.map