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

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