@ehfuse/overlay-scrollbar 1.7.8 → 1.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/OverlayScrollbar.d.ts.map +1 -1
- package/dist/index.esm.js +28 -23
- package/dist/index.esm.js.map +3 -3
- package/dist/index.js +28 -23
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
"use strict";var _e=Object.defineProperty;var Dt=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var kt=Object.prototype.hasOwnProperty;var It=(d,f)=>{for(var m in f)_e(d,m,{get:f[m],enumerable:!0})},Pt=(d,f,m,u)=>{if(f&&typeof f=="object"||typeof f=="function")for(let C of Rt(f))!kt.call(d,C)&&C!==m&&_e(d,C,{get:()=>f[C],enumerable:!(u=Dt(f,C))||u.enumerable});return d};var Wt=d=>Pt(_e({},"__esModule",{value:!0}),d);var Xt={};It(Xt,{OverlayScrollbar:()=>Be,default:()=>Be});module.exports=Wt(Xt);var t=require("react");var Ot=["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"],Ee=(d,f)=>{if(d instanceof HTMLElement&&d.isContentEditable||d.closest('[role="textbox"],[role="searchbox"]'))return!0;let m=d.tagName.toLowerCase();if(m==="input"){let u=(d.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(u)}if(["textarea","select","button"].includes(m)||["svg","path","circle","rect","line","polygon","polyline"].includes(m)||d.getAttribute("contenteditable")==="true")return!0;if(f?.excludeSelectors){for(let u of f.excludeSelectors)if(d.matches(u))return!0}return At(d,f)},At=(d,f)=>{let m=[...Ot,...f?.excludeClasses||[]],u=d,C=0,O=5;for(;u&&C<=O;){if(m.some(L=>u.classList.contains(L)))return!0;if(u.classList.contains("MuiDialogContent-root"))break;u=u.parentElement,C++}return!1};var I=require("react"),it=({containerRef:d,config:f})=>{let m=f.enabled??!0,u=f.threshold??80,C=f.maxDistance??u*2,O=f.onRefresh,[L,D]=(0,I.useState)(0),[A,q]=(0,I.useState)(!1),N=(0,I.useRef)(0),ce=(0,I.useRef)(0),Y=(0,I.useRef)(!1),Z=(0,I.useRef)(!1),ee=(0,I.useRef)(!1),se=(0,I.useRef)(0),P=(0,I.useRef)(!1);return(0,I.useEffect)(()=>{P.current=A},[A]),(0,I.useEffect)(()=>{let T=d.current;if(!T||!(m&&typeof O=="function"))return;let He=g=>{let R=g instanceof Element?g:null;for(;R&&R!==T;){if(R instanceof HTMLElement&&R.scrollHeight>R.clientHeight+1&&R.scrollTop>0)return!1;R=R.parentElement}return!0},te=g=>{Y.current=!1,Z.current=!1,ee.current=!1,!P.current&&g.touches.length===1&&T.scrollTop===0&&He(g.target)&&(Y.current=!0,N.current=g.touches[0].clientY,ce.current=g.touches[0].clientX)},l=g=>{if(!Y.current||P.current||g.touches.length!==1)return;let R=g.touches[0].clientY-N.current,z=g.touches[0].clientX-ce.current;if(!Z.current){if(R<=0||T.scrollTop>0){Y.current=!1;return}if(R>8&&R>Math.abs(z))Z.current=!0,ee.current=T.scrollTop<0;else return}!ee.current&&g.cancelable&&g.preventDefault();let oe=Math.min(Math.max(R,0)*.5,C);se.current=oe,D(oe)},F=()=>{if(!Y.current||(Y.current=!1,!Z.current))return;Z.current=!1,ee.current=!1;let g=se.current;se.current=0,g>=u&&!P.current?(q(!0),D(u),Promise.resolve().then(()=>O()).catch(()=>{}).finally(()=>{q(!1),D(0)})):D(0)};return T.addEventListener("touchstart",te,{passive:!0}),T.addEventListener("touchmove",l,{passive:!1}),T.addEventListener("touchend",F,{passive:!0}),T.addEventListener("touchcancel",F,{passive:!0}),()=>{T.removeEventListener("touchstart",te),T.removeEventListener("touchmove",l),T.removeEventListener("touchend",F),T.removeEventListener("touchcancel",F)}},[d,m,O,u,C]),{pullDistance:L,isRefreshing:A,pullProgress:Math.min(L/u,1),pullThreshold:u}};var Se=require("react");function at(){let[d,f]=(0,Se.useState)(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches);return(0,Se.useEffect)(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let m=window.matchMedia("(pointer: coarse)"),u=C=>f(C.matches);return f(m.matches),typeof m.addEventListener=="function"?(m.addEventListener("change",u),()=>m.removeEventListener("change",u)):(m.addListener(u),()=>m.removeListener(u))},[]),d}var S=require("react/jsx-runtime"),$t={},zt={},Nt={},Ft={},_t={},Bt={},Ut=(0,t.forwardRef)(({className:d="",style:f={},containerStyle:m={},contentStyle:u={},children:C,onScroll:O,thumb:L=$t,track:D=zt,arrows:A=Nt,dragScroll:q=Ft,autoHide:N=_t,pullToRefresh:ce=Bt,showScrollbar:Y=!0,showHorizontalScrollbar:Z=!0,detectInnerScroll:ee=!1},se)=>{let P=at(),T=P?!1:Y,Ce=P?!1:Z,He=(0,t.useRef)({});(0,t.useEffect)(()=>{He.current={children:C,onScroll:O,showScrollbar:T,showHorizontalScrollbar:Ce,thumb:L,track:D,arrows:A,dragScroll:q,autoHide:N}});let te=(0,t.useRef)(null),l=(0,t.useRef)(null),F=(0,t.useRef)(null),g=(0,t.useRef)(null),R=(0,t.useRef)(null),z=(0,t.useRef)(null),{pullDistance:oe,isRefreshing:ge,pullProgress:Le}=it({containerRef:l,config:ce}),Ue=ce.indicatorColor??"#1976d2",ct=oe>0||ge,[ve,M]=(0,t.useState)(!1),[B,Xe]=(0,t.useState)(!1),[qe,Ye]=(0,t.useState)(!1),[De,st]=(0,t.useState)({y:0,scrollTop:0}),[ue,Ge]=(0,t.useState)(0),[ut,Re]=(0,t.useState)(0),[re,je]=(0,t.useState)(!1),[Ke,Ve]=(0,t.useState)(!1),[U,Ze]=(0,t.useState)(!1),[ke,dt]=(0,t.useState)({x:0,scrollLeft:0}),[Ie,Qe]=(0,t.useState)(0),[Pe,Je]=(0,t.useState)(0),[ft,et]=(0,t.useState)(!1),ne=(0,t.useRef)(!1),[G,tt]=(0,t.useState)(!1),[de,pt]=(0,t.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[qt,Yt]=(0,t.useState)(null),[ye,we]=(0,t.useState)(null),[Gt,ht]=(0,t.useState)(!1),[mt,bt]=(0,t.useState)(0),fe=(0,t.useRef)(null),[ot,rt]=(0,t.useState)(!1),pe=(0,t.useRef)(null),Q=(0,t.useRef)(null),J=(0,t.useRef)(null),E=(0,t.useMemo)(()=>{let e=L.color??"#606060";return{width:L.width??8,minHeight:L.minHeight??50,radius:L.radius??(L.width??8)/2,color:e,opacity:L.opacity??.6,hoverColor:L.hoverColor??e,hoverOpacity:L.hoverOpacity??1}},[L]),i=(0,t.useMemo)(()=>({width:D.width??16,color:D.color??"rgba(128, 128, 128, 0.1)",visible:D.visible??!0,alignment:D.alignment??"outside",radius:D.radius??E.radius??4,margin:D.margin??4,overflowX:D.overflowX??!0,overflowY:D.overflowY??!0}),[D,E.radius]),_=(0,t.useMemo)(()=>{let e=A.color??"#808080";return{visible:A.visible??!1,step:A.step??50,color:e,opacity:A.opacity??.6,hoverColor:A.hoverColor??e,hoverOpacity:A.hoverOpacity??1}},[A]),he=(0,t.useMemo)(()=>({enabled:P?!1:q.enabled??!0,excludeClasses:q.excludeClasses??[],excludeSelectors:q.excludeSelectors??[]}),[q,P]),c=(0,t.useMemo)(()=>({enabled:N.enabled??!0,delay:N.delay??1500,delayOnWheel:N.delayOnWheel??700,initialDelay:N.initialDelay??200}),[N]),[le,gt]=(0,t.useState)(()=>(N.initialDelay??200)>0),y=E.width,vt=i.width,We=E.minHeight,X=_.visible,xe=_.step,$=(0,t.useCallback)(()=>{if(!l.current)return;let e=document.activeElement;e&&l.current.contains(e)&&e!==l.current||l.current.focus()},[]);(0,t.useImperativeHandle)(se,()=>({getScrollContainer:()=>l.current,scrollTo:e=>{l.current&&l.current.scrollTo(e)},get scrollTop(){return l.current?.scrollTop||0},get scrollHeight(){return l.current?.scrollHeight||0},get clientHeight(){return l.current?.clientHeight||0}}),[]);let h=(0,t.useCallback)(()=>{if(z.current){let o=z.current;if(document.contains(o)&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return o;z.current=null}if(!l.current)return null;if(l.current.scrollHeight>l.current.clientHeight+2||l.current.scrollWidth>l.current.clientWidth+2)return z.current=l.current,l.current;if(!ee)return null;let e=l.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of e){let r=o;if(r!==l.current&&r.classList.contains("overlay-scrollbar-container"))continue;let a=r.parentElement,n=!1;for(;a&&a!==l.current;){if(a.classList.contains("overlay-scrollbar-container")&&a!==l.current){n=!0;break}a=a.parentElement}if(!n&&(r.scrollHeight>r.clientHeight+2||r.scrollWidth>r.clientWidth+2))return z.current=r,r}return null},[]),j=(0,t.useCallback)(()=>h()!==null,[h]),w=(0,t.useCallback)(()=>{pe.current&&(clearTimeout(pe.current),pe.current=null)},[]),Te=(0,t.useCallback)(()=>{Q.current&&(clearTimeout(Q.current),Q.current=null)},[]),nt=(0,t.useCallback)(()=>{J.current&&(clearTimeout(J.current),J.current=null)},[]),yt=(0,t.useCallback)(()=>{Te(),!(B||U||G||ne.current)&&(w(),M(!1))},[w,Te,B,U,G]),v=(0,t.useCallback)(e=>{c.enabled&&(w(),pe.current=setTimeout(()=>{M(!1),pe.current=null},e))},[w,c.enabled]),p=(0,t.useCallback)(()=>{let e=h()??l.current;if(!e){M(!1),je(!1),et(!1),w();return}!c.enabled&&!le&&(M(!0),w());let o=e.clientHeight,r=e.scrollHeight,a=e.scrollTop,n=e.clientWidth,s=e.scrollWidth,x=e.scrollLeft,H=r-o>0,b=s-n>0,ie=H||b;je(H),et(b),ie||(M(!1),w());let me=0,W=0;if(te.current){let K=window.getComputedStyle(te.current),V=parseFloat(K.paddingTop)||0;W=parseFloat(K.paddingBottom)||0,me=V+W,bt(W)}if(H){let K=X?y*2+i.margin*4:i.margin*2,V=o-K+me,Me=o/r,ae=Math.max(V*Me,We),lt=r-o,Ht=V-ae,Lt=lt>0?a/lt*Ht:0;Ge(ae),Re(Lt)}else Ge(0),Re(0);let be=s-n;if(be>0){let K=n/s,V=Math.max(n*K,50),Me=n-V,ae=be>0?x/be*Me:0;Qe(V),Je(ae)}else Qe(0),Je(0)},[h,w,X,y,We,c.enabled,le]),wt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=h();o&&(Xe(!0),st({y:e.clientY,scrollTop:o.scrollTop}),w(),M(!0),$())},[h,w,$]),Oe=(0,t.useCallback)(e=>{if(!B)return;let o=h();if(!o)return;let r=o.clientHeight,n=o.scrollHeight-r,s=e.clientY-De.y,x=r-ue,H=s/x*n,b=Math.max(0,Math.min(n,De.scrollTop+H));o.scrollTop=b,p()},[B,De,ue,p,h]),Ae=(0,t.useCallback)(()=>{Xe(!1),j()&&v(c.delay)},[j,v,c.delay]),xt=(0,t.useCallback)(e=>{if(!g.current)return;let r=g.current.getBoundingClientRect(),a=e.clientY-r.top,n=h();if(!n)return;let s=n.clientHeight,x=n.scrollHeight,b=a/s*(x-s);n.scrollTop=Math.max(0,Math.min(x-s,b)),p(),M(!0),v(c.delay),$()},[p,v,c.delay,h,$]),Tt=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current)return;let o=Math.max(0,l.current.scrollTop-xe);l.current.scrollTop=o,p(),M(!0),v(c.delay),$()},[p,v,xe,c.delay,$]),Mt=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!l.current||!F.current)return;let o=l.current,a=F.current.scrollHeight-o.clientHeight,n=Math.min(a,o.scrollTop+xe);o.scrollTop=n,p(),M(!0),v(c.delay),$()},[p,v,xe,c.delay,$]),Et=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=h();o&&(Ze(!0),dt({x:e.clientX,scrollLeft:o.scrollLeft}),w(),M(!0),$())},[h,w,$]),$e=(0,t.useCallback)(e=>{if(!U)return;let o=h();if(!o)return;let r=o.clientWidth,n=o.scrollWidth-r,s=e.clientX-ke.x,x=r-Ie,H=s/x*n,b=Math.max(0,Math.min(n,ke.scrollLeft+H));o.scrollLeft=b,p()},[U,ke,Ie,p,h]),ze=(0,t.useCallback)(()=>{Ze(!1),j()&&v(c.delay)},[j,v,c.delay]),St=(0,t.useCallback)(e=>{if(!g.current)return;let r=g.current.getBoundingClientRect(),a=e.clientX-r.left,n=h();if(!n)return;let s=n.clientWidth,x=n.scrollWidth,b=a/s*(x-s);n.scrollLeft=Math.max(0,Math.min(x-s,b)),p(),M(!0),v(c.delay),$()},[p,v,c.delay,h,$]),Ct=(0,t.useCallback)(e=>{if(!he.enabled||e.defaultPrevented)return;let o=e.target,r=l.current;if(!r||!r.contains(o)||Ee(o,he)||e.button!==0)return;let a=h();a&&(a.scrollHeight<=a.clientHeight&&a.scrollWidth<=a.clientWidth||(e.preventDefault(),ne.current=!0,pt({x:e.clientX,y:e.clientY,scrollTop:a.scrollTop,scrollLeft:a.scrollLeft||0}),w()))},[he,Ee,h,w]),Ne=(0,t.useCallback)(e=>{if(!ne.current&&!G)return;let o=h();if(!o)return;let r=de.x-e.clientX,a=de.y-e.clientY;if(Math.abs(a)<5&&Math.abs(r)<5)return;ne.current&&(ne.current=!1,tt(!0)),M(!0);let n=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,de.scrollTop+a)),s=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,de.scrollLeft+r));o.scrollTop=n,o.scrollLeft=s,p()},[G,de,h,p]),Fe=(0,t.useCallback)(()=>{let e=G;ne.current=!1,tt(!1),e&&j()&&v(c.delay)},[G,j,v,c.delay]);(0,t.useEffect)(()=>{let e=s=>{if(p(),le){O&&O(s);return}w(),M(!0),nt();let x=ot?c.delayOnWheel:c.delay;v(x),O&&O(s)},o=()=>{rt(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(()=>{rt(!1)},300),nt(),J.current=setTimeout(()=>{M(!0),J.current=null,v(c.delayOnWheel)},50)},r=[],a=h();a&&r.push(a);let n=l.current;return n&&!a&&(r.push(n),n.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(x=>{let H=x;if(H!==n&&H.classList.contains("overlay-scrollbar-container"))return;let b=H.parentElement;for(;b&&b!==n;){if(b.classList.contains("overlay-scrollbar-container")&&b!==n)return;b=b.parentElement}r.push(H)})),r.forEach(s=>{s.addEventListener("scroll",e,{passive:!0}),s.addEventListener("wheel",o,{passive:!0})}),()=>{r.forEach(s=>{s.removeEventListener("scroll",e),s.removeEventListener("wheel",o)}),fe.current&&clearTimeout(fe.current),J.current&&clearTimeout(J.current)}},[h,p,O,w,v,c,ot,le]),(0,t.useEffect)(()=>{let e=r=>{let a=r.target;if(r.defaultPrevented||a instanceof Element&&Ee(a,he))return;let n=h();if(!n)return;let{key:s}=r,{scrollTop:x,scrollHeight:H,clientHeight:b}=n,ie=H-b,me=50,W=null;switch(s){case"ArrowUp":r.preventDefault(),W=Math.max(0,x-me);break;case"ArrowDown":r.preventDefault(),W=Math.min(ie,x+me);break;case"PageUp":r.preventDefault(),W=Math.max(0,x-b);break;case"PageDown":r.preventDefault(),W=Math.min(ie,x+b);break;case"Home":r.preventDefault(),W=0;break;case"End":r.preventDefault(),W=ie;break;default:return}if(W!==null){let be=W/ie,K=X?y*2+i.margin*4:i.margin*2,ae=(b-K-ue)*be;Re(ae),n.scrollTop=W,w(),M(!0),v(c.delay)}},o=l.current;if(o)return o.addEventListener("keydown",e),()=>{o.removeEventListener("keydown",e)}},[h,X,y,i.margin,ue,w,v,c.delay,he]),(0,t.useEffect)(()=>(document.addEventListener("mousemove",Ne),document.addEventListener("mouseup",Fe),()=>{document.removeEventListener("mousemove",Ne),document.removeEventListener("mouseup",Fe)}),[G,Ne,Fe]),(0,t.useEffect)(()=>{if(B)return document.addEventListener("mousemove",Oe),document.addEventListener("mouseup",Ae),()=>{document.removeEventListener("mousemove",Oe),document.removeEventListener("mouseup",Ae)}},[B,Oe,Ae]),(0,t.useEffect)(()=>{if(U)return document.addEventListener("mousemove",$e),document.addEventListener("mouseup",ze),()=>{document.removeEventListener("mousemove",$e),document.removeEventListener("mouseup",ze)}},[U,$e,ze]),(0,t.useEffect)(()=>{p();let e=setTimeout(()=>{p()},100);return()=>clearTimeout(e)},[p]),(0,t.useLayoutEffect)(()=>{ht(!0),p(),!c.enabled&&!le&&j()&&M(!0)},[j,p,c.enabled,le]),(0,t.useEffect)(()=>{if(c.initialDelay>0){let e=setTimeout(()=>{gt(!1)},c.initialDelay);return()=>clearTimeout(e)}},[c.initialDelay]),(0,t.useEffect)(()=>{let e=new ResizeObserver(()=>{p()}),o=[];return l.current&&o.push(l.current),F.current&&o.push(F.current),z.current&&document.contains(z.current)&&o.push(z.current),o.forEach(r=>{e.observe(r)}),()=>e.disconnect()},[p]),(0,t.useEffect)(()=>{if(!l.current)return;let e=new MutationObserver(()=>{z.current=null,p()});return e.observe(l.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[p]);let k=Math.max(vt,y);return(0,t.useEffect)(()=>{let e="overlay-scrollbar-webkit-hide",o=document.getElementById(e);o&&o.remove();let r=document.createElement("style");r.id=e;let a=P?`
|
|
2
|
-
/* \uD130\uCE58 \uAE30\uAE30: \uB124\uC774\uD2F0\uBE0C \uC2A4\uD06C\uB864\uBC14 \uC720\uC9C0(\uC228\uAE30\uC9C0 \uC54A\uC74C) */
|
|
3
|
-
.overlay-scrollbar-container {
|
|
4
|
-
scrollbar-width: thin;
|
|
5
|
-
-ms-overflow-style: auto;
|
|
6
|
-
}`:`
|
|
7
|
-
/* \uB9C8\uC6B0\uC2A4 \uAE30\uAE30: \uB124\uC774\uD2F0\uBE0C \uC2A4\uD06C\uB864\uBC14 \uC228\uAE30\uACE0 \uCEE4\uC2A4\uD140 \uC624\uBC84\uB808\uC774\uB9CC \uD45C\uC2DC */
|
|
8
|
-
.overlay-scrollbar-container {
|
|
9
|
-
scrollbar-width: none !important;
|
|
10
|
-
-ms-overflow-style: none !important;
|
|
11
|
-
}
|
|
12
|
-
.overlay-scrollbar-container::-webkit-scrollbar {
|
|
13
|
-
display: none !important;
|
|
14
|
-
width: 0 !important;
|
|
15
|
-
height: 0 !important;
|
|
16
|
-
}
|
|
17
|
-
.overlay-scrollbar-container::-webkit-scrollbar-track {
|
|
18
|
-
display: none !important;
|
|
19
|
-
}
|
|
20
|
-
.overlay-scrollbar-container::-webkit-scrollbar-thumb {
|
|
21
|
-
display: none !important;
|
|
22
|
-
}`;return r.textContent=`${a}
|
|
1
|
+
"use strict";var Fe=Object.defineProperty;var Rt=Object.getOwnPropertyDescriptor;var It=Object.getOwnPropertyNames;var $t=Object.prototype.hasOwnProperty;var Pt=(d,p)=>{for(var m in p)Fe(d,m,{get:p[m],enumerable:!0})},Wt=(d,p,m,u)=>{if(p&&typeof p=="object"||typeof p=="function")for(let C of It(p))!$t.call(d,C)&&C!==m&&Fe(d,C,{get:()=>p[C],enumerable:!(u=Rt(p,C))||u.enumerable});return d};var At=d=>Wt(Fe({},"__esModule",{value:!0}),d);var Yt={};Pt(Yt,{OverlayScrollbar:()=>Ue,default:()=>Ue});module.exports=At(Yt);var t=require("react");var Ot=["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"],Se=(d,p)=>{if(d instanceof HTMLElement&&d.isContentEditable||d.closest('[role="textbox"],[role="searchbox"]'))return!0;let m=d.tagName.toLowerCase();if(m==="input"){let u=(d.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(u)}if(["textarea","select","button"].includes(m)||["svg","path","circle","rect","line","polygon","polyline"].includes(m)||d.getAttribute("contenteditable")==="true")return!0;if(p?.excludeSelectors){for(let u of p.excludeSelectors)if(d.matches(u))return!0}return zt(d,p)},zt=(d,p)=>{let m=[...Ot,...p?.excludeClasses||[]],u=d,C=0,$=5;for(;u&&C<=$;){if(m.some(L=>u.classList.contains(L)))return!0;if(u.classList.contains("MuiDialogContent-root"))break;u=u.parentElement,C++}return!1};var R=require("react"),st=({containerRef:d,config:p})=>{let m=p.enabled??!0,u=p.threshold??80,C=p.maxDistance??u*2,$=p.onRefresh,[L,D]=(0,R.useState)(0),[P,U]=(0,R.useState)(!1),O=(0,R.useRef)(0),ae=(0,R.useRef)(0),X=(0,R.useRef)(!1),V=(0,R.useRef)(!1),te=(0,R.useRef)(!1),se=(0,R.useRef)(0),A=(0,R.useRef)(!1);return(0,R.useEffect)(()=>{A.current=P},[P]),(0,R.useEffect)(()=>{let w=d.current;if(!w||!(m&&typeof $=="function"))return;let Xe=r=>{let T=r instanceof Element?r:null;for(;T&&T!==w;){if(T instanceof HTMLElement&&T.scrollHeight>T.clientHeight+1&&T.scrollTop>0)return!1;T=T.parentElement}return!0},Z=r=>{X.current=!1,V.current=!1,te.current=!1,!A.current&&r.touches.length===1&&w.scrollTop===0&&Xe(r.target)&&(X.current=!0,O.current=r.touches[0].clientY,ae.current=r.touches[0].clientX)},be=r=>{if(!X.current||A.current||r.touches.length!==1)return;let T=r.touches[0].clientY-O.current,Q=r.touches[0].clientX-ae.current;if(!V.current){if(T<=0||w.scrollTop>0){X.current=!1;return}if(T>8&&T>Math.abs(Q))V.current=!0,te.current=w.scrollTop<0;else return}!te.current&&r.cancelable&&r.preventDefault();let ge=Math.min(Math.max(T,0)*.5,C);se.current=ge,D(ge)},q=()=>{if(!X.current||(X.current=!1,!V.current))return;V.current=!1,te.current=!1;let r=se.current;se.current=0,r>=u&&!A.current?(U(!0),D(u),Promise.resolve().then(()=>$()).catch(()=>{}).finally(()=>{U(!1),D(0)})):D(0)};return w.addEventListener("touchstart",Z,{passive:!0}),w.addEventListener("touchmove",be,{passive:!1}),w.addEventListener("touchend",q,{passive:!0}),w.addEventListener("touchcancel",q,{passive:!0}),()=>{w.removeEventListener("touchstart",Z),w.removeEventListener("touchmove",be),w.removeEventListener("touchend",q),w.removeEventListener("touchcancel",q)}},[d,m,$,u,C]),{pullDistance:L,isRefreshing:P,pullProgress:Math.min(L/u,1),pullThreshold:u}};var Ce=require("react");function ct(){let[d,p]=(0,Ce.useState)(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches);return(0,Ce.useEffect)(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let m=window.matchMedia("(pointer: coarse)"),u=C=>p(C.matches);return p(m.matches),typeof m.addEventListener=="function"?(m.addEventListener("change",u),()=>m.removeEventListener("change",u)):(m.addListener(u),()=>m.removeListener(u))},[]),d}var S=require("react/jsx-runtime"),Nt={},_t={},Bt={},Ft={},Ut={},Xt={},qt=(0,t.forwardRef)(({className:d="",style:p={},containerStyle:m={},contentStyle:u={},children:C,onScroll:$,thumb:L=Nt,track:D=_t,arrows:P=Bt,dragScroll:U=Ft,autoHide:O=Ut,pullToRefresh:ae=Xt,showScrollbar:X=!0,showHorizontalScrollbar:V=!0,detectInnerScroll:te=!1},se)=>{let A=ct(),w=A?!1:X,He=A?!1:V,Z=`os-${(0,t.useId)().replace(/[^a-zA-Z0-9_-]/g,"")}`,be=(0,t.useRef)({});(0,t.useEffect)(()=>{be.current={children:C,onScroll:$,showScrollbar:w,showHorizontalScrollbar:He,thumb:L,track:D,arrows:P,dragScroll:U,autoHide:O}});let q=(0,t.useRef)(null),r=(0,t.useRef)(null),T=(0,t.useRef)(null),Q=(0,t.useRef)(null),ge=(0,t.useRef)(null),N=(0,t.useRef)(null),{pullDistance:Le,isRefreshing:ve,pullProgress:De}=st({containerRef:r,config:ae}),qe=ae.indicatorColor??"#1976d2",ut=Le>0||ve,[ye,M]=(0,t.useState)(!1),[_,Ye]=(0,t.useState)(!1),[Ge,je]=(0,t.useState)(!1),[ke,dt]=(0,t.useState)({y:0,scrollTop:0}),[ce,Ke]=(0,t.useState)(0),[pt,Re]=(0,t.useState)(0),[oe,Ve]=(0,t.useState)(!1),[Ze,Qe]=(0,t.useState)(!1),[B,Je]=(0,t.useState)(!1),[Ie,ft]=(0,t.useState)({x:0,scrollLeft:0}),[$e,et]=(0,t.useState)(0),[Pe,tt]=(0,t.useState)(0),[ht,ot]=(0,t.useState)(!1),re=(0,t.useRef)(!1),[Y,rt]=(0,t.useState)(!1),[ue,mt]=(0,t.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[Gt,jt]=(0,t.useState)(null),[xe,we]=(0,t.useState)(null),[Kt,bt]=(0,t.useState)(!1),[gt,vt]=(0,t.useState)(0),de=(0,t.useRef)(null),[nt,lt]=(0,t.useState)(!1),pe=(0,t.useRef)(null),J=(0,t.useRef)(null),ee=(0,t.useRef)(null),E=(0,t.useMemo)(()=>{let e=L.color??"#606060";return{width:L.width??8,minHeight:L.minHeight??50,radius:L.radius??(L.width??8)/2,color:e,opacity:L.opacity??.6,hoverColor:L.hoverColor??e,hoverOpacity:L.hoverOpacity??1}},[L]),i=(0,t.useMemo)(()=>({width:D.width??16,color:D.color??"rgba(128, 128, 128, 0.1)",visible:D.visible??!0,alignment:D.alignment??"outside",radius:D.radius??E.radius??4,margin:D.margin??4,overflowX:D.overflowX??!0,overflowY:D.overflowY??!0}),[D,E.radius]),z=(0,t.useMemo)(()=>{let e=P.color??"#808080";return{visible:P.visible??!1,step:P.step??50,color:e,opacity:P.opacity??.6,hoverColor:P.hoverColor??e,hoverOpacity:P.hoverOpacity??1}},[P]),fe=(0,t.useMemo)(()=>({enabled:A?!1:U.enabled??!0,excludeClasses:U.excludeClasses??[],excludeSelectors:U.excludeSelectors??[]}),[U,A]),s=(0,t.useMemo)(()=>({enabled:O.enabled??!0,delay:O.delay??1500,delayOnWheel:O.delayOnWheel??700,initialDelay:O.initialDelay??200}),[O]),[ne,yt]=(0,t.useState)(()=>(O.initialDelay??200)>0),v=E.width,xt=i.width,We=E.minHeight,F=z.visible,Te=z.step,W=(0,t.useCallback)(()=>{if(!r.current)return;let e=document.activeElement;e&&r.current.contains(e)&&e!==r.current||r.current.focus()},[]);(0,t.useImperativeHandle)(se,()=>({getScrollContainer:()=>r.current,scrollTo:e=>{r.current&&r.current.scrollTo(e)},get scrollTop(){return r.current?.scrollTop||0},get scrollHeight(){return r.current?.scrollHeight||0},get clientHeight(){return r.current?.clientHeight||0}}),[]);let h=(0,t.useCallback)(()=>{if(N.current){let o=N.current;if(document.contains(o)&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return o;N.current=null}if(!r.current)return null;if(r.current.scrollHeight>r.current.clientHeight+2||r.current.scrollWidth>r.current.clientWidth+2)return N.current=r.current,r.current;if(!te)return null;let e=r.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of e){let n=o;if(n!==r.current&&n.classList.contains("overlay-scrollbar-container"))continue;let l=n.parentElement,a=!1;for(;l&&l!==r.current;){if(l.classList.contains("overlay-scrollbar-container")&&l!==r.current){a=!0;break}l=l.parentElement}if(!a&&(n.scrollHeight>n.clientHeight+2||n.scrollWidth>n.clientWidth+2))return N.current=n,n}return null},[]),G=(0,t.useCallback)(()=>h()!==null,[h]),y=(0,t.useCallback)(()=>{pe.current&&(clearTimeout(pe.current),pe.current=null)},[]),Me=(0,t.useCallback)(()=>{J.current&&(clearTimeout(J.current),J.current=null)},[]),it=(0,t.useCallback)(()=>{ee.current&&(clearTimeout(ee.current),ee.current=null)},[]),wt=(0,t.useCallback)(()=>{Me(),!(_||B||Y||re.current)&&(y(),M(!1))},[y,Me,_,B,Y]),g=(0,t.useCallback)(e=>{s.enabled&&(y(),pe.current=setTimeout(()=>{M(!1),pe.current=null},e))},[y,s.enabled]),f=(0,t.useCallback)(()=>{let e=h()??r.current;if(!e){M(!1),Ve(!1),ot(!1),y();return}!s.enabled&&!ne&&(M(!0),y());let o=e.clientHeight,n=e.scrollHeight,l=e.scrollTop,a=e.clientWidth,c=e.scrollWidth,x=e.scrollLeft,H=n-o>0,b=c-a>0,le=H||b;Ve(H),ot(b),le||(M(!1),y());let he=0,I=0;if(q.current){let j=window.getComputedStyle(q.current),K=parseFloat(j.paddingTop)||0;I=parseFloat(j.paddingBottom)||0,he=K+I,vt(I)}if(H){let j=F?v*2+i.margin*4:i.margin*2,K=o-j+he,Ee=o/n,ie=Math.max(K*Ee,We),at=n-o,Dt=K-ie,kt=at>0?l/at*Dt:0;Ke(ie),Re(kt)}else Ke(0),Re(0);let me=c-a;if(me>0){let j=a/c,K=Math.max(a*j,50),Ee=a-K,ie=me>0?x/me*Ee:0;et(K),tt(ie)}else et(0),tt(0)},[h,y,F,v,We,s.enabled,ne]),Tt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=h();o&&(Ye(!0),dt({y:e.clientY,scrollTop:o.scrollTop}),y(),M(!0),W())},[h,y,W]),Ae=(0,t.useCallback)(e=>{if(!_)return;let o=h();if(!o)return;let n=o.clientHeight,a=o.scrollHeight-n,c=e.clientY-ke.y,x=n-ce,H=c/x*a,b=Math.max(0,Math.min(a,ke.scrollTop+H));o.scrollTop=b,f()},[_,ke,ce,f,h]),Oe=(0,t.useCallback)(()=>{Ye(!1),G()&&g(s.delay)},[G,g,s.delay]),Mt=(0,t.useCallback)(e=>{if(!Q.current)return;let n=Q.current.getBoundingClientRect(),l=e.clientY-n.top,a=h();if(!a)return;let c=a.clientHeight,x=a.scrollHeight,b=l/c*(x-c);a.scrollTop=Math.max(0,Math.min(x-c,b)),f(),M(!0),g(s.delay),W()},[f,g,s.delay,h,W]),Et=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!r.current)return;let o=Math.max(0,r.current.scrollTop-Te);r.current.scrollTop=o,f(),M(!0),g(s.delay),W()},[f,g,Te,s.delay,W]),St=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!r.current||!T.current)return;let o=r.current,l=T.current.scrollHeight-o.clientHeight,a=Math.min(l,o.scrollTop+Te);o.scrollTop=a,f(),M(!0),g(s.delay),W()},[f,g,Te,s.delay,W]),Ct=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=h();o&&(Je(!0),ft({x:e.clientX,scrollLeft:o.scrollLeft}),y(),M(!0),W())},[h,y,W]),ze=(0,t.useCallback)(e=>{if(!B)return;let o=h();if(!o)return;let n=o.clientWidth,a=o.scrollWidth-n,c=e.clientX-Ie.x,x=n-$e,H=c/x*a,b=Math.max(0,Math.min(a,Ie.scrollLeft+H));o.scrollLeft=b,f()},[B,Ie,$e,f,h]),Ne=(0,t.useCallback)(()=>{Je(!1),G()&&g(s.delay)},[G,g,s.delay]),Ht=(0,t.useCallback)(e=>{if(!Q.current)return;let n=Q.current.getBoundingClientRect(),l=e.clientX-n.left,a=h();if(!a)return;let c=a.clientWidth,x=a.scrollWidth,b=l/c*(x-c);a.scrollLeft=Math.max(0,Math.min(x-c,b)),f(),M(!0),g(s.delay),W()},[f,g,s.delay,h,W]),Lt=(0,t.useCallback)(e=>{if(!fe.enabled||e.defaultPrevented)return;let o=e.target,n=r.current;if(!n||!n.contains(o)||Se(o,fe)||e.button!==0)return;let l=h();l&&(l.scrollHeight<=l.clientHeight&&l.scrollWidth<=l.clientWidth||(e.preventDefault(),re.current=!0,mt({x:e.clientX,y:e.clientY,scrollTop:l.scrollTop,scrollLeft:l.scrollLeft||0}),y()))},[fe,Se,h,y]),_e=(0,t.useCallback)(e=>{if(!re.current&&!Y)return;let o=h();if(!o)return;let n=ue.x-e.clientX,l=ue.y-e.clientY;if(Math.abs(l)<5&&Math.abs(n)<5)return;re.current&&(re.current=!1,rt(!0)),M(!0);let a=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,ue.scrollTop+l)),c=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,ue.scrollLeft+n));o.scrollTop=a,o.scrollLeft=c,f()},[Y,ue,h,f]),Be=(0,t.useCallback)(()=>{let e=Y;re.current=!1,rt(!1),e&&G()&&g(s.delay)},[Y,G,g,s.delay]);(0,t.useEffect)(()=>{let e=c=>{if(f(),ne){$&&$(c);return}y(),M(!0),it();let x=nt?s.delayOnWheel:s.delay;g(x),$&&$(c)},o=()=>{lt(!0),de.current&&clearTimeout(de.current),de.current=setTimeout(()=>{lt(!1)},300),it(),ee.current=setTimeout(()=>{M(!0),ee.current=null,g(s.delayOnWheel)},50)},n=[],l=h();l&&n.push(l);let a=r.current;return a&&!l&&(n.push(a),a.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(x=>{let H=x;if(H!==a&&H.classList.contains("overlay-scrollbar-container"))return;let b=H.parentElement;for(;b&&b!==a;){if(b.classList.contains("overlay-scrollbar-container")&&b!==a)return;b=b.parentElement}n.push(H)})),n.forEach(c=>{c.addEventListener("scroll",e,{passive:!0}),c.addEventListener("wheel",o,{passive:!0})}),()=>{n.forEach(c=>{c.removeEventListener("scroll",e),c.removeEventListener("wheel",o)}),de.current&&clearTimeout(de.current),ee.current&&clearTimeout(ee.current)}},[h,f,$,y,g,s,nt,ne]),(0,t.useEffect)(()=>{let e=n=>{let l=n.target;if(n.defaultPrevented||l instanceof Element&&Se(l,fe))return;let a=h();if(!a)return;let{key:c}=n,{scrollTop:x,scrollHeight:H,clientHeight:b}=a,le=H-b,he=50,I=null;switch(c){case"ArrowUp":n.preventDefault(),I=Math.max(0,x-he);break;case"ArrowDown":n.preventDefault(),I=Math.min(le,x+he);break;case"PageUp":n.preventDefault(),I=Math.max(0,x-b);break;case"PageDown":n.preventDefault(),I=Math.min(le,x+b);break;case"Home":n.preventDefault(),I=0;break;case"End":n.preventDefault(),I=le;break;default:return}if(I!==null){let me=I/le,j=F?v*2+i.margin*4:i.margin*2,ie=(b-j-ce)*me;Re(ie),a.scrollTop=I,y(),M(!0),g(s.delay)}},o=r.current;if(o)return o.addEventListener("keydown",e),()=>{o.removeEventListener("keydown",e)}},[h,F,v,i.margin,ce,y,g,s.delay,fe]),(0,t.useEffect)(()=>(document.addEventListener("mousemove",_e),document.addEventListener("mouseup",Be),()=>{document.removeEventListener("mousemove",_e),document.removeEventListener("mouseup",Be)}),[Y,_e,Be]),(0,t.useEffect)(()=>{if(_)return document.addEventListener("mousemove",Ae),document.addEventListener("mouseup",Oe),()=>{document.removeEventListener("mousemove",Ae),document.removeEventListener("mouseup",Oe)}},[_,Ae,Oe]),(0,t.useEffect)(()=>{if(B)return document.addEventListener("mousemove",ze),document.addEventListener("mouseup",Ne),()=>{document.removeEventListener("mousemove",ze),document.removeEventListener("mouseup",Ne)}},[B,ze,Ne]),(0,t.useEffect)(()=>{f();let e=setTimeout(()=>{f()},100);return()=>clearTimeout(e)},[f]),(0,t.useLayoutEffect)(()=>{bt(!0),f(),!s.enabled&&!ne&&G()&&M(!0)},[G,f,s.enabled,ne]),(0,t.useEffect)(()=>{if(s.initialDelay>0){let e=setTimeout(()=>{yt(!1)},s.initialDelay);return()=>clearTimeout(e)}},[s.initialDelay]),(0,t.useEffect)(()=>{let e=new ResizeObserver(()=>{f()}),o=[];return r.current&&o.push(r.current),T.current&&o.push(T.current),N.current&&document.contains(N.current)&&o.push(N.current),o.forEach(n=>{e.observe(n)}),()=>e.disconnect()},[f]),(0,t.useEffect)(()=>{if(!r.current)return;let e=new MutationObserver(()=>{N.current=null,f()});return e.observe(r.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[f]);let k=Math.max(xt,v);return(0,t.useEffect)(()=>{let e="overlay-scrollbar-shared";if(document.getElementById(e))return;let o=document.createElement("style");o.id=e,o.textContent=`
|
|
23
2
|
/* ehfuse-editor-content\uB294 \uC2A4\uD06C\uB864\uBC14 \uC720\uC9C0 */
|
|
24
3
|
.overlay-scrollbar-container .ehfuse-editor-content {
|
|
25
4
|
scrollbar-width: thin !important;
|
|
@@ -48,5 +27,31 @@
|
|
|
48
27
|
from { transform: rotate(0deg); }
|
|
49
28
|
to { transform: rotate(360deg); }
|
|
50
29
|
}
|
|
51
|
-
`,document.head.appendChild(
|
|
30
|
+
`,document.head.appendChild(o)},[]),(0,t.useEffect)(()=>{let e=`overlay-scrollbar-instance-${Z}`,o=document.getElementById(e);o&&o.remove();let n=document.createElement("style");n.id=e;let l=`.${Z}`;return n.textContent=A?`
|
|
31
|
+
${l} {
|
|
32
|
+
scrollbar-width: thin;
|
|
33
|
+
scrollbar-color: rgba(100, 116, 139, 0.55) transparent;
|
|
34
|
+
}
|
|
35
|
+
${l}::-webkit-scrollbar {
|
|
36
|
+
width: 6px;
|
|
37
|
+
height: 6px;
|
|
38
|
+
}
|
|
39
|
+
${l}::-webkit-scrollbar-track {
|
|
40
|
+
background: transparent;
|
|
41
|
+
}
|
|
42
|
+
${l}::-webkit-scrollbar-thumb {
|
|
43
|
+
background: rgba(100, 116, 139, 0.55);
|
|
44
|
+
border-radius: 3px;
|
|
45
|
+
}`:`
|
|
46
|
+
${l} {
|
|
47
|
+
scrollbar-width: none !important;
|
|
48
|
+
-ms-overflow-style: none !important;
|
|
49
|
+
}
|
|
50
|
+
${l}::-webkit-scrollbar {
|
|
51
|
+
display: none !important;
|
|
52
|
+
width: 0 !important;
|
|
53
|
+
height: 0 !important;
|
|
54
|
+
}
|
|
55
|
+
${l}::-webkit-scrollbar-track { display: none !important; }
|
|
56
|
+
${l}::-webkit-scrollbar-thumb { display: none !important; }`,document.head.appendChild(n),()=>{document.getElementById(e)?.remove()}},[A,Z]),(0,S.jsxs)("div",{ref:q,className:`overlay-scrollbar-wrapper ${d}`,onMouseLeave:wt,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...p},children:[ut&&(0,S.jsx)("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${Le-56}px)`,transition:ve?"transform 0.15s ease-out":Le===0?"transform 0.2s ease-out":"none",width:48,height:48,borderRadius:"50%",background:"#ffffff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.25)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1001,pointerEvents:"none",opacity:ve?1:Math.min(De*1.5,1)},children:ve?(0,S.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:(0,S.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:qe,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):(0,S.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",style:{transform:`rotate(${De*270}deg)`,opacity:De>=1?1:.6},children:(0,S.jsx)("path",{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",fill:qe})})}),(0,S.jsx)("div",{ref:r,className:`overlay-scrollbar-container ${Z}`,tabIndex:-1,onMouseDown:Lt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",outline:"none",userSelect:Y?"none":"auto",...m},children:(0,S.jsx)("div",{ref:T,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...u},children:C})}),w&&oe&&(i.overflowY??!0)&&(0,S.jsxs)("div",{ref:Q,className:"overlay-scrollbar-track",onMouseEnter:()=>{y(),J.current=setTimeout(()=>{M(!0),J.current=null},100)},onMouseLeave:()=>{Me(),_||g(s.delay)},style:{position:"absolute",top:0,right:0,width:`${k}px`,height:"100%",opacity:ye?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[i.visible&&(0,S.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Mt(e)},style:{position:"absolute",top:F?`${E.width+i.margin*2}px`:`${i.margin}px`,right:i.alignment==="outside"?"0px":`${(k-E.width)/2}px`,width:`${E.width}px`,height:F?`calc(100% - ${E.width*2+i.margin*4}px)`:`calc(100% - ${i.margin*2}px)`,backgroundColor:i.color,borderRadius:`${i.radius}px`,cursor:"pointer"}}),(0,S.jsx)("div",{ref:ge,className:"overlay-scrollbar-thumb",onMouseDown:Tt,onMouseEnter:()=>je(!0),onMouseLeave:()=>je(!1),style:{position:"absolute",top:`${(F?v+i.margin*2:i.margin)+pt}px`,right:i.alignment==="outside"?"0px":`${(k-v)/2}px`,width:`${v}px`,height:`${Math.max(ce,We)}px`,backgroundColor:Ge||_?E.hoverColor:E.color,opacity:Ge||_?E.hoverOpacity:E.opacity,borderRadius:`${E.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),w&&oe&&F&&(0,S.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:Et,onMouseEnter:()=>we("up"),onMouseLeave:()=>we(null),style:{position:"absolute",top:`${i.margin}px`,right:i.alignment==="outside"?"0px":`${(k-v)/2}px`,width:`${v}px`,height:`${v}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(v*.75,8)}px`,color:xe==="up"?z.hoverColor:z.color,userSelect:"none",zIndex:1001,opacity:ye?xe==="up"?z.hoverOpacity:z.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),w&&oe&&F&&(0,S.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:St,onMouseEnter:()=>we("down"),onMouseLeave:()=>we(null),style:{position:"absolute",bottom:`${i.margin}px`,right:i.alignment==="outside"?"0px":`${(k-v)/2}px`,width:`${v}px`,height:`${v}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(v*.75,8)}px`,color:xe==="down"?z.hoverColor:z.color,userSelect:"none",zIndex:1001,opacity:ye?xe==="down"?z.hoverOpacity:z.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),w&&He&&ht&&(i.overflowX??!0)&&(0,S.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{y(),J.current=setTimeout(()=>{M(!0),J.current=null},100)},onMouseLeave:()=>{Me(),B||g(s.delay)},style:{position:"absolute",bottom:`${gt}px`,left:0,width:"100%",height:`${k}px`,opacity:ye?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[i.visible&&(0,S.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Ht(e)},style:{position:"absolute",bottom:i.alignment==="outside"?"0px":`${(k-v)/2}px`,left:`${i.margin}px`,right:oe?i.alignment==="outside"?`${k-i.margin}px`:`${k}px`:`${i.margin}px`,height:`${v}px`,backgroundColor:i.color,borderRadius:`${i.radius}px`,cursor:"pointer"}}),(0,S.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:Ct,onMouseEnter:()=>Qe(!0),onMouseLeave:()=>Qe(!1),style:{position:"absolute",bottom:i.alignment==="outside"?"0px":`${(k-v)/2}px`,left:`${i.margin+Pe}px`,right:oe?i.alignment==="outside"?`${k-i.margin}px`:`${k}px`:"auto",maxWidth:oe?i.alignment==="outside"?`calc(100% - ${i.margin+Pe+k-i.margin}px)`:`calc(100% - ${i.margin+Pe+k}px)`:"none",width:`${Math.max($e,50)}px`,height:`${v}px`,backgroundColor:Ze||B?E.hoverColor:E.color,opacity:Ze||B?E.hoverOpacity:E.opacity,borderRadius:`${E.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),Ue=qt;
|
|
52
57
|
//# sourceMappingURL=index.js.map
|