"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("react/jsx-runtime"),a=require("react"),i=require("classnames"),l=require("@material-ui/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(e),s=n(t),u=n(o),b=n(i),d=["stickyHeader","className","stickyColumn","classes","shadowColor","style"];function p(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function h(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?p(Object(o),!0).forEach((function(t){c.default(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):p(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var f="top",g="right",y="bottom",m="left",T="both",P="var(".concat("--CorvaUI-Table-ShadowColor",")"),w="rgb(from ".concat("--CorvaUI-Table-ShadowColor"," r g b / 0)"),M=l.makeStyles((function(e){return{root:function(t){return{borderTop:t.isStickyHeader?"1px solid ".concat(e.palette.primary.text9):"none","& .MuiTable-root .MuiTableHead-root .MuiTableRow-head":{position:(t.top||t.bothVertical)&&"sticky",zIndex:2,top:0,boxShadow:(t.top||t.bothVertical)&&"0px 16px 10px ".concat(P)},"& .MuiTable-root .MuiTableFooter-root":{"&:before":{content:(t.bottom||t.bothVertical)&&"no-open-quote",position:"absolute",bottom:-1,width:"inherit",height:"16px",background:"linear-gradient(360deg, ".concat(w," 0%, ").concat(P," 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:(t.left||t.bothHorizontal)&&"no-open-quote",position:"absolute",top:0,right:"-16px",width:"16px",height:"100%",background:"linear-gradient(270deg, ".concat(w," 0%, ").concat(P," 100%)")}},"& .MuiTable-root .MuiTableHead-root .MuiTableRow-head .stickyEmptyCell, & .MuiTable-root .MuiTableBody-root .MuiTableRow-root .stickyEmptyCell":{background:(t.right||t.bothHorizontal)&&"linear-gradient(90deg, ".concat(w," 0%, ").concat(P," 100%)")}}}}})),O=a.forwardRef((function(e,t){var o=e.stickyHeader,i=e.className,n=e.stickyColumn,p=e.classes,P=e.shadowColor,w=void 0===P?"B4":P,O=e.style,k=u.default(e,d),C=a.useState(o?y:""),j=s.default(C,2),v=j[0],x=j[1],S=a.useState(n?g:""),H=s.default(S,2),q=H[0],R=H[1],z=M({top:v===f,bottom:v===y,bothVertical:v===T,left:q===m,right:q===g,bothHorizontal:q===T,isStickyHeader:o}),D=function(e){var t=e.scroll,o=e.clientParam,r=e.scrollParam,a=e.setScrollPosition,i=e.gradientPositions;0===t?a(i[0]):Math.ceil(t)+o===r?a(i[1]):a(T)},E=l.useTheme().palette.background[w.toLowerCase()]||w;return r.jsx(l.TableContainer,h({onScroll:function(e){o?D({scroll:e.currentTarget.scrollTop,clientParam:e.currentTarget.clientHeight,scrollParam:e.currentTarget.scrollHeight,setScrollPosition:x,gradientPositions:[y,f]}):n&&D({scroll:e.currentTarget.scrollLeft,clientParam:e.currentTarget.clientWidth,scrollParam:e.currentTarget.scrollWidth,setScrollPosition:R,gradientPositions:[g,m]})},className:b.default(z.root,i,null==p?void 0:p.root),ref:t,style:h(h({},O),{},c.default({},"--CorvaUI-Table-ShadowColor",E))},k))}));exports.TableContainer=O;
//# sourceMappingURL=TableContainer.js.map
