@ehfuse/mui-virtual-data-table 1.1.7 → 1.1.8

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 rt,useCallback as ye,useMemo as nt,useRef as z,useEffect as de,memo as Lt,useState as ot}from"react";import{flushSync as Dt}from"react-dom";import{Box as ve,Table as Et,TableBody as Ht,TableCell as We,TableContainer as It,TableHead as $t,TableRow as Ue,TableSortLabel as it,Paper as Ot,Typography as Bt}from"@mui/material";import{TableVirtuoso as Pt}from"react-virtuoso";import{jsx as tt}from"react/jsx-runtime";import{useRef as lt,useState as pt,useEffect as ft}from"react";import{Box as mt,CircularProgress as ht}from"@mui/material";var ze=function(){return ze=Object.assign||function(d){for(var y,h=1,g=arguments.length;h<g;h++){y=arguments[h];for(var E in y)Object.prototype.hasOwnProperty.call(y,E)&&(d[E]=y[E])}return d},ze.apply(this,arguments)};function at(s){var d=s.visible,y=s.onComplete,h=s.fadeoutDuration,g=h===void 0?200:h,E=s.exitDelay,p=E===void 0?0:E,R=s.size,k=R===void 0?40:R,q=s.className,te=s.style,A=s.sx,V=s.indicator,L=s.background,F=L===void 0?{show:!0,color:"255, 255, 255",opacity:.9}:L,pe=lt(void 0),l=lt(null),_=pt(d),fe=_[0],xe=_[1],$=F.show,Me=$===void 0?!0:$,S=F.color,D=S===void 0?"255, 255, 255":S,me=F.opacity,re=me===void 0?.9:me;if(ft(function(){var ie=pe.current;if(ie===!0&&d===!1&&l.current){var W=l.current;W.style.opacity="0",setTimeout(function(){xe(!1),y?.()},g+p)}else d===!0&&(xe(!0),l.current&&(l.current.style.opacity="1"));pe.current=d},[d,y,g,p]),!fe)return null;var Le=function(){return typeof V=="string"?tt("img",{src:V,alt:"Loading",style:{width:k,height:k}}):V||tt(ht,{size:k})},he=function(){return Me?D.startsWith("rgba")?{backgroundColor:D}:/^\d+,\s*\d+,\s*\d+$/.test(D)?{backgroundColor:"rgba(".concat(D,", ").concat(re,")")}:re!==1?{backgroundColor:D,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:D,opacity:re,zIndex:-1}}:{backgroundColor:D}:{backgroundColor:"transparent"}};return tt(mt,{ref:l,className:q,style:ze({},te),sx:ze(ze({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,opacity:d?1:0,transition:"opacity ".concat(g,"ms ease-out")},he()),A),children:Le()})}import{useRef as ee,useEffect as ce,useState as Y,useCallback as H,useMemo as Ae,forwardRef as gt,useImperativeHandle as bt,useLayoutEffect as yt}from"react";import{jsx as Oe,jsxs as ut}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=(s,d)=>{let y=s.tagName.toLowerCase(),h=["text","password","email","number","search","tel","url","checkbox","radio"];if(y==="input"){let g=s.type;return h.includes(g)}if(["textarea","select","button"].includes(y)||["svg","path","circle","rect","line","polygon","polyline"].includes(y)||s.getAttribute("contenteditable")==="true")return!0;if(d?.excludeSelectors){for(let g of d.excludeSelectors)if(s.matches(g))return!0}return xt(s,d)},xt=(s,d)=>{let y=[...vt,...d?.excludeClasses||[]],h=s,g=0,E=5;for(;h&&g<=E;){if(y.some(p=>h.classList.contains(p)))return!0;if(h.classList.contains("MuiDialogContent-root"))break;h=h.parentElement,g++}return!1},Mt={},Tt={},wt={},St={},Ct={},kt=gt(({className:s="",style:d={},containerStyle:y={},contentStyle:h={},children:g,onScroll:E,thumb:p=Mt,track:R=Tt,arrows:k=wt,dragScroll:q=St,autoHide:te=Ct,showScrollbar:A=!0,detectInnerScroll:V=!1},L)=>{let F=ee({});ce(()=>{F.current={children:g,onScroll:E,showScrollbar:A,thumb:p,track:R,arrows:k,dragScroll:q,autoHide:te}});let pe=ee(null),l=ee(null),_=ee(null),fe=ee(null),xe=ee(null),$=ee(null),[Me,S]=Y(!1),[D,me]=Y(!1),[re,Le]=Y(!1),[he,ie]=Y({y:0,scrollTop:0}),[W,Ye]=Y(0),[Xe,qe]=Y(0),[De,Ve]=Y(!1),[Ee,He]=Y(!1),[ge,X]=Y({x:0,y:0,scrollTop:0,scrollLeft:0}),[Te,Ke]=Y(null),[we,Se]=Y(null),[Pe,Ie]=Y(!1),le=ee(null),[Je,Fe]=Y(!1),ae=ee(null),se=ee(null),U=ee(null),O=Ae(()=>{let t=p.color??"#606060";return{width:p.width??8,minHeight:p.minHeight??50,radius:p.radius??(p.width??8)/2,color:t,opacity:p.opacity??.6,hoverColor:p.hoverColor??t,hoverOpacity:p.hoverOpacity??1}},[p]),b=Ae(()=>({width:R.width??16,color:R.color??"rgba(128, 128, 128, 0.1)",visible:R.visible??!0,alignment:R.alignment??"center",radius:R.radius??O.radius??4,margin:R.margin??4}),[R,O.radius]),G=Ae(()=>{let t=k.color??"#808080";return{visible:k.visible??!1,step:k.step??50,color:t,opacity:k.opacity??.6,hoverColor:k.hoverColor??t,hoverOpacity:k.hoverOpacity??1}},[k]),Re=Ae(()=>({enabled:q.enabled??!0,excludeClasses:q.excludeClasses??[],excludeSelectors:q.excludeSelectors??[]}),[q]),v=Ae(()=>({enabled:te.enabled??!0,delay:te.delay??1500,delayOnWheel:te.delayOnWheel??700}),[te]),C=O.width,o=b.width,i=O.minHeight,f=G.visible,M=G.step,I=H(()=>{if(!l.current)return;let t=document.activeElement;t&&l.current.contains(t)&&t!==l.current||l.current.focus()},[]);bt(L,()=>({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 e=H(()=>{if($.current){let n=$.current;if(document.contains(n)&&n.scrollHeight>n.clientHeight+2)return n;$.current=null}if(!l.current)return null;if(_.current&&_.current.scrollHeight>l.current.clientHeight+2)return $.current=l.current,l.current;if(!V)return null;let t=l.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let n of t){let r=n;if(r!==l.current&&r.classList.contains("overlay-scrollbar-container"))continue;let a=r.parentElement,u=!1;for(;a&&a!==l.current;){if(a.classList.contains("overlay-scrollbar-container")&&a!==l.current){u=!0;break}a=a.parentElement}if(!u&&r.scrollHeight>r.clientHeight+2)return $.current=r,r}return null},[]),N=H(()=>e()!==null,[e]),T=H(()=>{ae.current&&(clearTimeout(ae.current),ae.current=null)},[]),Ze=H(()=>{se.current&&(clearTimeout(se.current),se.current=null)},[]),j=H(()=>{U.current&&(clearTimeout(U.current),U.current=null)},[]),x=H(t=>{v.enabled&&(T(),ae.current=setTimeout(()=>{S(!1),ae.current=null},t))},[T,v.enabled]),m=H(()=>{let t=e();if(!t){S(!1),Ve(!1),T();return}if(Ve(!0),!fe.current)return;v.enabled||(S(!0),T());let n=t.clientHeight,r=t.scrollHeight,a=t.scrollTop,u=0;if(pe.current){let _e=window.getComputedStyle(pe.current),et=parseFloat(_e.paddingTop)||0,dt=parseFloat(_e.paddingBottom)||0;u=et+dt}let w=f?C*2+b.margin*4:b.margin*2,B=n-w+u,P=n/r,ke=Math.max(B*P,i),je=r-n,Q=B-ke,Qe=je>0?a/je*Q:0;Ye(ke),qe(Qe)},[e,T,f,C,i,v.enabled]),$e=H(t=>{t.preventDefault(),t.stopPropagation();let n=e();n&&(me(!0),ie({y:t.clientY,scrollTop:n.scrollTop}),T(),S(!0),I())},[e,T,I]),Ne=H(t=>{if(!D)return;let n=e();if(!n)return;let r=n.clientHeight,a=n.scrollHeight-r,u=t.clientY-he.y,w=r-W,B=u/w*a,P=Math.max(0,Math.min(a,he.scrollTop+B));n.scrollTop=P,m()},[D,he,W,m,e]),Ce=H(()=>{me(!1),N()&&x(v.delay)},[N,x,v.delay]),ne=H(t=>{if(!fe.current)return;let n=fe.current.getBoundingClientRect(),r=t.clientY-n.top,a=e();if(!a)return;let u=a.clientHeight,w=a.scrollHeight,B=r/u*(w-u);a.scrollTop=Math.max(0,Math.min(w-u,B)),m(),S(!0),x(v.delay),I()},[m,x,v.delay,e,I]),K=H(t=>{if(t.preventDefault(),t.stopPropagation(),!l.current)return;let n=Math.max(0,l.current.scrollTop-M);l.current.scrollTop=n,m(),S(!0),x(v.delay),I()},[m,x,M,v.delay,I]),J=H(t=>{if(t.preventDefault(),t.stopPropagation(),!l.current||!_.current)return;let n=l.current,r=_.current.scrollHeight-n.clientHeight,a=Math.min(r,n.scrollTop+M);n.scrollTop=a,m(),S(!0),x(v.delay),I()},[m,x,M,v.delay,I]),be=H(t=>{if(!Re.enabled)return;let n=t.target;if(st(n,Re)||t.button!==0)return;let r=e();r&&(r.scrollHeight<=r.clientHeight||(t.preventDefault(),He(!0),X({x:t.clientX,y:t.clientY,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft||0}),T()))},[Re,st,e,T]),ue=H(t=>{if(!Ee)return;let n=e();if(!n)return;let r=ge.x-t.clientX,a=ge.y-t.clientY;if(Math.abs(a)<3&&Math.abs(r)<3)return;S(!0);let u=Math.max(0,Math.min(n.scrollHeight-n.clientHeight,ge.scrollTop+a));n.scrollTop=u,m()},[Ee,ge,e,m]),oe=H(()=>{He(!1),N()&&x(v.delay)},[N,x,v.delay]);ce(()=>{let t=w=>{m(),T(),S(!0);let B=Je?v.delayOnWheel:v.delay;x(B),E&&E(w)},n=()=>{Fe(!0),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{Fe(!1)},300),T(),j(),U.current=setTimeout(()=>{S(!0),U.current=null},50)},r=[],a=e();a&&r.push(a);let u=l.current;return u&&!a&&(r.push(u),u.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(w=>{let B=w;if(B!==u&&B.classList.contains("overlay-scrollbar-container"))return;let P=B.parentElement;for(;P&&P!==u;){if(P.classList.contains("overlay-scrollbar-container")&&P!==u)return;P=P.parentElement}r.push(B)})),r.forEach(w=>{w.addEventListener("scroll",t,{passive:!0}),w.addEventListener("wheel",n,{passive:!0})}),()=>{r.forEach(w=>{w.removeEventListener("scroll",t),w.removeEventListener("wheel",n)}),le.current&&clearTimeout(le.current),U.current&&clearTimeout(U.current)}},[e,m,E,T,x,v,Je]),ce(()=>{let t=r=>{let a=e();if(!a)return;let{key:u}=r,{scrollTop:w,scrollHeight:B,clientHeight:P}=a,ke=B-P,je=50,Q=null;switch(u){case"ArrowUp":r.preventDefault(),Q=Math.max(0,w-je);break;case"ArrowDown":r.preventDefault(),Q=Math.min(ke,w+je);break;case"PageUp":r.preventDefault(),Q=Math.max(0,w-P);break;case"PageDown":r.preventDefault(),Q=Math.min(ke,w+P);break;case"Home":r.preventDefault(),Q=0;break;case"End":r.preventDefault(),Q=ke;break;default:return}if(Q!==null){let Qe=Q/ke,_e=f?C*2+b.margin*4:b.margin*2,et=(P-_e-W)*Qe;qe(et),a.scrollTop=Q,T(),S(!0),x(v.delay)}},n=l.current;if(n)return n.addEventListener("keydown",t),()=>{n.removeEventListener("keydown",t)}},[e,f,C,b.margin,W,T,x,v.delay]),ce(()=>{if(Ee)return document.addEventListener("mousemove",ue),document.addEventListener("mouseup",oe),()=>{document.removeEventListener("mousemove",ue),document.removeEventListener("mouseup",oe)}},[Ee,ue,oe]),ce(()=>{if(D)return document.addEventListener("mousemove",Ne),document.addEventListener("mouseup",Ce),()=>{document.removeEventListener("mousemove",Ne),document.removeEventListener("mouseup",Ce)}},[D,Ne,Ce]),ce(()=>{m();let t=setTimeout(()=>{m()},100);return()=>clearTimeout(t)},[m]),yt(()=>{Ie(!0),m(),!v.enabled&&N()&&S(!0)},[N,m,v.enabled]),ce(()=>{let t=new ResizeObserver(()=>{m()}),n=[];return l.current&&n.push(l.current),_.current&&n.push(_.current),$.current&&document.contains($.current)&&n.push($.current),n.forEach(r=>{t.observe(r)}),()=>t.disconnect()},[m]),ce(()=>{if(!l.current)return;let t=new MutationObserver(()=>{$.current=null,m()});return t.observe(l.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[m]);let Z=Math.max(o,C);return ce(()=>{let t="overlay-scrollbar-webkit-hide",n=document.getElementById(t);n&&n.remove();let r=document.createElement("style");return r.id=t,r.textContent=`
1
+ import{forwardRef as tt,useCallback as be,useMemo as rt,useRef as q,useEffect as Oe,memo as Lt,useState as ct}from"react";import{Box as ye,Table as Dt,TableBody as Et,TableCell as Ye,TableContainer as Ht,TableHead as It,TableRow as Fe,TableSortLabel as ot,Paper as Rt,Typography as $t}from"@mui/material";import{TableVirtuoso as Ot}from"react-virtuoso";import{jsx as et}from"react/jsx-runtime";import{useRef as nt,useState as pt,useEffect as ft}from"react";import{Box as mt,CircularProgress as ht}from"@mui/material";var ze=function(){return ze=Object.assign||function(p){for(var m,g=1,M=arguments.length;g<M;g++){m=arguments[g];for(var C in m)Object.prototype.hasOwnProperty.call(m,C)&&(p[C]=m[C])}return p},ze.apply(this,arguments)};function it(a){var p=a.visible,m=a.onComplete,g=a.fadeoutDuration,M=g===void 0?200:g,C=a.exitDelay,y=C===void 0?0:C,B=a.size,k=B===void 0?40:B,W=a.className,ee=a.style,N=a.sx,V=a.indicator,L=a.background,F=L===void 0?{show:!0,color:"255, 255, 255",opacity:.9}:L,de=nt(void 0),l=nt(null),_=pt(p),pe=_[0],ve=_[1],I=F.show,xe=I===void 0?!0:I,x=F.color,D=x===void 0?"255, 255, 255":x,fe=F.opacity,te=fe===void 0?.9:fe;if(ft(function(){var Be=de.current;if(Be===!0&&p===!1&&l.current){var ne=l.current;ne.style.opacity="0",setTimeout(function(){ve(!1),m?.()},M+y)}else p===!0&&(ve(!0),l.current&&(l.current.style.opacity="1"));de.current=p},[p,m,M,y]),!pe)return null;var Ee=function(){return typeof V=="string"?et("img",{src:V,alt:"Loading",style:{width:k,height:k}}):V||et(ht,{size:k})},me=function(){return xe?D.startsWith("rgba")?{backgroundColor:D}:/^\d+,\s*\d+,\s*\d+$/.test(D)?{backgroundColor:"rgba(".concat(D,", ").concat(te,")")}:te!==1?{backgroundColor:D,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:D,opacity:te,zIndex:-1}}:{backgroundColor:D}:{backgroundColor:"transparent"}};return et(mt,{ref:l,className:W,style:ze({},ee),sx:ze(ze({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(M,"ms ease-out")},me()),N),children:Ee()})}import{useRef as Q,useEffect as ue,useState as Y,useCallback as H,useMemo as Ae,forwardRef as gt,useImperativeHandle as bt,useLayoutEffect as yt}from"react";import{jsx as $e,jsxs as at}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"],lt=(a,p)=>{let m=a.tagName.toLowerCase(),g=["text","password","email","number","search","tel","url","checkbox","radio"];if(m==="input"){let M=a.type;return g.includes(M)}if(["textarea","select","button"].includes(m)||["svg","path","circle","rect","line","polygon","polyline"].includes(m)||a.getAttribute("contenteditable")==="true")return!0;if(p?.excludeSelectors){for(let M of p.excludeSelectors)if(a.matches(M))return!0}return xt(a,p)},xt=(a,p)=>{let m=[...vt,...p?.excludeClasses||[]],g=a,M=0,C=5;for(;g&&M<=C;){if(m.some(y=>g.classList.contains(y)))return!0;if(g.classList.contains("MuiDialogContent-root"))break;g=g.parentElement,M++}return!1},wt={},Mt={},Tt={},St={},Ct={},kt=gt(({className:a="",style:p={},containerStyle:m={},contentStyle:g={},children:M,onScroll:C,thumb:y=wt,track:B=Mt,arrows:k=Tt,dragScroll:W=St,autoHide:ee=Ct,showScrollbar:N=!0,detectInnerScroll:V=!1},L)=>{let F=Q({});ue(()=>{F.current={children:M,onScroll:C,showScrollbar:N,thumb:y,track:B,arrows:k,dragScroll:W,autoHide:ee}});let de=Q(null),l=Q(null),_=Q(null),pe=Q(null),ve=Q(null),I=Q(null),[xe,x]=Y(!1),[D,fe]=Y(!1),[te,Ee]=Y(!1),[me,Be]=Y({y:0,scrollTop:0}),[ne,qe]=Y(0),[Ge,Ue]=Y(0),[we,He]=Y(!1),[R,ie]=Y(!1),[Me,We]=Y({x:0,y:0,scrollTop:0,scrollLeft:0}),[Xe,Ne]=Y(null),[le,he]=Y(null),[ut,Ke]=Y(!1),ae=Q(null),[Ie,Te]=Y(!1),Se=Q(null),se=Q(null),ce=Q(null),$=Ae(()=>{let e=y.color??"#606060";return{width:y.width??8,minHeight:y.minHeight??50,radius:y.radius??(y.width??8)/2,color:e,opacity:y.opacity??.6,hoverColor:y.hoverColor??e,hoverOpacity:y.hoverOpacity??1}},[y]),h=Ae(()=>({width:B.width??16,color:B.color??"rgba(128, 128, 128, 0.1)",visible:B.visible??!0,alignment:B.alignment??"center",radius:B.radius??$.radius??4,margin:B.margin??4}),[B,$.radius]),j=Ae(()=>{let e=k.color??"#808080";return{visible:k.visible??!1,step:k.step??50,color:e,opacity:k.opacity??.6,hoverColor:k.hoverColor??e,hoverOpacity:k.hoverOpacity??1}},[k]),o=Ae(()=>({enabled:W.enabled??!0,excludeClasses:W.excludeClasses??[],excludeSelectors:W.excludeSelectors??[]}),[W]),r=Ae(()=>({enabled:ee.enabled??!0,delay:ee.delay??1500,delayOnWheel:ee.delayOnWheel??700}),[ee]),s=$.width,T=h.width,G=$.minHeight,t=j.visible,U=j.step,X=H(()=>{if(!l.current)return;let e=document.activeElement;e&&l.current.contains(e)&&e!==l.current||l.current.focus()},[]);bt(L,()=>({getScrollContainer:()=>l.current,scrollTo:e=>{l.current&&l.current.scrollTo(e)},get scrollTop(){return l.current?.scrollTop||0},get scrollHeight(){return l.current?.scrollHeight||0},get clientHeight(){return l.current?.clientHeight||0}}),[]);let f=H(()=>{if(I.current){let n=I.current;if(document.contains(n)&&n.scrollHeight>n.clientHeight+2)return n;I.current=null}if(!l.current)return null;if(_.current&&_.current.scrollHeight>l.current.clientHeight+2)return I.current=l.current,l.current;if(!V)return null;let e=l.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let n of e){let i=n;if(i!==l.current&&i.classList.contains("overlay-scrollbar-container"))continue;let c=i.parentElement,b=!1;for(;c&&c!==l.current;){if(c.classList.contains("overlay-scrollbar-container")&&c!==l.current){b=!0;break}c=c.parentElement}if(!b&&i.scrollHeight>i.clientHeight+2)return I.current=i,i}return null},[]),re=H(()=>f()!==null,[f]),E=H(()=>{Se.current&&(clearTimeout(Se.current),Se.current=null)},[]),Re=H(()=>{se.current&&(clearTimeout(se.current),se.current=null)},[]),Je=H(()=>{ce.current&&(clearTimeout(ce.current),ce.current=null)},[]),S=H(e=>{r.enabled&&(E(),Se.current=setTimeout(()=>{x(!1),Se.current=null},e))},[E,r.enabled]),u=H(()=>{let e=f();if(!e){x(!1),He(!1),E();return}if(He(!0),!pe.current)return;r.enabled||(x(!0),E());let n=e.clientHeight,i=e.scrollHeight,c=e.scrollTop,b=0;if(de.current){let Ve=window.getComputedStyle(de.current),Qe=parseFloat(Ve.paddingTop)||0,dt=parseFloat(Ve.paddingBottom)||0;b=Qe+dt}let v=t?s*2+h.margin*4:h.margin*2,O=n-v+b,P=n/i,De=Math.max(O*P,G),je=i-n,Z=O-De,Ze=je>0?c/je*Z:0;qe(De),Ue(Ze)},[f,E,t,s,G,r.enabled]),K=H(e=>{e.preventDefault(),e.stopPropagation();let n=f();n&&(fe(!0),Be({y:e.clientY,scrollTop:n.scrollTop}),E(),x(!0),X())},[f,E,X]),z=H(e=>{if(!D)return;let n=f();if(!n)return;let i=n.clientHeight,c=n.scrollHeight-i,b=e.clientY-me.y,v=i-ne,O=b/v*c,P=Math.max(0,Math.min(c,me.scrollTop+O));n.scrollTop=P,u()},[D,me,ne,u,f]),oe=H(()=>{fe(!1),re()&&S(r.delay)},[re,S,r.delay]),Ce=H(e=>{if(!pe.current)return;let n=pe.current.getBoundingClientRect(),i=e.clientY-n.top,c=f();if(!c)return;let b=c.clientHeight,v=c.scrollHeight,O=i/b*(v-b);c.scrollTop=Math.max(0,Math.min(v-b,O)),u(),x(!0),S(r.delay),X()},[u,S,r.delay,f,X]),ge=H(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current)return;let n=Math.max(0,l.current.scrollTop-U);l.current.scrollTop=n,u(),x(!0),S(r.delay),X()},[u,S,U,r.delay,X]),ke=H(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current||!_.current)return;let n=l.current,i=_.current.scrollHeight-n.clientHeight,c=Math.min(i,n.scrollTop+U);n.scrollTop=c,u(),x(!0),S(r.delay),X()},[u,S,U,r.delay,X]),J=H(e=>{if(!o.enabled)return;let n=e.target;if(lt(n,o)||e.button!==0)return;let i=f();i&&(i.scrollHeight<=i.clientHeight||(e.preventDefault(),ie(!0),We({x:e.clientX,y:e.clientY,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft||0}),E()))},[o,lt,f,E]),Le=H(e=>{if(!R)return;let n=f();if(!n)return;let i=Me.x-e.clientX,c=Me.y-e.clientY;if(Math.abs(c)<3&&Math.abs(i)<3)return;x(!0);let b=Math.max(0,Math.min(n.scrollHeight-n.clientHeight,Me.scrollTop+c));n.scrollTop=b,u()},[R,Me,f,u]),w=H(()=>{ie(!1),re()&&S(r.delay)},[re,S,r.delay]);ue(()=>{let e=v=>{u(),E(),x(!0);let O=Ie?r.delayOnWheel:r.delay;S(O),C&&C(v)},n=()=>{Te(!0),ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{Te(!1)},300),E(),Je(),ce.current=setTimeout(()=>{x(!0),ce.current=null},50)},i=[],c=f();c&&i.push(c);let b=l.current;return b&&!c&&(i.push(b),b.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(v=>{let O=v;if(O!==b&&O.classList.contains("overlay-scrollbar-container"))return;let P=O.parentElement;for(;P&&P!==b;){if(P.classList.contains("overlay-scrollbar-container")&&P!==b)return;P=P.parentElement}i.push(O)})),i.forEach(v=>{v.addEventListener("scroll",e,{passive:!0}),v.addEventListener("wheel",n,{passive:!0})}),()=>{i.forEach(v=>{v.removeEventListener("scroll",e),v.removeEventListener("wheel",n)}),ae.current&&clearTimeout(ae.current),ce.current&&clearTimeout(ce.current)}},[f,u,C,E,S,r,Ie]),ue(()=>{let e=i=>{let c=f();if(!c)return;let{key:b}=i,{scrollTop:v,scrollHeight:O,clientHeight:P}=c,De=O-P,je=50,Z=null;switch(b){case"ArrowUp":i.preventDefault(),Z=Math.max(0,v-je);break;case"ArrowDown":i.preventDefault(),Z=Math.min(De,v+je);break;case"PageUp":i.preventDefault(),Z=Math.max(0,v-P);break;case"PageDown":i.preventDefault(),Z=Math.min(De,v+P);break;case"Home":i.preventDefault(),Z=0;break;case"End":i.preventDefault(),Z=De;break;default:return}if(Z!==null){let Ze=Z/De,Ve=t?s*2+h.margin*4:h.margin*2,Qe=(P-Ve-ne)*Ze;Ue(Qe),c.scrollTop=Z,E(),x(!0),S(r.delay)}},n=l.current;if(n)return n.addEventListener("keydown",e),()=>{n.removeEventListener("keydown",e)}},[f,t,s,h.margin,ne,E,S,r.delay]),ue(()=>{if(R)return document.addEventListener("mousemove",Le),document.addEventListener("mouseup",w),()=>{document.removeEventListener("mousemove",Le),document.removeEventListener("mouseup",w)}},[R,Le,w]),ue(()=>{if(D)return document.addEventListener("mousemove",z),document.addEventListener("mouseup",oe),()=>{document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",oe)}},[D,z,oe]),ue(()=>{u();let e=setTimeout(()=>{u()},100);return()=>clearTimeout(e)},[u]),yt(()=>{Ke(!0),u(),!r.enabled&&re()&&x(!0)},[re,u,r.enabled]),ue(()=>{let e=new ResizeObserver(()=>{u()}),n=[];return l.current&&n.push(l.current),_.current&&n.push(_.current),I.current&&document.contains(I.current)&&n.push(I.current),n.forEach(i=>{e.observe(i)}),()=>e.disconnect()},[u]),ue(()=>{if(!l.current)return;let e=new MutationObserver(()=>{I.current=null,u()});return e.observe(l.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[u]);let A=Math.max(T,s);return ue(()=>{let e="overlay-scrollbar-webkit-hide",n=document.getElementById(e);n&&n.remove();let i=document.createElement("style");return i.id=e,i.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 rt,useCallback as ye,useMemo as nt,useRef as z,useEffect as
18
18
  outline: 2px solid rgba(0, 123, 255, 0.5);
19
19
  outline-offset: -2px;
20
20
  }
21
- `,document.head.appendChild(r),()=>{let a=document.getElementById(t);a&&a.remove()}},[]),ut("div",{ref:pe,className:`overlay-scrollbar-wrapper ${s}`,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",...d},children:[Oe("div",{ref:l,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:be,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:Ee?"none":"auto",...y},children:Oe("div",{ref:_,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...h},children:g})}),A&&De&&ut("div",{ref:fe,className:"overlay-scrollbar-track",onMouseEnter:()=>{T(),se.current=setTimeout(()=>{S(!0),se.current=null},100)},onMouseLeave:()=>{Ze(),D||x(v.delay)},style:{position:"absolute",top:0,right:0,width:`${Z}px`,height:"100%",opacity:Me?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[b.visible&&Oe("div",{className:"overlay-scrollbar-track-background",onClick:t=>{t.preventDefault(),t.stopPropagation(),ne(t)},style:{position:"absolute",top:f?`${O.width+b.margin*2}px`:`${b.margin}px`,right:b.alignment==="right"?"0px":`${(Z-O.width)/2}px`,width:`${O.width}px`,height:f?`calc(100% - ${O.width*2+b.margin*4}px)`:`calc(100% - ${b.margin*2}px)`,backgroundColor:b.color,borderRadius:`${b.radius}px`,cursor:"pointer"}}),Oe("div",{ref:xe,className:"overlay-scrollbar-thumb",onMouseDown:$e,onMouseEnter:()=>Le(!0),onMouseLeave:()=>Le(!1),style:{position:"absolute",top:`${(f?C+b.margin*2:b.margin)+Xe}px`,right:b.alignment==="right"?"0px":`${(Z-C)/2}px`,width:`${C}px`,height:`${Math.max(W,i)}px`,backgroundColor:re||D?O.hoverColor:O.color,opacity:re||D?O.hoverOpacity:O.opacity,borderRadius:`${O.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),A&&De&&f&&Oe("div",{className:"overlay-scrollbar-up-arrow",onClick:K,onMouseEnter:()=>Se("up"),onMouseLeave:()=>Se(null),style:{position:"absolute",top:`${b.margin}px`,right:b.alignment==="right"?"0px":`${(Z-C)/2}px`,width:`${C}px`,height:`${C}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(C*.75,8)}px`,color:we==="up"?G.hoverColor:G.color,userSelect:"none",zIndex:1001,opacity:Me?we==="up"?G.hoverOpacity:G.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),A&&De&&f&&Oe("div",{className:"overlay-scrollbar-down-arrow",onClick:J,onMouseEnter:()=>Se("down"),onMouseLeave:()=>Se(null),style:{position:"absolute",bottom:`${b.margin}px`,right:b.alignment==="right"?"0px":`${(Z-C)/2}px`,width:`${C}px`,height:`${C}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(C*.75,8)}px`,color:we==="down"?G.hoverColor:G.color,userSelect:"none",zIndex:1001,opacity:Me?we==="down"?G.hoverOpacity:G.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"})]})}),ct=kt;import{Fragment as Ge,jsx as c,jsxs as Be}from"react/jsx-runtime";var Rt={alignment:"right",margin:0,radius:0};function Nt({data:s,loading:d=!1,columns:y,onRowClick:h,onRowMouseDown:g,getRowId:E,selectedRowId:p,rowHeight:R=50,columnHeight:k=56,striped:q,rowDivider:te=!0,onSort:A,onLoadMore:V,sortBy:L,sortDirection:F,showPaper:pe=!0,paddingX:l="1rem",paddingTop:_=0,paddingBottom:fe=0,rowHoverColor:xe,rowHoverOpacity:$,scrollbars:Me,emptyMessage:S="NO DATA",LoadingComponent:D}){let me=nt(()=>rt((o,i)=>{let f=z(null);return c(ct,{detectInnerScroll:!0,track:Rt,...Me,children:c(It,{component:ve,...o,ref:M=>{f.current=M,typeof i=="function"?i(M):i&&(i.current=M)},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:fe}}})})}),[]),re=nt(()=>{if(q===!0)return"#f5f5f5";if(typeof q=="string")return q},[q]),[Le,he]=ot(d),[ie,W]=ot(null),Ye=z(p),[Xe,qe]=ot(0);de(()=>{d&&he(!0)},[d]),de(()=>{ie!==null&&ie===p&&W(null)},[ie,p]),de(()=>{Ye.current!==p&&(W(null),Ye.current=p)},[p]),de(()=>{p==null&&W(null)},[p]);let De=ye(()=>{he(!1)},[]),Ve=Le,Ee=d&&s.length>0,He=z(!1),ge=z(null),X=z(null),Te=z(!1),Ke=z({x:0,y:0,scrollTop:0}),we=z(!1),Se=z(0),Pe=z(0),Ie=z(!1),le=z({x:0,y:0}),Je=z(null),Fe=ye(o=>{},[]),ae=ye(o=>{if(!we.current||!X.current)return;let i=o.clientY-Ke.current.y;if(!Te.current&&Math.abs(i)>5&&(Te.current=!0,X.current&&(X.current.style.userSelect="none")),Te.current){let M=i*2;Pe.current+=-M;let I=X.current,e=Math.max(0,Se.current+Pe.current);I.scrollTop=e,Ke.current.y=o.clientY,o.preventDefault()}},[]),se=ye(()=>{if(we.current=!1,Te.current&&X.current){let o=Math.max(0,Se.current+Pe.current),i=()=>{X.current&&(X.current.scrollTop=o)};i(),setTimeout(i,1),setTimeout(i,5),setTimeout(i,10)}Te.current=!1,Pe.current=0,X.current&&(X.current.style.userSelect="auto")},[]);de(()=>{let o=document.querySelector('[data-testid="virtuoso-scroller"]');o&&o.querySelectorAll(".MuiTableSortLabel-root").forEach(f=>{let M=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0});f.dispatchEvent(M)})},[L]);let U=ye(o=>{if(!A)return;A(o,L===o&&F==="asc"?"desc":"asc")},[A,L,F]),O=ye(o=>{if(!V||d&&s.length===0)return;let i=Date.now(),f=window.lastRangeChangeTime||0;if(i-f<100)return;window.lastRangeChangeTime=i;let M=Math.max(10,Math.floor(s.length*.1)),I=o.endIndex>=s.length-M,e=s.length>=30;if(I&&e&&V&&!He.current){He.current=!0;let N=s.length;V(N,50)}},[s.length,d,V]);de(()=>{d||(He.current=!1)},[d]),de(()=>{s.length===0&&qe(o=>o+1)},[s.length]);let b=z(s.length);de(()=>{let o=b.current,i=s.length;if(i>o&&o>0){b.current=i;return}ge.current&&i>0&&i<=o&&ge.current.scrollToIndex({index:0,align:"start",behavior:"auto"}),b.current=i},[s]),de(()=>(document.addEventListener("mousemove",ae),document.addEventListener("mouseup",se),()=>{document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",se)}),[ae,se]);let G=ye(()=>{let o={},i=[];if(y.forEach(e=>{e.group?(o[e.group]||(o[e.group]=[]),o[e.group].push(e)):i.push(e)}),!(Object.keys(o).length>0))return c(Ue,{children:y.map(e=>c(We,{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?c("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:Be(ve,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>U(String(e.id)),children:[e.text,c(it,{active:L===e.id,direction:L===e.id?F:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:L===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 M=[...i.map(e=>c(We,{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&&A?c("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:Be(ve,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>U(String(e.id)),children:[e.text,c(it,{active:L===e.id,direction:L===e.id?F:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:L===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(o).map(([e,N])=>c(We,{align:"center",colSpan:N.length,style:{fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:e},e))],I=[...Object.values(o).flat().map(e=>c(We,{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&&A?c("div",{style:{display:"flex",alignItems:"center",justifyContent:e.align==="center"?"center":e.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:Be(ve,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>U(String(e.id)),children:[e.text,c(it,{active:L===e.id,direction:L===e.id?F:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:L===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 Be(Ge,{children:[c(Ue,{children:M}),c(Ue,{children:I})]})},[y,L,F,U,A,k]),Re=ye((o,i)=>i?c(Ge,{children:y.map(f=>c(We,{align:f.align||"left",style:{width:f.width,minWidth:f.width,...f.style,padding:"8px 16px"},children:f.render?f.render(i,o):String(i[f.id]||"")},String(f.id)))}):(console.log("rowContent - \uC544\uC774\uD15C \uC5C6\uC74C, \uC778\uB371\uC2A4:",o),null),[y]),v=nt(()=>({Scroller:me,Table:o=>c(Et,{...o,sx:{borderCollapse:"separate",tableLayout:"fixed",marginRight:"16px"}}),TableHead:rt((o,i)=>c($t,{...o,ref:i,sx:{userSelect:"none","& tr":{height:k,"& th":{padding:"16px",position:"sticky",top:0,zIndex:2,fontWeight:"bold"}}}})),TableRow:o=>{let{item:i,...f}=o,M=f["data-index"]??0,I=M%2===1,e=i&&E?E(i,M):M,N=ie??p,T=N!=null&&e===N,Ze=j=>{if(T)return"#dbeafe";let x=j.palette.mode==="dark",$e=xe??"#000000",Ne=$??.06,Ce=$e.replace("#",""),ne=parseInt(Ce.substring(0,2),16)/255,K=parseInt(Ce.substring(2,4),16)/255,J=parseInt(Ce.substring(4,6),16)/255;if(x){let be=Math.max(ne,K,J),ue=Math.min(ne,K,J),oe=0,Z=0,t=(be+ue)/2;if(be!==ue){let r=be-ue;switch(Z=t>.5?r/(2-be-ue):r/(be+ue),be){case ne:oe=((K-J)/r+(K<J?6:0))/6;break;case K:oe=((J-ne)/r+2)/6;break;case J:oe=((ne-K)/r+4)/6;break}}t=1-t;let n=(r,a,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<1/6?r+(a-r)*6*u:u<1/2?a:u<2/3?r+(a-r)*(2/3-u)*6:r);if(Z===0)ne=K=J=t;else{let r=t<.5?t*(1+Z):t+Z-t*Z,a=2*t-r;ne=n(a,r,oe+1/3),K=n(a,r,oe),J=n(a,r,oe-1/3)}}return`rgba(${Math.round(ne*255)}, ${Math.round(K*255)}, ${Math.round(J*255)}, ${Ne})`};return c(Ue,{...f,onMouseDown:j=>{Ie.current=!1,le.current={x:j.clientX,y:j.clientY},j.button===0&&(i&&(h||g)&&e!==p&&Dt(()=>{W(e)}),i&&g&&g(i,M))},onMouseMove:j=>{let x=Math.abs(j.clientX-le.current.x),m=Math.abs(j.clientY-le.current.y),$e=5;(x>$e||m>$e)&&(Ie.current=!0)},onMouseUp:j=>{j.button===0&&(!Ie.current&&!Te.current&&i&&h&&(e!==p&&W(e),h(i,M)),Ie.current=!1)},sx:j=>{let x=T?"#dbeafe":I&&re?re:"transparent",m=Ze(j);return{userSelect:"none",height:R,backgroundColor:x,boxShadow:T?"inset 3px 0 0 #3b82f6":"none","& td":{padding:"8px 16px",borderBottom:te?"1px solid rgba(224, 224, 224, 1)":"none",fontWeight:T?600:void 0,backgroundColor:x},"& th":{padding:"8px 16px",borderBottom:"none",backgroundColor:x},"&:hover":h||g?{backgroundColor:m,transition:"background-color 0.2s ease"}:void 0,"&:hover td":h||g?{backgroundColor:m,transition:"background-color 0.2s ease"}:void 0,"&:active":h||g?{backgroundColor:m}:void 0,"&:active td":h||g?{backgroundColor:m}:void 0,cursor:h||g?"pointer":void 0}}})},TableBody:rt((o,i)=>c(Ht,{...o,ref:i}))}),[h,g,E,p,ie,R,Fe,re,te,k,xe,$,me]),C=Be(ve,{sx:{position:"relative",height:"100%",width:"100%","& .MuiTableHead-root":{backgroundColor:o=>o.palette.mode==="dark"?"#1e1e1e !important":"#ffffff !important"}},children:[c(Pt,{ref:ge,data:s,totalCount:V?s.length+1:s.length,fixedHeaderContent:G,itemContent:Re,rangeChanged:O,components:v,style:{height:"100%"},increaseViewportBy:{top:100,bottom:300},overscan:5,followOutput:!1},Xe),s.length===0&&!d&&c(ve,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:typeof S=="string"?Be(Ge,{children:[c(ve,{sx:{width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5f5",color:"#999"},children:"\u{1F4C4}"}),c(Bt,{variant:"body1",sx:{color:"text.secondary"},children:S})]}):S}),Ve&&c(Ge,{children:D?c(D,{visible:d,onComplete:De}):c(at,{visible:d,onComplete:De,size:40,sx:{top:`${y.some(o=>o.group)?k*2:k}px`},background:{show:s.length===0,opacity:.8}})})]});return pe?c(Ot,{className:"grow",elevation:1,sx:{padding:0,paddingLeft:l,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:C}):c(ve,{className:"grow",style:{padding:0,paddingLeft:l,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:C})}var jt=Lt(Nt);export{jt as VirtualDataTable};
21
+ `,document.head.appendChild(i),()=>{let c=document.getElementById(e);c&&c.remove()}},[]),at("div",{ref:de,className:`overlay-scrollbar-wrapper ${a}`,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",...p},children:[$e("div",{ref:l,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:J,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:R?"none":"auto",...m},children:$e("div",{ref:_,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...g},children:M})}),N&&we&&at("div",{ref:pe,className:"overlay-scrollbar-track",onMouseEnter:()=>{E(),se.current=setTimeout(()=>{x(!0),se.current=null},100)},onMouseLeave:()=>{Re(),D||S(r.delay)},style:{position:"absolute",top:0,right:0,width:`${A}px`,height:"100%",opacity:xe?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[h.visible&&$e("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Ce(e)},style:{position:"absolute",top:t?`${$.width+h.margin*2}px`:`${h.margin}px`,right:h.alignment==="right"?"0px":`${(A-$.width)/2}px`,width:`${$.width}px`,height:t?`calc(100% - ${$.width*2+h.margin*4}px)`:`calc(100% - ${h.margin*2}px)`,backgroundColor:h.color,borderRadius:`${h.radius}px`,cursor:"pointer"}}),$e("div",{ref:ve,className:"overlay-scrollbar-thumb",onMouseDown:K,onMouseEnter:()=>Ee(!0),onMouseLeave:()=>Ee(!1),style:{position:"absolute",top:`${(t?s+h.margin*2:h.margin)+Ge}px`,right:h.alignment==="right"?"0px":`${(A-s)/2}px`,width:`${s}px`,height:`${Math.max(ne,G)}px`,backgroundColor:te||D?$.hoverColor:$.color,opacity:te||D?$.hoverOpacity:$.opacity,borderRadius:`${$.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),N&&we&&t&&$e("div",{className:"overlay-scrollbar-up-arrow",onClick:ge,onMouseEnter:()=>he("up"),onMouseLeave:()=>he(null),style:{position:"absolute",top:`${h.margin}px`,right:h.alignment==="right"?"0px":`${(A-s)/2}px`,width:`${s}px`,height:`${s}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(s*.75,8)}px`,color:le==="up"?j.hoverColor:j.color,userSelect:"none",zIndex:1001,opacity:xe?le==="up"?j.hoverOpacity:j.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),N&&we&&t&&$e("div",{className:"overlay-scrollbar-down-arrow",onClick:ke,onMouseEnter:()=>he("down"),onMouseLeave:()=>he(null),style:{position:"absolute",bottom:`${h.margin}px`,right:h.alignment==="right"?"0px":`${(A-s)/2}px`,width:`${s}px`,height:`${s}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(s*.75,8)}px`,color:le==="down"?j.hoverColor:j.color,userSelect:"none",zIndex:1001,opacity:xe?le==="down"?j.hoverOpacity:j.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"})]})}),st=kt;import{Fragment as _e,jsx as d,jsxs as Pe}from"react/jsx-runtime";var Pt={alignment:"right",margin:0,radius:0};function Bt({data:a,loading:p=!1,columns:m,onRowClick:g,getRowId:M,selectedRowId:C,selectedRowSx:y,rowHeight:B=50,columnHeight:k=56,striped:W,rowDivider:ee=!0,onSort:N,onLoadMore:V,sortBy:L,sortDirection:F,showPaper:de=!0,paddingX:l="1rem",paddingTop:_=0,paddingBottom:pe=0,rowHoverColor:ve,rowHoverOpacity:I,scrollbars:xe,emptyMessage:x="NO DATA",LoadingComponent:D}){let fe=rt(()=>tt((o,r)=>{let s=q(null);return d(st,{detectInnerScroll:!0,track:Pt,...xe,children:d(Ht,{component:ye,...o,ref:T=>{s.current=T,typeof r=="function"?r(T):r&&(r.current=T)},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:pe}}})})}),[]),te=rt(()=>{if(W===!0)return"#f5f5f5";if(typeof W=="string")return W},[W]),[Ee,me]=ct(p),[Be,ne]=ct(0);Oe(()=>{p&&me(!0)},[p]);let qe=be(()=>{me(!1)},[]),Ge=Ee,Ue=p&&a.length>0,we=q(!1),He=q(null),R=q(null),ie=q(!1),Me=q({x:0,y:0,scrollTop:0}),We=q(!1),Xe=q(0),Ne=q(0),le=q(!1),he=q({x:0,y:0}),ut=q(null),Ke=be(o=>{},[]),ae=be(o=>{if(!We.current||!R.current)return;let r=o.clientY-Me.current.y;if(!ie.current&&Math.abs(r)>5&&(ie.current=!0,R.current&&(R.current.style.userSelect="none")),ie.current){let T=r*2;Ne.current+=-T;let G=R.current,t=Math.max(0,Xe.current+Ne.current);G.scrollTop=t,Me.current.y=o.clientY,o.preventDefault()}},[]),Ie=be(()=>{if(We.current=!1,ie.current&&R.current){let o=Math.max(0,Xe.current+Ne.current),r=()=>{R.current&&(R.current.scrollTop=o)};r(),setTimeout(r,1),setTimeout(r,5),setTimeout(r,10)}ie.current=!1,Ne.current=0,R.current&&(R.current.style.userSelect="auto")},[]);Oe(()=>{let o=document.querySelector('[data-testid="virtuoso-scroller"]');o&&o.querySelectorAll(".MuiTableSortLabel-root").forEach(s=>{let T=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0});s.dispatchEvent(T)})},[L]);let Te=be(o=>{if(!N)return;N(o,L===o&&F==="asc"?"desc":"asc")},[N,L,F]),Se=be(o=>{if(!V||p&&a.length===0)return;let r=Date.now(),s=window.lastRangeChangeTime||0;if(r-s<100)return;window.lastRangeChangeTime=r;let T=Math.max(10,Math.floor(a.length*.1)),G=o.endIndex>=a.length-T,t=a.length>=30;if(G&&t&&V&&!we.current){we.current=!0;let U=a.length;V(U,50)}},[a.length,p,V]);Oe(()=>{p||(we.current=!1)},[p]),Oe(()=>{a.length===0&&ne(o=>o+1)},[a.length]);let se=q(a.length);Oe(()=>{let o=se.current,r=a.length;if(r>o&&o>0){se.current=r;return}He.current&&r>0&&r<=o&&He.current.scrollToIndex({index:0,align:"start",behavior:"auto"}),se.current=r},[a]),Oe(()=>(document.addEventListener("mousemove",ae),document.addEventListener("mouseup",Ie),()=>{document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",Ie)}),[ae,Ie]);let ce=be(()=>{let o={},r=[];if(m.forEach(t=>{t.group?(o[t.group]||(o[t.group]=[]),o[t.group].push(t)):r.push(t)}),!(Object.keys(o).length>0))return d(Fe,{children:m.map(t=>d(Ye,{align:t.align||"left",style:{width:t.width,minWidth:t.width,...t.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:t.sortable?d("div",{style:{display:"flex",alignItems:"center",justifyContent:t.align==="center"?"center":t.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:Pe(ye,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>Te(String(t.id)),children:[t.text,d(ot,{active:L===t.id,direction:L===t.id?F:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:L===t.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)"}}})]})}):t.text},String(t.id)))});let T=[...r.map(t=>d(Ye,{rowSpan:2,align:t.align||"left",style:{width:t.width,minWidth:t.width,...t.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:t.sortable&&N?d("div",{style:{display:"flex",alignItems:"center",justifyContent:t.align==="center"?"center":t.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:Pe(ye,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>Te(String(t.id)),children:[t.text,d(ot,{active:L===t.id,direction:L===t.id?F:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:L===t.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)"}}})]})}):t.text},String(t.id))),...Object.entries(o).map(([t,U])=>d(Ye,{align:"center",colSpan:U.length,style:{fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:t},t))],G=[...Object.values(o).flat().map(t=>d(Ye,{align:t.align||"left",style:{width:t.width,minWidth:t.width,...t.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:t.sortable&&N?d("div",{style:{display:"flex",alignItems:"center",justifyContent:t.align==="center"?"center":t.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:Pe(ye,{sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>Te(String(t.id)),children:[t.text,d(ot,{active:L===t.id,direction:L===t.id?F:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:L===t.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)"}}})]})}):t.text},String(t.id)))];return Pe(_e,{children:[d(Fe,{children:T}),d(Fe,{children:G})]})},[m,L,F,Te,N,k]),$=be((o,r)=>r?d(_e,{children:m.map(s=>d(Ye,{align:s.align||"left",style:{width:s.width,minWidth:s.width,...s.style,padding:"8px 16px"},children:s.render?s.render(r,o):String(r[s.id]||"")},String(s.id)))}):(console.log("rowContent - \uC544\uC774\uD15C \uC5C6\uC74C, \uC778\uB371\uC2A4:",o),null),[m]),h=rt(()=>({Scroller:fe,Table:o=>d(Dt,{...o,sx:{borderCollapse:"separate",tableLayout:"fixed",marginRight:"16px"}}),TableHead:tt((o,r)=>d(It,{...o,ref:r,sx:{userSelect:"none","& tr":{height:k,"& th":{padding:"16px",position:"sticky",top:0,zIndex:2,fontWeight:"bold"}}}})),TableRow:o=>{let{item:r,...s}=o,T=s["data-index"]??0,G=T%2===1,t=r&&M?M(r,T):T,U=C!=null&&t===C,X=U&&y?typeof y=="function"?y(r,T):y:void 0;return d(Fe,{...s,onMouseDown:f=>{le.current=!1,he.current={x:f.clientX,y:f.clientY}},onMouseMove:f=>{let re=Math.abs(f.clientX-he.current.x),E=Math.abs(f.clientY-he.current.y),Re=5;(re>Re||E>Re)&&(le.current=!0)},onClick:()=>{!le.current&&!ie.current&&r&&g&&g(r,T),le.current=!1},sx:[{userSelect:"none",height:B,backgroundColor:G&&te?te:"transparent","& td":{padding:"8px 16px",borderBottom:ee?"1px solid rgba(224, 224, 224, 1)":"none"},"& th":{padding:"8px 16px",borderBottom:"none"},"&:hover":g&&!U?{backgroundColor:f=>{let re=f.palette.mode==="dark",Re=ve??"#000000",Je=I??.06,S=Re.replace("#",""),u=parseInt(S.substring(0,2),16)/255,K=parseInt(S.substring(2,4),16)/255,z=parseInt(S.substring(4,6),16)/255;if(re){let oe=Math.max(u,K,z),Ce=Math.min(u,K,z),ge=0,ke=0,J=(oe+Ce)/2;if(oe!==Ce){let w=oe-Ce;switch(ke=J>.5?w/(2-oe-Ce):w/(oe+Ce),oe){case u:ge=((K-z)/w+(K<z?6:0))/6;break;case K:ge=((z-u)/w+2)/6;break;case z:ge=((u-K)/w+4)/6;break}}J=1-J;let Le=(w,A,e)=>(e<0&&(e+=1),e>1&&(e-=1),e<1/6?w+(A-w)*6*e:e<1/2?A:e<2/3?w+(A-w)*(2/3-e)*6:w);if(ke===0)u=K=z=J;else{let w=J<.5?J*(1+ke):J+ke-J*ke,A=2*J-w;u=Le(A,w,ge+1/3),K=Le(A,w,ge),z=Le(A,w,ge-1/3)}}return`rgba(${Math.round(u*255)}, ${Math.round(K*255)}, ${Math.round(z*255)}, ${Je})`}}:void 0,cursor:g?"pointer":void 0},X]})},TableBody:tt((o,r)=>d(Et,{...o,ref:r}))}),[g,M,C,y,B,Ke,te,ee,k,ve,I,fe]),j=Pe(ye,{sx:{position:"relative",height:"100%",width:"100%","& .MuiTableHead-root":{backgroundColor:o=>o.palette.mode==="dark"?"#1e1e1e !important":"#ffffff !important"}},children:[d(Ot,{ref:He,data:a,totalCount:V?a.length+1:a.length,fixedHeaderContent:ce,itemContent:$,rangeChanged:Se,components:h,style:{height:"100%"},increaseViewportBy:{top:100,bottom:300},overscan:5,followOutput:!1},Be),a.length===0&&!p&&d(ye,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:typeof x=="string"?Pe(_e,{children:[d(ye,{sx:{width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5f5",color:"#999"},children:"\u{1F4C4}"}),d($t,{variant:"body1",sx:{color:"text.secondary"},children:x})]}):x}),Ge&&d(_e,{children:D?d(D,{visible:p,onComplete:qe}):d(it,{visible:p,onComplete:qe,size:40,sx:{top:`${m.some(o=>o.group)?k*2:k}px`},background:{show:a.length===0,opacity:.8}})})]});return de?d(Rt,{className:"grow",elevation:1,sx:{padding:0,paddingLeft:l,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:j}):d(ye,{className:"grow",style:{padding:0,paddingLeft:l,height:"100%",minHeight:0,flex:1,display:"flex",flexDirection:"column"},children:j})}var Nt=Lt(Bt);export{Nt as VirtualDataTable};
22
22
  /**
23
23
  * Virtual Data Table - A high-performance virtual data table component for React
24
24
  *