import{__rest as t,__assign as o}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsx as e}from"react/jsx-runtime";import{forwardRef as r,useState as a}from"react";import i from"classnames";import{makeStyles as l,TableContainer as n}from"@material-ui/core";var c="top",s="right",b="bottom",u="left",d="both",m=l((function(t){return{root:function(o){return{borderTop:o.isStickyHeader?"1px solid ".concat(t.palette.primary.text9):"none","& .MuiTable-root .MuiTableHead-root .MuiTableRow-head":{position:(o.top||o.bothVertical)&&"sticky",zIndex:2,top:0,boxShadow:(o.top||o.bothVertical)&&"0px 16px 10px ".concat(t.palette.background.b4)},"& .MuiTable-root .MuiTableFooter-root":{"&:before":{content:(o.bottom||o.bothVertical)&&"no-open-quote",position:"absolute",bottom:-1,width:"inherit",height:"16px",background:"linear-gradient(360deg, rgba(44, 44, 44, 0) 0%, ".concat(t.palette.background.b4," 100%)"),transform:"matrix(1, 0, 0, -1, 0, 0)"}},"& .MuiTable-root .MuiTableHead-root .MuiTableRow-head .stickyCell, & .MuiTable-root .MuiTableBody-root .MuiTableRow-root .stickyCell":{"&:after":{content:(o.left||o.bothHorizontal)&&"no-open-quote",position:"absolute",top:0,right:"-16px",width:"16px",height:"100%",background:"linear-gradient(270deg, rgba(44, 44, 44, 0) 0%, ".concat(t.palette.background.b4," 100%)")}},"& .MuiTable-root .MuiTableHead-root .MuiTableRow-head .stickyEmptyCell, & .MuiTable-root .MuiTableBody-root .MuiTableRow-root .stickyEmptyCell":{background:(o.right||o.bothHorizontal)&&"linear-gradient(90deg, rgba(44, 44, 44, 0) 0%, ".concat(t.palette.background.b4," 100%)")}}}}})),p=r((function(r,l){var p=r.stickyHeader,g=r.className,h=r.stickyColumn,T=r.classes,f=t(r,["stickyHeader","className","stickyColumn","classes"]),k=a(p?b:""),M=k[0],y=k[1],x=a(h?s:""),H=x[0],P=x[1],w=m({top:M===c,bottom:M===b,bothVertical:M===d,left:H===u,right:H===s,bothHorizontal:H===d,isStickyHeader:p}),C=function(t){var o=t.scroll,e=t.clientParam,r=t.scrollParam,a=t.setScrollPosition,i=t.gradientPositions;0===o?a(i[0]):Math.ceil(o)+e===r?a(i[1]):a(d)};return e(n,o({onScroll:function(t){p?C({scroll:t.currentTarget.scrollTop,clientParam:t.currentTarget.clientHeight,scrollParam:t.currentTarget.scrollHeight,setScrollPosition:y,gradientPositions:[b,c]}):h&&C({scroll:t.currentTarget.scrollLeft,clientParam:t.currentTarget.clientWidth,scrollParam:t.currentTarget.scrollWidth,setScrollPosition:P,gradientPositions:[s,u]})},className:i(w.root,g,null==T?void 0:T.root),ref:l},f))}));export{p as TableContainer};
