util.mjs 653 B

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