import type * as React from 'react'; import type { UseOpenProps } from "../../hooks/useSelect/types.js"; import type { PopupPlacement } from "../Popup/index.js"; import type { SelectPopupProps } from "../Select/components/SelectPopup/types.js"; import type { TreeListContainerProps, TreeListProps, TreeListRenderContainer, TreeListRenderItem } from "../TreeList/types.js"; import type { ListItemId, ListItemSize, UseListResult } from "../useList/index.js"; import type { UseListParsedStateProps } from "../useList/hooks/useListParsedState.js"; export type TreeSelectRenderControlProps = { list: UseListResult; open: boolean; disabled?: boolean; placeholder?: string; toggleOpen(): void; clearValue(): void; ref: React.Ref; size: ListItemSize; value: ListItemId[]; id: string; activeItemId?: ListItemId; title?: string; hasClear?: boolean; /** * Determines content of the error message */ errorMessage?: React.ReactNode; /** * Determines whether the error message will be placed under the input field as text or in the tooltip */ errorPlacement?: 'outside' | 'inside'; /** * Describes the validation state */ validationState?: 'invalid'; isErrorVisible?: boolean; }; export type TreeSelectRenderItem = TreeListRenderItem; export type TreeSelectRenderContainerProps = TreeListContainerProps; export type TreeSelectRenderContainer = TreeListRenderContainer; interface TreeSelectBehavioralProps extends UseListParsedStateProps { withExpandedState?: boolean; multiple?: boolean; } export interface TreeSelectProps extends Omit, 'list' | 'renderContainer' | 'multiple'>, Pick, 'title' | 'placeholder' | 'disabled' | 'hasClear' | 'errorPlacement' | 'validationState' | 'errorMessage'>, UseOpenProps, TreeSelectBehavioralProps { value?: ListItemId[]; defaultValue?: ListItemId[] | undefined; popupClassName?: string; popupWidth?: SelectPopupProps['width']; placement?: PopupPlacement; width?: 'auto' | 'max' | number; containerClassName?: string; popupDisablePortal?: boolean; /** * Use slots if you don't need access to internal TreeListState. * In other situations use `renderContainer` method */ slotBeforeListBody?: React.ReactNode; /** * Use slots if you don't need access to internal TreeListState. * In other situations use `renderContainer` method */ slotAfterListBody?: React.ReactNode; onUpdate?(value: ListItemId[]): void; /** * Ability to override custom toggler button */ renderControl?(props: TreeSelectRenderControlProps): React.JSX.Element; renderContainer?: TreeSelectRenderContainer; onFocus?: (e: React.FocusEvent) => void; onBlur?: (e: React.FocusEvent) => void; } export {};