@ehfuse/overlay-scrollbar 1.7.25 → 1.7.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -38,5 +38,5 @@
38
38
  height: 0 !important;
39
39
  }
40
40
  ${a}::-webkit-scrollbar-track { display: none !important; }
41
- ${a}::-webkit-scrollbar-thumb { display: none !important; }`,document.head.appendChild(n),()=>{document.getElementById(e)?.remove()}},[Q]);let{normalizedContainerStyle:jt,normalizedContentStyle:Gt,bottomSpacerHeight:vt}=(0,t.useMemo)(()=>{let e=Qe(d),o=Qe(u);return{normalizedContainerStyle:e.style,normalizedContentStyle:o.style,bottomSpacerHeight:e.spacerHeight+o.spacerHeight}},[d,u]);return(0,y.jsxs)("div",{ref:We,className:`overlay-scrollbar-wrapper ${r}`,onMouseLeave:Bt,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...l},children:[Lt&&(0,y.jsx)("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${ze-68}px)`,transition:Ce?"transform 0.15s ease-out":ze===0?"transform 0.2s ease-out":"none",width:60,height:60,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:Ce?1:Math.min(Ae*1.5,1)},children:Ce?(0,y.jsx)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:ot,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):(0,y.jsx)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",style:{transform:`rotate(${Ae*270}deg)`,opacity:Ae>=1?1:.6},children:(0,y.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:ot})})}),(0,y.jsx)("div",{ref:c,className:`overlay-scrollbar-container ${Q}`,tabIndex:-1,onMouseDown:Yt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",outline:"none",userSelect:j?"none":"auto",...jt},children:(0,y.jsxs)("div",{ref:pe,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...Gt},children:[v,vt>0&&(0,y.jsx)("div",{className:"overlay-scrollbar-bottom-spacer","aria-hidden":"true",style:{flex:"0 0 auto",height:vt}})]})}),ne&&ie&&(i.overflowY??!0)&&(0,y.jsxs)("div",{ref:he,className:"overlay-scrollbar-track",onMouseEnter:()=>{T(),ee.current=setTimeout(()=>{E(!0),ee.current=null},100)},onMouseLeave:()=>{De(),F||x(f.delay)},style:{position:"absolute",top:0,right:0,width:`${P}px`,height:"100%",opacity:Ee?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[i.visible&&(0,y.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Nt(e)},style:{position:"absolute",top:_?`${M.width+i.margin*2}px`:`${i.margin}px`,right:i.alignment==="outside"?"0px":`${(P-M.width)/2}px`,width:`${M.width}px`,height:_?`calc(100% - ${M.width*2+i.margin*4}px)`:`calc(100% - ${i.margin*2}px)`,backgroundColor:i.color,borderRadius:`${i.radius}px`,cursor:"pointer"}}),(0,y.jsx)("div",{ref:Ht,className:"overlay-scrollbar-thumb",onMouseDown:Ft,onMouseEnter:()=>lt(!0),onMouseLeave:()=>lt(!1),style:{position:"absolute",top:`${(_?w+i.margin*2:i.margin)+Rt}px`,right:i.alignment==="outside"?"0px":`${(P-w)/2}px`,width:`${w}px`,height:`${Math.max(me,Xe)}px`,backgroundColor:nt||F?M.hoverColor:M.color,opacity:nt||F?M.hoverOpacity:M.opacity,borderRadius:`${M.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),ne&&ie&&_&&(0,y.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:_t,onMouseEnter:()=>He("up"),onMouseLeave:()=>He(null),style:{position:"absolute",top:`${i.margin}px`,right:i.alignment==="outside"?"0px":`${(P-w)/2}px`,width:`${w}px`,height:`${w}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(w*.75,8)}px`,color:Me==="up"?A.hoverColor:A.color,userSelect:"none",zIndex:1001,opacity:Ee?Me==="up"?A.hoverOpacity:A.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),ne&&ie&&_&&(0,y.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:Ut,onMouseEnter:()=>He("down"),onMouseLeave:()=>He(null),style:{position:"absolute",bottom:`${i.margin}px`,right:i.alignment==="outside"?"0px":`${(P-w)/2}px`,width:`${w}px`,height:`${w}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(w*.75,8)}px`,color:Me==="down"?A.hoverColor:A.color,userSelect:"none",zIndex:1001,opacity:Ee?Me==="down"?A.hoverOpacity:A.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),ne&&Te&&Pt&&(i.overflowX??!0)&&(0,y.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{T(),ee.current=setTimeout(()=>{E(!0),ee.current=null},100)},onMouseLeave:()=>{De(),N||x(f.delay)},style:{position:"absolute",bottom:`${Ot}px`,left:0,width:"100%",height:`${P}px`,opacity:Ee?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[i.visible&&(0,y.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),qt(e)},style:{position:"absolute",bottom:i.alignment==="outside"?"0px":`${(P-w)/2}px`,left:`${i.margin}px`,right:ie?i.alignment==="outside"?`${P-i.margin}px`:`${P}px`:`${i.margin}px`,height:`${w}px`,backgroundColor:i.color,borderRadius:`${i.radius}px`,cursor:"pointer"}}),(0,y.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:Xt,onMouseEnter:()=>ct(!0),onMouseLeave:()=>ct(!1),style:{position:"absolute",bottom:i.alignment==="outside"?"0px":`${(P-w)/2}px`,left:`${i.margin+Ue}px`,right:ie?i.alignment==="outside"?`${P-i.margin}px`:`${P}px`:"auto",maxWidth:ie?i.alignment==="outside"?`calc(100% - ${i.margin+Ue+P-i.margin}px)`:`calc(100% - ${i.margin+Ue+P}px)`:"none",width:`${Math.max(_e,50)}px`,height:`${w}px`,backgroundColor:st||N?M.hoverColor:M.color,opacity:st||N?M.hoverOpacity:M.opacity,borderRadius:`${M.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),Y&&(0,y.jsx)("button",{type:"button","aria-label":"\uB9E8 \uC704\uB85C",onClick:()=>{fe(!1),c.current?.scrollTo({top:0,behavior:"smooth"})},onPointerDown:()=>fe(!0),onPointerUp:()=>fe(!1),onPointerLeave:()=>fe(!1),onPointerCancel:()=>fe(!1),style:{position:"absolute",[Tt]:et,bottom:et,zIndex:1200,width:Se,height:Se,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:"none",borderRadius:"50%",backgroundColor:St,color:Ct,boxShadow:"0 3px 8px rgba(15, 23, 42, 0.28)",cursor:"pointer",opacity:Oe?Et?1:$e:0,pointerEvents:Oe?"auto":"none",transition:Oe?"opacity 0.15s ease":"opacity 0.45s ease"},children:(0,y.jsx)("svg",{width:Math.round(Se*.5),height:Math.round(Se*.5),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,y.jsx)("polyline",{points:"18 15 12 9 6 15"})})})]})}),Je=mo;
41
+ ${a}::-webkit-scrollbar-thumb { display: none !important; }`,document.head.appendChild(n),()=>{document.getElementById(e)?.remove()}},[Q]);let{normalizedContainerStyle:jt,normalizedContentStyle:Gt,bottomSpacerHeight:vt}=(0,t.useMemo)(()=>{let e=Qe(d),o=Qe(u);return{normalizedContainerStyle:e.style,normalizedContentStyle:o.style,bottomSpacerHeight:e.spacerHeight+o.spacerHeight}},[d,u]);return(0,y.jsxs)("div",{ref:We,className:`overlay-scrollbar-wrapper ${r}`,onMouseLeave:Bt,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...l},children:[Lt&&(0,y.jsx)("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${ze-68}px)`,transition:Ce?"transform 0.15s ease-out":ze===0?"transform 0.2s ease-out":"none",width:60,height:60,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:Ce?1:Math.min(Ae*1.5,1)},children:Ce?(0,y.jsx)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:ot,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):(0,y.jsx)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",style:{transform:`rotate(${Ae*270}deg)`,opacity:Ae>=1?1:.6},children:(0,y.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:ot})})}),(0,y.jsx)("div",{ref:c,className:`overlay-scrollbar-container ${Q}`,tabIndex:-1,onMouseDown:Yt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",outline:"none",userSelect:j?"none":"auto",...jt},children:(0,y.jsxs)("div",{ref:pe,className:"overlay-scrollbar-content",style:{flex:"1 1 auto",display:"flex",flexDirection:"column",boxSizing:"border-box",...Gt},children:[v,vt>0&&(0,y.jsx)("div",{className:"overlay-scrollbar-bottom-spacer","aria-hidden":"true",style:{flex:"0 0 auto",height:vt}})]})}),ne&&ie&&(i.overflowY??!0)&&(0,y.jsxs)("div",{ref:he,className:"overlay-scrollbar-track",onMouseEnter:()=>{T(),ee.current=setTimeout(()=>{E(!0),ee.current=null},100)},onMouseLeave:()=>{De(),F||x(f.delay)},style:{position:"absolute",top:0,right:0,width:`${P}px`,height:"100%",opacity:Ee?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[i.visible&&(0,y.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Nt(e)},style:{position:"absolute",top:_?`${M.width+i.margin*2}px`:`${i.margin}px`,right:i.alignment==="outside"?"0px":`${(P-M.width)/2}px`,width:`${M.width}px`,height:_?`calc(100% - ${M.width*2+i.margin*4}px)`:`calc(100% - ${i.margin*2}px)`,backgroundColor:i.color,borderRadius:`${i.radius}px`,cursor:"pointer"}}),(0,y.jsx)("div",{ref:Ht,className:"overlay-scrollbar-thumb",onMouseDown:Ft,onMouseEnter:()=>lt(!0),onMouseLeave:()=>lt(!1),style:{position:"absolute",top:`${(_?w+i.margin*2:i.margin)+Rt}px`,right:i.alignment==="outside"?"0px":`${(P-w)/2}px`,width:`${w}px`,height:`${Math.max(me,Xe)}px`,backgroundColor:nt||F?M.hoverColor:M.color,opacity:nt||F?M.hoverOpacity:M.opacity,borderRadius:`${M.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),ne&&ie&&_&&(0,y.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:_t,onMouseEnter:()=>He("up"),onMouseLeave:()=>He(null),style:{position:"absolute",top:`${i.margin}px`,right:i.alignment==="outside"?"0px":`${(P-w)/2}px`,width:`${w}px`,height:`${w}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(w*.75,8)}px`,color:Me==="up"?A.hoverColor:A.color,userSelect:"none",zIndex:1001,opacity:Ee?Me==="up"?A.hoverOpacity:A.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),ne&&ie&&_&&(0,y.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:Ut,onMouseEnter:()=>He("down"),onMouseLeave:()=>He(null),style:{position:"absolute",bottom:`${i.margin}px`,right:i.alignment==="outside"?"0px":`${(P-w)/2}px`,width:`${w}px`,height:`${w}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(w*.75,8)}px`,color:Me==="down"?A.hoverColor:A.color,userSelect:"none",zIndex:1001,opacity:Ee?Me==="down"?A.hoverOpacity:A.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),ne&&Te&&Pt&&(i.overflowX??!0)&&(0,y.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{T(),ee.current=setTimeout(()=>{E(!0),ee.current=null},100)},onMouseLeave:()=>{De(),N||x(f.delay)},style:{position:"absolute",bottom:`${Ot}px`,left:0,width:"100%",height:`${P}px`,opacity:Ee?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[i.visible&&(0,y.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),qt(e)},style:{position:"absolute",bottom:i.alignment==="outside"?"0px":`${(P-w)/2}px`,left:`${i.margin}px`,right:ie?i.alignment==="outside"?`${P-i.margin}px`:`${P}px`:`${i.margin}px`,height:`${w}px`,backgroundColor:i.color,borderRadius:`${i.radius}px`,cursor:"pointer"}}),(0,y.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:Xt,onMouseEnter:()=>ct(!0),onMouseLeave:()=>ct(!1),style:{position:"absolute",bottom:i.alignment==="outside"?"0px":`${(P-w)/2}px`,left:`${i.margin+Ue}px`,right:ie?i.alignment==="outside"?`${P-i.margin}px`:`${P}px`:"auto",maxWidth:ie?i.alignment==="outside"?`calc(100% - ${i.margin+Ue+P-i.margin}px)`:`calc(100% - ${i.margin+Ue+P}px)`:"none",width:`${Math.max(_e,50)}px`,height:`${w}px`,backgroundColor:st||N?M.hoverColor:M.color,opacity:st||N?M.hoverOpacity:M.opacity,borderRadius:`${M.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),Y&&(0,y.jsx)("button",{type:"button","aria-label":"\uB9E8 \uC704\uB85C",onClick:()=>{fe(!1),c.current?.scrollTo({top:0,behavior:"smooth"})},onPointerDown:()=>fe(!0),onPointerUp:()=>fe(!1),onPointerLeave:()=>fe(!1),onPointerCancel:()=>fe(!1),style:{position:"absolute",[Tt]:et,bottom:et,zIndex:1200,width:Se,height:Se,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:"none",borderRadius:"50%",backgroundColor:St,color:Ct,boxShadow:"0 3px 8px rgba(15, 23, 42, 0.28)",cursor:"pointer",opacity:Oe?Et?1:$e:0,pointerEvents:Oe?"auto":"none",transition:Oe?"opacity 0.15s ease":"opacity 0.45s ease"},children:(0,y.jsx)("svg",{width:Math.round(Se*.5),height:Math.round(Se*.5),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,y.jsx)("polyline",{points:"18 15 12 9 6 15"})})})]})}),Je=mo;
42
42
  //# sourceMappingURL=index.js.map