!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={3209:(e,t,r)=>{r.d(t,{X4:()=>o});const o=1e3},6989:e=>{e.exports=require("@mui/material/Box")},270:e=>{e.exports=require("@mui/material/Paper")},9292:e=>{e.exports=require("@mui/material/Table")},9008:e=>{e.exports=require("@mui/material/TableBody")},5684:e=>{e.exports=require("@mui/material/TableCell")},5783:e=>{e.exports=require("@mui/material/TableContainer")},8202:e=>{e.exports=require("@mui/material/TableHead")},464:e=>{e.exports=require("@mui/material/TableRow")},38:e=>{e.exports=require("@mui/material/TableSortLabel")},6831:e=>{e.exports=require("@mui/utils")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};r.r(o),r.d(o,{default:()=>H});var n=r(2015),a=r(9825),l=r.n(a),i=r(6842),s=r.n(i),u=r(6831),c=r(6989),m=r.n(c),d=r(9292),p=r.n(d),x=r(9008),f=r.n(x),b=r(5684),y=r.n(b),h=r(5783),g=r.n(h),E=r(8202),v=r.n(E),q=r(38),w=r.n(q),T=r(270),S=r.n(T),_=r(464),j=r.n(_);const k={dottedBorderLeft:"sYyWOBs7DxfIdU_ztAqL"};var K=r(3209);const C=({boxHeight:e="400px",columns:t=[],data:r=[],loadMoreData:o,onRowEdit:a,onSort:l,options:i={sortCol:"",sortDir:""}})=>{const{sortCol:c,sortDir:d}=i,x=n.useRef(!1);return n.createElement(m(),{sx:{width:"100%",height:e,overflow:"auto"},onScroll:e=>{if(x.current)return;const{scrollTop:t,scrollHeight:r,clientHeight:n}=e.target;t+n>=r-20&&(x.current=!0,o(),setTimeout((()=>{x.current=!1}),K.X4))}},n.createElement(S(),{elevation:0,sx:{width:"100%",mb:2}},n.createElement(g(),{component:S(),sx:{borderRadius:0,boxShadow:"none"}},n.createElement(p(),null,n.createElement(v(),{sx:{backgroundColor:"#EAEAEA"}},n.createElement(j(),null,t.map((e=>n.createElement(y(),{key:e.columnKey,sx:{width:e.width,minWidth:e.width,maxWidth:e.width},align:e.align??"left"},e.sortable?n.createElement(w(),{active:c===e.columnKey,direction:c===e.columnKey&&1===d?"asc":"desc",onClick:()=>l(e.columnKey,-1*d)},e.header,c===e.columnKey?n.createElement(m(),{component:"span",sx:u.visuallyHidden},"-1"===d?s().translate("mui_table.sorted_desc"):s().translate("mui_table.sorted_asc")):null):e.header))))),n.createElement(f(),null,r.map(((e,r)=>n.createElement(j(),{key:e.id||r},t.map((t=>{const r=t.render?t.render(e,{onRowEdit:a}):e[t.columnKey],o=t.className?k[t.className]||t.className:"";return n.createElement(y(),{key:t.columnKey,align:t.align??"left",className:o},r)}))))),0===r.length&&n.createElement(j(),null,n.createElement(y(),{colSpan:t.length,align:"center"},s().translate("mui_table.no_data"))))))))};C.propTypes={boxHeight:l().string,columns:l().array,data:l().array,loadMoreData:l().func,onRowEdit:l().func,onSort:l().func,options:l().object};const H=C;return o})()));
//# sourceMappingURL=infinite-table.js.map