UNPKG

@firecms/ui

Version:

Awesome Firebase/Firestore-based headless open-source CMS

48 lines (47 loc) 1.78 kB
import * as React from "react"; import { ChangeEvent } from "react"; export type MultiSelectValue = string | number | boolean; interface MultiSelectContextProps<T extends MultiSelectValue = string> { fieldValue?: T[]; onItemClick: (v: T) => void; } export declare const MultiSelectContext: React.Context<MultiSelectContextProps<any>>; /** * Props for MultiSelect component */ interface MultiSelectProps<T extends MultiSelectValue = string> { modalPopover?: boolean; className?: string; open?: boolean; name?: string; id?: string; onOpenChange?: (open: boolean) => void; value?: T[]; inputClassName?: string; onChange?: React.EventHandler<ChangeEvent<HTMLSelectElement>>; onValueChange?: (updatedValue: T[]) => void; placeholder?: React.ReactNode; size?: "smallest" | "small" | "medium" | "large"; useChips?: boolean; label?: React.ReactNode | string; disabled?: boolean; error?: boolean; position?: "item-aligned" | "popper"; endAdornment?: React.ReactNode; multiple?: boolean; includeSelectAll?: boolean; includeClear?: boolean; inputRef?: React.RefObject<HTMLButtonElement>; padding?: boolean; invisible?: boolean; children: React.ReactNode; renderValues?: (values: T[]) => React.ReactNode; } export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps<string> & React.RefAttributes<HTMLButtonElement>>; export interface MultiSelectItemProps<T extends MultiSelectValue = string> { value: T; children?: React.ReactNode; className?: string; } export declare function MultiSelectItem<T extends MultiSelectValue = string>({ children, value, className }: MultiSelectItemProps<T>): import("react/jsx-runtime").JSX.Element; export {};