@yandex/ui
Version:
Yandex UI components
73 lines (72 loc) • 2.7 kB
TypeScript
import React, { RefObject } from 'react';
import { PopperAnyModifiers, Direction, Boundary } from '../../usePopper';
export interface IPopupTargetAnchorProps {
/**
* Элемент, относительно которого позиционируется попап
*/
anchor?: RefObject<HTMLElement>;
/**
* Направления раскрытия блока
*
* @default ['bottom-start', 'bottom', 'bottom-end',
* 'top-start', 'top', 'top-end', 'right-start',
* 'right', 'right-end', 'left-start', 'left', 'left-end']
*/
direction?: Direction | Direction[];
/**
* Отступ попапа относительно основного направления
*
* @default 0
*/
mainOffset?: number;
/**
* Закрепляет положение попапа после открытия
*/
motionless?: boolean;
/**
* Отступ попапа относительно второстепенного направления
*
* @default 0
*/
secondaryOffset?: number;
/**
* Отступ хвостика от края попапа
*
* @default 0
*/
tailOffset?: number;
/**
* Позиционирование попапа относительно переданного элемента
*/
target?: 'anchor';
/**
* Отступ от края окна браузера
*
* @default 16
*/
viewportOffset?: number;
/**
* Пользовательский набор модификаторов для popperjs
*/
modifiers?: PopperAnyModifiers;
/**
* Ссылка на элемент или ссылки на элементы, в которые должен вписываться попап
*/
boundary?: Boundary;
}
/**
* Позиционирует попап относительно элемента, который указан в свойстве `anchor`.
* @param {IPopupTargetAnchorProps} props
*/
export declare const withTargetAnchor: {
<K extends import("@bem-react/core").IClassNameProps = {}>(WrappedComponent: React.ComponentType<IPopupTargetAnchorProps & K>): (props: IPopupTargetAnchorProps & K) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
__isSimple: boolean;
__blockName: string; /**
* Отступ попапа относительно второстепенного направления
*
* @default 0
*/
__mod: string;
__value: string | number | boolean | undefined;
__passToProps: boolean;
};