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