@ehfuse/mui-virtual-data-table 1.1.2 → 1.1.4
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 +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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=i.size,$=I===void 0?40:I,Z=i.className,j=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],z=he.show,ie=z===void 0?!0:z,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:$,height:$}}):C||(0,We.jsx)(Ye.CircularProgress,{size:$})},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({},j),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:I=ut,arrows:$=dt,dragScroll:Z=pt,autoHide:j=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:I,arrows:$,dragScroll:Z,autoHide:j}});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),z=(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),P=(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:I.width??16,color:I.color??"rgba(128, 128, 128, 0.1)",visible:I.visible??!0,alignment:I.alignment??"center",radius:I.radius??P.radius??4,margin:I.margin??4}),[I,P.radius]),o=(0,e.useMemo)(()=>{let t=$.color??"#808080";return{visible:$.visible??!1,step:$.step??50,color:t,opacity:$.opacity??.6,hoverColor:$.hoverColor??t,hoverOpacity:$.hoverOpacity??1}},[$]),a=(0,e.useMemo)(()=>({enabled:Z.enabled??!0,excludeClasses:Z.excludeClasses??[],excludeSelectors:Z.excludeSelectors??[]}),[Z]),u=(0,e.useMemo)(()=>({enabled:j.enabled??!0,delay:j.delay??1500,delayOnWheel:j.delayOnWheel??700}),[j]),m=P.width,ue=w.width,r=P.minHeight,H=o.visible,A=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(z.current){let n=z.current;if(document.contains(n)&&n.scrollHeight>n.clientHeight+2)return n;z.current=null}if(!p.current)return null;if(q.current&&q.current.scrollHeight>p.current.clientHeight+2)return z.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 z.current=l,l}return null},[]),U=(0,e.useCallback)(()=>T()!==null,[T]),O=(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&&(O(),se.current=setTimeout(()=>{k(!1),se.current=null},t))},[O,u.enabled]),g=(0,e.useCallback)(()=>{let t=T();if(!t){k(!1),V(!1),O();return}if(V(!0),!ne.current)return;u.enabled||(k(!0),O());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,B=n-S+M,N=n/l,Se=Math.max(B*N,r),Be=l-n,J=B-Se,Ve=Be>0?h/Be*J:0;qe(Se),ke(Ve)},[T,O,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}),O(),k(!0),_())},[T,O,_]),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,B=M/S*h,N=Math.max(0,Math.min(h,ye.scrollTop+B));n.scrollTop=N,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,B=l/M*(S-M);h.scrollTop=Math.max(0,Math.min(S-M,B)),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-A);p.current.scrollTop=n,g(),k(!0),x(u.delay),_()},[g,x,A,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+A);n.scrollTop=h,g(),k(!0),x(u.delay),_()},[g,x,A,u.delay,_]),R=(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}),O()))},[a,Ke,T,O]),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(),O(),k(!0);let B=we?u.delayOnWheel:u.delay;x(B),L&&L(S)},n=()=>{ze(!0),ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{ze(!1)},300),O(),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 B=S;if(B!==M&&B.classList.contains("overlay-scrollbar-container"))return;let N=B.parentElement;for(;N&&N!==M;){if(N.classList.contains("overlay-scrollbar-container")&&N!==M)return;N=N.parentElement}l.push(B)})),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,O,x,u,we]),(0,e.useEffect)(()=>{let t=l=>{let h=T();if(!h)return;let{key:M}=l,{scrollTop:S,scrollHeight:B,clientHeight:N}=h,Se=B-N,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-N);break;case"PageDown":l.preventDefault(),J=Math.min(Se,S+N);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=(N-Ae-ee)*Ve;ke(Fe),h.scrollTop=J,O(),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,O,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),z.current&&document.contains(z.current)&&n.push(z.current),n.forEach(l=>{t.observe(l)}),()=>t.disconnect()},[g]),(0,e.useEffect)(()=>{if(!p.current)return;let t=new MutationObserver(()=>{z.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=`
|
|
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=`
|
|
2
2
|
.overlay-scrollbar-container::-webkit-scrollbar {
|
|
3
3
|
display: none !important;
|
|
4
4
|
width: 0 !important;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
outline: 2px solid rgba(0, 123, 255, 0.5);
|
|
19
19
|
outline-offset: -2px;
|
|
20
20
|
}
|
|
21
|
-
`,document.head.appendChild(l),()=>{let 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:R,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:()=>{O(),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?`${P.width+w.margin*2}px`:`${w.margin}px`,right:w.alignment==="right"?"0px":`${(Pe-P.width)/2}px`,width:`${P.width}px`,height:H?`calc(100% - ${P.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?P.hoverColor:P.color,opacity:pe||E?P.hoverOpacity:P.opacity,borderRadius:`${P.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:I=56,striped:$,rowDivider:Z=!0,onSort:j,onLoadMore:Y,sortBy:C,sortDirection:G,showPaper:he=!0,paddingX:Q="1rem",paddingTop:p=0,paddingBottom:q=0,rowHoverColor:ne,rowHoverOpacity:ge,scrollbars:z,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,...z,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($===!0)return"#f5f5f5";if(typeof $=="string")return $},[$]),[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(!j)return;j(o,C===o&&G==="asc"?"desc":"asc")},[j,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&&j?(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&&j?(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,j,I]),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]),P=(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:I,"& 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:A=>{He.current=!1,fe.current={x:A.clientX,y:A.clientY}},onMouseMove:A=>{let _=Math.abs(A.clientX-fe.current.x),T=Math.abs(A.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?"#dbeafe":ue&&le?le:"transparent",boxShadow:H?"inset 3px 0 0 #3b82f6":"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:A=>{if(H)return"#dbeafe";let _=A.palette.mode==="dark",U=ne??"#000000",O=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 R=me-de;switch(Te=X>.5?R/(2-me-de):R/(me+de),me){case te:re=((x-g)/R+(x<g?6:0))/6;break;case x:re=((g-te)/R+2)/6;break;case g:re=((te-x)/R+4)/6;break}}X=1-X;let Oe=(R,K,W)=>(W<0&&(W+=1),W>1&&(W-=1),W<1/6?R+(K-R)*6*W:W<1/2?K:W<2/3?R+(K-R)*(2/3-W)*6:R);if(Te===0)te=x=g=X;else{let R=X<.5?X*(1+Te):X+Te-X*Te,K=2*X-R;te=Oe(K,R,re+1/3),x=Oe(K,R,re),g=Oe(K,R,re-1/3)}}return`rgba(${Math.round(te*255)}, ${Math.round(x*255)}, ${Math.round(g*255)}, ${O})`},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,I,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:P,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)?I*2:I}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);
|
|
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);
|
|
22
22
|
/**
|
|
23
23
|
* Virtual Data Table - A high-performance virtual data table component for React
|
|
24
24
|
*
|