@progress/kendo-vue-popup
Version:
Kendo UI for Vue Popup package
9 lines (8 loc) • 1.27 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../util.js");class m{constructor(t){this._dom=t}alignElement(t){const{anchor:e,element:o,anchorAlign:s,elementAlign:n,offset:i}=t,c=!this._dom.hasOffsetParent(o)?this.absoluteRect(e,o,i):this.relativeRect(e,o,i);return this._dom.align({anchorAlign:s,anchorRect:c,elementAlign:n,elementRect:this._dom.offset(o)})}absoluteRect(t,e,o){const s=this._dom,n=r.eitherRect(s.offset(t),o),i=s.stackingElementOffset(e),f=r.removeStackingOffset(n,i),c=s.stackingElementScroll(e),a=s.addScroll(f,c),d=this.elementScrollPosition(t,e),l=s.removeScroll(a,d);return l.left+=window.scrollX||window.pageXOffset,l.top+=window.scrollY||window.pageYOffset,l}elementScrollPosition(t,e){return t?{x:0,y:0}:this._dom.scrollPosition(e)}relativeRect(t,e,o){return r.eitherRect(this._dom.position(t,e),o)}}exports.AlignService=m;