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