import React from 'react';
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
import { PropForm, PropSize, PropView, RenderItemProps } from '../SelectComponents/types';
import { IconProps } from "../../icons/_Icon/Icon";
export declare type DefaultItem = {
label: string;
id: string | number;
groupId?: string | number;
disabled?: boolean;
};
export declare type DefaultGroup = {
label: string;
id: string | number;
};
declare type RenderValueProps- = {
item: ITEM;
handleRemove?: (e: React.SyntheticEvent) => void;
};
export declare const propIconView: readonly ["default", "search", "double"];
export declare type PropIconView = typeof propIconView[number];
export declare const defaultPropIconView: "default";
export declare type PropGetItemLabel
- = (item: ITEM) => string;
export declare type PropGetItemKey
- = (item: ITEM) => string | number;
export declare type PropGetItemGroupKey
- = (item: ITEM) => string | number | undefined;
export declare type PropGetItemDisabled
- = (item: ITEM) => boolean | undefined;
export declare type PropGetGroupKey = (group: GROUP) => string | number;
export declare type PropGetGroupLabel = (group: GROUP) => string;
declare type PropSearchFunction
- = (item: ITEM, searchValue: string) => boolean;
declare type PropOnChange
- = (props: {
value: (MULTIPLE extends true ? ITEM[] : ITEM) | null;
e: React.SyntheticEvent;
}) => void;
declare type PropValue
- = (MULTIPLE extends true ? ITEM[] : ITEM) | null | undefined;
export declare type PropRenderItem
- = (props: RenderItemProps
- ) => React.ReactElement | null;
export declare type PropRenderValue
- = (props: RenderValueProps
- ) => React.ReactElement | null;
export declare type ComboboxProps
- = PropsWithHTMLAttributesAndRef<{
items: ITEM[];
onChange: PropOnChange
- ;
disabled?: boolean;
form?: PropForm;
size?: Exclude;
view?: PropView;
placeholder?: string;
ariaLabel?: string;
dropdownClassName?: string;
dropdownRef?: React.RefObject;
name?: string;
renderItem?: PropRenderItem
- ;
renderValue?: PropRenderValue
- ;
onFocus?: React.FocusEventHandler;
onBlur?: React.FocusEventHandler;
onCreate?: (props: {
e: React.SyntheticEvent;
label: string;
}) => void;
inputRef?: React.RefObject;
labelForNotFound?: string;
labelForCreate?: string;
searchFunction?: PropSearchFunction
- ;
multiple?: MULTIPLE;
value?: PropValue
- ;
groups?: GROUP[];
getItemLabel?: PropGetItemLabel
- ;
getItemKey?: PropGetItemKey
- ;
getItemGroupKey?: PropGetItemGroupKey
- ;
getItemDisabled?: PropGetItemDisabled
- ;
getGroupLabel?: PropGetGroupLabel;
getGroupKey?: PropGetGroupKey;
iconRight?: React.ReactNode | React.FC;
iconUp?: boolean;
}, HTMLDivElement> & (ITEM extends {
label: DefaultItem['label'];
} ? {} : {
getItemLabel: PropGetItemLabel
- ;
}) & (ITEM extends {
id: DefaultItem['id'];
} ? {} : {
getItemKey: PropGetItemKey
- ;
}) & (GROUP extends {
label: DefaultGroup['label'];
} ? {} : {
getGroupLabel: PropGetGroupLabel;
}) & (GROUP extends {
id: DefaultGroup['id'];
} ? {} : {
getGroupKey: PropGetGroupKey;
});
export declare type ComboboxComponent =
- (props: ComboboxProps
- ) => React.ReactElement | null;
export declare const defaultGetItemKey: PropGetItemKey;
export declare const defaultGetItemLabel: PropGetItemLabel;
export declare const defaultGetItemGroupKey: PropGetItemGroupKey;
export declare const defaultGetItemDisabled: PropGetItemDisabled;
export declare const defaultGetGroupKey: PropGetGroupKey;
export declare const defaultGetGroupLabel: PropGetGroupLabel;
export declare const isMultipleParams:
- (params: ComboboxProps
- ) => params is ComboboxProps
- ;
export declare const isNotMultipleParams:
- (params: ComboboxProps
- ) => params is ComboboxProps
- ;
export declare function withDefaultGetters
- (props: ComboboxProps
- ): {
items: ITEM[];
onChange: PropOnChange
- ;
disabled?: boolean | undefined;
form?: "default" | "round" | "brick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "defaultBrick" | "brickDefault" | "brickClear" | "clearBrick" | "clearClear" | undefined;
size?: "s" | "m" | "l" | undefined;
view?: "default" | "clear" | undefined;
placeholder?: string | undefined;
ariaLabel?: string | undefined;
dropdownClassName?: string | undefined;
dropdownRef?: React.RefObject | undefined;
name?: string | undefined;
renderItem?: PropRenderItem
- | undefined;
renderValue?: PropRenderValue
- | undefined;
onFocus?: React.FocusEventHandler | undefined;
onBlur?: React.FocusEventHandler | undefined;
onCreate?: ((props: {
e: React.SyntheticEvent;
label: string;
}) => void) | undefined;
inputRef?: React.RefObject | undefined;
labelForNotFound?: string | undefined;
labelForCreate?: string | undefined;
searchFunction?: PropSearchFunction
- | undefined;
multiple?: MULTIPLE | undefined;
value?: PropValue
- ;
groups?: GROUP[] | undefined;
getItemLabel?: PropGetItemLabel
- | undefined;
getItemKey?: PropGetItemKey
- | undefined;
getItemGroupKey?: PropGetItemGroupKey
- | undefined;
getItemDisabled?: PropGetItemDisabled
- | undefined;
getGroupLabel?: PropGetGroupLabel | undefined;
getGroupKey?: PropGetGroupKey | undefined;
iconRight?: React.ReactNode | React.FC;
iconUp?: boolean | undefined;
} & Omit, "css" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "disabled" | "view" | "size" | "form" | "name" | "value" | "multiple" | "inputRef" | "items" | "ariaLabel" | "dropdownClassName" | "dropdownRef" | "renderItem" | "renderValue" | "groups" | "getItemLabel" | "getItemKey" | "getItemGroupKey" | "getItemDisabled" | "getGroupLabel" | "getGroupKey" | "iconRight" | "searchFunction" | "onCreate" | "labelForCreate" | "labelForNotFound" | "iconUp"> & React.RefAttributes & (ITEM extends {
label: string;
} ? {} : {
getItemLabel: PropGetItemLabel
- ;
}) & (ITEM extends {
id: string | number;
} ? {} : {
getItemKey: PropGetItemKey
- ;
}) & (GROUP extends {
label: string;
} ? {} : {
getGroupLabel: PropGetGroupLabel;
}) & (GROUP extends {
id: string | number;
} ? {} : {
getGroupKey: PropGetGroupKey;
}) & {
getItemLabel: PropGetItemLabel | PropGetItemLabel
- ;
getItemKey: PropGetItemKey | PropGetItemKey
- ;
getItemGroupKey: PropGetItemGroupKey | PropGetItemGroupKey
- ;
getItemDisabled: PropGetItemDisabled | PropGetItemDisabled
- ;
getGroupLabel: PropGetGroupLabel | PropGetGroupLabel;
getGroupKey: PropGetGroupKey | PropGetGroupKey;
};
export {};