zent
Version:
一套前端设计语言和基于React的实现
17 lines (16 loc) • 547 B
JavaScript
import { prefix } from './prefix';
export var RightCenter = function (_a) {
var contentRect = _a.contentRect, relativeRect = _a.relativeRect, cushion = _a.cushion;
var right = relativeRect.right, top = relativeRect.top, bottom = relativeRect.bottom;
var x = right + cushion;
var middle = (top + bottom) / 2;
var y = middle - contentRect.height / 2;
return {
style: {
position: 'absolute',
left: x,
top: y,
},
className: prefix('position-right-center'),
};
};