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