/* eslint-disable jsdoc/require-jsdoc */ import * as React from 'react'; import { classNames } from '@vkontakte/vkjs'; import type { Placement } from '../../lib/floating'; import type { HasDataAttribute, HTMLAttributesWithRootRef } from '../../types'; import { CustomScrollView, type CustomScrollViewProps } from '../CustomScrollView/CustomScrollView'; import { Popper } from '../Popper/Popper'; import { Spinner } from '../Spinner/Spinner'; import styles from './CustomSelectDropdown.module.css'; export interface CustomSelectDropdownProps extends HTMLAttributesWithRootRef, Pick, HasDataAttribute { targetRef: React.RefObject; placement?: Placement; scrollBoxRef?: React.Ref; fetching?: boolean; offsetDistance?: number; /** * Ширина раскрывающегося списка зависит от контента. */ autoWidth?: boolean; forcePortal?: boolean; onPlacementChange?: (placement: Placement) => void; /** * Отключает максимальную высоту по умолчанию. */ noMaxHeight?: boolean; } export const CustomSelectDropdown = ({ children, targetRef, scrollBoxRef, placement = 'bottom', fetching, offsetDistance = 0, autoWidth = false, forcePortal = true, className, noMaxHeight = false, // CustomScrollView overscrollBehavior, ...restProps }: CustomSelectDropdownProps): React.ReactNode => { return ( {fetching ? (
) : ( children )}
); };