UNPKG

@progress/kendo-vue-popup

Version:

Kendo UI for Vue Popup package

41 lines (40 loc) 1.21 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { eitherRect as h, replaceOffset as p } from "../util.mjs"; class R { constructor(e) { this._dom = e; } positionElement(e) { const { anchor: i, currentLocation: n, element: o, anchorAlign: r, elementAlign: l, collisions: m } = e, t = this._dom, f = e.viewPort || t.stackingElementViewPort(o) || t.windowViewPort(o), a = h(t.offset(i), n), c = p(t.staticOffset(o), n), d = this.elementRect(o, c), s = t.restrictToView({ anchorAlign: r, anchorRect: a, collisions: m, elementAlign: l, elementRect: d, viewPort: f }); return { flipped: s.flipped, offset: t.addOffset(c, s.offset) }; } elementRect(e, i) { return this._dom.removeScroll(i, this._dom.scrollPosition(e)); } } export { R as PositionService };