grid-layout-plus
Version:
<p align="center"> <a href="https://grid-layout-plus.netlify.app/" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/grid-layout-plus.svg" width="180" style="width: 120px;" /> </a> </p>
35 lines (34 loc) • 748 B
JavaScript
function a(t) {
return c(t);
}
function c(t) {
var f;
const n = ((f = t.target) == null ? void 0 : f.offsetParent) || document.body, e = t.offsetParent === document.body ? { left: 0, top: 0 } : n.getBoundingClientRect(), o = t.clientX + n.scrollLeft - e.left, r = t.clientY + n.scrollTop - e.top;
return { x: o, y: r };
}
function i(t, n, e, o) {
return s(t) ? {
deltaX: e - t,
deltaY: o - n,
lastX: t,
lastY: n,
x: e,
y: o
} : {
deltaX: 0,
deltaY: 0,
lastX: e,
lastY: o,
x: e,
y: o
};
}
function s(t) {
return typeof t == "number" && !Number.isNaN(t);
}
export {
i as createCoreData,
a as getControlPosition,
c as offsetXYFromParentOf
};
//# sourceMappingURL=draggable.mjs.map