@etsoo/materialui
Version:
TypeScript Material-UI Implementation
73 lines (72 loc) • 1.55 kB
TypeScript
import { ButtonProps } from "@mui/material/Button";
import { DataTypes, IdType } from "@etsoo/shared";
type DnDItemType = {
id: IdType;
};
export type ButtonPopupCheckboxProps<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 ids Ids
*/
onValueChange?: (ids: 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 ButtonPopupCheckbox<D extends DnDItemType>(props: ButtonPopupCheckboxProps<D>): import("react/jsx-runtime").JSX.Element;
export {};