@etsoo/materialui
Version:
TypeScript Material-UI Implementation
52 lines (51 loc) • 1.4 kB
TypeScript
import { DataTypes, IdType } from "@etsoo/shared";
import { ListProps } from "@mui/material/List";
import { ListItemProps } from "@mui/material/ListItem";
import { ListItemTextProps } from "@mui/material/ListItemText";
type ListItemLabel<T extends object> = DataTypes.Keys<T, string | undefined> | ((item: T) => string | undefined);
/**
* List multipler component props
*/
export type ListMultiplerProps<T extends object> = ListProps & {
/**
* List data
*/
data: T[];
/**
* Id field name
*/
idField: DataTypes.Keys<T, IdType>;
/**
* Primary label field name or function
*/
primaryLabel: ListItemLabel<T>;
/**
* Secondary label field name or function
*/
secondaryLabel?: ListItemLabel<T>;
/**
* List item props
*/
listItemProps?: ListItemProps;
/**
* List item text props
*/
listItemTextProps?: Omit<ListItemTextProps, "primary" | "secondary">;
/**
* Input name
*/
name?: string;
/**
* On change event
* @param items The selected items
* @param ids The selected IDs
*/
onCheckItems?: (items: T[], ids: unknown[]) => void;
};
/**
* List multipler component
* @param props Props
* @returns Component
*/
export declare function ListMultipler<T extends object>(props: ListMultiplerProps<T>): import("react/jsx-runtime").JSX.Element;
export {};