UNPKG

@etsoo/materialui

Version:

TypeScript Material-UI Implementation

73 lines (72 loc) 1.53 kB
import { ButtonProps } from "@mui/material/Button"; import { DataTypes, IdType } from "@etsoo/shared"; type DnDItemType = { id: IdType; }; export type ButtonPopupRadioProps<D extends DnDItemType> = Omit<ButtonProps, "chidren" | "onClick" | "value"> & { /** * Add items splitter */ addSplitter?: RegExp; /** * Input field name */ inputName?: string; /** * Label */ label?: string; /** * Label in the end */ labelEnd?: string; /** * Label field in items */ labelField: DataTypes.Keys<D>; /** * Label formatter * @param item Item to be formatted */ labelFormatter?: (item: D) => string; /** * Labels */ labels?: { dragIndicator?: string; add?: string; more?: string; }; /** * Load data */ loadData: D[] | (() => Promise<D[]>); /** * On add handler * @param ids Ids */ onAdd?: (ids: string[]) => Promise<false | D[]>; /** * On value change handler * @param id Id */ onValueChange?: (id: D["id"]) => void; /** * Popup title */ popupTitle?: string; /** * Popup message */ popupMessage?: string; /** * The field is required or not */ required?: boolean; /** * Value */ value?: D["id"]; }; export declare function ButtonPopupRadio<D extends DnDItemType>(props: ButtonPopupRadioProps<D>): import("react/jsx-runtime").JSX.Element; export {};