@etsoo/materialui
Version:
TypeScript Material-UI Implementation
66 lines (65 loc) • 1.63 kB
TypeScript
import { ListType2 } from "@etsoo/shared";
import { ChangeEventHandler } from "react";
import { InputFieldProps } from "./InputField";
import { AutocompleteProps } from "@mui/material/Autocomplete";
/**
* TiplistPro props
*/
export type TiplistProProps<T extends ListType2 = ListType2> = Omit<AutocompleteProps<T, false, false, true>, "open" | "multiple" | "options" | "renderInput"> & {
/**
* Load data callback
*/
loadData: (keyword: string | undefined, id: T["id"] | undefined, maxItems: number) => PromiseLike<T[] | null | undefined>;
/**
* Max items to read and display
*/
maxItems?: number;
/**
* Width
*/
width?: number;
/**
* Label
*/
label?: string;
/**
* Field name
*/
name?: string;
/**
* Id value
*/
idValue?: T["id"] | null;
/**
* Is the id value a string?
* @default false
*/
idIsString?: boolean;
/**
* Input onChange hanlder
*/
inputOnChange?: ChangeEventHandler<HTMLInputElement> | undefined;
/**
* Input props
*/
inputProps?: Omit<InputFieldProps, "onChange">;
/**
* Set 'data-reset'
*/
inputReset?: boolean;
/**
* Value change handler
* @param value New value
*/
onValueChange?: (value: T | null) => void;
/**
* Minimum characters to trigger the change event
*/
minChars?: number;
};
/**
* TiplistPro
* @param props Props
* @returns Component
*/
export declare function TiplistPro<T extends ListType2 = ListType2>(props: TiplistProProps<T>): import("react/jsx-runtime").JSX.Element;