@etsoo/materialui
Version:
TypeScript Material-UI Implementation
59 lines (58 loc) • 1.46 kB
TypeScript
import { ListType2 } from "@etsoo/shared";
import React from "react";
import { InputFieldProps } from "./InputField";
import { StackProps } from "@mui/material/Stack";
import { ListItemButtonProps } from "@mui/material/ListItemButton";
import { ListItemProps } from "@mui/material/ListItem";
/**
* Quick list props
*/
export type QuickListProps<T extends ListType2 = ListType2> = StackProps & {
/**
* Button props
*/
buttonProps?: ListItemButtonProps;
/**
* Label
*/
label?: string;
/**
* No matches label
*/
noMatchesLabel?: string;
/**
* Input field props
*/
inputProps?: Omit<InputFieldProps, "onChangeDelay">;
/**
* Get item label
* @param item Current item
* @returns Item label
*/
itemLabel?: (item: T) => string;
/**
* Item renderer
* @param item Current item
* @returns UI
*/
itemRenderer?: (item: T) => React.ReactNode;
/**
* List item props
*/
itemProps?: ListItemProps;
/**
* Load data callback
*/
loadData: (keyword: string | undefined) => PromiseLike<T[] | undefined>;
/**
* On item click
* @param item Clicked item
*/
onItemClick?: (item: T) => void;
};
/**
* Quick list
* @param props Props
* @returns Component
*/
export declare function QuickList<T extends ListType2 = ListType2>(props: QuickListProps<T>): import("react/jsx-runtime").JSX.Element;