@ehfuse/overlay-scrollbar 1.6.24 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +160 -131
- package/dist/OverlayScrollbar.d.ts +2 -0
- package/dist/OverlayScrollbar.d.ts.map +1 -1
- package/dist/hooks/usePullToRefresh.d.ts +25 -0
- package/dist/hooks/usePullToRefresh.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +7 -2
- package/dist/index.esm.js.map +4 -4
- package/dist/index.js +7 -2
- package/dist/index.js.map +4 -4
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var He=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var vt=Object.prototype.hasOwnProperty;var yt=(h,x)=>{for(var C in x)He(h,C,{get:x[C],enumerable:!0})},xt=(h,x,C,T)=>{if(x&&typeof x=="object"||typeof x=="function")for(let H of gt(x))!vt.call(h,H)&&H!==C&&He(h,H,{get:()=>x[H],enumerable:!(T=bt(x,H))||T.enumerable});return h};var wt=h=>xt(He({},"__esModule",{value:!0}),h);var kt={};yt(kt,{OverlayScrollbar:()=>Le,default:()=>Le});module.exports=wt(kt);var t=require("react");var Tt=["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"],me=(h,x)=>{if(h instanceof HTMLElement&&h.isContentEditable||h.closest('[role="textbox"],[role="searchbox"]'))return!0;let C=h.tagName.toLowerCase();if(C==="input"){let T=(h.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(T)}if(["textarea","select","button"].includes(C)||["svg","path","circle","rect","line","polygon","polyline"].includes(C)||h.getAttribute("contenteditable")==="true")return!0;if(x?.excludeSelectors){for(let T of x.excludeSelectors)if(h.matches(T))return!0}return Mt(h,x)},Mt=(h,x)=>{let C=[...Tt,...x?.excludeClasses||[]],T=h,H=0,$=5;for(;T&&H<=$;){if(C.some(L=>T.classList.contains(L)))return!0;if(T.classList.contains("MuiDialogContent-root"))break;T=T.parentElement,H++}return!1};var E=require("react/jsx-runtime"),St={},Et={},Ct={},Ht={},Lt={},Dt=(0,t.forwardRef)(({className:h="",style:x={},containerStyle:C={},contentStyle:T={},children:H,onScroll:$,thumb:L=St,track:k=Et,arrows:z=Ct,dragScroll:Z=Ht,autoHide:_=Lt,showScrollbar:j=!0,showHorizontalScrollbar:De=!0,detectInnerScroll:Ye=!1},Ge)=>{let Ke=(0,t.useRef)({});(0,t.useEffect)(()=>{Ke.current={children:H,onScroll:$,showScrollbar:j,showHorizontalScrollbar:De,thumb:L,track:k,arrows:z,dragScroll:Z,autoHide:_}});let he=(0,t.useRef)(null),i=(0,t.useRef)(null),J=(0,t.useRef)(null),Q=(0,t.useRef)(null),Ve=(0,t.useRef)(null),I=(0,t.useRef)(null),[ae,v]=(0,t.useState)(!1),[W,ke]=(0,t.useState)(!1),[Re,Ie]=(0,t.useState)(!1),[fe,Ze]=(0,t.useState)({y:0,scrollTop:0}),[ee,We]=(0,t.useState)(0),[je,be]=(0,t.useState)(0),[X,Oe]=(0,t.useState)(!1),[Ae,$e]=(0,t.useState)(!1),[O,ze]=(0,t.useState)(!1),[ge,Je]=(0,t.useState)({x:0,scrollLeft:0}),[ve,Pe]=(0,t.useState)(0),[ye,Ne]=(0,t.useState)(0),[Qe,Fe]=(0,t.useState)(!1),Y=(0,t.useRef)(!1),[P,Be]=(0,t.useState)(!1),[te,et]=(0,t.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[Rt,It]=(0,t.useState)(null),[ce,se]=(0,t.useState)(null),[Wt,tt]=(0,t.useState)(!1),[ot,rt]=(0,t.useState)(0),oe=(0,t.useRef)(null),[_e,Ue]=(0,t.useState)(!1),re=(0,t.useRef)(null),U=(0,t.useRef)(null),q=(0,t.useRef)(null),y=(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]),n=(0,t.useMemo)(()=>({width:k.width??16,color:k.color??"rgba(128, 128, 128, 0.1)",visible:k.visible??!0,alignment:k.alignment??"outside",radius:k.radius??y.radius??4,margin:k.margin??4,overflowX:k.overflowX??!0,overflowY:k.overflowY??!0}),[k,y.radius]),R=(0,t.useMemo)(()=>{let e=z.color??"#808080";return{visible:z.visible??!1,step:z.step??50,color:e,opacity:z.opacity??.6,hoverColor:z.hoverColor??e,hoverOpacity:z.hoverOpacity??1}},[z]),ne=(0,t.useMemo)(()=>({enabled:Z.enabled??!0,excludeClasses:Z.excludeClasses??[],excludeSelectors:Z.excludeSelectors??[]}),[Z]),a=(0,t.useMemo)(()=>({enabled:_.enabled??!0,delay:_.delay??1500,delayOnWheel:_.delayOnWheel??700,initialDelay:_.initialDelay??200}),[_]),[G,nt]=(0,t.useState)(()=>(_.initialDelay??200)>0),f=y.width,lt=n.width,xe=y.minHeight,A=R.visible,ue=R.step,D=(0,t.useCallback)(()=>{if(!i.current)return;let e=document.activeElement;e&&i.current.contains(e)&&e!==i.current||i.current.focus()},[]);(0,t.useImperativeHandle)(Ge,()=>({getScrollContainer:()=>i.current,scrollTo:e=>{i.current&&i.current.scrollTo(e)},get scrollTop(){return i.current?.scrollTop||0},get scrollHeight(){return i.current?.scrollHeight||0},get clientHeight(){return i.current?.clientHeight||0}}),[]);let d=(0,t.useCallback)(()=>{if(I.current){let o=I.current;if(document.contains(o)&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return o;I.current=null}if(!i.current)return null;if(i.current.scrollHeight>i.current.clientHeight+2||i.current.scrollWidth>i.current.clientWidth+2)return I.current=i.current,i.current;if(!Ye)return null;let e=i.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!==i.current&&r.classList.contains("overlay-scrollbar-container"))continue;let c=r.parentElement,l=!1;for(;c&&c!==i.current;){if(c.classList.contains("overlay-scrollbar-container")&&c!==i.current){l=!0;break}c=c.parentElement}if(!l&&(r.scrollHeight>r.clientHeight+2||r.scrollWidth>r.clientWidth+2))return I.current=r,r}return null},[]),N=(0,t.useCallback)(()=>d()!==null,[d]),b=(0,t.useCallback)(()=>{re.current&&(clearTimeout(re.current),re.current=null)},[]),de=(0,t.useCallback)(()=>{U.current&&(clearTimeout(U.current),U.current=null)},[]),qe=(0,t.useCallback)(()=>{q.current&&(clearTimeout(q.current),q.current=null)},[]),it=(0,t.useCallback)(()=>{de(),!(W||O||P||Y.current)&&(b(),v(!1))},[b,de,W,O,P]),m=(0,t.useCallback)(e=>{a.enabled&&(b(),re.current=setTimeout(()=>{v(!1),re.current=null},e))},[b,a.enabled]),u=(0,t.useCallback)(()=>{let e=d()??i.current;if(!e){v(!1),Oe(!1),Fe(!1),b();return}!a.enabled&&!G&&(v(!0),b());let o=e.clientHeight,r=e.scrollHeight,c=e.scrollTop,l=e.clientWidth,s=e.scrollWidth,g=e.scrollLeft,w=r-o>0,p=s-l>0,K=w||p;Oe(w),Fe(p),K||(v(!1),b());let le=0,S=0;if(he.current){let F=window.getComputedStyle(he.current),B=parseFloat(F.paddingTop)||0;S=parseFloat(F.paddingBottom)||0,le=B+S,rt(S)}if(w){let F=A?f*2+n.margin*4:n.margin*2,B=o-F+le,pe=o/r,V=Math.max(B*pe,xe),Xe=r-o,ht=B-V,ft=Xe>0?c/Xe*ht:0;We(V),be(ft)}else We(0),be(0);let ie=s-l;if(ie>0){let F=l/s,B=Math.max(l*F,50),pe=l-B,V=ie>0?g/ie*pe:0;Pe(B),Ne(V)}else Pe(0),Ne(0)},[d,b,A,f,xe,a.enabled,G]),at=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=d();o&&(ke(!0),Ze({y:e.clientY,scrollTop:o.scrollTop}),b(),v(!0),D())},[d,b,D]),we=(0,t.useCallback)(e=>{if(!W)return;let o=d();if(!o)return;let r=o.clientHeight,l=o.scrollHeight-r,s=e.clientY-fe.y,g=r-ee,w=s/g*l,p=Math.max(0,Math.min(l,fe.scrollTop+w));o.scrollTop=p,u()},[W,fe,ee,u,d]),Te=(0,t.useCallback)(()=>{ke(!1),N()&&m(a.delay)},[N,m,a.delay]),ct=(0,t.useCallback)(e=>{if(!Q.current)return;let r=Q.current.getBoundingClientRect(),c=e.clientY-r.top,l=d();if(!l)return;let s=l.clientHeight,g=l.scrollHeight,p=c/s*(g-s);l.scrollTop=Math.max(0,Math.min(g-s,p)),u(),v(!0),m(a.delay),D()},[u,m,a.delay,d,D]),st=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!i.current)return;let o=Math.max(0,i.current.scrollTop-ue);i.current.scrollTop=o,u(),v(!0),m(a.delay),D()},[u,m,ue,a.delay,D]),ut=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!i.current||!J.current)return;let o=i.current,c=J.current.scrollHeight-o.clientHeight,l=Math.min(c,o.scrollTop+ue);o.scrollTop=l,u(),v(!0),m(a.delay),D()},[u,m,ue,a.delay,D]),dt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=d();o&&(ze(!0),Je({x:e.clientX,scrollLeft:o.scrollLeft}),b(),v(!0),D())},[d,b,D]),Me=(0,t.useCallback)(e=>{if(!O)return;let o=d();if(!o)return;let r=o.clientWidth,l=o.scrollWidth-r,s=e.clientX-ge.x,g=r-ve,w=s/g*l,p=Math.max(0,Math.min(l,ge.scrollLeft+w));o.scrollLeft=p,u()},[O,ge,ve,u,d]),Se=(0,t.useCallback)(()=>{ze(!1),N()&&m(a.delay)},[N,m,a.delay]),pt=(0,t.useCallback)(e=>{if(!Q.current)return;let r=Q.current.getBoundingClientRect(),c=e.clientX-r.left,l=d();if(!l)return;let s=l.clientWidth,g=l.scrollWidth,p=c/s*(g-s);l.scrollLeft=Math.max(0,Math.min(g-s,p)),u(),v(!0),m(a.delay),D()},[u,m,a.delay,d,D]),mt=(0,t.useCallback)(e=>{if(!ne.enabled)return;let o=e.target;if(me(o,ne)||e.button!==0)return;let r=d();r&&(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth||(e.preventDefault(),Y.current=!0,et({x:e.clientX,y:e.clientY,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft||0}),b()))},[ne,me,d,b]),Ee=(0,t.useCallback)(e=>{if(!Y.current&&!P)return;let o=d();if(!o)return;let r=te.x-e.clientX,c=te.y-e.clientY;if(Math.abs(c)<5&&Math.abs(r)<5)return;Y.current&&(Y.current=!1,Be(!0)),v(!0);let l=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,te.scrollTop+c)),s=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,te.scrollLeft+r));o.scrollTop=l,o.scrollLeft=s,u()},[P,te,d,u]),Ce=(0,t.useCallback)(()=>{let e=P;Y.current=!1,Be(!1),e&&N()&&m(a.delay)},[P,N,m,a.delay]);(0,t.useEffect)(()=>{let e=s=>{if(u(),G){$&&$(s);return}b(),v(!0),qe();let g=_e?a.delayOnWheel:a.delay;m(g),$&&$(s)},o=()=>{Ue(!0),oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>{Ue(!1)},300),qe(),q.current=setTimeout(()=>{v(!0),q.current=null,m(a.delayOnWheel)},50)},r=[],c=d();c&&r.push(c);let l=i.current;return l&&!c&&(r.push(l),l.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(g=>{let w=g;if(w!==l&&w.classList.contains("overlay-scrollbar-container"))return;let p=w.parentElement;for(;p&&p!==l;){if(p.classList.contains("overlay-scrollbar-container")&&p!==l)return;p=p.parentElement}r.push(w)})),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)}),oe.current&&clearTimeout(oe.current),q.current&&clearTimeout(q.current)}},[d,u,$,b,m,a,_e,G]),(0,t.useEffect)(()=>{let e=r=>{let c=r.target;if(r.defaultPrevented||c instanceof Element&&me(c,ne))return;let l=d();if(!l)return;let{key:s}=r,{scrollTop:g,scrollHeight:w,clientHeight:p}=l,K=w-p,le=50,S=null;switch(s){case"ArrowUp":r.preventDefault(),S=Math.max(0,g-le);break;case"ArrowDown":r.preventDefault(),S=Math.min(K,g+le);break;case"PageUp":r.preventDefault(),S=Math.max(0,g-p);break;case"PageDown":r.preventDefault(),S=Math.min(K,g+p);break;case"Home":r.preventDefault(),S=0;break;case"End":r.preventDefault(),S=K;break;default:return}if(S!==null){let ie=S/K,F=A?f*2+n.margin*4:n.margin*2,V=(p-F-ee)*ie;be(V),l.scrollTop=S,b(),v(!0),m(a.delay)}},o=i.current;if(o)return o.addEventListener("keydown",e),()=>{o.removeEventListener("keydown",e)}},[d,A,f,n.margin,ee,b,m,a.delay,ne]),(0,t.useEffect)(()=>(document.addEventListener("mousemove",Ee),document.addEventListener("mouseup",Ce),()=>{document.removeEventListener("mousemove",Ee),document.removeEventListener("mouseup",Ce)}),[P,Ee,Ce]),(0,t.useEffect)(()=>{if(W)return document.addEventListener("mousemove",we),document.addEventListener("mouseup",Te),()=>{document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",Te)}},[W,we,Te]),(0,t.useEffect)(()=>{if(O)return document.addEventListener("mousemove",Me),document.addEventListener("mouseup",Se),()=>{document.removeEventListener("mousemove",Me),document.removeEventListener("mouseup",Se)}},[O,Me,Se]),(0,t.useEffect)(()=>{u();let e=setTimeout(()=>{u()},100);return()=>clearTimeout(e)},[u]),(0,t.useLayoutEffect)(()=>{tt(!0),u(),!a.enabled&&!G&&N()&&v(!0)},[N,u,a.enabled,G]),(0,t.useEffect)(()=>{if(a.initialDelay>0){let e=setTimeout(()=>{nt(!1)},a.initialDelay);return()=>clearTimeout(e)}},[a.initialDelay]),(0,t.useEffect)(()=>{let e=new ResizeObserver(()=>{u()}),o=[];return i.current&&o.push(i.current),J.current&&o.push(J.current),I.current&&document.contains(I.current)&&o.push(I.current),o.forEach(r=>{e.observe(r)}),()=>e.disconnect()},[u]),(0,t.useEffect)(()=>{if(!i.current)return;let e=new MutationObserver(()=>{I.current=null,u()});return e.observe(i.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[u]);let M=Math.max(lt,f);return(0,t.useEffect)(()=>{let e="overlay-scrollbar-webkit-hide",o=document.getElementById(e);o&&o.remove();let r=document.createElement("style");return r.id=e,r.textContent=`
|
|
1
|
+
"use strict";var $e=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var Ct=Object.prototype.hasOwnProperty;var Ht=(f,h)=>{for(var C in h)$e(f,C,{get:h[C],enumerable:!0})},Lt=(f,h,C,b)=>{if(h&&typeof h=="object"||typeof h=="function")for(let H of St(h))!Ct.call(f,H)&&H!==C&&$e(f,H,{get:()=>h[H],enumerable:!(b=Et(h,H))||b.enumerable});return f};var Dt=f=>Lt($e({},"__esModule",{value:!0}),f);var Nt={};Ht(Nt,{OverlayScrollbar:()=>ze,default:()=>ze});module.exports=Dt(Nt);var t=require("react");var Rt=["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=(f,h)=>{if(f instanceof HTMLElement&&f.isContentEditable||f.closest('[role="textbox"],[role="searchbox"]'))return!0;let C=f.tagName.toLowerCase();if(C==="input"){let b=(f.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(b)}if(["textarea","select","button"].includes(C)||["svg","path","circle","rect","line","polygon","polyline"].includes(C)||f.getAttribute("contenteditable")==="true")return!0;if(h?.excludeSelectors){for(let b of h.excludeSelectors)if(f.matches(b))return!0}return kt(f,h)},kt=(f,h)=>{let C=[...Rt,...h?.excludeClasses||[]],b=f,H=0,O=5;for(;b&&H<=O;){if(C.some(L=>b.classList.contains(L)))return!0;if(b.classList.contains("MuiDialogContent-root"))break;b=b.parentElement,H++}return!1};var W=require("react"),ot=({containerRef:f,config:h})=>{let C=h.enabled??!0,b=h.threshold??80,H=h.maxDistance??b*2,O=h.onRefresh,[L,D]=(0,W.useState)(0),[A,B]=(0,W.useState)(!1),z=(0,W.useRef)(0),ce=(0,W.useRef)(0),$=(0,W.useRef)(!1),X=(0,W.useRef)(!1),se=(0,W.useRef)(0),Q=(0,W.useRef)(!1);return(0,W.useEffect)(()=>{Q.current=A},[A]),(0,W.useEffect)(()=>{let R=f.current;if(!R||!(C&&typeof O=="function"))return;let i=u=>{let E=u instanceof Element?u:null;for(;E&&E!==R;){if(E instanceof HTMLElement&&E.scrollHeight>E.clientHeight+1&&E.scrollTop>0)return!1;E=E.parentElement}return!0},Y=u=>{Q.current||u.touches.length===1&&(R.scrollTop>0||i(u.target)&&($.current=!0,X.current=!1,z.current=u.touches[0].clientY,ce.current=u.touches[0].clientX))},q=u=>{if(!$.current||Q.current||u.touches.length!==1)return;let E=u.touches[0].clientY-z.current,te=u.touches[0].clientX-ce.current;if(!X.current){if(E<=0||R.scrollTop>0){$.current=!1;return}if(E>8&&E>Math.abs(te))X.current=!0;else return}u.cancelable&&u.preventDefault();let oe=Math.min(Math.max(E,0)*.5,H);se.current=oe,D(oe)},ee=()=>{if(!$.current||($.current=!1,!X.current))return;X.current=!1;let u=se.current;se.current=0,u>=b&&!Q.current?(B(!0),D(b),Promise.resolve().then(()=>O()).catch(()=>{}).finally(()=>{B(!1),D(0)})):D(0)};return R.addEventListener("touchstart",Y,{passive:!0}),R.addEventListener("touchmove",q,{passive:!1}),R.addEventListener("touchend",ee,{passive:!0}),R.addEventListener("touchcancel",ee,{passive:!0}),()=>{R.removeEventListener("touchstart",Y),R.removeEventListener("touchmove",q),R.removeEventListener("touchend",ee),R.removeEventListener("touchcancel",ee)}},[f,C,O,b,H]),{pullDistance:L,isRefreshing:A,pullProgress:Math.min(L/b,1),pullThreshold:b}};var M=require("react/jsx-runtime"),It={},Wt={},Ot={},At={},Pt={},$t={},zt=(0,t.forwardRef)(({className:f="",style:h={},containerStyle:C={},contentStyle:b={},children:H,onScroll:O,thumb:L=It,track:D=Wt,arrows:A=Ot,dragScroll:B=At,autoHide:z=Pt,pullToRefresh:ce=$t,showScrollbar:$=!0,showHorizontalScrollbar:X=!0,detectInnerScroll:se=!1},Q)=>{let R=(0,t.useRef)({});(0,t.useEffect)(()=>{R.current={children:H,onScroll:O,showScrollbar:$,showHorizontalScrollbar:X,thumb:L,track:D,arrows:A,dragScroll:B,autoHide:z}});let ge=(0,t.useRef)(null),i=(0,t.useRef)(null),Y=(0,t.useRef)(null),q=(0,t.useRef)(null),ee=(0,t.useRef)(null),u=(0,t.useRef)(null),{pullDistance:E,isRefreshing:te,pullProgress:oe}=ot({containerRef:i,config:ce}),Ne=ce.indicatorColor??"#1976d2",rt=E>0||te,[ve,T]=(0,t.useState)(!1),[F,Fe]=(0,t.useState)(!1),[_e,Ue]=(0,t.useState)(!1),[Se,nt]=(0,t.useState)({y:0,scrollTop:0}),[ue,Be]=(0,t.useState)(0),[lt,Ce]=(0,t.useState)(0),[re,Xe]=(0,t.useState)(!1),[Ye,qe]=(0,t.useState)(!1),[_,Ge]=(0,t.useState)(!1),[He,it]=(0,t.useState)({x:0,scrollLeft:0}),[Le,je]=(0,t.useState)(0),[De,Ke]=(0,t.useState)(0),[at,Ve]=(0,t.useState)(!1),ne=(0,t.useRef)(!1),[G,Ze]=(0,t.useState)(!1),[de,ct]=(0,t.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[Ft,_t]=(0,t.useState)(null),[ye,xe]=(0,t.useState)(null),[Ut,st]=(0,t.useState)(!1),[ut,dt]=(0,t.useState)(0),pe=(0,t.useRef)(null),[Je,Qe]=(0,t.useState)(!1),fe=(0,t.useRef)(null),Z=(0,t.useRef)(null),J=(0,t.useRef)(null),w=(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]),n=(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??w.radius??4,margin:D.margin??4,overflowX:D.overflowX??!0,overflowY:D.overflowY??!0}),[D,w.radius]),N=(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:B.enabled??!0,excludeClasses:B.excludeClasses??[],excludeSelectors:B.excludeSelectors??[]}),[B]),a=(0,t.useMemo)(()=>({enabled:z.enabled??!0,delay:z.delay??1500,delayOnWheel:z.delayOnWheel??700,initialDelay:z.initialDelay??200}),[z]),[le,pt]=(0,t.useState)(()=>(z.initialDelay??200)>0),v=w.width,ft=n.width,Re=w.minHeight,U=N.visible,Te=N.step,P=(0,t.useCallback)(()=>{if(!i.current)return;let e=document.activeElement;e&&i.current.contains(e)&&e!==i.current||i.current.focus()},[]);(0,t.useImperativeHandle)(Q,()=>({getScrollContainer:()=>i.current,scrollTo:e=>{i.current&&i.current.scrollTo(e)},get scrollTop(){return i.current?.scrollTop||0},get scrollHeight(){return i.current?.scrollHeight||0},get clientHeight(){return i.current?.clientHeight||0}}),[]);let p=(0,t.useCallback)(()=>{if(u.current){let o=u.current;if(document.contains(o)&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return o;u.current=null}if(!i.current)return null;if(i.current.scrollHeight>i.current.clientHeight+2||i.current.scrollWidth>i.current.clientWidth+2)return u.current=i.current,i.current;if(!se)return null;let e=i.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!==i.current&&r.classList.contains("overlay-scrollbar-container"))continue;let c=r.parentElement,l=!1;for(;c&&c!==i.current;){if(c.classList.contains("overlay-scrollbar-container")&&c!==i.current){l=!0;break}c=c.parentElement}if(!l&&(r.scrollHeight>r.clientHeight+2||r.scrollWidth>r.clientWidth+2))return u.current=r,r}return null},[]),j=(0,t.useCallback)(()=>p()!==null,[p]),y=(0,t.useCallback)(()=>{fe.current&&(clearTimeout(fe.current),fe.current=null)},[]),we=(0,t.useCallback)(()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)},[]),et=(0,t.useCallback)(()=>{J.current&&(clearTimeout(J.current),J.current=null)},[]),ht=(0,t.useCallback)(()=>{we(),!(F||_||G||ne.current)&&(y(),T(!1))},[y,we,F,_,G]),g=(0,t.useCallback)(e=>{a.enabled&&(y(),fe.current=setTimeout(()=>{T(!1),fe.current=null},e))},[y,a.enabled]),d=(0,t.useCallback)(()=>{let e=p()??i.current;if(!e){T(!1),Xe(!1),Ve(!1),y();return}!a.enabled&&!le&&(T(!0),y());let o=e.clientHeight,r=e.scrollHeight,c=e.scrollTop,l=e.clientWidth,s=e.scrollWidth,x=e.scrollLeft,S=r-o>0,m=s-l>0,ie=S||m;Xe(S),Ve(m),ie||(T(!1),y());let me=0,I=0;if(ge.current){let K=window.getComputedStyle(ge.current),V=parseFloat(K.paddingTop)||0;I=parseFloat(K.paddingBottom)||0,me=V+I,dt(I)}if(S){let K=U?v*2+n.margin*4:n.margin*2,V=o-K+me,Me=o/r,ae=Math.max(V*Me,Re),tt=r-o,wt=V-ae,Mt=tt>0?c/tt*wt:0;Be(ae),Ce(Mt)}else Be(0),Ce(0);let be=s-l;if(be>0){let K=l/s,V=Math.max(l*K,50),Me=l-V,ae=be>0?x/be*Me:0;je(V),Ke(ae)}else je(0),Ke(0)},[p,y,U,v,Re,a.enabled,le]),mt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=p();o&&(Fe(!0),nt({y:e.clientY,scrollTop:o.scrollTop}),y(),T(!0),P())},[p,y,P]),ke=(0,t.useCallback)(e=>{if(!F)return;let o=p();if(!o)return;let r=o.clientHeight,l=o.scrollHeight-r,s=e.clientY-Se.y,x=r-ue,S=s/x*l,m=Math.max(0,Math.min(l,Se.scrollTop+S));o.scrollTop=m,d()},[F,Se,ue,d,p]),Ie=(0,t.useCallback)(()=>{Fe(!1),j()&&g(a.delay)},[j,g,a.delay]),bt=(0,t.useCallback)(e=>{if(!q.current)return;let r=q.current.getBoundingClientRect(),c=e.clientY-r.top,l=p();if(!l)return;let s=l.clientHeight,x=l.scrollHeight,m=c/s*(x-s);l.scrollTop=Math.max(0,Math.min(x-s,m)),d(),T(!0),g(a.delay),P()},[d,g,a.delay,p,P]),gt=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!i.current)return;let o=Math.max(0,i.current.scrollTop-Te);i.current.scrollTop=o,d(),T(!0),g(a.delay),P()},[d,g,Te,a.delay,P]),vt=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!i.current||!Y.current)return;let o=i.current,c=Y.current.scrollHeight-o.clientHeight,l=Math.min(c,o.scrollTop+Te);o.scrollTop=l,d(),T(!0),g(a.delay),P()},[d,g,Te,a.delay,P]),yt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=p();o&&(Ge(!0),it({x:e.clientX,scrollLeft:o.scrollLeft}),y(),T(!0),P())},[p,y,P]),We=(0,t.useCallback)(e=>{if(!_)return;let o=p();if(!o)return;let r=o.clientWidth,l=o.scrollWidth-r,s=e.clientX-He.x,x=r-Le,S=s/x*l,m=Math.max(0,Math.min(l,He.scrollLeft+S));o.scrollLeft=m,d()},[_,He,Le,d,p]),Oe=(0,t.useCallback)(()=>{Ge(!1),j()&&g(a.delay)},[j,g,a.delay]),xt=(0,t.useCallback)(e=>{if(!q.current)return;let r=q.current.getBoundingClientRect(),c=e.clientX-r.left,l=p();if(!l)return;let s=l.clientWidth,x=l.scrollWidth,m=c/s*(x-s);l.scrollLeft=Math.max(0,Math.min(x-s,m)),d(),T(!0),g(a.delay),P()},[d,g,a.delay,p,P]),Tt=(0,t.useCallback)(e=>{if(!he.enabled)return;let o=e.target;if(Ee(o,he)||e.button!==0)return;let r=p();r&&(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth||(e.preventDefault(),ne.current=!0,ct({x:e.clientX,y:e.clientY,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft||0}),y()))},[he,Ee,p,y]),Ae=(0,t.useCallback)(e=>{if(!ne.current&&!G)return;let o=p();if(!o)return;let r=de.x-e.clientX,c=de.y-e.clientY;if(Math.abs(c)<5&&Math.abs(r)<5)return;ne.current&&(ne.current=!1,Ze(!0)),T(!0);let l=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,de.scrollTop+c)),s=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,de.scrollLeft+r));o.scrollTop=l,o.scrollLeft=s,d()},[G,de,p,d]),Pe=(0,t.useCallback)(()=>{let e=G;ne.current=!1,Ze(!1),e&&j()&&g(a.delay)},[G,j,g,a.delay]);(0,t.useEffect)(()=>{let e=s=>{if(d(),le){O&&O(s);return}y(),T(!0),et();let x=Je?a.delayOnWheel:a.delay;g(x),O&&O(s)},o=()=>{Qe(!0),pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>{Qe(!1)},300),et(),J.current=setTimeout(()=>{T(!0),J.current=null,g(a.delayOnWheel)},50)},r=[],c=p();c&&r.push(c);let l=i.current;return l&&!c&&(r.push(l),l.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(x=>{let S=x;if(S!==l&&S.classList.contains("overlay-scrollbar-container"))return;let m=S.parentElement;for(;m&&m!==l;){if(m.classList.contains("overlay-scrollbar-container")&&m!==l)return;m=m.parentElement}r.push(S)})),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)}),pe.current&&clearTimeout(pe.current),J.current&&clearTimeout(J.current)}},[p,d,O,y,g,a,Je,le]),(0,t.useEffect)(()=>{let e=r=>{let c=r.target;if(r.defaultPrevented||c instanceof Element&&Ee(c,he))return;let l=p();if(!l)return;let{key:s}=r,{scrollTop:x,scrollHeight:S,clientHeight:m}=l,ie=S-m,me=50,I=null;switch(s){case"ArrowUp":r.preventDefault(),I=Math.max(0,x-me);break;case"ArrowDown":r.preventDefault(),I=Math.min(ie,x+me);break;case"PageUp":r.preventDefault(),I=Math.max(0,x-m);break;case"PageDown":r.preventDefault(),I=Math.min(ie,x+m);break;case"Home":r.preventDefault(),I=0;break;case"End":r.preventDefault(),I=ie;break;default:return}if(I!==null){let be=I/ie,K=U?v*2+n.margin*4:n.margin*2,ae=(m-K-ue)*be;Ce(ae),l.scrollTop=I,y(),T(!0),g(a.delay)}},o=i.current;if(o)return o.addEventListener("keydown",e),()=>{o.removeEventListener("keydown",e)}},[p,U,v,n.margin,ue,y,g,a.delay,he]),(0,t.useEffect)(()=>(document.addEventListener("mousemove",Ae),document.addEventListener("mouseup",Pe),()=>{document.removeEventListener("mousemove",Ae),document.removeEventListener("mouseup",Pe)}),[G,Ae,Pe]),(0,t.useEffect)(()=>{if(F)return document.addEventListener("mousemove",ke),document.addEventListener("mouseup",Ie),()=>{document.removeEventListener("mousemove",ke),document.removeEventListener("mouseup",Ie)}},[F,ke,Ie]),(0,t.useEffect)(()=>{if(_)return document.addEventListener("mousemove",We),document.addEventListener("mouseup",Oe),()=>{document.removeEventListener("mousemove",We),document.removeEventListener("mouseup",Oe)}},[_,We,Oe]),(0,t.useEffect)(()=>{d();let e=setTimeout(()=>{d()},100);return()=>clearTimeout(e)},[d]),(0,t.useLayoutEffect)(()=>{st(!0),d(),!a.enabled&&!le&&j()&&T(!0)},[j,d,a.enabled,le]),(0,t.useEffect)(()=>{if(a.initialDelay>0){let e=setTimeout(()=>{pt(!1)},a.initialDelay);return()=>clearTimeout(e)}},[a.initialDelay]),(0,t.useEffect)(()=>{let e=new ResizeObserver(()=>{d()}),o=[];return i.current&&o.push(i.current),Y.current&&o.push(Y.current),u.current&&document.contains(u.current)&&o.push(u.current),o.forEach(r=>{e.observe(r)}),()=>e.disconnect()},[d]),(0,t.useEffect)(()=>{if(!i.current)return;let e=new MutationObserver(()=>{u.current=null,d()});return e.observe(i.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[d]);let k=Math.max(ft,v);return(0,t.useEffect)(()=>{let e="overlay-scrollbar-webkit-hide",o=document.getElementById(e);o&&o.remove();let r=document.createElement("style");return r.id=e,r.textContent=`
|
|
2
2
|
/* \uBAA8\uB4E0 \uC2A4\uD06C\uB864\uBC14 \uC228\uAE30\uAE30 */
|
|
3
3
|
.overlay-scrollbar-container {
|
|
4
4
|
scrollbar-width: none !important;
|
|
@@ -38,5 +38,10 @@
|
|
|
38
38
|
.overlay-scrollbar-container .ehfuse-editor-content::-webkit-scrollbar-thumb:hover {
|
|
39
39
|
background: #a1a1a1 !important;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
/* \uB2F9\uACA8\uC11C \uC0C8\uB85C\uACE0\uCE68 \uC2A4\uD53C\uB108 \uD68C\uC804 */
|
|
42
|
+
@keyframes overlay-scrollbar-ptr-spin {
|
|
43
|
+
from { transform: rotate(0deg); }
|
|
44
|
+
to { transform: rotate(360deg); }
|
|
45
|
+
}
|
|
46
|
+
`,document.head.appendChild(r),()=>{let c=document.getElementById(e);c&&c.remove()}},[]),(0,M.jsxs)("div",{ref:ge,className:`overlay-scrollbar-wrapper ${f}`,onMouseLeave:ht,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...h},children:[rt&&(0,M.jsx)("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${E-44}px)`,transition:te?"transform 0.15s ease-out":E===0?"transform 0.2s ease-out":"none",width:36,height:36,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:te?1:Math.min(oe*1.5,1)},children:te?(0,M.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:(0,M.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:Ne,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):(0,M.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",style:{transform:`rotate(${oe*270}deg)`,opacity:oe>=1?1:.6},children:(0,M.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:Ne})})}),(0,M.jsx)("div",{ref:i,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:Tt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:G?"none":"auto",...C},children:(0,M.jsx)("div",{ref:Y,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...b},children:H})}),$&&re&&(n.overflowY??!0)&&(0,M.jsxs)("div",{ref:q,className:"overlay-scrollbar-track",onMouseEnter:()=>{y(),Z.current=setTimeout(()=>{T(!0),Z.current=null},100)},onMouseLeave:()=>{we(),F||g(a.delay)},style:{position:"absolute",top:0,right:0,width:`${k}px`,height:"100%",opacity:ve?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,M.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),bt(e)},style:{position:"absolute",top:U?`${w.width+n.margin*2}px`:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(k-w.width)/2}px`,width:`${w.width}px`,height:U?`calc(100% - ${w.width*2+n.margin*4}px)`:`calc(100% - ${n.margin*2}px)`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,M.jsx)("div",{ref:ee,className:"overlay-scrollbar-thumb",onMouseDown:mt,onMouseEnter:()=>Ue(!0),onMouseLeave:()=>Ue(!1),style:{position:"absolute",top:`${(U?v+n.margin*2:n.margin)+lt}px`,right:n.alignment==="outside"?"0px":`${(k-v)/2}px`,width:`${v}px`,height:`${Math.max(ue,Re)}px`,backgroundColor:_e||F?w.hoverColor:w.color,opacity:_e||F?w.hoverOpacity:w.opacity,borderRadius:`${w.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),$&&re&&U&&(0,M.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:gt,onMouseEnter:()=>xe("up"),onMouseLeave:()=>xe(null),style:{position:"absolute",top:`${n.margin}px`,right:n.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:ye==="up"?N.hoverColor:N.color,userSelect:"none",zIndex:1001,opacity:ve?ye==="up"?N.hoverOpacity:N.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),$&&re&&U&&(0,M.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:vt,onMouseEnter:()=>xe("down"),onMouseLeave:()=>xe(null),style:{position:"absolute",bottom:`${n.margin}px`,right:n.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:ye==="down"?N.hoverColor:N.color,userSelect:"none",zIndex:1001,opacity:ve?ye==="down"?N.hoverOpacity:N.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),$&&X&&at&&(n.overflowX??!0)&&(0,M.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{y(),Z.current=setTimeout(()=>{T(!0),Z.current=null},100)},onMouseLeave:()=>{we(),_||g(a.delay)},style:{position:"absolute",bottom:`${ut}px`,left:0,width:"100%",height:`${k}px`,opacity:ve?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,M.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),xt(e)},style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(k-v)/2}px`,left:`${n.margin}px`,right:re?n.alignment==="outside"?`${k-n.margin}px`:`${k}px`:`${n.margin}px`,height:`${v}px`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,M.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:yt,onMouseEnter:()=>qe(!0),onMouseLeave:()=>qe(!1),style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(k-v)/2}px`,left:`${n.margin+De}px`,right:re?n.alignment==="outside"?`${k-n.margin}px`:`${k}px`:"auto",maxWidth:re?n.alignment==="outside"?`calc(100% - ${n.margin+De+k-n.margin}px)`:`calc(100% - ${n.margin+De+k}px)`:"none",width:`${Math.max(Le,50)}px`,height:`${v}px`,backgroundColor:Ye||_?w.hoverColor:w.color,opacity:Ye||_?w.hoverOpacity:w.opacity,borderRadius:`${w.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),ze=zt;
|
|
42
47
|
//# sourceMappingURL=index.js.map
|