util.js 779 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  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 = ({
  27. move,
  28. size,
  29. bar
  30. }) => ({
  31. [bar.size]: size,
  32. transform: `translate${bar.axis}(${move}%)`
  33. });
  34. exports.BAR_MAP = BAR_MAP;
  35. exports.GAP = GAP;
  36. exports.renderThumbStyle = renderThumbStyle;
  37. //# sourceMappingURL=util.js.map