import React from 'react';
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
import { PropForm, PropSize, PropView, RenderItemProps } from '../SelectComponents/types';
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 PropValue- = ITEM | null | undefined;
declare type RenderValueProps
- = {
item: ITEM;
};
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;
export declare type PropRenderItem
- = (props: RenderItemProps
- ) => React.ReactElement | null;
export declare type PropRenderValue
- = (props: RenderValueProps
- ) => React.ReactElement | null;
export declare type SelectProps
- = PropsWithHTMLAttributesAndRef<{
items: ITEM[];
onChange: (props: {
value: ITEM | null;
e: React.SyntheticEvent;
}) => void;
disabled?: boolean;
form?: PropForm;
size?: PropSize;
view?: PropView;
focused?: boolean;
multiple?: boolean;
placeholder?: string;
ariaLabel?: string;
dropdownClassName?: string;
dropdownRef?: React.RefObject;
name?: string;
value?: PropValue
- ;
renderItem?: PropRenderItem
- ;
renderValue?: PropRenderValue
- ;
onFocus?: React.FocusEventHandler;
onBlur?: React.FocusEventHandler;
inputRef?: React.RefObject;
groups?: GROUP[];
getItemLabel?: PropGetItemLabel
- ;
getItemKey?: PropGetItemKey
- ;
getItemGroupKey?: PropGetItemGroupKey
- ;
getItemDisabled?: PropGetItemDisabled
- ;
getGroupLabel?: PropGetGroupLabel;
getGroupKey?: PropGetGroupKey;
}, 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 SelectComponent =
- (props: SelectProps
- ) => 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 function withDefaultGetters
- (props: SelectProps
- ): {
items: ITEM[];
onChange: (props: {
value: ITEM | null;
e: React.SyntheticEvent;
}) => void;
disabled?: boolean | undefined;
form?: "default" | "round" | "brick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "defaultBrick" | "brickDefault" | "brickClear" | "clearBrick" | "clearClear" | undefined;
size?: "xs" | "s" | "m" | "l" | undefined;
view?: "default" | "clear" | undefined;
focused?: boolean | undefined;
multiple?: boolean | undefined;
placeholder?: string | undefined;
ariaLabel?: string | undefined;
dropdownClassName?: string | undefined;
dropdownRef?: React.RefObject | undefined;
name?: string | undefined;
value?: PropValue
- ;
renderItem?: PropRenderItem
- | undefined;
renderValue?: PropRenderValue
- | undefined;
onFocus?: React.FocusEventHandler | undefined;
onBlur?: React.FocusEventHandler | undefined;
inputRef?: React.RefObject | undefined;
groups?: GROUP[] | undefined;
getItemLabel?: PropGetItemLabel
- | undefined;
getItemKey?: PropGetItemKey
- | undefined;
getItemGroupKey?: PropGetItemGroupKey
- | undefined;
getItemDisabled?: PropGetItemDisabled
- | undefined;
getGroupLabel?: PropGetGroupLabel | undefined;
getGroupKey?: PropGetGroupKey | undefined;
} & Omit, "css" | "placeholder" | "onFocus" | "onBlur" | "onChange" | "disabled" | "view" | "size" | "form" | "name" | "value" | "multiple" | "inputRef" | "items" | "focused" | "ariaLabel" | "dropdownClassName" | "dropdownRef" | "renderItem" | "renderValue" | "groups" | "getItemLabel" | "getItemKey" | "getItemGroupKey" | "getItemDisabled" | "getGroupLabel" | "getGroupKey"> & 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 {};