import React, { FC, ReactNode } from 'react'; import { PopoverProps } from '../Popover'; import { OptionListProps } from '../OptionList'; import { AnvilSelectFooterProps, AnvilSelectHeaderProps, AnvilSelectMultipleProps, AnvilSelectOptionsProps, AnvilSelectSearchProps, AnvilSelectTreeProps, SelectDrillInProps, TriggerProps } from './components'; import { FocusContext } from './utils'; import { PopperProps } from '../../internal'; export declare type PrimitiveValueType = string | number | bigint | symbol | null | undefined; export interface AnvilSelectPropsStrict extends Pick { children?(props: OptionListProps): ReactNode; /** Adds one or more classnames for an element */ className?: string; /** Closes the Select on outside click */ closeOnClickOutside?: boolean; /** Indicates whether the Select is disabled or not. */ disabled?: boolean; /** The secondary */ drillIn?: SelectDrillInProps; /** Message when a Select has no available options */ emptyResult?: React.ReactNode; /** Visual error state for the trigger */ error?: boolean; /** Footer for the Select */ footer?: AnvilSelectFooterProps | PopoverProps['footer']; /** Header for the Select */ header?: AnvilSelectHeaderProps; /** Adds a Spinner visualization to the Select */ loading?: boolean; /** Enables multiple selections */ multiple?: AnvilSelectMultipleProps | boolean; /** Called when the user changes the value */ onChange?: (data: TValue, checked: boolean, childObject: AnvilSelectOptionsProps | AnvilSelectOptionsProps[], selfObject: AnvilSelectOptionsProps) => void; /** A handler that is called on every open and close action */ onOpenChange?(open: boolean, value?: AnvilSelectOptionsProps[]): void; /** Choices for the Select */ options?: AnvilSelectOptionsProps[]; /** Define the width property of the popover part of the Select */ popoverWidth?: PopoverProps['width']; /** Search properties for the Select */ search?: AnvilSelectSearchProps; /** The element that toggles the Select */ trigger?: TriggerProps | PopoverProps['trigger']; /** The options currently selected in the Select */ value?: TValue; /** Tree view option. Requires controlled state. */ tree?: AnvilSelectTreeProps; /** Passing indeterminate data through to the underlying OptionList */ indeterminateValue?: OptionListProps['indeterminateValue']; /** Props to be passed to the portaled div */ portalDataAttributes?: PopperProps['portalDataAttributes']; } export interface AnvilSelectProps extends AnvilSelectPropsStrict { /** Unstrict Props */ [propName: string]: any; } export interface AnvilSelectState { checkboxState: AnvilSelectOptionsProps[]; radioState: AnvilSelectOptionsProps; openState: boolean; controlledMode: boolean; } export declare const AnvilSelectSB: FC; export declare class AnvilSelectWrapped extends React.Component, AnvilSelectState> { static defaultProps: Partial>; static contextType: React.Context; context: React.ContextType; constructor(props: AnvilSelectProps); componentDidMount(): void; componentDidUpdate(prevProps: AnvilSelectProps): void; static getDerivedStateFromProps(props: AnvilSelectProps, state: AnvilSelectState): Pick | { checkboxState: AnvilSelectOptionsProps[]; radioState: AnvilSelectOptionsProps; controlledMode: boolean; }; static getCheckboxOptionByValue: (value: any, options: AnvilSelectPropsStrict['options']) => AnvilSelectOptionsProps[]; static getRadioOptionByValue: (value: any, options: AnvilSelectPropsStrict['options']) => AnvilSelectOptionsProps; static getNewCheckboxAndRadioStateByValue: (newValue: any, options: AnvilSelectPropsStrict['options']) => Pick; handleKeyDown: (e: React.KeyboardEvent, option: AnvilSelectOptionsProps) => void; focus: () => void; blur: () => void; toggleOpenState: (clickOutside?: boolean) => void; changeCheckboxState: (value: AnvilSelectOptionsProps[], checked: boolean, childObject: AnvilSelectOptionsProps | AnvilSelectOptionsProps[], selfObject: AnvilSelectOptionsProps) => void; onCheckboxChange: (value: any, checked: boolean, childObject: AnvilSelectOptionsProps | AnvilSelectOptionsProps[], selfObject: AnvilSelectOptionsProps) => void; changeRadioState: (value?: AnvilSelectOptionsProps) => void; getMultipleValues: () => { groupSelectAll: boolean; onTagClose: boolean | ((e: React.SyntheticEvent) => void); selectAll: boolean; }; getEmptyResult: () => JSX.Element; checkDrillIn: () => boolean; getCheckboxStateFilteredByGroupValues: (flattenGroupValues: AnvilSelectOptionsProps[]) => AnvilSelectOptionsProps[]; checkIfDisabledItemIsSelected: (option: AnvilSelectOptionsProps) => boolean; getFlattenValuesFromOptions: (options?: AnvilSelectOptionsProps[], skipDisabled?: boolean) => AnvilSelectOptionsProps[]; getChildOptionsFromGroupOptions: (groupOptions?: AnvilSelectOptionsProps[]) => import("../OptionList").SingleOptionProps[]; handleOnSelectAll: () => void; handleOnSelectGroup: (groupOptions: AnvilSelectOptionsProps[]) => void; handleOnClear: () => void; handleOnClearGroup: (groupOptions: AnvilSelectOptionsProps[]) => void; handleOnChange: (value: TValue, checked: any, childObject: AnvilSelectOptionsProps, selfObject: AnvilSelectOptionsProps) => void; handleOnTagClose: (value: AnvilSelectOptionsProps) => void; handleClickOutside: () => void; handleOnClick: (e: any) => void; getOnChange: (value: any, checked: boolean, childObject: AnvilSelectOptionsProps, selfObject: AnvilSelectOptionsProps) => void; getFlatGroup: () => boolean | { onGroupSelectAll: (groupOptions: AnvilSelectOptionsProps[]) => void; onGroupSelectNone: (groupOptions: AnvilSelectOptionsProps[]) => void; }; getOnExpand: () => (value: any) => void; getCollapseValue: () => any[]; optionsFromOptionList: AnvilSelectOptionsProps[] | null; getOptionsForFocusContext: () => AnvilSelectOptionsProps[]; setOptionsFromOptionList: (optionData: AnvilSelectOptionsProps[]) => void; getOptionList: () => JSX.Element; getHeader: () => any; getFooter: () => any; getTrigger: () => JSX.Element; getLoading: () => JSX.Element; getRestOfProps: () => { readonly [x: string]: any; indeterminateValue?: any[]; portalDataAttributes?: import("../../internal").DataAttributeProps; portal?: boolean; }; render(): React.ReactNode; } export declare const AnvilSelect: React.ForwardRefExoticComponent, "ref"> & React.RefAttributes>;