@ehfuse/mui-virtual-data-table 1.1.16 → 1.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import{forwardRef as et,useCallback as ke,useMemo as tt,useRef as ie,useEffect as pe,memo as Dt,useState as rt}from"react";import{Box as fe,Table as Et,TableBody as Rt,TableCell as Ae,TableContainer as Ht,TableHead as It,TableRow as ze,TableSortLabel as nt,Paper as Ot,Typography as $t}from"@mui/material";import{TableVirtuoso as Nt}from"react-virtuoso";import{jsx as Qe}from"react/jsx-runtime";import{useRef as lt,useState as ft,useEffect as mt}from"react";import{Box as ht,CircularProgress as gt}from"@mui/material";var Pe=function(){return Pe=Object.assign||function(f){for(var g,v=1,S=arguments.length;v<S;v++){g=arguments[v];for(var E in g)Object.prototype.hasOwnProperty.call(g,E)&&(f[E]=g[E])}return f},Pe.apply(this,arguments)};function at(a){var f=a.visible,g=a.onComplete,v=a.fadeoutDuration,S=v===void 0?200:v,E=a.exitDelay,M=E===void 0?0:E,k=a.size,R=k===void 0?40:k,z=a.className,X=a.style,q=a.sx,K=a.indicator,H=a.background,Y=H===void 0?{show:!0,color:"255, 255, 255",opacity:.9}:H,le=lt(void 0),l=lt(null),_=ft(f),ae=_[0],se=_[1],P=Y.show,G=P===void 0?!0:P,C=Y.color,O=C===void 0?"255, 255, 255":C,ee=Y.opacity,te=ee===void 0?.9:ee;if(mt(function(){var De=le.current;if(De===!0&&f===!1&&l.current){var re=l.current;re.style.opacity="0",setTimeout(function(){se(!1),g?.()},S+M)}else f===!0&&(se(!0),l.current&&(l.current.style.opacity="1"));le.current=f},[f,g,S,M]),!ae)return null;var ye=function(){return typeof K=="string"?Qe("img",{src:K,alt:"Loading",style:{width:R,height:R}}):K||Qe(gt,{size:R})},me=function(){return G?O.startsWith("rgba")?{backgroundColor:O}:/^\d+,\s*\d+,\s*\d+$/.test(O)?{backgroundColor:"rgba(".concat(O,", ").concat(te,")")}:te!==1?{backgroundColor:O,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:O,opacity:te,zIndex:-1}}:{backgroundColor:O}:{backgroundColor:"transparent"}};return Qe(ht,{ref:l,className:z,style:Pe({},X),sx:Pe(Pe({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,opacity:f?1:0,transition:"opacity ".concat(S,"ms ease-out")},me()),q),children:ye()})}import{useRef as Q,useEffect as oe,useState as W,useCallback as N,useMemo as Fe,forwardRef as bt,useImperativeHandle as xt,useLayoutEffect as yt}from"react";import{jsx as Se,jsxs as ct}from"react/jsx-runtime";var vt=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],st=(a,f)=>{let g=a.tagName.toLowerCase(),v=["text","password","email","number","search","tel","url","checkbox","radio"];if(g==="input"){let S=a.type;return v.includes(S)}if(["textarea","select","button"].includes(g)||["svg","path","circle","rect","line","polygon","polyline"].includes(g)||a.getAttribute("contenteditable")==="true")return!0;if(f?.excludeSelectors){for(let S of f.excludeSelectors)if(a.matches(S))return!0}return wt(a,f)},wt=(a,f)=>{let g=[...vt,...f?.excludeClasses||[]],v=a,S=0,E=5;for(;v&&S<=E;){if(g.some(M=>v.classList.contains(M)))return!0;if(v.classList.contains("MuiDialogContent-root"))break;v=v.parentElement,S++}return!1},Mt={},Ct={},Tt={},St={},kt={},Lt=bt(({className:a="",style:f={},containerStyle:g={},contentStyle:v={},children:S,onScroll:E,thumb:M=Mt,track:k=Ct,arrows:R=Tt,dragScroll:z=St,autoHide:X=kt,showScrollbar:q=!0,detectInnerScroll:K=!1},H)=>{let Y=Q({});oe(()=>{Y.current={children:S,onScroll:E,showScrollbar:q,thumb:M,track:k,arrows:R,dragScroll:z,autoHide:X}});let le=Q(null),l=Q(null),_=Q(null),ae=Q(null),se=Q(null),P=Q(null),[G,C]=W(!1),[O,ee]=W(!1),[te,ye]=W(!1),[me,De]=W({y:0,scrollTop:0}),[re,_e]=W(0),[Ge,Be]=W(0),[ve,Xe]=W(!1),[h,m]=W(!1),[ce,Ve]=W({x:0,y:0,scrollTop:0,scrollLeft:0}),[qe,ot]=W(null),[he,we]=W(null),[it,je]=W(!1),ge=Q(null),[Ke,Me]=W(!1),ne=Q(null),U=Q(null),j=Q(null),I=Fe(()=>{let t=M.color??"#606060";return{width:M.width??8,minHeight:M.minHeight??50,radius:M.radius??(M.width??8)/2,color:t,opacity:M.opacity??.6,hoverColor:M.hoverColor??t,hoverOpacity:M.hoverOpacity??1}},[M]),y=Fe(()=>({width:k.width??16,color:k.color??"rgba(128, 128, 128, 0.1)",visible:k.visible??!0,alignment:k.alignment??"center",radius:k.radius??I.radius??4,margin:k.margin??4}),[k,I.radius]),B=Fe(()=>{let t=R.color??"#808080";return{visible:R.visible??!1,step:R.step??50,color:t,opacity:R.opacity??.6,hoverColor:R.hoverColor??t,hoverOpacity:R.hoverOpacity??1}},[R]),Ee=Fe(()=>({enabled:z.enabled??!0,excludeClasses:z.excludeClasses??[],excludeSelectors:z.excludeSelectors??[]}),[z]),b=Fe(()=>({enabled:X.enabled??!0,delay:X.delay??1500,delayOnWheel:X.delayOnWheel??700}),[X]),$=I.width,Ue=y.width,Ce=I.minHeight,n=B.visible,r=B.step,x=N(()=>{if(!l.current)return;let t=document.activeElement;t&&l.current.contains(t)&&t!==l.current||l.current.focus()},[]);xt(H,()=>({getScrollContainer:()=>l.current,scrollTo:t=>{l.current&&l.current.scrollTo(t)},get scrollTop(){return l.current?.scrollTop||0},get scrollHeight(){return l.current?.scrollHeight||0},get clientHeight(){return l.current?.clientHeight||0}}),[]);let s=N(()=>{if(P.current){let o=P.current;if(document.contains(o)&&o.scrollHeight>o.clientHeight+2)return o;P.current=null}if(!l.current)return null;if(_.current&&_.current.scrollHeight>l.current.clientHeight+2)return P.current=l.current,l.current;if(!K)return null;let t=l.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of t){let i=o;if(i!==l.current&&i.classList.contains("overlay-scrollbar-container"))continue;let u=i.parentElement,w=!1;for(;u&&u!==l.current;){if(u.classList.contains("overlay-scrollbar-container")&&u!==l.current){w=!0;break}u=u.parentElement}if(!w&&i.scrollHeight>i.clientHeight+2)return P.current=i,i}return null},[]),c=N(()=>s()!==null,[s]),e=N(()=>{ne.current&&(clearTimeout(ne.current),ne.current=null)},[]),V=N(()=>{U.current&&(clearTimeout(U.current),U.current=null)},[]),Z=N(()=>{j.current&&(clearTimeout(j.current),j.current=null)},[]),L=N(t=>{b.enabled&&(e(),ne.current=setTimeout(()=>{C(!1),ne.current=null},t))},[e,b.enabled]),d=N(()=>{let t=s();if(!t){C(!1),Xe(!1),e();return}if(Xe(!0),!ae.current)return;b.enabled||(C(!0),e());let o=t.clientHeight,i=t.scrollHeight,u=t.scrollTop,w=0;if(le.current){let We=window.getComputedStyle(le.current),Je=parseFloat(We.paddingTop)||0,pt=parseFloat(We.paddingBottom)||0;w=Je+pt}let T=n?$*2+y.margin*4:y.margin*2,F=o-T+w,A=o/i,xe=Math.max(F*A,Ce),Ne=i-o,J=F-xe,Ze=Ne>0?u/Ne*J:0;_e(xe),Be(Ze)},[s,e,n,$,Ce,b.enabled]),Re=N(t=>{t.preventDefault(),t.stopPropagation();let o=s();o&&(ee(!0),De({y:t.clientY,scrollTop:o.scrollTop}),e(),C(!0),x())},[s,e,x]),ue=N(t=>{if(!O)return;let o=s();if(!o)return;let i=o.clientHeight,u=o.scrollHeight-i,w=t.clientY-me.y,T=i-re,F=w/T*u,A=Math.max(0,Math.min(u,me.scrollTop+F));o.scrollTop=A,d()},[O,me,re,d,s]),D=N(()=>{ee(!1),c()&&L(b.delay)},[c,L,b.delay]),Te=N(t=>{if(!ae.current)return;let o=ae.current.getBoundingClientRect(),i=t.clientY-o.top,u=s();if(!u)return;let w=u.clientHeight,T=u.scrollHeight,F=i/w*(T-w);u.scrollTop=Math.max(0,Math.min(T-w,F)),d(),C(!0),L(b.delay),x()},[d,L,b.delay,s,x]),He=N(t=>{if(t.preventDefault(),t.stopPropagation(),!l.current)return;let o=Math.max(0,l.current.scrollTop-r);l.current.scrollTop=o,d(),C(!0),L(b.delay),x()},[d,L,r,b.delay,x]),Ie=N(t=>{if(t.preventDefault(),t.stopPropagation(),!l.current||!_.current)return;let o=l.current,i=_.current.scrollHeight-o.clientHeight,u=Math.min(i,o.scrollTop+r);o.scrollTop=u,d(),C(!0),L(b.delay),x()},[d,L,r,b.delay,x]),Oe=N(t=>{if(!Ee.enabled)return;let o=t.target;if(st(o,Ee)||t.button!==0)return;let i=s();i&&(i.scrollHeight<=i.clientHeight||(t.preventDefault(),m(!0),Ve({x:t.clientX,y:t.clientY,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft||0}),e()))},[Ee,st,s,e]),de=N(t=>{if(!h)return;let o=s();if(!o)return;let i=ce.x-t.clientX,u=ce.y-t.clientY;if(Math.abs(u)<3&&Math.abs(i)<3)return;C(!0);let w=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,ce.scrollTop+u));o.scrollTop=w,d()},[h,ce,s,d]),$e=N(()=>{m(!1),c()&&L(b.delay)},[c,L,b.delay]);oe(()=>{let t=T=>{d(),e(),C(!0);let F=Ke?b.delayOnWheel:b.delay;L(F),E&&E(T)},o=()=>{Me(!0),ge.current&&clearTimeout(ge.current),ge.current=setTimeout(()=>{Me(!1)},300),e(),Z(),j.current=setTimeout(()=>{C(!0),j.current=null},50)},i=[],u=s();u&&i.push(u);let w=l.current;return w&&!u&&(i.push(w),w.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(T=>{let F=T;if(F!==w&&F.classList.contains("overlay-scrollbar-container"))return;let A=F.parentElement;for(;A&&A!==w;){if(A.classList.contains("overlay-scrollbar-container")&&A!==w)return;A=A.parentElement}i.push(F)})),i.forEach(T=>{T.addEventListener("scroll",t,{passive:!0}),T.addEventListener("wheel",o,{passive:!0})}),()=>{i.forEach(T=>{T.removeEventListener("scroll",t),T.removeEventListener("wheel",o)}),ge.current&&clearTimeout(ge.current),j.current&&clearTimeout(j.current)}},[s,d,E,e,L,b,Ke]),oe(()=>{let t=i=>{let u=s();if(!u)return;let{key:w}=i,{scrollTop:T,scrollHeight:F,clientHeight:A}=u,xe=F-A,Ne=50,J=null;switch(w){case"ArrowUp":i.preventDefault(),J=Math.max(0,T-Ne);break;case"ArrowDown":i.preventDefault(),J=Math.min(xe,T+Ne);break;case"PageUp":i.preventDefault(),J=Math.max(0,T-A);break;case"PageDown":i.preventDefault(),J=Math.min(xe,T+A);break;case"Home":i.preventDefault(),J=0;break;case"End":i.preventDefault(),J=xe;break;default:return}if(J!==null){let Ze=J/xe,We=n?$*2+y.margin*4:y.margin*2,Je=(A-We-re)*Ze;Be(Je),u.scrollTop=J,e(),C(!0),L(b.delay)}},o=l.current;if(o)return o.addEventListener("keydown",t),()=>{o.removeEventListener("keydown",t)}},[s,n,$,y.margin,re,e,L,b.delay]),oe(()=>{if(h)return document.addEventListener("mousemove",de),document.addEventListener("mouseup",$e),()=>{document.removeEventListener("mousemove",de),document.removeEventListener("mouseup",$e)}},[h,de,$e]),oe(()=>{if(O)return document.addEventListener("mousemove",ue),document.addEventListener("mouseup",D),()=>{document.removeEventListener("mousemove",ue),document.removeEventListener("mouseup",D)}},[O,ue,D]),oe(()=>{d();let t=setTimeout(()=>{d()},100);return()=>clearTimeout(t)},[d]),yt(()=>{je(!0),d(),!b.enabled&&c()&&C(!0)},[c,d,b.enabled]),oe(()=>{let t=new ResizeObserver(()=>{d()}),o=[];return l.current&&o.push(l.current),_.current&&o.push(_.current),P.current&&document.contains(P.current)&&o.push(P.current),o.forEach(i=>{t.observe(i)}),()=>t.disconnect()},[d]),oe(()=>{if(!l.current)return;let t=new MutationObserver(()=>{P.current=null,d()});return t.observe(l.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[d]);let be=Math.max(Ue,$);return oe(()=>{let t="overlay-scrollbar-webkit-hide",o=document.getElementById(t);o&&o.remove();let i=document.createElement("style");return i.id=t,i.textContent=`
1
+ import{forwardRef as Xe,useCallback as Ce,useMemo as rt,useRef as se,useEffect as ge,memo as Dt,useState as nt}from"react";import{Box as be,Table as Et,TableBody as Rt,TableCell as Ee,TableContainer as Ht,TableHead as It,TableFooter as Ot,TableRow as We,TableSortLabel as ot,Paper as $t,Typography as Ft}from"@mui/material";import{TableVirtuoso as Nt}from"react-virtuoso";import{jsx as tt}from"react/jsx-runtime";import{useRef as lt,useState as ft,useEffect as mt}from"react";import{Box as ht,CircularProgress as gt}from"@mui/material";var Be=function(){return Be=Object.assign||function(p){for(var f,y=1,k=arguments.length;y<k;y++){f=arguments[y];for(var E in f)Object.prototype.hasOwnProperty.call(f,E)&&(p[E]=f[E])}return p},Be.apply(this,arguments)};function at(a){var p=a.visible,f=a.onComplete,y=a.fadeoutDuration,k=y===void 0?200:y,E=a.exitDelay,w=E===void 0?0:E,C=a.size,R=C===void 0?40:C,z=a.className,X=a.style,W=a.sx,K=a.indicator,H=a.background,Y=H===void 0?{show:!0,color:"255, 255, 255",opacity:.9}:H,ce=lt(void 0),s=lt(null),_=ft(p),ue=_[0],de=_[1],P=Y.show,G=P===void 0?!0:P,M=Y.color,I=M===void 0?"255, 255, 255":M,ee=Y.opacity,te=ee===void 0?.9:ee;if(mt(function(){var re=ce.current;if(re===!0&&p===!1&&s.current){var ne=s.current;ne.style.opacity="0",setTimeout(function(){de(!1),f?.()},k+w)}else p===!0&&(de(!0),s.current&&(s.current.style.opacity="1"));ce.current=p},[p,f,k,w]),!ue)return null;var Te=function(){return typeof K=="string"?tt("img",{src:K,alt:"Loading",style:{width:R,height:R}}):K||tt(gt,{size:R})},pe=function(){return G?I.startsWith("rgba")?{backgroundColor:I}:/^\d+,\s*\d+,\s*\d+$/.test(I)?{backgroundColor:"rgba(".concat(I,", ").concat(te,")")}:te!==1?{backgroundColor:I,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:I,opacity:te,zIndex:-1}}:{backgroundColor:I}:{backgroundColor:"transparent"}};return tt(ht,{ref:s,className:z,style:Be({},X),sx:Be(Be({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,opacity:p?1:0,transition:"opacity ".concat(k,"ms ease-out")},pe()),W),children:Te()})}import{useRef as J,useEffect as ae,useState as j,useCallback as $,useMemo as Ve,forwardRef as bt,useImperativeHandle as xt,useLayoutEffect as yt}from"react";import{jsx as De,jsxs as ct}from"react/jsx-runtime";var vt=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],st=(a,p)=>{let f=a.tagName.toLowerCase(),y=["text","password","email","number","search","tel","url","checkbox","radio"];if(f==="input"){let k=a.type;return y.includes(k)}if(["textarea","select","button"].includes(f)||["svg","path","circle","rect","line","polygon","polyline"].includes(f)||a.getAttribute("contenteditable")==="true")return!0;if(p?.excludeSelectors){for(let k of p.excludeSelectors)if(a.matches(k))return!0}return wt(a,p)},wt=(a,p)=>{let f=[...vt,...p?.excludeClasses||[]],y=a,k=0,E=5;for(;y&&k<=E;){if(f.some(w=>y.classList.contains(w)))return!0;if(y.classList.contains("MuiDialogContent-root"))break;y=y.parentElement,k++}return!1},Mt={},Ct={},Tt={},St={},kt={},Lt=bt(({className:a="",style:p={},containerStyle:f={},contentStyle:y={},children:k,onScroll:E,thumb:w=Mt,track:C=Ct,arrows:R=Tt,dragScroll:z=St,autoHide:X=kt,showScrollbar:W=!0,detectInnerScroll:K=!1},H)=>{let Y=J({});ae(()=>{Y.current={children:k,onScroll:E,showScrollbar:W,thumb:w,track:C,arrows:R,dragScroll:z,autoHide:X}});let ce=J(null),s=J(null),_=J(null),ue=J(null),de=J(null),P=J(null),[G,M]=j(!1),[I,ee]=j(!1),[te,Te]=j(!1),[pe,re]=j({y:0,scrollTop:0}),[ne,Ue]=j(0),[Ze,qe]=j(0),[He,je]=j(!1),[xe,Ie]=j(!1),[Oe,v]=j({x:0,y:0,scrollTop:0,scrollLeft:0}),[h,ze]=j(null),[ye,fe]=j(null),[it,Ye]=j(!1),ve=J(null),[_e,$e]=j(!1),we=J(null),Se=J(null),U=J(null),O=Ve(()=>{let r=w.color??"#606060";return{width:w.width??8,minHeight:w.minHeight??50,radius:w.radius??(w.width??8)/2,color:r,opacity:w.opacity??.6,hoverColor:w.hoverColor??r,hoverOpacity:w.hoverOpacity??1}},[w]),m=Ve(()=>({width:C.width??16,color:C.color??"rgba(128, 128, 128, 0.1)",visible:C.visible??!0,alignment:C.alignment??"center",radius:C.radius??O.radius??4,margin:C.margin??4}),[C,O.radius]),F=Ve(()=>{let r=R.color??"#808080";return{visible:R.visible??!1,step:R.step??50,color:r,opacity:R.opacity??.6,hoverColor:R.hoverColor??r,hoverOpacity:R.hoverOpacity??1}},[R]),me=Ve(()=>({enabled:z.enabled??!0,excludeClasses:z.excludeClasses??[],excludeSelectors:z.excludeSelectors??[]}),[z]),g=Ve(()=>({enabled:X.enabled??!0,delay:X.delay??1500,delayOnWheel:X.delayOnWheel??700}),[X]),T=O.width,Je=m.width,Fe=O.minHeight,A=F.visible,ke=F.step,oe=$(()=>{if(!s.current)return;let r=document.activeElement;r&&s.current.contains(r)&&r!==s.current||s.current.focus()},[]);xt(H,()=>({getScrollContainer:()=>s.current,scrollTo:r=>{s.current&&s.current.scrollTo(r)},get scrollTop(){return s.current?.scrollTop||0},get scrollHeight(){return s.current?.scrollHeight||0},get clientHeight(){return s.current?.clientHeight||0}}),[]);let S=$(()=>{if(P.current){let o=P.current;if(document.contains(o)&&o.scrollHeight>o.clientHeight+2)return o;P.current=null}if(!s.current)return null;if(_.current&&_.current.scrollHeight>s.current.clientHeight+2)return P.current=s.current,s.current;if(!K)return null;let r=s.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of r){let l=o;if(l!==s.current&&l.classList.contains("overlay-scrollbar-container"))continue;let c=l.parentElement,b=!1;for(;c&&c!==s.current;){if(c.classList.contains("overlay-scrollbar-container")&&c!==s.current){b=!0;break}c=c.parentElement}if(!b&&l.scrollHeight>l.clientHeight+2)return P.current=l,l}return null},[]),ie=$(()=>S()!==null,[S]),t=$(()=>{we.current&&(clearTimeout(we.current),we.current=null)},[]),n=$(()=>{Se.current&&(clearTimeout(Se.current),Se.current=null)},[]),L=$(()=>{U.current&&(clearTimeout(U.current),U.current=null)},[]),u=$(r=>{g.enabled&&(t(),we.current=setTimeout(()=>{M(!1),we.current=null},r))},[t,g.enabled]),i=$(()=>{let r=S();if(!r){M(!1),je(!1),t();return}if(je(!0),!ue.current)return;g.enabled||(M(!0),t());let o=r.clientHeight,l=r.scrollHeight,c=r.scrollTop,b=0;if(ce.current){let Ge=window.getComputedStyle(ce.current),et=parseFloat(Ge.paddingTop)||0,pt=parseFloat(Ge.paddingBottom)||0;b=et+pt}let x=A?T*2+m.margin*4:m.margin*2,B=o-x+b,V=o/l,Me=Math.max(B*V,Fe),Ae=l-o,Z=B-Me,Qe=Ae>0?c/Ae*Z:0;Ue(Me),qe(Qe)},[S,t,A,T,Fe,g.enabled]),e=$(r=>{r.preventDefault(),r.stopPropagation();let o=S();o&&(ee(!0),re({y:r.clientY,scrollTop:o.scrollTop}),t(),M(!0),oe())},[S,t,oe]),N=$(r=>{if(!I)return;let o=S();if(!o)return;let l=o.clientHeight,c=o.scrollHeight-l,b=r.clientY-pe.y,x=l-ne,B=b/x*c,V=Math.max(0,Math.min(c,pe.scrollTop+B));o.scrollTop=V,i()},[I,pe,ne,i,S]),q=$(()=>{ee(!1),ie()&&u(g.delay)},[ie,u,g.delay]),Ne=$(r=>{if(!ue.current)return;let o=ue.current.getBoundingClientRect(),l=r.clientY-o.top,c=S();if(!c)return;let b=c.clientHeight,x=c.scrollHeight,B=l/b*(x-b);c.scrollTop=Math.max(0,Math.min(x-b,B)),i(),M(!0),u(g.delay),oe()},[i,u,g.delay,S,oe]),Q=$(r=>{if(r.preventDefault(),r.stopPropagation(),!s.current)return;let o=Math.max(0,s.current.scrollTop-ke);s.current.scrollTop=o,i(),M(!0),u(g.delay),oe()},[i,u,ke,g.delay,oe]),Pe=$(r=>{if(r.preventDefault(),r.stopPropagation(),!s.current||!_.current)return;let o=s.current,l=_.current.scrollHeight-o.clientHeight,c=Math.min(l,o.scrollTop+ke);o.scrollTop=c,i(),M(!0),u(g.delay),oe()},[i,u,ke,g.delay,oe]),Le=$(r=>{if(!me.enabled)return;let o=r.target;if(st(o,me)||r.button!==0)return;let l=S();l&&(l.scrollHeight<=l.clientHeight||(r.preventDefault(),Ie(!0),v({x:r.clientX,y:r.clientY,scrollTop:l.scrollTop,scrollLeft:l.scrollLeft||0}),t()))},[me,st,S,t]),D=$(r=>{if(!xe)return;let o=S();if(!o)return;let l=Oe.x-r.clientX,c=Oe.y-r.clientY;if(Math.abs(c)<3&&Math.abs(l)<3)return;M(!0);let b=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,Oe.scrollTop+c));o.scrollTop=b,i()},[xe,Oe,S,i]),he=$(()=>{Ie(!1),ie()&&u(g.delay)},[ie,u,g.delay]);ae(()=>{let r=x=>{i(),t(),M(!0);let B=_e?g.delayOnWheel:g.delay;u(B),E&&E(x)},o=()=>{$e(!0),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>{$e(!1)},300),t(),L(),U.current=setTimeout(()=>{M(!0),U.current=null},50)},l=[],c=S();c&&l.push(c);let b=s.current;return b&&!c&&(l.push(b),b.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(x=>{let B=x;if(B!==b&&B.classList.contains("overlay-scrollbar-container"))return;let V=B.parentElement;for(;V&&V!==b;){if(V.classList.contains("overlay-scrollbar-container")&&V!==b)return;V=V.parentElement}l.push(B)})),l.forEach(x=>{x.addEventListener("scroll",r,{passive:!0}),x.addEventListener("wheel",o,{passive:!0})}),()=>{l.forEach(x=>{x.removeEventListener("scroll",r),x.removeEventListener("wheel",o)}),ve.current&&clearTimeout(ve.current),U.current&&clearTimeout(U.current)}},[S,i,E,t,u,g,_e]),ae(()=>{let r=l=>{let c=S();if(!c)return;let{key:b}=l,{scrollTop:x,scrollHeight:B,clientHeight:V}=c,Me=B-V,Ae=50,Z=null;switch(b){case"ArrowUp":l.preventDefault(),Z=Math.max(0,x-Ae);break;case"ArrowDown":l.preventDefault(),Z=Math.min(Me,x+Ae);break;case"PageUp":l.preventDefault(),Z=Math.max(0,x-V);break;case"PageDown":l.preventDefault(),Z=Math.min(Me,x+V);break;case"Home":l.preventDefault(),Z=0;break;case"End":l.preventDefault(),Z=Me;break;default:return}if(Z!==null){let Qe=Z/Me,Ge=A?T*2+m.margin*4:m.margin*2,et=(V-Ge-ne)*Qe;qe(et),c.scrollTop=Z,t(),M(!0),u(g.delay)}},o=s.current;if(o)return o.addEventListener("keydown",r),()=>{o.removeEventListener("keydown",r)}},[S,A,T,m.margin,ne,t,u,g.delay]),ae(()=>{if(xe)return document.addEventListener("mousemove",D),document.addEventListener("mouseup",he),()=>{document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",he)}},[xe,D,he]),ae(()=>{if(I)return document.addEventListener("mousemove",N),document.addEventListener("mouseup",q),()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",q)}},[I,N,q]),ae(()=>{i();let r=setTimeout(()=>{i()},100);return()=>clearTimeout(r)},[i]),yt(()=>{Ye(!0),i(),!g.enabled&&ie()&&M(!0)},[ie,i,g.enabled]),ae(()=>{let r=new ResizeObserver(()=>{i()}),o=[];return s.current&&o.push(s.current),_.current&&o.push(_.current),P.current&&document.contains(P.current)&&o.push(P.current),o.forEach(l=>{r.observe(l)}),()=>r.disconnect()},[i]),ae(()=>{if(!s.current)return;let r=new MutationObserver(()=>{P.current=null,i()});return r.observe(s.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>r.disconnect()},[i]);let le=Math.max(Je,T);return ae(()=>{let r="overlay-scrollbar-webkit-hide",o=document.getElementById(r);o&&o.remove();let l=document.createElement("style");return l.id=r,l.textContent=`
2
2
  .overlay-scrollbar-container::-webkit-scrollbar {
3
3
  display: none !important;
4
4
  width: 0 !important;
@@ -18,7 +18,7 @@ import{forwardRef as et,useCallback as ke,useMemo as tt,useRef as ie,useEffect a
18
18
  outline: 2px solid rgba(0, 123, 255, 0.5);
19
19
  outline-offset: -2px;
20
20
  }
21
- `,document.head.appendChild(i),()=>{let u=document.getElementById(t);u&&u.remove()}},[]),ct("div",{ref:le,className:`overlay-scrollbar-wrapper ${a}`,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",...f},children:[Se("div",{ref:l,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:Oe,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:h?"none":"auto",...g},children:Se("div",{ref:_,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...v},children:S})}),q&&ve&&ct("div",{ref:ae,className:"overlay-scrollbar-track",onMouseEnter:()=>{e(),U.current=setTimeout(()=>{C(!0),U.current=null},100)},onMouseLeave:()=>{V(),O||L(b.delay)},style:{position:"absolute",top:0,right:0,width:`${be}px`,height:"100%",opacity:G?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[y.visible&&Se("div",{className:"overlay-scrollbar-track-background",onClick:t=>{t.preventDefault(),t.stopPropagation(),Te(t)},style:{position:"absolute",top:n?`${I.width+y.margin*2}px`:`${y.margin}px`,right:y.alignment==="right"?"0px":`${(be-I.width)/2}px`,width:`${I.width}px`,height:n?`calc(100% - ${I.width*2+y.margin*4}px)`:`calc(100% - ${y.margin*2}px)`,backgroundColor:y.color,borderRadius:`${y.radius}px`,cursor:"pointer"}}),Se("div",{ref:se,className:"overlay-scrollbar-thumb",onMouseDown:Re,onMouseEnter:()=>ye(!0),onMouseLeave:()=>ye(!1),style:{position:"absolute",top:`${(n?$+y.margin*2:y.margin)+Ge}px`,right:y.alignment==="right"?"0px":`${(be-$)/2}px`,width:`${$}px`,height:`${Math.max(re,Ce)}px`,backgroundColor:te||O?I.hoverColor:I.color,opacity:te||O?I.hoverOpacity:I.opacity,borderRadius:`${I.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),q&&ve&&n&&Se("div",{className:"overlay-scrollbar-up-arrow",onClick:He,onMouseEnter:()=>we("up"),onMouseLeave:()=>we(null),style:{position:"absolute",top:`${y.margin}px`,right:y.alignment==="right"?"0px":`${(be-$)/2}px`,width:`${$}px`,height:`${$}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max($*.75,8)}px`,color:he==="up"?B.hoverColor:B.color,userSelect:"none",zIndex:1001,opacity:G?he==="up"?B.hoverOpacity:B.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),q&&ve&&n&&Se("div",{className:"overlay-scrollbar-down-arrow",onClick:Ie,onMouseEnter:()=>we("down"),onMouseLeave:()=>we(null),style:{position:"absolute",bottom:`${y.margin}px`,right:y.alignment==="right"?"0px":`${(be-$)/2}px`,width:`${$}px`,height:`${$}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max($*.75,8)}px`,color:he==="down"?B.hoverColor:B.color,userSelect:"none",zIndex:1001,opacity:G?he==="down"?B.hoverOpacity:B.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"})]})}),ut=Lt;import{Fragment as Ye,jsx as p,jsxs as Le}from"react/jsx-runtime";var Pt={alignment:"right",margin:0,radius:0},dt=5;function Ft({data:a,loading:f=!1,columns:g,onRowClick:v,getRowId:S,selectedRowId:E,selectedRowSx:M,rowHeight:k=50,columnHeight:R=56,striped:z,rowDivider:X=!0,onSort:q,onLoadMore:K,sortBy:H,sortDirection:Y,showPaper:le=!0,paddingX:l="1rem",paddingTop:_=0,paddingBottom:ae=0,rowHoverColor:se,rowHoverOpacity:P,viewportBuffer:G,overscan:C,scrollbars:O,emptyMessage:ee="NO DATA",LoadingComponent:te}){let ye=Math.max(k*12,480),me=Math.max(k*12,480),De=typeof G=="number"?G:G?.top??ye,re=typeof G=="number"?G:G?.bottom??me,_e=Math.max(k*8,420),Ge=Math.max(k*10,520),Be=typeof C=="number"?C:{main:C?.main??_e,reverse:C?.reverse??Ge},ve=k+(X?1:0),Xe=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),[h]=rt(()=>typeof window>"u"?!1:window.localStorage.getItem("vdt-perf-debug")==="1"),m=ie({wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}),ce=ke(n=>{if(!h)return;let r=m.current;if(!(r.wheelEvents>0||r.rangeChangedCalls>0||r.rowContentCalls>0||r.cellRenderCalls>0))return;let s=r.rowContentCalls>0?r.rowContentMs/r.rowContentCalls:0,c=r.cellRenderCalls>0?r.cellRenderMs/r.cellRenderCalls:0;console.log("[VDT perf]",{reason:n,wheel:{events:r.wheelEvents,inputPx:Math.round(r.wheelInputPx),handlerMs:Number(r.wheelHandlerMs.toFixed(2)),rafFlushes:r.wheelRafFlushes,rafMs:Number(r.wheelRafMs.toFixed(2))},rangeChanged:{calls:r.rangeChangedCalls,totalMs:Number(r.rangeChangedMs.toFixed(2))},rowContent:{calls:r.rowContentCalls,totalMs:Number(r.rowContentMs.toFixed(2)),avgMs:Number(s.toFixed(3)),maxMs:Number(r.rowContentMaxMs.toFixed(3))},cellRender:{calls:r.cellRenderCalls,totalMs:Number(r.cellRenderMs.toFixed(2)),avgMs:Number(c.toFixed(3)),maxMs:Number(r.cellRenderMaxMs.toFixed(3))}}),m.current={wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}},[h]);pe(()=>{if(!h||typeof window>"u")return;console.log("[VDT perf] enabled (localStorage vdt-perf-debug=1)");let n=window.setInterval(()=>{ce("interval")},1500);return()=>{window.clearInterval(n),ce("cleanup")}},[ce,h]);let Ve=tt(()=>et((n,r)=>{let x=ie(null),s=ie(0),c=ie(null);return pe(()=>{let e=x.current;if(!e)return;let V=Z=>{let L=h?performance.now():0;Z.preventDefault();let d=Z.deltaY;Z.deltaMode===1?d*=40:Z.deltaMode===2&&(d*=e.clientHeight),h&&(m.current.wheelEvents+=1,m.current.wheelInputPx+=d),s.current+=d,c.current===null&&(c.current=requestAnimationFrame(()=>{let Re=h?performance.now():0,ue=Math.max(e.clientHeight*.4,160),D=Math.max(-ue,Math.min(ue,s.current));s.current=0,c.current=null,D!==0&&(e.scrollTop+=D),h&&(m.current.wheelRafFlushes+=1,m.current.wheelRafMs+=performance.now()-Re)}),h&&(m.current.wheelHandlerMs+=performance.now()-L))};return e.addEventListener("wheel",V,{passive:!1}),()=>{e.removeEventListener("wheel",V),c.current!==null&&(cancelAnimationFrame(c.current),c.current=null),s.current=0}},[]),p(ut,{detectInnerScroll:!0,track:Pt,...O,children:p(Ht,{component:fe,...n,ref:e=>{x.current=e,typeof r=="function"?r(e):r&&(r.current=e)},sx:{userSelect:"auto",WebkitUserSelect:"auto",position:"relative",width:"100%",height:"100%",overflow:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none",msOverflowStyle:"none",transform:"translateZ(0)",backfaceVisibility:"hidden",willChange:"scroll-position","&::-webkit-scrollbar":{display:"none"},"& .MuiTable-root":{paddingRight:l,paddingTop:_,paddingBottom:ae}}})})}),[]),qe=tt(()=>{if(z===!0)return"#f5f5f5";if(typeof z=="string")return z},[z]),[ot,he]=rt(f),[we,it]=rt(0);pe(()=>{f&&he(!0)},[f]);let je=ke(()=>{he(!1)},[]),ge=ot,Ke=f&&a.length>0,Me=ie(!1),ne=ie(null),U=ie(!1),j=ie({x:0,y:0});pe(()=>{let n=r=>{let x=r.clientX-j.current.x,s=r.clientY-j.current.y;Math.sqrt(x*x+s*s)>dt&&(U.current=!0)};return document.addEventListener("mousemove",n),()=>{document.removeEventListener("mousemove",n)}},[]),pe(()=>{let n=document.querySelector('[data-testid="virtuoso-scroller"]');n&&n.querySelectorAll(".MuiTableSortLabel-root").forEach(x=>{let s=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0});x.dispatchEvent(s)})},[H]);let I=ke(n=>{if(!q)return;q(n,H===n&&Y==="asc"?"desc":"asc")},[q,H,Y]),y=ke(n=>{let r=h?performance.now():0;if(!K){h&&(m.current.rangeChangedCalls+=1,m.current.rangeChangedMs+=performance.now()-r);return}if(f&&a.length===0){h&&(m.current.rangeChangedCalls+=1,m.current.rangeChangedMs+=performance.now()-r);return}let x=a.length>=30;if(n>=a.length-1&&x&&!Me.current){Me.current=!0;let c=a.length;K(c,50)}h&&(m.current.rangeChangedCalls+=1,m.current.rangeChangedMs+=performance.now()-r)},[a.length,f,K,h]);pe(()=>{f||(Me.current=!1)},[f]),pe(()=>{a.length===0&&it(n=>n+1)},[a.length]);let B=ie(a.length);pe(()=>{let n=B.current,r=a.length;if(r>n&&n>0){B.current=r;return}ne.current&&r>0&&r<=n&&ne.current.scrollToIndex({index:0,align:"start",behavior:"auto"}),B.current=r},[a]);let Ee=ke(()=>{let n={},r=[];if(g.forEach(e=>{e.group?(n[e.group]||(n[e.group]=[]),n[e.group].push(e)):r.push(e)}),!(Object.keys(n).length>0))return p(ze,{children:g.map(e=>p(Ae,{align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable?p("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:Le(fe,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>I(String(e.id)),children:[e.text,p(nt,{active:H===e.id,direction:H===e.id?Y:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:H===e.id?1:0,transition:"opacity 0.2s ease","& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):e.text},String(e.id)))});let s=[...r.map(e=>p(Ae,{rowSpan:2,align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable&&q?p("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:Le(fe,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>I(String(e.id)),children:[e.text,p(nt,{active:H===e.id,direction:H===e.id?Y:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:H===e.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):e.text},String(e.id))),...Object.entries(n).map(([e,V])=>p(Ae,{align:"center",colSpan:V.length,style:{fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e},e))],c=[...Object.values(n).flat().map(e=>p(Ae,{align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable&&q?p("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:Le(fe,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>I(String(e.id)),children:[e.text,p(nt,{active:H===e.id,direction:H===e.id?Y:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:H===e.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(0deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(180deg)"}}})]})}):e.text},String(e.id)))];return Le(Ye,{children:[p(ze,{children:s}),p(ze,{children:c})]})},[g,H,Y,I,q,R]),b=ke((n,r)=>{let x=h?performance.now():0;if(!r){if(h){m.current.rowContentCalls+=1;let c=performance.now()-x;m.current.rowContentMs+=c,m.current.rowContentMaxMs=Math.max(m.current.rowContentMaxMs,c)}return null}let s=g.map(c=>{let e=h?performance.now():0,V=c.render?c.render(r,n):String(r[c.id]||"");if(h){let Z=performance.now()-e;m.current.cellRenderCalls+=1,m.current.cellRenderMs+=Z,m.current.cellRenderMaxMs=Math.max(m.current.cellRenderMaxMs,Z)}return p(Ae,{align:c.align||"left",style:{width:c.width,minWidth:c.width,...c.style,padding:"8px 16px"},children:V},String(c.id))});if(h){m.current.rowContentCalls+=1;let c=performance.now()-x;m.current.rowContentMs+=c,m.current.rowContentMaxMs=Math.max(m.current.rowContentMaxMs,c)}return p(Ye,{children:s})},[g,h]),Ue=tt(()=>({Scroller:Ve,Table:n=>p(Et,{...n,sx:{borderCollapse:"separate",tableLayout:"fixed",marginRight:"16px"}}),TableHead:et((n,r)=>p(It,{...n,ref:r,sx:{userSelect:"none","& tr":{height:R,"& th":{padding:"16px",position:"sticky",top:0,zIndex:2,fontWeight:"bold"}}}})),TableRow:n=>{let{item:r,selected:x,"aria-selected":s,className:c,...e}=n,V=e["data-index"]??0,Z=V%2===1,L=r&&S?S(r,V):V,d=E!=null&&L===E,Re=d&&M?typeof M=="function"?M(r,V):M:void 0,ue=String(c??"").split(/\s+/).filter(D=>D!=="Mui-selected"&&D!=="Mui-focusVisible").join(" ");return p(ze,{...e,className:ue||void 0,selected:d,onMouseDown:D=>{U.current=!1,j.current={x:D.clientX,y:D.clientY}},onClick:D=>{let Te=D.clientX-j.current.x,He=D.clientY-j.current.y;if(Math.sqrt(Te*Te+He*He)>dt||U.current){D.preventDefault(),D.stopPropagation(),U.current=!1;return}r&&v&&v(r,V),U.current=!1},sx:[{userSelect:"none",height:k,backgroundColor:Z&&qe?qe:"transparent","& td":{padding:"8px 16px",borderBottom:X?"1px solid rgba(224, 224, 224, 1)":"none"},"& th":{padding:"8px 16px",borderBottom:"none"},"&:hover":v&&!d?{backgroundColor:D=>{let Te=D.palette.mode==="dark",Ie=se??"#000000",Oe=P??.06;if(!se)return Te?`rgba(255, 255, 255, ${Oe})`:`rgba(0, 0, 0, ${Oe})`;let de=Ie.replace("#","").trim();if(de.length!==6)return Ie;let $e=parseInt(de.substring(0,2),16),be=parseInt(de.substring(2,4),16),t=parseInt(de.substring(4,6),16);return`rgba(${$e}, ${be}, ${t}, ${Oe})`}}:void 0,cursor:v?"pointer":void 0},Re]})},TableBody:et((n,r)=>p(Rt,{...n,ref:r}))}),[v,S,E,M,k,qe,X,R,se,P,Ve]),Ce=Le(fe,{sx:{position:"relative",height:"100%",width:"100%","& .MuiTableHead-root":{backgroundColor:n=>n.palette.mode==="dark"?"#1e1e1e !important":"#ffffff !important"}},children:[p(Nt,{ref:ne,data:a,totalCount:K?a.length+1:a.length,defaultItemHeight:ve,fixedItemHeight:ve,fixedHeaderContent:Ee,itemContent:b,endReached:y,style:{height:"100%"},increaseViewportBy:{top:De,bottom:re},overscan:Be,followOutput:!1,components:Ue},we),a.length===0&&!f&&p(fe,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:typeof ee=="string"?Le(Ye,{children:[p(fe,{sx:{width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5f5",color:"#999"},children:"\u{1F4C4}"}),p($t,{variant:"body1",sx:{color:"text.secondary"},children:ee})]}):ee}),ge&&p(Ye,{children:te?p(te,{visible:f,onComplete:je}):p(at,{visible:f,onComplete:je,size:40,sx:{top:`${g.some(n=>n.group)?R*2:R}px`},background:{show:a.length===0,opacity:.8}})})]});return le?p(Ot,{className:"grow",elevation:1,sx:{padding:0,paddingLeft:l,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:Ce}):p(fe,{className:"grow",style:{padding:0,paddingLeft:l,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:Ce})}var At=Dt(Ft);export{At as VirtualDataTable};
21
+ `,document.head.appendChild(l),()=>{let c=document.getElementById(r);c&&c.remove()}},[]),ct("div",{ref:ce,className:`overlay-scrollbar-wrapper ${a}`,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",...p},children:[De("div",{ref:s,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:Le,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:xe?"none":"auto",...f},children:De("div",{ref:_,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...y},children:k})}),W&&He&&ct("div",{ref:ue,className:"overlay-scrollbar-track",onMouseEnter:()=>{t(),Se.current=setTimeout(()=>{M(!0),Se.current=null},100)},onMouseLeave:()=>{n(),I||u(g.delay)},style:{position:"absolute",top:0,right:0,width:`${le}px`,height:"100%",opacity:G?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[m.visible&&De("div",{className:"overlay-scrollbar-track-background",onClick:r=>{r.preventDefault(),r.stopPropagation(),Ne(r)},style:{position:"absolute",top:A?`${O.width+m.margin*2}px`:`${m.margin}px`,right:m.alignment==="right"?"0px":`${(le-O.width)/2}px`,width:`${O.width}px`,height:A?`calc(100% - ${O.width*2+m.margin*4}px)`:`calc(100% - ${m.margin*2}px)`,backgroundColor:m.color,borderRadius:`${m.radius}px`,cursor:"pointer"}}),De("div",{ref:de,className:"overlay-scrollbar-thumb",onMouseDown:e,onMouseEnter:()=>Te(!0),onMouseLeave:()=>Te(!1),style:{position:"absolute",top:`${(A?T+m.margin*2:m.margin)+Ze}px`,right:m.alignment==="right"?"0px":`${(le-T)/2}px`,width:`${T}px`,height:`${Math.max(ne,Fe)}px`,backgroundColor:te||I?O.hoverColor:O.color,opacity:te||I?O.hoverOpacity:O.opacity,borderRadius:`${O.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),W&&He&&A&&De("div",{className:"overlay-scrollbar-up-arrow",onClick:Q,onMouseEnter:()=>fe("up"),onMouseLeave:()=>fe(null),style:{position:"absolute",top:`${m.margin}px`,right:m.alignment==="right"?"0px":`${(le-T)/2}px`,width:`${T}px`,height:`${T}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(T*.75,8)}px`,color:ye==="up"?F.hoverColor:F.color,userSelect:"none",zIndex:1001,opacity:G?ye==="up"?F.hoverOpacity:F.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),W&&He&&A&&De("div",{className:"overlay-scrollbar-down-arrow",onClick:Pe,onMouseEnter:()=>fe("down"),onMouseLeave:()=>fe(null),style:{position:"absolute",bottom:`${m.margin}px`,right:m.alignment==="right"?"0px":`${(le-T)/2}px`,width:`${T}px`,height:`${T}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(T*.75,8)}px`,color:ye==="down"?F.hoverColor:F.color,userSelect:"none",zIndex:1001,opacity:G?ye==="down"?F.hoverOpacity:F.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"})]})}),ut=Lt;import{Fragment as Ke,jsx as d,jsxs as Re}from"react/jsx-runtime";var Pt={alignment:"right",margin:0,radius:0},dt=5;function At({data:a,loading:p=!1,columns:f,onRowClick:y,getRowId:k,selectedRowId:E,selectedRowSx:w,rowHeight:C=50,columnHeight:R=56,striped:z,rowDivider:X=!0,onSort:W,onLoadMore:K,sortBy:H,sortDirection:Y,showPaper:ce=!0,paddingX:s="1rem",paddingTop:_=0,paddingBottom:ue=0,rowHoverColor:de,rowHoverOpacity:P,viewportBuffer:G,overscan:M,scrollbars:I,emptyMessage:ee="NO DATA",LoadingComponent:te,showFooter:Te,footerHeight:pe,footerSx:re}){let ne=Math.max(C*12,480),Ue=Math.max(C*12,480),Ze=typeof G=="number"?G:G?.top??ne,qe=typeof G=="number"?G:G?.bottom??Ue,He=Math.max(C*8,420),je=Math.max(C*10,520),xe=typeof M=="number"?M:{main:M?.main??He,reverse:M?.reverse??je},Ie=C+(X?1:0),Oe=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),[v]=nt(()=>typeof window>"u"?!1:window.localStorage.getItem("vdt-perf-debug")==="1"),h=se({wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}),ze=Ce(t=>{if(!v)return;let n=h.current;if(!(n.wheelEvents>0||n.rangeChangedCalls>0||n.rowContentCalls>0||n.cellRenderCalls>0))return;let u=n.rowContentCalls>0?n.rowContentMs/n.rowContentCalls:0,i=n.cellRenderCalls>0?n.cellRenderMs/n.cellRenderCalls:0;console.log("[VDT perf]",{reason:t,wheel:{events:n.wheelEvents,inputPx:Math.round(n.wheelInputPx),handlerMs:Number(n.wheelHandlerMs.toFixed(2)),rafFlushes:n.wheelRafFlushes,rafMs:Number(n.wheelRafMs.toFixed(2))},rangeChanged:{calls:n.rangeChangedCalls,totalMs:Number(n.rangeChangedMs.toFixed(2))},rowContent:{calls:n.rowContentCalls,totalMs:Number(n.rowContentMs.toFixed(2)),avgMs:Number(u.toFixed(3)),maxMs:Number(n.rowContentMaxMs.toFixed(3))},cellRender:{calls:n.cellRenderCalls,totalMs:Number(n.cellRenderMs.toFixed(2)),avgMs:Number(i.toFixed(3)),maxMs:Number(n.cellRenderMaxMs.toFixed(3))}}),h.current={wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}},[v]);ge(()=>{if(!v||typeof window>"u")return;console.log("[VDT perf] enabled (localStorage vdt-perf-debug=1)");let t=window.setInterval(()=>{ze("interval")},1500);return()=>{window.clearInterval(t),ze("cleanup")}},[ze,v]);let ye=rt(()=>Xe((t,n)=>{let L=se(null),u=se(0),i=se(null);return ge(()=>{let e=L.current;if(!e)return;let N=q=>{let Ne=v?performance.now():0;q.preventDefault();let Q=q.deltaY;q.deltaMode===1?Q*=40:q.deltaMode===2&&(Q*=e.clientHeight),v&&(h.current.wheelEvents+=1,h.current.wheelInputPx+=Q),u.current+=Q,i.current===null&&(i.current=requestAnimationFrame(()=>{let Pe=v?performance.now():0,Le=Math.max(e.clientHeight*.4,160),D=Math.max(-Le,Math.min(Le,u.current));u.current=0,i.current=null,D!==0&&(e.scrollTop+=D),v&&(h.current.wheelRafFlushes+=1,h.current.wheelRafMs+=performance.now()-Pe)}),v&&(h.current.wheelHandlerMs+=performance.now()-Ne))};return e.addEventListener("wheel",N,{passive:!1}),()=>{e.removeEventListener("wheel",N),i.current!==null&&(cancelAnimationFrame(i.current),i.current=null),u.current=0}},[]),d(ut,{detectInnerScroll:!0,track:Pt,...I,children:d(Ht,{component:be,...t,ref:e=>{L.current=e,typeof n=="function"?n(e):n&&(n.current=e)},sx:{userSelect:"auto",WebkitUserSelect:"auto",position:"relative",width:"100%",height:"100%",overflow:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none",msOverflowStyle:"none",transform:"translateZ(0)",backfaceVisibility:"hidden",willChange:"scroll-position","&::-webkit-scrollbar":{display:"none"},"& .MuiTable-root":{paddingRight:s,paddingTop:_,paddingBottom:ue}}})})}),[]),fe=rt(()=>{if(z===!0)return"#f5f5f5";if(typeof z=="string")return z},[z]),[it,Ye]=nt(p),[ve,_e]=nt(0);ge(()=>{p&&Ye(!0)},[p]);let $e=Ce(()=>{Ye(!1)},[]),we=it,Se=p&&a.length>0,U=se(!1),O=se(null),m=se(!1),F=se({x:0,y:0});ge(()=>{let t=n=>{let L=n.clientX-F.current.x,u=n.clientY-F.current.y;Math.sqrt(L*L+u*u)>dt&&(m.current=!0)};return document.addEventListener("mousemove",t),()=>{document.removeEventListener("mousemove",t)}},[]),ge(()=>{let t=document.querySelector('[data-testid="virtuoso-scroller"]');t&&t.querySelectorAll(".MuiTableSortLabel-root").forEach(L=>{let u=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0});L.dispatchEvent(u)})},[H]);let me=Ce(t=>{if(!W)return;W(t,H===t&&Y==="asc"?"desc":"asc")},[W,H,Y]),g=Ce(t=>{let n=v?performance.now():0;if(!K){v&&(h.current.rangeChangedCalls+=1,h.current.rangeChangedMs+=performance.now()-n);return}if(p&&a.length===0){v&&(h.current.rangeChangedCalls+=1,h.current.rangeChangedMs+=performance.now()-n);return}let L=a.length>=30;if(t>=a.length-1&&L&&!U.current){U.current=!0;let i=a.length;K(i,50)}v&&(h.current.rangeChangedCalls+=1,h.current.rangeChangedMs+=performance.now()-n)},[a.length,p,K,v]);ge(()=>{p||(U.current=!1)},[p]),ge(()=>{a.length===0&&_e(t=>t+1)},[a.length]);let T=se(a.length);ge(()=>{let t=T.current,n=a.length;if(n>t&&t>0){T.current=n;return}O.current&&n>0&&n<=t&&O.current.scrollToIndex({index:0,align:"start",behavior:"auto"}),T.current=n},[a]);let Je=Ce(()=>{let t={},n=[];if(f.forEach(e=>{e.group?(t[e.group]||(t[e.group]=[]),t[e.group].push(e)):n.push(e)}),!(Object.keys(t).length>0))return d(We,{children:f.map(e=>d(Ee,{align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable?d("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:Re(be,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>me(String(e.id)),children:[e.text,d(ot,{active:H===e.id,direction:H===e.id?Y:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:H===e.id?1:0,transition:"opacity 0.2s ease","& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):e.text},String(e.id)))});let u=[...n.map(e=>d(Ee,{rowSpan:2,align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable&&W?d("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:Re(be,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>me(String(e.id)),children:[e.text,d(ot,{active:H===e.id,direction:H===e.id?Y:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:H===e.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):e.text},String(e.id))),...Object.entries(t).map(([e,N])=>d(Ee,{align:"center",colSpan:N.length,style:{fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e},e))],i=[...Object.values(t).flat().map(e=>d(Ee,{align:e.align||"left",style:{width:e.width,minWidth:e.width,...e.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e.sortable&&W?d("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:Re(be,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>me(String(e.id)),children:[e.text,d(ot,{active:H===e.id,direction:H===e.id?Y:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:H===e.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(0deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(180deg)"}}})]})}):e.text},String(e.id)))];return Re(Ke,{children:[d(We,{children:u}),d(We,{children:i})]})},[f,H,Y,me,W,R]),Fe=Ce((t,n)=>{let L=v?performance.now():0;if(!n){if(v){h.current.rowContentCalls+=1;let i=performance.now()-L;h.current.rowContentMs+=i,h.current.rowContentMaxMs=Math.max(h.current.rowContentMaxMs,i)}return null}let u=f.map(i=>{let e=v?performance.now():0,N=i.render?i.render(n,t):String(n[i.id]||"");if(v){let q=performance.now()-e;h.current.cellRenderCalls+=1,h.current.cellRenderMs+=q,h.current.cellRenderMaxMs=Math.max(h.current.cellRenderMaxMs,q)}return d(Ee,{align:i.align||"left",style:{width:i.width,minWidth:i.width,...i.style,padding:"8px 16px"},children:N},String(i.id))});if(v){h.current.rowContentCalls+=1;let i=performance.now()-L;h.current.rowContentMs+=i,h.current.rowContentMaxMs=Math.max(h.current.rowContentMaxMs,i)}return d(Ke,{children:u})},[f,v]),A=Te??f.some(t=>typeof t.footer=="function"),ke=Ce(()=>A?d(We,{children:f.map(t=>d(Ee,{align:t.align||"left",style:{width:t.width,minWidth:t.width,...t.style,fontWeight:"bold",padding:"16px"},children:t.footer?t.footer(a):null},String(t.id)))}):null,[A,f,a]),S=rt(()=>({Scroller:ye,Table:t=>d(Et,{...t,sx:{borderCollapse:"separate",tableLayout:"fixed",marginRight:"16px",...A?{height:"100%"}:{}}}),TableHead:Xe((t,n)=>d(It,{...t,ref:n,sx:{userSelect:"none","& tr":{height:R,"& th":{padding:"16px",position:"sticky",top:0,zIndex:2,fontWeight:"bold"}}}})),TableRow:t=>{let{item:n,selected:L,"aria-selected":u,className:i,...e}=t,N=e["data-index"]??0,q=N%2===1,Ne=n&&k?k(n,N):N,Q=E!=null&&Ne===E,Pe=Q&&w?typeof w=="function"?w(n,N):w:void 0,Le=String(i??"").split(/\s+/).filter(D=>D!=="Mui-selected"&&D!=="Mui-focusVisible").join(" ");return d(We,{...e,className:Le||void 0,selected:Q,onMouseDown:D=>{m.current=!1,F.current={x:D.clientX,y:D.clientY}},onClick:D=>{let he=D.clientX-F.current.x,le=D.clientY-F.current.y;if(Math.sqrt(he*he+le*le)>dt||m.current){D.preventDefault(),D.stopPropagation(),m.current=!1;return}n&&y&&y(n,N),m.current=!1},sx:[{userSelect:"none",height:C,backgroundColor:q&&fe?fe:"transparent","& td":{padding:"8px 16px",borderBottom:X?"1px solid rgba(224, 224, 224, 1)":"none"},"& th":{padding:"8px 16px",borderBottom:"none"},"&:hover":y&&!Q?{backgroundColor:D=>{let he=D.palette.mode==="dark",r=de??"#000000",o=P??.06;if(!de)return he?`rgba(255, 255, 255, ${o})`:`rgba(0, 0, 0, ${o})`;let l=r.replace("#","").trim();if(l.length!==6)return r;let c=parseInt(l.substring(0,2),16),b=parseInt(l.substring(2,4),16),x=parseInt(l.substring(4,6),16);return`rgba(${c}, ${b}, ${x}, ${o})`}}:void 0,cursor:y?"pointer":void 0},Pe]})},TableBody:Xe((t,n)=>d(Rt,{...t,ref:n})),TableFoot:Xe((t,n)=>d(Ot,{...t,ref:n,sx:[{position:"sticky",bottom:0,zIndex:2,backgroundColor:L=>L.palette.mode==="dark"?"#1e1e1e":"#ffffff","& tr":{height:pe??C},"& td":{padding:"16px",color:"inherit",fontSize:"0.875rem",borderTop:"2px solid rgba(224, 224, 224, 1)",borderBottom:"none"}},...Array.isArray(re)?re:re?[re]:[]]}))}),[y,k,E,w,C,fe,X,R,de,P,ye,pe,re,A]),ie=Re(be,{sx:{position:"relative",height:"100%",width:"100%","& .MuiTableHead-root":{backgroundColor:t=>t.palette.mode==="dark"?"#1e1e1e !important":"#ffffff !important"}},children:[d(Nt,{ref:O,data:a,totalCount:K?a.length+1:a.length,defaultItemHeight:Ie,fixedItemHeight:Ie,fixedHeaderContent:Je,fixedFooterContent:A?ke:void 0,itemContent:Fe,endReached:g,style:{height:"100%"},increaseViewportBy:{top:Ze,bottom:qe},overscan:xe,followOutput:!1,components:S},ve),a.length===0&&!p&&d(be,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:typeof ee=="string"?Re(Ke,{children:[d(be,{sx:{width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5f5",color:"#999"},children:"\u{1F4C4}"}),d(Ft,{variant:"body1",sx:{color:"text.secondary"},children:ee})]}):ee}),we&&d(Ke,{children:te?d(te,{visible:p,onComplete:$e}):d(at,{visible:p,onComplete:$e,size:40,sx:{top:`${f.some(t=>t.group)?R*2:R}px`},background:{show:a.length===0,opacity:.8}})})]});return ce?d($t,{className:"grow",elevation:1,sx:{padding:0,paddingLeft:s,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:ie}):d(be,{className:"grow",style:{padding:0,paddingLeft:s,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:ie})}var Bt=Dt(At);export{Bt as VirtualDataTable};
22
22
  /**
23
23
  * Virtual Data Table - A high-performance virtual data table component for React
24
24
  *