util.js 799 B

1234567891011121314151617181920212223242526272829303132333435
  1. Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
  2. //#region ../../packages/components/scrollbar/src/util.ts
  3. const GAP = 4;
  4. const BAR_MAP = {
  5. vertical: {
  6. offset: "offsetHeight",
  7. scroll: "scrollTop",
  8. scrollSize: "scrollHeight",
  9. size: "height",
  10. key: "vertical",
  11. axis: "Y",
  12. client: "clientY",
  13. direction: "top"
  14. },
  15. horizontal: {
  16. offset: "offsetWidth",
  17. scroll: "scrollLeft",
  18. scrollSize: "scrollWidth",
  19. size: "width",
  20. key: "horizontal",
  21. axis: "X",
  22. client: "clientX",
  23. direction: "left"
  24. }
  25. };
  26. const renderThumbStyle = ({ move, size, bar }) => ({
  27. [bar.size]: size,
  28. transform: `translate${bar.axis}(${move}%)`
  29. });
  30. //#endregion
  31. exports.BAR_MAP = BAR_MAP;
  32. exports.GAP = GAP;
  33. exports.renderThumbStyle = renderThumbStyle;
  34. //# sourceMappingURL=util.js.map