@ehfuse/mui-virtual-data-table 1.1.4 → 1.1.5

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