import { ChipProps } from "../chip"; import { DropdownProps, SelectableItem } from "../dropdown"; import { CheckBoxProps } from "../primitives"; /** Single multiselect item that user can select */ export type MultiselectItem = SelectableItem & { /** Is item selected */ selected: boolean; }; /** Props type of `Multiselect` */ export type MultiselectProps = Omit & { /** Items which can be selected */ items: Array; /** * Caption for label when some items are selected * @example selectionCaption: "selected: {0}" * @description Supports only 1 string parameter for number of selected items. Default is `{0} items selected` */ selectionCaption?: string; /** Customization for checkbox */ checkboxConfig?: Pick; /** Configuration for result display mode */ resultDisplayConfig?: MultiselectResultDisplayConfig; /** * Handler of changing select state of item * @description `item.selected` will be set by component * @param item Item that triggered event * @param selected New select flag value */ onChange: (item: MultiselectItem, selected: boolean) => void; /** * Handler of clear selection event. * When no handler specified - clear selection cannot be performed */ onClear?: () => void; }; /** Configuration for result display mode when using chips */ export type MultiselectResultAsChipDisplayConfig = Omit & { /** Position of chips label */ position: "label" | "belowLabel"; /** Custom class name for the container of chips */ containerClassName?: string; }; /** * Display mode for selected items in `Multiselect` * - `"default"`: shows selected items as a summary text in the label (e.g. "3 items selected") * - `MultiselectResultAsChipDisplayConfig`: shows selected items as chips below the label, with the provided configuration for chip appearance */ export type MultiselectResultDisplayConfig = "default" | MultiselectResultAsChipDisplayConfig; //# sourceMappingURL=types.d.ts.map