first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import { getWindow } from './getWindow';
/**
* Helper to get bounding client rect. Passing in window will get the window size.
*
* @public
*/
export function getRect(element, win) {
var theWin = (win !== null && win !== void 0 ? win : (!element || (element && element.hasOwnProperty('devicePixelRatio'))))
? getWindow()
: getWindow(element);
var rect;
if (element) {
if (element === theWin) {
rect = {
left: 0,
top: 0,
width: theWin.innerWidth,
height: theWin.innerHeight,
right: theWin.innerWidth,
bottom: theWin.innerHeight,
};
}
else if (element.getBoundingClientRect) {
rect = element.getBoundingClientRect();
}
}
return rect;
}
//# sourceMappingURL=getRect.js.map