@progress/kendo-vue-popup
Version:
Kendo UI for Vue Popup package
9 lines (8 loc) • 2.4 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("@progress/kendo-popup-common"),n=require("../util.js");class l{addOffset(t,e){return{left:t.left+e.left,top:t.top+e.top}}align(t){return r.align(t)}boundingOffset(t){return r.boundingOffset(t)}getWindow(){return n.isWindowAvailable()?window:null}isBodyOffset(t){return r.isBodyOffset(t)}hasOffsetParent(t){if(!t)return!1;const e=t.offsetParent;return e&&!(e.nodeName==="BODY"&&window.getComputedStyle(e).position==="static")}offset(t){return t?r.offset(t):null}staticOffset(t){if(!t)return null;const{left:e,top:o}=t.style;t.style.left="0px",t.style.top="0px";const i=r.offset(t);return t.style.left=e,t.style.top=o,i}position(t,e){if(!t||!e)return null;const o=r.siblingContainer(t,e);return r.positionWithScroll(t,o)}relativeOffset(t,e){return r.applyLocationOffset(this.offset(t),e,this.isBodyOffset(t))}addScroll(t,e){return r.addScroll(t,e)}removeScroll(t,e){return r.removeScroll(t,e)}restrictToView(t){return r.restrictToView(t)}scrollPosition(t){return r.scrollPosition(t)}scrollableParents(t){return n.scrollableParents(t)}stackingElementOffset(t){const e=this.getRelativeContextElement(t);return e?r.offset(e):null}stackingElementScroll(t){const e=this.getRelativeContextElement(t);return e?{x:e.scrollLeft,y:e.scrollTop}:{x:0,y:0}}stackingElementViewPort(t){const e=this.getRelativeContextElement(t);return e?{height:e.scrollHeight,width:e.scrollWidth}:null}getRelativeContextElement(t){if(!t||!n.HAS_RELATIVE_STACKING_CONTEXT)return null;let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).transform!=="none")return e;e=e.parentElement}return null}useRelativePosition(t){return!!this.getRelativeContextElement(t)}windowViewPort(t){return r.getWindowViewPort(t)}zIndex(t,e){return n.zIndex(t,e)}zoomLevel(){return!n.isDocumentAvailable()||!n.isWindowAvailable()?1:parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2))}isZoomed(){return this.zoomLevel()>1}}exports.DOMService=l;