jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
35 lines (34 loc) • 1.14 kB
TypeScript
import type { PropsWithChildren } from 'react';
import type { ReactElementType } from 'jamis-core';
import type { PopOverPosition } from '../types';
export interface OverlayProps extends PropsWithChildren {
placement?: string | PopOverPosition;
show?: boolean;
transition?: React.ElementType;
containerPadding?: number;
shouldUpdatePosition?: boolean;
/**
* 点击外部时是否关闭
*/
rootClose?: boolean;
/**
* 点击容器本身是否关闭
*/
closeOnContainer?: boolean;
container?: ReactElementType;
containerSelector?: string;
target?: ReactElementType;
watchTargetSizeChange?: boolean;
offset?: [number, number];
onHide?: (e: Event) => void;
onEnter?(node: HTMLElement): any;
onEntering?(node: HTMLElement): any;
onEntered?(node: HTMLElement): any;
onExit?(node: HTMLElement): any;
onExiting?(node: HTMLElement): any;
onExited?(node: HTMLElement): any;
/**
* 当自动调整了位置时的回调通知, 告知调用者popover是居上还是居下
*/
onUpdatePlacement?: (position: 'top' | 'bottom') => void;
}