/* eslint-disable jsdoc/require-jsdoc */ import type * 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 | undefined; scrollBoxRef?: React.Ref | undefined; fetching?: boolean | undefined; offsetDistance?: number | undefined; /** * Ширина раскрывающегося списка зависит от контента. */ autoWidth?: boolean | undefined; forcePortal?: boolean | undefined; onPlacementChange?: ((placement: Placement) => void) | undefined; /** * Отключает максимальную высоту по умолчанию. */ noMaxHeight?: boolean | undefined; } 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 )}
); };