index.02edecb1.js 3.6 KB

123456
  1. <<<<<<<< HEAD:dist/assets/index.02edecb1.js
  2. import{aa as S,aT as P,ab as k,aL as I,t as R,z as T,u as $,w as p,d as z,R as B,an as N,r as O,y as u,az as C,N as D,aU as E,Z as H,a0 as L,c as x,at as U,am as h,ap as V,D as Z}from"./index.ffe80dbe.js";function _(o,l){if(!S||!window.IntersectionObserver)return;const r=new IntersectionObserver(e=>{l(e[0].intersectionRatio>0)},{root:document.body}),s=()=>{o.value&&r.observe(o.value)},f=()=>{o.value&&r.unobserve(o.value)};P(f),k(f),I(s)}const[j,A]=R("sticky"),F={zIndex:T,position:$("top"),container:Object,offsetTop:p(0),offsetBottom:p(0)};var M=z({name:j,props:F,emits:["scroll","change"],setup(o,{emit:l,slots:r}){const s=B(),f=N(s),e=O({fixed:!1,width:0,height:0,transform:0}),i=u(()=>C(o.position==="top"?o.offsetTop:o.offsetBottom)),b=u(()=>{const{fixed:t,height:d,width:n}=e;if(t)return{width:`${n}px`,height:`${d}px`}}),w=u(()=>{if(!e.fixed)return;const t=D(E(o.zIndex),{width:`${e.width}px`,height:`${e.height}px`,[o.position]:`${i.value}px`});return e.transform&&(t.transform=`translate3d(0, ${e.transform}px, 0)`),t}),g=t=>l("scroll",{scrollTop:t,isFixed:e.fixed}),v=()=>{if(!s.value||U(s))return;const{container:t,position:d}=o,n=h(s),y=V(window);if(e.width=n.width,e.height=n.height,d==="top")if(t){const a=h(t),c=a.bottom-i.value-e.height;e.fixed=i.value>n.top&&a.bottom>0,e.transform=c<0?c:0}else e.fixed=i.value>n.top;else{const{clientHeight:a}=document.documentElement;if(t){const c=h(t),m=a-c.top-i.value-e.height;e.fixed=a-i.value<n.bottom&&a>c.top,e.transform=m<0?-m:0}else e.fixed=a-i.value<n.bottom}g(y)};return H(()=>e.fixed,t=>l("change",t)),L("scroll",v,{target:f,passive:!0}),_(s,v),()=>{var t;return x("div",{ref:s,style:b.value},[x("div",{class:A({fixed:e.fixed}),style:w.value},[(t=r.default)==null?void 0:t.call(r)])])}}});const G=Z(M);export{G as S};
  3. ========
  4. import{aa as S,aZ as P,ab as k,aH as I,t as R,z as $,u as T,w as p,d as B,R as N,ap as O,r as z,y as u,aM as H,N as Z,ax as A,Z as C,a0 as D,c as x,aA as E,an as h,ar as M,D as V}from"./index.1c621181.js";function _(o,l){if(!S||!window.IntersectionObserver)return;const r=new IntersectionObserver(e=>{l(e[0].intersectionRatio>0)},{root:document.body}),s=()=>{o.value&&r.observe(o.value)},f=()=>{o.value&&r.unobserve(o.value)};P(f),k(f),I(s)}const[j,F]=R("sticky"),L={zIndex:$,position:T("top"),container:Object,offsetTop:p(0),offsetBottom:p(0)};var U=B({name:j,props:L,emits:["scroll","change"],setup(o,{emit:l,slots:r}){const s=N(),f=O(s),e=z({fixed:!1,width:0,height:0,transform:0}),i=u(()=>H(o.position==="top"?o.offsetTop:o.offsetBottom)),b=u(()=>{const{fixed:t,height:d,width:n}=e;if(t)return{width:`${n}px`,height:`${d}px`}}),w=u(()=>{if(!e.fixed)return;const t=Z(A(o.zIndex),{width:`${e.width}px`,height:`${e.height}px`,[o.position]:`${i.value}px`});return e.transform&&(t.transform=`translate3d(0, ${e.transform}px, 0)`),t}),g=t=>l("scroll",{scrollTop:t,isFixed:e.fixed}),v=()=>{if(!s.value||E(s))return;const{container:t,position:d}=o,n=h(s),y=M(window);if(e.width=n.width,e.height=n.height,d==="top")if(t){const a=h(t),c=a.bottom-i.value-e.height;e.fixed=i.value>n.top&&a.bottom>0,e.transform=c<0?c:0}else e.fixed=i.value>n.top;else{const{clientHeight:a}=document.documentElement;if(t){const c=h(t),m=a-c.top-i.value-e.height;e.fixed=a-i.value<n.bottom&&a>c.top,e.transform=m<0?-m:0}else e.fixed=a-i.value<n.bottom}g(y)};return C(()=>e.fixed,t=>l("change",t)),D("scroll",v,{target:f,passive:!0}),_(s,v),()=>{var t;return x("div",{ref:s,style:b.value},[x("div",{class:F({fixed:e.fixed}),style:w.value},[(t=r.default)==null?void 0:t.call(r)])])}}});const G=V(U);export{G as S};
  5. >>>>>>>> online:dist/assets/index.d5b73933.js