@ozen-ui/kit
Version:
React component library
79 lines (78 loc) • 4.47 kB
TypeScript
import type { AutocompleteDefaultOption, AutocompletePropGetOptionDisabled, AutocompletePropGetOptionKey, AutocompletePropGetOptionLabel, AutocompleteProps } from './types';
export declare const defaultGetOptionKey: AutocompletePropGetOptionKey<AutocompleteDefaultOption>;
export declare const defaultGetOptionLabel: AutocompletePropGetOptionLabel<AutocompleteDefaultOption>;
export declare const defaultGetOptionDisabled: AutocompletePropGetOptionDisabled<AutocompleteDefaultOption>;
export declare function withDefaultGetters<OPTION = AutocompleteDefaultOption, MULTIPLE extends boolean = false>(props: AutocompleteProps<OPTION, MULTIPLE>): {
multiple?: MULTIPLE | undefined;
limitTags?: number | "responsive";
renderTag?: import("./types").AutocompletePropRenderTag;
renderMoreTag?: import("./types").AutocompletePropRenderMoreTag<OPTION> | undefined;
options: OPTION[];
size?: import("./types").AutocompletePropSize;
value?: import("./types").AutocompletePropValue<OPTION, MULTIPLE>;
defaultValue?: import("./types").AutocompletePropValue<OPTION, MULTIPLE>;
open?: boolean;
defaultOpen?: boolean;
onChange?: import("./types").AutocompleteOnChange<OPTION, MULTIPLE> | undefined;
renderRightPosition?: import("./types").AutocompleteRenderRightPosition;
inputValue?: string;
onInputChange?: import("./types").AutocompleteOnInputChange;
renderInput?: import("./types").AutocompletePropRenderInput;
renderOption?: import("./types").AutocompletePropRenderOption<OPTION> | undefined;
getOptionLabel?: AutocompletePropGetOptionLabel<OPTION> | undefined;
getOptionKey?: AutocompletePropGetOptionKey<OPTION> | undefined;
getOptionDisabled?: AutocompletePropGetOptionDisabled<OPTION> | undefined;
disableCloseOnSelect?: boolean;
allowCustomValue?: boolean;
loading?: boolean;
noOptionsText?: import("react").ReactNode;
clearText?: string;
openText?: string;
closeText?: string;
loadingText?: import("react").ReactNode;
onClose?(): void;
onOpen?(): void;
disableClearButton?: boolean;
searchFunction?: import("./types").AutocompletePropSearchFunction<OPTION> | undefined;
disableShowEmptyOptionsList?: boolean;
disableShowChevron?: boolean;
popoverProps?: import("./components").AutocompleteDropdownProps["popoverProps"];
listProps?: import("./components").AutocompleteDropdownProps["listProps"];
ref?: import("react").Ref<HTMLDivElement>;
} & {
error?: boolean | undefined;
label?: string | undefined;
style?: import("react").CSSProperties | undefined;
autoFocus?: boolean | undefined;
className?: string | undefined;
onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
disabled?: boolean | undefined;
placeholder?: string | undefined;
required?: boolean | undefined;
fullWidth?: boolean | undefined;
hint?: string | null | undefined;
disableStroke?: boolean | undefined;
renderLeft?: import("../FieldIcon").FieldIconProps["icon"];
renderRight?: import("../FieldIcon").FieldIconProps["icon"];
inputProps?: import("../FieldInput").FieldInputProps | undefined;
bodyProps?: import("react").ComponentPropsWithRef<"label"> | undefined;
hintProps?: Omit<import("../FieldHint").FieldHintProps, "children"> | undefined;
} & (OPTION extends {
label: AutocompleteDefaultOption["label"];
} ? object : {
getOptionLabel?: AutocompletePropGetOptionLabel<OPTION> | undefined;
}) & (OPTION extends {
id: AutocompleteDefaultOption["id"];
} ? object : {
getOptionKey?: AutocompletePropGetOptionKey<OPTION> | undefined;
}) & (OPTION extends {
disabled: AutocompleteDefaultOption["disabled"];
} ? object : {
getOptionDisabled?: AutocompletePropGetOptionDisabled<OPTION> | undefined;
}) & {
getOptionLabel: AutocompletePropGetOptionLabel<AutocompleteDefaultOption> | AutocompletePropGetOptionLabel<OPTION>;
getOptionKey: AutocompletePropGetOptionKey<AutocompleteDefaultOption> | AutocompletePropGetOptionKey<OPTION>;
getOptionDisabled: AutocompletePropGetOptionDisabled<AutocompleteDefaultOption> | AutocompletePropGetOptionDisabled<OPTION>;
};
export declare const isMultipleParams: <OPTION>(params: AutocompleteProps<OPTION, boolean>) => params is AutocompleteProps<OPTION, true>;
export declare const isNotMultipleParams: <OPTION>(params: AutocompleteProps<OPTION, boolean>) => params is AutocompleteProps<OPTION, false>;