sticky.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. const genStickyStyle = token => {
  7. const {
  8. componentCls,
  9. opacityLoading,
  10. tableScrollThumbBg,
  11. tableScrollThumbBgHover,
  12. tableScrollThumbSize,
  13. tableScrollBg,
  14. zIndexTableSticky
  15. } = token;
  16. const tableBorder = `${token.lineWidth}px ${token.lineType} ${token.tableBorderColor}`;
  17. return {
  18. [`${componentCls}-wrapper`]: {
  19. [`${componentCls}-sticky`]: {
  20. '&-holder': {
  21. position: 'sticky',
  22. zIndex: zIndexTableSticky,
  23. background: token.colorBgContainer
  24. },
  25. '&-scroll': {
  26. position: 'sticky',
  27. bottom: 0,
  28. height: `${tableScrollThumbSize}px !important`,
  29. zIndex: zIndexTableSticky,
  30. display: 'flex',
  31. alignItems: 'center',
  32. background: tableScrollBg,
  33. borderTop: tableBorder,
  34. opacity: opacityLoading,
  35. '&:hover': {
  36. transformOrigin: 'center bottom'
  37. },
  38. // fake scrollbar style of sticky
  39. '&-bar': {
  40. height: tableScrollThumbSize,
  41. backgroundColor: tableScrollThumbBg,
  42. borderRadius: 100,
  43. transition: `all ${token.motionDurationSlow}, transform none`,
  44. position: 'absolute',
  45. bottom: 0,
  46. '&:hover, &-active': {
  47. backgroundColor: tableScrollThumbBgHover
  48. }
  49. }
  50. }
  51. }
  52. }
  53. };
  54. };
  55. var _default = exports.default = genStickyStyle;