tg_h5_dist/assets/style-B5e8_1oV.js

1 line
17 KiB
JavaScript
Raw Normal View History

2025-07-10 16:17:30 +08:00
import{BORDER_TOP_BOTTOM as e,Badge as t,FORM_KEY as n,addUnit as r,callInterceptor as i,cancelRaf as a,clamp as o,createNamespace as s,doubleRaf as c,extend as l,getElementTop as u,getScrollTop as d,getZIndexStyle as f,inBrowser as p,isDef as m,isHidden as h,makeNumericProp as g,makeRequiredProp as _,makeStringProp as v,numericProp as y,onMountedOrActivated as b,onPopupReopen as ee,pick as x,preventDefault as te,raf as S,route as ne,routeProps as C,setRootScrollTop as w,setScrollTop as T,truthProp as E,unitToPx as D,unknownProp as O,useChildren as k,useEventListener as A,useExpose as j,useId as M,usePageVisibility as N,useParent as P,useRect as F,useScrollParent as I,useTouch as L,windowHeight as R,windowWidth as re,withInstall as z}from"./_plugin-vue_export-helper-BFIprANq.js";import{computed as B,createVNode as V,defineComponent as H,getCurrentInstance as U,mergeProps as W,nextTick as G,normalizeClass as K,normalizeStyle as q,onActivated as ie,onBeforeUnmount as ae,onBeforeUpdate as oe,onDeactivated as se,onMounted as J,provide as ce,reactive as Y,ref as X,stringifyStyle as le,vShow as ue,watch as Z,watchEffect as de,withDirectives as fe}from"./index-CSge6Fca.js";import{TAB_STATUS_KEY as pe}from"./use-tab-status-B4r5fRjv.js";function me(e,t,n){let r,i=0,o=e.scrollLeft,s=n===0?1:Math.round(n*1e3/16),c=o;function l(){a(r)}function u(){c+=(t-o)/s,e.scrollLeft=c,++i<s&&(r=S(u))}return u(),l}function he(e,t,n,r){let i,o=d(e),s=o<t,c=n===0?1:Math.round(n*1e3/16),l=(t-o)/c;function u(){a(i)}function f(){o+=l,(s&&o>t||!s&&o<t)&&(o=t),T(e,o),s&&o<t||!s&&o>t?i=S(f):r&&(i=S(r))}return f(),u}function ge(){let e=X([]),t=[];oe(()=>{e.value=[]});let n=n=>(t[n]||(t[n]=t=>{e.value[n]=t}),t[n]);return[e,n]}function _e(e,t){if(!p||!window.IntersectionObserver)return;let n=new IntersectionObserver(e=>{t(e[0].intersectionRatio>0)},{root:document.body}),r=()=>{e.value&&n.observe(e.value)},i=()=>{e.value&&n.unobserve(e.value)};se(i),ae(i),b(r)}const[ve,ye]=s(`sticky`),be={zIndex:y,position:v(`top`),container:Object,offsetTop:g(0),offsetBottom:g(0)};var xe=H({name:ve,props:be,emits:[`scroll`,`change`],setup(e,{emit:t,slots:n}){let r=X(),i=I(r),a=Y({fixed:!1,width:0,height:0,transform:0}),o=X(!1),s=B(()=>D(e.position===`top`?e.offsetTop:e.offsetBottom)),c=B(()=>{if(o.value)return;let{fixed:e,height:t,width:n}=a;if(e)return{width:`${n}px`,height:`${t}px`}}),u=B(()=>{if(!a.fixed||o.value)return;let t=l(f(e.zIndex),{width:`${a.width}px`,height:`${a.height}px`,[e.position]:`${s.value}px`});return a.transform&&(t.transform=`translate3d(0, ${a.transform}px, 0)`),t}),p=e=>t(`scroll`,{scrollTop:e,isFixed:a.fixed}),m=()=>{if(!r.value||h(r))return;let{container:t,position:n}=e,i=F(r),o=d(window);if(a.width=i.width,a.height=i.height,n===`top`)if(t){let e=F(t),n=e.bottom-s.value-a.height;a.fixed=s.value>i.top&&e.bottom>0,a.transform=n<0?n:0}else a.fixed=s.value>i.top;else{let{clientHeight:e}=document.documentElement;if(t){let n=F(t),r=e-n.top-s.value-a.height;a.fixed=e-s.value<i.bottom&&e>n.top,a.transform=r<0?-r:0}else a.fixed=e-s.value<i.bottom}p(o)};return Z(()=>a.fixed,e=>t(`change`,e)),A(`scroll`,m,{target:i,passive:!0}),_e(r,m),Z([re,R],()=>{!r.value||h(r)||!a.fixed||(o.value=!0,G(()=>{let e=F(r);a.width=e.width,a.height=e.height,o.value=!1}))}),()=>{var e;return V(`div`,{ref:r,style:c.value},[V(`div`,{class:ye({fixed:a.fixed&&!o.value}),style:u.value},[(e=n.default)?.call(n)])])}}});const Se=z(xe),[Ce,Q]=s(`swipe`),we={loop:E,width:y,height:y,vertical:Boolean,autoplay:g(0),duration:g(500),touchable:E,lazyRender:Boolean,initialSwipe:g(0),indicatorColor:String,showIndicators:E,stopPropagation:E},Te=Symbol(Ce);var Ee=H({name:Ce,props:we,emits:[`change`,`dragStart`,`dragEnd`],setup(e,{emit:t,slots:n}){let r=X(),i=X(),a=Y({rect:null,width:0,height:0,offset:0,active:0,swiping:!1}),s=!1,l=L(),{children:u,linkChildren:d}=k(Te),f=B(()=>u.length),p=B(()=>a[e.vertical?`height`:`width`]),m=B(()=>e.vertical?l.deltaY.value:l.deltaX.value),g=B(()=>{if(a.rect){let t=e.vertical?a.rect.height:a.rect.width;return t-p.value*f.value}return 0}),_=B(()=>p.value?Math.ce