import t from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/helpers/objectWithoutProperties";import{jsx as e}from"react/jsx-runtime";import{forwardRef as a,useState as i}from"react";import l from"classnames";import{makeStyles as n,useTheme as c,TableContainer as s}from"@material-ui/core";var b=["stickyHeader","className","stickyColumn","classes","shadowColor","style"];function u(t,o){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);o&&(e=e.filter((function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable}))),r.push.apply(r,e)}return r}function p(o){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?u(Object(e),!0).forEach((function(r){t(o,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach((function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(e,t))}))}return o}var d="top",m="right",h="bottom",g="left",f="both",y="var(".concat("--CorvaUI-Table-ShadowColor",")"),T="rgb(from ".concat("--CorvaUI-Table-ShadowColor"," r g b / 0)"),P=n((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(y)},"& .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, ".concat(T," 0%, ").concat(y," 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, ".concat(T," 0%, ").concat(y," 100%)")}},"& .MuiTable-root .MuiTableHead-root .MuiTableRow-head .stickyEmptyCell, & .MuiTable-root .MuiTableBody-root .MuiTableRow-root .stickyEmptyCell":{background:(o.right||o.bothHorizontal)&&"linear-gradient(90deg, ".concat(T," 0%, ").concat(y," 100%)")}}}}})),w=a((function(a,n){var u=a.stickyHeader,y=a.className,T=a.stickyColumn,w=a.classes,M=a.shadowColor,O=void 0===M?"B4":M,k=a.style,C=r(a,b),v=i(u?h:""),j=o(v,2),x=j[0],H=j[1],S=i(T?m:""),R=o(S,2),z=R[0],D=R[1],E=P({top:x===d,bottom:x===h,bothVertical:x===f,left:z===g,right:z===m,bothHorizontal:z===f,isStickyHeader:u}),I=function(t){var o=t.scroll,r=t.clientParam,e=t.scrollParam,a=t.setScrollPosition,i=t.gradientPositions;0===o?a(i[0]):Math.ceil(o)+r===e?a(i[1]):a(f)},V=c().palette.background[O.toLowerCase()]||O;return e(s,p({onScroll:function(t){u?I({scroll:t.currentTarget.scrollTop,clientParam:t.currentTarget.clientHeight,scrollParam:t.currentTarget.scrollHeight,setScrollPosition:H,gradientPositions:[h,d]}):T&&I({scroll:t.currentTarget.scrollLeft,clientParam:t.currentTarget.clientWidth,scrollParam:t.currentTarget.scrollWidth,setScrollPosition:D,gradientPositions:[m,g]})},className:l(E.root,y,null==w?void 0:w.root),ref:n,style:p(p({},k),{},t({},"--CorvaUI-Table-ShadowColor",V))},C))}));export{w as TableContainer};
//# sourceMappingURL=TableContainer.js.map
