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