import { useMouseCapture as e } from "../../composition/useMouseCapture.js";
import { computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, normalizeStyle as o, openBlock as s, ref as c } from "vue";
var l = /* @__PURE__ */ a({
	__name: "TScroll",
	props: {
		offset: {},
		windowSize: {},
		dataSize: {}
	},
	emits: ["change:offset"],
	setup(a, { emit: l }) {
		let u = l, d = a, f = c(), p = t(() => d.windowSize - 12), m = t(() => d.windowSize < d.dataSize), h = t(() => Math.ceil(d.offset * (p.value / d.dataSize))), g = t(() => Math.ceil(p.value * p.value / d.dataSize)), _ = t(() => ({
			top: `${h.value}px`,
			height: `${g.value}px`
		}));
		return e(f, (e, t) => {
			u("change:offset", (h.value + e.dy) * d.dataSize / p.value), t.x = e.x, t.y = e.y;
		}), (e, t) => (s(), r("div", {
			class: "t-scroll",
			style: o({ height: `${a.windowSize}px` })
		}, [i("div", null, [m.value ? (s(), r("div", {
			key: 0,
			ref_key: "handleRef",
			ref: f,
			class: "t-scroll__handle",
			style: o(_.value)
		}, null, 4)) : n("", !0)])], 4));
	}
});
export { l as default };

//# sourceMappingURL=TScroll.vue2.js.map