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