UNPKG

zent

Version:

一套前端设计语言和基于React的实现

66 lines (53 loc) 1.51 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _create = require('./create'); var _create2 = _interopRequireDefault(_create); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } /** * ------------------------------- * | anchor | popover | * | |--------- * ---------------------- */ exports['default'] = (0, _create2['default'])(function (anchorBoundingBox, containerBoundingBox, contentDimension, options) { var right = anchorBoundingBox.right, top = anchorBoundingBox.top; var x = right + options.cushion; var y = top; return { getCSSStyle: function getCSSStyle() { return { position: 'absolute', left: Math.round(x) + 'px', top: Math.round(y) + 'px' }; }, name: 'position-right-top' }; }); /** * ---------------------------------- * | | popover | * | anchor --------------| * ----------------------------------| */ // export function TopRightInnerPlacement(anchorBoundingBox, containerBoundingBox) { // const { right, top } = anchorBoundingBox; // const x = containerBoundingBox.right - right; // const y = top; // return { // getCSSStyle() { // return { // position: 'absolute', // right: `${x}px`, // top: `${y}px` // }; // }, // toString() { // return 'rt-i'; // } // }; // } module.exports = exports['default'];