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