@ehfuse/overlay-scrollbar 1.6.2 → 1.6.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"OverlayScrollbar.d.ts","sourceRoot":"","sources":["../src/OverlayScrollbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,EAMV,SAAS,EAIZ,MAAM,OAAO,CAAC;AAIf,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,YAAY;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAGD,MAAM,WAAW,cAAc;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAGlC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAG1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAGD,MAAM,WAAW,mBAAmB;IAChC,kBAAkB,EAAE,MAAM,cAAc,GAAG,IAAI,CAAC;IAChD,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACxB;AASD,QAAA,MAAM,gBAAgB,mGA6oDrB,CAAC;AAEF,eAAe,gBAAgB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"OverlayScrollbar.d.ts","sourceRoot":"","sources":["../src/OverlayScrollbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,EAMV,SAAS,EAIZ,MAAM,OAAO,CAAC;AAIf,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,YAAY;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAGD,MAAM,WAAW,cAAc;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAGlC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAG1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAGD,MAAM,WAAW,mBAAmB;IAChC,kBAAkB,EAAE,MAAM,cAAc,GAAG,IAAI,CAAC;IAChD,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACxB;AASD,QAAA,MAAM,gBAAgB,mGAoqDrB,CAAC;AAEF,eAAe,gBAAgB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import{useRef as S,useEffect as E,useState as h,useCallback as m,useMemo as re,forwardRef as gt,useImperativeHandle as vt,useLayoutEffect as yt}from"react";var ft=["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"],He=(H,z)=>{let N=H.tagName.toLowerCase(),D=["text","password","email","number","search","tel","url","checkbox","radio"];if(N==="input"){let k=H.type;return D.includes(k)}if(["textarea","select","button"].includes(N)||["svg","path","circle","rect","line","polygon","polyline"].includes(N)||H.getAttribute("contenteditable")==="true")return!0;if(z?.excludeSelectors){for(let k of z.excludeSelectors)if(H.matches(k))return!0}return bt(H,z)},bt=(H,z)=>{let N=[...ft,...z?.excludeClasses||[]],D=H,k=0,I=5;for(;D&&k<=I;){if(N.some(T=>D.classList.contains(T)))return!0;if(D.classList.contains("MuiDialogContent-root"))break;D=D.parentElement,k++}return!1};import{jsx as $,jsxs as De}from"react/jsx-runtime";var xt={},Tt={},wt={},Mt={},St={},Et=gt(({className:H="",style:z={},containerStyle:N={},contentStyle:D={},children:k,onScroll:I,thumb:T=xt,track:A=Tt,arrows:O=wt,dragScroll:J=Mt,autoHide:P=St,showScrollbar:K=!0,detectInnerScroll:Xe=!1},Ye)=>{let Ge=S({});E(()=>{Ge.current={children:k,onScroll:I,showScrollbar:K,thumb:T,track:A,arrows:O,dragScroll:J,autoHide:P}});let pe=S(null),i=S(null),F=S(null),X=S(null),Je=S(null),L=S(null),[ne,x]=h(!1),[_,ke]=h(!1),[Le,Re]=h(!1),[me,Ke]=h({y:0,scrollTop:0}),[Z,Ze]=h(0),[je,Ie]=h(0),[he,Ae]=h(!1),[Oe,We]=h(!1),[U,$e]=h(!1),[fe,Ve]=h({x:0,scrollLeft:0}),[be,Qe]=h(0),[et,tt]=h(0),[ot,ge]=h(!1),[j,ze]=h(!1),[V,rt]=h({x:0,y:0,scrollTop:0,scrollLeft:0}),[Ct,Ht]=h(null),[le,ie]=h(null),[Dt,nt]=h(!1),Q=S(null),[Ne,Pe]=h(!1),ee=S(null),q=S(null),B=S(null),f=re(()=>{let e=T.color??"#606060";return{width:T.width??8,minHeight:T.minHeight??50,radius:T.radius??(T.width??8)/2,color:e,opacity:T.opacity??.6,hoverColor:T.hoverColor??e,hoverOpacity:T.hoverOpacity??1}},[T]),c=re(()=>({width:A.width??16,color:A.color??"rgba(128, 128, 128, 0.1)",visible:A.visible??!0,alignment:A.alignment??"center",radius:A.radius??f.radius??4,margin:A.margin??4}),[A,f.radius]),C=re(()=>{let e=O.color??"#808080";return{visible:O.visible??!1,step:O.step??50,color:e,opacity:O.opacity??.6,hoverColor:O.hoverColor??e,hoverOpacity:O.hoverOpacity??1}},[O]),ve=re(()=>({enabled:J.enabled??!0,excludeClasses:J.excludeClasses??[],excludeSelectors:J.excludeSelectors??[]}),[J]),n=re(()=>({enabled:P.enabled??!0,delay:P.delay??1500,delayOnWheel:P.delayOnWheel??700,initialDelay:P.initialDelay??200}),[P]),[Y,lt]=h(()=>(P.initialDelay??200)>0),b=f.width,it=c.width,ye=f.minHeight,R=C.visible,ae=C.step,w=m(()=>{if(!i.current)return;let e=document.activeElement;e&&i.current.contains(e)&&e!==i.current||i.current.focus()},[]);vt(Ye,()=>({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 u=m(()=>{if(L.current){let t=L.current;if(document.contains(t)&&t.scrollHeight>t.clientHeight+2)return t;L.current=null}if(!i.current)return null;if(F.current&&F.current.scrollHeight>i.current.clientHeight+2)return L.current=i.current,i.current;if(!Xe)return null;let e=i.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let t of e){let o=t;if(o!==i.current&&o.classList.contains("overlay-scrollbar-container"))continue;let a=o.parentElement,r=!1;for(;a&&a!==i.current;){if(a.classList.contains("overlay-scrollbar-container")&&a!==i.current){r=!0;break}a=a.parentElement}if(!r&&o.scrollHeight>o.clientHeight+2)return L.current=o,o}return null},[]),W=m(()=>u()!==null,[u]),v=m(()=>{ee.current&&(clearTimeout(ee.current),ee.current=null)},[]),Fe=m(()=>{q.current&&(clearTimeout(q.current),q.current=null)},[]),_e=m(()=>{B.current&&(clearTimeout(B.current),B.current=null)},[]),d=m(e=>{n.enabled&&(v(),ee.current=setTimeout(()=>{x(!1),ee.current=null},e))},[v,n.enabled]),s=m(()=>{let e=u();if(!e){x(!1),Ae(!1),ge(!1),v();return}if(Ae(!0),!X.current)return;!n.enabled&&!Y&&(x(!0),v());let t=e.clientHeight,o=e.scrollHeight,a=e.scrollTop,r=e.clientWidth,l=e.scrollWidth,y=e.scrollLeft,g=0;if(pe.current){let ue=window.getComputedStyle(pe.current),de=parseFloat(ue.paddingTop)||0,Ce=parseFloat(ue.paddingBottom)||0;g=de+Ce}let p=R?b*2+c.margin*4:c.margin*2,te=t-p+g,M=t/o,ce=Math.max(te*M,ye),se=o-t,Ue=te-ce,qe=se>0?a/se*Ue:0;Ze(ce),Ie(qe);let oe=l-r;if(oe>0){ge(!0);let ue=r/l,de=Math.max(r*ue,50),Ce=r-de,ht=oe>0?y/oe*Ce:0;Qe(de),tt(ht)}else ge(!1)},[u,v,R,b,ye,n.enabled,Y]),at=m(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(ke(!0),Ke({y:e.clientY,scrollTop:t.scrollTop}),v(),x(!0),w())},[u,v,w]),xe=m(e=>{if(!_)return;let t=u();if(!t)return;let o=t.clientHeight,r=t.scrollHeight-o,l=e.clientY-me.y,y=o-Z,g=l/y*r,p=Math.max(0,Math.min(r,me.scrollTop+g));t.scrollTop=p,s()},[_,me,Z,s,u]),Te=m(()=>{ke(!1),W()&&d(n.delay)},[W,d,n.delay]),ct=m(e=>{if(!X.current)return;let o=X.current.getBoundingClientRect(),a=e.clientY-o.top,r=u();if(!r)return;let l=r.clientHeight,y=r.scrollHeight,p=a/l*(y-l);r.scrollTop=Math.max(0,Math.min(y-l,p)),s(),x(!0),d(n.delay),w()},[s,d,n.delay,u,w]),st=m(e=>{if(e.preventDefault(),e.stopPropagation(),!i.current)return;let t=Math.max(0,i.current.scrollTop-ae);i.current.scrollTop=t,s(),x(!0),d(n.delay),w()},[s,d,ae,n.delay,w]),ut=m(e=>{if(e.preventDefault(),e.stopPropagation(),!i.current||!F.current)return;let t=i.current,a=F.current.scrollHeight-t.clientHeight,r=Math.min(a,t.scrollTop+ae);t.scrollTop=r,s(),x(!0),d(n.delay),w()},[s,d,ae,n.delay,w]),dt=m(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&($e(!0),Ve({x:e.clientX,scrollLeft:t.scrollLeft}),v(),x(!0),w())},[u,v,w]),we=m(e=>{if(!U)return;let t=u();if(!t)return;let o=t.clientWidth,r=t.scrollWidth-o,l=e.clientX-fe.x,y=o-be,g=l/y*r,p=Math.max(0,Math.min(r,fe.scrollLeft+g));t.scrollLeft=p,s()},[U,fe,be,s,u]),Me=m(()=>{$e(!1),W()&&d(n.delay)},[W,d,n.delay]),pt=m(e=>{if(!X.current)return;let o=X.current.getBoundingClientRect(),a=e.clientX-o.left,r=u();if(!r)return;let l=r.clientWidth,y=r.scrollWidth,p=a/l*(y-l);r.scrollLeft=Math.max(0,Math.min(y-l,p)),s(),x(!0),d(n.delay),w()},[s,d,n.delay,u,w]),mt=m(e=>{if(!ve.enabled)return;let t=e.target;if(He(t,ve)||e.button!==0)return;let o=u();o&&(o.scrollHeight<=o.clientHeight&&o.scrollWidth<=o.clientWidth||(e.preventDefault(),ze(!0),rt({x:e.clientX,y:e.clientY,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft||0}),v()))},[ve,He,u,v]),Se=m(e=>{if(!j)return;let t=u();if(!t)return;let o=V.x-e.clientX,a=V.y-e.clientY;if(Math.abs(a)<3&&Math.abs(o)<3)return;x(!0);let r=Math.max(0,Math.min(t.scrollHeight-t.clientHeight,V.scrollTop+a)),l=Math.max(0,Math.min(t.scrollWidth-t.clientWidth,V.scrollLeft+o));t.scrollTop=r,t.scrollLeft=l,s()},[j,V,u,s]),Ee=m(()=>{ze(!1),W()&&d(n.delay)},[W,d,n.delay]);E(()=>{let e=l=>{if(s(),Y){I&&I(l);return}v(),x(!0),_e();let y=Ne?n.delayOnWheel:n.delay;d(y),I&&I(l)},t=()=>{Pe(!0),Q.current&&clearTimeout(Q.current),Q.current=setTimeout(()=>{Pe(!1)},300),_e(),B.current=setTimeout(()=>{x(!0),B.current=null,d(n.delayOnWheel)},50)},o=[],a=u();a&&o.push(a);let r=i.current;return r&&!a&&(o.push(r),r.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(y=>{let g=y;if(g!==r&&g.classList.contains("overlay-scrollbar-container"))return;let p=g.parentElement;for(;p&&p!==r;){if(p.classList.contains("overlay-scrollbar-container")&&p!==r)return;p=p.parentElement}o.push(g)})),o.forEach(l=>{l.addEventListener("scroll",e,{passive:!0}),l.addEventListener("wheel",t,{passive:!0})}),()=>{o.forEach(l=>{l.removeEventListener("scroll",e),l.removeEventListener("wheel",t)}),Q.current&&clearTimeout(Q.current),B.current&&clearTimeout(B.current)}},[u,s,I,v,d,n,Ne,Y]),E(()=>{let e=o=>{let a=u();if(!a)return;let{key:r}=o,{scrollTop:l,scrollHeight:y,clientHeight:g}=a,p=y-g,te=50,M=null;switch(r){case"ArrowUp":o.preventDefault(),M=Math.max(0,l-te);break;case"ArrowDown":o.preventDefault(),M=Math.min(p,l+te);break;case"PageUp":o.preventDefault(),M=Math.max(0,l-g);break;case"PageDown":o.preventDefault(),M=Math.min(p,l+g);break;case"Home":o.preventDefault(),M=0;break;case"End":o.preventDefault(),M=p;break;default:return}if(M!==null){let ce=M/p,se=R?b*2+c.margin*4:c.margin*2,oe=(g-se-Z)*ce;Ie(oe),a.scrollTop=M,v(),x(!0),d(n.delay)}},t=i.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[u,R,b,c.margin,Z,v,d,n.delay]),E(()=>{if(j)return document.addEventListener("mousemove",Se),document.addEventListener("mouseup",Ee),()=>{document.removeEventListener("mousemove",Se),document.removeEventListener("mouseup",Ee)}},[j,Se,Ee]),E(()=>{if(_)return document.addEventListener("mousemove",xe),document.addEventListener("mouseup",Te),()=>{document.removeEventListener("mousemove",xe),document.removeEventListener("mouseup",Te)}},[_,xe,Te]),E(()=>{if(U)return document.addEventListener("mousemove",we),document.addEventListener("mouseup",Me),()=>{document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",Me)}},[U,we,Me]),E(()=>{s();let e=setTimeout(()=>{s()},100);return()=>clearTimeout(e)},[s]),yt(()=>{nt(!0),s(),!n.enabled&&!Y&&W()&&x(!0)},[W,s,n.enabled,Y]),E(()=>{if(n.initialDelay>0){let e=setTimeout(()=>{lt(!1)},n.initialDelay);return()=>clearTimeout(e)}},[n.initialDelay]),E(()=>{let e=new ResizeObserver(()=>{s()}),t=[];return i.current&&t.push(i.current),F.current&&t.push(F.current),L.current&&document.contains(L.current)&&t.push(L.current),t.forEach(o=>{e.observe(o)}),()=>e.disconnect()},[s]),E(()=>{if(!i.current)return;let e=new MutationObserver(()=>{L.current=null,s()});return e.observe(i.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[s]);let G=Math.max(it,b);return E(()=>{let e="overlay-scrollbar-webkit-hide",t=document.getElementById(e);t&&t.remove();let o=document.createElement("style");return o.id=e,o.textContent=`
1
+ import{useRef as S,useEffect as E,useState as h,useCallback as m,useMemo as ne,forwardRef as gt,useImperativeHandle as vt,useLayoutEffect as yt}from"react";var ft=["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"],He=(H,N)=>{let P=H.tagName.toLowerCase(),D=["text","password","email","number","search","tel","url","checkbox","radio"];if(P==="input"){let k=H.type;return D.includes(k)}if(["textarea","select","button"].includes(P)||["svg","path","circle","rect","line","polygon","polyline"].includes(P)||H.getAttribute("contenteditable")==="true")return!0;if(N?.excludeSelectors){for(let k of N.excludeSelectors)if(H.matches(k))return!0}return bt(H,N)},bt=(H,N)=>{let P=[...ft,...N?.excludeClasses||[]],D=H,k=0,A=5;for(;D&&k<=A;){if(P.some(T=>D.classList.contains(T)))return!0;if(D.classList.contains("MuiDialogContent-root"))break;D=D.parentElement,k++}return!1};import{jsx as z,jsxs as De}from"react/jsx-runtime";var xt={},Tt={},Mt={},wt={},St={},Et=gt(({className:H="",style:N={},containerStyle:P={},contentStyle:D={},children:k,onScroll:A,thumb:T=xt,track:O=Tt,arrows:W=Mt,dragScroll:K=wt,autoHide:F=St,showScrollbar:Z=!0,detectInnerScroll:Ye=!1},Ge)=>{let Je=S({});E(()=>{Je.current={children:k,onScroll:A,showScrollbar:Z,thumb:T,track:O,arrows:W,dragScroll:K,autoHide:F}});let me=S(null),a=S(null),_=S(null),Y=S(null),Ke=S(null),L=S(null),[le,x]=h(!1),[U,ke]=h(!1),[Le,Re]=h(!1),[he,Ze]=h({y:0,scrollTop:0}),[j,je]=h(0),[Ve,Ie]=h(0),[G,Ae]=h(!1),[Oe,We]=h(!1),[q,$e]=h(!1),[fe,Qe]=h({x:0,scrollLeft:0}),[be,et]=h(0),[ze,tt]=h(0),[ot,ge]=h(!1),[V,Ne]=h(!1),[Q,rt]=h({x:0,y:0,scrollTop:0,scrollLeft:0}),[Ct,Ht]=h(null),[ie,ae]=h(null),[Dt,nt]=h(!1),ee=S(null),[Pe,Fe]=h(!1),te=S(null),B=S(null),X=S(null),f=ne(()=>{let e=T.color??"#606060";return{width:T.width??8,minHeight:T.minHeight??50,radius:T.radius??(T.width??8)/2,color:e,opacity:T.opacity??.6,hoverColor:T.hoverColor??e,hoverOpacity:T.hoverOpacity??1}},[T]),n=ne(()=>({width:O.width??16,color:O.color??"rgba(128, 128, 128, 0.1)",visible:O.visible??!0,alignment:O.alignment??"center",radius:O.radius??f.radius??4,margin:O.margin??4}),[O,f.radius]),C=ne(()=>{let e=W.color??"#808080";return{visible:W.visible??!1,step:W.step??50,color:e,opacity:W.opacity??.6,hoverColor:W.hoverColor??e,hoverOpacity:W.hoverOpacity??1}},[W]),ve=ne(()=>({enabled:K.enabled??!0,excludeClasses:K.excludeClasses??[],excludeSelectors:K.excludeSelectors??[]}),[K]),l=ne(()=>({enabled:F.enabled??!0,delay:F.delay??1500,delayOnWheel:F.delayOnWheel??700,initialDelay:F.initialDelay??200}),[F]),[J,lt]=h(()=>(F.initialDelay??200)>0),b=f.width,it=n.width,ye=f.minHeight,R=C.visible,ce=C.step,M=m(()=>{if(!a.current)return;let e=document.activeElement;e&&a.current.contains(e)&&e!==a.current||a.current.focus()},[]);vt(Ge,()=>({getScrollContainer:()=>a.current,scrollTo:e=>{a.current&&a.current.scrollTo(e)},get scrollTop(){return a.current?.scrollTop||0},get scrollHeight(){return a.current?.scrollHeight||0},get clientHeight(){return a.current?.clientHeight||0}}),[]);let u=m(()=>{if(L.current){let t=L.current;if(document.contains(t)&&t.scrollHeight>t.clientHeight+2)return t;L.current=null}if(!a.current)return null;if(_.current&&_.current.scrollHeight>a.current.clientHeight+2)return L.current=a.current,a.current;if(!Ye)return null;let e=a.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let t of e){let o=t;if(o!==a.current&&o.classList.contains("overlay-scrollbar-container"))continue;let c=o.parentElement,r=!1;for(;c&&c!==a.current;){if(c.classList.contains("overlay-scrollbar-container")&&c!==a.current){r=!0;break}c=c.parentElement}if(!r&&o.scrollHeight>o.clientHeight+2)return L.current=o,o}return null},[]),$=m(()=>u()!==null,[u]),v=m(()=>{te.current&&(clearTimeout(te.current),te.current=null)},[]),_e=m(()=>{B.current&&(clearTimeout(B.current),B.current=null)},[]),Ue=m(()=>{X.current&&(clearTimeout(X.current),X.current=null)},[]),d=m(e=>{l.enabled&&(v(),te.current=setTimeout(()=>{x(!1),te.current=null},e))},[v,l.enabled]),s=m(()=>{let e=u();if(!e){x(!1),Ae(!1),ge(!1),v();return}if(Ae(!0),!Y.current)return;!l.enabled&&!J&&(x(!0),v());let t=e.clientHeight,o=e.scrollHeight,c=e.scrollTop,r=e.clientWidth,i=e.scrollWidth,y=e.scrollLeft,g=0;if(me.current){let de=window.getComputedStyle(me.current),pe=parseFloat(de.paddingTop)||0,Ce=parseFloat(de.paddingBottom)||0;g=pe+Ce}let p=R?b*2+n.margin*4:n.margin*2,oe=t-p+g,w=t/o,se=Math.max(oe*w,ye),ue=o-t,qe=oe-se,Be=ue>0?c/ue*qe:0;je(se),Ie(Be);let re=i-r;if(re>0){ge(!0);let de=r/i,pe=Math.max(r*de,50),Ce=r-pe,ht=re>0?y/re*Ce:0;et(pe),tt(ht)}else ge(!1)},[u,v,R,b,ye,l.enabled,J]),at=m(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&(ke(!0),Ze({y:e.clientY,scrollTop:t.scrollTop}),v(),x(!0),M())},[u,v,M]),xe=m(e=>{if(!U)return;let t=u();if(!t)return;let o=t.clientHeight,r=t.scrollHeight-o,i=e.clientY-he.y,y=o-j,g=i/y*r,p=Math.max(0,Math.min(r,he.scrollTop+g));t.scrollTop=p,s()},[U,he,j,s,u]),Te=m(()=>{ke(!1),$()&&d(l.delay)},[$,d,l.delay]),ct=m(e=>{if(!Y.current)return;let o=Y.current.getBoundingClientRect(),c=e.clientY-o.top,r=u();if(!r)return;let i=r.clientHeight,y=r.scrollHeight,p=c/i*(y-i);r.scrollTop=Math.max(0,Math.min(y-i,p)),s(),x(!0),d(l.delay),M()},[s,d,l.delay,u,M]),st=m(e=>{if(e.preventDefault(),e.stopPropagation(),!a.current)return;let t=Math.max(0,a.current.scrollTop-ce);a.current.scrollTop=t,s(),x(!0),d(l.delay),M()},[s,d,ce,l.delay,M]),ut=m(e=>{if(e.preventDefault(),e.stopPropagation(),!a.current||!_.current)return;let t=a.current,c=_.current.scrollHeight-t.clientHeight,r=Math.min(c,t.scrollTop+ce);t.scrollTop=r,s(),x(!0),d(l.delay),M()},[s,d,ce,l.delay,M]),dt=m(e=>{e.preventDefault(),e.stopPropagation();let t=u();t&&($e(!0),Qe({x:e.clientX,scrollLeft:t.scrollLeft}),v(),x(!0),M())},[u,v,M]),Me=m(e=>{if(!q)return;let t=u();if(!t)return;let o=t.clientWidth,r=t.scrollWidth-o,i=e.clientX-fe.x,y=o-be,g=i/y*r,p=Math.max(0,Math.min(r,fe.scrollLeft+g));t.scrollLeft=p,s()},[q,fe,be,s,u]),we=m(()=>{$e(!1),$()&&d(l.delay)},[$,d,l.delay]),pt=m(e=>{if(!Y.current)return;let o=Y.current.getBoundingClientRect(),c=e.clientX-o.left,r=u();if(!r)return;let i=r.clientWidth,y=r.scrollWidth,p=c/i*(y-i);r.scrollLeft=Math.max(0,Math.min(y-i,p)),s(),x(!0),d(l.delay),M()},[s,d,l.delay,u,M]),mt=m(e=>{if(!ve.enabled)return;let t=e.target;if(He(t,ve)||e.button!==0)return;let o=u();o&&(o.scrollHeight<=o.clientHeight&&o.scrollWidth<=o.clientWidth||(e.preventDefault(),Ne(!0),rt({x:e.clientX,y:e.clientY,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft||0}),v()))},[ve,He,u,v]),Se=m(e=>{if(!V)return;let t=u();if(!t)return;let o=Q.x-e.clientX,c=Q.y-e.clientY;if(Math.abs(c)<3&&Math.abs(o)<3)return;x(!0);let r=Math.max(0,Math.min(t.scrollHeight-t.clientHeight,Q.scrollTop+c)),i=Math.max(0,Math.min(t.scrollWidth-t.clientWidth,Q.scrollLeft+o));t.scrollTop=r,t.scrollLeft=i,s()},[V,Q,u,s]),Ee=m(()=>{Ne(!1),$()&&d(l.delay)},[$,d,l.delay]);E(()=>{let e=i=>{if(s(),J){A&&A(i);return}v(),x(!0),Ue();let y=Pe?l.delayOnWheel:l.delay;d(y),A&&A(i)},t=()=>{Fe(!0),ee.current&&clearTimeout(ee.current),ee.current=setTimeout(()=>{Fe(!1)},300),Ue(),X.current=setTimeout(()=>{x(!0),X.current=null,d(l.delayOnWheel)},50)},o=[],c=u();c&&o.push(c);let r=a.current;return r&&!c&&(o.push(r),r.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(y=>{let g=y;if(g!==r&&g.classList.contains("overlay-scrollbar-container"))return;let p=g.parentElement;for(;p&&p!==r;){if(p.classList.contains("overlay-scrollbar-container")&&p!==r)return;p=p.parentElement}o.push(g)})),o.forEach(i=>{i.addEventListener("scroll",e,{passive:!0}),i.addEventListener("wheel",t,{passive:!0})}),()=>{o.forEach(i=>{i.removeEventListener("scroll",e),i.removeEventListener("wheel",t)}),ee.current&&clearTimeout(ee.current),X.current&&clearTimeout(X.current)}},[u,s,A,v,d,l,Pe,J]),E(()=>{let e=o=>{let c=u();if(!c)return;let{key:r}=o,{scrollTop:i,scrollHeight:y,clientHeight:g}=c,p=y-g,oe=50,w=null;switch(r){case"ArrowUp":o.preventDefault(),w=Math.max(0,i-oe);break;case"ArrowDown":o.preventDefault(),w=Math.min(p,i+oe);break;case"PageUp":o.preventDefault(),w=Math.max(0,i-g);break;case"PageDown":o.preventDefault(),w=Math.min(p,i+g);break;case"Home":o.preventDefault(),w=0;break;case"End":o.preventDefault(),w=p;break;default:return}if(w!==null){let se=w/p,ue=R?b*2+n.margin*4:n.margin*2,re=(g-ue-j)*se;Ie(re),c.scrollTop=w,v(),x(!0),d(l.delay)}},t=a.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[u,R,b,n.margin,j,v,d,l.delay]),E(()=>{if(V)return document.addEventListener("mousemove",Se),document.addEventListener("mouseup",Ee),()=>{document.removeEventListener("mousemove",Se),document.removeEventListener("mouseup",Ee)}},[V,Se,Ee]),E(()=>{if(U)return document.addEventListener("mousemove",xe),document.addEventListener("mouseup",Te),()=>{document.removeEventListener("mousemove",xe),document.removeEventListener("mouseup",Te)}},[U,xe,Te]),E(()=>{if(q)return document.addEventListener("mousemove",Me),document.addEventListener("mouseup",we),()=>{document.removeEventListener("mousemove",Me),document.removeEventListener("mouseup",we)}},[q,Me,we]),E(()=>{s();let e=setTimeout(()=>{s()},100);return()=>clearTimeout(e)},[s]),yt(()=>{nt(!0),s(),!l.enabled&&!J&&$()&&x(!0)},[$,s,l.enabled,J]),E(()=>{if(l.initialDelay>0){let e=setTimeout(()=>{lt(!1)},l.initialDelay);return()=>clearTimeout(e)}},[l.initialDelay]),E(()=>{let e=new ResizeObserver(()=>{s()}),t=[];return a.current&&t.push(a.current),_.current&&t.push(_.current),L.current&&document.contains(L.current)&&t.push(L.current),t.forEach(o=>{e.observe(o)}),()=>e.disconnect()},[s]),E(()=>{if(!a.current)return;let e=new MutationObserver(()=>{L.current=null,s()});return e.observe(a.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[s]);let I=Math.max(it,b);return E(()=>{let e="overlay-scrollbar-webkit-hide",t=document.getElementById(e);t&&t.remove();let o=document.createElement("style");return o.id=e,o.textContent=`
2
2
  .overlay-scrollbar-container::-webkit-scrollbar {
3
3
  display: none !important;
4
4
  width: 0 !important;
@@ -40,5 +40,5 @@ import{useRef as S,useEffect as E,useState as h,useCallback as m,useMemo as re,f
40
40
  outline: 2px solid rgba(0, 123, 255, 0.5);
41
41
  outline-offset: -2px;
42
42
  }
43
- `,document.head.appendChild(o),()=>{let a=document.getElementById(e);a&&a.remove()}},[]),De("div",{ref:pe,className:`overlay-scrollbar-wrapper ${H}`,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",...z},children:[$("div",{ref:i,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:mt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:j?"none":"auto",...N},children:$("div",{ref:F,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...D},children:k})}),K&&he&&De("div",{ref:X,className:"overlay-scrollbar-track",onMouseEnter:()=>{v(),q.current=setTimeout(()=>{x(!0),q.current=null},100)},onMouseLeave:()=>{Fe(),_||d(n.delay)},style:{position:"absolute",top:0,right:0,width:`${G}px`,height:"100%",opacity:ne?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[c.visible&&$("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),ct(e)},style:{position:"absolute",top:R?`${f.width+c.margin*2}px`:`${c.margin}px`,right:c.alignment==="outside"?"0px":`${(G-f.width)/2}px`,width:`${f.width}px`,height:R?`calc(100% - ${f.width*2+c.margin*4}px)`:`calc(100% - ${c.margin*2}px)`,backgroundColor:c.color,borderRadius:`${c.radius}px`,cursor:"pointer"}}),$("div",{ref:Je,className:"overlay-scrollbar-thumb",onMouseDown:at,onMouseEnter:()=>Re(!0),onMouseLeave:()=>Re(!1),style:{position:"absolute",top:`${(R?b+c.margin*2:c.margin)+je}px`,right:c.alignment==="outside"?"0px":`${(G-b)/2}px`,width:`${b}px`,height:`${Math.max(Z,ye)}px`,backgroundColor:Le||_?f.hoverColor:f.color,opacity:Le||_?f.hoverOpacity:f.opacity,borderRadius:`${f.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),K&&he&&R&&$("div",{className:"overlay-scrollbar-up-arrow",onClick:st,onMouseEnter:()=>ie("up"),onMouseLeave:()=>ie(null),style:{position:"absolute",top:`${c.margin}px`,right:c.alignment==="outside"?"0px":`${(G-b)/2}px`,width:`${b}px`,height:`${b}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(b*.75,8)}px`,color:le==="up"?C.hoverColor:C.color,userSelect:"none",zIndex:1001,opacity:ne?le==="up"?C.hoverOpacity:C.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),K&&he&&R&&$("div",{className:"overlay-scrollbar-down-arrow",onClick:ut,onMouseEnter:()=>ie("down"),onMouseLeave:()=>ie(null),style:{position:"absolute",bottom:`${c.margin}px`,right:c.alignment==="outside"?"0px":`${(G-b)/2}px`,width:`${b}px`,height:`${b}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(b*.75,8)}px`,color:le==="down"?C.hoverColor:C.color,userSelect:"none",zIndex:1001,opacity:ne?le==="down"?C.hoverOpacity:C.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),K&&ot&&De("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{v(),q.current=setTimeout(()=>{x(!0),q.current=null},100)},onMouseLeave:()=>{Fe(),U||d(n.delay)},style:{position:"absolute",bottom:0,left:0,width:"100%",height:`${G}px`,opacity:ne?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[c.visible&&$("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),pt(e)},style:{position:"absolute",bottom:`${c.margin}px`,left:`${c.margin}px`,width:`calc(100% - ${c.margin*2}px)`,height:`${b}px`,backgroundColor:c.color,borderRadius:`${c.radius}px`,cursor:"pointer"}}),$("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:dt,onMouseEnter:()=>We(!0),onMouseLeave:()=>We(!1),style:{position:"absolute",bottom:`${c.margin}px`,left:`${c.margin+et}px`,width:`${Math.max(be,50)}px`,height:`${b}px`,backgroundColor:Oe||U?f.hoverColor:f.color,opacity:Oe||U?f.hoverOpacity:f.opacity,borderRadius:`${f.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),Be=Et;export{Be as OverlayScrollbar,Be as default};
43
+ `,document.head.appendChild(o),()=>{let c=document.getElementById(e);c&&c.remove()}},[]),De("div",{ref:me,className:`overlay-scrollbar-wrapper ${H}`,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",...N},children:[z("div",{ref:a,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:mt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:V?"none":"auto",...P},children:z("div",{ref:_,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...D},children:k})}),Z&&G&&De("div",{ref:Y,className:"overlay-scrollbar-track",onMouseEnter:()=>{v(),B.current=setTimeout(()=>{x(!0),B.current=null},100)},onMouseLeave:()=>{_e(),U||d(l.delay)},style:{position:"absolute",top:0,right:0,width:`${I}px`,height:"100%",opacity:le?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&z("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),ct(e)},style:{position:"absolute",top:R?`${f.width+n.margin*2}px`:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(I-f.width)/2}px`,width:`${f.width}px`,height:R?`calc(100% - ${f.width*2+n.margin*4}px)`:`calc(100% - ${n.margin*2}px)`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),z("div",{ref:Ke,className:"overlay-scrollbar-thumb",onMouseDown:at,onMouseEnter:()=>Re(!0),onMouseLeave:()=>Re(!1),style:{position:"absolute",top:`${(R?b+n.margin*2:n.margin)+Ve}px`,right:n.alignment==="outside"?"0px":`${(I-b)/2}px`,width:`${b}px`,height:`${Math.max(j,ye)}px`,backgroundColor:Le||U?f.hoverColor:f.color,opacity:Le||U?f.hoverOpacity:f.opacity,borderRadius:`${f.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),Z&&G&&R&&z("div",{className:"overlay-scrollbar-up-arrow",onClick:st,onMouseEnter:()=>ae("up"),onMouseLeave:()=>ae(null),style:{position:"absolute",top:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(I-b)/2}px`,width:`${b}px`,height:`${b}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(b*.75,8)}px`,color:ie==="up"?C.hoverColor:C.color,userSelect:"none",zIndex:1001,opacity:le?ie==="up"?C.hoverOpacity:C.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),Z&&G&&R&&z("div",{className:"overlay-scrollbar-down-arrow",onClick:ut,onMouseEnter:()=>ae("down"),onMouseLeave:()=>ae(null),style:{position:"absolute",bottom:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(I-b)/2}px`,width:`${b}px`,height:`${b}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(b*.75,8)}px`,color:ie==="down"?C.hoverColor:C.color,userSelect:"none",zIndex:1001,opacity:le?ie==="down"?C.hoverOpacity:C.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),Z&&ot&&De("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{v(),B.current=setTimeout(()=>{x(!0),B.current=null},100)},onMouseLeave:()=>{_e(),q||d(l.delay)},style:{position:"absolute",bottom:0,left:0,width:"100%",height:`${I}px`,opacity:le?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&z("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),pt(e)},style:{position:"absolute",bottom:0,left:`${n.margin}px`,right:n.alignment==="outside"&&G?`${I-n.margin}px`:`${n.margin}px`,height:`${b}px`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),z("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:dt,onMouseEnter:()=>We(!0),onMouseLeave:()=>We(!1),style:{position:"absolute",bottom:0,left:`${n.margin+ze}px`,right:n.alignment==="outside"&&G?`${I-n.margin}px`:"auto",maxWidth:n.alignment==="outside"&&G?`calc(100% - ${n.margin+ze+I-n.margin}px)`:"none",width:`${Math.max(be,50)}px`,height:`${b}px`,backgroundColor:Oe||q?f.hoverColor:f.color,opacity:Oe||q?f.hoverOpacity:f.opacity,borderRadius:`${f.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),Xe=Et;export{Xe as OverlayScrollbar,Xe as default};
44
44
  //# sourceMappingURL=index.esm.js.map