zent
Version:
一套前端设计语言和基于React的实现
39 lines (29 loc) • 954 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _create = require('./create');
var _create2 = _interopRequireDefault(_create);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* |--------------------|
* ----------| |
* | popover | anchor |
* |---------|--------------------|
*/
function locate(anchorBoundingBox, containerBoundingBox, contentDimension, options) {
var x = anchorBoundingBox.left - contentDimension.width - options.cushion;
var y = anchorBoundingBox.bottom - contentDimension.height;
return {
getCSSStyle: function getCSSStyle() {
return {
position: 'absolute',
left: Math.round(x) + 'px',
top: Math.round(y) + 'px'
};
},
name: 'position-left-bottom'
};
}
var LeftBottom = (0, _create2['default'])(locate);
exports['default'] = LeftBottom;