zent
Version:
一套前端设计语言和基于React的实现
30 lines (26 loc) • 595 B
text/typescript
import { IPositionFunction } from '../position-function';
import { prefix } from './prefix';
/**
* ----------------------
* | |----------
* | anchor | popover |
* |--------------------|---------
*
*/
export const RightBottom: IPositionFunction = ({
relativeRect,
cushion,
contentRect,
}) => {
const { right, bottom } = relativeRect;
const x = right + cushion;
const y = bottom - contentRect.height;
return {
style: {
position: 'absolute',
left: x,
top: y,
},
className: prefix('position-right-bottom'),
};
};